From 810c3032104d31a6e3fa0311c6837c4b5cace2b7 Mon Sep 17 00:00:00 2001 From: doctorpangloss <@hiddenswitch.com> Date: Wed, 5 Mar 2025 14:05:18 -0800 Subject: [PATCH] Remove web directory from package --- comfy/web/assets/BaseViewTemplate-DaGOaycP.js | 51 - .../assets/BaseViewTemplate-DaGOaycP.js.map | 1 - comfy/web/assets/CREDIT.txt | 1 - comfy/web/assets/DesktopStartView-Dy1mcl-U.js | 19 - .../assets/DesktopStartView-Dy1mcl-U.js.map | 1 - .../web/assets/DesktopUpdateView-CoZUcBzh.css | 20 - .../web/assets/DesktopUpdateView-dW35wQOR.js | 59 - .../assets/DesktopUpdateView-dW35wQOR.js.map | 1 - comfy/web/assets/DownloadGitView-La5U0bHp.js | 58 - .../assets/DownloadGitView-La5U0bHp.js.map | 1 - comfy/web/assets/ExtensionPanel-CSL3CfyH.js | 182 - .../web/assets/ExtensionPanel-CSL3CfyH.js.map | 1 - comfy/web/assets/GraphView-J5fY4zmU.js | 5329 - comfy/web/assets/GraphView-J5fY4zmU.js.map | 1 - comfy/web/assets/GraphView-NWS5Ob8A.css | 404 - comfy/web/assets/InstallView-BwawagSr.js | 971 - comfy/web/assets/InstallView-BwawagSr.js.map | 1 - comfy/web/assets/InstallView-C_PLT5gk.css | 81 - comfy/web/assets/KeybindingPanel-BetULlhU.js | 292 - .../assets/KeybindingPanel-BetULlhU.js.map | 1 - comfy/web/assets/KeybindingPanel-CwPLIgAf.css | 8 - comfy/web/assets/MaintenanceView-BFp9KqAr.js | 770 - .../assets/MaintenanceView-BFp9KqAr.js.map | 1 - comfy/web/assets/MaintenanceView-DSwnnc8G.css | 87 - .../ManualConfigurationView-Cq3hPfap.css | 7 - .../ManualConfigurationView-hsnBcOeR.js | 74 - .../ManualConfigurationView-hsnBcOeR.js.map | 1 - .../web/assets/MetricsConsentView-CVHnHa_u.js | 86 - .../assets/MetricsConsentView-CVHnHa_u.js.map | 1 - .../web/assets/NotSupportedView-BiyVuLfX.css | 19 - comfy/web/assets/NotSupportedView-CMCKSnEd.js | 86 - .../assets/NotSupportedView-CMCKSnEd.js.map | 1 - .../web/assets/ServerConfigPanel-di9WinBR.js | 156 - .../assets/ServerConfigPanel-di9WinBR.js.map | 1 - comfy/web/assets/ServerStartView-BLlSvhJ0.css | 5 - comfy/web/assets/ServerStartView-CvFWnVGg.js | 100 - .../assets/ServerStartView-CvFWnVGg.js.map | 1 - .../assets/TerminalOutputDrawer-B_NZxAv8.js | 676 - .../TerminalOutputDrawer-B_NZxAv8.js.map | 1 - comfy/web/assets/UserSelectView-ByltuBH7.js | 101 - .../web/assets/UserSelectView-ByltuBH7.js.map | 1 - comfy/web/assets/WelcomeView-aCH40CSK.css | 36 - comfy/web/assets/WelcomeView-bWjYcpdL.js | 39 - comfy/web/assets/WelcomeView-bWjYcpdL.js.map | 1 - comfy/web/assets/images/Git-Logo-White.svg | 1 - comfy/web/assets/images/apple-mps-logo.png | Bin 67332 -> 0 bytes .../assets/images/manual-configuration.svg | 5 - comfy/web/assets/images/nvidia-logo.svg | 6 - comfy/web/assets/images/sad_girl.png | Bin 177633 -> 0 bytes comfy/web/assets/index-B8O-6_L7.css | 166 - comfy/web/assets/index-BKScv1mm.js | 539 - comfy/web/assets/index-BKScv1mm.js.map | 1 - comfy/web/assets/index-CE2hpomb.js | 618 - comfy/web/assets/index-CE2hpomb.js.map | 1 - comfy/web/assets/index-C_ACzX5-.js | 392 - comfy/web/assets/index-C_ACzX5-.js.map | 1 - comfy/web/assets/index-CpICyVZm.js | 55774 ---- comfy/web/assets/index-CpICyVZm.js.map | 1 - comfy/web/assets/index-Czd3J-KM.js | 8790 - comfy/web/assets/index-Czd3J-KM.js.map | 1 - comfy/web/assets/index-D8hjiWMw.js | 27 - comfy/web/assets/index-D8hjiWMw.js.map | 1 - comfy/web/assets/index-DIgj6hpb.js | 223630 --------------- comfy/web/assets/index-DIgj6hpb.js.map | 1 - comfy/web/assets/index-DdgRmRKP.js | 4993 - comfy/web/assets/index-DdgRmRKP.js.map | 1 - comfy/web/assets/index-NNVvMeR_.css | 4961 - comfy/web/assets/index-mHcHTYAB.js | 24875 -- comfy/web/assets/index-mHcHTYAB.js.map | 1 - .../web/assets/keybindingService-CqDMAs0_.js | 250 - .../assets/keybindingService-CqDMAs0_.js.map | 1 - comfy/web/assets/primeicons-C6QP2o4f.woff2 | Bin 35148 -> 0 bytes comfy/web/assets/primeicons-DMOk5skT.eot | Bin 85156 -> 0 bytes comfy/web/assets/primeicons-Dr5RGzOO.svg | 345 - comfy/web/assets/primeicons-MpK4pl85.ttf | Bin 84980 -> 0 bytes comfy/web/assets/primeicons-WjwUDZjB.woff | Bin 85056 -> 0 bytes .../web/assets/serverConfigStore-3t3U367D.js | 90 - .../assets/serverConfigStore-3t3U367D.js.map | 1 - comfy/web/assets/sorted-custom-node-map.json | 2602 - comfy/web/assets/uvMirrors-B-HKMf6X.js | 16 - comfy/web/assets/uvMirrors-B-HKMf6X.js.map | 1 - comfy/web/cursor/colorSelect.png | Bin 373 -> 0 bytes comfy/web/cursor/paintBucket.png | Bin 410 -> 0 bytes comfy/web/extensions/.gitignore | 0 comfy/web/extensions/core/clipspace.js | 2 - comfy/web/extensions/core/groupNode.js | 3 - comfy/web/extensions/core/groupNodeManage.js | 2 - .../core/load3d/AnimationManager.js | 2 - .../extensions/core/load3d/CameraManager.js | 2 - .../extensions/core/load3d/ControlsManager.js | 2 - .../extensions/core/load3d/EventManager.js | 2 - .../extensions/core/load3d/LightingManager.js | 2 - .../extensions/core/load3d/LoaderManager.js | 2 - .../extensions/core/load3d/ModelManager.js | 2 - .../web/extensions/core/load3d/NodeStorage.js | 2 - .../extensions/core/load3d/PreviewManager.js | 2 - .../extensions/core/load3d/SceneManager.js | 2 - .../core/load3d/ViewHelperManager.js | 2 - comfy/web/extensions/core/maskEditorOld.js | 2 - comfy/web/extensions/core/widgetInputs.js | 5 - .../fonts/materialdesignicons-webfont.woff2 | Bin 403216 -> 0 bytes comfy/web/index.html | 15 - comfy/web/materialdesignicons.min.css | 3 - comfy/web/scripts/api.js | 3 - comfy/web/scripts/app.js | 4 - comfy/web/scripts/changeTracker.js | 2 - comfy/web/scripts/defaultGraph.js | 4 - comfy/web/scripts/domWidget.js | 2 - comfy/web/scripts/metadata/flac.js | 3 - comfy/web/scripts/metadata/png.js | 3 - comfy/web/scripts/pnginfo.js | 6 - comfy/web/scripts/ui.js | 4 - .../web/scripts/ui/components/asyncDialog.js | 2 - comfy/web/scripts/ui/components/button.js | 2 - .../web/scripts/ui/components/buttonGroup.js | 2 - comfy/web/scripts/ui/components/popup.js | 2 - .../web/scripts/ui/components/splitButton.js | 2 - comfy/web/scripts/ui/dialog.js | 2 - comfy/web/scripts/ui/draggableList.js | 2 - comfy/web/scripts/ui/imagePreview.js | 3 - comfy/web/scripts/ui/menu/index.js | 2 - comfy/web/scripts/ui/settings.js | 2 - comfy/web/scripts/ui/toggleSwitch.js | 2 - comfy/web/scripts/ui/utils.js | 3 - comfy/web/scripts/utils.js | 9 - comfy/web/scripts/widgets.js | 6 - comfy/web/templates/2_pass_pose_worship.json | 673 - comfy/web/templates/area_composition.json | 966 - .../templates/area_composition_reversed.json | 967 - ...a_composition_square_area_for_subject.json | 620 - comfy/web/templates/controlnet_example.json | 385 - comfy/web/templates/default.jpg | Bin 20506 -> 0 bytes comfy/web/templates/default.json | 356 - comfy/web/templates/depth_controlnet.json | 378 - comfy/web/templates/depth_t2i_adapter.json | 371 - comfy/web/templates/embedding_example.json | 267 - comfy/web/templates/esrgan_example.json | 329 - .../templates/flux_canny_model_example.json | 474 - .../templates/flux_depth_lora_example.json | 454 - .../flux_dev_checkpoint_example.json | 332 - comfy/web/templates/flux_dev_example.json | 771 - .../templates/flux_fill_inpaint_example.json | 458 - .../templates/flux_fill_outpaint_example.json | 491 - .../templates/flux_redux_model_example.json | 951 - comfy/web/templates/flux_schnell.jpg | Bin 23789 -> 0 bytes comfy/web/templates/flux_schnell.json | 302 - .../web/templates/gligen_textbox_example.json | 376 - .../templates/hiresfix_esrgan_workflow.json | 607 - .../templates/hiresfix_latent_workflow.json | 442 - .../hunyuan_video_text_to_video.json | 553 - comfy/web/templates/image2image.jpg | Bin 25787 -> 0 bytes comfy/web/templates/image2image.json | 447 - comfy/web/templates/image_to_video.json | 314 - .../templates/inpain_model_outpainting.json | 360 - comfy/web/templates/inpaint_example.json | 323 - ...latent_upscale_different_prompt_model.json | 528 - comfy/web/templates/lora.json | 311 - comfy/web/templates/lora_multiple.json | 357 - comfy/web/templates/ltxv_image_to_video.json | 482 - comfy/web/templates/ltxv_text_to_video.json | 419 - comfy/web/templates/mixing_controlnets.json | 492 - .../mochi_text_to_video_example.json | 308 - .../sd3.5_large_canny_controlnet_example.json | 470 - comfy/web/templates/sd3.5_simple_example.json | 278 - .../sdxl_refiner_prompt_example.json | 728 - .../templates/sdxl_revision_text_prompts.json | 490 - .../sdxl_revision_zero_positive.json | 494 - comfy/web/templates/sdxl_simple_example.json | 896 - comfy/web/templates/sdxlturbo_example.json | 372 - comfy/web/templates/stable_audio_example.json | 302 - .../web/templates/stable_zero123_example.json | 273 - .../web/templates/txt_to_image_to_video.json | 535 - comfy/web/templates/upscale.jpg | Bin 30593 -> 0 bytes comfy/web/user.css | 1 - 174 files changed, 358655 deletions(-) delete mode 100644 comfy/web/assets/BaseViewTemplate-DaGOaycP.js delete mode 100644 comfy/web/assets/BaseViewTemplate-DaGOaycP.js.map delete mode 100644 comfy/web/assets/CREDIT.txt delete mode 100644 comfy/web/assets/DesktopStartView-Dy1mcl-U.js delete mode 100644 comfy/web/assets/DesktopStartView-Dy1mcl-U.js.map delete mode 100644 comfy/web/assets/DesktopUpdateView-CoZUcBzh.css delete mode 100644 comfy/web/assets/DesktopUpdateView-dW35wQOR.js delete mode 100644 comfy/web/assets/DesktopUpdateView-dW35wQOR.js.map delete mode 100644 comfy/web/assets/DownloadGitView-La5U0bHp.js delete mode 100644 comfy/web/assets/DownloadGitView-La5U0bHp.js.map delete mode 100644 comfy/web/assets/ExtensionPanel-CSL3CfyH.js delete mode 100644 comfy/web/assets/ExtensionPanel-CSL3CfyH.js.map delete mode 100644 comfy/web/assets/GraphView-J5fY4zmU.js delete mode 100644 comfy/web/assets/GraphView-J5fY4zmU.js.map delete mode 100644 comfy/web/assets/GraphView-NWS5Ob8A.css delete mode 100644 comfy/web/assets/InstallView-BwawagSr.js delete mode 100644 comfy/web/assets/InstallView-BwawagSr.js.map delete mode 100644 comfy/web/assets/InstallView-C_PLT5gk.css delete mode 100644 comfy/web/assets/KeybindingPanel-BetULlhU.js delete mode 100644 comfy/web/assets/KeybindingPanel-BetULlhU.js.map delete mode 100644 comfy/web/assets/KeybindingPanel-CwPLIgAf.css delete mode 100644 comfy/web/assets/MaintenanceView-BFp9KqAr.js delete mode 100644 comfy/web/assets/MaintenanceView-BFp9KqAr.js.map delete mode 100644 comfy/web/assets/MaintenanceView-DSwnnc8G.css delete mode 100644 comfy/web/assets/ManualConfigurationView-Cq3hPfap.css delete mode 100644 comfy/web/assets/ManualConfigurationView-hsnBcOeR.js delete mode 100644 comfy/web/assets/ManualConfigurationView-hsnBcOeR.js.map delete mode 100644 comfy/web/assets/MetricsConsentView-CVHnHa_u.js delete mode 100644 comfy/web/assets/MetricsConsentView-CVHnHa_u.js.map delete mode 100644 comfy/web/assets/NotSupportedView-BiyVuLfX.css delete mode 100644 comfy/web/assets/NotSupportedView-CMCKSnEd.js delete mode 100644 comfy/web/assets/NotSupportedView-CMCKSnEd.js.map delete mode 100644 comfy/web/assets/ServerConfigPanel-di9WinBR.js delete mode 100644 comfy/web/assets/ServerConfigPanel-di9WinBR.js.map delete mode 100644 comfy/web/assets/ServerStartView-BLlSvhJ0.css delete mode 100644 comfy/web/assets/ServerStartView-CvFWnVGg.js delete mode 100644 comfy/web/assets/ServerStartView-CvFWnVGg.js.map delete mode 100644 comfy/web/assets/TerminalOutputDrawer-B_NZxAv8.js delete mode 100644 comfy/web/assets/TerminalOutputDrawer-B_NZxAv8.js.map delete mode 100644 comfy/web/assets/UserSelectView-ByltuBH7.js delete mode 100644 comfy/web/assets/UserSelectView-ByltuBH7.js.map delete mode 100644 comfy/web/assets/WelcomeView-aCH40CSK.css delete mode 100644 comfy/web/assets/WelcomeView-bWjYcpdL.js delete mode 100644 comfy/web/assets/WelcomeView-bWjYcpdL.js.map delete mode 100644 comfy/web/assets/images/Git-Logo-White.svg delete mode 100644 comfy/web/assets/images/apple-mps-logo.png delete mode 100644 comfy/web/assets/images/manual-configuration.svg delete mode 100644 comfy/web/assets/images/nvidia-logo.svg delete mode 100644 comfy/web/assets/images/sad_girl.png delete mode 100644 comfy/web/assets/index-B8O-6_L7.css delete mode 100644 comfy/web/assets/index-BKScv1mm.js delete mode 100644 comfy/web/assets/index-BKScv1mm.js.map delete mode 100644 comfy/web/assets/index-CE2hpomb.js delete mode 100644 comfy/web/assets/index-CE2hpomb.js.map delete mode 100644 comfy/web/assets/index-C_ACzX5-.js delete mode 100644 comfy/web/assets/index-C_ACzX5-.js.map delete mode 100644 comfy/web/assets/index-CpICyVZm.js delete mode 100644 comfy/web/assets/index-CpICyVZm.js.map delete mode 100644 comfy/web/assets/index-Czd3J-KM.js delete mode 100644 comfy/web/assets/index-Czd3J-KM.js.map delete mode 100644 comfy/web/assets/index-D8hjiWMw.js delete mode 100644 comfy/web/assets/index-D8hjiWMw.js.map delete mode 100644 comfy/web/assets/index-DIgj6hpb.js delete mode 100644 comfy/web/assets/index-DIgj6hpb.js.map delete mode 100644 comfy/web/assets/index-DdgRmRKP.js delete mode 100644 comfy/web/assets/index-DdgRmRKP.js.map delete mode 100644 comfy/web/assets/index-NNVvMeR_.css delete mode 100644 comfy/web/assets/index-mHcHTYAB.js delete mode 100644 comfy/web/assets/index-mHcHTYAB.js.map delete mode 100644 comfy/web/assets/keybindingService-CqDMAs0_.js delete mode 100644 comfy/web/assets/keybindingService-CqDMAs0_.js.map delete mode 100644 comfy/web/assets/primeicons-C6QP2o4f.woff2 delete mode 100644 comfy/web/assets/primeicons-DMOk5skT.eot delete mode 100644 comfy/web/assets/primeicons-Dr5RGzOO.svg delete mode 100644 comfy/web/assets/primeicons-MpK4pl85.ttf delete mode 100644 comfy/web/assets/primeicons-WjwUDZjB.woff delete mode 100644 comfy/web/assets/serverConfigStore-3t3U367D.js delete mode 100644 comfy/web/assets/serverConfigStore-3t3U367D.js.map delete mode 100644 comfy/web/assets/sorted-custom-node-map.json delete mode 100644 comfy/web/assets/uvMirrors-B-HKMf6X.js delete mode 100644 comfy/web/assets/uvMirrors-B-HKMf6X.js.map delete mode 100644 comfy/web/cursor/colorSelect.png delete mode 100644 comfy/web/cursor/paintBucket.png delete mode 100644 comfy/web/extensions/.gitignore delete mode 100644 comfy/web/extensions/core/clipspace.js delete mode 100644 comfy/web/extensions/core/groupNode.js delete mode 100644 comfy/web/extensions/core/groupNodeManage.js delete mode 100644 comfy/web/extensions/core/load3d/AnimationManager.js delete mode 100644 comfy/web/extensions/core/load3d/CameraManager.js delete mode 100644 comfy/web/extensions/core/load3d/ControlsManager.js delete mode 100644 comfy/web/extensions/core/load3d/EventManager.js delete mode 100644 comfy/web/extensions/core/load3d/LightingManager.js delete mode 100644 comfy/web/extensions/core/load3d/LoaderManager.js delete mode 100644 comfy/web/extensions/core/load3d/ModelManager.js delete mode 100644 comfy/web/extensions/core/load3d/NodeStorage.js delete mode 100644 comfy/web/extensions/core/load3d/PreviewManager.js delete mode 100644 comfy/web/extensions/core/load3d/SceneManager.js delete mode 100644 comfy/web/extensions/core/load3d/ViewHelperManager.js delete mode 100644 comfy/web/extensions/core/maskEditorOld.js delete mode 100644 comfy/web/extensions/core/widgetInputs.js delete mode 100644 comfy/web/fonts/materialdesignicons-webfont.woff2 delete mode 100644 comfy/web/index.html delete mode 100644 comfy/web/materialdesignicons.min.css delete mode 100644 comfy/web/scripts/api.js delete mode 100644 comfy/web/scripts/app.js delete mode 100644 comfy/web/scripts/changeTracker.js delete mode 100644 comfy/web/scripts/defaultGraph.js delete mode 100644 comfy/web/scripts/domWidget.js delete mode 100644 comfy/web/scripts/metadata/flac.js delete mode 100644 comfy/web/scripts/metadata/png.js delete mode 100644 comfy/web/scripts/pnginfo.js delete mode 100644 comfy/web/scripts/ui.js delete mode 100644 comfy/web/scripts/ui/components/asyncDialog.js delete mode 100644 comfy/web/scripts/ui/components/button.js delete mode 100644 comfy/web/scripts/ui/components/buttonGroup.js delete mode 100644 comfy/web/scripts/ui/components/popup.js delete mode 100644 comfy/web/scripts/ui/components/splitButton.js delete mode 100644 comfy/web/scripts/ui/dialog.js delete mode 100644 comfy/web/scripts/ui/draggableList.js delete mode 100644 comfy/web/scripts/ui/imagePreview.js delete mode 100644 comfy/web/scripts/ui/menu/index.js delete mode 100644 comfy/web/scripts/ui/settings.js delete mode 100644 comfy/web/scripts/ui/toggleSwitch.js delete mode 100644 comfy/web/scripts/ui/utils.js delete mode 100644 comfy/web/scripts/utils.js delete mode 100644 comfy/web/scripts/widgets.js delete mode 100644 comfy/web/templates/2_pass_pose_worship.json delete mode 100644 comfy/web/templates/area_composition.json delete mode 100644 comfy/web/templates/area_composition_reversed.json delete mode 100644 comfy/web/templates/area_composition_square_area_for_subject.json delete mode 100644 comfy/web/templates/controlnet_example.json delete mode 100644 comfy/web/templates/default.jpg delete mode 100644 comfy/web/templates/default.json delete mode 100644 comfy/web/templates/depth_controlnet.json delete mode 100644 comfy/web/templates/depth_t2i_adapter.json delete mode 100644 comfy/web/templates/embedding_example.json delete mode 100644 comfy/web/templates/esrgan_example.json delete mode 100644 comfy/web/templates/flux_canny_model_example.json delete mode 100644 comfy/web/templates/flux_depth_lora_example.json delete mode 100644 comfy/web/templates/flux_dev_checkpoint_example.json delete mode 100644 comfy/web/templates/flux_dev_example.json delete mode 100644 comfy/web/templates/flux_fill_inpaint_example.json delete mode 100644 comfy/web/templates/flux_fill_outpaint_example.json delete mode 100644 comfy/web/templates/flux_redux_model_example.json delete mode 100644 comfy/web/templates/flux_schnell.jpg delete mode 100644 comfy/web/templates/flux_schnell.json delete mode 100644 comfy/web/templates/gligen_textbox_example.json delete mode 100644 comfy/web/templates/hiresfix_esrgan_workflow.json delete mode 100644 comfy/web/templates/hiresfix_latent_workflow.json delete mode 100644 comfy/web/templates/hunyuan_video_text_to_video.json delete mode 100644 comfy/web/templates/image2image.jpg delete mode 100644 comfy/web/templates/image2image.json delete mode 100644 comfy/web/templates/image_to_video.json delete mode 100644 comfy/web/templates/inpain_model_outpainting.json delete mode 100644 comfy/web/templates/inpaint_example.json delete mode 100644 comfy/web/templates/latent_upscale_different_prompt_model.json delete mode 100644 comfy/web/templates/lora.json delete mode 100644 comfy/web/templates/lora_multiple.json delete mode 100644 comfy/web/templates/ltxv_image_to_video.json delete mode 100644 comfy/web/templates/ltxv_text_to_video.json delete mode 100644 comfy/web/templates/mixing_controlnets.json delete mode 100644 comfy/web/templates/mochi_text_to_video_example.json delete mode 100644 comfy/web/templates/sd3.5_large_canny_controlnet_example.json delete mode 100644 comfy/web/templates/sd3.5_simple_example.json delete mode 100644 comfy/web/templates/sdxl_refiner_prompt_example.json delete mode 100644 comfy/web/templates/sdxl_revision_text_prompts.json delete mode 100644 comfy/web/templates/sdxl_revision_zero_positive.json delete mode 100644 comfy/web/templates/sdxl_simple_example.json delete mode 100644 comfy/web/templates/sdxlturbo_example.json delete mode 100644 comfy/web/templates/stable_audio_example.json delete mode 100644 comfy/web/templates/stable_zero123_example.json delete mode 100644 comfy/web/templates/txt_to_image_to_video.json delete mode 100644 comfy/web/templates/upscale.jpg delete mode 100644 comfy/web/user.css diff --git a/comfy/web/assets/BaseViewTemplate-DaGOaycP.js b/comfy/web/assets/BaseViewTemplate-DaGOaycP.js deleted file mode 100644 index 6b36a4853..000000000 --- a/comfy/web/assets/BaseViewTemplate-DaGOaycP.js +++ /dev/null @@ -1,51 +0,0 @@ -import { d as defineComponent, T as ref, p as onMounted, bh as isElectron, V as nextTick, bi as electronAPI, o as openBlock, f as createElementBlock, i as withDirectives, v as vShow, j as unref, bj as isNativeWindow, m as createBaseVNode, A as renderSlot, Z as normalizeClass } from "./index-DIgj6hpb.js"; -const _hoisted_1 = { class: "flex-grow w-full flex items-center justify-center overflow-auto" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "BaseViewTemplate", - props: { - dark: { type: Boolean, default: false } - }, - setup(__props) { - const props = __props; - const darkTheme = { - color: "rgba(0, 0, 0, 0)", - symbolColor: "#d4d4d4" - }; - const lightTheme = { - color: "rgba(0, 0, 0, 0)", - symbolColor: "#171717" - }; - const topMenuRef = ref(null); - onMounted(async () => { - if (isElectron()) { - await nextTick(); - electronAPI().changeTheme({ - ...props.dark ? darkTheme : lightTheme, - height: topMenuRef.value.getBoundingClientRect().height - }); - } - }); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div", { - class: normalizeClass(["font-sans w-screen h-screen flex flex-col", [ - props.dark ? "text-neutral-300 bg-neutral-900 dark-theme" : "text-neutral-900 bg-neutral-300" - ]]) - }, [ - withDirectives(createBaseVNode("div", { - ref_key: "topMenuRef", - ref: topMenuRef, - class: "app-drag w-full h-[var(--comfy-topbar-height)]" - }, null, 512), [ - [vShow, unref(isNativeWindow)()] - ]), - createBaseVNode("div", _hoisted_1, [ - renderSlot(_ctx.$slots, "default") - ]) - ], 2); - }; - } -}); -export { - _sfc_main as _ -}; -//# sourceMappingURL=BaseViewTemplate-DaGOaycP.js.map diff --git a/comfy/web/assets/BaseViewTemplate-DaGOaycP.js.map b/comfy/web/assets/BaseViewTemplate-DaGOaycP.js.map deleted file mode 100644 index 99eb5d6c4..000000000 --- a/comfy/web/assets/BaseViewTemplate-DaGOaycP.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"BaseViewTemplate-DaGOaycP.js","sources":["../../src/views/templates/BaseViewTemplate.vue"],"sourcesContent":["\n\n\n"],"names":[],"mappings":";;;;;;;;AA4BA,UAAM,QAAQ;AASd,UAAM,YAAY;AAAA,MAChB,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAEA,UAAM,aAAa;AAAA,MACjB,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAEM,UAAA,aAAa,IAA2B,IAAI;AAClD,cAAU,YAAY;AACpB,UAAI,cAAc;AAChB,cAAM,SAAS;AAEf,oBAAA,EAAc,YAAY;AAAA,UACxB,GAAI,MAAM,OAAO,YAAY;AAAA,UAC7B,QAAQ,WAAW,MAAM,wBAAwB;AAAA,QAAA,CAClD;AAAA,MAAA;AAAA,IACH,CACD;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/CREDIT.txt b/comfy/web/assets/CREDIT.txt deleted file mode 100644 index b3a9bc906..000000000 --- a/comfy/web/assets/CREDIT.txt +++ /dev/null @@ -1 +0,0 @@ -Thanks to OpenArt (https://openart.ai) for providing the sorted-custom-node-map data, captured in September 2024. \ No newline at end of file diff --git a/comfy/web/assets/DesktopStartView-Dy1mcl-U.js b/comfy/web/assets/DesktopStartView-Dy1mcl-U.js deleted file mode 100644 index c20fa585d..000000000 --- a/comfy/web/assets/DesktopStartView-Dy1mcl-U.js +++ /dev/null @@ -1,19 +0,0 @@ -import { d as defineComponent, o as openBlock, y as createBlock, z as withCtx, k as createVNode, j as unref, bN as script } from "./index-DIgj6hpb.js"; -import { _ as _sfc_main$1 } from "./BaseViewTemplate-DaGOaycP.js"; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "DesktopStartView", - setup(__props) { - return (_ctx, _cache) => { - return openBlock(), createBlock(_sfc_main$1, { dark: "" }, { - default: withCtx(() => [ - createVNode(unref(script), { class: "m-8 w-48 h-48" }) - ]), - _: 1 - }); - }; - } -}); -export { - _sfc_main as default -}; -//# sourceMappingURL=DesktopStartView-Dy1mcl-U.js.map diff --git a/comfy/web/assets/DesktopStartView-Dy1mcl-U.js.map b/comfy/web/assets/DesktopStartView-Dy1mcl-U.js.map deleted file mode 100644 index f9d1dcc88..000000000 --- a/comfy/web/assets/DesktopStartView-Dy1mcl-U.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DesktopStartView-Dy1mcl-U.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/DesktopUpdateView-CoZUcBzh.css b/comfy/web/assets/DesktopUpdateView-CoZUcBzh.css deleted file mode 100644 index e85cbfae6..000000000 --- a/comfy/web/assets/DesktopUpdateView-CoZUcBzh.css +++ /dev/null @@ -1,20 +0,0 @@ - -.download-bg[data-v-8d77828d]::before { - position: absolute; - margin: 0px; - color: var(--p-text-muted-color); - font-family: 'primeicons'; - top: -2rem; - right: 2rem; - speak: none; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - display: inline-block; - -webkit-font-smoothing: antialiased; - opacity: 0.02; - font-size: min(14rem, 90vw); - z-index: 0 -} diff --git a/comfy/web/assets/DesktopUpdateView-dW35wQOR.js b/comfy/web/assets/DesktopUpdateView-dW35wQOR.js deleted file mode 100644 index f21b86db7..000000000 --- a/comfy/web/assets/DesktopUpdateView-dW35wQOR.js +++ /dev/null @@ -1,59 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { d as defineComponent, T as ref, bU as onUnmounted, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, j as unref, bp as t, k as createVNode, bN as script, l as script$1, bi as electronAPI, _ as _export_sfc } from "./index-DIgj6hpb.js"; -import { s as script$2 } from "./index-CE2hpomb.js"; -import { _ as _sfc_main$1 } from "./TerminalOutputDrawer-B_NZxAv8.js"; -import { _ as _sfc_main$2 } from "./BaseViewTemplate-DaGOaycP.js"; -import "./index-C_ACzX5-.js"; -const _hoisted_1 = { class: "h-screen w-screen grid items-center justify-around overflow-y-auto" }; -const _hoisted_2 = { class: "relative m-8 text-center" }; -const _hoisted_3 = { class: "download-bg pi-download text-4xl font-bold" }; -const _hoisted_4 = { class: "m-8" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "DesktopUpdateView", - setup(__props) { - const electron = electronAPI(); - const terminalVisible = ref(false); - const toggleConsoleDrawer = /* @__PURE__ */ __name(() => { - terminalVisible.value = !terminalVisible.value; - }, "toggleConsoleDrawer"); - onUnmounted(() => electron.Validation.dispose()); - return (_ctx, _cache) => { - return openBlock(), createBlock(_sfc_main$2, { dark: "" }, { - default: withCtx(() => [ - createBaseVNode("div", _hoisted_1, [ - createBaseVNode("div", _hoisted_2, [ - createBaseVNode("h1", _hoisted_3, toDisplayString(unref(t)("desktopUpdate.title")), 1), - createBaseVNode("div", _hoisted_4, [ - createBaseVNode("span", null, toDisplayString(unref(t)("desktopUpdate.description")), 1) - ]), - createVNode(unref(script), { class: "m-8 w-48 h-48" }), - createVNode(unref(script$1), { - style: { "transform": "translateX(-50%)" }, - class: "fixed bottom-0 left-1/2 my-8", - label: unref(t)("maintenance.consoleLogs"), - icon: "pi pi-desktop", - "icon-pos": "left", - severity: "secondary", - onClick: toggleConsoleDrawer - }, null, 8, ["label"]), - createVNode(_sfc_main$1, { - modelValue: terminalVisible.value, - "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => terminalVisible.value = $event), - header: unref(t)("g.terminal"), - "default-message": unref(t)("desktopUpdate.terminalDefaultMessage") - }, null, 8, ["modelValue", "header", "default-message"]) - ]) - ]), - createVNode(unref(script$2)) - ]), - _: 1 - }); - }; - } -}); -const DesktopUpdateView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8d77828d"]]); -export { - DesktopUpdateView as default -}; -//# sourceMappingURL=DesktopUpdateView-dW35wQOR.js.map diff --git a/comfy/web/assets/DesktopUpdateView-dW35wQOR.js.map b/comfy/web/assets/DesktopUpdateView-dW35wQOR.js.map deleted file mode 100644 index c43896602..000000000 --- a/comfy/web/assets/DesktopUpdateView-dW35wQOR.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DesktopUpdateView-dW35wQOR.js","sources":["../../src/views/DesktopUpdateView.vue"],"sourcesContent":["\n\n\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAmDA,UAAM,WAAW,YAAY;AAEvB,UAAA,kBAAkB,IAAI,KAAK;AAEjC,UAAM,sBAAsB,6BAAM;AAChB,sBAAA,QAAQ,CAAC,gBAAgB;AAAA,IAC3C,GAF4B;AAI5B,gBAAY,MAAM,SAAS,WAAW,QAAA,CAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/DownloadGitView-La5U0bHp.js b/comfy/web/assets/DownloadGitView-La5U0bHp.js deleted file mode 100644 index f8238cefa..000000000 --- a/comfy/web/assets/DownloadGitView-La5U0bHp.js +++ /dev/null @@ -1,58 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { d as defineComponent, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, k as createVNode, j as unref, l as script, br as useRouter } from "./index-DIgj6hpb.js"; -import { _ as _sfc_main$1 } from "./BaseViewTemplate-DaGOaycP.js"; -const _hoisted_1 = { class: "max-w-screen-sm flex flex-col gap-8 p-8 bg-[url('/assets/images/Git-Logo-White.svg')] bg-no-repeat bg-right-top bg-origin-padding" }; -const _hoisted_2 = { class: "mt-24 text-4xl font-bold text-red-500" }; -const _hoisted_3 = { class: "space-y-4" }; -const _hoisted_4 = { class: "text-xl" }; -const _hoisted_5 = { class: "text-xl" }; -const _hoisted_6 = { class: "text-m" }; -const _hoisted_7 = { class: "flex gap-4 flex-row-reverse" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "DownloadGitView", - setup(__props) { - const openGitDownloads = /* @__PURE__ */ __name(() => { - window.open("https://git-scm.com/downloads/", "_blank"); - }, "openGitDownloads"); - const skipGit = /* @__PURE__ */ __name(() => { - console.warn("pushing"); - const router = useRouter(); - router.push("install"); - }, "skipGit"); - return (_ctx, _cache) => { - return openBlock(), createBlock(_sfc_main$1, null, { - default: withCtx(() => [ - createBaseVNode("div", _hoisted_1, [ - createBaseVNode("h1", _hoisted_2, toDisplayString(_ctx.$t("downloadGit.title")), 1), - createBaseVNode("div", _hoisted_3, [ - createBaseVNode("p", _hoisted_4, toDisplayString(_ctx.$t("downloadGit.message")), 1), - createBaseVNode("p", _hoisted_5, toDisplayString(_ctx.$t("downloadGit.instructions")), 1), - createBaseVNode("p", _hoisted_6, toDisplayString(_ctx.$t("downloadGit.warning")), 1) - ]), - createBaseVNode("div", _hoisted_7, [ - createVNode(unref(script), { - label: _ctx.$t("downloadGit.gitWebsite"), - icon: "pi pi-external-link", - "icon-pos": "right", - onClick: openGitDownloads, - severity: "primary" - }, null, 8, ["label"]), - createVNode(unref(script), { - label: _ctx.$t("downloadGit.skip"), - icon: "pi pi-exclamation-triangle", - onClick: skipGit, - severity: "secondary" - }, null, 8, ["label"]) - ]) - ]) - ]), - _: 1 - }); - }; - } -}); -export { - _sfc_main as default -}; -//# sourceMappingURL=DownloadGitView-La5U0bHp.js.map diff --git a/comfy/web/assets/DownloadGitView-La5U0bHp.js.map b/comfy/web/assets/DownloadGitView-La5U0bHp.js.map deleted file mode 100644 index fa1f34eda..000000000 --- a/comfy/web/assets/DownloadGitView-La5U0bHp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DownloadGitView-La5U0bHp.js","sources":["../../src/views/DownloadGitView.vue"],"sourcesContent":["\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAiDA,UAAM,mBAAmB,6BAAM;AACtB,aAAA,KAAK,kCAAkC,QAAQ;AAAA,IACxD,GAFyB;AAIzB,UAAM,UAAU,6BAAM;AACpB,cAAQ,KAAK,SAAS;AACtB,YAAM,SAAS,UAAU;AACzB,aAAO,KAAK,SAAS;AAAA,IACvB,GAJgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/ExtensionPanel-CSL3CfyH.js b/comfy/web/assets/ExtensionPanel-CSL3CfyH.js deleted file mode 100644 index 444ab8571..000000000 --- a/comfy/web/assets/ExtensionPanel-CSL3CfyH.js +++ /dev/null @@ -1,182 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { d as defineComponent, T as ref, dI as FilterMatchMode, dN as useExtensionStore, a as useSettingStore, p as onMounted, c as computed, o as openBlock, y as createBlock, z as withCtx, k as createVNode, dJ as SearchBox, j as unref, bw as script, m as createBaseVNode, f as createElementBlock, D as renderList, E as toDisplayString, ak as createTextVNode, F as Fragment, l as script$1, B as createCommentVNode, ah as script$3, aI as script$4, bA as script$5, dK as _sfc_main$1 } from "./index-DIgj6hpb.js"; -import { g as script$2, h as script$6 } from "./index-Czd3J-KM.js"; -import "./index-D8hjiWMw.js"; -const _hoisted_1 = { class: "flex justify-end" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "ExtensionPanel", - setup(__props) { - const filters = ref({ - global: { value: "", matchMode: FilterMatchMode.CONTAINS } - }); - const extensionStore = useExtensionStore(); - const settingStore = useSettingStore(); - const editingEnabledExtensions = ref({}); - onMounted(() => { - extensionStore.extensions.forEach((ext) => { - editingEnabledExtensions.value[ext.name] = extensionStore.isExtensionEnabled(ext.name); - }); - }); - const changedExtensions = computed(() => { - return extensionStore.extensions.filter( - (ext) => editingEnabledExtensions.value[ext.name] !== extensionStore.isExtensionEnabled(ext.name) - ); - }); - const hasChanges = computed(() => { - return changedExtensions.value.length > 0; - }); - const updateExtensionStatus = /* @__PURE__ */ __name(() => { - const editingDisabledExtensionNames = Object.entries( - editingEnabledExtensions.value - ).filter(([_, enabled]) => !enabled).map(([name]) => name); - settingStore.set("Comfy.Extension.Disabled", [ - ...extensionStore.inactiveDisabledExtensionNames, - ...editingDisabledExtensionNames - ]); - }, "updateExtensionStatus"); - const enableAllExtensions = /* @__PURE__ */ __name(() => { - extensionStore.extensions.forEach((ext) => { - if (extensionStore.isExtensionReadOnly(ext.name)) return; - editingEnabledExtensions.value[ext.name] = true; - }); - updateExtensionStatus(); - }, "enableAllExtensions"); - const disableAllExtensions = /* @__PURE__ */ __name(() => { - extensionStore.extensions.forEach((ext) => { - if (extensionStore.isExtensionReadOnly(ext.name)) return; - editingEnabledExtensions.value[ext.name] = false; - }); - updateExtensionStatus(); - }, "disableAllExtensions"); - const disableThirdPartyExtensions = /* @__PURE__ */ __name(() => { - extensionStore.extensions.forEach((ext) => { - if (extensionStore.isCoreExtension(ext.name)) return; - editingEnabledExtensions.value[ext.name] = false; - }); - updateExtensionStatus(); - }, "disableThirdPartyExtensions"); - const applyChanges = /* @__PURE__ */ __name(() => { - window.location.reload(); - }, "applyChanges"); - const menu = ref(); - const contextMenuItems = [ - { - label: "Enable All", - icon: "pi pi-check", - command: enableAllExtensions - }, - { - label: "Disable All", - icon: "pi pi-times", - command: disableAllExtensions - }, - { - label: "Disable 3rd Party", - icon: "pi pi-times", - command: disableThirdPartyExtensions, - disabled: !extensionStore.hasThirdPartyExtensions - } - ]; - return (_ctx, _cache) => { - return openBlock(), createBlock(_sfc_main$1, { - value: "Extension", - class: "extension-panel" - }, { - header: withCtx(() => [ - createVNode(SearchBox, { - modelValue: filters.value["global"].value, - "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filters.value["global"].value = $event), - placeholder: _ctx.$t("g.searchExtensions") + "..." - }, null, 8, ["modelValue", "placeholder"]), - hasChanges.value ? (openBlock(), createBlock(unref(script), { - key: 0, - severity: "info", - "pt:text": "w-full", - class: "max-h-96 overflow-y-auto" - }, { - default: withCtx(() => [ - createBaseVNode("ul", null, [ - (openBlock(true), createElementBlock(Fragment, null, renderList(changedExtensions.value, (ext) => { - return openBlock(), createElementBlock("li", { - key: ext.name - }, [ - createBaseVNode("span", null, toDisplayString(unref(extensionStore).isExtensionEnabled(ext.name) ? "[-]" : "[+]"), 1), - createTextVNode(" " + toDisplayString(ext.name), 1) - ]); - }), 128)) - ]), - createBaseVNode("div", _hoisted_1, [ - createVNode(unref(script$1), { - label: _ctx.$t("g.reloadToApplyChanges"), - onClick: applyChanges, - outlined: "", - severity: "danger" - }, null, 8, ["label"]) - ]) - ]), - _: 1 - })) : createCommentVNode("", true) - ]), - default: withCtx(() => [ - createVNode(unref(script$6), { - value: unref(extensionStore).extensions, - stripedRows: "", - size: "small", - filters: filters.value - }, { - default: withCtx(() => [ - createVNode(unref(script$2), { - header: _ctx.$t("g.extensionName"), - sortable: "", - field: "name" - }, { - body: withCtx((slotProps) => [ - createTextVNode(toDisplayString(slotProps.data.name) + " ", 1), - unref(extensionStore).isCoreExtension(slotProps.data.name) ? (openBlock(), createBlock(unref(script$3), { - key: 0, - value: "Core" - })) : createCommentVNode("", true) - ]), - _: 1 - }, 8, ["header"]), - createVNode(unref(script$2), { pt: { - headerCell: "flex items-center justify-end", - bodyCell: "flex items-center justify-end" - } }, { - header: withCtx(() => [ - createVNode(unref(script$1), { - icon: "pi pi-ellipsis-h", - text: "", - severity: "secondary", - onClick: _cache[1] || (_cache[1] = ($event) => menu.value.show($event)) - }), - createVNode(unref(script$4), { - ref_key: "menu", - ref: menu, - model: contextMenuItems - }, null, 512) - ]), - body: withCtx((slotProps) => [ - createVNode(unref(script$5), { - disabled: unref(extensionStore).isExtensionReadOnly(slotProps.data.name), - modelValue: editingEnabledExtensions.value[slotProps.data.name], - "onUpdate:modelValue": /* @__PURE__ */ __name(($event) => editingEnabledExtensions.value[slotProps.data.name] = $event, "onUpdate:modelValue"), - onChange: updateExtensionStatus - }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue"]) - ]), - _: 1 - }) - ]), - _: 1 - }, 8, ["value", "filters"]) - ]), - _: 1 - }); - }; - } -}); -export { - _sfc_main as default -}; -//# sourceMappingURL=ExtensionPanel-CSL3CfyH.js.map diff --git a/comfy/web/assets/ExtensionPanel-CSL3CfyH.js.map b/comfy/web/assets/ExtensionPanel-CSL3CfyH.js.map deleted file mode 100644 index b8caa8fea..000000000 --- a/comfy/web/assets/ExtensionPanel-CSL3CfyH.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":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AAM;AAClB,qBAAA,WAAW,QAAQ,CAAC,QAAQ;AACzC,YAAI,eAAe,oBAAoB,IAAI,IAAI,EAAG;AAEzB,iCAAA,MAAM,IAAI,IAAI,IAAI;AAAA,MAAA,CAC5C;AACqB,4BAAA;AAAA,IACxB,GAP6B;AAS7B,UAAM,8BAA8B,6BAAM;AACzB,qBAAA,WAAW,QAAQ,CAAC,QAAQ;AACzC,YAAI,eAAe,gBAAgB,IAAI,IAAI,EAAG;AAErB,iCAAA,MAAM,IAAI,IAAI,IAAI;AAAA,MAAA,CAC5C;AACqB,4BAAA;AAAA,IACxB,GAPoC;AASpC,UAAM,eAAe,6BAAM;AAEzB,aAAO,SAAS,OAAO;AAAA,IACzB,GAHqB;AAKrB,UAAM,OAAO,IAAsC;AACnD,UAAM,mBAAmB;AAAA,MACvB;AAAA,QACE,OAAO;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,MACA;AAAA,QACE,OAAO;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,MACA;AAAA,QACE,OAAO;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,UAAU,CAAC,eAAe;AAAA,MAAA;AAAA,IAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/GraphView-J5fY4zmU.js b/comfy/web/assets/GraphView-J5fY4zmU.js deleted file mode 100644 index 6b5cf2f90..000000000 --- a/comfy/web/assets/GraphView-J5fY4zmU.js +++ /dev/null @@ -1,5329 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { d as defineComponent, u as useExecutionStore, c as computed, a as useSettingStore, b as useWorkflowStore, e as useTitle, o as openBlock, f as createElementBlock, g as useWorkspaceStore, w as watchEffect, h as app, r as resolveDirective, i as withDirectives, v as vShow, j as unref, k as createVNode, s as showNativeSystemMenu, l as script, m as createBaseVNode, n as normalizeStyle, _ as _export_sfc, p as onMounted, q as onBeforeUnmount, t as useSidebarTabStore, x as useBottomPanelStore, y as createBlock, z as withCtx, A as renderSlot, B as createCommentVNode, C as resolveDynamicComponent, F as Fragment, D as renderList, E as toDisplayString, G as script$5, H as markRaw, I as useI18n, J as useCommandStore, K as useCanvasStore, L as LiteGraph, M as useColorPaletteStore, N as watch, O as useNodeDefStore, P as BadgePosition, Q as LGraphBadge, R as _, S as NodeBadgeMode, T as ref, U as useEventListener, V as nextTick, W as st, X as normalizeI18nKey, Y as useChainCallback, Z as normalizeClass, $ as createBounds, a0 as LGraphCanvas, a1 as getItemsColorOption, a2 as script$7, a3 as adjustColor, a4 as isColorable, a5 as isLGraphNode, a6 as useExtensionService, a7 as isLGraphGroup, a8 as script$8, a9 as useTitleEditorStore, aa as LGraphGroup, ab as LGraphNode, ac as EditableText, ad as defineStore, ae as useNodeFrequencyStore, af as useNodeBookmarkStore, ag as highlightQuery, ah as script$a, ai as formatNumberWithSuffix, aj as NodeSourceType, ak as createTextVNode, al as script$b, am as NodePreview, an as NodeSearchFilter, ao as script$c, ap as SearchFilterChip, aq as useLitegraphService, ar as storeToRefs, as as isRef, at as toRaw, au as LinkReleaseTriggerAction, av as useUserStore, aw as useDialogStore, ax as SettingDialogHeader, ay as SettingDialogContent, az as useKeybindingStore, aA as Teleport, aB as usePragmaticDraggable, aC as usePragmaticDroppable, aD as withModifiers, aE as mergeProps, aF as useWorkflowService, aG as useWorkflowBookmarkStore, aH as script$e, aI as script$f, aJ as useModelToNodeStore, aK as ComfyNodeDefImpl, aL as ComfyModelDef, aM as ComfyWorkflow, aN as te, aO as LGraph, aP as LLink, aQ as DragAndScale, aR as ContextMenu, aS as CanvasPointer, aT as isImageNode, aU as isVideoNode, aV as api, aW as getStorageValue, aX as useModelStore, aY as setStorageValue, aZ as LinkMarkerShape, a_ as IS_CONTROL_WIDGET, a$ as updateControlWidgetLabel, b0 as useColorPaletteService, b1 as ChangeTracker, b2 as i18n, b3 as useToast, b4 as useToastStore, b5 as useQueueSettingsStore, b6 as script$h, b7 as useQueuePendingTaskCountStore, b8 as useLocalStorage, b9 as useDraggable, ba as watchDebounced, bb as inject, bc as useElementBounding, bd as lodashExports, be as useEventBus, bf as useMenuItemStore, bg as provide, bh as isElectron, bi as electronAPI, bj as isNativeWindow, bk as useDialogService, bl as LGraphEventMode, bm as useQueueStore, bn as DEFAULT_DARK_COLOR_PALETTE, bo as DEFAULT_LIGHT_COLOR_PALETTE, bp as t, bq as useErrorHandling } from "./index-DIgj6hpb.js"; -import { s as script$1, a as script$2, b as script$3, c as script$4, d as script$6, e as script$9, f as script$d, g as script$i, h as script$j } from "./index-DdgRmRKP.js"; -import { s as script$g } from "./index-CE2hpomb.js"; -import { u as useKeybindingService } from "./keybindingService-CqDMAs0_.js"; -import { u as useServerConfigStore } from "./serverConfigStore-3t3U367D.js"; -import "./index-D8hjiWMw.js"; -const DEFAULT_TITLE = "ComfyUI"; -const TITLE_SUFFIX = " - ComfyUI"; -const _sfc_main$x = /* @__PURE__ */ defineComponent({ - __name: "BrowserTabTitle", - setup(__props) { - const executionStore = useExecutionStore(); - const executionText = computed( - () => executionStore.isIdle ? "" : `[${executionStore.executionProgress}%]` - ); - const settingStore = useSettingStore(); - const betaMenuEnabled = computed( - () => settingStore.get("Comfy.UseNewMenu") !== "Disabled" - ); - const workflowStore = useWorkflowStore(); - const isUnsavedText = computed( - () => workflowStore.activeWorkflow?.isModified || !workflowStore.activeWorkflow?.isPersisted ? " *" : "" - ); - const workflowNameText = computed(() => { - const workflowName = workflowStore.activeWorkflow?.filename; - return workflowName ? isUnsavedText.value + workflowName + TITLE_SUFFIX : DEFAULT_TITLE; - }); - const nodeExecutionTitle = computed( - () => executionStore.executingNode && executionStore.executingNodeProgress ? `${executionText.value}[${executionStore.executingNodeProgress}%] ${executionStore.executingNode.type}` : "" - ); - const workflowTitle = computed( - () => executionText.value + (betaMenuEnabled.value ? workflowNameText.value : DEFAULT_TITLE) - ); - const title = computed(() => nodeExecutionTitle.value || workflowTitle.value); - useTitle(title); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div"); - }; - } -}); -const _hoisted_1$m = { class: "window-actions-spacer" }; -const _sfc_main$w = /* @__PURE__ */ defineComponent({ - __name: "MenuHamburger", - setup(__props) { - const workspaceState = useWorkspaceStore(); - const settingStore = useSettingStore(); - const exitFocusMode = /* @__PURE__ */ __name(() => { - workspaceState.focusMode = false; - }, "exitFocusMode"); - watchEffect(() => { - if (settingStore.get("Comfy.UseNewMenu") !== "Disabled") { - return; - } - if (workspaceState.focusMode) { - app.ui.menuContainer.style.display = "none"; - } else { - app.ui.menuContainer.style.display = "block"; - } - }); - const menuSetting = computed(() => settingStore.get("Comfy.UseNewMenu")); - const positionCSS = computed( - () => ( - // 'Bottom' menuSetting shows the hamburger button in the bottom right corner - // 'Disabled', 'Top' menuSetting shows the hamburger button in the top right corner - menuSetting.value === "Bottom" ? { bottom: "0px", right: "0px" } : { top: "0px", right: "0px" } - ) - ); - return (_ctx, _cache) => { - const _directive_tooltip = resolveDirective("tooltip"); - return withDirectives((openBlock(), createElementBlock("div", { - class: "comfy-menu-hamburger no-drag", - style: normalizeStyle(positionCSS.value) - }, [ - withDirectives(createVNode(unref(script), { - icon: "pi pi-bars", - severity: "secondary", - text: "", - size: "large", - "aria-label": _ctx.$t("menu.showMenu"), - "aria-live": "assertive", - onClick: exitFocusMode, - onContextmenu: unref(showNativeSystemMenu) - }, null, 8, ["aria-label", "onContextmenu"]), [ - [_directive_tooltip, { value: _ctx.$t("menu.showMenu"), showDelay: 300 }] - ]), - withDirectives(createBaseVNode("div", _hoisted_1$m, null, 512), [ - [vShow, menuSetting.value !== "Bottom"] - ]) - ], 4)), [ - [vShow, unref(workspaceState).focusMode] - ]); - }; - } -}); -const MenuHamburger = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-4c2fbe7d"]]); -const _sfc_main$v = /* @__PURE__ */ defineComponent({ - __name: "UnloadWindowConfirmDialog", - setup(__props) { - const settingStore = useSettingStore(); - const workflowStore = useWorkflowStore(); - const handleBeforeUnload = /* @__PURE__ */ __name((event) => { - if (settingStore.get("Comfy.Window.UnloadConfirmation") && workflowStore.modifiedWorkflows.length > 0) { - event.preventDefault(); - return true; - } - return void 0; - }, "handleBeforeUnload"); - onMounted(() => { - window.addEventListener("beforeunload", handleBeforeUnload); - }); - onBeforeUnmount(() => { - window.removeEventListener("beforeunload", handleBeforeUnload); - }); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div"); - }; - } -}); -const _sfc_main$u = /* @__PURE__ */ defineComponent({ - __name: "LiteGraphCanvasSplitterOverlay", - setup(__props) { - const settingStore = useSettingStore(); - const sidebarLocation = computed( - () => settingStore.get("Comfy.Sidebar.Location") - ); - const sidebarPanelVisible = computed( - () => useSidebarTabStore().activeSidebarTab !== null - ); - const bottomPanelVisible = computed( - () => useBottomPanelStore().bottomPanelVisible - ); - const activeSidebarTabId = computed( - () => useSidebarTabStore().activeSidebarTabId - ); - return (_ctx, _cache) => { - return openBlock(), createBlock(unref(script$2), { - class: "splitter-overlay-root splitter-overlay", - "pt:gutter": sidebarPanelVisible.value ? "" : "hidden", - key: activeSidebarTabId.value, - stateKey: activeSidebarTabId.value, - stateStorage: "local" - }, { - default: withCtx(() => [ - sidebarLocation.value === "left" ? withDirectives((openBlock(), createBlock(unref(script$1), { - key: 0, - class: "side-bar-panel", - minSize: 10, - size: 20 - }, { - default: withCtx(() => [ - renderSlot(_ctx.$slots, "side-bar-panel", {}, void 0, true) - ]), - _: 3 - }, 512)), [ - [vShow, sidebarPanelVisible.value] - ]) : createCommentVNode("", true), - createVNode(unref(script$1), { size: 100 }, { - default: withCtx(() => [ - createVNode(unref(script$2), { - class: "splitter-overlay max-w-full", - layout: "vertical", - "pt:gutter": bottomPanelVisible.value ? "" : "hidden", - stateKey: "bottom-panel-splitter", - stateStorage: "local" - }, { - default: withCtx(() => [ - createVNode(unref(script$1), { class: "graph-canvas-panel relative" }, { - default: withCtx(() => [ - renderSlot(_ctx.$slots, "graph-canvas-panel", {}, void 0, true) - ]), - _: 3 - }), - withDirectives(createVNode(unref(script$1), { class: "bottom-panel" }, { - default: withCtx(() => [ - renderSlot(_ctx.$slots, "bottom-panel", {}, void 0, true) - ]), - _: 3 - }, 512), [ - [vShow, bottomPanelVisible.value] - ]) - ]), - _: 3 - }, 8, ["pt:gutter"]) - ]), - _: 3 - }), - sidebarLocation.value === "right" ? withDirectives((openBlock(), createBlock(unref(script$1), { - key: 1, - class: "side-bar-panel", - minSize: 10, - size: 20 - }, { - default: withCtx(() => [ - renderSlot(_ctx.$slots, "side-bar-panel", {}, void 0, true) - ]), - _: 3 - }, 512)), [ - [vShow, sidebarPanelVisible.value] - ]) : createCommentVNode("", true) - ]), - _: 3 - }, 8, ["pt:gutter", "stateKey"]); - }; - } -}); -const LiteGraphCanvasSplitterOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-e50caa15"]]); -const _sfc_main$t = /* @__PURE__ */ defineComponent({ - __name: "ExtensionSlot", - props: { - extension: {} - }, - setup(__props) { - const props = __props; - const mountCustomExtension = /* @__PURE__ */ __name((extension, el) => { - extension.render(el); - }, "mountCustomExtension"); - onBeforeUnmount(() => { - if (props.extension.type === "custom" && props.extension.destroy) { - props.extension.destroy(); - } - }); - return (_ctx, _cache) => { - return _ctx.extension.type === "vue" ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.extension.component), { key: 0 })) : (openBlock(), createElementBlock("div", { - key: 1, - ref: /* @__PURE__ */ __name((el) => { - if (el) - mountCustomExtension( - props.extension, - el - ); - }, "ref") - }, null, 512)); - }; - } -}); -const _hoisted_1$l = { class: "flex flex-col h-full" }; -const _hoisted_2$8 = { class: "w-full flex justify-between" }; -const _hoisted_3$7 = { class: "tabs-container" }; -const _hoisted_4$4 = { class: "font-bold" }; -const _hoisted_5$1 = { class: "flex-grow h-0" }; -const _sfc_main$s = /* @__PURE__ */ defineComponent({ - __name: "BottomPanel", - setup(__props) { - const bottomPanelStore = useBottomPanelStore(); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div", _hoisted_1$l, [ - createVNode(unref(script$5), { - value: unref(bottomPanelStore).activeBottomPanelTabId, - "onUpdate:value": _cache[1] || (_cache[1] = ($event) => unref(bottomPanelStore).activeBottomPanelTabId = $event) - }, { - default: withCtx(() => [ - createVNode(unref(script$3), { "pt:tabList": "border-none" }, { - default: withCtx(() => [ - createBaseVNode("div", _hoisted_2$8, [ - createBaseVNode("div", _hoisted_3$7, [ - (openBlock(true), createElementBlock(Fragment, null, renderList(unref(bottomPanelStore).bottomPanelTabs, (tab) => { - return openBlock(), createBlock(unref(script$4), { - key: tab.id, - value: tab.id, - class: "p-3 border-none" - }, { - default: withCtx(() => [ - createBaseVNode("span", _hoisted_4$4, toDisplayString(tab.title.toUpperCase()), 1) - ]), - _: 2 - }, 1032, ["value"]); - }), 128)) - ]), - createVNode(unref(script), { - class: "justify-self-end", - icon: "pi pi-times", - severity: "secondary", - size: "small", - text: "", - onClick: _cache[0] || (_cache[0] = ($event) => unref(bottomPanelStore).bottomPanelVisible = false) - }) - ]) - ]), - _: 1 - }) - ]), - _: 1 - }, 8, ["value"]), - createBaseVNode("div", _hoisted_5$1, [ - unref(bottomPanelStore).bottomPanelVisible && unref(bottomPanelStore).activeBottomPanelTab ? (openBlock(), createBlock(_sfc_main$t, { - key: 0, - extension: unref(bottomPanelStore).activeBottomPanelTab - }, null, 8, ["extension"])) : createCommentVNode("", true) - ]) - ]); - }; - } -}); -const _hoisted_1$k = { - viewBox: "0 0 1024 1024", - width: "1.2em", - height: "1.2em" -}; -function render$8(_ctx, _cache) { - return openBlock(), createElementBlock("svg", _hoisted_1$k, _cache[0] || (_cache[0] = [ - createBaseVNode("path", { - fill: "currentColor", - d: "M921.088 103.232L584.832 889.024L465.52 544.512L121.328 440.48zM1004.46.769c-6.096 0-13.52 1.728-22.096 5.36L27.708 411.2c-34.383 14.592-36.56 42.704-4.847 62.464l395.296 123.584l129.36 403.264c9.28 15.184 20.496 22.72 31.263 22.72c11.936 0 23.296-9.152 31.04-27.248l408.272-953.728C1029.148 16.368 1022.86.769 1004.46.769" - }, null, -1) - ])); -} -__name(render$8, "render$8"); -const __unplugin_components_1$2 = markRaw({ name: "simple-line-icons-cursor", render: render$8 }); -const _hoisted_1$j = { - viewBox: "0 0 24 24", - width: "1.2em", - height: "1.2em" -}; -function render$7(_ctx, _cache) { - return openBlock(), createElementBlock("svg", _hoisted_1$j, _cache[0] || (_cache[0] = [ - createBaseVNode("path", { - fill: "currentColor", - d: "M10.05 23q-.75 0-1.4-.337T7.575 21.7L1.2 12.375l.6-.575q.475-.475 1.125-.55t1.175.3L7 13.575V4q0-.425.288-.712T8 3t.713.288T9 4v13.425l-3.7-2.6l3.925 5.725q.125.2.35.325t.475.125H17q.825 0 1.413-.587T19 19V5q0-.425.288-.712T20 4t.713.288T21 5v14q0 1.65-1.175 2.825T17 23zM11 12V2q0-.425.288-.712T12 1t.713.288T13 2v10zm4 0V3q0-.425.288-.712T16 2t.713.288T17 3v9zm-2.85 4.5" - }, null, -1) - ])); -} -__name(render$7, "render$7"); -const __unplugin_components_0$3 = markRaw({ name: "material-symbols-pan-tool-outline", render: render$7 }); -const _sfc_main$r = /* @__PURE__ */ defineComponent({ - __name: "GraphCanvasMenu", - setup(__props) { - const { t: t2 } = useI18n(); - const commandStore = useCommandStore(); - const canvasStore = useCanvasStore(); - const settingStore = useSettingStore(); - const linkHidden = computed( - () => settingStore.get("Comfy.LinkRenderMode") === LiteGraph.HIDDEN_LINK - ); - let interval = null; - const repeat = /* @__PURE__ */ __name((command) => { - if (interval) return; - const cmd = /* @__PURE__ */ __name(() => commandStore.execute(command), "cmd"); - cmd(); - interval = window.setInterval(cmd, 100); - }, "repeat"); - const stopRepeat = /* @__PURE__ */ __name(() => { - if (interval) { - clearInterval(interval); - interval = null; - } - }, "stopRepeat"); - return (_ctx, _cache) => { - const _component_i_material_symbols58pan_tool_outline = __unplugin_components_0$3; - const _component_i_simple_line_icons58cursor = __unplugin_components_1$2; - const _directive_tooltip = resolveDirective("tooltip"); - return openBlock(), createBlock(unref(script$6), { class: "p-buttongroup-vertical absolute bottom-[10px] right-[10px] z-[1000]" }, { - default: withCtx(() => [ - withDirectives(createVNode(unref(script), { - severity: "secondary", - icon: "pi pi-plus", - "aria-label": _ctx.$t("graphCanvasMenu.zoomIn"), - onMousedown: _cache[0] || (_cache[0] = ($event) => repeat("Comfy.Canvas.ZoomIn")), - onMouseup: stopRepeat - }, null, 8, ["aria-label"]), [ - [ - _directive_tooltip, - unref(t2)("graphCanvasMenu.zoomIn"), - void 0, - { left: true } - ] - ]), - withDirectives(createVNode(unref(script), { - severity: "secondary", - icon: "pi pi-minus", - "aria-label": _ctx.$t("graphCanvasMenu.zoomOut"), - onMousedown: _cache[1] || (_cache[1] = ($event) => repeat("Comfy.Canvas.ZoomOut")), - onMouseup: stopRepeat - }, null, 8, ["aria-label"]), [ - [ - _directive_tooltip, - unref(t2)("graphCanvasMenu.zoomOut"), - void 0, - { left: true } - ] - ]), - withDirectives(createVNode(unref(script), { - severity: "secondary", - icon: "pi pi-expand", - "aria-label": _ctx.$t("graphCanvasMenu.fitView"), - onClick: _cache[2] || (_cache[2] = () => unref(commandStore).execute("Comfy.Canvas.FitView")) - }, null, 8, ["aria-label"]), [ - [ - _directive_tooltip, - unref(t2)("graphCanvasMenu.fitView"), - void 0, - { left: true } - ] - ]), - withDirectives((openBlock(), createBlock(unref(script), { - severity: "secondary", - "aria-label": unref(t2)( - "graphCanvasMenu." + (unref(canvasStore).canvas?.read_only ? "panMode" : "selectMode") - ), - onClick: _cache[3] || (_cache[3] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLock")) - }, { - icon: withCtx(() => [ - unref(canvasStore).canvas?.read_only ? (openBlock(), createBlock(_component_i_material_symbols58pan_tool_outline, { key: 0 })) : (openBlock(), createBlock(_component_i_simple_line_icons58cursor, { key: 1 })) - ]), - _: 1 - }, 8, ["aria-label"])), [ - [ - _directive_tooltip, - unref(t2)( - "graphCanvasMenu." + (unref(canvasStore).canvas?.read_only ? "panMode" : "selectMode") - ) + " (Space)", - void 0, - { left: true } - ] - ]), - withDirectives(createVNode(unref(script), { - severity: "secondary", - icon: linkHidden.value ? "pi pi-eye-slash" : "pi pi-eye", - "aria-label": _ctx.$t("graphCanvasMenu.toggleLinkVisibility"), - onClick: _cache[4] || (_cache[4] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLinkVisibility")), - "data-testid": "toggle-link-visibility-button" - }, null, 8, ["icon", "aria-label"]), [ - [ - _directive_tooltip, - unref(t2)("graphCanvasMenu.toggleLinkVisibility"), - void 0, - { left: true } - ] - ]) - ]), - _: 1 - }); - }; - } -}); -const GraphCanvasMenu = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-27a9500c"]]); -const _sfc_main$q = /* @__PURE__ */ defineComponent({ - __name: "NodeBadge", - setup(__props) { - const settingStore = useSettingStore(); - const colorPaletteStore = useColorPaletteStore(); - const nodeSourceBadgeMode = computed( - () => settingStore.get("Comfy.NodeBadge.NodeSourceBadgeMode") - ); - const nodeIdBadgeMode = computed( - () => settingStore.get("Comfy.NodeBadge.NodeIdBadgeMode") - ); - const nodeLifeCycleBadgeMode = computed( - () => settingStore.get("Comfy.NodeBadge.NodeLifeCycleBadgeMode") - ); - watch([nodeSourceBadgeMode, nodeIdBadgeMode, nodeLifeCycleBadgeMode], () => { - app.graph?.setDirtyCanvas(true, true); - }); - const nodeDefStore = useNodeDefStore(); - function badgeTextVisible(nodeDef, badgeMode) { - return !(badgeMode === NodeBadgeMode.None || nodeDef?.isCoreNode && badgeMode === NodeBadgeMode.HideBuiltIn); - } - __name(badgeTextVisible, "badgeTextVisible"); - onMounted(() => { - app.registerExtension({ - name: "Comfy.NodeBadge", - nodeCreated(node) { - node.badgePosition = BadgePosition.TopRight; - const badge = computed(() => { - const nodeDef = nodeDefStore.fromLGraphNode(node); - return new LGraphBadge({ - text: _.truncate( - [ - badgeTextVisible(nodeDef, nodeIdBadgeMode.value) ? `#${node.id}` : "", - badgeTextVisible(nodeDef, nodeLifeCycleBadgeMode.value) ? nodeDef?.nodeLifeCycleBadgeText ?? "" : "", - badgeTextVisible(nodeDef, nodeSourceBadgeMode.value) ? nodeDef?.nodeSource?.badgeText ?? "" : "" - ].filter((s) => s.length > 0).join(" "), - { - length: 31 - } - ), - fgColor: colorPaletteStore.completedActivePalette.colors.litegraph_base.BADGE_FG_COLOR, - bgColor: colorPaletteStore.completedActivePalette.colors.litegraph_base.BADGE_BG_COLOR - }); - }); - node.badges.push(() => badge.value); - } - }); - }); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div"); - }; - } -}); -const _sfc_main$p = /* @__PURE__ */ defineComponent({ - __name: "NodeTooltip", - setup(__props) { - let idleTimeout; - const nodeDefStore = useNodeDefStore(); - const settingStore = useSettingStore(); - const tooltipRef = ref(); - const tooltipText = ref(""); - const left = ref(); - const top = ref(); - const hideTooltip = /* @__PURE__ */ __name(() => tooltipText.value = null, "hideTooltip"); - const showTooltip = /* @__PURE__ */ __name(async (tooltip) => { - if (!tooltip) return; - left.value = app.canvas.mouse[0] + "px"; - top.value = app.canvas.mouse[1] + "px"; - tooltipText.value = tooltip; - await nextTick(); - const rect = tooltipRef.value.getBoundingClientRect(); - if (rect.right > window.innerWidth) { - left.value = app.canvas.mouse[0] - rect.width + "px"; - } - if (rect.top < 0) { - top.value = app.canvas.mouse[1] + rect.height + "px"; - } - }, "showTooltip"); - const onIdle = /* @__PURE__ */ __name(() => { - const { canvas } = app; - const node = canvas.node_over; - if (!node) return; - const ctor = node.constructor; - const nodeDef = nodeDefStore.nodeDefsByName[node.type]; - if (ctor.title_mode !== LiteGraph.NO_TITLE && canvas.graph_mouse[1] < node.pos[1]) { - return showTooltip(nodeDef.description); - } - if (node.flags?.collapsed) return; - const inputSlot = canvas.isOverNodeInput( - node, - canvas.graph_mouse[0], - canvas.graph_mouse[1], - [0, 0] - ); - if (inputSlot !== -1) { - const inputName = node.inputs[inputSlot].name; - const translatedTooltip = st( - `nodeDefs.${normalizeI18nKey(node.type)}.inputs.${normalizeI18nKey(inputName)}.tooltip`, - nodeDef.inputs.getInput(inputName)?.tooltip - ); - return showTooltip(translatedTooltip); - } - const outputSlot = canvas.isOverNodeOutput( - node, - canvas.graph_mouse[0], - canvas.graph_mouse[1], - [0, 0] - ); - if (outputSlot !== -1) { - const translatedTooltip = st( - `nodeDefs.${normalizeI18nKey(node.type)}.outputs.${outputSlot}.tooltip`, - nodeDef.outputs.all?.[outputSlot]?.tooltip - ); - return showTooltip(translatedTooltip); - } - const widget = app.canvas.getWidgetAtCursor(); - if (widget && !widget.element) { - const translatedTooltip = st( - `nodeDefs.${normalizeI18nKey(node.type)}.inputs.${normalizeI18nKey(widget.name)}.tooltip`, - nodeDef.inputs.getInput(widget.name)?.tooltip - ); - return showTooltip(widget.tooltip ?? translatedTooltip); - } - }, "onIdle"); - const onMouseMove = /* @__PURE__ */ __name((e) => { - hideTooltip(); - clearTimeout(idleTimeout); - if (e.target.nodeName !== "CANVAS") return; - idleTimeout = window.setTimeout( - onIdle, - settingStore.get("LiteGraph.Node.TooltipDelay") - ); - }, "onMouseMove"); - useEventListener(window, "mousemove", onMouseMove); - useEventListener(window, "click", hideTooltip); - return (_ctx, _cache) => { - return tooltipText.value ? (openBlock(), createElementBlock("div", { - key: 0, - ref_key: "tooltipRef", - ref: tooltipRef, - class: "node-tooltip", - style: normalizeStyle({ left: left.value, top: top.value }) - }, toDisplayString(tooltipText.value), 5)) : createCommentVNode("", true); - }; - } -}); -const NodeTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-f03142eb"]]); -function useAbsolutePosition() { - const canvasStore = useCanvasStore(); - const style = ref({ - position: "fixed", - left: "0px", - top: "0px", - width: "0px", - height: "0px" - }); - const updatePosition = /* @__PURE__ */ __name((config, extraStyle) => { - const { pos, size, scale = canvasStore.canvas?.ds?.scale ?? 1 } = config; - const [left, top] = app.canvasPosToClientPos(pos); - const [width, height] = size; - style.value = { - ...style.value, - left: `${left}px`, - top: `${top}px`, - width: `${width * scale}px`, - height: `${height * scale}px`, - ...extraStyle - }; - }, "updatePosition"); - return { - style, - updatePosition - }; -} -__name(useAbsolutePosition, "useAbsolutePosition"); -const _sfc_main$o = /* @__PURE__ */ defineComponent({ - __name: "SelectionOverlay", - setup(__props) { - const canvasStore = useCanvasStore(); - const { style, updatePosition } = useAbsolutePosition(); - const visible = ref(false); - const showBorder = ref(false); - const positionSelectionOverlay = /* @__PURE__ */ __name((canvas) => { - const selectedItems = canvas.selectedItems; - showBorder.value = selectedItems.size > 1; - if (!selectedItems.size) { - visible.value = false; - return; - } - visible.value = true; - const bounds = createBounds(selectedItems); - updatePosition({ - pos: [bounds[0], bounds[1]], - size: [bounds[2], bounds[3]] - }); - }, "positionSelectionOverlay"); - watch( - () => canvasStore.canvas, - (canvas) => { - if (!canvas) return; - canvas.onSelectionChange = useChainCallback( - canvas.onSelectionChange, - () => positionSelectionOverlay(canvas) - ); - }, - { immediate: true } - ); - watch( - () => { - const canvas = canvasStore.canvas; - if (!canvas) return null; - return { - scale: canvas.ds.state.scale, - offset: [canvas.ds.state.offset[0], canvas.ds.state.offset[1]] - }; - }, - (state) => { - if (!state) return; - positionSelectionOverlay(canvasStore.canvas); - } - ); - watch( - () => canvasStore.canvas?.state?.draggingItems, - (draggingItems) => { - if (draggingItems === false) { - setTimeout(() => { - visible.value = true; - positionSelectionOverlay(canvasStore.canvas); - }, 100); - } else { - visible.value = false; - } - } - ); - return (_ctx, _cache) => { - return withDirectives((openBlock(), createElementBlock("div", { - class: normalizeClass(["selection-overlay-container pointer-events-none z-40", { - "show-border": showBorder.value - }]), - style: normalizeStyle(unref(style)) - }, [ - renderSlot(_ctx.$slots, "default", {}, void 0, true) - ], 6)), [ - [vShow, visible.value] - ]); - }; - } -}); -const SelectionOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-79be2f2e"]]); -const _hoisted_1$i = { - viewBox: "0 0 512 512", - width: "1.2em", - height: "1.2em" -}; -function render$6(_ctx, _cache) { - return openBlock(), createElementBlock("svg", _hoisted_1$i, _cache[0] || (_cache[0] = [ - createBaseVNode("path", { - fill: "currentColor", - d: "M486.945 25.055L347.49 52.945l23.78 23.784L390.544 96l-56.793 56.795c-27.393-22.7-57.978-32.844-86.97-32.06c-33.838.918-64.92 15.95-87.858 38.888c-22.94 22.94-38.084 54.114-39.406 88.178c-1.138 29.306 8.49 60.407 30.742 88.485L19.27 467.27l25.46 25.46l155.48-155.484l-12.476-12.726c-24.72-25.22-33.185-51.125-32.246-75.323s11.9-47.13 28.89-64.12c16.988-16.988 39.66-27.71 63.38-28.352c23.72-.643 49.04 8.152 73.633 33.5l12.727 13.115L416 121.457l43.055 43.053zM256 192a64 64 0 0 0-64 64a64 64 0 0 0 64 64a64 64 0 0 0 64-64a64 64 0 0 0-64-64" - }, null, -1) - ])); -} -__name(render$6, "render$6"); -const __unplugin_components_0$2 = markRaw({ name: "game-icons-detour", render: render$6 }); -const _hoisted_1$h = { class: "relative" }; -const _hoisted_2$7 = { class: "flex items-center gap-1" }; -const _hoisted_3$6 = { - key: 0, - class: "color-picker-container absolute -top-10 left-1/2" -}; -const _hoisted_4$3 = ["data-testid"]; -const _sfc_main$n = /* @__PURE__ */ defineComponent({ - __name: "ColorPickerButton", - setup(__props) { - const { t: t2 } = useI18n(); - const canvasStore = useCanvasStore(); - const colorPaletteStore = useColorPaletteStore(); - const isLightTheme = computed( - () => colorPaletteStore.completedActivePalette.light_theme - ); - const toLightThemeColor = /* @__PURE__ */ __name((color) => adjustColor(color, { lightness: 0.5 }), "toLightThemeColor"); - const showColorPicker = ref(false); - const NO_COLOR_OPTION = { - name: "noColor", - localizedName: t2("color.noColor"), - value: { - dark: LiteGraph.NODE_DEFAULT_BGCOLOR, - light: toLightThemeColor(LiteGraph.NODE_DEFAULT_BGCOLOR) - } - }; - const colorOptions = [ - NO_COLOR_OPTION, - ...Object.entries(LGraphCanvas.node_colors).map(([name, color]) => ({ - name, - localizedName: t2(`color.${name}`), - value: { - dark: color.bgcolor, - light: toLightThemeColor(color.bgcolor) - } - })) - ]; - const selectedColorOption = ref(null); - const applyColor = /* @__PURE__ */ __name((colorOption) => { - const colorName = colorOption?.name ?? NO_COLOR_OPTION.name; - const canvasColorOption = colorName === NO_COLOR_OPTION.name ? null : LGraphCanvas.node_colors[colorName]; - for (const item of canvasStore.selectedItems) { - if (isColorable(item)) { - item.setColorOption(canvasColorOption); - } - } - canvasStore.canvas?.setDirty(true, true); - currentColorOption.value = canvasColorOption; - showColorPicker.value = false; - }, "applyColor"); - const currentColorOption = ref(null); - const currentColor = computed( - () => currentColorOption.value ? isLightTheme.value ? toLightThemeColor(currentColorOption.value?.bgcolor) : currentColorOption.value?.bgcolor : null - ); - watch( - () => canvasStore.selectedItems, - (newSelectedItems) => { - showColorPicker.value = false; - selectedColorOption.value = null; - currentColorOption.value = getItemsColorOption(newSelectedItems); - } - ); - return (_ctx, _cache) => { - const _directive_tooltip = resolveDirective("tooltip"); - return openBlock(), createElementBlock("div", _hoisted_1$h, [ - createVNode(unref(script), { - severity: "secondary", - text: "", - onClick: _cache[0] || (_cache[0] = () => showColorPicker.value = !showColorPicker.value) - }, { - icon: withCtx(() => [ - createBaseVNode("div", _hoisted_2$7, [ - createBaseVNode("i", { - class: "pi pi-circle-fill", - style: normalizeStyle({ color: currentColor.value }) - }, null, 4), - _cache[1] || (_cache[1] = createBaseVNode("i", { - class: "pi pi-chevron-down", - style: { fontSize: "0.5rem" } - }, null, -1)) - ]) - ]), - _: 1 - }), - showColorPicker.value ? (openBlock(), createElementBlock("div", _hoisted_3$6, [ - createVNode(unref(script$7), { - modelValue: selectedColorOption.value, - "onUpdate:modelValue": applyColor, - options: colorOptions, - optionLabel: "name", - dataKey: "value" - }, { - option: withCtx(({ option }) => [ - withDirectives(createBaseVNode("i", { - class: "pi pi-circle-fill", - style: normalizeStyle({ - color: isLightTheme.value ? option.value.light : option.value.dark - }), - "data-testid": option.name - }, null, 12, _hoisted_4$3), [ - [ - _directive_tooltip, - option.localizedName, - void 0, - { top: true } - ] - ]) - ]), - _: 1 - }, 8, ["modelValue"]) - ])) : createCommentVNode("", true) - ]); - }; - } -}); -const ColorPickerButton = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-665d04c1"]]); -const isRefreshableWidget = /* @__PURE__ */ __name((widget) => "refresh" in widget && typeof widget.refresh === "function", "isRefreshableWidget"); -const useRefreshableSelection = /* @__PURE__ */ __name(() => { - const graphStore = useCanvasStore(); - const commandStore = useCommandStore(); - const selectedNodes = ref([]); - const isAllNodesSelected = ref(false); - watchEffect(() => { - selectedNodes.value = graphStore.selectedItems.filter(isLGraphNode); - isAllNodesSelected.value = graphStore.canvas?.graph?.nodes?.every((node) => !!node.selected) ?? false; - }); - const refreshableWidgets = computed( - () => selectedNodes.value.flatMap( - (node) => node.widgets?.filter(isRefreshableWidget) ?? [] - ) - ); - const isRefreshable = computed( - () => refreshableWidgets.value.length > 0 || isAllNodesSelected.value - ); - async function refreshSelected() { - if (!isRefreshable.value) return; - if (isAllNodesSelected.value) { - commandStore.execute("Comfy.RefreshNodeDefinitions"); - } else { - await Promise.all(refreshableWidgets.value.map((item) => item.refresh())); - } - } - __name(refreshSelected, "refreshSelected"); - return { - isRefreshable, - refreshSelected - }; -}, "useRefreshableSelection"); -const _sfc_main$m = /* @__PURE__ */ defineComponent({ - __name: "SelectionToolbox", - setup(__props) { - const commandStore = useCommandStore(); - const canvasStore = useCanvasStore(); - const extensionService = useExtensionService(); - const { isRefreshable, refreshSelected } = useRefreshableSelection(); - const nodeSelected = computed( - () => canvasStore.selectedItems.some(isLGraphNode) - ); - const groupSelected = computed( - () => canvasStore.selectedItems.some(isLGraphGroup) - ); - const extensionToolboxCommands = computed(() => { - const commandIds = new Set( - canvasStore.selectedItems.map( - (item) => extensionService.invokeExtensions("getSelectionToolboxCommands", item).flat() - ).flat() - ); - return Array.from(commandIds).map((commandId) => commandStore.getCommand(commandId)).filter((command) => command !== void 0); - }); - return (_ctx, _cache) => { - const _component_i_game_icons58detour = __unplugin_components_0$2; - return openBlock(), createBlock(unref(script$8), { - class: "selection-toolbox absolute left-1/2 rounded-lg", - pt: { - header: "hidden", - content: "p-0 flex flex-row" - } - }, { - default: withCtx(() => [ - nodeSelected.value || groupSelected.value ? (openBlock(), createBlock(ColorPickerButton, { key: 0 })) : createCommentVNode("", true), - nodeSelected.value ? (openBlock(), createBlock(unref(script), { - key: 1, - severity: "secondary", - text: "", - onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.Canvas.ToggleSelectedNodes.Bypass")), - "data-testid": "bypass-button" - }, { - icon: withCtx(() => [ - createVNode(_component_i_game_icons58detour) - ]), - _: 1 - })) : createCommentVNode("", true), - nodeSelected.value || groupSelected.value ? (openBlock(), createBlock(unref(script), { - key: 2, - severity: "secondary", - text: "", - icon: "pi pi-thumbtack", - onClick: _cache[1] || (_cache[1] = () => unref(commandStore).execute("Comfy.Canvas.ToggleSelected.Pin")) - })) : createCommentVNode("", true), - createVNode(unref(script), { - severity: "danger", - text: "", - icon: "pi pi-trash", - onClick: _cache[2] || (_cache[2] = () => unref(commandStore).execute("Comfy.Canvas.DeleteSelectedItems")) - }), - unref(isRefreshable) ? (openBlock(), createBlock(unref(script), { - key: 3, - severity: "info", - text: "", - icon: "pi pi-refresh", - onClick: unref(refreshSelected) - }, null, 8, ["onClick"])) : createCommentVNode("", true), - (openBlock(true), createElementBlock(Fragment, null, renderList(extensionToolboxCommands.value, (command) => { - return openBlock(), createBlock(unref(script), { - key: command.id, - severity: "secondary", - text: "", - icon: typeof command.icon === "function" ? command.icon() : command.icon, - onClick: /* @__PURE__ */ __name(() => unref(commandStore).execute(command.id), "onClick") - }, null, 8, ["icon", "onClick"]); - }), 128)) - ]), - _: 1 - }); - }; - } -}); -const SelectionToolbox = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-5f2fc3fa"]]); -const _sfc_main$l = /* @__PURE__ */ defineComponent({ - __name: "TitleEditor", - setup(__props) { - const settingStore = useSettingStore(); - const showInput = ref(false); - const editedTitle = ref(""); - const { style: inputStyle, updatePosition } = useAbsolutePosition(); - const titleEditorStore = useTitleEditorStore(); - const canvasStore = useCanvasStore(); - const previousCanvasDraggable = ref(true); - const onEdit = /* @__PURE__ */ __name((newValue) => { - if (titleEditorStore.titleEditorTarget && newValue.trim() !== "") { - titleEditorStore.titleEditorTarget.title = newValue.trim(); - app.graph.setDirtyCanvas(true, true); - } - showInput.value = false; - titleEditorStore.titleEditorTarget = null; - canvasStore.canvas.allow_dragcanvas = previousCanvasDraggable.value; - }, "onEdit"); - watch( - () => titleEditorStore.titleEditorTarget, - (target) => { - if (target === null) { - return; - } - editedTitle.value = target.title; - showInput.value = true; - const canvas = canvasStore.canvas; - previousCanvasDraggable.value = canvas.allow_dragcanvas; - canvas.allow_dragcanvas = false; - const scale = canvas.ds.scale; - if (target instanceof LGraphGroup) { - const group = target; - updatePosition( - { - pos: group.pos, - size: [group.size[0], group.titleHeight] - }, - { fontSize: `${group.font_size * scale}px` } - ); - } else if (target instanceof LGraphNode) { - const node = target; - const [x, y] = node.getBounding(); - updatePosition( - { - pos: [x, y], - size: [node.width, LiteGraph.NODE_TITLE_HEIGHT] - }, - { fontSize: `${12 * scale}px` } - ); - } - } - ); - const canvasEventHandler = /* @__PURE__ */ __name((event) => { - if (event.detail.subType === "group-double-click") { - if (!settingStore.get("Comfy.Group.DoubleClickTitleToEdit")) { - return; - } - const group = event.detail.group; - const [x, y] = group.pos; - const e = event.detail.originalEvent; - const relativeY = e.canvasY - y; - if (relativeY <= group.titleHeight) { - titleEditorStore.titleEditorTarget = group; - } - } else if (event.detail.subType === "node-double-click") { - if (!settingStore.get("Comfy.Node.DoubleClickTitleToEdit")) { - return; - } - const node = event.detail.node; - const [x, y] = node.pos; - const e = event.detail.originalEvent; - const relativeY = e.canvasY - y; - if (relativeY <= 0) { - titleEditorStore.titleEditorTarget = node; - } - } - }, "canvasEventHandler"); - useEventListener(document, "litegraph:canvas", canvasEventHandler); - return (_ctx, _cache) => { - return showInput.value ? (openBlock(), createElementBlock("div", { - key: 0, - class: "group-title-editor node-title-editor", - style: normalizeStyle(unref(inputStyle)) - }, [ - createVNode(EditableText, { - isEditing: showInput.value, - modelValue: editedTitle.value, - onEdit - }, null, 8, ["isEditing", "modelValue"]) - ], 4)) : createCommentVNode("", true); - }; - } -}); -const TitleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-4e10cee2"]]); -const useSearchBoxStore = defineStore("searchBox", () => { - const visible = ref(false); - function toggleVisible() { - visible.value = !visible.value; - } - __name(toggleVisible, "toggleVisible"); - return { - visible, - toggleVisible - }; -}); -class ConnectingLinkImpl { - static { - __name(this, "ConnectingLinkImpl"); - } - constructor(node, slot, input, output, pos, afterRerouteId) { - this.node = node; - this.slot = slot; - this.input = input; - this.output = output; - this.pos = pos; - this.afterRerouteId = afterRerouteId; - } - static createFromPlainObject(obj) { - return new ConnectingLinkImpl( - obj.node, - obj.slot, - obj.input, - obj.output, - obj.pos, - obj.afterRerouteId - ); - } - get type() { - const result = this.input ? this.input.type : this.output?.type ?? null; - return result === -1 ? null : result; - } - /** - * Which slot type is release and need to be reconnected. - * - 'output' means we need a new node's outputs slot to connect with this link - */ - get releaseSlotType() { - return this.output ? "input" : "output"; - } - connectTo(newNode) { - const newNodeSlots = this.releaseSlotType === "output" ? newNode.outputs : newNode.inputs; - if (!newNodeSlots) return; - const newNodeSlot = newNodeSlots.findIndex( - (slot) => LiteGraph.isValidConnection(slot.type, this.type) - ); - if (newNodeSlot === -1) { - console.warn( - `Could not find slot with type ${this.type} on node ${newNode.title}. This should never happen` - ); - return; - } - if (this.releaseSlotType === "input") { - this.node.connect(this.slot, newNode, newNodeSlot, this.afterRerouteId); - } else { - newNode.connect(newNodeSlot, this.node, this.slot, this.afterRerouteId); - } - } -} -const _sfc_main$k = { - name: "AutoCompletePlus", - extends: script$9, - emits: ["focused-option-changed"], - data() { - return { - // Flag to determine if IME is active - isComposing: false - }; - }, - mounted() { - if (typeof script$9.mounted === "function") { - script$9.mounted.call(this); - } - const inputEl = this.$el.querySelector("input"); - if (inputEl) { - inputEl.addEventListener("compositionstart", () => { - this.isComposing = true; - }); - inputEl.addEventListener("compositionend", () => { - this.isComposing = false; - }); - } - this.$watch( - () => this.focusedOptionIndex, - (newVal, oldVal) => { - this.$emit("focused-option-changed", newVal); - } - ); - }, - methods: { - // Override onKeyDown to block Enter when IME is active - onKeyDown(event) { - if (event.key === "Enter" && this.isComposing) { - event.preventDefault(); - event.stopPropagation(); - return; - } - script$9.methods.onKeyDown.call(this, event); - } - } -}; -const _hoisted_1$g = { class: "option-container flex justify-between items-center px-2 py-0 cursor-pointer overflow-hidden w-full" }; -const _hoisted_2$6 = { class: "option-display-name font-semibold flex flex-col" }; -const _hoisted_3$5 = { key: 0 }; -const _hoisted_4$2 = ["innerHTML"]; -const _hoisted_5 = ["innerHTML"]; -const _hoisted_6 = { - key: 0, - class: "option-category font-light text-sm text-muted overflow-hidden text-ellipsis whitespace-nowrap" -}; -const _hoisted_7 = { class: "option-badges" }; -const _sfc_main$j = /* @__PURE__ */ defineComponent({ - __name: "NodeSearchItem", - props: { - nodeDef: {}, - currentQuery: {} - }, - setup(__props) { - const settingStore = useSettingStore(); - const showCategory = computed( - () => settingStore.get("Comfy.NodeSearchBoxImpl.ShowCategory") - ); - const showIdName = computed( - () => settingStore.get("Comfy.NodeSearchBoxImpl.ShowIdName") - ); - const showNodeFrequency = computed( - () => settingStore.get("Comfy.NodeSearchBoxImpl.ShowNodeFrequency") - ); - const nodeFrequencyStore = useNodeFrequencyStore(); - const nodeFrequency = computed( - () => nodeFrequencyStore.getNodeFrequency(props.nodeDef) - ); - const nodeBookmarkStore = useNodeBookmarkStore(); - const isBookmarked = computed( - () => nodeBookmarkStore.isBookmarked(props.nodeDef) - ); - const props = __props; - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div", _hoisted_1$g, [ - createBaseVNode("div", _hoisted_2$6, [ - createBaseVNode("div", null, [ - isBookmarked.value ? (openBlock(), createElementBlock("span", _hoisted_3$5, _cache[0] || (_cache[0] = [ - createBaseVNode("i", { class: "pi pi-bookmark-fill text-sm mr-1" }, null, -1) - ]))) : createCommentVNode("", true), - createBaseVNode("span", { - innerHTML: unref(highlightQuery)(_ctx.nodeDef.display_name, _ctx.currentQuery) - }, null, 8, _hoisted_4$2), - _cache[1] || (_cache[1] = createBaseVNode("span", null, " ", -1)), - showIdName.value ? (openBlock(), createBlock(unref(script$a), { - key: 1, - severity: "secondary" - }, { - default: withCtx(() => [ - createBaseVNode("span", { - innerHTML: unref(highlightQuery)(_ctx.nodeDef.name, _ctx.currentQuery) - }, null, 8, _hoisted_5) - ]), - _: 1 - })) : createCommentVNode("", true) - ]), - showCategory.value ? (openBlock(), createElementBlock("div", _hoisted_6, toDisplayString(_ctx.nodeDef.category.replaceAll("/", " > ")), 1)) : createCommentVNode("", true) - ]), - createBaseVNode("div", _hoisted_7, [ - _ctx.nodeDef.experimental ? (openBlock(), createBlock(unref(script$a), { - key: 0, - value: _ctx.$t("g.experimental"), - severity: "primary" - }, null, 8, ["value"])) : createCommentVNode("", true), - _ctx.nodeDef.deprecated ? (openBlock(), createBlock(unref(script$a), { - key: 1, - value: _ctx.$t("g.deprecated"), - severity: "danger" - }, null, 8, ["value"])) : createCommentVNode("", true), - showNodeFrequency.value && nodeFrequency.value > 0 ? (openBlock(), createBlock(unref(script$a), { - key: 2, - value: unref(formatNumberWithSuffix)(nodeFrequency.value, { roundToInt: true }), - severity: "secondary" - }, null, 8, ["value"])) : createCommentVNode("", true), - _ctx.nodeDef.nodeSource.type !== unref(NodeSourceType).Unknown ? (openBlock(), createBlock(unref(script$b), { - key: 3, - class: "text-sm font-light" - }, { - default: withCtx(() => [ - createTextVNode(toDisplayString(_ctx.nodeDef.nodeSource.displayText), 1) - ]), - _: 1 - })) : createCommentVNode("", true) - ]) - ]); - }; - } -}); -const NodeSearchItem = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-186bfdc4"]]); -const _hoisted_1$f = { class: "comfy-vue-node-search-container flex justify-center items-center w-full min-w-96" }; -const _hoisted_2$5 = { - key: 0, - class: "comfy-vue-node-preview-container absolute left-[-350px] top-[50px]" -}; -const _hoisted_3$4 = { class: "_dialog-body" }; -const _sfc_main$i = /* @__PURE__ */ defineComponent({ - __name: "NodeSearchBox", - props: { - filters: {}, - searchLimit: { default: 64 } - }, - emits: ["addFilter", "removeFilter", "addNode"], - setup(__props, { emit: __emit }) { - const settingStore = useSettingStore(); - const { t: t2 } = useI18n(); - const enableNodePreview = computed( - () => settingStore.get("Comfy.NodeSearchBoxImpl.NodePreview") - ); - const props = __props; - const nodeSearchFilterVisible = ref(false); - const inputId = `comfy-vue-node-search-box-input-${Math.random()}`; - const suggestions = ref([]); - const hoveredSuggestion = ref(null); - const currentQuery = ref(""); - const placeholder = computed(() => { - return props.filters.length === 0 ? t2("g.searchNodes") + "..." : ""; - }); - const nodeDefStore = useNodeDefStore(); - const nodeFrequencyStore = useNodeFrequencyStore(); - const search = /* @__PURE__ */ __name((query) => { - const queryIsEmpty = query === "" && props.filters.length === 0; - currentQuery.value = query; - suggestions.value = queryIsEmpty ? nodeFrequencyStore.topNodeDefs : [ - ...nodeDefStore.nodeSearchService.searchNode(query, props.filters, { - limit: props.searchLimit - }) - ]; - }, "search"); - const emit = __emit; - let inputElement = null; - const reFocusInput = /* @__PURE__ */ __name(() => { - inputElement ??= document.getElementById(inputId); - if (inputElement) { - inputElement.blur(); - nextTick(() => inputElement?.focus()); - } - }, "reFocusInput"); - onMounted(reFocusInput); - const onAddFilter = /* @__PURE__ */ __name((filterAndValue) => { - nodeSearchFilterVisible.value = false; - emit("addFilter", filterAndValue); - }, "onAddFilter"); - const onRemoveFilter = /* @__PURE__ */ __name((event, filterAndValue) => { - event.stopPropagation(); - event.preventDefault(); - emit("removeFilter", filterAndValue); - reFocusInput(); - }, "onRemoveFilter"); - const setHoverSuggestion = /* @__PURE__ */ __name((index) => { - if (index === -1) { - hoveredSuggestion.value = null; - return; - } - const value = suggestions.value[index]; - hoveredSuggestion.value = value; - }, "setHoverSuggestion"); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div", _hoisted_1$f, [ - enableNodePreview.value ? (openBlock(), createElementBlock("div", _hoisted_2$5, [ - hoveredSuggestion.value ? (openBlock(), createBlock(NodePreview, { - nodeDef: hoveredSuggestion.value, - key: hoveredSuggestion.value?.name || "" - }, null, 8, ["nodeDef"])) : createCommentVNode("", true) - ])) : createCommentVNode("", true), - createVNode(unref(script), { - icon: "pi pi-filter", - severity: "secondary", - class: "filter-button z-10", - onClick: _cache[0] || (_cache[0] = ($event) => nodeSearchFilterVisible.value = true) - }), - createVNode(unref(script$c), { - visible: nodeSearchFilterVisible.value, - "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => nodeSearchFilterVisible.value = $event), - class: "min-w-96", - "dismissable-mask": "", - modal: "", - onHide: reFocusInput - }, { - header: withCtx(() => _cache[5] || (_cache[5] = [ - createBaseVNode("h3", null, "Add node filter condition", -1) - ])), - default: withCtx(() => [ - createBaseVNode("div", _hoisted_3$4, [ - createVNode(NodeSearchFilter, { onAddFilter }) - ]) - ]), - _: 1 - }, 8, ["visible"]), - createVNode(_sfc_main$k, { - "model-value": props.filters, - class: "comfy-vue-node-search-box z-10 flex-grow", - scrollHeight: "40vh", - placeholder: placeholder.value, - "input-id": inputId, - "append-to": "self", - suggestions: suggestions.value, - "min-length": 0, - delay: 100, - loading: !unref(nodeFrequencyStore).isLoaded, - onComplete: _cache[2] || (_cache[2] = ($event) => search($event.query)), - onOptionSelect: _cache[3] || (_cache[3] = ($event) => emit("addNode", $event.value)), - onFocusedOptionChanged: _cache[4] || (_cache[4] = ($event) => setHoverSuggestion($event)), - "complete-on-focus": "", - "auto-option-focus": "", - "force-selection": "", - multiple: "", - optionLabel: "display_name" - }, { - option: withCtx(({ option }) => [ - createVNode(NodeSearchItem, { - nodeDef: option, - currentQuery: currentQuery.value - }, null, 8, ["nodeDef", "currentQuery"]) - ]), - chip: withCtx(({ value }) => [ - Array.isArray(value) && value.length === 2 ? (openBlock(), createBlock(SearchFilterChip, { - key: `${value[0].id}-${value[1]}`, - onRemove: /* @__PURE__ */ __name(($event) => onRemoveFilter($event, value), "onRemove"), - text: value[1], - badge: value[0].invokeSequence.toUpperCase(), - "badge-class": value[0].invokeSequence + "-badge" - }, null, 8, ["onRemove", "text", "badge", "badge-class"])) : createCommentVNode("", true) - ]), - _: 1 - }, 8, ["model-value", "placeholder", "suggestions", "loading"]) - ]); - }; - } -}); -const _sfc_main$h = /* @__PURE__ */ defineComponent({ - __name: "NodeSearchBoxPopover", - setup(__props) { - const settingStore = useSettingStore(); - const litegraphService = useLitegraphService(); - const { visible } = storeToRefs(useSearchBoxStore()); - const dismissable = ref(true); - const triggerEvent = ref(null); - const getNewNodeLocation = /* @__PURE__ */ __name(() => { - if (!triggerEvent.value) { - return litegraphService.getCanvasCenter(); - } - const originalEvent = triggerEvent.value.detail.originalEvent; - return [originalEvent.canvasX, originalEvent.canvasY]; - }, "getNewNodeLocation"); - const nodeFilters = ref([]); - const addFilter = /* @__PURE__ */ __name((filter) => { - nodeFilters.value.push(filter); - }, "addFilter"); - const removeFilter = /* @__PURE__ */ __name((filter) => { - nodeFilters.value = nodeFilters.value.filter( - (f) => toRaw(f) !== toRaw(filter) - ); - }, "removeFilter"); - const clearFilters = /* @__PURE__ */ __name(() => { - nodeFilters.value = []; - }, "clearFilters"); - const closeDialog = /* @__PURE__ */ __name(() => { - visible.value = false; - }, "closeDialog"); - const addNode = /* @__PURE__ */ __name((nodeDef) => { - const node = litegraphService.addNodeOnGraph(nodeDef, { - pos: getNewNodeLocation() - }); - const eventDetail = triggerEvent.value?.detail; - if (eventDetail && eventDetail.subType === "empty-release") { - eventDetail.linkReleaseContext.links.forEach((link) => { - ConnectingLinkImpl.createFromPlainObject(link).connectTo(node); - }); - } - window.setTimeout(() => { - closeDialog(); - }, 100); - }, "addNode"); - const newSearchBoxEnabled = computed( - () => settingStore.get("Comfy.NodeSearchBoxImpl") === "default" - ); - const showSearchBox = /* @__PURE__ */ __name((e) => { - const detail = e.detail; - if (newSearchBoxEnabled.value) { - if (detail.originalEvent?.pointerType === "touch") { - setTimeout(() => { - showNewSearchBox(e); - }, 128); - } else { - showNewSearchBox(e); - } - } else { - canvasStore.canvas.showSearchBox(detail.originalEvent); - } - }, "showSearchBox"); - const nodeDefStore = useNodeDefStore(); - const showNewSearchBox = /* @__PURE__ */ __name((e) => { - if (e.detail.subType === "empty-release") { - const links = e.detail.linkReleaseContext.links; - if (links.length === 0) { - console.warn("Empty release with no links! This should never happen"); - return; - } - const firstLink = ConnectingLinkImpl.createFromPlainObject(links[0]); - const filter = nodeDefStore.nodeSearchService.getFilterById( - firstLink.releaseSlotType - ); - const dataType = firstLink.type.toString(); - addFilter([filter, dataType]); - } - visible.value = true; - triggerEvent.value = e; - dismissable.value = false; - setTimeout(() => { - dismissable.value = true; - }, 300); - }, "showNewSearchBox"); - const showContextMenu = /* @__PURE__ */ __name((e) => { - if (e.detail.subType !== "empty-release") { - return; - } - const links = e.detail.linkReleaseContext.links; - if (links.length === 0) { - console.warn("Empty release with no links! This should never happen"); - return; - } - const firstLink = ConnectingLinkImpl.createFromPlainObject(links[0]); - const mouseEvent = e.detail.originalEvent; - const commonOptions = { - e: mouseEvent, - allow_searchbox: true, - showSearchBox: /* @__PURE__ */ __name(() => showSearchBox(e), "showSearchBox") - }; - const connectionOptions = firstLink.output ? { - nodeFrom: firstLink.node, - slotFrom: firstLink.output, - afterRerouteId: firstLink.afterRerouteId - } : { - nodeTo: firstLink.node, - slotTo: firstLink.input, - afterRerouteId: firstLink.afterRerouteId - }; - canvasStore.canvas.showConnectionMenu({ - ...connectionOptions, - ...commonOptions - }); - }, "showContextMenu"); - const canvasStore = useCanvasStore(); - watchEffect(() => { - if (canvasStore.canvas) { - LiteGraph.release_link_on_empty_shows_menu = false; - canvasStore.canvas.allow_searchbox = false; - } - }); - const canvasEventHandler = /* @__PURE__ */ __name((e) => { - if (e.detail.subType === "empty-double-click") { - showSearchBox(e); - } else if (e.detail.subType === "empty-release") { - handleCanvasEmptyRelease(e); - } else if (e.detail.subType === "group-double-click") { - const group = e.detail.group; - const [x, y] = group.pos; - const relativeY = e.detail.originalEvent.canvasY - y; - if (relativeY > group.titleHeight) { - showSearchBox(e); - } - } - }, "canvasEventHandler"); - const linkReleaseAction = computed(() => { - return settingStore.get("Comfy.LinkRelease.Action"); - }); - const linkReleaseActionShift = computed(() => { - return settingStore.get("Comfy.LinkRelease.ActionShift"); - }); - const handleCanvasEmptyRelease = /* @__PURE__ */ __name((e) => { - const detail = e.detail; - const shiftPressed = detail.originalEvent.shiftKey; - const action = shiftPressed ? linkReleaseActionShift.value : linkReleaseAction.value; - switch (action) { - case LinkReleaseTriggerAction.SEARCH_BOX: - showSearchBox(e); - break; - case LinkReleaseTriggerAction.CONTEXT_MENU: - showContextMenu(e); - break; - case LinkReleaseTriggerAction.NO_ACTION: - default: - break; - } - }, "handleCanvasEmptyRelease"); - useEventListener(document, "litegraph:canvas", canvasEventHandler); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div", null, [ - createVNode(unref(script$c), { - visible: unref(visible), - "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => isRef(visible) ? visible.value = $event : null), - modal: "", - "dismissable-mask": dismissable.value, - onHide: clearFilters, - pt: { - root: { - class: "invisible-dialog-root", - role: "search" - }, - mask: { class: "node-search-box-dialog-mask" }, - transition: { - enterFromClass: "opacity-0 scale-75", - // 100ms is the duration of the transition in the dialog component - enterActiveClass: "transition-all duration-100 ease-out", - leaveActiveClass: "transition-all duration-100 ease-in", - leaveToClass: "opacity-0 scale-75" - } - } - }, { - container: withCtx(() => [ - createVNode(_sfc_main$i, { - filters: nodeFilters.value, - onAddFilter: addFilter, - onRemoveFilter: removeFilter, - onAddNode: addNode - }, null, 8, ["filters"]) - ]), - _: 1 - }, 8, ["visible", "dismissable-mask"]) - ]); - }; - } -}); -const _sfc_main$g = /* @__PURE__ */ defineComponent({ - __name: "SidebarIcon", - props: { - icon: String, - selected: Boolean, - tooltip: { - type: String, - default: "" - }, - class: { - type: String, - default: "" - }, - iconBadge: { - type: [String, Function], - default: "" - } - }, - emits: ["click"], - setup(__props, { emit: __emit }) { - const props = __props; - const emit = __emit; - const overlayValue = computed( - () => typeof props.iconBadge === "function" ? props.iconBadge() || "" : props.iconBadge - ); - const shouldShowBadge = computed(() => !!overlayValue.value); - return (_ctx, _cache) => { - const _directive_tooltip = resolveDirective("tooltip"); - return withDirectives((openBlock(), createBlock(unref(script), { - class: normalizeClass(props.class), - text: "", - pt: { - root: { - class: `side-bar-button ${props.selected ? "p-button-primary side-bar-button-selected" : "p-button-secondary"}`, - "aria-label": props.tooltip - } - }, - onClick: _cache[0] || (_cache[0] = ($event) => emit("click", $event)) - }, { - icon: withCtx(() => [ - shouldShowBadge.value ? (openBlock(), createBlock(unref(script$d), { - key: 0, - value: overlayValue.value - }, { - default: withCtx(() => [ - createBaseVNode("i", { - class: normalizeClass(props.icon + " side-bar-button-icon") - }, null, 2) - ]), - _: 1 - }, 8, ["value"])) : (openBlock(), createElementBlock("i", { - key: 1, - class: normalizeClass(props.icon + " side-bar-button-icon") - }, null, 2)) - ]), - _: 1 - }, 8, ["class", "pt"])), [ - [_directive_tooltip, { value: props.tooltip, showDelay: 300, hideDelay: 300 }] - ]); - }; - } -}); -const SidebarIcon = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-6ab4daa6"]]); -const _sfc_main$f = /* @__PURE__ */ defineComponent({ - __name: "SidebarLogoutIcon", - setup(__props) { - const { t: t2 } = useI18n(); - const userStore = useUserStore(); - const tooltip = computed( - () => `${t2("sideToolbar.logout")} (${userStore.currentUser?.username})` - ); - const logout = /* @__PURE__ */ __name(() => { - userStore.logout(); - window.location.reload(); - }, "logout"); - return (_ctx, _cache) => { - return openBlock(), createBlock(SidebarIcon, { - icon: "pi pi-sign-out", - tooltip: tooltip.value, - onClick: logout - }, null, 8, ["tooltip"]); - }; - } -}); -const _sfc_main$e = /* @__PURE__ */ defineComponent({ - __name: "SidebarSettingsToggleIcon", - setup(__props) { - const dialogStore = useDialogStore(); - const showSetting = /* @__PURE__ */ __name(() => { - dialogStore.showDialog({ - key: "global-settings", - headerComponent: SettingDialogHeader, - component: SettingDialogContent - }); - }, "showSetting"); - return (_ctx, _cache) => { - return openBlock(), createBlock(SidebarIcon, { - icon: "pi pi-cog", - class: "comfy-settings-btn", - onClick: showSetting, - tooltip: _ctx.$t("g.settings") - }, null, 8, ["tooltip"]); - }; - } -}); -const _sfc_main$d = /* @__PURE__ */ defineComponent({ - __name: "SidebarThemeToggleIcon", - setup(__props) { - const colorPaletteStore = useColorPaletteStore(); - const icon = computed( - () => colorPaletteStore.completedActivePalette.light_theme ? "pi pi-sun" : "pi pi-moon" - ); - const commandStore = useCommandStore(); - const toggleTheme = /* @__PURE__ */ __name(() => { - commandStore.execute("Comfy.ToggleTheme"); - }, "toggleTheme"); - return (_ctx, _cache) => { - return openBlock(), createBlock(SidebarIcon, { - icon: icon.value, - onClick: toggleTheme, - tooltip: _ctx.$t("sideToolbar.themeToggle"), - class: "comfy-vue-theme-toggle" - }, null, 8, ["icon", "tooltip"]); - }; - } -}); -const _hoisted_1$e = { class: "side-tool-bar-end" }; -const _hoisted_2$4 = { - key: 0, - class: "sidebar-content-container h-full overflow-y-auto overflow-x-hidden" -}; -const _sfc_main$c = /* @__PURE__ */ defineComponent({ - __name: "SideToolbar", - setup(__props) { - const workspaceStore = useWorkspaceStore(); - const settingStore = useSettingStore(); - const userStore = useUserStore(); - const teleportTarget = computed( - () => settingStore.get("Comfy.Sidebar.Location") === "left" ? ".comfyui-body-left" : ".comfyui-body-right" - ); - const isSmall = computed( - () => settingStore.get("Comfy.Sidebar.Size") === "small" - ); - const tabs = computed(() => workspaceStore.getSidebarTabs()); - const selectedTab = computed(() => workspaceStore.sidebarTab.activeSidebarTab); - const onTabClick = /* @__PURE__ */ __name((item) => { - workspaceStore.sidebarTab.toggleSidebarTab(item.id); - }, "onTabClick"); - const keybindingStore = useKeybindingStore(); - const getTabTooltipSuffix = /* @__PURE__ */ __name((tab) => { - const keybinding = keybindingStore.getKeybindingByCommandId( - `Workspace.ToggleSidebarTab.${tab.id}` - ); - return keybinding ? ` (${keybinding.combo.toString()})` : ""; - }, "getTabTooltipSuffix"); - return (_ctx, _cache) => { - return openBlock(), createElementBlock(Fragment, null, [ - (openBlock(), createBlock(Teleport, { to: teleportTarget.value }, [ - createBaseVNode("nav", { - class: normalizeClass(["side-tool-bar-container", { "small-sidebar": isSmall.value }]) - }, [ - (openBlock(true), createElementBlock(Fragment, null, renderList(tabs.value, (tab) => { - return openBlock(), createBlock(SidebarIcon, { - key: tab.id, - icon: tab.icon, - iconBadge: tab.iconBadge, - tooltip: tab.tooltip + getTabTooltipSuffix(tab), - selected: tab.id === selectedTab.value?.id, - class: normalizeClass(tab.id + "-tab-button"), - onClick: /* @__PURE__ */ __name(($event) => onTabClick(tab), "onClick") - }, null, 8, ["icon", "iconBadge", "tooltip", "selected", "class", "onClick"]); - }), 128)), - createBaseVNode("div", _hoisted_1$e, [ - unref(userStore).isMultiUserServer ? (openBlock(), createBlock(_sfc_main$f, { key: 0 })) : createCommentVNode("", true), - createVNode(_sfc_main$d), - createVNode(_sfc_main$e) - ]) - ], 2) - ], 8, ["to"])), - selectedTab.value ? (openBlock(), createElementBlock("div", _hoisted_2$4, [ - createVNode(_sfc_main$t, { extension: selectedTab.value }, null, 8, ["extension"]) - ])) : createCommentVNode("", true) - ], 64); - }; - } -}); -const SideToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-04875455"]]); -const _hoisted_1$d = { class: "workflow-label text-sm max-w-[150px] truncate inline-block" }; -const _hoisted_2$3 = { class: "relative" }; -const _hoisted_3$3 = { - key: 0, - class: "status-indicator" -}; -const _sfc_main$b = /* @__PURE__ */ defineComponent({ - __name: "WorkflowTab", - props: { - class: {}, - workflowOption: {} - }, - setup(__props) { - const props = __props; - const { t: t2 } = useI18n(); - const workspaceStore = useWorkspaceStore(); - const workflowStore = useWorkflowStore(); - const workflowTabRef = ref(null); - const closeWorkflows = /* @__PURE__ */ __name(async (options) => { - for (const opt of options) { - if (!await useWorkflowService().closeWorkflow(opt.workflow, { - warnIfUnsaved: !workspaceStore.shiftDown, - hint: t2("sideToolbar.workflowTab.dirtyCloseHint") - })) { - break; - } - } - }, "closeWorkflows"); - const onCloseWorkflow = /* @__PURE__ */ __name((option) => { - closeWorkflows([option]); - }, "onCloseWorkflow"); - const tabGetter = /* @__PURE__ */ __name(() => workflowTabRef.value, "tabGetter"); - usePragmaticDraggable(tabGetter, { - getInitialData: /* @__PURE__ */ __name(() => { - return { - workflowKey: props.workflowOption.workflow.key - }; - }, "getInitialData") - }); - usePragmaticDroppable(tabGetter, { - getData: /* @__PURE__ */ __name(() => { - return { - workflowKey: props.workflowOption.workflow.key - }; - }, "getData"), - onDrop: /* @__PURE__ */ __name((e) => { - const fromIndex = workflowStore.openWorkflows.findIndex( - (wf) => wf.key === e.source.data.workflowKey - ); - const toIndex = workflowStore.openWorkflows.findIndex( - (wf) => wf.key === e.location.current.dropTargets[0]?.data.workflowKey - ); - if (fromIndex !== toIndex) { - workflowStore.reorderWorkflows(fromIndex, toIndex); - } - }, "onDrop") - }); - return (_ctx, _cache) => { - const _directive_tooltip = resolveDirective("tooltip"); - return openBlock(), createElementBlock("div", mergeProps({ - class: "flex p-2 gap-2 workflow-tab", - ref_key: "workflowTabRef", - ref: workflowTabRef - }, _ctx.$attrs), [ - withDirectives((openBlock(), createElementBlock("span", _hoisted_1$d, [ - createTextVNode(toDisplayString(_ctx.workflowOption.workflow.filename), 1) - ])), [ - [ - _directive_tooltip, - _ctx.workflowOption.workflow.key, - void 0, - { bottom: true } - ] - ]), - createBaseVNode("div", _hoisted_2$3, [ - !unref(workspaceStore).shiftDown && (_ctx.workflowOption.workflow.isModified || !_ctx.workflowOption.workflow.isPersisted) ? (openBlock(), createElementBlock("span", _hoisted_3$3, "•")) : createCommentVNode("", true), - createVNode(unref(script), { - class: "close-button p-0 w-auto", - icon: "pi pi-times", - text: "", - severity: "secondary", - size: "small", - onClick: _cache[0] || (_cache[0] = withModifiers(($event) => onCloseWorkflow(_ctx.workflowOption), ["stop"])) - }) - ]) - ], 16); - }; - } -}); -const WorkflowTab = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-fd6ae3af"]]); -const _hoisted_1$c = { class: "workflow-tabs-container flex flex-row max-w-full h-full" }; -const _sfc_main$a = /* @__PURE__ */ defineComponent({ - __name: "WorkflowTabs", - props: { - class: {} - }, - setup(__props) { - const props = __props; - const { t: t2 } = useI18n(); - const workspaceStore = useWorkspaceStore(); - const workflowStore = useWorkflowStore(); - const workflowService = useWorkflowService(); - const workflowBookmarkStore = useWorkflowBookmarkStore(); - const rightClickedTab = ref(null); - const menu = ref(); - const workflowToOption = /* @__PURE__ */ __name((workflow) => ({ - value: workflow.path, - workflow - }), "workflowToOption"); - const options = computed( - () => workflowStore.openWorkflows.map(workflowToOption) - ); - const selectedWorkflow = computed( - () => workflowStore.activeWorkflow ? workflowToOption(workflowStore.activeWorkflow) : null - ); - const onWorkflowChange = /* @__PURE__ */ __name((option) => { - if (!option) { - return; - } - if (selectedWorkflow.value?.value === option.value) { - return; - } - workflowService.openWorkflow(option.workflow); - }, "onWorkflowChange"); - const closeWorkflows = /* @__PURE__ */ __name(async (options2) => { - for (const opt of options2) { - if (!await workflowService.closeWorkflow(opt.workflow, { - warnIfUnsaved: !workspaceStore.shiftDown - })) { - break; - } - } - }, "closeWorkflows"); - const onCloseWorkflow = /* @__PURE__ */ __name((option) => { - closeWorkflows([option]); - }, "onCloseWorkflow"); - const showContextMenu = /* @__PURE__ */ __name((event, option) => { - rightClickedTab.value = option; - menu.value.show(event); - }, "showContextMenu"); - const contextMenuItems = computed(() => { - const tab = rightClickedTab.value; - if (!tab) return []; - const index = options.value.findIndex((v) => v.workflow === tab.workflow); - return [ - { - label: t2("tabMenu.duplicateTab"), - command: /* @__PURE__ */ __name(() => { - workflowService.duplicateWorkflow(tab.workflow); - }, "command") - }, - { - separator: true - }, - { - label: t2("tabMenu.closeTab"), - command: /* @__PURE__ */ __name(() => onCloseWorkflow(tab), "command") - }, - { - label: t2("tabMenu.closeTabsToLeft"), - command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(0, index)), "command"), - disabled: index <= 0 - }, - { - label: t2("tabMenu.closeTabsToRight"), - command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(index + 1)), "command"), - disabled: index === options.value.length - 1 - }, - { - label: t2("tabMenu.closeOtherTabs"), - command: /* @__PURE__ */ __name(() => closeWorkflows([ - ...options.value.slice(index + 1), - ...options.value.slice(0, index) - ]), "command"), - disabled: options.value.length <= 1 - }, - { - label: workflowBookmarkStore.isBookmarked(tab.workflow.path) ? t2("tabMenu.removeFromBookmarks") : t2("tabMenu.addToBookmarks"), - command: /* @__PURE__ */ __name(() => workflowBookmarkStore.toggleBookmarked(tab.workflow.path), "command"), - disabled: tab.workflow.isTemporary - } - ]; - }); - const commandStore = useCommandStore(); - const handleWheel = /* @__PURE__ */ __name((event) => { - const scrollElement = event.currentTarget; - const scrollAmount = event.deltaX || event.deltaY; - scrollElement.scroll({ - left: scrollElement.scrollLeft + scrollAmount - }); - }, "handleWheel"); - return (_ctx, _cache) => { - const _directive_tooltip = resolveDirective("tooltip"); - return openBlock(), createElementBlock("div", _hoisted_1$c, [ - createVNode(unref(script$e), { - class: "overflow-hidden no-drag", - "pt:content": { - class: "p-0 w-full", - onwheel: handleWheel - }, - "pt:barX": "h-1" - }, { - default: withCtx(() => [ - createVNode(unref(script$7), { - class: normalizeClass(["workflow-tabs bg-transparent", props.class]), - modelValue: selectedWorkflow.value, - "onUpdate:modelValue": onWorkflowChange, - options: options.value, - optionLabel: "label", - dataKey: "value" - }, { - option: withCtx(({ option }) => [ - createVNode(WorkflowTab, { - onContextmenu: /* @__PURE__ */ __name(($event) => showContextMenu($event, option), "onContextmenu"), - onMouseup: withModifiers(($event) => onCloseWorkflow(option), ["middle"]), - "workflow-option": option - }, null, 8, ["onContextmenu", "onMouseup", "workflow-option"]) - ]), - _: 1 - }, 8, ["class", "modelValue", "options"]) - ]), - _: 1 - }, 8, ["pt:content"]), - withDirectives(createVNode(unref(script), { - class: "new-blank-workflow-button flex-shrink-0 no-drag", - icon: "pi pi-plus", - text: "", - severity: "secondary", - "aria-label": _ctx.$t("sideToolbar.newBlankWorkflow"), - onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.NewBlankWorkflow")) - }, null, 8, ["aria-label"]), [ - [_directive_tooltip, { value: _ctx.$t("sideToolbar.newBlankWorkflow"), showDelay: 300 }] - ]), - createVNode(unref(script$f), { - ref_key: "menu", - ref: menu, - model: contextMenuItems.value - }, null, 8, ["model"]) - ]); - }; - } -}); -const WorkflowTabs = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-54fadc45"]]); -const _hoisted_1$b = { class: "absolute top-0 left-0 w-auto max-w-full" }; -const _sfc_main$9 = /* @__PURE__ */ defineComponent({ - __name: "SecondRowWorkflowTabs", - setup(__props) { - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div", _hoisted_1$b, [ - createVNode(WorkflowTabs) - ]); - }; - } -}); -const SecondRowWorkflowTabs = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-6ab68035"]]); -const useCanvasDrop = /* @__PURE__ */ __name((canvasRef) => { - const modelToNodeStore = useModelToNodeStore(); - const litegraphService = useLitegraphService(); - const workflowService = useWorkflowService(); - usePragmaticDroppable(() => canvasRef.value, { - getDropEffect: /* @__PURE__ */ __name((args) => args.source.data.type === "tree-explorer-node" ? "copy" : "move", "getDropEffect"), - onDrop: /* @__PURE__ */ __name((event) => { - const loc = event.location.current.input; - const dndData = event.source.data; - if (dndData.type === "tree-explorer-node") { - const node = dndData.data; - if (node.data instanceof ComfyNodeDefImpl) { - const nodeDef = node.data; - const pos = app.clientPosToCanvasPos([ - loc.clientX, - loc.clientY + LiteGraph.NODE_TITLE_HEIGHT - ]); - litegraphService.addNodeOnGraph(nodeDef, { pos }); - } else if (node.data instanceof ComfyModelDef) { - const model = node.data; - const pos = app.clientPosToCanvasPos([loc.clientX, loc.clientY]); - const nodeAtPos = app.graph.getNodeOnPos(pos[0], pos[1]); - let targetProvider = null; - let targetGraphNode = null; - if (nodeAtPos) { - const providers = modelToNodeStore.getAllNodeProviders( - model.directory - ); - for (const provider of providers) { - if (provider.nodeDef.name === nodeAtPos.comfyClass) { - targetGraphNode = nodeAtPos; - targetProvider = provider; - } - } - } - if (!targetGraphNode) { - const provider = modelToNodeStore.getNodeProvider(model.directory); - if (provider) { - targetGraphNode = litegraphService.addNodeOnGraph( - provider.nodeDef, - { - pos - } - ); - targetProvider = provider; - } - } - if (targetGraphNode) { - const widget = targetGraphNode.widgets?.find( - (widget2) => widget2.name === targetProvider?.key - ); - if (widget) { - widget.value = model.file_name; - } - } - } else if (node.data instanceof ComfyWorkflow) { - const workflow = node.data; - const position = app.clientPosToCanvasPos([ - loc.clientX, - loc.clientY - ]); - workflowService.insertWorkflow(workflow, { position }); - } - } - }, "onDrop") - }); -}, "useCanvasDrop"); -const useContextMenuTranslation = /* @__PURE__ */ __name(() => { - const f = LGraphCanvas.prototype.getCanvasMenuOptions; - const getCanvasCenterMenuOptions = /* @__PURE__ */ __name(function(...args) { - const res = f.apply(this, args); - for (const item of res) { - if (item?.content) { - item.content = st(`contextMenu.${item.content}`, item.content); - } - } - return res; - }, "getCanvasCenterMenuOptions"); - LGraphCanvas.prototype.getCanvasMenuOptions = getCanvasCenterMenuOptions; - function translateMenus(values, options) { - if (!values) return; - const reInput = /Convert (.*) to input/; - const reWidget = /Convert (.*) to widget/; - const cvt = st("contextMenu.Convert ", "Convert "); - const tinp = st("contextMenu. to input", " to input"); - const twgt = st("contextMenu. to widget", " to widget"); - for (const value of values) { - if (typeof value === "string") continue; - translateMenus(value?.submenu?.options, options); - if (!value?.content) { - continue; - } - if (te(`contextMenu.${value.content}`)) { - value.content = st(`contextMenu.${value.content}`, value.content); - } - const extraInfo = options.extra || options.parentMenu?.options?.extra; - const matchInput = value.content?.match(reInput); - if (matchInput) { - let match = matchInput[1]; - extraInfo?.inputs?.find((i) => { - if (i.name != match) return false; - match = i.label ? i.label : i.name; - }); - extraInfo?.widgets?.find((i) => { - if (i.name != match) return false; - match = i.label ? i.label : i.name; - }); - value.content = cvt + match + tinp; - continue; - } - const matchWidget = value.content?.match(reWidget); - if (matchWidget) { - let match = matchWidget[1]; - extraInfo?.inputs?.find((i) => { - if (i.name != match) return false; - match = i.label ? i.label : i.name; - }); - extraInfo?.widgets?.find((i) => { - if (i.name != match) return false; - match = i.label ? i.label : i.name; - }); - value.content = cvt + match + twgt; - continue; - } - } - } - __name(translateMenus, "translateMenus"); - const OriginalContextMenu = LiteGraph.ContextMenu; - function ContextMenu2(values, options) { - if (options.title) { - options.title = st( - `nodeDefs.${normalizeI18nKey(options.title)}.display_name`, - options.title - ); - } - translateMenus(values, options); - const ctx = new OriginalContextMenu(values, options); - return ctx; - } - __name(ContextMenu2, "ContextMenu"); - LiteGraph.ContextMenu = ContextMenu2; -}, "useContextMenuTranslation"); -const useCopy = /* @__PURE__ */ __name(() => { - const canvasStore = useCanvasStore(); - useEventListener(document, "copy", (e) => { - if (!(e.target instanceof Element)) { - return; - } - if (e.target instanceof HTMLTextAreaElement && e.target.type === "textarea" || e.target instanceof HTMLInputElement && e.target.type === "text") { - return; - } - const isTargetInGraph = e.target.classList.contains("litegraph") || e.target.classList.contains("graph-canvas-container") || e.target.id === "graph-canvas"; - const canvas = canvasStore.canvas; - if (isTargetInGraph && canvas?.selectedItems) { - canvas.copyToClipboard(); - e.clipboardData?.setData("text", " "); - e.preventDefault(); - e.stopImmediatePropagation(); - return false; - } - }); -}, "useCopy"); -const useGlobalLitegraph = /* @__PURE__ */ __name(() => { - window["LiteGraph"] = LiteGraph; - window["LGraph"] = LGraph; - window["LLink"] = LLink; - window["LGraphNode"] = LGraphNode; - window["LGraphGroup"] = LGraphGroup; - window["DragAndScale"] = DragAndScale; - window["LGraphCanvas"] = LGraphCanvas; - window["ContextMenu"] = ContextMenu; - window["LGraphBadge"] = LGraphBadge; -}, "useGlobalLitegraph"); -const useLitegraphSettings = /* @__PURE__ */ __name(() => { - const settingStore = useSettingStore(); - const canvasStore = useCanvasStore(); - watchEffect(() => { - const canvasInfoEnabled = settingStore.get("Comfy.Graph.CanvasInfo"); - if (canvasStore.canvas) { - canvasStore.canvas.show_info = canvasInfoEnabled; - } - }); - watchEffect(() => { - const zoomSpeed = settingStore.get("Comfy.Graph.ZoomSpeed"); - if (canvasStore.canvas) { - canvasStore.canvas.zoom_speed = zoomSpeed; - } - }); - watchEffect(() => { - LiteGraph.snaps_for_comfy = settingStore.get( - "Comfy.Node.AutoSnapLinkToSlot" - ); - }); - watchEffect(() => { - LiteGraph.snap_highlights_node = settingStore.get( - "Comfy.Node.SnapHighlightsNode" - ); - }); - watchEffect(() => { - LGraphNode.keepAllLinksOnBypass = settingStore.get( - "Comfy.Node.BypassAllLinksOnDelete" - ); - }); - watchEffect(() => { - LiteGraph.middle_click_slot_add_default_node = settingStore.get( - "Comfy.Node.MiddleClickRerouteNode" - ); - }); - watchEffect(() => { - const linkRenderMode = settingStore.get("Comfy.LinkRenderMode"); - if (canvasStore.canvas) { - canvasStore.canvas.links_render_mode = linkRenderMode; - canvasStore.canvas.setDirty( - /* fg */ - false, - /* bg */ - true - ); - } - }); - watchEffect(() => { - const lowQualityRenderingZoomThreshold = settingStore.get( - "LiteGraph.Canvas.LowQualityRenderingZoomThreshold" - ); - if (canvasStore.canvas) { - canvasStore.canvas.low_quality_zoom_threshold = lowQualityRenderingZoomThreshold; - canvasStore.canvas.setDirty( - /* fg */ - true, - /* bg */ - true - ); - } - }); - watchEffect(() => { - const linkMarkerShape = settingStore.get("Comfy.Graph.LinkMarkers"); - const { canvas } = canvasStore; - if (canvas) { - canvas.linkMarkerShape = linkMarkerShape; - canvas.setDirty(false, true); - } - }); - watchEffect(() => { - const reroutesEnabled = settingStore.get("Comfy.RerouteBeta"); - const { canvas } = canvasStore; - if (canvas) { - canvas.reroutesEnabled = reroutesEnabled; - canvas.setDirty(false, true); - } - }); - watchEffect(() => { - const maximumFps = settingStore.get("LiteGraph.Canvas.MaximumFps"); - const { canvas } = canvasStore; - if (canvas) canvas.maximumFps = maximumFps; - }); - watchEffect(() => { - const dragZoomEnabled = settingStore.get("Comfy.Graph.CtrlShiftZoom"); - const { canvas } = canvasStore; - if (canvas) canvas.dragZoomEnabled = dragZoomEnabled; - }); - watchEffect(() => { - CanvasPointer.doubleClickTime = settingStore.get( - "Comfy.Pointer.DoubleClickTime" - ); - }); - watchEffect(() => { - CanvasPointer.bufferTime = settingStore.get("Comfy.Pointer.ClickBufferTime"); - }); - watchEffect(() => { - CanvasPointer.maxClickDrift = settingStore.get("Comfy.Pointer.ClickDrift"); - }); - watchEffect(() => { - LiteGraph.CANVAS_GRID_SIZE = settingStore.get("Comfy.SnapToGrid.GridSize"); - }); - watchEffect(() => { - LiteGraph.alwaysSnapToGrid = settingStore.get("pysssss.SnapToGrid"); - }); - watchEffect(() => { - LiteGraph.context_menu_scaling = settingStore.get( - "LiteGraph.ContextMenu.Scaling" - ); - }); -}, "useLitegraphSettings"); -const usePaste = /* @__PURE__ */ __name(() => { - const workspaceStore = useWorkspaceStore(); - const canvasStore = useCanvasStore(); - const pasteItemOnNode = /* @__PURE__ */ __name((items, node) => { - if (!node) return; - const blob = items[0]?.getAsFile(); - if (!blob) return; - node.pasteFile?.(blob); - node.pasteFiles?.( - Array.from(items).map((i) => i.getAsFile()).filter((f) => f !== null) - ); - }, "pasteItemOnNode"); - useEventListener(document, "paste", async (e) => { - if (workspaceStore.shiftDown) return; - const canvas = canvasStore.canvas; - if (!canvas) return; - const graph = canvas.graph; - let data = e.clipboardData || window.clipboardData; - const items = data.items; - const currentNode = canvas.current_node; - const isNodeSelected = currentNode?.is_selected; - const isImageNodeSelected = isNodeSelected && isImageNode(currentNode); - const isVideoNodeSelected = isNodeSelected && isVideoNode(currentNode); - let imageNode = isImageNodeSelected ? currentNode : null; - const videoNode = isVideoNodeSelected ? currentNode : null; - for (const item of items) { - if (item.type.startsWith("image/")) { - if (!imageNode) { - const newNode = LiteGraph.createNode("LoadImage"); - newNode.pos = [...canvas.graph_mouse]; - imageNode = graph?.add(newNode) ?? null; - graph?.change(); - } - pasteItemOnNode(items, imageNode); - return; - } else if (item.type.startsWith("video/")) { - if (!videoNode) { - } else { - pasteItemOnNode(items, videoNode); - return; - } - } - } - data = data.getData("text/plain"); - let workflow = null; - try { - data = data.slice(data.indexOf("{")); - workflow = JSON.parse(data); - } catch (err) { - try { - data = data.slice(data.indexOf("workflow\n")); - data = data.slice(data.indexOf("{")); - workflow = JSON.parse(data); - } catch (error) { - workflow = null; - } - } - if (workflow && workflow.version && workflow.nodes && workflow.extra) { - await app.loadGraphData(workflow); - } else { - if (e.target instanceof HTMLTextAreaElement && e.target.type === "textarea" || e.target instanceof HTMLInputElement && e.target.type === "text") { - return; - } - canvas.pasteFromClipboard(); - } - }); -}, "usePaste"); -function useWorkflowPersistence() { - const workflowStore = useWorkflowStore(); - const settingStore = useSettingStore(); - const persistCurrentWorkflow = /* @__PURE__ */ __name(() => { - const workflow = JSON.stringify(app.serializeGraph()); - localStorage.setItem("workflow", workflow); - if (api.clientId) { - sessionStorage.setItem(`workflow:${api.clientId}`, workflow); - } - }, "persistCurrentWorkflow"); - const loadWorkflowFromStorage = /* @__PURE__ */ __name(async (json, workflowName) => { - if (!json) return false; - const workflow = JSON.parse(json); - await app.loadGraphData(workflow, true, true, workflowName); - return true; - }, "loadWorkflowFromStorage"); - const loadPreviousWorkflowFromStorage = /* @__PURE__ */ __name(async () => { - const workflowName = getStorageValue("Comfy.PreviousWorkflow"); - const clientId = api.initialClientId ?? api.clientId; - if (clientId) { - const sessionWorkflow = sessionStorage.getItem(`workflow:${clientId}`); - if (await loadWorkflowFromStorage(sessionWorkflow, workflowName)) { - return true; - } - } - const localWorkflow = localStorage.getItem("workflow"); - return await loadWorkflowFromStorage(localWorkflow, workflowName); - }, "loadPreviousWorkflowFromStorage"); - const loadDefaultWorkflow = /* @__PURE__ */ __name(async () => { - if (!settingStore.get("Comfy.TutorialCompleted")) { - await settingStore.set("Comfy.TutorialCompleted", true); - await useModelStore().loadModelFolders(); - await useWorkflowService().loadTutorialWorkflow(); - } else { - await app.loadGraphData(); - } - }, "loadDefaultWorkflow"); - const restorePreviousWorkflow = /* @__PURE__ */ __name(async () => { - try { - const restored = await loadPreviousWorkflowFromStorage(); - if (!restored) { - await loadDefaultWorkflow(); - } - } catch (err) { - console.error("Error loading previous workflow", err); - await loadDefaultWorkflow(); - } - }, "restorePreviousWorkflow"); - watchEffect(() => { - if (workflowStore.activeWorkflow) { - const workflow = workflowStore.activeWorkflow; - setStorageValue("Comfy.PreviousWorkflow", workflow.key); - persistCurrentWorkflow(); - } - }); - api.addEventListener("graphChanged", persistCurrentWorkflow); - const openWorkflows = computed(() => workflowStore.openWorkflows); - const activeWorkflow = computed(() => workflowStore.activeWorkflow); - const restoreState = computed( - () => { - if (!openWorkflows.value || !activeWorkflow.value) { - return { paths: [], activeIndex: -1 }; - } - const paths = openWorkflows.value.filter((workflow) => workflow?.isPersisted && !workflow.isModified).map((workflow) => workflow.path); - const activeIndex = openWorkflows.value.findIndex( - (workflow) => workflow.path === activeWorkflow.value?.path - ); - return { paths, activeIndex }; - } - ); - const storedWorkflows = JSON.parse( - getStorageValue("Comfy.OpenWorkflowsPaths") || "[]" - ); - const storedActiveIndex = JSON.parse( - getStorageValue("Comfy.ActiveWorkflowIndex") || "-1" - ); - watch(restoreState, ({ paths, activeIndex }) => { - setStorageValue("Comfy.OpenWorkflowsPaths", JSON.stringify(paths)); - setStorageValue("Comfy.ActiveWorkflowIndex", JSON.stringify(activeIndex)); - }); - const restoreWorkflowTabsState = /* @__PURE__ */ __name(() => { - const isRestorable = storedWorkflows?.length > 0 && storedActiveIndex >= 0; - if (isRestorable) { - workflowStore.openWorkflowsInBackground({ - left: storedWorkflows.slice(0, storedActiveIndex), - right: storedWorkflows.slice(storedActiveIndex) - }); - } - }, "restoreWorkflowTabsState"); - return { - restorePreviousWorkflow, - restoreWorkflowTabsState - }; -} -__name(useWorkflowPersistence, "useWorkflowPersistence"); -const CORE_SETTINGS = [ - { - id: "Comfy.Validation.Workflows", - name: "Validate workflows", - type: "boolean", - defaultValue: true - }, - { - id: "Comfy.NodeSearchBoxImpl", - category: ["Comfy", "Node Search Box", "Implementation"], - experimental: true, - name: "Node search box implementation", - type: "combo", - options: ["default", "litegraph (legacy)"], - defaultValue: "default" - }, - { - id: "Comfy.LinkRelease.Action", - category: ["LiteGraph", "LinkRelease", "Action"], - name: "Action on link release (No modifier)", - type: "combo", - options: Object.values(LinkReleaseTriggerAction), - defaultValue: LinkReleaseTriggerAction.CONTEXT_MENU - }, - { - id: "Comfy.LinkRelease.ActionShift", - category: ["LiteGraph", "LinkRelease", "ActionShift"], - name: "Action on link release (Shift)", - type: "combo", - options: Object.values(LinkReleaseTriggerAction), - defaultValue: LinkReleaseTriggerAction.SEARCH_BOX - }, - { - id: "Comfy.NodeSearchBoxImpl.NodePreview", - category: ["Comfy", "Node Search Box", "NodePreview"], - name: "Node preview", - tooltip: "Only applies to the default implementation", - type: "boolean", - defaultValue: true - }, - { - id: "Comfy.NodeSearchBoxImpl.ShowCategory", - category: ["Comfy", "Node Search Box", "ShowCategory"], - name: "Show node category in search results", - tooltip: "Only applies to the default implementation", - type: "boolean", - defaultValue: true - }, - { - id: "Comfy.NodeSearchBoxImpl.ShowIdName", - category: ["Comfy", "Node Search Box", "ShowIdName"], - name: "Show node id name in search results", - tooltip: "Only applies to the default implementation", - type: "boolean", - defaultValue: false - }, - { - id: "Comfy.NodeSearchBoxImpl.ShowNodeFrequency", - category: ["Comfy", "Node Search Box", "ShowNodeFrequency"], - name: "Show node frequency in search results", - tooltip: "Only applies to the default implementation", - type: "boolean", - defaultValue: false - }, - { - id: "Comfy.Sidebar.Location", - category: ["Appearance", "Sidebar", "Location"], - name: "Sidebar location", - type: "combo", - options: ["left", "right"], - defaultValue: "left" - }, - { - id: "Comfy.Sidebar.Size", - category: ["Appearance", "Sidebar", "Size"], - name: "Sidebar size", - type: "combo", - options: ["normal", "small"], - // Default to small if the window is less than 1536px(2xl) wide. - defaultValue: /* @__PURE__ */ __name(() => window.innerWidth < 1536 ? "small" : "normal", "defaultValue") - }, - { - id: "Comfy.TextareaWidget.FontSize", - category: ["Appearance", "Node Widget", "TextareaWidget", "FontSize"], - name: "Textarea widget font size", - type: "slider", - defaultValue: 10, - attrs: { - min: 8, - max: 24 - } - }, - { - id: "Comfy.TextareaWidget.Spellcheck", - category: ["Comfy", "Node Widget", "TextareaWidget", "Spellcheck"], - name: "Textarea widget spellcheck", - type: "boolean", - defaultValue: false - }, - { - id: "Comfy.Workflow.SortNodeIdOnSave", - name: "Sort node IDs when saving workflow", - type: "boolean", - defaultValue: false - }, - { - id: "Comfy.Graph.CanvasInfo", - category: ["LiteGraph", "Canvas", "CanvasInfo"], - name: "Show canvas info on bottom left corner (fps, etc.)", - type: "boolean", - defaultValue: true - }, - { - id: "Comfy.Node.ShowDeprecated", - name: "Show deprecated nodes in search", - tooltip: "Deprecated nodes are hidden by default in the UI, but remain functional in existing workflows that use them.", - type: "boolean", - defaultValue: false - }, - { - id: "Comfy.Node.ShowExperimental", - name: "Show experimental nodes in search", - tooltip: "Experimental nodes are marked as such in the UI and may be subject to significant changes or removal in future versions. Use with caution in production workflows", - type: "boolean", - defaultValue: true - }, - { - id: "Comfy.Node.Opacity", - category: ["Appearance", "Node", "Opacity"], - name: "Node opacity", - type: "slider", - defaultValue: 1, - attrs: { - min: 0.01, - max: 1, - step: 0.01 - } - }, - { - id: "Comfy.Workflow.ShowMissingNodesWarning", - name: "Show missing nodes warning", - type: "boolean", - defaultValue: true - }, - { - id: "Comfy.Workflow.ShowMissingModelsWarning", - name: "Show missing models warning", - type: "boolean", - defaultValue: true, - experimental: true - }, - { - id: "Comfy.Graph.ZoomSpeed", - category: ["LiteGraph", "Canvas", "ZoomSpeed"], - name: "Canvas zoom speed", - type: "slider", - defaultValue: 1.1, - attrs: { - min: 1.01, - max: 2.5, - step: 0.01 - } - }, - // Bookmarks are stored in the settings store. - // Bookmarks are in format of category/display_name. e.g. "conditioning/CLIPTextEncode" - { - id: "Comfy.NodeLibrary.Bookmarks", - name: "Node library bookmarks with display name (deprecated)", - type: "hidden", - defaultValue: [], - deprecated: true - }, - { - id: "Comfy.NodeLibrary.Bookmarks.V2", - name: "Node library bookmarks v2 with unique name", - type: "hidden", - defaultValue: [] - }, - // Stores mapping from bookmark folder name to its customization. - { - id: "Comfy.NodeLibrary.BookmarksCustomization", - name: "Node library bookmarks customization", - type: "hidden", - defaultValue: {} - }, - // Hidden setting used by the queue for how to fit images - { - id: "Comfy.Queue.ImageFit", - name: "Queue image fit", - type: "hidden", - defaultValue: "cover" - }, - { - id: "Comfy.GroupSelectedNodes.Padding", - category: ["LiteGraph", "Group", "Padding"], - name: "Group selected nodes padding", - type: "slider", - defaultValue: 10, - attrs: { - min: 0, - max: 100 - } - }, - { - id: "Comfy.Node.DoubleClickTitleToEdit", - category: ["LiteGraph", "Node", "DoubleClickTitleToEdit"], - name: "Double click node title to edit", - type: "boolean", - defaultValue: true - }, - { - id: "Comfy.Group.DoubleClickTitleToEdit", - category: ["LiteGraph", "Group", "DoubleClickTitleToEdit"], - name: "Double click group title to edit", - type: "boolean", - defaultValue: true - }, - { - id: "Comfy.Window.UnloadConfirmation", - name: "Show confirmation when closing window", - type: "boolean", - defaultValue: true, - versionModified: "1.7.12" - }, - { - id: "Comfy.TreeExplorer.ItemPadding", - category: ["Appearance", "Tree Explorer", "ItemPadding"], - name: "Tree explorer item padding", - type: "slider", - defaultValue: 2, - attrs: { - min: 0, - max: 8, - step: 1 - } - }, - { - id: "Comfy.ModelLibrary.AutoLoadAll", - name: "Automatically load all model folders", - tooltip: "If true, all folders will load as soon as you open the model library (this may cause delays while it loads). If false, root level model folders will only load once you click on them.", - type: "boolean", - defaultValue: false - }, - { - id: "Comfy.ModelLibrary.NameFormat", - name: "What name to display in the model library tree view", - tooltip: 'Select "filename" to render a simplified view of the raw filename (without directory or ".safetensors" extension) in the model list. Select "title" to display the configurable model metadata title.', - type: "combo", - options: ["filename", "title"], - defaultValue: "title" - }, - { - id: "Comfy.Locale", - name: "Language", - type: "combo", - options: [ - { value: "en", text: "English" }, - { value: "zh", text: "中文" }, - { value: "ru", text: "Русский" }, - { value: "ja", text: "日本語" }, - { value: "ko", text: "한국어" }, - { value: "fr", text: "Français" } - ], - defaultValue: /* @__PURE__ */ __name(() => navigator.language.split("-")[0] || "en", "defaultValue") - }, - { - id: "Comfy.NodeBadge.NodeSourceBadgeMode", - category: ["LiteGraph", "Node", "NodeSourceBadgeMode"], - name: "Node source badge mode", - type: "combo", - options: Object.values(NodeBadgeMode), - defaultValue: NodeBadgeMode.HideBuiltIn - }, - { - id: "Comfy.NodeBadge.NodeIdBadgeMode", - category: ["LiteGraph", "Node", "NodeIdBadgeMode"], - name: "Node ID badge mode", - type: "combo", - options: [NodeBadgeMode.None, NodeBadgeMode.ShowAll], - defaultValue: NodeBadgeMode.None - }, - { - id: "Comfy.NodeBadge.NodeLifeCycleBadgeMode", - category: ["LiteGraph", "Node", "NodeLifeCycleBadgeMode"], - name: "Node life cycle badge mode", - type: "combo", - options: [NodeBadgeMode.None, NodeBadgeMode.ShowAll], - defaultValue: NodeBadgeMode.ShowAll - }, - { - id: "Comfy.ConfirmClear", - category: ["Comfy", "Workflow", "ConfirmClear"], - name: "Require confirmation when clearing workflow", - type: "boolean", - defaultValue: true - }, - { - id: "Comfy.PromptFilename", - category: ["Comfy", "Workflow", "PromptFilename"], - name: "Prompt for filename when saving workflow", - type: "boolean", - defaultValue: true - }, - /** - * file format for preview - * - * format;quality - * - * ex) - * webp;50 -> webp, quality 50 - * jpeg;80 -> rgb, jpeg, quality 80 - * - * @type {string} - */ - { - id: "Comfy.PreviewFormat", - category: ["LiteGraph", "Node Widget", "PreviewFormat"], - name: "Preview image format", - tooltip: "When displaying a preview in the image widget, convert it to a lightweight image, e.g. webp, jpeg, webp;50, etc.", - type: "text", - defaultValue: "" - }, - { - id: "Comfy.DisableSliders", - category: ["LiteGraph", "Node Widget", "DisableSliders"], - name: "Disable node widget sliders", - type: "boolean", - defaultValue: false - }, - { - id: "Comfy.DisableFloatRounding", - category: ["LiteGraph", "Node Widget", "DisableFloatRounding"], - name: "Disable default float widget rounding.", - tooltip: "(requires page reload) Cannot disable round when round is set by the node in the backend.", - type: "boolean", - defaultValue: false - }, - { - id: "Comfy.FloatRoundingPrecision", - category: ["LiteGraph", "Node Widget", "FloatRoundingPrecision"], - name: "Float widget rounding decimal places [0 = auto].", - tooltip: "(requires page reload)", - type: "slider", - attrs: { - min: 0, - max: 6, - step: 1 - }, - defaultValue: 0 - }, - { - id: "LiteGraph.Node.TooltipDelay", - name: "Tooltip Delay", - type: "number", - attrs: { - min: 100, - max: 3e3, - step: 50 - }, - defaultValue: 500, - versionAdded: "1.9.0" - }, - { - id: "Comfy.EnableTooltips", - category: ["LiteGraph", "Node", "EnableTooltips"], - name: "Enable Tooltips", - type: "boolean", - defaultValue: true - }, - { - id: "Comfy.DevMode", - name: "Enable dev mode options (API save, etc.)", - type: "boolean", - defaultValue: false, - onChange: /* @__PURE__ */ __name((value) => { - const element = document.getElementById("comfy-dev-save-api-button"); - if (element) { - element.style.display = value ? "flex" : "none"; - } - }, "onChange") - }, - { - id: "Comfy.UseNewMenu", - category: ["Comfy", "Menu", "UseNewMenu"], - defaultValue: "Top", - name: "Use new menu", - type: "combo", - options: ["Disabled", "Top", "Bottom"], - migrateDeprecatedValue: /* @__PURE__ */ __name((value) => { - if (value === "Floating") { - return "Top"; - } - return value; - }, "migrateDeprecatedValue") - }, - { - id: "Comfy.Workflow.WorkflowTabsPosition", - name: "Opened workflows position", - type: "combo", - options: ["Sidebar", "Topbar", "Topbar (2nd-row)"], - // Default to topbar (2nd-row) if the window is less than 1536px(2xl) wide. - defaultValue: /* @__PURE__ */ __name(() => window.innerWidth < 1536 ? "Topbar (2nd-row)" : "Topbar", "defaultValue") - }, - { - id: "Comfy.Graph.CanvasMenu", - category: ["LiteGraph", "Canvas", "CanvasMenu"], - name: "Show graph canvas menu", - type: "boolean", - defaultValue: true - }, - { - id: "Comfy.QueueButton.BatchCountLimit", - name: "Batch count limit", - tooltip: "The maximum number of tasks added to the queue at one button click", - type: "number", - defaultValue: 100, - versionAdded: "1.3.5" - }, - { - id: "Comfy.Keybinding.UnsetBindings", - name: "Keybindings unset by the user", - type: "hidden", - defaultValue: [], - versionAdded: "1.3.7", - versionModified: "1.7.3", - migrateDeprecatedValue: /* @__PURE__ */ __name((value) => { - return value.map((keybinding) => { - if (keybinding["targetSelector"] === "#graph-canvas") { - keybinding["targetElementId"] = "graph-canvas"; - } - return keybinding; - }); - }, "migrateDeprecatedValue") - }, - { - id: "Comfy.Keybinding.NewBindings", - name: "Keybindings set by the user", - type: "hidden", - defaultValue: [], - versionAdded: "1.3.7" - }, - { - id: "Comfy.Extension.Disabled", - name: "Disabled extension names", - type: "hidden", - defaultValue: [], - versionAdded: "1.3.11" - }, - { - id: "Comfy.Validation.NodeDefs", - name: "Validate node definitions (slow)", - type: "boolean", - tooltip: "Recommended for node developers. This will validate all node definitions on startup.", - defaultValue: false, - versionAdded: "1.3.14" - }, - { - id: "Comfy.LinkRenderMode", - category: ["LiteGraph", "Graph", "LinkRenderMode"], - name: "Link Render Mode", - defaultValue: 2, - type: "combo", - options: [ - { value: LiteGraph.STRAIGHT_LINK, text: "Straight" }, - { value: LiteGraph.LINEAR_LINK, text: "Linear" }, - { value: LiteGraph.SPLINE_LINK, text: "Spline" }, - { value: LiteGraph.HIDDEN_LINK, text: "Hidden" } - ] - }, - { - id: "Comfy.Node.AutoSnapLinkToSlot", - category: ["LiteGraph", "Node", "AutoSnapLinkToSlot"], - name: "Auto snap link to node slot", - tooltip: "When dragging a link over a node, the link automatically snap to a viable input slot on the node", - type: "boolean", - defaultValue: true, - versionAdded: "1.3.29" - }, - { - id: "Comfy.Node.SnapHighlightsNode", - category: ["LiteGraph", "Node", "SnapHighlightsNode"], - name: "Snap highlights node", - tooltip: "When dragging a link over a node with viable input slot, highlight the node", - type: "boolean", - defaultValue: true, - versionAdded: "1.3.29" - }, - { - id: "Comfy.Node.BypassAllLinksOnDelete", - category: ["LiteGraph", "Node", "BypassAllLinksOnDelete"], - name: "Keep all links when deleting nodes", - tooltip: "When deleting a node, attempt to reconnect all of its input and output links (bypassing the deleted node)", - type: "boolean", - defaultValue: true, - versionAdded: "1.3.40" - }, - { - id: "Comfy.Node.MiddleClickRerouteNode", - category: ["LiteGraph", "Node", "MiddleClickRerouteNode"], - name: "Middle-click creates a new Reroute node", - type: "boolean", - defaultValue: true, - versionAdded: "1.3.42" - }, - { - id: "Comfy.RerouteBeta", - category: ["LiteGraph", "RerouteBeta"], - name: "Opt-in to the reroute beta test", - tooltip: "Enables the new native reroutes.\n\nReroutes can be added by holding alt and dragging from a link line, or on the link menu.\n\nDisabling this option is non-destructive - reroutes are hidden.", - experimental: true, - type: "boolean", - defaultValue: false, - versionAdded: "1.3.42" - }, - { - id: "Comfy.Graph.LinkMarkers", - category: ["LiteGraph", "Link", "LinkMarkers"], - name: "Link midpoint markers", - defaultValue: LinkMarkerShape.Circle, - type: "combo", - options: [ - { value: LinkMarkerShape.None, text: "None" }, - { value: LinkMarkerShape.Circle, text: "Circle" }, - { value: LinkMarkerShape.Arrow, text: "Arrow" } - ], - versionAdded: "1.3.42" - }, - { - id: "Comfy.DOMClippingEnabled", - category: ["LiteGraph", "Node", "DOMClippingEnabled"], - name: "Enable DOM element clipping (enabling may reduce performance)", - type: "boolean", - defaultValue: true - }, - { - id: "Comfy.Graph.CtrlShiftZoom", - category: ["LiteGraph", "Canvas", "CtrlShiftZoom"], - name: "Enable fast-zoom shortcut (Ctrl + Shift + Drag)", - type: "boolean", - defaultValue: true, - versionAdded: "1.4.0" - }, - { - id: "Comfy.Pointer.ClickDrift", - category: ["LiteGraph", "Pointer", "ClickDrift"], - name: "Pointer click drift (maximum distance)", - tooltip: "If the pointer moves more than this distance while holding a button down, it is considered dragging (rather than clicking).\n\nHelps prevent objects from being unintentionally nudged if the pointer is moved whilst clicking.", - experimental: true, - type: "slider", - attrs: { - min: 0, - max: 20, - step: 1 - }, - defaultValue: 6, - versionAdded: "1.4.3" - }, - { - id: "Comfy.Pointer.ClickBufferTime", - category: ["LiteGraph", "Pointer", "ClickBufferTime"], - name: "Pointer click drift delay", - tooltip: "After pressing a pointer button down, this is the maximum time (in milliseconds) that pointer movement can be ignored for.\n\nHelps prevent objects from being unintentionally nudged if the pointer is moved whilst clicking.", - experimental: true, - type: "slider", - attrs: { - min: 0, - max: 1e3, - step: 25 - }, - defaultValue: 150, - versionAdded: "1.4.3" - }, - { - id: "Comfy.Pointer.DoubleClickTime", - category: ["LiteGraph", "Pointer", "DoubleClickTime"], - name: "Double click interval (maximum)", - tooltip: "The maximum time in milliseconds between the two clicks of a double-click. Increasing this value may assist if double-clicks are sometimes not registered.", - type: "slider", - attrs: { - min: 100, - max: 1e3, - step: 50 - }, - defaultValue: 300, - versionAdded: "1.4.3" - }, - { - id: "Comfy.SnapToGrid.GridSize", - category: ["LiteGraph", "Canvas", "GridSize"], - name: "Snap to grid size", - type: "slider", - attrs: { - min: 1, - max: 500 - }, - tooltip: "When dragging and resizing nodes while holding shift they will be aligned to the grid, this controls the size of that grid.", - defaultValue: LiteGraph.CANVAS_GRID_SIZE - }, - // Keep the 'pysssss.SnapToGrid' setting id so we don't need to migrate setting values. - // Using a new setting id can cause existing users to lose their existing settings. - { - id: "pysssss.SnapToGrid", - category: ["LiteGraph", "Canvas", "AlwaysSnapToGrid"], - name: "Always snap to grid", - type: "boolean", - defaultValue: false, - versionAdded: "1.3.13" - }, - { - id: "Comfy.Server.ServerConfigValues", - name: "Server config values for frontend display", - tooltip: "Server config values used for frontend display only", - type: "hidden", - // Mapping from server config id to value. - defaultValue: {}, - versionAdded: "1.4.8" - }, - { - id: "Comfy.Server.LaunchArgs", - name: "Server launch arguments", - tooltip: "These are the actual arguments that are passed to the server when it is launched.", - type: "hidden", - defaultValue: {}, - versionAdded: "1.4.8" - }, - { - id: "Comfy.Queue.MaxHistoryItems", - name: "Queue history size", - tooltip: "The maximum number of tasks that show in the queue history.", - type: "slider", - attrs: { - min: 16, - max: 256, - step: 16 - }, - defaultValue: 64, - versionAdded: "1.4.12" - }, - { - id: "LiteGraph.Canvas.MaximumFps", - name: "Maximum FPS", - tooltip: "The maximum frames per second that the canvas is allowed to render. Caps GPU usage at the cost of smoothness. If 0, the screen refresh rate is used. Default: 0", - type: "slider", - attrs: { - min: 0, - max: 120 - }, - defaultValue: 0, - versionAdded: "1.5.1" - }, - { - id: "Comfy.EnableWorkflowViewRestore", - category: ["Comfy", "Workflow", "EnableWorkflowViewRestore"], - name: "Save and restore canvas position and zoom level in workflows", - type: "boolean", - defaultValue: true, - versionModified: "1.5.4" - }, - { - id: "Comfy.Workflow.ConfirmDelete", - name: "Show confirmation when deleting workflows", - type: "boolean", - defaultValue: true, - versionAdded: "1.5.6" - }, - { - id: "Comfy.ColorPalette", - name: "The active color palette id", - type: "hidden", - defaultValue: "dark", - versionModified: "1.6.7", - migrateDeprecatedValue(value) { - return value.startsWith("custom_") ? value.replace("custom_", "") : value; - } - }, - { - id: "Comfy.CustomColorPalettes", - name: "Custom color palettes", - type: "hidden", - defaultValue: {}, - versionModified: "1.6.7" - }, - { - id: "Comfy.WidgetControlMode", - category: ["Comfy", "Node Widget", "WidgetControlMode"], - name: "Widget control mode", - tooltip: "Controls when widget values are updated (randomize/increment/decrement), either before the prompt is queued or after.", - type: "combo", - defaultValue: "after", - options: ["before", "after"], - versionModified: "1.6.10" - }, - { - id: "Comfy.TutorialCompleted", - name: "Tutorial completed", - type: "hidden", - defaultValue: false, - versionAdded: "1.8.7" - }, - { - id: "LiteGraph.ContextMenu.Scaling", - name: "Scale node combo widget menus (lists) when zoomed in", - defaultValue: false, - type: "boolean", - versionAdded: "1.8.8" - }, - { - id: "LiteGraph.Canvas.LowQualityRenderingZoomThreshold", - name: "Low quality rendering zoom threshold", - tooltip: "Render low quality shapes when zoomed out", - type: "slider", - attrs: { - min: 0.1, - max: 1, - step: 0.01 - }, - defaultValue: 0.6, - versionAdded: "1.9.1" - }, - { - id: "Comfy.Canvas.SelectionToolbox", - category: ["LiteGraph", "Canvas", "SelectionToolbox"], - name: "Show selection toolbox", - type: "boolean", - defaultValue: true, - versionAdded: "1.10.5" - } -]; -const _sfc_main$8 = /* @__PURE__ */ defineComponent({ - __name: "GraphCanvas", - emits: ["ready"], - setup(__props, { emit: __emit }) { - const emit = __emit; - const canvasRef = ref(null); - const settingStore = useSettingStore(); - const nodeDefStore = useNodeDefStore(); - const workspaceStore = useWorkspaceStore(); - const canvasStore = useCanvasStore(); - const betaMenuEnabled = computed( - () => settingStore.get("Comfy.UseNewMenu") !== "Disabled" - ); - const workflowTabsPosition = computed( - () => settingStore.get("Comfy.Workflow.WorkflowTabsPosition") - ); - const canvasMenuEnabled = computed( - () => settingStore.get("Comfy.Graph.CanvasMenu") - ); - const tooltipEnabled = computed(() => settingStore.get("Comfy.EnableTooltips")); - const selectionToolboxEnabled = computed( - () => settingStore.get("Comfy.Canvas.SelectionToolbox") - ); - watchEffect(() => { - nodeDefStore.showDeprecated = settingStore.get("Comfy.Node.ShowDeprecated"); - }); - watchEffect(() => { - nodeDefStore.showExperimental = settingStore.get( - "Comfy.Node.ShowExperimental" - ); - }); - watchEffect(() => { - const spellcheckEnabled = settingStore.get("Comfy.TextareaWidget.Spellcheck"); - const textareas = document.querySelectorAll("textarea.comfy-multiline-input"); - textareas.forEach((textarea) => { - textarea.spellcheck = spellcheckEnabled; - textarea.focus(); - textarea.blur(); - }); - }); - watch( - () => settingStore.get("Comfy.WidgetControlMode"), - () => { - if (!canvasStore.canvas) return; - for (const n of app.graph.nodes) { - if (!n.widgets) continue; - for (const w of n.widgets) { - if (w[IS_CONTROL_WIDGET]) { - updateControlWidgetLabel(w); - if (w.linkedWidgets) { - for (const l of w.linkedWidgets) { - updateControlWidgetLabel(l); - } - } - } - } - } - app.graph.setDirtyCanvas(true); - } - ); - const colorPaletteService = useColorPaletteService(); - const colorPaletteStore = useColorPaletteStore(); - watch( - [() => canvasStore.canvas, () => settingStore.get("Comfy.ColorPalette")], - ([canvas, currentPaletteId]) => { - if (!canvas) return; - colorPaletteService.loadColorPalette(currentPaletteId); - } - ); - watch( - () => colorPaletteStore.activePaletteId, - (newValue) => { - settingStore.set("Comfy.ColorPalette", newValue); - } - ); - const loadCustomNodesI18n = /* @__PURE__ */ __name(async () => { - try { - const i18nData = await api.getCustomNodesI18n(); - Object.entries(i18nData).forEach(([locale, message]) => { - i18n.global.mergeLocaleMessage(locale, message); - }); - } catch (error) { - console.error("Failed to load custom nodes i18n", error); - } - }, "loadCustomNodesI18n"); - const comfyAppReady = ref(false); - const workflowPersistence = useWorkflowPersistence(); - useCanvasDrop(canvasRef); - useLitegraphSettings(); - onMounted(async () => { - useGlobalLitegraph(); - useContextMenuTranslation(); - useCopy(); - usePaste(); - app.vueAppReady = true; - workspaceStore.spinner = true; - ChangeTracker.init(app); - await loadCustomNodesI18n(); - await settingStore.loadSettingValues(); - CORE_SETTINGS.forEach((setting) => { - settingStore.addSetting(setting); - }); - await app.setup(canvasRef.value); - canvasStore.canvas = app.canvas; - canvasStore.canvas.render_canvas_border = false; - workspaceStore.spinner = false; - window["app"] = app; - window["graph"] = app.graph; - comfyAppReady.value = true; - app.canvas.onSelectionChange = useChainCallback( - app.canvas.onSelectionChange, - () => canvasStore.updateSelectedItems() - ); - colorPaletteStore.customPalettes = settingStore.get( - "Comfy.CustomColorPalettes" - ); - await workflowPersistence.restorePreviousWorkflow(); - workflowPersistence.restoreWorkflowTabsState(); - watch( - () => settingStore.get("Comfy.Locale"), - async () => { - await useCommandStore().execute("Comfy.RefreshNodeDefinitions"); - useWorkflowService().reloadCurrentWorkflow(); - } - ); - emit("ready"); - }); - return (_ctx, _cache) => { - return openBlock(), createElementBlock(Fragment, null, [ - comfyAppReady.value && betaMenuEnabled.value && !unref(workspaceStore).focusMode ? (openBlock(), createBlock(LiteGraphCanvasSplitterOverlay, { key: 0 }, { - "side-bar-panel": withCtx(() => [ - createVNode(SideToolbar) - ]), - "bottom-panel": withCtx(() => [ - createVNode(_sfc_main$s) - ]), - "graph-canvas-panel": withCtx(() => [ - workflowTabsPosition.value === "Topbar (2nd-row)" ? (openBlock(), createBlock(SecondRowWorkflowTabs, { - key: 0, - class: "pointer-events-auto" - })) : createCommentVNode("", true), - canvasMenuEnabled.value ? (openBlock(), createBlock(GraphCanvasMenu, { - key: 1, - class: "pointer-events-auto" - })) : createCommentVNode("", true) - ]), - _: 1 - })) : createCommentVNode("", true), - createVNode(TitleEditor), - !betaMenuEnabled.value && canvasMenuEnabled.value ? (openBlock(), createBlock(GraphCanvasMenu, { key: 1 })) : createCommentVNode("", true), - createBaseVNode("canvas", { - ref_key: "canvasRef", - ref: canvasRef, - id: "graph-canvas", - tabindex: "1", - class: "w-full h-full touch-none" - }, null, 512), - createVNode(_sfc_main$h), - selectionToolboxEnabled.value ? (openBlock(), createBlock(SelectionOverlay, { key: 2 }, { - default: withCtx(() => [ - createVNode(SelectionToolbox) - ]), - _: 1 - })) : createCommentVNode("", true), - tooltipEnabled.value ? (openBlock(), createBlock(NodeTooltip, { key: 3 })) : createCommentVNode("", true), - createVNode(_sfc_main$q) - ], 64); - }; - } -}); -const _sfc_main$7 = /* @__PURE__ */ defineComponent({ - __name: "GlobalToast", - setup(__props) { - const toast = useToast(); - const toastStore = useToastStore(); - const settingStore = useSettingStore(); - watch( - () => toastStore.messagesToAdd, - (newMessages) => { - if (newMessages.length === 0) { - return; - } - newMessages.forEach((message) => { - toast.add(message); - }); - toastStore.messagesToAdd = []; - }, - { deep: true } - ); - watch( - () => toastStore.messagesToRemove, - (messagesToRemove) => { - if (messagesToRemove.length === 0) { - return; - } - messagesToRemove.forEach((message) => { - toast.remove(message); - }); - toastStore.messagesToRemove = []; - }, - { deep: true } - ); - watch( - () => toastStore.removeAllRequested, - (requested) => { - if (requested) { - toast.removeAllGroups(); - toastStore.removeAllRequested = false; - } - } - ); - function updateToastPosition() { - const styleElement = document.getElementById("dynamic-toast-style") || createStyleElement(); - const rect = document.querySelector(".graph-canvas-container").getBoundingClientRect(); - styleElement.textContent = ` - .p-toast.p-component.p-toast-top-right { - top: ${rect.top + 20}px !important; - right: ${window.innerWidth - (rect.left + rect.width) + 20}px !important; - } - `; - } - __name(updateToastPosition, "updateToastPosition"); - function createStyleElement() { - const style = document.createElement("style"); - style.id = "dynamic-toast-style"; - document.head.appendChild(style); - return style; - } - __name(createStyleElement, "createStyleElement"); - watch( - () => settingStore.get("Comfy.UseNewMenu"), - () => nextTick(updateToastPosition), - { immediate: true } - ); - watch( - () => settingStore.get("Comfy.Sidebar.Location"), - () => nextTick(updateToastPosition), - { immediate: true } - ); - return (_ctx, _cache) => { - return openBlock(), createBlock(unref(script$g)); - }; - } -}); -const _hoisted_1$a = { - viewBox: "0 0 24 24", - width: "1.2em", - height: "1.2em" -}; -function render$5(_ctx, _cache) { - return openBlock(), createElementBlock("svg", _hoisted_1$a, _cache[0] || (_cache[0] = [ - createBaseVNode("path", { - fill: "none", - stroke: "currentColor", - "stroke-linecap": "round", - "stroke-linejoin": "round", - "stroke-width": "2", - d: "M6 4v16m4-16l10 8l-10 8z" - }, null, -1) - ])); -} -__name(render$5, "render$5"); -const __unplugin_components_3 = markRaw({ name: "lucide-step-forward", render: render$5 }); -const _hoisted_1$9 = { - viewBox: "0 0 24 24", - width: "1.2em", - height: "1.2em" -}; -function render$4(_ctx, _cache) { - return openBlock(), createElementBlock("svg", _hoisted_1$9, _cache[0] || (_cache[0] = [ - createBaseVNode("path", { - fill: "none", - stroke: "currentColor", - "stroke-linecap": "round", - "stroke-linejoin": "round", - "stroke-width": "2", - d: "m13 19l9-7l-9-7zM2 19l9-7l-9-7z" - }, null, -1) - ])); -} -__name(render$4, "render$4"); -const __unplugin_components_2 = markRaw({ name: "lucide-fast-forward", render: render$4 }); -const _hoisted_1$8 = { - viewBox: "0 0 24 24", - width: "1.2em", - height: "1.2em" -}; -function render$3(_ctx, _cache) { - return openBlock(), createElementBlock("svg", _hoisted_1$8, _cache[0] || (_cache[0] = [ - createBaseVNode("path", { - fill: "none", - stroke: "currentColor", - "stroke-linecap": "round", - "stroke-linejoin": "round", - "stroke-width": "2", - d: "m6 3l14 9l-14 9z" - }, null, -1) - ])); -} -__name(render$3, "render$3"); -const __unplugin_components_1$1 = markRaw({ name: "lucide-play", render: render$3 }); -const _hoisted_1$7 = { - viewBox: "0 0 24 24", - width: "1.2em", - height: "1.2em" -}; -function render$2(_ctx, _cache) { - return openBlock(), createElementBlock("svg", _hoisted_1$7, _cache[0] || (_cache[0] = [ - createBaseVNode("g", { - fill: "none", - stroke: "currentColor", - "stroke-linecap": "round", - "stroke-linejoin": "round", - "stroke-width": "2" - }, [ - createBaseVNode("path", { d: "M16 12H3m13 6H3m7-12H3m18 12V8a2 2 0 0 0-2-2h-5" }), - createBaseVNode("path", { d: "m16 8l-2-2l2-2" }) - ], -1) - ])); -} -__name(render$2, "render$2"); -const __unplugin_components_0$1 = markRaw({ name: "lucide-list-start", render: render$2 }); -const _hoisted_1$6 = ["aria-label"]; -const minQueueCount = 1; -const _sfc_main$6 = /* @__PURE__ */ defineComponent({ - __name: "BatchCountEdit", - props: { - class: { default: "" } - }, - setup(__props) { - const props = __props; - const queueSettingsStore = useQueueSettingsStore(); - const { batchCount } = storeToRefs(queueSettingsStore); - const settingStore = useSettingStore(); - const maxQueueCount = computed( - () => settingStore.get("Comfy.QueueButton.BatchCountLimit") - ); - const handleClick = /* @__PURE__ */ __name((increment) => { - let newCount; - if (increment) { - const originalCount = batchCount.value - 1; - newCount = Math.min(originalCount * 2, maxQueueCount.value); - } else { - const originalCount = batchCount.value + 1; - newCount = Math.floor(originalCount / 2); - } - batchCount.value = newCount; - }, "handleClick"); - return (_ctx, _cache) => { - const _directive_tooltip = resolveDirective("tooltip"); - return withDirectives((openBlock(), createElementBlock("div", { - class: normalizeClass(["batch-count", props.class]), - "aria-label": _ctx.$t("menu.batchCount") - }, [ - createVNode(unref(script$h), { - class: "w-14", - modelValue: unref(batchCount), - "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(batchCount) ? batchCount.value = $event : null), - min: minQueueCount, - max: maxQueueCount.value, - fluid: "", - showButtons: "", - pt: { - incrementButton: { - class: "w-6", - onmousedown: /* @__PURE__ */ __name(() => { - handleClick(true); - }, "onmousedown") - }, - decrementButton: { - class: "w-6", - onmousedown: /* @__PURE__ */ __name(() => { - handleClick(false); - }, "onmousedown") - } - } - }, null, 8, ["modelValue", "max", "pt"]) - ], 10, _hoisted_1$6)), [ - [ - _directive_tooltip, - { - value: _ctx.$t("menu.batchCount"), - showDelay: 600 - }, - void 0, - { bottom: true } - ] - ]); - }; - } -}); -const BatchCountEdit = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-2dc25459"]]); -const _hoisted_1$5 = { class: "queue-button-group flex" }; -const _sfc_main$5 = /* @__PURE__ */ defineComponent({ - __name: "ComfyQueueButton", - setup(__props) { - const workspaceStore = useWorkspaceStore(); - const queueCountStore = storeToRefs(useQueuePendingTaskCountStore()); - const { mode: queueMode } = storeToRefs(useQueueSettingsStore()); - const { t: t2 } = useI18n(); - const queueModeMenuItemLookup = computed(() => ({ - disabled: { - key: "disabled", - label: t2("menu.queue"), - tooltip: t2("menu.disabledTooltip"), - command: /* @__PURE__ */ __name(() => { - queueMode.value = "disabled"; - }, "command") - }, - instant: { - key: "instant", - label: `${t2("menu.queue")} (${t2("menu.instant")})`, - tooltip: t2("menu.instantTooltip"), - command: /* @__PURE__ */ __name(() => { - queueMode.value = "instant"; - }, "command") - }, - change: { - key: "change", - label: `${t2("menu.queue")} (${t2("menu.onChange")})`, - tooltip: t2("menu.onChangeTooltip"), - command: /* @__PURE__ */ __name(() => { - queueMode.value = "change"; - }, "command") - } - })); - const activeQueueModeMenuItem = computed( - () => queueModeMenuItemLookup.value[queueMode.value] - ); - const queueModeMenuItems = computed( - () => Object.values(queueModeMenuItemLookup.value) - ); - const executingPrompt = computed(() => !!queueCountStore.count.value); - const hasPendingTasks = computed( - () => queueCountStore.count.value > 1 || queueMode.value !== "disabled" - ); - const commandStore = useCommandStore(); - const queuePrompt = /* @__PURE__ */ __name((e) => { - const commandId = e.shiftKey ? "Comfy.QueuePromptFront" : "Comfy.QueuePrompt"; - commandStore.execute(commandId); - }, "queuePrompt"); - return (_ctx, _cache) => { - const _component_i_lucide58list_start = __unplugin_components_0$1; - const _component_i_lucide58play = __unplugin_components_1$1; - const _component_i_lucide58fast_forward = __unplugin_components_2; - const _component_i_lucide58step_forward = __unplugin_components_3; - const _directive_tooltip = resolveDirective("tooltip"); - return openBlock(), createElementBlock("div", _hoisted_1$5, [ - withDirectives((openBlock(), createBlock(unref(script$i), { - class: "comfyui-queue-button", - label: activeQueueModeMenuItem.value.label, - severity: "primary", - size: "small", - onClick: queuePrompt, - model: queueModeMenuItems.value, - "data-testid": "queue-button" - }, { - icon: withCtx(() => [ - unref(workspaceStore).shiftDown ? (openBlock(), createBlock(_component_i_lucide58list_start, { key: 0 })) : unref(queueMode) === "disabled" ? (openBlock(), createBlock(_component_i_lucide58play, { key: 1 })) : unref(queueMode) === "instant" ? (openBlock(), createBlock(_component_i_lucide58fast_forward, { key: 2 })) : unref(queueMode) === "change" ? (openBlock(), createBlock(_component_i_lucide58step_forward, { key: 3 })) : createCommentVNode("", true) - ]), - item: withCtx(({ item }) => [ - withDirectives(createVNode(unref(script), { - label: String(item.label), - icon: item.icon, - severity: item.key === unref(queueMode) ? "primary" : "secondary", - size: "small", - text: "" - }, null, 8, ["label", "icon", "severity"]), [ - [_directive_tooltip, { - value: item.tooltip, - showDelay: 600 - }] - ]) - ]), - _: 1 - }, 8, ["label", "model"])), [ - [ - _directive_tooltip, - { - value: unref(workspaceStore).shiftDown ? _ctx.$t("menu.queueWorkflowFront") : _ctx.$t("menu.queueWorkflow"), - showDelay: 600 - }, - void 0, - { bottom: true } - ] - ]), - createVNode(BatchCountEdit), - createVNode(unref(script$6), { class: "execution-actions flex flex-nowrap" }, { - default: withCtx(() => [ - withDirectives(createVNode(unref(script), { - icon: "pi pi-times", - severity: executingPrompt.value ? "danger" : "secondary", - disabled: !executingPrompt.value, - text: "", - "aria-label": _ctx.$t("menu.interrupt"), - onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.Interrupt")) - }, null, 8, ["severity", "disabled", "aria-label"]), [ - [ - _directive_tooltip, - { - value: _ctx.$t("menu.interrupt"), - showDelay: 600 - }, - void 0, - { bottom: true } - ] - ]), - withDirectives(createVNode(unref(script), { - icon: "pi pi-stop", - severity: hasPendingTasks.value ? "danger" : "secondary", - disabled: !hasPendingTasks.value, - text: "", - "aria-label": _ctx.$t("sideToolbar.queueTab.clearPendingTasks"), - onClick: _cache[1] || (_cache[1] = () => { - if (unref(queueCountStore).count.value > 1) { - unref(commandStore).execute("Comfy.ClearPendingTasks"); - } - queueMode.value = "disabled"; - }) - }, null, 8, ["severity", "disabled", "aria-label"]), [ - [ - _directive_tooltip, - { - value: _ctx.$t("sideToolbar.queueTab.clearPendingTasks"), - showDelay: 600 - }, - void 0, - { bottom: true } - ] - ]) - ]), - _: 1 - }) - ]); - }; - } -}); -const ComfyQueueButton = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-4579e2ce"]]); -const overlapThreshold = 20; -const _sfc_main$4 = /* @__PURE__ */ defineComponent({ - __name: "ComfyActionbar", - setup(__props) { - const settingsStore = useSettingStore(); - const visible = computed( - () => settingsStore.get("Comfy.UseNewMenu") !== "Disabled" - ); - const panelRef = ref(null); - const dragHandleRef = ref(null); - const isDocked = useLocalStorage("Comfy.MenuPosition.Docked", false); - const storedPosition = useLocalStorage("Comfy.MenuPosition.Floating", { - x: 0, - y: 0 - }); - const { - x, - y, - style, - isDragging - } = useDraggable(panelRef, { - initialValue: { x: 0, y: 0 }, - handle: dragHandleRef, - containerElement: document.body - }); - watchDebounced( - [x, y], - ([newX, newY]) => { - storedPosition.value = { x: newX, y: newY }; - }, - { debounce: 300 } - ); - const setInitialPosition = /* @__PURE__ */ __name(() => { - if (x.value !== 0 || y.value !== 0) { - return; - } - if (storedPosition.value.x !== 0 || storedPosition.value.y !== 0) { - x.value = storedPosition.value.x; - y.value = storedPosition.value.y; - captureLastDragState(); - return; - } - if (panelRef.value) { - const screenWidth = window.innerWidth; - const screenHeight = window.innerHeight; - const menuWidth = panelRef.value.offsetWidth; - const menuHeight = panelRef.value.offsetHeight; - if (menuWidth === 0 || menuHeight === 0) { - return; - } - x.value = (screenWidth - menuWidth) / 2; - y.value = screenHeight - menuHeight - 10; - captureLastDragState(); - } - }, "setInitialPosition"); - onMounted(setInitialPosition); - watch(visible, (newVisible) => { - if (newVisible) { - nextTick(setInitialPosition); - } - }); - const lastDragState = ref({ - x: x.value, - y: y.value, - windowWidth: window.innerWidth, - windowHeight: window.innerHeight - }); - const captureLastDragState = /* @__PURE__ */ __name(() => { - lastDragState.value = { - x: x.value, - y: y.value, - windowWidth: window.innerWidth, - windowHeight: window.innerHeight - }; - }, "captureLastDragState"); - watch( - isDragging, - (newIsDragging) => { - if (!newIsDragging) { - captureLastDragState(); - } - }, - { immediate: true } - ); - const adjustMenuPosition = /* @__PURE__ */ __name(() => { - if (panelRef.value) { - const screenWidth = window.innerWidth; - const screenHeight = window.innerHeight; - const menuWidth = panelRef.value.offsetWidth; - const menuHeight = panelRef.value.offsetHeight; - const distanceLeft = lastDragState.value.x; - const distanceRight = lastDragState.value.windowWidth - (lastDragState.value.x + menuWidth); - const distanceTop = lastDragState.value.y; - const distanceBottom = lastDragState.value.windowHeight - (lastDragState.value.y + menuHeight); - const distances = [ - { edge: "left", distance: distanceLeft }, - { edge: "right", distance: distanceRight }, - { edge: "top", distance: distanceTop }, - { edge: "bottom", distance: distanceBottom } - ]; - const closestEdge = distances.reduce( - (min, curr) => curr.distance < min.distance ? curr : min - ); - const verticalRatio = lastDragState.value.y / lastDragState.value.windowHeight; - const horizontalRatio = lastDragState.value.x / lastDragState.value.windowWidth; - if (closestEdge.edge === "left") { - x.value = closestEdge.distance; - y.value = verticalRatio * screenHeight; - } else if (closestEdge.edge === "right") { - x.value = screenWidth - menuWidth - closestEdge.distance; - y.value = verticalRatio * screenHeight; - } else if (closestEdge.edge === "top") { - x.value = horizontalRatio * screenWidth; - y.value = closestEdge.distance; - } else { - x.value = horizontalRatio * screenWidth; - y.value = screenHeight - menuHeight - closestEdge.distance; - } - x.value = lodashExports.clamp(x.value, 0, screenWidth - menuWidth); - y.value = lodashExports.clamp(y.value, 0, screenHeight - menuHeight); - } - }, "adjustMenuPosition"); - useEventListener(window, "resize", adjustMenuPosition); - const topMenuRef = inject("topMenuRef"); - const topMenuBounds = useElementBounding(topMenuRef); - const isOverlappingWithTopMenu = computed(() => { - if (!panelRef.value) { - return false; - } - const { height } = panelRef.value.getBoundingClientRect(); - const actionbarBottom = y.value + height; - const topMenuBottom = topMenuBounds.bottom.value; - const overlapPixels = Math.min(actionbarBottom, topMenuBottom) - Math.max(y.value, topMenuBounds.top.value); - return overlapPixels > overlapThreshold; - }); - watch(isDragging, (newIsDragging) => { - if (!newIsDragging) { - isDocked.value = isOverlappingWithTopMenu.value; - } else { - isDocked.value = false; - } - }); - const eventBus = useEventBus("topMenu"); - watch([isDragging, isOverlappingWithTopMenu], ([dragging, overlapping]) => { - eventBus.emit("updateHighlight", { - isDragging: dragging, - isOverlapping: overlapping - }); - }); - return (_ctx, _cache) => { - return openBlock(), createBlock(unref(script$8), { - class: normalizeClass(["actionbar w-fit", { "is-dragging": unref(isDragging), "is-docked": unref(isDocked) }]), - style: normalizeStyle(unref(style)) - }, { - default: withCtx(() => [ - createBaseVNode("div", { - class: "actionbar-content flex items-center select-none", - ref_key: "panelRef", - ref: panelRef - }, [ - createBaseVNode("span", { - class: "drag-handle cursor-move mr-2 p-0!", - ref_key: "dragHandleRef", - ref: dragHandleRef - }, null, 512), - createVNode(ComfyQueueButton) - ], 512) - ]), - _: 1 - }, 8, ["style", "class"]); - }; - } -}); -const Actionbar = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-ebd56d51"]]); -const _hoisted_1$4 = { - viewBox: "0 0 24 24", - width: "1.2em", - height: "1.2em" -}; -function render$1(_ctx, _cache) { - return openBlock(), createElementBlock("svg", _hoisted_1$4, _cache[0] || (_cache[0] = [ - createBaseVNode("path", { - fill: "currentColor", - d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-5v3h14v-3zm0-2h14V5H5zm0 2v3z" - }, null, -1) - ])); -} -__name(render$1, "render$1"); -const __unplugin_components_1 = markRaw({ name: "material-symbols-dock-to-bottom-outline", render: render$1 }); -const _hoisted_1$3 = { - viewBox: "0 0 24 24", - width: "1.2em", - height: "1.2em" -}; -function render(_ctx, _cache) { - return openBlock(), createElementBlock("svg", _hoisted_1$3, _cache[0] || (_cache[0] = [ - createBaseVNode("path", { - fill: "currentColor", - d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-7h14V5H5z" - }, null, -1) - ])); -} -__name(render, "render"); -const __unplugin_components_0 = markRaw({ name: "material-symbols-dock-to-bottom", render }); -const _sfc_main$3 = /* @__PURE__ */ defineComponent({ - __name: "BottomPanelToggleButton", - setup(__props) { - const bottomPanelStore = useBottomPanelStore(); - return (_ctx, _cache) => { - const _component_i_material_symbols58dock_to_bottom = __unplugin_components_0; - const _component_i_material_symbols58dock_to_bottom_outline = __unplugin_components_1; - const _directive_tooltip = resolveDirective("tooltip"); - return withDirectives((openBlock(), createBlock(unref(script), { - severity: "secondary", - text: "", - "aria-label": _ctx.$t("menu.toggleBottomPanel"), - onClick: unref(bottomPanelStore).toggleBottomPanel - }, { - icon: withCtx(() => [ - unref(bottomPanelStore).bottomPanelVisible ? (openBlock(), createBlock(_component_i_material_symbols58dock_to_bottom, { key: 0 })) : (openBlock(), createBlock(_component_i_material_symbols58dock_to_bottom_outline, { key: 1 })) - ]), - _: 1 - }, 8, ["aria-label", "onClick"])), [ - [vShow, unref(bottomPanelStore).bottomPanelTabs.length > 0], - [_directive_tooltip, { value: _ctx.$t("menu.toggleBottomPanel"), showDelay: 300 }] - ]); - }; - } -}); -const _hoisted_1$2 = ["href"]; -const _hoisted_2$2 = { class: "p-menubar-item-label" }; -const _hoisted_3$2 = { - key: 1, - class: "ml-auto border border-surface rounded text-muted text-xs text-nowrap p-1 keybinding-tag" -}; -const _hoisted_4$1 = { - key: 2, - class: "ml-auto pi pi-angle-right" -}; -const _sfc_main$2 = /* @__PURE__ */ defineComponent({ - __name: "CommandMenubar", - setup(__props) { - const settingStore = useSettingStore(); - const dropdownDirection = computed( - () => settingStore.get("Comfy.UseNewMenu") === "Top" ? "down" : "up" - ); - const menuItemsStore = useMenuItemStore(); - const { t: t2 } = useI18n(); - const translateMenuItem = /* @__PURE__ */ __name((item) => { - const label = typeof item.label === "function" ? item.label() : item.label; - const translatedLabel = label ? t2(`menuLabels.${normalizeI18nKey(label)}`, label) : void 0; - return { - ...item, - label: translatedLabel, - items: item.items?.map(translateMenuItem) - }; - }, "translateMenuItem"); - const translatedItems = computed( - () => menuItemsStore.menuItems.map(translateMenuItem) - ); - return (_ctx, _cache) => { - return openBlock(), createBlock(unref(script$j), { - model: translatedItems.value, - class: "top-menubar border-none p-0 bg-transparent", - pt: { - rootList: "gap-0 flex-nowrap w-auto", - submenu: `dropdown-direction-${dropdownDirection.value}`, - item: "relative" - } - }, { - item: withCtx(({ item, props, root }) => [ - createBaseVNode("a", mergeProps({ class: "p-menubar-item-link" }, props.action, { - href: item.url, - target: "_blank" - }), [ - item.icon ? (openBlock(), createElementBlock("span", { - key: 0, - class: normalizeClass(["p-menubar-item-icon", item.icon]) - }, null, 2)) : createCommentVNode("", true), - createBaseVNode("span", _hoisted_2$2, toDisplayString(item.label), 1), - item?.comfyCommand?.keybinding ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(item.comfyCommand.keybinding.combo.toString()), 1)) : createCommentVNode("", true), - !root && item.items ? (openBlock(), createElementBlock("i", _hoisted_4$1)) : createCommentVNode("", true) - ], 16, _hoisted_1$2) - ]), - _: 1 - }, 8, ["model", "pt"]); - }; - } -}); -const CommandMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-6a9cf415"]]); -const _hoisted_1$1 = { class: "flex-grow min-w-0 app-drag h-full" }; -const _hoisted_2$1 = { class: "window-actions-spacer flex-shrink-0" }; -const _hoisted_3$1 = { class: "fixed top-0 left-0 app-drag w-full h-[var(--comfy-topbar-height)]" }; -const _sfc_main$1 = /* @__PURE__ */ defineComponent({ - __name: "TopMenubar", - setup(__props) { - const workspaceState = useWorkspaceStore(); - const settingStore = useSettingStore(); - const workflowTabsPosition = computed( - () => settingStore.get("Comfy.Workflow.WorkflowTabsPosition") - ); - const menuSetting = computed(() => settingStore.get("Comfy.UseNewMenu")); - const betaMenuEnabled = computed(() => menuSetting.value !== "Disabled"); - const showTopMenu = computed( - () => betaMenuEnabled.value && !workspaceState.focusMode - ); - const menuRight = ref(null); - onMounted(() => { - if (menuRight.value) { - menuRight.value.appendChild(app.menu.element); - } - }); - const topMenuRef = ref(null); - provide("topMenuRef", topMenuRef); - const eventBus = useEventBus("topMenu"); - const isDropZone = ref(false); - const isDroppable = ref(false); - eventBus.on((event, payload) => { - if (event === "updateHighlight") { - isDropZone.value = payload.isDragging; - isDroppable.value = payload.isOverlapping && payload.isDragging; - } - }); - onMounted(() => { - if (isElectron()) { - electronAPI().changeTheme({ - height: topMenuRef.value.getBoundingClientRect().height - }); - } - }); - return (_ctx, _cache) => { - const _directive_tooltip = resolveDirective("tooltip"); - return openBlock(), createElementBlock(Fragment, null, [ - withDirectives(createBaseVNode("div", { - ref_key: "topMenuRef", - ref: topMenuRef, - class: normalizeClass(["comfyui-menu flex items-center", { dropzone: isDropZone.value, "dropzone-active": isDroppable.value }]) - }, [ - _cache[1] || (_cache[1] = createBaseVNode("h1", { class: "comfyui-logo mx-2 app-drag" }, "ComfyUI", -1)), - createVNode(CommandMenubar), - createBaseVNode("div", _hoisted_1$1, [ - workflowTabsPosition.value === "Topbar" ? (openBlock(), createBlock(WorkflowTabs, { key: 0 })) : createCommentVNode("", true) - ]), - createBaseVNode("div", { - class: "comfyui-menu-right flex-shrink-0", - ref_key: "menuRight", - ref: menuRight - }, null, 512), - createVNode(Actionbar), - createVNode(_sfc_main$3, { class: "flex-shrink-0" }), - withDirectives(createVNode(unref(script), { - class: "flex-shrink-0", - icon: "pi pi-bars", - severity: "secondary", - text: "", - "aria-label": _ctx.$t("menu.hideMenu"), - onClick: _cache[0] || (_cache[0] = ($event) => unref(workspaceState).focusMode = true), - onContextmenu: unref(showNativeSystemMenu) - }, null, 8, ["aria-label", "onContextmenu"]), [ - [_directive_tooltip, { value: _ctx.$t("menu.hideMenu"), showDelay: 300 }] - ]), - withDirectives(createBaseVNode("div", _hoisted_2$1, null, 512), [ - [vShow, menuSetting.value !== "Bottom"] - ]) - ], 2), [ - [vShow, showTopMenu.value] - ]), - withDirectives(createBaseVNode("div", _hoisted_3$1, null, 512), [ - [vShow, unref(isNativeWindow)() && !showTopMenu.value] - ]) - ], 64); - }; - } -}); -const TopMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-99f99a6b"]]); -function useCoreCommands() { - const workflowService = useWorkflowService(); - const workflowStore = useWorkflowStore(); - const dialogService = useDialogService(); - const colorPaletteStore = useColorPaletteStore(); - const getTracker = /* @__PURE__ */ __name(() => workflowStore.activeWorkflow?.changeTracker, "getTracker"); - const getSelectedNodes = /* @__PURE__ */ __name(() => { - const selectedNodes = app.canvas.selected_nodes; - const result = []; - if (selectedNodes) { - for (const i in selectedNodes) { - const node = selectedNodes[i]; - result.push(node); - } - } - return result; - }, "getSelectedNodes"); - const toggleSelectedNodesMode = /* @__PURE__ */ __name((mode) => { - getSelectedNodes().forEach((node) => { - if (node.mode === mode) { - node.mode = LGraphEventMode.ALWAYS; - } else { - node.mode = mode; - } - }); - }, "toggleSelectedNodesMode"); - return [ - { - id: "Comfy.NewBlankWorkflow", - icon: "pi pi-plus", - label: "New Blank Workflow", - menubarLabel: "New", - function: /* @__PURE__ */ __name(() => workflowService.loadBlankWorkflow(), "function") - }, - { - id: "Comfy.OpenWorkflow", - icon: "pi pi-folder-open", - label: "Open Workflow", - menubarLabel: "Open", - function: /* @__PURE__ */ __name(() => { - app.ui.loadFile(); - }, "function") - }, - { - id: "Comfy.LoadDefaultWorkflow", - icon: "pi pi-code", - label: "Load Default Workflow", - function: /* @__PURE__ */ __name(() => workflowService.loadDefaultWorkflow(), "function") - }, - { - id: "Comfy.SaveWorkflow", - icon: "pi pi-save", - label: "Save Workflow", - menubarLabel: "Save", - function: /* @__PURE__ */ __name(async () => { - const workflow = useWorkflowStore().activeWorkflow; - if (!workflow) return; - await workflowService.saveWorkflow(workflow); - }, "function") - }, - { - id: "Comfy.SaveWorkflowAs", - icon: "pi pi-save", - label: "Save Workflow As", - menubarLabel: "Save As", - function: /* @__PURE__ */ __name(async () => { - const workflow = useWorkflowStore().activeWorkflow; - if (!workflow) return; - await workflowService.saveWorkflowAs(workflow); - }, "function") - }, - { - id: "Comfy.ExportWorkflow", - icon: "pi pi-download", - label: "Export Workflow", - menubarLabel: "Export", - function: /* @__PURE__ */ __name(() => { - workflowService.exportWorkflow("workflow", "workflow"); - }, "function") - }, - { - id: "Comfy.ExportWorkflowAPI", - icon: "pi pi-download", - label: "Export Workflow (API Format)", - menubarLabel: "Export (API)", - function: /* @__PURE__ */ __name(() => { - workflowService.exportWorkflow("workflow_api", "output"); - }, "function") - }, - { - id: "Comfy.Undo", - icon: "pi pi-undo", - label: "Undo", - function: /* @__PURE__ */ __name(async () => { - await getTracker()?.undo?.(); - }, "function") - }, - { - id: "Comfy.Redo", - icon: "pi pi-refresh", - label: "Redo", - function: /* @__PURE__ */ __name(async () => { - await getTracker()?.redo?.(); - }, "function") - }, - { - id: "Comfy.ClearWorkflow", - icon: "pi pi-trash", - label: "Clear Workflow", - function: /* @__PURE__ */ __name(() => { - const settingStore = useSettingStore(); - if (!settingStore.get("Comfy.ComfirmClear") || confirm("Clear workflow?")) { - app.clean(); - app.graph.clear(); - api.dispatchCustomEvent("graphCleared"); - } - }, "function") - }, - { - id: "Comfy.Canvas.ResetView", - icon: "pi pi-expand", - label: "Reset View", - function: /* @__PURE__ */ __name(() => { - useLitegraphService().resetView(); - }, "function") - }, - { - id: "Comfy.OpenClipspace", - icon: "pi pi-clipboard", - label: "Clipspace", - function: /* @__PURE__ */ __name(() => { - app.openClipspace(); - }, "function") - }, - { - id: "Comfy.RefreshNodeDefinitions", - icon: "pi pi-refresh", - label: "Refresh Node Definitions", - function: /* @__PURE__ */ __name(async () => { - await app.refreshComboInNodes(); - }, "function") - }, - { - id: "Comfy.Interrupt", - icon: "pi pi-stop", - label: "Interrupt", - function: /* @__PURE__ */ __name(async () => { - await api.interrupt(); - useToastStore().add({ - severity: "info", - summary: "Interrupted", - detail: "Execution has been interrupted", - life: 1e3 - }); - }, "function") - }, - { - id: "Comfy.ClearPendingTasks", - icon: "pi pi-stop", - label: "Clear Pending Tasks", - function: /* @__PURE__ */ __name(async () => { - await useQueueStore().clear(["queue"]); - useToastStore().add({ - severity: "info", - summary: "Confirmed", - detail: "Pending tasks deleted", - life: 3e3 - }); - }, "function") - }, - { - id: "Comfy.BrowseTemplates", - icon: "pi pi-folder-open", - label: "Browse Templates", - function: /* @__PURE__ */ __name(() => { - dialogService.showTemplateWorkflowsDialog(); - }, "function") - }, - { - id: "Comfy.Canvas.ZoomIn", - icon: "pi pi-plus", - label: "Zoom In", - function: /* @__PURE__ */ __name(() => { - const ds = app.canvas.ds; - ds.changeScale( - ds.scale * 1.1, - ds.element ? [ds.element.width / 2, ds.element.height / 2] : void 0 - ); - app.canvas.setDirty(true, true); - }, "function") - }, - { - id: "Comfy.Canvas.ZoomOut", - icon: "pi pi-minus", - label: "Zoom Out", - function: /* @__PURE__ */ __name(() => { - const ds = app.canvas.ds; - ds.changeScale( - ds.scale / 1.1, - ds.element ? [ds.element.width / 2, ds.element.height / 2] : void 0 - ); - app.canvas.setDirty(true, true); - }, "function") - }, - { - id: "Comfy.Canvas.FitView", - icon: "pi pi-expand", - label: "Fit view to selected nodes", - function: /* @__PURE__ */ __name(() => { - if (app.canvas.empty) { - useToastStore().add({ - severity: "error", - summary: "Empty canvas", - life: 3e3 - }); - return; - } - app.canvas.fitViewToSelectionAnimated(); - }, "function") - }, - { - id: "Comfy.Canvas.ToggleLock", - icon: "pi pi-lock", - label: "Canvas Toggle Lock", - function: /* @__PURE__ */ __name(() => { - app.canvas["read_only"] = !app.canvas["read_only"]; - }, "function") - }, - { - id: "Comfy.Canvas.ToggleLinkVisibility", - icon: "pi pi-eye", - label: "Canvas Toggle Link Visibility", - versionAdded: "1.3.6", - function: (() => { - const settingStore = useSettingStore(); - let lastLinksRenderMode = LiteGraph.SPLINE_LINK; - return () => { - const currentMode = settingStore.get("Comfy.LinkRenderMode"); - if (currentMode === LiteGraph.HIDDEN_LINK) { - settingStore.set("Comfy.LinkRenderMode", lastLinksRenderMode); - } else { - lastLinksRenderMode = currentMode; - settingStore.set("Comfy.LinkRenderMode", LiteGraph.HIDDEN_LINK); - } - }; - })() - }, - { - id: "Comfy.QueuePrompt", - icon: "pi pi-play", - label: "Queue Prompt", - versionAdded: "1.3.7", - function: /* @__PURE__ */ __name(() => { - const batchCount = useQueueSettingsStore().batchCount; - app.queuePrompt(0, batchCount); - }, "function") - }, - { - id: "Comfy.QueuePromptFront", - icon: "pi pi-play", - label: "Queue Prompt (Front)", - versionAdded: "1.3.7", - function: /* @__PURE__ */ __name(() => { - const batchCount = useQueueSettingsStore().batchCount; - app.queuePrompt(-1, batchCount); - }, "function") - }, - { - id: "Comfy.ShowSettingsDialog", - icon: "pi pi-cog", - label: "Show Settings Dialog", - versionAdded: "1.3.7", - function: /* @__PURE__ */ __name(() => { - dialogService.showSettingsDialog(); - }, "function") - }, - { - id: "Comfy.Graph.GroupSelectedNodes", - icon: "pi pi-sitemap", - label: "Group Selected Nodes", - versionAdded: "1.3.7", - function: /* @__PURE__ */ __name(() => { - const { canvas } = app; - if (!canvas.selectedItems?.size) { - useToastStore().add({ - severity: "error", - summary: "Nothing to group", - detail: "Please select the nodes (or other groups) to create a group for", - life: 3e3 - }); - return; - } - const group = new LGraphGroup(); - const padding = useSettingStore().get( - "Comfy.GroupSelectedNodes.Padding" - ); - group.resizeTo(canvas.selectedItems, padding); - canvas.graph?.add(group); - useTitleEditorStore().titleEditorTarget = group; - }, "function") - }, - { - id: "Workspace.NextOpenedWorkflow", - icon: "pi pi-step-forward", - label: "Next Opened Workflow", - versionAdded: "1.3.9", - function: /* @__PURE__ */ __name(() => { - workflowService.loadNextOpenedWorkflow(); - }, "function") - }, - { - id: "Workspace.PreviousOpenedWorkflow", - icon: "pi pi-step-backward", - label: "Previous Opened Workflow", - versionAdded: "1.3.9", - function: /* @__PURE__ */ __name(() => { - workflowService.loadPreviousOpenedWorkflow(); - }, "function") - }, - { - id: "Comfy.Canvas.ToggleSelectedNodes.Mute", - icon: "pi pi-volume-off", - label: "Mute/Unmute Selected Nodes", - versionAdded: "1.3.11", - function: /* @__PURE__ */ __name(() => { - toggleSelectedNodesMode(LGraphEventMode.NEVER); - app.canvas.setDirty(true, true); - }, "function") - }, - { - id: "Comfy.Canvas.ToggleSelectedNodes.Bypass", - icon: "pi pi-shield", - label: "Bypass/Unbypass Selected Nodes", - versionAdded: "1.3.11", - function: /* @__PURE__ */ __name(() => { - toggleSelectedNodesMode(LGraphEventMode.BYPASS); - app.canvas.setDirty(true, true); - }, "function") - }, - { - id: "Comfy.Canvas.ToggleSelectedNodes.Pin", - icon: "pi pi-pin", - label: "Pin/Unpin Selected Nodes", - versionAdded: "1.3.11", - function: /* @__PURE__ */ __name(() => { - getSelectedNodes().forEach((node) => { - node.pin(!node.pinned); - }); - app.canvas.setDirty(true, true); - }, "function") - }, - { - id: "Comfy.Canvas.ToggleSelected.Pin", - icon: "pi pi-pin", - label: "Pin/Unpin Selected Items", - versionAdded: "1.3.33", - function: /* @__PURE__ */ __name(() => { - for (const item of app.canvas.selectedItems) { - if (item instanceof LGraphNode || item instanceof LGraphGroup) { - item.pin(!item.pinned); - } - } - app.canvas.setDirty(true, true); - }, "function") - }, - { - id: "Comfy.Canvas.ToggleSelectedNodes.Collapse", - icon: "pi pi-minus", - label: "Collapse/Expand Selected Nodes", - versionAdded: "1.3.11", - function: /* @__PURE__ */ __name(() => { - getSelectedNodes().forEach((node) => { - node.collapse(); - }); - app.canvas.setDirty(true, true); - }, "function") - }, - { - id: "Comfy.ToggleTheme", - icon: "pi pi-moon", - label: "Toggle Theme (Dark/Light)", - versionAdded: "1.3.12", - function: (() => { - let previousDarkTheme = DEFAULT_DARK_COLOR_PALETTE.id; - let previousLightTheme = DEFAULT_LIGHT_COLOR_PALETTE.id; - return () => { - const settingStore = useSettingStore(); - const theme = colorPaletteStore.completedActivePalette; - if (theme.light_theme) { - previousLightTheme = theme.id; - settingStore.set("Comfy.ColorPalette", previousDarkTheme); - } else { - previousDarkTheme = theme.id; - settingStore.set("Comfy.ColorPalette", previousLightTheme); - } - }; - })() - }, - { - id: "Workspace.ToggleBottomPanel", - icon: "pi pi-list", - label: "Toggle Bottom Panel", - versionAdded: "1.3.22", - function: /* @__PURE__ */ __name(() => { - useBottomPanelStore().toggleBottomPanel(); - }, "function") - }, - { - id: "Workspace.ToggleFocusMode", - icon: "pi pi-eye", - label: "Toggle Focus Mode", - versionAdded: "1.3.27", - function: /* @__PURE__ */ __name(() => { - useWorkspaceStore().toggleFocusMode(); - }, "function") - }, - { - id: "Comfy.Graph.FitGroupToContents", - icon: "pi pi-expand", - label: "Fit Group To Contents", - versionAdded: "1.4.9", - function: /* @__PURE__ */ __name(() => { - for (const group of app.canvas.selectedItems) { - if (group instanceof LGraphGroup) { - group.recomputeInsideNodes(); - const padding = useSettingStore().get( - "Comfy.GroupSelectedNodes.Padding" - ); - group.resizeTo(group.children, padding); - app.graph.change(); - } - } - }, "function") - }, - { - id: "Comfy.Help.OpenComfyUIIssues", - icon: "pi pi-github", - label: "Open ComfyUI Issues", - menubarLabel: "ComfyUI Issues", - versionAdded: "1.5.5", - function: /* @__PURE__ */ __name(() => { - window.open( - "https://github.com/comfyanonymous/ComfyUI/issues", - "_blank" - ); - }, "function") - }, - { - id: "Comfy.Help.OpenComfyUIDocs", - icon: "pi pi-info-circle", - label: "Open ComfyUI Docs", - menubarLabel: "ComfyUI Docs", - versionAdded: "1.5.5", - function: /* @__PURE__ */ __name(() => { - window.open("https://docs.comfy.org/", "_blank"); - }, "function") - }, - { - id: "Comfy.Help.OpenComfyOrgDiscord", - icon: "pi pi-discord", - label: "Open Comfy-Org Discord", - menubarLabel: "Comfy-Org Discord", - versionAdded: "1.5.5", - function: /* @__PURE__ */ __name(() => { - window.open("https://www.comfy.org/discord", "_blank"); - }, "function") - }, - { - id: "Workspace.SearchBox.Toggle", - icon: "pi pi-search", - label: "Toggle Search Box", - versionAdded: "1.5.7", - function: /* @__PURE__ */ __name(() => { - useSearchBoxStore().toggleVisible(); - }, "function") - }, - { - id: "Comfy.Help.AboutComfyUI", - icon: "pi pi-info-circle", - label: "Open About ComfyUI", - menubarLabel: "About ComfyUI", - versionAdded: "1.6.4", - function: /* @__PURE__ */ __name(() => { - dialogService.showSettingsDialog("about"); - }, "function") - }, - { - id: "Comfy.DuplicateWorkflow", - icon: "pi pi-clone", - label: "Duplicate Current Workflow", - versionAdded: "1.6.15", - function: /* @__PURE__ */ __name(() => { - workflowService.duplicateWorkflow(workflowStore.activeWorkflow); - }, "function") - }, - { - id: "Workspace.CloseWorkflow", - icon: "pi pi-times", - label: "Close Current Workflow", - versionAdded: "1.7.3", - function: /* @__PURE__ */ __name(() => { - if (workflowStore.activeWorkflow) - workflowService.closeWorkflow(workflowStore.activeWorkflow); - }, "function") - }, - { - id: "Comfy.Feedback", - icon: "pi pi-megaphone", - label: "Give Feedback", - versionAdded: "1.8.2", - function: /* @__PURE__ */ __name(() => { - dialogService.showIssueReportDialog({ - title: t("g.feedback"), - subtitle: t("issueReport.feedbackTitle"), - panelProps: { - errorType: "Feedback", - defaultFields: ["SystemStats", "Settings"] - } - }); - }, "function") - }, - { - id: "Comfy.Help.OpenComfyUIForum", - icon: "pi pi-comments", - label: "Open ComfyUI Forum", - menubarLabel: "ComfyUI Forum", - versionAdded: "1.8.2", - function: /* @__PURE__ */ __name(() => { - window.open("https://forum.comfy.org/", "_blank"); - }, "function") - }, - { - id: "Comfy.Canvas.DeleteSelectedItems", - icon: "pi pi-trash", - label: "Delete Selected Items", - versionAdded: "1.10.5", - function: /* @__PURE__ */ __name(() => { - app.canvas.deleteSelected(); - app.canvas.setDirty(true, true); - }, "function") - } - ]; -} -__name(useCoreCommands, "useCoreCommands"); -var LatentPreviewMethod = /* @__PURE__ */ ((LatentPreviewMethod2) => { - LatentPreviewMethod2["NoPreviews"] = "none"; - LatentPreviewMethod2["Auto"] = "auto"; - LatentPreviewMethod2["Latent2RGB"] = "latent2rgb"; - LatentPreviewMethod2["TAESD"] = "taesd"; - return LatentPreviewMethod2; -})(LatentPreviewMethod || {}); -var LogLevel = /* @__PURE__ */ ((LogLevel2) => { - LogLevel2["DEBUG"] = "DEBUG"; - LogLevel2["INFO"] = "INFO"; - LogLevel2["WARNING"] = "WARNING"; - LogLevel2["ERROR"] = "ERROR"; - LogLevel2["CRITICAL"] = "CRITICAL"; - return LogLevel2; -})(LogLevel || {}); -var HashFunction = /* @__PURE__ */ ((HashFunction2) => { - HashFunction2["MD5"] = "md5"; - HashFunction2["SHA1"] = "sha1"; - HashFunction2["SHA256"] = "sha256"; - HashFunction2["SHA512"] = "sha512"; - return HashFunction2; -})(HashFunction || {}); -var AutoLaunch = /* @__PURE__ */ ((AutoLaunch2) => { - AutoLaunch2["Auto"] = "auto"; - AutoLaunch2["Disable"] = "disable"; - AutoLaunch2["Enable"] = "enable"; - return AutoLaunch2; -})(AutoLaunch || {}); -var CudaMalloc = /* @__PURE__ */ ((CudaMalloc2) => { - CudaMalloc2["Auto"] = "auto"; - CudaMalloc2["Disable"] = "disable"; - CudaMalloc2["Enable"] = "enable"; - return CudaMalloc2; -})(CudaMalloc || {}); -var FloatingPointPrecision = /* @__PURE__ */ ((FloatingPointPrecision2) => { - FloatingPointPrecision2["AUTO"] = "auto"; - FloatingPointPrecision2["FP64"] = "fp64"; - FloatingPointPrecision2["FP32"] = "fp32"; - FloatingPointPrecision2["FP16"] = "fp16"; - FloatingPointPrecision2["BF16"] = "bf16"; - FloatingPointPrecision2["FP8E4M3FN"] = "fp8_e4m3fn"; - FloatingPointPrecision2["FP8E5M2"] = "fp8_e5m2"; - return FloatingPointPrecision2; -})(FloatingPointPrecision || {}); -var CrossAttentionMethod = /* @__PURE__ */ ((CrossAttentionMethod2) => { - CrossAttentionMethod2["Auto"] = "auto"; - CrossAttentionMethod2["Split"] = "split"; - CrossAttentionMethod2["Quad"] = "quad"; - CrossAttentionMethod2["Pytorch"] = "pytorch"; - return CrossAttentionMethod2; -})(CrossAttentionMethod || {}); -var VramManagement = /* @__PURE__ */ ((VramManagement2) => { - VramManagement2["Auto"] = "auto"; - VramManagement2["GPUOnly"] = "gpu-only"; - VramManagement2["HighVram"] = "highvram"; - VramManagement2["NormalVram"] = "normalvram"; - VramManagement2["LowVram"] = "lowvram"; - VramManagement2["NoVram"] = "novram"; - VramManagement2["CPU"] = "cpu"; - return VramManagement2; -})(VramManagement || {}); -const WEB_ONLY_CONFIG_ITEMS = [ - // Launch behavior - { - id: "auto-launch", - name: "Automatically opens in the browser on startup", - category: ["Launch"], - type: "combo", - options: Object.values(AutoLaunch), - defaultValue: AutoLaunch.Auto, - getValue: /* @__PURE__ */ __name((value) => { - switch (value) { - case AutoLaunch.Auto: - return {}; - case AutoLaunch.Enable: - return { - ["auto-launch"]: true - }; - case AutoLaunch.Disable: - return { - ["disable-auto-launch"]: true - }; - } - }, "getValue") - } -]; -const SERVER_CONFIG_ITEMS = [ - // Network settings - { - id: "listen", - name: "Host: The IP address to listen on", - category: ["Network"], - type: "text", - defaultValue: "127.0.0.1" - }, - { - id: "port", - name: "Port: The port to listen on", - category: ["Network"], - type: "number", - // The default launch port for desktop app is 8000 instead of 8188. - defaultValue: 8e3 - }, - { - id: "tls-keyfile", - name: "TLS Key File: Path to TLS key file for HTTPS", - category: ["Network"], - type: "text", - defaultValue: "" - }, - { - id: "tls-certfile", - name: "TLS Certificate File: Path to TLS certificate file for HTTPS", - category: ["Network"], - type: "text", - defaultValue: "" - }, - { - id: "enable-cors-header", - name: 'Enable CORS header: Use "*" for all origins or specify domain', - category: ["Network"], - type: "text", - defaultValue: "" - }, - { - id: "max-upload-size", - name: "Maximum upload size (MB)", - category: ["Network"], - type: "number", - defaultValue: 100 - }, - // CUDA settings - { - id: "cuda-device", - name: "CUDA device index to use", - category: ["CUDA"], - type: "number", - defaultValue: null - }, - { - id: "cuda-malloc", - name: "Use CUDA malloc for memory allocation", - category: ["CUDA"], - type: "combo", - options: Object.values(CudaMalloc), - defaultValue: CudaMalloc.Auto, - getValue: /* @__PURE__ */ __name((value) => { - switch (value) { - case CudaMalloc.Auto: - return {}; - case CudaMalloc.Enable: - return { - ["cuda-malloc"]: true - }; - case CudaMalloc.Disable: - return { - ["disable-cuda-malloc"]: true - }; - } - }, "getValue") - }, - // Precision settings - { - id: "global-precision", - name: "Global floating point precision", - category: ["Inference"], - type: "combo", - options: [ - FloatingPointPrecision.AUTO, - FloatingPointPrecision.FP32, - FloatingPointPrecision.FP16 - ], - defaultValue: FloatingPointPrecision.AUTO, - tooltip: "Global floating point precision", - getValue: /* @__PURE__ */ __name((value) => { - switch (value) { - case FloatingPointPrecision.AUTO: - return {}; - case FloatingPointPrecision.FP32: - return { - ["force-fp32"]: true - }; - case FloatingPointPrecision.FP16: - return { - ["force-fp16"]: true - }; - default: - return {}; - } - }, "getValue") - }, - // UNET precision - { - id: "unet-precision", - name: "UNET precision", - category: ["Inference"], - type: "combo", - options: [ - FloatingPointPrecision.AUTO, - FloatingPointPrecision.FP64, - FloatingPointPrecision.FP32, - FloatingPointPrecision.FP16, - FloatingPointPrecision.BF16, - FloatingPointPrecision.FP8E4M3FN, - FloatingPointPrecision.FP8E5M2 - ], - defaultValue: FloatingPointPrecision.AUTO, - tooltip: "UNET precision", - getValue: /* @__PURE__ */ __name((value) => { - switch (value) { - case FloatingPointPrecision.AUTO: - return {}; - default: - return { - [`${value.toLowerCase()}-unet`]: true - }; - } - }, "getValue") - }, - // VAE settings - { - id: "vae-precision", - name: "VAE precision", - category: ["Inference"], - type: "combo", - options: [ - FloatingPointPrecision.AUTO, - FloatingPointPrecision.FP16, - FloatingPointPrecision.FP32, - FloatingPointPrecision.BF16 - ], - defaultValue: FloatingPointPrecision.AUTO, - tooltip: "VAE precision", - getValue: /* @__PURE__ */ __name((value) => { - switch (value) { - case FloatingPointPrecision.AUTO: - return {}; - default: - return { - [`${value.toLowerCase()}-vae`]: true - }; - } - }, "getValue") - }, - { - id: "cpu-vae", - name: "Run VAE on CPU", - category: ["Inference"], - type: "boolean", - defaultValue: false - }, - // Text Encoder settings - { - id: "text-encoder-precision", - name: "Text Encoder precision", - category: ["Inference"], - type: "combo", - options: [ - FloatingPointPrecision.AUTO, - FloatingPointPrecision.FP8E4M3FN, - FloatingPointPrecision.FP8E5M2, - FloatingPointPrecision.FP16, - FloatingPointPrecision.FP32 - ], - defaultValue: FloatingPointPrecision.AUTO, - tooltip: "Text Encoder precision", - getValue: /* @__PURE__ */ __name((value) => { - switch (value) { - case FloatingPointPrecision.AUTO: - return {}; - default: - return { - [`${value.toLowerCase()}-text-enc`]: true - }; - } - }, "getValue") - }, - // Memory and performance settings - { - id: "force-channels-last", - name: "Force channels-last memory format", - category: ["Memory"], - type: "boolean", - defaultValue: false - }, - { - id: "directml", - name: "DirectML device index", - category: ["Memory"], - type: "number", - defaultValue: null - }, - { - id: "disable-ipex-optimize", - name: "Disable IPEX optimization", - category: ["Memory"], - type: "boolean", - defaultValue: false - }, - // Preview settings - { - id: "preview-method", - name: "Method used for latent previews", - category: ["Preview"], - type: "combo", - options: Object.values(LatentPreviewMethod), - defaultValue: LatentPreviewMethod.NoPreviews - }, - { - id: "preview-size", - name: "Size of preview images", - category: ["Preview"], - type: "slider", - defaultValue: 512, - attrs: { - min: 128, - max: 2048, - step: 128 - } - }, - // Cache settings - { - id: "cache-classic", - name: "Use classic cache system", - category: ["Cache"], - type: "boolean", - defaultValue: false - }, - { - id: "cache-lru", - name: "Use LRU caching with a maximum of N node results cached.", - category: ["Cache"], - type: "number", - defaultValue: null, - tooltip: "May use more RAM/VRAM." - }, - // Attention settings - { - id: "cross-attention-method", - name: "Cross attention method", - category: ["Attention"], - type: "combo", - options: Object.values(CrossAttentionMethod), - defaultValue: CrossAttentionMethod.Auto, - getValue: /* @__PURE__ */ __name((value) => { - switch (value) { - case CrossAttentionMethod.Auto: - return {}; - default: - return { - [`use-${value.toLowerCase()}-cross-attention`]: true - }; - } - }, "getValue") - }, - { - id: "disable-xformers", - name: "Disable xFormers optimization", - type: "boolean", - defaultValue: false - }, - { - id: "force-upcast-attention", - name: "Force attention upcast", - category: ["Attention"], - type: "boolean", - defaultValue: false - }, - { - id: "dont-upcast-attention", - name: "Prevent attention upcast", - category: ["Attention"], - type: "boolean", - defaultValue: false - }, - // VRAM management - { - id: "vram-management", - name: "VRAM management mode", - category: ["Memory"], - type: "combo", - options: Object.values(VramManagement), - defaultValue: VramManagement.Auto, - getValue: /* @__PURE__ */ __name((value) => { - switch (value) { - case VramManagement.Auto: - return {}; - default: - return { - [value]: true - }; - } - }, "getValue") - }, - { - id: "reserve-vram", - name: "Reserved VRAM (GB)", - category: ["Memory"], - type: "number", - defaultValue: null, - tooltip: "Set the amount of vram in GB you want to reserve for use by your OS/other software. By default some amount is reverved depending on your OS." - }, - // Misc settings - { - id: "default-hashing-function", - name: "Default hashing function for model files", - type: "combo", - options: Object.values(HashFunction), - defaultValue: HashFunction.SHA256 - }, - { - id: "disable-smart-memory", - name: "Disable smart memory management", - tooltip: "Force ComfyUI to aggressively offload to regular ram instead of keeping models in vram when it can.", - category: ["Memory"], - type: "boolean", - defaultValue: false - }, - { - id: "deterministic", - name: "Make pytorch use slower deterministic algorithms when it can.", - type: "boolean", - defaultValue: false, - tooltip: "Note that this might not make images deterministic in all cases." - }, - { - id: "fast", - name: "Enable some untested and potentially quality deteriorating optimizations.", - type: "boolean", - defaultValue: false - }, - { - id: "dont-print-server", - name: "Don't print server output to console.", - type: "boolean", - defaultValue: false - }, - { - id: "disable-metadata", - name: "Disable saving prompt metadata in files.", - type: "boolean", - defaultValue: false - }, - { - id: "disable-all-custom-nodes", - name: "Disable loading all custom nodes.", - type: "boolean", - defaultValue: false - }, - { - id: "log-level", - name: "Logging verbosity level", - type: "combo", - options: Object.values(LogLevel), - defaultValue: LogLevel.INFO, - getValue: /* @__PURE__ */ __name((value) => { - return { - verbose: value - }; - }, "getValue") - }, - // Directories - { - id: "input-directory", - name: "Input directory", - category: ["Directories"], - type: "text", - defaultValue: "" - }, - { - id: "output-directory", - name: "Output directory", - category: ["Directories"], - type: "text", - defaultValue: "" - } -]; -function setupAutoQueueHandler() { - const queueCountStore = useQueuePendingTaskCountStore(); - const queueSettingsStore = useQueueSettingsStore(); - let graphHasChanged = false; - let internalCount = 0; - api.addEventListener("graphChanged", () => { - if (queueSettingsStore.mode === "change") { - if (internalCount) { - graphHasChanged = true; - } else { - graphHasChanged = false; - app.queuePrompt(0, queueSettingsStore.batchCount); - internalCount++; - } - } - }); - queueCountStore.$subscribe( - () => { - internalCount = queueCountStore.count; - if (!internalCount && !app.lastExecutionError) { - if (queueSettingsStore.mode === "instant" || queueSettingsStore.mode === "change" && graphHasChanged) { - graphHasChanged = false; - app.queuePrompt(0, queueSettingsStore.batchCount); - } - } - }, - { detached: true } - ); -} -__name(setupAutoQueueHandler, "setupAutoQueueHandler"); -const _hoisted_1 = { class: "comfyui-body grid h-screen w-screen overflow-hidden" }; -const _hoisted_2 = { - class: "comfyui-body-top", - id: "comfyui-body-top" -}; -const _hoisted_3 = { - class: "comfyui-body-bottom", - id: "comfyui-body-bottom" -}; -const _hoisted_4 = { - class: "graph-canvas-container", - id: "graph-canvas-container" -}; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "GraphView", - setup(__props) { - setupAutoQueueHandler(); - const { t: t2 } = useI18n(); - const toast = useToast(); - const settingStore = useSettingStore(); - const executionStore = useExecutionStore(); - const colorPaletteStore = useColorPaletteStore(); - const queueStore = useQueueStore(); - watch( - () => colorPaletteStore.completedActivePalette, - (newTheme) => { - const DARK_THEME_CLASS = "dark-theme"; - if (newTheme.light_theme) { - document.body.classList.remove(DARK_THEME_CLASS); - } else { - document.body.classList.add(DARK_THEME_CLASS); - } - if (isElectron()) { - electronAPI().changeTheme({ - color: "rgba(0, 0, 0, 0)", - symbolColor: newTheme.colors.comfy_base["input-text"] - }); - } - }, - { immediate: true } - ); - if (isElectron()) { - watch( - () => queueStore.tasks, - (newTasks, oldTasks) => { - const oldRunningTaskIds = new Set( - oldTasks.filter((task) => task.isRunning).map((task) => task.promptId) - ); - newTasks.filter( - (task) => oldRunningTaskIds.has(task.promptId) && task.isHistory - ).forEach((task) => { - electronAPI().Events.incrementUserProperty( - `execution:${task.displayStatus.toLowerCase()}`, - 1 - ); - electronAPI().Events.trackEvent("execution", { - status: task.displayStatus.toLowerCase() - }); - }); - }, - { deep: true } - ); - } - watchEffect(() => { - const fontSize = settingStore.get("Comfy.TextareaWidget.FontSize"); - document.documentElement.style.setProperty( - "--comfy-textarea-font-size", - `${fontSize}px` - ); - }); - watchEffect(() => { - const padding = settingStore.get("Comfy.TreeExplorer.ItemPadding"); - document.documentElement.style.setProperty( - "--comfy-tree-explorer-item-padding", - `${padding}px` - ); - }); - watchEffect(() => { - const locale = settingStore.get("Comfy.Locale"); - if (locale) { - i18n.global.locale.value = locale; - } - }); - const useNewMenu = computed(() => { - return settingStore.get("Comfy.UseNewMenu"); - }); - watchEffect(() => { - if (useNewMenu.value === "Disabled") { - app.ui.menuContainer.style.setProperty("display", "block"); - app.ui.restoreMenuPosition(); - } else { - app.ui.menuContainer.style.setProperty("display", "none"); - } - }); - watchEffect(() => { - queueStore.maxHistoryItems = settingStore.get("Comfy.Queue.MaxHistoryItems"); - }); - const init = /* @__PURE__ */ __name(() => { - const coreCommands = useCoreCommands(); - useCommandStore().registerCommands(coreCommands); - useMenuItemStore().registerCoreMenuCommands(); - useKeybindingService().registerCoreKeybindings(); - useSidebarTabStore().registerCoreSidebarTabs(); - useBottomPanelStore().registerCoreBottomPanelTabs(); - app.extensionManager = useWorkspaceStore(); - }, "init"); - const queuePendingTaskCountStore = useQueuePendingTaskCountStore(); - const onStatus = /* @__PURE__ */ __name(async (e) => { - queuePendingTaskCountStore.update(e); - await queueStore.update(); - }, "onStatus"); - const reconnectingMessage = { - severity: "error", - summary: t2("g.reconnecting") - }; - const onReconnecting = /* @__PURE__ */ __name(() => { - toast.remove(reconnectingMessage); - toast.add(reconnectingMessage); - }, "onReconnecting"); - const onReconnected = /* @__PURE__ */ __name(() => { - toast.remove(reconnectingMessage); - toast.add({ - severity: "success", - summary: t2("g.reconnected"), - life: 2e3 - }); - }, "onReconnected"); - onMounted(() => { - api.addEventListener("status", onStatus); - api.addEventListener("reconnecting", onReconnecting); - api.addEventListener("reconnected", onReconnected); - executionStore.bindExecutionEvents(); - try { - init(); - } catch (e) { - console.error("Failed to init ComfyUI frontend", e); - } - }); - onBeforeUnmount(() => { - api.removeEventListener("status", onStatus); - api.removeEventListener("reconnecting", onReconnecting); - api.removeEventListener("reconnected", onReconnected); - executionStore.unbindExecutionEvents(); - }); - useEventListener(window, "keydown", useKeybindingService().keybindHandler); - const { wrapWithErrorHandling, wrapWithErrorHandlingAsync } = useErrorHandling(); - const onGraphReady = /* @__PURE__ */ __name(() => { - requestIdleCallback( - () => { - wrapWithErrorHandling(useKeybindingService().registerUserKeybindings)(); - wrapWithErrorHandling(useServerConfigStore().loadServerConfig)( - SERVER_CONFIG_ITEMS, - settingStore.get("Comfy.Server.ServerConfigValues") - ); - wrapWithErrorHandlingAsync(useModelStore().loadModelFolders)(); - wrapWithErrorHandlingAsync(useNodeFrequencyStore().loadNodeFrequencies)(); - useNodeDefStore().nodeSearchService.endsWithFilterStartSequence(""); - }, - { timeout: 1e3 } - ); - }, "onGraphReady"); - return (_ctx, _cache) => { - return openBlock(), createElementBlock(Fragment, null, [ - createBaseVNode("div", _hoisted_1, [ - createBaseVNode("div", _hoisted_2, [ - useNewMenu.value === "Top" ? (openBlock(), createBlock(TopMenubar, { key: 0 })) : createCommentVNode("", true) - ]), - createBaseVNode("div", _hoisted_3, [ - useNewMenu.value === "Bottom" ? (openBlock(), createBlock(TopMenubar, { key: 0 })) : createCommentVNode("", true) - ]), - _cache[0] || (_cache[0] = createBaseVNode("div", { - class: "comfyui-body-left", - id: "comfyui-body-left" - }, null, -1)), - _cache[1] || (_cache[1] = createBaseVNode("div", { - class: "comfyui-body-right", - id: "comfyui-body-right" - }, null, -1)), - createBaseVNode("div", _hoisted_4, [ - createVNode(_sfc_main$8, { onReady: onGraphReady }) - ]) - ]), - createVNode(_sfc_main$7), - !unref(isElectron)() ? (openBlock(), createBlock(_sfc_main$v, { key: 0 })) : createCommentVNode("", true), - createVNode(_sfc_main$x), - createVNode(MenuHamburger) - ], 64); - }; - } -}); -const GraphView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e89d9273"]]); -export { - GraphView as default -}; -//# sourceMappingURL=GraphView-J5fY4zmU.js.map diff --git a/comfy/web/assets/GraphView-J5fY4zmU.js.map b/comfy/web/assets/GraphView-J5fY4zmU.js.map deleted file mode 100644 index 400317a3e..000000000 --- a/comfy/web/assets/GraphView-J5fY4zmU.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GraphView-J5fY4zmU.js","sources":["../../src/components/BrowserTabTitle.vue","../../src/components/MenuHamburger.vue","../../src/components/dialog/UnloadWindowConfirmDialog.vue","../../src/components/LiteGraphCanvasSplitterOverlay.vue","../../src/components/common/ExtensionSlot.vue","../../src/components/bottomPanel/BottomPanel.vue","../../src/components/graph/GraphCanvasMenu.vue","../../src/components/graph/NodeBadge.vue","../../src/components/graph/NodeTooltip.vue","../../src/composables/element/useAbsolutePosition.ts","../../src/components/graph/SelectionOverlay.vue","../../src/components/graph/selectionToolbox/ColorPickerButton.vue","../../src/composables/useRefreshableSelection.ts","../../src/components/graph/SelectionToolbox.vue","../../src/components/graph/TitleEditor.vue","../../src/stores/workspace/searchBoxStore.ts","../../src/types/litegraphTypes.ts","../../src/components/primevueOverride/AutoCompletePlus.vue","../../src/components/searchbox/NodeSearchItem.vue","../../src/components/searchbox/NodeSearchBox.vue","../../src/components/searchbox/NodeSearchBoxPopover.vue","../../src/components/sidebar/SidebarIcon.vue","../../src/components/sidebar/SidebarLogoutIcon.vue","../../src/components/sidebar/SidebarSettingsToggleIcon.vue","../../src/components/sidebar/SidebarThemeToggleIcon.vue","../../src/components/sidebar/SideToolbar.vue","../../src/components/topbar/WorkflowTab.vue","../../src/components/topbar/WorkflowTabs.vue","../../src/composables/useCanvasDrop.ts","../../src/composables/useContextMenuTranslation.ts","../../src/composables/useCopy.ts","../../src/composables/useGlobalLitegraph.ts","../../src/composables/useLitegraphSettings.ts","../../src/composables/usePaste.ts","../../src/composables/useWorkflowPersistence.ts","../../src/constants/coreSettings.ts","../../src/components/graph/GraphCanvas.vue","../../src/components/toast/GlobalToast.vue","../../src/components/actionbar/BatchCountEdit.vue","../../src/components/actionbar/ComfyQueueButton.vue","../../src/components/actionbar/ComfyActionbar.vue","../../src/components/topbar/BottomPanelToggleButton.vue","../../src/components/topbar/CommandMenubar.vue","../../src/components/topbar/TopMenubar.vue","../../src/composables/useCoreCommands.ts","../../src/types/serverArgs.ts","../../src/constants/serverConfig.ts","../../src/services/autoQueueService.ts","../../src/views/GraphView.vue"],"sourcesContent":["\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","import type { Size, Vector2 } from '@comfyorg/litegraph'\nimport { CSSProperties, ref } from 'vue'\n\nimport { app } from '@/scripts/app'\nimport { useCanvasStore } from '@/stores/graphStore'\n\nexport interface PositionConfig {\n /* The position of the element on litegraph canvas */\n pos: Vector2\n /* The size of the element on litegraph canvas */\n size: Size\n /* The scale factor of the canvas */\n scale?: number\n}\n\nexport function useAbsolutePosition() {\n const canvasStore = useCanvasStore()\n const style = ref({\n position: 'fixed',\n left: '0px',\n top: '0px',\n width: '0px',\n height: '0px'\n })\n\n const updatePosition = (\n config: PositionConfig,\n extraStyle?: CSSProperties\n ) => {\n const { pos, size, scale = canvasStore.canvas?.ds?.scale ?? 1 } = config\n const [left, top] = app.canvasPosToClientPos(pos)\n const [width, height] = size\n\n style.value = {\n ...style.value,\n left: `${left}px`,\n top: `${top}px`,\n width: `${width * scale}px`,\n height: `${height * scale}px`,\n ...extraStyle\n }\n }\n\n return {\n style,\n updatePosition\n }\n}\n","\n\n\n\n\n\n","\n\n\n\n\n","import type { LGraphNode } from '@comfyorg/litegraph'\nimport type { IWidget } from '@comfyorg/litegraph'\nimport { computed, ref, watchEffect } from 'vue'\n\nimport { useCommandStore } from '@/stores/commandStore'\nimport { useCanvasStore } from '@/stores/graphStore'\nimport { isLGraphNode } from '@/utils/litegraphUtil'\n\ninterface RefreshableItem {\n refresh: () => Promise | void\n}\n\ntype RefreshableWidget = IWidget & RefreshableItem\n\nconst isRefreshableWidget = (widget: IWidget): widget is RefreshableWidget =>\n 'refresh' in widget && typeof widget.refresh === 'function'\n\n/**\n * Tracks selected nodes and their refreshable widgets\n */\nexport const useRefreshableSelection = () => {\n const graphStore = useCanvasStore()\n const commandStore = useCommandStore()\n const selectedNodes = ref([])\n const isAllNodesSelected = ref(false)\n\n watchEffect(() => {\n selectedNodes.value = graphStore.selectedItems.filter(isLGraphNode)\n isAllNodesSelected.value =\n graphStore.canvas?.graph?.nodes?.every((node) => !!node.selected) ?? false\n })\n\n const refreshableWidgets = computed(() =>\n selectedNodes.value.flatMap(\n (node) => node.widgets?.filter(isRefreshableWidget) ?? []\n )\n )\n\n const isRefreshable = computed(\n () => refreshableWidgets.value.length > 0 || isAllNodesSelected.value\n )\n\n async function refreshSelected() {\n if (!isRefreshable.value) return\n\n if (isAllNodesSelected.value) {\n commandStore.execute('Comfy.RefreshNodeDefinitions')\n } else {\n await Promise.all(refreshableWidgets.value.map((item) => item.refresh()))\n }\n }\n\n return {\n isRefreshable,\n refreshSelected\n }\n}\n","\n\n\n\n\n","\n\n\n\n\n","import { defineStore } from 'pinia'\nimport { ref } from 'vue'\n\nexport const useSearchBoxStore = defineStore('searchBox', () => {\n const visible = ref(false)\n function toggleVisible() {\n visible.value = !visible.value\n }\n\n return {\n visible,\n toggleVisible\n }\n})\n","import type {\n ConnectingLink,\n INodeInputSlot,\n INodeOutputSlot,\n INodeSlot,\n ISlotType,\n LGraphNode,\n Vector2\n} from '@comfyorg/litegraph'\nimport { LiteGraph } from '@comfyorg/litegraph'\nimport { RerouteId } from '@comfyorg/litegraph/dist/Reroute'\n\nexport class ConnectingLinkImpl implements ConnectingLink {\n constructor(\n public node: LGraphNode,\n public slot: number,\n public input: INodeInputSlot | undefined,\n public output: INodeOutputSlot | undefined,\n public pos: Vector2,\n public afterRerouteId?: RerouteId\n ) {}\n\n static createFromPlainObject(obj: ConnectingLink) {\n return new ConnectingLinkImpl(\n obj.node,\n obj.slot,\n obj.input,\n obj.output,\n obj.pos,\n obj.afterRerouteId\n )\n }\n\n get type(): ISlotType | null {\n const result = this.input ? this.input.type : this.output?.type ?? null\n return result === -1 ? null : result\n }\n\n /**\n * Which slot type is release and need to be reconnected.\n * - 'output' means we need a new node's outputs slot to connect with this link\n */\n get releaseSlotType(): 'input' | 'output' {\n return this.output ? 'input' : 'output'\n }\n\n connectTo(newNode: LGraphNode) {\n const newNodeSlots =\n this.releaseSlotType === 'output' ? newNode.outputs : newNode.inputs\n if (!newNodeSlots) return\n\n const newNodeSlot = newNodeSlots.findIndex((slot: INodeSlot) =>\n LiteGraph.isValidConnection(slot.type, this.type)\n )\n\n if (newNodeSlot === -1) {\n console.warn(\n `Could not find slot with type ${this.type} on node ${newNode.title}. This should never happen`\n )\n return\n }\n\n if (this.releaseSlotType === 'input') {\n this.node.connect(this.slot, newNode, newNodeSlot, this.afterRerouteId)\n } else {\n newNode.connect(newNodeSlot, this.node, this.slot, this.afterRerouteId)\n }\n }\n}\n\nexport type CanvasDragAndDropData = {\n type: 'add-node'\n data: T\n}\n","\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import { LGraphNode } from '@comfyorg/litegraph'\nimport { LiteGraph } from '@comfyorg/litegraph'\nimport { Ref } from 'vue'\n\nimport { usePragmaticDroppable } from '@/composables/usePragmaticDragAndDrop'\nimport { app as comfyApp } from '@/scripts/app'\nimport { useLitegraphService } from '@/services/litegraphService'\nimport { useWorkflowService } from '@/services/workflowService'\nimport { ComfyModelDef } from '@/stores/modelStore'\nimport { ModelNodeProvider } from '@/stores/modelToNodeStore'\nimport { useModelToNodeStore } from '@/stores/modelToNodeStore'\nimport { ComfyNodeDefImpl } from '@/stores/nodeDefStore'\nimport { ComfyWorkflow } from '@/stores/workflowStore'\nimport { RenderedTreeExplorerNode } from '@/types/treeExplorerTypes'\n\nexport const useCanvasDrop = (canvasRef: Ref) => {\n const modelToNodeStore = useModelToNodeStore()\n const litegraphService = useLitegraphService()\n const workflowService = useWorkflowService()\n\n usePragmaticDroppable(() => canvasRef.value, {\n getDropEffect: (args): Exclude =>\n args.source.data.type === 'tree-explorer-node' ? 'copy' : 'move',\n onDrop: (event) => {\n const loc = event.location.current.input\n const dndData = event.source.data\n\n if (dndData.type === 'tree-explorer-node') {\n const node = dndData.data as RenderedTreeExplorerNode\n if (node.data instanceof ComfyNodeDefImpl) {\n const nodeDef = node.data\n // Add an offset on x to make sure after adding the node, the cursor\n // is on the node (top left corner)\n const pos = comfyApp.clientPosToCanvasPos([\n loc.clientX,\n loc.clientY + LiteGraph.NODE_TITLE_HEIGHT\n ])\n litegraphService.addNodeOnGraph(nodeDef, { pos })\n } else if (node.data instanceof ComfyModelDef) {\n const model = node.data\n const pos = comfyApp.clientPosToCanvasPos([loc.clientX, loc.clientY])\n const nodeAtPos = comfyApp.graph.getNodeOnPos(pos[0], pos[1])\n let targetProvider: ModelNodeProvider | null = null\n let targetGraphNode: LGraphNode | null = null\n if (nodeAtPos) {\n const providers = modelToNodeStore.getAllNodeProviders(\n model.directory\n )\n for (const provider of providers) {\n if (provider.nodeDef.name === nodeAtPos.comfyClass) {\n targetGraphNode = nodeAtPos\n targetProvider = provider\n }\n }\n }\n if (!targetGraphNode) {\n const provider = modelToNodeStore.getNodeProvider(model.directory)\n if (provider) {\n targetGraphNode = litegraphService.addNodeOnGraph(\n provider.nodeDef,\n {\n pos\n }\n )\n targetProvider = provider\n }\n }\n if (targetGraphNode) {\n const widget = targetGraphNode.widgets?.find(\n (widget) => widget.name === targetProvider?.key\n )\n if (widget) {\n widget.value = model.file_name\n }\n }\n } else if (node.data instanceof ComfyWorkflow) {\n const workflow = node.data\n const position = comfyApp.clientPosToCanvasPos([\n loc.clientX,\n loc.clientY\n ])\n workflowService.insertWorkflow(workflow, { position })\n }\n }\n }\n })\n}\n","import type {\n IContextMenuOptions,\n IContextMenuValue,\n INodeInputSlot,\n IWidget\n} from '@comfyorg/litegraph'\nimport { LGraphCanvas, LiteGraph } from '@comfyorg/litegraph'\n\nimport { st, te } from '@/i18n'\nimport { normalizeI18nKey } from '@/utils/formatUtil'\n\n/**\n * Add translation for litegraph context menu.\n */\nexport const useContextMenuTranslation = () => {\n const f = LGraphCanvas.prototype.getCanvasMenuOptions\n const getCanvasCenterMenuOptions = function (\n this: LGraphCanvas,\n ...args: Parameters\n ) {\n const res = f.apply(this, args) as ReturnType\n for (const item of res) {\n if (item?.content) {\n item.content = st(`contextMenu.${item.content}`, item.content)\n }\n }\n return res\n }\n\n LGraphCanvas.prototype.getCanvasMenuOptions = getCanvasCenterMenuOptions\n\n function translateMenus(\n values: (IContextMenuValue | string)[] | undefined,\n options: IContextMenuOptions\n ) {\n if (!values) return\n const reInput = /Convert (.*) to input/\n const reWidget = /Convert (.*) to widget/\n const cvt = st('contextMenu.Convert ', 'Convert ')\n const tinp = st('contextMenu. to input', ' to input')\n const twgt = st('contextMenu. to widget', ' to widget')\n for (const value of values) {\n if (typeof value === 'string') continue\n\n translateMenus(value?.submenu?.options, options)\n if (!value?.content) {\n continue\n }\n if (te(`contextMenu.${value.content}`)) {\n value.content = st(`contextMenu.${value.content}`, value.content)\n }\n\n // for capture translation text of input and widget\n const extraInfo: any = options.extra || options.parentMenu?.options?.extra\n // widgets and inputs\n const matchInput = value.content?.match(reInput)\n if (matchInput) {\n let match = matchInput[1]\n extraInfo?.inputs?.find((i: INodeInputSlot) => {\n if (i.name != match) return false\n match = i.label ? i.label : i.name\n })\n extraInfo?.widgets?.find((i: IWidget) => {\n if (i.name != match) return false\n match = i.label ? i.label : i.name\n })\n value.content = cvt + match + tinp\n continue\n }\n const matchWidget = value.content?.match(reWidget)\n if (matchWidget) {\n let match = matchWidget[1]\n extraInfo?.inputs?.find((i: INodeInputSlot) => {\n if (i.name != match) return false\n match = i.label ? i.label : i.name\n })\n extraInfo?.widgets?.find((i: IWidget) => {\n if (i.name != match) return false\n match = i.label ? i.label : i.name\n })\n value.content = cvt + match + twgt\n continue\n }\n }\n }\n\n const OriginalContextMenu = LiteGraph.ContextMenu\n function ContextMenu(\n values: (IContextMenuValue | string)[],\n options: IContextMenuOptions\n ) {\n if (options.title) {\n options.title = st(\n `nodeDefs.${normalizeI18nKey(options.title)}.display_name`,\n options.title\n )\n }\n translateMenus(values, options)\n const ctx = new OriginalContextMenu(values, options)\n return ctx\n }\n\n LiteGraph.ContextMenu = ContextMenu as unknown as typeof LiteGraph.ContextMenu\n}\n","import { useEventListener } from '@vueuse/core'\n\nimport { useCanvasStore } from '@/stores/graphStore'\n\n/**\n * Adds a handler on copy that serializes selected nodes to JSON\n */\nexport const useCopy = () => {\n const canvasStore = useCanvasStore()\n\n useEventListener(document, 'copy', (e) => {\n if (!(e.target instanceof Element)) {\n return\n }\n if (\n (e.target instanceof HTMLTextAreaElement &&\n e.target.type === 'textarea') ||\n (e.target instanceof HTMLInputElement && e.target.type === 'text')\n ) {\n // Default system copy\n return\n }\n const isTargetInGraph =\n e.target.classList.contains('litegraph') ||\n e.target.classList.contains('graph-canvas-container') ||\n e.target.id === 'graph-canvas'\n\n // copy nodes and clear clipboard\n const canvas = canvasStore.canvas\n if (isTargetInGraph && canvas?.selectedItems) {\n canvas.copyToClipboard()\n // clearData doesn't remove images from clipboard\n e.clipboardData?.setData('text', ' ')\n e.preventDefault()\n e.stopImmediatePropagation()\n return false\n }\n })\n}\n","// @ts-strict-ignore\nimport {\n ContextMenu,\n DragAndScale,\n LGraph,\n LGraphBadge,\n LGraphCanvas,\n LGraphGroup,\n LGraphNode,\n LLink,\n LiteGraph\n} from '@comfyorg/litegraph'\n\n/**\n * Assign all properties of LiteGraph to window to make it backward compatible.\n */\nexport const useGlobalLitegraph = () => {\n window['LiteGraph'] = LiteGraph\n window['LGraph'] = LGraph\n window['LLink'] = LLink\n window['LGraphNode'] = LGraphNode\n window['LGraphGroup'] = LGraphGroup\n window['DragAndScale'] = DragAndScale\n window['LGraphCanvas'] = LGraphCanvas\n window['ContextMenu'] = ContextMenu\n window['LGraphBadge'] = LGraphBadge\n}\n","import { CanvasPointer, LGraphNode, LiteGraph } from '@comfyorg/litegraph'\nimport { watchEffect } from 'vue'\n\nimport { useCanvasStore } from '@/stores/graphStore'\nimport { useSettingStore } from '@/stores/settingStore'\n\n/**\n * Watch for changes in the setting store and update the LiteGraph settings accordingly.\n */\nexport const useLitegraphSettings = () => {\n const settingStore = useSettingStore()\n const canvasStore = useCanvasStore()\n\n watchEffect(() => {\n const canvasInfoEnabled = settingStore.get('Comfy.Graph.CanvasInfo')\n if (canvasStore.canvas) {\n canvasStore.canvas.show_info = canvasInfoEnabled\n }\n })\n\n watchEffect(() => {\n const zoomSpeed = settingStore.get('Comfy.Graph.ZoomSpeed')\n if (canvasStore.canvas) {\n canvasStore.canvas.zoom_speed = zoomSpeed\n }\n })\n\n watchEffect(() => {\n LiteGraph.snaps_for_comfy = settingStore.get(\n 'Comfy.Node.AutoSnapLinkToSlot'\n )\n })\n\n watchEffect(() => {\n LiteGraph.snap_highlights_node = settingStore.get(\n 'Comfy.Node.SnapHighlightsNode'\n )\n })\n\n watchEffect(() => {\n LGraphNode.keepAllLinksOnBypass = settingStore.get(\n 'Comfy.Node.BypassAllLinksOnDelete'\n )\n })\n\n watchEffect(() => {\n LiteGraph.middle_click_slot_add_default_node = settingStore.get(\n 'Comfy.Node.MiddleClickRerouteNode'\n )\n })\n\n watchEffect(() => {\n const linkRenderMode = settingStore.get('Comfy.LinkRenderMode')\n if (canvasStore.canvas) {\n canvasStore.canvas.links_render_mode = linkRenderMode\n canvasStore.canvas.setDirty(/* fg */ false, /* bg */ true)\n }\n })\n\n watchEffect(() => {\n const lowQualityRenderingZoomThreshold = settingStore.get(\n 'LiteGraph.Canvas.LowQualityRenderingZoomThreshold'\n )\n if (canvasStore.canvas) {\n canvasStore.canvas.low_quality_zoom_threshold =\n lowQualityRenderingZoomThreshold\n canvasStore.canvas.setDirty(/* fg */ true, /* bg */ true)\n }\n })\n\n watchEffect(() => {\n const linkMarkerShape = settingStore.get('Comfy.Graph.LinkMarkers')\n const { canvas } = canvasStore\n if (canvas) {\n canvas.linkMarkerShape = linkMarkerShape\n canvas.setDirty(false, true)\n }\n })\n\n watchEffect(() => {\n const reroutesEnabled = settingStore.get('Comfy.RerouteBeta')\n const { canvas } = canvasStore\n if (canvas) {\n canvas.reroutesEnabled = reroutesEnabled\n canvas.setDirty(false, true)\n }\n })\n\n watchEffect(() => {\n const maximumFps = settingStore.get('LiteGraph.Canvas.MaximumFps')\n const { canvas } = canvasStore\n if (canvas) canvas.maximumFps = maximumFps\n })\n\n watchEffect(() => {\n const dragZoomEnabled = settingStore.get('Comfy.Graph.CtrlShiftZoom')\n const { canvas } = canvasStore\n if (canvas) canvas.dragZoomEnabled = dragZoomEnabled\n })\n\n watchEffect(() => {\n CanvasPointer.doubleClickTime = settingStore.get(\n 'Comfy.Pointer.DoubleClickTime'\n )\n })\n\n watchEffect(() => {\n CanvasPointer.bufferTime = settingStore.get('Comfy.Pointer.ClickBufferTime')\n })\n\n watchEffect(() => {\n CanvasPointer.maxClickDrift = settingStore.get('Comfy.Pointer.ClickDrift')\n })\n\n watchEffect(() => {\n LiteGraph.CANVAS_GRID_SIZE = settingStore.get('Comfy.SnapToGrid.GridSize')\n })\n\n watchEffect(() => {\n LiteGraph.alwaysSnapToGrid = settingStore.get('pysssss.SnapToGrid')\n })\n\n watchEffect(() => {\n LiteGraph.context_menu_scaling = settingStore.get(\n 'LiteGraph.ContextMenu.Scaling'\n )\n })\n}\n","import { LiteGraph } from '@comfyorg/litegraph'\nimport type { LGraphNode } from '@comfyorg/litegraph'\nimport { useEventListener } from '@vueuse/core'\n\nimport { app } from '@/scripts/app'\nimport { useCanvasStore } from '@/stores/graphStore'\nimport { useWorkspaceStore } from '@/stores/workspaceStore'\nimport { ComfyWorkflowJSON } from '@/types/comfyWorkflow'\nimport { isImageNode, isVideoNode } from '@/utils/litegraphUtil'\n\n/**\n * Adds a handler on paste that extracts and loads images or workflows from pasted JSON data\n */\nexport const usePaste = () => {\n const workspaceStore = useWorkspaceStore()\n const canvasStore = useCanvasStore()\n\n const pasteItemOnNode = (\n items: DataTransferItemList,\n node: LGraphNode | null\n ) => {\n if (!node) return\n\n const blob = items[0]?.getAsFile()\n if (!blob) return\n\n node.pasteFile?.(blob)\n node.pasteFiles?.(\n Array.from(items)\n .map((i) => i.getAsFile())\n .filter((f) => f !== null)\n )\n }\n\n useEventListener(document, 'paste', async (e: ClipboardEvent) => {\n // ctrl+shift+v is used to paste nodes with connections\n // this is handled by litegraph\n if (workspaceStore.shiftDown) return\n\n const canvas = canvasStore.canvas\n if (!canvas) return\n\n const graph = canvas.graph\n // @ts-expect-error: Property 'clipboardData' does not exist on type 'Window & typeof globalThis'.\n // Did you mean 'Clipboard'?ts(2551)\n // TODO: Not sure what the code wants to do.\n let data = e.clipboardData || window.clipboardData\n const items: DataTransferItemList = data.items\n\n const currentNode = canvas.current_node as LGraphNode\n const isNodeSelected = currentNode?.is_selected\n\n const isImageNodeSelected = isNodeSelected && isImageNode(currentNode)\n const isVideoNodeSelected = isNodeSelected && isVideoNode(currentNode)\n\n let imageNode: LGraphNode | null = isImageNodeSelected ? currentNode : null\n const videoNode: LGraphNode | null = isVideoNodeSelected\n ? currentNode\n : null\n\n // Look for image paste data\n for (const item of items) {\n if (item.type.startsWith('image/')) {\n if (!imageNode) {\n // No image node selected: add a new one\n const newNode = LiteGraph.createNode('LoadImage')\n // @ts-expect-error array to Float32Array\n newNode.pos = [...canvas.graph_mouse]\n imageNode = graph?.add(newNode) ?? null\n graph?.change()\n }\n pasteItemOnNode(items, imageNode)\n return\n } else if (item.type.startsWith('video/')) {\n if (!videoNode) {\n // No video node selected: add a new one\n // TODO: when video node exists\n } else {\n pasteItemOnNode(items, videoNode)\n return\n }\n }\n }\n\n // No image found. Look for node data\n data = data.getData('text/plain')\n let workflow: ComfyWorkflowJSON | null = null\n try {\n data = data.slice(data.indexOf('{'))\n workflow = JSON.parse(data)\n } catch (err) {\n try {\n data = data.slice(data.indexOf('workflow\\n'))\n data = data.slice(data.indexOf('{'))\n workflow = JSON.parse(data)\n } catch (error) {\n workflow = null\n }\n }\n\n if (workflow && workflow.version && workflow.nodes && workflow.extra) {\n await app.loadGraphData(workflow)\n } else {\n if (\n (e.target instanceof HTMLTextAreaElement &&\n e.target.type === 'textarea') ||\n (e.target instanceof HTMLInputElement && e.target.type === 'text')\n ) {\n return\n }\n\n // Litegraph default paste\n canvas.pasteFromClipboard()\n }\n })\n}\n","import { computed, watch, watchEffect } from 'vue'\n\nimport { api } from '@/scripts/api'\nimport { app as comfyApp } from '@/scripts/app'\nimport { getStorageValue, setStorageValue } from '@/scripts/utils'\nimport { useWorkflowService } from '@/services/workflowService'\nimport { useModelStore } from '@/stores/modelStore'\nimport { useSettingStore } from '@/stores/settingStore'\nimport { useWorkflowStore } from '@/stores/workflowStore'\n\nexport function useWorkflowPersistence() {\n const workflowStore = useWorkflowStore()\n const settingStore = useSettingStore()\n\n const persistCurrentWorkflow = () => {\n const workflow = JSON.stringify(comfyApp.serializeGraph())\n localStorage.setItem('workflow', workflow)\n if (api.clientId) {\n sessionStorage.setItem(`workflow:${api.clientId}`, workflow)\n }\n }\n\n const loadWorkflowFromStorage = async (\n json: string | null,\n workflowName: string | null\n ) => {\n if (!json) return false\n const workflow = JSON.parse(json)\n await comfyApp.loadGraphData(workflow, true, true, workflowName)\n return true\n }\n\n const loadPreviousWorkflowFromStorage = async () => {\n const workflowName = getStorageValue('Comfy.PreviousWorkflow')\n const clientId = api.initialClientId ?? api.clientId\n\n // Try loading from session storage first\n if (clientId) {\n const sessionWorkflow = sessionStorage.getItem(`workflow:${clientId}`)\n if (await loadWorkflowFromStorage(sessionWorkflow, workflowName)) {\n return true\n }\n }\n\n // Fall back to local storage\n const localWorkflow = localStorage.getItem('workflow')\n return await loadWorkflowFromStorage(localWorkflow, workflowName)\n }\n\n const loadDefaultWorkflow = async () => {\n if (!settingStore.get('Comfy.TutorialCompleted')) {\n await settingStore.set('Comfy.TutorialCompleted', true)\n await useModelStore().loadModelFolders()\n await useWorkflowService().loadTutorialWorkflow()\n } else {\n await comfyApp.loadGraphData()\n }\n }\n\n const restorePreviousWorkflow = async () => {\n try {\n const restored = await loadPreviousWorkflowFromStorage()\n if (!restored) {\n await loadDefaultWorkflow()\n }\n } catch (err) {\n console.error('Error loading previous workflow', err)\n await loadDefaultWorkflow()\n }\n }\n\n // Setup watchers\n watchEffect(() => {\n if (workflowStore.activeWorkflow) {\n const workflow = workflowStore.activeWorkflow\n setStorageValue('Comfy.PreviousWorkflow', workflow.key)\n // When the activeWorkflow changes, the graph has already been loaded.\n // Saving the current state of the graph to the localStorage.\n persistCurrentWorkflow()\n }\n })\n api.addEventListener('graphChanged', persistCurrentWorkflow)\n\n // Restore workflow tabs states\n const openWorkflows = computed(() => workflowStore.openWorkflows)\n const activeWorkflow = computed(() => workflowStore.activeWorkflow)\n const restoreState = computed<{ paths: string[]; activeIndex: number }>(\n () => {\n if (!openWorkflows.value || !activeWorkflow.value) {\n return { paths: [], activeIndex: -1 }\n }\n\n const paths = openWorkflows.value\n .filter((workflow) => workflow?.isPersisted && !workflow.isModified)\n .map((workflow) => workflow.path)\n const activeIndex = openWorkflows.value.findIndex(\n (workflow) => workflow.path === activeWorkflow.value?.path\n )\n\n return { paths, activeIndex }\n }\n )\n\n // Get storage values before setting watchers\n const storedWorkflows = JSON.parse(\n getStorageValue('Comfy.OpenWorkflowsPaths') || '[]'\n )\n const storedActiveIndex = JSON.parse(\n getStorageValue('Comfy.ActiveWorkflowIndex') || '-1'\n )\n watch(restoreState, ({ paths, activeIndex }) => {\n setStorageValue('Comfy.OpenWorkflowsPaths', JSON.stringify(paths))\n setStorageValue('Comfy.ActiveWorkflowIndex', JSON.stringify(activeIndex))\n })\n\n const restoreWorkflowTabsState = () => {\n const isRestorable = storedWorkflows?.length > 0 && storedActiveIndex >= 0\n if (isRestorable) {\n workflowStore.openWorkflowsInBackground({\n left: storedWorkflows.slice(0, storedActiveIndex),\n right: storedWorkflows.slice(storedActiveIndex)\n })\n }\n }\n\n return {\n restorePreviousWorkflow,\n restoreWorkflowTabsState\n }\n}\n","import { LinkMarkerShape } from '@comfyorg/litegraph'\nimport { LiteGraph } from '@comfyorg/litegraph'\n\nimport type { ColorPalettes } from '@/types/colorPaletteTypes'\nimport type { Keybinding } from '@/types/keyBindingTypes'\nimport { NodeBadgeMode } from '@/types/nodeSource'\nimport { LinkReleaseTriggerAction } from '@/types/searchBoxTypes'\nimport type { SettingParams } from '@/types/settingTypes'\n\nexport const CORE_SETTINGS: SettingParams[] = [\n {\n id: 'Comfy.Validation.Workflows',\n name: 'Validate workflows',\n type: 'boolean',\n defaultValue: true\n },\n {\n id: 'Comfy.NodeSearchBoxImpl',\n category: ['Comfy', 'Node Search Box', 'Implementation'],\n experimental: true,\n name: 'Node search box implementation',\n type: 'combo',\n options: ['default', 'litegraph (legacy)'],\n defaultValue: 'default'\n },\n {\n id: 'Comfy.LinkRelease.Action',\n category: ['LiteGraph', 'LinkRelease', 'Action'],\n name: 'Action on link release (No modifier)',\n type: 'combo',\n options: Object.values(LinkReleaseTriggerAction),\n defaultValue: LinkReleaseTriggerAction.CONTEXT_MENU\n },\n {\n id: 'Comfy.LinkRelease.ActionShift',\n category: ['LiteGraph', 'LinkRelease', 'ActionShift'],\n name: 'Action on link release (Shift)',\n type: 'combo',\n options: Object.values(LinkReleaseTriggerAction),\n defaultValue: LinkReleaseTriggerAction.SEARCH_BOX\n },\n {\n id: 'Comfy.NodeSearchBoxImpl.NodePreview',\n category: ['Comfy', 'Node Search Box', 'NodePreview'],\n name: 'Node preview',\n tooltip: 'Only applies to the default implementation',\n type: 'boolean',\n defaultValue: true\n },\n {\n id: 'Comfy.NodeSearchBoxImpl.ShowCategory',\n category: ['Comfy', 'Node Search Box', 'ShowCategory'],\n name: 'Show node category in search results',\n tooltip: 'Only applies to the default implementation',\n type: 'boolean',\n defaultValue: true\n },\n {\n id: 'Comfy.NodeSearchBoxImpl.ShowIdName',\n category: ['Comfy', 'Node Search Box', 'ShowIdName'],\n name: 'Show node id name in search results',\n tooltip: 'Only applies to the default implementation',\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'Comfy.NodeSearchBoxImpl.ShowNodeFrequency',\n category: ['Comfy', 'Node Search Box', 'ShowNodeFrequency'],\n name: 'Show node frequency in search results',\n tooltip: 'Only applies to the default implementation',\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'Comfy.Sidebar.Location',\n category: ['Appearance', 'Sidebar', 'Location'],\n name: 'Sidebar location',\n type: 'combo',\n options: ['left', 'right'],\n defaultValue: 'left'\n },\n {\n id: 'Comfy.Sidebar.Size',\n category: ['Appearance', 'Sidebar', 'Size'],\n name: 'Sidebar size',\n type: 'combo',\n options: ['normal', 'small'],\n // Default to small if the window is less than 1536px(2xl) wide.\n defaultValue: () => (window.innerWidth < 1536 ? 'small' : 'normal')\n },\n {\n id: 'Comfy.TextareaWidget.FontSize',\n category: ['Appearance', 'Node Widget', 'TextareaWidget', 'FontSize'],\n name: 'Textarea widget font size',\n type: 'slider',\n defaultValue: 10,\n attrs: {\n min: 8,\n max: 24\n }\n },\n {\n id: 'Comfy.TextareaWidget.Spellcheck',\n category: ['Comfy', 'Node Widget', 'TextareaWidget', 'Spellcheck'],\n name: 'Textarea widget spellcheck',\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'Comfy.Workflow.SortNodeIdOnSave',\n name: 'Sort node IDs when saving workflow',\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'Comfy.Graph.CanvasInfo',\n category: ['LiteGraph', 'Canvas', 'CanvasInfo'],\n name: 'Show canvas info on bottom left corner (fps, etc.)',\n type: 'boolean',\n defaultValue: true\n },\n {\n id: 'Comfy.Node.ShowDeprecated',\n name: 'Show deprecated nodes in search',\n tooltip:\n 'Deprecated nodes are hidden by default in the UI, but remain functional in existing workflows that use them.',\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'Comfy.Node.ShowExperimental',\n name: 'Show experimental nodes in search',\n tooltip:\n 'Experimental nodes are marked as such in the UI and may be subject to significant changes or removal in future versions. Use with caution in production workflows',\n type: 'boolean',\n defaultValue: true\n },\n {\n id: 'Comfy.Node.Opacity',\n category: ['Appearance', 'Node', 'Opacity'],\n name: 'Node opacity',\n type: 'slider',\n defaultValue: 1,\n attrs: {\n min: 0.01,\n max: 1,\n step: 0.01\n }\n },\n {\n id: 'Comfy.Workflow.ShowMissingNodesWarning',\n name: 'Show missing nodes warning',\n type: 'boolean',\n defaultValue: true\n },\n {\n id: 'Comfy.Workflow.ShowMissingModelsWarning',\n name: 'Show missing models warning',\n type: 'boolean',\n defaultValue: true,\n experimental: true\n },\n {\n id: 'Comfy.Graph.ZoomSpeed',\n category: ['LiteGraph', 'Canvas', 'ZoomSpeed'],\n name: 'Canvas zoom speed',\n type: 'slider',\n defaultValue: 1.1,\n attrs: {\n min: 1.01,\n max: 2.5,\n step: 0.01\n }\n },\n // Bookmarks are stored in the settings store.\n // Bookmarks are in format of category/display_name. e.g. \"conditioning/CLIPTextEncode\"\n {\n id: 'Comfy.NodeLibrary.Bookmarks',\n name: 'Node library bookmarks with display name (deprecated)',\n type: 'hidden',\n defaultValue: [],\n deprecated: true\n },\n {\n id: 'Comfy.NodeLibrary.Bookmarks.V2',\n name: 'Node library bookmarks v2 with unique name',\n type: 'hidden',\n defaultValue: []\n },\n // Stores mapping from bookmark folder name to its customization.\n {\n id: 'Comfy.NodeLibrary.BookmarksCustomization',\n name: 'Node library bookmarks customization',\n type: 'hidden',\n defaultValue: {}\n },\n // Hidden setting used by the queue for how to fit images\n {\n id: 'Comfy.Queue.ImageFit',\n name: 'Queue image fit',\n type: 'hidden',\n defaultValue: 'cover'\n },\n {\n id: 'Comfy.GroupSelectedNodes.Padding',\n category: ['LiteGraph', 'Group', 'Padding'],\n name: 'Group selected nodes padding',\n type: 'slider',\n defaultValue: 10,\n attrs: {\n min: 0,\n max: 100\n }\n },\n {\n id: 'Comfy.Node.DoubleClickTitleToEdit',\n category: ['LiteGraph', 'Node', 'DoubleClickTitleToEdit'],\n name: 'Double click node title to edit',\n type: 'boolean',\n defaultValue: true\n },\n {\n id: 'Comfy.Group.DoubleClickTitleToEdit',\n category: ['LiteGraph', 'Group', 'DoubleClickTitleToEdit'],\n name: 'Double click group title to edit',\n type: 'boolean',\n defaultValue: true\n },\n {\n id: 'Comfy.Window.UnloadConfirmation',\n name: 'Show confirmation when closing window',\n type: 'boolean',\n defaultValue: true,\n versionModified: '1.7.12'\n },\n {\n id: 'Comfy.TreeExplorer.ItemPadding',\n category: ['Appearance', 'Tree Explorer', 'ItemPadding'],\n name: 'Tree explorer item padding',\n type: 'slider',\n defaultValue: 2,\n attrs: {\n min: 0,\n max: 8,\n step: 1\n }\n },\n {\n id: 'Comfy.ModelLibrary.AutoLoadAll',\n name: 'Automatically load all model folders',\n tooltip:\n 'If true, all folders will load as soon as you open the model library (this may cause delays while it loads). If false, root level model folders will only load once you click on them.',\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'Comfy.ModelLibrary.NameFormat',\n name: 'What name to display in the model library tree view',\n tooltip:\n 'Select \"filename\" to render a simplified view of the raw filename (without directory or \".safetensors\" extension) in the model list. Select \"title\" to display the configurable model metadata title.',\n type: 'combo',\n options: ['filename', 'title'],\n defaultValue: 'title'\n },\n {\n id: 'Comfy.Locale',\n name: 'Language',\n type: 'combo',\n options: [\n { value: 'en', text: 'English' },\n { value: 'zh', text: '中文' },\n { value: 'ru', text: 'Русский' },\n { value: 'ja', text: '日本語' },\n { value: 'ko', text: '한국어' },\n { value: 'fr', text: 'Français' }\n ],\n defaultValue: () => navigator.language.split('-')[0] || 'en'\n },\n {\n id: 'Comfy.NodeBadge.NodeSourceBadgeMode',\n category: ['LiteGraph', 'Node', 'NodeSourceBadgeMode'],\n name: 'Node source badge mode',\n type: 'combo',\n options: Object.values(NodeBadgeMode),\n defaultValue: NodeBadgeMode.HideBuiltIn\n },\n {\n id: 'Comfy.NodeBadge.NodeIdBadgeMode',\n category: ['LiteGraph', 'Node', 'NodeIdBadgeMode'],\n name: 'Node ID badge mode',\n type: 'combo',\n options: [NodeBadgeMode.None, NodeBadgeMode.ShowAll],\n defaultValue: NodeBadgeMode.None\n },\n {\n id: 'Comfy.NodeBadge.NodeLifeCycleBadgeMode',\n category: ['LiteGraph', 'Node', 'NodeLifeCycleBadgeMode'],\n name: 'Node life cycle badge mode',\n type: 'combo',\n options: [NodeBadgeMode.None, NodeBadgeMode.ShowAll],\n defaultValue: NodeBadgeMode.ShowAll\n },\n {\n id: 'Comfy.ConfirmClear',\n category: ['Comfy', 'Workflow', 'ConfirmClear'],\n name: 'Require confirmation when clearing workflow',\n type: 'boolean',\n defaultValue: true\n },\n {\n id: 'Comfy.PromptFilename',\n category: ['Comfy', 'Workflow', 'PromptFilename'],\n name: 'Prompt for filename when saving workflow',\n type: 'boolean',\n defaultValue: true\n },\n /**\n * file format for preview\n *\n * format;quality\n *\n * ex)\n * webp;50 -> webp, quality 50\n * jpeg;80 -> rgb, jpeg, quality 80\n *\n * @type {string}\n */\n {\n id: 'Comfy.PreviewFormat',\n category: ['LiteGraph', 'Node Widget', 'PreviewFormat'],\n name: 'Preview image format',\n tooltip:\n 'When displaying a preview in the image widget, convert it to a lightweight image, e.g. webp, jpeg, webp;50, etc.',\n type: 'text',\n defaultValue: ''\n },\n {\n id: 'Comfy.DisableSliders',\n category: ['LiteGraph', 'Node Widget', 'DisableSliders'],\n name: 'Disable node widget sliders',\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'Comfy.DisableFloatRounding',\n category: ['LiteGraph', 'Node Widget', 'DisableFloatRounding'],\n name: 'Disable default float widget rounding.',\n tooltip:\n '(requires page reload) Cannot disable round when round is set by the node in the backend.',\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'Comfy.FloatRoundingPrecision',\n category: ['LiteGraph', 'Node Widget', 'FloatRoundingPrecision'],\n name: 'Float widget rounding decimal places [0 = auto].',\n tooltip: '(requires page reload)',\n type: 'slider',\n attrs: {\n min: 0,\n max: 6,\n step: 1\n },\n defaultValue: 0\n },\n {\n id: 'LiteGraph.Node.TooltipDelay',\n name: 'Tooltip Delay',\n type: 'number',\n attrs: {\n min: 100,\n max: 3000,\n step: 50\n },\n defaultValue: 500,\n versionAdded: '1.9.0'\n },\n {\n id: 'Comfy.EnableTooltips',\n category: ['LiteGraph', 'Node', 'EnableTooltips'],\n name: 'Enable Tooltips',\n type: 'boolean',\n defaultValue: true\n },\n {\n id: 'Comfy.DevMode',\n name: 'Enable dev mode options (API save, etc.)',\n type: 'boolean',\n defaultValue: false,\n onChange: (value) => {\n const element = document.getElementById('comfy-dev-save-api-button')\n if (element) {\n element.style.display = value ? 'flex' : 'none'\n }\n }\n },\n {\n id: 'Comfy.UseNewMenu',\n category: ['Comfy', 'Menu', 'UseNewMenu'],\n defaultValue: 'Top',\n name: 'Use new menu',\n type: 'combo',\n options: ['Disabled', 'Top', 'Bottom'],\n migrateDeprecatedValue: (value: string) => {\n // Floating is now supported by dragging the docked actionbar off.\n if (value === 'Floating') {\n return 'Top'\n }\n return value\n }\n },\n {\n id: 'Comfy.Workflow.WorkflowTabsPosition',\n name: 'Opened workflows position',\n type: 'combo',\n options: ['Sidebar', 'Topbar', 'Topbar (2nd-row)'],\n // Default to topbar (2nd-row) if the window is less than 1536px(2xl) wide.\n defaultValue: () =>\n window.innerWidth < 1536 ? 'Topbar (2nd-row)' : 'Topbar'\n },\n {\n id: 'Comfy.Graph.CanvasMenu',\n category: ['LiteGraph', 'Canvas', 'CanvasMenu'],\n name: 'Show graph canvas menu',\n type: 'boolean',\n defaultValue: true\n },\n {\n id: 'Comfy.QueueButton.BatchCountLimit',\n name: 'Batch count limit',\n tooltip:\n 'The maximum number of tasks added to the queue at one button click',\n type: 'number',\n defaultValue: 100,\n versionAdded: '1.3.5'\n },\n {\n id: 'Comfy.Keybinding.UnsetBindings',\n name: 'Keybindings unset by the user',\n type: 'hidden',\n defaultValue: [] as Keybinding[],\n versionAdded: '1.3.7',\n versionModified: '1.7.3',\n migrateDeprecatedValue: (value: any[]) => {\n return value.map((keybinding) => {\n if (keybinding['targetSelector'] === '#graph-canvas') {\n keybinding['targetElementId'] = 'graph-canvas'\n }\n return keybinding\n })\n }\n },\n {\n id: 'Comfy.Keybinding.NewBindings',\n name: 'Keybindings set by the user',\n type: 'hidden',\n defaultValue: [] as Keybinding[],\n versionAdded: '1.3.7'\n },\n {\n id: 'Comfy.Extension.Disabled',\n name: 'Disabled extension names',\n type: 'hidden',\n defaultValue: [] as string[],\n versionAdded: '1.3.11'\n },\n {\n id: 'Comfy.Validation.NodeDefs',\n name: 'Validate node definitions (slow)',\n type: 'boolean',\n tooltip:\n 'Recommended for node developers. This will validate all node definitions on startup.',\n defaultValue: false,\n versionAdded: '1.3.14'\n },\n {\n id: 'Comfy.LinkRenderMode',\n category: ['LiteGraph', 'Graph', 'LinkRenderMode'],\n name: 'Link Render Mode',\n defaultValue: 2,\n type: 'combo',\n options: [\n { value: LiteGraph.STRAIGHT_LINK, text: 'Straight' },\n { value: LiteGraph.LINEAR_LINK, text: 'Linear' },\n { value: LiteGraph.SPLINE_LINK, text: 'Spline' },\n { value: LiteGraph.HIDDEN_LINK, text: 'Hidden' }\n ]\n },\n {\n id: 'Comfy.Node.AutoSnapLinkToSlot',\n category: ['LiteGraph', 'Node', 'AutoSnapLinkToSlot'],\n name: 'Auto snap link to node slot',\n tooltip:\n 'When dragging a link over a node, the link automatically snap to a viable input slot on the node',\n type: 'boolean',\n defaultValue: true,\n versionAdded: '1.3.29'\n },\n {\n id: 'Comfy.Node.SnapHighlightsNode',\n category: ['LiteGraph', 'Node', 'SnapHighlightsNode'],\n name: 'Snap highlights node',\n tooltip:\n 'When dragging a link over a node with viable input slot, highlight the node',\n type: 'boolean',\n defaultValue: true,\n versionAdded: '1.3.29'\n },\n {\n id: 'Comfy.Node.BypassAllLinksOnDelete',\n category: ['LiteGraph', 'Node', 'BypassAllLinksOnDelete'],\n name: 'Keep all links when deleting nodes',\n tooltip:\n 'When deleting a node, attempt to reconnect all of its input and output links (bypassing the deleted node)',\n type: 'boolean',\n defaultValue: true,\n versionAdded: '1.3.40'\n },\n {\n id: 'Comfy.Node.MiddleClickRerouteNode',\n category: ['LiteGraph', 'Node', 'MiddleClickRerouteNode'],\n name: 'Middle-click creates a new Reroute node',\n type: 'boolean',\n defaultValue: true,\n versionAdded: '1.3.42'\n },\n {\n id: 'Comfy.RerouteBeta',\n category: ['LiteGraph', 'RerouteBeta'],\n name: 'Opt-in to the reroute beta test',\n tooltip:\n 'Enables the new native reroutes.\\n\\nReroutes can be added by holding alt and dragging from a link line, or on the link menu.\\n\\nDisabling this option is non-destructive - reroutes are hidden.',\n experimental: true,\n type: 'boolean',\n defaultValue: false,\n versionAdded: '1.3.42'\n },\n {\n id: 'Comfy.Graph.LinkMarkers',\n category: ['LiteGraph', 'Link', 'LinkMarkers'],\n name: 'Link midpoint markers',\n defaultValue: LinkMarkerShape.Circle,\n type: 'combo',\n options: [\n { value: LinkMarkerShape.None, text: 'None' },\n { value: LinkMarkerShape.Circle, text: 'Circle' },\n { value: LinkMarkerShape.Arrow, text: 'Arrow' }\n ],\n versionAdded: '1.3.42'\n },\n {\n id: 'Comfy.DOMClippingEnabled',\n category: ['LiteGraph', 'Node', 'DOMClippingEnabled'],\n name: 'Enable DOM element clipping (enabling may reduce performance)',\n type: 'boolean',\n defaultValue: true\n },\n {\n id: 'Comfy.Graph.CtrlShiftZoom',\n category: ['LiteGraph', 'Canvas', 'CtrlShiftZoom'],\n name: 'Enable fast-zoom shortcut (Ctrl + Shift + Drag)',\n type: 'boolean',\n defaultValue: true,\n versionAdded: '1.4.0'\n },\n {\n id: 'Comfy.Pointer.ClickDrift',\n category: ['LiteGraph', 'Pointer', 'ClickDrift'],\n name: 'Pointer click drift (maximum distance)',\n tooltip:\n 'If the pointer moves more than this distance while holding a button down, it is considered dragging (rather than clicking).\\n\\nHelps prevent objects from being unintentionally nudged if the pointer is moved whilst clicking.',\n experimental: true,\n type: 'slider',\n attrs: {\n min: 0,\n max: 20,\n step: 1\n },\n defaultValue: 6,\n versionAdded: '1.4.3'\n },\n {\n id: 'Comfy.Pointer.ClickBufferTime',\n category: ['LiteGraph', 'Pointer', 'ClickBufferTime'],\n name: 'Pointer click drift delay',\n tooltip:\n 'After pressing a pointer button down, this is the maximum time (in milliseconds) that pointer movement can be ignored for.\\n\\nHelps prevent objects from being unintentionally nudged if the pointer is moved whilst clicking.',\n experimental: true,\n type: 'slider',\n attrs: {\n min: 0,\n max: 1000,\n step: 25\n },\n defaultValue: 150,\n versionAdded: '1.4.3'\n },\n {\n id: 'Comfy.Pointer.DoubleClickTime',\n category: ['LiteGraph', 'Pointer', 'DoubleClickTime'],\n name: 'Double click interval (maximum)',\n tooltip:\n 'The maximum time in milliseconds between the two clicks of a double-click. Increasing this value may assist if double-clicks are sometimes not registered.',\n type: 'slider',\n attrs: {\n min: 100,\n max: 1000,\n step: 50\n },\n defaultValue: 300,\n versionAdded: '1.4.3'\n },\n {\n id: 'Comfy.SnapToGrid.GridSize',\n category: ['LiteGraph', 'Canvas', 'GridSize'],\n name: 'Snap to grid size',\n type: 'slider',\n attrs: {\n min: 1,\n max: 500\n },\n tooltip:\n 'When dragging and resizing nodes while holding shift they will be aligned to the grid, this controls the size of that grid.',\n defaultValue: LiteGraph.CANVAS_GRID_SIZE\n },\n // Keep the 'pysssss.SnapToGrid' setting id so we don't need to migrate setting values.\n // Using a new setting id can cause existing users to lose their existing settings.\n {\n id: 'pysssss.SnapToGrid',\n category: ['LiteGraph', 'Canvas', 'AlwaysSnapToGrid'],\n name: 'Always snap to grid',\n type: 'boolean',\n defaultValue: false,\n versionAdded: '1.3.13'\n },\n {\n id: 'Comfy.Server.ServerConfigValues',\n name: 'Server config values for frontend display',\n tooltip: 'Server config values used for frontend display only',\n type: 'hidden',\n // Mapping from server config id to value.\n defaultValue: {} as Record,\n versionAdded: '1.4.8'\n },\n {\n id: 'Comfy.Server.LaunchArgs',\n name: 'Server launch arguments',\n tooltip:\n 'These are the actual arguments that are passed to the server when it is launched.',\n type: 'hidden',\n defaultValue: {} as Record,\n versionAdded: '1.4.8'\n },\n {\n id: 'Comfy.Queue.MaxHistoryItems',\n name: 'Queue history size',\n tooltip: 'The maximum number of tasks that show in the queue history.',\n type: 'slider',\n attrs: {\n min: 16,\n max: 256,\n step: 16\n },\n defaultValue: 64,\n versionAdded: '1.4.12'\n },\n {\n id: 'LiteGraph.Canvas.MaximumFps',\n name: 'Maximum FPS',\n tooltip:\n 'The maximum frames per second that the canvas is allowed to render. Caps GPU usage at the cost of smoothness. If 0, the screen refresh rate is used. Default: 0',\n type: 'slider',\n attrs: {\n min: 0,\n max: 120\n },\n defaultValue: 0,\n versionAdded: '1.5.1'\n },\n {\n id: 'Comfy.EnableWorkflowViewRestore',\n category: ['Comfy', 'Workflow', 'EnableWorkflowViewRestore'],\n name: 'Save and restore canvas position and zoom level in workflows',\n type: 'boolean',\n defaultValue: true,\n versionModified: '1.5.4'\n },\n {\n id: 'Comfy.Workflow.ConfirmDelete',\n name: 'Show confirmation when deleting workflows',\n type: 'boolean',\n defaultValue: true,\n versionAdded: '1.5.6'\n },\n {\n id: 'Comfy.ColorPalette',\n name: 'The active color palette id',\n type: 'hidden',\n defaultValue: 'dark',\n versionModified: '1.6.7',\n migrateDeprecatedValue(value: string) {\n // Legacy custom palettes were prefixed with 'custom_'\n return value.startsWith('custom_') ? value.replace('custom_', '') : value\n }\n },\n {\n id: 'Comfy.CustomColorPalettes',\n name: 'Custom color palettes',\n type: 'hidden',\n defaultValue: {} as ColorPalettes,\n versionModified: '1.6.7'\n },\n {\n id: 'Comfy.WidgetControlMode',\n category: ['Comfy', 'Node Widget', 'WidgetControlMode'],\n name: 'Widget control mode',\n tooltip:\n 'Controls when widget values are updated (randomize/increment/decrement), either before the prompt is queued or after.',\n type: 'combo',\n defaultValue: 'after',\n options: ['before', 'after'],\n versionModified: '1.6.10'\n },\n {\n id: 'Comfy.TutorialCompleted',\n name: 'Tutorial completed',\n type: 'hidden',\n defaultValue: false,\n versionAdded: '1.8.7'\n },\n {\n id: 'LiteGraph.ContextMenu.Scaling',\n name: 'Scale node combo widget menus (lists) when zoomed in',\n defaultValue: false,\n type: 'boolean',\n versionAdded: '1.8.8'\n },\n {\n id: 'LiteGraph.Canvas.LowQualityRenderingZoomThreshold',\n name: 'Low quality rendering zoom threshold',\n tooltip: 'Render low quality shapes when zoomed out',\n type: 'slider',\n attrs: {\n min: 0.1,\n max: 1,\n step: 0.01\n },\n defaultValue: 0.6,\n versionAdded: '1.9.1'\n },\n {\n id: 'Comfy.Canvas.SelectionToolbox',\n category: ['LiteGraph', 'Canvas', 'SelectionToolbox'],\n name: 'Show selection toolbox',\n type: 'boolean',\n defaultValue: true,\n versionAdded: '1.10.5'\n }\n]\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import {\n LGraphEventMode,\n LGraphGroup,\n LGraphNode,\n LiteGraph\n} from '@comfyorg/litegraph'\n\nimport {\n DEFAULT_DARK_COLOR_PALETTE,\n DEFAULT_LIGHT_COLOR_PALETTE\n} from '@/constants/coreColorPalettes'\nimport { t } from '@/i18n'\nimport { api } from '@/scripts/api'\nimport { app } from '@/scripts/app'\nimport { useDialogService } from '@/services/dialogService'\nimport { useLitegraphService } from '@/services/litegraphService'\nimport { useWorkflowService } from '@/services/workflowService'\nimport type { ComfyCommand } from '@/stores/commandStore'\nimport { useTitleEditorStore } from '@/stores/graphStore'\nimport { useQueueSettingsStore, useQueueStore } from '@/stores/queueStore'\nimport { useSettingStore } from '@/stores/settingStore'\nimport { useToastStore } from '@/stores/toastStore'\nimport { type ComfyWorkflow, useWorkflowStore } from '@/stores/workflowStore'\nimport { useBottomPanelStore } from '@/stores/workspace/bottomPanelStore'\nimport { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'\nimport { useSearchBoxStore } from '@/stores/workspace/searchBoxStore'\nimport { useWorkspaceStore } from '@/stores/workspaceStore'\n\nexport function useCoreCommands(): ComfyCommand[] {\n const workflowService = useWorkflowService()\n const workflowStore = useWorkflowStore()\n const dialogService = useDialogService()\n const colorPaletteStore = useColorPaletteStore()\n const getTracker = () => workflowStore.activeWorkflow?.changeTracker\n\n const getSelectedNodes = (): LGraphNode[] => {\n const selectedNodes = app.canvas.selected_nodes\n const result: LGraphNode[] = []\n if (selectedNodes) {\n for (const i in selectedNodes) {\n const node = selectedNodes[i]\n result.push(node)\n }\n }\n return result\n }\n\n const toggleSelectedNodesMode = (mode: LGraphEventMode) => {\n getSelectedNodes().forEach((node) => {\n if (node.mode === mode) {\n node.mode = LGraphEventMode.ALWAYS\n } else {\n node.mode = mode\n }\n })\n }\n\n return [\n {\n id: 'Comfy.NewBlankWorkflow',\n icon: 'pi pi-plus',\n label: 'New Blank Workflow',\n menubarLabel: 'New',\n function: () => workflowService.loadBlankWorkflow()\n },\n {\n id: 'Comfy.OpenWorkflow',\n icon: 'pi pi-folder-open',\n label: 'Open Workflow',\n menubarLabel: 'Open',\n function: () => {\n app.ui.loadFile()\n }\n },\n {\n id: 'Comfy.LoadDefaultWorkflow',\n icon: 'pi pi-code',\n label: 'Load Default Workflow',\n function: () => workflowService.loadDefaultWorkflow()\n },\n {\n id: 'Comfy.SaveWorkflow',\n icon: 'pi pi-save',\n label: 'Save Workflow',\n menubarLabel: 'Save',\n function: async () => {\n const workflow = useWorkflowStore().activeWorkflow as ComfyWorkflow\n if (!workflow) return\n\n await workflowService.saveWorkflow(workflow)\n }\n },\n {\n id: 'Comfy.SaveWorkflowAs',\n icon: 'pi pi-save',\n label: 'Save Workflow As',\n menubarLabel: 'Save As',\n function: async () => {\n const workflow = useWorkflowStore().activeWorkflow as ComfyWorkflow\n if (!workflow) return\n\n await workflowService.saveWorkflowAs(workflow)\n }\n },\n {\n id: 'Comfy.ExportWorkflow',\n icon: 'pi pi-download',\n label: 'Export Workflow',\n menubarLabel: 'Export',\n function: () => {\n workflowService.exportWorkflow('workflow', 'workflow')\n }\n },\n {\n id: 'Comfy.ExportWorkflowAPI',\n icon: 'pi pi-download',\n label: 'Export Workflow (API Format)',\n menubarLabel: 'Export (API)',\n function: () => {\n workflowService.exportWorkflow('workflow_api', 'output')\n }\n },\n {\n id: 'Comfy.Undo',\n icon: 'pi pi-undo',\n label: 'Undo',\n function: async () => {\n await getTracker()?.undo?.()\n }\n },\n {\n id: 'Comfy.Redo',\n icon: 'pi pi-refresh',\n label: 'Redo',\n function: async () => {\n await getTracker()?.redo?.()\n }\n },\n {\n id: 'Comfy.ClearWorkflow',\n icon: 'pi pi-trash',\n label: 'Clear Workflow',\n function: () => {\n const settingStore = useSettingStore()\n if (\n !settingStore.get('Comfy.ComfirmClear') ||\n confirm('Clear workflow?')\n ) {\n app.clean()\n app.graph.clear()\n api.dispatchCustomEvent('graphCleared')\n }\n }\n },\n {\n id: 'Comfy.Canvas.ResetView',\n icon: 'pi pi-expand',\n label: 'Reset View',\n function: () => {\n useLitegraphService().resetView()\n }\n },\n {\n id: 'Comfy.OpenClipspace',\n icon: 'pi pi-clipboard',\n label: 'Clipspace',\n function: () => {\n app.openClipspace()\n }\n },\n {\n id: 'Comfy.RefreshNodeDefinitions',\n icon: 'pi pi-refresh',\n label: 'Refresh Node Definitions',\n function: async () => {\n await app.refreshComboInNodes()\n }\n },\n {\n id: 'Comfy.Interrupt',\n icon: 'pi pi-stop',\n label: 'Interrupt',\n function: async () => {\n await api.interrupt()\n useToastStore().add({\n severity: 'info',\n summary: 'Interrupted',\n detail: 'Execution has been interrupted',\n life: 1000\n })\n }\n },\n {\n id: 'Comfy.ClearPendingTasks',\n icon: 'pi pi-stop',\n label: 'Clear Pending Tasks',\n function: async () => {\n await useQueueStore().clear(['queue'])\n useToastStore().add({\n severity: 'info',\n summary: 'Confirmed',\n detail: 'Pending tasks deleted',\n life: 3000\n })\n }\n },\n {\n id: 'Comfy.BrowseTemplates',\n icon: 'pi pi-folder-open',\n label: 'Browse Templates',\n function: () => {\n dialogService.showTemplateWorkflowsDialog()\n }\n },\n {\n id: 'Comfy.Canvas.ZoomIn',\n icon: 'pi pi-plus',\n label: 'Zoom In',\n function: () => {\n const ds = app.canvas.ds\n ds.changeScale(\n ds.scale * 1.1,\n ds.element ? [ds.element.width / 2, ds.element.height / 2] : undefined\n )\n app.canvas.setDirty(true, true)\n }\n },\n {\n id: 'Comfy.Canvas.ZoomOut',\n icon: 'pi pi-minus',\n label: 'Zoom Out',\n function: () => {\n const ds = app.canvas.ds\n ds.changeScale(\n ds.scale / 1.1,\n ds.element ? [ds.element.width / 2, ds.element.height / 2] : undefined\n )\n app.canvas.setDirty(true, true)\n }\n },\n {\n id: 'Comfy.Canvas.FitView',\n icon: 'pi pi-expand',\n label: 'Fit view to selected nodes',\n function: () => {\n if (app.canvas.empty) {\n useToastStore().add({\n severity: 'error',\n summary: 'Empty canvas',\n life: 3000\n })\n return\n }\n app.canvas.fitViewToSelectionAnimated()\n }\n },\n {\n id: 'Comfy.Canvas.ToggleLock',\n icon: 'pi pi-lock',\n label: 'Canvas Toggle Lock',\n function: () => {\n app.canvas['read_only'] = !app.canvas['read_only']\n }\n },\n {\n id: 'Comfy.Canvas.ToggleLinkVisibility',\n icon: 'pi pi-eye',\n label: 'Canvas Toggle Link Visibility',\n versionAdded: '1.3.6',\n\n function: (() => {\n const settingStore = useSettingStore()\n let lastLinksRenderMode = LiteGraph.SPLINE_LINK\n\n return () => {\n const currentMode = settingStore.get('Comfy.LinkRenderMode')\n\n if (currentMode === LiteGraph.HIDDEN_LINK) {\n // If links are hidden, restore the last positive value or default to spline mode\n settingStore.set('Comfy.LinkRenderMode', lastLinksRenderMode)\n } else {\n // If links are visible, store the current mode and hide links\n lastLinksRenderMode = currentMode\n settingStore.set('Comfy.LinkRenderMode', LiteGraph.HIDDEN_LINK)\n }\n }\n })()\n },\n {\n id: 'Comfy.QueuePrompt',\n icon: 'pi pi-play',\n label: 'Queue Prompt',\n versionAdded: '1.3.7',\n function: () => {\n const batchCount = useQueueSettingsStore().batchCount\n app.queuePrompt(0, batchCount)\n }\n },\n {\n id: 'Comfy.QueuePromptFront',\n icon: 'pi pi-play',\n label: 'Queue Prompt (Front)',\n versionAdded: '1.3.7',\n function: () => {\n const batchCount = useQueueSettingsStore().batchCount\n app.queuePrompt(-1, batchCount)\n }\n },\n {\n id: 'Comfy.ShowSettingsDialog',\n icon: 'pi pi-cog',\n label: 'Show Settings Dialog',\n versionAdded: '1.3.7',\n function: () => {\n dialogService.showSettingsDialog()\n }\n },\n {\n id: 'Comfy.Graph.GroupSelectedNodes',\n icon: 'pi pi-sitemap',\n label: 'Group Selected Nodes',\n versionAdded: '1.3.7',\n function: () => {\n const { canvas } = app\n if (!canvas.selectedItems?.size) {\n useToastStore().add({\n severity: 'error',\n summary: 'Nothing to group',\n detail:\n 'Please select the nodes (or other groups) to create a group for',\n life: 3000\n })\n return\n }\n const group = new LGraphGroup()\n const padding = useSettingStore().get(\n 'Comfy.GroupSelectedNodes.Padding'\n )\n group.resizeTo(canvas.selectedItems, padding)\n canvas.graph?.add(group)\n useTitleEditorStore().titleEditorTarget = group\n }\n },\n {\n id: 'Workspace.NextOpenedWorkflow',\n icon: 'pi pi-step-forward',\n label: 'Next Opened Workflow',\n versionAdded: '1.3.9',\n function: () => {\n workflowService.loadNextOpenedWorkflow()\n }\n },\n {\n id: 'Workspace.PreviousOpenedWorkflow',\n icon: 'pi pi-step-backward',\n label: 'Previous Opened Workflow',\n versionAdded: '1.3.9',\n function: () => {\n workflowService.loadPreviousOpenedWorkflow()\n }\n },\n {\n id: 'Comfy.Canvas.ToggleSelectedNodes.Mute',\n icon: 'pi pi-volume-off',\n label: 'Mute/Unmute Selected Nodes',\n versionAdded: '1.3.11',\n function: () => {\n toggleSelectedNodesMode(LGraphEventMode.NEVER)\n app.canvas.setDirty(true, true)\n }\n },\n {\n id: 'Comfy.Canvas.ToggleSelectedNodes.Bypass',\n icon: 'pi pi-shield',\n label: 'Bypass/Unbypass Selected Nodes',\n versionAdded: '1.3.11',\n function: () => {\n toggleSelectedNodesMode(LGraphEventMode.BYPASS)\n app.canvas.setDirty(true, true)\n }\n },\n {\n id: 'Comfy.Canvas.ToggleSelectedNodes.Pin',\n icon: 'pi pi-pin',\n label: 'Pin/Unpin Selected Nodes',\n versionAdded: '1.3.11',\n function: () => {\n getSelectedNodes().forEach((node) => {\n node.pin(!node.pinned)\n })\n app.canvas.setDirty(true, true)\n }\n },\n {\n id: 'Comfy.Canvas.ToggleSelected.Pin',\n icon: 'pi pi-pin',\n label: 'Pin/Unpin Selected Items',\n versionAdded: '1.3.33',\n function: () => {\n for (const item of app.canvas.selectedItems) {\n if (item instanceof LGraphNode || item instanceof LGraphGroup) {\n item.pin(!item.pinned)\n }\n }\n app.canvas.setDirty(true, true)\n }\n },\n {\n id: 'Comfy.Canvas.ToggleSelectedNodes.Collapse',\n icon: 'pi pi-minus',\n label: 'Collapse/Expand Selected Nodes',\n versionAdded: '1.3.11',\n function: () => {\n getSelectedNodes().forEach((node) => {\n node.collapse()\n })\n app.canvas.setDirty(true, true)\n }\n },\n {\n id: 'Comfy.ToggleTheme',\n icon: 'pi pi-moon',\n label: 'Toggle Theme (Dark/Light)',\n versionAdded: '1.3.12',\n function: (() => {\n let previousDarkTheme: string = DEFAULT_DARK_COLOR_PALETTE.id\n let previousLightTheme: string = DEFAULT_LIGHT_COLOR_PALETTE.id\n\n return () => {\n const settingStore = useSettingStore()\n const theme = colorPaletteStore.completedActivePalette\n if (theme.light_theme) {\n previousLightTheme = theme.id\n settingStore.set('Comfy.ColorPalette', previousDarkTheme)\n } else {\n previousDarkTheme = theme.id\n settingStore.set('Comfy.ColorPalette', previousLightTheme)\n }\n }\n })()\n },\n {\n id: 'Workspace.ToggleBottomPanel',\n icon: 'pi pi-list',\n label: 'Toggle Bottom Panel',\n versionAdded: '1.3.22',\n function: () => {\n useBottomPanelStore().toggleBottomPanel()\n }\n },\n {\n id: 'Workspace.ToggleFocusMode',\n icon: 'pi pi-eye',\n label: 'Toggle Focus Mode',\n versionAdded: '1.3.27',\n function: () => {\n useWorkspaceStore().toggleFocusMode()\n }\n },\n {\n id: 'Comfy.Graph.FitGroupToContents',\n icon: 'pi pi-expand',\n label: 'Fit Group To Contents',\n versionAdded: '1.4.9',\n function: () => {\n for (const group of app.canvas.selectedItems) {\n if (group instanceof LGraphGroup) {\n group.recomputeInsideNodes()\n const padding = useSettingStore().get(\n 'Comfy.GroupSelectedNodes.Padding'\n )\n group.resizeTo(group.children, padding)\n app.graph.change()\n }\n }\n }\n },\n {\n id: 'Comfy.Help.OpenComfyUIIssues',\n icon: 'pi pi-github',\n label: 'Open ComfyUI Issues',\n menubarLabel: 'ComfyUI Issues',\n versionAdded: '1.5.5',\n function: () => {\n window.open(\n 'https://github.com/comfyanonymous/ComfyUI/issues',\n '_blank'\n )\n }\n },\n {\n id: 'Comfy.Help.OpenComfyUIDocs',\n icon: 'pi pi-info-circle',\n label: 'Open ComfyUI Docs',\n menubarLabel: 'ComfyUI Docs',\n versionAdded: '1.5.5',\n function: () => {\n window.open('https://docs.comfy.org/', '_blank')\n }\n },\n {\n id: 'Comfy.Help.OpenComfyOrgDiscord',\n icon: 'pi pi-discord',\n label: 'Open Comfy-Org Discord',\n menubarLabel: 'Comfy-Org Discord',\n versionAdded: '1.5.5',\n function: () => {\n window.open('https://www.comfy.org/discord', '_blank')\n }\n },\n {\n id: 'Workspace.SearchBox.Toggle',\n icon: 'pi pi-search',\n label: 'Toggle Search Box',\n versionAdded: '1.5.7',\n function: () => {\n useSearchBoxStore().toggleVisible()\n }\n },\n {\n id: 'Comfy.Help.AboutComfyUI',\n icon: 'pi pi-info-circle',\n label: 'Open About ComfyUI',\n menubarLabel: 'About ComfyUI',\n versionAdded: '1.6.4',\n function: () => {\n dialogService.showSettingsDialog('about')\n }\n },\n {\n id: 'Comfy.DuplicateWorkflow',\n icon: 'pi pi-clone',\n label: 'Duplicate Current Workflow',\n versionAdded: '1.6.15',\n function: () => {\n workflowService.duplicateWorkflow(workflowStore.activeWorkflow!)\n }\n },\n {\n id: 'Workspace.CloseWorkflow',\n icon: 'pi pi-times',\n label: 'Close Current Workflow',\n versionAdded: '1.7.3',\n function: () => {\n if (workflowStore.activeWorkflow)\n workflowService.closeWorkflow(workflowStore.activeWorkflow)\n }\n },\n {\n id: 'Comfy.Feedback',\n icon: 'pi pi-megaphone',\n label: 'Give Feedback',\n versionAdded: '1.8.2',\n function: () => {\n dialogService.showIssueReportDialog({\n title: t('g.feedback'),\n subtitle: t('issueReport.feedbackTitle'),\n panelProps: {\n errorType: 'Feedback',\n defaultFields: ['SystemStats', 'Settings']\n }\n })\n }\n },\n {\n id: 'Comfy.Help.OpenComfyUIForum',\n icon: 'pi pi-comments',\n label: 'Open ComfyUI Forum',\n menubarLabel: 'ComfyUI Forum',\n versionAdded: '1.8.2',\n function: () => {\n window.open('https://forum.comfy.org/', '_blank')\n }\n },\n {\n id: 'Comfy.Canvas.DeleteSelectedItems',\n icon: 'pi pi-trash',\n label: 'Delete Selected Items',\n versionAdded: '1.10.5',\n function: () => {\n app.canvas.deleteSelected()\n app.canvas.setDirty(true, true)\n }\n }\n ]\n}\n","export enum LatentPreviewMethod {\n NoPreviews = 'none',\n Auto = 'auto',\n Latent2RGB = 'latent2rgb',\n TAESD = 'taesd'\n}\n\nexport enum LogLevel {\n DEBUG = 'DEBUG',\n INFO = 'INFO',\n WARNING = 'WARNING',\n ERROR = 'ERROR',\n CRITICAL = 'CRITICAL'\n}\n\nexport enum HashFunction {\n MD5 = 'md5',\n SHA1 = 'sha1',\n SHA256 = 'sha256',\n SHA512 = 'sha512'\n}\n\nexport enum AutoLaunch {\n // Let server decide whether to auto launch based on the current environment\n Auto = 'auto',\n // Disable auto launch\n Disable = 'disable',\n // Enable auto launch\n Enable = 'enable'\n}\n\nexport enum CudaMalloc {\n // Let server decide whether to use CUDA malloc based on the current environment\n Auto = 'auto',\n // Disable CUDA malloc\n Disable = 'disable',\n // Enable CUDA malloc\n Enable = 'enable'\n}\n\nexport enum FloatingPointPrecision {\n AUTO = 'auto',\n FP64 = 'fp64',\n FP32 = 'fp32',\n FP16 = 'fp16',\n BF16 = 'bf16',\n FP8E4M3FN = 'fp8_e4m3fn',\n FP8E5M2 = 'fp8_e5m2'\n}\n\nexport enum CrossAttentionMethod {\n Auto = 'auto',\n Split = 'split',\n Quad = 'quad',\n Pytorch = 'pytorch'\n}\n\nexport enum VramManagement {\n Auto = 'auto',\n GPUOnly = 'gpu-only',\n HighVram = 'highvram',\n NormalVram = 'normalvram',\n LowVram = 'lowvram',\n NoVram = 'novram',\n CPU = 'cpu'\n}\n","import {\n AutoLaunch,\n CrossAttentionMethod,\n CudaMalloc,\n FloatingPointPrecision,\n HashFunction,\n LatentPreviewMethod,\n LogLevel,\n VramManagement\n} from '@/types/serverArgs'\nimport { FormItem } from '@/types/settingTypes'\n\nexport type ServerConfigValue = string | number | true | null | undefined\n\nexport interface ServerConfig extends FormItem {\n id: string\n defaultValue: T\n category?: string[]\n // Override the default value getter with a custom function.\n getValue?: (value: T) => Record\n}\n\nexport const WEB_ONLY_CONFIG_ITEMS: ServerConfig[] = [\n // Launch behavior\n {\n id: 'auto-launch',\n name: 'Automatically opens in the browser on startup',\n category: ['Launch'],\n type: 'combo',\n options: Object.values(AutoLaunch),\n defaultValue: AutoLaunch.Auto,\n getValue: (value: AutoLaunch) => {\n switch (value) {\n case AutoLaunch.Auto:\n return {}\n case AutoLaunch.Enable:\n return {\n ['auto-launch']: true\n }\n case AutoLaunch.Disable:\n return {\n ['disable-auto-launch']: true\n }\n }\n }\n }\n]\n\nexport const SERVER_CONFIG_ITEMS: ServerConfig[] = [\n // Network settings\n {\n id: 'listen',\n name: 'Host: The IP address to listen on',\n category: ['Network'],\n type: 'text',\n defaultValue: '127.0.0.1'\n },\n {\n id: 'port',\n name: 'Port: The port to listen on',\n category: ['Network'],\n type: 'number',\n // The default launch port for desktop app is 8000 instead of 8188.\n defaultValue: 8000\n },\n {\n id: 'tls-keyfile',\n name: 'TLS Key File: Path to TLS key file for HTTPS',\n category: ['Network'],\n type: 'text',\n defaultValue: ''\n },\n {\n id: 'tls-certfile',\n name: 'TLS Certificate File: Path to TLS certificate file for HTTPS',\n category: ['Network'],\n type: 'text',\n defaultValue: ''\n },\n {\n id: 'enable-cors-header',\n name: 'Enable CORS header: Use \"*\" for all origins or specify domain',\n category: ['Network'],\n type: 'text',\n defaultValue: ''\n },\n {\n id: 'max-upload-size',\n name: 'Maximum upload size (MB)',\n category: ['Network'],\n type: 'number',\n defaultValue: 100\n },\n\n // CUDA settings\n {\n id: 'cuda-device',\n name: 'CUDA device index to use',\n category: ['CUDA'],\n type: 'number',\n defaultValue: null\n },\n {\n id: 'cuda-malloc',\n name: 'Use CUDA malloc for memory allocation',\n category: ['CUDA'],\n type: 'combo',\n options: Object.values(CudaMalloc),\n defaultValue: CudaMalloc.Auto,\n getValue: (value: CudaMalloc) => {\n switch (value) {\n case CudaMalloc.Auto:\n return {}\n case CudaMalloc.Enable:\n return {\n ['cuda-malloc']: true\n }\n case CudaMalloc.Disable:\n return {\n ['disable-cuda-malloc']: true\n }\n }\n }\n },\n\n // Precision settings\n {\n id: 'global-precision',\n name: 'Global floating point precision',\n category: ['Inference'],\n type: 'combo',\n options: [\n FloatingPointPrecision.AUTO,\n FloatingPointPrecision.FP32,\n FloatingPointPrecision.FP16\n ],\n defaultValue: FloatingPointPrecision.AUTO,\n tooltip: 'Global floating point precision',\n getValue: (value: FloatingPointPrecision) => {\n switch (value) {\n case FloatingPointPrecision.AUTO:\n return {}\n case FloatingPointPrecision.FP32:\n return {\n ['force-fp32']: true\n }\n case FloatingPointPrecision.FP16:\n return {\n ['force-fp16']: true\n }\n default:\n return {}\n }\n }\n },\n\n // UNET precision\n {\n id: 'unet-precision',\n name: 'UNET precision',\n category: ['Inference'],\n type: 'combo',\n options: [\n FloatingPointPrecision.AUTO,\n FloatingPointPrecision.FP64,\n FloatingPointPrecision.FP32,\n FloatingPointPrecision.FP16,\n FloatingPointPrecision.BF16,\n FloatingPointPrecision.FP8E4M3FN,\n FloatingPointPrecision.FP8E5M2\n ],\n defaultValue: FloatingPointPrecision.AUTO,\n tooltip: 'UNET precision',\n getValue: (value: FloatingPointPrecision) => {\n switch (value) {\n case FloatingPointPrecision.AUTO:\n return {}\n default:\n return {\n [`${value.toLowerCase()}-unet`]: true\n }\n }\n }\n },\n\n // VAE settings\n {\n id: 'vae-precision',\n name: 'VAE precision',\n category: ['Inference'],\n type: 'combo',\n options: [\n FloatingPointPrecision.AUTO,\n FloatingPointPrecision.FP16,\n FloatingPointPrecision.FP32,\n FloatingPointPrecision.BF16\n ],\n defaultValue: FloatingPointPrecision.AUTO,\n tooltip: 'VAE precision',\n getValue: (value: FloatingPointPrecision) => {\n switch (value) {\n case FloatingPointPrecision.AUTO:\n return {}\n default:\n return {\n [`${value.toLowerCase()}-vae`]: true\n }\n }\n }\n },\n {\n id: 'cpu-vae',\n name: 'Run VAE on CPU',\n category: ['Inference'],\n type: 'boolean',\n defaultValue: false\n },\n\n // Text Encoder settings\n {\n id: 'text-encoder-precision',\n name: 'Text Encoder precision',\n category: ['Inference'],\n type: 'combo',\n options: [\n FloatingPointPrecision.AUTO,\n FloatingPointPrecision.FP8E4M3FN,\n FloatingPointPrecision.FP8E5M2,\n FloatingPointPrecision.FP16,\n FloatingPointPrecision.FP32\n ],\n defaultValue: FloatingPointPrecision.AUTO,\n tooltip: 'Text Encoder precision',\n getValue: (value: FloatingPointPrecision) => {\n switch (value) {\n case FloatingPointPrecision.AUTO:\n return {}\n default:\n return {\n [`${value.toLowerCase()}-text-enc`]: true\n }\n }\n }\n },\n\n // Memory and performance settings\n {\n id: 'force-channels-last',\n name: 'Force channels-last memory format',\n category: ['Memory'],\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'directml',\n name: 'DirectML device index',\n category: ['Memory'],\n type: 'number',\n defaultValue: null\n },\n {\n id: 'disable-ipex-optimize',\n name: 'Disable IPEX optimization',\n category: ['Memory'],\n type: 'boolean',\n defaultValue: false\n },\n\n // Preview settings\n {\n id: 'preview-method',\n name: 'Method used for latent previews',\n category: ['Preview'],\n type: 'combo',\n options: Object.values(LatentPreviewMethod),\n defaultValue: LatentPreviewMethod.NoPreviews\n },\n {\n id: 'preview-size',\n name: 'Size of preview images',\n category: ['Preview'],\n type: 'slider',\n defaultValue: 512,\n attrs: {\n min: 128,\n max: 2048,\n step: 128\n }\n },\n\n // Cache settings\n {\n id: 'cache-classic',\n name: 'Use classic cache system',\n category: ['Cache'],\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'cache-lru',\n name: 'Use LRU caching with a maximum of N node results cached.',\n category: ['Cache'],\n type: 'number',\n defaultValue: null,\n tooltip: 'May use more RAM/VRAM.'\n },\n\n // Attention settings\n {\n id: 'cross-attention-method',\n name: 'Cross attention method',\n category: ['Attention'],\n type: 'combo',\n options: Object.values(CrossAttentionMethod),\n defaultValue: CrossAttentionMethod.Auto,\n getValue: (value: CrossAttentionMethod) => {\n switch (value) {\n case CrossAttentionMethod.Auto:\n return {}\n default:\n return {\n [`use-${value.toLowerCase()}-cross-attention`]: true\n }\n }\n }\n },\n {\n id: 'disable-xformers',\n name: 'Disable xFormers optimization',\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'force-upcast-attention',\n name: 'Force attention upcast',\n category: ['Attention'],\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'dont-upcast-attention',\n name: 'Prevent attention upcast',\n category: ['Attention'],\n type: 'boolean',\n defaultValue: false\n },\n\n // VRAM management\n {\n id: 'vram-management',\n name: 'VRAM management mode',\n category: ['Memory'],\n type: 'combo',\n options: Object.values(VramManagement),\n defaultValue: VramManagement.Auto,\n getValue: (value: VramManagement) => {\n switch (value) {\n case VramManagement.Auto:\n return {}\n default:\n return {\n [value]: true\n }\n }\n }\n },\n {\n id: 'reserve-vram',\n name: 'Reserved VRAM (GB)',\n category: ['Memory'],\n type: 'number',\n defaultValue: null,\n tooltip:\n 'Set the amount of vram in GB you want to reserve for use by your OS/other software. By default some amount is reverved depending on your OS.'\n },\n\n // Misc settings\n {\n id: 'default-hashing-function',\n name: 'Default hashing function for model files',\n type: 'combo',\n options: Object.values(HashFunction),\n defaultValue: HashFunction.SHA256\n },\n {\n id: 'disable-smart-memory',\n name: 'Disable smart memory management',\n tooltip:\n 'Force ComfyUI to aggressively offload to regular ram instead of keeping models in vram when it can.',\n category: ['Memory'],\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'deterministic',\n name: 'Make pytorch use slower deterministic algorithms when it can.',\n type: 'boolean',\n defaultValue: false,\n tooltip: 'Note that this might not make images deterministic in all cases.'\n },\n {\n id: 'fast',\n name: 'Enable some untested and potentially quality deteriorating optimizations.',\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'dont-print-server',\n name: \"Don't print server output to console.\",\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'disable-metadata',\n name: 'Disable saving prompt metadata in files.',\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'disable-all-custom-nodes',\n name: 'Disable loading all custom nodes.',\n type: 'boolean',\n defaultValue: false\n },\n {\n id: 'log-level',\n name: 'Logging verbosity level',\n type: 'combo',\n options: Object.values(LogLevel),\n defaultValue: LogLevel.INFO,\n getValue: (value: LogLevel) => {\n return {\n verbose: value\n }\n }\n },\n // Directories\n {\n id: 'input-directory',\n name: 'Input directory',\n category: ['Directories'],\n type: 'text',\n defaultValue: ''\n },\n {\n id: 'output-directory',\n name: 'Output directory',\n category: ['Directories'],\n type: 'text',\n defaultValue: ''\n }\n]\n","import { api } from '@/scripts/api'\nimport { app } from '@/scripts/app'\nimport {\n useQueuePendingTaskCountStore,\n useQueueSettingsStore\n} from '@/stores/queueStore'\n\nexport function setupAutoQueueHandler() {\n const queueCountStore = useQueuePendingTaskCountStore()\n const queueSettingsStore = useQueueSettingsStore()\n\n let graphHasChanged = false\n let internalCount = 0 // Use an internal counter here so it is instantly updated when re-queuing\n api.addEventListener('graphChanged', () => {\n if (queueSettingsStore.mode === 'change') {\n if (internalCount) {\n graphHasChanged = true\n } else {\n graphHasChanged = false\n app.queuePrompt(0, queueSettingsStore.batchCount)\n internalCount++\n }\n }\n })\n\n queueCountStore.$subscribe(\n () => {\n internalCount = queueCountStore.count\n if (!internalCount && !app.lastExecutionError) {\n if (\n queueSettingsStore.mode === 'instant' ||\n (queueSettingsStore.mode === 'change' && graphHasChanged)\n ) {\n graphHasChanged = false\n app.queuePrompt(0, queueSettingsStore.batchCount)\n }\n }\n },\n { detached: true }\n )\n}\n","\n\n\n\n\n"],"names":["t","comfyApp","_sfc_main","AutoComplete","options","widget","ContextMenu","clamp","LatentPreviewMethod","LogLevel","HashFunction","AutoLaunch","CudaMalloc","FloatingPointPrecision","CrossAttentionMethod","VramManagement"],"mappings":";;;;;;;;AAcA,MAAM,gBAAgB;AACtB,MAAM,eAAe;;;;AAErB,UAAM,iBAAiB,kBAAkB;AACzC,UAAM,gBAAgB;AAAA,MAAS,MAC7B,eAAe,SAAS,KAAK,IAAI,eAAe,iBAAiB;AAAA,IACnE;AAEA,UAAM,eAAe,gBAAgB;AACrC,UAAM,kBAAkB;AAAA,MACtB,MAAM,aAAa,IAAI,kBAAkB,MAAM;AAAA,IACjD;AAEA,UAAM,gBAAgB,iBAAiB;AACvC,UAAM,gBAAgB;AAAA,MAAS,MAC7B,cAAc,gBAAgB,cAC9B,CAAC,cAAc,gBAAgB,cAC3B,OACA;AAAA,IACN;AACM,UAAA,mBAAmB,SAAS,MAAM;AAChC,YAAA,eAAe,cAAc,gBAAgB;AACnD,aAAO,eACH,cAAc,QAAQ,eAAe,eACrC;AAAA,IAA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AAAA,MAAA;AAAA,IACpD,CACD;AAED,oBAAgB,MAAM;AAChB,UAAA,oBAAoB,UAAU,QAAQ;AACtC,UAAA,oBAAoB,gBAAgB,cAAc;AAClD,UAAA,oBAAoB,eAAe,aAAa;AACpD,qBAAe,sBAAsB;AAAA,IAAA,CACtC;AAED,qBAAiB,QAAQ,WAAW,qBAAqB,EAAE,cAAc;AAEzE,UAAM,EAAE,uBAAuB,2BAA2B,IAAI,iBAAiB;AAC/E,UAAM,eAAe,6BAAM;AACzB;AAAA,QACE,MAAM;AAGkB,gCAAA,uBAAuB,uBAAuB,EAAE;AAGhD,gCAAA,uBAAuB,gBAAgB;AAAA,YAC3D;AAAA,YACA,aAAa,IAAI,iCAAiC;AAAA,UACpD;AAG2B,qCAAA,gBAAgB,gBAAgB,EAAE;AAGlC,qCAAA,wBAAwB,mBAAmB,EAAE;AAKxD,4BAAE,kBAAkB,4BAA4B,EAAE;AAAA,QACpE;AAAA,QACA,EAAE,SAAS,IAAK;AAAA,MAClB;AAAA,IACF,GA1BqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/GraphView-NWS5Ob8A.css b/comfy/web/assets/GraphView-NWS5Ob8A.css deleted file mode 100644 index 63a4387d1..000000000 --- a/comfy/web/assets/GraphView-NWS5Ob8A.css +++ /dev/null @@ -1,404 +0,0 @@ - -.comfy-menu-hamburger[data-v-4c2fbe7d] { - position: fixed; - z-index: 9999; - display: flex; - flex-direction: row -} - -[data-v-e50caa15] .p-splitter-gutter { - pointer-events: auto; -} -[data-v-e50caa15] .p-splitter-gutter:hover,[data-v-e50caa15] .p-splitter-gutter[data-p-gutter-resizing='true'] { - transition: background-color 0.2s ease 300ms; - background-color: var(--p-primary-color); -} -.side-bar-panel[data-v-e50caa15] { - background-color: var(--bg-color); - pointer-events: auto; -} -.bottom-panel[data-v-e50caa15] { - background-color: var(--bg-color); - pointer-events: auto; -} -.splitter-overlay[data-v-e50caa15] { - pointer-events: none; - border-style: none; - background-color: transparent; -} -.splitter-overlay-root[data-v-e50caa15] { - position: absolute; - top: 0px; - left: 0px; - height: 100%; - width: 100%; - - /* Set it the same as the ComfyUI menu */ - /* Note: Lite-graph DOM widgets have the same z-index as the node id, so - 999 should be sufficient to make sure splitter overlays on node's DOM - widgets */ - z-index: 999; -} - -.p-buttongroup-vertical[data-v-27a9500c] { - display: flex; - flex-direction: column; - border-radius: var(--p-button-border-radius); - overflow: hidden; - border: 1px solid var(--p-panel-border-color); -} -.p-buttongroup-vertical .p-button[data-v-27a9500c] { - margin: 0; - border-radius: 0; -} - -.node-tooltip[data-v-f03142eb] { - background: var(--comfy-input-bg); - border-radius: 5px; - box-shadow: 0 0 5px rgba(0, 0, 0, 0.4); - color: var(--input-text); - font-family: sans-serif; - left: 0; - max-width: 30vw; - padding: 4px 8px; - position: absolute; - top: 0; - transform: translate(5px, calc(-100% - 5px)); - white-space: pre-wrap; - z-index: 99999; -} - -.selection-overlay-container[data-v-79be2f2e] > * { - pointer-events: auto; -} -.show-border[data-v-79be2f2e] { - border-radius: 0.375rem; - border-width: 2px; - border-style: dashed; - border-color: var(--border-color); -} - -.color-picker-container[data-v-665d04c1] { - transform: translateX(-50%); -} -[data-v-665d04c1] .p-togglebutton { - padding-top: 0.5rem; - padding-bottom: 0.5rem; - padding-left: 0.25rem; - padding-right: 0.25rem; -} - -.selection-toolbox[data-v-5f2fc3fa] { - transform: translateX(-50%) translateY(-120%); -} - -.group-title-editor.node-title-editor[data-v-4e10cee2] { - z-index: 9999; - padding: 0.25rem; -} -[data-v-4e10cee2] .editable-text { - width: 100%; - height: 100%; -} -[data-v-4e10cee2] .editable-text input { - width: 100%; - height: 100%; - /* Override the default font size */ - font-size: inherit; -} - -[data-v-186bfdc4] .highlight { - background-color: var(--p-primary-color); - color: var(--p-primary-contrast-color); - font-weight: bold; - border-radius: 0.25rem; - padding: 0 0.125rem; - margin: -0.125rem 0.125rem; -} - -.invisible-dialog-root { - width: 60%; - min-width: 24rem; - max-width: 48rem; - border: 0 !important; - background-color: transparent !important; - margin-top: 25vh; - margin-left: 400px; -} -@media all and (max-width: 768px) { -.invisible-dialog-root { - margin-left: 0; -} -} -.node-search-box-dialog-mask { - align-items: flex-start !important; -} - -.side-bar-button-icon { - font-size: var(--sidebar-icon-size) !important; -} -.side-bar-button-selected .side-bar-button-icon { - font-size: var(--sidebar-icon-size) !important; - font-weight: bold; -} - -.side-bar-button[data-v-6ab4daa6] { - width: var(--sidebar-width); - height: var(--sidebar-width); - border-radius: 0; -} -.comfyui-body-left .side-bar-button.side-bar-button-selected[data-v-6ab4daa6], -.comfyui-body-left .side-bar-button.side-bar-button-selected[data-v-6ab4daa6]:hover { - border-left: 4px solid var(--p-button-text-primary-color); -} -.comfyui-body-right .side-bar-button.side-bar-button-selected[data-v-6ab4daa6], -.comfyui-body-right .side-bar-button.side-bar-button-selected[data-v-6ab4daa6]:hover { - border-right: 4px solid var(--p-button-text-primary-color); -} - -.side-tool-bar-container[data-v-04875455] { - display: flex; - flex-direction: column; - align-items: center; - - width: var(--sidebar-width); - height: 100%; - - background-color: var(--comfy-menu-secondary-bg); - color: var(--fg-color); - box-shadow: var(--bar-shadow); - - --sidebar-width: 4rem; - --sidebar-icon-size: 1.5rem; -} -.side-tool-bar-container.small-sidebar[data-v-04875455] { - --sidebar-width: 2.5rem; - --sidebar-icon-size: 1rem; -} -.side-tool-bar-end[data-v-04875455] { - align-self: flex-end; - margin-top: auto; -} - -.status-indicator[data-v-fd6ae3af] { - position: absolute; - font-weight: 700; - font-size: 1.5rem; - top: 50%; - left: 50%; - transform: translate(-50%, -50%) -} - -[data-v-54fadc45] .p-togglebutton { - position: relative; - flex-shrink: 0; - border-radius: 0px; - border-width: 0px; - border-right-width: 1px; - border-style: solid; - background-color: transparent; - padding: 0px; - border-right-color: var(--border-color) -} -[data-v-54fadc45] .p-togglebutton::before { - display: none -} -[data-v-54fadc45] .p-togglebutton:first-child { - border-left-width: 1px; - border-style: solid; - border-left-color: var(--border-color) -} -[data-v-54fadc45] .p-togglebutton:not(:first-child) { - border-left-width: 0px -} -[data-v-54fadc45] .p-togglebutton.p-togglebutton-checked { - height: 100%; - border-bottom-width: 1px; - border-style: solid; - border-bottom-color: var(--p-button-text-primary-color) -} -[data-v-54fadc45] .p-togglebutton:not(.p-togglebutton-checked) { - opacity: 0.75 -} -[data-v-54fadc45] .p-togglebutton-checked .close-button,[data-v-54fadc45] .p-togglebutton:hover .close-button { - visibility: visible -} -[data-v-54fadc45] .p-togglebutton:hover .status-indicator { - display: none -} -[data-v-54fadc45] .p-togglebutton .close-button { - visibility: hidden -} -[data-v-54fadc45] .p-scrollpanel-content { - height: 100% -} - -/* Scrollbar half opacity to avoid blocking the active tab bottom border */ -[data-v-54fadc45] .p-scrollpanel:hover .p-scrollpanel-bar,[data-v-54fadc45] .p-scrollpanel:active .p-scrollpanel-bar { - opacity: 0.5 -} -[data-v-54fadc45] .p-selectbutton { - height: 100%; - border-radius: 0px -} - -[data-v-6ab68035] .workflow-tabs { - background-color: var(--comfy-menu-bg); -} - -[data-v-2dc25459] .p-inputtext { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} - -.comfyui-queue-button[data-v-4579e2ce] .p-splitbutton-dropdown { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} - -.actionbar[data-v-ebd56d51] { - pointer-events: all; - position: fixed; - z-index: 1000; -} -.actionbar.is-docked[data-v-ebd56d51] { - position: static; - border-style: none; - background-color: transparent; - padding: 0px; -} -.actionbar.is-dragging[data-v-ebd56d51] { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; -} -[data-v-ebd56d51] .p-panel-content { - padding: 0.25rem; -} -.is-docked[data-v-ebd56d51] .p-panel-content { - padding: 0px; -} -[data-v-ebd56d51] .p-panel-header { - display: none; -} -.drag-handle[data-v-ebd56d51] { - height: -moz-max-content; - height: max-content; - width: 0.75rem; -} - -[data-v-6a9cf415] .p-menubar-submenu.dropdown-direction-up { - top: auto; - bottom: 100%; - flex-direction: column-reverse; -} -.keybinding-tag[data-v-6a9cf415] { - background: var(--p-content-hover-background); - border-color: var(--p-content-border-color); - border-style: solid; -} - -.comfyui-menu[data-v-99f99a6b] { - width: 100vw; - height: var(--comfy-topbar-height); - background: var(--comfy-menu-bg); - color: var(--fg-color); - box-shadow: var(--bar-shadow); - font-family: Arial, Helvetica, sans-serif; - font-size: 0.8em; - box-sizing: border-box; - z-index: 1000; - order: 0; - grid-column: 1/-1; -} -.comfyui-menu.dropzone[data-v-99f99a6b] { - background: var(--p-highlight-background); -} -.comfyui-menu.dropzone-active[data-v-99f99a6b] { - background: var(--p-highlight-background-focus); -} -[data-v-99f99a6b] .p-menubar-item-label { - line-height: revert; -} -.comfyui-logo[data-v-99f99a6b] { - font-size: 1.2em; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - cursor: default; -} - -.comfyui-body[data-v-e89d9273] { - grid-template-columns: auto 1fr auto; - grid-template-rows: auto 1fr auto; -} - -/** - +------------------+------------------+------------------+ - | | - | .comfyui-body- | - | top | - | (spans all cols) | - | | - +------------------+------------------+------------------+ - | | | | - | .comfyui-body- | #graph-canvas | .comfyui-body- | - | left | | right | - | | | | - | | | | - +------------------+------------------+------------------+ - | | - | .comfyui-body- | - | bottom | - | (spans all cols) | - | | - +------------------+------------------+------------------+ -*/ -.comfyui-body-top[data-v-e89d9273] { - order: -5; - /* Span across all columns */ - grid-column: 1/-1; - /* Position at the first row */ - grid-row: 1; - /* Top menu bar dropdown needs to be above of graph canvas splitter overlay which is z-index: 999 */ - /* Top menu bar z-index needs to be higher than bottom menu bar z-index as by default - pysssss's image feed is located at body-bottom, and it can overlap with the queue button, which - is located in body-top. */ - z-index: 1001; - display: flex; - flex-direction: column; -} -.comfyui-body-left[data-v-e89d9273] { - order: -4; - /* Position in the first column */ - grid-column: 1; - /* Position below the top element */ - grid-row: 2; - z-index: 10; - display: flex; -} -.graph-canvas-container[data-v-e89d9273] { - width: 100%; - height: 100%; - order: -3; - grid-column: 2; - grid-row: 2; - position: relative; - overflow: hidden; -} -.comfyui-body-right[data-v-e89d9273] { - order: -2; - z-index: 10; - grid-column: 3; - grid-row: 2; -} -.comfyui-body-bottom[data-v-e89d9273] { - order: 4; - /* Span across all columns */ - grid-column: 1/-1; - grid-row: 3; - /* Bottom menu bar dropdown needs to be above of graph canvas splitter overlay which is z-index: 999 */ - z-index: 1000; - display: flex; - flex-direction: column; -} diff --git a/comfy/web/assets/InstallView-BwawagSr.js b/comfy/web/assets/InstallView-BwawagSr.js deleted file mode 100644 index 91366c6d6..000000000 --- a/comfy/web/assets/InstallView-BwawagSr.js +++ /dev/null @@ -1,971 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { d as defineComponent, T as ref, bz as useModel, o as openBlock, f as createElementBlock, m as createBaseVNode, E as toDisplayString, k as createVNode, j as unref, bA as script, bu as script$1, aD as withModifiers, z as withCtx, ao as script$2, I as useI18n, c as computed, Z as normalizeClass, B as createCommentVNode, ah as script$3, ak as createTextVNode, bi as electronAPI, _ as _export_sfc, p as onMounted, r as resolveDirective, bt as script$4, i as withDirectives, bB as script$5, bC as script$6, l as script$7, y as createBlock, bw as script$8, bD as MigrationItems, w as watchEffect, F as Fragment, D as renderList, bE as script$9, bF as mergeModels, bG as ValidationState, X as normalizeI18nKey, N as watch, bH as checkMirrorReachable, bI as _sfc_main$7, bJ as isInChina, bK as mergeValidationStates, bp as t, a8 as script$a, bL as CUDA_TORCH_URL, bM as NIGHTLY_CPU_TORCH_URL, br as useRouter, at as toRaw } from "./index-DIgj6hpb.js"; -import { s as script$b, a as script$c, b as script$d, c as script$e, d as script$f } from "./index-BKScv1mm.js"; -import { P as PYTHON_MIRROR, a as PYPI_MIRROR } from "./uvMirrors-B-HKMf6X.js"; -import { _ as _sfc_main$8 } from "./BaseViewTemplate-DaGOaycP.js"; -const _hoisted_1$5 = { class: "flex flex-col gap-6 w-[600px]" }; -const _hoisted_2$5 = { class: "flex flex-col gap-4" }; -const _hoisted_3$5 = { class: "text-2xl font-semibold text-neutral-100" }; -const _hoisted_4$5 = { class: "text-neutral-400 my-0" }; -const _hoisted_5$3 = { class: "flex flex-col bg-neutral-800 p-4 rounded-lg" }; -const _hoisted_6$3 = { class: "flex items-center gap-4" }; -const _hoisted_7$3 = { class: "flex-1" }; -const _hoisted_8$3 = { class: "text-lg font-medium text-neutral-100" }; -const _hoisted_9$3 = { class: "text-sm text-neutral-400 mt-1" }; -const _hoisted_10$3 = { class: "flex items-center gap-4" }; -const _hoisted_11$3 = { class: "flex-1" }; -const _hoisted_12$3 = { class: "text-lg font-medium text-neutral-100" }; -const _hoisted_13$1 = { class: "text-sm text-neutral-400 mt-1" }; -const _hoisted_14$1 = { class: "text-neutral-300" }; -const _hoisted_15 = { class: "font-medium mb-2" }; -const _hoisted_16 = { class: "list-disc pl-6 space-y-1" }; -const _hoisted_17 = { class: "font-medium mt-4 mb-2" }; -const _hoisted_18 = { class: "list-disc pl-6 space-y-1" }; -const _hoisted_19 = { class: "mt-4" }; -const _hoisted_20 = { - href: "https://comfy.org/privacy", - target: "_blank", - class: "text-blue-400 hover:text-blue-300 underline" -}; -const _sfc_main$6 = /* @__PURE__ */ defineComponent({ - __name: "DesktopSettingsConfiguration", - props: { - "autoUpdate": { type: Boolean, ...{ required: true } }, - "autoUpdateModifiers": {}, - "allowMetrics": { type: Boolean, ...{ required: true } }, - "allowMetricsModifiers": {} - }, - emits: ["update:autoUpdate", "update:allowMetrics"], - setup(__props) { - const showDialog = ref(false); - const autoUpdate = useModel(__props, "autoUpdate"); - const allowMetrics = useModel(__props, "allowMetrics"); - const showMetricsInfo = /* @__PURE__ */ __name(() => { - showDialog.value = true; - }, "showMetricsInfo"); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div", _hoisted_1$5, [ - createBaseVNode("div", _hoisted_2$5, [ - createBaseVNode("h2", _hoisted_3$5, toDisplayString(_ctx.$t("install.desktopAppSettings")), 1), - createBaseVNode("p", _hoisted_4$5, toDisplayString(_ctx.$t("install.desktopAppSettingsDescription")), 1) - ]), - createBaseVNode("div", _hoisted_5$3, [ - createBaseVNode("div", _hoisted_6$3, [ - createBaseVNode("div", _hoisted_7$3, [ - createBaseVNode("h3", _hoisted_8$3, toDisplayString(_ctx.$t("install.settings.autoUpdate")), 1), - createBaseVNode("p", _hoisted_9$3, toDisplayString(_ctx.$t("install.settings.autoUpdateDescription")), 1) - ]), - createVNode(unref(script), { - modelValue: autoUpdate.value, - "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => autoUpdate.value = $event) - }, null, 8, ["modelValue"]) - ]), - createVNode(unref(script$1)), - createBaseVNode("div", _hoisted_10$3, [ - createBaseVNode("div", _hoisted_11$3, [ - createBaseVNode("h3", _hoisted_12$3, toDisplayString(_ctx.$t("install.settings.allowMetrics")), 1), - createBaseVNode("p", _hoisted_13$1, toDisplayString(_ctx.$t("install.settings.allowMetricsDescription")), 1), - createBaseVNode("a", { - href: "#", - class: "text-sm text-blue-400 hover:text-blue-300 mt-1 inline-block", - onClick: withModifiers(showMetricsInfo, ["prevent"]) - }, toDisplayString(_ctx.$t("install.settings.learnMoreAboutData")), 1) - ]), - createVNode(unref(script), { - modelValue: allowMetrics.value, - "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => allowMetrics.value = $event) - }, null, 8, ["modelValue"]) - ]) - ]), - createVNode(unref(script$2), { - visible: showDialog.value, - "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => showDialog.value = $event), - modal: "", - header: _ctx.$t("install.settings.dataCollectionDialog.title") - }, { - default: withCtx(() => [ - createBaseVNode("div", _hoisted_14$1, [ - createBaseVNode("h4", _hoisted_15, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeCollect")), 1), - createBaseVNode("ul", _hoisted_16, [ - createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.collect.errorReports")), 1), - createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.collect.systemInfo")), 1), - createBaseVNode("li", null, toDisplayString(_ctx.$t( - "install.settings.dataCollectionDialog.collect.userJourneyEvents" - )), 1) - ]), - createBaseVNode("h4", _hoisted_17, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeDoNotCollect")), 1), - createBaseVNode("ul", _hoisted_18, [ - createBaseVNode("li", null, toDisplayString(_ctx.$t( - "install.settings.dataCollectionDialog.doNotCollect.personalInformation" - )), 1), - createBaseVNode("li", null, toDisplayString(_ctx.$t( - "install.settings.dataCollectionDialog.doNotCollect.workflowContents" - )), 1), - createBaseVNode("li", null, toDisplayString(_ctx.$t( - "install.settings.dataCollectionDialog.doNotCollect.fileSystemInformation" - )), 1), - createBaseVNode("li", null, toDisplayString(_ctx.$t( - "install.settings.dataCollectionDialog.doNotCollect.customNodeConfigurations" - )), 1) - ]), - createBaseVNode("div", _hoisted_19, [ - createBaseVNode("a", _hoisted_20, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.viewFullPolicy")), 1) - ]) - ]) - ]), - _: 1 - }, 8, ["visible", "header"]) - ]); - }; - } -}); -const _imports_0 = "" + new URL("images/nvidia-logo.svg", import.meta.url).href; -const _imports_1 = "" + new URL("images/apple-mps-logo.png", import.meta.url).href; -const _imports_2 = "" + new URL("images/manual-configuration.svg", import.meta.url).href; -const _hoisted_1$4 = { class: "flex flex-col gap-6 w-[600px] h-[30rem] select-none" }; -const _hoisted_2$4 = { class: "grow flex flex-col gap-4 text-neutral-300" }; -const _hoisted_3$4 = { class: "text-2xl font-semibold text-neutral-100" }; -const _hoisted_4$4 = { class: "m-1 text-neutral-400" }; -const _hoisted_5$2 = { - key: 0, - class: "m-1" -}; -const _hoisted_6$2 = { - key: 1, - class: "m-1" -}; -const _hoisted_7$2 = { - key: 2, - class: "text-neutral-300" -}; -const _hoisted_8$2 = { class: "m-1" }; -const _hoisted_9$2 = { key: 3 }; -const _hoisted_10$2 = { class: "m-1" }; -const _hoisted_11$2 = { class: "m-1" }; -const _hoisted_12$2 = { - for: "cpu-mode", - class: "select-none" -}; -const _sfc_main$5 = /* @__PURE__ */ defineComponent({ - __name: "GpuPicker", - props: { - "device": { - required: true - }, - "deviceModifiers": {} - }, - emits: ["update:device"], - setup(__props) { - const { t: t2 } = useI18n(); - const cpuMode = computed({ - get: /* @__PURE__ */ __name(() => selected.value === "cpu", "get"), - set: /* @__PURE__ */ __name((value) => { - selected.value = value ? "cpu" : null; - }, "set") - }); - const selected = useModel(__props, "device"); - const electron = electronAPI(); - const platform = electron.getPlatform(); - const pickGpu = /* @__PURE__ */ __name((value) => { - const newValue = selected.value === value ? null : value; - selected.value = newValue; - }, "pickGpu"); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div", _hoisted_1$4, [ - createBaseVNode("div", _hoisted_2$4, [ - createBaseVNode("h2", _hoisted_3$4, toDisplayString(_ctx.$t("install.gpuSelection.selectGpu")), 1), - createBaseVNode("p", _hoisted_4$4, toDisplayString(_ctx.$t("install.gpuSelection.selectGpuDescription")) + ": ", 1), - createBaseVNode("div", { - class: normalizeClass(["flex gap-2 text-center transition-opacity", { selected: selected.value }]) - }, [ - unref(platform) !== "darwin" ? (openBlock(), createElementBlock("div", { - key: 0, - class: normalizeClass(["gpu-button", { selected: selected.value === "nvidia" }]), - role: "button", - onClick: _cache[0] || (_cache[0] = ($event) => pickGpu("nvidia")) - }, _cache[4] || (_cache[4] = [ - createBaseVNode("img", { - class: "m-12", - alt: "NVIDIA logo", - width: "196", - height: "32", - src: _imports_0 - }, null, -1) - ]), 2)) : createCommentVNode("", true), - unref(platform) === "darwin" ? (openBlock(), createElementBlock("div", { - key: 1, - class: normalizeClass(["gpu-button", { selected: selected.value === "mps" }]), - role: "button", - onClick: _cache[1] || (_cache[1] = ($event) => pickGpu("mps")) - }, _cache[5] || (_cache[5] = [ - createBaseVNode("img", { - class: "rounded-lg hover-brighten", - alt: "Apple Metal Performance Shaders Logo", - width: "292", - ratio: "", - src: _imports_1 - }, null, -1) - ]), 2)) : createCommentVNode("", true), - createBaseVNode("div", { - class: normalizeClass(["gpu-button", { selected: selected.value === "unsupported" }]), - role: "button", - onClick: _cache[2] || (_cache[2] = ($event) => pickGpu("unsupported")) - }, _cache[6] || (_cache[6] = [ - createBaseVNode("img", { - class: "m-12", - alt: "Manual configuration", - width: "196", - src: _imports_2 - }, null, -1) - ]), 2) - ], 2), - selected.value === "nvidia" ? (openBlock(), createElementBlock("p", _hoisted_5$2, [ - createVNode(unref(script$3), { - icon: "pi pi-check", - severity: "success", - value: "CUDA" - }), - createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.nvidiaDescription")), 1) - ])) : createCommentVNode("", true), - selected.value === "mps" ? (openBlock(), createElementBlock("p", _hoisted_6$2, [ - createVNode(unref(script$3), { - icon: "pi pi-check", - severity: "success", - value: "MPS" - }), - createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.mpsDescription")), 1) - ])) : createCommentVNode("", true), - selected.value === "unsupported" ? (openBlock(), createElementBlock("div", _hoisted_7$2, [ - createBaseVNode("p", _hoisted_8$2, [ - createVNode(unref(script$3), { - icon: "pi pi-exclamation-triangle", - severity: "warn", - value: unref(t2)("icon.exclamation-triangle") - }, null, 8, ["value"]), - createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.customSkipsPython")), 1) - ]), - createBaseVNode("ul", null, [ - createBaseVNode("li", null, [ - createBaseVNode("strong", null, toDisplayString(_ctx.$t("install.gpuSelection.customComfyNeedsPython")), 1) - ]), - createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customManualVenv")), 1), - createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customInstallRequirements")), 1), - createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customMayNotWork")), 1) - ]) - ])) : createCommentVNode("", true), - selected.value === "cpu" ? (openBlock(), createElementBlock("div", _hoisted_9$2, [ - createBaseVNode("p", _hoisted_10$2, [ - createVNode(unref(script$3), { - icon: "pi pi-exclamation-triangle", - severity: "warn", - value: unref(t2)("icon.exclamation-triangle") - }, null, 8, ["value"]), - createTextVNode(" " + toDisplayString(_ctx.$t("install.gpuSelection.cpuModeDescription")), 1) - ]), - createBaseVNode("p", _hoisted_11$2, toDisplayString(_ctx.$t("install.gpuSelection.cpuModeDescription2")), 1) - ])) : createCommentVNode("", true) - ]), - createBaseVNode("div", { - class: normalizeClass(["transition-opacity flex gap-3 h-0", { - "opacity-40": selected.value && selected.value !== "cpu" - }]) - }, [ - createVNode(unref(script), { - modelValue: cpuMode.value, - "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => cpuMode.value = $event), - inputId: "cpu-mode", - class: "-translate-y-40" - }, null, 8, ["modelValue"]), - createBaseVNode("label", _hoisted_12$2, toDisplayString(_ctx.$t("install.gpuSelection.enableCpuMode")), 1) - ], 2) - ]); - }; - } -}); -const GpuPicker = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-79125ff6"]]); -const _hoisted_1$3 = { class: "flex flex-col gap-6 w-[600px]" }; -const _hoisted_2$3 = { class: "flex flex-col gap-4" }; -const _hoisted_3$3 = { class: "text-2xl font-semibold text-neutral-100" }; -const _hoisted_4$3 = { class: "text-neutral-400 my-0" }; -const _hoisted_5$1 = { class: "flex gap-2" }; -const _hoisted_6$1 = { class: "bg-neutral-800 p-4 rounded-lg" }; -const _hoisted_7$1 = { class: "text-lg font-medium mt-0 mb-3 text-neutral-100" }; -const _hoisted_8$1 = { class: "flex flex-col gap-2" }; -const _hoisted_9$1 = { class: "flex items-center gap-2" }; -const _hoisted_10$1 = { class: "text-neutral-200" }; -const _hoisted_11$1 = { class: "pi pi-info-circle" }; -const _hoisted_12$1 = { class: "flex items-center gap-2" }; -const _hoisted_13 = { class: "text-neutral-200" }; -const _hoisted_14 = { class: "pi pi-info-circle" }; -const _sfc_main$4 = /* @__PURE__ */ defineComponent({ - __name: "InstallLocationPicker", - props: { - "installPath": { required: true }, - "installPathModifiers": {}, - "pathError": { required: true }, - "pathErrorModifiers": {} - }, - emits: ["update:installPath", "update:pathError"], - setup(__props) { - const { t: t2 } = useI18n(); - const installPath = useModel(__props, "installPath"); - const pathError = useModel(__props, "pathError"); - const pathExists = ref(false); - const appData = ref(""); - const appPath = ref(""); - const inputTouched = ref(false); - const electron = electronAPI(); - onMounted(async () => { - const paths = await electron.getSystemPaths(); - appData.value = paths.appData; - appPath.value = paths.appPath; - installPath.value = paths.defaultInstallPath; - await validatePath(paths.defaultInstallPath); - }); - const validatePath = /* @__PURE__ */ __name(async (path) => { - try { - pathError.value = ""; - pathExists.value = false; - const validation = await electron.validateInstallPath(path); - if (!validation.isValid) { - const errors = []; - if (validation.cannotWrite) errors.push(t2("install.cannotWrite")); - if (validation.freeSpace < validation.requiredSpace) { - const requiredGB = validation.requiredSpace / 1024 / 1024 / 1024; - errors.push(`${t2("install.insufficientFreeSpace")}: ${requiredGB} GB`); - } - if (validation.parentMissing) errors.push(t2("install.parentMissing")); - if (validation.error) - errors.push(`${t2("install.unhandledError")}: ${validation.error}`); - pathError.value = errors.join("\n"); - } - if (validation.exists) pathExists.value = true; - } catch (error) { - pathError.value = t2("install.pathValidationFailed"); - } - }, "validatePath"); - const browsePath = /* @__PURE__ */ __name(async () => { - try { - const result = await electron.showDirectoryPicker(); - if (result) { - installPath.value = result; - await validatePath(result); - } - } catch (error) { - pathError.value = t2("install.failedToSelectDirectory"); - } - }, "browsePath"); - const onFocus = /* @__PURE__ */ __name(() => { - if (!inputTouched.value) { - inputTouched.value = true; - return; - } - validatePath(installPath.value); - }, "onFocus"); - return (_ctx, _cache) => { - const _directive_tooltip = resolveDirective("tooltip"); - return openBlock(), createElementBlock("div", _hoisted_1$3, [ - createBaseVNode("div", _hoisted_2$3, [ - createBaseVNode("h2", _hoisted_3$3, toDisplayString(_ctx.$t("install.chooseInstallationLocation")), 1), - createBaseVNode("p", _hoisted_4$3, toDisplayString(_ctx.$t("install.installLocationDescription")), 1), - createBaseVNode("div", _hoisted_5$1, [ - createVNode(unref(script$6), { class: "flex-1" }, { - default: withCtx(() => [ - createVNode(unref(script$4), { - modelValue: installPath.value, - "onUpdate:modelValue": [ - _cache[0] || (_cache[0] = ($event) => installPath.value = $event), - validatePath - ], - class: normalizeClass(["w-full", { "p-invalid": pathError.value }]), - onFocus - }, null, 8, ["modelValue", "class"]), - withDirectives(createVNode(unref(script$5), { class: "pi pi-info-circle" }, null, 512), [ - [ - _directive_tooltip, - _ctx.$t("install.installLocationTooltip"), - void 0, - { top: true } - ] - ]) - ]), - _: 1 - }), - createVNode(unref(script$7), { - icon: "pi pi-folder", - onClick: browsePath, - class: "w-12" - }) - ]), - pathError.value ? (openBlock(), createBlock(unref(script$8), { - key: 0, - severity: "error", - class: "whitespace-pre-line" - }, { - default: withCtx(() => [ - createTextVNode(toDisplayString(pathError.value), 1) - ]), - _: 1 - })) : createCommentVNode("", true), - pathExists.value ? (openBlock(), createBlock(unref(script$8), { - key: 1, - severity: "warn" - }, { - default: withCtx(() => [ - createTextVNode(toDisplayString(_ctx.$t("install.pathExists")), 1) - ]), - _: 1 - })) : createCommentVNode("", true) - ]), - createBaseVNode("div", _hoisted_6$1, [ - createBaseVNode("h3", _hoisted_7$1, toDisplayString(_ctx.$t("install.systemLocations")), 1), - createBaseVNode("div", _hoisted_8$1, [ - createBaseVNode("div", _hoisted_9$1, [ - _cache[1] || (_cache[1] = createBaseVNode("i", { class: "pi pi-folder text-neutral-400" }, null, -1)), - _cache[2] || (_cache[2] = createBaseVNode("span", { class: "text-neutral-400" }, "App Data:", -1)), - createBaseVNode("span", _hoisted_10$1, toDisplayString(appData.value), 1), - withDirectives(createBaseVNode("span", _hoisted_11$1, null, 512), [ - [_directive_tooltip, _ctx.$t("install.appDataLocationTooltip")] - ]) - ]), - createBaseVNode("div", _hoisted_12$1, [ - _cache[3] || (_cache[3] = createBaseVNode("i", { class: "pi pi-desktop text-neutral-400" }, null, -1)), - _cache[4] || (_cache[4] = createBaseVNode("span", { class: "text-neutral-400" }, "App Path:", -1)), - createBaseVNode("span", _hoisted_13, toDisplayString(appPath.value), 1), - withDirectives(createBaseVNode("span", _hoisted_14, null, 512), [ - [_directive_tooltip, _ctx.$t("install.appPathLocationTooltip")] - ]) - ]) - ]) - ]) - ]); - }; - } -}); -const _hoisted_1$2 = { class: "flex flex-col gap-6 w-[600px]" }; -const _hoisted_2$2 = { class: "flex flex-col gap-4" }; -const _hoisted_3$2 = { class: "text-2xl font-semibold text-neutral-100" }; -const _hoisted_4$2 = { class: "text-neutral-400 my-0" }; -const _hoisted_5 = { class: "flex gap-2" }; -const _hoisted_6 = { - key: 0, - class: "flex flex-col gap-4 bg-neutral-800 p-4 rounded-lg" -}; -const _hoisted_7 = { class: "text-lg mt-0 font-medium text-neutral-100" }; -const _hoisted_8 = { class: "flex flex-col gap-3" }; -const _hoisted_9 = ["onClick"]; -const _hoisted_10 = ["for"]; -const _hoisted_11 = { class: "text-sm text-neutral-400 my-1" }; -const _hoisted_12 = { - key: 1, - class: "text-neutral-400 italic" -}; -const _sfc_main$3 = /* @__PURE__ */ defineComponent({ - __name: "MigrationPicker", - props: { - "sourcePath": { required: false }, - "sourcePathModifiers": {}, - "migrationItemIds": { - required: false - }, - "migrationItemIdsModifiers": {} - }, - emits: ["update:sourcePath", "update:migrationItemIds"], - setup(__props) { - const { t: t2 } = useI18n(); - const electron = electronAPI(); - const sourcePath = useModel(__props, "sourcePath"); - const migrationItemIds = useModel(__props, "migrationItemIds"); - const migrationItems = ref( - MigrationItems.map((item) => ({ - ...item, - selected: true - })) - ); - const pathError = ref(""); - const isValidSource = computed( - () => sourcePath.value !== "" && pathError.value === "" - ); - const validateSource = /* @__PURE__ */ __name(async (sourcePath2) => { - if (!sourcePath2) { - pathError.value = ""; - return; - } - try { - pathError.value = ""; - const validation = await electron.validateComfyUISource(sourcePath2); - if (!validation.isValid) pathError.value = validation.error; - } catch (error) { - console.error(error); - pathError.value = t2("install.pathValidationFailed"); - } - }, "validateSource"); - const browsePath = /* @__PURE__ */ __name(async () => { - try { - const result = await electron.showDirectoryPicker(); - if (result) { - sourcePath.value = result; - await validateSource(result); - } - } catch (error) { - console.error(error); - pathError.value = t2("install.failedToSelectDirectory"); - } - }, "browsePath"); - watchEffect(() => { - migrationItemIds.value = migrationItems.value.filter((item) => item.selected).map((item) => item.id); - }); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div", _hoisted_1$2, [ - createBaseVNode("div", _hoisted_2$2, [ - createBaseVNode("h2", _hoisted_3$2, toDisplayString(_ctx.$t("install.migrateFromExistingInstallation")), 1), - createBaseVNode("p", _hoisted_4$2, toDisplayString(_ctx.$t("install.migrationSourcePathDescription")), 1), - createBaseVNode("div", _hoisted_5, [ - createVNode(unref(script$4), { - modelValue: sourcePath.value, - "onUpdate:modelValue": [ - _cache[0] || (_cache[0] = ($event) => sourcePath.value = $event), - validateSource - ], - placeholder: "Select existing ComfyUI installation (optional)", - class: normalizeClass(["flex-1", { "p-invalid": pathError.value }]) - }, null, 8, ["modelValue", "class"]), - createVNode(unref(script$7), { - icon: "pi pi-folder", - onClick: browsePath, - class: "w-12" - }) - ]), - pathError.value ? (openBlock(), createBlock(unref(script$8), { - key: 0, - severity: "error" - }, { - default: withCtx(() => [ - createTextVNode(toDisplayString(pathError.value), 1) - ]), - _: 1 - })) : createCommentVNode("", true) - ]), - isValidSource.value ? (openBlock(), createElementBlock("div", _hoisted_6, [ - createBaseVNode("h3", _hoisted_7, toDisplayString(_ctx.$t("install.selectItemsToMigrate")), 1), - createBaseVNode("div", _hoisted_8, [ - (openBlock(true), createElementBlock(Fragment, null, renderList(migrationItems.value, (item) => { - return openBlock(), createElementBlock("div", { - key: item.id, - class: "flex items-center gap-3 p-2 hover:bg-neutral-700 rounded", - onClick: /* @__PURE__ */ __name(($event) => item.selected = !item.selected, "onClick") - }, [ - createVNode(unref(script$9), { - modelValue: item.selected, - "onUpdate:modelValue": /* @__PURE__ */ __name(($event) => item.selected = $event, "onUpdate:modelValue"), - inputId: item.id, - binary: true, - onClick: _cache[1] || (_cache[1] = withModifiers(() => { - }, ["stop"])) - }, null, 8, ["modelValue", "onUpdate:modelValue", "inputId"]), - createBaseVNode("div", null, [ - createBaseVNode("label", { - for: item.id, - class: "text-neutral-200 font-medium" - }, toDisplayString(item.label), 9, _hoisted_10), - createBaseVNode("p", _hoisted_11, toDisplayString(item.description), 1) - ]) - ], 8, _hoisted_9); - }), 128)) - ]) - ])) : (openBlock(), createElementBlock("div", _hoisted_12, toDisplayString(_ctx.$t("install.migrationOptional")), 1)) - ]); - }; - } -}); -const _hoisted_1$1 = { class: "flex flex-col items-center gap-4" }; -const _hoisted_2$1 = { class: "w-full" }; -const _hoisted_3$1 = { class: "text-lg font-medium text-neutral-100" }; -const _hoisted_4$1 = { class: "text-sm text-neutral-400 mt-1" }; -const _sfc_main$2 = /* @__PURE__ */ defineComponent({ - __name: "MirrorItem", - props: /* @__PURE__ */ mergeModels({ - item: {} - }, { - "modelValue": { required: true }, - "modelModifiers": {} - }), - emits: /* @__PURE__ */ mergeModels(["state-change"], ["update:modelValue"]), - setup(__props, { emit: __emit }) { - const emit = __emit; - const modelValue = useModel(__props, "modelValue"); - const validationState = ref(ValidationState.IDLE); - const normalizedSettingId = computed(() => { - return normalizeI18nKey(__props.item.settingId); - }); - onMounted(() => { - modelValue.value = __props.item.mirror; - }); - watch(validationState, (newState) => { - emit("state-change", newState); - if (newState === ValidationState.INVALID && modelValue.value === __props.item.mirror) { - modelValue.value = __props.item.fallbackMirror; - } - }); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div", _hoisted_1$1, [ - createBaseVNode("div", _hoisted_2$1, [ - createBaseVNode("h3", _hoisted_3$1, toDisplayString(_ctx.$t(`settings.${normalizedSettingId.value}.name`)), 1), - createBaseVNode("p", _hoisted_4$1, toDisplayString(_ctx.$t(`settings.${normalizedSettingId.value}.tooltip`)), 1) - ]), - createVNode(_sfc_main$7, { - modelValue: modelValue.value, - "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event), - "validate-url-fn": /* @__PURE__ */ __name((mirror) => unref(checkMirrorReachable)(mirror + (_ctx.item.validationPathSuffix ?? "")), "validate-url-fn"), - onStateChange: _cache[1] || (_cache[1] = ($event) => validationState.value = $event) - }, null, 8, ["modelValue", "validate-url-fn"]) - ]); - }; - } -}); -const _sfc_main$1 = /* @__PURE__ */ defineComponent({ - __name: "MirrorsConfiguration", - props: /* @__PURE__ */ mergeModels({ - device: {} - }, { - "pythonMirror": { required: true }, - "pythonMirrorModifiers": {}, - "pypiMirror": { required: true }, - "pypiMirrorModifiers": {}, - "torchMirror": { required: true }, - "torchMirrorModifiers": {} - }), - emits: ["update:pythonMirror", "update:pypiMirror", "update:torchMirror"], - setup(__props) { - const showMirrorInputs = ref(false); - const pythonMirror = useModel(__props, "pythonMirror"); - const pypiMirror = useModel(__props, "pypiMirror"); - const torchMirror = useModel(__props, "torchMirror"); - const getTorchMirrorItem = /* @__PURE__ */ __name((device) => { - const settingId = "Comfy-Desktop.UV.TorchInstallMirror"; - switch (device) { - case "mps": - return { - settingId, - mirror: NIGHTLY_CPU_TORCH_URL, - fallbackMirror: NIGHTLY_CPU_TORCH_URL - }; - case "nvidia": - return { - settingId, - mirror: CUDA_TORCH_URL, - fallbackMirror: CUDA_TORCH_URL - }; - case "cpu": - default: - return { - settingId, - mirror: PYPI_MIRROR.mirror, - fallbackMirror: PYPI_MIRROR.fallbackMirror - }; - } - }, "getTorchMirrorItem"); - const userIsInChina = ref(false); - onMounted(async () => { - userIsInChina.value = await isInChina(); - }); - const useFallbackMirror = /* @__PURE__ */ __name((mirror) => ({ - ...mirror, - mirror: mirror.fallbackMirror - }), "useFallbackMirror"); - const mirrors = computed( - () => [ - [PYTHON_MIRROR, pythonMirror], - [PYPI_MIRROR, pypiMirror], - [getTorchMirrorItem(__props.device), torchMirror] - ].map(([item, modelValue]) => [ - userIsInChina.value ? useFallbackMirror(item) : item, - modelValue - ]) - ); - const validationStates = ref( - mirrors.value.map(() => ValidationState.IDLE) - ); - const validationState = computed(() => { - return mergeValidationStates(validationStates.value); - }); - const validationStateTooltip = computed(() => { - switch (validationState.value) { - case ValidationState.INVALID: - return t("install.settings.mirrorsUnreachable"); - case ValidationState.VALID: - return t("install.settings.mirrorsReachable"); - default: - return t("install.settings.checkingMirrors"); - } - }); - return (_ctx, _cache) => { - const _directive_tooltip = resolveDirective("tooltip"); - return openBlock(), createBlock(unref(script$a), { - header: _ctx.$t("install.settings.mirrorSettings"), - toggleable: "", - collapsed: !showMirrorInputs.value, - "pt:root": "bg-neutral-800 border-none w-[600px]" - }, { - icons: withCtx(() => [ - withDirectives(createBaseVNode("i", { - class: normalizeClass({ - "pi pi-spin pi-spinner text-neutral-400": validationState.value === unref(ValidationState).LOADING, - "pi pi-check text-green-500": validationState.value === unref(ValidationState).VALID, - "pi pi-times text-red-500": validationState.value === unref(ValidationState).INVALID - }) - }, null, 2), [ - [_directive_tooltip, validationStateTooltip.value] - ]) - ]), - default: withCtx(() => [ - (openBlock(true), createElementBlock(Fragment, null, renderList(mirrors.value, ([item, modelValue], index) => { - return openBlock(), createElementBlock(Fragment, { - key: item.settingId + item.mirror - }, [ - index > 0 ? (openBlock(), createBlock(unref(script$1), { key: 0 })) : createCommentVNode("", true), - createVNode(_sfc_main$2, { - item, - modelValue: modelValue.value, - "onUpdate:modelValue": /* @__PURE__ */ __name(($event) => modelValue.value = $event, "onUpdate:modelValue"), - onStateChange: /* @__PURE__ */ __name(($event) => validationStates.value[index] = $event, "onStateChange") - }, null, 8, ["item", "modelValue", "onUpdate:modelValue", "onStateChange"]) - ], 64); - }), 128)) - ]), - _: 1 - }, 8, ["header", "collapsed"]); - }; - } -}); -const _hoisted_1 = { class: "flex pt-6 justify-end" }; -const _hoisted_2 = { class: "flex pt-6 justify-between" }; -const _hoisted_3 = { class: "flex pt-6 justify-between" }; -const _hoisted_4 = { class: "flex mt-6 justify-between" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "InstallView", - setup(__props) { - const device = ref(null); - const installPath = ref(""); - const pathError = ref(""); - const migrationSourcePath = ref(""); - const migrationItemIds = ref([]); - const autoUpdate = ref(true); - const allowMetrics = ref(true); - const pythonMirror = ref(""); - const pypiMirror = ref(""); - const torchMirror = ref(""); - const highestStep = ref(0); - const handleStepChange = /* @__PURE__ */ __name((value) => { - setHighestStep(value); - electronAPI().Events.trackEvent("install_stepper_change", { - step: value - }); - }, "handleStepChange"); - const setHighestStep = /* @__PURE__ */ __name((value) => { - const int = typeof value === "number" ? value : parseInt(value, 10); - if (!isNaN(int) && int > highestStep.value) highestStep.value = int; - }, "setHighestStep"); - const hasError = computed(() => pathError.value !== ""); - const noGpu = computed(() => typeof device.value !== "string"); - const electron = electronAPI(); - const router = useRouter(); - const install = /* @__PURE__ */ __name(() => { - const options = { - installPath: installPath.value, - autoUpdate: autoUpdate.value, - allowMetrics: allowMetrics.value, - migrationSourcePath: migrationSourcePath.value, - migrationItemIds: toRaw(migrationItemIds.value), - pythonMirror: pythonMirror.value, - pypiMirror: pypiMirror.value, - torchMirror: torchMirror.value, - device: device.value - }; - electron.installComfyUI(options); - const nextPage = options.device === "unsupported" ? "/manual-configuration" : "/server-start"; - router.push(nextPage); - }, "install"); - onMounted(async () => { - if (!electron) return; - const detectedGpu = await electron.Config.getDetectedGpu(); - if (detectedGpu === "mps" || detectedGpu === "nvidia") { - device.value = detectedGpu; - } - electronAPI().Events.trackEvent("install_stepper_change", { - step: "0", - gpu: detectedGpu - }); - }); - return (_ctx, _cache) => { - return openBlock(), createBlock(_sfc_main$8, { dark: "" }, { - default: withCtx(() => [ - createVNode(unref(script$f), { - class: "h-full p-8 2xl:p-16", - value: "0", - "onUpdate:value": handleStepChange - }, { - default: withCtx(() => [ - createVNode(unref(script$b), { class: "select-none" }, { - default: withCtx(() => [ - createVNode(unref(script$c), { value: "0" }, { - default: withCtx(() => [ - createTextVNode(toDisplayString(_ctx.$t("install.gpu")), 1) - ]), - _: 1 - }), - createVNode(unref(script$c), { - value: "1", - disabled: noGpu.value - }, { - default: withCtx(() => [ - createTextVNode(toDisplayString(_ctx.$t("install.installLocation")), 1) - ]), - _: 1 - }, 8, ["disabled"]), - createVNode(unref(script$c), { - value: "2", - disabled: noGpu.value || hasError.value || highestStep.value < 1 - }, { - default: withCtx(() => [ - createTextVNode(toDisplayString(_ctx.$t("install.migration")), 1) - ]), - _: 1 - }, 8, ["disabled"]), - createVNode(unref(script$c), { - value: "3", - disabled: noGpu.value || hasError.value || highestStep.value < 2 - }, { - default: withCtx(() => [ - createTextVNode(toDisplayString(_ctx.$t("install.desktopSettings")), 1) - ]), - _: 1 - }, 8, ["disabled"]) - ]), - _: 1 - }), - createVNode(unref(script$d), null, { - default: withCtx(() => [ - createVNode(unref(script$e), { value: "0" }, { - default: withCtx(({ activateCallback }) => [ - createVNode(GpuPicker, { - device: device.value, - "onUpdate:device": _cache[0] || (_cache[0] = ($event) => device.value = $event) - }, null, 8, ["device"]), - createBaseVNode("div", _hoisted_1, [ - createVNode(unref(script$7), { - label: _ctx.$t("g.next"), - icon: "pi pi-arrow-right", - iconPos: "right", - onClick: /* @__PURE__ */ __name(($event) => activateCallback("1"), "onClick"), - disabled: typeof device.value !== "string" - }, null, 8, ["label", "onClick", "disabled"]) - ]) - ]), - _: 1 - }), - createVNode(unref(script$e), { value: "1" }, { - default: withCtx(({ activateCallback }) => [ - createVNode(_sfc_main$4, { - installPath: installPath.value, - "onUpdate:installPath": _cache[1] || (_cache[1] = ($event) => installPath.value = $event), - pathError: pathError.value, - "onUpdate:pathError": _cache[2] || (_cache[2] = ($event) => pathError.value = $event) - }, null, 8, ["installPath", "pathError"]), - createBaseVNode("div", _hoisted_2, [ - createVNode(unref(script$7), { - label: _ctx.$t("g.back"), - severity: "secondary", - icon: "pi pi-arrow-left", - onClick: /* @__PURE__ */ __name(($event) => activateCallback("0"), "onClick") - }, null, 8, ["label", "onClick"]), - createVNode(unref(script$7), { - label: _ctx.$t("g.next"), - icon: "pi pi-arrow-right", - iconPos: "right", - onClick: /* @__PURE__ */ __name(($event) => activateCallback("2"), "onClick"), - disabled: pathError.value !== "" - }, null, 8, ["label", "onClick", "disabled"]) - ]) - ]), - _: 1 - }), - createVNode(unref(script$e), { value: "2" }, { - default: withCtx(({ activateCallback }) => [ - createVNode(_sfc_main$3, { - sourcePath: migrationSourcePath.value, - "onUpdate:sourcePath": _cache[3] || (_cache[3] = ($event) => migrationSourcePath.value = $event), - migrationItemIds: migrationItemIds.value, - "onUpdate:migrationItemIds": _cache[4] || (_cache[4] = ($event) => migrationItemIds.value = $event) - }, null, 8, ["sourcePath", "migrationItemIds"]), - createBaseVNode("div", _hoisted_3, [ - createVNode(unref(script$7), { - label: _ctx.$t("g.back"), - severity: "secondary", - icon: "pi pi-arrow-left", - onClick: /* @__PURE__ */ __name(($event) => activateCallback("1"), "onClick") - }, null, 8, ["label", "onClick"]), - createVNode(unref(script$7), { - label: _ctx.$t("g.next"), - icon: "pi pi-arrow-right", - iconPos: "right", - onClick: /* @__PURE__ */ __name(($event) => activateCallback("3"), "onClick") - }, null, 8, ["label", "onClick"]) - ]) - ]), - _: 1 - }), - createVNode(unref(script$e), { value: "3" }, { - default: withCtx(({ activateCallback }) => [ - createVNode(_sfc_main$6, { - autoUpdate: autoUpdate.value, - "onUpdate:autoUpdate": _cache[5] || (_cache[5] = ($event) => autoUpdate.value = $event), - allowMetrics: allowMetrics.value, - "onUpdate:allowMetrics": _cache[6] || (_cache[6] = ($event) => allowMetrics.value = $event) - }, null, 8, ["autoUpdate", "allowMetrics"]), - createVNode(_sfc_main$1, { - device: device.value, - pythonMirror: pythonMirror.value, - "onUpdate:pythonMirror": _cache[7] || (_cache[7] = ($event) => pythonMirror.value = $event), - pypiMirror: pypiMirror.value, - "onUpdate:pypiMirror": _cache[8] || (_cache[8] = ($event) => pypiMirror.value = $event), - torchMirror: torchMirror.value, - "onUpdate:torchMirror": _cache[9] || (_cache[9] = ($event) => torchMirror.value = $event), - class: "mt-6" - }, null, 8, ["device", "pythonMirror", "pypiMirror", "torchMirror"]), - createBaseVNode("div", _hoisted_4, [ - createVNode(unref(script$7), { - label: _ctx.$t("g.back"), - severity: "secondary", - icon: "pi pi-arrow-left", - onClick: /* @__PURE__ */ __name(($event) => activateCallback("2"), "onClick") - }, null, 8, ["label", "onClick"]), - createVNode(unref(script$7), { - label: _ctx.$t("g.install"), - icon: "pi pi-check", - iconPos: "right", - disabled: hasError.value, - onClick: _cache[10] || (_cache[10] = ($event) => install()) - }, null, 8, ["label", "disabled"]) - ]) - ]), - _: 1 - }) - ]), - _: 1 - }) - ]), - _: 1 - }) - ]), - _: 1 - }); - }; - } -}); -const InstallView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cd6731d2"]]); -export { - InstallView as default -}; -//# sourceMappingURL=InstallView-BwawagSr.js.map diff --git a/comfy/web/assets/InstallView-BwawagSr.js.map b/comfy/web/assets/InstallView-BwawagSr.js.map deleted file mode 100644 index a51ebe4a6..000000000 --- a/comfy/web/assets/InstallView-BwawagSr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"InstallView-BwawagSr.js","sources":["../../src/components/install/DesktopSettingsConfiguration.vue","../../../../../../assets/images/nvidia-logo.svg","../../../../../../assets/images/apple-mps-logo.png","../../../../../../assets/images/manual-configuration.svg","../../src/components/install/GpuPicker.vue","../../src/components/install/InstallLocationPicker.vue","../../src/components/install/MigrationPicker.vue","../../src/components/install/mirror/MirrorItem.vue","../../src/components/install/MirrorsConfiguration.vue","../../src/views/InstallView.vue"],"sourcesContent":["\n\n\n","export default \"__VITE_PUBLIC_ASSET__fe43f3f5__\"","export default \"__VITE_PUBLIC_ASSET__2bae65e3__\"","export default \"__VITE_PUBLIC_ASSET__57befc1b__\"","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n \n \n\n\n\n","\n\n\n\n\n"],"names":["_useModel","t","sourcePath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmIM,UA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D,MAAM;AAAA,QACN,KAAK;AAAA,MAAA,CACN;AAAA,IAAA,CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/InstallView-C_PLT5gk.css b/comfy/web/assets/InstallView-C_PLT5gk.css deleted file mode 100644 index 3628d5acc..000000000 --- a/comfy/web/assets/InstallView-C_PLT5gk.css +++ /dev/null @@ -1,81 +0,0 @@ - -.p-tag[data-v-79125ff6] { - --p-tag-gap: 0.5rem; -} -.hover-brighten { -&[data-v-79125ff6] { - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; - transition-property: filter, box-shadow; - } -&[data-v-79125ff6]:hover { - filter: brightness(107%) contrast(105%); - box-shadow: 0 0 0.25rem #ffffff79; -} -} -.p-accordioncontent-content[data-v-79125ff6] { - border-radius: 0.5rem; - --tw-bg-opacity: 1; - background-color: rgb(23 23 23 / var(--tw-bg-opacity, 1)); - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; -} -div.selected { -.gpu-button[data-v-79125ff6]:not(.selected) { - opacity: 0.5; -} -.gpu-button[data-v-79125ff6]:not(.selected):hover { - opacity: 1; -} -} -.gpu-button[data-v-79125ff6] { - margin: 0px; - display: flex; - width: 50%; - cursor: pointer; - flex-direction: column; - align-items: center; - justify-content: space-around; - border-radius: 0.5rem; - background-color: rgb(38 38 38 / var(--tw-bg-opacity, 1)); - --tw-bg-opacity: 0.5; - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; -} -.gpu-button[data-v-79125ff6]:hover { - --tw-bg-opacity: 0.75; -} -.gpu-button { -&.selected[data-v-79125ff6] { - --tw-bg-opacity: 1; - background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1)); -} -&.selected[data-v-79125ff6] { - --tw-bg-opacity: 0.5; -} -&.selected[data-v-79125ff6] { - opacity: 1; -} -&.selected[data-v-79125ff6]:hover { - --tw-bg-opacity: 0.6; -} -} -.disabled[data-v-79125ff6] { - pointer-events: none; - opacity: 0.4; -} -.p-card-header[data-v-79125ff6] { - flex-grow: 1; - text-align: center; -} -.p-card-body[data-v-79125ff6] { - padding-top: 0px; - text-align: center; -} - -[data-v-cd6731d2] .p-steppanel { - background-color: transparent -} diff --git a/comfy/web/assets/KeybindingPanel-BetULlhU.js b/comfy/web/assets/KeybindingPanel-BetULlhU.js deleted file mode 100644 index d1d988902..000000000 --- a/comfy/web/assets/KeybindingPanel-BetULlhU.js +++ /dev/null @@ -1,292 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { d as defineComponent, c as computed, o as openBlock, f as createElementBlock, F as Fragment, D as renderList, k as createVNode, z as withCtx, ak as createTextVNode, E as toDisplayString, j as unref, ah as script, B as createCommentVNode, T as ref, dI as FilterMatchMode, az as useKeybindingStore, J as useCommandStore, I as useI18n, X as normalizeI18nKey, w as watchEffect, b3 as useToast, r as resolveDirective, y as createBlock, dJ as SearchBox, m as createBaseVNode, l as script$2, bt as script$4, aD as withModifiers, bw as script$5, ao as script$6, i as withDirectives, dK as _sfc_main$2, dL as KeyComboImpl, dM as KeybindingImpl, _ as _export_sfc } from "./index-DIgj6hpb.js"; -import { g as script$1, h as script$3 } from "./index-Czd3J-KM.js"; -import { u as useKeybindingService } from "./keybindingService-CqDMAs0_.js"; -import "./index-D8hjiWMw.js"; -const _hoisted_1$1 = { - key: 0, - class: "px-2" -}; -const _sfc_main$1 = /* @__PURE__ */ defineComponent({ - __name: "KeyComboDisplay", - props: { - keyCombo: {}, - isModified: { type: Boolean, default: false } - }, - setup(__props) { - const props = __props; - const keySequences = computed(() => props.keyCombo.getKeySequences()); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("span", null, [ - (openBlock(true), createElementBlock(Fragment, null, renderList(keySequences.value, (sequence, index) => { - return openBlock(), createElementBlock(Fragment, { key: index }, [ - createVNode(unref(script), { - severity: _ctx.isModified ? "info" : "secondary" - }, { - default: withCtx(() => [ - createTextVNode(toDisplayString(sequence), 1) - ]), - _: 2 - }, 1032, ["severity"]), - index < keySequences.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_1$1, "+")) : createCommentVNode("", true) - ], 64); - }), 128)) - ]); - }; - } -}); -const _hoisted_1 = { class: "actions invisible flex flex-row" }; -const _hoisted_2 = ["title"]; -const _hoisted_3 = { key: 1 }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "KeybindingPanel", - setup(__props) { - const filters = ref({ - global: { value: "", matchMode: FilterMatchMode.CONTAINS } - }); - const keybindingStore = useKeybindingStore(); - const keybindingService = useKeybindingService(); - const commandStore = useCommandStore(); - const { t } = useI18n(); - const commandsData = computed(() => { - return Object.values(commandStore.commands).map((command) => ({ - id: command.id, - label: t(`commands.${normalizeI18nKey(command.id)}.label`, command.label), - keybinding: keybindingStore.getKeybindingByCommandId(command.id) - })); - }); - const selectedCommandData = ref(null); - const editDialogVisible = ref(false); - const newBindingKeyCombo = ref(null); - const currentEditingCommand = ref(null); - const keybindingInput = ref(null); - const existingKeybindingOnCombo = computed(() => { - if (!currentEditingCommand.value) { - return null; - } - if (currentEditingCommand.value.keybinding?.combo?.equals( - newBindingKeyCombo.value - )) { - return null; - } - if (!newBindingKeyCombo.value) { - return null; - } - return keybindingStore.getKeybinding(newBindingKeyCombo.value); - }); - function editKeybinding(commandData) { - currentEditingCommand.value = commandData; - newBindingKeyCombo.value = commandData.keybinding ? commandData.keybinding.combo : null; - editDialogVisible.value = true; - } - __name(editKeybinding, "editKeybinding"); - watchEffect(() => { - if (editDialogVisible.value) { - setTimeout(() => { - keybindingInput.value?.$el?.focus(); - }, 300); - } - }); - function removeKeybinding(commandData) { - if (commandData.keybinding) { - keybindingStore.unsetKeybinding(commandData.keybinding); - keybindingService.persistUserKeybindings(); - } - } - __name(removeKeybinding, "removeKeybinding"); - function captureKeybinding(event) { - if (!event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey) { - switch (event.key) { - case "Escape": - cancelEdit(); - return; - case "Enter": - saveKeybinding(); - return; - } - } - const keyCombo = KeyComboImpl.fromEvent(event); - newBindingKeyCombo.value = keyCombo; - } - __name(captureKeybinding, "captureKeybinding"); - function cancelEdit() { - editDialogVisible.value = false; - currentEditingCommand.value = null; - newBindingKeyCombo.value = null; - } - __name(cancelEdit, "cancelEdit"); - function saveKeybinding() { - if (currentEditingCommand.value && newBindingKeyCombo.value) { - const updated = keybindingStore.updateKeybindingOnCommand( - new KeybindingImpl({ - commandId: currentEditingCommand.value.id, - combo: newBindingKeyCombo.value - }) - ); - if (updated) { - keybindingService.persistUserKeybindings(); - } - } - cancelEdit(); - } - __name(saveKeybinding, "saveKeybinding"); - const toast = useToast(); - async function resetKeybindings() { - keybindingStore.resetKeybindings(); - await keybindingService.persistUserKeybindings(); - toast.add({ - severity: "info", - summary: "Info", - detail: "Keybindings reset", - life: 3e3 - }); - } - __name(resetKeybindings, "resetKeybindings"); - return (_ctx, _cache) => { - const _directive_tooltip = resolveDirective("tooltip"); - return openBlock(), createBlock(_sfc_main$2, { - value: "Keybinding", - class: "keybinding-panel" - }, { - header: withCtx(() => [ - createVNode(SearchBox, { - modelValue: filters.value["global"].value, - "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filters.value["global"].value = $event), - placeholder: _ctx.$t("g.searchKeybindings") + "..." - }, null, 8, ["modelValue", "placeholder"]) - ]), - default: withCtx(() => [ - createVNode(unref(script$3), { - value: commandsData.value, - selection: selectedCommandData.value, - "onUpdate:selection": _cache[1] || (_cache[1] = ($event) => selectedCommandData.value = $event), - "global-filter-fields": ["id", "label"], - filters: filters.value, - selectionMode: "single", - stripedRows: "", - pt: { - header: "px-0" - } - }, { - default: withCtx(() => [ - createVNode(unref(script$1), { - field: "actions", - header: "" - }, { - body: withCtx((slotProps) => [ - createBaseVNode("div", _hoisted_1, [ - createVNode(unref(script$2), { - icon: "pi pi-pencil", - class: "p-button-text", - onClick: /* @__PURE__ */ __name(($event) => editKeybinding(slotProps.data), "onClick") - }, null, 8, ["onClick"]), - createVNode(unref(script$2), { - icon: "pi pi-trash", - class: "p-button-text p-button-danger", - onClick: /* @__PURE__ */ __name(($event) => removeKeybinding(slotProps.data), "onClick"), - disabled: !slotProps.data.keybinding - }, null, 8, ["onClick", "disabled"]) - ]) - ]), - _: 1 - }), - createVNode(unref(script$1), { - field: "id", - header: _ctx.$t("g.command"), - sortable: "", - class: "max-w-64 2xl:max-w-full" - }, { - body: withCtx((slotProps) => [ - createBaseVNode("div", { - class: "overflow-hidden text-ellipsis whitespace-nowrap", - title: slotProps.data.id - }, toDisplayString(slotProps.data.label), 9, _hoisted_2) - ]), - _: 1 - }, 8, ["header"]), - createVNode(unref(script$1), { - field: "keybinding", - header: _ctx.$t("g.keybinding") - }, { - body: withCtx((slotProps) => [ - slotProps.data.keybinding ? (openBlock(), createBlock(_sfc_main$1, { - key: 0, - keyCombo: slotProps.data.keybinding.combo, - isModified: unref(keybindingStore).isCommandKeybindingModified(slotProps.data.id) - }, null, 8, ["keyCombo", "isModified"])) : (openBlock(), createElementBlock("span", _hoisted_3, "-")) - ]), - _: 1 - }, 8, ["header"]) - ]), - _: 1 - }, 8, ["value", "selection", "filters"]), - createVNode(unref(script$6), { - class: "min-w-96", - visible: editDialogVisible.value, - "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => editDialogVisible.value = $event), - modal: "", - header: currentEditingCommand.value?.label, - onHide: cancelEdit - }, { - footer: withCtx(() => [ - createVNode(unref(script$2), { - label: "Save", - icon: "pi pi-check", - onClick: saveKeybinding, - disabled: !!existingKeybindingOnCombo.value, - autofocus: "" - }, null, 8, ["disabled"]) - ]), - default: withCtx(() => [ - createBaseVNode("div", null, [ - createVNode(unref(script$4), { - class: "mb-2 text-center", - ref_key: "keybindingInput", - ref: keybindingInput, - modelValue: newBindingKeyCombo.value?.toString() ?? "", - placeholder: "Press keys for new binding", - onKeydown: withModifiers(captureKeybinding, ["stop", "prevent"]), - autocomplete: "off", - fluid: "", - invalid: !!existingKeybindingOnCombo.value - }, null, 8, ["modelValue", "invalid"]), - existingKeybindingOnCombo.value ? (openBlock(), createBlock(unref(script$5), { - key: 0, - severity: "error" - }, { - default: withCtx(() => [ - _cache[3] || (_cache[3] = createTextVNode(" Keybinding already exists on ")), - createVNode(unref(script), { - severity: "secondary", - value: existingKeybindingOnCombo.value.commandId - }, null, 8, ["value"]) - ]), - _: 1 - })) : createCommentVNode("", true) - ]) - ]), - _: 1 - }, 8, ["visible", "header"]), - withDirectives(createVNode(unref(script$2), { - class: "mt-4", - label: _ctx.$t("g.reset"), - icon: "pi pi-trash", - severity: "danger", - fluid: "", - text: "", - onClick: resetKeybindings - }, null, 8, ["label"]), [ - [_directive_tooltip, _ctx.$t("g.resetKeybindingsTooltip")] - ]) - ]), - _: 1 - }); - }; - } -}); -const KeybindingPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8454e24f"]]); -export { - KeybindingPanel as default -}; -//# sourceMappingURL=KeybindingPanel-BetULlhU.js.map diff --git a/comfy/web/assets/KeybindingPanel-BetULlhU.js.map b/comfy/web/assets/KeybindingPanel-BetULlhU.js.map deleted file mode 100644 index cc865c149..000000000 --- a/comfy/web/assets/KeybindingPanel-BetULlhU.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"KeybindingPanel-BetULlhU.js","sources":["../../src/components/dialog/content/setting/keybinding/KeyComboDisplay.vue","../../src/components/dialog/content/setting/KeybindingPanel.vue"],"sourcesContent":["\n\n\n","\n\n\n\n\n"],"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A;AARY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/KeybindingPanel-CwPLIgAf.css b/comfy/web/assets/KeybindingPanel-CwPLIgAf.css deleted file mode 100644 index 2392e4f5c..000000000 --- a/comfy/web/assets/KeybindingPanel-CwPLIgAf.css +++ /dev/null @@ -1,8 +0,0 @@ - -[data-v-8454e24f] .p-datatable-tbody > tr > td { - padding: 0.25rem; - min-height: 2rem -} -[data-v-8454e24f] .p-datatable-row-selected .actions,[data-v-8454e24f] .p-datatable-selectable-row:hover .actions { - visibility: visible -} diff --git a/comfy/web/assets/MaintenanceView-BFp9KqAr.js b/comfy/web/assets/MaintenanceView-BFp9KqAr.js deleted file mode 100644 index e538000e5..000000000 --- a/comfy/web/assets/MaintenanceView-BFp9KqAr.js +++ /dev/null @@ -1,770 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { d as defineComponent, bF as mergeModels, bz as useModel, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, Z as normalizeClass, i as withDirectives, v as vShow, k as createVNode, j as unref, bN as script, l as script$1, c as computed, bO as PrimeIcons, bp as t, ah as script$2, bi as electronAPI, ad as defineStore, T as ref, bP as useTimeout, N as watch, f as createElementBlock, B as createCommentVNode, ak as createTextVNode, E as toDisplayString, aE as mergeProps, bQ as script$3, _ as _export_sfc, r as resolveDirective, bR as script$4, b3 as useToast, bS as useConfirm, F as Fragment, bu as script$5, D as renderList, bT as script$6, p as onMounted, bU as onUnmounted, a2 as script$7, as as isRef } from "./index-DIgj6hpb.js"; -import { s as script$8 } from "./index-CE2hpomb.js"; -import "./index-mHcHTYAB.js"; -import { _ as _sfc_main$7 } from "./TerminalOutputDrawer-B_NZxAv8.js"; -import { _ as _sfc_main$8 } from "./BaseViewTemplate-DaGOaycP.js"; -import "./index-DdgRmRKP.js"; -import "./index-D8hjiWMw.js"; -import "./index-Czd3J-KM.js"; -import "./index-C_ACzX5-.js"; -import "./index-BKScv1mm.js"; -const _sfc_main$6 = /* @__PURE__ */ defineComponent({ - __name: "RefreshButton", - props: /* @__PURE__ */ mergeModels({ - outlined: { type: Boolean, default: true }, - disabled: { type: Boolean }, - severity: { default: "secondary" } - }, { - "modelValue": { type: Boolean, ...{ required: true } }, - "modelModifiers": {} - }), - emits: /* @__PURE__ */ mergeModels(["refresh"], ["update:modelValue"]), - setup(__props) { - const props = __props; - const active = useModel(__props, "modelValue"); - return (_ctx, _cache) => { - return openBlock(), createBlock(unref(script$1), { - class: "relative p-button-icon-only", - outlined: props.outlined, - severity: props.severity, - disabled: active.value || props.disabled, - onClick: _cache[0] || (_cache[0] = (event) => _ctx.$emit("refresh", event)) - }, { - default: withCtx(() => [ - createBaseVNode("span", { - class: normalizeClass(["p-button-icon pi pi-refresh transition-all", { "opacity-0": active.value }]), - "data-pc-section": "icon" - }, null, 2), - _cache[1] || (_cache[1] = createBaseVNode("span", { - class: "p-button-label", - "data-pc-section": "label" - }, " ", -1)), - withDirectives(createVNode(unref(script), { class: "absolute w-1/2 h-1/2" }, null, 512), [ - [vShow, active.value] - ]) - ]), - _: 1 - }, 8, ["outlined", "severity", "disabled"]); - }; - } -}); -const _sfc_main$5 = /* @__PURE__ */ defineComponent({ - __name: "StatusTag", - props: { - error: { type: Boolean }, - refreshing: { type: Boolean } - }, - setup(__props) { - const props = __props; - const icon = computed(() => { - if (props.refreshing) return PrimeIcons.QUESTION; - if (props.error) return PrimeIcons.TIMES; - return PrimeIcons.CHECK; - }); - const severity = computed(() => { - if (props.refreshing) return "info"; - if (props.error) return "danger"; - return "success"; - }); - const value = computed(() => { - if (props.refreshing) return t("maintenance.refreshing"); - if (props.error) return t("g.error"); - return t("maintenance.OK"); - }); - return (_ctx, _cache) => { - return openBlock(), createBlock(unref(script$2), { - icon: icon.value, - severity: severity.value, - value: value.value - }, null, 8, ["icon", "severity", "value"]); - }; - } -}); -const electron = electronAPI(); -const openUrl = /* @__PURE__ */ __name((url) => { - window.open(url, "_blank"); - return true; -}, "openUrl"); -const DESKTOP_MAINTENANCE_TASKS = [ - { - id: "basePath", - execute: /* @__PURE__ */ __name(async () => await electron.setBasePath(), "execute"), - name: "Base path", - shortDescription: "Change the application base path.", - errorDescription: "Unable to open the base path. Please select a new one.", - description: "The base path is the default location where ComfyUI stores data. It is the location fo the python environment, and may also contain models, custom nodes, and other extensions.", - isInstallationFix: true, - button: { - icon: PrimeIcons.QUESTION, - text: "Select" - } - }, - { - id: "git", - headerImg: "assets/images/Git-Logo-White.svg", - execute: /* @__PURE__ */ __name(() => openUrl("https://git-scm.com/downloads/"), "execute"), - name: "Download git", - shortDescription: "Open the git download page.", - errorDescription: "Git is missing. Please download and install git, then restart ComfyUI Desktop.", - description: "Git is required to download and manage custom nodes and other extensions. This task opens the download page in your default browser, where you can download the latest version of git. Once you have installed git, please restart ComfyUI Desktop.", - button: { - icon: PrimeIcons.EXTERNAL_LINK, - text: "Download" - } - }, - { - id: "vcRedist", - execute: /* @__PURE__ */ __name(() => openUrl("https://aka.ms/vs/17/release/vc_redist.x64.exe"), "execute"), - name: "Download VC++ Redist", - shortDescription: "Download the latest VC++ Redistributable runtime.", - description: "The Visual C++ runtime libraries are required to run ComfyUI. You will need to download and install this file.", - button: { - icon: PrimeIcons.EXTERNAL_LINK, - text: "Download" - } - }, - { - id: "reinstall", - severity: "danger", - requireConfirm: true, - execute: /* @__PURE__ */ __name(async () => { - await electron.reinstall(); - return true; - }, "execute"), - name: "Reinstall ComfyUI", - shortDescription: "Deletes the desktop app config and load the welcome screen.", - description: "Delete the desktop app config, restart the app, and load the installation screen.", - confirmText: "Delete all saved config and reinstall?", - button: { - icon: PrimeIcons.EXCLAMATION_TRIANGLE, - text: "Reinstall" - } - }, - { - id: "pythonPackages", - requireConfirm: true, - execute: /* @__PURE__ */ __name(async () => { - try { - await electron.uv.installRequirements(); - return true; - } catch (error) { - return false; - } - }, "execute"), - name: "Install python packages", - shortDescription: "Installs the base python packages required to run ComfyUI.", - errorDescription: "Python packages that are required to run ComfyUI are not installed.", - description: "This will install the python packages required to run ComfyUI. This includes torch, torchvision, and other dependencies.", - usesTerminal: true, - isInstallationFix: true, - button: { - icon: PrimeIcons.DOWNLOAD, - text: "Install" - } - }, - { - id: "uv", - execute: /* @__PURE__ */ __name(() => openUrl("https://docs.astral.sh/uv/getting-started/installation/"), "execute"), - name: "uv executable", - shortDescription: "uv installs and maintains the python environment.", - description: "This will open the download page for Astral's uv tool. uv is used to install python and manage python packages.", - button: { - icon: "pi pi-asterisk", - text: "Download" - } - }, - { - id: "uvCache", - severity: "danger", - requireConfirm: true, - execute: /* @__PURE__ */ __name(async () => await electron.uv.clearCache(), "execute"), - name: "uv cache", - shortDescription: "Remove the Astral uv cache of python packages.", - description: "This will remove the uv cache directory and its contents. All downloaded python packages will need to be downloaded again.", - confirmText: "Delete uv cache of python packages?", - usesTerminal: true, - isInstallationFix: true, - button: { - icon: PrimeIcons.TRASH, - text: "Clear cache" - } - }, - { - id: "venvDirectory", - severity: "danger", - requireConfirm: true, - execute: /* @__PURE__ */ __name(async () => await electron.uv.resetVenv(), "execute"), - name: "Reset virtual environment", - shortDescription: "Remove and recreate the .venv directory. This removes all python packages.", - description: "The python environment is where ComfyUI installs python and python packages. It is used to run the ComfyUI server.", - confirmText: "Delete the .venv directory?", - usesTerminal: true, - isInstallationFix: true, - button: { - icon: PrimeIcons.FOLDER, - text: "Recreate" - } - } -]; -class MaintenanceTaskRunner { - static { - __name(this, "MaintenanceTaskRunner"); - } - constructor(task) { - this.task = task; - } - _state; - /** The current state of the task. Setter also controls {@link resolved} as a side-effect. */ - get state() { - return this._state; - } - /** Updates the task state and {@link resolved} status. */ - setState(value) { - if (this._state === "error" && value === "OK") this.resolved = true; - if (value === "error") this.resolved &&= false; - this._state = value; - } - /** `true` if the task has been resolved (was `error`, now `OK`). This is a side-effect of the {@link state} setter. */ - resolved; - /** Whether the task state is currently being refreshed. */ - refreshing; - /** Whether the task is currently running. */ - executing; - /** The error message that occurred when the task failed. */ - error; - update(update) { - const state = update[this.task.id]; - this.refreshing = state === void 0; - if (state) this.setState(state); - } - finaliseUpdate(update) { - this.refreshing = false; - this.setState(update[this.task.id] ?? "skipped"); - } - /** Wraps the execution of a maintenance task, updating state and rethrowing errors. */ - async execute(task) { - try { - this.executing = true; - const success = await task.execute(); - if (!success) return false; - this.error = void 0; - return true; - } catch (error) { - this.error = error?.message; - throw error; - } finally { - this.executing = false; - } - } -} -const useMaintenanceTaskStore = defineStore("maintenanceTask", () => { - const electron2 = electronAPI(); - const isRefreshing = ref(false); - const isRunningTerminalCommand = computed( - () => tasks.value.filter((task) => task.usesTerminal).some((task) => getRunner(task)?.executing) - ); - const isRunningInstallationFix = computed( - () => tasks.value.filter((task) => task.isInstallationFix).some((task) => getRunner(task)?.executing) - ); - const tasks = ref(DESKTOP_MAINTENANCE_TASKS); - const taskRunners = ref( - new Map( - DESKTOP_MAINTENANCE_TASKS.map((x) => [x.id, new MaintenanceTaskRunner(x)]) - ) - ); - const anyErrors = computed( - () => tasks.value.some((task) => getRunner(task).state === "error") - ); - const getRunner = /* @__PURE__ */ __name((task) => taskRunners.value.get(task.id), "getRunner"); - const processUpdate = /* @__PURE__ */ __name((validationUpdate) => { - const update = validationUpdate; - isRefreshing.value = true; - for (const task of tasks.value) { - getRunner(task).update(update); - } - if (!update.inProgress && isRefreshing.value) { - isRefreshing.value = false; - for (const task of tasks.value) { - getRunner(task).finaliseUpdate(update); - } - } - }, "processUpdate"); - const clearResolved = /* @__PURE__ */ __name(() => { - for (const task of tasks.value) { - getRunner(task).resolved &&= false; - } - }, "clearResolved"); - const refreshDesktopTasks = /* @__PURE__ */ __name(async () => { - isRefreshing.value = true; - console.log("Refreshing desktop tasks"); - await electron2.Validation.validateInstallation(processUpdate); - }, "refreshDesktopTasks"); - const execute = /* @__PURE__ */ __name(async (task) => { - return getRunner(task).execute(task); - }, "execute"); - return { - tasks, - isRefreshing, - isRunningTerminalCommand, - isRunningInstallationFix, - execute, - getRunner, - processUpdate, - clearResolved, - /** True if any tasks are in an error state. */ - anyErrors, - refreshDesktopTasks - }; -}); -function useMinLoadingDurationRef(value, minDuration = 250) { - const current = ref(value.value); - const { ready, start } = useTimeout(minDuration, { - controls: true, - immediate: false - }); - watch(value, (newValue) => { - if (newValue && !current.value) start(); - current.value = newValue; - }); - return computed(() => current.value || !ready.value); -} -__name(useMinLoadingDurationRef, "useMinLoadingDurationRef"); -const _hoisted_1$3 = { - key: 0, - class: "pi pi-exclamation-triangle text-red-500 absolute m-2 top-0 -right-14 opacity-15", - style: { "font-size": "10rem" } -}; -const _hoisted_2$3 = ["src"]; -const _hoisted_3$3 = { class: "flex gap-4 mt-1" }; -const _hoisted_4$3 = { - key: 0, - class: "task-card-ok pi pi-check" -}; -const _sfc_main$4 = /* @__PURE__ */ defineComponent({ - __name: "TaskCard", - props: { - task: {} - }, - emits: ["execute"], - setup(__props) { - const taskStore = useMaintenanceTaskStore(); - const runner = computed(() => taskStore.getRunner(props.task)); - const props = __props; - const description = computed( - () => runner.value.state === "error" ? props.task.errorDescription ?? props.task.shortDescription : props.task.shortDescription - ); - const reactiveLoading = computed(() => runner.value.refreshing); - const reactiveExecuting = computed(() => runner.value.executing); - const isLoading = useMinLoadingDurationRef(reactiveLoading, 250); - const isExecuting = useMinLoadingDurationRef(reactiveExecuting, 250); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("div", { - class: normalizeClass(["task-div max-w-48 min-h-52 grid relative", { "opacity-75": unref(isLoading) }]) - }, [ - createVNode(unref(script$3), mergeProps({ - class: ["max-w-48 relative h-full overflow-hidden", { "opacity-65": runner.value.state !== "error" }] - }, (({ onClick, ...rest }) => rest)(_ctx.$attrs)), { - header: withCtx(() => [ - runner.value.state === "error" ? (openBlock(), createElementBlock("i", _hoisted_1$3)) : createCommentVNode("", true), - _ctx.task.headerImg ? (openBlock(), createElementBlock("img", { - key: 1, - src: _ctx.task.headerImg, - class: "object-contain w-full h-full opacity-25 pt-4 px-4" - }, null, 8, _hoisted_2$3)) : createCommentVNode("", true) - ]), - title: withCtx(() => [ - createTextVNode(toDisplayString(_ctx.task.name), 1) - ]), - content: withCtx(() => [ - createTextVNode(toDisplayString(description.value), 1) - ]), - footer: withCtx(() => [ - createBaseVNode("div", _hoisted_3$3, [ - createVNode(unref(script$1), { - icon: _ctx.task.button?.icon, - label: _ctx.task.button?.text, - class: "w-full", - raised: "", - "icon-pos": "right", - onClick: _cache[0] || (_cache[0] = (event) => _ctx.$emit("execute", event)), - loading: unref(isExecuting) - }, null, 8, ["icon", "label", "loading"]) - ]) - ]), - _: 1 - }, 16, ["class"]), - !unref(isLoading) && runner.value.state === "OK" ? (openBlock(), createElementBlock("i", _hoisted_4$3)) : createCommentVNode("", true) - ], 2); - }; - } -}); -const TaskCard = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-c3bd7658"]]); -const _sfc_main$3 = /* @__PURE__ */ defineComponent({ - __name: "TaskListStatusIcon", - props: { - state: {}, - loading: {} - }, - setup(__props) { - const tooltip = computed(() => { - if (props.state === "error") { - return t("g.error"); - } else if (props.state === "OK") { - return t("maintenance.OK"); - } else { - return t("maintenance.Skipped"); - } - }); - const cssClasses = computed(() => { - let classes; - if (props.state === "error") { - classes = `${PrimeIcons.EXCLAMATION_TRIANGLE} text-red-500`; - } else if (props.state === "OK") { - classes = `${PrimeIcons.CHECK} text-green-500`; - } else { - classes = PrimeIcons.MINUS; - } - return `text-3xl pi ${classes}`; - }); - const props = __props; - return (_ctx, _cache) => { - const _directive_tooltip = resolveDirective("tooltip"); - return !_ctx.state || _ctx.loading ? (openBlock(), createBlock(unref(script), { - key: 0, - class: "h-8 w-8" - })) : withDirectives((openBlock(), createElementBlock("i", { - key: 1, - class: normalizeClass(cssClasses.value) - }, null, 2)), [ - [ - _directive_tooltip, - { value: tooltip.value, showDelay: 250 }, - void 0, - { top: true } - ] - ]); - }; - } -}); -const _hoisted_1$2 = { class: "text-center w-16" }; -const _hoisted_2$2 = { class: "inline-block" }; -const _hoisted_3$2 = { class: "whitespace-pre-line" }; -const _hoisted_4$2 = { class: "text-right px-4" }; -const _sfc_main$2 = /* @__PURE__ */ defineComponent({ - __name: "TaskListItem", - props: { - task: {} - }, - emits: ["execute"], - setup(__props) { - const taskStore = useMaintenanceTaskStore(); - const runner = computed(() => taskStore.getRunner(props.task)); - const props = __props; - const severity = computed( - () => runner.value.state === "error" || runner.value.state === "warning" ? "primary" : "secondary" - ); - const reactiveLoading = computed(() => runner.value.refreshing); - const reactiveExecuting = computed(() => runner.value.executing); - const isLoading = useMinLoadingDurationRef(reactiveLoading, 250); - const isExecuting = useMinLoadingDurationRef(reactiveExecuting, 250); - const infoPopover = ref(); - const toggle = /* @__PURE__ */ __name((event) => { - infoPopover.value.toggle(event); - }, "toggle"); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("tr", { - class: normalizeClass(["border-neutral-700 border-solid border-y", { - "opacity-50": runner.value.resolved, - "opacity-75": unref(isLoading) && runner.value.resolved - }]) - }, [ - createBaseVNode("td", _hoisted_1$2, [ - createVNode(_sfc_main$3, { - state: runner.value.state, - loading: unref(isLoading) - }, null, 8, ["state", "loading"]) - ]), - createBaseVNode("td", null, [ - createBaseVNode("p", _hoisted_2$2, toDisplayString(_ctx.task.name), 1), - createVNode(unref(script$1), { - class: "inline-block mx-2", - type: "button", - icon: unref(PrimeIcons).INFO_CIRCLE, - severity: "secondary", - text: true, - onClick: toggle - }, null, 8, ["icon"]), - createVNode(unref(script$4), { - ref_key: "infoPopover", - ref: infoPopover, - class: "block m-1 max-w-64 min-w-32" - }, { - default: withCtx(() => [ - createBaseVNode("span", _hoisted_3$2, toDisplayString(_ctx.task.description), 1) - ]), - _: 1 - }, 512) - ]), - createBaseVNode("td", _hoisted_4$2, [ - createVNode(unref(script$1), { - icon: _ctx.task.button?.icon, - label: _ctx.task.button?.text, - severity: severity.value, - "icon-pos": "right", - onClick: _cache[0] || (_cache[0] = (event) => _ctx.$emit("execute", event)), - loading: unref(isExecuting) - }, null, 8, ["icon", "label", "severity", "loading"]) - ]) - ], 2); - }; - } -}); -const _hoisted_1$1 = { class: "my-4" }; -const _hoisted_2$1 = { class: "text-neutral-400 w-full text-center" }; -const _hoisted_3$1 = { - key: 0, - class: "w-full border-collapse border-hidden" -}; -const _hoisted_4$1 = { - key: 1, - class: "flex flex-wrap justify-evenly gap-8 pad-y my-4" -}; -const _sfc_main$1 = /* @__PURE__ */ defineComponent({ - __name: "TaskListPanel", - props: { - displayAsList: {}, - filter: {}, - isRefreshing: { type: Boolean } - }, - setup(__props) { - const toast = useToast(); - const confirm = useConfirm(); - const taskStore = useMaintenanceTaskStore(); - const props = __props; - const executeTask = /* @__PURE__ */ __name(async (task) => { - let message; - try { - if (await taskStore.execute(task) === true) return; - message = t("maintenance.error.taskFailed"); - } catch (error) { - message = error?.message; - } - toast.add({ - severity: "error", - summary: t("maintenance.error.toastTitle"), - detail: message ?? t("maintenance.error.defaultDescription"), - life: 1e4 - }); - }, "executeTask"); - const confirmButton = /* @__PURE__ */ __name(async (event, task) => { - if (!task.requireConfirm) { - await executeTask(task); - return; - } - confirm.require({ - target: event.currentTarget, - message: task.confirmText ?? t("maintenance.confirmTitle"), - icon: "pi pi-exclamation-circle", - rejectProps: { - label: t("g.cancel"), - severity: "secondary", - outlined: true - }, - acceptProps: { - label: task.button?.text ?? t("g.save"), - severity: task.severity ?? "primary" - }, - // TODO: Not awaited. - accept: /* @__PURE__ */ __name(async () => { - await executeTask(task); - }, "accept") - }); - }, "confirmButton"); - return (_ctx, _cache) => { - return openBlock(), createElementBlock("section", _hoisted_1$1, [ - _ctx.filter.tasks.length === 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ - createVNode(unref(script$5)), - createBaseVNode("p", _hoisted_2$1, toDisplayString(_ctx.$t("maintenance.allOk")), 1) - ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [ - _ctx.displayAsList === unref(PrimeIcons).LIST ? (openBlock(), createElementBlock("table", _hoisted_3$1, [ - (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filter.tasks, (task) => { - return openBlock(), createBlock(_sfc_main$2, { - key: task.id, - task, - onExecute: /* @__PURE__ */ __name((event) => confirmButton(event, task), "onExecute") - }, null, 8, ["task", "onExecute"]); - }), 128)) - ])) : (openBlock(), createElementBlock("div", _hoisted_4$1, [ - (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filter.tasks, (task) => { - return openBlock(), createBlock(TaskCard, { - key: task.id, - task, - onExecute: /* @__PURE__ */ __name((event) => confirmButton(event, task), "onExecute") - }, null, 8, ["task", "onExecute"]); - }), 128)) - ])) - ], 64)), - createVNode(unref(script$6)) - ]); - }; - } -}); -const _hoisted_1 = { class: "min-w-full min-h-full font-sans w-screen h-screen grid justify-around text-neutral-300 bg-neutral-900 dark-theme overflow-y-auto" }; -const _hoisted_2 = { class: "max-w-screen-sm w-screen m-8 relative" }; -const _hoisted_3 = { class: "backspan pi-wrench text-4xl font-bold" }; -const _hoisted_4 = { class: "w-full flex flex-wrap gap-4 items-center" }; -const _hoisted_5 = { class: "grow" }; -const _hoisted_6 = { class: "flex gap-4 items-center" }; -const _hoisted_7 = { class: "max-sm:hidden" }; -const _hoisted_8 = { class: "flex justify-between gap-4 flex-row" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "MaintenanceView", - setup(__props) { - const electron2 = electronAPI(); - const toast = useToast(); - const taskStore = useMaintenanceTaskStore(); - const { clearResolved, processUpdate, refreshDesktopTasks } = taskStore; - const terminalVisible = ref(false); - const reactiveIsRefreshing = computed(() => taskStore.isRefreshing); - const isRefreshing = useMinLoadingDurationRef(reactiveIsRefreshing, 250); - const anyErrors = computed(() => taskStore.anyErrors); - const displayAsList = ref(PrimeIcons.TH_LARGE); - const errorFilter = computed( - () => taskStore.tasks.filter((x) => { - const { state, resolved } = taskStore.getRunner(x); - return state === "error" || resolved; - }) - ); - const filterOptions = ref([ - { icon: PrimeIcons.FILTER_FILL, value: "All", tasks: taskStore.tasks }, - { icon: PrimeIcons.EXCLAMATION_TRIANGLE, value: "Errors", tasks: errorFilter } - ]); - const filter = ref(filterOptions.value[0]); - const completeValidation = /* @__PURE__ */ __name(async () => { - const isValid = await electron2.Validation.complete(); - if (!isValid) { - toast.add({ - severity: "error", - summary: t("g.error"), - detail: t("maintenance.error.cannotContinue"), - life: 5e3 - }); - } - }, "completeValidation"); - const toggleConsoleDrawer = /* @__PURE__ */ __name(() => { - terminalVisible.value = !terminalVisible.value; - }, "toggleConsoleDrawer"); - watch( - () => taskStore.isRunningTerminalCommand, - (value) => { - terminalVisible.value = value; - } - ); - onMounted(async () => { - electron2.Validation.onUpdate(processUpdate); - const update = await electron2.Validation.getStatus(); - if (Object.values(update).some((x) => x === "error")) { - filter.value = filterOptions.value[1]; - } - processUpdate(update); - }); - onUnmounted(() => electron2.Validation.dispose()); - return (_ctx, _cache) => { - return openBlock(), createBlock(_sfc_main$8, { dark: "" }, { - default: withCtx(() => [ - createBaseVNode("div", _hoisted_1, [ - createBaseVNode("div", _hoisted_2, [ - createBaseVNode("h1", _hoisted_3, toDisplayString(unref(t)("maintenance.title")), 1), - createBaseVNode("div", _hoisted_4, [ - createBaseVNode("span", _hoisted_5, [ - createTextVNode(toDisplayString(unref(t)("maintenance.status")) + ": ", 1), - createVNode(_sfc_main$5, { - refreshing: unref(isRefreshing), - error: anyErrors.value - }, null, 8, ["refreshing", "error"]) - ]), - createBaseVNode("div", _hoisted_6, [ - createVNode(unref(script$7), { - modelValue: displayAsList.value, - "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => displayAsList.value = $event), - options: [unref(PrimeIcons).LIST, unref(PrimeIcons).TH_LARGE], - "allow-empty": false - }, { - option: withCtx((opts) => [ - createBaseVNode("i", { - class: normalizeClass(opts.option) - }, null, 2) - ]), - _: 1 - }, 8, ["modelValue", "options"]), - createVNode(unref(script$7), { - modelValue: filter.value, - "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => filter.value = $event), - options: filterOptions.value, - "allow-empty": false, - optionLabel: "value", - dataKey: "value", - "area-labelledby": "custom", - onChange: unref(clearResolved) - }, { - option: withCtx((opts) => [ - createBaseVNode("i", { - class: normalizeClass(opts.option.icon) - }, null, 2), - createBaseVNode("span", _hoisted_7, toDisplayString(opts.option.value), 1) - ]), - _: 1 - }, 8, ["modelValue", "options", "onChange"]), - createVNode(_sfc_main$6, { - modelValue: unref(isRefreshing), - "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(isRefreshing) ? isRefreshing.value = $event : null), - severity: "secondary", - onRefresh: unref(refreshDesktopTasks) - }, null, 8, ["modelValue", "onRefresh"]) - ]) - ]), - createVNode(_sfc_main$1, { - class: "border-neutral-700 border-solid border-x-0 border-y", - filter: filter.value, - displayAsList: displayAsList.value, - isRefreshing: unref(isRefreshing) - }, null, 8, ["filter", "displayAsList", "isRefreshing"]), - createBaseVNode("div", _hoisted_8, [ - createVNode(unref(script$1), { - label: unref(t)("maintenance.consoleLogs"), - icon: "pi pi-desktop", - "icon-pos": "left", - severity: "secondary", - onClick: toggleConsoleDrawer - }, null, 8, ["label"]), - createVNode(unref(script$1), { - label: unref(t)("g.continue"), - icon: "pi pi-arrow-right", - "icon-pos": "left", - severity: anyErrors.value ? "secondary" : "primary", - onClick: _cache[3] || (_cache[3] = () => completeValidation()), - loading: unref(isRefreshing) - }, null, 8, ["label", "severity", "loading"]) - ]) - ]), - createVNode(_sfc_main$7, { - modelValue: terminalVisible.value, - "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => terminalVisible.value = $event), - header: unref(t)("g.terminal"), - "default-message": unref(t)("maintenance.terminalDefaultMessage") - }, null, 8, ["modelValue", "header", "default-message"]), - createVNode(unref(script$8)) - ]) - ]), - _: 1 - }); - }; - } -}); -const MaintenanceView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1073ace1"]]); -export { - MaintenanceView as default -}; -//# sourceMappingURL=MaintenanceView-BFp9KqAr.js.map diff --git a/comfy/web/assets/MaintenanceView-BFp9KqAr.js.map b/comfy/web/assets/MaintenanceView-BFp9KqAr.js.map deleted file mode 100644 index 1a9e099eb..000000000 --- a/comfy/web/assets/MaintenanceView-BFp9KqAr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MaintenanceView-BFp9KqAr.js","sources":["../../src/components/common/RefreshButton.vue","../../src/components/maintenance/StatusTag.vue","../../src/constants/desktopMaintenanceTasks.ts","../../src/stores/maintenanceTaskStore.ts","../../src/utils/refUtil.ts","../../src/components/maintenance/TaskCard.vue","../../src/components/maintenance/TaskListStatusIcon.vue","../../src/components/maintenance/TaskListItem.vue","../../src/components/maintenance/TaskListPanel.vue","../../src/views/MaintenanceView.vue"],"sourcesContent":["\n\n\n\n","\n\n\n","import { PrimeIcons } from '@primevue/core'\n\nimport type { MaintenanceTask } from '@/types/desktop/maintenanceTypes'\nimport { electronAPI } from '@/utils/envUtil'\n\nconst electron = electronAPI()\n\nconst openUrl = (url: string) => {\n window.open(url, '_blank')\n return true\n}\n\nexport const DESKTOP_MAINTENANCE_TASKS: Readonly[] = [\n {\n id: 'basePath',\n execute: async () => await electron.setBasePath(),\n name: 'Base path',\n shortDescription: 'Change the application base path.',\n errorDescription: 'Unable to open the base path. Please select a new one.',\n description:\n 'The base path is the default location where ComfyUI stores data. It is the location fo the python environment, and may also contain models, custom nodes, and other extensions.',\n isInstallationFix: true,\n button: {\n icon: PrimeIcons.QUESTION,\n text: 'Select'\n }\n },\n {\n id: 'git',\n headerImg: 'assets/images/Git-Logo-White.svg',\n execute: () => openUrl('https://git-scm.com/downloads/'),\n name: 'Download git',\n shortDescription: 'Open the git download page.',\n errorDescription:\n 'Git is missing. Please download and install git, then restart ComfyUI Desktop.',\n description:\n 'Git is required to download and manage custom nodes and other extensions. This task opens the download page in your default browser, where you can download the latest version of git. Once you have installed git, please restart ComfyUI Desktop.',\n button: {\n icon: PrimeIcons.EXTERNAL_LINK,\n text: 'Download'\n }\n },\n {\n id: 'vcRedist',\n execute: () => openUrl('https://aka.ms/vs/17/release/vc_redist.x64.exe'),\n name: 'Download VC++ Redist',\n shortDescription: 'Download the latest VC++ Redistributable runtime.',\n description:\n 'The Visual C++ runtime libraries are required to run ComfyUI. You will need to download and install this file.',\n button: {\n icon: PrimeIcons.EXTERNAL_LINK,\n text: 'Download'\n }\n },\n {\n id: 'reinstall',\n severity: 'danger',\n requireConfirm: true,\n execute: async () => {\n await electron.reinstall()\n return true\n },\n name: 'Reinstall ComfyUI',\n shortDescription:\n 'Deletes the desktop app config and load the welcome screen.',\n description:\n 'Delete the desktop app config, restart the app, and load the installation screen.',\n confirmText: 'Delete all saved config and reinstall?',\n button: {\n icon: PrimeIcons.EXCLAMATION_TRIANGLE,\n text: 'Reinstall'\n }\n },\n {\n id: 'pythonPackages',\n requireConfirm: true,\n execute: async () => {\n try {\n await electron.uv.installRequirements()\n return true\n } catch (error) {\n return false\n }\n },\n name: 'Install python packages',\n shortDescription:\n 'Installs the base python packages required to run ComfyUI.',\n errorDescription:\n 'Python packages that are required to run ComfyUI are not installed.',\n description:\n 'This will install the python packages required to run ComfyUI. This includes torch, torchvision, and other dependencies.',\n usesTerminal: true,\n isInstallationFix: true,\n button: {\n icon: PrimeIcons.DOWNLOAD,\n text: 'Install'\n }\n },\n {\n id: 'uv',\n execute: () =>\n openUrl('https://docs.astral.sh/uv/getting-started/installation/'),\n name: 'uv executable',\n shortDescription: 'uv installs and maintains the python environment.',\n description:\n \"This will open the download page for Astral's uv tool. uv is used to install python and manage python packages.\",\n button: {\n icon: 'pi pi-asterisk',\n text: 'Download'\n }\n },\n {\n id: 'uvCache',\n severity: 'danger',\n requireConfirm: true,\n execute: async () => await electron.uv.clearCache(),\n name: 'uv cache',\n shortDescription: 'Remove the Astral uv cache of python packages.',\n description:\n 'This will remove the uv cache directory and its contents. All downloaded python packages will need to be downloaded again.',\n confirmText: 'Delete uv cache of python packages?',\n usesTerminal: true,\n isInstallationFix: true,\n button: {\n icon: PrimeIcons.TRASH,\n text: 'Clear cache'\n }\n },\n {\n id: 'venvDirectory',\n severity: 'danger',\n requireConfirm: true,\n execute: async () => await electron.uv.resetVenv(),\n name: 'Reset virtual environment',\n shortDescription:\n 'Remove and recreate the .venv directory. This removes all python packages.',\n description:\n 'The python environment is where ComfyUI installs python and python packages. It is used to run the ComfyUI server.',\n confirmText: 'Delete the .venv directory?',\n usesTerminal: true,\n isInstallationFix: true,\n button: {\n icon: PrimeIcons.FOLDER,\n text: 'Recreate'\n }\n }\n] as const\n","import type { InstallValidation } from '@comfyorg/comfyui-electron-types'\nimport { defineStore } from 'pinia'\nimport { computed, ref } from 'vue'\n\nimport { DESKTOP_MAINTENANCE_TASKS } from '@/constants/desktopMaintenanceTasks'\nimport type { MaintenanceTask } from '@/types/desktop/maintenanceTypes'\nimport { electronAPI } from '@/utils/envUtil'\n\n/** State of a maintenance task, managed by the maintenance task store. */\ntype MaintenanceTaskState = 'warning' | 'error' | 'OK' | 'skipped'\n\n// Type not exported by API\ntype ValidationState = InstallValidation['basePath']\n// Add index to API type\ntype IndexedUpdate = InstallValidation & Record\n\n/** State of a maintenance task, managed by the maintenance task store. */\nexport class MaintenanceTaskRunner {\n constructor(readonly task: MaintenanceTask) {}\n\n private _state?: MaintenanceTaskState\n /** The current state of the task. Setter also controls {@link resolved} as a side-effect. */\n get state() {\n return this._state\n }\n\n /** Updates the task state and {@link resolved} status. */\n setState(value: MaintenanceTaskState) {\n // Mark resolved\n if (this._state === 'error' && value === 'OK') this.resolved = true\n // Mark unresolved (if previously resolved)\n if (value === 'error') this.resolved &&= false\n\n this._state = value\n }\n\n /** `true` if the task has been resolved (was `error`, now `OK`). This is a side-effect of the {@link state} setter. */\n resolved?: boolean\n\n /** Whether the task state is currently being refreshed. */\n refreshing?: boolean\n /** Whether the task is currently running. */\n executing?: boolean\n /** The error message that occurred when the task failed. */\n error?: string\n\n update(update: IndexedUpdate) {\n const state = update[this.task.id]\n\n this.refreshing = state === undefined\n if (state) this.setState(state)\n }\n\n finaliseUpdate(update: IndexedUpdate) {\n this.refreshing = false\n this.setState(update[this.task.id] ?? 'skipped')\n }\n\n /** Wraps the execution of a maintenance task, updating state and rethrowing errors. */\n async execute(task: MaintenanceTask) {\n try {\n this.executing = true\n const success = await task.execute()\n if (!success) return false\n\n this.error = undefined\n return true\n } catch (error) {\n this.error = (error as Error)?.message\n throw error\n } finally {\n this.executing = false\n }\n }\n}\n\n/**\n * User-initiated maintenance tasks. Currently only used by the desktop app maintenance view.\n *\n * Includes running state, task list, and execution / refresh logic.\n * @returns The maintenance task store\n */\nexport const useMaintenanceTaskStore = defineStore('maintenanceTask', () => {\n /** Refresh should run for at least this long, even if it completes much faster. Ensures refresh feels like it is doing something. */\n const electron = electronAPI()\n\n // Reactive state\n const isRefreshing = ref(false)\n const isRunningTerminalCommand = computed(() =>\n tasks.value\n .filter((task) => task.usesTerminal)\n .some((task) => getRunner(task)?.executing)\n )\n const isRunningInstallationFix = computed(() =>\n tasks.value\n .filter((task) => task.isInstallationFix)\n .some((task) => getRunner(task)?.executing)\n )\n\n // Task list\n const tasks = ref(DESKTOP_MAINTENANCE_TASKS)\n\n const taskRunners = ref(\n new Map(\n DESKTOP_MAINTENANCE_TASKS.map((x) => [x.id, new MaintenanceTaskRunner(x)])\n )\n )\n\n /** True if any tasks are in an error state. */\n const anyErrors = computed(() =>\n tasks.value.some((task) => getRunner(task).state === 'error')\n )\n\n /**\n * Returns the matching state object for a task.\n * @param task Task to get the matching state object for\n * @returns The state object for this task\n */\n const getRunner = (task: MaintenanceTask) => taskRunners.value.get(task.id)!\n\n /**\n * Updates the task list with the latest validation state.\n * @param validationUpdate Update details passed in by electron\n */\n const processUpdate = (validationUpdate: InstallValidation) => {\n const update = validationUpdate as IndexedUpdate\n isRefreshing.value = true\n\n // Update each task state\n for (const task of tasks.value) {\n getRunner(task).update(update)\n }\n\n // Final update\n if (!update.inProgress && isRefreshing.value) {\n isRefreshing.value = false\n\n for (const task of tasks.value) {\n getRunner(task).finaliseUpdate(update)\n }\n }\n }\n\n /** Clears the resolved status of tasks (when changing filters) */\n const clearResolved = () => {\n for (const task of tasks.value) {\n getRunner(task).resolved &&= false\n }\n }\n\n /** @todo Refreshes Electron tasks only. */\n const refreshDesktopTasks = async () => {\n isRefreshing.value = true\n console.log('Refreshing desktop tasks')\n await electron.Validation.validateInstallation(processUpdate)\n }\n\n const execute = async (task: MaintenanceTask) => {\n return getRunner(task).execute(task)\n }\n\n return {\n tasks,\n isRefreshing,\n isRunningTerminalCommand,\n isRunningInstallationFix,\n execute,\n getRunner,\n processUpdate,\n clearResolved,\n /** True if any tasks are in an error state. */\n anyErrors,\n refreshDesktopTasks\n }\n})\n","import { useTimeout } from '@vueuse/core'\nimport { type Ref, computed, ref, watch } from 'vue'\n\n/**\n * Vue boolean ref (writable computed) with one difference: when set to `true` it stays that way for at least {@link minDuration}.\n * If set to `false` before {@link minDuration} has passed, it uses a timer to delay the change.\n * @param value The default value to set on this ref\n * @param minDuration The minimum time that this ref must be `true` for\n * @returns A custom boolean vue ref with a minimum activation time\n */\nexport function useMinLoadingDurationRef(\n value: Ref,\n minDuration = 250\n) {\n const current = ref(value.value)\n\n const { ready, start } = useTimeout(minDuration, {\n controls: true,\n immediate: false\n })\n\n watch(value, (newValue) => {\n if (newValue && !current.value) start()\n\n current.value = newValue\n })\n\n return computed(() => current.value || !ready.value)\n}\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n"],"names":["_useModel","electron"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0CA,UAAM,QAAQ;AAMR,UAAA,SAASA,SAAuC,SAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpCtD,UAAM,QAAQ;AAMR,UAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/MaintenanceView-DSwnnc8G.css b/comfy/web/assets/MaintenanceView-DSwnnc8G.css deleted file mode 100644 index 3a076aa93..000000000 --- a/comfy/web/assets/MaintenanceView-DSwnnc8G.css +++ /dev/null @@ -1,87 +0,0 @@ - -.task-card-ok[data-v-c3bd7658] { - - position: absolute; - - right: -1rem; - - bottom: -1rem; - - grid-column: 1 / -1; - - grid-row: 1 / -1; - - --tw-text-opacity: 1; - - color: rgb(150 206 76 / var(--tw-text-opacity, 1)); - - opacity: 1; - - transition-property: opacity; - - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - - transition-duration: 150ms; - - font-size: 4rem; - text-shadow: 0.25rem 0 0.5rem black; - z-index: 10; -} -.p-card { -&[data-v-c3bd7658] { - - transition-property: opacity; - - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - - transition-duration: 150ms; - - --p-card-background: var(--p-button-secondary-background); - opacity: 0.9; - } -&.opacity-65[data-v-c3bd7658] { - opacity: 0.4; -} -&[data-v-c3bd7658]:hover { - opacity: 1; -} -} -[data-v-c3bd7658] .p-card-header { - z-index: 0; -} -[data-v-c3bd7658] .p-card-body { - z-index: 1; - flex-grow: 1; - justify-content: space-between; -} -.task-div { -> i[data-v-c3bd7658] { - pointer-events: none; -} -&:hover > i[data-v-c3bd7658] { - opacity: 0.2; -} -} - -[data-v-1073ace1] .p-tag { - --p-tag-gap: 0.375rem; -} -.backspan[data-v-1073ace1]::before { - position: absolute; - margin: 0px; - color: var(--p-text-muted-color); - font-family: 'primeicons'; - top: -2rem; - right: -2rem; - speak: none; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - display: inline-block; - -webkit-font-smoothing: antialiased; - opacity: 0.02; - font-size: min(14rem, 90vw); - z-index: 0; -} diff --git a/comfy/web/assets/ManualConfigurationView-Cq3hPfap.css b/comfy/web/assets/ManualConfigurationView-Cq3hPfap.css deleted file mode 100644 index dba81a0bb..000000000 --- a/comfy/web/assets/ManualConfigurationView-Cq3hPfap.css +++ /dev/null @@ -1,7 +0,0 @@ - -.p-tag[data-v-dc169863] { - --p-tag-gap: 0.5rem; -} -.comfy-installer[data-v-dc169863] { - margin-top: max(1rem, max(0px, calc((100vh - 42rem) * 0.5))); -} diff --git a/comfy/web/assets/ManualConfigurationView-hsnBcOeR.js b/comfy/web/assets/ManualConfigurationView-hsnBcOeR.js deleted file mode 100644 index 778182755..000000000 --- a/comfy/web/assets/ManualConfigurationView-hsnBcOeR.js +++ /dev/null @@ -1,74 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { d as defineComponent, I as useI18n, T as ref, p as onMounted, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, k as createVNode, j as unref, ah as script, a8 as script$1, l as script$2, bi as electronAPI, _ as _export_sfc } from "./index-DIgj6hpb.js"; -import { _ as _sfc_main$1 } from "./BaseViewTemplate-DaGOaycP.js"; -const _hoisted_1 = { class: "comfy-installer grow flex flex-col gap-4 text-neutral-300 max-w-110" }; -const _hoisted_2 = { class: "text-2xl font-semibold text-neutral-100" }; -const _hoisted_3 = { class: "m-1 text-neutral-300" }; -const _hoisted_4 = { class: "ml-2" }; -const _hoisted_5 = { class: "m-1 mb-4" }; -const _hoisted_6 = { class: "m-0" }; -const _hoisted_7 = { class: "m-1" }; -const _hoisted_8 = { class: "font-mono" }; -const _hoisted_9 = { class: "m-1" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "ManualConfigurationView", - setup(__props) { - const { t } = useI18n(); - const electron = electronAPI(); - const basePath = ref(null); - const sep = ref("/"); - const restartApp = /* @__PURE__ */ __name((message) => electron.restartApp(message), "restartApp"); - onMounted(async () => { - basePath.value = await electron.getBasePath(); - if (basePath.value.indexOf("/") === -1) sep.value = "\\"; - }); - return (_ctx, _cache) => { - return openBlock(), createBlock(_sfc_main$1, { dark: "" }, { - default: withCtx(() => [ - createBaseVNode("div", _hoisted_1, [ - createBaseVNode("h2", _hoisted_2, toDisplayString(_ctx.$t("install.manualConfiguration.title")), 1), - createBaseVNode("p", _hoisted_3, [ - createVNode(unref(script), { - icon: "pi pi-exclamation-triangle", - severity: "warn", - value: unref(t)("icon.exclamation-triangle") - }, null, 8, ["value"]), - createBaseVNode("strong", _hoisted_4, toDisplayString(_ctx.$t("install.gpuSelection.customComfyNeedsPython")), 1) - ]), - createBaseVNode("div", null, [ - createBaseVNode("p", _hoisted_5, toDisplayString(_ctx.$t("install.manualConfiguration.requirements")) + ": ", 1), - createBaseVNode("ul", _hoisted_6, [ - createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customManualVenv")), 1), - createBaseVNode("li", null, toDisplayString(_ctx.$t("install.gpuSelection.customInstallRequirements")), 1) - ]) - ]), - createBaseVNode("p", _hoisted_7, toDisplayString(_ctx.$t("install.manualConfiguration.createVenv")) + ":", 1), - createVNode(unref(script$1), { - header: unref(t)("install.manualConfiguration.virtualEnvironmentPath") - }, { - default: withCtx(() => [ - createBaseVNode("span", _hoisted_8, toDisplayString(`${basePath.value}${sep.value}.venv${sep.value}`), 1) - ]), - _: 1 - }, 8, ["header"]), - createBaseVNode("p", _hoisted_9, toDisplayString(_ctx.$t("install.manualConfiguration.restartWhenFinished")), 1), - createVNode(unref(script$2), { - class: "place-self-end", - label: unref(t)("menuLabels.Restart"), - severity: "warn", - icon: "pi pi-refresh", - onClick: _cache[0] || (_cache[0] = ($event) => restartApp("Manual configuration complete")) - }, null, 8, ["label"]) - ]) - ]), - _: 1 - }); - }; - } -}); -const ManualConfigurationView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dc169863"]]); -export { - ManualConfigurationView as default -}; -//# sourceMappingURL=ManualConfigurationView-hsnBcOeR.js.map diff --git a/comfy/web/assets/ManualConfigurationView-hsnBcOeR.js.map b/comfy/web/assets/ManualConfigurationView-hsnBcOeR.js.map deleted file mode 100644 index a1d53e1b4..000000000 --- a/comfy/web/assets/ManualConfigurationView-hsnBcOeR.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ManualConfigurationView-hsnBcOeR.js","sources":["../../src/views/ManualConfigurationView.vue"],"sourcesContent":["\n\n\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA8DM,UAAA,EAAE,EAAE,IAAI,QAAQ;AAEtB,UAAM,WAAW,YAAY;AAEvB,UAAA,WAAW,IAAY,IAAI;AAC3B,UAAA,MAAM,IAAgB,GAAG;AAE/B,UAAM,aAAa,wBAAC,YAAqB,SAAS,WAAW,OAAO,GAAjD;AAEnB,cAAU,YAAY;AACX,eAAA,QAAQ,MAAM,SAAS,YAAY;AAC5C,UAAI,SAAS,MAAM,QAAQ,GAAG,MAAM,QAAQ,QAAQ;AAAA,IAAA,CACrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/MetricsConsentView-CVHnHa_u.js b/comfy/web/assets/MetricsConsentView-CVHnHa_u.js deleted file mode 100644 index 324988657..000000000 --- a/comfy/web/assets/MetricsConsentView-CVHnHa_u.js +++ /dev/null @@ -1,86 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { _ as _sfc_main$1 } from "./BaseViewTemplate-DaGOaycP.js"; -import { d as defineComponent, b3 as useToast, I as useI18n, T as ref, br as useRouter, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, ak as createTextVNode, k as createVNode, j as unref, bA as script, l as script$1, bi as electronAPI } from "./index-DIgj6hpb.js"; -const _hoisted_1 = { class: "h-full p-8 2xl:p-16 flex flex-col items-center justify-center" }; -const _hoisted_2 = { class: "bg-neutral-800 rounded-lg shadow-lg p-6 w-full max-w-[600px] flex flex-col gap-6" }; -const _hoisted_3 = { class: "text-3xl font-semibold text-neutral-100" }; -const _hoisted_4 = { class: "text-neutral-400" }; -const _hoisted_5 = { class: "text-neutral-400" }; -const _hoisted_6 = { - href: "https://comfy.org/privacy", - target: "_blank", - class: "text-blue-400 hover:text-blue-300 underline" -}; -const _hoisted_7 = { class: "flex items-center gap-4" }; -const _hoisted_8 = { - id: "metricsDescription", - class: "text-neutral-100" -}; -const _hoisted_9 = { class: "flex pt-6 justify-end" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "MetricsConsentView", - setup(__props) { - const toast = useToast(); - const { t } = useI18n(); - const allowMetrics = ref(true); - const router = useRouter(); - const isUpdating = ref(false); - const updateConsent = /* @__PURE__ */ __name(async () => { - isUpdating.value = true; - try { - await electronAPI().setMetricsConsent(allowMetrics.value); - } catch (error) { - toast.add({ - severity: "error", - summary: t("install.errorUpdatingConsent"), - detail: t("install.errorUpdatingConsentDetail"), - life: 3e3 - }); - } finally { - isUpdating.value = false; - } - router.push("/"); - }, "updateConsent"); - return (_ctx, _cache) => { - const _component_BaseViewTemplate = _sfc_main$1; - return openBlock(), createBlock(_component_BaseViewTemplate, { dark: "" }, { - default: withCtx(() => [ - createBaseVNode("div", _hoisted_1, [ - createBaseVNode("div", _hoisted_2, [ - createBaseVNode("h2", _hoisted_3, toDisplayString(_ctx.$t("install.helpImprove")), 1), - createBaseVNode("p", _hoisted_4, toDisplayString(_ctx.$t("install.updateConsent")), 1), - createBaseVNode("p", _hoisted_5, [ - createTextVNode(toDisplayString(_ctx.$t("install.moreInfo")) + " ", 1), - createBaseVNode("a", _hoisted_6, toDisplayString(_ctx.$t("install.privacyPolicy")), 1), - _cache[1] || (_cache[1] = createTextVNode(". ")) - ]), - createBaseVNode("div", _hoisted_7, [ - createVNode(unref(script), { - modelValue: allowMetrics.value, - "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => allowMetrics.value = $event), - "aria-describedby": "metricsDescription" - }, null, 8, ["modelValue"]), - createBaseVNode("span", _hoisted_8, toDisplayString(allowMetrics.value ? _ctx.$t("install.metricsEnabled") : _ctx.$t("install.metricsDisabled")), 1) - ]), - createBaseVNode("div", _hoisted_9, [ - createVNode(unref(script$1), { - label: _ctx.$t("g.ok"), - icon: "pi pi-check", - loading: isUpdating.value, - iconPos: "right", - onClick: updateConsent - }, null, 8, ["label", "loading"]) - ]) - ]) - ]) - ]), - _: 1 - }); - }; - } -}); -export { - _sfc_main as default -}; -//# sourceMappingURL=MetricsConsentView-CVHnHa_u.js.map diff --git a/comfy/web/assets/MetricsConsentView-CVHnHa_u.js.map b/comfy/web/assets/MetricsConsentView-CVHnHa_u.js.map deleted file mode 100644 index b047e422b..000000000 --- a/comfy/web/assets/MetricsConsentView-CVHnHa_u.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MetricsConsentView-CVHnHa_u.js","sources":["../../src/views/MetricsConsentView.vue"],"sourcesContent":["\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA2DA,UAAM,QAAQ,SAAS;AACjB,UAAA,EAAE,EAAE,IAAI,QAAQ;AAEhB,UAAA,eAAe,IAAI,IAAI;AAC7B,UAAM,SAAS,UAAU;AACnB,UAAA,aAAa,IAAI,KAAK;AAE5B,UAAM,gBAAgB,mCAAY;AAChC,iBAAW,QAAQ;AACf,UAAA;AACF,cAAM,YAAY,EAAE,kBAAkB,aAAa,KAAK;AAAA,eACjD,OAAO;AACd,cAAM,IAAI;AAAA,UACR,UAAU;AAAA,UACV,SAAS,EAAE,8BAA8B;AAAA,UACzC,QAAQ,EAAE,oCAAoC;AAAA,UAC9C,MAAM;AAAA,QAAA,CACP;AAAA,MAAA,UACD;AACA,mBAAW,QAAQ;AAAA,MAAA;AAErB,aAAO,KAAK,GAAG;AAAA,IACjB,GAfsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/NotSupportedView-BiyVuLfX.css b/comfy/web/assets/NotSupportedView-BiyVuLfX.css deleted file mode 100644 index 594783813..000000000 --- a/comfy/web/assets/NotSupportedView-BiyVuLfX.css +++ /dev/null @@ -1,19 +0,0 @@ - -.sad-container { -&[data-v-ebb20958] { - display: grid; - align-items: center; - justify-content: space-evenly; - grid-template-columns: 25rem 1fr; -} -&[data-v-ebb20958] > * { - grid-row: 1; -} -} -.sad-text[data-v-ebb20958] { - grid-column: 1/3; -} -.sad-girl[data-v-ebb20958] { - grid-column: 2/3; - width: min(75vw, 100vh); -} diff --git a/comfy/web/assets/NotSupportedView-CMCKSnEd.js b/comfy/web/assets/NotSupportedView-CMCKSnEd.js deleted file mode 100644 index 450a86ade..000000000 --- a/comfy/web/assets/NotSupportedView-CMCKSnEd.js +++ /dev/null @@ -1,86 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { d as defineComponent, br as useRouter, r as resolveDirective, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, k as createVNode, j as unref, l as script, i as withDirectives, _ as _export_sfc } from "./index-DIgj6hpb.js"; -import { _ as _sfc_main$1 } from "./BaseViewTemplate-DaGOaycP.js"; -const _imports_0 = "" + new URL("images/sad_girl.png", import.meta.url).href; -const _hoisted_1 = { class: "sad-container" }; -const _hoisted_2 = { class: "no-drag sad-text flex items-center" }; -const _hoisted_3 = { class: "flex flex-col gap-8 p-8 min-w-110" }; -const _hoisted_4 = { class: "text-4xl font-bold text-red-500" }; -const _hoisted_5 = { class: "space-y-4" }; -const _hoisted_6 = { class: "text-xl" }; -const _hoisted_7 = { class: "list-disc list-inside space-y-1 text-neutral-800" }; -const _hoisted_8 = { class: "flex gap-4" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "NotSupportedView", - setup(__props) { - const openDocs = /* @__PURE__ */ __name(() => { - window.open( - "https://github.com/Comfy-Org/desktop#currently-supported-platforms", - "_blank" - ); - }, "openDocs"); - const reportIssue = /* @__PURE__ */ __name(() => { - window.open("https://forum.comfy.org/c/v1-feedback/", "_blank"); - }, "reportIssue"); - const router = useRouter(); - const continueToInstall = /* @__PURE__ */ __name(() => { - router.push("/install"); - }, "continueToInstall"); - return (_ctx, _cache) => { - const _directive_tooltip = resolveDirective("tooltip"); - return openBlock(), createBlock(_sfc_main$1, null, { - default: withCtx(() => [ - createBaseVNode("div", _hoisted_1, [ - _cache[0] || (_cache[0] = createBaseVNode("img", { - class: "sad-girl", - src: _imports_0, - alt: "Sad girl illustration" - }, null, -1)), - createBaseVNode("div", _hoisted_2, [ - createBaseVNode("div", _hoisted_3, [ - createBaseVNode("h1", _hoisted_4, toDisplayString(_ctx.$t("notSupported.title")), 1), - createBaseVNode("div", _hoisted_5, [ - createBaseVNode("p", _hoisted_6, toDisplayString(_ctx.$t("notSupported.message")), 1), - createBaseVNode("ul", _hoisted_7, [ - createBaseVNode("li", null, toDisplayString(_ctx.$t("notSupported.supportedDevices.macos")), 1), - createBaseVNode("li", null, toDisplayString(_ctx.$t("notSupported.supportedDevices.windows")), 1) - ]) - ]), - createBaseVNode("div", _hoisted_8, [ - createVNode(unref(script), { - label: _ctx.$t("notSupported.learnMore"), - icon: "pi pi-github", - onClick: openDocs, - severity: "secondary" - }, null, 8, ["label"]), - createVNode(unref(script), { - label: _ctx.$t("notSupported.reportIssue"), - icon: "pi pi-flag", - onClick: reportIssue, - severity: "secondary" - }, null, 8, ["label"]), - withDirectives(createVNode(unref(script), { - label: _ctx.$t("notSupported.continue"), - icon: "pi pi-arrow-right", - iconPos: "right", - onClick: continueToInstall, - severity: "danger" - }, null, 8, ["label"]), [ - [_directive_tooltip, _ctx.$t("notSupported.continueTooltip")] - ]) - ]) - ]) - ]) - ]) - ]), - _: 1 - }); - }; - } -}); -const NotSupportedView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ebb20958"]]); -export { - NotSupportedView as default -}; -//# sourceMappingURL=NotSupportedView-CMCKSnEd.js.map diff --git a/comfy/web/assets/NotSupportedView-CMCKSnEd.js.map b/comfy/web/assets/NotSupportedView-CMCKSnEd.js.map deleted file mode 100644 index 015e5f5a9..000000000 --- a/comfy/web/assets/NotSupportedView-CMCKSnEd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NotSupportedView-CMCKSnEd.js","sources":["../../../../../../assets/images/sad_girl.png","../../src/views/NotSupportedView.vue"],"sourcesContent":["export default \"__VITE_PUBLIC_ASSET__b82952e7__\"","\n\n\n\n\n"],"names":[],"mappings":";;;;AAAA,MAAe,aAAA,KAAA,IAAA,IAAA,uBAAA,YAAA,GAAA,EAAA;;;;;;;;;;;;AC+Df,UAAM,WAAW,6BAAM;AACd,aAAA;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,IACF,GALiB;AAOjB,UAAM,cAAc,6BAAM;AACjB,aAAA,KAAK,0CAA0C,QAAQ;AAAA,IAChE,GAFoB;AAIpB,UAAM,SAAS,UAAU;AACzB,UAAM,oBAAoB,6BAAM;AAC9B,aAAO,KAAK,UAAU;AAAA,IACxB,GAF0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/ServerConfigPanel-di9WinBR.js b/comfy/web/assets/ServerConfigPanel-di9WinBR.js deleted file mode 100644 index 96b0e74a0..000000000 --- a/comfy/web/assets/ServerConfigPanel-di9WinBR.js +++ /dev/null @@ -1,156 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { o as openBlock, f as createElementBlock, m as createBaseVNode, H as markRaw, d as defineComponent, a as useSettingStore, ar as storeToRefs, N as watch, dU as useCopyToClipboard, I as useI18n, y as createBlock, z as withCtx, j as unref, bw as script, E as toDisplayString, D as renderList, F as Fragment, k as createVNode, l as script$1, B as createCommentVNode, bu as script$2, dV as FormItem, dK as _sfc_main$1, bi as electronAPI } from "./index-DIgj6hpb.js"; -import { u as useServerConfigStore } from "./serverConfigStore-3t3U367D.js"; -const _hoisted_1$1 = { - viewBox: "0 0 24 24", - width: "1.2em", - height: "1.2em" -}; -function render(_ctx, _cache) { - return openBlock(), createElementBlock("svg", _hoisted_1$1, _cache[0] || (_cache[0] = [ - createBaseVNode("path", { - fill: "none", - stroke: "currentColor", - "stroke-linecap": "round", - "stroke-linejoin": "round", - "stroke-width": "2", - d: "m4 17l6-6l-6-6m8 14h8" - }, null, -1) - ])); -} -__name(render, "render"); -const __unplugin_components_0 = markRaw({ name: "lucide-terminal", render }); -const _hoisted_1 = { class: "flex flex-col gap-2" }; -const _hoisted_2 = { class: "flex justify-end gap-2" }; -const _hoisted_3 = { class: "flex items-center justify-between" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "ServerConfigPanel", - setup(__props) { - const settingStore = useSettingStore(); - const serverConfigStore = useServerConfigStore(); - const { - serverConfigsByCategory, - serverConfigValues, - launchArgs, - commandLineArgs, - modifiedConfigs - } = storeToRefs(serverConfigStore); - const revertChanges = /* @__PURE__ */ __name(() => { - serverConfigStore.revertChanges(); - }, "revertChanges"); - const restartApp = /* @__PURE__ */ __name(() => { - electronAPI().restartApp(); - }, "restartApp"); - watch(launchArgs, (newVal) => { - settingStore.set("Comfy.Server.LaunchArgs", newVal); - }); - watch(serverConfigValues, (newVal) => { - settingStore.set("Comfy.Server.ServerConfigValues", newVal); - }); - const { copyToClipboard } = useCopyToClipboard(); - const copyCommandLineArgs = /* @__PURE__ */ __name(async () => { - await copyToClipboard(commandLineArgs.value); - }, "copyCommandLineArgs"); - const { t } = useI18n(); - const translateItem = /* @__PURE__ */ __name((item) => { - return { - ...item, - name: t(`serverConfigItems.${item.id}.name`, item.name), - tooltip: item.tooltip ? t(`serverConfigItems.${item.id}.tooltip`, item.tooltip) : void 0 - }; - }, "translateItem"); - return (_ctx, _cache) => { - const _component_i_lucide58terminal = __unplugin_components_0; - return openBlock(), createBlock(_sfc_main$1, { - value: "Server-Config", - class: "server-config-panel" - }, { - header: withCtx(() => [ - createBaseVNode("div", _hoisted_1, [ - unref(modifiedConfigs).length > 0 ? (openBlock(), createBlock(unref(script), { - key: 0, - severity: "info", - "pt:text": "w-full" - }, { - default: withCtx(() => [ - createBaseVNode("p", null, toDisplayString(_ctx.$t("serverConfig.modifiedConfigs")), 1), - createBaseVNode("ul", null, [ - (openBlock(true), createElementBlock(Fragment, null, renderList(unref(modifiedConfigs), (config) => { - return openBlock(), createElementBlock("li", { - key: config.id - }, toDisplayString(config.name) + ": " + toDisplayString(config.initialValue) + " → " + toDisplayString(config.value), 1); - }), 128)) - ]), - createBaseVNode("div", _hoisted_2, [ - createVNode(unref(script$1), { - label: _ctx.$t("serverConfig.revertChanges"), - onClick: revertChanges, - outlined: "" - }, null, 8, ["label"]), - createVNode(unref(script$1), { - label: _ctx.$t("serverConfig.restart"), - onClick: restartApp, - outlined: "", - severity: "danger" - }, null, 8, ["label"]) - ]) - ]), - _: 1 - })) : createCommentVNode("", true), - unref(commandLineArgs) ? (openBlock(), createBlock(unref(script), { - key: 1, - severity: "secondary", - "pt:text": "w-full" - }, { - icon: withCtx(() => [ - createVNode(_component_i_lucide58terminal, { class: "text-xl font-bold" }) - ]), - default: withCtx(() => [ - createBaseVNode("div", _hoisted_3, [ - createBaseVNode("p", null, toDisplayString(unref(commandLineArgs)), 1), - createVNode(unref(script$1), { - icon: "pi pi-clipboard", - onClick: copyCommandLineArgs, - severity: "secondary", - text: "" - }) - ]) - ]), - _: 1 - })) : createCommentVNode("", true) - ]) - ]), - default: withCtx(() => [ - (openBlock(true), createElementBlock(Fragment, null, renderList(Object.entries(unref(serverConfigsByCategory)), ([label, items], i) => { - return openBlock(), createElementBlock("div", { key: label }, [ - i > 0 ? (openBlock(), createBlock(unref(script$2), { key: 0 })) : createCommentVNode("", true), - createBaseVNode("h3", null, toDisplayString(_ctx.$t(`serverConfigCategories.${label}`, label)), 1), - (openBlock(true), createElementBlock(Fragment, null, renderList(items, (item) => { - return openBlock(), createElementBlock("div", { - key: item.name, - class: "mb-4" - }, [ - createVNode(FormItem, { - item: translateItem(item), - formValue: item.value, - "onUpdate:formValue": /* @__PURE__ */ __name(($event) => item.value = $event, "onUpdate:formValue"), - id: item.id, - labelClass: { - "text-highlight": item.initialValue !== item.value - } - }, null, 8, ["item", "formValue", "onUpdate:formValue", "id", "labelClass"]) - ]); - }), 128)) - ]); - }), 128)) - ]), - _: 1 - }); - }; - } -}); -export { - _sfc_main as default -}; -//# sourceMappingURL=ServerConfigPanel-di9WinBR.js.map diff --git a/comfy/web/assets/ServerConfigPanel-di9WinBR.js.map b/comfy/web/assets/ServerConfigPanel-di9WinBR.js.map deleted file mode 100644 index ed89039d3..000000000 --- a/comfy/web/assets/ServerConfigPanel-di9WinBR.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ServerConfigPanel-di9WinBR.js","sources":["../../src/components/dialog/content/setting/ServerConfigPanel.vue"],"sourcesContent":["\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqFA,UAAM,eAAe,gBAAgB;AACrC,UAAM,oBAAoB,qBAAqB;AACzC,UAAA;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,IACE,YAAY,iBAAiB;AAEjC,UAAM,gBAAgB,6BAAM;AAC1B,wBAAkB,cAAc;AAAA,IAClC,GAFsB;AAItB,UAAM,aAAa,6BAAM;AACvB,kBAAA,EAAc,WAAW;AAAA,IAC3B,GAFmB;AAIb,UAAA,YAAY,CAAC,WAAW;AACf,mBAAA,IAAI,2BAA2B,MAAM;AAAA,IAAA,CACnD;AAEK,UAAA,oBAAoB,CAAC,WAAW;AACvB,mBAAA,IAAI,mCAAmC,MAAM;AAAA,IAAA,CAC3D;AAEK,UAAA,EAAE,gBAAgB,IAAI,mBAAmB;AAC/C,UAAM,sBAAsB,mCAAY;AAChC,YAAA,gBAAgB,gBAAgB,KAAK;AAAA,IAC7C,GAF4B;AAItB,UAAA,EAAE,EAAE,IAAI,QAAQ;AAChB,UAAA,gBAAgB,wBAAC,SAA0C;AACxD,aAAA;AAAA,QACL,GAAG;AAAA,QACH,MAAM,EAAE,qBAAqB,KAAK,EAAE,SAAS,KAAK,IAAI;AAAA,QACtD,SAAS,KAAK,UACV,EAAE,qBAAqB,KAAK,EAAE,YAAY,KAAK,OAAO,IACtD;AAAA,MACN;AAAA,IACF,GARsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/ServerStartView-BLlSvhJ0.css b/comfy/web/assets/ServerStartView-BLlSvhJ0.css deleted file mode 100644 index 4671393d1..000000000 --- a/comfy/web/assets/ServerStartView-BLlSvhJ0.css +++ /dev/null @@ -1,5 +0,0 @@ - -[data-v-32a7f48f] .xterm-helper-textarea { - /* Hide this as it moves all over when uv is running */ - display: none; -} diff --git a/comfy/web/assets/ServerStartView-CvFWnVGg.js b/comfy/web/assets/ServerStartView-CvFWnVGg.js deleted file mode 100644 index 62b579f11..000000000 --- a/comfy/web/assets/ServerStartView-CvFWnVGg.js +++ /dev/null @@ -1,100 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { d as defineComponent, I as useI18n, T as ref, bx as ProgressStatus, p as onMounted, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, ak as createTextVNode, E as toDisplayString, j as unref, f as createElementBlock, B as createCommentVNode, k as createVNode, l as script, i as withDirectives, v as vShow, by as BaseTerminal, bi as electronAPI, _ as _export_sfc } from "./index-DIgj6hpb.js"; -import { _ as _sfc_main$1 } from "./BaseViewTemplate-DaGOaycP.js"; -const _hoisted_1 = { class: "flex flex-col w-full h-full items-center" }; -const _hoisted_2 = { class: "text-2xl font-bold" }; -const _hoisted_3 = { key: 0 }; -const _hoisted_4 = { - key: 0, - class: "flex flex-col items-center gap-4" -}; -const _hoisted_5 = { class: "flex items-center my-4 gap-2" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "ServerStartView", - setup(__props) { - const electron = electronAPI(); - const { t } = useI18n(); - const status = ref(ProgressStatus.INITIAL_STATE); - const electronVersion = ref(""); - let xterm; - const terminalVisible = ref(true); - const updateProgress = /* @__PURE__ */ __name(({ status: newStatus }) => { - status.value = newStatus; - if (newStatus === ProgressStatus.ERROR) terminalVisible.value = false; - else xterm?.clear(); - }, "updateProgress"); - const terminalCreated = /* @__PURE__ */ __name(({ terminal, useAutoSize }, root) => { - xterm = terminal; - useAutoSize({ root, autoRows: true, autoCols: true }); - electron.onLogMessage((message) => { - terminal.write(message); - }); - terminal.options.cursorBlink = false; - terminal.options.disableStdin = true; - terminal.options.cursorInactiveStyle = "block"; - }, "terminalCreated"); - const troubleshoot = /* @__PURE__ */ __name(() => electron.startTroubleshooting(), "troubleshoot"); - const reportIssue = /* @__PURE__ */ __name(() => { - window.open("https://forum.comfy.org/c/v1-feedback/", "_blank"); - }, "reportIssue"); - const openLogs = /* @__PURE__ */ __name(() => electron.openLogsFolder(), "openLogs"); - onMounted(async () => { - electron.sendReady(); - electron.onProgressUpdate(updateProgress); - electronVersion.value = await electron.getElectronVersion(); - }); - return (_ctx, _cache) => { - return openBlock(), createBlock(_sfc_main$1, { - dark: "", - class: "flex-col" - }, { - default: withCtx(() => [ - createBaseVNode("div", _hoisted_1, [ - createBaseVNode("h2", _hoisted_2, [ - createTextVNode(toDisplayString(unref(t)(`serverStart.process.${status.value}`)) + " ", 1), - status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("span", _hoisted_3, " v" + toDisplayString(electronVersion.value), 1)) : createCommentVNode("", true) - ]), - status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("div", _hoisted_4, [ - createBaseVNode("div", _hoisted_5, [ - createVNode(unref(script), { - icon: "pi pi-flag", - severity: "secondary", - label: unref(t)("serverStart.reportIssue"), - onClick: reportIssue - }, null, 8, ["label"]), - createVNode(unref(script), { - icon: "pi pi-file", - severity: "secondary", - label: unref(t)("serverStart.openLogs"), - onClick: openLogs - }, null, 8, ["label"]), - createVNode(unref(script), { - icon: "pi pi-wrench", - label: unref(t)("serverStart.troubleshoot"), - onClick: troubleshoot - }, null, 8, ["label"]) - ]), - !terminalVisible.value ? (openBlock(), createBlock(unref(script), { - key: 0, - icon: "pi pi-search", - severity: "secondary", - label: unref(t)("serverStart.showTerminal"), - onClick: _cache[0] || (_cache[0] = ($event) => terminalVisible.value = true) - }, null, 8, ["label"])) : createCommentVNode("", true) - ])) : createCommentVNode("", true), - withDirectives(createVNode(BaseTerminal, { onCreated: terminalCreated }, null, 512), [ - [vShow, terminalVisible.value] - ]) - ]) - ]), - _: 1 - }); - }; - } -}); -const ServerStartView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-32a7f48f"]]); -export { - ServerStartView as default -}; -//# sourceMappingURL=ServerStartView-CvFWnVGg.js.map diff --git a/comfy/web/assets/ServerStartView-CvFWnVGg.js.map b/comfy/web/assets/ServerStartView-CvFWnVGg.js.map deleted file mode 100644 index 66719d56d..000000000 --- a/comfy/web/assets/ServerStartView-CvFWnVGg.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ServerStartView-CvFWnVGg.js","sources":["../../src/views/ServerStartView.vue"],"sourcesContent":["\n\n\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAyDA,UAAM,WAAW,YAAY;AACvB,UAAA,EAAE,EAAE,IAAI,QAAQ;AAEhB,UAAA,SAAS,IAAoB,eAAe,aAAa;AACzD,UAAA,kBAAkB,IAAY,EAAE;AAClC,QAAA;AAEE,UAAA,kBAAkB,IAAI,IAAI;AAEhC,UAAM,iBAAiB,wBAAC,EAAE,QAAQ,gBAA4C;AAC5E,aAAO,QAAQ;AAGf,UAAI,cAAc,eAAe,MAAO,iBAAgB,QAAQ;AAAA,kBACpD,MAAM;AAAA,IACpB,GANuB;AAQvB,UAAM,kBAAkB,wBACtB,EAAE,UAAU,YAAA,GACZ,SACG;AACK,cAAA;AAER,kBAAY,EAAE,MAAM,UAAU,MAAM,UAAU,MAAM;AAC3C,eAAA,aAAa,CAAC,YAAoB;AACzC,iBAAS,MAAM,OAAO;AAAA,MAAA,CACvB;AAED,eAAS,QAAQ,cAAc;AAC/B,eAAS,QAAQ,eAAe;AAChC,eAAS,QAAQ,sBAAsB;AAAA,IACzC,GAdwB;AAgBlB,UAAA,eAAe,6BAAM,SAAS,qBAAqB,GAApC;AACrB,UAAM,cAAc,6BAAM;AACjB,aAAA,KAAK,0CAA0C,QAAQ;AAAA,IAChE,GAFoB;AAGd,UAAA,WAAW,6BAAM,SAAS,eAAe,GAA9B;AAEjB,cAAU,YAAY;AACpB,eAAS,UAAU;AACnB,eAAS,iBAAiB,cAAc;AACxB,sBAAA,QAAQ,MAAM,SAAS,mBAAmB;AAAA,IAAA,CAC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/TerminalOutputDrawer-B_NZxAv8.js b/comfy/web/assets/TerminalOutputDrawer-B_NZxAv8.js deleted file mode 100644 index cd319c487..000000000 --- a/comfy/web/assets/TerminalOutputDrawer-B_NZxAv8.js +++ /dev/null @@ -1,676 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { bV as commonjsGlobal, bW as getDefaultExportFromCjs, H as markRaw, bX as xtermExports, p as onMounted, bU as onUnmounted, d as defineComponent, bF as mergeModels, bz as useModel, o as openBlock, y as createBlock, z as withCtx, k as createVNode, by as BaseTerminal, j as unref, bi as electronAPI } from "./index-DIgj6hpb.js"; -import { s as script } from "./index-C_ACzX5-.js"; -var addonSerialize$2 = { exports: {} }; -var addonSerialize = addonSerialize$2.exports; -(function(module, exports) { - !function(e, t) { - true ? module.exports = t() : false ? (void 0)([], t) : true ? exports.SerializeAddon = t() : e.SerializeAddon = t(); - }(commonjsGlobal, () => (() => { - "use strict"; - var e = { 930: (e2, t2, s2) => { - Object.defineProperty(t2, "__esModule", { value: true }), t2.ColorContrastCache = void 0; - const r2 = s2(485); - t2.ColorContrastCache = class { - constructor() { - this._color = new r2.TwoKeyMap(), this._css = new r2.TwoKeyMap(); - } - setCss(e3, t3, s3) { - this._css.set(e3, t3, s3); - } - getCss(e3, t3) { - return this._css.get(e3, t3); - } - setColor(e3, t3, s3) { - this._color.set(e3, t3, s3); - } - getColor(e3, t3) { - return this._color.get(e3, t3); - } - clear() { - this._color.clear(), this._css.clear(); - } - }; - }, 997: function(e2, t2, s2) { - var r2 = this && this.__decorate || function(e3, t3, s3, r3) { - var o2, i2 = arguments.length, n2 = i2 < 3 ? t3 : null === r3 ? r3 = Object.getOwnPropertyDescriptor(t3, s3) : r3; - if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n2 = Reflect.decorate(e3, t3, s3, r3); - else for (var l2 = e3.length - 1; l2 >= 0; l2--) (o2 = e3[l2]) && (n2 = (i2 < 3 ? o2(n2) : i2 > 3 ? o2(t3, s3, n2) : o2(t3, s3)) || n2); - return i2 > 3 && n2 && Object.defineProperty(t3, s3, n2), n2; - }, o = this && this.__param || function(e3, t3) { - return function(s3, r3) { - t3(s3, r3, e3); - }; - }; - Object.defineProperty(t2, "__esModule", { value: true }), t2.ThemeService = t2.DEFAULT_ANSI_COLORS = void 0; - const i = s2(930), n = s2(160), l = s2(345), a = s2(859), c = s2(97), h = n.css.toColor("#ffffff"), u = n.css.toColor("#000000"), _ = n.css.toColor("#ffffff"), d = n.css.toColor("#000000"), C = { css: "rgba(255, 255, 255, 0.3)", rgba: 4294967117 }; - t2.DEFAULT_ANSI_COLORS = Object.freeze((() => { - const e3 = [n.css.toColor("#2e3436"), n.css.toColor("#cc0000"), n.css.toColor("#4e9a06"), n.css.toColor("#c4a000"), n.css.toColor("#3465a4"), n.css.toColor("#75507b"), n.css.toColor("#06989a"), n.css.toColor("#d3d7cf"), n.css.toColor("#555753"), n.css.toColor("#ef2929"), n.css.toColor("#8ae234"), n.css.toColor("#fce94f"), n.css.toColor("#729fcf"), n.css.toColor("#ad7fa8"), n.css.toColor("#34e2e2"), n.css.toColor("#eeeeec")], t3 = [0, 95, 135, 175, 215, 255]; - for (let s3 = 0; s3 < 216; s3++) { - const r3 = t3[s3 / 36 % 6 | 0], o2 = t3[s3 / 6 % 6 | 0], i2 = t3[s3 % 6]; - e3.push({ css: n.channels.toCss(r3, o2, i2), rgba: n.channels.toRgba(r3, o2, i2) }); - } - for (let t4 = 0; t4 < 24; t4++) { - const s3 = 8 + 10 * t4; - e3.push({ css: n.channels.toCss(s3, s3, s3), rgba: n.channels.toRgba(s3, s3, s3) }); - } - return e3; - })()); - let f = t2.ThemeService = class extends a.Disposable { - get colors() { - return this._colors; - } - constructor(e3) { - super(), this._optionsService = e3, this._contrastCache = new i.ColorContrastCache(), this._halfContrastCache = new i.ColorContrastCache(), this._onChangeColors = this.register(new l.EventEmitter()), this.onChangeColors = this._onChangeColors.event, this._colors = { foreground: h, background: u, cursor: _, cursorAccent: d, selectionForeground: void 0, selectionBackgroundTransparent: C, selectionBackgroundOpaque: n.color.blend(u, C), selectionInactiveBackgroundTransparent: C, selectionInactiveBackgroundOpaque: n.color.blend(u, C), ansi: t2.DEFAULT_ANSI_COLORS.slice(), contrastCache: this._contrastCache, halfContrastCache: this._halfContrastCache }, this._updateRestoreColors(), this._setTheme(this._optionsService.rawOptions.theme), this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio", () => this._contrastCache.clear())), this.register(this._optionsService.onSpecificOptionChange("theme", () => this._setTheme(this._optionsService.rawOptions.theme))); - } - _setTheme(e3 = {}) { - const s3 = this._colors; - if (s3.foreground = g(e3.foreground, h), s3.background = g(e3.background, u), s3.cursor = g(e3.cursor, _), s3.cursorAccent = g(e3.cursorAccent, d), s3.selectionBackgroundTransparent = g(e3.selectionBackground, C), s3.selectionBackgroundOpaque = n.color.blend(s3.background, s3.selectionBackgroundTransparent), s3.selectionInactiveBackgroundTransparent = g(e3.selectionInactiveBackground, s3.selectionBackgroundTransparent), s3.selectionInactiveBackgroundOpaque = n.color.blend(s3.background, s3.selectionInactiveBackgroundTransparent), s3.selectionForeground = e3.selectionForeground ? g(e3.selectionForeground, n.NULL_COLOR) : void 0, s3.selectionForeground === n.NULL_COLOR && (s3.selectionForeground = void 0), n.color.isOpaque(s3.selectionBackgroundTransparent)) { - const e4 = 0.3; - s3.selectionBackgroundTransparent = n.color.opacity(s3.selectionBackgroundTransparent, e4); - } - if (n.color.isOpaque(s3.selectionInactiveBackgroundTransparent)) { - const e4 = 0.3; - s3.selectionInactiveBackgroundTransparent = n.color.opacity(s3.selectionInactiveBackgroundTransparent, e4); - } - if (s3.ansi = t2.DEFAULT_ANSI_COLORS.slice(), s3.ansi[0] = g(e3.black, t2.DEFAULT_ANSI_COLORS[0]), s3.ansi[1] = g(e3.red, t2.DEFAULT_ANSI_COLORS[1]), s3.ansi[2] = g(e3.green, t2.DEFAULT_ANSI_COLORS[2]), s3.ansi[3] = g(e3.yellow, t2.DEFAULT_ANSI_COLORS[3]), s3.ansi[4] = g(e3.blue, t2.DEFAULT_ANSI_COLORS[4]), s3.ansi[5] = g(e3.magenta, t2.DEFAULT_ANSI_COLORS[5]), s3.ansi[6] = g(e3.cyan, t2.DEFAULT_ANSI_COLORS[6]), s3.ansi[7] = g(e3.white, t2.DEFAULT_ANSI_COLORS[7]), s3.ansi[8] = g(e3.brightBlack, t2.DEFAULT_ANSI_COLORS[8]), s3.ansi[9] = g(e3.brightRed, t2.DEFAULT_ANSI_COLORS[9]), s3.ansi[10] = g(e3.brightGreen, t2.DEFAULT_ANSI_COLORS[10]), s3.ansi[11] = g(e3.brightYellow, t2.DEFAULT_ANSI_COLORS[11]), s3.ansi[12] = g(e3.brightBlue, t2.DEFAULT_ANSI_COLORS[12]), s3.ansi[13] = g(e3.brightMagenta, t2.DEFAULT_ANSI_COLORS[13]), s3.ansi[14] = g(e3.brightCyan, t2.DEFAULT_ANSI_COLORS[14]), s3.ansi[15] = g(e3.brightWhite, t2.DEFAULT_ANSI_COLORS[15]), e3.extendedAnsi) { - const r3 = Math.min(s3.ansi.length - 16, e3.extendedAnsi.length); - for (let o2 = 0; o2 < r3; o2++) s3.ansi[o2 + 16] = g(e3.extendedAnsi[o2], t2.DEFAULT_ANSI_COLORS[o2 + 16]); - } - this._contrastCache.clear(), this._halfContrastCache.clear(), this._updateRestoreColors(), this._onChangeColors.fire(this.colors); - } - restoreColor(e3) { - this._restoreColor(e3), this._onChangeColors.fire(this.colors); - } - _restoreColor(e3) { - if (void 0 !== e3) switch (e3) { - case 256: - this._colors.foreground = this._restoreColors.foreground; - break; - case 257: - this._colors.background = this._restoreColors.background; - break; - case 258: - this._colors.cursor = this._restoreColors.cursor; - break; - default: - this._colors.ansi[e3] = this._restoreColors.ansi[e3]; - } - else for (let e4 = 0; e4 < this._restoreColors.ansi.length; ++e4) this._colors.ansi[e4] = this._restoreColors.ansi[e4]; - } - modifyColors(e3) { - e3(this._colors), this._onChangeColors.fire(this.colors); - } - _updateRestoreColors() { - this._restoreColors = { foreground: this._colors.foreground, background: this._colors.background, cursor: this._colors.cursor, ansi: this._colors.ansi.slice() }; - } - }; - function g(e3, t3) { - if (void 0 !== e3) try { - return n.css.toColor(e3); - } catch { - } - return t3; - } - __name(g, "g"); - t2.ThemeService = f = r2([o(0, c.IOptionsService)], f); - }, 160: (e2, t2) => { - Object.defineProperty(t2, "__esModule", { value: true }), t2.contrastRatio = t2.toPaddedHex = t2.rgba = t2.rgb = t2.css = t2.color = t2.channels = t2.NULL_COLOR = void 0; - let s2 = 0, r2 = 0, o = 0, i = 0; - var n, l, a, c, h; - function u(e3) { - const t3 = e3.toString(16); - return t3.length < 2 ? "0" + t3 : t3; - } - __name(u, "u"); - function _(e3, t3) { - return e3 < t3 ? (t3 + 0.05) / (e3 + 0.05) : (e3 + 0.05) / (t3 + 0.05); - } - __name(_, "_"); - t2.NULL_COLOR = { css: "#00000000", rgba: 0 }, function(e3) { - e3.toCss = function(e4, t3, s3, r3) { - return void 0 !== r3 ? `#${u(e4)}${u(t3)}${u(s3)}${u(r3)}` : `#${u(e4)}${u(t3)}${u(s3)}`; - }, e3.toRgba = function(e4, t3, s3, r3 = 255) { - return (e4 << 24 | t3 << 16 | s3 << 8 | r3) >>> 0; - }, e3.toColor = function(t3, s3, r3, o2) { - return { css: e3.toCss(t3, s3, r3, o2), rgba: e3.toRgba(t3, s3, r3, o2) }; - }; - }(n || (t2.channels = n = {})), function(e3) { - function t3(e4, t4) { - return i = Math.round(255 * t4), [s2, r2, o] = h.toChannels(e4.rgba), { css: n.toCss(s2, r2, o, i), rgba: n.toRgba(s2, r2, o, i) }; - } - __name(t3, "t"); - e3.blend = function(e4, t4) { - if (i = (255 & t4.rgba) / 255, 1 === i) return { css: t4.css, rgba: t4.rgba }; - const l2 = t4.rgba >> 24 & 255, a2 = t4.rgba >> 16 & 255, c2 = t4.rgba >> 8 & 255, h2 = e4.rgba >> 24 & 255, u2 = e4.rgba >> 16 & 255, _2 = e4.rgba >> 8 & 255; - return s2 = h2 + Math.round((l2 - h2) * i), r2 = u2 + Math.round((a2 - u2) * i), o = _2 + Math.round((c2 - _2) * i), { css: n.toCss(s2, r2, o), rgba: n.toRgba(s2, r2, o) }; - }, e3.isOpaque = function(e4) { - return 255 == (255 & e4.rgba); - }, e3.ensureContrastRatio = function(e4, t4, s3) { - const r3 = h.ensureContrastRatio(e4.rgba, t4.rgba, s3); - if (r3) return n.toColor(r3 >> 24 & 255, r3 >> 16 & 255, r3 >> 8 & 255); - }, e3.opaque = function(e4) { - const t4 = (255 | e4.rgba) >>> 0; - return [s2, r2, o] = h.toChannels(t4), { css: n.toCss(s2, r2, o), rgba: t4 }; - }, e3.opacity = t3, e3.multiplyOpacity = function(e4, s3) { - return i = 255 & e4.rgba, t3(e4, i * s3 / 255); - }, e3.toColorRGB = function(e4) { - return [e4.rgba >> 24 & 255, e4.rgba >> 16 & 255, e4.rgba >> 8 & 255]; - }; - }(l || (t2.color = l = {})), function(e3) { - let t3, l2; - try { - const e4 = document.createElement("canvas"); - e4.width = 1, e4.height = 1; - const s3 = e4.getContext("2d", { willReadFrequently: true }); - s3 && (t3 = s3, t3.globalCompositeOperation = "copy", l2 = t3.createLinearGradient(0, 0, 1, 1)); - } catch { - } - e3.toColor = function(e4) { - if (e4.match(/#[\da-f]{3,8}/i)) switch (e4.length) { - case 4: - return s2 = parseInt(e4.slice(1, 2).repeat(2), 16), r2 = parseInt(e4.slice(2, 3).repeat(2), 16), o = parseInt(e4.slice(3, 4).repeat(2), 16), n.toColor(s2, r2, o); - case 5: - return s2 = parseInt(e4.slice(1, 2).repeat(2), 16), r2 = parseInt(e4.slice(2, 3).repeat(2), 16), o = parseInt(e4.slice(3, 4).repeat(2), 16), i = parseInt(e4.slice(4, 5).repeat(2), 16), n.toColor(s2, r2, o, i); - case 7: - return { css: e4, rgba: (parseInt(e4.slice(1), 16) << 8 | 255) >>> 0 }; - case 9: - return { css: e4, rgba: parseInt(e4.slice(1), 16) >>> 0 }; - } - const a2 = e4.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/); - if (a2) return s2 = parseInt(a2[1]), r2 = parseInt(a2[2]), o = parseInt(a2[3]), i = Math.round(255 * (void 0 === a2[5] ? 1 : parseFloat(a2[5]))), n.toColor(s2, r2, o, i); - if (!t3 || !l2) throw new Error("css.toColor: Unsupported css format"); - if (t3.fillStyle = l2, t3.fillStyle = e4, "string" != typeof t3.fillStyle) throw new Error("css.toColor: Unsupported css format"); - if (t3.fillRect(0, 0, 1, 1), [s2, r2, o, i] = t3.getImageData(0, 0, 1, 1).data, 255 !== i) throw new Error("css.toColor: Unsupported css format"); - return { rgba: n.toRgba(s2, r2, o, i), css: e4 }; - }; - }(a || (t2.css = a = {})), function(e3) { - function t3(e4, t4, s3) { - const r3 = e4 / 255, o2 = t4 / 255, i2 = s3 / 255; - return 0.2126 * (r3 <= 0.03928 ? r3 / 12.92 : Math.pow((r3 + 0.055) / 1.055, 2.4)) + 0.7152 * (o2 <= 0.03928 ? o2 / 12.92 : Math.pow((o2 + 0.055) / 1.055, 2.4)) + 0.0722 * (i2 <= 0.03928 ? i2 / 12.92 : Math.pow((i2 + 0.055) / 1.055, 2.4)); - } - __name(t3, "t"); - e3.relativeLuminance = function(e4) { - return t3(e4 >> 16 & 255, e4 >> 8 & 255, 255 & e4); - }, e3.relativeLuminance2 = t3; - }(c || (t2.rgb = c = {})), function(e3) { - function t3(e4, t4, s3) { - const r3 = e4 >> 24 & 255, o2 = e4 >> 16 & 255, i2 = e4 >> 8 & 255; - let n2 = t4 >> 24 & 255, l3 = t4 >> 16 & 255, a2 = t4 >> 8 & 255, h2 = _(c.relativeLuminance2(n2, l3, a2), c.relativeLuminance2(r3, o2, i2)); - for (; h2 < s3 && (n2 > 0 || l3 > 0 || a2 > 0); ) n2 -= Math.max(0, Math.ceil(0.1 * n2)), l3 -= Math.max(0, Math.ceil(0.1 * l3)), a2 -= Math.max(0, Math.ceil(0.1 * a2)), h2 = _(c.relativeLuminance2(n2, l3, a2), c.relativeLuminance2(r3, o2, i2)); - return (n2 << 24 | l3 << 16 | a2 << 8 | 255) >>> 0; - } - __name(t3, "t"); - function l2(e4, t4, s3) { - const r3 = e4 >> 24 & 255, o2 = e4 >> 16 & 255, i2 = e4 >> 8 & 255; - let n2 = t4 >> 24 & 255, l3 = t4 >> 16 & 255, a2 = t4 >> 8 & 255, h2 = _(c.relativeLuminance2(n2, l3, a2), c.relativeLuminance2(r3, o2, i2)); - for (; h2 < s3 && (n2 < 255 || l3 < 255 || a2 < 255); ) n2 = Math.min(255, n2 + Math.ceil(0.1 * (255 - n2))), l3 = Math.min(255, l3 + Math.ceil(0.1 * (255 - l3))), a2 = Math.min(255, a2 + Math.ceil(0.1 * (255 - a2))), h2 = _(c.relativeLuminance2(n2, l3, a2), c.relativeLuminance2(r3, o2, i2)); - return (n2 << 24 | l3 << 16 | a2 << 8 | 255) >>> 0; - } - __name(l2, "l"); - e3.blend = function(e4, t4) { - if (i = (255 & t4) / 255, 1 === i) return t4; - const l3 = t4 >> 24 & 255, a2 = t4 >> 16 & 255, c2 = t4 >> 8 & 255, h2 = e4 >> 24 & 255, u2 = e4 >> 16 & 255, _2 = e4 >> 8 & 255; - return s2 = h2 + Math.round((l3 - h2) * i), r2 = u2 + Math.round((a2 - u2) * i), o = _2 + Math.round((c2 - _2) * i), n.toRgba(s2, r2, o); - }, e3.ensureContrastRatio = function(e4, s3, r3) { - const o2 = c.relativeLuminance(e4 >> 8), i2 = c.relativeLuminance(s3 >> 8); - if (_(o2, i2) < r3) { - if (i2 < o2) { - const i3 = t3(e4, s3, r3), n3 = _(o2, c.relativeLuminance(i3 >> 8)); - if (n3 < r3) { - const t4 = l2(e4, s3, r3); - return n3 > _(o2, c.relativeLuminance(t4 >> 8)) ? i3 : t4; - } - return i3; - } - const n2 = l2(e4, s3, r3), a2 = _(o2, c.relativeLuminance(n2 >> 8)); - if (a2 < r3) { - const i3 = t3(e4, s3, r3); - return a2 > _(o2, c.relativeLuminance(i3 >> 8)) ? n2 : i3; - } - return n2; - } - }, e3.reduceLuminance = t3, e3.increaseLuminance = l2, e3.toChannels = function(e4) { - return [e4 >> 24 & 255, e4 >> 16 & 255, e4 >> 8 & 255, 255 & e4]; - }; - }(h || (t2.rgba = h = {})), t2.toPaddedHex = u, t2.contrastRatio = _; - }, 345: (e2, t2) => { - Object.defineProperty(t2, "__esModule", { value: true }), t2.runAndSubscribe = t2.forwardEvent = t2.EventEmitter = void 0, t2.EventEmitter = class { - constructor() { - this._listeners = [], this._disposed = false; - } - get event() { - return this._event || (this._event = (e3) => (this._listeners.push(e3), { dispose: /* @__PURE__ */ __name(() => { - if (!this._disposed) { - for (let t3 = 0; t3 < this._listeners.length; t3++) if (this._listeners[t3] === e3) return void this._listeners.splice(t3, 1); - } - }, "dispose") })), this._event; - } - fire(e3, t3) { - const s2 = []; - for (let e4 = 0; e4 < this._listeners.length; e4++) s2.push(this._listeners[e4]); - for (let r2 = 0; r2 < s2.length; r2++) s2[r2].call(void 0, e3, t3); - } - dispose() { - this.clearListeners(), this._disposed = true; - } - clearListeners() { - this._listeners && (this._listeners.length = 0); - } - }, t2.forwardEvent = function(e3, t3) { - return e3((e4) => t3.fire(e4)); - }, t2.runAndSubscribe = function(e3, t3) { - return t3(void 0), e3((e4) => t3(e4)); - }; - }, 859: (e2, t2) => { - function s2(e3) { - for (const t3 of e3) t3.dispose(); - e3.length = 0; - } - __name(s2, "s"); - Object.defineProperty(t2, "__esModule", { value: true }), t2.getDisposeArrayDisposable = t2.disposeArray = t2.toDisposable = t2.MutableDisposable = t2.Disposable = void 0, t2.Disposable = class { - constructor() { - this._disposables = [], this._isDisposed = false; - } - dispose() { - this._isDisposed = true; - for (const e3 of this._disposables) e3.dispose(); - this._disposables.length = 0; - } - register(e3) { - return this._disposables.push(e3), e3; - } - unregister(e3) { - const t3 = this._disposables.indexOf(e3); - -1 !== t3 && this._disposables.splice(t3, 1); - } - }, t2.MutableDisposable = class { - constructor() { - this._isDisposed = false; - } - get value() { - return this._isDisposed ? void 0 : this._value; - } - set value(e3) { - this._isDisposed || e3 === this._value || (this._value?.dispose(), this._value = e3); - } - clear() { - this.value = void 0; - } - dispose() { - this._isDisposed = true, this._value?.dispose(), this._value = void 0; - } - }, t2.toDisposable = function(e3) { - return { dispose: e3 }; - }, t2.disposeArray = s2, t2.getDisposeArrayDisposable = function(e3) { - return { dispose: /* @__PURE__ */ __name(() => s2(e3), "dispose") }; - }; - }, 485: (e2, t2) => { - Object.defineProperty(t2, "__esModule", { value: true }), t2.FourKeyMap = t2.TwoKeyMap = void 0; - class s2 { - static { - __name(this, "s"); - } - constructor() { - this._data = {}; - } - set(e3, t3, s3) { - this._data[e3] || (this._data[e3] = {}), this._data[e3][t3] = s3; - } - get(e3, t3) { - return this._data[e3] ? this._data[e3][t3] : void 0; - } - clear() { - this._data = {}; - } - } - t2.TwoKeyMap = s2, t2.FourKeyMap = class { - constructor() { - this._data = new s2(); - } - set(e3, t3, r2, o, i) { - this._data.get(e3, t3) || this._data.set(e3, t3, new s2()), this._data.get(e3, t3).set(r2, o, i); - } - get(e3, t3, s3, r2) { - return this._data.get(e3, t3)?.get(s3, r2); - } - clear() { - this._data.clear(); - } - }; - }, 726: (e2, t2) => { - Object.defineProperty(t2, "__esModule", { value: true }), t2.createDecorator = t2.getServiceDependencies = t2.serviceRegistry = void 0; - const s2 = "di$target", r2 = "di$dependencies"; - t2.serviceRegistry = /* @__PURE__ */ new Map(), t2.getServiceDependencies = function(e3) { - return e3[r2] || []; - }, t2.createDecorator = function(e3) { - if (t2.serviceRegistry.has(e3)) return t2.serviceRegistry.get(e3); - const o = /* @__PURE__ */ __name(function(e4, t3, i) { - if (3 !== arguments.length) throw new Error("@IServiceName-decorator can only be used to decorate a parameter"); - !function(e5, t4, o2) { - t4[s2] === t4 ? t4[r2].push({ id: e5, index: o2 }) : (t4[r2] = [{ id: e5, index: o2 }], t4[s2] = t4); - }(o, e4, i); - }, "o"); - return o.toString = () => e3, t2.serviceRegistry.set(e3, o), o; - }; - }, 97: (e2, t2, s2) => { - Object.defineProperty(t2, "__esModule", { value: true }), t2.IDecorationService = t2.IUnicodeService = t2.IOscLinkService = t2.IOptionsService = t2.ILogService = t2.LogLevelEnum = t2.IInstantiationService = t2.ICharsetService = t2.ICoreService = t2.ICoreMouseService = t2.IBufferService = void 0; - const r2 = s2(726); - var o; - t2.IBufferService = (0, r2.createDecorator)("BufferService"), t2.ICoreMouseService = (0, r2.createDecorator)("CoreMouseService"), t2.ICoreService = (0, r2.createDecorator)("CoreService"), t2.ICharsetService = (0, r2.createDecorator)("CharsetService"), t2.IInstantiationService = (0, r2.createDecorator)("InstantiationService"), function(e3) { - e3[e3.TRACE = 0] = "TRACE", e3[e3.DEBUG = 1] = "DEBUG", e3[e3.INFO = 2] = "INFO", e3[e3.WARN = 3] = "WARN", e3[e3.ERROR = 4] = "ERROR", e3[e3.OFF = 5] = "OFF"; - }(o || (t2.LogLevelEnum = o = {})), t2.ILogService = (0, r2.createDecorator)("LogService"), t2.IOptionsService = (0, r2.createDecorator)("OptionsService"), t2.IOscLinkService = (0, r2.createDecorator)("OscLinkService"), t2.IUnicodeService = (0, r2.createDecorator)("UnicodeService"), t2.IDecorationService = (0, r2.createDecorator)("DecorationService"); - } }, t = {}; - function s(r2) { - var o = t[r2]; - if (void 0 !== o) return o.exports; - var i = t[r2] = { exports: {} }; - return e[r2].call(i.exports, i, i.exports, s), i.exports; - } - __name(s, "s"); - var r = {}; - return (() => { - var e2 = r; - Object.defineProperty(e2, "__esModule", { value: true }), e2.HTMLSerializeHandler = e2.SerializeAddon = void 0; - const t2 = s(997); - function o(e3, t3, s2) { - return Math.max(t3, Math.min(e3, s2)); - } - __name(o, "o"); - class i { - static { - __name(this, "i"); - } - constructor(e3) { - this._buffer = e3; - } - serialize(e3, t3) { - const s2 = this._buffer.getNullCell(), r2 = this._buffer.getNullCell(); - let o2 = s2; - const i2 = e3.start.y, n2 = e3.end.y, l2 = e3.start.x, a2 = e3.end.x; - this._beforeSerialize(n2 - i2, i2, n2); - for (let t4 = i2; t4 <= n2; t4++) { - const i3 = this._buffer.getLine(t4); - if (i3) { - const n3 = t4 === e3.start.y ? l2 : 0, c2 = t4 === e3.end.y ? a2 : i3.length; - for (let e4 = n3; e4 < c2; e4++) { - const n4 = i3.getCell(e4, o2 === s2 ? r2 : s2); - n4 ? (this._nextCell(n4, o2, t4, e4), o2 = n4) : console.warn(`Can't get cell at row=${t4}, col=${e4}`); - } - } - this._rowEnd(t4, t4 === n2); - } - return this._afterSerialize(), this._serializeString(t3); - } - _nextCell(e3, t3, s2, r2) { - } - _rowEnd(e3, t3) { - } - _beforeSerialize(e3, t3, s2) { - } - _afterSerialize() { - } - _serializeString(e3) { - return ""; - } - } - function n(e3, t3) { - return e3.getFgColorMode() === t3.getFgColorMode() && e3.getFgColor() === t3.getFgColor(); - } - __name(n, "n"); - function l(e3, t3) { - return e3.getBgColorMode() === t3.getBgColorMode() && e3.getBgColor() === t3.getBgColor(); - } - __name(l, "l"); - function a(e3, t3) { - return e3.isInverse() === t3.isInverse() && e3.isBold() === t3.isBold() && e3.isUnderline() === t3.isUnderline() && e3.isOverline() === t3.isOverline() && e3.isBlink() === t3.isBlink() && e3.isInvisible() === t3.isInvisible() && e3.isItalic() === t3.isItalic() && e3.isDim() === t3.isDim() && e3.isStrikethrough() === t3.isStrikethrough(); - } - __name(a, "a"); - class c extends i { - static { - __name(this, "c"); - } - constructor(e3, t3) { - super(e3), this._terminal = t3, this._rowIndex = 0, this._allRows = new Array(), this._allRowSeparators = new Array(), this._currentRow = "", this._nullCellCount = 0, this._cursorStyle = this._buffer.getNullCell(), this._cursorStyleRow = 0, this._cursorStyleCol = 0, this._backgroundCell = this._buffer.getNullCell(), this._firstRow = 0, this._lastCursorRow = 0, this._lastCursorCol = 0, this._lastContentCursorRow = 0, this._lastContentCursorCol = 0, this._thisRowLastChar = this._buffer.getNullCell(), this._thisRowLastSecondChar = this._buffer.getNullCell(), this._nextRowFirstChar = this._buffer.getNullCell(); - } - _beforeSerialize(e3, t3, s2) { - this._allRows = new Array(e3), this._lastContentCursorRow = t3, this._lastCursorRow = t3, this._firstRow = t3; - } - _rowEnd(e3, t3) { - this._nullCellCount > 0 && !l(this._cursorStyle, this._backgroundCell) && (this._currentRow += `\x1B[${this._nullCellCount}X`); - let s2 = ""; - if (!t3) { - e3 - this._firstRow >= this._terminal.rows && this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol, this._backgroundCell); - const t4 = this._buffer.getLine(e3), r2 = this._buffer.getLine(e3 + 1); - if (r2.isWrapped) { - s2 = ""; - const o2 = t4.getCell(t4.length - 1, this._thisRowLastChar), i2 = t4.getCell(t4.length - 2, this._thisRowLastSecondChar), n2 = r2.getCell(0, this._nextRowFirstChar), a2 = n2.getWidth() > 1; - let c2 = false; - (n2.getChars() && a2 ? this._nullCellCount <= 1 : this._nullCellCount <= 0) && ((o2.getChars() || 0 === o2.getWidth()) && l(o2, n2) && (c2 = true), a2 && (i2.getChars() || 0 === i2.getWidth()) && l(o2, n2) && l(i2, n2) && (c2 = true)), c2 || (s2 = "-".repeat(this._nullCellCount + 1), s2 += "\x1B[1D\x1B[1X", this._nullCellCount > 0 && (s2 += "\x1B[A", s2 += `\x1B[${t4.length - this._nullCellCount}C`, s2 += `\x1B[${this._nullCellCount}X`, s2 += `\x1B[${t4.length - this._nullCellCount}D`, s2 += "\x1B[B"), this._lastContentCursorRow = e3 + 1, this._lastContentCursorCol = 0, this._lastCursorRow = e3 + 1, this._lastCursorCol = 0); - } else s2 = "\r\n", this._lastCursorRow = e3 + 1, this._lastCursorCol = 0; - } - this._allRows[this._rowIndex] = this._currentRow, this._allRowSeparators[this._rowIndex++] = s2, this._currentRow = "", this._nullCellCount = 0; - } - _diffStyle(e3, t3) { - const s2 = [], r2 = !n(e3, t3), o2 = !l(e3, t3), i2 = !a(e3, t3); - if (r2 || o2 || i2) if (e3.isAttributeDefault()) t3.isAttributeDefault() || s2.push(0); - else { - if (r2) { - const t4 = e3.getFgColor(); - e3.isFgRGB() ? s2.push(38, 2, t4 >>> 16 & 255, t4 >>> 8 & 255, 255 & t4) : e3.isFgPalette() ? t4 >= 16 ? s2.push(38, 5, t4) : s2.push(8 & t4 ? 90 + (7 & t4) : 30 + (7 & t4)) : s2.push(39); - } - if (o2) { - const t4 = e3.getBgColor(); - e3.isBgRGB() ? s2.push(48, 2, t4 >>> 16 & 255, t4 >>> 8 & 255, 255 & t4) : e3.isBgPalette() ? t4 >= 16 ? s2.push(48, 5, t4) : s2.push(8 & t4 ? 100 + (7 & t4) : 40 + (7 & t4)) : s2.push(49); - } - i2 && (e3.isInverse() !== t3.isInverse() && s2.push(e3.isInverse() ? 7 : 27), e3.isBold() !== t3.isBold() && s2.push(e3.isBold() ? 1 : 22), e3.isUnderline() !== t3.isUnderline() && s2.push(e3.isUnderline() ? 4 : 24), e3.isOverline() !== t3.isOverline() && s2.push(e3.isOverline() ? 53 : 55), e3.isBlink() !== t3.isBlink() && s2.push(e3.isBlink() ? 5 : 25), e3.isInvisible() !== t3.isInvisible() && s2.push(e3.isInvisible() ? 8 : 28), e3.isItalic() !== t3.isItalic() && s2.push(e3.isItalic() ? 3 : 23), e3.isDim() !== t3.isDim() && s2.push(e3.isDim() ? 2 : 22), e3.isStrikethrough() !== t3.isStrikethrough() && s2.push(e3.isStrikethrough() ? 9 : 29)); - } - return s2; - } - _nextCell(e3, t3, s2, r2) { - if (0 === e3.getWidth()) return; - const o2 = "" === e3.getChars(), i2 = this._diffStyle(e3, this._cursorStyle); - if (o2 ? !l(this._cursorStyle, e3) : i2.length > 0) { - this._nullCellCount > 0 && (l(this._cursorStyle, this._backgroundCell) || (this._currentRow += `\x1B[${this._nullCellCount}X`), this._currentRow += `\x1B[${this._nullCellCount}C`, this._nullCellCount = 0), this._lastContentCursorRow = this._lastCursorRow = s2, this._lastContentCursorCol = this._lastCursorCol = r2, this._currentRow += `\x1B[${i2.join(";")}m`; - const e4 = this._buffer.getLine(s2); - void 0 !== e4 && (e4.getCell(r2, this._cursorStyle), this._cursorStyleRow = s2, this._cursorStyleCol = r2); - } - o2 ? this._nullCellCount += e3.getWidth() : (this._nullCellCount > 0 && (l(this._cursorStyle, this._backgroundCell) || (this._currentRow += `\x1B[${this._nullCellCount}X`), this._currentRow += `\x1B[${this._nullCellCount}C`, this._nullCellCount = 0), this._currentRow += e3.getChars(), this._lastContentCursorRow = this._lastCursorRow = s2, this._lastContentCursorCol = this._lastCursorCol = r2 + e3.getWidth()); - } - _serializeString(e3) { - let t3 = this._allRows.length; - this._buffer.length - this._firstRow <= this._terminal.rows && (t3 = this._lastContentCursorRow + 1 - this._firstRow, this._lastCursorCol = this._lastContentCursorCol, this._lastCursorRow = this._lastContentCursorRow); - let s2 = ""; - for (let e4 = 0; e4 < t3; e4++) s2 += this._allRows[e4], e4 + 1 < t3 && (s2 += this._allRowSeparators[e4]); - if (!e3) { - const e4 = this._buffer.baseY + this._buffer.cursorY, t4 = this._buffer.cursorX, o3 = /* @__PURE__ */ __name((e5) => { - e5 > 0 ? s2 += `\x1B[${e5}C` : e5 < 0 && (s2 += `\x1B[${-e5}D`); - }, "o"); - (e4 !== this._lastCursorRow || t4 !== this._lastCursorCol) && ((r2 = e4 - this._lastCursorRow) > 0 ? s2 += `\x1B[${r2}B` : r2 < 0 && (s2 += `\x1B[${-r2}A`), o3(t4 - this._lastCursorCol)); - } - var r2; - const o2 = this._terminal._core._inputHandler._curAttrData, i2 = this._diffStyle(o2, this._cursorStyle); - return i2.length > 0 && (s2 += `\x1B[${i2.join(";")}m`), s2; - } - } - e2.SerializeAddon = class { - activate(e3) { - this._terminal = e3; - } - _serializeBufferByScrollback(e3, t3, s2) { - const r2 = t3.length, i2 = void 0 === s2 ? r2 : o(s2 + e3.rows, 0, r2); - return this._serializeBufferByRange(e3, t3, { start: r2 - i2, end: r2 - 1 }, false); - } - _serializeBufferByRange(e3, t3, s2, r2) { - return new c(t3, e3).serialize({ start: { x: 0, y: "number" == typeof s2.start ? s2.start : s2.start.line }, end: { x: e3.cols, y: "number" == typeof s2.end ? s2.end : s2.end.line } }, r2); - } - _serializeBufferAsHTML(e3, t3) { - const s2 = e3.buffer.active, r2 = new h(s2, e3, t3); - if (!t3.onlySelection) { - const i3 = s2.length, n2 = t3.scrollback, l2 = void 0 === n2 ? i3 : o(n2 + e3.rows, 0, i3); - return r2.serialize({ start: { x: 0, y: i3 - l2 }, end: { x: e3.cols, y: i3 - 1 } }); - } - const i2 = this._terminal?.getSelectionPosition(); - return void 0 !== i2 ? r2.serialize({ start: { x: i2.start.x, y: i2.start.y }, end: { x: i2.end.x, y: i2.end.y } }) : ""; - } - _serializeModes(e3) { - let t3 = ""; - const s2 = e3.modes; - if (s2.applicationCursorKeysMode && (t3 += "\x1B[?1h"), s2.applicationKeypadMode && (t3 += "\x1B[?66h"), s2.bracketedPasteMode && (t3 += "\x1B[?2004h"), s2.insertMode && (t3 += "\x1B[4h"), s2.originMode && (t3 += "\x1B[?6h"), s2.reverseWraparoundMode && (t3 += "\x1B[?45h"), s2.sendFocusMode && (t3 += "\x1B[?1004h"), false === s2.wraparoundMode && (t3 += "\x1B[?7l"), "none" !== s2.mouseTrackingMode) switch (s2.mouseTrackingMode) { - case "x10": - t3 += "\x1B[?9h"; - break; - case "vt200": - t3 += "\x1B[?1000h"; - break; - case "drag": - t3 += "\x1B[?1002h"; - break; - case "any": - t3 += "\x1B[?1003h"; - } - return t3; - } - serialize(e3) { - if (!this._terminal) throw new Error("Cannot use addon until it has been loaded"); - let t3 = e3?.range ? this._serializeBufferByRange(this._terminal, this._terminal.buffer.normal, e3.range, true) : this._serializeBufferByScrollback(this._terminal, this._terminal.buffer.normal, e3?.scrollback); - return e3?.excludeAltBuffer || "alternate" !== this._terminal.buffer.active.type || (t3 += `\x1B[?1049h\x1B[H${this._serializeBufferByScrollback(this._terminal, this._terminal.buffer.alternate, void 0)}`), e3?.excludeModes || (t3 += this._serializeModes(this._terminal)), t3; - } - serializeAsHTML(e3) { - if (!this._terminal) throw new Error("Cannot use addon until it has been loaded"); - return this._serializeBufferAsHTML(this._terminal, e3 || {}); - } - dispose() { - } - }; - class h extends i { - static { - __name(this, "h"); - } - constructor(e3, s2, r2) { - super(e3), this._terminal = s2, this._options = r2, this._currentRow = "", this._htmlContent = "", s2._core._themeService ? this._ansiColors = s2._core._themeService.colors.ansi : this._ansiColors = t2.DEFAULT_ANSI_COLORS; - } - _padStart(e3, t3, s2) { - return t3 >>= 0, s2 = s2 ?? " ", e3.length > t3 ? e3 : ((t3 -= e3.length) > s2.length && (s2 += s2.repeat(t3 / s2.length)), s2.slice(0, t3) + e3); - } - _beforeSerialize(e3, t3, s2) { - this._htmlContent += "
";
-          let r2 = "#000000", o2 = "#ffffff";
-          this._options.includeGlobalBackground && (r2 = this._terminal.options.theme?.foreground ?? "#ffffff", o2 = this._terminal.options.theme?.background ?? "#000000");
-          const i2 = [];
-          i2.push("color: " + r2 + ";"), i2.push("background-color: " + o2 + ";"), i2.push("font-family: " + this._terminal.options.fontFamily + ";"), i2.push("font-size: " + this._terminal.options.fontSize + "px;"), this._htmlContent += "
"; - } - _afterSerialize() { - this._htmlContent += "
", this._htmlContent += "
"; - } - _rowEnd(e3, t3) { - this._htmlContent += "
" + this._currentRow + "
", this._currentRow = ""; - } - _getHexColor(e3, t3) { - const s2 = t3 ? e3.getFgColor() : e3.getBgColor(); - return (t3 ? e3.isFgRGB() : e3.isBgRGB()) ? "#" + [s2 >> 16 & 255, s2 >> 8 & 255, 255 & s2].map((e4) => this._padStart(e4.toString(16), 2, "0")).join("") : (t3 ? e3.isFgPalette() : e3.isBgPalette()) ? this._ansiColors[s2].css : void 0; - } - _diffStyle(e3, t3) { - const s2 = [], r2 = !n(e3, t3), o2 = !l(e3, t3), i2 = !a(e3, t3); - if (r2 || o2 || i2) { - const t4 = this._getHexColor(e3, true); - t4 && s2.push("color: " + t4 + ";"); - const r3 = this._getHexColor(e3, false); - return r3 && s2.push("background-color: " + r3 + ";"), e3.isInverse() && s2.push("color: #000000; background-color: #BFBFBF;"), e3.isBold() && s2.push("font-weight: bold;"), e3.isUnderline() && e3.isOverline() ? s2.push("text-decoration: overline underline;") : e3.isUnderline() ? s2.push("text-decoration: underline;") : e3.isOverline() && s2.push("text-decoration: overline;"), e3.isBlink() && s2.push("text-decoration: blink;"), e3.isInvisible() && s2.push("visibility: hidden;"), e3.isItalic() && s2.push("font-style: italic;"), e3.isDim() && s2.push("opacity: 0.5;"), e3.isStrikethrough() && s2.push("text-decoration: line-through;"), s2; - } - } - _nextCell(e3, t3, s2, r2) { - if (0 === e3.getWidth()) return; - const o2 = "" === e3.getChars(), i2 = this._diffStyle(e3, t3); - i2 && (this._currentRow += 0 === i2.length ? "" : ""), this._currentRow += o2 ? " " : e3.getChars(); - } - _serializeString() { - return this._htmlContent; - } - } - e2.HTMLSerializeHandler = h; - })(), r; - })()); -})(addonSerialize$2, addonSerialize$2.exports); -var addonSerializeExports = addonSerialize$2.exports; -const addonSerialize$1 = /* @__PURE__ */ getDefaultExportFromCjs(addonSerializeExports); -function useTerminalBuffer() { - const serializeAddon = new addonSerializeExports.SerializeAddon(); - const terminal = markRaw(new xtermExports.Terminal({ convertEol: true })); - const copyTo = /* @__PURE__ */ __name((destinationTerminal) => { - destinationTerminal.write(serializeAddon.serialize()); - }, "copyTo"); - const write = /* @__PURE__ */ __name((message) => terminal.write(message), "write"); - const serialize = /* @__PURE__ */ __name(() => serializeAddon.serialize(), "serialize"); - onMounted(() => { - terminal.loadAddon(serializeAddon); - }); - onUnmounted(() => { - terminal.dispose(); - }); - return { - copyTo, - serialize, - write - }; -} -__name(useTerminalBuffer, "useTerminalBuffer"); -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "TerminalOutputDrawer", - props: /* @__PURE__ */ mergeModels({ - header: {}, - defaultMessage: {} - }, { - "modelValue": { type: Boolean, ...{ required: true } }, - "modelModifiers": {} - }), - emits: ["update:modelValue"], - setup(__props) { - const terminalVisible = useModel(__props, "modelValue"); - const props = __props; - const electron = electronAPI(); - const buffer = useTerminalBuffer(); - let xterm = null; - const terminalCreated = /* @__PURE__ */ __name(({ terminal, useAutoSize }, root) => { - xterm = terminal; - useAutoSize({ root, autoRows: true, autoCols: true }); - terminal.write(props.defaultMessage); - buffer.copyTo(terminal); - terminal.options.cursorBlink = false; - terminal.options.cursorStyle = "bar"; - terminal.options.cursorInactiveStyle = "bar"; - terminal.options.disableStdin = true; - }, "terminalCreated"); - const terminalUnmounted = /* @__PURE__ */ __name(() => { - xterm = null; - }, "terminalUnmounted"); - onMounted(async () => { - electron.onLogMessage((message) => { - buffer.write(message); - xterm?.write(message); - }); - }); - return (_ctx, _cache) => { - return openBlock(), createBlock(unref(script), { - visible: terminalVisible.value, - "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => terminalVisible.value = $event), - header: _ctx.header, - position: "bottom", - style: { "height": "max(50vh, 34rem)" } - }, { - default: withCtx(() => [ - createVNode(BaseTerminal, { - onCreated: terminalCreated, - onUnmounted: terminalUnmounted - }) - ]), - _: 1 - }, 8, ["visible", "header"]); - }; - } -}); -export { - _sfc_main as _ -}; -//# sourceMappingURL=TerminalOutputDrawer-B_NZxAv8.js.map diff --git a/comfy/web/assets/TerminalOutputDrawer-B_NZxAv8.js.map b/comfy/web/assets/TerminalOutputDrawer-B_NZxAv8.js.map deleted file mode 100644 index 934d02332..000000000 --- a/comfy/web/assets/TerminalOutputDrawer-B_NZxAv8.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TerminalOutputDrawer-B_NZxAv8.js","sources":["../../../../../node_modules/@xterm/addon-serialize/lib/addon-serialize.js","../../src/composables/bottomPanelTabs/useTerminalBuffer.ts","../../src/components/maintenance/TerminalOutputDrawer.vue"],"sourcesContent":["!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.SerializeAddon=t():e.SerializeAddon=t()}(this,(()=>(()=>{\"use strict\";var e={930:(e,t,s)=>{Object.defineProperty(t,\"__esModule\",{value:!0}),t.ColorContrastCache=void 0;const r=s(485);t.ColorContrastCache=class{constructor(){this._color=new r.TwoKeyMap,this._css=new r.TwoKeyMap}setCss(e,t,s){this._css.set(e,t,s)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,s){this._color.set(e,t,s)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},997:function(e,t,s){var r=this&&this.__decorate||function(e,t,s,r){var o,i=arguments.length,n=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,s):r;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)n=Reflect.decorate(e,t,s,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(i<3?o(n):i>3?o(t,s,n):o(t,s))||n);return i>3&&n&&Object.defineProperty(t,s,n),n},o=this&&this.__param||function(e,t){return function(s,r){t(s,r,e)}};Object.defineProperty(t,\"__esModule\",{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;const i=s(930),n=s(160),l=s(345),a=s(859),c=s(97),h=n.css.toColor(\"#ffffff\"),u=n.css.toColor(\"#000000\"),_=n.css.toColor(\"#ffffff\"),d=n.css.toColor(\"#000000\"),C={css:\"rgba(255, 255, 255, 0.3)\",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const e=[n.css.toColor(\"#2e3436\"),n.css.toColor(\"#cc0000\"),n.css.toColor(\"#4e9a06\"),n.css.toColor(\"#c4a000\"),n.css.toColor(\"#3465a4\"),n.css.toColor(\"#75507b\"),n.css.toColor(\"#06989a\"),n.css.toColor(\"#d3d7cf\"),n.css.toColor(\"#555753\"),n.css.toColor(\"#ef2929\"),n.css.toColor(\"#8ae234\"),n.css.toColor(\"#fce94f\"),n.css.toColor(\"#729fcf\"),n.css.toColor(\"#ad7fa8\"),n.css.toColor(\"#34e2e2\"),n.css.toColor(\"#eeeeec\")],t=[0,95,135,175,215,255];for(let s=0;s<216;s++){const r=t[s/36%6|0],o=t[s/6%6|0],i=t[s%6];e.push({css:n.channels.toCss(r,o,i),rgba:n.channels.toRgba(r,o,i)})}for(let t=0;t<24;t++){const s=8+10*t;e.push({css:n.channels.toCss(s,s,s),rgba:n.channels.toRgba(s,s,s)})}return e})());let f=t.ThemeService=class extends a.Disposable{get colors(){return this._colors}constructor(e){super(),this._optionsService=e,this._contrastCache=new i.ColorContrastCache,this._halfContrastCache=new i.ColorContrastCache,this._onChangeColors=this.register(new l.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:h,background:u,cursor:_,cursorAccent:d,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:n.color.blend(u,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:n.color.blend(u,C),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange(\"minimumContrastRatio\",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange(\"theme\",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(e={}){const s=this._colors;if(s.foreground=g(e.foreground,h),s.background=g(e.background,u),s.cursor=g(e.cursor,_),s.cursorAccent=g(e.cursorAccent,d),s.selectionBackgroundTransparent=g(e.selectionBackground,C),s.selectionBackgroundOpaque=n.color.blend(s.background,s.selectionBackgroundTransparent),s.selectionInactiveBackgroundTransparent=g(e.selectionInactiveBackground,s.selectionBackgroundTransparent),s.selectionInactiveBackgroundOpaque=n.color.blend(s.background,s.selectionInactiveBackgroundTransparent),s.selectionForeground=e.selectionForeground?g(e.selectionForeground,n.NULL_COLOR):void 0,s.selectionForeground===n.NULL_COLOR&&(s.selectionForeground=void 0),n.color.isOpaque(s.selectionBackgroundTransparent)){const e=.3;s.selectionBackgroundTransparent=n.color.opacity(s.selectionBackgroundTransparent,e)}if(n.color.isOpaque(s.selectionInactiveBackgroundTransparent)){const e=.3;s.selectionInactiveBackgroundTransparent=n.color.opacity(s.selectionInactiveBackgroundTransparent,e)}if(s.ansi=t.DEFAULT_ANSI_COLORS.slice(),s.ansi[0]=g(e.black,t.DEFAULT_ANSI_COLORS[0]),s.ansi[1]=g(e.red,t.DEFAULT_ANSI_COLORS[1]),s.ansi[2]=g(e.green,t.DEFAULT_ANSI_COLORS[2]),s.ansi[3]=g(e.yellow,t.DEFAULT_ANSI_COLORS[3]),s.ansi[4]=g(e.blue,t.DEFAULT_ANSI_COLORS[4]),s.ansi[5]=g(e.magenta,t.DEFAULT_ANSI_COLORS[5]),s.ansi[6]=g(e.cyan,t.DEFAULT_ANSI_COLORS[6]),s.ansi[7]=g(e.white,t.DEFAULT_ANSI_COLORS[7]),s.ansi[8]=g(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),s.ansi[9]=g(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),s.ansi[10]=g(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),s.ansi[11]=g(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),s.ansi[12]=g(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),s.ansi[13]=g(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),s.ansi[14]=g(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),s.ansi[15]=g(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),e.extendedAnsi){const r=Math.min(s.ansi.length-16,e.extendedAnsi.length);for(let o=0;o{Object.defineProperty(t,\"__esModule\",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let s=0,r=0,o=0,i=0;var n,l,a,c,h;function u(e){const t=e.toString(16);return t.length<2?\"0\"+t:t}function _(e,t){return e>>0},e.toColor=function(t,s,r,o){return{css:e.toCss(t,s,r,o),rgba:e.toRgba(t,s,r,o)}}}(n||(t.channels=n={})),function(e){function t(e,t){return i=Math.round(255*t),[s,r,o]=h.toChannels(e.rgba),{css:n.toCss(s,r,o,i),rgba:n.toRgba(s,r,o,i)}}e.blend=function(e,t){if(i=(255&t.rgba)/255,1===i)return{css:t.css,rgba:t.rgba};const l=t.rgba>>24&255,a=t.rgba>>16&255,c=t.rgba>>8&255,h=e.rgba>>24&255,u=e.rgba>>16&255,_=e.rgba>>8&255;return s=h+Math.round((l-h)*i),r=u+Math.round((a-u)*i),o=_+Math.round((c-_)*i),{css:n.toCss(s,r,o),rgba:n.toRgba(s,r,o)}},e.isOpaque=function(e){return 255==(255&e.rgba)},e.ensureContrastRatio=function(e,t,s){const r=h.ensureContrastRatio(e.rgba,t.rgba,s);if(r)return n.toColor(r>>24&255,r>>16&255,r>>8&255)},e.opaque=function(e){const t=(255|e.rgba)>>>0;return[s,r,o]=h.toChannels(t),{css:n.toCss(s,r,o),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,s){return i=255&e.rgba,t(e,i*s/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(l||(t.color=l={})),function(e){let t,l;try{const e=document.createElement(\"canvas\");e.width=1,e.height=1;const s=e.getContext(\"2d\",{willReadFrequently:!0});s&&(t=s,t.globalCompositeOperation=\"copy\",l=t.createLinearGradient(0,0,1,1))}catch{}e.toColor=function(e){if(e.match(/#[\\da-f]{3,8}/i))switch(e.length){case 4:return s=parseInt(e.slice(1,2).repeat(2),16),r=parseInt(e.slice(2,3).repeat(2),16),o=parseInt(e.slice(3,4).repeat(2),16),n.toColor(s,r,o);case 5:return s=parseInt(e.slice(1,2).repeat(2),16),r=parseInt(e.slice(2,3).repeat(2),16),o=parseInt(e.slice(3,4).repeat(2),16),i=parseInt(e.slice(4,5).repeat(2),16),n.toColor(s,r,o,i);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}const a=e.match(/rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*(,\\s*(0|1|\\d?\\.(\\d+))\\s*)?\\)/);if(a)return s=parseInt(a[1]),r=parseInt(a[2]),o=parseInt(a[3]),i=Math.round(255*(void 0===a[5]?1:parseFloat(a[5]))),n.toColor(s,r,o,i);if(!t||!l)throw new Error(\"css.toColor: Unsupported css format\");if(t.fillStyle=l,t.fillStyle=e,\"string\"!=typeof t.fillStyle)throw new Error(\"css.toColor: Unsupported css format\");if(t.fillRect(0,0,1,1),[s,r,o,i]=t.getImageData(0,0,1,1).data,255!==i)throw new Error(\"css.toColor: Unsupported css format\");return{rgba:n.toRgba(s,r,o,i),css:e}}}(a||(t.css=a={})),function(e){function t(e,t,s){const r=e/255,o=t/255,i=s/255;return.2126*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.7152*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(c||(t.rgb=c={})),function(e){function t(e,t,s){const r=e>>24&255,o=e>>16&255,i=e>>8&255;let n=t>>24&255,l=t>>16&255,a=t>>8&255,h=_(c.relativeLuminance2(n,l,a),c.relativeLuminance2(r,o,i));for(;h0||l>0||a>0);)n-=Math.max(0,Math.ceil(.1*n)),l-=Math.max(0,Math.ceil(.1*l)),a-=Math.max(0,Math.ceil(.1*a)),h=_(c.relativeLuminance2(n,l,a),c.relativeLuminance2(r,o,i));return(n<<24|l<<16|a<<8|255)>>>0}function l(e,t,s){const r=e>>24&255,o=e>>16&255,i=e>>8&255;let n=t>>24&255,l=t>>16&255,a=t>>8&255,h=_(c.relativeLuminance2(n,l,a),c.relativeLuminance2(r,o,i));for(;h>>0}e.blend=function(e,t){if(i=(255&t)/255,1===i)return t;const l=t>>24&255,a=t>>16&255,c=t>>8&255,h=e>>24&255,u=e>>16&255,_=e>>8&255;return s=h+Math.round((l-h)*i),r=u+Math.round((a-u)*i),o=_+Math.round((c-_)*i),n.toRgba(s,r,o)},e.ensureContrastRatio=function(e,s,r){const o=c.relativeLuminance(e>>8),i=c.relativeLuminance(s>>8);if(_(o,i)>8));if(n_(o,c.relativeLuminance(t>>8))?i:t}return i}const n=l(e,s,r),a=_(o,c.relativeLuminance(n>>8));if(a_(o,c.relativeLuminance(i>>8))?n:i}return n}},e.reduceLuminance=t,e.increaseLuminance=l,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]}}(h||(t.rgba=h={})),t.toPaddedHex=u,t.contrastRatio=_},345:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed)for(let t=0;tt.fire(e)))},t.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))}},859:(e,t)=>{function s(e){for(const t of e)t.dispose();e.length=0}Object.defineProperty(t,\"__esModule\",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){const t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=s,t.getDisposeArrayDisposable=function(e){return{dispose:()=>s(e)}}},485:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class s{constructor(){this._data={}}set(e,t,s){this._data[e]||(this._data[e]={}),this._data[e][t]=s}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=s,t.FourKeyMap=class{constructor(){this._data=new s}set(e,t,r,o,i){this._data.get(e,t)||this._data.set(e,t,new s),this._data.get(e,t).set(r,o,i)}get(e,t,s,r){return this._data.get(e,t)?.get(s,r)}clear(){this._data.clear()}}},726:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const s=\"di$target\",r=\"di$dependencies\";t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[r]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);const o=function(e,t,i){if(3!==arguments.length)throw new Error(\"@IServiceName-decorator can only be used to decorate a parameter\");!function(e,t,o){t[s]===t?t[r].push({id:e,index:o}):(t[r]=[{id:e,index:o}],t[s]=t)}(o,e,i)};return o.toString=()=>e,t.serviceRegistry.set(e,o),o}},97:(e,t,s)=>{Object.defineProperty(t,\"__esModule\",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const r=s(726);var o;t.IBufferService=(0,r.createDecorator)(\"BufferService\"),t.ICoreMouseService=(0,r.createDecorator)(\"CoreMouseService\"),t.ICoreService=(0,r.createDecorator)(\"CoreService\"),t.ICharsetService=(0,r.createDecorator)(\"CharsetService\"),t.IInstantiationService=(0,r.createDecorator)(\"InstantiationService\"),function(e){e[e.TRACE=0]=\"TRACE\",e[e.DEBUG=1]=\"DEBUG\",e[e.INFO=2]=\"INFO\",e[e.WARN=3]=\"WARN\",e[e.ERROR=4]=\"ERROR\",e[e.OFF=5]=\"OFF\"}(o||(t.LogLevelEnum=o={})),t.ILogService=(0,r.createDecorator)(\"LogService\"),t.IOptionsService=(0,r.createDecorator)(\"OptionsService\"),t.IOscLinkService=(0,r.createDecorator)(\"OscLinkService\"),t.IUnicodeService=(0,r.createDecorator)(\"UnicodeService\"),t.IDecorationService=(0,r.createDecorator)(\"DecorationService\")}},t={};function s(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,s),i.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,\"__esModule\",{value:!0}),e.HTMLSerializeHandler=e.SerializeAddon=void 0;const t=s(997);function o(e,t,s){return Math.max(t,Math.min(e,s))}class i{constructor(e){this._buffer=e}serialize(e,t){const s=this._buffer.getNullCell(),r=this._buffer.getNullCell();let o=s;const i=e.start.y,n=e.end.y,l=e.start.x,a=e.end.x;this._beforeSerialize(n-i,i,n);for(let t=i;t<=n;t++){const i=this._buffer.getLine(t);if(i){const n=t===e.start.y?l:0,c=t===e.end.y?a:i.length;for(let e=n;e0&&!l(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\u001b[${this._nullCellCount}X`);let s=\"\";if(!t){e-this._firstRow>=this._terminal.rows&&this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol,this._backgroundCell);const t=this._buffer.getLine(e),r=this._buffer.getLine(e+1);if(r.isWrapped){s=\"\";const o=t.getCell(t.length-1,this._thisRowLastChar),i=t.getCell(t.length-2,this._thisRowLastSecondChar),n=r.getCell(0,this._nextRowFirstChar),a=n.getWidth()>1;let c=!1;(n.getChars()&&a?this._nullCellCount<=1:this._nullCellCount<=0)&&((o.getChars()||0===o.getWidth())&&l(o,n)&&(c=!0),a&&(i.getChars()||0===i.getWidth())&&l(o,n)&&l(i,n)&&(c=!0)),c||(s=\"-\".repeat(this._nullCellCount+1),s+=\"\u001b[1D\u001b[1X\",this._nullCellCount>0&&(s+=\"\u001b[A\",s+=`\u001b[${t.length-this._nullCellCount}C`,s+=`\u001b[${this._nullCellCount}X`,s+=`\u001b[${t.length-this._nullCellCount}D`,s+=\"\u001b[B\"),this._lastContentCursorRow=e+1,this._lastContentCursorCol=0,this._lastCursorRow=e+1,this._lastCursorCol=0)}else s=\"\\r\\n\",this._lastCursorRow=e+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=s,this._currentRow=\"\",this._nullCellCount=0}_diffStyle(e,t){const s=[],r=!n(e,t),o=!l(e,t),i=!a(e,t);if(r||o||i)if(e.isAttributeDefault())t.isAttributeDefault()||s.push(0);else{if(r){const t=e.getFgColor();e.isFgRGB()?s.push(38,2,t>>>16&255,t>>>8&255,255&t):e.isFgPalette()?t>=16?s.push(38,5,t):s.push(8&t?90+(7&t):30+(7&t)):s.push(39)}if(o){const t=e.getBgColor();e.isBgRGB()?s.push(48,2,t>>>16&255,t>>>8&255,255&t):e.isBgPalette()?t>=16?s.push(48,5,t):s.push(8&t?100+(7&t):40+(7&t)):s.push(49)}i&&(e.isInverse()!==t.isInverse()&&s.push(e.isInverse()?7:27),e.isBold()!==t.isBold()&&s.push(e.isBold()?1:22),e.isUnderline()!==t.isUnderline()&&s.push(e.isUnderline()?4:24),e.isOverline()!==t.isOverline()&&s.push(e.isOverline()?53:55),e.isBlink()!==t.isBlink()&&s.push(e.isBlink()?5:25),e.isInvisible()!==t.isInvisible()&&s.push(e.isInvisible()?8:28),e.isItalic()!==t.isItalic()&&s.push(e.isItalic()?3:23),e.isDim()!==t.isDim()&&s.push(e.isDim()?2:22),e.isStrikethrough()!==t.isStrikethrough()&&s.push(e.isStrikethrough()?9:29))}return s}_nextCell(e,t,s,r){if(0===e.getWidth())return;const o=\"\"===e.getChars(),i=this._diffStyle(e,this._cursorStyle);if(o?!l(this._cursorStyle,e):i.length>0){this._nullCellCount>0&&(l(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\u001b[${this._nullCellCount}X`),this._currentRow+=`\u001b[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=s,this._lastContentCursorCol=this._lastCursorCol=r,this._currentRow+=`\u001b[${i.join(\";\")}m`;const e=this._buffer.getLine(s);void 0!==e&&(e.getCell(r,this._cursorStyle),this._cursorStyleRow=s,this._cursorStyleCol=r)}o?this._nullCellCount+=e.getWidth():(this._nullCellCount>0&&(l(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\u001b[${this._nullCellCount}X`),this._currentRow+=`\u001b[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=e.getChars(),this._lastContentCursorRow=this._lastCursorRow=s,this._lastContentCursorCol=this._lastCursorCol=r+e.getWidth())}_serializeString(e){let t=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(t=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let s=\"\";for(let e=0;e{e>0?s+=`\u001b[${e}C`:e<0&&(s+=`\u001b[${-e}D`)};(e!==this._lastCursorRow||t!==this._lastCursorCol)&&((r=e-this._lastCursorRow)>0?s+=`\u001b[${r}B`:r<0&&(s+=`\u001b[${-r}A`),o(t-this._lastCursorCol))}var r;const o=this._terminal._core._inputHandler._curAttrData,i=this._diffStyle(o,this._cursorStyle);return i.length>0&&(s+=`\u001b[${i.join(\";\")}m`),s}}e.SerializeAddon=class{activate(e){this._terminal=e}_serializeBufferByScrollback(e,t,s){const r=t.length,i=void 0===s?r:o(s+e.rows,0,r);return this._serializeBufferByRange(e,t,{start:r-i,end:r-1},!1)}_serializeBufferByRange(e,t,s,r){return new c(t,e).serialize({start:{x:0,y:\"number\"==typeof s.start?s.start:s.start.line},end:{x:e.cols,y:\"number\"==typeof s.end?s.end:s.end.line}},r)}_serializeBufferAsHTML(e,t){const s=e.buffer.active,r=new h(s,e,t);if(!t.onlySelection){const i=s.length,n=t.scrollback,l=void 0===n?i:o(n+e.rows,0,i);return r.serialize({start:{x:0,y:i-l},end:{x:e.cols,y:i-1}})}const i=this._terminal?.getSelectionPosition();return void 0!==i?r.serialize({start:{x:i.start.x,y:i.start.y},end:{x:i.end.x,y:i.end.y}}):\"\"}_serializeModes(e){let t=\"\";const s=e.modes;if(s.applicationCursorKeysMode&&(t+=\"\u001b[?1h\"),s.applicationKeypadMode&&(t+=\"\u001b[?66h\"),s.bracketedPasteMode&&(t+=\"\u001b[?2004h\"),s.insertMode&&(t+=\"\u001b[4h\"),s.originMode&&(t+=\"\u001b[?6h\"),s.reverseWraparoundMode&&(t+=\"\u001b[?45h\"),s.sendFocusMode&&(t+=\"\u001b[?1004h\"),!1===s.wraparoundMode&&(t+=\"\u001b[?7l\"),\"none\"!==s.mouseTrackingMode)switch(s.mouseTrackingMode){case\"x10\":t+=\"\u001b[?9h\";break;case\"vt200\":t+=\"\u001b[?1000h\";break;case\"drag\":t+=\"\u001b[?1002h\";break;case\"any\":t+=\"\u001b[?1003h\"}return t}serialize(e){if(!this._terminal)throw new Error(\"Cannot use addon until it has been loaded\");let t=e?.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,e.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,e?.scrollback);return e?.excludeAltBuffer||\"alternate\"!==this._terminal.buffer.active.type||(t+=`\u001b[?1049h\u001b[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),e?.excludeModes||(t+=this._serializeModes(this._terminal)),t}serializeAsHTML(e){if(!this._terminal)throw new Error(\"Cannot use addon until it has been loaded\");return this._serializeBufferAsHTML(this._terminal,e||{})}dispose(){}};class h extends i{constructor(e,s,r){super(e),this._terminal=s,this._options=r,this._currentRow=\"\",this._htmlContent=\"\",s._core._themeService?this._ansiColors=s._core._themeService.colors.ansi:this._ansiColors=t.DEFAULT_ANSI_COLORS}_padStart(e,t,s){return t>>=0,s=s??\" \",e.length>t?e:((t-=e.length)>s.length&&(s+=s.repeat(t/s.length)),s.slice(0,t)+e)}_beforeSerialize(e,t,s){this._htmlContent+=\"\\x3c!--StartFragment--\\x3e
\";let r=\"#000000\",o=\"#ffffff\";this._options.includeGlobalBackground&&(r=this._terminal.options.theme?.foreground??\"#ffffff\",o=this._terminal.options.theme?.background??\"#000000\");const i=[];i.push(\"color: \"+r+\";\"),i.push(\"background-color: \"+o+\";\"),i.push(\"font-family: \"+this._terminal.options.fontFamily+\";\"),i.push(\"font-size: \"+this._terminal.options.fontSize+\"px;\"),this._htmlContent+=\"
\"}_afterSerialize(){this._htmlContent+=\"
\",this._htmlContent+=\"
\\x3c!--EndFragment--\\x3e\"}_rowEnd(e,t){this._htmlContent+=\"
\"+this._currentRow+\"
\",this._currentRow=\"\"}_getHexColor(e,t){const s=t?e.getFgColor():e.getBgColor();return(t?e.isFgRGB():e.isBgRGB())?\"#\"+[s>>16&255,s>>8&255,255&s].map((e=>this._padStart(e.toString(16),2,\"0\"))).join(\"\"):(t?e.isFgPalette():e.isBgPalette())?this._ansiColors[s].css:void 0}_diffStyle(e,t){const s=[],r=!n(e,t),o=!l(e,t),i=!a(e,t);if(r||o||i){const t=this._getHexColor(e,!0);t&&s.push(\"color: \"+t+\";\");const r=this._getHexColor(e,!1);return r&&s.push(\"background-color: \"+r+\";\"),e.isInverse()&&s.push(\"color: #000000; background-color: #BFBFBF;\"),e.isBold()&&s.push(\"font-weight: bold;\"),e.isUnderline()&&e.isOverline()?s.push(\"text-decoration: overline underline;\"):e.isUnderline()?s.push(\"text-decoration: underline;\"):e.isOverline()&&s.push(\"text-decoration: overline;\"),e.isBlink()&&s.push(\"text-decoration: blink;\"),e.isInvisible()&&s.push(\"visibility: hidden;\"),e.isItalic()&&s.push(\"font-style: italic;\"),e.isDim()&&s.push(\"opacity: 0.5;\"),e.isStrikethrough()&&s.push(\"text-decoration: line-through;\"),s}}_nextCell(e,t,s,r){if(0===e.getWidth())return;const o=\"\"===e.getChars(),i=this._diffStyle(e,t);i&&(this._currentRow+=0===i.length?\"
\":\"\"),this._currentRow+=o?\" \":e.getChars()}_serializeString(){return this._htmlContent}}e.HTMLSerializeHandler=h})(),r})()));\n//# sourceMappingURL=addon-serialize.js.map","import { SerializeAddon } from '@xterm/addon-serialize'\nimport { Terminal } from '@xterm/xterm'\nimport { markRaw, onMounted, onUnmounted } from 'vue'\n\nexport function useTerminalBuffer() {\n const serializeAddon = new SerializeAddon()\n const terminal = markRaw(new Terminal({ convertEol: true }))\n\n const copyTo = (destinationTerminal: Terminal) => {\n destinationTerminal.write(serializeAddon.serialize())\n }\n\n const write = (message: string) => terminal.write(message)\n\n const serialize = () => serializeAddon.serialize()\n\n onMounted(() => {\n terminal.loadAddon(serializeAddon)\n })\n\n onUnmounted(() => {\n terminal.dispose()\n })\n\n return {\n copyTo,\n serialize,\n write\n }\n}\n","\n\n\n"],"names":["define","this","e","t","s","r","o","i","n","l","a","c","h","u","_","SerializeAddon","Terminal","_useModel"],"mappings":";;;;;;;AAAA,GA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M,QAAQ,wBAAC,YAAoB,SAAS,MAAM,OAAO,GAA3C;AAER,QAAA,YAAY,6BAAM,eAAe,UAAU,GAA/B;AAElB,YAAU,MAAM;AACd,aAAS,UAAU,cAAc;AAAA,EAAA,CAClC;AAED,cAAY,MAAM;AAChB,aAAS,QAAQ;AAAA,EAAA,CAClB;AAEM,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAzBgB;;;;;;;;;;;;ACkBV,UAAA,kBAAkBC,SAAuC,SAAA,YAAA;AAC/D,UAAM,QAAQ;AAKd,UAAM,WAAW,YAAY;AAG7B,UAAM,SAAS,kBAAkB;AACjC,QAAI,QAAyB;AAG7B,UAAM,kBAAkB,wBACtB,EAAE,UAAU,YAAA,GACZ,SACG;AACK,cAAA;AACR,kBAAY,EAAE,MAAM,UAAU,MAAM,UAAU,MAAM;AAC3C,eAAA,MAAM,MAAM,cAAc;AACnC,aAAO,OAAO,QAAQ;AAEtB,eAAS,QAAQ,cAAc;AAC/B,eAAS,QAAQ,cAAc;AAC/B,eAAS,QAAQ,sBAAsB;AACvC,eAAS,QAAQ,eAAe;AAAA,IAClC,GAbwB;AAexB,UAAM,oBAAoB,6BAAM;AACtB,cAAA;AAAA,IACV,GAF0B;AAI1B,cAAU,YAAY;AACX,eAAA,aAAa,CAAC,YAAoB;AACzC,eAAO,MAAM,OAAO;AACpB,eAAO,MAAM,OAAO;AAAA,MAAA,CACrB;AAAA,IAAA,CACF;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/comfy/web/assets/UserSelectView-ByltuBH7.js b/comfy/web/assets/UserSelectView-ByltuBH7.js deleted file mode 100644 index de21a1466..000000000 --- a/comfy/web/assets/UserSelectView-ByltuBH7.js +++ /dev/null @@ -1,101 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { d as defineComponent, av as useUserStore, br as useRouter, T as ref, c as computed, p as onMounted, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, k as createVNode, bs as withKeys, j as unref, bt as script, bu as script$1, bv as script$2, bw as script$3, ak as createTextVNode, B as createCommentVNode, l as script$4 } from "./index-DIgj6hpb.js"; -import { _ as _sfc_main$1 } from "./BaseViewTemplate-DaGOaycP.js"; -const _hoisted_1 = { - id: "comfy-user-selection", - class: "min-w-84 relative rounded-lg bg-[var(--comfy-menu-bg)] p-5 px-10 shadow-lg" -}; -const _hoisted_2 = { class: "flex w-full flex-col items-center" }; -const _hoisted_3 = { class: "flex w-full flex-col gap-2" }; -const _hoisted_4 = { for: "new-user-input" }; -const _hoisted_5 = { class: "flex w-full flex-col gap-2" }; -const _hoisted_6 = { for: "existing-user-select" }; -const _hoisted_7 = { class: "mt-5" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "UserSelectView", - setup(__props) { - const userStore = useUserStore(); - const router = useRouter(); - const selectedUser = ref(null); - const newUsername = ref(""); - const loginError = ref(""); - const createNewUser = computed(() => newUsername.value.trim() !== ""); - const newUserExistsError = computed(() => { - return userStore.users.find((user) => user.username === newUsername.value) ? `User "${newUsername.value}" already exists` : ""; - }); - const error = computed(() => newUserExistsError.value || loginError.value); - const login = /* @__PURE__ */ __name(async () => { - try { - const user = createNewUser.value ? await userStore.createUser(newUsername.value) : selectedUser.value; - if (!user) { - throw new Error("No user selected"); - } - userStore.login(user); - router.push("/"); - } catch (err) { - loginError.value = err.message ?? JSON.stringify(err); - } - }, "login"); - onMounted(async () => { - if (!userStore.initialized) { - await userStore.initialize(); - } - }); - return (_ctx, _cache) => { - return openBlock(), createBlock(_sfc_main$1, { dark: "" }, { - default: withCtx(() => [ - createBaseVNode("main", _hoisted_1, [ - _cache[2] || (_cache[2] = createBaseVNode("h1", { class: "my-2.5 mb-7 font-normal" }, "ComfyUI", -1)), - createBaseVNode("div", _hoisted_2, [ - createBaseVNode("div", _hoisted_3, [ - createBaseVNode("label", _hoisted_4, toDisplayString(_ctx.$t("userSelect.newUser")) + ":", 1), - createVNode(unref(script), { - id: "new-user-input", - modelValue: newUsername.value, - "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => newUsername.value = $event), - placeholder: _ctx.$t("userSelect.enterUsername"), - onKeyup: withKeys(login, ["enter"]) - }, null, 8, ["modelValue", "placeholder"]) - ]), - createVNode(unref(script$1)), - createBaseVNode("div", _hoisted_5, [ - createBaseVNode("label", _hoisted_6, toDisplayString(_ctx.$t("userSelect.existingUser")) + ":", 1), - createVNode(unref(script$2), { - modelValue: selectedUser.value, - "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedUser.value = $event), - class: "w-full", - inputId: "existing-user-select", - options: unref(userStore).users, - "option-label": "username", - placeholder: _ctx.$t("userSelect.selectUser"), - disabled: createNewUser.value - }, null, 8, ["modelValue", "options", "placeholder", "disabled"]), - error.value ? (openBlock(), createBlock(unref(script$3), { - key: 0, - severity: "error" - }, { - default: withCtx(() => [ - createTextVNode(toDisplayString(error.value), 1) - ]), - _: 1 - })) : createCommentVNode("", true) - ]), - createBaseVNode("footer", _hoisted_7, [ - createVNode(unref(script$4), { - label: _ctx.$t("userSelect.next"), - onClick: login - }, null, 8, ["label"]) - ]) - ]) - ]) - ]), - _: 1 - }); - }; - } -}); -export { - _sfc_main as default -}; -//# sourceMappingURL=UserSelectView-ByltuBH7.js.map diff --git a/comfy/web/assets/UserSelectView-ByltuBH7.js.map b/comfy/web/assets/UserSelectView-ByltuBH7.js.map deleted file mode 100644 index bc2e31a15..000000000 --- a/comfy/web/assets/UserSelectView-ByltuBH7.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"UserSelectView-ByltuBH7.js","sources":["../../src/views/UserSelectView.vue"],"sourcesContent":["\n\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAqDA,UAAM,YAAY,aAAa;AAC/B,UAAM,SAAS,UAAU;AAEnB,UAAA,eAAe,IAAiB,IAAI;AACpC,UAAA,cAAc,IAAI,EAAE;AACpB,UAAA,aAAa,IAAI,EAAE;AAEzB,UAAM,gBAAgB,SAAS,MAAM,YAAY,MAAM,WAAW,EAAE;AAC9D,UAAA,qBAAqB,SAAS,MAAM;AACxC,aAAO,UAAU,MAAM,KAAK,CAAC,SAAS,KAAK,aAAa,YAAY,KAAK,IACrE,SAAS,YAAY,KAAK,qBAC1B;AAAA,IAAA,CACL;AACD,UAAM,QAAQ,SAAS,MAAM,mBAAmB,SAAS,WAAW,KAAK;AAEzE,UAAM,QAAQ,mCAAY;AACpB,UAAA;AACI,cAAA,OAAO,cAAc,QACvB,MAAM,UAAU,WAAW,YAAY,KAAK,IAC5C,aAAa;AAEjB,YAAI,CAAC,MAAM;AACH,gBAAA,IAAI,MAAM,kBAAkB;AAAA,QAAA;AAGpC,kBAAU,MAAM,IAAI;AACpB,eAAO,KAAK,GAAG;AAAA,eACR,KAAK;AACZ,mBAAW,QAAQ,IAAI,WAAW,KAAK,UAAU,GAAG;AAAA,MAAA;AAAA,IAExD,GAfc;AAiBd,cAAU,YAAY;AAChB,UAAA,CAAC,UAAU,aAAa;AAC1B,cAAM,UAAU,WAAW;AAAA,MAAA;AAAA,IAC7B,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/WelcomeView-aCH40CSK.css b/comfy/web/assets/WelcomeView-aCH40CSK.css deleted file mode 100644 index 522f34388..000000000 --- a/comfy/web/assets/WelcomeView-aCH40CSK.css +++ /dev/null @@ -1,36 +0,0 @@ - -.animated-gradient-text[data-v-7dfaf74c] { - font-weight: 700; - font-size: clamp(2rem, 8vw, 4rem); - background: linear-gradient(to right, #12c2e9, #c471ed, #f64f59, #12c2e9); - background-size: 300% auto; - background-clip: text; - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - animation: gradient-7dfaf74c 8s linear infinite; -} -.text-glow[data-v-7dfaf74c] { - filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3)); -} -@keyframes gradient-7dfaf74c { -0% { - background-position: 0% center; -} -100% { - background-position: 300% center; -} -} -.fade-in-up[data-v-7dfaf74c] { - animation: fadeInUp-7dfaf74c 1.5s ease-out; - animation-fill-mode: both; -} -@keyframes fadeInUp-7dfaf74c { -0% { - opacity: 0; - transform: translateY(20px); -} -100% { - opacity: 1; - transform: translateY(0); -} -} diff --git a/comfy/web/assets/WelcomeView-bWjYcpdL.js b/comfy/web/assets/WelcomeView-bWjYcpdL.js deleted file mode 100644 index 7296ae68f..000000000 --- a/comfy/web/assets/WelcomeView-bWjYcpdL.js +++ /dev/null @@ -1,39 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { d as defineComponent, br as useRouter, o as openBlock, y as createBlock, z as withCtx, m as createBaseVNode, E as toDisplayString, k as createVNode, j as unref, l as script, _ as _export_sfc } from "./index-DIgj6hpb.js"; -import { _ as _sfc_main$1 } from "./BaseViewTemplate-DaGOaycP.js"; -const _hoisted_1 = { class: "flex flex-col items-center justify-center gap-8 p-8" }; -const _hoisted_2 = { class: "animated-gradient-text text-glow select-none" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "WelcomeView", - setup(__props) { - const router = useRouter(); - const navigateTo = /* @__PURE__ */ __name((path) => { - router.push(path); - }, "navigateTo"); - return (_ctx, _cache) => { - return openBlock(), createBlock(_sfc_main$1, { dark: "" }, { - default: withCtx(() => [ - createBaseVNode("div", _hoisted_1, [ - createBaseVNode("h1", _hoisted_2, toDisplayString(_ctx.$t("welcome.title")), 1), - createVNode(unref(script), { - label: _ctx.$t("welcome.getStarted"), - icon: "pi pi-arrow-right", - iconPos: "right", - size: "large", - rounded: "", - onClick: _cache[0] || (_cache[0] = ($event) => navigateTo("/install")), - class: "p-4 text-lg fade-in-up" - }, null, 8, ["label"]) - ]) - ]), - _: 1 - }); - }; - } -}); -const WelcomeView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7dfaf74c"]]); -export { - WelcomeView as default -}; -//# sourceMappingURL=WelcomeView-bWjYcpdL.js.map diff --git a/comfy/web/assets/WelcomeView-bWjYcpdL.js.map b/comfy/web/assets/WelcomeView-bWjYcpdL.js.map deleted file mode 100644 index e9413964a..000000000 --- a/comfy/web/assets/WelcomeView-bWjYcpdL.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"WelcomeView-bWjYcpdL.js","sources":["../../src/views/WelcomeView.vue"],"sourcesContent":["\n\n\n\n\n"],"names":[],"mappings":";;;;;;;;;AA4BA,UAAM,SAAS,UAAU;AACnB,UAAA,aAAa,wBAAC,SAAiB;AACnC,aAAO,KAAK,IAAI;AAAA,IAClB,GAFmB;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/comfy/web/assets/images/Git-Logo-White.svg b/comfy/web/assets/images/Git-Logo-White.svg deleted file mode 100644 index f2961b944..000000000 --- a/comfy/web/assets/images/Git-Logo-White.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/comfy/web/assets/images/apple-mps-logo.png b/comfy/web/assets/images/apple-mps-logo.png deleted file mode 100644 index 261edbfd638fd82bc7e0971b528a01d91f800179..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67332 zcmV)sK$yRYP)EX>4Tx04R}tkv&MmKpe$iQ$^8A2Rn#5WT;LSK}8%(6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|?BJy6A|?JWDYS_3;J6>}?mh0_0Yam~RI@7zsG4P@ z;xRFsTNQg=5kNnJ7{R2(Og)ia%)oPe-NVP%y9m$nKKJJsQ1T`Nd?Im_>4rtTK|H%@ z>74h8L#!kz#OK5l23?T&k?XR{Z=8z`3p_JqWK#3QA!4!E!Ey()lA#jM5Qi02qkJLj zvch?bvs$UK);;+P19@#F&2^fih+_!}Bq2gZ4P{hdAwsK0iis5M$2|PQjz38*nOtQs zax9<<6_Voz|AXJ%nuX~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Nzoi_%I^^m-)bw;c~&W#X`tWlI>YK(iCARp3#8z zPGQ8sS3tbYCqFzqP%_%p-cCkt#rU9t#7%3}+7>o_Pw=hz8#dPS-~RSrWg6>03}M}I zceBH;iLUmMHl*aV+XH8X<&_P~G{DNOL;nkyFGgA>Cs&92R(Z+hEZ&o@7P%yz0}VwCoc%vxbS|*UrNQEAszh WwrB%B;W$D70000 - - - - diff --git a/comfy/web/assets/images/nvidia-logo.svg b/comfy/web/assets/images/nvidia-logo.svg deleted file mode 100644 index 71f15b53b..000000000 --- a/comfy/web/assets/images/nvidia-logo.svg +++ /dev/null @@ -1,6 +0,0 @@ - Artificial Intelligence Computing Leadership from NVIDIA - - - - - \ No newline at end of file diff --git a/comfy/web/assets/images/sad_girl.png b/comfy/web/assets/images/sad_girl.png deleted file mode 100644 index 2b0925a63cf0f12db8d806f4fad64d19afea2ec8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 177633 zcmd42XH-*9^fo#tg%VomNDW20fC^F+2)$T9nxF_M7C;oF2ujJJDA=eXHabd|A}9!$ zp!fq(Dbi6PG>IU+Ly~jzfA9P0-uvaQbwAu$E9;!Ivd*5#%$~iU{XCPq_9v`(aN;-s z0FRBexdQ+g)-48bpjj8|Pd}?!7bw`l$`l&@qE2Exa0Xht1p~k(_&*;AJbNJq0BXVh zn3DzTOZvaU(dYj3xqSNkEBfEu_Z4553?_mw$DaE!8Jp5FYV?_G`g9iK?;w5RnUu6D zHOqg{`#gO#)7aFy&(n*(F~`_l{{76y%<^b+&OPNvZwHjoV`& zz$eTv!=P{P&iytpFdw+!P3@qlD(f8FZ@ByX@nqrEj%ybEF^=y_|Dz8)9!d6~PxSS8 zcp9RyBX`}nIfTE59Tmn2>TAKrgOC>kVCf@Ezzq(acZlk1lR{tPlz12}eojUwyYh$u9MteWdvAZ5huyI8FP8 z^yDC&y?3J1Jk+G8KEKbg*M5Ba`9MuUZOMO6!$VWA`NE#=e*&(DIJ-pn-&F8P_LUcF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TDl*T`X_B@1rku1{>7e;%eFq#e<_fV`5&PL=u} zfhw0b*M`5)bC`Xk5h-}AlU_-wZj`(J402409@8~2oO?31=y9!MGixyL(iQfl6#r*5 zuBU)+z>9+$hi&8y7`mZ3w@Ajkd9rHoZeyzbSNV>pH+AmiZi=AK5w>GQSvUEy^zKYh9xL zcgnl$XzgjiXCY1hE6YHFv6@20-o8j_VkV~iIaLz;IQ37uEXnCj3vdxzalr|FA(HO> zeM!o|GGs4sD^8eFv!;*MNf4qZbUOreWGb6gK>i9m7OZA|1Lsv}`ol6#gJdYD&hD9; zlaLsqQL{J6iTOq4xSJMTr_z1;b$Nq=7GzT7IQBv7)3ZzYUyP{FMLMcfO@zcc6wmeC z3%(SBO2=~-5Qf}yb4R9lJK;5#M_5ky#BP1_=8JJ$9Lc^{|b_hs+Sgr_!xLVB-jS+n^{)@U82!bD7;eE34LajW{Nf&rv z+gIZP(T2z-e?I{NwvDQeyQ4NJUlq3<*%cB;|d9oN(s zq;@vEPqnzxvve%oQSym{m|yK4_ur5rj4Nkr?Q<&+W5w3rB${QL(UAS==zZu|4E&{F zUnw=RJhCFuU#Xw&V__=TZS}gq;S**{rVd$-{6+bs+%vCT-uEX3+GT{($#+}Z^m!NE z6W8?{b2W7$-KQrDnr<#u)J%9cMp4eVmma49_PRU^y&m#K z@jmw}vQh`je?#Lx7=wtvw;Lul4HqM1pFW`i+pBx1GviEYuG7^4nHDjkhZkrW header { - display: flex; - align-items: center; - gap: 10px; - justify-content: space-between; - background: var(--comfy-menu-bg); - padding: 15px 20px; -} -.comfy-group-manage-outer > header select { - background: var(--comfy-input-bg); - border: 1px solid var(--border-color); - color: var(--input-text); - padding: 5px 10px; - border-radius: 5px; -} -.comfy-group-manage h2 { - margin: 0; - font-weight: normal; -} -.comfy-group-manage main { - display: flex; - overflow: hidden; -} -.comfy-group-manage .drag-handle { - font-weight: bold; -} -.comfy-group-manage-list { - border-right: 1px solid var(--comfy-menu-bg); -} -.comfy-group-manage-list ul { - margin: 40px 0 0; - padding: 0; - list-style: none; -} -.comfy-group-manage-list-items { - max-height: calc(100% - 40px); - overflow-y: scroll; - overflow-x: hidden; -} -.comfy-group-manage-list li { - display: flex; - padding: 10px 20px 10px 10px; - cursor: pointer; - align-items: center; - gap: 5px; -} -.comfy-group-manage-list div { - display: flex; - flex-direction: column; -} -.comfy-group-manage-list li:not(.selected):hover div { - text-decoration: underline; -} -.comfy-group-manage-list li.selected { - background: var(--border-color); -} -.comfy-group-manage-list li span { - opacity: 0.7; - font-size: smaller; -} -.comfy-group-manage-node { - flex: auto; - background: var(--border-color); - display: flex; - flex-direction: column; -} -.comfy-group-manage-node > div { - overflow: auto; -} -.comfy-group-manage-node header { - display: flex; - background: var(--bg-color); - height: 40px; -} -.comfy-group-manage-node header a { - text-align: center; - flex: auto; - border-right: 1px solid var(--comfy-menu-bg); - border-bottom: 1px solid var(--comfy-menu-bg); - padding: 10px; - cursor: pointer; - font-size: 15px; -} -.comfy-group-manage-node header a:last-child { - border-right: none; -} -.comfy-group-manage-node header a:not(.active):hover { - text-decoration: underline; -} -.comfy-group-manage-node header a.active { - background: var(--border-color); - border-bottom: none; -} -.comfy-group-manage-node-page { - display: none; - overflow: auto; -} -.comfy-group-manage-node-page.active { - display: block; -} -.comfy-group-manage-node-page div { - padding: 10px; - display: flex; - align-items: center; - gap: 10px; -} -.comfy-group-manage-node-page input { - border: none; - color: var(--input-text); - background: var(--comfy-input-bg); - padding: 5px 10px; -} -.comfy-group-manage-node-page input[type="text"] { - flex: auto; -} -.comfy-group-manage-node-page label { - display: flex; - gap: 5px; - align-items: center; -} -.comfy-group-manage footer { - border-top: 1px solid var(--comfy-menu-bg); - padding: 10px; - display: flex; - gap: 10px; -} -.comfy-group-manage footer button { - font-size: 14px; - padding: 5px 10px; - border-radius: 0; -} -.comfy-group-manage footer button:first-child { - margin-right: auto; -} - -.spinner[data-v-852efd73] { - width: 50px; - height: 50px; - border: 4px solid #f3f3f3; - border-top: 4px solid #3498db; - border-radius: 50%; - animation: spin-852efd73 1s linear infinite; -} -@keyframes spin-852efd73 { -0% { - transform: rotate(0deg); -} -100% { - transform: rotate(360deg); -} -} diff --git a/comfy/web/assets/index-BKScv1mm.js b/comfy/web/assets/index-BKScv1mm.js deleted file mode 100644 index 1971f3585..000000000 --- a/comfy/web/assets/index-BKScv1mm.js +++ /dev/null @@ -1,539 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value2) => __defProp(target, "name", { value: value2, configurable: true }); -import { ce as BaseStyle, cf as script$6, o as openBlock, f as createElementBlock, aE as mergeProps, dk as findIndexInList, cD as find, co as resolveComponent, y as createBlock, C as resolveDynamicComponent, z as withCtx, m as createBaseVNode, E as toDisplayString, A as renderSlot, B as createCommentVNode, Z as normalizeClass, cg as findSingle, F as Fragment, c8 as Transition, i as withDirectives, v as vShow, cm as UniqueComponentId } from "./index-DIgj6hpb.js"; -var classes$4 = { - root: /* @__PURE__ */ __name(function root(_ref) { - var instance = _ref.instance; - return ["p-step", { - "p-step-active": instance.active, - "p-disabled": instance.isStepDisabled - }]; - }, "root"), - header: "p-step-header", - number: "p-step-number", - title: "p-step-title" -}; -var StepStyle = BaseStyle.extend({ - name: "step", - classes: classes$4 -}); -var script$2$2 = { - name: "StepperSeparator", - hostName: "Stepper", - "extends": script$6 -}; -function render$1$2(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("span", mergeProps({ - "class": _ctx.cx("separator") - }, _ctx.ptm("separator")), null, 16); -} -__name(render$1$2, "render$1$2"); -script$2$2.render = render$1$2; -var script$1$4 = { - name: "BaseStep", - "extends": script$6, - props: { - value: { - type: [String, Number], - "default": void 0 - }, - disabled: { - type: Boolean, - "default": false - }, - asChild: { - type: Boolean, - "default": false - }, - as: { - type: [String, Object], - "default": "DIV" - } - }, - style: StepStyle, - provide: /* @__PURE__ */ __name(function provide() { - return { - $pcStep: this, - $parentInstance: this - }; - }, "provide") -}; -var script$5 = { - name: "Step", - "extends": script$1$4, - inheritAttrs: false, - inject: { - $pcStepper: { - "default": null - }, - $pcStepList: { - "default": null - }, - $pcStepItem: { - "default": null - } - }, - data: /* @__PURE__ */ __name(function data() { - return { - isSeparatorVisible: false - }; - }, "data"), - mounted: /* @__PURE__ */ __name(function mounted() { - if (this.$el && this.$pcStepList) { - var index = findIndexInList(this.$el, find(this.$pcStepper.$el, '[data-pc-name="step"]')); - var stepLen = find(this.$pcStepper.$el, '[data-pc-name="step"]').length; - this.isSeparatorVisible = index !== stepLen - 1; - } - }, "mounted"), - methods: { - getPTOptions: /* @__PURE__ */ __name(function getPTOptions(key) { - var _ptm = key === "root" ? this.ptmi : this.ptm; - return _ptm(key, { - context: { - active: this.active, - disabled: this.isStepDisabled - } - }); - }, "getPTOptions"), - onStepClick: /* @__PURE__ */ __name(function onStepClick() { - this.$pcStepper.updateValue(this.activeValue); - }, "onStepClick") - }, - computed: { - active: /* @__PURE__ */ __name(function active() { - return this.$pcStepper.isStepActive(this.activeValue); - }, "active"), - activeValue: /* @__PURE__ */ __name(function activeValue() { - var _this$$pcStepItem; - return !!this.$pcStepItem ? (_this$$pcStepItem = this.$pcStepItem) === null || _this$$pcStepItem === void 0 ? void 0 : _this$$pcStepItem.value : this.value; - }, "activeValue"), - isStepDisabled: /* @__PURE__ */ __name(function isStepDisabled() { - return !this.active && (this.$pcStepper.isStepDisabled() || this.disabled); - }, "isStepDisabled"), - id: /* @__PURE__ */ __name(function id() { - var _this$$pcStepper; - return "".concat((_this$$pcStepper = this.$pcStepper) === null || _this$$pcStepper === void 0 ? void 0 : _this$$pcStepper.id, "_step_").concat(this.activeValue); - }, "id"), - ariaControls: /* @__PURE__ */ __name(function ariaControls() { - var _this$$pcStepper2; - return "".concat((_this$$pcStepper2 = this.$pcStepper) === null || _this$$pcStepper2 === void 0 ? void 0 : _this$$pcStepper2.id, "_steppanel_").concat(this.activeValue); - }, "ariaControls"), - a11yAttrs: /* @__PURE__ */ __name(function a11yAttrs() { - return { - root: { - role: "presentation", - "aria-current": this.active ? "step" : void 0, - "data-pc-name": "step", - "data-pc-section": "root", - "data-p-disabled": this.isStepDisabled, - "data-p-active": this.active - }, - header: { - id: this.id, - role: "tab", - taindex: this.disabled ? -1 : void 0, - "aria-controls": this.ariaControls, - "data-pc-section": "header", - disabled: this.isStepDisabled, - onClick: this.onStepClick - } - }; - }, "a11yAttrs") - }, - components: { - StepperSeparator: script$2$2 - } -}; -var _hoisted_1 = ["id", "tabindex", "aria-controls", "disabled"]; -function render$4(_ctx, _cache, $props, $setup, $data, $options) { - var _component_StepperSeparator = resolveComponent("StepperSeparator"); - return !_ctx.asChild ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ - key: 0, - "class": _ctx.cx("root"), - "aria-current": $options.active ? "step" : void 0, - role: "presentation", - "data-p-active": $options.active, - "data-p-disabled": $options.isStepDisabled - }, $options.getPTOptions("root")), { - "default": withCtx(function() { - return [createBaseVNode("button", mergeProps({ - id: $options.id, - "class": _ctx.cx("header"), - role: "tab", - type: "button", - tabindex: $options.isStepDisabled ? -1 : void 0, - "aria-controls": $options.ariaControls, - disabled: $options.isStepDisabled, - onClick: _cache[0] || (_cache[0] = function() { - return $options.onStepClick && $options.onStepClick.apply($options, arguments); - }) - }, $options.getPTOptions("header")), [createBaseVNode("span", mergeProps({ - "class": _ctx.cx("number") - }, $options.getPTOptions("number")), toDisplayString($options.activeValue), 17), createBaseVNode("span", mergeProps({ - "class": _ctx.cx("title") - }, $options.getPTOptions("title")), [renderSlot(_ctx.$slots, "default")], 16)], 16, _hoisted_1), $data.isSeparatorVisible ? (openBlock(), createBlock(_component_StepperSeparator, { - key: 0 - })) : createCommentVNode("", true)]; - }), - _: 3 - }, 16, ["class", "aria-current", "data-p-active", "data-p-disabled"])) : renderSlot(_ctx.$slots, "default", { - key: 1, - "class": normalizeClass(_ctx.cx("root")), - active: $options.active, - value: _ctx.value, - a11yAttrs: $options.a11yAttrs, - activateCallback: $options.onStepClick - }); -} -__name(render$4, "render$4"); -script$5.render = render$4; -var classes$3 = { - root: "p-steplist" -}; -var StepListStyle = BaseStyle.extend({ - name: "steplist", - classes: classes$3 -}); -var script$1$3 = { - name: "BaseStepList", - "extends": script$6, - style: StepListStyle, - provide: /* @__PURE__ */ __name(function provide2() { - return { - $pcStepList: this, - $parentInstance: this - }; - }, "provide") -}; -var script$4 = { - name: "StepList", - "extends": script$1$3, - inheritAttrs: false -}; -function render$3(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("div", mergeProps({ - "class": _ctx.cx("root") - }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16); -} -__name(render$3, "render$3"); -script$4.render = render$3; -var classes$2 = { - root: /* @__PURE__ */ __name(function root2(_ref) { - var instance = _ref.instance; - return ["p-steppanel", { - "p-steppanel-active": instance.isVertical && instance.active - }]; - }, "root"), - content: "p-steppanel-content" -}; -var StepPanelStyle = BaseStyle.extend({ - name: "steppanel", - classes: classes$2 -}); -var script$2$1 = { - name: "StepperSeparator", - hostName: "Stepper", - "extends": script$6 -}; -function render$1$1(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("span", mergeProps({ - "class": _ctx.cx("separator") - }, _ctx.ptm("separator")), null, 16); -} -__name(render$1$1, "render$1$1"); -script$2$1.render = render$1$1; -var script$1$2 = { - name: "BaseStepPanel", - "extends": script$6, - props: { - value: { - type: [String, Number], - "default": void 0 - }, - asChild: { - type: Boolean, - "default": false - }, - as: { - type: [String, Object], - "default": "DIV" - } - }, - style: StepPanelStyle, - provide: /* @__PURE__ */ __name(function provide3() { - return { - $pcStepPanel: this, - $parentInstance: this - }; - }, "provide") -}; -var script$3 = { - name: "StepPanel", - "extends": script$1$2, - inheritAttrs: false, - inject: { - $pcStepper: { - "default": null - }, - $pcStepItem: { - "default": null - }, - $pcStepList: { - "default": null - } - }, - data: /* @__PURE__ */ __name(function data2() { - return { - isSeparatorVisible: false - }; - }, "data"), - mounted: /* @__PURE__ */ __name(function mounted2() { - if (this.$el) { - var _this$$pcStepItem, _this$$pcStepList; - var stepElements = find(this.$pcStepper.$el, '[data-pc-name="step"]'); - var stepPanelEl = findSingle(this.isVertical ? (_this$$pcStepItem = this.$pcStepItem) === null || _this$$pcStepItem === void 0 ? void 0 : _this$$pcStepItem.$el : (_this$$pcStepList = this.$pcStepList) === null || _this$$pcStepList === void 0 ? void 0 : _this$$pcStepList.$el, '[data-pc-name="step"]'); - var stepPanelIndex = findIndexInList(stepPanelEl, stepElements); - this.isSeparatorVisible = this.isVertical && stepPanelIndex !== stepElements.length - 1; - } - }, "mounted"), - methods: { - getPTOptions: /* @__PURE__ */ __name(function getPTOptions2(key) { - var _ptm = key === "root" ? this.ptmi : this.ptm; - return _ptm(key, { - context: { - active: this.active - } - }); - }, "getPTOptions"), - updateValue: /* @__PURE__ */ __name(function updateValue(val) { - this.$pcStepper.updateValue(val); - }, "updateValue") - }, - computed: { - active: /* @__PURE__ */ __name(function active2() { - var _this$$pcStepItem2, _this$$pcStepper; - var activeValue3 = !!this.$pcStepItem ? (_this$$pcStepItem2 = this.$pcStepItem) === null || _this$$pcStepItem2 === void 0 ? void 0 : _this$$pcStepItem2.value : this.value; - return activeValue3 === ((_this$$pcStepper = this.$pcStepper) === null || _this$$pcStepper === void 0 ? void 0 : _this$$pcStepper.d_value); - }, "active"), - isVertical: /* @__PURE__ */ __name(function isVertical() { - return !!this.$pcStepItem; - }, "isVertical"), - activeValue: /* @__PURE__ */ __name(function activeValue2() { - var _this$$pcStepItem3; - return this.isVertical ? (_this$$pcStepItem3 = this.$pcStepItem) === null || _this$$pcStepItem3 === void 0 ? void 0 : _this$$pcStepItem3.value : this.value; - }, "activeValue"), - id: /* @__PURE__ */ __name(function id2() { - var _this$$pcStepper2; - return "".concat((_this$$pcStepper2 = this.$pcStepper) === null || _this$$pcStepper2 === void 0 ? void 0 : _this$$pcStepper2.id, "_steppanel_").concat(this.activeValue); - }, "id"), - ariaControls: /* @__PURE__ */ __name(function ariaControls2() { - var _this$$pcStepper3; - return "".concat((_this$$pcStepper3 = this.$pcStepper) === null || _this$$pcStepper3 === void 0 ? void 0 : _this$$pcStepper3.id, "_step_").concat(this.activeValue); - }, "ariaControls"), - a11yAttrs: /* @__PURE__ */ __name(function a11yAttrs2() { - return { - id: this.id, - role: "tabpanel", - "aria-controls": this.ariaControls, - "data-pc-name": "steppanel", - "data-p-active": this.active - }; - }, "a11yAttrs") - }, - components: { - StepperSeparator: script$2$1 - } -}; -function render$2(_ctx, _cache, $props, $setup, $data, $options) { - var _component_StepperSeparator = resolveComponent("StepperSeparator"); - return $options.isVertical ? (openBlock(), createElementBlock(Fragment, { - key: 0 - }, [!_ctx.asChild ? (openBlock(), createBlock(Transition, mergeProps({ - key: 0, - name: "p-toggleable-content" - }, _ctx.ptm("transition")), { - "default": withCtx(function() { - return [withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ - id: $options.id, - "class": _ctx.cx("root"), - role: "tabpanel", - "aria-controls": $options.ariaControls - }, $options.getPTOptions("root")), { - "default": withCtx(function() { - return [$data.isSeparatorVisible ? (openBlock(), createBlock(_component_StepperSeparator, { - key: 0 - })) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ - "class": _ctx.cx("content") - }, $options.getPTOptions("content")), [renderSlot(_ctx.$slots, "default", { - active: $options.active, - activateCallback: /* @__PURE__ */ __name(function activateCallback(val) { - return $options.updateValue(val); - }, "activateCallback") - })], 16)]; - }), - _: 3 - }, 16, ["id", "class", "aria-controls"])), [[vShow, $options.active]])]; - }), - _: 3 - }, 16)) : renderSlot(_ctx.$slots, "default", { - key: 1, - active: $options.active, - a11yAttrs: $options.a11yAttrs, - activateCallback: /* @__PURE__ */ __name(function activateCallback(val) { - return $options.updateValue(val); - }, "activateCallback") - })], 64)) : (openBlock(), createElementBlock(Fragment, { - key: 1 - }, [!_ctx.asChild ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({ - key: 0, - id: $options.id, - "class": _ctx.cx("root"), - role: "tabpanel", - "aria-controls": $options.ariaControls - }, $options.getPTOptions("root")), { - "default": withCtx(function() { - return [renderSlot(_ctx.$slots, "default", { - active: $options.active, - activateCallback: /* @__PURE__ */ __name(function activateCallback(val) { - return $options.updateValue(val); - }, "activateCallback") - })]; - }), - _: 3 - }, 16, ["id", "class", "aria-controls"])), [[vShow, $options.active]]) : _ctx.asChild && $options.active ? renderSlot(_ctx.$slots, "default", { - key: 1, - active: $options.active, - a11yAttrs: $options.a11yAttrs, - activateCallback: /* @__PURE__ */ __name(function activateCallback(val) { - return $options.updateValue(val); - }, "activateCallback") - }) : createCommentVNode("", true)], 64)); -} -__name(render$2, "render$2"); -script$3.render = render$2; -var classes$1 = { - root: "p-steppanels" -}; -var StepPanelsStyle = BaseStyle.extend({ - name: "steppanels", - classes: classes$1 -}); -var script$1$1 = { - name: "BaseStepPanels", - "extends": script$6, - style: StepPanelsStyle, - provide: /* @__PURE__ */ __name(function provide4() { - return { - $pcStepPanels: this, - $parentInstance: this - }; - }, "provide") -}; -var script$2 = { - name: "StepPanels", - "extends": script$1$1, - inheritAttrs: false -}; -function render$1(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("div", mergeProps({ - "class": _ctx.cx("root") - }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default")], 16); -} -__name(render$1, "render$1"); -script$2.render = render$1; -var theme = /* @__PURE__ */ __name(function theme2(_ref) { - var dt = _ref.dt; - return "\n.p-steplist {\n position: relative;\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow-x: auto;\n}\n\n.p-step {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n gap: ".concat(dt("stepper.step.gap"), ";\n padding: ").concat(dt("stepper.step.padding"), ";\n}\n\n.p-step:last-of-type {\n flex: initial;\n}\n\n.p-step-header {\n border: 0 none;\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n cursor: pointer;\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ";\n border-radius: ").concat(dt("stepper.step.header.border.radius"), ";\n outline-color: transparent;\n background: transparent;\n padding: ").concat(dt("stepper.step.header.padding"), ";\n gap: ").concat(dt("stepper.step.header.gap"), ";\n}\n\n.p-step-header:focus-visible {\n box-shadow: ").concat(dt("stepper.step.header.focus.ring.shadow"), ";\n outline: ").concat(dt("stepper.step.header.focus.ring.width"), " ").concat(dt("stepper.step.header.focus.ring.style"), " ").concat(dt("stepper.step.header.focus.ring.color"), ";\n outline-offset: ").concat(dt("stepper.step.header.focus.ring.offset"), ";\n}\n\n.p-stepper.p-stepper-readonly .p-step {\n cursor: auto;\n}\n\n.p-step-title {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n color: ").concat(dt("stepper.step.title.color"), ";\n font-weight: ").concat(dt("stepper.step.title.font.weight"), ";\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ";\n}\n\n.p-step-number {\n display: flex;\n align-items: center;\n justify-content: center;\n color: ").concat(dt("stepper.step.number.color"), ";\n border: 2px solid ").concat(dt("stepper.step.number.border.color"), ";\n background: ").concat(dt("stepper.step.number.background"), ";\n min-width: ").concat(dt("stepper.step.number.size"), ";\n height: ").concat(dt("stepper.step.number.size"), ";\n line-height: ").concat(dt("stepper.step.number.size"), ";\n font-size: ").concat(dt("stepper.step.number.font.size"), ";\n z-index: 1;\n border-radius: ").concat(dt("stepper.step.number.border.radius"), ";\n position: relative;\n font-weight: ").concat(dt("stepper.step.number.font.weight"), ';\n}\n\n.p-step-number::after {\n content: " ";\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: ').concat(dt("stepper.step.number.border.radius"), ";\n box-shadow: ").concat(dt("stepper.step.number.shadow"), ";\n}\n\n.p-step-active .p-step-header {\n cursor: default;\n}\n\n.p-step-active .p-step-number {\n background: ").concat(dt("stepper.step.number.active.background"), ";\n border-color: ").concat(dt("stepper.step.number.active.border.color"), ";\n color: ").concat(dt("stepper.step.number.active.color"), ";\n}\n\n.p-step-active .p-step-title {\n color: ").concat(dt("stepper.step.title.active.color"), ";\n}\n\n.p-step:not(.p-disabled):focus-visible {\n outline: ").concat(dt("focus.ring.width"), " ").concat(dt("focus.ring.style"), " ").concat(dt("focus.ring.color"), ";\n outline-offset: ").concat(dt("focus.ring.offset"), ";\n}\n\n.p-step:has(~ .p-step-active) .p-stepper-separator {\n background: ").concat(dt("stepper.separator.active.background"), ";\n}\n\n.p-stepper-separator {\n flex: 1 1 0;\n background: ").concat(dt("stepper.separator.background"), ";\n width: 100%;\n height: ").concat(dt("stepper.separator.size"), ";\n transition: background ").concat(dt("stepper.transition.duration"), ", color ").concat(dt("stepper.transition.duration"), ", border-color ").concat(dt("stepper.transition.duration"), ", box-shadow ").concat(dt("stepper.transition.duration"), ", outline-color ").concat(dt("stepper.transition.duration"), ";\n}\n\n.p-steppanels {\n padding: ").concat(dt("stepper.steppanels.padding"), ";\n}\n\n.p-steppanel {\n background: ").concat(dt("stepper.steppanel.background"), ";\n color: ").concat(dt("stepper.steppanel.color"), ";\n}\n\n.p-stepper:has(.p-stepitem) {\n display: flex;\n flex-direction: column;\n}\n\n.p-stepitem {\n display: flex;\n flex-direction: column;\n flex: initial;\n}\n\n.p-stepitem.p-stepitem-active {\n flex: 1 1 auto;\n}\n\n.p-stepitem .p-step {\n flex: initial;\n}\n\n.p-stepitem .p-steppanel-content {\n width: 100%;\n padding: ").concat(dt("stepper.steppanel.padding"), ";\n margin-inline-start: 1rem;\n}\n\n.p-stepitem .p-steppanel {\n display: flex;\n flex: 1 1 auto;\n}\n\n.p-stepitem .p-stepper-separator {\n flex: 0 0 auto;\n width: ").concat(dt("stepper.separator.size"), ";\n height: auto;\n margin: ").concat(dt("stepper.separator.margin"), ";\n position: relative;\n left: calc(-1 * ").concat(dt("stepper.separator.size"), ");\n}\n\n.p-stepitem .p-stepper-separator:dir(rtl) {\n left: calc(-9 * ").concat(dt("stepper.separator.size"), ");\n}\n\n.p-stepitem:has(~ .p-stepitem-active) .p-stepper-separator {\n background: ").concat(dt("stepper.separator.active.background"), ";\n}\n\n.p-stepitem:last-of-type .p-steppanel {\n padding-inline-start: ").concat(dt("stepper.step.number.size"), ";\n}\n"); -}, "theme"); -var classes = { - root: /* @__PURE__ */ __name(function root3(_ref2) { - var props = _ref2.props; - return ["p-stepper p-component", { - "p-readonly": props.linear - }]; - }, "root"), - separator: "p-stepper-separator" -}; -var StepperStyle = BaseStyle.extend({ - name: "stepper", - theme, - classes -}); -var script$1 = { - name: "BaseStepper", - "extends": script$6, - props: { - value: { - type: [String, Number], - "default": void 0 - }, - linear: { - type: Boolean, - "default": false - } - }, - style: StepperStyle, - provide: /* @__PURE__ */ __name(function provide5() { - return { - $pcStepper: this, - $parentInstance: this - }; - }, "provide") -}; -var script = { - name: "Stepper", - "extends": script$1, - inheritAttrs: false, - emits: ["update:value"], - data: /* @__PURE__ */ __name(function data3() { - return { - id: this.$attrs.id, - d_value: this.value - }; - }, "data"), - watch: { - "$attrs.id": /* @__PURE__ */ __name(function $attrsId(newValue) { - this.id = newValue || UniqueComponentId(); - }, "$attrsId"), - value: /* @__PURE__ */ __name(function value(newValue) { - this.d_value = newValue; - }, "value") - }, - mounted: /* @__PURE__ */ __name(function mounted3() { - this.id = this.id || UniqueComponentId(); - }, "mounted"), - methods: { - updateValue: /* @__PURE__ */ __name(function updateValue2(newValue) { - if (this.d_value !== newValue) { - this.d_value = newValue; - this.$emit("update:value", newValue); - } - }, "updateValue"), - isStepActive: /* @__PURE__ */ __name(function isStepActive(value2) { - return this.d_value === value2; - }, "isStepActive"), - isStepDisabled: /* @__PURE__ */ __name(function isStepDisabled2() { - return this.linear; - }, "isStepDisabled") - } -}; -function render(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("div", mergeProps({ - "class": _ctx.cx("root"), - role: "tablist" - }, _ctx.ptmi("root")), [_ctx.$slots.start ? renderSlot(_ctx.$slots, "start", { - key: 0 - }) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), _ctx.$slots.end ? renderSlot(_ctx.$slots, "end", { - key: 1 - }) : createCommentVNode("", true)], 16); -} -__name(render, "render"); -script.render = render; -export { - script$5 as a, - script$2 as b, - script$3 as c, - script as d, - script$4 as s -}; -//# sourceMappingURL=index-BKScv1mm.js.map diff --git a/comfy/web/assets/index-BKScv1mm.js.map b/comfy/web/assets/index-BKScv1mm.js.map deleted file mode 100644 index 7d4bcd844..000000000 --- a/comfy/web/assets/index-BKScv1mm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-BKScv1mm.js","sources":["../../../../../node_modules/primevue/step/style/index.mjs","../../../../../node_modules/primevue/step/index.mjs","../../../../../node_modules/primevue/steplist/style/index.mjs","../../../../../node_modules/primevue/steplist/index.mjs","../../../../../node_modules/primevue/steppanel/style/index.mjs","../../../../../node_modules/primevue/steppanel/index.mjs","../../../../../node_modules/primevue/steppanels/style/index.mjs","../../../../../node_modules/primevue/steppanels/index.mjs","../../../../../node_modules/primevue/stepper/style/index.mjs","../../../../../node_modules/primevue/stepper/index.mjs"],"sourcesContent":["import BaseStyle from '@primevue/core/base/style';\n\nvar classes = {\n root: function root(_ref) {\n var instance = _ref.instance;\n return ['p-step', {\n 'p-step-active': instance.active,\n 'p-disabled': instance.isStepDisabled\n }];\n },\n header: 'p-step-header',\n number: 'p-step-number',\n title: 'p-step-title'\n};\nvar StepStyle = BaseStyle.extend({\n name: 'step',\n classes: classes\n});\n\nexport { StepStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { find } from '@primeuix/utils/dom';\nimport { findIndexInList } from '@primeuix/utils/object';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport { openBlock, createElementBlock, mergeProps, resolveComponent, createBlock, resolveDynamicComponent, withCtx, createElementVNode, toDisplayString, renderSlot, createCommentVNode, normalizeClass } from 'vue';\nimport StepStyle from 'primevue/step/style';\n\nvar script$2 = {\n name: 'StepperSeparator',\n hostName: 'Stepper',\n \"extends\": BaseComponent\n};\n\nfunction render$1(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"span\", mergeProps({\n \"class\": _ctx.cx('separator')\n }, _ctx.ptm('separator')), null, 16);\n}\n\nscript$2.render = render$1;\n\nvar script$1 = {\n name: 'BaseStep',\n \"extends\": BaseComponent,\n props: {\n value: {\n type: [String, Number],\n \"default\": undefined\n },\n disabled: {\n type: Boolean,\n \"default\": false\n },\n asChild: {\n type: Boolean,\n \"default\": false\n },\n as: {\n type: [String, Object],\n \"default\": 'DIV'\n }\n },\n style: StepStyle,\n provide: function provide() {\n return {\n $pcStep: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'Step',\n \"extends\": script$1,\n inheritAttrs: false,\n inject: {\n $pcStepper: {\n \"default\": null\n },\n $pcStepList: {\n \"default\": null\n },\n $pcStepItem: {\n \"default\": null\n }\n },\n data: function data() {\n return {\n isSeparatorVisible: false\n };\n },\n mounted: function mounted() {\n if (this.$el && this.$pcStepList) {\n var index = findIndexInList(this.$el, find(this.$pcStepper.$el, '[data-pc-name=\"step\"]'));\n var stepLen = find(this.$pcStepper.$el, '[data-pc-name=\"step\"]').length;\n this.isSeparatorVisible = index !== stepLen - 1;\n }\n },\n methods: {\n getPTOptions: function getPTOptions(key) {\n var _ptm = key === 'root' ? this.ptmi : this.ptm;\n return _ptm(key, {\n context: {\n active: this.active,\n disabled: this.isStepDisabled\n }\n });\n },\n onStepClick: function onStepClick() {\n this.$pcStepper.updateValue(this.activeValue);\n }\n },\n computed: {\n active: function active() {\n return this.$pcStepper.isStepActive(this.activeValue);\n },\n activeValue: function activeValue() {\n var _this$$pcStepItem;\n return !!this.$pcStepItem ? (_this$$pcStepItem = this.$pcStepItem) === null || _this$$pcStepItem === void 0 ? void 0 : _this$$pcStepItem.value : this.value;\n },\n isStepDisabled: function isStepDisabled() {\n return !this.active && (this.$pcStepper.isStepDisabled() || this.disabled);\n },\n id: function id() {\n var _this$$pcStepper;\n return \"\".concat((_this$$pcStepper = this.$pcStepper) === null || _this$$pcStepper === void 0 ? void 0 : _this$$pcStepper.id, \"_step_\").concat(this.activeValue);\n },\n ariaControls: function ariaControls() {\n var _this$$pcStepper2;\n return \"\".concat((_this$$pcStepper2 = this.$pcStepper) === null || _this$$pcStepper2 === void 0 ? void 0 : _this$$pcStepper2.id, \"_steppanel_\").concat(this.activeValue);\n },\n a11yAttrs: function a11yAttrs() {\n return {\n root: {\n role: 'presentation',\n 'aria-current': this.active ? 'step' : undefined,\n 'data-pc-name': 'step',\n 'data-pc-section': 'root',\n 'data-p-disabled': this.isStepDisabled,\n 'data-p-active': this.active\n },\n header: {\n id: this.id,\n role: 'tab',\n taindex: this.disabled ? -1 : undefined,\n 'aria-controls': this.ariaControls,\n 'data-pc-section': 'header',\n disabled: this.isStepDisabled,\n onClick: this.onStepClick\n }\n };\n }\n },\n components: {\n StepperSeparator: script$2\n }\n};\n\nvar _hoisted_1 = [\"id\", \"tabindex\", \"aria-controls\", \"disabled\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_StepperSeparator = resolveComponent(\"StepperSeparator\");\n return !_ctx.asChild ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({\n key: 0,\n \"class\": _ctx.cx('root'),\n \"aria-current\": $options.active ? 'step' : undefined,\n role: \"presentation\",\n \"data-p-active\": $options.active,\n \"data-p-disabled\": $options.isStepDisabled\n }, $options.getPTOptions('root')), {\n \"default\": withCtx(function () {\n return [createElementVNode(\"button\", mergeProps({\n id: $options.id,\n \"class\": _ctx.cx('header'),\n role: \"tab\",\n type: \"button\",\n tabindex: $options.isStepDisabled ? -1 : undefined,\n \"aria-controls\": $options.ariaControls,\n disabled: $options.isStepDisabled,\n onClick: _cache[0] || (_cache[0] = function () {\n return $options.onStepClick && $options.onStepClick.apply($options, arguments);\n })\n }, $options.getPTOptions('header')), [createElementVNode(\"span\", mergeProps({\n \"class\": _ctx.cx('number')\n }, $options.getPTOptions('number')), toDisplayString($options.activeValue), 17), createElementVNode(\"span\", mergeProps({\n \"class\": _ctx.cx('title')\n }, $options.getPTOptions('title')), [renderSlot(_ctx.$slots, \"default\")], 16)], 16, _hoisted_1), $data.isSeparatorVisible ? (openBlock(), createBlock(_component_StepperSeparator, {\n key: 0\n })) : createCommentVNode(\"\", true)];\n }),\n _: 3\n }, 16, [\"class\", \"aria-current\", \"data-p-active\", \"data-p-disabled\"])) : renderSlot(_ctx.$slots, \"default\", {\n key: 1,\n \"class\": normalizeClass(_ctx.cx('root')),\n active: $options.active,\n value: _ctx.value,\n a11yAttrs: $options.a11yAttrs,\n activateCallback: $options.onStepClick\n });\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar classes = {\n root: 'p-steplist'\n};\nvar StepListStyle = BaseStyle.extend({\n name: 'steplist',\n classes: classes\n});\n\nexport { StepListStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseComponent from '@primevue/core/basecomponent';\nimport StepListStyle from 'primevue/steplist/style';\nimport { openBlock, createElementBlock, mergeProps, renderSlot } from 'vue';\n\nvar script$1 = {\n name: 'BaseStepList',\n \"extends\": BaseComponent,\n style: StepListStyle,\n provide: function provide() {\n return {\n $pcStepList: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'StepList',\n \"extends\": script$1,\n inheritAttrs: false\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), [renderSlot(_ctx.$slots, \"default\")], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar classes = {\n root: function root(_ref) {\n var instance = _ref.instance;\n return ['p-steppanel', {\n 'p-steppanel-active': instance.isVertical && instance.active\n }];\n },\n content: 'p-steppanel-content'\n};\nvar StepPanelStyle = BaseStyle.extend({\n name: 'steppanel',\n classes: classes\n});\n\nexport { StepPanelStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { find, findSingle } from '@primeuix/utils/dom';\nimport { findIndexInList } from '@primeuix/utils/object';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport { openBlock, createElementBlock, mergeProps, resolveComponent, Fragment, createBlock, Transition, withCtx, withDirectives, resolveDynamicComponent, createCommentVNode, createElementVNode, renderSlot, vShow } from 'vue';\nimport StepPanelStyle from 'primevue/steppanel/style';\n\nvar script$2 = {\n name: 'StepperSeparator',\n hostName: 'Stepper',\n \"extends\": BaseComponent\n};\n\nfunction render$1(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"span\", mergeProps({\n \"class\": _ctx.cx('separator')\n }, _ctx.ptm('separator')), null, 16);\n}\n\nscript$2.render = render$1;\n\nvar script$1 = {\n name: 'BaseStepPanel',\n \"extends\": BaseComponent,\n props: {\n value: {\n type: [String, Number],\n \"default\": undefined\n },\n asChild: {\n type: Boolean,\n \"default\": false\n },\n as: {\n type: [String, Object],\n \"default\": 'DIV'\n }\n },\n style: StepPanelStyle,\n provide: function provide() {\n return {\n $pcStepPanel: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'StepPanel',\n \"extends\": script$1,\n inheritAttrs: false,\n inject: {\n $pcStepper: {\n \"default\": null\n },\n $pcStepItem: {\n \"default\": null\n },\n $pcStepList: {\n \"default\": null\n }\n },\n data: function data() {\n return {\n isSeparatorVisible: false\n };\n },\n mounted: function mounted() {\n if (this.$el) {\n var _this$$pcStepItem, _this$$pcStepList;\n var stepElements = find(this.$pcStepper.$el, '[data-pc-name=\"step\"]');\n var stepPanelEl = findSingle(this.isVertical ? (_this$$pcStepItem = this.$pcStepItem) === null || _this$$pcStepItem === void 0 ? void 0 : _this$$pcStepItem.$el : (_this$$pcStepList = this.$pcStepList) === null || _this$$pcStepList === void 0 ? void 0 : _this$$pcStepList.$el, '[data-pc-name=\"step\"]');\n var stepPanelIndex = findIndexInList(stepPanelEl, stepElements);\n this.isSeparatorVisible = this.isVertical && stepPanelIndex !== stepElements.length - 1;\n }\n },\n methods: {\n getPTOptions: function getPTOptions(key) {\n var _ptm = key === 'root' ? this.ptmi : this.ptm;\n return _ptm(key, {\n context: {\n active: this.active\n }\n });\n },\n updateValue: function updateValue(val) {\n this.$pcStepper.updateValue(val);\n }\n },\n computed: {\n active: function active() {\n var _this$$pcStepItem2, _this$$pcStepper;\n var activeValue = !!this.$pcStepItem ? (_this$$pcStepItem2 = this.$pcStepItem) === null || _this$$pcStepItem2 === void 0 ? void 0 : _this$$pcStepItem2.value : this.value;\n return activeValue === ((_this$$pcStepper = this.$pcStepper) === null || _this$$pcStepper === void 0 ? void 0 : _this$$pcStepper.d_value);\n },\n isVertical: function isVertical() {\n return !!this.$pcStepItem;\n },\n activeValue: function activeValue() {\n var _this$$pcStepItem3;\n return this.isVertical ? (_this$$pcStepItem3 = this.$pcStepItem) === null || _this$$pcStepItem3 === void 0 ? void 0 : _this$$pcStepItem3.value : this.value;\n },\n id: function id() {\n var _this$$pcStepper2;\n return \"\".concat((_this$$pcStepper2 = this.$pcStepper) === null || _this$$pcStepper2 === void 0 ? void 0 : _this$$pcStepper2.id, \"_steppanel_\").concat(this.activeValue);\n },\n ariaControls: function ariaControls() {\n var _this$$pcStepper3;\n return \"\".concat((_this$$pcStepper3 = this.$pcStepper) === null || _this$$pcStepper3 === void 0 ? void 0 : _this$$pcStepper3.id, \"_step_\").concat(this.activeValue);\n },\n a11yAttrs: function a11yAttrs() {\n return {\n id: this.id,\n role: 'tabpanel',\n 'aria-controls': this.ariaControls,\n 'data-pc-name': 'steppanel',\n 'data-p-active': this.active\n };\n }\n },\n components: {\n StepperSeparator: script$2\n }\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_StepperSeparator = resolveComponent(\"StepperSeparator\");\n return $options.isVertical ? (openBlock(), createElementBlock(Fragment, {\n key: 0\n }, [!_ctx.asChild ? (openBlock(), createBlock(Transition, mergeProps({\n key: 0,\n name: \"p-toggleable-content\"\n }, _ctx.ptm('transition')), {\n \"default\": withCtx(function () {\n return [withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({\n id: $options.id,\n \"class\": _ctx.cx('root'),\n role: \"tabpanel\",\n \"aria-controls\": $options.ariaControls\n }, $options.getPTOptions('root')), {\n \"default\": withCtx(function () {\n return [$data.isSeparatorVisible ? (openBlock(), createBlock(_component_StepperSeparator, {\n key: 0\n })) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('content')\n }, $options.getPTOptions('content')), [renderSlot(_ctx.$slots, \"default\", {\n active: $options.active,\n activateCallback: function activateCallback(val) {\n return $options.updateValue(val);\n }\n })], 16)];\n }),\n _: 3\n }, 16, [\"id\", \"class\", \"aria-controls\"])), [[vShow, $options.active]])];\n }),\n _: 3\n }, 16)) : renderSlot(_ctx.$slots, \"default\", {\n key: 1,\n active: $options.active,\n a11yAttrs: $options.a11yAttrs,\n activateCallback: function activateCallback(val) {\n return $options.updateValue(val);\n }\n })], 64)) : (openBlock(), createElementBlock(Fragment, {\n key: 1\n }, [!_ctx.asChild ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({\n key: 0,\n id: $options.id,\n \"class\": _ctx.cx('root'),\n role: \"tabpanel\",\n \"aria-controls\": $options.ariaControls\n }, $options.getPTOptions('root')), {\n \"default\": withCtx(function () {\n return [renderSlot(_ctx.$slots, \"default\", {\n active: $options.active,\n activateCallback: function activateCallback(val) {\n return $options.updateValue(val);\n }\n })];\n }),\n _: 3\n }, 16, [\"id\", \"class\", \"aria-controls\"])), [[vShow, $options.active]]) : _ctx.asChild && $options.active ? renderSlot(_ctx.$slots, \"default\", {\n key: 1,\n active: $options.active,\n a11yAttrs: $options.a11yAttrs,\n activateCallback: function activateCallback(val) {\n return $options.updateValue(val);\n }\n }) : createCommentVNode(\"\", true)], 64));\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar classes = {\n root: 'p-steppanels'\n};\nvar StepPanelsStyle = BaseStyle.extend({\n name: 'steppanels',\n classes: classes\n});\n\nexport { StepPanelsStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseComponent from '@primevue/core/basecomponent';\nimport StepPanelsStyle from 'primevue/steppanels/style';\nimport { openBlock, createElementBlock, mergeProps, renderSlot } from 'vue';\n\nvar script$1 = {\n name: 'BaseStepPanels',\n \"extends\": BaseComponent,\n style: StepPanelsStyle,\n provide: function provide() {\n return {\n $pcStepPanels: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'StepPanels',\n \"extends\": script$1,\n inheritAttrs: false\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), [renderSlot(_ctx.$slots, \"default\")], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-steplist {\\n position: relative;\\n display: flex;\\n justify-content: space-between;\\n align-items: center;\\n margin: 0;\\n padding: 0;\\n list-style-type: none;\\n overflow-x: auto;\\n}\\n\\n.p-step {\\n position: relative;\\n display: flex;\\n flex: 1 1 auto;\\n align-items: center;\\n gap: \".concat(dt('stepper.step.gap'), \";\\n padding: \").concat(dt('stepper.step.padding'), \";\\n}\\n\\n.p-step:last-of-type {\\n flex: initial;\\n}\\n\\n.p-step-header {\\n border: 0 none;\\n display: inline-flex;\\n align-items: center;\\n text-decoration: none;\\n cursor: pointer;\\n transition: background \").concat(dt('stepper.transition.duration'), \", color \").concat(dt('stepper.transition.duration'), \", border-color \").concat(dt('stepper.transition.duration'), \", outline-color \").concat(dt('stepper.transition.duration'), \", box-shadow \").concat(dt('stepper.transition.duration'), \";\\n border-radius: \").concat(dt('stepper.step.header.border.radius'), \";\\n outline-color: transparent;\\n background: transparent;\\n padding: \").concat(dt('stepper.step.header.padding'), \";\\n gap: \").concat(dt('stepper.step.header.gap'), \";\\n}\\n\\n.p-step-header:focus-visible {\\n box-shadow: \").concat(dt('stepper.step.header.focus.ring.shadow'), \";\\n outline: \").concat(dt('stepper.step.header.focus.ring.width'), \" \").concat(dt('stepper.step.header.focus.ring.style'), \" \").concat(dt('stepper.step.header.focus.ring.color'), \";\\n outline-offset: \").concat(dt('stepper.step.header.focus.ring.offset'), \";\\n}\\n\\n.p-stepper.p-stepper-readonly .p-step {\\n cursor: auto;\\n}\\n\\n.p-step-title {\\n display: block;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n max-width: 100%;\\n color: \").concat(dt('stepper.step.title.color'), \";\\n font-weight: \").concat(dt('stepper.step.title.font.weight'), \";\\n transition: background \").concat(dt('stepper.transition.duration'), \", color \").concat(dt('stepper.transition.duration'), \", border-color \").concat(dt('stepper.transition.duration'), \", box-shadow \").concat(dt('stepper.transition.duration'), \", outline-color \").concat(dt('stepper.transition.duration'), \";\\n}\\n\\n.p-step-number {\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n color: \").concat(dt('stepper.step.number.color'), \";\\n border: 2px solid \").concat(dt('stepper.step.number.border.color'), \";\\n background: \").concat(dt('stepper.step.number.background'), \";\\n min-width: \").concat(dt('stepper.step.number.size'), \";\\n height: \").concat(dt('stepper.step.number.size'), \";\\n line-height: \").concat(dt('stepper.step.number.size'), \";\\n font-size: \").concat(dt('stepper.step.number.font.size'), \";\\n z-index: 1;\\n border-radius: \").concat(dt('stepper.step.number.border.radius'), \";\\n position: relative;\\n font-weight: \").concat(dt('stepper.step.number.font.weight'), \";\\n}\\n\\n.p-step-number::after {\\n content: \\\" \\\";\\n position: absolute;\\n width: 100%;\\n height: 100%;\\n border-radius: \").concat(dt('stepper.step.number.border.radius'), \";\\n box-shadow: \").concat(dt('stepper.step.number.shadow'), \";\\n}\\n\\n.p-step-active .p-step-header {\\n cursor: default;\\n}\\n\\n.p-step-active .p-step-number {\\n background: \").concat(dt('stepper.step.number.active.background'), \";\\n border-color: \").concat(dt('stepper.step.number.active.border.color'), \";\\n color: \").concat(dt('stepper.step.number.active.color'), \";\\n}\\n\\n.p-step-active .p-step-title {\\n color: \").concat(dt('stepper.step.title.active.color'), \";\\n}\\n\\n.p-step:not(.p-disabled):focus-visible {\\n outline: \").concat(dt('focus.ring.width'), \" \").concat(dt('focus.ring.style'), \" \").concat(dt('focus.ring.color'), \";\\n outline-offset: \").concat(dt('focus.ring.offset'), \";\\n}\\n\\n.p-step:has(~ .p-step-active) .p-stepper-separator {\\n background: \").concat(dt('stepper.separator.active.background'), \";\\n}\\n\\n.p-stepper-separator {\\n flex: 1 1 0;\\n background: \").concat(dt('stepper.separator.background'), \";\\n width: 100%;\\n height: \").concat(dt('stepper.separator.size'), \";\\n transition: background \").concat(dt('stepper.transition.duration'), \", color \").concat(dt('stepper.transition.duration'), \", border-color \").concat(dt('stepper.transition.duration'), \", box-shadow \").concat(dt('stepper.transition.duration'), \", outline-color \").concat(dt('stepper.transition.duration'), \";\\n}\\n\\n.p-steppanels {\\n padding: \").concat(dt('stepper.steppanels.padding'), \";\\n}\\n\\n.p-steppanel {\\n background: \").concat(dt('stepper.steppanel.background'), \";\\n color: \").concat(dt('stepper.steppanel.color'), \";\\n}\\n\\n.p-stepper:has(.p-stepitem) {\\n display: flex;\\n flex-direction: column;\\n}\\n\\n.p-stepitem {\\n display: flex;\\n flex-direction: column;\\n flex: initial;\\n}\\n\\n.p-stepitem.p-stepitem-active {\\n flex: 1 1 auto;\\n}\\n\\n.p-stepitem .p-step {\\n flex: initial;\\n}\\n\\n.p-stepitem .p-steppanel-content {\\n width: 100%;\\n padding: \").concat(dt('stepper.steppanel.padding'), \";\\n margin-inline-start: 1rem;\\n}\\n\\n.p-stepitem .p-steppanel {\\n display: flex;\\n flex: 1 1 auto;\\n}\\n\\n.p-stepitem .p-stepper-separator {\\n flex: 0 0 auto;\\n width: \").concat(dt('stepper.separator.size'), \";\\n height: auto;\\n margin: \").concat(dt('stepper.separator.margin'), \";\\n position: relative;\\n left: calc(-1 * \").concat(dt('stepper.separator.size'), \");\\n}\\n\\n.p-stepitem .p-stepper-separator:dir(rtl) {\\n left: calc(-9 * \").concat(dt('stepper.separator.size'), \");\\n}\\n\\n.p-stepitem:has(~ .p-stepitem-active) .p-stepper-separator {\\n background: \").concat(dt('stepper.separator.active.background'), \";\\n}\\n\\n.p-stepitem:last-of-type .p-steppanel {\\n padding-inline-start: \").concat(dt('stepper.step.number.size'), \";\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var props = _ref2.props;\n return ['p-stepper p-component', {\n 'p-readonly': props.linear\n }];\n },\n separator: 'p-stepper-separator'\n};\nvar StepperStyle = BaseStyle.extend({\n name: 'stepper',\n theme: theme,\n classes: classes\n});\n\nexport { StepperStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { UniqueComponentId } from '@primevue/core/utils';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport StepperStyle from 'primevue/stepper/style';\nimport { openBlock, createElementBlock, mergeProps, renderSlot, createCommentVNode } from 'vue';\n\nvar script$1 = {\n name: 'BaseStepper',\n \"extends\": BaseComponent,\n props: {\n value: {\n type: [String, Number],\n \"default\": undefined\n },\n linear: {\n type: Boolean,\n \"default\": false\n }\n },\n style: StepperStyle,\n provide: function provide() {\n return {\n $pcStepper: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'Stepper',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['update:value'],\n data: function data() {\n return {\n id: this.$attrs.id,\n d_value: this.value\n };\n },\n watch: {\n '$attrs.id': function $attrsId(newValue) {\n this.id = newValue || UniqueComponentId();\n },\n value: function value(newValue) {\n this.d_value = newValue;\n }\n },\n mounted: function mounted() {\n this.id = this.id || UniqueComponentId();\n },\n methods: {\n updateValue: function updateValue(newValue) {\n if (this.d_value !== newValue) {\n this.d_value = newValue;\n this.$emit('update:value', newValue);\n }\n },\n isStepActive: function isStepActive(value) {\n return this.d_value === value;\n },\n isStepDisabled: function isStepDisabled() {\n return this.linear;\n }\n }\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root'),\n role: \"tablist\"\n }, _ctx.ptmi('root')), [_ctx.$slots.start ? renderSlot(_ctx.$slots, \"start\", {\n key: 0\n }) : createCommentVNode(\"\", true), renderSlot(_ctx.$slots, \"default\"), _ctx.$slots.end ? renderSlot(_ctx.$slots, \"end\", {\n key: 1\n }) : createCommentVNode(\"\", true)], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n"],"names":["classes","script$2","BaseComponent","render$1","script$1","script","render","createElementVNode","provide","root","data","mounted","getPTOptions","active","activeValue","id","ariaControls","a11yAttrs","theme","updateValue","value","isStepDisabled"],"mappings":";;;AAEA,IAAIA,YAAU;AAAA,EACZ,MAAM,gCAAS,KAAK,MAAM;AACxB,QAAI,WAAW,KAAK;AACpB,WAAO,CAAC,UAAU;AAAA,MAChB,iBAAiB,SAAS;AAAA,MAC1B,cAAc,SAAS;AAAA,IAC7B,CAAK;AAAA,EACF,GANK;AAAA,EAON,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AACT;AACA,IAAI,YAAY,UAAU,OAAO;AAAA,EAC/B,MAAM;AAAA,EACN,SAASA;AACX,CAAC;ACXD,IAAIC,aAAW;AA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Q,OAAO;AAAA,IACtH,KAAK;AAAA,EACN,CAAA,IAAI,mBAAmB,IAAI,IAAI,CAAC,GAAG,EAAE;AACxC;AATS;AAWT,OAAO,SAAS;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]} \ No newline at end of file diff --git a/comfy/web/assets/index-CE2hpomb.js b/comfy/web/assets/index-CE2hpomb.js deleted file mode 100644 index bd15e7050..000000000 --- a/comfy/web/assets/index-CE2hpomb.js +++ /dev/null @@ -1,618 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { ce as BaseStyle, cu as script$5, o as openBlock, f as createElementBlock, aE as mergeProps, m as createBaseVNode, cf as script$6, db as script$7, dc as script$8, cU as script$9, cl as Ripple, r as resolveDirective, y as createBlock, C as resolveDynamicComponent, F as Fragment, E as toDisplayString, d3 as normalizeProps, i as withDirectives, B as createCommentVNode, dG as ToastEventBus, cw as ZIndex, cR as isEmpty, cH as setAttribute, cJ as script$a, co as resolveComponent, z as withCtx, k as createVNode, dH as TransitionGroup, D as renderList } from "./index-DIgj6hpb.js"; -function _typeof$2(o) { - "@babel/helpers - typeof"; - return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$2(o); -} -__name(_typeof$2, "_typeof$2"); -function _defineProperty$2(e, r, t) { - return (r = _toPropertyKey$2(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$2, "_defineProperty$2"); -function _toPropertyKey$2(t) { - var i = _toPrimitive$2(t, "string"); - return "symbol" == _typeof$2(i) ? i : i + ""; -} -__name(_toPropertyKey$2, "_toPropertyKey$2"); -function _toPrimitive$2(t, r) { - if ("object" != _typeof$2(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$2(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$2, "_toPrimitive$2"); -var theme = /* @__PURE__ */ __name(function theme2(_ref) { - var dt = _ref.dt; - return "\n.p-toast {\n width: ".concat(dt("toast.width"), ";\n white-space: pre-line;\n word-break: break-word;\n}\n\n.p-toast-message {\n margin: 0 0 1rem 0;\n}\n\n.p-toast-message-icon {\n flex-shrink: 0;\n font-size: ").concat(dt("toast.icon.size"), ";\n width: ").concat(dt("toast.icon.size"), ";\n height: ").concat(dt("toast.icon.size"), ";\n}\n\n.p-toast-message-content {\n display: flex;\n align-items: flex-start;\n padding: ").concat(dt("toast.content.padding"), ";\n gap: ").concat(dt("toast.content.gap"), ";\n}\n\n.p-toast-message-text {\n flex: 1 1 auto;\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("toast.text.gap"), ";\n}\n\n.p-toast-summary {\n font-weight: ").concat(dt("toast.summary.font.weight"), ";\n font-size: ").concat(dt("toast.summary.font.size"), ";\n}\n\n.p-toast-detail {\n font-weight: ").concat(dt("toast.detail.font.weight"), ";\n font-size: ").concat(dt("toast.detail.font.size"), ";\n}\n\n.p-toast-close-button {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n cursor: pointer;\n background: transparent;\n transition: background ").concat(dt("toast.transition.duration"), ", color ").concat(dt("toast.transition.duration"), ", outline-color ").concat(dt("toast.transition.duration"), ", box-shadow ").concat(dt("toast.transition.duration"), ";\n outline-color: transparent;\n color: inherit;\n width: ").concat(dt("toast.close.button.width"), ";\n height: ").concat(dt("toast.close.button.height"), ";\n border-radius: ").concat(dt("toast.close.button.border.radius"), ";\n margin: -25% 0 0 0;\n right: -25%;\n padding: 0;\n border: none;\n user-select: none;\n}\n\n.p-toast-close-button:dir(rtl) {\n margin: -25% 0 0 auto;\n left: -25%;\n right: auto;\n}\n\n.p-toast-message-info,\n.p-toast-message-success,\n.p-toast-message-warn,\n.p-toast-message-error,\n.p-toast-message-secondary,\n.p-toast-message-contrast {\n border-width: ").concat(dt("toast.border.width"), ";\n border-style: solid;\n backdrop-filter: blur(").concat(dt("toast.blur"), ");\n border-radius: ").concat(dt("toast.border.radius"), ";\n}\n\n.p-toast-close-icon {\n font-size: ").concat(dt("toast.close.icon.size"), ";\n width: ").concat(dt("toast.close.icon.size"), ";\n height: ").concat(dt("toast.close.icon.size"), ";\n}\n\n.p-toast-close-button:focus-visible {\n outline-width: ").concat(dt("focus.ring.width"), ";\n outline-style: ").concat(dt("focus.ring.style"), ";\n outline-offset: ").concat(dt("focus.ring.offset"), ";\n}\n\n.p-toast-message-info {\n background: ").concat(dt("toast.info.background"), ";\n border-color: ").concat(dt("toast.info.border.color"), ";\n color: ").concat(dt("toast.info.color"), ";\n box-shadow: ").concat(dt("toast.info.shadow"), ";\n}\n\n.p-toast-message-info .p-toast-detail {\n color: ").concat(dt("toast.info.detail.color"), ";\n}\n\n.p-toast-message-info .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.info.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.info.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-info .p-toast-close-button:hover {\n background: ").concat(dt("toast.info.close.button.hover.background"), ";\n}\n\n.p-toast-message-success {\n background: ").concat(dt("toast.success.background"), ";\n border-color: ").concat(dt("toast.success.border.color"), ";\n color: ").concat(dt("toast.success.color"), ";\n box-shadow: ").concat(dt("toast.success.shadow"), ";\n}\n\n.p-toast-message-success .p-toast-detail {\n color: ").concat(dt("toast.success.detail.color"), ";\n}\n\n.p-toast-message-success .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.success.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.success.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-success .p-toast-close-button:hover {\n background: ").concat(dt("toast.success.close.button.hover.background"), ";\n}\n\n.p-toast-message-warn {\n background: ").concat(dt("toast.warn.background"), ";\n border-color: ").concat(dt("toast.warn.border.color"), ";\n color: ").concat(dt("toast.warn.color"), ";\n box-shadow: ").concat(dt("toast.warn.shadow"), ";\n}\n\n.p-toast-message-warn .p-toast-detail {\n color: ").concat(dt("toast.warn.detail.color"), ";\n}\n\n.p-toast-message-warn .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.warn.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.warn.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-warn .p-toast-close-button:hover {\n background: ").concat(dt("toast.warn.close.button.hover.background"), ";\n}\n\n.p-toast-message-error {\n background: ").concat(dt("toast.error.background"), ";\n border-color: ").concat(dt("toast.error.border.color"), ";\n color: ").concat(dt("toast.error.color"), ";\n box-shadow: ").concat(dt("toast.error.shadow"), ";\n}\n\n.p-toast-message-error .p-toast-detail {\n color: ").concat(dt("toast.error.detail.color"), ";\n}\n\n.p-toast-message-error .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.error.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.error.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-error .p-toast-close-button:hover {\n background: ").concat(dt("toast.error.close.button.hover.background"), ";\n}\n\n.p-toast-message-secondary {\n background: ").concat(dt("toast.secondary.background"), ";\n border-color: ").concat(dt("toast.secondary.border.color"), ";\n color: ").concat(dt("toast.secondary.color"), ";\n box-shadow: ").concat(dt("toast.secondary.shadow"), ";\n}\n\n.p-toast-message-secondary .p-toast-detail {\n color: ").concat(dt("toast.secondary.detail.color"), ";\n}\n\n.p-toast-message-secondary .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.secondary.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.secondary.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-secondary .p-toast-close-button:hover {\n background: ").concat(dt("toast.secondary.close.button.hover.background"), ";\n}\n\n.p-toast-message-contrast {\n background: ").concat(dt("toast.contrast.background"), ";\n border-color: ").concat(dt("toast.contrast.border.color"), ";\n color: ").concat(dt("toast.contrast.color"), ";\n box-shadow: ").concat(dt("toast.contrast.shadow"), ";\n}\n\n.p-toast-message-contrast .p-toast-detail {\n color: ").concat(dt("toast.contrast.detail.color"), ";\n}\n\n.p-toast-message-contrast .p-toast-close-button:focus-visible {\n outline-color: ").concat(dt("toast.contrast.close.button.focus.ring.color"), ";\n box-shadow: ").concat(dt("toast.contrast.close.button.focus.ring.shadow"), ";\n}\n\n.p-toast-message-contrast .p-toast-close-button:hover {\n background: ").concat(dt("toast.contrast.close.button.hover.background"), ";\n}\n\n.p-toast-top-center {\n transform: translateX(-50%);\n}\n\n.p-toast-bottom-center {\n transform: translateX(-50%);\n}\n\n.p-toast-center {\n min-width: 20vw;\n transform: translate(-50%, -50%);\n}\n\n.p-toast-message-enter-from {\n opacity: 0;\n transform: translateY(50%);\n}\n\n.p-toast-message-leave-from {\n max-height: 1000px;\n}\n\n.p-toast .p-toast-message.p-toast-message-leave-to {\n max-height: 0;\n opacity: 0;\n margin-bottom: 0;\n overflow: hidden;\n}\n\n.p-toast-message-enter-active {\n transition: transform 0.3s, opacity 0.3s;\n}\n\n.p-toast-message-leave-active {\n transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin-bottom 0.3s;\n}\n"); -}, "theme"); -var inlineStyles = { - root: /* @__PURE__ */ __name(function root(_ref2) { - var position = _ref2.position; - return { - position: "fixed", - top: position === "top-right" || position === "top-left" || position === "top-center" ? "20px" : position === "center" ? "50%" : null, - right: (position === "top-right" || position === "bottom-right") && "20px", - bottom: (position === "bottom-left" || position === "bottom-right" || position === "bottom-center") && "20px", - left: position === "top-left" || position === "bottom-left" ? "20px" : position === "center" || position === "top-center" || position === "bottom-center" ? "50%" : null - }; - }, "root") -}; -var classes = { - root: /* @__PURE__ */ __name(function root2(_ref3) { - var props = _ref3.props; - return ["p-toast p-component p-toast-" + props.position]; - }, "root"), - message: /* @__PURE__ */ __name(function message(_ref4) { - var props = _ref4.props; - return ["p-toast-message", { - "p-toast-message-info": props.message.severity === "info" || props.message.severity === void 0, - "p-toast-message-warn": props.message.severity === "warn", - "p-toast-message-error": props.message.severity === "error", - "p-toast-message-success": props.message.severity === "success", - "p-toast-message-secondary": props.message.severity === "secondary", - "p-toast-message-contrast": props.message.severity === "contrast" - }]; - }, "message"), - messageContent: "p-toast-message-content", - messageIcon: /* @__PURE__ */ __name(function messageIcon(_ref5) { - var props = _ref5.props; - return ["p-toast-message-icon", _defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2({}, props.infoIcon, props.message.severity === "info"), props.warnIcon, props.message.severity === "warn"), props.errorIcon, props.message.severity === "error"), props.successIcon, props.message.severity === "success")]; - }, "messageIcon"), - messageText: "p-toast-message-text", - summary: "p-toast-summary", - detail: "p-toast-detail", - closeButton: "p-toast-close-button", - closeIcon: "p-toast-close-icon" -}; -var ToastStyle = BaseStyle.extend({ - name: "toast", - theme, - classes, - inlineStyles -}); -var script$4 = { - name: "ExclamationTriangleIcon", - "extends": script$5 -}; -function render$3(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - d: "M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z", - fill: "currentColor" - }, null, -1), createBaseVNode("path", { - d: "M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z", - fill: "currentColor" - }, null, -1), createBaseVNode("path", { - d: "M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$3, "render$3"); -script$4.render = render$3; -var script$3 = { - name: "InfoCircleIcon", - "extends": script$5 -}; -function render$2(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - "fill-rule": "evenodd", - "clip-rule": "evenodd", - d: "M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$2, "render$2"); -script$3.render = render$2; -var script$2 = { - name: "BaseToast", - "extends": script$6, - props: { - group: { - type: String, - "default": null - }, - position: { - type: String, - "default": "top-right" - }, - autoZIndex: { - type: Boolean, - "default": true - }, - baseZIndex: { - type: Number, - "default": 0 - }, - breakpoints: { - type: Object, - "default": null - }, - closeIcon: { - type: String, - "default": void 0 - }, - infoIcon: { - type: String, - "default": void 0 - }, - warnIcon: { - type: String, - "default": void 0 - }, - errorIcon: { - type: String, - "default": void 0 - }, - successIcon: { - type: String, - "default": void 0 - }, - closeButtonProps: { - type: null, - "default": null - } - }, - style: ToastStyle, - provide: /* @__PURE__ */ __name(function provide() { - return { - $pcToast: this, - $parentInstance: this - }; - }, "provide") -}; -var script$1 = { - name: "ToastMessage", - hostName: "Toast", - "extends": script$6, - emits: ["close"], - closeTimeout: null, - props: { - message: { - type: null, - "default": null - }, - templates: { - type: Object, - "default": null - }, - closeIcon: { - type: String, - "default": null - }, - infoIcon: { - type: String, - "default": null - }, - warnIcon: { - type: String, - "default": null - }, - errorIcon: { - type: String, - "default": null - }, - successIcon: { - type: String, - "default": null - }, - closeButtonProps: { - type: null, - "default": null - } - }, - mounted: /* @__PURE__ */ __name(function mounted() { - var _this = this; - if (this.message.life) { - this.closeTimeout = setTimeout(function() { - _this.close({ - message: _this.message, - type: "life-end" - }); - }, this.message.life); - } - }, "mounted"), - beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount() { - this.clearCloseTimeout(); - }, "beforeUnmount"), - methods: { - close: /* @__PURE__ */ __name(function close(params) { - this.$emit("close", params); - }, "close"), - onCloseClick: /* @__PURE__ */ __name(function onCloseClick() { - this.clearCloseTimeout(); - this.close({ - message: this.message, - type: "close" - }); - }, "onCloseClick"), - clearCloseTimeout: /* @__PURE__ */ __name(function clearCloseTimeout() { - if (this.closeTimeout) { - clearTimeout(this.closeTimeout); - this.closeTimeout = null; - } - }, "clearCloseTimeout") - }, - computed: { - iconComponent: /* @__PURE__ */ __name(function iconComponent() { - return { - info: !this.infoIcon && script$3, - success: !this.successIcon && script$7, - warn: !this.warnIcon && script$4, - error: !this.errorIcon && script$8 - }[this.message.severity]; - }, "iconComponent"), - closeAriaLabel: /* @__PURE__ */ __name(function closeAriaLabel() { - return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : void 0; - }, "closeAriaLabel") - }, - components: { - TimesIcon: script$9, - InfoCircleIcon: script$3, - CheckIcon: script$7, - ExclamationTriangleIcon: script$4, - TimesCircleIcon: script$8 - }, - directives: { - ripple: Ripple - } -}; -function _typeof$1(o) { - "@babel/helpers - typeof"; - return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$1(o); -} -__name(_typeof$1, "_typeof$1"); -function ownKeys$1(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys$1, "ownKeys$1"); -function _objectSpread$1(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys$1(Object(t), true).forEach(function(r2) { - _defineProperty$1(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread$1, "_objectSpread$1"); -function _defineProperty$1(e, r, t) { - return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$1, "_defineProperty$1"); -function _toPropertyKey$1(t) { - var i = _toPrimitive$1(t, "string"); - return "symbol" == _typeof$1(i) ? i : i + ""; -} -__name(_toPropertyKey$1, "_toPropertyKey$1"); -function _toPrimitive$1(t, r) { - if ("object" != _typeof$1(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$1(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$1, "_toPrimitive$1"); -var _hoisted_1 = ["aria-label"]; -function render$1(_ctx, _cache, $props, $setup, $data, $options) { - var _directive_ripple = resolveDirective("ripple"); - return openBlock(), createElementBlock("div", mergeProps({ - "class": [_ctx.cx("message"), $props.message.styleClass], - role: "alert", - "aria-live": "assertive", - "aria-atomic": "true" - }, _ctx.ptm("message")), [$props.templates.container ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.container), { - key: 0, - message: $props.message, - closeCallback: $options.onCloseClick - }, null, 8, ["message", "closeCallback"])) : (openBlock(), createElementBlock("div", mergeProps({ - key: 1, - "class": [_ctx.cx("messageContent"), $props.message.contentStyleClass] - }, _ctx.ptm("messageContent")), [!$props.templates.message ? (openBlock(), createElementBlock(Fragment, { - key: 0 - }, [(openBlock(), createBlock(resolveDynamicComponent($props.templates.messageicon ? $props.templates.messageicon : $props.templates.icon ? $props.templates.icon : $options.iconComponent && $options.iconComponent.name ? $options.iconComponent : "span"), mergeProps({ - "class": _ctx.cx("messageIcon") - }, _ctx.ptm("messageIcon")), null, 16, ["class"])), createBaseVNode("div", mergeProps({ - "class": _ctx.cx("messageText") - }, _ctx.ptm("messageText")), [createBaseVNode("span", mergeProps({ - "class": _ctx.cx("summary") - }, _ctx.ptm("summary")), toDisplayString($props.message.summary), 17), createBaseVNode("div", mergeProps({ - "class": _ctx.cx("detail") - }, _ctx.ptm("detail")), toDisplayString($props.message.detail), 17)], 16)], 64)) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.message), { - key: 1, - message: $props.message - }, null, 8, ["message"])), $props.message.closable !== false ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ - key: 2 - }, _ctx.ptm("buttonContainer"))), [withDirectives((openBlock(), createElementBlock("button", mergeProps({ - "class": _ctx.cx("closeButton"), - type: "button", - "aria-label": $options.closeAriaLabel, - onClick: _cache[0] || (_cache[0] = function() { - return $options.onCloseClick && $options.onCloseClick.apply($options, arguments); - }), - autofocus: "" - }, _objectSpread$1(_objectSpread$1({}, $props.closeButtonProps), _ctx.ptm("closeButton"))), [(openBlock(), createBlock(resolveDynamicComponent($props.templates.closeicon || "TimesIcon"), mergeProps({ - "class": [_ctx.cx("closeIcon"), $props.closeIcon] - }, _ctx.ptm("closeIcon")), null, 16, ["class"]))], 16, _hoisted_1)), [[_directive_ripple]])], 16)) : createCommentVNode("", true)], 16))], 16); -} -__name(render$1, "render$1"); -script$1.render = render$1; -function _toConsumableArray(r) { - return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); -} -__name(_toConsumableArray, "_toConsumableArray"); -function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} -__name(_nonIterableSpread, "_nonIterableSpread"); -function _unsupportedIterableToArray(r, a) { - if (r) { - if ("string" == typeof r) return _arrayLikeToArray(r, a); - var t = {}.toString.call(r).slice(8, -1); - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; - } -} -__name(_unsupportedIterableToArray, "_unsupportedIterableToArray"); -function _iterableToArray(r) { - if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); -} -__name(_iterableToArray, "_iterableToArray"); -function _arrayWithoutHoles(r) { - if (Array.isArray(r)) return _arrayLikeToArray(r); -} -__name(_arrayWithoutHoles, "_arrayWithoutHoles"); -function _arrayLikeToArray(r, a) { - (null == a || a > r.length) && (a = r.length); - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; - return n; -} -__name(_arrayLikeToArray, "_arrayLikeToArray"); -var messageIdx = 0; -var script = { - name: "Toast", - "extends": script$2, - inheritAttrs: false, - emits: ["close", "life-end"], - data: /* @__PURE__ */ __name(function data() { - return { - messages: [] - }; - }, "data"), - styleElement: null, - mounted: /* @__PURE__ */ __name(function mounted2() { - ToastEventBus.on("add", this.onAdd); - ToastEventBus.on("remove", this.onRemove); - ToastEventBus.on("remove-group", this.onRemoveGroup); - ToastEventBus.on("remove-all-groups", this.onRemoveAllGroups); - if (this.breakpoints) { - this.createStyle(); - } - }, "mounted"), - beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount2() { - this.destroyStyle(); - if (this.$refs.container && this.autoZIndex) { - ZIndex.clear(this.$refs.container); - } - ToastEventBus.off("add", this.onAdd); - ToastEventBus.off("remove", this.onRemove); - ToastEventBus.off("remove-group", this.onRemoveGroup); - ToastEventBus.off("remove-all-groups", this.onRemoveAllGroups); - }, "beforeUnmount"), - methods: { - add: /* @__PURE__ */ __name(function add(message2) { - if (message2.id == null) { - message2.id = messageIdx++; - } - this.messages = [].concat(_toConsumableArray(this.messages), [message2]); - }, "add"), - remove: /* @__PURE__ */ __name(function remove(params) { - var index = this.messages.findIndex(function(m) { - return m.id === params.message.id; - }); - if (index !== -1) { - this.messages.splice(index, 1); - this.$emit(params.type, { - message: params.message - }); - } - }, "remove"), - onAdd: /* @__PURE__ */ __name(function onAdd(message2) { - if (this.group == message2.group) { - this.add(message2); - } - }, "onAdd"), - onRemove: /* @__PURE__ */ __name(function onRemove(message2) { - this.remove({ - message: message2, - type: "close" - }); - }, "onRemove"), - onRemoveGroup: /* @__PURE__ */ __name(function onRemoveGroup(group) { - if (this.group === group) { - this.messages = []; - } - }, "onRemoveGroup"), - onRemoveAllGroups: /* @__PURE__ */ __name(function onRemoveAllGroups() { - this.messages = []; - }, "onRemoveAllGroups"), - onEnter: /* @__PURE__ */ __name(function onEnter() { - if (this.autoZIndex) { - ZIndex.set("modal", this.$refs.container, this.baseZIndex || this.$primevue.config.zIndex.modal); - } - }, "onEnter"), - onLeave: /* @__PURE__ */ __name(function onLeave() { - var _this = this; - if (this.$refs.container && this.autoZIndex && isEmpty(this.messages)) { - setTimeout(function() { - ZIndex.clear(_this.$refs.container); - }, 200); - } - }, "onLeave"), - createStyle: /* @__PURE__ */ __name(function createStyle() { - if (!this.styleElement && !this.isUnstyled) { - var _this$$primevue; - this.styleElement = document.createElement("style"); - this.styleElement.type = "text/css"; - setAttribute(this.styleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce); - document.head.appendChild(this.styleElement); - var innerHTML = ""; - for (var breakpoint in this.breakpoints) { - var breakpointStyle = ""; - for (var styleProp in this.breakpoints[breakpoint]) { - breakpointStyle += styleProp + ":" + this.breakpoints[breakpoint][styleProp] + "!important;"; - } - innerHTML += "\n @media screen and (max-width: ".concat(breakpoint, ") {\n .p-toast[").concat(this.$attrSelector, "] {\n ").concat(breakpointStyle, "\n }\n }\n "); - } - this.styleElement.innerHTML = innerHTML; - } - }, "createStyle"), - destroyStyle: /* @__PURE__ */ __name(function destroyStyle() { - if (this.styleElement) { - document.head.removeChild(this.styleElement); - this.styleElement = null; - } - }, "destroyStyle") - }, - components: { - ToastMessage: script$1, - Portal: script$a - } -}; -function _typeof(o) { - "@babel/helpers - typeof"; - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof(o); -} -__name(_typeof, "_typeof"); -function ownKeys(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys, "ownKeys"); -function _objectSpread(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys(Object(t), true).forEach(function(r2) { - _defineProperty(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread, "_objectSpread"); -function _defineProperty(e, r, t) { - return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty, "_defineProperty"); -function _toPropertyKey(t) { - var i = _toPrimitive(t, "string"); - return "symbol" == _typeof(i) ? i : i + ""; -} -__name(_toPropertyKey, "_toPropertyKey"); -function _toPrimitive(t, r) { - if ("object" != _typeof(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive, "_toPrimitive"); -function render(_ctx, _cache, $props, $setup, $data, $options) { - var _component_ToastMessage = resolveComponent("ToastMessage"); - var _component_Portal = resolveComponent("Portal"); - return openBlock(), createBlock(_component_Portal, null, { - "default": withCtx(function() { - return [createBaseVNode("div", mergeProps({ - ref: "container", - "class": _ctx.cx("root"), - style: _ctx.sx("root", true, { - position: _ctx.position - }) - }, _ctx.ptmi("root")), [createVNode(TransitionGroup, mergeProps({ - name: "p-toast-message", - tag: "div", - onEnter: $options.onEnter, - onLeave: $options.onLeave - }, _objectSpread({}, _ctx.ptm("transition"))), { - "default": withCtx(function() { - return [(openBlock(true), createElementBlock(Fragment, null, renderList($data.messages, function(msg) { - return openBlock(), createBlock(_component_ToastMessage, { - key: msg.id, - message: msg, - templates: _ctx.$slots, - closeIcon: _ctx.closeIcon, - infoIcon: _ctx.infoIcon, - warnIcon: _ctx.warnIcon, - errorIcon: _ctx.errorIcon, - successIcon: _ctx.successIcon, - closeButtonProps: _ctx.closeButtonProps, - unstyled: _ctx.unstyled, - onClose: _cache[0] || (_cache[0] = function($event) { - return $options.remove($event); - }), - pt: _ctx.pt - }, null, 8, ["message", "templates", "closeIcon", "infoIcon", "warnIcon", "errorIcon", "successIcon", "closeButtonProps", "unstyled", "pt"]); - }), 128))]; - }), - _: 1 - }, 16, ["onEnter", "onLeave"])], 16)]; - }), - _: 1 - }); -} -__name(render, "render"); -script.render = render; -export { - script$3 as a, - script$4 as b, - script as s -}; -//# sourceMappingURL=index-CE2hpomb.js.map diff --git a/comfy/web/assets/index-CE2hpomb.js.map b/comfy/web/assets/index-CE2hpomb.js.map deleted file mode 100644 index 11cbeb6a9..000000000 --- a/comfy/web/assets/index-CE2hpomb.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-CE2hpomb.js","sources":["../../../../../node_modules/primevue/toast/style/index.mjs","../../../../../node_modules/@primevue/icons/exclamationtriangle/index.mjs","../../../../../node_modules/@primevue/icons/infocircle/index.mjs","../../../../../node_modules/primevue/toast/index.mjs"],"sourcesContent":["import BaseStyle from '@primevue/core/base/style';\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-toast {\\n width: \".concat(dt('toast.width'), \";\\n white-space: pre-line;\\n word-break: break-word;\\n}\\n\\n.p-toast-message {\\n margin: 0 0 1rem 0;\\n}\\n\\n.p-toast-message-icon {\\n flex-shrink: 0;\\n font-size: \").concat(dt('toast.icon.size'), \";\\n width: \").concat(dt('toast.icon.size'), \";\\n height: \").concat(dt('toast.icon.size'), \";\\n}\\n\\n.p-toast-message-content {\\n display: flex;\\n align-items: flex-start;\\n padding: \").concat(dt('toast.content.padding'), \";\\n gap: \").concat(dt('toast.content.gap'), \";\\n}\\n\\n.p-toast-message-text {\\n flex: 1 1 auto;\\n display: flex;\\n flex-direction: column;\\n gap: \").concat(dt('toast.text.gap'), \";\\n}\\n\\n.p-toast-summary {\\n font-weight: \").concat(dt('toast.summary.font.weight'), \";\\n font-size: \").concat(dt('toast.summary.font.size'), \";\\n}\\n\\n.p-toast-detail {\\n font-weight: \").concat(dt('toast.detail.font.weight'), \";\\n font-size: \").concat(dt('toast.detail.font.size'), \";\\n}\\n\\n.p-toast-close-button {\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n overflow: hidden;\\n position: relative;\\n cursor: pointer;\\n background: transparent;\\n transition: background \").concat(dt('toast.transition.duration'), \", color \").concat(dt('toast.transition.duration'), \", outline-color \").concat(dt('toast.transition.duration'), \", box-shadow \").concat(dt('toast.transition.duration'), \";\\n outline-color: transparent;\\n color: inherit;\\n width: \").concat(dt('toast.close.button.width'), \";\\n height: \").concat(dt('toast.close.button.height'), \";\\n border-radius: \").concat(dt('toast.close.button.border.radius'), \";\\n margin: -25% 0 0 0;\\n right: -25%;\\n padding: 0;\\n border: none;\\n user-select: none;\\n}\\n\\n.p-toast-close-button:dir(rtl) {\\n margin: -25% 0 0 auto;\\n left: -25%;\\n right: auto;\\n}\\n\\n.p-toast-message-info,\\n.p-toast-message-success,\\n.p-toast-message-warn,\\n.p-toast-message-error,\\n.p-toast-message-secondary,\\n.p-toast-message-contrast {\\n border-width: \").concat(dt('toast.border.width'), \";\\n border-style: solid;\\n backdrop-filter: blur(\").concat(dt('toast.blur'), \");\\n border-radius: \").concat(dt('toast.border.radius'), \";\\n}\\n\\n.p-toast-close-icon {\\n font-size: \").concat(dt('toast.close.icon.size'), \";\\n width: \").concat(dt('toast.close.icon.size'), \";\\n height: \").concat(dt('toast.close.icon.size'), \";\\n}\\n\\n.p-toast-close-button:focus-visible {\\n outline-width: \").concat(dt('focus.ring.width'), \";\\n outline-style: \").concat(dt('focus.ring.style'), \";\\n outline-offset: \").concat(dt('focus.ring.offset'), \";\\n}\\n\\n.p-toast-message-info {\\n background: \").concat(dt('toast.info.background'), \";\\n border-color: \").concat(dt('toast.info.border.color'), \";\\n color: \").concat(dt('toast.info.color'), \";\\n box-shadow: \").concat(dt('toast.info.shadow'), \";\\n}\\n\\n.p-toast-message-info .p-toast-detail {\\n color: \").concat(dt('toast.info.detail.color'), \";\\n}\\n\\n.p-toast-message-info .p-toast-close-button:focus-visible {\\n outline-color: \").concat(dt('toast.info.close.button.focus.ring.color'), \";\\n box-shadow: \").concat(dt('toast.info.close.button.focus.ring.shadow'), \";\\n}\\n\\n.p-toast-message-info .p-toast-close-button:hover {\\n background: \").concat(dt('toast.info.close.button.hover.background'), \";\\n}\\n\\n.p-toast-message-success {\\n background: \").concat(dt('toast.success.background'), \";\\n border-color: \").concat(dt('toast.success.border.color'), \";\\n color: \").concat(dt('toast.success.color'), \";\\n box-shadow: \").concat(dt('toast.success.shadow'), \";\\n}\\n\\n.p-toast-message-success .p-toast-detail {\\n color: \").concat(dt('toast.success.detail.color'), \";\\n}\\n\\n.p-toast-message-success .p-toast-close-button:focus-visible {\\n outline-color: \").concat(dt('toast.success.close.button.focus.ring.color'), \";\\n box-shadow: \").concat(dt('toast.success.close.button.focus.ring.shadow'), \";\\n}\\n\\n.p-toast-message-success .p-toast-close-button:hover {\\n background: \").concat(dt('toast.success.close.button.hover.background'), \";\\n}\\n\\n.p-toast-message-warn {\\n background: \").concat(dt('toast.warn.background'), \";\\n border-color: \").concat(dt('toast.warn.border.color'), \";\\n color: \").concat(dt('toast.warn.color'), \";\\n box-shadow: \").concat(dt('toast.warn.shadow'), \";\\n}\\n\\n.p-toast-message-warn .p-toast-detail {\\n color: \").concat(dt('toast.warn.detail.color'), \";\\n}\\n\\n.p-toast-message-warn .p-toast-close-button:focus-visible {\\n outline-color: \").concat(dt('toast.warn.close.button.focus.ring.color'), \";\\n box-shadow: \").concat(dt('toast.warn.close.button.focus.ring.shadow'), \";\\n}\\n\\n.p-toast-message-warn .p-toast-close-button:hover {\\n background: \").concat(dt('toast.warn.close.button.hover.background'), \";\\n}\\n\\n.p-toast-message-error {\\n background: \").concat(dt('toast.error.background'), \";\\n border-color: \").concat(dt('toast.error.border.color'), \";\\n color: \").concat(dt('toast.error.color'), \";\\n box-shadow: \").concat(dt('toast.error.shadow'), \";\\n}\\n\\n.p-toast-message-error .p-toast-detail {\\n color: \").concat(dt('toast.error.detail.color'), \";\\n}\\n\\n.p-toast-message-error .p-toast-close-button:focus-visible {\\n outline-color: \").concat(dt('toast.error.close.button.focus.ring.color'), \";\\n box-shadow: \").concat(dt('toast.error.close.button.focus.ring.shadow'), \";\\n}\\n\\n.p-toast-message-error .p-toast-close-button:hover {\\n background: \").concat(dt('toast.error.close.button.hover.background'), \";\\n}\\n\\n.p-toast-message-secondary {\\n background: \").concat(dt('toast.secondary.background'), \";\\n border-color: \").concat(dt('toast.secondary.border.color'), \";\\n color: \").concat(dt('toast.secondary.color'), \";\\n box-shadow: \").concat(dt('toast.secondary.shadow'), \";\\n}\\n\\n.p-toast-message-secondary .p-toast-detail {\\n color: \").concat(dt('toast.secondary.detail.color'), \";\\n}\\n\\n.p-toast-message-secondary .p-toast-close-button:focus-visible {\\n outline-color: \").concat(dt('toast.secondary.close.button.focus.ring.color'), \";\\n box-shadow: \").concat(dt('toast.secondary.close.button.focus.ring.shadow'), \";\\n}\\n\\n.p-toast-message-secondary .p-toast-close-button:hover {\\n background: \").concat(dt('toast.secondary.close.button.hover.background'), \";\\n}\\n\\n.p-toast-message-contrast {\\n background: \").concat(dt('toast.contrast.background'), \";\\n border-color: \").concat(dt('toast.contrast.border.color'), \";\\n color: \").concat(dt('toast.contrast.color'), \";\\n box-shadow: \").concat(dt('toast.contrast.shadow'), \";\\n}\\n\\n.p-toast-message-contrast .p-toast-detail {\\n color: \").concat(dt('toast.contrast.detail.color'), \";\\n}\\n\\n.p-toast-message-contrast .p-toast-close-button:focus-visible {\\n outline-color: \").concat(dt('toast.contrast.close.button.focus.ring.color'), \";\\n box-shadow: \").concat(dt('toast.contrast.close.button.focus.ring.shadow'), \";\\n}\\n\\n.p-toast-message-contrast .p-toast-close-button:hover {\\n background: \").concat(dt('toast.contrast.close.button.hover.background'), \";\\n}\\n\\n.p-toast-top-center {\\n transform: translateX(-50%);\\n}\\n\\n.p-toast-bottom-center {\\n transform: translateX(-50%);\\n}\\n\\n.p-toast-center {\\n min-width: 20vw;\\n transform: translate(-50%, -50%);\\n}\\n\\n.p-toast-message-enter-from {\\n opacity: 0;\\n transform: translateY(50%);\\n}\\n\\n.p-toast-message-leave-from {\\n max-height: 1000px;\\n}\\n\\n.p-toast .p-toast-message.p-toast-message-leave-to {\\n max-height: 0;\\n opacity: 0;\\n margin-bottom: 0;\\n overflow: hidden;\\n}\\n\\n.p-toast-message-enter-active {\\n transition: transform 0.3s, opacity 0.3s;\\n}\\n\\n.p-toast-message-leave-active {\\n transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin-bottom 0.3s;\\n}\\n\");\n};\n\n// Position\nvar inlineStyles = {\n root: function root(_ref2) {\n var position = _ref2.position;\n return {\n position: 'fixed',\n top: position === 'top-right' || position === 'top-left' || position === 'top-center' ? '20px' : position === 'center' ? '50%' : null,\n right: (position === 'top-right' || position === 'bottom-right') && '20px',\n bottom: (position === 'bottom-left' || position === 'bottom-right' || position === 'bottom-center') && '20px',\n left: position === 'top-left' || position === 'bottom-left' ? '20px' : position === 'center' || position === 'top-center' || position === 'bottom-center' ? '50%' : null\n };\n }\n};\nvar classes = {\n root: function root(_ref3) {\n var props = _ref3.props;\n return ['p-toast p-component p-toast-' + props.position];\n },\n message: function message(_ref4) {\n var props = _ref4.props;\n return ['p-toast-message', {\n 'p-toast-message-info': props.message.severity === 'info' || props.message.severity === undefined,\n 'p-toast-message-warn': props.message.severity === 'warn',\n 'p-toast-message-error': props.message.severity === 'error',\n 'p-toast-message-success': props.message.severity === 'success',\n 'p-toast-message-secondary': props.message.severity === 'secondary',\n 'p-toast-message-contrast': props.message.severity === 'contrast'\n }];\n },\n messageContent: 'p-toast-message-content',\n messageIcon: function messageIcon(_ref5) {\n var props = _ref5.props;\n return ['p-toast-message-icon', _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, props.infoIcon, props.message.severity === 'info'), props.warnIcon, props.message.severity === 'warn'), props.errorIcon, props.message.severity === 'error'), props.successIcon, props.message.severity === 'success')];\n },\n messageText: 'p-toast-message-text',\n summary: 'p-toast-summary',\n detail: 'p-toast-detail',\n closeButton: 'p-toast-close-button',\n closeIcon: 'p-toast-close-icon'\n};\nvar ToastStyle = BaseStyle.extend({\n name: 'toast',\n theme: theme,\n classes: classes,\n inlineStyles: inlineStyles\n});\n\nexport { ToastStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'ExclamationTriangleIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z\",\n fill: \"currentColor\"\n }, null, -1), createElementVNode(\"path\", {\n d: \"M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z\",\n fill: \"currentColor\"\n }, null, -1), createElementVNode(\"path\", {\n d: \"M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'InfoCircleIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import { setAttribute } from '@primeuix/utils/dom';\nimport { isEmpty } from '@primeuix/utils/object';\nimport { ZIndex } from '@primeuix/utils/zindex';\nimport Portal from 'primevue/portal';\nimport ToastEventBus from 'primevue/toasteventbus';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport ToastStyle from 'primevue/toast/style';\nimport CheckIcon from '@primevue/icons/check';\nimport ExclamationTriangleIcon from '@primevue/icons/exclamationtriangle';\nimport InfoCircleIcon from '@primevue/icons/infocircle';\nimport TimesIcon from '@primevue/icons/times';\nimport TimesCircleIcon from '@primevue/icons/timescircle';\nimport Ripple from 'primevue/ripple';\nimport { resolveDirective, openBlock, createElementBlock, mergeProps, createBlock, resolveDynamicComponent, Fragment, createElementVNode, toDisplayString, normalizeProps, withDirectives, createCommentVNode, resolveComponent, withCtx, createVNode, TransitionGroup, renderList } from 'vue';\n\nvar script$2 = {\n name: 'BaseToast',\n \"extends\": BaseComponent,\n props: {\n group: {\n type: String,\n \"default\": null\n },\n position: {\n type: String,\n \"default\": 'top-right'\n },\n autoZIndex: {\n type: Boolean,\n \"default\": true\n },\n baseZIndex: {\n type: Number,\n \"default\": 0\n },\n breakpoints: {\n type: Object,\n \"default\": null\n },\n closeIcon: {\n type: String,\n \"default\": undefined\n },\n infoIcon: {\n type: String,\n \"default\": undefined\n },\n warnIcon: {\n type: String,\n \"default\": undefined\n },\n errorIcon: {\n type: String,\n \"default\": undefined\n },\n successIcon: {\n type: String,\n \"default\": undefined\n },\n closeButtonProps: {\n type: null,\n \"default\": null\n }\n },\n style: ToastStyle,\n provide: function provide() {\n return {\n $pcToast: this,\n $parentInstance: this\n };\n }\n};\n\nvar script$1 = {\n name: 'ToastMessage',\n hostName: 'Toast',\n \"extends\": BaseComponent,\n emits: ['close'],\n closeTimeout: null,\n props: {\n message: {\n type: null,\n \"default\": null\n },\n templates: {\n type: Object,\n \"default\": null\n },\n closeIcon: {\n type: String,\n \"default\": null\n },\n infoIcon: {\n type: String,\n \"default\": null\n },\n warnIcon: {\n type: String,\n \"default\": null\n },\n errorIcon: {\n type: String,\n \"default\": null\n },\n successIcon: {\n type: String,\n \"default\": null\n },\n closeButtonProps: {\n type: null,\n \"default\": null\n }\n },\n mounted: function mounted() {\n var _this = this;\n if (this.message.life) {\n this.closeTimeout = setTimeout(function () {\n _this.close({\n message: _this.message,\n type: 'life-end'\n });\n }, this.message.life);\n }\n },\n beforeUnmount: function beforeUnmount() {\n this.clearCloseTimeout();\n },\n methods: {\n close: function close(params) {\n this.$emit('close', params);\n },\n onCloseClick: function onCloseClick() {\n this.clearCloseTimeout();\n this.close({\n message: this.message,\n type: 'close'\n });\n },\n clearCloseTimeout: function clearCloseTimeout() {\n if (this.closeTimeout) {\n clearTimeout(this.closeTimeout);\n this.closeTimeout = null;\n }\n }\n },\n computed: {\n iconComponent: function iconComponent() {\n return {\n info: !this.infoIcon && InfoCircleIcon,\n success: !this.successIcon && CheckIcon,\n warn: !this.warnIcon && ExclamationTriangleIcon,\n error: !this.errorIcon && TimesCircleIcon\n }[this.message.severity];\n },\n closeAriaLabel: function closeAriaLabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;\n }\n },\n components: {\n TimesIcon: TimesIcon,\n InfoCircleIcon: InfoCircleIcon,\n CheckIcon: CheckIcon,\n ExclamationTriangleIcon: ExclamationTriangleIcon,\n TimesCircleIcon: TimesCircleIcon\n },\n directives: {\n ripple: Ripple\n }\n};\n\nfunction _typeof$1(o) { \"@babel/helpers - typeof\"; return _typeof$1 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof$1(o); }\nfunction ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty$1(e, r, t) { return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey$1(t) { var i = _toPrimitive$1(t, \"string\"); return \"symbol\" == _typeof$1(i) ? i : i + \"\"; }\nfunction _toPrimitive$1(t, r) { if (\"object\" != _typeof$1(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof$1(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar _hoisted_1 = [\"aria-label\"];\nfunction render$1(_ctx, _cache, $props, $setup, $data, $options) {\n var _directive_ripple = resolveDirective(\"ripple\");\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": [_ctx.cx('message'), $props.message.styleClass],\n role: \"alert\",\n \"aria-live\": \"assertive\",\n \"aria-atomic\": \"true\"\n }, _ctx.ptm('message')), [$props.templates.container ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.container), {\n key: 0,\n message: $props.message,\n closeCallback: $options.onCloseClick\n }, null, 8, [\"message\", \"closeCallback\"])) : (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 1,\n \"class\": [_ctx.cx('messageContent'), $props.message.contentStyleClass]\n }, _ctx.ptm('messageContent')), [!$props.templates.message ? (openBlock(), createElementBlock(Fragment, {\n key: 0\n }, [(openBlock(), createBlock(resolveDynamicComponent($props.templates.messageicon ? $props.templates.messageicon : $props.templates.icon ? $props.templates.icon : $options.iconComponent && $options.iconComponent.name ? $options.iconComponent : 'span'), mergeProps({\n \"class\": _ctx.cx('messageIcon')\n }, _ctx.ptm('messageIcon')), null, 16, [\"class\"])), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('messageText')\n }, _ctx.ptm('messageText')), [createElementVNode(\"span\", mergeProps({\n \"class\": _ctx.cx('summary')\n }, _ctx.ptm('summary')), toDisplayString($props.message.summary), 17), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('detail')\n }, _ctx.ptm('detail')), toDisplayString($props.message.detail), 17)], 16)], 64)) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.message), {\n key: 1,\n message: $props.message\n }, null, 8, [\"message\"])), $props.message.closable !== false ? (openBlock(), createElementBlock(\"div\", normalizeProps(mergeProps({\n key: 2\n }, _ctx.ptm('buttonContainer'))), [withDirectives((openBlock(), createElementBlock(\"button\", mergeProps({\n \"class\": _ctx.cx('closeButton'),\n type: \"button\",\n \"aria-label\": $options.closeAriaLabel,\n onClick: _cache[0] || (_cache[0] = function () {\n return $options.onCloseClick && $options.onCloseClick.apply($options, arguments);\n }),\n autofocus: \"\"\n }, _objectSpread$1(_objectSpread$1({}, $props.closeButtonProps), _ctx.ptm('closeButton'))), [(openBlock(), createBlock(resolveDynamicComponent($props.templates.closeicon || 'TimesIcon'), mergeProps({\n \"class\": [_ctx.cx('closeIcon'), $props.closeIcon]\n }, _ctx.ptm('closeIcon')), null, 16, [\"class\"]))], 16, _hoisted_1)), [[_directive_ripple]])], 16)) : createCommentVNode(\"\", true)], 16))], 16);\n}\n\nscript$1.render = render$1;\n\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nvar messageIdx = 0;\nvar script = {\n name: 'Toast',\n \"extends\": script$2,\n inheritAttrs: false,\n emits: ['close', 'life-end'],\n data: function data() {\n return {\n messages: []\n };\n },\n styleElement: null,\n mounted: function mounted() {\n ToastEventBus.on('add', this.onAdd);\n ToastEventBus.on('remove', this.onRemove);\n ToastEventBus.on('remove-group', this.onRemoveGroup);\n ToastEventBus.on('remove-all-groups', this.onRemoveAllGroups);\n if (this.breakpoints) {\n this.createStyle();\n }\n },\n beforeUnmount: function beforeUnmount() {\n this.destroyStyle();\n if (this.$refs.container && this.autoZIndex) {\n ZIndex.clear(this.$refs.container);\n }\n ToastEventBus.off('add', this.onAdd);\n ToastEventBus.off('remove', this.onRemove);\n ToastEventBus.off('remove-group', this.onRemoveGroup);\n ToastEventBus.off('remove-all-groups', this.onRemoveAllGroups);\n },\n methods: {\n add: function add(message) {\n if (message.id == null) {\n message.id = messageIdx++;\n }\n this.messages = [].concat(_toConsumableArray(this.messages), [message]);\n },\n remove: function remove(params) {\n var index = this.messages.findIndex(function (m) {\n return m.id === params.message.id;\n });\n if (index !== -1) {\n this.messages.splice(index, 1);\n this.$emit(params.type, {\n message: params.message\n });\n }\n },\n onAdd: function onAdd(message) {\n if (this.group == message.group) {\n this.add(message);\n }\n },\n onRemove: function onRemove(message) {\n this.remove({\n message: message,\n type: 'close'\n });\n },\n onRemoveGroup: function onRemoveGroup(group) {\n if (this.group === group) {\n this.messages = [];\n }\n },\n onRemoveAllGroups: function onRemoveAllGroups() {\n this.messages = [];\n },\n onEnter: function onEnter() {\n if (this.autoZIndex) {\n ZIndex.set('modal', this.$refs.container, this.baseZIndex || this.$primevue.config.zIndex.modal);\n }\n },\n onLeave: function onLeave() {\n var _this = this;\n if (this.$refs.container && this.autoZIndex && isEmpty(this.messages)) {\n setTimeout(function () {\n ZIndex.clear(_this.$refs.container);\n }, 200);\n }\n },\n createStyle: function createStyle() {\n if (!this.styleElement && !this.isUnstyled) {\n var _this$$primevue;\n this.styleElement = document.createElement('style');\n this.styleElement.type = 'text/css';\n setAttribute(this.styleElement, 'nonce', (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);\n document.head.appendChild(this.styleElement);\n var innerHTML = '';\n for (var breakpoint in this.breakpoints) {\n var breakpointStyle = '';\n for (var styleProp in this.breakpoints[breakpoint]) {\n breakpointStyle += styleProp + ':' + this.breakpoints[breakpoint][styleProp] + '!important;';\n }\n innerHTML += \"\\n @media screen and (max-width: \".concat(breakpoint, \") {\\n .p-toast[\").concat(this.$attrSelector, \"] {\\n \").concat(breakpointStyle, \"\\n }\\n }\\n \");\n }\n this.styleElement.innerHTML = innerHTML;\n }\n },\n destroyStyle: function destroyStyle() {\n if (this.styleElement) {\n document.head.removeChild(this.styleElement);\n this.styleElement = null;\n }\n }\n },\n components: {\n ToastMessage: script$1,\n Portal: Portal\n }\n};\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_ToastMessage = resolveComponent(\"ToastMessage\");\n var _component_Portal = resolveComponent(\"Portal\");\n return openBlock(), createBlock(_component_Portal, null, {\n \"default\": withCtx(function () {\n return [createElementVNode(\"div\", mergeProps({\n ref: \"container\",\n \"class\": _ctx.cx('root'),\n style: _ctx.sx('root', true, {\n position: _ctx.position\n })\n }, _ctx.ptmi('root')), [createVNode(TransitionGroup, mergeProps({\n name: \"p-toast-message\",\n tag: \"div\",\n onEnter: $options.onEnter,\n onLeave: $options.onLeave\n }, _objectSpread({}, _ctx.ptm('transition'))), {\n \"default\": withCtx(function () {\n return [(openBlock(true), createElementBlock(Fragment, null, renderList($data.messages, function (msg) {\n return openBlock(), createBlock(_component_ToastMessage, {\n key: msg.id,\n message: msg,\n templates: _ctx.$slots,\n closeIcon: _ctx.closeIcon,\n infoIcon: _ctx.infoIcon,\n warnIcon: _ctx.warnIcon,\n errorIcon: _ctx.errorIcon,\n successIcon: _ctx.successIcon,\n closeButtonProps: _ctx.closeButtonProps,\n unstyled: _ctx.unstyled,\n onClose: _cache[0] || (_cache[0] = function ($event) {\n return $options.remove($event);\n }),\n pt: _ctx.pt\n }, null, 8, [\"message\", \"templates\", \"closeIcon\", \"infoIcon\", \"warnIcon\", \"errorIcon\", \"successIcon\", \"closeButtonProps\", \"unstyled\", \"pt\"]);\n }), 128))];\n }),\n _: 1\n }, 16, [\"onEnter\", \"onLeave\"])], 16)];\n }),\n _: 1\n });\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n"],"names":["_typeof","o","_defineProperty","_toPropertyKey","_toPrimitive","theme","root","script","BaseIcon","render","createElementVNode","BaseComponent","InfoCircleIcon","CheckIcon","ExclamationTriangleIcon","TimesCircleIcon","TimesIcon","r","mounted","beforeUnmount","message","Portal"],"mappings":";;;AAEA,SAASA,UAAQ,GAAG;AAAE;AAA2B,SAAOA,YAAU,cAAc,OAAO,UAAU,YAAY,OAAO,OAAO,WAAW,SAAUC,IAAG;AAAE,WAAO,OAAOA;AAAA,MAAO,SAAUA,IAAG;AAAE,WAAOA,MAAK,cAAc,OAAO,UAAUA,GAAE,gBAAgB,UAAUA,OAAM,OAAO,YAAY,WAAW,OAAOA;AAAA,EAAE,GAAID,UAAQ,CAAC;AAAE;AAAnTA;AACT,SAASE,kBAAgB,GAAG,GAAG,GAAG;AAAE,UAAQ,IAAIC,iBAAe,CAAC,MAAM,IAAI,OAAO,eAAe,GAAG,GAAG,EAAE,OAAO,GAAG,YAAY,MAAI,cAAc,MAAI,UAAU,KAAE,CAAE,IAAI,EAAE,CAAC,IAAI,GAAG;AAAE;AAAzKD;AACT,SAASC,iBAAe,GAAG;AAAE,MAAI,IAAIC,eAAa,GAAG,QAAQ;AAAG,SAAO,YAAYJ,UAAQ,CAAC,IAAI,IAAI,IAAI;AAAG;AAAlGG;AACT,SAASC,eAAa,GAAG,GAAG;AAAE,MAAI,YAAYJ,UAAQ,CAAC,KAAK,CAAC,EAAG,QAAO;AAAG,MAAI,IAAI,EAAE,OAAO,WAAW;AAAG,MAAI,WAAW,GAAG;AA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1B,GAAS,cAAc,CAAA,GAAI,KAAK,IAAI,YAAY,CAAC,CAAC,GAAG;AAAA,QAC7C,WAAW,QAAQ,WAAY;AAC7B,iBAAO,EAAE,UAAU,IAAI,GAAG,mBAAmB,UAAU,MAAM,WAAW,MAAM,UAAU,SAAU,KAAK;AACrG,mBAAO,UAAS,GAAI,YAAY,yBAAyB;AAAA,cACvD,KAAK,IAAI;AAAA,cACT,SAAS;AAAA,cACT,WAAW,KAAK;AAAA,cAChB,WAAW,KAAK;AAAA,cAChB,UAAU,KAAK;AAAA,cACf,UAAU,KAAK;AAAA,cACf,WAAW,KAAK;AAAA,cAChB,aAAa,KAAK;AAAA,cAClB,kBAAkB,KAAK;AAAA,cACvB,UAAU,KAAK;AAAA,cACf,SAAS,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,SAAU,QAAQ;AACnD,uBAAO,SAAS,OAAO,MAAM;AAAA,cAC7C;AAAA,cACc,IAAI,KAAK;AAAA,YACV,GAAE,MAAM,GAAG,CAAC,WAAW,aAAa,aAAa,YAAY,YAAY,aAAa,eAAe,oBAAoB,YAAY,IAAI,CAAC;AAAA,UACvJ,CAAW,GAAG,GAAG,EAAG;AAAA,QACpB,CAAS;AAAA,QACD,GAAG;AAAA,MACX,GAAS,IAAI,CAAC,WAAW,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC;AAAA,IAC1C,CAAK;AAAA,IACD,GAAG;AAAA,EACP,CAAG;AACH;AA1CS;AA4CT,OAAO,SAAS;","x_google_ignoreList":[0,1,2,3]} \ No newline at end of file diff --git a/comfy/web/assets/index-C_ACzX5-.js b/comfy/web/assets/index-C_ACzX5-.js deleted file mode 100644 index c2c2cb6d4..000000000 --- a/comfy/web/assets/index-C_ACzX5-.js +++ /dev/null @@ -1,392 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { ce as BaseStyle, cf as script$2, cw as ZIndex, cr as addClass, ci as focus, d4 as blockBodyScroll, d6 as unblockBodyScroll, d7 as FocusTrap, l as script$3, cJ as script$4, cU as script$5, co as resolveComponent, r as resolveDirective, o as openBlock, y as createBlock, z as withCtx, f as createElementBlock, aE as mergeProps, k as createVNode, c8 as Transition, i as withDirectives, A as renderSlot, F as Fragment, m as createBaseVNode, Z as normalizeClass, E as toDisplayString, B as createCommentVNode, C as resolveDynamicComponent } from "./index-DIgj6hpb.js"; -var theme = /* @__PURE__ */ __name(function theme2(_ref) { - var dt = _ref.dt; - return "\n.p-drawer {\n display: flex;\n flex-direction: column;\n transform: translate3d(0px, 0px, 0px);\n position: relative;\n transition: transform 0.3s;\n background: ".concat(dt("drawer.background"), ";\n color: ").concat(dt("drawer.color"), ";\n border: 1px solid ").concat(dt("drawer.border.color"), ";\n box-shadow: ").concat(dt("drawer.shadow"), ";\n}\n\n.p-drawer-content {\n overflow-y: auto;\n flex-grow: 1;\n padding: ").concat(dt("drawer.content.padding"), ";\n}\n\n.p-drawer-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-shrink: 0;\n padding: ").concat(dt("drawer.header.padding"), ";\n}\n\n.p-drawer-footer {\n padding: ").concat(dt("drawer.footer.padding"), ";\n}\n\n.p-drawer-title {\n font-weight: ").concat(dt("drawer.title.font.weight"), ";\n font-size: ").concat(dt("drawer.title.font.size"), ";\n}\n\n.p-drawer-full .p-drawer {\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px !important;\n left: 0px !important;\n border-width: 1px;\n}\n\n.p-drawer-left .p-drawer-enter-from,\n.p-drawer-left .p-drawer-leave-to {\n transform: translateX(-100%);\n}\n\n.p-drawer-right .p-drawer-enter-from,\n.p-drawer-right .p-drawer-leave-to {\n transform: translateX(100%);\n}\n\n.p-drawer-top .p-drawer-enter-from,\n.p-drawer-top .p-drawer-leave-to {\n transform: translateY(-100%);\n}\n\n.p-drawer-bottom .p-drawer-enter-from,\n.p-drawer-bottom .p-drawer-leave-to {\n transform: translateY(100%);\n}\n\n.p-drawer-full .p-drawer-enter-from,\n.p-drawer-full .p-drawer-leave-to {\n opacity: 0;\n}\n\n.p-drawer-full .p-drawer-enter-active,\n.p-drawer-full .p-drawer-leave-active {\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n}\n\n.p-drawer-left .p-drawer {\n width: 20rem;\n height: 100%;\n border-inline-end-width: 1px;\n}\n\n.p-drawer-right .p-drawer {\n width: 20rem;\n height: 100%;\n border-inline-start-width: 1px;\n}\n\n.p-drawer-top .p-drawer {\n height: 10rem;\n width: 100%;\n border-block-end-width: 1px;\n}\n\n.p-drawer-bottom .p-drawer {\n height: 10rem;\n width: 100%;\n border-block-start-width: 1px;\n}\n\n.p-drawer-left .p-drawer-content,\n.p-drawer-right .p-drawer-content,\n.p-drawer-top .p-drawer-content,\n.p-drawer-bottom .p-drawer-content {\n width: 100%;\n height: 100%;\n}\n\n.p-drawer-open {\n display: flex;\n}\n\n.p-drawer-mask:dir(rtl) {\n flex-direction: row-reverse;\n}\n"); -}, "theme"); -var inlineStyles = { - mask: /* @__PURE__ */ __name(function mask(_ref2) { - var position = _ref2.position, modal = _ref2.modal; - return { - position: "fixed", - height: "100%", - width: "100%", - left: 0, - top: 0, - display: "flex", - justifyContent: position === "left" ? "flex-start" : position === "right" ? "flex-end" : "center", - alignItems: position === "top" ? "flex-start" : position === "bottom" ? "flex-end" : "center", - pointerEvents: modal ? "auto" : "none" - }; - }, "mask"), - root: { - pointerEvents: "auto" - } -}; -var classes = { - mask: /* @__PURE__ */ __name(function mask2(_ref3) { - var instance = _ref3.instance, props = _ref3.props; - var positions = ["left", "right", "top", "bottom"]; - var pos = positions.find(function(item) { - return item === props.position; - }); - return ["p-drawer-mask", { - "p-overlay-mask p-overlay-mask-enter": props.modal, - "p-drawer-open": instance.containerVisible, - "p-drawer-full": instance.fullScreen - }, pos ? "p-drawer-".concat(pos) : ""]; - }, "mask"), - root: /* @__PURE__ */ __name(function root(_ref4) { - var instance = _ref4.instance; - return ["p-drawer p-component", { - "p-drawer-full": instance.fullScreen - }]; - }, "root"), - header: "p-drawer-header", - title: "p-drawer-title", - pcCloseButton: "p-drawer-close-button", - content: "p-drawer-content", - footer: "p-drawer-footer" -}; -var DrawerStyle = BaseStyle.extend({ - name: "drawer", - theme, - classes, - inlineStyles -}); -var script$1 = { - name: "BaseDrawer", - "extends": script$2, - props: { - visible: { - type: Boolean, - "default": false - }, - position: { - type: String, - "default": "left" - }, - header: { - type: null, - "default": null - }, - baseZIndex: { - type: Number, - "default": 0 - }, - autoZIndex: { - type: Boolean, - "default": true - }, - dismissable: { - type: Boolean, - "default": true - }, - showCloseIcon: { - type: Boolean, - "default": true - }, - closeButtonProps: { - type: Object, - "default": /* @__PURE__ */ __name(function _default() { - return { - severity: "secondary", - text: true, - rounded: true - }; - }, "_default") - }, - closeIcon: { - type: String, - "default": void 0 - }, - modal: { - type: Boolean, - "default": true - }, - blockScroll: { - type: Boolean, - "default": false - } - }, - style: DrawerStyle, - provide: /* @__PURE__ */ __name(function provide() { - return { - $pcDrawer: this, - $parentInstance: this - }; - }, "provide") -}; -var script = { - name: "Drawer", - "extends": script$1, - inheritAttrs: false, - emits: ["update:visible", "show", "after-show", "hide", "after-hide"], - data: /* @__PURE__ */ __name(function data() { - return { - containerVisible: this.visible - }; - }, "data"), - container: null, - mask: null, - content: null, - headerContainer: null, - footerContainer: null, - closeButton: null, - outsideClickListener: null, - documentKeydownListener: null, - watch: { - dismissable: /* @__PURE__ */ __name(function dismissable(newValue) { - if (newValue) { - this.enableDocumentSettings(); - } else { - this.disableDocumentSettings(); - } - }, "dismissable") - }, - updated: /* @__PURE__ */ __name(function updated() { - if (this.visible) { - this.containerVisible = this.visible; - } - }, "updated"), - beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount() { - this.disableDocumentSettings(); - if (this.mask && this.autoZIndex) { - ZIndex.clear(this.mask); - } - this.container = null; - this.mask = null; - }, "beforeUnmount"), - methods: { - hide: /* @__PURE__ */ __name(function hide() { - this.$emit("update:visible", false); - }, "hide"), - onEnter: /* @__PURE__ */ __name(function onEnter() { - this.$emit("show"); - this.focus(); - this.bindDocumentKeyDownListener(); - if (this.autoZIndex) { - ZIndex.set("modal", this.mask, this.baseZIndex || this.$primevue.config.zIndex.modal); - } - }, "onEnter"), - onAfterEnter: /* @__PURE__ */ __name(function onAfterEnter() { - this.enableDocumentSettings(); - this.$emit("after-show"); - }, "onAfterEnter"), - onBeforeLeave: /* @__PURE__ */ __name(function onBeforeLeave() { - if (this.modal) { - !this.isUnstyled && addClass(this.mask, "p-overlay-mask-leave"); - } - }, "onBeforeLeave"), - onLeave: /* @__PURE__ */ __name(function onLeave() { - this.$emit("hide"); - }, "onLeave"), - onAfterLeave: /* @__PURE__ */ __name(function onAfterLeave() { - if (this.autoZIndex) { - ZIndex.clear(this.mask); - } - this.unbindDocumentKeyDownListener(); - this.containerVisible = false; - this.disableDocumentSettings(); - this.$emit("after-hide"); - }, "onAfterLeave"), - onMaskClick: /* @__PURE__ */ __name(function onMaskClick(event) { - if (this.dismissable && this.modal && this.mask === event.target) { - this.hide(); - } - }, "onMaskClick"), - focus: /* @__PURE__ */ __name(function focus$1() { - var findFocusableElement = /* @__PURE__ */ __name(function findFocusableElement2(container) { - return container && container.querySelector("[autofocus]"); - }, "findFocusableElement"); - var focusTarget = this.$slots.header && findFocusableElement(this.headerContainer); - if (!focusTarget) { - focusTarget = this.$slots["default"] && findFocusableElement(this.container); - if (!focusTarget) { - focusTarget = this.$slots.footer && findFocusableElement(this.footerContainer); - if (!focusTarget) { - focusTarget = this.closeButton; - } - } - } - focusTarget && focus(focusTarget); - }, "focus$1"), - enableDocumentSettings: /* @__PURE__ */ __name(function enableDocumentSettings() { - if (this.dismissable && !this.modal) { - this.bindOutsideClickListener(); - } - if (this.blockScroll) { - blockBodyScroll(); - } - }, "enableDocumentSettings"), - disableDocumentSettings: /* @__PURE__ */ __name(function disableDocumentSettings() { - this.unbindOutsideClickListener(); - if (this.blockScroll) { - unblockBodyScroll(); - } - }, "disableDocumentSettings"), - onKeydown: /* @__PURE__ */ __name(function onKeydown(event) { - if (event.code === "Escape") { - this.hide(); - } - }, "onKeydown"), - containerRef: /* @__PURE__ */ __name(function containerRef(el) { - this.container = el; - }, "containerRef"), - maskRef: /* @__PURE__ */ __name(function maskRef(el) { - this.mask = el; - }, "maskRef"), - contentRef: /* @__PURE__ */ __name(function contentRef(el) { - this.content = el; - }, "contentRef"), - headerContainerRef: /* @__PURE__ */ __name(function headerContainerRef(el) { - this.headerContainer = el; - }, "headerContainerRef"), - footerContainerRef: /* @__PURE__ */ __name(function footerContainerRef(el) { - this.footerContainer = el; - }, "footerContainerRef"), - closeButtonRef: /* @__PURE__ */ __name(function closeButtonRef(el) { - this.closeButton = el ? el.$el : void 0; - }, "closeButtonRef"), - bindDocumentKeyDownListener: /* @__PURE__ */ __name(function bindDocumentKeyDownListener() { - if (!this.documentKeydownListener) { - this.documentKeydownListener = this.onKeydown; - document.addEventListener("keydown", this.documentKeydownListener); - } - }, "bindDocumentKeyDownListener"), - unbindDocumentKeyDownListener: /* @__PURE__ */ __name(function unbindDocumentKeyDownListener() { - if (this.documentKeydownListener) { - document.removeEventListener("keydown", this.documentKeydownListener); - this.documentKeydownListener = null; - } - }, "unbindDocumentKeyDownListener"), - bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener() { - var _this = this; - if (!this.outsideClickListener) { - this.outsideClickListener = function(event) { - if (_this.isOutsideClicked(event)) { - _this.hide(); - } - }; - document.addEventListener("click", this.outsideClickListener); - } - }, "bindOutsideClickListener"), - unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener() { - if (this.outsideClickListener) { - document.removeEventListener("click", this.outsideClickListener); - this.outsideClickListener = null; - } - }, "unbindOutsideClickListener"), - isOutsideClicked: /* @__PURE__ */ __name(function isOutsideClicked(event) { - return this.container && !this.container.contains(event.target); - }, "isOutsideClicked") - }, - computed: { - fullScreen: /* @__PURE__ */ __name(function fullScreen() { - return this.position === "full"; - }, "fullScreen"), - closeAriaLabel: /* @__PURE__ */ __name(function closeAriaLabel() { - return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : void 0; - }, "closeAriaLabel") - }, - directives: { - focustrap: FocusTrap - }, - components: { - Button: script$3, - Portal: script$4, - TimesIcon: script$5 - } -}; -var _hoisted_1 = ["aria-modal"]; -function render(_ctx, _cache, $props, $setup, $data, $options) { - var _component_Button = resolveComponent("Button"); - var _component_Portal = resolveComponent("Portal"); - var _directive_focustrap = resolveDirective("focustrap"); - return openBlock(), createBlock(_component_Portal, null, { - "default": withCtx(function() { - return [$data.containerVisible ? (openBlock(), createElementBlock("div", mergeProps({ - key: 0, - ref: $options.maskRef, - onMousedown: _cache[0] || (_cache[0] = function() { - return $options.onMaskClick && $options.onMaskClick.apply($options, arguments); - }), - "class": _ctx.cx("mask"), - style: _ctx.sx("mask", true, { - position: _ctx.position, - modal: _ctx.modal - }) - }, _ctx.ptm("mask")), [createVNode(Transition, mergeProps({ - name: "p-drawer", - onEnter: $options.onEnter, - onAfterEnter: $options.onAfterEnter, - onBeforeLeave: $options.onBeforeLeave, - onLeave: $options.onLeave, - onAfterLeave: $options.onAfterLeave, - appear: "" - }, _ctx.ptm("transition")), { - "default": withCtx(function() { - return [_ctx.visible ? withDirectives((openBlock(), createElementBlock("div", mergeProps({ - key: 0, - ref: $options.containerRef, - "class": _ctx.cx("root"), - style: _ctx.sx("root"), - role: "complementary", - "aria-modal": _ctx.modal - }, _ctx.ptmi("root")), [_ctx.$slots.container ? renderSlot(_ctx.$slots, "container", { - key: 0, - closeCallback: $options.hide - }) : (openBlock(), createElementBlock(Fragment, { - key: 1 - }, [createBaseVNode("div", mergeProps({ - ref: $options.headerContainerRef, - "class": _ctx.cx("header") - }, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header", { - "class": normalizeClass(_ctx.cx("title")) - }, function() { - return [_ctx.header ? (openBlock(), createElementBlock("div", mergeProps({ - key: 0, - "class": _ctx.cx("title") - }, _ctx.ptm("title")), toDisplayString(_ctx.header), 17)) : createCommentVNode("", true)]; - }), _ctx.showCloseIcon ? (openBlock(), createBlock(_component_Button, mergeProps({ - key: 0, - ref: $options.closeButtonRef, - type: "button", - "class": _ctx.cx("pcCloseButton"), - "aria-label": $options.closeAriaLabel, - unstyled: _ctx.unstyled, - onClick: $options.hide - }, _ctx.closeButtonProps, { - pt: _ctx.ptm("pcCloseButton"), - "data-pc-group-section": "iconcontainer" - }), { - icon: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "closeicon", {}, function() { - return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon ? "span" : "TimesIcon"), mergeProps({ - "class": [_ctx.closeIcon, slotProps["class"]] - }, _ctx.ptm("pcCloseButton")["icon"]), null, 16, ["class"]))]; - })]; - }), - _: 3 - }, 16, ["class", "aria-label", "unstyled", "onClick", "pt"])) : createCommentVNode("", true)], 16), createBaseVNode("div", mergeProps({ - ref: $options.contentRef, - "class": _ctx.cx("content") - }, _ctx.ptm("content")), [renderSlot(_ctx.$slots, "default")], 16), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", mergeProps({ - key: 0, - ref: $options.footerContainerRef, - "class": _ctx.cx("footer") - }, _ctx.ptm("footer")), [renderSlot(_ctx.$slots, "footer")], 16)) : createCommentVNode("", true)], 64))], 16, _hoisted_1)), [[_directive_focustrap]]) : createCommentVNode("", true)]; - }), - _: 3 - }, 16, ["onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"])], 16)) : createCommentVNode("", true)]; - }), - _: 3 - }); -} -__name(render, "render"); -script.render = render; -export { - script as s -}; -//# sourceMappingURL=index-C_ACzX5-.js.map diff --git a/comfy/web/assets/index-C_ACzX5-.js.map b/comfy/web/assets/index-C_ACzX5-.js.map deleted file mode 100644 index fc62f6d14..000000000 --- a/comfy/web/assets/index-C_ACzX5-.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-C_ACzX5-.js","sources":["../../../../../node_modules/primevue/drawer/style/index.mjs","../../../../../node_modules/primevue/drawer/index.mjs"],"sourcesContent":["import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-drawer {\\n display: flex;\\n flex-direction: column;\\n transform: translate3d(0px, 0px, 0px);\\n position: relative;\\n transition: transform 0.3s;\\n background: \".concat(dt('drawer.background'), \";\\n color: \").concat(dt('drawer.color'), \";\\n border: 1px solid \").concat(dt('drawer.border.color'), \";\\n box-shadow: \").concat(dt('drawer.shadow'), \";\\n}\\n\\n.p-drawer-content {\\n overflow-y: auto;\\n flex-grow: 1;\\n padding: \").concat(dt('drawer.content.padding'), \";\\n}\\n\\n.p-drawer-header {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n flex-shrink: 0;\\n padding: \").concat(dt('drawer.header.padding'), \";\\n}\\n\\n.p-drawer-footer {\\n padding: \").concat(dt('drawer.footer.padding'), \";\\n}\\n\\n.p-drawer-title {\\n font-weight: \").concat(dt('drawer.title.font.weight'), \";\\n font-size: \").concat(dt('drawer.title.font.size'), \";\\n}\\n\\n.p-drawer-full .p-drawer {\\n transition: none;\\n transform: none;\\n width: 100vw !important;\\n height: 100vh !important;\\n max-height: 100%;\\n top: 0px !important;\\n left: 0px !important;\\n border-width: 1px;\\n}\\n\\n.p-drawer-left .p-drawer-enter-from,\\n.p-drawer-left .p-drawer-leave-to {\\n transform: translateX(-100%);\\n}\\n\\n.p-drawer-right .p-drawer-enter-from,\\n.p-drawer-right .p-drawer-leave-to {\\n transform: translateX(100%);\\n}\\n\\n.p-drawer-top .p-drawer-enter-from,\\n.p-drawer-top .p-drawer-leave-to {\\n transform: translateY(-100%);\\n}\\n\\n.p-drawer-bottom .p-drawer-enter-from,\\n.p-drawer-bottom .p-drawer-leave-to {\\n transform: translateY(100%);\\n}\\n\\n.p-drawer-full .p-drawer-enter-from,\\n.p-drawer-full .p-drawer-leave-to {\\n opacity: 0;\\n}\\n\\n.p-drawer-full .p-drawer-enter-active,\\n.p-drawer-full .p-drawer-leave-active {\\n transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\\n}\\n\\n.p-drawer-left .p-drawer {\\n width: 20rem;\\n height: 100%;\\n border-inline-end-width: 1px;\\n}\\n\\n.p-drawer-right .p-drawer {\\n width: 20rem;\\n height: 100%;\\n border-inline-start-width: 1px;\\n}\\n\\n.p-drawer-top .p-drawer {\\n height: 10rem;\\n width: 100%;\\n border-block-end-width: 1px;\\n}\\n\\n.p-drawer-bottom .p-drawer {\\n height: 10rem;\\n width: 100%;\\n border-block-start-width: 1px;\\n}\\n\\n.p-drawer-left .p-drawer-content,\\n.p-drawer-right .p-drawer-content,\\n.p-drawer-top .p-drawer-content,\\n.p-drawer-bottom .p-drawer-content {\\n width: 100%;\\n height: 100%;\\n}\\n\\n.p-drawer-open {\\n display: flex;\\n}\\n\\n.p-drawer-mask:dir(rtl) {\\n flex-direction: row-reverse;\\n}\\n\");\n};\nvar inlineStyles = {\n mask: function mask(_ref2) {\n var position = _ref2.position,\n modal = _ref2.modal;\n return {\n position: 'fixed',\n height: '100%',\n width: '100%',\n left: 0,\n top: 0,\n display: 'flex',\n justifyContent: position === 'left' ? 'flex-start' : position === 'right' ? 'flex-end' : 'center',\n alignItems: position === 'top' ? 'flex-start' : position === 'bottom' ? 'flex-end' : 'center',\n pointerEvents: modal ? 'auto' : 'none'\n };\n },\n root: {\n pointerEvents: 'auto'\n }\n};\nvar classes = {\n mask: function mask(_ref3) {\n var instance = _ref3.instance,\n props = _ref3.props;\n var positions = ['left', 'right', 'top', 'bottom'];\n var pos = positions.find(function (item) {\n return item === props.position;\n });\n return ['p-drawer-mask', {\n 'p-overlay-mask p-overlay-mask-enter': props.modal,\n 'p-drawer-open': instance.containerVisible,\n 'p-drawer-full': instance.fullScreen\n }, pos ? \"p-drawer-\".concat(pos) : ''];\n },\n root: function root(_ref4) {\n var instance = _ref4.instance;\n return ['p-drawer p-component', {\n 'p-drawer-full': instance.fullScreen\n }];\n },\n header: 'p-drawer-header',\n title: 'p-drawer-title',\n pcCloseButton: 'p-drawer-close-button',\n content: 'p-drawer-content',\n footer: 'p-drawer-footer'\n};\nvar DrawerStyle = BaseStyle.extend({\n name: 'drawer',\n theme: theme,\n classes: classes,\n inlineStyles: inlineStyles\n});\n\nexport { DrawerStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { addClass, focus, blockBodyScroll, unblockBodyScroll } from '@primeuix/utils/dom';\nimport { ZIndex } from '@primeuix/utils/zindex';\nimport TimesIcon from '@primevue/icons/times';\nimport Button from 'primevue/button';\nimport FocusTrap from 'primevue/focustrap';\nimport Portal from 'primevue/portal';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport DrawerStyle from 'primevue/drawer/style';\nimport { resolveComponent, resolveDirective, openBlock, createBlock, withCtx, createElementBlock, mergeProps, createVNode, Transition, withDirectives, renderSlot, Fragment, createElementVNode, normalizeClass, toDisplayString, createCommentVNode, resolveDynamicComponent } from 'vue';\n\nvar script$1 = {\n name: 'BaseDrawer',\n \"extends\": BaseComponent,\n props: {\n visible: {\n type: Boolean,\n \"default\": false\n },\n position: {\n type: String,\n \"default\": 'left'\n },\n header: {\n type: null,\n \"default\": null\n },\n baseZIndex: {\n type: Number,\n \"default\": 0\n },\n autoZIndex: {\n type: Boolean,\n \"default\": true\n },\n dismissable: {\n type: Boolean,\n \"default\": true\n },\n showCloseIcon: {\n type: Boolean,\n \"default\": true\n },\n closeButtonProps: {\n type: Object,\n \"default\": function _default() {\n return {\n severity: 'secondary',\n text: true,\n rounded: true\n };\n }\n },\n closeIcon: {\n type: String,\n \"default\": undefined\n },\n modal: {\n type: Boolean,\n \"default\": true\n },\n blockScroll: {\n type: Boolean,\n \"default\": false\n }\n },\n style: DrawerStyle,\n provide: function provide() {\n return {\n $pcDrawer: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'Drawer',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['update:visible', 'show', 'after-show', 'hide', 'after-hide'],\n data: function data() {\n return {\n containerVisible: this.visible\n };\n },\n container: null,\n mask: null,\n content: null,\n headerContainer: null,\n footerContainer: null,\n closeButton: null,\n outsideClickListener: null,\n documentKeydownListener: null,\n watch: {\n dismissable: function dismissable(newValue) {\n if (newValue) {\n this.enableDocumentSettings();\n } else {\n this.disableDocumentSettings();\n }\n }\n },\n updated: function updated() {\n if (this.visible) {\n this.containerVisible = this.visible;\n }\n },\n beforeUnmount: function beforeUnmount() {\n this.disableDocumentSettings();\n if (this.mask && this.autoZIndex) {\n ZIndex.clear(this.mask);\n }\n this.container = null;\n this.mask = null;\n },\n methods: {\n hide: function hide() {\n this.$emit('update:visible', false);\n },\n onEnter: function onEnter() {\n this.$emit('show');\n this.focus();\n this.bindDocumentKeyDownListener();\n if (this.autoZIndex) {\n ZIndex.set('modal', this.mask, this.baseZIndex || this.$primevue.config.zIndex.modal);\n }\n },\n onAfterEnter: function onAfterEnter() {\n this.enableDocumentSettings();\n this.$emit('after-show');\n },\n onBeforeLeave: function onBeforeLeave() {\n if (this.modal) {\n !this.isUnstyled && addClass(this.mask, 'p-overlay-mask-leave');\n }\n },\n onLeave: function onLeave() {\n this.$emit('hide');\n },\n onAfterLeave: function onAfterLeave() {\n if (this.autoZIndex) {\n ZIndex.clear(this.mask);\n }\n this.unbindDocumentKeyDownListener();\n this.containerVisible = false;\n this.disableDocumentSettings();\n this.$emit('after-hide');\n },\n onMaskClick: function onMaskClick(event) {\n if (this.dismissable && this.modal && this.mask === event.target) {\n this.hide();\n }\n },\n focus: function focus$1() {\n var findFocusableElement = function findFocusableElement(container) {\n return container && container.querySelector('[autofocus]');\n };\n var focusTarget = this.$slots.header && findFocusableElement(this.headerContainer);\n if (!focusTarget) {\n focusTarget = this.$slots[\"default\"] && findFocusableElement(this.container);\n if (!focusTarget) {\n focusTarget = this.$slots.footer && findFocusableElement(this.footerContainer);\n if (!focusTarget) {\n focusTarget = this.closeButton;\n }\n }\n }\n focusTarget && focus(focusTarget);\n },\n enableDocumentSettings: function enableDocumentSettings() {\n if (this.dismissable && !this.modal) {\n this.bindOutsideClickListener();\n }\n if (this.blockScroll) {\n blockBodyScroll();\n }\n },\n disableDocumentSettings: function disableDocumentSettings() {\n this.unbindOutsideClickListener();\n if (this.blockScroll) {\n unblockBodyScroll();\n }\n },\n onKeydown: function onKeydown(event) {\n if (event.code === 'Escape') {\n this.hide();\n }\n },\n containerRef: function containerRef(el) {\n this.container = el;\n },\n maskRef: function maskRef(el) {\n this.mask = el;\n },\n contentRef: function contentRef(el) {\n this.content = el;\n },\n headerContainerRef: function headerContainerRef(el) {\n this.headerContainer = el;\n },\n footerContainerRef: function footerContainerRef(el) {\n this.footerContainer = el;\n },\n closeButtonRef: function closeButtonRef(el) {\n this.closeButton = el ? el.$el : undefined;\n },\n bindDocumentKeyDownListener: function bindDocumentKeyDownListener() {\n if (!this.documentKeydownListener) {\n this.documentKeydownListener = this.onKeydown;\n document.addEventListener('keydown', this.documentKeydownListener);\n }\n },\n unbindDocumentKeyDownListener: function unbindDocumentKeyDownListener() {\n if (this.documentKeydownListener) {\n document.removeEventListener('keydown', this.documentKeydownListener);\n this.documentKeydownListener = null;\n }\n },\n bindOutsideClickListener: function bindOutsideClickListener() {\n var _this = this;\n if (!this.outsideClickListener) {\n this.outsideClickListener = function (event) {\n if (_this.isOutsideClicked(event)) {\n _this.hide();\n }\n };\n document.addEventListener('click', this.outsideClickListener);\n }\n },\n unbindOutsideClickListener: function unbindOutsideClickListener() {\n if (this.outsideClickListener) {\n document.removeEventListener('click', this.outsideClickListener);\n this.outsideClickListener = null;\n }\n },\n isOutsideClicked: function isOutsideClicked(event) {\n return this.container && !this.container.contains(event.target);\n }\n },\n computed: {\n fullScreen: function fullScreen() {\n return this.position === 'full';\n },\n closeAriaLabel: function closeAriaLabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;\n }\n },\n directives: {\n focustrap: FocusTrap\n },\n components: {\n Button: Button,\n Portal: Portal,\n TimesIcon: TimesIcon\n }\n};\n\nvar _hoisted_1 = [\"aria-modal\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_Button = resolveComponent(\"Button\");\n var _component_Portal = resolveComponent(\"Portal\");\n var _directive_focustrap = resolveDirective(\"focustrap\");\n return openBlock(), createBlock(_component_Portal, null, {\n \"default\": withCtx(function () {\n return [$data.containerVisible ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n ref: $options.maskRef,\n onMousedown: _cache[0] || (_cache[0] = function () {\n return $options.onMaskClick && $options.onMaskClick.apply($options, arguments);\n }),\n \"class\": _ctx.cx('mask'),\n style: _ctx.sx('mask', true, {\n position: _ctx.position,\n modal: _ctx.modal\n })\n }, _ctx.ptm('mask')), [createVNode(Transition, mergeProps({\n name: \"p-drawer\",\n onEnter: $options.onEnter,\n onAfterEnter: $options.onAfterEnter,\n onBeforeLeave: $options.onBeforeLeave,\n onLeave: $options.onLeave,\n onAfterLeave: $options.onAfterLeave,\n appear: \"\"\n }, _ctx.ptm('transition')), {\n \"default\": withCtx(function () {\n return [_ctx.visible ? withDirectives((openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n ref: $options.containerRef,\n \"class\": _ctx.cx('root'),\n style: _ctx.sx('root'),\n role: \"complementary\",\n \"aria-modal\": _ctx.modal\n }, _ctx.ptmi('root')), [_ctx.$slots.container ? renderSlot(_ctx.$slots, \"container\", {\n key: 0,\n closeCallback: $options.hide\n }) : (openBlock(), createElementBlock(Fragment, {\n key: 1\n }, [createElementVNode(\"div\", mergeProps({\n ref: $options.headerContainerRef,\n \"class\": _ctx.cx('header')\n }, _ctx.ptm('header')), [renderSlot(_ctx.$slots, \"header\", {\n \"class\": normalizeClass(_ctx.cx('title'))\n }, function () {\n return [_ctx.header ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('title')\n }, _ctx.ptm('title')), toDisplayString(_ctx.header), 17)) : createCommentVNode(\"\", true)];\n }), _ctx.showCloseIcon ? (openBlock(), createBlock(_component_Button, mergeProps({\n key: 0,\n ref: $options.closeButtonRef,\n type: \"button\",\n \"class\": _ctx.cx('pcCloseButton'),\n \"aria-label\": $options.closeAriaLabel,\n unstyled: _ctx.unstyled,\n onClick: $options.hide\n }, _ctx.closeButtonProps, {\n pt: _ctx.ptm('pcCloseButton'),\n \"data-pc-group-section\": \"iconcontainer\"\n }), {\n icon: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"closeicon\", {}, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon ? 'span' : 'TimesIcon'), mergeProps({\n \"class\": [_ctx.closeIcon, slotProps[\"class\"]]\n }, _ctx.ptm('pcCloseButton')['icon']), null, 16, [\"class\"]))];\n })];\n }),\n _: 3\n }, 16, [\"class\", \"aria-label\", \"unstyled\", \"onClick\", \"pt\"])) : createCommentVNode(\"\", true)], 16), createElementVNode(\"div\", mergeProps({\n ref: $options.contentRef,\n \"class\": _ctx.cx('content')\n }, _ctx.ptm('content')), [renderSlot(_ctx.$slots, \"default\")], 16), _ctx.$slots.footer ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n ref: $options.footerContainerRef,\n \"class\": _ctx.cx('footer')\n }, _ctx.ptm('footer')), [renderSlot(_ctx.$slots, \"footer\")], 16)) : createCommentVNode(\"\", true)], 64))], 16, _hoisted_1)), [[_directive_focustrap]]) : createCommentVNode(\"\", true)];\n }),\n _: 3\n }, 16, [\"onEnter\", \"onAfterEnter\", \"onBeforeLeave\", \"onLeave\", \"onAfterLeave\"])], 16)) : createCommentVNode(\"\", true)];\n }),\n _: 3\n });\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n"],"names":["theme","mask","BaseComponent","findFocusableElement","Button","Portal","TimesIcon","createElementVNode"],"mappings":";;;AAEA,IAAI,QAAQ,gCAASA,OAAM,MAAM;AAC/B,MAAI,KAAK,KAAK;AACd,SA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,GAAG,SAAS;AAAA,UACtC,GAAa,KAAK,IAAI,SAAS,CAAC,GAAG,CAAC,WAAW,KAAK,QAAQ,SAAS,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,UAAU,aAAa,mBAAmB,OAAO,WAAW;AAAA,YAC1I,KAAK;AAAA,YACL,KAAK,SAAS;AAAA,YACd,SAAS,KAAK,GAAG,QAAQ;AAAA,UAC1B,GAAE,KAAK,IAAI,QAAQ,CAAC,GAAG,CAAC,WAAW,KAAK,QAAQ,QAAQ,CAAC,GAAG,EAAE,KAAK,mBAAmB,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,UAAU,IAAI,CAAC,CAAC,oBAAoB,CAAC,CAAC,IAAI,mBAAmB,IAAI,IAAI,CAAC;AAAA,QAC9L,CAAS;AAAA,QACD,GAAG;AAAA,MACJ,GAAE,IAAI,CAAC,WAAW,gBAAgB,iBAAiB,WAAW,cAAc,CAAC,CAAC,GAAG,EAAE,KAAK,mBAAmB,IAAI,IAAI,CAAC;AAAA,IAC3H,CAAK;AAAA,IACD,GAAG;AAAA,EACP,CAAG;AACH;AAnFS;AAqFT,OAAO,SAAS;","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/comfy/web/assets/index-CpICyVZm.js b/comfy/web/assets/index-CpICyVZm.js deleted file mode 100644 index 62711f752..000000000 --- a/comfy/web/assets/index-CpICyVZm.js +++ /dev/null @@ -1,55774 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { bY as ComfyDialog, bZ as $el, b_ as ComfyApp, h as app, L as LiteGraph, a0 as LGraphCanvas, a6 as useExtensionService, b$ as processDynamicPrompt, bh as isElectron, bi as electronAPI, b as useWorkflowStore, bH as checkMirrorReachable, bk as useDialogService, bp as t, c0 as DraggableList, b4 as useToastStore, ab as LGraphNode, c1 as applyTextReplacements, c2 as ComfyWidgets, c3 as addValueControlWidgets, O as useNodeDefStore, a as useSettingStore, c4 as serialise, c5 as deserialiseAndCreate, aV as api, aa as LGraphGroup, d as defineComponent, c6 as Tooltip, T as ref, N as watch, p as onMounted, bU as onUnmounted, c as computed, o as openBlock, f as createElementBlock, m as createBaseVNode, k as createVNode, j as unref, l as script, z as withCtx, i as withDirectives, F as Fragment, D as renderList, Z as normalizeClass, E as toDisplayString, v as vShow, B as createCommentVNode, ak as createTextVNode, c7 as script$1, y as createBlock, c8 as Transition, _ as _export_sfc, at as toRaw, w as watchEffect, bv as script$2, c9 as createApp, V as nextTick, ca as PrimeVue, bd as lodashExports, aY as setStorageValue, aW as getStorageValue, cb as useNodeFileInput, cc as useNodeDragAndDrop, cd as isComboInputSpecV1 } from "./index-DIgj6hpb.js"; -import { P as PYTHON_MIRROR } from "./uvMirrors-B-HKMf6X.js"; -import "./index-mHcHTYAB.js"; -import "./index-DdgRmRKP.js"; -import "./index-D8hjiWMw.js"; -import "./index-Czd3J-KM.js"; -import "./index-C_ACzX5-.js"; -import "./index-CE2hpomb.js"; -import "./index-BKScv1mm.js"; -class ClipspaceDialog extends ComfyDialog { - static { - __name(this, "ClipspaceDialog"); - } - static items = []; - static instance = null; - static registerButton(name, contextPredicate, callback) { - const item = $el("button", { - type: "button", - textContent: name, - contextPredicate, - onclick: callback - }); - ClipspaceDialog.items.push(item); - } - static invalidatePreview() { - if (ComfyApp.clipspace && ComfyApp.clipspace.imgs && ComfyApp.clipspace.imgs.length > 0) { - const img_preview = document.getElementById( - "clipspace_preview" - ); - if (img_preview) { - img_preview.src = ComfyApp.clipspace.imgs[ComfyApp.clipspace["selectedIndex"]].src; - img_preview.style.maxHeight = "100%"; - img_preview.style.maxWidth = "100%"; - } - } - } - static invalidate() { - if (ClipspaceDialog.instance) { - const self2 = ClipspaceDialog.instance; - const children = $el("div.comfy-modal-content", [ - self2.createImgSettings(), - ...self2.createButtons() - ]); - if (self2.element) { - if (self2.element.firstChild) { - self2.element.removeChild(self2.element.firstChild); - } - self2.element.appendChild(children); - } else { - self2.element = $el("div.comfy-modal", { parent: document.body }, [ - children - ]); - } - if (self2.element.children[0].children.length <= 1) { - self2.element.children[0].appendChild( - $el("p", {}, [ - "Unable to find the features to edit content of a format stored in the current Clipspace." - ]) - ); - } - ClipspaceDialog.invalidatePreview(); - } - } - constructor() { - super(); - } - createButtons() { - const buttons = []; - for (let idx in ClipspaceDialog.items) { - const item = ClipspaceDialog.items[idx]; - if (!item.contextPredicate || item.contextPredicate()) - buttons.push(ClipspaceDialog.items[idx]); - } - buttons.push( - $el("button", { - type: "button", - textContent: "Close", - onclick: /* @__PURE__ */ __name(() => { - this.close(); - }, "onclick") - }) - ); - return buttons; - } - createImgSettings() { - if (ComfyApp.clipspace?.imgs) { - const combo_items = []; - const imgs = ComfyApp.clipspace.imgs; - for (let i = 0; i < imgs.length; i++) { - combo_items.push($el("option", { value: i }, [`${i}`])); - } - const combo1 = $el( - "select", - { - id: "clipspace_img_selector", - onchange: /* @__PURE__ */ __name((event) => { - if (event.target && ComfyApp.clipspace) { - ComfyApp.clipspace["selectedIndex"] = event.target.selectedIndex; - ClipspaceDialog.invalidatePreview(); - } - }, "onchange") - }, - combo_items - ); - const row1 = $el("tr", {}, [ - $el("td", {}, [$el("font", { color: "white" }, ["Select Image"])]), - $el("td", {}, [combo1]) - ]); - const combo2 = $el( - "select", - { - id: "clipspace_img_paste_mode", - onchange: /* @__PURE__ */ __name((event) => { - if (event.target && ComfyApp.clipspace) { - ComfyApp.clipspace["img_paste_mode"] = event.target.value; - } - }, "onchange") - }, - [ - $el("option", { value: "selected" }, "selected"), - $el("option", { value: "all" }, "all") - ] - ); - combo2.value = ComfyApp.clipspace["img_paste_mode"]; - const row2 = $el("tr", {}, [ - $el("td", {}, [$el("font", { color: "white" }, ["Paste Mode"])]), - $el("td", {}, [combo2]) - ]); - const td2 = $el( - "td", - { align: "center", width: "100px", height: "100px", colSpan: "2" }, - [$el("img", { id: "clipspace_preview", ondragstart: /* @__PURE__ */ __name(() => false, "ondragstart") }, [])] - ); - const row3 = $el("tr", {}, [td2]); - return $el("table", {}, [row1, row2, row3]); - } else { - return []; - } - } - createImgPreview() { - if (ComfyApp.clipspace?.imgs) { - return $el("img", { id: "clipspace_preview", ondragstart: /* @__PURE__ */ __name(() => false, "ondragstart") }); - } else return []; - } - show() { - const img_preview = document.getElementById("clipspace_preview"); - ClipspaceDialog.invalidate(); - this.element.style.display = "block"; - } -} -app.registerExtension({ - name: "Comfy.Clipspace", - init(app2) { - app2.openClipspace = function() { - if (!ClipspaceDialog.instance) { - ClipspaceDialog.instance = new ClipspaceDialog(); - ComfyApp.clipspace_invalidate_handler = ClipspaceDialog.invalidate; - } - if (ComfyApp.clipspace) { - ClipspaceDialog.instance.show(); - } else app2.ui.dialog.show("Clipspace is Empty!"); - }; - } -}); -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.clipspace = window.comfyAPI.clipspace || {}; -window.comfyAPI.clipspace.ClipspaceDialog = ClipspaceDialog; -const ext$1 = { - name: "Comfy.ContextMenuFilter", - init() { - const ctxMenu = LiteGraph.ContextMenu; - LiteGraph.ContextMenu = function(values, options) { - const ctx = new ctxMenu(values, options); - if (options?.className === "dark" && values?.length > 4) { - const filter = document.createElement("input"); - filter.classList.add("comfy-context-menu-filter"); - filter.placeholder = "Filter list"; - ctx.root.prepend(filter); - const items = Array.from( - ctx.root.querySelectorAll(".litemenu-entry") - ); - let displayedItems = [...items]; - let itemCount = displayedItems.length; - requestAnimationFrame(() => { - const currentNode = LGraphCanvas.active_canvas.current_node; - const clickedComboValue = currentNode?.widgets?.filter( - (w) => w.type === "combo" && w.options.values?.length === values.length - ).find( - (w) => w.options.values?.every((v, i) => v === values[i]) - )?.value; - let selectedIndex = clickedComboValue ? values.findIndex((v) => v === clickedComboValue) : 0; - if (selectedIndex < 0) { - selectedIndex = 0; - } - let selectedItem = displayedItems[selectedIndex]; - updateSelected(); - function updateSelected() { - selectedItem?.style.setProperty("background-color", ""); - selectedItem?.style.setProperty("color", ""); - selectedItem = displayedItems[selectedIndex]; - selectedItem?.style.setProperty( - "background-color", - "#ccc", - "important" - ); - selectedItem?.style.setProperty("color", "#000", "important"); - } - __name(updateSelected, "updateSelected"); - const positionList = /* @__PURE__ */ __name(() => { - const rect = ctx.root.getBoundingClientRect(); - if (rect.top < 0) { - const scale = 1 - ctx.root.getBoundingClientRect().height / ctx.root.clientHeight; - const shift = ctx.root.clientHeight * scale / 2; - ctx.root.style.top = -shift + "px"; - } - }, "positionList"); - filter.addEventListener("keydown", (event) => { - switch (event.key) { - case "ArrowUp": - event.preventDefault(); - if (selectedIndex === 0) { - selectedIndex = itemCount - 1; - } else { - selectedIndex--; - } - updateSelected(); - break; - case "ArrowRight": - event.preventDefault(); - selectedIndex = itemCount - 1; - updateSelected(); - break; - case "ArrowDown": - event.preventDefault(); - if (selectedIndex === itemCount - 1) { - selectedIndex = 0; - } else { - selectedIndex++; - } - updateSelected(); - break; - case "ArrowLeft": - event.preventDefault(); - selectedIndex = 0; - updateSelected(); - break; - case "Enter": - selectedItem?.click(); - break; - case "Escape": - ctx.close(); - break; - } - }); - filter.addEventListener("input", () => { - const term = filter.value.toLocaleLowerCase(); - displayedItems = items.filter((item) => { - const isVisible = !term || item.textContent?.toLocaleLowerCase().includes(term); - item.style.display = isVisible ? "block" : "none"; - return isVisible; - }); - selectedIndex = 0; - if (displayedItems.includes(selectedItem)) { - selectedIndex = displayedItems.findIndex( - (d) => d === selectedItem - ); - } - itemCount = displayedItems.length; - updateSelected(); - if (options.event) { - let top = options.event.clientY - 10; - const bodyRect = document.body.getBoundingClientRect(); - const rootRect = ctx.root.getBoundingClientRect(); - if (bodyRect.height && top > bodyRect.height - rootRect.height - 10) { - top = Math.max(0, bodyRect.height - rootRect.height - 10); - } - ctx.root.style.top = top + "px"; - positionList(); - } - }); - requestAnimationFrame(() => { - filter.focus(); - positionList(); - }); - }); - } - return ctx; - }; - LiteGraph.ContextMenu.prototype = ctxMenu.prototype; - } -}; -app.registerExtension(ext$1); -useExtensionService().registerExtension({ - name: "Comfy.DynamicPrompts", - nodeCreated(node) { - if (node.widgets) { - const widgets = node.widgets.filter((w) => w.dynamicPrompts); - for (const widget of widgets) { - widget.serializeValue = (workflowNode, widgetIndex) => { - if (typeof widget.value !== "string") return widget.value; - const prompt = processDynamicPrompt(widget.value); - if (workflowNode?.widgets_values) - workflowNode.widgets_values[widgetIndex] = prompt; - return prompt; - }; - } - } - } -}); -app.registerExtension({ - name: "Comfy.EditAttention", - init() { - const editAttentionDelta = app.ui.settings.addSetting({ - id: "Comfy.EditAttention.Delta", - category: ["Comfy", "EditTokenWeight", "Delta"], - name: "Ctrl+up/down precision", - type: "slider", - attrs: { - min: 0.01, - max: 0.5, - step: 0.01 - }, - defaultValue: 0.05 - }); - function incrementWeight(weight, delta) { - const floatWeight = parseFloat(weight); - if (isNaN(floatWeight)) return weight; - const newWeight = floatWeight + delta; - return String(Number(newWeight.toFixed(10))); - } - __name(incrementWeight, "incrementWeight"); - function findNearestEnclosure(text, cursorPos) { - let start = cursorPos, end = cursorPos; - let openCount = 0, closeCount = 0; - while (start >= 0) { - start--; - if (text[start] === "(" && openCount === closeCount) break; - if (text[start] === "(") openCount++; - if (text[start] === ")") closeCount++; - } - if (start < 0) return null; - openCount = 0; - closeCount = 0; - while (end < text.length) { - if (text[end] === ")" && openCount === closeCount) break; - if (text[end] === "(") openCount++; - if (text[end] === ")") closeCount++; - end++; - } - if (end === text.length) return null; - return { start: start + 1, end }; - } - __name(findNearestEnclosure, "findNearestEnclosure"); - function addWeightToParentheses(text) { - const parenRegex = /^\((.*)\)$/; - const parenMatch = text.match(parenRegex); - const floatRegex = /:([+-]?(\d*\.)?\d+([eE][+-]?\d+)?)/; - const floatMatch = text.match(floatRegex); - if (parenMatch && !floatMatch) { - return `(${parenMatch[1]}:1.0)`; - } else { - return text; - } - } - __name(addWeightToParentheses, "addWeightToParentheses"); - function editAttention(event) { - const inputField = event.composedPath()[0]; - const delta = parseFloat(editAttentionDelta.value); - if (inputField.tagName !== "TEXTAREA") return; - if (!(event.key === "ArrowUp" || event.key === "ArrowDown")) return; - if (!event.ctrlKey && !event.metaKey) return; - event.preventDefault(); - let start = inputField.selectionStart; - let end = inputField.selectionEnd; - let selectedText = inputField.value.substring(start, end); - if (!selectedText) { - const nearestEnclosure = findNearestEnclosure(inputField.value, start); - if (nearestEnclosure) { - start = nearestEnclosure.start; - end = nearestEnclosure.end; - selectedText = inputField.value.substring(start, end); - } else { - const delimiters = " .,\\/!?%^*;:{}=-_`~()\r\n "; - while (!delimiters.includes(inputField.value[start - 1]) && start > 0) { - start--; - } - while (!delimiters.includes(inputField.value[end]) && end < inputField.value.length) { - end++; - } - selectedText = inputField.value.substring(start, end); - if (!selectedText) return; - } - } - if (selectedText[selectedText.length - 1] === " ") { - selectedText = selectedText.substring(0, selectedText.length - 1); - end -= 1; - } - if (inputField.value[start - 1] === "(" && inputField.value[end] === ")") { - start -= 1; - end += 1; - selectedText = inputField.value.substring(start, end); - } - if (selectedText[0] !== "(" || selectedText[selectedText.length - 1] !== ")") { - selectedText = `(${selectedText})`; - } - selectedText = addWeightToParentheses(selectedText); - const weightDelta = event.key === "ArrowUp" ? delta : -delta; - const updatedText = selectedText.replace( - /\((.*):([+-]?\d+(?:\.\d+)?)\)/, - (match, text, weight) => { - weight = incrementWeight(weight, weightDelta); - if (weight == 1) { - return text; - } else { - return `(${text}:${weight})`; - } - } - ); - inputField.setSelectionRange(start, end); - document.execCommand("insertText", false, updatedText); - inputField.setSelectionRange(start, start + updatedText.length); - } - __name(editAttention, "editAttention"); - window.addEventListener("keydown", editAttention); - } -}); -(async () => { - if (!isElectron()) return; - const electronAPI$1 = electronAPI(); - const desktopAppVersion = await electronAPI$1.getElectronVersion(); - const workflowStore = useWorkflowStore(); - const onChangeRestartApp = /* @__PURE__ */ __name((newValue, oldValue) => { - if (oldValue !== void 0 && newValue !== oldValue) { - electronAPI$1.restartApp("Restart ComfyUI to apply changes.", 1500); - } - }, "onChangeRestartApp"); - app.registerExtension({ - name: "Comfy.ElectronAdapter", - settings: [ - { - id: "Comfy-Desktop.AutoUpdate", - category: ["Comfy-Desktop", "General", "AutoUpdate"], - name: "Automatically check for updates", - type: "boolean", - defaultValue: true, - onChange: onChangeRestartApp - }, - { - id: "Comfy-Desktop.SendStatistics", - category: ["Comfy-Desktop", "General", "Send Statistics"], - name: "Send anonymous usage metrics", - type: "boolean", - defaultValue: true, - onChange: onChangeRestartApp - }, - { - id: "Comfy-Desktop.WindowStyle", - category: ["Comfy-Desktop", "General", "Window Style"], - name: "Window Style", - tooltip: "Custom: Replace the system title bar with ComfyUI's Top menu", - type: "combo", - experimental: true, - defaultValue: "default", - options: ["default", "custom"], - onChange: /* @__PURE__ */ __name((newValue, oldValue) => { - if (!oldValue) return; - electronAPI$1.Config.setWindowStyle(newValue); - }, "onChange") - }, - { - id: "Comfy-Desktop.UV.PythonInstallMirror", - name: "Python Install Mirror", - tooltip: `Managed Python installations are downloaded from the Astral python-build-standalone project. This variable can be set to a mirror URL to use a different source for Python installations. The provided URL will replace https://github.com/astral-sh/python-build-standalone/releases/download in, e.g., https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz. Distributions can be read from a local directory by using the file:// URL scheme.`, - type: "url", - defaultValue: "", - attrs: { - validateUrlFn(mirror) { - return checkMirrorReachable( - mirror + PYTHON_MIRROR.validationPathSuffix - ); - } - } - }, - { - id: "Comfy-Desktop.UV.PypiInstallMirror", - name: "Pypi Install Mirror", - tooltip: `Default pip install mirror`, - type: "url", - defaultValue: "", - attrs: { - validateUrlFn: checkMirrorReachable - } - }, - { - id: "Comfy-Desktop.UV.TorchInstallMirror", - name: "Torch Install Mirror", - tooltip: `Pip install mirror for pytorch`, - type: "url", - defaultValue: "", - attrs: { - validateUrlFn: checkMirrorReachable - } - } - ], - commands: [ - { - id: "Comfy-Desktop.Folders.OpenLogsFolder", - label: "Open Logs Folder", - icon: "pi pi-folder-open", - function() { - electronAPI$1.openLogsFolder(); - } - }, - { - id: "Comfy-Desktop.Folders.OpenModelsFolder", - label: "Open Models Folder", - icon: "pi pi-folder-open", - function() { - electronAPI$1.openModelsFolder(); - } - }, - { - id: "Comfy-Desktop.Folders.OpenOutputsFolder", - label: "Open Outputs Folder", - icon: "pi pi-folder-open", - function() { - electronAPI$1.openOutputsFolder(); - } - }, - { - id: "Comfy-Desktop.Folders.OpenInputsFolder", - label: "Open Inputs Folder", - icon: "pi pi-folder-open", - function() { - electronAPI$1.openInputsFolder(); - } - }, - { - id: "Comfy-Desktop.Folders.OpenCustomNodesFolder", - label: "Open Custom Nodes Folder", - icon: "pi pi-folder-open", - function() { - electronAPI$1.openCustomNodesFolder(); - } - }, - { - id: "Comfy-Desktop.Folders.OpenModelConfig", - label: "Open extra_model_paths.yaml", - icon: "pi pi-file", - function() { - electronAPI$1.openModelConfig(); - } - }, - { - id: "Comfy-Desktop.OpenDevTools", - label: "Open DevTools", - icon: "pi pi-code", - function() { - electronAPI$1.openDevTools(); - } - }, - { - id: "Comfy-Desktop.OpenUserGuide", - label: "Desktop User Guide", - icon: "pi pi-book", - function() { - window.open("https://comfyorg.notion.site/", "_blank"); - } - }, - { - id: "Comfy-Desktop.Reinstall", - label: "Reinstall", - icon: "pi pi-refresh", - async function() { - const proceed = await useDialogService().confirm({ - message: t("desktopMenu.confirmReinstall"), - title: t("desktopMenu.reinstall"), - type: "reinstall" - }); - if (proceed) electronAPI$1.reinstall(); - } - }, - { - id: "Comfy-Desktop.Restart", - label: "Restart", - icon: "pi pi-refresh", - function() { - electronAPI$1.restartApp(); - } - }, - { - id: "Comfy-Desktop.Quit", - label: "Quit", - icon: "pi pi-sign-out", - async function() { - if (workflowStore.modifiedWorkflows.length > 0) { - const confirmed = await useDialogService().confirm({ - message: t("desktopMenu.confirmQuit"), - title: t("desktopMenu.quit"), - type: "default" - }); - if (!confirmed) return; - } - electronAPI$1.quit(); - } - } - ], - menuCommands: [ - { - path: ["Help"], - commands: ["Comfy-Desktop.OpenUserGuide"] - }, - { - path: ["Help"], - commands: ["Comfy-Desktop.OpenDevTools"] - }, - { - path: ["Help", "Open Folder"], - commands: [ - "Comfy-Desktop.Folders.OpenLogsFolder", - "Comfy-Desktop.Folders.OpenModelsFolder", - "Comfy-Desktop.Folders.OpenOutputsFolder", - "Comfy-Desktop.Folders.OpenInputsFolder", - "Comfy-Desktop.Folders.OpenCustomNodesFolder", - "Comfy-Desktop.Folders.OpenModelConfig" - ] - }, - { - path: ["Help"], - commands: ["Comfy-Desktop.Reinstall"] - } - ], - keybindings: [ - { - commandId: "Workspace.CloseWorkflow", - combo: { - key: "w", - ctrl: true - } - } - ], - aboutPageBadges: [ - { - label: "ComfyUI_desktop v" + desktopAppVersion, - url: "https://github.com/Comfy-Org/electron", - icon: "pi pi-github" - } - ] - }); -})(); -const ORDER = Symbol(); -const PREFIX$1 = "workflow"; -const SEPARATOR$1 = ">"; -function merge(target, source) { - if (typeof target === "object" && typeof source === "object") { - for (const key in source) { - const sv = source[key]; - if (typeof sv === "object") { - let tv = target[key]; - if (!tv) tv = target[key] = {}; - merge(tv, source[key]); - } else { - target[key] = sv; - } - } - } - return target; -} -__name(merge, "merge"); -class ManageGroupDialog extends ComfyDialog { - static { - __name(this, "ManageGroupDialog"); - } - tabs; - selectedNodeIndex; - selectedTab = "Inputs"; - selectedGroup; - modifications = {}; - nodeItems; - app; - groupNodeType; - groupNodeDef; - groupData; - innerNodesList; - widgetsPage; - inputsPage; - outputsPage; - draggable; - get selectedNodeInnerIndex() { - return +this.nodeItems[this.selectedNodeIndex].dataset.nodeindex; - } - constructor(app2) { - super(); - this.app = app2; - this.element = $el("dialog.comfy-group-manage", { - parent: document.body - }); - } - changeTab(tab) { - this.tabs[this.selectedTab].tab.classList.remove("active"); - this.tabs[this.selectedTab].page.classList.remove("active"); - this.tabs[tab].tab.classList.add("active"); - this.tabs[tab].page.classList.add("active"); - this.selectedTab = tab; - } - changeNode(index, force) { - if (!force && this.selectedNodeIndex === index) return; - if (this.selectedNodeIndex != null) { - this.nodeItems[this.selectedNodeIndex].classList.remove("selected"); - } - this.nodeItems[index].classList.add("selected"); - this.selectedNodeIndex = index; - if (!this.buildInputsPage() && this.selectedTab === "Inputs") { - this.changeTab("Widgets"); - } - if (!this.buildWidgetsPage() && this.selectedTab === "Widgets") { - this.changeTab("Outputs"); - } - if (!this.buildOutputsPage() && this.selectedTab === "Outputs") { - this.changeTab("Inputs"); - } - this.changeTab(this.selectedTab); - } - getGroupData() { - this.groupNodeType = LiteGraph.registered_node_types[`${PREFIX$1}${SEPARATOR$1}` + this.selectedGroup]; - this.groupNodeDef = this.groupNodeType.nodeData; - this.groupData = GroupNodeHandler.getGroupData(this.groupNodeType); - } - changeGroup(group, reset = true) { - this.selectedGroup = group; - this.getGroupData(); - const nodes = this.groupData.nodeData.nodes; - this.nodeItems = nodes.map( - (n, i) => $el( - "li.draggable-item", - { - dataset: { - nodeindex: n.index + "" - }, - onclick: /* @__PURE__ */ __name(() => { - this.changeNode(i); - }, "onclick") - }, - [ - $el("span.drag-handle"), - $el( - "div", - { - textContent: n.title ?? n.type - }, - n.title ? $el("span", { - textContent: n.type - }) : [] - ) - ] - ) - ); - this.innerNodesList.replaceChildren(...this.nodeItems); - if (reset) { - this.selectedNodeIndex = null; - this.changeNode(0); - } else { - const items = this.draggable.getAllItems(); - let index = items.findIndex((item) => item.classList.contains("selected")); - if (index === -1) index = this.selectedNodeIndex; - this.changeNode(index, true); - } - const ordered = [...nodes]; - this.draggable?.dispose(); - this.draggable = new DraggableList(this.innerNodesList, "li"); - this.draggable.addEventListener( - "dragend", - ({ detail: { oldPosition, newPosition } }) => { - if (oldPosition === newPosition) return; - ordered.splice(newPosition, 0, ordered.splice(oldPosition, 1)[0]); - for (let i = 0; i < ordered.length; i++) { - this.storeModification({ - nodeIndex: ordered[i].index, - section: ORDER, - prop: "order", - value: i - }); - } - } - ); - } - storeModification(props) { - const { nodeIndex, section, prop, value } = props; - const groupMod = this.modifications[this.selectedGroup] ??= {}; - const nodesMod = groupMod.nodes ??= {}; - const nodeMod = nodesMod[nodeIndex ?? this.selectedNodeInnerIndex] ??= {}; - const typeMod = nodeMod[section] ??= {}; - if (typeof value === "object") { - const objMod = typeMod[prop] ??= {}; - Object.assign(objMod, value); - } else { - typeMod[prop] = value; - } - } - getEditElement(section, prop, value, placeholder, checked, checkable = true) { - if (value === placeholder) value = ""; - const mods = this.modifications[this.selectedGroup]?.nodes?.[this.selectedNodeInnerIndex]?.[section]?.[prop]; - if (mods) { - if (mods.name != null) { - value = mods.name; - } - if (mods.visible != null) { - checked = mods.visible; - } - } - return $el("div", [ - $el("input", { - value, - placeholder, - type: "text", - onchange: /* @__PURE__ */ __name((e) => { - this.storeModification({ - section, - prop, - value: { name: e.target.value } - }); - }, "onchange") - }), - $el("label", { textContent: "Visible" }, [ - $el("input", { - type: "checkbox", - checked, - disabled: !checkable, - onchange: /* @__PURE__ */ __name((e) => { - this.storeModification({ - section, - prop, - value: { visible: !!e.target.checked } - }); - }, "onchange") - }) - ]) - ]); - } - buildWidgetsPage() { - const widgets = this.groupData.oldToNewWidgetMap[this.selectedNodeInnerIndex]; - const items = Object.keys(widgets ?? {}); - const type = app.graph.extra.groupNodes[this.selectedGroup]; - const config = type.config?.[this.selectedNodeInnerIndex]?.input; - this.widgetsPage.replaceChildren( - ...items.map((oldName) => { - return this.getEditElement( - "input", - oldName, - widgets[oldName], - oldName, - config?.[oldName]?.visible !== false - ); - }) - ); - return !!items.length; - } - buildInputsPage() { - const inputs = this.groupData.nodeInputs[this.selectedNodeInnerIndex]; - const items = Object.keys(inputs ?? {}); - const type = app.graph.extra.groupNodes[this.selectedGroup]; - const config = type.config?.[this.selectedNodeInnerIndex]?.input; - this.inputsPage.replaceChildren( - ...items.map((oldName) => { - let value = inputs[oldName]; - if (!value) { - return; - } - return this.getEditElement( - "input", - oldName, - value, - oldName, - config?.[oldName]?.visible !== false - ); - }).filter(Boolean) - ); - return !!items.length; - } - buildOutputsPage() { - const nodes = this.groupData.nodeData.nodes; - const innerNodeDef = this.groupData.getNodeDef( - nodes[this.selectedNodeInnerIndex] - ); - const outputs = innerNodeDef?.output ?? []; - const groupOutputs = this.groupData.oldToNewOutputMap[this.selectedNodeInnerIndex]; - const type = app.graph.extra.groupNodes[this.selectedGroup]; - const config = type.config?.[this.selectedNodeInnerIndex]?.output; - const node = this.groupData.nodeData.nodes[this.selectedNodeInnerIndex]; - const checkable = node.type !== "PrimitiveNode"; - this.outputsPage.replaceChildren( - ...outputs.map((type2, slot) => { - const groupOutputIndex = groupOutputs?.[slot]; - const oldName = innerNodeDef.output_name?.[slot] ?? type2; - let value = config?.[slot]?.name; - const visible = config?.[slot]?.visible || groupOutputIndex != null; - if (!value || value === oldName) { - value = ""; - } - return this.getEditElement( - "output", - slot, - value, - oldName, - visible, - checkable - ); - }).filter(Boolean) - ); - return !!outputs.length; - } - show(type) { - const groupNodes = Object.keys(app.graph.extra?.groupNodes ?? {}).sort( - (a, b) => a.localeCompare(b) - ); - this.innerNodesList = $el( - "ul.comfy-group-manage-list-items" - ); - this.widgetsPage = $el("section.comfy-group-manage-node-page"); - this.inputsPage = $el("section.comfy-group-manage-node-page"); - this.outputsPage = $el("section.comfy-group-manage-node-page"); - const pages = $el("div", [ - this.widgetsPage, - this.inputsPage, - this.outputsPage - ]); - this.tabs = [ - ["Inputs", this.inputsPage], - ["Widgets", this.widgetsPage], - ["Outputs", this.outputsPage] - ].reduce((p, [name, page]) => { - p[name] = { - tab: $el("a", { - onclick: /* @__PURE__ */ __name(() => { - this.changeTab(name); - }, "onclick"), - textContent: name - }), - page - }; - return p; - }, {}); - const outer = $el("div.comfy-group-manage-outer", [ - $el("header", [ - $el("h2", "Group Nodes"), - $el( - "select", - { - onchange: /* @__PURE__ */ __name((e) => { - this.changeGroup(e.target.value); - }, "onchange") - }, - groupNodes.map( - (g) => $el("option", { - textContent: g, - selected: `${PREFIX$1}${SEPARATOR$1}${g}` === type, - value: g - }) - ) - ) - ]), - $el("main", [ - $el("section.comfy-group-manage-list", this.innerNodesList), - $el("section.comfy-group-manage-node", [ - $el( - "header", - Object.values(this.tabs).map((t2) => t2.tab) - ), - pages - ]) - ]), - $el("footer", [ - $el( - "button.comfy-btn", - { - onclick: /* @__PURE__ */ __name((e) => { - const node = app.graph.nodes.find( - (n) => n.type === `${PREFIX$1}${SEPARATOR$1}` + this.selectedGroup - ); - if (node) { - useToastStore().addAlert( - "This group node is in use in the current workflow, please first remove these." - ); - return; - } - if (confirm( - `Are you sure you want to remove the node: "${this.selectedGroup}"` - )) { - delete app.graph.extra.groupNodes[this.selectedGroup]; - LiteGraph.unregisterNodeType( - `${PREFIX$1}${SEPARATOR$1}` + this.selectedGroup - ); - } - this.show(); - }, "onclick") - }, - "Delete Group Node" - ), - $el( - "button.comfy-btn", - { - onclick: /* @__PURE__ */ __name(async () => { - let nodesByType; - let recreateNodes = []; - const types = {}; - for (const g in this.modifications) { - const type2 = app.graph.extra.groupNodes[g]; - let config = type2.config ??= {}; - let nodeMods = this.modifications[g]?.nodes; - if (nodeMods) { - const keys = Object.keys(nodeMods); - if (nodeMods[keys[0]][ORDER]) { - const orderedNodes = []; - const orderedMods = {}; - const orderedConfig = {}; - for (const n of keys) { - const order = nodeMods[n][ORDER].order; - orderedNodes[order] = type2.nodes[+n]; - orderedMods[order] = nodeMods[n]; - orderedNodes[order].index = order; - } - for (const l of type2.links) { - if (l[0] != null) l[0] = type2.nodes[l[0]].index; - if (l[2] != null) l[2] = type2.nodes[l[2]].index; - } - if (type2.external) { - for (const ext2 of type2.external) { - ext2[0] = type2.nodes[ext2[0]]; - } - } - for (const id2 of keys) { - if (config[id2]) { - orderedConfig[type2.nodes[id2].index] = config[id2]; - } - delete config[id2]; - } - type2.nodes = orderedNodes; - nodeMods = orderedMods; - type2.config = config = orderedConfig; - } - merge(config, nodeMods); - } - types[g] = type2; - if (!nodesByType) { - nodesByType = app.graph.nodes.reduce((p, n) => { - p[n.type] ??= []; - p[n.type].push(n); - return p; - }, {}); - } - const nodes = nodesByType[`${PREFIX$1}${SEPARATOR$1}` + g]; - if (nodes) recreateNodes.push(...nodes); - } - await GroupNodeConfig.registerFromWorkflow(types, {}); - for (const node of recreateNodes) { - node.recreate(); - } - this.modifications = {}; - this.app.graph.setDirtyCanvas(true, true); - this.changeGroup(this.selectedGroup, false); - }, "onclick") - }, - "Save" - ), - $el( - "button.comfy-btn", - { onclick: /* @__PURE__ */ __name(() => this.element.close(), "onclick") }, - "Close" - ) - ]) - ]); - this.element.replaceChildren(outer); - this.changeGroup( - type ? groupNodes.find((g) => `${PREFIX$1}${SEPARATOR$1}${g}` === type) ?? groupNodes[0] : groupNodes[0] - ); - this.element.showModal(); - this.element.addEventListener("close", () => { - this.draggable?.dispose(); - this.element.remove(); - }); - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.groupNodeManage = window.comfyAPI.groupNodeManage || {}; -window.comfyAPI.groupNodeManage.ManageGroupDialog = ManageGroupDialog; -const CONVERTED_TYPE = "converted-widget"; -const VALID_TYPES = [ - "STRING", - "combo", - "number", - "toggle", - "BOOLEAN", - "text", - "string" -]; -const CONFIG = Symbol(); -const GET_CONFIG = Symbol(); -const TARGET = Symbol(); -const replacePropertyName = "Run widget replace on values"; -class PrimitiveNode extends LGraphNode { - static { - __name(this, "PrimitiveNode"); - } - controlValues; - lastType; - static category; - constructor(title) { - super(title); - this.addOutput("connect to widget input", "*"); - this.serialize_widgets = true; - this.isVirtualNode = true; - if (!this.properties || !(replacePropertyName in this.properties)) { - this.addProperty(replacePropertyName, false, "boolean"); - } - } - applyToGraph(extraLinks = []) { - if (!this.outputs[0].links?.length) return; - function get_links(node) { - let links2 = []; - for (const l of node.outputs[0].links) { - const linkInfo = app.graph.links[l]; - const n = node.graph.getNodeById(linkInfo.target_id); - if (n.type == "Reroute") { - links2 = links2.concat(get_links(n)); - } else { - links2.push(l); - } - } - return links2; - } - __name(get_links, "get_links"); - let links = [ - ...get_links(this).map((l) => app.graph.links[l]), - ...extraLinks - ]; - let v = this.widgets?.[0].value; - if (v && this.properties[replacePropertyName]) { - v = applyTextReplacements(app, v); - } - for (const linkInfo of links) { - const node = this.graph.getNodeById(linkInfo.target_id); - const input = node.inputs[linkInfo.target_slot]; - let widget; - if (input.widget[TARGET]) { - widget = input.widget[TARGET]; - } else { - const widgetName = input.widget.name; - if (widgetName) { - widget = node.widgets.find((w) => w.name === widgetName); - } - } - if (widget) { - widget.value = v; - if (widget.callback) { - widget.callback( - widget.value, - app.canvas, - node, - app.canvas.graph_mouse, - {} - ); - } - } - } - } - refreshComboInNode() { - const widget = this.widgets?.[0]; - if (widget?.type === "combo") { - widget.options.values = this.outputs[0].widget[GET_CONFIG]()[0]; - if (!widget.options.values.includes(widget.value)) { - widget.value = widget.options.values[0]; - widget.callback(widget.value); - } - } - } - onAfterGraphConfigured() { - if (this.outputs[0].links?.length && !this.widgets?.length) { - if (!this.#onFirstConnection()) return; - if (this.widgets) { - for (let i = 0; i < this.widgets_values.length; i++) { - const w = this.widgets[i]; - if (w) { - w.value = this.widgets_values[i]; - } - } - } - this.#mergeWidgetConfig(); - } - } - onConnectionsChange(_, index, connected) { - if (app.configuringGraph) { - return; - } - const links = this.outputs[0].links; - if (connected) { - if (links?.length && !this.widgets?.length) { - this.#onFirstConnection(); - } - } else { - this.#mergeWidgetConfig(); - if (!links?.length) { - this.onLastDisconnect(); - } - } - } - onConnectOutput(slot, type, input, target_node, target_slot) { - if (!input.widget) { - if (!(input.type in ComfyWidgets)) return false; - } - if (this.outputs[slot].links?.length) { - const valid = this.#isValidConnection(input); - if (valid) { - this.applyToGraph([{ target_id: target_node.id, target_slot }]); - } - return valid; - } - } - #onFirstConnection(recreating) { - if (!this.outputs[0].links) { - this.onLastDisconnect(); - return; - } - const linkId = this.outputs[0].links[0]; - const link = this.graph.links[linkId]; - if (!link) return; - const theirNode = this.graph.getNodeById(link.target_id); - if (!theirNode || !theirNode.inputs) return; - const input = theirNode.inputs[link.target_slot]; - if (!input) return; - let widget; - if (!input.widget) { - if (!(input.type in ComfyWidgets)) return; - widget = { name: input.name, [GET_CONFIG]: () => [input.type, {}] }; - } else { - widget = input.widget; - } - const config = widget[GET_CONFIG]?.(); - if (!config) return; - const { type } = getWidgetType(config); - this.outputs[0].type = type; - this.outputs[0].name = type; - this.outputs[0].widget = widget; - this.#createWidget( - widget[CONFIG] ?? config, - theirNode, - widget.name, - recreating, - widget[TARGET] - ); - } - #createWidget(inputData, node, widgetName, recreating, targetWidget) { - let type = inputData[0]; - if (type instanceof Array) { - type = "COMBO"; - } - const [oldWidth, oldHeight] = this.size; - let widget; - if (type in ComfyWidgets) { - widget = (ComfyWidgets[type](this, "value", inputData, app) || {}).widget; - } else { - widget = this.addWidget(type, "value", null, () => { - }, {}); - } - if (targetWidget) { - widget.value = targetWidget.value; - } else if (node?.widgets && widget) { - const theirWidget = node.widgets.find((w) => w.name === widgetName); - if (theirWidget) { - widget.value = theirWidget.value; - } - } - if (!inputData?.[1]?.control_after_generate && (widget.type === "number" || widget.type === "combo")) { - let control_value = this.widgets_values?.[1]; - if (!control_value) { - control_value = "fixed"; - } - addValueControlWidgets( - this, - widget, - control_value, - void 0, - inputData - ); - let filter = this.widgets_values?.[2]; - if (filter && this.widgets.length === 3) { - this.widgets[2].value = filter; - } - } - const controlValues = this.controlValues; - if (this.lastType === this.widgets[0].type && controlValues?.length === this.widgets.length - 1) { - for (let i = 0; i < controlValues.length; i++) { - this.widgets[i + 1].value = controlValues[i]; - } - } - const callback = widget.callback; - const self2 = this; - widget.callback = function() { - const r = callback ? callback.apply(this, arguments) : void 0; - self2.applyToGraph(); - return r; - }; - this.setSize([ - Math.max(this.size[0], oldWidth), - Math.max(this.size[1], oldHeight) - ]); - if (!recreating) { - const sz = this.computeSize(); - if (this.size[0] < sz[0]) { - this.size[0] = sz[0]; - } - if (this.size[1] < sz[1]) { - this.size[1] = sz[1]; - } - requestAnimationFrame(() => { - if (this.onResize) { - this.onResize(this.size); - } - }); - } - } - recreateWidget() { - const values = this.widgets?.map((w) => w.value); - this.#removeWidgets(); - this.#onFirstConnection(true); - if (values?.length) { - for (let i = 0; i < this.widgets?.length; i++) - this.widgets[i].value = values[i]; - } - return this.widgets?.[0]; - } - #mergeWidgetConfig() { - const output = this.outputs[0]; - const links = output.links; - const hasConfig = !!output.widget[CONFIG]; - if (hasConfig) { - delete output.widget[CONFIG]; - } - if (links?.length < 2 && hasConfig) { - if (links.length) { - this.recreateWidget(); - } - return; - } - const config1 = output.widget[GET_CONFIG](); - const isNumber = config1[0] === "INT" || config1[0] === "FLOAT"; - if (!isNumber) return; - for (const linkId of links) { - const link = app.graph.links[linkId]; - if (!link) continue; - const theirNode = app.graph.getNodeById(link.target_id); - const theirInput = theirNode.inputs[link.target_slot]; - this.#isValidConnection(theirInput, hasConfig); - } - } - isValidWidgetLink(originSlot, targetNode, targetWidget) { - const config2 = getConfig.call(targetNode, targetWidget.name) ?? [ - targetWidget.type, - targetWidget.options || {} - ]; - if (!isConvertibleWidget(targetWidget, config2)) return false; - const output = this.outputs[originSlot]; - if (!(output.widget?.[CONFIG] ?? output.widget?.[GET_CONFIG]())) { - return true; - } - return !!mergeIfValid.call(this, output, config2); - } - #isValidConnection(input, forceUpdate) { - const output = this.outputs[0]; - const config2 = input.widget[GET_CONFIG](); - return !!mergeIfValid.call( - this, - output, - config2, - forceUpdate, - this.recreateWidget - ); - } - #removeWidgets() { - if (this.widgets) { - for (const w of this.widgets) { - if (w.onRemove) { - w.onRemove(); - } - } - this.controlValues = []; - this.lastType = this.widgets[0]?.type; - for (let i = 1; i < this.widgets.length; i++) { - this.controlValues.push(this.widgets[i].value); - } - setTimeout(() => { - delete this.lastType; - delete this.controlValues; - }, 15); - this.widgets.length = 0; - } - } - onLastDisconnect() { - this.outputs[0].type = "*"; - this.outputs[0].name = "connect to widget input"; - delete this.outputs[0].widget; - this.#removeWidgets(); - } -} -function getWidgetConfig(slot) { - return slot.widget[CONFIG] ?? slot.widget[GET_CONFIG]?.() ?? ["*", {}]; -} -__name(getWidgetConfig, "getWidgetConfig"); -function getConfig(widgetName) { - const { nodeData } = this.constructor; - return nodeData?.input?.required?.[widgetName] ?? nodeData?.input?.optional?.[widgetName]; -} -__name(getConfig, "getConfig"); -function isConvertibleWidget(widget, config) { - return (VALID_TYPES.includes(widget.type) || VALID_TYPES.includes(config[0])) && !widget.options?.forceInput; -} -__name(isConvertibleWidget, "isConvertibleWidget"); -function hideWidget(node, widget, options = {}) { - const { suffix = "", holdSpace = true } = options; - if (widget.type?.startsWith(CONVERTED_TYPE)) return; - widget.origType = widget.type; - widget.origComputeSize = widget.computeSize; - widget.origSerializeValue = widget.serializeValue; - widget.type = CONVERTED_TYPE + suffix; - if (holdSpace) { - widget.computeSize = () => [0, LiteGraph.NODE_WIDGET_HEIGHT]; - } else { - widget.computeSize = () => [0, -4]; - } - widget.serializeValue = (node2, index) => { - if (!node2.inputs) { - return void 0; - } - let node_input = node2.inputs.find((i) => i.widget?.name === widget.name); - if (!node_input || !node_input.link) { - return void 0; - } - return widget.origSerializeValue ? widget.origSerializeValue(node2, index) : widget.value; - }; - if (widget.linkedWidgets) { - for (const w of widget.linkedWidgets) { - hideWidget(node, w, { suffix: ":" + widget.name, holdSpace: false }); - } - } -} -__name(hideWidget, "hideWidget"); -function showWidget(widget) { - widget.type = widget.origType; - widget.computeSize = widget.origComputeSize; - widget.serializeValue = widget.origSerializeValue; - delete widget.origType; - delete widget.origComputeSize; - delete widget.origSerializeValue; - if (widget.linkedWidgets) { - for (const w of widget.linkedWidgets) { - showWidget(w); - } - } -} -__name(showWidget, "showWidget"); -function convertToInput(node, widget, config) { - hideWidget(node, widget); - const { type } = getWidgetType(config); - const [oldWidth, oldHeight] = node.size; - const inputIsOptional = !!widget.options?.inputIsOptional; - const input = node.addInput(widget.name, type, { - widget: { name: widget.name, [GET_CONFIG]: () => config }, - ...inputIsOptional ? { shape: LiteGraph.SlotShape.HollowCircle } : {} - }); - for (const widget2 of node.widgets) { - widget2.last_y += LiteGraph.NODE_SLOT_HEIGHT; - } - node.setSize([ - Math.max(oldWidth, node.size[0]), - Math.max(oldHeight, node.size[1]) - ]); - return input; -} -__name(convertToInput, "convertToInput"); -function convertToWidget(node, widget) { - showWidget(widget); - const [oldWidth, oldHeight] = node.size; - node.removeInput(node.inputs.findIndex((i) => i.widget?.name === widget.name)); - for (const widget2 of node.widgets) { - widget2.last_y -= LiteGraph.NODE_SLOT_HEIGHT; - } - node.setSize([ - Math.max(oldWidth, node.size[0]), - Math.max(oldHeight, node.size[1]) - ]); -} -__name(convertToWidget, "convertToWidget"); -function getWidgetType(config) { - let type = config[0]; - if (type instanceof Array) { - type = "COMBO"; - } - return { type }; -} -__name(getWidgetType, "getWidgetType"); -function isValidCombo(combo, obj) { - if (!(obj instanceof Array)) { - console.log(`connection rejected: tried to connect combo to ${obj}`); - return false; - } - if (combo.length !== obj.length) { - console.log(`connection rejected: combo lists dont match`); - return false; - } - if (combo.find((v, i) => obj[i] !== v)) { - console.log(`connection rejected: combo lists dont match`); - return false; - } - return true; -} -__name(isValidCombo, "isValidCombo"); -function isPrimitiveNode(node) { - return node.type === "PrimitiveNode"; -} -__name(isPrimitiveNode, "isPrimitiveNode"); -function setWidgetConfig(slot, config, target) { - if (!slot.widget) return; - if (config) { - slot.widget[GET_CONFIG] = () => config; - slot.widget[TARGET] = target; - } else { - delete slot.widget; - } - if (slot.link) { - const link = app.graph.links[slot.link]; - if (link) { - const originNode = app.graph.getNodeById(link.origin_id); - if (isPrimitiveNode(originNode)) { - if (config) { - originNode.recreateWidget(); - } else if (!app.configuringGraph) { - originNode.disconnectOutput(0); - originNode.onLastDisconnect(); - } - } - } - } -} -__name(setWidgetConfig, "setWidgetConfig"); -function mergeIfValid(output, config2, forceUpdate, recreateWidget, config1) { - if (!config1) { - config1 = getWidgetConfig(output); - } - if (config1[0] instanceof Array) { - if (!isValidCombo(config1[0], config2[0])) return; - } else if (config1[0] !== config2[0]) { - console.log(`connection rejected: types dont match`, config1[0], config2[0]); - return; - } - const keys = /* @__PURE__ */ new Set([ - ...Object.keys(config1[1] ?? {}), - ...Object.keys(config2[1] ?? {}) - ]); - let customConfig; - const getCustomConfig = /* @__PURE__ */ __name(() => { - if (!customConfig) { - if (typeof structuredClone === "undefined") { - customConfig = JSON.parse(JSON.stringify(config1[1] ?? {})); - } else { - customConfig = structuredClone(config1[1] ?? {}); - } - } - return customConfig; - }, "getCustomConfig"); - const isNumber = config1[0] === "INT" || config1[0] === "FLOAT"; - for (const k of keys.values()) { - if (k !== "default" && k !== "forceInput" && k !== "defaultInput" && k !== "control_after_generate" && k !== "multiline" && k !== "tooltip" && k !== "dynamicPrompts") { - let v1 = config1[1][k]; - let v2 = config2[1]?.[k]; - if (v1 === v2 || !v1 && !v2) continue; - if (isNumber) { - if (k === "min") { - const theirMax = config2[1]?.["max"]; - if (theirMax != null && v1 > theirMax) { - console.log("connection rejected: min > max", v1, theirMax); - return; - } - getCustomConfig()[k] = v1 == null ? v2 : v2 == null ? v1 : Math.max(v1, v2); - continue; - } else if (k === "max") { - const theirMin = config2[1]?.["min"]; - if (theirMin != null && v1 < theirMin) { - console.log("connection rejected: max < min", v1, theirMin); - return; - } - getCustomConfig()[k] = v1 == null ? v2 : v2 == null ? v1 : Math.min(v1, v2); - continue; - } else if (k === "step") { - let step; - if (v1 == null) { - step = v2; - } else if (v2 == null) { - step = v1; - } else { - if (v1 < v2) { - const a = v2; - v2 = v1; - v1 = a; - } - if (v1 % v2) { - console.log( - "connection rejected: steps not divisible", - "current:", - v1, - "new:", - v2 - ); - return; - } - step = v1; - } - getCustomConfig()[k] = step; - continue; - } - } - console.log(`connection rejected: config ${k} values dont match`, v1, v2); - return; - } - } - if (customConfig || forceUpdate) { - if (customConfig) { - output.widget[CONFIG] = [config1[0], customConfig]; - } - const widget = recreateWidget?.call(this); - if (widget) { - const min = widget.options.min; - const max2 = widget.options.max; - if (min != null && widget.value < min) widget.value = min; - if (max2 != null && widget.value > max2) widget.value = max2; - widget.callback(widget.value); - } - } - return { customConfig }; -} -__name(mergeIfValid, "mergeIfValid"); -app.registerExtension({ - name: "Comfy.WidgetInputs", - settings: [ - { - id: "Comfy.NodeInputConversionSubmenus", - name: "In the node context menu, place the entries that convert between input/widget in sub-menus.", - type: "boolean", - defaultValue: true - } - ], - setup() { - app.canvas.getWidgetLinkType = function(widget, node) { - const nodeDefStore = useNodeDefStore(); - const nodeDef = nodeDefStore.nodeDefsByName[node.type]; - const input = nodeDef.inputs.getInput(widget.name); - return input?.type; - }; - document.addEventListener( - "litegraph:canvas", - async (e) => { - if (e.detail.subType === "connectingWidgetLink") { - const { node, link, widget } = e.detail; - if (!node || !link || !widget) return; - const nodeData = node.constructor.nodeData; - if (!nodeData) return; - const all = { - ...nodeData?.input?.required, - ...nodeData?.input?.optional - }; - const inputSpec = all[widget.name]; - if (!inputSpec) return; - const input = convertToInput(node, widget, inputSpec); - if (!input) return; - const originNode = link.node; - originNode.connect(link.slot, node, node.inputs.lastIndexOf(input)); - } - } - ); - }, - async beforeRegisterNodeDef(nodeType, nodeData, app2) { - const origGetExtraMenuOptions = nodeType.prototype.getExtraMenuOptions; - nodeType.prototype.convertWidgetToInput = function(widget) { - const config = getConfig.call(this, widget.name) ?? [ - widget.type, - widget.options || {} - ]; - if (!isConvertibleWidget(widget, config)) return false; - if (widget.type?.startsWith(CONVERTED_TYPE)) return false; - convertToInput(this, widget, config); - return true; - }; - nodeType.prototype.getExtraSlotMenuOptions = function(slot) { - if (!slot.input || !slot.input.widget) return []; - const widget = this.widgets.find((w) => w.name === slot.input.widget.name); - if (!widget) return []; - return [ - { - content: `Convert to widget`, - callback: /* @__PURE__ */ __name(() => convertToWidget(this, widget), "callback") - } - ]; - }; - nodeType.prototype.getExtraMenuOptions = function(_, options) { - const r = origGetExtraMenuOptions ? origGetExtraMenuOptions.apply(this, arguments) : void 0; - const getPointerCanvasPos = /* @__PURE__ */ __name(() => { - const pos = this.graph?.list_of_graphcanvas?.at(0)?.graph_mouse; - return pos ? { canvasX: pos[0], canvasY: pos[1] } : void 0; - }, "getPointerCanvasPos"); - if (this.widgets) { - const { canvasX, canvasY } = getPointerCanvasPos(); - const widget = this.getWidgetOnPos(canvasX, canvasY); - if (widget && widget.type !== CONVERTED_TYPE) { - const config = getConfig.call(this, widget.name) ?? [ - widget.type, - widget.options || {} - ]; - if (isConvertibleWidget(widget, config)) { - options.push({ - content: `Convert ${widget.name} to input`, - callback: /* @__PURE__ */ __name(() => convertToInput(this, widget, config) && false, "callback") - }); - } - } - let toInput = []; - let toWidget = []; - for (const w of this.widgets) { - if (w.options?.forceInput) { - continue; - } - if (w.type === CONVERTED_TYPE) { - toWidget.push({ - // @ts-expect-error never - content: `Convert ${w.name} to widget`, - callback: /* @__PURE__ */ __name(() => convertToWidget(this, w), "callback") - }); - } else { - const config = getConfig.call(this, w.name) ?? [ - w.type, - w.options || {} - ]; - if (isConvertibleWidget(w, config)) { - toInput.push({ - content: `Convert ${w.name} to input`, - callback: /* @__PURE__ */ __name(() => convertToInput(this, w, config), "callback") - }); - } - } - } - if (toInput.length) { - if (useSettingStore().get("Comfy.NodeInputConversionSubmenus")) { - options.push({ - content: "Convert Widget to Input", - submenu: { - options: toInput - } - }); - } else { - options.push(...toInput, null); - } - } - if (toWidget.length) { - if (useSettingStore().get("Comfy.NodeInputConversionSubmenus")) { - options.push({ - content: "Convert Input to Widget", - submenu: { - options: toWidget - } - }); - } else { - options.push(...toWidget, null); - } - } - } - return r; - }; - nodeType.prototype.onGraphConfigured = function() { - if (!this.inputs) return; - this.widgets ??= []; - for (const input of this.inputs) { - if (input.widget) { - if (!input.widget[GET_CONFIG]) { - input.widget[GET_CONFIG] = () => getConfig.call(this, input.widget.name); - } - if (input.widget.config) { - if (input.widget.config[0] instanceof Array) { - input.type = "COMBO"; - const link = app2.graph.links[input.link]; - if (link) { - link.type = input.type; - } - } - delete input.widget.config; - } - const w = this.widgets.find((w2) => w2.name === input.widget.name); - if (w) { - hideWidget(this, w); - } else { - convertToWidget(this, input); - } - } - } - }; - const origOnNodeCreated = nodeType.prototype.onNodeCreated; - nodeType.prototype.onNodeCreated = function() { - const r = origOnNodeCreated ? origOnNodeCreated.apply(this) : void 0; - if (!app2.configuringGraph && this.widgets) { - for (const w of this.widgets) { - if (w?.options?.forceInput || w?.options?.defaultInput) { - const config = getConfig.call(this, w.name) ?? [ - w.type, - w.options || {} - ]; - convertToInput(this, w, config); - } - } - } - return r; - }; - const origOnConfigure = nodeType.prototype.onConfigure; - nodeType.prototype.onConfigure = function() { - const r = origOnConfigure ? origOnConfigure.apply(this, arguments) : void 0; - if (!app2.configuringGraph && this.inputs) { - for (const input of this.inputs) { - if (input.widget && !input.widget[GET_CONFIG]) { - input.widget[GET_CONFIG] = () => getConfig.call(this, input.widget.name); - const w = this.widgets.find((w2) => w2.name === input.widget.name); - if (w) { - hideWidget(this, w); - } - } - } - } - return r; - }; - function isNodeAtPos(pos) { - for (const n of app2.graph.nodes) { - if (n.pos[0] === pos[0] && n.pos[1] === pos[1]) { - return true; - } - } - return false; - } - __name(isNodeAtPos, "isNodeAtPos"); - const origOnInputDblClick = nodeType.prototype.onInputDblClick; - const ignoreDblClick = Symbol(); - nodeType.prototype.onInputDblClick = function(slot) { - const r = origOnInputDblClick ? origOnInputDblClick.apply(this, arguments) : void 0; - const input = this.inputs[slot]; - if (!input.widget || !input[ignoreDblClick]) { - if (!(input.type in ComfyWidgets) && !(input.widget?.[GET_CONFIG]?.()?.[0] instanceof Array)) { - return r; - } - } - const node = LiteGraph.createNode("PrimitiveNode"); - app2.graph.add(node); - const pos = [ - this.pos[0] - node.size[0] - 30, - this.pos[1] - ]; - while (isNodeAtPos(pos)) { - pos[1] += LiteGraph.NODE_TITLE_HEIGHT; - } - node.pos = pos; - node.connect(0, this, slot); - node.title = input.name; - input[ignoreDblClick] = true; - setTimeout(() => { - delete input[ignoreDblClick]; - }, 300); - return r; - }; - const onConnectInput = nodeType.prototype.onConnectInput; - nodeType.prototype.onConnectInput = function(targetSlot, type, output, originNode, originSlot) { - const v = onConnectInput?.(this, arguments); - if (type !== "COMBO") return v; - if (originNode.outputs[originSlot].widget) return v; - const targetCombo = this.inputs[targetSlot].widget?.[GET_CONFIG]?.()?.[0]; - if (!targetCombo || !(targetCombo instanceof Array)) return v; - const originConfig = originNode.constructor?.nodeData?.output?.[originSlot]; - if (!originConfig || !isValidCombo(targetCombo, originConfig)) { - return false; - } - return v; - }; - }, - registerCustomNodes() { - LiteGraph.registerNodeType( - "PrimitiveNode", - Object.assign(PrimitiveNode, { - title: "Primitive" - }) - ); - PrimitiveNode.category = "utils"; - } -}); -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.widgetInputs = window.comfyAPI.widgetInputs || {}; -window.comfyAPI.widgetInputs.getWidgetConfig = getWidgetConfig; -window.comfyAPI.widgetInputs.convertToInput = convertToInput; -window.comfyAPI.widgetInputs.setWidgetConfig = setWidgetConfig; -window.comfyAPI.widgetInputs.mergeIfValid = mergeIfValid; -const GROUP = Symbol(); -const PREFIX = "workflow"; -const SEPARATOR = ">"; -const Workflow = { - InUse: { - Free: 0, - Registered: 1, - InWorkflow: 2 - }, - isInUseGroupNode(name) { - const id2 = `${PREFIX}${SEPARATOR}${name}`; - if (app.graph.extra?.groupNodes?.[name]) { - if (app.graph.nodes.find((n) => n.type === id2)) { - return Workflow.InUse.InWorkflow; - } else { - return Workflow.InUse.Registered; - } - } - return Workflow.InUse.Free; - }, - storeGroupNode(name, data) { - let extra = app.graph.extra; - if (!extra) app.graph.extra = extra = {}; - let groupNodes = extra.groupNodes; - if (!groupNodes) extra.groupNodes = groupNodes = {}; - groupNodes[name] = data; - } -}; -class GroupNodeBuilder { - static { - __name(this, "GroupNodeBuilder"); - } - nodes; - nodeData; - constructor(nodes) { - this.nodes = nodes; - } - async build() { - const name = await this.getName(); - if (!name) return; - this.sortNodes(); - this.nodeData = this.getNodeData(); - Workflow.storeGroupNode(name, this.nodeData); - return { name, nodeData: this.nodeData }; - } - async getName() { - const name = await useDialogService().prompt({ - title: t("groupNode.create"), - message: t("groupNode.enterName"), - defaultValue: "" - }); - if (!name) return; - const used = Workflow.isInUseGroupNode(name); - switch (used) { - case Workflow.InUse.InWorkflow: - useToastStore().addAlert( - "An in use group node with this name already exists embedded in this workflow, please remove any instances or use a new name." - ); - return; - case Workflow.InUse.Registered: - if (!confirm( - "A group node with this name already exists embedded in this workflow, are you sure you want to overwrite it?" - )) { - return; - } - break; - } - return name; - } - sortNodes() { - const nodesInOrder = app.graph.computeExecutionOrder(false); - this.nodes = this.nodes.map((node) => ({ index: nodesInOrder.indexOf(node), node })).sort((a, b) => a.index - b.index || a.node.id - b.node.id).map(({ node }) => node); - } - getNodeData() { - const storeLinkTypes = /* @__PURE__ */ __name((config) => { - for (const link of config.links) { - const origin = app.graph.getNodeById(link[4]); - const type = origin.outputs[link[1]].type; - link.push(type); - } - }, "storeLinkTypes"); - const storeExternalLinks = /* @__PURE__ */ __name((config) => { - config.external = []; - for (let i = 0; i < this.nodes.length; i++) { - const node = this.nodes[i]; - if (!node.outputs?.length) continue; - for (let slot = 0; slot < node.outputs.length; slot++) { - let hasExternal = false; - const output = node.outputs[slot]; - let type = output.type; - if (!output.links?.length) continue; - for (const l of output.links) { - const link = app.graph.links[l]; - if (!link) continue; - if (type === "*") type = link.type; - if (!app.canvas.selected_nodes[link.target_id]) { - hasExternal = true; - break; - } - } - if (hasExternal) { - config.external.push([i, slot, type]); - } - } - } - }, "storeExternalLinks"); - try { - const serialised = serialise(this.nodes, app.canvas.graph); - const config = JSON.parse(serialised); - storeLinkTypes(config); - storeExternalLinks(config); - return config; - } finally { - } - } -} -class GroupNodeConfig { - static { - __name(this, "GroupNodeConfig"); - } - name; - nodeData; - inputCount; - oldToNewOutputMap; - newToOldOutputMap; - oldToNewInputMap; - oldToNewWidgetMap; - newToOldWidgetMap; - primitiveDefs; - widgetToPrimitive; - primitiveToWidget; - nodeInputs; - outputVisibility; - nodeDef; - inputs; - linksFrom; - linksTo; - externalFrom; - constructor(name, nodeData) { - this.name = name; - this.nodeData = nodeData; - this.getLinks(); - this.inputCount = 0; - this.oldToNewOutputMap = {}; - this.newToOldOutputMap = {}; - this.oldToNewInputMap = {}; - this.oldToNewWidgetMap = {}; - this.newToOldWidgetMap = {}; - this.primitiveDefs = {}; - this.widgetToPrimitive = {}; - this.primitiveToWidget = {}; - this.nodeInputs = {}; - this.outputVisibility = []; - } - async registerType(source = PREFIX) { - this.nodeDef = { - output: [], - output_name: [], - output_is_list: [], - // @ts-expect-error Unused, doesn't exist - output_is_hidden: [], - name: source + SEPARATOR + this.name, - display_name: this.name, - category: "group nodes" + (SEPARATOR + source), - input: { required: {} }, - description: `Group node combining ${this.nodeData.nodes.map((n) => n.type).join(", ")}`, - python_module: "custom_nodes." + this.name, - [GROUP]: this - }; - this.inputs = []; - const seenInputs = {}; - const seenOutputs = {}; - for (let i = 0; i < this.nodeData.nodes.length; i++) { - const node = this.nodeData.nodes[i]; - node.index = i; - this.processNode(node, seenInputs, seenOutputs); - } - for (const p of this.#convertedToProcess) { - p(); - } - this.#convertedToProcess = null; - await app.registerNodeDef(`${PREFIX}${SEPARATOR}` + this.name, this.nodeDef); - useNodeDefStore().addNodeDef(this.nodeDef); - } - getLinks() { - this.linksFrom = {}; - this.linksTo = {}; - this.externalFrom = {}; - for (const l of this.nodeData.links) { - const [sourceNodeId, sourceNodeSlot, targetNodeId, targetNodeSlot] = l; - if (sourceNodeId == null) continue; - if (!this.linksFrom[sourceNodeId]) { - this.linksFrom[sourceNodeId] = {}; - } - if (!this.linksFrom[sourceNodeId][sourceNodeSlot]) { - this.linksFrom[sourceNodeId][sourceNodeSlot] = []; - } - this.linksFrom[sourceNodeId][sourceNodeSlot].push(l); - if (!this.linksTo[targetNodeId]) { - this.linksTo[targetNodeId] = {}; - } - this.linksTo[targetNodeId][targetNodeSlot] = l; - } - if (this.nodeData.external) { - for (const ext2 of this.nodeData.external) { - if (!this.externalFrom[ext2[0]]) { - this.externalFrom[ext2[0]] = { [ext2[1]]: ext2[2] }; - } else { - this.externalFrom[ext2[0]][ext2[1]] = ext2[2]; - } - } - } - } - processNode(node, seenInputs, seenOutputs) { - const def = this.getNodeDef(node); - if (!def) return; - const inputs = { ...def.input?.required, ...def.input?.optional }; - this.inputs.push(this.processNodeInputs(node, seenInputs, inputs)); - if (def.output?.length) this.processNodeOutputs(node, seenOutputs, def); - } - getNodeDef(node) { - const def = globalDefs[node.type]; - if (def) return def; - const linksFrom = this.linksFrom[node.index]; - if (node.type === "PrimitiveNode") { - if (!linksFrom) return; - let type = linksFrom["0"][0][5]; - if (type === "COMBO") { - const source = node.outputs[0].widget.name; - const fromTypeName = this.nodeData.nodes[linksFrom["0"][0][2]].type; - const fromType = globalDefs[fromTypeName]; - const input = fromType.input.required[source] ?? fromType.input.optional[source]; - type = input[0]; - } - const def2 = this.primitiveDefs[node.index] = { - input: { - required: { - value: [type, {}] - } - }, - output: [type], - output_name: [], - output_is_list: [] - }; - return def2; - } else if (node.type === "Reroute") { - const linksTo = this.linksTo[node.index]; - if (linksTo && linksFrom && !this.externalFrom[node.index]?.[0]) { - return null; - } - let config = {}; - let rerouteType = "*"; - if (linksFrom) { - for (const [, , id2, slot] of linksFrom["0"]) { - const node2 = this.nodeData.nodes[id2]; - const input = node2.inputs[slot]; - if (rerouteType === "*") { - rerouteType = input.type; - } - if (input.widget) { - const targetDef = globalDefs[node2.type]; - const targetWidget = targetDef.input.required[input.widget.name] ?? targetDef.input.optional[input.widget.name]; - const widget = [targetWidget[0], config]; - const res = mergeIfValid( - { - widget - }, - targetWidget, - false, - null, - widget - ); - config = res?.customConfig ?? config; - } - } - } else if (linksTo) { - const [id2, slot] = linksTo["0"]; - rerouteType = this.nodeData.nodes[id2].outputs[slot].type; - } else { - for (const l of this.nodeData.links) { - if (l[2] === node.index) { - rerouteType = l[5]; - break; - } - } - if (rerouteType === "*") { - const t2 = this.externalFrom[node.index]?.[0]; - if (t2) { - rerouteType = t2; - } - } - } - config.forceInput = true; - return { - input: { - required: { - [rerouteType]: [rerouteType, config] - } - }, - output: [rerouteType], - output_name: [], - output_is_list: [] - }; - } - console.warn( - "Skipping virtual node " + node.type + " when building group node " + this.name - ); - } - getInputConfig(node, inputName, seenInputs, config, extra) { - const customConfig = this.nodeData.config?.[node.index]?.input?.[inputName]; - let name = customConfig?.name ?? node.inputs?.find((inp) => inp.name === inputName)?.label ?? inputName; - let key = name; - let prefix = ""; - if (node.type === "PrimitiveNode" && node.title || name in seenInputs) { - prefix = `${node.title ?? node.type} `; - key = name = `${prefix}${inputName}`; - if (name in seenInputs) { - name = `${prefix}${seenInputs[name]} ${inputName}`; - } - } - seenInputs[key] = (seenInputs[key] ?? 1) + 1; - if (inputName === "seed" || inputName === "noise_seed") { - if (!extra) extra = {}; - extra.control_after_generate = `${prefix}control_after_generate`; - } - if (config[0] === "IMAGEUPLOAD") { - if (!extra) extra = {}; - extra.widget = this.oldToNewWidgetMap[node.index]?.[config[1]?.widget ?? "image"] ?? "image"; - } - if (extra) { - config = [config[0], { ...config[1], ...extra }]; - } - return { name, config, customConfig }; - } - processWidgetInputs(inputs, node, inputNames, seenInputs) { - const slots = []; - const converted = /* @__PURE__ */ new Map(); - const widgetMap = this.oldToNewWidgetMap[node.index] = {}; - for (const inputName of inputNames) { - let widgetType = app.getWidgetType(inputs[inputName], inputName); - if (widgetType) { - const convertedIndex = node.inputs?.findIndex( - (inp) => inp.name === inputName && inp.widget?.name === inputName - ); - if (convertedIndex > -1) { - converted.set(convertedIndex, inputName); - widgetMap[inputName] = null; - } else { - const { name, config } = this.getInputConfig( - node, - inputName, - seenInputs, - inputs[inputName] - ); - this.nodeDef.input.required[name] = config; - widgetMap[inputName] = name; - this.newToOldWidgetMap[name] = { node, inputName }; - } - } else { - slots.push(inputName); - } - } - return { converted, slots }; - } - checkPrimitiveConnection(link, inputName, inputs) { - const sourceNode = this.nodeData.nodes[link[0]]; - if (sourceNode.type === "PrimitiveNode") { - const [sourceNodeId, _, targetNodeId, __] = link; - const primitiveDef = this.primitiveDefs[sourceNodeId]; - const targetWidget = inputs[inputName]; - const primitiveConfig = primitiveDef.input.required.value; - const output = { widget: primitiveConfig }; - const config = mergeIfValid( - output, - targetWidget, - false, - null, - primitiveConfig - ); - primitiveConfig[1] = config?.customConfig ?? inputs[inputName][1] ? { ...inputs[inputName][1] } : {}; - let name = this.oldToNewWidgetMap[sourceNodeId]["value"]; - name = name.substr(0, name.length - 6); - primitiveConfig[1].control_after_generate = true; - primitiveConfig[1].control_prefix = name; - let toPrimitive = this.widgetToPrimitive[targetNodeId]; - if (!toPrimitive) { - toPrimitive = this.widgetToPrimitive[targetNodeId] = {}; - } - if (toPrimitive[inputName]) { - toPrimitive[inputName].push(sourceNodeId); - } - toPrimitive[inputName] = sourceNodeId; - let toWidget = this.primitiveToWidget[sourceNodeId]; - if (!toWidget) { - toWidget = this.primitiveToWidget[sourceNodeId] = []; - } - toWidget.push({ nodeId: targetNodeId, inputName }); - } - } - processInputSlots(inputs, node, slots, linksTo, inputMap, seenInputs) { - this.nodeInputs[node.index] = {}; - for (let i = 0; i < slots.length; i++) { - const inputName = slots[i]; - if (linksTo[i]) { - this.checkPrimitiveConnection(linksTo[i], inputName, inputs); - continue; - } - const { name, config, customConfig } = this.getInputConfig( - node, - inputName, - seenInputs, - inputs[inputName] - ); - this.nodeInputs[node.index][inputName] = name; - if (customConfig?.visible === false) continue; - this.nodeDef.input.required[name] = config; - inputMap[i] = this.inputCount++; - } - } - processConvertedWidgets(inputs, node, slots, converted, linksTo, inputMap, seenInputs) { - const convertedSlots = [...converted.keys()].sort().map((k) => converted.get(k)); - for (let i = 0; i < convertedSlots.length; i++) { - const inputName = convertedSlots[i]; - if (linksTo[slots.length + i]) { - this.checkPrimitiveConnection( - linksTo[slots.length + i], - inputName, - inputs - ); - continue; - } - const { name, config } = this.getInputConfig( - node, - inputName, - seenInputs, - inputs[inputName], - { - defaultInput: true - } - ); - this.nodeDef.input.required[name] = config; - this.newToOldWidgetMap[name] = { node, inputName }; - if (!this.oldToNewWidgetMap[node.index]) { - this.oldToNewWidgetMap[node.index] = {}; - } - this.oldToNewWidgetMap[node.index][inputName] = name; - inputMap[slots.length + i] = this.inputCount++; - } - } - #convertedToProcess = []; - processNodeInputs(node, seenInputs, inputs) { - const inputMapping = []; - const inputNames = Object.keys(inputs); - if (!inputNames.length) return; - const { converted, slots } = this.processWidgetInputs( - inputs, - node, - inputNames, - seenInputs - ); - const linksTo = this.linksTo[node.index] ?? {}; - const inputMap = this.oldToNewInputMap[node.index] = {}; - this.processInputSlots(inputs, node, slots, linksTo, inputMap, seenInputs); - this.#convertedToProcess.push( - () => this.processConvertedWidgets( - inputs, - node, - slots, - converted, - linksTo, - inputMap, - seenInputs - ) - ); - return inputMapping; - } - processNodeOutputs(node, seenOutputs, def) { - const oldToNew = this.oldToNewOutputMap[node.index] = {}; - for (let outputId = 0; outputId < def.output.length; outputId++) { - const linksFrom = this.linksFrom[node.index]; - const hasLink = linksFrom?.[outputId] && !this.externalFrom[node.index]?.[outputId]; - const customConfig = this.nodeData.config?.[node.index]?.output?.[outputId]; - const visible = customConfig?.visible ?? !hasLink; - this.outputVisibility.push(visible); - if (!visible) { - continue; - } - oldToNew[outputId] = this.nodeDef.output.length; - this.newToOldOutputMap[this.nodeDef.output.length] = { - node, - slot: outputId - }; - this.nodeDef.output.push(def.output[outputId]); - this.nodeDef.output_is_list.push(def.output_is_list[outputId]); - let label = customConfig?.name; - if (!label) { - label = def.output_name?.[outputId] ?? def.output[outputId]; - const output = node.outputs.find((o) => o.name === label); - if (output?.label) { - label = output.label; - } - } - let name = label; - if (name in seenOutputs) { - const prefix = `${node.title ?? node.type} `; - name = `${prefix}${label}`; - if (name in seenOutputs) { - name = `${prefix}${node.index} ${label}`; - } - } - seenOutputs[name] = 1; - this.nodeDef.output_name.push(name); - } - } - static async registerFromWorkflow(groupNodes, missingNodeTypes) { - for (const g in groupNodes) { - const groupData = groupNodes[g]; - let hasMissing = false; - for (const n of groupData.nodes) { - if (!(n.type in LiteGraph.registered_node_types)) { - missingNodeTypes.push({ - type: n.type, - hint: ` (In group node '${PREFIX}${SEPARATOR}${g}')` - }); - missingNodeTypes.push({ - type: `${PREFIX}${SEPARATOR}` + g, - action: { - text: "Remove from workflow", - callback: /* @__PURE__ */ __name((e) => { - delete groupNodes[g]; - e.target.textContent = "Removed"; - e.target.style.pointerEvents = "none"; - e.target.style.opacity = 0.7; - }, "callback") - } - }); - hasMissing = true; - } - } - if (hasMissing) continue; - const config = new GroupNodeConfig(g, groupData); - await config.registerType(); - } - } -} -class GroupNodeHandler { - static { - __name(this, "GroupNodeHandler"); - } - node; - groupData; - innerNodes; - constructor(node) { - this.node = node; - this.groupData = node.constructor?.nodeData?.[GROUP]; - this.node.setInnerNodes = (innerNodes) => { - this.innerNodes = innerNodes; - for (let innerNodeIndex = 0; innerNodeIndex < this.innerNodes.length; innerNodeIndex++) { - const innerNode = this.innerNodes[innerNodeIndex]; - for (const w of innerNode.widgets ?? []) { - if (w.type === "converted-widget") { - w.serializeValue = w.origSerializeValue; - } - } - innerNode.index = innerNodeIndex; - innerNode.getInputNode = (slot) => { - const externalSlot = this.groupData.oldToNewInputMap[innerNode.index]?.[slot]; - if (externalSlot != null) { - return this.node.getInputNode(externalSlot); - } - const innerLink = this.groupData.linksTo[innerNode.index]?.[slot]; - if (!innerLink) return null; - const inputNode = innerNodes[innerLink[0]]; - if (inputNode.type === "PrimitiveNode") return null; - return inputNode; - }; - innerNode.getInputLink = (slot) => { - const externalSlot = this.groupData.oldToNewInputMap[innerNode.index]?.[slot]; - if (externalSlot != null) { - const linkId = this.node.inputs[externalSlot].link; - let link2 = app.graph.links[linkId]; - link2 = { - ...link2, - target_id: innerNode.id, - target_slot: +slot - }; - return link2; - } - let link = this.groupData.linksTo[innerNode.index]?.[slot]; - if (!link) return null; - link = { - origin_id: innerNodes[link[0]].id, - origin_slot: link[1], - target_id: innerNode.id, - target_slot: +slot - }; - return link; - }; - } - }; - this.node.updateLink = (link) => { - link = { ...link }; - const output = this.groupData.newToOldOutputMap[link.origin_slot]; - let innerNode = this.innerNodes[output.node.index]; - let l; - while (innerNode?.type === "Reroute") { - l = innerNode.getInputLink(0); - innerNode = innerNode.getInputNode(0); - } - if (!innerNode) { - return null; - } - if (l && GroupNodeHandler.isGroupNode(innerNode)) { - return innerNode.updateLink(l); - } - link.origin_id = innerNode.id; - link.origin_slot = l?.origin_slot ?? output.slot; - return link; - }; - this.node.getInnerNodes = () => { - if (!this.innerNodes) { - this.node.setInnerNodes( - this.groupData.nodeData.nodes.map((n, i) => { - const innerNode = LiteGraph.createNode(n.type); - innerNode.configure(n); - innerNode.id = `${this.node.id}:${i}`; - return innerNode; - }) - ); - } - this.updateInnerWidgets(); - return this.innerNodes; - }; - this.node.recreate = async () => { - const id2 = this.node.id; - const sz = this.node.size; - const nodes = this.node.convertToNodes(); - const groupNode = LiteGraph.createNode(this.node.type); - groupNode.id = id2; - groupNode.setInnerNodes(nodes); - groupNode[GROUP].populateWidgets(); - app.graph.add(groupNode); - groupNode.setSize([ - Math.max(groupNode.size[0], sz[0]), - Math.max(groupNode.size[1], sz[1]) - ]); - const builder = new GroupNodeBuilder(nodes); - const nodeData = builder.getNodeData(); - groupNode[GROUP].groupData.nodeData.links = nodeData.links; - groupNode[GROUP].replaceNodes(nodes); - return groupNode; - }; - this.node.convertToNodes = () => { - const addInnerNodes = /* @__PURE__ */ __name(() => { - const c = { ...this.groupData.nodeData }; - c.nodes = [...c.nodes]; - const innerNodes = this.node.getInnerNodes(); - let ids = []; - for (let i = 0; i < c.nodes.length; i++) { - let id2 = innerNodes?.[i]?.id; - if (id2 == null || isNaN(id2)) { - id2 = void 0; - } else { - ids.push(id2); - } - c.nodes[i] = { ...c.nodes[i], id: id2 }; - } - deserialiseAndCreate(JSON.stringify(c), app.canvas); - const [x, y] = this.node.pos; - let top; - let left; - const selectedIds = ids.length ? ids : Object.keys(app.canvas.selected_nodes); - const newNodes = []; - for (let i = 0; i < selectedIds.length; i++) { - const id2 = selectedIds[i]; - const newNode = app.graph.getNodeById(id2); - const innerNode = innerNodes[i]; - newNodes.push(newNode); - if (left == null || newNode.pos[0] < left) { - left = newNode.pos[0]; - } - if (top == null || newNode.pos[1] < top) { - top = newNode.pos[1]; - } - if (!newNode.widgets) continue; - const map = this.groupData.oldToNewWidgetMap[innerNode.index]; - if (map) { - const widgets = Object.keys(map); - for (const oldName of widgets) { - const newName = map[oldName]; - if (!newName) continue; - const widgetIndex = this.node.widgets.findIndex( - (w) => w.name === newName - ); - if (widgetIndex === -1) continue; - if (innerNode.type === "PrimitiveNode") { - for (let i2 = 0; i2 < newNode.widgets.length; i2++) { - newNode.widgets[i2].value = this.node.widgets[widgetIndex + i2].value; - } - } else { - const outerWidget = this.node.widgets[widgetIndex]; - const newWidget = newNode.widgets.find( - (w) => w.name === oldName - ); - if (!newWidget) continue; - newWidget.value = outerWidget.value; - for (let w = 0; w < outerWidget.linkedWidgets?.length; w++) { - newWidget.linkedWidgets[w].value = outerWidget.linkedWidgets[w].value; - } - } - } - } - } - for (const newNode of newNodes) { - newNode.pos[0] -= left - x; - newNode.pos[1] -= top - y; - } - return { newNodes, selectedIds }; - }, "addInnerNodes"); - const reconnectInputs = /* @__PURE__ */ __name((selectedIds) => { - for (const innerNodeIndex in this.groupData.oldToNewInputMap) { - const id2 = selectedIds[innerNodeIndex]; - const newNode = app.graph.getNodeById(id2); - const map = this.groupData.oldToNewInputMap[innerNodeIndex]; - for (const innerInputId in map) { - const groupSlotId = map[innerInputId]; - if (groupSlotId == null) continue; - const slot = node.inputs[groupSlotId]; - if (slot.link == null) continue; - const link = app.graph.links[slot.link]; - if (!link) continue; - const originNode = app.graph.getNodeById(link.origin_id); - originNode.connect(link.origin_slot, newNode, +innerInputId); - } - } - }, "reconnectInputs"); - const reconnectOutputs = /* @__PURE__ */ __name((selectedIds) => { - for (let groupOutputId = 0; groupOutputId < node.outputs?.length; groupOutputId++) { - const output = node.outputs[groupOutputId]; - if (!output.links) continue; - const links = [...output.links]; - for (const l of links) { - const slot = this.groupData.newToOldOutputMap[groupOutputId]; - const link = app.graph.links[l]; - const targetNode = app.graph.getNodeById(link.target_id); - const newNode = app.graph.getNodeById(selectedIds[slot.node.index]); - newNode.connect(slot.slot, targetNode, link.target_slot); - } - } - }, "reconnectOutputs"); - app.canvas.emitBeforeChange(); - try { - const { newNodes, selectedIds } = addInnerNodes(); - reconnectInputs(selectedIds); - reconnectOutputs(selectedIds); - app.graph.remove(this.node); - return newNodes; - } finally { - app.canvas.emitAfterChange(); - } - }; - const getExtraMenuOptions = this.node.getExtraMenuOptions; - this.node.getExtraMenuOptions = function(_, options) { - getExtraMenuOptions?.apply(this, arguments); - let optionIndex = options.findIndex((o) => o.content === "Outputs"); - if (optionIndex === -1) optionIndex = options.length; - else optionIndex++; - options.splice( - optionIndex, - 0, - null, - { - content: "Convert to nodes", - // @ts-expect-error - callback: /* @__PURE__ */ __name(() => { - return this.convertToNodes(); - }, "callback") - }, - { - content: "Manage Group Node", - callback: /* @__PURE__ */ __name(() => manageGroupNodes(this.type), "callback") - } - ); - }; - const onDrawTitleBox = this.node.onDrawTitleBox; - this.node.onDrawTitleBox = function(ctx, height, size, scale) { - onDrawTitleBox?.apply(this, arguments); - const fill2 = ctx.fillStyle; - ctx.beginPath(); - ctx.rect(11, -height + 11, 2, 2); - ctx.rect(14, -height + 11, 2, 2); - ctx.rect(17, -height + 11, 2, 2); - ctx.rect(11, -height + 14, 2, 2); - ctx.rect(14, -height + 14, 2, 2); - ctx.rect(17, -height + 14, 2, 2); - ctx.rect(11, -height + 17, 2, 2); - ctx.rect(14, -height + 17, 2, 2); - ctx.rect(17, -height + 17, 2, 2); - ctx.fillStyle = this.boxcolor || LiteGraph.NODE_DEFAULT_BOXCOLOR; - ctx.fill(); - ctx.fillStyle = fill2; - }; - const onDrawForeground = node.onDrawForeground; - const groupData = this.groupData.nodeData; - node.onDrawForeground = function(ctx) { - const r = onDrawForeground?.apply?.(this, arguments); - if (+app.runningNodeId === this.id && this.runningInternalNodeId !== null) { - const n = groupData.nodes[this.runningInternalNodeId]; - if (!n) return; - const message = `Running ${n.title || n.type} (${this.runningInternalNodeId}/${groupData.nodes.length})`; - ctx.save(); - ctx.font = "12px sans-serif"; - const sz = ctx.measureText(message); - ctx.fillStyle = node.boxcolor || LiteGraph.NODE_DEFAULT_BOXCOLOR; - ctx.beginPath(); - ctx.roundRect( - 0, - -LiteGraph.NODE_TITLE_HEIGHT - 20, - sz.width + 12, - 20, - 5 - ); - ctx.fill(); - ctx.fillStyle = "#fff"; - ctx.fillText(message, 6, -LiteGraph.NODE_TITLE_HEIGHT - 6); - ctx.restore(); - } - }; - const onExecutionStart = this.node.onExecutionStart; - this.node.onExecutionStart = function() { - this.resetExecution = true; - return onExecutionStart?.apply(this, arguments); - }; - const self2 = this; - const onNodeCreated = this.node.onNodeCreated; - this.node.onNodeCreated = function() { - if (!this.widgets) { - return; - } - const config = self2.groupData.nodeData.config; - if (config) { - for (const n in config) { - const inputs = config[n]?.input; - for (const w in inputs) { - if (inputs[w].visible !== false) continue; - const widgetName = self2.groupData.oldToNewWidgetMap[n][w]; - const widget = this.widgets.find((w2) => w2.name === widgetName); - if (widget) { - widget.type = "hidden"; - widget.computeSize = () => [0, -4]; - } - } - } - } - return onNodeCreated?.apply(this, arguments); - }; - function handleEvent(type, getId, getEvent) { - const handler = /* @__PURE__ */ __name(({ detail }) => { - const id2 = getId(detail); - if (!id2) return; - const node2 = app.graph.getNodeById(id2); - if (node2) return; - const innerNodeIndex = this.innerNodes?.findIndex((n) => n.id == id2); - if (innerNodeIndex > -1) { - this.node.runningInternalNodeId = innerNodeIndex; - api.dispatchCustomEvent( - type, - getEvent(detail, `${this.node.id}`, this.node) - ); - } - }, "handler"); - api.addEventListener(type, handler); - return handler; - } - __name(handleEvent, "handleEvent"); - const executing = handleEvent.call( - this, - "executing", - (d) => d, - (d, id2, node2) => id2 - ); - const executed = handleEvent.call( - this, - "executed", - (d) => d?.display_node || d?.node, - (d, id2, node2) => ({ - ...d, - node: id2, - display_node: id2, - merge: !node2.resetExecution - }) - ); - const onRemoved = node.onRemoved; - this.node.onRemoved = function() { - onRemoved?.apply(this, arguments); - api.removeEventListener("executing", executing); - api.removeEventListener("executed", executed); - }; - this.node.refreshComboInNode = (defs) => { - for (const widgetName in this.groupData.newToOldWidgetMap) { - const widget = this.node.widgets.find((w) => w.name === widgetName); - if (widget?.type === "combo") { - const old = this.groupData.newToOldWidgetMap[widgetName]; - const def = defs[old.node.type]; - const input = def?.input?.required?.[old.inputName] ?? def?.input?.optional?.[old.inputName]; - if (!input) continue; - widget.options.values = input[0]; - if (old.inputName !== "image" && // @ts-expect-error Widget values - !widget.options.values.includes(widget.value)) { - widget.value = widget.options.values[0]; - widget.callback(widget.value); - } - } - } - }; - } - updateInnerWidgets() { - for (const newWidgetName in this.groupData.newToOldWidgetMap) { - const newWidget = this.node.widgets.find((w) => w.name === newWidgetName); - if (!newWidget) continue; - const newValue = newWidget.value; - const old = this.groupData.newToOldWidgetMap[newWidgetName]; - let innerNode = this.innerNodes[old.node.index]; - if (innerNode.type === "PrimitiveNode") { - innerNode.primitiveValue = newValue; - const primitiveLinked = this.groupData.primitiveToWidget[old.node.index]; - for (const linked of primitiveLinked ?? []) { - const node = this.innerNodes[linked.nodeId]; - const widget2 = node.widgets.find((w) => w.name === linked.inputName); - if (widget2) { - widget2.value = newValue; - } - } - continue; - } else if (innerNode.type === "Reroute") { - const rerouteLinks = this.groupData.linksFrom[old.node.index]; - if (rerouteLinks) { - for (const [_, , targetNodeId, targetSlot] of rerouteLinks["0"]) { - const node = this.innerNodes[targetNodeId]; - const input = node.inputs[targetSlot]; - if (input.widget) { - const widget2 = node.widgets?.find( - (w) => w.name === input.widget.name - ); - if (widget2) { - widget2.value = newValue; - } - } - } - } - } - const widget = innerNode.widgets?.find((w) => w.name === old.inputName); - if (widget) { - widget.value = newValue; - } - } - } - populatePrimitive(node, nodeId, oldName, i, linkedShift) { - const primitiveId = this.groupData.widgetToPrimitive[nodeId]?.[oldName]; - if (primitiveId == null) return; - const targetWidgetName = this.groupData.oldToNewWidgetMap[primitiveId]["value"]; - const targetWidgetIndex = this.node.widgets.findIndex( - (w) => w.name === targetWidgetName - ); - if (targetWidgetIndex > -1) { - const primitiveNode = this.innerNodes[primitiveId]; - let len = primitiveNode.widgets.length; - if (len - 1 !== this.node.widgets[targetWidgetIndex].linkedWidgets?.length) { - len = 1; - } - for (let i2 = 0; i2 < len; i2++) { - this.node.widgets[targetWidgetIndex + i2].value = primitiveNode.widgets[i2].value; - } - } - return true; - } - populateReroute(node, nodeId, map) { - if (node.type !== "Reroute") return; - const link = this.groupData.linksFrom[nodeId]?.[0]?.[0]; - if (!link) return; - const [, , targetNodeId, targetNodeSlot] = link; - const targetNode = this.groupData.nodeData.nodes[targetNodeId]; - const inputs = targetNode.inputs; - const targetWidget = inputs?.[targetNodeSlot]?.widget; - if (!targetWidget) return; - const offset = inputs.length - (targetNode.widgets_values?.length ?? 0); - const v = targetNode.widgets_values?.[targetNodeSlot - offset]; - if (v == null) return; - const widgetName = Object.values(map)[0]; - const widget = this.node.widgets.find((w) => w.name === widgetName); - if (widget) { - widget.value = v; - } - } - populateWidgets() { - if (!this.node.widgets) return; - for (let nodeId = 0; nodeId < this.groupData.nodeData.nodes.length; nodeId++) { - const node = this.groupData.nodeData.nodes[nodeId]; - const map = this.groupData.oldToNewWidgetMap[nodeId] ?? {}; - const widgets = Object.keys(map); - if (!node.widgets_values?.length) { - this.populateReroute(node, nodeId, map); - continue; - } - let linkedShift = 0; - for (let i = 0; i < widgets.length; i++) { - const oldName = widgets[i]; - const newName = map[oldName]; - const widgetIndex = this.node.widgets.findIndex( - (w) => w.name === newName - ); - const mainWidget = this.node.widgets[widgetIndex]; - if (this.populatePrimitive(node, nodeId, oldName, i, linkedShift) || widgetIndex === -1) { - const innerWidget = this.innerNodes[nodeId].widgets?.find( - (w) => w.name === oldName - ); - linkedShift += innerWidget?.linkedWidgets?.length ?? 0; - } - if (widgetIndex === -1) { - continue; - } - mainWidget.value = node.widgets_values[i + linkedShift]; - for (let w = 0; w < mainWidget.linkedWidgets?.length; w++) { - this.node.widgets[widgetIndex + w + 1].value = node.widgets_values[i + ++linkedShift]; - } - } - } - } - replaceNodes(nodes) { - let top; - let left; - for (let i = 0; i < nodes.length; i++) { - const node = nodes[i]; - if (left == null || node.pos[0] < left) { - left = node.pos[0]; - } - if (top == null || node.pos[1] < top) { - top = node.pos[1]; - } - this.linkOutputs(node, i); - app.graph.remove(node); - } - this.linkInputs(); - this.node.pos = [left, top]; - } - linkOutputs(originalNode, nodeId) { - if (!originalNode.outputs) return; - for (const output of originalNode.outputs) { - if (!output.links) continue; - const links = [...output.links]; - for (const l of links) { - const link = app.graph.links[l]; - if (!link) continue; - const targetNode = app.graph.getNodeById(link.target_id); - const newSlot = this.groupData.oldToNewOutputMap[nodeId]?.[link.origin_slot]; - if (newSlot != null) { - this.node.connect(newSlot, targetNode, link.target_slot); - } - } - } - } - linkInputs() { - for (const link of this.groupData.nodeData.links ?? []) { - const [, originSlot, targetId, targetSlot, actualOriginId] = link; - const originNode = app.graph.getNodeById(actualOriginId); - if (!originNode) continue; - originNode.connect( - originSlot, - // @ts-expect-error Valid - uses deprecated interface. Required check: if (graph.getNodeById(this.node.id) !== this.node) report() - this.node.id, - this.groupData.oldToNewInputMap[targetId][targetSlot] - ); - } - } - static getGroupData(node) { - return (node.nodeData ?? node.constructor?.nodeData)?.[GROUP]; - } - static isGroupNode(node) { - return !!node.constructor?.nodeData?.[GROUP]; - } - static async fromNodes(nodes) { - const builder = new GroupNodeBuilder(nodes); - const res = await builder.build(); - if (!res) return; - const { name, nodeData } = res; - const config = new GroupNodeConfig(name, nodeData); - await config.registerType(); - const groupNode = LiteGraph.createNode(`${PREFIX}${SEPARATOR}${name}`); - groupNode.setInnerNodes(builder.nodes); - groupNode[GROUP].populateWidgets(); - app.graph.add(groupNode); - groupNode[GROUP].replaceNodes(builder.nodes); - return groupNode; - } -} -function addConvertToGroupOptions() { - function addConvertOption(options, index) { - const selected = Object.values(app.canvas.selected_nodes ?? {}); - const disabled = selected.length < 2 || selected.find((n) => GroupNodeHandler.isGroupNode(n)); - options.splice(index + 1, null, { - content: `Convert to Group Node`, - disabled, - callback: convertSelectedNodesToGroupNode - }); - } - __name(addConvertOption, "addConvertOption"); - function addManageOption(options, index) { - const groups = app.graph.extra?.groupNodes; - const disabled = !groups || !Object.keys(groups).length; - options.splice(index + 1, null, { - content: `Manage Group Nodes`, - disabled, - callback: /* @__PURE__ */ __name(() => manageGroupNodes(), "callback") - }); - } - __name(addManageOption, "addManageOption"); - const getCanvasMenuOptions = LGraphCanvas.prototype.getCanvasMenuOptions; - LGraphCanvas.prototype.getCanvasMenuOptions = function() { - const options = getCanvasMenuOptions.apply(this, arguments); - const index = options.findIndex((o) => o?.content === "Add Group") + 1 || options.length; - addConvertOption(options, index); - addManageOption(options, index + 1); - return options; - }; - const getNodeMenuOptions = LGraphCanvas.prototype.getNodeMenuOptions; - LGraphCanvas.prototype.getNodeMenuOptions = function(node) { - const options = getNodeMenuOptions.apply(this, arguments); - if (!GroupNodeHandler.isGroupNode(node)) { - const index = options.findIndex((o) => o?.content === "Outputs") + 1 || options.length - 1; - addConvertOption(options, index); - } - return options; - }; -} -__name(addConvertToGroupOptions, "addConvertToGroupOptions"); -const replaceLegacySeparators = /* @__PURE__ */ __name((nodes) => { - for (const node of nodes) { - if (typeof node.type === "string" && node.type.startsWith("workflow/")) { - node.type = node.type.replace(/^workflow\//, `${PREFIX}${SEPARATOR}`); - } - } -}, "replaceLegacySeparators"); -async function convertSelectedNodesToGroupNode() { - const nodes = Object.values(app.canvas.selected_nodes ?? {}); - if (nodes.length === 0) { - throw new Error("No nodes selected"); - } - if (nodes.length === 1) { - throw new Error("Please select multiple nodes to convert to group node"); - } - if (nodes.some((n) => GroupNodeHandler.isGroupNode(n))) { - throw new Error("Selected nodes contain a group node"); - } - return await GroupNodeHandler.fromNodes(nodes); -} -__name(convertSelectedNodesToGroupNode, "convertSelectedNodesToGroupNode"); -function ungroupSelectedGroupNodes() { - const nodes = Object.values(app.canvas.selected_nodes ?? {}); - for (const node of nodes) { - if (GroupNodeHandler.isGroupNode(node)) { - node.convertToNodes?.(); - } - } -} -__name(ungroupSelectedGroupNodes, "ungroupSelectedGroupNodes"); -function manageGroupNodes(type) { - new ManageGroupDialog(app).show(type); -} -__name(manageGroupNodes, "manageGroupNodes"); -const id$1 = "Comfy.GroupNode"; -let globalDefs; -const ext = { - name: id$1, - commands: [ - { - id: "Comfy.GroupNode.ConvertSelectedNodesToGroupNode", - label: "Convert selected nodes to group node", - icon: "pi pi-sitemap", - versionAdded: "1.3.17", - function: convertSelectedNodesToGroupNode - }, - { - id: "Comfy.GroupNode.UngroupSelectedGroupNodes", - label: "Ungroup selected group nodes", - icon: "pi pi-sitemap", - versionAdded: "1.3.17", - function: ungroupSelectedGroupNodes - }, - { - id: "Comfy.GroupNode.ManageGroupNodes", - label: "Manage group nodes", - icon: "pi pi-cog", - versionAdded: "1.3.17", - function: manageGroupNodes - } - ], - keybindings: [ - { - commandId: "Comfy.GroupNode.ConvertSelectedNodesToGroupNode", - combo: { - alt: true, - key: "g" - } - }, - { - commandId: "Comfy.GroupNode.UngroupSelectedGroupNodes", - combo: { - alt: true, - shift: true, - key: "G" - } - } - ], - setup() { - addConvertToGroupOptions(); - }, - async beforeConfigureGraph(graphData, missingNodeTypes) { - const nodes = graphData?.extra?.groupNodes; - if (nodes) { - replaceLegacySeparators(graphData.nodes); - await GroupNodeConfig.registerFromWorkflow(nodes, missingNodeTypes); - } - }, - addCustomNodeDefs(defs) { - globalDefs = defs; - }, - nodeCreated(node) { - if (GroupNodeHandler.isGroupNode(node)) { - node[GROUP] = new GroupNodeHandler(node); - if (node.title && node[GROUP]?.groupData?.nodeData) { - Workflow.storeGroupNode(node.title, node[GROUP].groupData.nodeData); - } - } - }, - async refreshComboInNodes(defs) { - Object.assign(globalDefs, defs); - const nodes = app.graph.extra?.groupNodes; - if (nodes) { - await GroupNodeConfig.registerFromWorkflow(nodes, {}); - } - } -}; -app.registerExtension(ext); -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.groupNode = window.comfyAPI.groupNode || {}; -window.comfyAPI.groupNode.GroupNodeConfig = GroupNodeConfig; -window.comfyAPI.groupNode.GroupNodeHandler = GroupNodeHandler; -function setNodeMode(node, mode) { - node.mode = mode; - node.graph?.change(); -} -__name(setNodeMode, "setNodeMode"); -function addNodesToGroup(group, items) { - const padding = useSettingStore().get("Comfy.GroupSelectedNodes.Padding"); - group.resizeTo([...group.children, ...items], padding); -} -__name(addNodesToGroup, "addNodesToGroup"); -app.registerExtension({ - name: "Comfy.GroupOptions", - setup() { - const orig = LGraphCanvas.prototype.getCanvasMenuOptions; - LGraphCanvas.prototype.getCanvasMenuOptions = function() { - const options = orig.apply(this, arguments); - const group = this.graph.getGroupOnPos( - this.graph_mouse[0], - this.graph_mouse[1] - ); - if (!group) { - options.push({ - content: "Add Group For Selected Nodes", - disabled: !this.selectedItems?.size, - callback: /* @__PURE__ */ __name(() => { - const group2 = new LGraphGroup(); - addNodesToGroup(group2, this.selectedItems); - this.graph.add(group2); - this.graph.change(); - }, "callback") - }); - return options; - } - group.recomputeInsideNodes(); - const nodesInGroup = group.nodes; - options.push({ - content: "Add Selected Nodes To Group", - disabled: !this.selectedItems?.size, - callback: /* @__PURE__ */ __name(() => { - addNodesToGroup(group, this.selectedItems); - this.graph.change(); - }, "callback") - }); - if (nodesInGroup.length === 0) { - return options; - } else { - options.push(null); - } - let allNodesAreSameMode = true; - for (let i = 1; i < nodesInGroup.length; i++) { - if (nodesInGroup[i].mode !== nodesInGroup[0].mode) { - allNodesAreSameMode = false; - break; - } - } - options.push({ - content: "Fit Group To Nodes", - callback: /* @__PURE__ */ __name(() => { - group.recomputeInsideNodes(); - const padding = useSettingStore().get( - "Comfy.GroupSelectedNodes.Padding" - ); - group.resizeTo(group.children, padding); - this.graph.change(); - }, "callback") - }); - options.push({ - content: "Select Nodes", - callback: /* @__PURE__ */ __name(() => { - this.selectNodes(nodesInGroup); - this.graph.change(); - this.canvas.focus(); - }, "callback") - }); - if (allNodesAreSameMode) { - const mode = nodesInGroup[0].mode; - switch (mode) { - case 0: - options.push({ - content: "Set Group Nodes to Never", - callback: /* @__PURE__ */ __name(() => { - for (const node of nodesInGroup) { - setNodeMode(node, 2); - } - }, "callback") - }); - options.push({ - content: "Bypass Group Nodes", - callback: /* @__PURE__ */ __name(() => { - for (const node of nodesInGroup) { - setNodeMode(node, 4); - } - }, "callback") - }); - break; - case 2: - options.push({ - content: "Set Group Nodes to Always", - callback: /* @__PURE__ */ __name(() => { - for (const node of nodesInGroup) { - setNodeMode(node, 0); - } - }, "callback") - }); - options.push({ - content: "Bypass Group Nodes", - callback: /* @__PURE__ */ __name(() => { - for (const node of nodesInGroup) { - setNodeMode(node, 4); - } - }, "callback") - }); - break; - case 4: - options.push({ - content: "Set Group Nodes to Always", - callback: /* @__PURE__ */ __name(() => { - for (const node of nodesInGroup) { - setNodeMode(node, 0); - } - }, "callback") - }); - options.push({ - content: "Set Group Nodes to Never", - callback: /* @__PURE__ */ __name(() => { - for (const node of nodesInGroup) { - setNodeMode(node, 2); - } - }, "callback") - }); - break; - default: - options.push({ - content: "Set Group Nodes to Always", - callback: /* @__PURE__ */ __name(() => { - for (const node of nodesInGroup) { - setNodeMode(node, 0); - } - }, "callback") - }); - options.push({ - content: "Set Group Nodes to Never", - callback: /* @__PURE__ */ __name(() => { - for (const node of nodesInGroup) { - setNodeMode(node, 2); - } - }, "callback") - }); - options.push({ - content: "Bypass Group Nodes", - callback: /* @__PURE__ */ __name(() => { - for (const node of nodesInGroup) { - setNodeMode(node, 4); - } - }, "callback") - }); - break; - } - } else { - options.push({ - content: "Set Group Nodes to Always", - callback: /* @__PURE__ */ __name(() => { - for (const node of nodesInGroup) { - setNodeMode(node, 0); - } - }, "callback") - }); - options.push({ - content: "Set Group Nodes to Never", - callback: /* @__PURE__ */ __name(() => { - for (const node of nodesInGroup) { - setNodeMode(node, 2); - } - }, "callback") - }); - options.push({ - content: "Bypass Group Nodes", - callback: /* @__PURE__ */ __name(() => { - for (const node of nodesInGroup) { - setNodeMode(node, 4); - } - }, "callback") - }); - } - return options; - }; - } -}); -const _hoisted_1$4 = { class: "absolute top-12 left-2 flex flex-col pointer-events-auto z-20 bg-gray-700 bg-opacity-30 rounded-lg" }; -const _hoisted_2$2 = { class: "relative show-menu" }; -const _hoisted_3$1 = { class: "absolute left-12 top-0 bg-black bg-opacity-50 rounded-lg shadow-lg" }; -const _hoisted_4 = { class: "flex flex-col" }; -const _hoisted_5 = { class: "text-white" }; -const _hoisted_6 = { class: "bg-gray-700 bg-opacity-30 rounded-lg" }; -const _hoisted_7 = { - key: 0, - class: "flex flex-col" -}; -const _hoisted_8 = { class: "pi pi-table text-white text-lg" }; -const _hoisted_9 = { key: 0 }; -const _hoisted_10 = { class: "pi pi-palette text-white text-lg" }; -const _hoisted_11 = ["value"]; -const _hoisted_12 = { key: 1 }; -const _hoisted_13 = { class: "pi pi-image text-white text-lg" }; -const _hoisted_14 = { key: 2 }; -const _hoisted_15 = { class: "pi pi-times text-white text-lg" }; -const _hoisted_16 = { - key: 1, - class: "flex flex-col" -}; -const _hoisted_17 = { class: "relative show-up-direction" }; -const _hoisted_18 = { class: "pi pi-arrow-up text-white text-lg" }; -const _hoisted_19 = { class: "absolute left-12 top-0 bg-black bg-opacity-50 rounded-lg shadow-lg" }; -const _hoisted_20 = { class: "flex flex-col" }; -const _hoisted_21 = { class: "relative show-material-mode" }; -const _hoisted_22 = { class: "pi pi-box text-white text-lg" }; -const _hoisted_23 = { class: "absolute left-12 top-0 bg-black bg-opacity-50 rounded-lg shadow-lg" }; -const _hoisted_24 = { class: "flex flex-col" }; -const _hoisted_25 = { - key: 2, - class: "flex flex-col" -}; -const _hoisted_26 = { - key: 0, - class: "relative show-fov" -}; -const _hoisted_27 = { class: "pi pi-expand text-white text-lg" }; -const _hoisted_28 = { - class: "absolute left-12 top-0 bg-black bg-opacity-50 p-4 rounded-lg shadow-lg", - style: { "width": "150px" } -}; -const _hoisted_29 = { - key: 3, - class: "flex flex-col" -}; -const _hoisted_30 = { - key: 0, - class: "relative show-light-intensity" -}; -const _hoisted_31 = { class: "pi pi-sun text-white text-lg" }; -const _hoisted_32 = { - class: "absolute left-12 top-0 bg-black bg-opacity-50 p-4 rounded-lg shadow-lg", - style: { "width": "150px" } -}; -const _hoisted_33 = { key: 0 }; -const _sfc_main$6 = /* @__PURE__ */ defineComponent({ - __name: "Load3DControls", - props: { - backgroundColor: {}, - showGrid: { type: Boolean }, - showPreview: { type: Boolean }, - lightIntensity: {}, - showLightIntensityButton: { type: Boolean }, - fov: {}, - showFOVButton: { type: Boolean }, - showPreviewButton: { type: Boolean }, - cameraType: {}, - hasBackgroundImage: { type: Boolean }, - upDirection: {}, - materialMode: {} - }, - emits: ["switchCamera", "toggleGrid", "updateBackgroundColor", "updateLightIntensity", "updateFOV", "togglePreview", "updateBackgroundImage", "updateUpDirection", "updateMaterialMode"], - setup(__props, { emit: __emit }) { - const vTooltip = Tooltip; - const props = __props; - const isMenuOpen = ref(false); - const activeCategory = ref("scene"); - const categories = { - scene: "load3d.scene", - model: "load3d.model", - camera: "load3d.camera", - light: "load3d.light" - }; - const toggleMenu = /* @__PURE__ */ __name(() => { - isMenuOpen.value = !isMenuOpen.value; - }, "toggleMenu"); - const selectCategory = /* @__PURE__ */ __name((category) => { - activeCategory.value = category; - isMenuOpen.value = false; - }, "selectCategory"); - const getCategoryIcon = /* @__PURE__ */ __name((category) => { - const icons = { - scene: "pi pi-image", - model: "pi pi-box", - camera: "pi pi-camera", - light: "pi pi-sun" - }; - return `${icons[category]} text-white text-lg`; - }, "getCategoryIcon"); - const emit = __emit; - const backgroundColor = ref(props.backgroundColor); - const showGrid = ref(props.showGrid); - const showPreview = ref(props.showPreview); - const colorPickerRef = ref(null); - const lightIntensity = ref(props.lightIntensity); - const upDirection = ref(props.upDirection || "original"); - const materialMode = ref(props.materialMode || "original"); - const showLightIntensity = ref(false); - const showLightIntensityButton = ref(props.showLightIntensityButton); - const fov2 = ref(props.fov); - const showFOV = ref(false); - const showFOVButton = ref(props.showFOVButton); - const showPreviewButton = ref(props.showPreviewButton); - const hasBackgroundImage = ref(props.hasBackgroundImage); - const imagePickerRef = ref(null); - const showUpDirection = ref(false); - const upDirections = [ - "original", - "-x", - "+x", - "-y", - "+y", - "-z", - "+z" - ]; - const showMaterialMode = ref(false); - const materialModes = [ - "original", - "normal", - "wireframe", - "depth" - ]; - const switchCamera = /* @__PURE__ */ __name(() => { - emit("switchCamera"); - }, "switchCamera"); - const toggleGrid = /* @__PURE__ */ __name(() => { - showGrid.value = !showGrid.value; - emit("toggleGrid", showGrid.value); - }, "toggleGrid"); - const togglePreview = /* @__PURE__ */ __name(() => { - showPreview.value = !showPreview.value; - emit("togglePreview", showPreview.value); - }, "togglePreview"); - const updateBackgroundColor = /* @__PURE__ */ __name((color) => { - emit("updateBackgroundColor", color); - }, "updateBackgroundColor"); - const openColorPicker = /* @__PURE__ */ __name(() => { - colorPickerRef.value?.click(); - }, "openColorPicker"); - const toggleLightIntensity = /* @__PURE__ */ __name(() => { - showLightIntensity.value = !showLightIntensity.value; - }, "toggleLightIntensity"); - const updateLightIntensity = /* @__PURE__ */ __name(() => { - emit("updateLightIntensity", lightIntensity.value); - }, "updateLightIntensity"); - const toggleFOV = /* @__PURE__ */ __name(() => { - showFOV.value = !showFOV.value; - }, "toggleFOV"); - const updateFOV = /* @__PURE__ */ __name(() => { - emit("updateFOV", fov2.value); - }, "updateFOV"); - const toggleUpDirection = /* @__PURE__ */ __name(() => { - showUpDirection.value = !showUpDirection.value; - }, "toggleUpDirection"); - const selectUpDirection = /* @__PURE__ */ __name((direction) => { - upDirection.value = direction; - emit("updateUpDirection", direction); - }, "selectUpDirection"); - const formatOption = /* @__PURE__ */ __name((option) => { - if (option === "original") return "Original"; - return option.toUpperCase(); - }, "formatOption"); - const toggleMaterialMode = /* @__PURE__ */ __name(() => { - showMaterialMode.value = !showMaterialMode.value; - }, "toggleMaterialMode"); - const selectMaterialMode = /* @__PURE__ */ __name((mode) => { - materialMode.value = mode; - emit("updateMaterialMode", mode); - }, "selectMaterialMode"); - const formatMaterialMode = /* @__PURE__ */ __name((mode) => { - return mode.charAt(0).toUpperCase() + mode.slice(1); - }, "formatMaterialMode"); - const closeSlider = /* @__PURE__ */ __name((e) => { - const target = e.target; - if (!target.closest(".show-menu")) { - isMenuOpen.value = false; - } - if (!target.closest(".show-fov")) { - showFOV.value = false; - } - if (!target.closest(".show-light-intensity")) { - showLightIntensity.value = false; - } - if (!target.closest(".show-up-direction")) { - showUpDirection.value = false; - } - if (!target.closest(".show-material-mode")) { - showMaterialMode.value = false; - } - }, "closeSlider"); - const openImagePicker = /* @__PURE__ */ __name(() => { - imagePickerRef.value?.click(); - }, "openImagePicker"); - watch( - () => props.upDirection, - (newValue) => { - if (newValue) { - upDirection.value = newValue; - } - } - ); - const uploadBackgroundImage = /* @__PURE__ */ __name((event) => { - const input = event.target; - hasBackgroundImage.value = true; - if (input.files && input.files[0]) { - emit("updateBackgroundImage", input.files[0]); - } - }, "uploadBackgroundImage"); - const removeBackgroundImage = /* @__PURE__ */ __name(() => { - hasBackgroundImage.value = false; - emit("updateBackgroundImage", null); - }, "removeBackgroundImage"); - watch( - () => props.backgroundColor, - (newValue) => { - backgroundColor.value = newValue; - } - ); - watch( - () => props.fov, - (newValue) => { - fov2.value = newValue; - } - ); - watch( - () => props.lightIntensity, - (newValue) => { - lightIntensity.value = newValue; - } - ); - watch( - () => props.showFOVButton, - (newValue) => { - showFOVButton.value = newValue; - } - ); - watch( - () => props.showLightIntensityButton, - (newValue) => { - showLightIntensityButton.value = newValue; - } - ); - watch( - () => props.upDirection, - (newValue) => { - upDirection.value = newValue; - } - ); - watch( - () => props.materialMode, - (newValue) => { - materialMode.value = newValue; - } - ); - watch( - () => props.showPreviewButton, - (newValue) => { - showPreviewButton.value = newValue; - } - ); - watch( - () => props.showPreview, - (newValue) => { - showPreview.value = newValue; - } - ); - watch( - () => props.hasBackgroundImage, - (newValue) => { - hasBackgroundImage.value = newValue; - } - ); - watch( - () => props.materialMode, - (newValue) => { - if (newValue) { - materialMode.value = newValue; - } - } - ); - onMounted(() => { - document.addEventListener("click", closeSlider); - }); - onUnmounted(() => { - document.removeEventListener("click", closeSlider); - }); - const getCameraIcon = computed(() => { - return props.cameraType === "perspective" ? "pi-camera" : "pi-camera"; - }); - return (_ctx, _cache2) => { - return openBlock(), createElementBlock("div", _hoisted_1$4, [ - createBaseVNode("div", _hoisted_2$2, [ - createVNode(unref(script), { - class: "p-button-rounded p-button-text bg-opacity-30", - onClick: toggleMenu - }, { - default: withCtx(() => _cache2[3] || (_cache2[3] = [ - createBaseVNode("i", { class: "pi pi-bars text-white text-lg" }, null, -1) - ])), - _: 1 - }), - withDirectives(createBaseVNode("div", _hoisted_3$1, [ - createBaseVNode("div", _hoisted_4, [ - (openBlock(), createElementBlock(Fragment, null, renderList(categories, (label, category) => { - return createVNode(unref(script), { - key: category, - class: normalizeClass(["p-button-text w-full flex items-center justify-start", { "bg-gray-600": activeCategory.value === category }]), - onClick: /* @__PURE__ */ __name(($event) => selectCategory(category), "onClick") - }, { - default: withCtx(() => [ - createBaseVNode("i", { - class: normalizeClass(getCategoryIcon(category)) - }, null, 2), - createBaseVNode("span", _hoisted_5, toDisplayString(unref(t)(label)), 1) - ]), - _: 2 - }, 1032, ["class", "onClick"]); - }), 64)) - ]) - ], 512), [ - [vShow, isMenuOpen.value] - ]) - ]), - withDirectives(createBaseVNode("div", _hoisted_6, [ - activeCategory.value === "scene" ? (openBlock(), createElementBlock("div", _hoisted_7, [ - createVNode(unref(script), { - class: normalizeClass(["p-button-rounded p-button-text", { "p-button-outlined": showGrid.value }]), - onClick: toggleGrid - }, { - default: withCtx(() => [ - withDirectives(createBaseVNode("i", _hoisted_8, null, 512), [ - [ - unref(vTooltip), - { value: unref(t)("load3d.showGrid"), showDelay: 300 }, - void 0, - { right: true } - ] - ]) - ]), - _: 1 - }, 8, ["class"]), - !hasBackgroundImage.value ? (openBlock(), createElementBlock("div", _hoisted_9, [ - createVNode(unref(script), { - class: "p-button-rounded p-button-text", - onClick: openColorPicker - }, { - default: withCtx(() => [ - withDirectives(createBaseVNode("i", _hoisted_10, null, 512), [ - [ - unref(vTooltip), - { - value: unref(t)("load3d.backgroundColor"), - showDelay: 300 - }, - void 0, - { right: true } - ] - ]), - createBaseVNode("input", { - type: "color", - ref_key: "colorPickerRef", - ref: colorPickerRef, - value: backgroundColor.value, - onInput: _cache2[0] || (_cache2[0] = ($event) => updateBackgroundColor($event.target.value)), - class: "absolute opacity-0 w-0 h-0 p-0 m-0 pointer-events-none" - }, null, 40, _hoisted_11) - ]), - _: 1 - }) - ])) : createCommentVNode("", true), - !hasBackgroundImage.value ? (openBlock(), createElementBlock("div", _hoisted_12, [ - createVNode(unref(script), { - class: "p-button-rounded p-button-text", - onClick: openImagePicker - }, { - default: withCtx(() => [ - withDirectives(createBaseVNode("i", _hoisted_13, null, 512), [ - [ - unref(vTooltip), - { - value: unref(t)("load3d.uploadBackgroundImage"), - showDelay: 300 - }, - void 0, - { right: true } - ] - ]), - createBaseVNode("input", { - type: "file", - ref_key: "imagePickerRef", - ref: imagePickerRef, - accept: "image/*", - onChange: uploadBackgroundImage, - class: "absolute opacity-0 w-0 h-0 p-0 m-0 pointer-events-none" - }, null, 544) - ]), - _: 1 - }) - ])) : createCommentVNode("", true), - hasBackgroundImage.value ? (openBlock(), createElementBlock("div", _hoisted_14, [ - createVNode(unref(script), { - class: "p-button-rounded p-button-text", - onClick: removeBackgroundImage - }, { - default: withCtx(() => [ - withDirectives(createBaseVNode("i", _hoisted_15, null, 512), [ - [ - unref(vTooltip), - { - value: unref(t)("load3d.removeBackgroundImage"), - showDelay: 300 - }, - void 0, - { right: true } - ] - ]) - ]), - _: 1 - }) - ])) : createCommentVNode("", true) - ])) : createCommentVNode("", true), - activeCategory.value === "model" ? (openBlock(), createElementBlock("div", _hoisted_16, [ - createBaseVNode("div", _hoisted_17, [ - createVNode(unref(script), { - class: "p-button-rounded p-button-text", - onClick: toggleUpDirection - }, { - default: withCtx(() => [ - withDirectives(createBaseVNode("i", _hoisted_18, null, 512), [ - [ - unref(vTooltip), - { - value: unref(t)("load3d.upDirection"), - showDelay: 300 - }, - void 0, - { right: true } - ] - ]) - ]), - _: 1 - }), - withDirectives(createBaseVNode("div", _hoisted_19, [ - createBaseVNode("div", _hoisted_20, [ - (openBlock(), createElementBlock(Fragment, null, renderList(upDirections, (direction) => { - return createVNode(unref(script), { - key: direction, - class: normalizeClass(["p-button-text text-white", { "bg-blue-500": upDirection.value === direction }]), - onClick: /* @__PURE__ */ __name(($event) => selectUpDirection(direction), "onClick") - }, { - default: withCtx(() => [ - createTextVNode(toDisplayString(formatOption(direction)), 1) - ]), - _: 2 - }, 1032, ["class", "onClick"]); - }), 64)) - ]) - ], 512), [ - [vShow, showUpDirection.value] - ]) - ]), - createBaseVNode("div", _hoisted_21, [ - createVNode(unref(script), { - class: "p-button-rounded p-button-text", - onClick: toggleMaterialMode - }, { - default: withCtx(() => [ - withDirectives(createBaseVNode("i", _hoisted_22, null, 512), [ - [ - unref(vTooltip), - { - value: unref(t)("load3d.materialMode"), - showDelay: 300 - }, - void 0, - { right: true } - ] - ]) - ]), - _: 1 - }), - withDirectives(createBaseVNode("div", _hoisted_23, [ - createBaseVNode("div", _hoisted_24, [ - (openBlock(), createElementBlock(Fragment, null, renderList(materialModes, (mode) => { - return createVNode(unref(script), { - key: mode, - class: normalizeClass(["p-button-text text-white", { "bg-blue-500": materialMode.value === mode }]), - onClick: /* @__PURE__ */ __name(($event) => selectMaterialMode(mode), "onClick") - }, { - default: withCtx(() => [ - createTextVNode(toDisplayString(formatMaterialMode(mode)), 1) - ]), - _: 2 - }, 1032, ["class", "onClick"]); - }), 64)) - ]) - ], 512), [ - [vShow, showMaterialMode.value] - ]) - ]) - ])) : createCommentVNode("", true), - activeCategory.value === "camera" ? (openBlock(), createElementBlock("div", _hoisted_25, [ - createVNode(unref(script), { - class: "p-button-rounded p-button-text", - onClick: switchCamera - }, { - default: withCtx(() => [ - withDirectives(createBaseVNode("i", { - class: normalizeClass(["pi", getCameraIcon.value, "text-white text-lg"]) - }, null, 2), [ - [ - unref(vTooltip), - { - value: unref(t)("load3d.switchCamera"), - showDelay: 300 - }, - void 0, - { right: true } - ] - ]) - ]), - _: 1 - }), - showFOVButton.value ? (openBlock(), createElementBlock("div", _hoisted_26, [ - createVNode(unref(script), { - class: "p-button-rounded p-button-text", - onClick: toggleFOV - }, { - default: withCtx(() => [ - withDirectives(createBaseVNode("i", _hoisted_27, null, 512), [ - [ - unref(vTooltip), - { value: unref(t)("load3d.fov"), showDelay: 300 }, - void 0, - { right: true } - ] - ]) - ]), - _: 1 - }), - withDirectives(createBaseVNode("div", _hoisted_28, [ - createVNode(unref(script$1), { - modelValue: fov2.value, - "onUpdate:modelValue": _cache2[1] || (_cache2[1] = ($event) => fov2.value = $event), - class: "w-full", - onChange: updateFOV, - min: 10, - max: 150, - step: 1 - }, null, 8, ["modelValue"]) - ], 512), [ - [vShow, showFOV.value] - ]) - ])) : createCommentVNode("", true) - ])) : createCommentVNode("", true), - activeCategory.value === "light" ? (openBlock(), createElementBlock("div", _hoisted_29, [ - showLightIntensityButton.value ? (openBlock(), createElementBlock("div", _hoisted_30, [ - createVNode(unref(script), { - class: "p-button-rounded p-button-text", - onClick: toggleLightIntensity - }, { - default: withCtx(() => [ - withDirectives(createBaseVNode("i", _hoisted_31, null, 512), [ - [ - unref(vTooltip), - { - value: unref(t)("load3d.lightIntensity"), - showDelay: 300 - }, - void 0, - { right: true } - ] - ]) - ]), - _: 1 - }), - withDirectives(createBaseVNode("div", _hoisted_32, [ - createVNode(unref(script$1), { - modelValue: lightIntensity.value, - "onUpdate:modelValue": _cache2[2] || (_cache2[2] = ($event) => lightIntensity.value = $event), - class: "w-full", - onChange: updateLightIntensity, - min: 1, - max: 20, - step: 1 - }, null, 8, ["modelValue"]) - ], 512), [ - [vShow, showLightIntensity.value] - ]) - ])) : createCommentVNode("", true) - ])) : createCommentVNode("", true) - ], 512), [ - [vShow, activeCategory.value] - ]), - showPreviewButton.value ? (openBlock(), createElementBlock("div", _hoisted_33, [ - createVNode(unref(script), { - class: "p-button-rounded p-button-text", - onClick: togglePreview - }, { - default: withCtx(() => [ - withDirectives(createBaseVNode("i", { - class: normalizeClass([ - "pi", - showPreview.value ? "pi-eye" : "pi-eye-slash", - "text-white text-lg" - ]) - }, null, 2), [ - [ - unref(vTooltip), - { value: unref(t)("load3d.previewOutput"), showDelay: 300 }, - void 0, - { right: true } - ] - ]) - ]), - _: 1 - }) - ])) : createCommentVNode("", true) - ]); - }; - } -}); -const _hoisted_1$3 = { - key: 0, - class: "absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50" -}; -const _hoisted_2$1 = { class: "flex flex-col items-center" }; -const _hoisted_3 = { class: "text-white mt-4 text-lg" }; -const _sfc_main$5 = /* @__PURE__ */ defineComponent({ - __name: "LoadingOverlay", - setup(__props, { expose: __expose }) { - const modelLoading = ref(false); - const startLoading = /* @__PURE__ */ __name(() => { - modelLoading.value = true; - }, "startLoading"); - const endLoading = /* @__PURE__ */ __name(() => { - modelLoading.value = false; - }, "endLoading"); - __expose({ - startLoading, - endLoading - }); - return (_ctx, _cache2) => { - return openBlock(), createBlock(Transition, { name: "fade" }, { - default: withCtx(() => [ - modelLoading.value ? (openBlock(), createElementBlock("div", _hoisted_1$3, [ - createBaseVNode("div", _hoisted_2$1, [ - _cache2[0] || (_cache2[0] = createBaseVNode("div", { class: "spinner" }, null, -1)), - createBaseVNode("div", _hoisted_3, toDisplayString(unref(t)("load3d.loadingModel")), 1) - ]) - ])) : createCommentVNode("", true) - ]), - _: 1 - }); - }; - } -}); -const LoadingOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-852efd73"]]); -/** - * @license - * Copyright 2010-2024 Three.js Authors - * SPDX-License-Identifier: MIT - */ -const REVISION = "170"; -const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }; -const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }; -const CullFaceNone = 0; -const CullFaceBack = 1; -const CullFaceFront = 2; -const CullFaceFrontBack = 3; -const BasicShadowMap = 0; -const PCFShadowMap = 1; -const PCFSoftShadowMap = 2; -const VSMShadowMap = 3; -const FrontSide = 0; -const BackSide = 1; -const DoubleSide = 2; -const NoBlending = 0; -const NormalBlending = 1; -const AdditiveBlending = 2; -const SubtractiveBlending = 3; -const MultiplyBlending = 4; -const CustomBlending = 5; -const AddEquation = 100; -const SubtractEquation = 101; -const ReverseSubtractEquation = 102; -const MinEquation = 103; -const MaxEquation = 104; -const ZeroFactor = 200; -const OneFactor = 201; -const SrcColorFactor = 202; -const OneMinusSrcColorFactor = 203; -const SrcAlphaFactor = 204; -const OneMinusSrcAlphaFactor = 205; -const DstAlphaFactor = 206; -const OneMinusDstAlphaFactor = 207; -const DstColorFactor = 208; -const OneMinusDstColorFactor = 209; -const SrcAlphaSaturateFactor = 210; -const ConstantColorFactor = 211; -const OneMinusConstantColorFactor = 212; -const ConstantAlphaFactor = 213; -const OneMinusConstantAlphaFactor = 214; -const NeverDepth = 0; -const AlwaysDepth = 1; -const LessDepth = 2; -const LessEqualDepth = 3; -const EqualDepth = 4; -const GreaterEqualDepth = 5; -const GreaterDepth = 6; -const NotEqualDepth = 7; -const MultiplyOperation = 0; -const MixOperation = 1; -const AddOperation = 2; -const NoToneMapping = 0; -const LinearToneMapping = 1; -const ReinhardToneMapping = 2; -const CineonToneMapping = 3; -const ACESFilmicToneMapping = 4; -const CustomToneMapping = 5; -const AgXToneMapping = 6; -const NeutralToneMapping = 7; -const AttachedBindMode = "attached"; -const DetachedBindMode = "detached"; -const UVMapping = 300; -const CubeReflectionMapping = 301; -const CubeRefractionMapping = 302; -const EquirectangularReflectionMapping = 303; -const EquirectangularRefractionMapping = 304; -const CubeUVReflectionMapping = 306; -const RepeatWrapping = 1e3; -const ClampToEdgeWrapping = 1001; -const MirroredRepeatWrapping = 1002; -const NearestFilter = 1003; -const NearestMipmapNearestFilter = 1004; -const NearestMipMapNearestFilter = 1004; -const NearestMipmapLinearFilter = 1005; -const NearestMipMapLinearFilter = 1005; -const LinearFilter = 1006; -const LinearMipmapNearestFilter = 1007; -const LinearMipMapNearestFilter = 1007; -const LinearMipmapLinearFilter = 1008; -const LinearMipMapLinearFilter = 1008; -const UnsignedByteType = 1009; -const ByteType = 1010; -const ShortType = 1011; -const UnsignedShortType = 1012; -const IntType = 1013; -const UnsignedIntType = 1014; -const FloatType = 1015; -const HalfFloatType = 1016; -const UnsignedShort4444Type = 1017; -const UnsignedShort5551Type = 1018; -const UnsignedInt248Type = 1020; -const UnsignedInt5999Type = 35902; -const AlphaFormat = 1021; -const RGBFormat = 1022; -const RGBAFormat = 1023; -const LuminanceFormat = 1024; -const LuminanceAlphaFormat = 1025; -const DepthFormat = 1026; -const DepthStencilFormat = 1027; -const RedFormat = 1028; -const RedIntegerFormat = 1029; -const RGFormat = 1030; -const RGIntegerFormat = 1031; -const RGBIntegerFormat = 1032; -const RGBAIntegerFormat = 1033; -const RGB_S3TC_DXT1_Format = 33776; -const RGBA_S3TC_DXT1_Format = 33777; -const RGBA_S3TC_DXT3_Format = 33778; -const RGBA_S3TC_DXT5_Format = 33779; -const RGB_PVRTC_4BPPV1_Format = 35840; -const RGB_PVRTC_2BPPV1_Format = 35841; -const RGBA_PVRTC_4BPPV1_Format = 35842; -const RGBA_PVRTC_2BPPV1_Format = 35843; -const RGB_ETC1_Format = 36196; -const RGB_ETC2_Format = 37492; -const RGBA_ETC2_EAC_Format = 37496; -const RGBA_ASTC_4x4_Format = 37808; -const RGBA_ASTC_5x4_Format = 37809; -const RGBA_ASTC_5x5_Format = 37810; -const RGBA_ASTC_6x5_Format = 37811; -const RGBA_ASTC_6x6_Format = 37812; -const RGBA_ASTC_8x5_Format = 37813; -const RGBA_ASTC_8x6_Format = 37814; -const RGBA_ASTC_8x8_Format = 37815; -const RGBA_ASTC_10x5_Format = 37816; -const RGBA_ASTC_10x6_Format = 37817; -const RGBA_ASTC_10x8_Format = 37818; -const RGBA_ASTC_10x10_Format = 37819; -const RGBA_ASTC_12x10_Format = 37820; -const RGBA_ASTC_12x12_Format = 37821; -const RGBA_BPTC_Format = 36492; -const RGB_BPTC_SIGNED_Format = 36494; -const RGB_BPTC_UNSIGNED_Format = 36495; -const RED_RGTC1_Format = 36283; -const SIGNED_RED_RGTC1_Format = 36284; -const RED_GREEN_RGTC2_Format = 36285; -const SIGNED_RED_GREEN_RGTC2_Format = 36286; -const LoopOnce = 2200; -const LoopRepeat = 2201; -const LoopPingPong = 2202; -const InterpolateDiscrete = 2300; -const InterpolateLinear = 2301; -const InterpolateSmooth = 2302; -const ZeroCurvatureEnding = 2400; -const ZeroSlopeEnding = 2401; -const WrapAroundEnding = 2402; -const NormalAnimationBlendMode = 2500; -const AdditiveAnimationBlendMode = 2501; -const TrianglesDrawMode = 0; -const TriangleStripDrawMode = 1; -const TriangleFanDrawMode = 2; -const BasicDepthPacking = 3200; -const RGBADepthPacking = 3201; -const RGBDepthPacking = 3202; -const RGDepthPacking = 3203; -const TangentSpaceNormalMap = 0; -const ObjectSpaceNormalMap = 1; -const NoColorSpace = ""; -const SRGBColorSpace = "srgb"; -const LinearSRGBColorSpace = "srgb-linear"; -const LinearTransfer = "linear"; -const SRGBTransfer = "srgb"; -const ZeroStencilOp = 0; -const KeepStencilOp = 7680; -const ReplaceStencilOp = 7681; -const IncrementStencilOp = 7682; -const DecrementStencilOp = 7683; -const IncrementWrapStencilOp = 34055; -const DecrementWrapStencilOp = 34056; -const InvertStencilOp = 5386; -const NeverStencilFunc = 512; -const LessStencilFunc = 513; -const EqualStencilFunc = 514; -const LessEqualStencilFunc = 515; -const GreaterStencilFunc = 516; -const NotEqualStencilFunc = 517; -const GreaterEqualStencilFunc = 518; -const AlwaysStencilFunc = 519; -const NeverCompare = 512; -const LessCompare = 513; -const EqualCompare = 514; -const LessEqualCompare = 515; -const GreaterCompare = 516; -const NotEqualCompare = 517; -const GreaterEqualCompare = 518; -const AlwaysCompare = 519; -const StaticDrawUsage = 35044; -const DynamicDrawUsage = 35048; -const StreamDrawUsage = 35040; -const StaticReadUsage = 35045; -const DynamicReadUsage = 35049; -const StreamReadUsage = 35041; -const StaticCopyUsage = 35046; -const DynamicCopyUsage = 35050; -const StreamCopyUsage = 35042; -const GLSL1 = "100"; -const GLSL3 = "300 es"; -const WebGLCoordinateSystem = 2e3; -const WebGPUCoordinateSystem = 2001; -class EventDispatcher { - static { - __name(this, "EventDispatcher"); - } - addEventListener(type, listener) { - if (this._listeners === void 0) this._listeners = {}; - const listeners = this._listeners; - if (listeners[type] === void 0) { - listeners[type] = []; - } - if (listeners[type].indexOf(listener) === -1) { - listeners[type].push(listener); - } - } - hasEventListener(type, listener) { - if (this._listeners === void 0) return false; - const listeners = this._listeners; - return listeners[type] !== void 0 && listeners[type].indexOf(listener) !== -1; - } - removeEventListener(type, listener) { - if (this._listeners === void 0) return; - const listeners = this._listeners; - const listenerArray = listeners[type]; - if (listenerArray !== void 0) { - const index = listenerArray.indexOf(listener); - if (index !== -1) { - listenerArray.splice(index, 1); - } - } - } - dispatchEvent(event) { - if (this._listeners === void 0) return; - const listeners = this._listeners; - const listenerArray = listeners[event.type]; - if (listenerArray !== void 0) { - event.target = this; - const array = listenerArray.slice(0); - for (let i = 0, l = array.length; i < l; i++) { - array[i].call(this, event); - } - event.target = null; - } - } -} -const _lut = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"]; -let _seed = 1234567; -const DEG2RAD = Math.PI / 180; -const RAD2DEG = 180 / Math.PI; -function generateUUID() { - const d0 = Math.random() * 4294967295 | 0; - const d1 = Math.random() * 4294967295 | 0; - const d2 = Math.random() * 4294967295 | 0; - const d3 = Math.random() * 4294967295 | 0; - const uuid = _lut[d0 & 255] + _lut[d0 >> 8 & 255] + _lut[d0 >> 16 & 255] + _lut[d0 >> 24 & 255] + "-" + _lut[d1 & 255] + _lut[d1 >> 8 & 255] + "-" + _lut[d1 >> 16 & 15 | 64] + _lut[d1 >> 24 & 255] + "-" + _lut[d2 & 63 | 128] + _lut[d2 >> 8 & 255] + "-" + _lut[d2 >> 16 & 255] + _lut[d2 >> 24 & 255] + _lut[d3 & 255] + _lut[d3 >> 8 & 255] + _lut[d3 >> 16 & 255] + _lut[d3 >> 24 & 255]; - return uuid.toLowerCase(); -} -__name(generateUUID, "generateUUID"); -function clamp(value, min, max2) { - return Math.max(min, Math.min(max2, value)); -} -__name(clamp, "clamp"); -function euclideanModulo(n, m) { - return (n % m + m) % m; -} -__name(euclideanModulo, "euclideanModulo"); -function mapLinear(x, a1, a2, b1, b22) { - return b1 + (x - a1) * (b22 - b1) / (a2 - a1); -} -__name(mapLinear, "mapLinear"); -function inverseLerp(x, y, value) { - if (x !== y) { - return (value - x) / (y - x); - } else { - return 0; - } -} -__name(inverseLerp, "inverseLerp"); -function lerp(x, y, t2) { - return (1 - t2) * x + t2 * y; -} -__name(lerp, "lerp"); -function damp(x, y, lambda, dt) { - return lerp(x, y, 1 - Math.exp(-lambda * dt)); -} -__name(damp, "damp"); -function pingpong(x, length = 1) { - return length - Math.abs(euclideanModulo(x, length * 2) - length); -} -__name(pingpong, "pingpong"); -function smoothstep(x, min, max2) { - if (x <= min) return 0; - if (x >= max2) return 1; - x = (x - min) / (max2 - min); - return x * x * (3 - 2 * x); -} -__name(smoothstep, "smoothstep"); -function smootherstep(x, min, max2) { - if (x <= min) return 0; - if (x >= max2) return 1; - x = (x - min) / (max2 - min); - return x * x * x * (x * (x * 6 - 15) + 10); -} -__name(smootherstep, "smootherstep"); -function randInt(low, high) { - return low + Math.floor(Math.random() * (high - low + 1)); -} -__name(randInt, "randInt"); -function randFloat(low, high) { - return low + Math.random() * (high - low); -} -__name(randFloat, "randFloat"); -function randFloatSpread(range) { - return range * (0.5 - Math.random()); -} -__name(randFloatSpread, "randFloatSpread"); -function seededRandom(s) { - if (s !== void 0) _seed = s; - let t2 = _seed += 1831565813; - t2 = Math.imul(t2 ^ t2 >>> 15, t2 | 1); - t2 ^= t2 + Math.imul(t2 ^ t2 >>> 7, t2 | 61); - return ((t2 ^ t2 >>> 14) >>> 0) / 4294967296; -} -__name(seededRandom, "seededRandom"); -function degToRad(degrees) { - return degrees * DEG2RAD; -} -__name(degToRad, "degToRad"); -function radToDeg(radians) { - return radians * RAD2DEG; -} -__name(radToDeg, "radToDeg"); -function isPowerOfTwo(value) { - return (value & value - 1) === 0 && value !== 0; -} -__name(isPowerOfTwo, "isPowerOfTwo"); -function ceilPowerOfTwo(value) { - return Math.pow(2, Math.ceil(Math.log(value) / Math.LN2)); -} -__name(ceilPowerOfTwo, "ceilPowerOfTwo"); -function floorPowerOfTwo(value) { - return Math.pow(2, Math.floor(Math.log(value) / Math.LN2)); -} -__name(floorPowerOfTwo, "floorPowerOfTwo"); -function setQuaternionFromProperEuler(q, a, b, c, order) { - const cos = Math.cos; - const sin = Math.sin; - const c2 = cos(b / 2); - const s2 = sin(b / 2); - const c13 = cos((a + c) / 2); - const s13 = sin((a + c) / 2); - const c1_3 = cos((a - c) / 2); - const s1_3 = sin((a - c) / 2); - const c3_1 = cos((c - a) / 2); - const s3_1 = sin((c - a) / 2); - switch (order) { - case "XYX": - q.set(c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13); - break; - case "YZY": - q.set(s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13); - break; - case "ZXZ": - q.set(s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13); - break; - case "XZX": - q.set(c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13); - break; - case "YXY": - q.set(s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13); - break; - case "ZYZ": - q.set(s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13); - break; - default: - console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + order); - } -} -__name(setQuaternionFromProperEuler, "setQuaternionFromProperEuler"); -function denormalize(value, array) { - switch (array.constructor) { - case Float32Array: - return value; - case Uint32Array: - return value / 4294967295; - case Uint16Array: - return value / 65535; - case Uint8Array: - return value / 255; - case Int32Array: - return Math.max(value / 2147483647, -1); - case Int16Array: - return Math.max(value / 32767, -1); - case Int8Array: - return Math.max(value / 127, -1); - default: - throw new Error("Invalid component type."); - } -} -__name(denormalize, "denormalize"); -function normalize(value, array) { - switch (array.constructor) { - case Float32Array: - return value; - case Uint32Array: - return Math.round(value * 4294967295); - case Uint16Array: - return Math.round(value * 65535); - case Uint8Array: - return Math.round(value * 255); - case Int32Array: - return Math.round(value * 2147483647); - case Int16Array: - return Math.round(value * 32767); - case Int8Array: - return Math.round(value * 127); - default: - throw new Error("Invalid component type."); - } -} -__name(normalize, "normalize"); -const MathUtils = { - DEG2RAD, - RAD2DEG, - generateUUID, - clamp, - euclideanModulo, - mapLinear, - inverseLerp, - lerp, - damp, - pingpong, - smoothstep, - smootherstep, - randInt, - randFloat, - randFloatSpread, - seededRandom, - degToRad, - radToDeg, - isPowerOfTwo, - ceilPowerOfTwo, - floorPowerOfTwo, - setQuaternionFromProperEuler, - normalize, - denormalize -}; -class Vector2 { - static { - __name(this, "Vector2"); - } - constructor(x = 0, y = 0) { - Vector2.prototype.isVector2 = true; - this.x = x; - this.y = y; - } - get width() { - return this.x; - } - set width(value) { - this.x = value; - } - get height() { - return this.y; - } - set height(value) { - this.y = value; - } - set(x, y) { - this.x = x; - this.y = y; - return this; - } - setScalar(scalar) { - this.x = scalar; - this.y = scalar; - return this; - } - setX(x) { - this.x = x; - return this; - } - setY(y) { - this.y = y; - return this; - } - setComponent(index, value) { - switch (index) { - case 0: - this.x = value; - break; - case 1: - this.y = value; - break; - default: - throw new Error("index is out of range: " + index); - } - return this; - } - getComponent(index) { - switch (index) { - case 0: - return this.x; - case 1: - return this.y; - default: - throw new Error("index is out of range: " + index); - } - } - clone() { - return new this.constructor(this.x, this.y); - } - copy(v) { - this.x = v.x; - this.y = v.y; - return this; - } - add(v) { - this.x += v.x; - this.y += v.y; - return this; - } - addScalar(s) { - this.x += s; - this.y += s; - return this; - } - addVectors(a, b) { - this.x = a.x + b.x; - this.y = a.y + b.y; - return this; - } - addScaledVector(v, s) { - this.x += v.x * s; - this.y += v.y * s; - return this; - } - sub(v) { - this.x -= v.x; - this.y -= v.y; - return this; - } - subScalar(s) { - this.x -= s; - this.y -= s; - return this; - } - subVectors(a, b) { - this.x = a.x - b.x; - this.y = a.y - b.y; - return this; - } - multiply(v) { - this.x *= v.x; - this.y *= v.y; - return this; - } - multiplyScalar(scalar) { - this.x *= scalar; - this.y *= scalar; - return this; - } - divide(v) { - this.x /= v.x; - this.y /= v.y; - return this; - } - divideScalar(scalar) { - return this.multiplyScalar(1 / scalar); - } - applyMatrix3(m) { - const x = this.x, y = this.y; - const e = m.elements; - this.x = e[0] * x + e[3] * y + e[6]; - this.y = e[1] * x + e[4] * y + e[7]; - return this; - } - min(v) { - this.x = Math.min(this.x, v.x); - this.y = Math.min(this.y, v.y); - return this; - } - max(v) { - this.x = Math.max(this.x, v.x); - this.y = Math.max(this.y, v.y); - return this; - } - clamp(min, max2) { - this.x = Math.max(min.x, Math.min(max2.x, this.x)); - this.y = Math.max(min.y, Math.min(max2.y, this.y)); - return this; - } - clampScalar(minVal, maxVal) { - this.x = Math.max(minVal, Math.min(maxVal, this.x)); - this.y = Math.max(minVal, Math.min(maxVal, this.y)); - return this; - } - clampLength(min, max2) { - const length = this.length(); - return this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max2, length))); - } - floor() { - this.x = Math.floor(this.x); - this.y = Math.floor(this.y); - return this; - } - ceil() { - this.x = Math.ceil(this.x); - this.y = Math.ceil(this.y); - return this; - } - round() { - this.x = Math.round(this.x); - this.y = Math.round(this.y); - return this; - } - roundToZero() { - this.x = Math.trunc(this.x); - this.y = Math.trunc(this.y); - return this; - } - negate() { - this.x = -this.x; - this.y = -this.y; - return this; - } - dot(v) { - return this.x * v.x + this.y * v.y; - } - cross(v) { - return this.x * v.y - this.y * v.x; - } - lengthSq() { - return this.x * this.x + this.y * this.y; - } - length() { - return Math.sqrt(this.x * this.x + this.y * this.y); - } - manhattanLength() { - return Math.abs(this.x) + Math.abs(this.y); - } - normalize() { - return this.divideScalar(this.length() || 1); - } - angle() { - const angle = Math.atan2(-this.y, -this.x) + Math.PI; - return angle; - } - angleTo(v) { - const denominator = Math.sqrt(this.lengthSq() * v.lengthSq()); - if (denominator === 0) return Math.PI / 2; - const theta = this.dot(v) / denominator; - return Math.acos(clamp(theta, -1, 1)); - } - distanceTo(v) { - return Math.sqrt(this.distanceToSquared(v)); - } - distanceToSquared(v) { - const dx = this.x - v.x, dy = this.y - v.y; - return dx * dx + dy * dy; - } - manhattanDistanceTo(v) { - return Math.abs(this.x - v.x) + Math.abs(this.y - v.y); - } - setLength(length) { - return this.normalize().multiplyScalar(length); - } - lerp(v, alpha) { - this.x += (v.x - this.x) * alpha; - this.y += (v.y - this.y) * alpha; - return this; - } - lerpVectors(v1, v2, alpha) { - this.x = v1.x + (v2.x - v1.x) * alpha; - this.y = v1.y + (v2.y - v1.y) * alpha; - return this; - } - equals(v) { - return v.x === this.x && v.y === this.y; - } - fromArray(array, offset = 0) { - this.x = array[offset]; - this.y = array[offset + 1]; - return this; - } - toArray(array = [], offset = 0) { - array[offset] = this.x; - array[offset + 1] = this.y; - return array; - } - fromBufferAttribute(attribute, index) { - this.x = attribute.getX(index); - this.y = attribute.getY(index); - return this; - } - rotateAround(center, angle) { - const c = Math.cos(angle), s = Math.sin(angle); - const x = this.x - center.x; - const y = this.y - center.y; - this.x = x * c - y * s + center.x; - this.y = x * s + y * c + center.y; - return this; - } - random() { - this.x = Math.random(); - this.y = Math.random(); - return this; - } - *[Symbol.iterator]() { - yield this.x; - yield this.y; - } -} -class Matrix3 { - static { - __name(this, "Matrix3"); - } - constructor(n11, n12, n13, n21, n22, n23, n31, n32, n33) { - Matrix3.prototype.isMatrix3 = true; - this.elements = [ - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1 - ]; - if (n11 !== void 0) { - this.set(n11, n12, n13, n21, n22, n23, n31, n32, n33); - } - } - set(n11, n12, n13, n21, n22, n23, n31, n32, n33) { - const te2 = this.elements; - te2[0] = n11; - te2[1] = n21; - te2[2] = n31; - te2[3] = n12; - te2[4] = n22; - te2[5] = n32; - te2[6] = n13; - te2[7] = n23; - te2[8] = n33; - return this; - } - identity() { - this.set( - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1 - ); - return this; - } - copy(m) { - const te2 = this.elements; - const me = m.elements; - te2[0] = me[0]; - te2[1] = me[1]; - te2[2] = me[2]; - te2[3] = me[3]; - te2[4] = me[4]; - te2[5] = me[5]; - te2[6] = me[6]; - te2[7] = me[7]; - te2[8] = me[8]; - return this; - } - extractBasis(xAxis, yAxis, zAxis) { - xAxis.setFromMatrix3Column(this, 0); - yAxis.setFromMatrix3Column(this, 1); - zAxis.setFromMatrix3Column(this, 2); - return this; - } - setFromMatrix4(m) { - const me = m.elements; - this.set( - me[0], - me[4], - me[8], - me[1], - me[5], - me[9], - me[2], - me[6], - me[10] - ); - return this; - } - multiply(m) { - return this.multiplyMatrices(this, m); - } - premultiply(m) { - return this.multiplyMatrices(m, this); - } - multiplyMatrices(a, b) { - const ae = a.elements; - const be = b.elements; - const te2 = this.elements; - const a11 = ae[0], a12 = ae[3], a13 = ae[6]; - const a21 = ae[1], a22 = ae[4], a23 = ae[7]; - const a31 = ae[2], a32 = ae[5], a33 = ae[8]; - const b11 = be[0], b12 = be[3], b13 = be[6]; - const b21 = be[1], b22 = be[4], b23 = be[7]; - const b31 = be[2], b32 = be[5], b33 = be[8]; - te2[0] = a11 * b11 + a12 * b21 + a13 * b31; - te2[3] = a11 * b12 + a12 * b22 + a13 * b32; - te2[6] = a11 * b13 + a12 * b23 + a13 * b33; - te2[1] = a21 * b11 + a22 * b21 + a23 * b31; - te2[4] = a21 * b12 + a22 * b22 + a23 * b32; - te2[7] = a21 * b13 + a22 * b23 + a23 * b33; - te2[2] = a31 * b11 + a32 * b21 + a33 * b31; - te2[5] = a31 * b12 + a32 * b22 + a33 * b32; - te2[8] = a31 * b13 + a32 * b23 + a33 * b33; - return this; - } - multiplyScalar(s) { - const te2 = this.elements; - te2[0] *= s; - te2[3] *= s; - te2[6] *= s; - te2[1] *= s; - te2[4] *= s; - te2[7] *= s; - te2[2] *= s; - te2[5] *= s; - te2[8] *= s; - return this; - } - determinant() { - const te2 = this.elements; - const a = te2[0], b = te2[1], c = te2[2], d = te2[3], e = te2[4], f = te2[5], g = te2[6], h = te2[7], i = te2[8]; - return a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g; - } - invert() { - const te2 = this.elements, n11 = te2[0], n21 = te2[1], n31 = te2[2], n12 = te2[3], n22 = te2[4], n32 = te2[5], n13 = te2[6], n23 = te2[7], n33 = te2[8], t11 = n33 * n22 - n32 * n23, t12 = n32 * n13 - n33 * n12, t13 = n23 * n12 - n22 * n13, det = n11 * t11 + n21 * t12 + n31 * t13; - if (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0); - const detInv = 1 / det; - te2[0] = t11 * detInv; - te2[1] = (n31 * n23 - n33 * n21) * detInv; - te2[2] = (n32 * n21 - n31 * n22) * detInv; - te2[3] = t12 * detInv; - te2[4] = (n33 * n11 - n31 * n13) * detInv; - te2[5] = (n31 * n12 - n32 * n11) * detInv; - te2[6] = t13 * detInv; - te2[7] = (n21 * n13 - n23 * n11) * detInv; - te2[8] = (n22 * n11 - n21 * n12) * detInv; - return this; - } - transpose() { - let tmp2; - const m = this.elements; - tmp2 = m[1]; - m[1] = m[3]; - m[3] = tmp2; - tmp2 = m[2]; - m[2] = m[6]; - m[6] = tmp2; - tmp2 = m[5]; - m[5] = m[7]; - m[7] = tmp2; - return this; - } - getNormalMatrix(matrix4) { - return this.setFromMatrix4(matrix4).invert().transpose(); - } - transposeIntoArray(r) { - const m = this.elements; - r[0] = m[0]; - r[1] = m[3]; - r[2] = m[6]; - r[3] = m[1]; - r[4] = m[4]; - r[5] = m[7]; - r[6] = m[2]; - r[7] = m[5]; - r[8] = m[8]; - return this; - } - setUvTransform(tx, ty, sx, sy, rotation, cx, cy) { - const c = Math.cos(rotation); - const s = Math.sin(rotation); - this.set( - sx * c, - sx * s, - -sx * (c * cx + s * cy) + cx + tx, - -sy * s, - sy * c, - -sy * (-s * cx + c * cy) + cy + ty, - 0, - 0, - 1 - ); - return this; - } - // - scale(sx, sy) { - this.premultiply(_m3.makeScale(sx, sy)); - return this; - } - rotate(theta) { - this.premultiply(_m3.makeRotation(-theta)); - return this; - } - translate(tx, ty) { - this.premultiply(_m3.makeTranslation(tx, ty)); - return this; - } - // for 2D Transforms - makeTranslation(x, y) { - if (x.isVector2) { - this.set( - 1, - 0, - x.x, - 0, - 1, - x.y, - 0, - 0, - 1 - ); - } else { - this.set( - 1, - 0, - x, - 0, - 1, - y, - 0, - 0, - 1 - ); - } - return this; - } - makeRotation(theta) { - const c = Math.cos(theta); - const s = Math.sin(theta); - this.set( - c, - -s, - 0, - s, - c, - 0, - 0, - 0, - 1 - ); - return this; - } - makeScale(x, y) { - this.set( - x, - 0, - 0, - 0, - y, - 0, - 0, - 0, - 1 - ); - return this; - } - // - equals(matrix) { - const te2 = this.elements; - const me = matrix.elements; - for (let i = 0; i < 9; i++) { - if (te2[i] !== me[i]) return false; - } - return true; - } - fromArray(array, offset = 0) { - for (let i = 0; i < 9; i++) { - this.elements[i] = array[i + offset]; - } - return this; - } - toArray(array = [], offset = 0) { - const te2 = this.elements; - array[offset] = te2[0]; - array[offset + 1] = te2[1]; - array[offset + 2] = te2[2]; - array[offset + 3] = te2[3]; - array[offset + 4] = te2[4]; - array[offset + 5] = te2[5]; - array[offset + 6] = te2[6]; - array[offset + 7] = te2[7]; - array[offset + 8] = te2[8]; - return array; - } - clone() { - return new this.constructor().fromArray(this.elements); - } -} -const _m3 = /* @__PURE__ */ new Matrix3(); -function arrayNeedsUint32(array) { - for (let i = array.length - 1; i >= 0; --i) { - if (array[i] >= 65535) return true; - } - return false; -} -__name(arrayNeedsUint32, "arrayNeedsUint32"); -const TYPED_ARRAYS = { - Int8Array, - Uint8Array, - Uint8ClampedArray, - Int16Array, - Uint16Array, - Int32Array, - Uint32Array, - Float32Array, - Float64Array -}; -function getTypedArray(type, buffer) { - return new TYPED_ARRAYS[type](buffer); -} -__name(getTypedArray, "getTypedArray"); -function createElementNS(name) { - return document.createElementNS("http://www.w3.org/1999/xhtml", name); -} -__name(createElementNS, "createElementNS"); -function createCanvasElement() { - const canvas = createElementNS("canvas"); - canvas.style.display = "block"; - return canvas; -} -__name(createCanvasElement, "createCanvasElement"); -const _cache = {}; -function warnOnce(message) { - if (message in _cache) return; - _cache[message] = true; - console.warn(message); -} -__name(warnOnce, "warnOnce"); -function probeAsync(gl, sync, interval) { - return new Promise(function(resolve, reject) { - function probe() { - switch (gl.clientWaitSync(sync, gl.SYNC_FLUSH_COMMANDS_BIT, 0)) { - case gl.WAIT_FAILED: - reject(); - break; - case gl.TIMEOUT_EXPIRED: - setTimeout(probe, interval); - break; - default: - resolve(); - } - } - __name(probe, "probe"); - setTimeout(probe, interval); - }); -} -__name(probeAsync, "probeAsync"); -function toNormalizedProjectionMatrix(projectionMatrix) { - const m = projectionMatrix.elements; - m[2] = 0.5 * m[2] + 0.5 * m[3]; - m[6] = 0.5 * m[6] + 0.5 * m[7]; - m[10] = 0.5 * m[10] + 0.5 * m[11]; - m[14] = 0.5 * m[14] + 0.5 * m[15]; -} -__name(toNormalizedProjectionMatrix, "toNormalizedProjectionMatrix"); -function toReversedProjectionMatrix(projectionMatrix) { - const m = projectionMatrix.elements; - const isPerspectiveMatrix = m[11] === -1; - if (isPerspectiveMatrix) { - m[10] = -m[10] - 1; - m[14] = -m[14]; - } else { - m[10] = -m[10]; - m[14] = -m[14] + 1; - } -} -__name(toReversedProjectionMatrix, "toReversedProjectionMatrix"); -const ColorManagement = { - enabled: true, - workingColorSpace: LinearSRGBColorSpace, - /** - * Implementations of supported color spaces. - * - * Required: - * - primaries: chromaticity coordinates [ rx ry gx gy bx by ] - * - whitePoint: reference white [ x y ] - * - transfer: transfer function (pre-defined) - * - toXYZ: Matrix3 RGB to XYZ transform - * - fromXYZ: Matrix3 XYZ to RGB transform - * - luminanceCoefficients: RGB luminance coefficients - * - * Optional: - * - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace } - * - workingColorSpaceConfig: { unpackColorSpace: ColorSpace } - * - * Reference: - * - https://www.russellcottrell.com/photo/matrixCalculator.htm - */ - spaces: {}, - convert: /* @__PURE__ */ __name(function(color, sourceColorSpace, targetColorSpace) { - if (this.enabled === false || sourceColorSpace === targetColorSpace || !sourceColorSpace || !targetColorSpace) { - return color; - } - if (this.spaces[sourceColorSpace].transfer === SRGBTransfer) { - color.r = SRGBToLinear(color.r); - color.g = SRGBToLinear(color.g); - color.b = SRGBToLinear(color.b); - } - if (this.spaces[sourceColorSpace].primaries !== this.spaces[targetColorSpace].primaries) { - color.applyMatrix3(this.spaces[sourceColorSpace].toXYZ); - color.applyMatrix3(this.spaces[targetColorSpace].fromXYZ); - } - if (this.spaces[targetColorSpace].transfer === SRGBTransfer) { - color.r = LinearToSRGB(color.r); - color.g = LinearToSRGB(color.g); - color.b = LinearToSRGB(color.b); - } - return color; - }, "convert"), - fromWorkingColorSpace: /* @__PURE__ */ __name(function(color, targetColorSpace) { - return this.convert(color, this.workingColorSpace, targetColorSpace); - }, "fromWorkingColorSpace"), - toWorkingColorSpace: /* @__PURE__ */ __name(function(color, sourceColorSpace) { - return this.convert(color, sourceColorSpace, this.workingColorSpace); - }, "toWorkingColorSpace"), - getPrimaries: /* @__PURE__ */ __name(function(colorSpace) { - return this.spaces[colorSpace].primaries; - }, "getPrimaries"), - getTransfer: /* @__PURE__ */ __name(function(colorSpace) { - if (colorSpace === NoColorSpace) return LinearTransfer; - return this.spaces[colorSpace].transfer; - }, "getTransfer"), - getLuminanceCoefficients: /* @__PURE__ */ __name(function(target, colorSpace = this.workingColorSpace) { - return target.fromArray(this.spaces[colorSpace].luminanceCoefficients); - }, "getLuminanceCoefficients"), - define: /* @__PURE__ */ __name(function(colorSpaces) { - Object.assign(this.spaces, colorSpaces); - }, "define"), - // Internal APIs - _getMatrix: /* @__PURE__ */ __name(function(targetMatrix, sourceColorSpace, targetColorSpace) { - return targetMatrix.copy(this.spaces[sourceColorSpace].toXYZ).multiply(this.spaces[targetColorSpace].fromXYZ); - }, "_getMatrix"), - _getDrawingBufferColorSpace: /* @__PURE__ */ __name(function(colorSpace) { - return this.spaces[colorSpace].outputColorSpaceConfig.drawingBufferColorSpace; - }, "_getDrawingBufferColorSpace"), - _getUnpackColorSpace: /* @__PURE__ */ __name(function(colorSpace = this.workingColorSpace) { - return this.spaces[colorSpace].workingColorSpaceConfig.unpackColorSpace; - }, "_getUnpackColorSpace") -}; -function SRGBToLinear(c) { - return c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4); -} -__name(SRGBToLinear, "SRGBToLinear"); -function LinearToSRGB(c) { - return c < 31308e-7 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055; -} -__name(LinearToSRGB, "LinearToSRGB"); -const REC709_PRIMARIES = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06]; -const REC709_LUMINANCE_COEFFICIENTS = [0.2126, 0.7152, 0.0722]; -const D65 = [0.3127, 0.329]; -const LINEAR_REC709_TO_XYZ = /* @__PURE__ */ new Matrix3().set( - 0.4123908, - 0.3575843, - 0.1804808, - 0.212639, - 0.7151687, - 0.0721923, - 0.0193308, - 0.1191948, - 0.9505322 -); -const XYZ_TO_LINEAR_REC709 = /* @__PURE__ */ new Matrix3().set( - 3.2409699, - -1.5373832, - -0.4986108, - -0.9692436, - 1.8759675, - 0.0415551, - 0.0556301, - -0.203977, - 1.0569715 -); -ColorManagement.define({ - [LinearSRGBColorSpace]: { - primaries: REC709_PRIMARIES, - whitePoint: D65, - transfer: LinearTransfer, - toXYZ: LINEAR_REC709_TO_XYZ, - fromXYZ: XYZ_TO_LINEAR_REC709, - luminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS, - workingColorSpaceConfig: { unpackColorSpace: SRGBColorSpace }, - outputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace } - }, - [SRGBColorSpace]: { - primaries: REC709_PRIMARIES, - whitePoint: D65, - transfer: SRGBTransfer, - toXYZ: LINEAR_REC709_TO_XYZ, - fromXYZ: XYZ_TO_LINEAR_REC709, - luminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS, - outputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace } - } -}); -let _canvas; -class ImageUtils { - static { - __name(this, "ImageUtils"); - } - static getDataURL(image) { - if (/^data:/i.test(image.src)) { - return image.src; - } - if (typeof HTMLCanvasElement === "undefined") { - return image.src; - } - let canvas; - if (image instanceof HTMLCanvasElement) { - canvas = image; - } else { - if (_canvas === void 0) _canvas = createElementNS("canvas"); - _canvas.width = image.width; - _canvas.height = image.height; - const context = _canvas.getContext("2d"); - if (image instanceof ImageData) { - context.putImageData(image, 0, 0); - } else { - context.drawImage(image, 0, 0, image.width, image.height); - } - canvas = _canvas; - } - if (canvas.width > 2048 || canvas.height > 2048) { - console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons", image); - return canvas.toDataURL("image/jpeg", 0.6); - } else { - return canvas.toDataURL("image/png"); - } - } - static sRGBToLinear(image) { - if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) { - const canvas = createElementNS("canvas"); - canvas.width = image.width; - canvas.height = image.height; - const context = canvas.getContext("2d"); - context.drawImage(image, 0, 0, image.width, image.height); - const imageData = context.getImageData(0, 0, image.width, image.height); - const data = imageData.data; - for (let i = 0; i < data.length; i++) { - data[i] = SRGBToLinear(data[i] / 255) * 255; - } - context.putImageData(imageData, 0, 0); - return canvas; - } else if (image.data) { - const data = image.data.slice(0); - for (let i = 0; i < data.length; i++) { - if (data instanceof Uint8Array || data instanceof Uint8ClampedArray) { - data[i] = Math.floor(SRGBToLinear(data[i] / 255) * 255); - } else { - data[i] = SRGBToLinear(data[i]); - } - } - return { - data, - width: image.width, - height: image.height - }; - } else { - console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."); - return image; - } - } -} -let _sourceId = 0; -class Source { - static { - __name(this, "Source"); - } - constructor(data = null) { - this.isSource = true; - Object.defineProperty(this, "id", { value: _sourceId++ }); - this.uuid = generateUUID(); - this.data = data; - this.dataReady = true; - this.version = 0; - } - set needsUpdate(value) { - if (value === true) this.version++; - } - toJSON(meta) { - const isRootObject = meta === void 0 || typeof meta === "string"; - if (!isRootObject && meta.images[this.uuid] !== void 0) { - return meta.images[this.uuid]; - } - const output = { - uuid: this.uuid, - url: "" - }; - const data = this.data; - if (data !== null) { - let url; - if (Array.isArray(data)) { - url = []; - for (let i = 0, l = data.length; i < l; i++) { - if (data[i].isDataTexture) { - url.push(serializeImage(data[i].image)); - } else { - url.push(serializeImage(data[i])); - } - } - } else { - url = serializeImage(data); - } - output.url = url; - } - if (!isRootObject) { - meta.images[this.uuid] = output; - } - return output; - } -} -function serializeImage(image) { - if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) { - return ImageUtils.getDataURL(image); - } else { - if (image.data) { - return { - data: Array.from(image.data), - width: image.width, - height: image.height, - type: image.data.constructor.name - }; - } else { - console.warn("THREE.Texture: Unable to serialize Texture."); - return {}; - } - } -} -__name(serializeImage, "serializeImage"); -let _textureId = 0; -class Texture extends EventDispatcher { - static { - __name(this, "Texture"); - } - constructor(image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = Texture.DEFAULT_ANISOTROPY, colorSpace = NoColorSpace) { - super(); - this.isTexture = true; - Object.defineProperty(this, "id", { value: _textureId++ }); - this.uuid = generateUUID(); - this.name = ""; - this.source = new Source(image); - this.mipmaps = []; - this.mapping = mapping; - this.channel = 0; - this.wrapS = wrapS; - this.wrapT = wrapT; - this.magFilter = magFilter; - this.minFilter = minFilter; - this.anisotropy = anisotropy; - this.format = format; - this.internalFormat = null; - this.type = type; - this.offset = new Vector2(0, 0); - this.repeat = new Vector2(1, 1); - this.center = new Vector2(0, 0); - this.rotation = 0; - this.matrixAutoUpdate = true; - this.matrix = new Matrix3(); - this.generateMipmaps = true; - this.premultiplyAlpha = false; - this.flipY = true; - this.unpackAlignment = 4; - this.colorSpace = colorSpace; - this.userData = {}; - this.version = 0; - this.onUpdate = null; - this.isRenderTargetTexture = false; - this.pmremVersion = 0; - } - get image() { - return this.source.data; - } - set image(value = null) { - this.source.data = value; - } - updateMatrix() { - this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y); - } - clone() { - return new this.constructor().copy(this); - } - copy(source) { - this.name = source.name; - this.source = source.source; - this.mipmaps = source.mipmaps.slice(0); - this.mapping = source.mapping; - this.channel = source.channel; - this.wrapS = source.wrapS; - this.wrapT = source.wrapT; - this.magFilter = source.magFilter; - this.minFilter = source.minFilter; - this.anisotropy = source.anisotropy; - this.format = source.format; - this.internalFormat = source.internalFormat; - this.type = source.type; - this.offset.copy(source.offset); - this.repeat.copy(source.repeat); - this.center.copy(source.center); - this.rotation = source.rotation; - this.matrixAutoUpdate = source.matrixAutoUpdate; - this.matrix.copy(source.matrix); - this.generateMipmaps = source.generateMipmaps; - this.premultiplyAlpha = source.premultiplyAlpha; - this.flipY = source.flipY; - this.unpackAlignment = source.unpackAlignment; - this.colorSpace = source.colorSpace; - this.userData = JSON.parse(JSON.stringify(source.userData)); - this.needsUpdate = true; - return this; - } - toJSON(meta) { - const isRootObject = meta === void 0 || typeof meta === "string"; - if (!isRootObject && meta.textures[this.uuid] !== void 0) { - return meta.textures[this.uuid]; - } - const output = { - metadata: { - version: 4.6, - type: "Texture", - generator: "Texture.toJSON" - }, - uuid: this.uuid, - name: this.name, - image: this.source.toJSON(meta).uuid, - mapping: this.mapping, - channel: this.channel, - repeat: [this.repeat.x, this.repeat.y], - offset: [this.offset.x, this.offset.y], - center: [this.center.x, this.center.y], - rotation: this.rotation, - wrap: [this.wrapS, this.wrapT], - format: this.format, - internalFormat: this.internalFormat, - type: this.type, - colorSpace: this.colorSpace, - minFilter: this.minFilter, - magFilter: this.magFilter, - anisotropy: this.anisotropy, - flipY: this.flipY, - generateMipmaps: this.generateMipmaps, - premultiplyAlpha: this.premultiplyAlpha, - unpackAlignment: this.unpackAlignment - }; - if (Object.keys(this.userData).length > 0) output.userData = this.userData; - if (!isRootObject) { - meta.textures[this.uuid] = output; - } - return output; - } - dispose() { - this.dispatchEvent({ type: "dispose" }); - } - transformUv(uv) { - if (this.mapping !== UVMapping) return uv; - uv.applyMatrix3(this.matrix); - if (uv.x < 0 || uv.x > 1) { - switch (this.wrapS) { - case RepeatWrapping: - uv.x = uv.x - Math.floor(uv.x); - break; - case ClampToEdgeWrapping: - uv.x = uv.x < 0 ? 0 : 1; - break; - case MirroredRepeatWrapping: - if (Math.abs(Math.floor(uv.x) % 2) === 1) { - uv.x = Math.ceil(uv.x) - uv.x; - } else { - uv.x = uv.x - Math.floor(uv.x); - } - break; - } - } - if (uv.y < 0 || uv.y > 1) { - switch (this.wrapT) { - case RepeatWrapping: - uv.y = uv.y - Math.floor(uv.y); - break; - case ClampToEdgeWrapping: - uv.y = uv.y < 0 ? 0 : 1; - break; - case MirroredRepeatWrapping: - if (Math.abs(Math.floor(uv.y) % 2) === 1) { - uv.y = Math.ceil(uv.y) - uv.y; - } else { - uv.y = uv.y - Math.floor(uv.y); - } - break; - } - } - if (this.flipY) { - uv.y = 1 - uv.y; - } - return uv; - } - set needsUpdate(value) { - if (value === true) { - this.version++; - this.source.needsUpdate = true; - } - } - set needsPMREMUpdate(value) { - if (value === true) { - this.pmremVersion++; - } - } -} -Texture.DEFAULT_IMAGE = null; -Texture.DEFAULT_MAPPING = UVMapping; -Texture.DEFAULT_ANISOTROPY = 1; -class Vector4 { - static { - __name(this, "Vector4"); - } - constructor(x = 0, y = 0, z = 0, w = 1) { - Vector4.prototype.isVector4 = true; - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - get width() { - return this.z; - } - set width(value) { - this.z = value; - } - get height() { - return this.w; - } - set height(value) { - this.w = value; - } - set(x, y, z, w) { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - return this; - } - setScalar(scalar) { - this.x = scalar; - this.y = scalar; - this.z = scalar; - this.w = scalar; - return this; - } - setX(x) { - this.x = x; - return this; - } - setY(y) { - this.y = y; - return this; - } - setZ(z) { - this.z = z; - return this; - } - setW(w) { - this.w = w; - return this; - } - setComponent(index, value) { - switch (index) { - case 0: - this.x = value; - break; - case 1: - this.y = value; - break; - case 2: - this.z = value; - break; - case 3: - this.w = value; - break; - default: - throw new Error("index is out of range: " + index); - } - return this; - } - getComponent(index) { - switch (index) { - case 0: - return this.x; - case 1: - return this.y; - case 2: - return this.z; - case 3: - return this.w; - default: - throw new Error("index is out of range: " + index); - } - } - clone() { - return new this.constructor(this.x, this.y, this.z, this.w); - } - copy(v) { - this.x = v.x; - this.y = v.y; - this.z = v.z; - this.w = v.w !== void 0 ? v.w : 1; - return this; - } - add(v) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; - return this; - } - addScalar(s) { - this.x += s; - this.y += s; - this.z += s; - this.w += s; - return this; - } - addVectors(a, b) { - this.x = a.x + b.x; - this.y = a.y + b.y; - this.z = a.z + b.z; - this.w = a.w + b.w; - return this; - } - addScaledVector(v, s) { - this.x += v.x * s; - this.y += v.y * s; - this.z += v.z * s; - this.w += v.w * s; - return this; - } - sub(v) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; - return this; - } - subScalar(s) { - this.x -= s; - this.y -= s; - this.z -= s; - this.w -= s; - return this; - } - subVectors(a, b) { - this.x = a.x - b.x; - this.y = a.y - b.y; - this.z = a.z - b.z; - this.w = a.w - b.w; - return this; - } - multiply(v) { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z; - this.w *= v.w; - return this; - } - multiplyScalar(scalar) { - this.x *= scalar; - this.y *= scalar; - this.z *= scalar; - this.w *= scalar; - return this; - } - applyMatrix4(m) { - const x = this.x, y = this.y, z = this.z, w = this.w; - const e = m.elements; - this.x = e[0] * x + e[4] * y + e[8] * z + e[12] * w; - this.y = e[1] * x + e[5] * y + e[9] * z + e[13] * w; - this.z = e[2] * x + e[6] * y + e[10] * z + e[14] * w; - this.w = e[3] * x + e[7] * y + e[11] * z + e[15] * w; - return this; - } - divide(v) { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z; - this.w /= v.w; - return this; - } - divideScalar(scalar) { - return this.multiplyScalar(1 / scalar); - } - setAxisAngleFromQuaternion(q) { - this.w = 2 * Math.acos(q.w); - const s = Math.sqrt(1 - q.w * q.w); - if (s < 1e-4) { - this.x = 1; - this.y = 0; - this.z = 0; - } else { - this.x = q.x / s; - this.y = q.y / s; - this.z = q.z / s; - } - return this; - } - setAxisAngleFromRotationMatrix(m) { - let angle, x, y, z; - const epsilon = 0.01, epsilon2 = 0.1, te2 = m.elements, m11 = te2[0], m12 = te2[4], m13 = te2[8], m21 = te2[1], m22 = te2[5], m23 = te2[9], m31 = te2[2], m32 = te2[6], m33 = te2[10]; - if (Math.abs(m12 - m21) < epsilon && Math.abs(m13 - m31) < epsilon && Math.abs(m23 - m32) < epsilon) { - if (Math.abs(m12 + m21) < epsilon2 && Math.abs(m13 + m31) < epsilon2 && Math.abs(m23 + m32) < epsilon2 && Math.abs(m11 + m22 + m33 - 3) < epsilon2) { - this.set(1, 0, 0, 0); - return this; - } - angle = Math.PI; - const xx = (m11 + 1) / 2; - const yy = (m22 + 1) / 2; - const zz = (m33 + 1) / 2; - const xy = (m12 + m21) / 4; - const xz = (m13 + m31) / 4; - const yz = (m23 + m32) / 4; - if (xx > yy && xx > zz) { - if (xx < epsilon) { - x = 0; - y = 0.707106781; - z = 0.707106781; - } else { - x = Math.sqrt(xx); - y = xy / x; - z = xz / x; - } - } else if (yy > zz) { - if (yy < epsilon) { - x = 0.707106781; - y = 0; - z = 0.707106781; - } else { - y = Math.sqrt(yy); - x = xy / y; - z = yz / y; - } - } else { - if (zz < epsilon) { - x = 0.707106781; - y = 0.707106781; - z = 0; - } else { - z = Math.sqrt(zz); - x = xz / z; - y = yz / z; - } - } - this.set(x, y, z, angle); - return this; - } - let s = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12)); - if (Math.abs(s) < 1e-3) s = 1; - this.x = (m32 - m23) / s; - this.y = (m13 - m31) / s; - this.z = (m21 - m12) / s; - this.w = Math.acos((m11 + m22 + m33 - 1) / 2); - return this; - } - setFromMatrixPosition(m) { - const e = m.elements; - this.x = e[12]; - this.y = e[13]; - this.z = e[14]; - this.w = e[15]; - return this; - } - min(v) { - this.x = Math.min(this.x, v.x); - this.y = Math.min(this.y, v.y); - this.z = Math.min(this.z, v.z); - this.w = Math.min(this.w, v.w); - return this; - } - max(v) { - this.x = Math.max(this.x, v.x); - this.y = Math.max(this.y, v.y); - this.z = Math.max(this.z, v.z); - this.w = Math.max(this.w, v.w); - return this; - } - clamp(min, max2) { - this.x = Math.max(min.x, Math.min(max2.x, this.x)); - this.y = Math.max(min.y, Math.min(max2.y, this.y)); - this.z = Math.max(min.z, Math.min(max2.z, this.z)); - this.w = Math.max(min.w, Math.min(max2.w, this.w)); - return this; - } - clampScalar(minVal, maxVal) { - this.x = Math.max(minVal, Math.min(maxVal, this.x)); - this.y = Math.max(minVal, Math.min(maxVal, this.y)); - this.z = Math.max(minVal, Math.min(maxVal, this.z)); - this.w = Math.max(minVal, Math.min(maxVal, this.w)); - return this; - } - clampLength(min, max2) { - const length = this.length(); - return this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max2, length))); - } - floor() { - this.x = Math.floor(this.x); - this.y = Math.floor(this.y); - this.z = Math.floor(this.z); - this.w = Math.floor(this.w); - return this; - } - ceil() { - this.x = Math.ceil(this.x); - this.y = Math.ceil(this.y); - this.z = Math.ceil(this.z); - this.w = Math.ceil(this.w); - return this; - } - round() { - this.x = Math.round(this.x); - this.y = Math.round(this.y); - this.z = Math.round(this.z); - this.w = Math.round(this.w); - return this; - } - roundToZero() { - this.x = Math.trunc(this.x); - this.y = Math.trunc(this.y); - this.z = Math.trunc(this.z); - this.w = Math.trunc(this.w); - return this; - } - negate() { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - this.w = -this.w; - return this; - } - dot(v) { - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - } - lengthSq() { - return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w; - } - length() { - return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w); - } - manhattanLength() { - return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w); - } - normalize() { - return this.divideScalar(this.length() || 1); - } - setLength(length) { - return this.normalize().multiplyScalar(length); - } - lerp(v, alpha) { - this.x += (v.x - this.x) * alpha; - this.y += (v.y - this.y) * alpha; - this.z += (v.z - this.z) * alpha; - this.w += (v.w - this.w) * alpha; - return this; - } - lerpVectors(v1, v2, alpha) { - this.x = v1.x + (v2.x - v1.x) * alpha; - this.y = v1.y + (v2.y - v1.y) * alpha; - this.z = v1.z + (v2.z - v1.z) * alpha; - this.w = v1.w + (v2.w - v1.w) * alpha; - return this; - } - equals(v) { - return v.x === this.x && v.y === this.y && v.z === this.z && v.w === this.w; - } - fromArray(array, offset = 0) { - this.x = array[offset]; - this.y = array[offset + 1]; - this.z = array[offset + 2]; - this.w = array[offset + 3]; - return this; - } - toArray(array = [], offset = 0) { - array[offset] = this.x; - array[offset + 1] = this.y; - array[offset + 2] = this.z; - array[offset + 3] = this.w; - return array; - } - fromBufferAttribute(attribute, index) { - this.x = attribute.getX(index); - this.y = attribute.getY(index); - this.z = attribute.getZ(index); - this.w = attribute.getW(index); - return this; - } - random() { - this.x = Math.random(); - this.y = Math.random(); - this.z = Math.random(); - this.w = Math.random(); - return this; - } - *[Symbol.iterator]() { - yield this.x; - yield this.y; - yield this.z; - yield this.w; - } -} -class RenderTarget extends EventDispatcher { - static { - __name(this, "RenderTarget"); - } - constructor(width = 1, height = 1, options = {}) { - super(); - this.isRenderTarget = true; - this.width = width; - this.height = height; - this.depth = 1; - this.scissor = new Vector4(0, 0, width, height); - this.scissorTest = false; - this.viewport = new Vector4(0, 0, width, height); - const image = { width, height, depth: 1 }; - options = Object.assign({ - generateMipmaps: false, - internalFormat: null, - minFilter: LinearFilter, - depthBuffer: true, - stencilBuffer: false, - resolveDepthBuffer: true, - resolveStencilBuffer: true, - depthTexture: null, - samples: 0, - count: 1 - }, options); - const texture = new Texture(image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace); - texture.flipY = false; - texture.generateMipmaps = options.generateMipmaps; - texture.internalFormat = options.internalFormat; - this.textures = []; - const count = options.count; - for (let i = 0; i < count; i++) { - this.textures[i] = texture.clone(); - this.textures[i].isRenderTargetTexture = true; - } - this.depthBuffer = options.depthBuffer; - this.stencilBuffer = options.stencilBuffer; - this.resolveDepthBuffer = options.resolveDepthBuffer; - this.resolveStencilBuffer = options.resolveStencilBuffer; - this.depthTexture = options.depthTexture; - this.samples = options.samples; - } - get texture() { - return this.textures[0]; - } - set texture(value) { - this.textures[0] = value; - } - setSize(width, height, depth = 1) { - if (this.width !== width || this.height !== height || this.depth !== depth) { - this.width = width; - this.height = height; - this.depth = depth; - for (let i = 0, il = this.textures.length; i < il; i++) { - this.textures[i].image.width = width; - this.textures[i].image.height = height; - this.textures[i].image.depth = depth; - } - this.dispose(); - } - this.viewport.set(0, 0, width, height); - this.scissor.set(0, 0, width, height); - } - clone() { - return new this.constructor().copy(this); - } - copy(source) { - this.width = source.width; - this.height = source.height; - this.depth = source.depth; - this.scissor.copy(source.scissor); - this.scissorTest = source.scissorTest; - this.viewport.copy(source.viewport); - this.textures.length = 0; - for (let i = 0, il = source.textures.length; i < il; i++) { - this.textures[i] = source.textures[i].clone(); - this.textures[i].isRenderTargetTexture = true; - } - const image = Object.assign({}, source.texture.image); - this.texture.source = new Source(image); - this.depthBuffer = source.depthBuffer; - this.stencilBuffer = source.stencilBuffer; - this.resolveDepthBuffer = source.resolveDepthBuffer; - this.resolveStencilBuffer = source.resolveStencilBuffer; - if (source.depthTexture !== null) this.depthTexture = source.depthTexture.clone(); - this.samples = source.samples; - return this; - } - dispose() { - this.dispatchEvent({ type: "dispose" }); - } -} -class WebGLRenderTarget extends RenderTarget { - static { - __name(this, "WebGLRenderTarget"); - } - constructor(width = 1, height = 1, options = {}) { - super(width, height, options); - this.isWebGLRenderTarget = true; - } -} -class DataArrayTexture extends Texture { - static { - __name(this, "DataArrayTexture"); - } - constructor(data = null, width = 1, height = 1, depth = 1) { - super(null); - this.isDataArrayTexture = true; - this.image = { data, width, height, depth }; - this.magFilter = NearestFilter; - this.minFilter = NearestFilter; - this.wrapR = ClampToEdgeWrapping; - this.generateMipmaps = false; - this.flipY = false; - this.unpackAlignment = 1; - this.layerUpdates = /* @__PURE__ */ new Set(); - } - addLayerUpdate(layerIndex) { - this.layerUpdates.add(layerIndex); - } - clearLayerUpdates() { - this.layerUpdates.clear(); - } -} -class WebGLArrayRenderTarget extends WebGLRenderTarget { - static { - __name(this, "WebGLArrayRenderTarget"); - } - constructor(width = 1, height = 1, depth = 1, options = {}) { - super(width, height, options); - this.isWebGLArrayRenderTarget = true; - this.depth = depth; - this.texture = new DataArrayTexture(null, width, height, depth); - this.texture.isRenderTargetTexture = true; - } -} -class Data3DTexture extends Texture { - static { - __name(this, "Data3DTexture"); - } - constructor(data = null, width = 1, height = 1, depth = 1) { - super(null); - this.isData3DTexture = true; - this.image = { data, width, height, depth }; - this.magFilter = NearestFilter; - this.minFilter = NearestFilter; - this.wrapR = ClampToEdgeWrapping; - this.generateMipmaps = false; - this.flipY = false; - this.unpackAlignment = 1; - } -} -class WebGL3DRenderTarget extends WebGLRenderTarget { - static { - __name(this, "WebGL3DRenderTarget"); - } - constructor(width = 1, height = 1, depth = 1, options = {}) { - super(width, height, options); - this.isWebGL3DRenderTarget = true; - this.depth = depth; - this.texture = new Data3DTexture(null, width, height, depth); - this.texture.isRenderTargetTexture = true; - } -} -class Quaternion { - static { - __name(this, "Quaternion"); - } - constructor(x = 0, y = 0, z = 0, w = 1) { - this.isQuaternion = true; - this._x = x; - this._y = y; - this._z = z; - this._w = w; - } - static slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t2) { - let x0 = src0[srcOffset0 + 0], y0 = src0[srcOffset0 + 1], z0 = src0[srcOffset0 + 2], w0 = src0[srcOffset0 + 3]; - const x1 = src1[srcOffset1 + 0], y1 = src1[srcOffset1 + 1], z1 = src1[srcOffset1 + 2], w1 = src1[srcOffset1 + 3]; - if (t2 === 0) { - dst[dstOffset + 0] = x0; - dst[dstOffset + 1] = y0; - dst[dstOffset + 2] = z0; - dst[dstOffset + 3] = w0; - return; - } - if (t2 === 1) { - dst[dstOffset + 0] = x1; - dst[dstOffset + 1] = y1; - dst[dstOffset + 2] = z1; - dst[dstOffset + 3] = w1; - return; - } - if (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) { - let s = 1 - t2; - const cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, dir = cos >= 0 ? 1 : -1, sqrSin = 1 - cos * cos; - if (sqrSin > Number.EPSILON) { - const sin = Math.sqrt(sqrSin), len = Math.atan2(sin, cos * dir); - s = Math.sin(s * len) / sin; - t2 = Math.sin(t2 * len) / sin; - } - const tDir = t2 * dir; - x0 = x0 * s + x1 * tDir; - y0 = y0 * s + y1 * tDir; - z0 = z0 * s + z1 * tDir; - w0 = w0 * s + w1 * tDir; - if (s === 1 - t2) { - const f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0); - x0 *= f; - y0 *= f; - z0 *= f; - w0 *= f; - } - } - dst[dstOffset] = x0; - dst[dstOffset + 1] = y0; - dst[dstOffset + 2] = z0; - dst[dstOffset + 3] = w0; - } - static multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) { - const x0 = src0[srcOffset0]; - const y0 = src0[srcOffset0 + 1]; - const z0 = src0[srcOffset0 + 2]; - const w0 = src0[srcOffset0 + 3]; - const x1 = src1[srcOffset1]; - const y1 = src1[srcOffset1 + 1]; - const z1 = src1[srcOffset1 + 2]; - const w1 = src1[srcOffset1 + 3]; - dst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1; - dst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1; - dst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1; - dst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1; - return dst; - } - get x() { - return this._x; - } - set x(value) { - this._x = value; - this._onChangeCallback(); - } - get y() { - return this._y; - } - set y(value) { - this._y = value; - this._onChangeCallback(); - } - get z() { - return this._z; - } - set z(value) { - this._z = value; - this._onChangeCallback(); - } - get w() { - return this._w; - } - set w(value) { - this._w = value; - this._onChangeCallback(); - } - set(x, y, z, w) { - this._x = x; - this._y = y; - this._z = z; - this._w = w; - this._onChangeCallback(); - return this; - } - clone() { - return new this.constructor(this._x, this._y, this._z, this._w); - } - copy(quaternion) { - this._x = quaternion.x; - this._y = quaternion.y; - this._z = quaternion.z; - this._w = quaternion.w; - this._onChangeCallback(); - return this; - } - setFromEuler(euler, update = true) { - const x = euler._x, y = euler._y, z = euler._z, order = euler._order; - const cos = Math.cos; - const sin = Math.sin; - const c1 = cos(x / 2); - const c2 = cos(y / 2); - const c3 = cos(z / 2); - const s1 = sin(x / 2); - const s2 = sin(y / 2); - const s3 = sin(z / 2); - switch (order) { - case "XYZ": - this._x = s1 * c2 * c3 + c1 * s2 * s3; - this._y = c1 * s2 * c3 - s1 * c2 * s3; - this._z = c1 * c2 * s3 + s1 * s2 * c3; - this._w = c1 * c2 * c3 - s1 * s2 * s3; - break; - case "YXZ": - this._x = s1 * c2 * c3 + c1 * s2 * s3; - this._y = c1 * s2 * c3 - s1 * c2 * s3; - this._z = c1 * c2 * s3 - s1 * s2 * c3; - this._w = c1 * c2 * c3 + s1 * s2 * s3; - break; - case "ZXY": - this._x = s1 * c2 * c3 - c1 * s2 * s3; - this._y = c1 * s2 * c3 + s1 * c2 * s3; - this._z = c1 * c2 * s3 + s1 * s2 * c3; - this._w = c1 * c2 * c3 - s1 * s2 * s3; - break; - case "ZYX": - this._x = s1 * c2 * c3 - c1 * s2 * s3; - this._y = c1 * s2 * c3 + s1 * c2 * s3; - this._z = c1 * c2 * s3 - s1 * s2 * c3; - this._w = c1 * c2 * c3 + s1 * s2 * s3; - break; - case "YZX": - this._x = s1 * c2 * c3 + c1 * s2 * s3; - this._y = c1 * s2 * c3 + s1 * c2 * s3; - this._z = c1 * c2 * s3 - s1 * s2 * c3; - this._w = c1 * c2 * c3 - s1 * s2 * s3; - break; - case "XZY": - this._x = s1 * c2 * c3 - c1 * s2 * s3; - this._y = c1 * s2 * c3 - s1 * c2 * s3; - this._z = c1 * c2 * s3 + s1 * s2 * c3; - this._w = c1 * c2 * c3 + s1 * s2 * s3; - break; - default: - console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + order); - } - if (update === true) this._onChangeCallback(); - return this; - } - setFromAxisAngle(axis, angle) { - const halfAngle = angle / 2, s = Math.sin(halfAngle); - this._x = axis.x * s; - this._y = axis.y * s; - this._z = axis.z * s; - this._w = Math.cos(halfAngle); - this._onChangeCallback(); - return this; - } - setFromRotationMatrix(m) { - const te2 = m.elements, m11 = te2[0], m12 = te2[4], m13 = te2[8], m21 = te2[1], m22 = te2[5], m23 = te2[9], m31 = te2[2], m32 = te2[6], m33 = te2[10], trace = m11 + m22 + m33; - if (trace > 0) { - const s = 0.5 / Math.sqrt(trace + 1); - this._w = 0.25 / s; - this._x = (m32 - m23) * s; - this._y = (m13 - m31) * s; - this._z = (m21 - m12) * s; - } else if (m11 > m22 && m11 > m33) { - const s = 2 * Math.sqrt(1 + m11 - m22 - m33); - this._w = (m32 - m23) / s; - this._x = 0.25 * s; - this._y = (m12 + m21) / s; - this._z = (m13 + m31) / s; - } else if (m22 > m33) { - const s = 2 * Math.sqrt(1 + m22 - m11 - m33); - this._w = (m13 - m31) / s; - this._x = (m12 + m21) / s; - this._y = 0.25 * s; - this._z = (m23 + m32) / s; - } else { - const s = 2 * Math.sqrt(1 + m33 - m11 - m22); - this._w = (m21 - m12) / s; - this._x = (m13 + m31) / s; - this._y = (m23 + m32) / s; - this._z = 0.25 * s; - } - this._onChangeCallback(); - return this; - } - setFromUnitVectors(vFrom, vTo) { - let r = vFrom.dot(vTo) + 1; - if (r < Number.EPSILON) { - r = 0; - if (Math.abs(vFrom.x) > Math.abs(vFrom.z)) { - this._x = -vFrom.y; - this._y = vFrom.x; - this._z = 0; - this._w = r; - } else { - this._x = 0; - this._y = -vFrom.z; - this._z = vFrom.y; - this._w = r; - } - } else { - this._x = vFrom.y * vTo.z - vFrom.z * vTo.y; - this._y = vFrom.z * vTo.x - vFrom.x * vTo.z; - this._z = vFrom.x * vTo.y - vFrom.y * vTo.x; - this._w = r; - } - return this.normalize(); - } - angleTo(q) { - return 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1))); - } - rotateTowards(q, step) { - const angle = this.angleTo(q); - if (angle === 0) return this; - const t2 = Math.min(1, step / angle); - this.slerp(q, t2); - return this; - } - identity() { - return this.set(0, 0, 0, 1); - } - invert() { - return this.conjugate(); - } - conjugate() { - this._x *= -1; - this._y *= -1; - this._z *= -1; - this._onChangeCallback(); - return this; - } - dot(v) { - return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w; - } - lengthSq() { - return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w; - } - length() { - return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w); - } - normalize() { - let l = this.length(); - if (l === 0) { - this._x = 0; - this._y = 0; - this._z = 0; - this._w = 1; - } else { - l = 1 / l; - this._x = this._x * l; - this._y = this._y * l; - this._z = this._z * l; - this._w = this._w * l; - } - this._onChangeCallback(); - return this; - } - multiply(q) { - return this.multiplyQuaternions(this, q); - } - premultiply(q) { - return this.multiplyQuaternions(q, this); - } - multiplyQuaternions(a, b) { - const qax = a._x, qay = a._y, qaz = a._z, qaw = a._w; - const qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w; - this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; - this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; - this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; - this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; - this._onChangeCallback(); - return this; - } - slerp(qb, t2) { - if (t2 === 0) return this; - if (t2 === 1) return this.copy(qb); - const x = this._x, y = this._y, z = this._z, w = this._w; - let cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z; - if (cosHalfTheta < 0) { - this._w = -qb._w; - this._x = -qb._x; - this._y = -qb._y; - this._z = -qb._z; - cosHalfTheta = -cosHalfTheta; - } else { - this.copy(qb); - } - if (cosHalfTheta >= 1) { - this._w = w; - this._x = x; - this._y = y; - this._z = z; - return this; - } - const sqrSinHalfTheta = 1 - cosHalfTheta * cosHalfTheta; - if (sqrSinHalfTheta <= Number.EPSILON) { - const s = 1 - t2; - this._w = s * w + t2 * this._w; - this._x = s * x + t2 * this._x; - this._y = s * y + t2 * this._y; - this._z = s * z + t2 * this._z; - this.normalize(); - return this; - } - const sinHalfTheta = Math.sqrt(sqrSinHalfTheta); - const halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta); - const ratioA = Math.sin((1 - t2) * halfTheta) / sinHalfTheta, ratioB = Math.sin(t2 * halfTheta) / sinHalfTheta; - this._w = w * ratioA + this._w * ratioB; - this._x = x * ratioA + this._x * ratioB; - this._y = y * ratioA + this._y * ratioB; - this._z = z * ratioA + this._z * ratioB; - this._onChangeCallback(); - return this; - } - slerpQuaternions(qa, qb, t2) { - return this.copy(qa).slerp(qb, t2); - } - random() { - const theta1 = 2 * Math.PI * Math.random(); - const theta2 = 2 * Math.PI * Math.random(); - const x0 = Math.random(); - const r1 = Math.sqrt(1 - x0); - const r2 = Math.sqrt(x0); - return this.set( - r1 * Math.sin(theta1), - r1 * Math.cos(theta1), - r2 * Math.sin(theta2), - r2 * Math.cos(theta2) - ); - } - equals(quaternion) { - return quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w; - } - fromArray(array, offset = 0) { - this._x = array[offset]; - this._y = array[offset + 1]; - this._z = array[offset + 2]; - this._w = array[offset + 3]; - this._onChangeCallback(); - return this; - } - toArray(array = [], offset = 0) { - array[offset] = this._x; - array[offset + 1] = this._y; - array[offset + 2] = this._z; - array[offset + 3] = this._w; - return array; - } - fromBufferAttribute(attribute, index) { - this._x = attribute.getX(index); - this._y = attribute.getY(index); - this._z = attribute.getZ(index); - this._w = attribute.getW(index); - this._onChangeCallback(); - return this; - } - toJSON() { - return this.toArray(); - } - _onChange(callback) { - this._onChangeCallback = callback; - return this; - } - _onChangeCallback() { - } - *[Symbol.iterator]() { - yield this._x; - yield this._y; - yield this._z; - yield this._w; - } -} -class Vector3 { - static { - __name(this, "Vector3"); - } - constructor(x = 0, y = 0, z = 0) { - Vector3.prototype.isVector3 = true; - this.x = x; - this.y = y; - this.z = z; - } - set(x, y, z) { - if (z === void 0) z = this.z; - this.x = x; - this.y = y; - this.z = z; - return this; - } - setScalar(scalar) { - this.x = scalar; - this.y = scalar; - this.z = scalar; - return this; - } - setX(x) { - this.x = x; - return this; - } - setY(y) { - this.y = y; - return this; - } - setZ(z) { - this.z = z; - return this; - } - setComponent(index, value) { - switch (index) { - case 0: - this.x = value; - break; - case 1: - this.y = value; - break; - case 2: - this.z = value; - break; - default: - throw new Error("index is out of range: " + index); - } - return this; - } - getComponent(index) { - switch (index) { - case 0: - return this.x; - case 1: - return this.y; - case 2: - return this.z; - default: - throw new Error("index is out of range: " + index); - } - } - clone() { - return new this.constructor(this.x, this.y, this.z); - } - copy(v) { - this.x = v.x; - this.y = v.y; - this.z = v.z; - return this; - } - add(v) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - return this; - } - addScalar(s) { - this.x += s; - this.y += s; - this.z += s; - return this; - } - addVectors(a, b) { - this.x = a.x + b.x; - this.y = a.y + b.y; - this.z = a.z + b.z; - return this; - } - addScaledVector(v, s) { - this.x += v.x * s; - this.y += v.y * s; - this.z += v.z * s; - return this; - } - sub(v) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - return this; - } - subScalar(s) { - this.x -= s; - this.y -= s; - this.z -= s; - return this; - } - subVectors(a, b) { - this.x = a.x - b.x; - this.y = a.y - b.y; - this.z = a.z - b.z; - return this; - } - multiply(v) { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z; - return this; - } - multiplyScalar(scalar) { - this.x *= scalar; - this.y *= scalar; - this.z *= scalar; - return this; - } - multiplyVectors(a, b) { - this.x = a.x * b.x; - this.y = a.y * b.y; - this.z = a.z * b.z; - return this; - } - applyEuler(euler) { - return this.applyQuaternion(_quaternion$4.setFromEuler(euler)); - } - applyAxisAngle(axis, angle) { - return this.applyQuaternion(_quaternion$4.setFromAxisAngle(axis, angle)); - } - applyMatrix3(m) { - const x = this.x, y = this.y, z = this.z; - const e = m.elements; - this.x = e[0] * x + e[3] * y + e[6] * z; - this.y = e[1] * x + e[4] * y + e[7] * z; - this.z = e[2] * x + e[5] * y + e[8] * z; - return this; - } - applyNormalMatrix(m) { - return this.applyMatrix3(m).normalize(); - } - applyMatrix4(m) { - const x = this.x, y = this.y, z = this.z; - const e = m.elements; - const w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]); - this.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * w; - this.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * w; - this.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * w; - return this; - } - applyQuaternion(q) { - const vx = this.x, vy = this.y, vz = this.z; - const qx = q.x, qy = q.y, qz = q.z, qw = q.w; - const tx = 2 * (qy * vz - qz * vy); - const ty = 2 * (qz * vx - qx * vz); - const tz = 2 * (qx * vy - qy * vx); - this.x = vx + qw * tx + qy * tz - qz * ty; - this.y = vy + qw * ty + qz * tx - qx * tz; - this.z = vz + qw * tz + qx * ty - qy * tx; - return this; - } - project(camera) { - return this.applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix); - } - unproject(camera) { - return this.applyMatrix4(camera.projectionMatrixInverse).applyMatrix4(camera.matrixWorld); - } - transformDirection(m) { - const x = this.x, y = this.y, z = this.z; - const e = m.elements; - this.x = e[0] * x + e[4] * y + e[8] * z; - this.y = e[1] * x + e[5] * y + e[9] * z; - this.z = e[2] * x + e[6] * y + e[10] * z; - return this.normalize(); - } - divide(v) { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z; - return this; - } - divideScalar(scalar) { - return this.multiplyScalar(1 / scalar); - } - min(v) { - this.x = Math.min(this.x, v.x); - this.y = Math.min(this.y, v.y); - this.z = Math.min(this.z, v.z); - return this; - } - max(v) { - this.x = Math.max(this.x, v.x); - this.y = Math.max(this.y, v.y); - this.z = Math.max(this.z, v.z); - return this; - } - clamp(min, max2) { - this.x = Math.max(min.x, Math.min(max2.x, this.x)); - this.y = Math.max(min.y, Math.min(max2.y, this.y)); - this.z = Math.max(min.z, Math.min(max2.z, this.z)); - return this; - } - clampScalar(minVal, maxVal) { - this.x = Math.max(minVal, Math.min(maxVal, this.x)); - this.y = Math.max(minVal, Math.min(maxVal, this.y)); - this.z = Math.max(minVal, Math.min(maxVal, this.z)); - return this; - } - clampLength(min, max2) { - const length = this.length(); - return this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max2, length))); - } - floor() { - this.x = Math.floor(this.x); - this.y = Math.floor(this.y); - this.z = Math.floor(this.z); - return this; - } - ceil() { - this.x = Math.ceil(this.x); - this.y = Math.ceil(this.y); - this.z = Math.ceil(this.z); - return this; - } - round() { - this.x = Math.round(this.x); - this.y = Math.round(this.y); - this.z = Math.round(this.z); - return this; - } - roundToZero() { - this.x = Math.trunc(this.x); - this.y = Math.trunc(this.y); - this.z = Math.trunc(this.z); - return this; - } - negate() { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - return this; - } - dot(v) { - return this.x * v.x + this.y * v.y + this.z * v.z; - } - // TODO lengthSquared? - lengthSq() { - return this.x * this.x + this.y * this.y + this.z * this.z; - } - length() { - return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); - } - manhattanLength() { - return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z); - } - normalize() { - return this.divideScalar(this.length() || 1); - } - setLength(length) { - return this.normalize().multiplyScalar(length); - } - lerp(v, alpha) { - this.x += (v.x - this.x) * alpha; - this.y += (v.y - this.y) * alpha; - this.z += (v.z - this.z) * alpha; - return this; - } - lerpVectors(v1, v2, alpha) { - this.x = v1.x + (v2.x - v1.x) * alpha; - this.y = v1.y + (v2.y - v1.y) * alpha; - this.z = v1.z + (v2.z - v1.z) * alpha; - return this; - } - cross(v) { - return this.crossVectors(this, v); - } - crossVectors(a, b) { - const ax = a.x, ay = a.y, az = a.z; - const bx = b.x, by = b.y, bz = b.z; - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - return this; - } - projectOnVector(v) { - const denominator = v.lengthSq(); - if (denominator === 0) return this.set(0, 0, 0); - const scalar = v.dot(this) / denominator; - return this.copy(v).multiplyScalar(scalar); - } - projectOnPlane(planeNormal) { - _vector$c.copy(this).projectOnVector(planeNormal); - return this.sub(_vector$c); - } - reflect(normal) { - return this.sub(_vector$c.copy(normal).multiplyScalar(2 * this.dot(normal))); - } - angleTo(v) { - const denominator = Math.sqrt(this.lengthSq() * v.lengthSq()); - if (denominator === 0) return Math.PI / 2; - const theta = this.dot(v) / denominator; - return Math.acos(clamp(theta, -1, 1)); - } - distanceTo(v) { - return Math.sqrt(this.distanceToSquared(v)); - } - distanceToSquared(v) { - const dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z; - return dx * dx + dy * dy + dz * dz; - } - manhattanDistanceTo(v) { - return Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z); - } - setFromSpherical(s) { - return this.setFromSphericalCoords(s.radius, s.phi, s.theta); - } - setFromSphericalCoords(radius, phi, theta) { - const sinPhiRadius = Math.sin(phi) * radius; - this.x = sinPhiRadius * Math.sin(theta); - this.y = Math.cos(phi) * radius; - this.z = sinPhiRadius * Math.cos(theta); - return this; - } - setFromCylindrical(c) { - return this.setFromCylindricalCoords(c.radius, c.theta, c.y); - } - setFromCylindricalCoords(radius, theta, y) { - this.x = radius * Math.sin(theta); - this.y = y; - this.z = radius * Math.cos(theta); - return this; - } - setFromMatrixPosition(m) { - const e = m.elements; - this.x = e[12]; - this.y = e[13]; - this.z = e[14]; - return this; - } - setFromMatrixScale(m) { - const sx = this.setFromMatrixColumn(m, 0).length(); - const sy = this.setFromMatrixColumn(m, 1).length(); - const sz = this.setFromMatrixColumn(m, 2).length(); - this.x = sx; - this.y = sy; - this.z = sz; - return this; - } - setFromMatrixColumn(m, index) { - return this.fromArray(m.elements, index * 4); - } - setFromMatrix3Column(m, index) { - return this.fromArray(m.elements, index * 3); - } - setFromEuler(e) { - this.x = e._x; - this.y = e._y; - this.z = e._z; - return this; - } - setFromColor(c) { - this.x = c.r; - this.y = c.g; - this.z = c.b; - return this; - } - equals(v) { - return v.x === this.x && v.y === this.y && v.z === this.z; - } - fromArray(array, offset = 0) { - this.x = array[offset]; - this.y = array[offset + 1]; - this.z = array[offset + 2]; - return this; - } - toArray(array = [], offset = 0) { - array[offset] = this.x; - array[offset + 1] = this.y; - array[offset + 2] = this.z; - return array; - } - fromBufferAttribute(attribute, index) { - this.x = attribute.getX(index); - this.y = attribute.getY(index); - this.z = attribute.getZ(index); - return this; - } - random() { - this.x = Math.random(); - this.y = Math.random(); - this.z = Math.random(); - return this; - } - randomDirection() { - const theta = Math.random() * Math.PI * 2; - const u = Math.random() * 2 - 1; - const c = Math.sqrt(1 - u * u); - this.x = c * Math.cos(theta); - this.y = u; - this.z = c * Math.sin(theta); - return this; - } - *[Symbol.iterator]() { - yield this.x; - yield this.y; - yield this.z; - } -} -const _vector$c = /* @__PURE__ */ new Vector3(); -const _quaternion$4 = /* @__PURE__ */ new Quaternion(); -class Box3 { - static { - __name(this, "Box3"); - } - constructor(min = new Vector3(Infinity, Infinity, Infinity), max2 = new Vector3(-Infinity, -Infinity, -Infinity)) { - this.isBox3 = true; - this.min = min; - this.max = max2; - } - set(min, max2) { - this.min.copy(min); - this.max.copy(max2); - return this; - } - setFromArray(array) { - this.makeEmpty(); - for (let i = 0, il = array.length; i < il; i += 3) { - this.expandByPoint(_vector$b.fromArray(array, i)); - } - return this; - } - setFromBufferAttribute(attribute) { - this.makeEmpty(); - for (let i = 0, il = attribute.count; i < il; i++) { - this.expandByPoint(_vector$b.fromBufferAttribute(attribute, i)); - } - return this; - } - setFromPoints(points) { - this.makeEmpty(); - for (let i = 0, il = points.length; i < il; i++) { - this.expandByPoint(points[i]); - } - return this; - } - setFromCenterAndSize(center, size) { - const halfSize = _vector$b.copy(size).multiplyScalar(0.5); - this.min.copy(center).sub(halfSize); - this.max.copy(center).add(halfSize); - return this; - } - setFromObject(object, precise = false) { - this.makeEmpty(); - return this.expandByObject(object, precise); - } - clone() { - return new this.constructor().copy(this); - } - copy(box) { - this.min.copy(box.min); - this.max.copy(box.max); - return this; - } - makeEmpty() { - this.min.x = this.min.y = this.min.z = Infinity; - this.max.x = this.max.y = this.max.z = -Infinity; - return this; - } - isEmpty() { - return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z; - } - getCenter(target) { - return this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5); - } - getSize(target) { - return this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min); - } - expandByPoint(point) { - this.min.min(point); - this.max.max(point); - return this; - } - expandByVector(vector) { - this.min.sub(vector); - this.max.add(vector); - return this; - } - expandByScalar(scalar) { - this.min.addScalar(-scalar); - this.max.addScalar(scalar); - return this; - } - expandByObject(object, precise = false) { - object.updateWorldMatrix(false, false); - const geometry = object.geometry; - if (geometry !== void 0) { - const positionAttribute = geometry.getAttribute("position"); - if (precise === true && positionAttribute !== void 0 && object.isInstancedMesh !== true) { - for (let i = 0, l = positionAttribute.count; i < l; i++) { - if (object.isMesh === true) { - object.getVertexPosition(i, _vector$b); - } else { - _vector$b.fromBufferAttribute(positionAttribute, i); - } - _vector$b.applyMatrix4(object.matrixWorld); - this.expandByPoint(_vector$b); - } - } else { - if (object.boundingBox !== void 0) { - if (object.boundingBox === null) { - object.computeBoundingBox(); - } - _box$4.copy(object.boundingBox); - } else { - if (geometry.boundingBox === null) { - geometry.computeBoundingBox(); - } - _box$4.copy(geometry.boundingBox); - } - _box$4.applyMatrix4(object.matrixWorld); - this.union(_box$4); - } - } - const children = object.children; - for (let i = 0, l = children.length; i < l; i++) { - this.expandByObject(children[i], precise); - } - return this; - } - containsPoint(point) { - return point.x >= this.min.x && point.x <= this.max.x && point.y >= this.min.y && point.y <= this.max.y && point.z >= this.min.z && point.z <= this.max.z; - } - containsBox(box) { - return this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z; - } - getParameter(point, target) { - return target.set( - (point.x - this.min.x) / (this.max.x - this.min.x), - (point.y - this.min.y) / (this.max.y - this.min.y), - (point.z - this.min.z) / (this.max.z - this.min.z) - ); - } - intersectsBox(box) { - return box.max.x >= this.min.x && box.min.x <= this.max.x && box.max.y >= this.min.y && box.min.y <= this.max.y && box.max.z >= this.min.z && box.min.z <= this.max.z; - } - intersectsSphere(sphere) { - this.clampPoint(sphere.center, _vector$b); - return _vector$b.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius; - } - intersectsPlane(plane) { - let min, max2; - if (plane.normal.x > 0) { - min = plane.normal.x * this.min.x; - max2 = plane.normal.x * this.max.x; - } else { - min = plane.normal.x * this.max.x; - max2 = plane.normal.x * this.min.x; - } - if (plane.normal.y > 0) { - min += plane.normal.y * this.min.y; - max2 += plane.normal.y * this.max.y; - } else { - min += plane.normal.y * this.max.y; - max2 += plane.normal.y * this.min.y; - } - if (plane.normal.z > 0) { - min += plane.normal.z * this.min.z; - max2 += plane.normal.z * this.max.z; - } else { - min += plane.normal.z * this.max.z; - max2 += plane.normal.z * this.min.z; - } - return min <= -plane.constant && max2 >= -plane.constant; - } - intersectsTriangle(triangle) { - if (this.isEmpty()) { - return false; - } - this.getCenter(_center); - _extents.subVectors(this.max, _center); - _v0$3.subVectors(triangle.a, _center); - _v1$7.subVectors(triangle.b, _center); - _v2$4.subVectors(triangle.c, _center); - _f0.subVectors(_v1$7, _v0$3); - _f1.subVectors(_v2$4, _v1$7); - _f2.subVectors(_v0$3, _v2$4); - let axes = [ - 0, - -_f0.z, - _f0.y, - 0, - -_f1.z, - _f1.y, - 0, - -_f2.z, - _f2.y, - _f0.z, - 0, - -_f0.x, - _f1.z, - 0, - -_f1.x, - _f2.z, - 0, - -_f2.x, - -_f0.y, - _f0.x, - 0, - -_f1.y, - _f1.x, - 0, - -_f2.y, - _f2.x, - 0 - ]; - if (!satForAxes(axes, _v0$3, _v1$7, _v2$4, _extents)) { - return false; - } - axes = [1, 0, 0, 0, 1, 0, 0, 0, 1]; - if (!satForAxes(axes, _v0$3, _v1$7, _v2$4, _extents)) { - return false; - } - _triangleNormal.crossVectors(_f0, _f1); - axes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z]; - return satForAxes(axes, _v0$3, _v1$7, _v2$4, _extents); - } - clampPoint(point, target) { - return target.copy(point).clamp(this.min, this.max); - } - distanceToPoint(point) { - return this.clampPoint(point, _vector$b).distanceTo(point); - } - getBoundingSphere(target) { - if (this.isEmpty()) { - target.makeEmpty(); - } else { - this.getCenter(target.center); - target.radius = this.getSize(_vector$b).length() * 0.5; - } - return target; - } - intersect(box) { - this.min.max(box.min); - this.max.min(box.max); - if (this.isEmpty()) this.makeEmpty(); - return this; - } - union(box) { - this.min.min(box.min); - this.max.max(box.max); - return this; - } - applyMatrix4(matrix) { - if (this.isEmpty()) return this; - _points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix); - _points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix); - _points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix); - _points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix); - _points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix); - _points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix); - _points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix); - _points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix); - this.setFromPoints(_points); - return this; - } - translate(offset) { - this.min.add(offset); - this.max.add(offset); - return this; - } - equals(box) { - return box.min.equals(this.min) && box.max.equals(this.max); - } -} -const _points = [ - /* @__PURE__ */ new Vector3(), - /* @__PURE__ */ new Vector3(), - /* @__PURE__ */ new Vector3(), - /* @__PURE__ */ new Vector3(), - /* @__PURE__ */ new Vector3(), - /* @__PURE__ */ new Vector3(), - /* @__PURE__ */ new Vector3(), - /* @__PURE__ */ new Vector3() -]; -const _vector$b = /* @__PURE__ */ new Vector3(); -const _box$4 = /* @__PURE__ */ new Box3(); -const _v0$3 = /* @__PURE__ */ new Vector3(); -const _v1$7 = /* @__PURE__ */ new Vector3(); -const _v2$4 = /* @__PURE__ */ new Vector3(); -const _f0 = /* @__PURE__ */ new Vector3(); -const _f1 = /* @__PURE__ */ new Vector3(); -const _f2 = /* @__PURE__ */ new Vector3(); -const _center = /* @__PURE__ */ new Vector3(); -const _extents = /* @__PURE__ */ new Vector3(); -const _triangleNormal = /* @__PURE__ */ new Vector3(); -const _testAxis = /* @__PURE__ */ new Vector3(); -function satForAxes(axes, v0, v1, v2, extents) { - for (let i = 0, j = axes.length - 3; i <= j; i += 3) { - _testAxis.fromArray(axes, i); - const r = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z); - const p0 = v0.dot(_testAxis); - const p1 = v1.dot(_testAxis); - const p2 = v2.dot(_testAxis); - if (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r) { - return false; - } - } - return true; -} -__name(satForAxes, "satForAxes"); -const _box$3 = /* @__PURE__ */ new Box3(); -const _v1$6 = /* @__PURE__ */ new Vector3(); -const _v2$3 = /* @__PURE__ */ new Vector3(); -class Sphere { - static { - __name(this, "Sphere"); - } - constructor(center = new Vector3(), radius = -1) { - this.isSphere = true; - this.center = center; - this.radius = radius; - } - set(center, radius) { - this.center.copy(center); - this.radius = radius; - return this; - } - setFromPoints(points, optionalCenter) { - const center = this.center; - if (optionalCenter !== void 0) { - center.copy(optionalCenter); - } else { - _box$3.setFromPoints(points).getCenter(center); - } - let maxRadiusSq = 0; - for (let i = 0, il = points.length; i < il; i++) { - maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i])); - } - this.radius = Math.sqrt(maxRadiusSq); - return this; - } - copy(sphere) { - this.center.copy(sphere.center); - this.radius = sphere.radius; - return this; - } - isEmpty() { - return this.radius < 0; - } - makeEmpty() { - this.center.set(0, 0, 0); - this.radius = -1; - return this; - } - containsPoint(point) { - return point.distanceToSquared(this.center) <= this.radius * this.radius; - } - distanceToPoint(point) { - return point.distanceTo(this.center) - this.radius; - } - intersectsSphere(sphere) { - const radiusSum = this.radius + sphere.radius; - return sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum; - } - intersectsBox(box) { - return box.intersectsSphere(this); - } - intersectsPlane(plane) { - return Math.abs(plane.distanceToPoint(this.center)) <= this.radius; - } - clampPoint(point, target) { - const deltaLengthSq = this.center.distanceToSquared(point); - target.copy(point); - if (deltaLengthSq > this.radius * this.radius) { - target.sub(this.center).normalize(); - target.multiplyScalar(this.radius).add(this.center); - } - return target; - } - getBoundingBox(target) { - if (this.isEmpty()) { - target.makeEmpty(); - return target; - } - target.set(this.center, this.center); - target.expandByScalar(this.radius); - return target; - } - applyMatrix4(matrix) { - this.center.applyMatrix4(matrix); - this.radius = this.radius * matrix.getMaxScaleOnAxis(); - return this; - } - translate(offset) { - this.center.add(offset); - return this; - } - expandByPoint(point) { - if (this.isEmpty()) { - this.center.copy(point); - this.radius = 0; - return this; - } - _v1$6.subVectors(point, this.center); - const lengthSq = _v1$6.lengthSq(); - if (lengthSq > this.radius * this.radius) { - const length = Math.sqrt(lengthSq); - const delta = (length - this.radius) * 0.5; - this.center.addScaledVector(_v1$6, delta / length); - this.radius += delta; - } - return this; - } - union(sphere) { - if (sphere.isEmpty()) { - return this; - } - if (this.isEmpty()) { - this.copy(sphere); - return this; - } - if (this.center.equals(sphere.center) === true) { - this.radius = Math.max(this.radius, sphere.radius); - } else { - _v2$3.subVectors(sphere.center, this.center).setLength(sphere.radius); - this.expandByPoint(_v1$6.copy(sphere.center).add(_v2$3)); - this.expandByPoint(_v1$6.copy(sphere.center).sub(_v2$3)); - } - return this; - } - equals(sphere) { - return sphere.center.equals(this.center) && sphere.radius === this.radius; - } - clone() { - return new this.constructor().copy(this); - } -} -const _vector$a = /* @__PURE__ */ new Vector3(); -const _segCenter = /* @__PURE__ */ new Vector3(); -const _segDir = /* @__PURE__ */ new Vector3(); -const _diff = /* @__PURE__ */ new Vector3(); -const _edge1 = /* @__PURE__ */ new Vector3(); -const _edge2 = /* @__PURE__ */ new Vector3(); -const _normal$1 = /* @__PURE__ */ new Vector3(); -class Ray { - static { - __name(this, "Ray"); - } - constructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) { - this.origin = origin; - this.direction = direction; - } - set(origin, direction) { - this.origin.copy(origin); - this.direction.copy(direction); - return this; - } - copy(ray) { - this.origin.copy(ray.origin); - this.direction.copy(ray.direction); - return this; - } - at(t2, target) { - return target.copy(this.origin).addScaledVector(this.direction, t2); - } - lookAt(v) { - this.direction.copy(v).sub(this.origin).normalize(); - return this; - } - recast(t2) { - this.origin.copy(this.at(t2, _vector$a)); - return this; - } - closestPointToPoint(point, target) { - target.subVectors(point, this.origin); - const directionDistance = target.dot(this.direction); - if (directionDistance < 0) { - return target.copy(this.origin); - } - return target.copy(this.origin).addScaledVector(this.direction, directionDistance); - } - distanceToPoint(point) { - return Math.sqrt(this.distanceSqToPoint(point)); - } - distanceSqToPoint(point) { - const directionDistance = _vector$a.subVectors(point, this.origin).dot(this.direction); - if (directionDistance < 0) { - return this.origin.distanceToSquared(point); - } - _vector$a.copy(this.origin).addScaledVector(this.direction, directionDistance); - return _vector$a.distanceToSquared(point); - } - distanceSqToSegment(v0, v1, optionalPointOnRay, optionalPointOnSegment) { - _segCenter.copy(v0).add(v1).multiplyScalar(0.5); - _segDir.copy(v1).sub(v0).normalize(); - _diff.copy(this.origin).sub(_segCenter); - const segExtent = v0.distanceTo(v1) * 0.5; - const a01 = -this.direction.dot(_segDir); - const b0 = _diff.dot(this.direction); - const b1 = -_diff.dot(_segDir); - const c = _diff.lengthSq(); - const det = Math.abs(1 - a01 * a01); - let s0, s1, sqrDist, extDet; - if (det > 0) { - s0 = a01 * b1 - b0; - s1 = a01 * b0 - b1; - extDet = segExtent * det; - if (s0 >= 0) { - if (s1 >= -extDet) { - if (s1 <= extDet) { - const invDet = 1 / det; - s0 *= invDet; - s1 *= invDet; - sqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c; - } else { - s1 = segExtent; - s0 = Math.max(0, -(a01 * s1 + b0)); - sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c; - } - } else { - s1 = -segExtent; - s0 = Math.max(0, -(a01 * s1 + b0)); - sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c; - } - } else { - if (s1 <= -extDet) { - s0 = Math.max(0, -(-a01 * segExtent + b0)); - s1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent); - sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c; - } else if (s1 <= extDet) { - s0 = 0; - s1 = Math.min(Math.max(-segExtent, -b1), segExtent); - sqrDist = s1 * (s1 + 2 * b1) + c; - } else { - s0 = Math.max(0, -(a01 * segExtent + b0)); - s1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent); - sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c; - } - } - } else { - s1 = a01 > 0 ? -segExtent : segExtent; - s0 = Math.max(0, -(a01 * s1 + b0)); - sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c; - } - if (optionalPointOnRay) { - optionalPointOnRay.copy(this.origin).addScaledVector(this.direction, s0); - } - if (optionalPointOnSegment) { - optionalPointOnSegment.copy(_segCenter).addScaledVector(_segDir, s1); - } - return sqrDist; - } - intersectSphere(sphere, target) { - _vector$a.subVectors(sphere.center, this.origin); - const tca = _vector$a.dot(this.direction); - const d2 = _vector$a.dot(_vector$a) - tca * tca; - const radius2 = sphere.radius * sphere.radius; - if (d2 > radius2) return null; - const thc = Math.sqrt(radius2 - d2); - const t0 = tca - thc; - const t1 = tca + thc; - if (t1 < 0) return null; - if (t0 < 0) return this.at(t1, target); - return this.at(t0, target); - } - intersectsSphere(sphere) { - return this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius; - } - distanceToPlane(plane) { - const denominator = plane.normal.dot(this.direction); - if (denominator === 0) { - if (plane.distanceToPoint(this.origin) === 0) { - return 0; - } - return null; - } - const t2 = -(this.origin.dot(plane.normal) + plane.constant) / denominator; - return t2 >= 0 ? t2 : null; - } - intersectPlane(plane, target) { - const t2 = this.distanceToPlane(plane); - if (t2 === null) { - return null; - } - return this.at(t2, target); - } - intersectsPlane(plane) { - const distToPoint = plane.distanceToPoint(this.origin); - if (distToPoint === 0) { - return true; - } - const denominator = plane.normal.dot(this.direction); - if (denominator * distToPoint < 0) { - return true; - } - return false; - } - intersectBox(box, target) { - let tmin, tmax, tymin, tymax, tzmin, tzmax; - const invdirx = 1 / this.direction.x, invdiry = 1 / this.direction.y, invdirz = 1 / this.direction.z; - const origin = this.origin; - if (invdirx >= 0) { - tmin = (box.min.x - origin.x) * invdirx; - tmax = (box.max.x - origin.x) * invdirx; - } else { - tmin = (box.max.x - origin.x) * invdirx; - tmax = (box.min.x - origin.x) * invdirx; - } - if (invdiry >= 0) { - tymin = (box.min.y - origin.y) * invdiry; - tymax = (box.max.y - origin.y) * invdiry; - } else { - tymin = (box.max.y - origin.y) * invdiry; - tymax = (box.min.y - origin.y) * invdiry; - } - if (tmin > tymax || tymin > tmax) return null; - if (tymin > tmin || isNaN(tmin)) tmin = tymin; - if (tymax < tmax || isNaN(tmax)) tmax = tymax; - if (invdirz >= 0) { - tzmin = (box.min.z - origin.z) * invdirz; - tzmax = (box.max.z - origin.z) * invdirz; - } else { - tzmin = (box.max.z - origin.z) * invdirz; - tzmax = (box.min.z - origin.z) * invdirz; - } - if (tmin > tzmax || tzmin > tmax) return null; - if (tzmin > tmin || tmin !== tmin) tmin = tzmin; - if (tzmax < tmax || tmax !== tmax) tmax = tzmax; - if (tmax < 0) return null; - return this.at(tmin >= 0 ? tmin : tmax, target); - } - intersectsBox(box) { - return this.intersectBox(box, _vector$a) !== null; - } - intersectTriangle(a, b, c, backfaceCulling, target) { - _edge1.subVectors(b, a); - _edge2.subVectors(c, a); - _normal$1.crossVectors(_edge1, _edge2); - let DdN = this.direction.dot(_normal$1); - let sign2; - if (DdN > 0) { - if (backfaceCulling) return null; - sign2 = 1; - } else if (DdN < 0) { - sign2 = -1; - DdN = -DdN; - } else { - return null; - } - _diff.subVectors(this.origin, a); - const DdQxE2 = sign2 * this.direction.dot(_edge2.crossVectors(_diff, _edge2)); - if (DdQxE2 < 0) { - return null; - } - const DdE1xQ = sign2 * this.direction.dot(_edge1.cross(_diff)); - if (DdE1xQ < 0) { - return null; - } - if (DdQxE2 + DdE1xQ > DdN) { - return null; - } - const QdN = -sign2 * _diff.dot(_normal$1); - if (QdN < 0) { - return null; - } - return this.at(QdN / DdN, target); - } - applyMatrix4(matrix4) { - this.origin.applyMatrix4(matrix4); - this.direction.transformDirection(matrix4); - return this; - } - equals(ray) { - return ray.origin.equals(this.origin) && ray.direction.equals(this.direction); - } - clone() { - return new this.constructor().copy(this); - } -} -class Matrix4 { - static { - __name(this, "Matrix4"); - } - constructor(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) { - Matrix4.prototype.isMatrix4 = true; - this.elements = [ - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1 - ]; - if (n11 !== void 0) { - this.set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44); - } - } - set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) { - const te2 = this.elements; - te2[0] = n11; - te2[4] = n12; - te2[8] = n13; - te2[12] = n14; - te2[1] = n21; - te2[5] = n22; - te2[9] = n23; - te2[13] = n24; - te2[2] = n31; - te2[6] = n32; - te2[10] = n33; - te2[14] = n34; - te2[3] = n41; - te2[7] = n42; - te2[11] = n43; - te2[15] = n44; - return this; - } - identity() { - this.set( - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1 - ); - return this; - } - clone() { - return new Matrix4().fromArray(this.elements); - } - copy(m) { - const te2 = this.elements; - const me = m.elements; - te2[0] = me[0]; - te2[1] = me[1]; - te2[2] = me[2]; - te2[3] = me[3]; - te2[4] = me[4]; - te2[5] = me[5]; - te2[6] = me[6]; - te2[7] = me[7]; - te2[8] = me[8]; - te2[9] = me[9]; - te2[10] = me[10]; - te2[11] = me[11]; - te2[12] = me[12]; - te2[13] = me[13]; - te2[14] = me[14]; - te2[15] = me[15]; - return this; - } - copyPosition(m) { - const te2 = this.elements, me = m.elements; - te2[12] = me[12]; - te2[13] = me[13]; - te2[14] = me[14]; - return this; - } - setFromMatrix3(m) { - const me = m.elements; - this.set( - me[0], - me[3], - me[6], - 0, - me[1], - me[4], - me[7], - 0, - me[2], - me[5], - me[8], - 0, - 0, - 0, - 0, - 1 - ); - return this; - } - extractBasis(xAxis, yAxis, zAxis) { - xAxis.setFromMatrixColumn(this, 0); - yAxis.setFromMatrixColumn(this, 1); - zAxis.setFromMatrixColumn(this, 2); - return this; - } - makeBasis(xAxis, yAxis, zAxis) { - this.set( - xAxis.x, - yAxis.x, - zAxis.x, - 0, - xAxis.y, - yAxis.y, - zAxis.y, - 0, - xAxis.z, - yAxis.z, - zAxis.z, - 0, - 0, - 0, - 0, - 1 - ); - return this; - } - extractRotation(m) { - const te2 = this.elements; - const me = m.elements; - const scaleX = 1 / _v1$5.setFromMatrixColumn(m, 0).length(); - const scaleY = 1 / _v1$5.setFromMatrixColumn(m, 1).length(); - const scaleZ = 1 / _v1$5.setFromMatrixColumn(m, 2).length(); - te2[0] = me[0] * scaleX; - te2[1] = me[1] * scaleX; - te2[2] = me[2] * scaleX; - te2[3] = 0; - te2[4] = me[4] * scaleY; - te2[5] = me[5] * scaleY; - te2[6] = me[6] * scaleY; - te2[7] = 0; - te2[8] = me[8] * scaleZ; - te2[9] = me[9] * scaleZ; - te2[10] = me[10] * scaleZ; - te2[11] = 0; - te2[12] = 0; - te2[13] = 0; - te2[14] = 0; - te2[15] = 1; - return this; - } - makeRotationFromEuler(euler) { - const te2 = this.elements; - const x = euler.x, y = euler.y, z = euler.z; - const a = Math.cos(x), b = Math.sin(x); - const c = Math.cos(y), d = Math.sin(y); - const e = Math.cos(z), f = Math.sin(z); - if (euler.order === "XYZ") { - const ae = a * e, af = a * f, be = b * e, bf = b * f; - te2[0] = c * e; - te2[4] = -c * f; - te2[8] = d; - te2[1] = af + be * d; - te2[5] = ae - bf * d; - te2[9] = -b * c; - te2[2] = bf - ae * d; - te2[6] = be + af * d; - te2[10] = a * c; - } else if (euler.order === "YXZ") { - const ce = c * e, cf = c * f, de = d * e, df = d * f; - te2[0] = ce + df * b; - te2[4] = de * b - cf; - te2[8] = a * d; - te2[1] = a * f; - te2[5] = a * e; - te2[9] = -b; - te2[2] = cf * b - de; - te2[6] = df + ce * b; - te2[10] = a * c; - } else if (euler.order === "ZXY") { - const ce = c * e, cf = c * f, de = d * e, df = d * f; - te2[0] = ce - df * b; - te2[4] = -a * f; - te2[8] = de + cf * b; - te2[1] = cf + de * b; - te2[5] = a * e; - te2[9] = df - ce * b; - te2[2] = -a * d; - te2[6] = b; - te2[10] = a * c; - } else if (euler.order === "ZYX") { - const ae = a * e, af = a * f, be = b * e, bf = b * f; - te2[0] = c * e; - te2[4] = be * d - af; - te2[8] = ae * d + bf; - te2[1] = c * f; - te2[5] = bf * d + ae; - te2[9] = af * d - be; - te2[2] = -d; - te2[6] = b * c; - te2[10] = a * c; - } else if (euler.order === "YZX") { - const ac = a * c, ad = a * d, bc = b * c, bd = b * d; - te2[0] = c * e; - te2[4] = bd - ac * f; - te2[8] = bc * f + ad; - te2[1] = f; - te2[5] = a * e; - te2[9] = -b * e; - te2[2] = -d * e; - te2[6] = ad * f + bc; - te2[10] = ac - bd * f; - } else if (euler.order === "XZY") { - const ac = a * c, ad = a * d, bc = b * c, bd = b * d; - te2[0] = c * e; - te2[4] = -f; - te2[8] = d * e; - te2[1] = ac * f + bd; - te2[5] = a * e; - te2[9] = ad * f - bc; - te2[2] = bc * f - ad; - te2[6] = b * e; - te2[10] = bd * f + ac; - } - te2[3] = 0; - te2[7] = 0; - te2[11] = 0; - te2[12] = 0; - te2[13] = 0; - te2[14] = 0; - te2[15] = 1; - return this; - } - makeRotationFromQuaternion(q) { - return this.compose(_zero, q, _one); - } - lookAt(eye, target, up) { - const te2 = this.elements; - _z.subVectors(eye, target); - if (_z.lengthSq() === 0) { - _z.z = 1; - } - _z.normalize(); - _x.crossVectors(up, _z); - if (_x.lengthSq() === 0) { - if (Math.abs(up.z) === 1) { - _z.x += 1e-4; - } else { - _z.z += 1e-4; - } - _z.normalize(); - _x.crossVectors(up, _z); - } - _x.normalize(); - _y.crossVectors(_z, _x); - te2[0] = _x.x; - te2[4] = _y.x; - te2[8] = _z.x; - te2[1] = _x.y; - te2[5] = _y.y; - te2[9] = _z.y; - te2[2] = _x.z; - te2[6] = _y.z; - te2[10] = _z.z; - return this; - } - multiply(m) { - return this.multiplyMatrices(this, m); - } - premultiply(m) { - return this.multiplyMatrices(m, this); - } - multiplyMatrices(a, b) { - const ae = a.elements; - const be = b.elements; - const te2 = this.elements; - const a11 = ae[0], a12 = ae[4], a13 = ae[8], a14 = ae[12]; - const a21 = ae[1], a22 = ae[5], a23 = ae[9], a24 = ae[13]; - const a31 = ae[2], a32 = ae[6], a33 = ae[10], a34 = ae[14]; - const a41 = ae[3], a42 = ae[7], a43 = ae[11], a44 = ae[15]; - const b11 = be[0], b12 = be[4], b13 = be[8], b14 = be[12]; - const b21 = be[1], b22 = be[5], b23 = be[9], b24 = be[13]; - const b31 = be[2], b32 = be[6], b33 = be[10], b34 = be[14]; - const b41 = be[3], b42 = be[7], b43 = be[11], b44 = be[15]; - te2[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; - te2[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; - te2[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; - te2[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; - te2[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; - te2[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; - te2[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; - te2[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; - te2[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; - te2[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; - te2[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; - te2[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; - te2[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; - te2[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; - te2[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; - te2[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; - return this; - } - multiplyScalar(s) { - const te2 = this.elements; - te2[0] *= s; - te2[4] *= s; - te2[8] *= s; - te2[12] *= s; - te2[1] *= s; - te2[5] *= s; - te2[9] *= s; - te2[13] *= s; - te2[2] *= s; - te2[6] *= s; - te2[10] *= s; - te2[14] *= s; - te2[3] *= s; - te2[7] *= s; - te2[11] *= s; - te2[15] *= s; - return this; - } - determinant() { - const te2 = this.elements; - const n11 = te2[0], n12 = te2[4], n13 = te2[8], n14 = te2[12]; - const n21 = te2[1], n22 = te2[5], n23 = te2[9], n24 = te2[13]; - const n31 = te2[2], n32 = te2[6], n33 = te2[10], n34 = te2[14]; - const n41 = te2[3], n42 = te2[7], n43 = te2[11], n44 = te2[15]; - return n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31); - } - transpose() { - const te2 = this.elements; - let tmp2; - tmp2 = te2[1]; - te2[1] = te2[4]; - te2[4] = tmp2; - tmp2 = te2[2]; - te2[2] = te2[8]; - te2[8] = tmp2; - tmp2 = te2[6]; - te2[6] = te2[9]; - te2[9] = tmp2; - tmp2 = te2[3]; - te2[3] = te2[12]; - te2[12] = tmp2; - tmp2 = te2[7]; - te2[7] = te2[13]; - te2[13] = tmp2; - tmp2 = te2[11]; - te2[11] = te2[14]; - te2[14] = tmp2; - return this; - } - setPosition(x, y, z) { - const te2 = this.elements; - if (x.isVector3) { - te2[12] = x.x; - te2[13] = x.y; - te2[14] = x.z; - } else { - te2[12] = x; - te2[13] = y; - te2[14] = z; - } - return this; - } - invert() { - const te2 = this.elements, n11 = te2[0], n21 = te2[1], n31 = te2[2], n41 = te2[3], n12 = te2[4], n22 = te2[5], n32 = te2[6], n42 = te2[7], n13 = te2[8], n23 = te2[9], n33 = te2[10], n43 = te2[11], n14 = te2[12], n24 = te2[13], n34 = te2[14], n44 = te2[15], t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; - const det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14; - if (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - const detInv = 1 / det; - te2[0] = t11 * detInv; - te2[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv; - te2[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv; - te2[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv; - te2[4] = t12 * detInv; - te2[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv; - te2[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv; - te2[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv; - te2[8] = t13 * detInv; - te2[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv; - te2[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv; - te2[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv; - te2[12] = t14 * detInv; - te2[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv; - te2[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv; - te2[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv; - return this; - } - scale(v) { - const te2 = this.elements; - const x = v.x, y = v.y, z = v.z; - te2[0] *= x; - te2[4] *= y; - te2[8] *= z; - te2[1] *= x; - te2[5] *= y; - te2[9] *= z; - te2[2] *= x; - te2[6] *= y; - te2[10] *= z; - te2[3] *= x; - te2[7] *= y; - te2[11] *= z; - return this; - } - getMaxScaleOnAxis() { - const te2 = this.elements; - const scaleXSq = te2[0] * te2[0] + te2[1] * te2[1] + te2[2] * te2[2]; - const scaleYSq = te2[4] * te2[4] + te2[5] * te2[5] + te2[6] * te2[6]; - const scaleZSq = te2[8] * te2[8] + te2[9] * te2[9] + te2[10] * te2[10]; - return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); - } - makeTranslation(x, y, z) { - if (x.isVector3) { - this.set( - 1, - 0, - 0, - x.x, - 0, - 1, - 0, - x.y, - 0, - 0, - 1, - x.z, - 0, - 0, - 0, - 1 - ); - } else { - this.set( - 1, - 0, - 0, - x, - 0, - 1, - 0, - y, - 0, - 0, - 1, - z, - 0, - 0, - 0, - 1 - ); - } - return this; - } - makeRotationX(theta) { - const c = Math.cos(theta), s = Math.sin(theta); - this.set( - 1, - 0, - 0, - 0, - 0, - c, - -s, - 0, - 0, - s, - c, - 0, - 0, - 0, - 0, - 1 - ); - return this; - } - makeRotationY(theta) { - const c = Math.cos(theta), s = Math.sin(theta); - this.set( - c, - 0, - s, - 0, - 0, - 1, - 0, - 0, - -s, - 0, - c, - 0, - 0, - 0, - 0, - 1 - ); - return this; - } - makeRotationZ(theta) { - const c = Math.cos(theta), s = Math.sin(theta); - this.set( - c, - -s, - 0, - 0, - s, - c, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1 - ); - return this; - } - makeRotationAxis(axis, angle) { - const c = Math.cos(angle); - const s = Math.sin(angle); - const t2 = 1 - c; - const x = axis.x, y = axis.y, z = axis.z; - const tx = t2 * x, ty = t2 * y; - this.set( - tx * x + c, - tx * y - s * z, - tx * z + s * y, - 0, - tx * y + s * z, - ty * y + c, - ty * z - s * x, - 0, - tx * z - s * y, - ty * z + s * x, - t2 * z * z + c, - 0, - 0, - 0, - 0, - 1 - ); - return this; - } - makeScale(x, y, z) { - this.set( - x, - 0, - 0, - 0, - 0, - y, - 0, - 0, - 0, - 0, - z, - 0, - 0, - 0, - 0, - 1 - ); - return this; - } - makeShear(xy, xz, yx, yz, zx, zy) { - this.set( - 1, - yx, - zx, - 0, - xy, - 1, - zy, - 0, - xz, - yz, - 1, - 0, - 0, - 0, - 0, - 1 - ); - return this; - } - compose(position, quaternion, scale) { - const te2 = this.elements; - const x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w; - const x2 = x + x, y2 = y + y, z2 = z + z; - const xx = x * x2, xy = x * y2, xz = x * z2; - const yy = y * y2, yz = y * z2, zz = z * z2; - const wx = w * x2, wy = w * y2, wz = w * z2; - const sx = scale.x, sy = scale.y, sz = scale.z; - te2[0] = (1 - (yy + zz)) * sx; - te2[1] = (xy + wz) * sx; - te2[2] = (xz - wy) * sx; - te2[3] = 0; - te2[4] = (xy - wz) * sy; - te2[5] = (1 - (xx + zz)) * sy; - te2[6] = (yz + wx) * sy; - te2[7] = 0; - te2[8] = (xz + wy) * sz; - te2[9] = (yz - wx) * sz; - te2[10] = (1 - (xx + yy)) * sz; - te2[11] = 0; - te2[12] = position.x; - te2[13] = position.y; - te2[14] = position.z; - te2[15] = 1; - return this; - } - decompose(position, quaternion, scale) { - const te2 = this.elements; - let sx = _v1$5.set(te2[0], te2[1], te2[2]).length(); - const sy = _v1$5.set(te2[4], te2[5], te2[6]).length(); - const sz = _v1$5.set(te2[8], te2[9], te2[10]).length(); - const det = this.determinant(); - if (det < 0) sx = -sx; - position.x = te2[12]; - position.y = te2[13]; - position.z = te2[14]; - _m1$4.copy(this); - const invSX = 1 / sx; - const invSY = 1 / sy; - const invSZ = 1 / sz; - _m1$4.elements[0] *= invSX; - _m1$4.elements[1] *= invSX; - _m1$4.elements[2] *= invSX; - _m1$4.elements[4] *= invSY; - _m1$4.elements[5] *= invSY; - _m1$4.elements[6] *= invSY; - _m1$4.elements[8] *= invSZ; - _m1$4.elements[9] *= invSZ; - _m1$4.elements[10] *= invSZ; - quaternion.setFromRotationMatrix(_m1$4); - scale.x = sx; - scale.y = sy; - scale.z = sz; - return this; - } - makePerspective(left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem) { - const te2 = this.elements; - const x = 2 * near / (right - left); - const y = 2 * near / (top - bottom); - const a = (right + left) / (right - left); - const b = (top + bottom) / (top - bottom); - let c, d; - if (coordinateSystem === WebGLCoordinateSystem) { - c = -(far + near) / (far - near); - d = -2 * far * near / (far - near); - } else if (coordinateSystem === WebGPUCoordinateSystem) { - c = -far / (far - near); - d = -far * near / (far - near); - } else { - throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + coordinateSystem); - } - te2[0] = x; - te2[4] = 0; - te2[8] = a; - te2[12] = 0; - te2[1] = 0; - te2[5] = y; - te2[9] = b; - te2[13] = 0; - te2[2] = 0; - te2[6] = 0; - te2[10] = c; - te2[14] = d; - te2[3] = 0; - te2[7] = 0; - te2[11] = -1; - te2[15] = 0; - return this; - } - makeOrthographic(left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem) { - const te2 = this.elements; - const w = 1 / (right - left); - const h = 1 / (top - bottom); - const p = 1 / (far - near); - const x = (right + left) * w; - const y = (top + bottom) * h; - let z, zInv; - if (coordinateSystem === WebGLCoordinateSystem) { - z = (far + near) * p; - zInv = -2 * p; - } else if (coordinateSystem === WebGPUCoordinateSystem) { - z = near * p; - zInv = -1 * p; - } else { - throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + coordinateSystem); - } - te2[0] = 2 * w; - te2[4] = 0; - te2[8] = 0; - te2[12] = -x; - te2[1] = 0; - te2[5] = 2 * h; - te2[9] = 0; - te2[13] = -y; - te2[2] = 0; - te2[6] = 0; - te2[10] = zInv; - te2[14] = -z; - te2[3] = 0; - te2[7] = 0; - te2[11] = 0; - te2[15] = 1; - return this; - } - equals(matrix) { - const te2 = this.elements; - const me = matrix.elements; - for (let i = 0; i < 16; i++) { - if (te2[i] !== me[i]) return false; - } - return true; - } - fromArray(array, offset = 0) { - for (let i = 0; i < 16; i++) { - this.elements[i] = array[i + offset]; - } - return this; - } - toArray(array = [], offset = 0) { - const te2 = this.elements; - array[offset] = te2[0]; - array[offset + 1] = te2[1]; - array[offset + 2] = te2[2]; - array[offset + 3] = te2[3]; - array[offset + 4] = te2[4]; - array[offset + 5] = te2[5]; - array[offset + 6] = te2[6]; - array[offset + 7] = te2[7]; - array[offset + 8] = te2[8]; - array[offset + 9] = te2[9]; - array[offset + 10] = te2[10]; - array[offset + 11] = te2[11]; - array[offset + 12] = te2[12]; - array[offset + 13] = te2[13]; - array[offset + 14] = te2[14]; - array[offset + 15] = te2[15]; - return array; - } -} -const _v1$5 = /* @__PURE__ */ new Vector3(); -const _m1$4 = /* @__PURE__ */ new Matrix4(); -const _zero = /* @__PURE__ */ new Vector3(0, 0, 0); -const _one = /* @__PURE__ */ new Vector3(1, 1, 1); -const _x = /* @__PURE__ */ new Vector3(); -const _y = /* @__PURE__ */ new Vector3(); -const _z = /* @__PURE__ */ new Vector3(); -const _matrix$2 = /* @__PURE__ */ new Matrix4(); -const _quaternion$3 = /* @__PURE__ */ new Quaternion(); -class Euler { - static { - __name(this, "Euler"); - } - constructor(x = 0, y = 0, z = 0, order = Euler.DEFAULT_ORDER) { - this.isEuler = true; - this._x = x; - this._y = y; - this._z = z; - this._order = order; - } - get x() { - return this._x; - } - set x(value) { - this._x = value; - this._onChangeCallback(); - } - get y() { - return this._y; - } - set y(value) { - this._y = value; - this._onChangeCallback(); - } - get z() { - return this._z; - } - set z(value) { - this._z = value; - this._onChangeCallback(); - } - get order() { - return this._order; - } - set order(value) { - this._order = value; - this._onChangeCallback(); - } - set(x, y, z, order = this._order) { - this._x = x; - this._y = y; - this._z = z; - this._order = order; - this._onChangeCallback(); - return this; - } - clone() { - return new this.constructor(this._x, this._y, this._z, this._order); - } - copy(euler) { - this._x = euler._x; - this._y = euler._y; - this._z = euler._z; - this._order = euler._order; - this._onChangeCallback(); - return this; - } - setFromRotationMatrix(m, order = this._order, update = true) { - const te2 = m.elements; - const m11 = te2[0], m12 = te2[4], m13 = te2[8]; - const m21 = te2[1], m22 = te2[5], m23 = te2[9]; - const m31 = te2[2], m32 = te2[6], m33 = te2[10]; - switch (order) { - case "XYZ": - this._y = Math.asin(clamp(m13, -1, 1)); - if (Math.abs(m13) < 0.9999999) { - this._x = Math.atan2(-m23, m33); - this._z = Math.atan2(-m12, m11); - } else { - this._x = Math.atan2(m32, m22); - this._z = 0; - } - break; - case "YXZ": - this._x = Math.asin(-clamp(m23, -1, 1)); - if (Math.abs(m23) < 0.9999999) { - this._y = Math.atan2(m13, m33); - this._z = Math.atan2(m21, m22); - } else { - this._y = Math.atan2(-m31, m11); - this._z = 0; - } - break; - case "ZXY": - this._x = Math.asin(clamp(m32, -1, 1)); - if (Math.abs(m32) < 0.9999999) { - this._y = Math.atan2(-m31, m33); - this._z = Math.atan2(-m12, m22); - } else { - this._y = 0; - this._z = Math.atan2(m21, m11); - } - break; - case "ZYX": - this._y = Math.asin(-clamp(m31, -1, 1)); - if (Math.abs(m31) < 0.9999999) { - this._x = Math.atan2(m32, m33); - this._z = Math.atan2(m21, m11); - } else { - this._x = 0; - this._z = Math.atan2(-m12, m22); - } - break; - case "YZX": - this._z = Math.asin(clamp(m21, -1, 1)); - if (Math.abs(m21) < 0.9999999) { - this._x = Math.atan2(-m23, m22); - this._y = Math.atan2(-m31, m11); - } else { - this._x = 0; - this._y = Math.atan2(m13, m33); - } - break; - case "XZY": - this._z = Math.asin(-clamp(m12, -1, 1)); - if (Math.abs(m12) < 0.9999999) { - this._x = Math.atan2(m32, m22); - this._y = Math.atan2(m13, m11); - } else { - this._x = Math.atan2(-m23, m33); - this._y = 0; - } - break; - default: - console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + order); - } - this._order = order; - if (update === true) this._onChangeCallback(); - return this; - } - setFromQuaternion(q, order, update) { - _matrix$2.makeRotationFromQuaternion(q); - return this.setFromRotationMatrix(_matrix$2, order, update); - } - setFromVector3(v, order = this._order) { - return this.set(v.x, v.y, v.z, order); - } - reorder(newOrder) { - _quaternion$3.setFromEuler(this); - return this.setFromQuaternion(_quaternion$3, newOrder); - } - equals(euler) { - return euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order; - } - fromArray(array) { - this._x = array[0]; - this._y = array[1]; - this._z = array[2]; - if (array[3] !== void 0) this._order = array[3]; - this._onChangeCallback(); - return this; - } - toArray(array = [], offset = 0) { - array[offset] = this._x; - array[offset + 1] = this._y; - array[offset + 2] = this._z; - array[offset + 3] = this._order; - return array; - } - _onChange(callback) { - this._onChangeCallback = callback; - return this; - } - _onChangeCallback() { - } - *[Symbol.iterator]() { - yield this._x; - yield this._y; - yield this._z; - yield this._order; - } -} -Euler.DEFAULT_ORDER = "XYZ"; -class Layers { - static { - __name(this, "Layers"); - } - constructor() { - this.mask = 1 | 0; - } - set(channel) { - this.mask = (1 << channel | 0) >>> 0; - } - enable(channel) { - this.mask |= 1 << channel | 0; - } - enableAll() { - this.mask = 4294967295 | 0; - } - toggle(channel) { - this.mask ^= 1 << channel | 0; - } - disable(channel) { - this.mask &= ~(1 << channel | 0); - } - disableAll() { - this.mask = 0; - } - test(layers) { - return (this.mask & layers.mask) !== 0; - } - isEnabled(channel) { - return (this.mask & (1 << channel | 0)) !== 0; - } -} -let _object3DId = 0; -const _v1$4 = /* @__PURE__ */ new Vector3(); -const _q1 = /* @__PURE__ */ new Quaternion(); -const _m1$3 = /* @__PURE__ */ new Matrix4(); -const _target = /* @__PURE__ */ new Vector3(); -const _position$3 = /* @__PURE__ */ new Vector3(); -const _scale$2 = /* @__PURE__ */ new Vector3(); -const _quaternion$2 = /* @__PURE__ */ new Quaternion(); -const _xAxis = /* @__PURE__ */ new Vector3(1, 0, 0); -const _yAxis = /* @__PURE__ */ new Vector3(0, 1, 0); -const _zAxis = /* @__PURE__ */ new Vector3(0, 0, 1); -const _addedEvent = { type: "added" }; -const _removedEvent = { type: "removed" }; -const _childaddedEvent = { type: "childadded", child: null }; -const _childremovedEvent = { type: "childremoved", child: null }; -class Object3D extends EventDispatcher { - static { - __name(this, "Object3D"); - } - constructor() { - super(); - this.isObject3D = true; - Object.defineProperty(this, "id", { value: _object3DId++ }); - this.uuid = generateUUID(); - this.name = ""; - this.type = "Object3D"; - this.parent = null; - this.children = []; - this.up = Object3D.DEFAULT_UP.clone(); - const position = new Vector3(); - const rotation = new Euler(); - const quaternion = new Quaternion(); - const scale = new Vector3(1, 1, 1); - function onRotationChange() { - quaternion.setFromEuler(rotation, false); - } - __name(onRotationChange, "onRotationChange"); - function onQuaternionChange() { - rotation.setFromQuaternion(quaternion, void 0, false); - } - __name(onQuaternionChange, "onQuaternionChange"); - rotation._onChange(onRotationChange); - quaternion._onChange(onQuaternionChange); - Object.defineProperties(this, { - position: { - configurable: true, - enumerable: true, - value: position - }, - rotation: { - configurable: true, - enumerable: true, - value: rotation - }, - quaternion: { - configurable: true, - enumerable: true, - value: quaternion - }, - scale: { - configurable: true, - enumerable: true, - value: scale - }, - modelViewMatrix: { - value: new Matrix4() - }, - normalMatrix: { - value: new Matrix3() - } - }); - this.matrix = new Matrix4(); - this.matrixWorld = new Matrix4(); - this.matrixAutoUpdate = Object3D.DEFAULT_MATRIX_AUTO_UPDATE; - this.matrixWorldAutoUpdate = Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE; - this.matrixWorldNeedsUpdate = false; - this.layers = new Layers(); - this.visible = true; - this.castShadow = false; - this.receiveShadow = false; - this.frustumCulled = true; - this.renderOrder = 0; - this.animations = []; - this.userData = {}; - } - onBeforeShadow() { - } - onAfterShadow() { - } - onBeforeRender() { - } - onAfterRender() { - } - applyMatrix4(matrix) { - if (this.matrixAutoUpdate) this.updateMatrix(); - this.matrix.premultiply(matrix); - this.matrix.decompose(this.position, this.quaternion, this.scale); - } - applyQuaternion(q) { - this.quaternion.premultiply(q); - return this; - } - setRotationFromAxisAngle(axis, angle) { - this.quaternion.setFromAxisAngle(axis, angle); - } - setRotationFromEuler(euler) { - this.quaternion.setFromEuler(euler, true); - } - setRotationFromMatrix(m) { - this.quaternion.setFromRotationMatrix(m); - } - setRotationFromQuaternion(q) { - this.quaternion.copy(q); - } - rotateOnAxis(axis, angle) { - _q1.setFromAxisAngle(axis, angle); - this.quaternion.multiply(_q1); - return this; - } - rotateOnWorldAxis(axis, angle) { - _q1.setFromAxisAngle(axis, angle); - this.quaternion.premultiply(_q1); - return this; - } - rotateX(angle) { - return this.rotateOnAxis(_xAxis, angle); - } - rotateY(angle) { - return this.rotateOnAxis(_yAxis, angle); - } - rotateZ(angle) { - return this.rotateOnAxis(_zAxis, angle); - } - translateOnAxis(axis, distance) { - _v1$4.copy(axis).applyQuaternion(this.quaternion); - this.position.add(_v1$4.multiplyScalar(distance)); - return this; - } - translateX(distance) { - return this.translateOnAxis(_xAxis, distance); - } - translateY(distance) { - return this.translateOnAxis(_yAxis, distance); - } - translateZ(distance) { - return this.translateOnAxis(_zAxis, distance); - } - localToWorld(vector) { - this.updateWorldMatrix(true, false); - return vector.applyMatrix4(this.matrixWorld); - } - worldToLocal(vector) { - this.updateWorldMatrix(true, false); - return vector.applyMatrix4(_m1$3.copy(this.matrixWorld).invert()); - } - lookAt(x, y, z) { - if (x.isVector3) { - _target.copy(x); - } else { - _target.set(x, y, z); - } - const parent = this.parent; - this.updateWorldMatrix(true, false); - _position$3.setFromMatrixPosition(this.matrixWorld); - if (this.isCamera || this.isLight) { - _m1$3.lookAt(_position$3, _target, this.up); - } else { - _m1$3.lookAt(_target, _position$3, this.up); - } - this.quaternion.setFromRotationMatrix(_m1$3); - if (parent) { - _m1$3.extractRotation(parent.matrixWorld); - _q1.setFromRotationMatrix(_m1$3); - this.quaternion.premultiply(_q1.invert()); - } - } - add(object) { - if (arguments.length > 1) { - for (let i = 0; i < arguments.length; i++) { - this.add(arguments[i]); - } - return this; - } - if (object === this) { - console.error("THREE.Object3D.add: object can't be added as a child of itself.", object); - return this; - } - if (object && object.isObject3D) { - object.removeFromParent(); - object.parent = this; - this.children.push(object); - object.dispatchEvent(_addedEvent); - _childaddedEvent.child = object; - this.dispatchEvent(_childaddedEvent); - _childaddedEvent.child = null; - } else { - console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", object); - } - return this; - } - remove(object) { - if (arguments.length > 1) { - for (let i = 0; i < arguments.length; i++) { - this.remove(arguments[i]); - } - return this; - } - const index = this.children.indexOf(object); - if (index !== -1) { - object.parent = null; - this.children.splice(index, 1); - object.dispatchEvent(_removedEvent); - _childremovedEvent.child = object; - this.dispatchEvent(_childremovedEvent); - _childremovedEvent.child = null; - } - return this; - } - removeFromParent() { - const parent = this.parent; - if (parent !== null) { - parent.remove(this); - } - return this; - } - clear() { - return this.remove(...this.children); - } - attach(object) { - this.updateWorldMatrix(true, false); - _m1$3.copy(this.matrixWorld).invert(); - if (object.parent !== null) { - object.parent.updateWorldMatrix(true, false); - _m1$3.multiply(object.parent.matrixWorld); - } - object.applyMatrix4(_m1$3); - object.removeFromParent(); - object.parent = this; - this.children.push(object); - object.updateWorldMatrix(false, true); - object.dispatchEvent(_addedEvent); - _childaddedEvent.child = object; - this.dispatchEvent(_childaddedEvent); - _childaddedEvent.child = null; - return this; - } - getObjectById(id2) { - return this.getObjectByProperty("id", id2); - } - getObjectByName(name) { - return this.getObjectByProperty("name", name); - } - getObjectByProperty(name, value) { - if (this[name] === value) return this; - for (let i = 0, l = this.children.length; i < l; i++) { - const child = this.children[i]; - const object = child.getObjectByProperty(name, value); - if (object !== void 0) { - return object; - } - } - return void 0; - } - getObjectsByProperty(name, value, result = []) { - if (this[name] === value) result.push(this); - const children = this.children; - for (let i = 0, l = children.length; i < l; i++) { - children[i].getObjectsByProperty(name, value, result); - } - return result; - } - getWorldPosition(target) { - this.updateWorldMatrix(true, false); - return target.setFromMatrixPosition(this.matrixWorld); - } - getWorldQuaternion(target) { - this.updateWorldMatrix(true, false); - this.matrixWorld.decompose(_position$3, target, _scale$2); - return target; - } - getWorldScale(target) { - this.updateWorldMatrix(true, false); - this.matrixWorld.decompose(_position$3, _quaternion$2, target); - return target; - } - getWorldDirection(target) { - this.updateWorldMatrix(true, false); - const e = this.matrixWorld.elements; - return target.set(e[8], e[9], e[10]).normalize(); - } - raycast() { - } - traverse(callback) { - callback(this); - const children = this.children; - for (let i = 0, l = children.length; i < l; i++) { - children[i].traverse(callback); - } - } - traverseVisible(callback) { - if (this.visible === false) return; - callback(this); - const children = this.children; - for (let i = 0, l = children.length; i < l; i++) { - children[i].traverseVisible(callback); - } - } - traverseAncestors(callback) { - const parent = this.parent; - if (parent !== null) { - callback(parent); - parent.traverseAncestors(callback); - } - } - updateMatrix() { - this.matrix.compose(this.position, this.quaternion, this.scale); - this.matrixWorldNeedsUpdate = true; - } - updateMatrixWorld(force) { - if (this.matrixAutoUpdate) this.updateMatrix(); - if (this.matrixWorldNeedsUpdate || force) { - if (this.matrixWorldAutoUpdate === true) { - if (this.parent === null) { - this.matrixWorld.copy(this.matrix); - } else { - this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix); - } - } - this.matrixWorldNeedsUpdate = false; - force = true; - } - const children = this.children; - for (let i = 0, l = children.length; i < l; i++) { - const child = children[i]; - child.updateMatrixWorld(force); - } - } - updateWorldMatrix(updateParents, updateChildren) { - const parent = this.parent; - if (updateParents === true && parent !== null) { - parent.updateWorldMatrix(true, false); - } - if (this.matrixAutoUpdate) this.updateMatrix(); - if (this.matrixWorldAutoUpdate === true) { - if (this.parent === null) { - this.matrixWorld.copy(this.matrix); - } else { - this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix); - } - } - if (updateChildren === true) { - const children = this.children; - for (let i = 0, l = children.length; i < l; i++) { - const child = children[i]; - child.updateWorldMatrix(false, true); - } - } - } - toJSON(meta) { - const isRootObject = meta === void 0 || typeof meta === "string"; - const output = {}; - if (isRootObject) { - meta = { - geometries: {}, - materials: {}, - textures: {}, - images: {}, - shapes: {}, - skeletons: {}, - animations: {}, - nodes: {} - }; - output.metadata = { - version: 4.6, - type: "Object", - generator: "Object3D.toJSON" - }; - } - const object = {}; - object.uuid = this.uuid; - object.type = this.type; - if (this.name !== "") object.name = this.name; - if (this.castShadow === true) object.castShadow = true; - if (this.receiveShadow === true) object.receiveShadow = true; - if (this.visible === false) object.visible = false; - if (this.frustumCulled === false) object.frustumCulled = false; - if (this.renderOrder !== 0) object.renderOrder = this.renderOrder; - if (Object.keys(this.userData).length > 0) object.userData = this.userData; - object.layers = this.layers.mask; - object.matrix = this.matrix.toArray(); - object.up = this.up.toArray(); - if (this.matrixAutoUpdate === false) object.matrixAutoUpdate = false; - if (this.isInstancedMesh) { - object.type = "InstancedMesh"; - object.count = this.count; - object.instanceMatrix = this.instanceMatrix.toJSON(); - if (this.instanceColor !== null) object.instanceColor = this.instanceColor.toJSON(); - } - if (this.isBatchedMesh) { - object.type = "BatchedMesh"; - object.perObjectFrustumCulled = this.perObjectFrustumCulled; - object.sortObjects = this.sortObjects; - object.drawRanges = this._drawRanges; - object.reservedRanges = this._reservedRanges; - object.visibility = this._visibility; - object.active = this._active; - object.bounds = this._bounds.map((bound) => ({ - boxInitialized: bound.boxInitialized, - boxMin: bound.box.min.toArray(), - boxMax: bound.box.max.toArray(), - sphereInitialized: bound.sphereInitialized, - sphereRadius: bound.sphere.radius, - sphereCenter: bound.sphere.center.toArray() - })); - object.maxInstanceCount = this._maxInstanceCount; - object.maxVertexCount = this._maxVertexCount; - object.maxIndexCount = this._maxIndexCount; - object.geometryInitialized = this._geometryInitialized; - object.geometryCount = this._geometryCount; - object.matricesTexture = this._matricesTexture.toJSON(meta); - if (this._colorsTexture !== null) object.colorsTexture = this._colorsTexture.toJSON(meta); - if (this.boundingSphere !== null) { - object.boundingSphere = { - center: object.boundingSphere.center.toArray(), - radius: object.boundingSphere.radius - }; - } - if (this.boundingBox !== null) { - object.boundingBox = { - min: object.boundingBox.min.toArray(), - max: object.boundingBox.max.toArray() - }; - } - } - function serialize(library, element) { - if (library[element.uuid] === void 0) { - library[element.uuid] = element.toJSON(meta); - } - return element.uuid; - } - __name(serialize, "serialize"); - if (this.isScene) { - if (this.background) { - if (this.background.isColor) { - object.background = this.background.toJSON(); - } else if (this.background.isTexture) { - object.background = this.background.toJSON(meta).uuid; - } - } - if (this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== true) { - object.environment = this.environment.toJSON(meta).uuid; - } - } else if (this.isMesh || this.isLine || this.isPoints) { - object.geometry = serialize(meta.geometries, this.geometry); - const parameters = this.geometry.parameters; - if (parameters !== void 0 && parameters.shapes !== void 0) { - const shapes = parameters.shapes; - if (Array.isArray(shapes)) { - for (let i = 0, l = shapes.length; i < l; i++) { - const shape = shapes[i]; - serialize(meta.shapes, shape); - } - } else { - serialize(meta.shapes, shapes); - } - } - } - if (this.isSkinnedMesh) { - object.bindMode = this.bindMode; - object.bindMatrix = this.bindMatrix.toArray(); - if (this.skeleton !== void 0) { - serialize(meta.skeletons, this.skeleton); - object.skeleton = this.skeleton.uuid; - } - } - if (this.material !== void 0) { - if (Array.isArray(this.material)) { - const uuids = []; - for (let i = 0, l = this.material.length; i < l; i++) { - uuids.push(serialize(meta.materials, this.material[i])); - } - object.material = uuids; - } else { - object.material = serialize(meta.materials, this.material); - } - } - if (this.children.length > 0) { - object.children = []; - for (let i = 0; i < this.children.length; i++) { - object.children.push(this.children[i].toJSON(meta).object); - } - } - if (this.animations.length > 0) { - object.animations = []; - for (let i = 0; i < this.animations.length; i++) { - const animation = this.animations[i]; - object.animations.push(serialize(meta.animations, animation)); - } - } - if (isRootObject) { - const geometries = extractFromCache(meta.geometries); - const materials = extractFromCache(meta.materials); - const textures = extractFromCache(meta.textures); - const images = extractFromCache(meta.images); - const shapes = extractFromCache(meta.shapes); - const skeletons = extractFromCache(meta.skeletons); - const animations = extractFromCache(meta.animations); - const nodes = extractFromCache(meta.nodes); - if (geometries.length > 0) output.geometries = geometries; - if (materials.length > 0) output.materials = materials; - if (textures.length > 0) output.textures = textures; - if (images.length > 0) output.images = images; - if (shapes.length > 0) output.shapes = shapes; - if (skeletons.length > 0) output.skeletons = skeletons; - if (animations.length > 0) output.animations = animations; - if (nodes.length > 0) output.nodes = nodes; - } - output.object = object; - return output; - function extractFromCache(cache) { - const values = []; - for (const key in cache) { - const data = cache[key]; - delete data.metadata; - values.push(data); - } - return values; - } - __name(extractFromCache, "extractFromCache"); - } - clone(recursive) { - return new this.constructor().copy(this, recursive); - } - copy(source, recursive = true) { - this.name = source.name; - this.up.copy(source.up); - this.position.copy(source.position); - this.rotation.order = source.rotation.order; - this.quaternion.copy(source.quaternion); - this.scale.copy(source.scale); - this.matrix.copy(source.matrix); - this.matrixWorld.copy(source.matrixWorld); - this.matrixAutoUpdate = source.matrixAutoUpdate; - this.matrixWorldAutoUpdate = source.matrixWorldAutoUpdate; - this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate; - this.layers.mask = source.layers.mask; - this.visible = source.visible; - this.castShadow = source.castShadow; - this.receiveShadow = source.receiveShadow; - this.frustumCulled = source.frustumCulled; - this.renderOrder = source.renderOrder; - this.animations = source.animations.slice(); - this.userData = JSON.parse(JSON.stringify(source.userData)); - if (recursive === true) { - for (let i = 0; i < source.children.length; i++) { - const child = source.children[i]; - this.add(child.clone()); - } - } - return this; - } -} -Object3D.DEFAULT_UP = /* @__PURE__ */ new Vector3(0, 1, 0); -Object3D.DEFAULT_MATRIX_AUTO_UPDATE = true; -Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = true; -const _v0$2 = /* @__PURE__ */ new Vector3(); -const _v1$3 = /* @__PURE__ */ new Vector3(); -const _v2$2 = /* @__PURE__ */ new Vector3(); -const _v3$2 = /* @__PURE__ */ new Vector3(); -const _vab = /* @__PURE__ */ new Vector3(); -const _vac = /* @__PURE__ */ new Vector3(); -const _vbc = /* @__PURE__ */ new Vector3(); -const _vap = /* @__PURE__ */ new Vector3(); -const _vbp = /* @__PURE__ */ new Vector3(); -const _vcp = /* @__PURE__ */ new Vector3(); -const _v40 = /* @__PURE__ */ new Vector4(); -const _v41 = /* @__PURE__ */ new Vector4(); -const _v42 = /* @__PURE__ */ new Vector4(); -class Triangle { - static { - __name(this, "Triangle"); - } - constructor(a = new Vector3(), b = new Vector3(), c = new Vector3()) { - this.a = a; - this.b = b; - this.c = c; - } - static getNormal(a, b, c, target) { - target.subVectors(c, b); - _v0$2.subVectors(a, b); - target.cross(_v0$2); - const targetLengthSq = target.lengthSq(); - if (targetLengthSq > 0) { - return target.multiplyScalar(1 / Math.sqrt(targetLengthSq)); - } - return target.set(0, 0, 0); - } - // static/instance method to calculate barycentric coordinates - // based on: http://www.blackpawn.com/texts/pointinpoly/default.html - static getBarycoord(point, a, b, c, target) { - _v0$2.subVectors(c, a); - _v1$3.subVectors(b, a); - _v2$2.subVectors(point, a); - const dot00 = _v0$2.dot(_v0$2); - const dot01 = _v0$2.dot(_v1$3); - const dot02 = _v0$2.dot(_v2$2); - const dot11 = _v1$3.dot(_v1$3); - const dot12 = _v1$3.dot(_v2$2); - const denom = dot00 * dot11 - dot01 * dot01; - if (denom === 0) { - target.set(0, 0, 0); - return null; - } - const invDenom = 1 / denom; - const u = (dot11 * dot02 - dot01 * dot12) * invDenom; - const v = (dot00 * dot12 - dot01 * dot02) * invDenom; - return target.set(1 - u - v, v, u); - } - static containsPoint(point, a, b, c) { - if (this.getBarycoord(point, a, b, c, _v3$2) === null) { - return false; - } - return _v3$2.x >= 0 && _v3$2.y >= 0 && _v3$2.x + _v3$2.y <= 1; - } - static getInterpolation(point, p1, p2, p3, v1, v2, v3, target) { - if (this.getBarycoord(point, p1, p2, p3, _v3$2) === null) { - target.x = 0; - target.y = 0; - if ("z" in target) target.z = 0; - if ("w" in target) target.w = 0; - return null; - } - target.setScalar(0); - target.addScaledVector(v1, _v3$2.x); - target.addScaledVector(v2, _v3$2.y); - target.addScaledVector(v3, _v3$2.z); - return target; - } - static getInterpolatedAttribute(attr, i1, i2, i3, barycoord, target) { - _v40.setScalar(0); - _v41.setScalar(0); - _v42.setScalar(0); - _v40.fromBufferAttribute(attr, i1); - _v41.fromBufferAttribute(attr, i2); - _v42.fromBufferAttribute(attr, i3); - target.setScalar(0); - target.addScaledVector(_v40, barycoord.x); - target.addScaledVector(_v41, barycoord.y); - target.addScaledVector(_v42, barycoord.z); - return target; - } - static isFrontFacing(a, b, c, direction) { - _v0$2.subVectors(c, b); - _v1$3.subVectors(a, b); - return _v0$2.cross(_v1$3).dot(direction) < 0 ? true : false; - } - set(a, b, c) { - this.a.copy(a); - this.b.copy(b); - this.c.copy(c); - return this; - } - setFromPointsAndIndices(points, i0, i1, i2) { - this.a.copy(points[i0]); - this.b.copy(points[i1]); - this.c.copy(points[i2]); - return this; - } - setFromAttributeAndIndices(attribute, i0, i1, i2) { - this.a.fromBufferAttribute(attribute, i0); - this.b.fromBufferAttribute(attribute, i1); - this.c.fromBufferAttribute(attribute, i2); - return this; - } - clone() { - return new this.constructor().copy(this); - } - copy(triangle) { - this.a.copy(triangle.a); - this.b.copy(triangle.b); - this.c.copy(triangle.c); - return this; - } - getArea() { - _v0$2.subVectors(this.c, this.b); - _v1$3.subVectors(this.a, this.b); - return _v0$2.cross(_v1$3).length() * 0.5; - } - getMidpoint(target) { - return target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3); - } - getNormal(target) { - return Triangle.getNormal(this.a, this.b, this.c, target); - } - getPlane(target) { - return target.setFromCoplanarPoints(this.a, this.b, this.c); - } - getBarycoord(point, target) { - return Triangle.getBarycoord(point, this.a, this.b, this.c, target); - } - getInterpolation(point, v1, v2, v3, target) { - return Triangle.getInterpolation(point, this.a, this.b, this.c, v1, v2, v3, target); - } - containsPoint(point) { - return Triangle.containsPoint(point, this.a, this.b, this.c); - } - isFrontFacing(direction) { - return Triangle.isFrontFacing(this.a, this.b, this.c, direction); - } - intersectsBox(box) { - return box.intersectsTriangle(this); - } - closestPointToPoint(p, target) { - const a = this.a, b = this.b, c = this.c; - let v, w; - _vab.subVectors(b, a); - _vac.subVectors(c, a); - _vap.subVectors(p, a); - const d1 = _vab.dot(_vap); - const d2 = _vac.dot(_vap); - if (d1 <= 0 && d2 <= 0) { - return target.copy(a); - } - _vbp.subVectors(p, b); - const d3 = _vab.dot(_vbp); - const d4 = _vac.dot(_vbp); - if (d3 >= 0 && d4 <= d3) { - return target.copy(b); - } - const vc = d1 * d4 - d3 * d2; - if (vc <= 0 && d1 >= 0 && d3 <= 0) { - v = d1 / (d1 - d3); - return target.copy(a).addScaledVector(_vab, v); - } - _vcp.subVectors(p, c); - const d5 = _vab.dot(_vcp); - const d6 = _vac.dot(_vcp); - if (d6 >= 0 && d5 <= d6) { - return target.copy(c); - } - const vb = d5 * d2 - d1 * d6; - if (vb <= 0 && d2 >= 0 && d6 <= 0) { - w = d2 / (d2 - d6); - return target.copy(a).addScaledVector(_vac, w); - } - const va = d3 * d6 - d5 * d4; - if (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) { - _vbc.subVectors(c, b); - w = (d4 - d3) / (d4 - d3 + (d5 - d6)); - return target.copy(b).addScaledVector(_vbc, w); - } - const denom = 1 / (va + vb + vc); - v = vb * denom; - w = vc * denom; - return target.copy(a).addScaledVector(_vab, v).addScaledVector(_vac, w); - } - equals(triangle) { - return triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c); - } -} -const _colorKeywords = { - "aliceblue": 15792383, - "antiquewhite": 16444375, - "aqua": 65535, - "aquamarine": 8388564, - "azure": 15794175, - "beige": 16119260, - "bisque": 16770244, - "black": 0, - "blanchedalmond": 16772045, - "blue": 255, - "blueviolet": 9055202, - "brown": 10824234, - "burlywood": 14596231, - "cadetblue": 6266528, - "chartreuse": 8388352, - "chocolate": 13789470, - "coral": 16744272, - "cornflowerblue": 6591981, - "cornsilk": 16775388, - "crimson": 14423100, - "cyan": 65535, - "darkblue": 139, - "darkcyan": 35723, - "darkgoldenrod": 12092939, - "darkgray": 11119017, - "darkgreen": 25600, - "darkgrey": 11119017, - "darkkhaki": 12433259, - "darkmagenta": 9109643, - "darkolivegreen": 5597999, - "darkorange": 16747520, - "darkorchid": 10040012, - "darkred": 9109504, - "darksalmon": 15308410, - "darkseagreen": 9419919, - "darkslateblue": 4734347, - "darkslategray": 3100495, - "darkslategrey": 3100495, - "darkturquoise": 52945, - "darkviolet": 9699539, - "deeppink": 16716947, - "deepskyblue": 49151, - "dimgray": 6908265, - "dimgrey": 6908265, - "dodgerblue": 2003199, - "firebrick": 11674146, - "floralwhite": 16775920, - "forestgreen": 2263842, - "fuchsia": 16711935, - "gainsboro": 14474460, - "ghostwhite": 16316671, - "gold": 16766720, - "goldenrod": 14329120, - "gray": 8421504, - "green": 32768, - "greenyellow": 11403055, - "grey": 8421504, - "honeydew": 15794160, - "hotpink": 16738740, - "indianred": 13458524, - "indigo": 4915330, - "ivory": 16777200, - "khaki": 15787660, - "lavender": 15132410, - "lavenderblush": 16773365, - "lawngreen": 8190976, - "lemonchiffon": 16775885, - "lightblue": 11393254, - "lightcoral": 15761536, - "lightcyan": 14745599, - "lightgoldenrodyellow": 16448210, - "lightgray": 13882323, - "lightgreen": 9498256, - "lightgrey": 13882323, - "lightpink": 16758465, - "lightsalmon": 16752762, - "lightseagreen": 2142890, - "lightskyblue": 8900346, - "lightslategray": 7833753, - "lightslategrey": 7833753, - "lightsteelblue": 11584734, - "lightyellow": 16777184, - "lime": 65280, - "limegreen": 3329330, - "linen": 16445670, - "magenta": 16711935, - "maroon": 8388608, - "mediumaquamarine": 6737322, - "mediumblue": 205, - "mediumorchid": 12211667, - "mediumpurple": 9662683, - "mediumseagreen": 3978097, - "mediumslateblue": 8087790, - "mediumspringgreen": 64154, - "mediumturquoise": 4772300, - "mediumvioletred": 13047173, - "midnightblue": 1644912, - "mintcream": 16121850, - "mistyrose": 16770273, - "moccasin": 16770229, - "navajowhite": 16768685, - "navy": 128, - "oldlace": 16643558, - "olive": 8421376, - "olivedrab": 7048739, - "orange": 16753920, - "orangered": 16729344, - "orchid": 14315734, - "palegoldenrod": 15657130, - "palegreen": 10025880, - "paleturquoise": 11529966, - "palevioletred": 14381203, - "papayawhip": 16773077, - "peachpuff": 16767673, - "peru": 13468991, - "pink": 16761035, - "plum": 14524637, - "powderblue": 11591910, - "purple": 8388736, - "rebeccapurple": 6697881, - "red": 16711680, - "rosybrown": 12357519, - "royalblue": 4286945, - "saddlebrown": 9127187, - "salmon": 16416882, - "sandybrown": 16032864, - "seagreen": 3050327, - "seashell": 16774638, - "sienna": 10506797, - "silver": 12632256, - "skyblue": 8900331, - "slateblue": 6970061, - "slategray": 7372944, - "slategrey": 7372944, - "snow": 16775930, - "springgreen": 65407, - "steelblue": 4620980, - "tan": 13808780, - "teal": 32896, - "thistle": 14204888, - "tomato": 16737095, - "turquoise": 4251856, - "violet": 15631086, - "wheat": 16113331, - "white": 16777215, - "whitesmoke": 16119285, - "yellow": 16776960, - "yellowgreen": 10145074 -}; -const _hslA = { h: 0, s: 0, l: 0 }; -const _hslB = { h: 0, s: 0, l: 0 }; -function hue2rgb(p, q, t2) { - if (t2 < 0) t2 += 1; - if (t2 > 1) t2 -= 1; - if (t2 < 1 / 6) return p + (q - p) * 6 * t2; - if (t2 < 1 / 2) return q; - if (t2 < 2 / 3) return p + (q - p) * 6 * (2 / 3 - t2); - return p; -} -__name(hue2rgb, "hue2rgb"); -class Color { - static { - __name(this, "Color"); - } - constructor(r, g, b) { - this.isColor = true; - this.r = 1; - this.g = 1; - this.b = 1; - return this.set(r, g, b); - } - set(r, g, b) { - if (g === void 0 && b === void 0) { - const value = r; - if (value && value.isColor) { - this.copy(value); - } else if (typeof value === "number") { - this.setHex(value); - } else if (typeof value === "string") { - this.setStyle(value); - } - } else { - this.setRGB(r, g, b); - } - return this; - } - setScalar(scalar) { - this.r = scalar; - this.g = scalar; - this.b = scalar; - return this; - } - setHex(hex, colorSpace = SRGBColorSpace) { - hex = Math.floor(hex); - this.r = (hex >> 16 & 255) / 255; - this.g = (hex >> 8 & 255) / 255; - this.b = (hex & 255) / 255; - ColorManagement.toWorkingColorSpace(this, colorSpace); - return this; - } - setRGB(r, g, b, colorSpace = ColorManagement.workingColorSpace) { - this.r = r; - this.g = g; - this.b = b; - ColorManagement.toWorkingColorSpace(this, colorSpace); - return this; - } - setHSL(h, s, l, colorSpace = ColorManagement.workingColorSpace) { - h = euclideanModulo(h, 1); - s = clamp(s, 0, 1); - l = clamp(l, 0, 1); - if (s === 0) { - this.r = this.g = this.b = l; - } else { - const p = l <= 0.5 ? l * (1 + s) : l + s - l * s; - const q = 2 * l - p; - this.r = hue2rgb(q, p, h + 1 / 3); - this.g = hue2rgb(q, p, h); - this.b = hue2rgb(q, p, h - 1 / 3); - } - ColorManagement.toWorkingColorSpace(this, colorSpace); - return this; - } - setStyle(style, colorSpace = SRGBColorSpace) { - function handleAlpha(string) { - if (string === void 0) return; - if (parseFloat(string) < 1) { - console.warn("THREE.Color: Alpha component of " + style + " will be ignored."); - } - } - __name(handleAlpha, "handleAlpha"); - let m; - if (m = /^(\w+)\(([^\)]*)\)/.exec(style)) { - let color; - const name = m[1]; - const components = m[2]; - switch (name) { - case "rgb": - case "rgba": - if (color = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) { - handleAlpha(color[4]); - return this.setRGB( - Math.min(255, parseInt(color[1], 10)) / 255, - Math.min(255, parseInt(color[2], 10)) / 255, - Math.min(255, parseInt(color[3], 10)) / 255, - colorSpace - ); - } - if (color = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) { - handleAlpha(color[4]); - return this.setRGB( - Math.min(100, parseInt(color[1], 10)) / 100, - Math.min(100, parseInt(color[2], 10)) / 100, - Math.min(100, parseInt(color[3], 10)) / 100, - colorSpace - ); - } - break; - case "hsl": - case "hsla": - if (color = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) { - handleAlpha(color[4]); - return this.setHSL( - parseFloat(color[1]) / 360, - parseFloat(color[2]) / 100, - parseFloat(color[3]) / 100, - colorSpace - ); - } - break; - default: - console.warn("THREE.Color: Unknown color model " + style); - } - } else if (m = /^\#([A-Fa-f\d]+)$/.exec(style)) { - const hex = m[1]; - const size = hex.length; - if (size === 3) { - return this.setRGB( - parseInt(hex.charAt(0), 16) / 15, - parseInt(hex.charAt(1), 16) / 15, - parseInt(hex.charAt(2), 16) / 15, - colorSpace - ); - } else if (size === 6) { - return this.setHex(parseInt(hex, 16), colorSpace); - } else { - console.warn("THREE.Color: Invalid hex color " + style); - } - } else if (style && style.length > 0) { - return this.setColorName(style, colorSpace); - } - return this; - } - setColorName(style, colorSpace = SRGBColorSpace) { - const hex = _colorKeywords[style.toLowerCase()]; - if (hex !== void 0) { - this.setHex(hex, colorSpace); - } else { - console.warn("THREE.Color: Unknown color " + style); - } - return this; - } - clone() { - return new this.constructor(this.r, this.g, this.b); - } - copy(color) { - this.r = color.r; - this.g = color.g; - this.b = color.b; - return this; - } - copySRGBToLinear(color) { - this.r = SRGBToLinear(color.r); - this.g = SRGBToLinear(color.g); - this.b = SRGBToLinear(color.b); - return this; - } - copyLinearToSRGB(color) { - this.r = LinearToSRGB(color.r); - this.g = LinearToSRGB(color.g); - this.b = LinearToSRGB(color.b); - return this; - } - convertSRGBToLinear() { - this.copySRGBToLinear(this); - return this; - } - convertLinearToSRGB() { - this.copyLinearToSRGB(this); - return this; - } - getHex(colorSpace = SRGBColorSpace) { - ColorManagement.fromWorkingColorSpace(_color$1.copy(this), colorSpace); - return Math.round(clamp(_color$1.r * 255, 0, 255)) * 65536 + Math.round(clamp(_color$1.g * 255, 0, 255)) * 256 + Math.round(clamp(_color$1.b * 255, 0, 255)); - } - getHexString(colorSpace = SRGBColorSpace) { - return ("000000" + this.getHex(colorSpace).toString(16)).slice(-6); - } - getHSL(target, colorSpace = ColorManagement.workingColorSpace) { - ColorManagement.fromWorkingColorSpace(_color$1.copy(this), colorSpace); - const r = _color$1.r, g = _color$1.g, b = _color$1.b; - const max2 = Math.max(r, g, b); - const min = Math.min(r, g, b); - let hue, saturation; - const lightness = (min + max2) / 2; - if (min === max2) { - hue = 0; - saturation = 0; - } else { - const delta = max2 - min; - saturation = lightness <= 0.5 ? delta / (max2 + min) : delta / (2 - max2 - min); - switch (max2) { - case r: - hue = (g - b) / delta + (g < b ? 6 : 0); - break; - case g: - hue = (b - r) / delta + 2; - break; - case b: - hue = (r - g) / delta + 4; - break; - } - hue /= 6; - } - target.h = hue; - target.s = saturation; - target.l = lightness; - return target; - } - getRGB(target, colorSpace = ColorManagement.workingColorSpace) { - ColorManagement.fromWorkingColorSpace(_color$1.copy(this), colorSpace); - target.r = _color$1.r; - target.g = _color$1.g; - target.b = _color$1.b; - return target; - } - getStyle(colorSpace = SRGBColorSpace) { - ColorManagement.fromWorkingColorSpace(_color$1.copy(this), colorSpace); - const r = _color$1.r, g = _color$1.g, b = _color$1.b; - if (colorSpace !== SRGBColorSpace) { - return `color(${colorSpace} ${r.toFixed(3)} ${g.toFixed(3)} ${b.toFixed(3)})`; - } - return `rgb(${Math.round(r * 255)},${Math.round(g * 255)},${Math.round(b * 255)})`; - } - offsetHSL(h, s, l) { - this.getHSL(_hslA); - return this.setHSL(_hslA.h + h, _hslA.s + s, _hslA.l + l); - } - add(color) { - this.r += color.r; - this.g += color.g; - this.b += color.b; - return this; - } - addColors(color1, color2) { - this.r = color1.r + color2.r; - this.g = color1.g + color2.g; - this.b = color1.b + color2.b; - return this; - } - addScalar(s) { - this.r += s; - this.g += s; - this.b += s; - return this; - } - sub(color) { - this.r = Math.max(0, this.r - color.r); - this.g = Math.max(0, this.g - color.g); - this.b = Math.max(0, this.b - color.b); - return this; - } - multiply(color) { - this.r *= color.r; - this.g *= color.g; - this.b *= color.b; - return this; - } - multiplyScalar(s) { - this.r *= s; - this.g *= s; - this.b *= s; - return this; - } - lerp(color, alpha) { - this.r += (color.r - this.r) * alpha; - this.g += (color.g - this.g) * alpha; - this.b += (color.b - this.b) * alpha; - return this; - } - lerpColors(color1, color2, alpha) { - this.r = color1.r + (color2.r - color1.r) * alpha; - this.g = color1.g + (color2.g - color1.g) * alpha; - this.b = color1.b + (color2.b - color1.b) * alpha; - return this; - } - lerpHSL(color, alpha) { - this.getHSL(_hslA); - color.getHSL(_hslB); - const h = lerp(_hslA.h, _hslB.h, alpha); - const s = lerp(_hslA.s, _hslB.s, alpha); - const l = lerp(_hslA.l, _hslB.l, alpha); - this.setHSL(h, s, l); - return this; - } - setFromVector3(v) { - this.r = v.x; - this.g = v.y; - this.b = v.z; - return this; - } - applyMatrix3(m) { - const r = this.r, g = this.g, b = this.b; - const e = m.elements; - this.r = e[0] * r + e[3] * g + e[6] * b; - this.g = e[1] * r + e[4] * g + e[7] * b; - this.b = e[2] * r + e[5] * g + e[8] * b; - return this; - } - equals(c) { - return c.r === this.r && c.g === this.g && c.b === this.b; - } - fromArray(array, offset = 0) { - this.r = array[offset]; - this.g = array[offset + 1]; - this.b = array[offset + 2]; - return this; - } - toArray(array = [], offset = 0) { - array[offset] = this.r; - array[offset + 1] = this.g; - array[offset + 2] = this.b; - return array; - } - fromBufferAttribute(attribute, index) { - this.r = attribute.getX(index); - this.g = attribute.getY(index); - this.b = attribute.getZ(index); - return this; - } - toJSON() { - return this.getHex(); - } - *[Symbol.iterator]() { - yield this.r; - yield this.g; - yield this.b; - } -} -const _color$1 = /* @__PURE__ */ new Color(); -Color.NAMES = _colorKeywords; -let _materialId = 0; -class Material extends EventDispatcher { - static { - __name(this, "Material"); - } - static get type() { - return "Material"; - } - get type() { - return this.constructor.type; - } - set type(_value) { - } - constructor() { - super(); - this.isMaterial = true; - Object.defineProperty(this, "id", { value: _materialId++ }); - this.uuid = generateUUID(); - this.name = ""; - this.blending = NormalBlending; - this.side = FrontSide; - this.vertexColors = false; - this.opacity = 1; - this.transparent = false; - this.alphaHash = false; - this.blendSrc = SrcAlphaFactor; - this.blendDst = OneMinusSrcAlphaFactor; - this.blendEquation = AddEquation; - this.blendSrcAlpha = null; - this.blendDstAlpha = null; - this.blendEquationAlpha = null; - this.blendColor = new Color(0, 0, 0); - this.blendAlpha = 0; - this.depthFunc = LessEqualDepth; - this.depthTest = true; - this.depthWrite = true; - this.stencilWriteMask = 255; - this.stencilFunc = AlwaysStencilFunc; - this.stencilRef = 0; - this.stencilFuncMask = 255; - this.stencilFail = KeepStencilOp; - this.stencilZFail = KeepStencilOp; - this.stencilZPass = KeepStencilOp; - this.stencilWrite = false; - this.clippingPlanes = null; - this.clipIntersection = false; - this.clipShadows = false; - this.shadowSide = null; - this.colorWrite = true; - this.precision = null; - this.polygonOffset = false; - this.polygonOffsetFactor = 0; - this.polygonOffsetUnits = 0; - this.dithering = false; - this.alphaToCoverage = false; - this.premultipliedAlpha = false; - this.forceSinglePass = false; - this.visible = true; - this.toneMapped = true; - this.userData = {}; - this.version = 0; - this._alphaTest = 0; - } - get alphaTest() { - return this._alphaTest; - } - set alphaTest(value) { - if (this._alphaTest > 0 !== value > 0) { - this.version++; - } - this._alphaTest = value; - } - // onBeforeRender and onBeforeCompile only supported in WebGLRenderer - onBeforeRender() { - } - onBeforeCompile() { - } - customProgramCacheKey() { - return this.onBeforeCompile.toString(); - } - setValues(values) { - if (values === void 0) return; - for (const key in values) { - const newValue = values[key]; - if (newValue === void 0) { - console.warn(`THREE.Material: parameter '${key}' has value of undefined.`); - continue; - } - const currentValue = this[key]; - if (currentValue === void 0) { - console.warn(`THREE.Material: '${key}' is not a property of THREE.${this.type}.`); - continue; - } - if (currentValue && currentValue.isColor) { - currentValue.set(newValue); - } else if (currentValue && currentValue.isVector3 && (newValue && newValue.isVector3)) { - currentValue.copy(newValue); - } else { - this[key] = newValue; - } - } - } - toJSON(meta) { - const isRootObject = meta === void 0 || typeof meta === "string"; - if (isRootObject) { - meta = { - textures: {}, - images: {} - }; - } - const data = { - metadata: { - version: 4.6, - type: "Material", - generator: "Material.toJSON" - } - }; - data.uuid = this.uuid; - data.type = this.type; - if (this.name !== "") data.name = this.name; - if (this.color && this.color.isColor) data.color = this.color.getHex(); - if (this.roughness !== void 0) data.roughness = this.roughness; - if (this.metalness !== void 0) data.metalness = this.metalness; - if (this.sheen !== void 0) data.sheen = this.sheen; - if (this.sheenColor && this.sheenColor.isColor) data.sheenColor = this.sheenColor.getHex(); - if (this.sheenRoughness !== void 0) data.sheenRoughness = this.sheenRoughness; - if (this.emissive && this.emissive.isColor) data.emissive = this.emissive.getHex(); - if (this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1) data.emissiveIntensity = this.emissiveIntensity; - if (this.specular && this.specular.isColor) data.specular = this.specular.getHex(); - if (this.specularIntensity !== void 0) data.specularIntensity = this.specularIntensity; - if (this.specularColor && this.specularColor.isColor) data.specularColor = this.specularColor.getHex(); - if (this.shininess !== void 0) data.shininess = this.shininess; - if (this.clearcoat !== void 0) data.clearcoat = this.clearcoat; - if (this.clearcoatRoughness !== void 0) data.clearcoatRoughness = this.clearcoatRoughness; - if (this.clearcoatMap && this.clearcoatMap.isTexture) { - data.clearcoatMap = this.clearcoatMap.toJSON(meta).uuid; - } - if (this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture) { - data.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(meta).uuid; - } - if (this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture) { - data.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(meta).uuid; - data.clearcoatNormalScale = this.clearcoatNormalScale.toArray(); - } - if (this.dispersion !== void 0) data.dispersion = this.dispersion; - if (this.iridescence !== void 0) data.iridescence = this.iridescence; - if (this.iridescenceIOR !== void 0) data.iridescenceIOR = this.iridescenceIOR; - if (this.iridescenceThicknessRange !== void 0) data.iridescenceThicknessRange = this.iridescenceThicknessRange; - if (this.iridescenceMap && this.iridescenceMap.isTexture) { - data.iridescenceMap = this.iridescenceMap.toJSON(meta).uuid; - } - if (this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture) { - data.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(meta).uuid; - } - if (this.anisotropy !== void 0) data.anisotropy = this.anisotropy; - if (this.anisotropyRotation !== void 0) data.anisotropyRotation = this.anisotropyRotation; - if (this.anisotropyMap && this.anisotropyMap.isTexture) { - data.anisotropyMap = this.anisotropyMap.toJSON(meta).uuid; - } - if (this.map && this.map.isTexture) data.map = this.map.toJSON(meta).uuid; - if (this.matcap && this.matcap.isTexture) data.matcap = this.matcap.toJSON(meta).uuid; - if (this.alphaMap && this.alphaMap.isTexture) data.alphaMap = this.alphaMap.toJSON(meta).uuid; - if (this.lightMap && this.lightMap.isTexture) { - data.lightMap = this.lightMap.toJSON(meta).uuid; - data.lightMapIntensity = this.lightMapIntensity; - } - if (this.aoMap && this.aoMap.isTexture) { - data.aoMap = this.aoMap.toJSON(meta).uuid; - data.aoMapIntensity = this.aoMapIntensity; - } - if (this.bumpMap && this.bumpMap.isTexture) { - data.bumpMap = this.bumpMap.toJSON(meta).uuid; - data.bumpScale = this.bumpScale; - } - if (this.normalMap && this.normalMap.isTexture) { - data.normalMap = this.normalMap.toJSON(meta).uuid; - data.normalMapType = this.normalMapType; - data.normalScale = this.normalScale.toArray(); - } - if (this.displacementMap && this.displacementMap.isTexture) { - data.displacementMap = this.displacementMap.toJSON(meta).uuid; - data.displacementScale = this.displacementScale; - data.displacementBias = this.displacementBias; - } - if (this.roughnessMap && this.roughnessMap.isTexture) data.roughnessMap = this.roughnessMap.toJSON(meta).uuid; - if (this.metalnessMap && this.metalnessMap.isTexture) data.metalnessMap = this.metalnessMap.toJSON(meta).uuid; - if (this.emissiveMap && this.emissiveMap.isTexture) data.emissiveMap = this.emissiveMap.toJSON(meta).uuid; - if (this.specularMap && this.specularMap.isTexture) data.specularMap = this.specularMap.toJSON(meta).uuid; - if (this.specularIntensityMap && this.specularIntensityMap.isTexture) data.specularIntensityMap = this.specularIntensityMap.toJSON(meta).uuid; - if (this.specularColorMap && this.specularColorMap.isTexture) data.specularColorMap = this.specularColorMap.toJSON(meta).uuid; - if (this.envMap && this.envMap.isTexture) { - data.envMap = this.envMap.toJSON(meta).uuid; - if (this.combine !== void 0) data.combine = this.combine; - } - if (this.envMapRotation !== void 0) data.envMapRotation = this.envMapRotation.toArray(); - if (this.envMapIntensity !== void 0) data.envMapIntensity = this.envMapIntensity; - if (this.reflectivity !== void 0) data.reflectivity = this.reflectivity; - if (this.refractionRatio !== void 0) data.refractionRatio = this.refractionRatio; - if (this.gradientMap && this.gradientMap.isTexture) { - data.gradientMap = this.gradientMap.toJSON(meta).uuid; - } - if (this.transmission !== void 0) data.transmission = this.transmission; - if (this.transmissionMap && this.transmissionMap.isTexture) data.transmissionMap = this.transmissionMap.toJSON(meta).uuid; - if (this.thickness !== void 0) data.thickness = this.thickness; - if (this.thicknessMap && this.thicknessMap.isTexture) data.thicknessMap = this.thicknessMap.toJSON(meta).uuid; - if (this.attenuationDistance !== void 0 && this.attenuationDistance !== Infinity) data.attenuationDistance = this.attenuationDistance; - if (this.attenuationColor !== void 0) data.attenuationColor = this.attenuationColor.getHex(); - if (this.size !== void 0) data.size = this.size; - if (this.shadowSide !== null) data.shadowSide = this.shadowSide; - if (this.sizeAttenuation !== void 0) data.sizeAttenuation = this.sizeAttenuation; - if (this.blending !== NormalBlending) data.blending = this.blending; - if (this.side !== FrontSide) data.side = this.side; - if (this.vertexColors === true) data.vertexColors = true; - if (this.opacity < 1) data.opacity = this.opacity; - if (this.transparent === true) data.transparent = true; - if (this.blendSrc !== SrcAlphaFactor) data.blendSrc = this.blendSrc; - if (this.blendDst !== OneMinusSrcAlphaFactor) data.blendDst = this.blendDst; - if (this.blendEquation !== AddEquation) data.blendEquation = this.blendEquation; - if (this.blendSrcAlpha !== null) data.blendSrcAlpha = this.blendSrcAlpha; - if (this.blendDstAlpha !== null) data.blendDstAlpha = this.blendDstAlpha; - if (this.blendEquationAlpha !== null) data.blendEquationAlpha = this.blendEquationAlpha; - if (this.blendColor && this.blendColor.isColor) data.blendColor = this.blendColor.getHex(); - if (this.blendAlpha !== 0) data.blendAlpha = this.blendAlpha; - if (this.depthFunc !== LessEqualDepth) data.depthFunc = this.depthFunc; - if (this.depthTest === false) data.depthTest = this.depthTest; - if (this.depthWrite === false) data.depthWrite = this.depthWrite; - if (this.colorWrite === false) data.colorWrite = this.colorWrite; - if (this.stencilWriteMask !== 255) data.stencilWriteMask = this.stencilWriteMask; - if (this.stencilFunc !== AlwaysStencilFunc) data.stencilFunc = this.stencilFunc; - if (this.stencilRef !== 0) data.stencilRef = this.stencilRef; - if (this.stencilFuncMask !== 255) data.stencilFuncMask = this.stencilFuncMask; - if (this.stencilFail !== KeepStencilOp) data.stencilFail = this.stencilFail; - if (this.stencilZFail !== KeepStencilOp) data.stencilZFail = this.stencilZFail; - if (this.stencilZPass !== KeepStencilOp) data.stencilZPass = this.stencilZPass; - if (this.stencilWrite === true) data.stencilWrite = this.stencilWrite; - if (this.rotation !== void 0 && this.rotation !== 0) data.rotation = this.rotation; - if (this.polygonOffset === true) data.polygonOffset = true; - if (this.polygonOffsetFactor !== 0) data.polygonOffsetFactor = this.polygonOffsetFactor; - if (this.polygonOffsetUnits !== 0) data.polygonOffsetUnits = this.polygonOffsetUnits; - if (this.linewidth !== void 0 && this.linewidth !== 1) data.linewidth = this.linewidth; - if (this.dashSize !== void 0) data.dashSize = this.dashSize; - if (this.gapSize !== void 0) data.gapSize = this.gapSize; - if (this.scale !== void 0) data.scale = this.scale; - if (this.dithering === true) data.dithering = true; - if (this.alphaTest > 0) data.alphaTest = this.alphaTest; - if (this.alphaHash === true) data.alphaHash = true; - if (this.alphaToCoverage === true) data.alphaToCoverage = true; - if (this.premultipliedAlpha === true) data.premultipliedAlpha = true; - if (this.forceSinglePass === true) data.forceSinglePass = true; - if (this.wireframe === true) data.wireframe = true; - if (this.wireframeLinewidth > 1) data.wireframeLinewidth = this.wireframeLinewidth; - if (this.wireframeLinecap !== "round") data.wireframeLinecap = this.wireframeLinecap; - if (this.wireframeLinejoin !== "round") data.wireframeLinejoin = this.wireframeLinejoin; - if (this.flatShading === true) data.flatShading = true; - if (this.visible === false) data.visible = false; - if (this.toneMapped === false) data.toneMapped = false; - if (this.fog === false) data.fog = false; - if (Object.keys(this.userData).length > 0) data.userData = this.userData; - function extractFromCache(cache) { - const values = []; - for (const key in cache) { - const data2 = cache[key]; - delete data2.metadata; - values.push(data2); - } - return values; - } - __name(extractFromCache, "extractFromCache"); - if (isRootObject) { - const textures = extractFromCache(meta.textures); - const images = extractFromCache(meta.images); - if (textures.length > 0) data.textures = textures; - if (images.length > 0) data.images = images; - } - return data; - } - clone() { - return new this.constructor().copy(this); - } - copy(source) { - this.name = source.name; - this.blending = source.blending; - this.side = source.side; - this.vertexColors = source.vertexColors; - this.opacity = source.opacity; - this.transparent = source.transparent; - this.blendSrc = source.blendSrc; - this.blendDst = source.blendDst; - this.blendEquation = source.blendEquation; - this.blendSrcAlpha = source.blendSrcAlpha; - this.blendDstAlpha = source.blendDstAlpha; - this.blendEquationAlpha = source.blendEquationAlpha; - this.blendColor.copy(source.blendColor); - this.blendAlpha = source.blendAlpha; - this.depthFunc = source.depthFunc; - this.depthTest = source.depthTest; - this.depthWrite = source.depthWrite; - this.stencilWriteMask = source.stencilWriteMask; - this.stencilFunc = source.stencilFunc; - this.stencilRef = source.stencilRef; - this.stencilFuncMask = source.stencilFuncMask; - this.stencilFail = source.stencilFail; - this.stencilZFail = source.stencilZFail; - this.stencilZPass = source.stencilZPass; - this.stencilWrite = source.stencilWrite; - const srcPlanes = source.clippingPlanes; - let dstPlanes = null; - if (srcPlanes !== null) { - const n = srcPlanes.length; - dstPlanes = new Array(n); - for (let i = 0; i !== n; ++i) { - dstPlanes[i] = srcPlanes[i].clone(); - } - } - this.clippingPlanes = dstPlanes; - this.clipIntersection = source.clipIntersection; - this.clipShadows = source.clipShadows; - this.shadowSide = source.shadowSide; - this.colorWrite = source.colorWrite; - this.precision = source.precision; - this.polygonOffset = source.polygonOffset; - this.polygonOffsetFactor = source.polygonOffsetFactor; - this.polygonOffsetUnits = source.polygonOffsetUnits; - this.dithering = source.dithering; - this.alphaTest = source.alphaTest; - this.alphaHash = source.alphaHash; - this.alphaToCoverage = source.alphaToCoverage; - this.premultipliedAlpha = source.premultipliedAlpha; - this.forceSinglePass = source.forceSinglePass; - this.visible = source.visible; - this.toneMapped = source.toneMapped; - this.userData = JSON.parse(JSON.stringify(source.userData)); - return this; - } - dispose() { - this.dispatchEvent({ type: "dispose" }); - } - set needsUpdate(value) { - if (value === true) this.version++; - } - onBuild() { - console.warn("Material: onBuild() has been removed."); - } -} -class MeshBasicMaterial extends Material { - static { - __name(this, "MeshBasicMaterial"); - } - static get type() { - return "MeshBasicMaterial"; - } - constructor(parameters) { - super(); - this.isMeshBasicMaterial = true; - this.color = new Color(16777215); - this.map = null; - this.lightMap = null; - this.lightMapIntensity = 1; - this.aoMap = null; - this.aoMapIntensity = 1; - this.specularMap = null; - this.alphaMap = null; - this.envMap = null; - this.envMapRotation = new Euler(); - this.combine = MultiplyOperation; - this.reflectivity = 1; - this.refractionRatio = 0.98; - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = "round"; - this.wireframeLinejoin = "round"; - this.fog = true; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.color.copy(source.color); - this.map = source.map; - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; - this.specularMap = source.specularMap; - this.alphaMap = source.alphaMap; - this.envMap = source.envMap; - this.envMapRotation.copy(source.envMapRotation); - this.combine = source.combine; - this.reflectivity = source.reflectivity; - this.refractionRatio = source.refractionRatio; - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; - this.fog = source.fog; - return this; - } -} -const _tables = /* @__PURE__ */ _generateTables(); -function _generateTables() { - const buffer = new ArrayBuffer(4); - const floatView = new Float32Array(buffer); - const uint32View = new Uint32Array(buffer); - const baseTable = new Uint32Array(512); - const shiftTable = new Uint32Array(512); - for (let i = 0; i < 256; ++i) { - const e = i - 127; - if (e < -27) { - baseTable[i] = 0; - baseTable[i | 256] = 32768; - shiftTable[i] = 24; - shiftTable[i | 256] = 24; - } else if (e < -14) { - baseTable[i] = 1024 >> -e - 14; - baseTable[i | 256] = 1024 >> -e - 14 | 32768; - shiftTable[i] = -e - 1; - shiftTable[i | 256] = -e - 1; - } else if (e <= 15) { - baseTable[i] = e + 15 << 10; - baseTable[i | 256] = e + 15 << 10 | 32768; - shiftTable[i] = 13; - shiftTable[i | 256] = 13; - } else if (e < 128) { - baseTable[i] = 31744; - baseTable[i | 256] = 64512; - shiftTable[i] = 24; - shiftTable[i | 256] = 24; - } else { - baseTable[i] = 31744; - baseTable[i | 256] = 64512; - shiftTable[i] = 13; - shiftTable[i | 256] = 13; - } - } - const mantissaTable = new Uint32Array(2048); - const exponentTable = new Uint32Array(64); - const offsetTable = new Uint32Array(64); - for (let i = 1; i < 1024; ++i) { - let m = i << 13; - let e = 0; - while ((m & 8388608) === 0) { - m <<= 1; - e -= 8388608; - } - m &= ~8388608; - e += 947912704; - mantissaTable[i] = m | e; - } - for (let i = 1024; i < 2048; ++i) { - mantissaTable[i] = 939524096 + (i - 1024 << 13); - } - for (let i = 1; i < 31; ++i) { - exponentTable[i] = i << 23; - } - exponentTable[31] = 1199570944; - exponentTable[32] = 2147483648; - for (let i = 33; i < 63; ++i) { - exponentTable[i] = 2147483648 + (i - 32 << 23); - } - exponentTable[63] = 3347054592; - for (let i = 1; i < 64; ++i) { - if (i !== 32) { - offsetTable[i] = 1024; - } - } - return { - floatView, - uint32View, - baseTable, - shiftTable, - mantissaTable, - exponentTable, - offsetTable - }; -} -__name(_generateTables, "_generateTables"); -function toHalfFloat(val) { - if (Math.abs(val) > 65504) console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."); - val = clamp(val, -65504, 65504); - _tables.floatView[0] = val; - const f = _tables.uint32View[0]; - const e = f >> 23 & 511; - return _tables.baseTable[e] + ((f & 8388607) >> _tables.shiftTable[e]); -} -__name(toHalfFloat, "toHalfFloat"); -function fromHalfFloat(val) { - const m = val >> 10; - _tables.uint32View[0] = _tables.mantissaTable[_tables.offsetTable[m] + (val & 1023)] + _tables.exponentTable[m]; - return _tables.floatView[0]; -} -__name(fromHalfFloat, "fromHalfFloat"); -const DataUtils = { - toHalfFloat, - fromHalfFloat -}; -const _vector$9 = /* @__PURE__ */ new Vector3(); -const _vector2$1 = /* @__PURE__ */ new Vector2(); -class BufferAttribute { - static { - __name(this, "BufferAttribute"); - } - constructor(array, itemSize, normalized = false) { - if (Array.isArray(array)) { - throw new TypeError("THREE.BufferAttribute: array should be a Typed Array."); - } - this.isBufferAttribute = true; - this.name = ""; - this.array = array; - this.itemSize = itemSize; - this.count = array !== void 0 ? array.length / itemSize : 0; - this.normalized = normalized; - this.usage = StaticDrawUsage; - this.updateRanges = []; - this.gpuType = FloatType; - this.version = 0; - } - onUploadCallback() { - } - set needsUpdate(value) { - if (value === true) this.version++; - } - setUsage(value) { - this.usage = value; - return this; - } - addUpdateRange(start, count) { - this.updateRanges.push({ start, count }); - } - clearUpdateRanges() { - this.updateRanges.length = 0; - } - copy(source) { - this.name = source.name; - this.array = new source.array.constructor(source.array); - this.itemSize = source.itemSize; - this.count = source.count; - this.normalized = source.normalized; - this.usage = source.usage; - this.gpuType = source.gpuType; - return this; - } - copyAt(index1, attribute, index2) { - index1 *= this.itemSize; - index2 *= attribute.itemSize; - for (let i = 0, l = this.itemSize; i < l; i++) { - this.array[index1 + i] = attribute.array[index2 + i]; - } - return this; - } - copyArray(array) { - this.array.set(array); - return this; - } - applyMatrix3(m) { - if (this.itemSize === 2) { - for (let i = 0, l = this.count; i < l; i++) { - _vector2$1.fromBufferAttribute(this, i); - _vector2$1.applyMatrix3(m); - this.setXY(i, _vector2$1.x, _vector2$1.y); - } - } else if (this.itemSize === 3) { - for (let i = 0, l = this.count; i < l; i++) { - _vector$9.fromBufferAttribute(this, i); - _vector$9.applyMatrix3(m); - this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z); - } - } - return this; - } - applyMatrix4(m) { - for (let i = 0, l = this.count; i < l; i++) { - _vector$9.fromBufferAttribute(this, i); - _vector$9.applyMatrix4(m); - this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z); - } - return this; - } - applyNormalMatrix(m) { - for (let i = 0, l = this.count; i < l; i++) { - _vector$9.fromBufferAttribute(this, i); - _vector$9.applyNormalMatrix(m); - this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z); - } - return this; - } - transformDirection(m) { - for (let i = 0, l = this.count; i < l; i++) { - _vector$9.fromBufferAttribute(this, i); - _vector$9.transformDirection(m); - this.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z); - } - return this; - } - set(value, offset = 0) { - this.array.set(value, offset); - return this; - } - getComponent(index, component) { - let value = this.array[index * this.itemSize + component]; - if (this.normalized) value = denormalize(value, this.array); - return value; - } - setComponent(index, component, value) { - if (this.normalized) value = normalize(value, this.array); - this.array[index * this.itemSize + component] = value; - return this; - } - getX(index) { - let x = this.array[index * this.itemSize]; - if (this.normalized) x = denormalize(x, this.array); - return x; - } - setX(index, x) { - if (this.normalized) x = normalize(x, this.array); - this.array[index * this.itemSize] = x; - return this; - } - getY(index) { - let y = this.array[index * this.itemSize + 1]; - if (this.normalized) y = denormalize(y, this.array); - return y; - } - setY(index, y) { - if (this.normalized) y = normalize(y, this.array); - this.array[index * this.itemSize + 1] = y; - return this; - } - getZ(index) { - let z = this.array[index * this.itemSize + 2]; - if (this.normalized) z = denormalize(z, this.array); - return z; - } - setZ(index, z) { - if (this.normalized) z = normalize(z, this.array); - this.array[index * this.itemSize + 2] = z; - return this; - } - getW(index) { - let w = this.array[index * this.itemSize + 3]; - if (this.normalized) w = denormalize(w, this.array); - return w; - } - setW(index, w) { - if (this.normalized) w = normalize(w, this.array); - this.array[index * this.itemSize + 3] = w; - return this; - } - setXY(index, x, y) { - index *= this.itemSize; - if (this.normalized) { - x = normalize(x, this.array); - y = normalize(y, this.array); - } - this.array[index + 0] = x; - this.array[index + 1] = y; - return this; - } - setXYZ(index, x, y, z) { - index *= this.itemSize; - if (this.normalized) { - x = normalize(x, this.array); - y = normalize(y, this.array); - z = normalize(z, this.array); - } - this.array[index + 0] = x; - this.array[index + 1] = y; - this.array[index + 2] = z; - return this; - } - setXYZW(index, x, y, z, w) { - index *= this.itemSize; - if (this.normalized) { - x = normalize(x, this.array); - y = normalize(y, this.array); - z = normalize(z, this.array); - w = normalize(w, this.array); - } - this.array[index + 0] = x; - this.array[index + 1] = y; - this.array[index + 2] = z; - this.array[index + 3] = w; - return this; - } - onUpload(callback) { - this.onUploadCallback = callback; - return this; - } - clone() { - return new this.constructor(this.array, this.itemSize).copy(this); - } - toJSON() { - const data = { - itemSize: this.itemSize, - type: this.array.constructor.name, - array: Array.from(this.array), - normalized: this.normalized - }; - if (this.name !== "") data.name = this.name; - if (this.usage !== StaticDrawUsage) data.usage = this.usage; - return data; - } -} -class Int8BufferAttribute extends BufferAttribute { - static { - __name(this, "Int8BufferAttribute"); - } - constructor(array, itemSize, normalized) { - super(new Int8Array(array), itemSize, normalized); - } -} -class Uint8BufferAttribute extends BufferAttribute { - static { - __name(this, "Uint8BufferAttribute"); - } - constructor(array, itemSize, normalized) { - super(new Uint8Array(array), itemSize, normalized); - } -} -class Uint8ClampedBufferAttribute extends BufferAttribute { - static { - __name(this, "Uint8ClampedBufferAttribute"); - } - constructor(array, itemSize, normalized) { - super(new Uint8ClampedArray(array), itemSize, normalized); - } -} -class Int16BufferAttribute extends BufferAttribute { - static { - __name(this, "Int16BufferAttribute"); - } - constructor(array, itemSize, normalized) { - super(new Int16Array(array), itemSize, normalized); - } -} -class Uint16BufferAttribute extends BufferAttribute { - static { - __name(this, "Uint16BufferAttribute"); - } - constructor(array, itemSize, normalized) { - super(new Uint16Array(array), itemSize, normalized); - } -} -class Int32BufferAttribute extends BufferAttribute { - static { - __name(this, "Int32BufferAttribute"); - } - constructor(array, itemSize, normalized) { - super(new Int32Array(array), itemSize, normalized); - } -} -class Uint32BufferAttribute extends BufferAttribute { - static { - __name(this, "Uint32BufferAttribute"); - } - constructor(array, itemSize, normalized) { - super(new Uint32Array(array), itemSize, normalized); - } -} -class Float16BufferAttribute extends BufferAttribute { - static { - __name(this, "Float16BufferAttribute"); - } - constructor(array, itemSize, normalized) { - super(new Uint16Array(array), itemSize, normalized); - this.isFloat16BufferAttribute = true; - } - getX(index) { - let x = fromHalfFloat(this.array[index * this.itemSize]); - if (this.normalized) x = denormalize(x, this.array); - return x; - } - setX(index, x) { - if (this.normalized) x = normalize(x, this.array); - this.array[index * this.itemSize] = toHalfFloat(x); - return this; - } - getY(index) { - let y = fromHalfFloat(this.array[index * this.itemSize + 1]); - if (this.normalized) y = denormalize(y, this.array); - return y; - } - setY(index, y) { - if (this.normalized) y = normalize(y, this.array); - this.array[index * this.itemSize + 1] = toHalfFloat(y); - return this; - } - getZ(index) { - let z = fromHalfFloat(this.array[index * this.itemSize + 2]); - if (this.normalized) z = denormalize(z, this.array); - return z; - } - setZ(index, z) { - if (this.normalized) z = normalize(z, this.array); - this.array[index * this.itemSize + 2] = toHalfFloat(z); - return this; - } - getW(index) { - let w = fromHalfFloat(this.array[index * this.itemSize + 3]); - if (this.normalized) w = denormalize(w, this.array); - return w; - } - setW(index, w) { - if (this.normalized) w = normalize(w, this.array); - this.array[index * this.itemSize + 3] = toHalfFloat(w); - return this; - } - setXY(index, x, y) { - index *= this.itemSize; - if (this.normalized) { - x = normalize(x, this.array); - y = normalize(y, this.array); - } - this.array[index + 0] = toHalfFloat(x); - this.array[index + 1] = toHalfFloat(y); - return this; - } - setXYZ(index, x, y, z) { - index *= this.itemSize; - if (this.normalized) { - x = normalize(x, this.array); - y = normalize(y, this.array); - z = normalize(z, this.array); - } - this.array[index + 0] = toHalfFloat(x); - this.array[index + 1] = toHalfFloat(y); - this.array[index + 2] = toHalfFloat(z); - return this; - } - setXYZW(index, x, y, z, w) { - index *= this.itemSize; - if (this.normalized) { - x = normalize(x, this.array); - y = normalize(y, this.array); - z = normalize(z, this.array); - w = normalize(w, this.array); - } - this.array[index + 0] = toHalfFloat(x); - this.array[index + 1] = toHalfFloat(y); - this.array[index + 2] = toHalfFloat(z); - this.array[index + 3] = toHalfFloat(w); - return this; - } -} -class Float32BufferAttribute extends BufferAttribute { - static { - __name(this, "Float32BufferAttribute"); - } - constructor(array, itemSize, normalized) { - super(new Float32Array(array), itemSize, normalized); - } -} -let _id$2 = 0; -const _m1$2 = /* @__PURE__ */ new Matrix4(); -const _obj = /* @__PURE__ */ new Object3D(); -const _offset = /* @__PURE__ */ new Vector3(); -const _box$2 = /* @__PURE__ */ new Box3(); -const _boxMorphTargets = /* @__PURE__ */ new Box3(); -const _vector$8 = /* @__PURE__ */ new Vector3(); -class BufferGeometry extends EventDispatcher { - static { - __name(this, "BufferGeometry"); - } - constructor() { - super(); - this.isBufferGeometry = true; - Object.defineProperty(this, "id", { value: _id$2++ }); - this.uuid = generateUUID(); - this.name = ""; - this.type = "BufferGeometry"; - this.index = null; - this.indirect = null; - this.attributes = {}; - this.morphAttributes = {}; - this.morphTargetsRelative = false; - this.groups = []; - this.boundingBox = null; - this.boundingSphere = null; - this.drawRange = { start: 0, count: Infinity }; - this.userData = {}; - } - getIndex() { - return this.index; - } - setIndex(index) { - if (Array.isArray(index)) { - this.index = new (arrayNeedsUint32(index) ? Uint32BufferAttribute : Uint16BufferAttribute)(index, 1); - } else { - this.index = index; - } - return this; - } - setIndirect(indirect) { - this.indirect = indirect; - return this; - } - getIndirect() { - return this.indirect; - } - getAttribute(name) { - return this.attributes[name]; - } - setAttribute(name, attribute) { - this.attributes[name] = attribute; - return this; - } - deleteAttribute(name) { - delete this.attributes[name]; - return this; - } - hasAttribute(name) { - return this.attributes[name] !== void 0; - } - addGroup(start, count, materialIndex = 0) { - this.groups.push({ - start, - count, - materialIndex - }); - } - clearGroups() { - this.groups = []; - } - setDrawRange(start, count) { - this.drawRange.start = start; - this.drawRange.count = count; - } - applyMatrix4(matrix) { - const position = this.attributes.position; - if (position !== void 0) { - position.applyMatrix4(matrix); - position.needsUpdate = true; - } - const normal = this.attributes.normal; - if (normal !== void 0) { - const normalMatrix = new Matrix3().getNormalMatrix(matrix); - normal.applyNormalMatrix(normalMatrix); - normal.needsUpdate = true; - } - const tangent = this.attributes.tangent; - if (tangent !== void 0) { - tangent.transformDirection(matrix); - tangent.needsUpdate = true; - } - if (this.boundingBox !== null) { - this.computeBoundingBox(); - } - if (this.boundingSphere !== null) { - this.computeBoundingSphere(); - } - return this; - } - applyQuaternion(q) { - _m1$2.makeRotationFromQuaternion(q); - this.applyMatrix4(_m1$2); - return this; - } - rotateX(angle) { - _m1$2.makeRotationX(angle); - this.applyMatrix4(_m1$2); - return this; - } - rotateY(angle) { - _m1$2.makeRotationY(angle); - this.applyMatrix4(_m1$2); - return this; - } - rotateZ(angle) { - _m1$2.makeRotationZ(angle); - this.applyMatrix4(_m1$2); - return this; - } - translate(x, y, z) { - _m1$2.makeTranslation(x, y, z); - this.applyMatrix4(_m1$2); - return this; - } - scale(x, y, z) { - _m1$2.makeScale(x, y, z); - this.applyMatrix4(_m1$2); - return this; - } - lookAt(vector) { - _obj.lookAt(vector); - _obj.updateMatrix(); - this.applyMatrix4(_obj.matrix); - return this; - } - center() { - this.computeBoundingBox(); - this.boundingBox.getCenter(_offset).negate(); - this.translate(_offset.x, _offset.y, _offset.z); - return this; - } - setFromPoints(points) { - const positionAttribute = this.getAttribute("position"); - if (positionAttribute === void 0) { - const position = []; - for (let i = 0, l = points.length; i < l; i++) { - const point = points[i]; - position.push(point.x, point.y, point.z || 0); - } - this.setAttribute("position", new Float32BufferAttribute(position, 3)); - } else { - for (let i = 0, l = positionAttribute.count; i < l; i++) { - const point = points[i]; - positionAttribute.setXYZ(i, point.x, point.y, point.z || 0); - } - if (points.length > positionAttribute.count) { - console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."); - } - positionAttribute.needsUpdate = true; - } - return this; - } - computeBoundingBox() { - if (this.boundingBox === null) { - this.boundingBox = new Box3(); - } - const position = this.attributes.position; - const morphAttributesPosition = this.morphAttributes.position; - if (position && position.isGLBufferAttribute) { - console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.", this); - this.boundingBox.set( - new Vector3(-Infinity, -Infinity, -Infinity), - new Vector3(Infinity, Infinity, Infinity) - ); - return; - } - if (position !== void 0) { - this.boundingBox.setFromBufferAttribute(position); - if (morphAttributesPosition) { - for (let i = 0, il = morphAttributesPosition.length; i < il; i++) { - const morphAttribute = morphAttributesPosition[i]; - _box$2.setFromBufferAttribute(morphAttribute); - if (this.morphTargetsRelative) { - _vector$8.addVectors(this.boundingBox.min, _box$2.min); - this.boundingBox.expandByPoint(_vector$8); - _vector$8.addVectors(this.boundingBox.max, _box$2.max); - this.boundingBox.expandByPoint(_vector$8); - } else { - this.boundingBox.expandByPoint(_box$2.min); - this.boundingBox.expandByPoint(_box$2.max); - } - } - } - } else { - this.boundingBox.makeEmpty(); - } - if (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) { - console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this); - } - } - computeBoundingSphere() { - if (this.boundingSphere === null) { - this.boundingSphere = new Sphere(); - } - const position = this.attributes.position; - const morphAttributesPosition = this.morphAttributes.position; - if (position && position.isGLBufferAttribute) { - console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.", this); - this.boundingSphere.set(new Vector3(), Infinity); - return; - } - if (position) { - const center = this.boundingSphere.center; - _box$2.setFromBufferAttribute(position); - if (morphAttributesPosition) { - for (let i = 0, il = morphAttributesPosition.length; i < il; i++) { - const morphAttribute = morphAttributesPosition[i]; - _boxMorphTargets.setFromBufferAttribute(morphAttribute); - if (this.morphTargetsRelative) { - _vector$8.addVectors(_box$2.min, _boxMorphTargets.min); - _box$2.expandByPoint(_vector$8); - _vector$8.addVectors(_box$2.max, _boxMorphTargets.max); - _box$2.expandByPoint(_vector$8); - } else { - _box$2.expandByPoint(_boxMorphTargets.min); - _box$2.expandByPoint(_boxMorphTargets.max); - } - } - } - _box$2.getCenter(center); - let maxRadiusSq = 0; - for (let i = 0, il = position.count; i < il; i++) { - _vector$8.fromBufferAttribute(position, i); - maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8)); - } - if (morphAttributesPosition) { - for (let i = 0, il = morphAttributesPosition.length; i < il; i++) { - const morphAttribute = morphAttributesPosition[i]; - const morphTargetsRelative = this.morphTargetsRelative; - for (let j = 0, jl = morphAttribute.count; j < jl; j++) { - _vector$8.fromBufferAttribute(morphAttribute, j); - if (morphTargetsRelative) { - _offset.fromBufferAttribute(position, j); - _vector$8.add(_offset); - } - maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8)); - } - } - } - this.boundingSphere.radius = Math.sqrt(maxRadiusSq); - if (isNaN(this.boundingSphere.radius)) { - console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this); - } - } - } - computeTangents() { - const index = this.index; - const attributes = this.attributes; - if (index === null || attributes.position === void 0 || attributes.normal === void 0 || attributes.uv === void 0) { - console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)"); - return; - } - const positionAttribute = attributes.position; - const normalAttribute = attributes.normal; - const uvAttribute = attributes.uv; - if (this.hasAttribute("tangent") === false) { - this.setAttribute("tangent", new BufferAttribute(new Float32Array(4 * positionAttribute.count), 4)); - } - const tangentAttribute = this.getAttribute("tangent"); - const tan1 = [], tan2 = []; - for (let i = 0; i < positionAttribute.count; i++) { - tan1[i] = new Vector3(); - tan2[i] = new Vector3(); - } - const vA = new Vector3(), vB = new Vector3(), vC = new Vector3(), uvA = new Vector2(), uvB = new Vector2(), uvC = new Vector2(), sdir = new Vector3(), tdir = new Vector3(); - function handleTriangle(a, b, c) { - vA.fromBufferAttribute(positionAttribute, a); - vB.fromBufferAttribute(positionAttribute, b); - vC.fromBufferAttribute(positionAttribute, c); - uvA.fromBufferAttribute(uvAttribute, a); - uvB.fromBufferAttribute(uvAttribute, b); - uvC.fromBufferAttribute(uvAttribute, c); - vB.sub(vA); - vC.sub(vA); - uvB.sub(uvA); - uvC.sub(uvA); - const r = 1 / (uvB.x * uvC.y - uvC.x * uvB.y); - if (!isFinite(r)) return; - sdir.copy(vB).multiplyScalar(uvC.y).addScaledVector(vC, -uvB.y).multiplyScalar(r); - tdir.copy(vC).multiplyScalar(uvB.x).addScaledVector(vB, -uvC.x).multiplyScalar(r); - tan1[a].add(sdir); - tan1[b].add(sdir); - tan1[c].add(sdir); - tan2[a].add(tdir); - tan2[b].add(tdir); - tan2[c].add(tdir); - } - __name(handleTriangle, "handleTriangle"); - let groups = this.groups; - if (groups.length === 0) { - groups = [{ - start: 0, - count: index.count - }]; - } - for (let i = 0, il = groups.length; i < il; ++i) { - const group = groups[i]; - const start = group.start; - const count = group.count; - for (let j = start, jl = start + count; j < jl; j += 3) { - handleTriangle( - index.getX(j + 0), - index.getX(j + 1), - index.getX(j + 2) - ); - } - } - const tmp2 = new Vector3(), tmp22 = new Vector3(); - const n = new Vector3(), n2 = new Vector3(); - function handleVertex(v) { - n.fromBufferAttribute(normalAttribute, v); - n2.copy(n); - const t2 = tan1[v]; - tmp2.copy(t2); - tmp2.sub(n.multiplyScalar(n.dot(t2))).normalize(); - tmp22.crossVectors(n2, t2); - const test = tmp22.dot(tan2[v]); - const w = test < 0 ? -1 : 1; - tangentAttribute.setXYZW(v, tmp2.x, tmp2.y, tmp2.z, w); - } - __name(handleVertex, "handleVertex"); - for (let i = 0, il = groups.length; i < il; ++i) { - const group = groups[i]; - const start = group.start; - const count = group.count; - for (let j = start, jl = start + count; j < jl; j += 3) { - handleVertex(index.getX(j + 0)); - handleVertex(index.getX(j + 1)); - handleVertex(index.getX(j + 2)); - } - } - } - computeVertexNormals() { - const index = this.index; - const positionAttribute = this.getAttribute("position"); - if (positionAttribute !== void 0) { - let normalAttribute = this.getAttribute("normal"); - if (normalAttribute === void 0) { - normalAttribute = new BufferAttribute(new Float32Array(positionAttribute.count * 3), 3); - this.setAttribute("normal", normalAttribute); - } else { - for (let i = 0, il = normalAttribute.count; i < il; i++) { - normalAttribute.setXYZ(i, 0, 0, 0); - } - } - const pA = new Vector3(), pB = new Vector3(), pC = new Vector3(); - const nA = new Vector3(), nB = new Vector3(), nC = new Vector3(); - const cb = new Vector3(), ab = new Vector3(); - if (index) { - for (let i = 0, il = index.count; i < il; i += 3) { - const vA = index.getX(i + 0); - const vB = index.getX(i + 1); - const vC = index.getX(i + 2); - pA.fromBufferAttribute(positionAttribute, vA); - pB.fromBufferAttribute(positionAttribute, vB); - pC.fromBufferAttribute(positionAttribute, vC); - cb.subVectors(pC, pB); - ab.subVectors(pA, pB); - cb.cross(ab); - nA.fromBufferAttribute(normalAttribute, vA); - nB.fromBufferAttribute(normalAttribute, vB); - nC.fromBufferAttribute(normalAttribute, vC); - nA.add(cb); - nB.add(cb); - nC.add(cb); - normalAttribute.setXYZ(vA, nA.x, nA.y, nA.z); - normalAttribute.setXYZ(vB, nB.x, nB.y, nB.z); - normalAttribute.setXYZ(vC, nC.x, nC.y, nC.z); - } - } else { - for (let i = 0, il = positionAttribute.count; i < il; i += 3) { - pA.fromBufferAttribute(positionAttribute, i + 0); - pB.fromBufferAttribute(positionAttribute, i + 1); - pC.fromBufferAttribute(positionAttribute, i + 2); - cb.subVectors(pC, pB); - ab.subVectors(pA, pB); - cb.cross(ab); - normalAttribute.setXYZ(i + 0, cb.x, cb.y, cb.z); - normalAttribute.setXYZ(i + 1, cb.x, cb.y, cb.z); - normalAttribute.setXYZ(i + 2, cb.x, cb.y, cb.z); - } - } - this.normalizeNormals(); - normalAttribute.needsUpdate = true; - } - } - normalizeNormals() { - const normals = this.attributes.normal; - for (let i = 0, il = normals.count; i < il; i++) { - _vector$8.fromBufferAttribute(normals, i); - _vector$8.normalize(); - normals.setXYZ(i, _vector$8.x, _vector$8.y, _vector$8.z); - } - } - toNonIndexed() { - function convertBufferAttribute(attribute, indices2) { - const array = attribute.array; - const itemSize = attribute.itemSize; - const normalized = attribute.normalized; - const array2 = new array.constructor(indices2.length * itemSize); - let index = 0, index2 = 0; - for (let i = 0, l = indices2.length; i < l; i++) { - if (attribute.isInterleavedBufferAttribute) { - index = indices2[i] * attribute.data.stride + attribute.offset; - } else { - index = indices2[i] * itemSize; - } - for (let j = 0; j < itemSize; j++) { - array2[index2++] = array[index++]; - } - } - return new BufferAttribute(array2, itemSize, normalized); - } - __name(convertBufferAttribute, "convertBufferAttribute"); - if (this.index === null) { - console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."); - return this; - } - const geometry2 = new BufferGeometry(); - const indices = this.index.array; - const attributes = this.attributes; - for (const name in attributes) { - const attribute = attributes[name]; - const newAttribute = convertBufferAttribute(attribute, indices); - geometry2.setAttribute(name, newAttribute); - } - const morphAttributes = this.morphAttributes; - for (const name in morphAttributes) { - const morphArray = []; - const morphAttribute = morphAttributes[name]; - for (let i = 0, il = morphAttribute.length; i < il; i++) { - const attribute = morphAttribute[i]; - const newAttribute = convertBufferAttribute(attribute, indices); - morphArray.push(newAttribute); - } - geometry2.morphAttributes[name] = morphArray; - } - geometry2.morphTargetsRelative = this.morphTargetsRelative; - const groups = this.groups; - for (let i = 0, l = groups.length; i < l; i++) { - const group = groups[i]; - geometry2.addGroup(group.start, group.count, group.materialIndex); - } - return geometry2; - } - toJSON() { - const data = { - metadata: { - version: 4.6, - type: "BufferGeometry", - generator: "BufferGeometry.toJSON" - } - }; - data.uuid = this.uuid; - data.type = this.type; - if (this.name !== "") data.name = this.name; - if (Object.keys(this.userData).length > 0) data.userData = this.userData; - if (this.parameters !== void 0) { - const parameters = this.parameters; - for (const key in parameters) { - if (parameters[key] !== void 0) data[key] = parameters[key]; - } - return data; - } - data.data = { attributes: {} }; - const index = this.index; - if (index !== null) { - data.data.index = { - type: index.array.constructor.name, - array: Array.prototype.slice.call(index.array) - }; - } - const attributes = this.attributes; - for (const key in attributes) { - const attribute = attributes[key]; - data.data.attributes[key] = attribute.toJSON(data.data); - } - const morphAttributes = {}; - let hasMorphAttributes = false; - for (const key in this.morphAttributes) { - const attributeArray = this.morphAttributes[key]; - const array = []; - for (let i = 0, il = attributeArray.length; i < il; i++) { - const attribute = attributeArray[i]; - array.push(attribute.toJSON(data.data)); - } - if (array.length > 0) { - morphAttributes[key] = array; - hasMorphAttributes = true; - } - } - if (hasMorphAttributes) { - data.data.morphAttributes = morphAttributes; - data.data.morphTargetsRelative = this.morphTargetsRelative; - } - const groups = this.groups; - if (groups.length > 0) { - data.data.groups = JSON.parse(JSON.stringify(groups)); - } - const boundingSphere = this.boundingSphere; - if (boundingSphere !== null) { - data.data.boundingSphere = { - center: boundingSphere.center.toArray(), - radius: boundingSphere.radius - }; - } - return data; - } - clone() { - return new this.constructor().copy(this); - } - copy(source) { - this.index = null; - this.attributes = {}; - this.morphAttributes = {}; - this.groups = []; - this.boundingBox = null; - this.boundingSphere = null; - const data = {}; - this.name = source.name; - const index = source.index; - if (index !== null) { - this.setIndex(index.clone(data)); - } - const attributes = source.attributes; - for (const name in attributes) { - const attribute = attributes[name]; - this.setAttribute(name, attribute.clone(data)); - } - const morphAttributes = source.morphAttributes; - for (const name in morphAttributes) { - const array = []; - const morphAttribute = morphAttributes[name]; - for (let i = 0, l = morphAttribute.length; i < l; i++) { - array.push(morphAttribute[i].clone(data)); - } - this.morphAttributes[name] = array; - } - this.morphTargetsRelative = source.morphTargetsRelative; - const groups = source.groups; - for (let i = 0, l = groups.length; i < l; i++) { - const group = groups[i]; - this.addGroup(group.start, group.count, group.materialIndex); - } - const boundingBox = source.boundingBox; - if (boundingBox !== null) { - this.boundingBox = boundingBox.clone(); - } - const boundingSphere = source.boundingSphere; - if (boundingSphere !== null) { - this.boundingSphere = boundingSphere.clone(); - } - this.drawRange.start = source.drawRange.start; - this.drawRange.count = source.drawRange.count; - this.userData = source.userData; - return this; - } - dispose() { - this.dispatchEvent({ type: "dispose" }); - } -} -const _inverseMatrix$3 = /* @__PURE__ */ new Matrix4(); -const _ray$3 = /* @__PURE__ */ new Ray(); -const _sphere$6 = /* @__PURE__ */ new Sphere(); -const _sphereHitAt = /* @__PURE__ */ new Vector3(); -const _vA$1 = /* @__PURE__ */ new Vector3(); -const _vB$1 = /* @__PURE__ */ new Vector3(); -const _vC$1 = /* @__PURE__ */ new Vector3(); -const _tempA = /* @__PURE__ */ new Vector3(); -const _morphA = /* @__PURE__ */ new Vector3(); -const _intersectionPoint = /* @__PURE__ */ new Vector3(); -const _intersectionPointWorld = /* @__PURE__ */ new Vector3(); -class Mesh extends Object3D { - static { - __name(this, "Mesh"); - } - constructor(geometry = new BufferGeometry(), material = new MeshBasicMaterial()) { - super(); - this.isMesh = true; - this.type = "Mesh"; - this.geometry = geometry; - this.material = material; - this.updateMorphTargets(); - } - copy(source, recursive) { - super.copy(source, recursive); - if (source.morphTargetInfluences !== void 0) { - this.morphTargetInfluences = source.morphTargetInfluences.slice(); - } - if (source.morphTargetDictionary !== void 0) { - this.morphTargetDictionary = Object.assign({}, source.morphTargetDictionary); - } - this.material = Array.isArray(source.material) ? source.material.slice() : source.material; - this.geometry = source.geometry; - return this; - } - updateMorphTargets() { - const geometry = this.geometry; - const morphAttributes = geometry.morphAttributes; - const keys = Object.keys(morphAttributes); - if (keys.length > 0) { - const morphAttribute = morphAttributes[keys[0]]; - if (morphAttribute !== void 0) { - this.morphTargetInfluences = []; - this.morphTargetDictionary = {}; - for (let m = 0, ml = morphAttribute.length; m < ml; m++) { - const name = morphAttribute[m].name || String(m); - this.morphTargetInfluences.push(0); - this.morphTargetDictionary[name] = m; - } - } - } - } - getVertexPosition(index, target) { - const geometry = this.geometry; - const position = geometry.attributes.position; - const morphPosition = geometry.morphAttributes.position; - const morphTargetsRelative = geometry.morphTargetsRelative; - target.fromBufferAttribute(position, index); - const morphInfluences = this.morphTargetInfluences; - if (morphPosition && morphInfluences) { - _morphA.set(0, 0, 0); - for (let i = 0, il = morphPosition.length; i < il; i++) { - const influence = morphInfluences[i]; - const morphAttribute = morphPosition[i]; - if (influence === 0) continue; - _tempA.fromBufferAttribute(morphAttribute, index); - if (morphTargetsRelative) { - _morphA.addScaledVector(_tempA, influence); - } else { - _morphA.addScaledVector(_tempA.sub(target), influence); - } - } - target.add(_morphA); - } - return target; - } - raycast(raycaster, intersects2) { - const geometry = this.geometry; - const material = this.material; - const matrixWorld = this.matrixWorld; - if (material === void 0) return; - if (geometry.boundingSphere === null) geometry.computeBoundingSphere(); - _sphere$6.copy(geometry.boundingSphere); - _sphere$6.applyMatrix4(matrixWorld); - _ray$3.copy(raycaster.ray).recast(raycaster.near); - if (_sphere$6.containsPoint(_ray$3.origin) === false) { - if (_ray$3.intersectSphere(_sphere$6, _sphereHitAt) === null) return; - if (_ray$3.origin.distanceToSquared(_sphereHitAt) > (raycaster.far - raycaster.near) ** 2) return; - } - _inverseMatrix$3.copy(matrixWorld).invert(); - _ray$3.copy(raycaster.ray).applyMatrix4(_inverseMatrix$3); - if (geometry.boundingBox !== null) { - if (_ray$3.intersectsBox(geometry.boundingBox) === false) return; - } - this._computeIntersections(raycaster, intersects2, _ray$3); - } - _computeIntersections(raycaster, intersects2, rayLocalSpace) { - let intersection; - const geometry = this.geometry; - const material = this.material; - const index = geometry.index; - const position = geometry.attributes.position; - const uv = geometry.attributes.uv; - const uv1 = geometry.attributes.uv1; - const normal = geometry.attributes.normal; - const groups = geometry.groups; - const drawRange = geometry.drawRange; - if (index !== null) { - if (Array.isArray(material)) { - for (let i = 0, il = groups.length; i < il; i++) { - const group = groups[i]; - const groupMaterial = material[group.materialIndex]; - const start = Math.max(group.start, drawRange.start); - const end = Math.min(index.count, Math.min(group.start + group.count, drawRange.start + drawRange.count)); - for (let j = start, jl = end; j < jl; j += 3) { - const a = index.getX(j); - const b = index.getX(j + 1); - const c = index.getX(j + 2); - intersection = checkGeometryIntersection(this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c); - if (intersection) { - intersection.faceIndex = Math.floor(j / 3); - intersection.face.materialIndex = group.materialIndex; - intersects2.push(intersection); - } - } - } - } else { - const start = Math.max(0, drawRange.start); - const end = Math.min(index.count, drawRange.start + drawRange.count); - for (let i = start, il = end; i < il; i += 3) { - const a = index.getX(i); - const b = index.getX(i + 1); - const c = index.getX(i + 2); - intersection = checkGeometryIntersection(this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c); - if (intersection) { - intersection.faceIndex = Math.floor(i / 3); - intersects2.push(intersection); - } - } - } - } else if (position !== void 0) { - if (Array.isArray(material)) { - for (let i = 0, il = groups.length; i < il; i++) { - const group = groups[i]; - const groupMaterial = material[group.materialIndex]; - const start = Math.max(group.start, drawRange.start); - const end = Math.min(position.count, Math.min(group.start + group.count, drawRange.start + drawRange.count)); - for (let j = start, jl = end; j < jl; j += 3) { - const a = j; - const b = j + 1; - const c = j + 2; - intersection = checkGeometryIntersection(this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c); - if (intersection) { - intersection.faceIndex = Math.floor(j / 3); - intersection.face.materialIndex = group.materialIndex; - intersects2.push(intersection); - } - } - } - } else { - const start = Math.max(0, drawRange.start); - const end = Math.min(position.count, drawRange.start + drawRange.count); - for (let i = start, il = end; i < il; i += 3) { - const a = i; - const b = i + 1; - const c = i + 2; - intersection = checkGeometryIntersection(this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c); - if (intersection) { - intersection.faceIndex = Math.floor(i / 3); - intersects2.push(intersection); - } - } - } - } - } -} -function checkIntersection$1(object, material, raycaster, ray, pA, pB, pC, point) { - let intersect2; - if (material.side === BackSide) { - intersect2 = ray.intersectTriangle(pC, pB, pA, true, point); - } else { - intersect2 = ray.intersectTriangle(pA, pB, pC, material.side === FrontSide, point); - } - if (intersect2 === null) return null; - _intersectionPointWorld.copy(point); - _intersectionPointWorld.applyMatrix4(object.matrixWorld); - const distance = raycaster.ray.origin.distanceTo(_intersectionPointWorld); - if (distance < raycaster.near || distance > raycaster.far) return null; - return { - distance, - point: _intersectionPointWorld.clone(), - object - }; -} -__name(checkIntersection$1, "checkIntersection$1"); -function checkGeometryIntersection(object, material, raycaster, ray, uv, uv1, normal, a, b, c) { - object.getVertexPosition(a, _vA$1); - object.getVertexPosition(b, _vB$1); - object.getVertexPosition(c, _vC$1); - const intersection = checkIntersection$1(object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint); - if (intersection) { - const barycoord = new Vector3(); - Triangle.getBarycoord(_intersectionPoint, _vA$1, _vB$1, _vC$1, barycoord); - if (uv) { - intersection.uv = Triangle.getInterpolatedAttribute(uv, a, b, c, barycoord, new Vector2()); - } - if (uv1) { - intersection.uv1 = Triangle.getInterpolatedAttribute(uv1, a, b, c, barycoord, new Vector2()); - } - if (normal) { - intersection.normal = Triangle.getInterpolatedAttribute(normal, a, b, c, barycoord, new Vector3()); - if (intersection.normal.dot(ray.direction) > 0) { - intersection.normal.multiplyScalar(-1); - } - } - const face = { - a, - b, - c, - normal: new Vector3(), - materialIndex: 0 - }; - Triangle.getNormal(_vA$1, _vB$1, _vC$1, face.normal); - intersection.face = face; - intersection.barycoord = barycoord; - } - return intersection; -} -__name(checkGeometryIntersection, "checkGeometryIntersection"); -class BoxGeometry extends BufferGeometry { - static { - __name(this, "BoxGeometry"); - } - constructor(width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1) { - super(); - this.type = "BoxGeometry"; - this.parameters = { - width, - height, - depth, - widthSegments, - heightSegments, - depthSegments - }; - const scope = this; - widthSegments = Math.floor(widthSegments); - heightSegments = Math.floor(heightSegments); - depthSegments = Math.floor(depthSegments); - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; - let numberOfVertices = 0; - let groupStart = 0; - buildPlane("z", "y", "x", -1, -1, depth, height, width, depthSegments, heightSegments, 0); - buildPlane("z", "y", "x", 1, -1, depth, height, -width, depthSegments, heightSegments, 1); - buildPlane("x", "z", "y", 1, 1, width, depth, height, widthSegments, depthSegments, 2); - buildPlane("x", "z", "y", 1, -1, width, depth, -height, widthSegments, depthSegments, 3); - buildPlane("x", "y", "z", 1, -1, width, height, depth, widthSegments, heightSegments, 4); - buildPlane("x", "y", "z", -1, -1, width, height, -depth, widthSegments, heightSegments, 5); - this.setIndex(indices); - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); - function buildPlane(u, v, w, udir, vdir, width2, height2, depth2, gridX, gridY, materialIndex) { - const segmentWidth = width2 / gridX; - const segmentHeight = height2 / gridY; - const widthHalf = width2 / 2; - const heightHalf = height2 / 2; - const depthHalf = depth2 / 2; - const gridX1 = gridX + 1; - const gridY1 = gridY + 1; - let vertexCounter = 0; - let groupCount = 0; - const vector = new Vector3(); - for (let iy = 0; iy < gridY1; iy++) { - const y = iy * segmentHeight - heightHalf; - for (let ix = 0; ix < gridX1; ix++) { - const x = ix * segmentWidth - widthHalf; - vector[u] = x * udir; - vector[v] = y * vdir; - vector[w] = depthHalf; - vertices.push(vector.x, vector.y, vector.z); - vector[u] = 0; - vector[v] = 0; - vector[w] = depth2 > 0 ? 1 : -1; - normals.push(vector.x, vector.y, vector.z); - uvs.push(ix / gridX); - uvs.push(1 - iy / gridY); - vertexCounter += 1; - } - } - for (let iy = 0; iy < gridY; iy++) { - for (let ix = 0; ix < gridX; ix++) { - const a = numberOfVertices + ix + gridX1 * iy; - const b = numberOfVertices + ix + gridX1 * (iy + 1); - const c = numberOfVertices + (ix + 1) + gridX1 * (iy + 1); - const d = numberOfVertices + (ix + 1) + gridX1 * iy; - indices.push(a, b, d); - indices.push(b, c, d); - groupCount += 6; - } - } - scope.addGroup(groupStart, groupCount, materialIndex); - groupStart += groupCount; - numberOfVertices += vertexCounter; - } - __name(buildPlane, "buildPlane"); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - static fromJSON(data) { - return new BoxGeometry(data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments); - } -} -function cloneUniforms(src) { - const dst = {}; - for (const u in src) { - dst[u] = {}; - for (const p in src[u]) { - const property = src[u][p]; - if (property && (property.isColor || property.isMatrix3 || property.isMatrix4 || property.isVector2 || property.isVector3 || property.isVector4 || property.isTexture || property.isQuaternion)) { - if (property.isRenderTargetTexture) { - console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."); - dst[u][p] = null; - } else { - dst[u][p] = property.clone(); - } - } else if (Array.isArray(property)) { - dst[u][p] = property.slice(); - } else { - dst[u][p] = property; - } - } - } - return dst; -} -__name(cloneUniforms, "cloneUniforms"); -function mergeUniforms(uniforms) { - const merged = {}; - for (let u = 0; u < uniforms.length; u++) { - const tmp2 = cloneUniforms(uniforms[u]); - for (const p in tmp2) { - merged[p] = tmp2[p]; - } - } - return merged; -} -__name(mergeUniforms, "mergeUniforms"); -function cloneUniformsGroups(src) { - const dst = []; - for (let u = 0; u < src.length; u++) { - dst.push(src[u].clone()); - } - return dst; -} -__name(cloneUniformsGroups, "cloneUniformsGroups"); -function getUnlitUniformColorSpace(renderer) { - const currentRenderTarget = renderer.getRenderTarget(); - if (currentRenderTarget === null) { - return renderer.outputColorSpace; - } - if (currentRenderTarget.isXRRenderTarget === true) { - return currentRenderTarget.texture.colorSpace; - } - return ColorManagement.workingColorSpace; -} -__name(getUnlitUniformColorSpace, "getUnlitUniformColorSpace"); -const UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms }; -var default_vertex = "void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"; -var default_fragment = "void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}"; -class ShaderMaterial extends Material { - static { - __name(this, "ShaderMaterial"); - } - static get type() { - return "ShaderMaterial"; - } - constructor(parameters) { - super(); - this.isShaderMaterial = true; - this.defines = {}; - this.uniforms = {}; - this.uniformsGroups = []; - this.vertexShader = default_vertex; - this.fragmentShader = default_fragment; - this.linewidth = 1; - this.wireframe = false; - this.wireframeLinewidth = 1; - this.fog = false; - this.lights = false; - this.clipping = false; - this.forceSinglePass = true; - this.extensions = { - clipCullDistance: false, - // set to use vertex shader clipping - multiDraw: false - // set to use vertex shader multi_draw / enable gl_DrawID - }; - this.defaultAttributeValues = { - "color": [1, 1, 1], - "uv": [0, 0], - "uv1": [0, 0] - }; - this.index0AttributeName = void 0; - this.uniformsNeedUpdate = false; - this.glslVersion = null; - if (parameters !== void 0) { - this.setValues(parameters); - } - } - copy(source) { - super.copy(source); - this.fragmentShader = source.fragmentShader; - this.vertexShader = source.vertexShader; - this.uniforms = cloneUniforms(source.uniforms); - this.uniformsGroups = cloneUniformsGroups(source.uniformsGroups); - this.defines = Object.assign({}, source.defines); - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.fog = source.fog; - this.lights = source.lights; - this.clipping = source.clipping; - this.extensions = Object.assign({}, source.extensions); - this.glslVersion = source.glslVersion; - return this; - } - toJSON(meta) { - const data = super.toJSON(meta); - data.glslVersion = this.glslVersion; - data.uniforms = {}; - for (const name in this.uniforms) { - const uniform = this.uniforms[name]; - const value = uniform.value; - if (value && value.isTexture) { - data.uniforms[name] = { - type: "t", - value: value.toJSON(meta).uuid - }; - } else if (value && value.isColor) { - data.uniforms[name] = { - type: "c", - value: value.getHex() - }; - } else if (value && value.isVector2) { - data.uniforms[name] = { - type: "v2", - value: value.toArray() - }; - } else if (value && value.isVector3) { - data.uniforms[name] = { - type: "v3", - value: value.toArray() - }; - } else if (value && value.isVector4) { - data.uniforms[name] = { - type: "v4", - value: value.toArray() - }; - } else if (value && value.isMatrix3) { - data.uniforms[name] = { - type: "m3", - value: value.toArray() - }; - } else if (value && value.isMatrix4) { - data.uniforms[name] = { - type: "m4", - value: value.toArray() - }; - } else { - data.uniforms[name] = { - value - }; - } - } - if (Object.keys(this.defines).length > 0) data.defines = this.defines; - data.vertexShader = this.vertexShader; - data.fragmentShader = this.fragmentShader; - data.lights = this.lights; - data.clipping = this.clipping; - const extensions = {}; - for (const key in this.extensions) { - if (this.extensions[key] === true) extensions[key] = true; - } - if (Object.keys(extensions).length > 0) data.extensions = extensions; - return data; - } -} -class Camera extends Object3D { - static { - __name(this, "Camera"); - } - constructor() { - super(); - this.isCamera = true; - this.type = "Camera"; - this.matrixWorldInverse = new Matrix4(); - this.projectionMatrix = new Matrix4(); - this.projectionMatrixInverse = new Matrix4(); - this.coordinateSystem = WebGLCoordinateSystem; - } - copy(source, recursive) { - super.copy(source, recursive); - this.matrixWorldInverse.copy(source.matrixWorldInverse); - this.projectionMatrix.copy(source.projectionMatrix); - this.projectionMatrixInverse.copy(source.projectionMatrixInverse); - this.coordinateSystem = source.coordinateSystem; - return this; - } - getWorldDirection(target) { - return super.getWorldDirection(target).negate(); - } - updateMatrixWorld(force) { - super.updateMatrixWorld(force); - this.matrixWorldInverse.copy(this.matrixWorld).invert(); - } - updateWorldMatrix(updateParents, updateChildren) { - super.updateWorldMatrix(updateParents, updateChildren); - this.matrixWorldInverse.copy(this.matrixWorld).invert(); - } - clone() { - return new this.constructor().copy(this); - } -} -const _v3$1 = /* @__PURE__ */ new Vector3(); -const _minTarget = /* @__PURE__ */ new Vector2(); -const _maxTarget = /* @__PURE__ */ new Vector2(); -class PerspectiveCamera extends Camera { - static { - __name(this, "PerspectiveCamera"); - } - constructor(fov2 = 50, aspect2 = 1, near = 0.1, far = 2e3) { - super(); - this.isPerspectiveCamera = true; - this.type = "PerspectiveCamera"; - this.fov = fov2; - this.zoom = 1; - this.near = near; - this.far = far; - this.focus = 10; - this.aspect = aspect2; - this.view = null; - this.filmGauge = 35; - this.filmOffset = 0; - this.updateProjectionMatrix(); - } - copy(source, recursive) { - super.copy(source, recursive); - this.fov = source.fov; - this.zoom = source.zoom; - this.near = source.near; - this.far = source.far; - this.focus = source.focus; - this.aspect = source.aspect; - this.view = source.view === null ? null : Object.assign({}, source.view); - this.filmGauge = source.filmGauge; - this.filmOffset = source.filmOffset; - return this; - } - /** - * Sets the FOV by focal length in respect to the current .filmGauge. - * - * The default film gauge is 35, so that the focal length can be specified for - * a 35mm (full frame) camera. - * - * Values for focal length and film gauge must have the same unit. - */ - setFocalLength(focalLength) { - const vExtentSlope = 0.5 * this.getFilmHeight() / focalLength; - this.fov = RAD2DEG * 2 * Math.atan(vExtentSlope); - this.updateProjectionMatrix(); - } - /** - * Calculates the focal length from the current .fov and .filmGauge. - */ - getFocalLength() { - const vExtentSlope = Math.tan(DEG2RAD * 0.5 * this.fov); - return 0.5 * this.getFilmHeight() / vExtentSlope; - } - getEffectiveFOV() { - return RAD2DEG * 2 * Math.atan( - Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom - ); - } - getFilmWidth() { - return this.filmGauge * Math.min(this.aspect, 1); - } - getFilmHeight() { - return this.filmGauge / Math.max(this.aspect, 1); - } - /** - * Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction. - * Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle. - */ - getViewBounds(distance, minTarget, maxTarget) { - _v3$1.set(-1, -1, 0.5).applyMatrix4(this.projectionMatrixInverse); - minTarget.set(_v3$1.x, _v3$1.y).multiplyScalar(-distance / _v3$1.z); - _v3$1.set(1, 1, 0.5).applyMatrix4(this.projectionMatrixInverse); - maxTarget.set(_v3$1.x, _v3$1.y).multiplyScalar(-distance / _v3$1.z); - } - /** - * Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction. - * Copies the result into the target Vector2, where x is width and y is height. - */ - getViewSize(distance, target) { - this.getViewBounds(distance, _minTarget, _maxTarget); - return target.subVectors(_maxTarget, _minTarget); - } - /** - * Sets an offset in a larger frustum. This is useful for multi-window or - * multi-monitor/multi-machine setups. - * - * For example, if you have 3x2 monitors and each monitor is 1920x1080 and - * the monitors are in grid like this - * - * +---+---+---+ - * | A | B | C | - * +---+---+---+ - * | D | E | F | - * +---+---+---+ - * - * then for each monitor you would call it like this - * - * const w = 1920; - * const h = 1080; - * const fullWidth = w * 3; - * const fullHeight = h * 2; - * - * --A-- - * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); - * --B-- - * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); - * --C-- - * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); - * --D-- - * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); - * --E-- - * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); - * --F-- - * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); - * - * Note there is no reason monitors have to be the same size or in a grid. - */ - setViewOffset(fullWidth, fullHeight, x, y, width, height) { - this.aspect = fullWidth / fullHeight; - if (this.view === null) { - this.view = { - enabled: true, - fullWidth: 1, - fullHeight: 1, - offsetX: 0, - offsetY: 0, - width: 1, - height: 1 - }; - } - this.view.enabled = true; - this.view.fullWidth = fullWidth; - this.view.fullHeight = fullHeight; - this.view.offsetX = x; - this.view.offsetY = y; - this.view.width = width; - this.view.height = height; - this.updateProjectionMatrix(); - } - clearViewOffset() { - if (this.view !== null) { - this.view.enabled = false; - } - this.updateProjectionMatrix(); - } - updateProjectionMatrix() { - const near = this.near; - let top = near * Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom; - let height = 2 * top; - let width = this.aspect * height; - let left = -0.5 * width; - const view = this.view; - if (this.view !== null && this.view.enabled) { - const fullWidth = view.fullWidth, fullHeight = view.fullHeight; - left += view.offsetX * width / fullWidth; - top -= view.offsetY * height / fullHeight; - width *= view.width / fullWidth; - height *= view.height / fullHeight; - } - const skew = this.filmOffset; - if (skew !== 0) left += near * skew / this.getFilmWidth(); - this.projectionMatrix.makePerspective(left, left + width, top, top - height, near, this.far, this.coordinateSystem); - this.projectionMatrixInverse.copy(this.projectionMatrix).invert(); - } - toJSON(meta) { - const data = super.toJSON(meta); - data.object.fov = this.fov; - data.object.zoom = this.zoom; - data.object.near = this.near; - data.object.far = this.far; - data.object.focus = this.focus; - data.object.aspect = this.aspect; - if (this.view !== null) data.object.view = Object.assign({}, this.view); - data.object.filmGauge = this.filmGauge; - data.object.filmOffset = this.filmOffset; - return data; - } -} -const fov = -90; -const aspect = 1; -class CubeCamera extends Object3D { - static { - __name(this, "CubeCamera"); - } - constructor(near, far, renderTarget) { - super(); - this.type = "CubeCamera"; - this.renderTarget = renderTarget; - this.coordinateSystem = null; - this.activeMipmapLevel = 0; - const cameraPX = new PerspectiveCamera(fov, aspect, near, far); - cameraPX.layers = this.layers; - this.add(cameraPX); - const cameraNX = new PerspectiveCamera(fov, aspect, near, far); - cameraNX.layers = this.layers; - this.add(cameraNX); - const cameraPY = new PerspectiveCamera(fov, aspect, near, far); - cameraPY.layers = this.layers; - this.add(cameraPY); - const cameraNY = new PerspectiveCamera(fov, aspect, near, far); - cameraNY.layers = this.layers; - this.add(cameraNY); - const cameraPZ = new PerspectiveCamera(fov, aspect, near, far); - cameraPZ.layers = this.layers; - this.add(cameraPZ); - const cameraNZ = new PerspectiveCamera(fov, aspect, near, far); - cameraNZ.layers = this.layers; - this.add(cameraNZ); - } - updateCoordinateSystem() { - const coordinateSystem = this.coordinateSystem; - const cameras = this.children.concat(); - const [cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ] = cameras; - for (const camera of cameras) this.remove(camera); - if (coordinateSystem === WebGLCoordinateSystem) { - cameraPX.up.set(0, 1, 0); - cameraPX.lookAt(1, 0, 0); - cameraNX.up.set(0, 1, 0); - cameraNX.lookAt(-1, 0, 0); - cameraPY.up.set(0, 0, -1); - cameraPY.lookAt(0, 1, 0); - cameraNY.up.set(0, 0, 1); - cameraNY.lookAt(0, -1, 0); - cameraPZ.up.set(0, 1, 0); - cameraPZ.lookAt(0, 0, 1); - cameraNZ.up.set(0, 1, 0); - cameraNZ.lookAt(0, 0, -1); - } else if (coordinateSystem === WebGPUCoordinateSystem) { - cameraPX.up.set(0, -1, 0); - cameraPX.lookAt(-1, 0, 0); - cameraNX.up.set(0, -1, 0); - cameraNX.lookAt(1, 0, 0); - cameraPY.up.set(0, 0, 1); - cameraPY.lookAt(0, 1, 0); - cameraNY.up.set(0, 0, -1); - cameraNY.lookAt(0, -1, 0); - cameraPZ.up.set(0, -1, 0); - cameraPZ.lookAt(0, 0, 1); - cameraNZ.up.set(0, -1, 0); - cameraNZ.lookAt(0, 0, -1); - } else { - throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: " + coordinateSystem); - } - for (const camera of cameras) { - this.add(camera); - camera.updateMatrixWorld(); - } - } - update(renderer, scene) { - if (this.parent === null) this.updateMatrixWorld(); - const { renderTarget, activeMipmapLevel } = this; - if (this.coordinateSystem !== renderer.coordinateSystem) { - this.coordinateSystem = renderer.coordinateSystem; - this.updateCoordinateSystem(); - } - const [cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ] = this.children; - const currentRenderTarget = renderer.getRenderTarget(); - const currentActiveCubeFace = renderer.getActiveCubeFace(); - const currentActiveMipmapLevel = renderer.getActiveMipmapLevel(); - const currentXrEnabled = renderer.xr.enabled; - renderer.xr.enabled = false; - const generateMipmaps = renderTarget.texture.generateMipmaps; - renderTarget.texture.generateMipmaps = false; - renderer.setRenderTarget(renderTarget, 0, activeMipmapLevel); - renderer.render(scene, cameraPX); - renderer.setRenderTarget(renderTarget, 1, activeMipmapLevel); - renderer.render(scene, cameraNX); - renderer.setRenderTarget(renderTarget, 2, activeMipmapLevel); - renderer.render(scene, cameraPY); - renderer.setRenderTarget(renderTarget, 3, activeMipmapLevel); - renderer.render(scene, cameraNY); - renderer.setRenderTarget(renderTarget, 4, activeMipmapLevel); - renderer.render(scene, cameraPZ); - renderTarget.texture.generateMipmaps = generateMipmaps; - renderer.setRenderTarget(renderTarget, 5, activeMipmapLevel); - renderer.render(scene, cameraNZ); - renderer.setRenderTarget(currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel); - renderer.xr.enabled = currentXrEnabled; - renderTarget.texture.needsPMREMUpdate = true; - } -} -class CubeTexture extends Texture { - static { - __name(this, "CubeTexture"); - } - constructor(images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace) { - images = images !== void 0 ? images : []; - mapping = mapping !== void 0 ? mapping : CubeReflectionMapping; - super(images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace); - this.isCubeTexture = true; - this.flipY = false; - } - get images() { - return this.image; - } - set images(value) { - this.image = value; - } -} -class WebGLCubeRenderTarget extends WebGLRenderTarget { - static { - __name(this, "WebGLCubeRenderTarget"); - } - constructor(size = 1, options = {}) { - super(size, size, options); - this.isWebGLCubeRenderTarget = true; - const image = { width: size, height: size, depth: 1 }; - const images = [image, image, image, image, image, image]; - this.texture = new CubeTexture(images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace); - this.texture.isRenderTargetTexture = true; - this.texture.generateMipmaps = options.generateMipmaps !== void 0 ? options.generateMipmaps : false; - this.texture.minFilter = options.minFilter !== void 0 ? options.minFilter : LinearFilter; - } - fromEquirectangularTexture(renderer, texture) { - this.texture.type = texture.type; - this.texture.colorSpace = texture.colorSpace; - this.texture.generateMipmaps = texture.generateMipmaps; - this.texture.minFilter = texture.minFilter; - this.texture.magFilter = texture.magFilter; - const shader = { - uniforms: { - tEquirect: { value: null } - }, - vertexShader: ( - /* glsl */ - ` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - ` - ), - fragmentShader: ( - /* glsl */ - ` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - ` - ) - }; - const geometry = new BoxGeometry(5, 5, 5); - const material = new ShaderMaterial({ - name: "CubemapFromEquirect", - uniforms: cloneUniforms(shader.uniforms), - vertexShader: shader.vertexShader, - fragmentShader: shader.fragmentShader, - side: BackSide, - blending: NoBlending - }); - material.uniforms.tEquirect.value = texture; - const mesh = new Mesh(geometry, material); - const currentMinFilter = texture.minFilter; - if (texture.minFilter === LinearMipmapLinearFilter) texture.minFilter = LinearFilter; - const camera = new CubeCamera(1, 10, this); - camera.update(renderer, mesh); - texture.minFilter = currentMinFilter; - mesh.geometry.dispose(); - mesh.material.dispose(); - return this; - } - clear(renderer, color, depth, stencil) { - const currentRenderTarget = renderer.getRenderTarget(); - for (let i = 0; i < 6; i++) { - renderer.setRenderTarget(this, i); - renderer.clear(color, depth, stencil); - } - renderer.setRenderTarget(currentRenderTarget); - } -} -const _vector1 = /* @__PURE__ */ new Vector3(); -const _vector2 = /* @__PURE__ */ new Vector3(); -const _normalMatrix = /* @__PURE__ */ new Matrix3(); -class Plane { - static { - __name(this, "Plane"); - } - constructor(normal = new Vector3(1, 0, 0), constant = 0) { - this.isPlane = true; - this.normal = normal; - this.constant = constant; - } - set(normal, constant) { - this.normal.copy(normal); - this.constant = constant; - return this; - } - setComponents(x, y, z, w) { - this.normal.set(x, y, z); - this.constant = w; - return this; - } - setFromNormalAndCoplanarPoint(normal, point) { - this.normal.copy(normal); - this.constant = -point.dot(this.normal); - return this; - } - setFromCoplanarPoints(a, b, c) { - const normal = _vector1.subVectors(c, b).cross(_vector2.subVectors(a, b)).normalize(); - this.setFromNormalAndCoplanarPoint(normal, a); - return this; - } - copy(plane) { - this.normal.copy(plane.normal); - this.constant = plane.constant; - return this; - } - normalize() { - const inverseNormalLength = 1 / this.normal.length(); - this.normal.multiplyScalar(inverseNormalLength); - this.constant *= inverseNormalLength; - return this; - } - negate() { - this.constant *= -1; - this.normal.negate(); - return this; - } - distanceToPoint(point) { - return this.normal.dot(point) + this.constant; - } - distanceToSphere(sphere) { - return this.distanceToPoint(sphere.center) - sphere.radius; - } - projectPoint(point, target) { - return target.copy(point).addScaledVector(this.normal, -this.distanceToPoint(point)); - } - intersectLine(line, target) { - const direction = line.delta(_vector1); - const denominator = this.normal.dot(direction); - if (denominator === 0) { - if (this.distanceToPoint(line.start) === 0) { - return target.copy(line.start); - } - return null; - } - const t2 = -(line.start.dot(this.normal) + this.constant) / denominator; - if (t2 < 0 || t2 > 1) { - return null; - } - return target.copy(line.start).addScaledVector(direction, t2); - } - intersectsLine(line) { - const startSign = this.distanceToPoint(line.start); - const endSign = this.distanceToPoint(line.end); - return startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0; - } - intersectsBox(box) { - return box.intersectsPlane(this); - } - intersectsSphere(sphere) { - return sphere.intersectsPlane(this); - } - coplanarPoint(target) { - return target.copy(this.normal).multiplyScalar(-this.constant); - } - applyMatrix4(matrix, optionalNormalMatrix) { - const normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix); - const referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix); - const normal = this.normal.applyMatrix3(normalMatrix).normalize(); - this.constant = -referencePoint.dot(normal); - return this; - } - translate(offset) { - this.constant -= offset.dot(this.normal); - return this; - } - equals(plane) { - return plane.normal.equals(this.normal) && plane.constant === this.constant; - } - clone() { - return new this.constructor().copy(this); - } -} -const _sphere$5 = /* @__PURE__ */ new Sphere(); -const _vector$7 = /* @__PURE__ */ new Vector3(); -class Frustum { - static { - __name(this, "Frustum"); - } - constructor(p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane()) { - this.planes = [p0, p1, p2, p3, p4, p5]; - } - set(p0, p1, p2, p3, p4, p5) { - const planes = this.planes; - planes[0].copy(p0); - planes[1].copy(p1); - planes[2].copy(p2); - planes[3].copy(p3); - planes[4].copy(p4); - planes[5].copy(p5); - return this; - } - copy(frustum) { - const planes = this.planes; - for (let i = 0; i < 6; i++) { - planes[i].copy(frustum.planes[i]); - } - return this; - } - setFromProjectionMatrix(m, coordinateSystem = WebGLCoordinateSystem) { - const planes = this.planes; - const me = m.elements; - const me0 = me[0], me1 = me[1], me2 = me[2], me3 = me[3]; - const me4 = me[4], me5 = me[5], me6 = me[6], me7 = me[7]; - const me8 = me[8], me9 = me[9], me10 = me[10], me11 = me[11]; - const me12 = me[12], me13 = me[13], me14 = me[14], me15 = me[15]; - planes[0].setComponents(me3 - me0, me7 - me4, me11 - me8, me15 - me12).normalize(); - planes[1].setComponents(me3 + me0, me7 + me4, me11 + me8, me15 + me12).normalize(); - planes[2].setComponents(me3 + me1, me7 + me5, me11 + me9, me15 + me13).normalize(); - planes[3].setComponents(me3 - me1, me7 - me5, me11 - me9, me15 - me13).normalize(); - planes[4].setComponents(me3 - me2, me7 - me6, me11 - me10, me15 - me14).normalize(); - if (coordinateSystem === WebGLCoordinateSystem) { - planes[5].setComponents(me3 + me2, me7 + me6, me11 + me10, me15 + me14).normalize(); - } else if (coordinateSystem === WebGPUCoordinateSystem) { - planes[5].setComponents(me2, me6, me10, me14).normalize(); - } else { - throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: " + coordinateSystem); - } - return this; - } - intersectsObject(object) { - if (object.boundingSphere !== void 0) { - if (object.boundingSphere === null) object.computeBoundingSphere(); - _sphere$5.copy(object.boundingSphere).applyMatrix4(object.matrixWorld); - } else { - const geometry = object.geometry; - if (geometry.boundingSphere === null) geometry.computeBoundingSphere(); - _sphere$5.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld); - } - return this.intersectsSphere(_sphere$5); - } - intersectsSprite(sprite) { - _sphere$5.center.set(0, 0, 0); - _sphere$5.radius = 0.7071067811865476; - _sphere$5.applyMatrix4(sprite.matrixWorld); - return this.intersectsSphere(_sphere$5); - } - intersectsSphere(sphere) { - const planes = this.planes; - const center = sphere.center; - const negRadius = -sphere.radius; - for (let i = 0; i < 6; i++) { - const distance = planes[i].distanceToPoint(center); - if (distance < negRadius) { - return false; - } - } - return true; - } - intersectsBox(box) { - const planes = this.planes; - for (let i = 0; i < 6; i++) { - const plane = planes[i]; - _vector$7.x = plane.normal.x > 0 ? box.max.x : box.min.x; - _vector$7.y = plane.normal.y > 0 ? box.max.y : box.min.y; - _vector$7.z = plane.normal.z > 0 ? box.max.z : box.min.z; - if (plane.distanceToPoint(_vector$7) < 0) { - return false; - } - } - return true; - } - containsPoint(point) { - const planes = this.planes; - for (let i = 0; i < 6; i++) { - if (planes[i].distanceToPoint(point) < 0) { - return false; - } - } - return true; - } - clone() { - return new this.constructor().copy(this); - } -} -function WebGLAnimation() { - let context = null; - let isAnimating = false; - let animationLoop = null; - let requestId = null; - function onAnimationFrame(time, frame) { - animationLoop(time, frame); - requestId = context.requestAnimationFrame(onAnimationFrame); - } - __name(onAnimationFrame, "onAnimationFrame"); - return { - start: /* @__PURE__ */ __name(function() { - if (isAnimating === true) return; - if (animationLoop === null) return; - requestId = context.requestAnimationFrame(onAnimationFrame); - isAnimating = true; - }, "start"), - stop: /* @__PURE__ */ __name(function() { - context.cancelAnimationFrame(requestId); - isAnimating = false; - }, "stop"), - setAnimationLoop: /* @__PURE__ */ __name(function(callback) { - animationLoop = callback; - }, "setAnimationLoop"), - setContext: /* @__PURE__ */ __name(function(value) { - context = value; - }, "setContext") - }; -} -__name(WebGLAnimation, "WebGLAnimation"); -function WebGLAttributes(gl) { - const buffers = /* @__PURE__ */ new WeakMap(); - function createBuffer(attribute, bufferType) { - const array = attribute.array; - const usage = attribute.usage; - const size = array.byteLength; - const buffer = gl.createBuffer(); - gl.bindBuffer(bufferType, buffer); - gl.bufferData(bufferType, array, usage); - attribute.onUploadCallback(); - let type; - if (array instanceof Float32Array) { - type = gl.FLOAT; - } else if (array instanceof Uint16Array) { - if (attribute.isFloat16BufferAttribute) { - type = gl.HALF_FLOAT; - } else { - type = gl.UNSIGNED_SHORT; - } - } else if (array instanceof Int16Array) { - type = gl.SHORT; - } else if (array instanceof Uint32Array) { - type = gl.UNSIGNED_INT; - } else if (array instanceof Int32Array) { - type = gl.INT; - } else if (array instanceof Int8Array) { - type = gl.BYTE; - } else if (array instanceof Uint8Array) { - type = gl.UNSIGNED_BYTE; - } else if (array instanceof Uint8ClampedArray) { - type = gl.UNSIGNED_BYTE; - } else { - throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: " + array); - } - return { - buffer, - type, - bytesPerElement: array.BYTES_PER_ELEMENT, - version: attribute.version, - size - }; - } - __name(createBuffer, "createBuffer"); - function updateBuffer(buffer, attribute, bufferType) { - const array = attribute.array; - const updateRanges = attribute.updateRanges; - gl.bindBuffer(bufferType, buffer); - if (updateRanges.length === 0) { - gl.bufferSubData(bufferType, 0, array); - } else { - updateRanges.sort((a, b) => a.start - b.start); - let mergeIndex = 0; - for (let i = 1; i < updateRanges.length; i++) { - const previousRange = updateRanges[mergeIndex]; - const range = updateRanges[i]; - if (range.start <= previousRange.start + previousRange.count + 1) { - previousRange.count = Math.max( - previousRange.count, - range.start + range.count - previousRange.start - ); - } else { - ++mergeIndex; - updateRanges[mergeIndex] = range; - } - } - updateRanges.length = mergeIndex + 1; - for (let i = 0, l = updateRanges.length; i < l; i++) { - const range = updateRanges[i]; - gl.bufferSubData( - bufferType, - range.start * array.BYTES_PER_ELEMENT, - array, - range.start, - range.count - ); - } - attribute.clearUpdateRanges(); - } - attribute.onUploadCallback(); - } - __name(updateBuffer, "updateBuffer"); - function get(attribute) { - if (attribute.isInterleavedBufferAttribute) attribute = attribute.data; - return buffers.get(attribute); - } - __name(get, "get"); - function remove(attribute) { - if (attribute.isInterleavedBufferAttribute) attribute = attribute.data; - const data = buffers.get(attribute); - if (data) { - gl.deleteBuffer(data.buffer); - buffers.delete(attribute); - } - } - __name(remove, "remove"); - function update(attribute, bufferType) { - if (attribute.isInterleavedBufferAttribute) attribute = attribute.data; - if (attribute.isGLBufferAttribute) { - const cached = buffers.get(attribute); - if (!cached || cached.version < attribute.version) { - buffers.set(attribute, { - buffer: attribute.buffer, - type: attribute.type, - bytesPerElement: attribute.elementSize, - version: attribute.version - }); - } - return; - } - const data = buffers.get(attribute); - if (data === void 0) { - buffers.set(attribute, createBuffer(attribute, bufferType)); - } else if (data.version < attribute.version) { - if (data.size !== attribute.array.byteLength) { - throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported."); - } - updateBuffer(data.buffer, attribute, bufferType); - data.version = attribute.version; - } - } - __name(update, "update"); - return { - get, - remove, - update - }; -} -__name(WebGLAttributes, "WebGLAttributes"); -class PlaneGeometry extends BufferGeometry { - static { - __name(this, "PlaneGeometry"); - } - constructor(width = 1, height = 1, widthSegments = 1, heightSegments = 1) { - super(); - this.type = "PlaneGeometry"; - this.parameters = { - width, - height, - widthSegments, - heightSegments - }; - const width_half = width / 2; - const height_half = height / 2; - const gridX = Math.floor(widthSegments); - const gridY = Math.floor(heightSegments); - const gridX1 = gridX + 1; - const gridY1 = gridY + 1; - const segment_width = width / gridX; - const segment_height = height / gridY; - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; - for (let iy = 0; iy < gridY1; iy++) { - const y = iy * segment_height - height_half; - for (let ix = 0; ix < gridX1; ix++) { - const x = ix * segment_width - width_half; - vertices.push(x, -y, 0); - normals.push(0, 0, 1); - uvs.push(ix / gridX); - uvs.push(1 - iy / gridY); - } - } - for (let iy = 0; iy < gridY; iy++) { - for (let ix = 0; ix < gridX; ix++) { - const a = ix + gridX1 * iy; - const b = ix + gridX1 * (iy + 1); - const c = ix + 1 + gridX1 * (iy + 1); - const d = ix + 1 + gridX1 * iy; - indices.push(a, b, d); - indices.push(b, c, d); - } - } - this.setIndex(indices); - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - static fromJSON(data) { - return new PlaneGeometry(data.width, data.height, data.widthSegments, data.heightSegments); - } -} -var alphahash_fragment = "#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif"; -var alphahash_pars_fragment = "#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif"; -var alphamap_fragment = "#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif"; -var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif"; -var alphatest_fragment = "#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif"; -var alphatest_pars_fragment = "#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif"; -var aomap_fragment = "#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif"; -var aomap_pars_fragment = "#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif"; -var batching_pars_vertex = "#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec3 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n }\n#endif"; -var batching_vertex = "#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif"; -var begin_vertex = "vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif"; -var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif"; -var bsdfs = "float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated"; -var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif"; -var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif"; -var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif"; -var clipping_planes_pars_fragment = "#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif"; -var clipping_planes_pars_vertex = "#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif"; -var clipping_planes_vertex = "#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif"; -var color_fragment = "#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif"; -var color_pars_fragment = "#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif"; -var color_pars_vertex = "#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif"; -var color_vertex = "#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.xyz;\n#endif"; -var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated"; -var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif"; -var defaultnormal_vertex = "vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif"; -var displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif"; -var displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif"; -var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif"; -var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif"; -var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );"; -var colorspace_pars_fragment = "vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}"; -var envmap_fragment = "#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif"; -var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif"; -var envmap_pars_fragment = "#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif"; -var envmap_pars_vertex = "#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif"; -var envmap_vertex = "#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif"; -var fog_vertex = "#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif"; -var fog_pars_vertex = "#ifdef USE_FOG\n varying float vFogDepth;\n#endif"; -var fog_fragment = "#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif"; -var fog_pars_fragment = "#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif"; -var gradientmap_pars_fragment = "#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}"; -var lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif"; -var lights_lambert_fragment = "LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;"; -var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert"; -var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif"; -var envmap_physical_pars_fragment = "#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif"; -var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;"; -var lights_toon_pars_fragment = "varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon"; -var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;"; -var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong"; -var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif"; -var lights_physical_pars_fragment = "struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return saturate(v);\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColor;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n #endif\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}"; -var lights_fragment_begin = "\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif"; -var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif"; -var lights_fragment_end = "#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif"; -var logdepthbuf_fragment = "#if defined( USE_LOGDEPTHBUF )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif"; -var logdepthbuf_pars_fragment = "#if defined( USE_LOGDEPTHBUF )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif"; -var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif"; -var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif"; -var map_fragment = "#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif"; -var map_pars_fragment = "#ifdef USE_MAP\n uniform sampler2D map;\n#endif"; -var map_particle_fragment = "#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif"; -var map_particle_pars_fragment = "#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif"; -var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif"; -var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif"; -var morphinstance_vertex = "#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif"; -var morphcolor_vertex = "#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif"; -var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif"; -var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif"; -var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif"; -var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;"; -var normal_fragment_maps = "#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif"; -var normal_pars_fragment = "#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif"; -var normal_pars_vertex = "#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif"; -var normal_vertex = "#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif"; -var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif"; -var clearcoat_normal_fragment_begin = "#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif"; -var clearcoat_normal_fragment_maps = "#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif"; -var clearcoat_pars_fragment = "#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif"; -var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif"; -var opaque_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );"; -var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * depth - far );\n}"; -var premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif"; -var project_vertex = "vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;"; -var dithering_fragment = "#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif"; -var dithering_pars_fragment = "#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif"; -var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif"; -var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif"; -var shadowmap_pars_fragment = "#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n float hard_shadow = step( compare , distribution.x );\n if (hard_shadow != 1.0 ) {\n float distance = compare - distribution.x ;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n \n float lightToPositionLength = length( lightToPosition );\n if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n shadow = (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n#endif"; -var shadowmap_pars_vertex = "#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif"; -var shadowmap_vertex = "#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif"; -var shadowmask_pars_fragment = "float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}"; -var skinbase_vertex = "#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif"; -var skinning_pars_vertex = "#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif"; -var skinning_vertex = "#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif"; -var skinnormal_vertex = "#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif"; -var specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif"; -var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif"; -var tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif"; -var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }"; -var transmission_fragment = "#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif"; -var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n \n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n \n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n \n #else\n \n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n \n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif"; -var uv_pars_fragment = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif"; -var uv_pars_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif"; -var uv_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif"; -var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif"; -const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}"; -const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include \n #include \n}"; -const vertex$g = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n gl_Position.z = gl_Position.w;\n}"; -const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include \n #include \n}"; -const vertex$f = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n gl_Position.z = gl_Position.w;\n}"; -const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include \n #include \n}"; -const vertex$e = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n}"; -const fragment$e = "#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include \n #include \n #include \n #include \n #include \n float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}"; -const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #ifdef USE_DISPLACEMENTMAP\n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vWorldPosition = worldPosition.xyz;\n}"; -const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include \n #include \n #include \n #include \n #include \n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}"; -const vertex$c = "varying vec3 vWorldDirection;\n#include \nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include \n #include \n}"; -const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include \n #include \n}"; -const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vLineDistance = scale * lineDistance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; -const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}"; -const vertex$a = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include \n #include \n #include \n #include \n #include \n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; -const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include \n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; -const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}"; -const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; -const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n}"; -const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include \n #include \n #include \n #include \n #include \n #include \n}"; -const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n vViewPosition = - mvPosition.xyz;\n#endif\n}"; -const fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include \n #include \n #include \n #include \n gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}"; -const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n #include \n}"; -const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; -const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}"; -const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n uniform sampler2D specularColorMap;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEEN_COLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEEN_ROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n uniform vec2 anisotropyVector;\n #ifdef USE_ANISOTROPYMAP\n uniform sampler2D anisotropyMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include \n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n}"; -const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vViewPosition = - mvPosition.xyz;\n #include \n #include \n #include \n}"; -const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include \n #include \n #include \n #include \n #include \n #include \n}"; -const vertex$3 = "uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\nvoid main() {\n #ifdef USE_POINTS_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #include \n #include \n #include \n #include \n #include \n #include \n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include \n #include \n #include \n #include \n}"; -const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n #include \n}"; -const vertex$2 = "#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n #include \n}"; -const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include \n #include \n #include \n}"; -const vertex$1 = "uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n #include \n vec4 mvPosition = modelViewMatrix[ 3 ];\n vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include \n #include \n #include \n}"; -const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include \n vec3 outgoingLight = vec3( 0.0 );\n #include \n #include \n #include \n #include \n #include \n outgoingLight = diffuseColor.rgb;\n #include \n #include \n #include \n #include \n}"; -const ShaderChunk = { - alphahash_fragment, - alphahash_pars_fragment, - alphamap_fragment, - alphamap_pars_fragment, - alphatest_fragment, - alphatest_pars_fragment, - aomap_fragment, - aomap_pars_fragment, - batching_pars_vertex, - batching_vertex, - begin_vertex, - beginnormal_vertex, - bsdfs, - iridescence_fragment, - bumpmap_pars_fragment, - clipping_planes_fragment, - clipping_planes_pars_fragment, - clipping_planes_pars_vertex, - clipping_planes_vertex, - color_fragment, - color_pars_fragment, - color_pars_vertex, - color_vertex, - common, - cube_uv_reflection_fragment, - defaultnormal_vertex, - displacementmap_pars_vertex, - displacementmap_vertex, - emissivemap_fragment, - emissivemap_pars_fragment, - colorspace_fragment, - colorspace_pars_fragment, - envmap_fragment, - envmap_common_pars_fragment, - envmap_pars_fragment, - envmap_pars_vertex, - envmap_physical_pars_fragment, - envmap_vertex, - fog_vertex, - fog_pars_vertex, - fog_fragment, - fog_pars_fragment, - gradientmap_pars_fragment, - lightmap_pars_fragment, - lights_lambert_fragment, - lights_lambert_pars_fragment, - lights_pars_begin, - lights_toon_fragment, - lights_toon_pars_fragment, - lights_phong_fragment, - lights_phong_pars_fragment, - lights_physical_fragment, - lights_physical_pars_fragment, - lights_fragment_begin, - lights_fragment_maps, - lights_fragment_end, - logdepthbuf_fragment, - logdepthbuf_pars_fragment, - logdepthbuf_pars_vertex, - logdepthbuf_vertex, - map_fragment, - map_pars_fragment, - map_particle_fragment, - map_particle_pars_fragment, - metalnessmap_fragment, - metalnessmap_pars_fragment, - morphinstance_vertex, - morphcolor_vertex, - morphnormal_vertex, - morphtarget_pars_vertex, - morphtarget_vertex, - normal_fragment_begin, - normal_fragment_maps, - normal_pars_fragment, - normal_pars_vertex, - normal_vertex, - normalmap_pars_fragment, - clearcoat_normal_fragment_begin, - clearcoat_normal_fragment_maps, - clearcoat_pars_fragment, - iridescence_pars_fragment, - opaque_fragment, - packing, - premultiplied_alpha_fragment, - project_vertex, - dithering_fragment, - dithering_pars_fragment, - roughnessmap_fragment, - roughnessmap_pars_fragment, - shadowmap_pars_fragment, - shadowmap_pars_vertex, - shadowmap_vertex, - shadowmask_pars_fragment, - skinbase_vertex, - skinning_pars_vertex, - skinning_vertex, - skinnormal_vertex, - specularmap_fragment, - specularmap_pars_fragment, - tonemapping_fragment, - tonemapping_pars_fragment, - transmission_fragment, - transmission_pars_fragment, - uv_pars_fragment, - uv_pars_vertex, - uv_vertex, - worldpos_vertex, - background_vert: vertex$h, - background_frag: fragment$h, - backgroundCube_vert: vertex$g, - backgroundCube_frag: fragment$g, - cube_vert: vertex$f, - cube_frag: fragment$f, - depth_vert: vertex$e, - depth_frag: fragment$e, - distanceRGBA_vert: vertex$d, - distanceRGBA_frag: fragment$d, - equirect_vert: vertex$c, - equirect_frag: fragment$c, - linedashed_vert: vertex$b, - linedashed_frag: fragment$b, - meshbasic_vert: vertex$a, - meshbasic_frag: fragment$a, - meshlambert_vert: vertex$9, - meshlambert_frag: fragment$9, - meshmatcap_vert: vertex$8, - meshmatcap_frag: fragment$8, - meshnormal_vert: vertex$7, - meshnormal_frag: fragment$7, - meshphong_vert: vertex$6, - meshphong_frag: fragment$6, - meshphysical_vert: vertex$5, - meshphysical_frag: fragment$5, - meshtoon_vert: vertex$4, - meshtoon_frag: fragment$4, - points_vert: vertex$3, - points_frag: fragment$3, - shadow_vert: vertex$2, - shadow_frag: fragment$2, - sprite_vert: vertex$1, - sprite_frag: fragment$1 -}; -const UniformsLib = { - common: { - diffuse: { value: /* @__PURE__ */ new Color(16777215) }, - opacity: { value: 1 }, - map: { value: null }, - mapTransform: { value: /* @__PURE__ */ new Matrix3() }, - alphaMap: { value: null }, - alphaMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - alphaTest: { value: 0 } - }, - specularmap: { - specularMap: { value: null }, - specularMapTransform: { value: /* @__PURE__ */ new Matrix3() } - }, - envmap: { - envMap: { value: null }, - envMapRotation: { value: /* @__PURE__ */ new Matrix3() }, - flipEnvMap: { value: -1 }, - reflectivity: { value: 1 }, - // basic, lambert, phong - ior: { value: 1.5 }, - // physical - refractionRatio: { value: 0.98 } - // basic, lambert, phong - }, - aomap: { - aoMap: { value: null }, - aoMapIntensity: { value: 1 }, - aoMapTransform: { value: /* @__PURE__ */ new Matrix3() } - }, - lightmap: { - lightMap: { value: null }, - lightMapIntensity: { value: 1 }, - lightMapTransform: { value: /* @__PURE__ */ new Matrix3() } - }, - bumpmap: { - bumpMap: { value: null }, - bumpMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - bumpScale: { value: 1 } - }, - normalmap: { - normalMap: { value: null }, - normalMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - normalScale: { value: /* @__PURE__ */ new Vector2(1, 1) } - }, - displacementmap: { - displacementMap: { value: null }, - displacementMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - displacementScale: { value: 1 }, - displacementBias: { value: 0 } - }, - emissivemap: { - emissiveMap: { value: null }, - emissiveMapTransform: { value: /* @__PURE__ */ new Matrix3() } - }, - metalnessmap: { - metalnessMap: { value: null }, - metalnessMapTransform: { value: /* @__PURE__ */ new Matrix3() } - }, - roughnessmap: { - roughnessMap: { value: null }, - roughnessMapTransform: { value: /* @__PURE__ */ new Matrix3() } - }, - gradientmap: { - gradientMap: { value: null } - }, - fog: { - fogDensity: { value: 25e-5 }, - fogNear: { value: 1 }, - fogFar: { value: 2e3 }, - fogColor: { value: /* @__PURE__ */ new Color(16777215) } - }, - lights: { - ambientLightColor: { value: [] }, - lightProbe: { value: [] }, - directionalLights: { value: [], properties: { - direction: {}, - color: {} - } }, - directionalLightShadows: { value: [], properties: { - shadowIntensity: 1, - shadowBias: {}, - shadowNormalBias: {}, - shadowRadius: {}, - shadowMapSize: {} - } }, - directionalShadowMap: { value: [] }, - directionalShadowMatrix: { value: [] }, - spotLights: { value: [], properties: { - color: {}, - position: {}, - direction: {}, - distance: {}, - coneCos: {}, - penumbraCos: {}, - decay: {} - } }, - spotLightShadows: { value: [], properties: { - shadowIntensity: 1, - shadowBias: {}, - shadowNormalBias: {}, - shadowRadius: {}, - shadowMapSize: {} - } }, - spotLightMap: { value: [] }, - spotShadowMap: { value: [] }, - spotLightMatrix: { value: [] }, - pointLights: { value: [], properties: { - color: {}, - position: {}, - decay: {}, - distance: {} - } }, - pointLightShadows: { value: [], properties: { - shadowIntensity: 1, - shadowBias: {}, - shadowNormalBias: {}, - shadowRadius: {}, - shadowMapSize: {}, - shadowCameraNear: {}, - shadowCameraFar: {} - } }, - pointShadowMap: { value: [] }, - pointShadowMatrix: { value: [] }, - hemisphereLights: { value: [], properties: { - direction: {}, - skyColor: {}, - groundColor: {} - } }, - // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src - rectAreaLights: { value: [], properties: { - color: {}, - position: {}, - width: {}, - height: {} - } }, - ltc_1: { value: null }, - ltc_2: { value: null } - }, - points: { - diffuse: { value: /* @__PURE__ */ new Color(16777215) }, - opacity: { value: 1 }, - size: { value: 1 }, - scale: { value: 1 }, - map: { value: null }, - alphaMap: { value: null }, - alphaMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - alphaTest: { value: 0 }, - uvTransform: { value: /* @__PURE__ */ new Matrix3() } - }, - sprite: { - diffuse: { value: /* @__PURE__ */ new Color(16777215) }, - opacity: { value: 1 }, - center: { value: /* @__PURE__ */ new Vector2(0.5, 0.5) }, - rotation: { value: 0 }, - map: { value: null }, - mapTransform: { value: /* @__PURE__ */ new Matrix3() }, - alphaMap: { value: null }, - alphaMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - alphaTest: { value: 0 } - } -}; -const ShaderLib = { - basic: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.common, - UniformsLib.specularmap, - UniformsLib.envmap, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.fog - ]), - vertexShader: ShaderChunk.meshbasic_vert, - fragmentShader: ShaderChunk.meshbasic_frag - }, - lambert: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.common, - UniformsLib.specularmap, - UniformsLib.envmap, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.emissivemap, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - UniformsLib.fog, - UniformsLib.lights, - { - emissive: { value: /* @__PURE__ */ new Color(0) } - } - ]), - vertexShader: ShaderChunk.meshlambert_vert, - fragmentShader: ShaderChunk.meshlambert_frag - }, - phong: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.common, - UniformsLib.specularmap, - UniformsLib.envmap, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.emissivemap, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - UniformsLib.fog, - UniformsLib.lights, - { - emissive: { value: /* @__PURE__ */ new Color(0) }, - specular: { value: /* @__PURE__ */ new Color(1118481) }, - shininess: { value: 30 } - } - ]), - vertexShader: ShaderChunk.meshphong_vert, - fragmentShader: ShaderChunk.meshphong_frag - }, - standard: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.common, - UniformsLib.envmap, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.emissivemap, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - UniformsLib.roughnessmap, - UniformsLib.metalnessmap, - UniformsLib.fog, - UniformsLib.lights, - { - emissive: { value: /* @__PURE__ */ new Color(0) }, - roughness: { value: 1 }, - metalness: { value: 0 }, - envMapIntensity: { value: 1 } - } - ]), - vertexShader: ShaderChunk.meshphysical_vert, - fragmentShader: ShaderChunk.meshphysical_frag - }, - toon: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.common, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.emissivemap, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - UniformsLib.gradientmap, - UniformsLib.fog, - UniformsLib.lights, - { - emissive: { value: /* @__PURE__ */ new Color(0) } - } - ]), - vertexShader: ShaderChunk.meshtoon_vert, - fragmentShader: ShaderChunk.meshtoon_frag - }, - matcap: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.common, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - UniformsLib.fog, - { - matcap: { value: null } - } - ]), - vertexShader: ShaderChunk.meshmatcap_vert, - fragmentShader: ShaderChunk.meshmatcap_frag - }, - points: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.points, - UniformsLib.fog - ]), - vertexShader: ShaderChunk.points_vert, - fragmentShader: ShaderChunk.points_frag - }, - dashed: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.common, - UniformsLib.fog, - { - scale: { value: 1 }, - dashSize: { value: 1 }, - totalSize: { value: 2 } - } - ]), - vertexShader: ShaderChunk.linedashed_vert, - fragmentShader: ShaderChunk.linedashed_frag - }, - depth: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.common, - UniformsLib.displacementmap - ]), - vertexShader: ShaderChunk.depth_vert, - fragmentShader: ShaderChunk.depth_frag - }, - normal: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.common, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - { - opacity: { value: 1 } - } - ]), - vertexShader: ShaderChunk.meshnormal_vert, - fragmentShader: ShaderChunk.meshnormal_frag - }, - sprite: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.sprite, - UniformsLib.fog - ]), - vertexShader: ShaderChunk.sprite_vert, - fragmentShader: ShaderChunk.sprite_frag - }, - background: { - uniforms: { - uvTransform: { value: /* @__PURE__ */ new Matrix3() }, - t2D: { value: null }, - backgroundIntensity: { value: 1 } - }, - vertexShader: ShaderChunk.background_vert, - fragmentShader: ShaderChunk.background_frag - }, - backgroundCube: { - uniforms: { - envMap: { value: null }, - flipEnvMap: { value: -1 }, - backgroundBlurriness: { value: 0 }, - backgroundIntensity: { value: 1 }, - backgroundRotation: { value: /* @__PURE__ */ new Matrix3() } - }, - vertexShader: ShaderChunk.backgroundCube_vert, - fragmentShader: ShaderChunk.backgroundCube_frag - }, - cube: { - uniforms: { - tCube: { value: null }, - tFlip: { value: -1 }, - opacity: { value: 1 } - }, - vertexShader: ShaderChunk.cube_vert, - fragmentShader: ShaderChunk.cube_frag - }, - equirect: { - uniforms: { - tEquirect: { value: null } - }, - vertexShader: ShaderChunk.equirect_vert, - fragmentShader: ShaderChunk.equirect_frag - }, - distanceRGBA: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.common, - UniformsLib.displacementmap, - { - referencePosition: { value: /* @__PURE__ */ new Vector3() }, - nearDistance: { value: 1 }, - farDistance: { value: 1e3 } - } - ]), - vertexShader: ShaderChunk.distanceRGBA_vert, - fragmentShader: ShaderChunk.distanceRGBA_frag - }, - shadow: { - uniforms: /* @__PURE__ */ mergeUniforms([ - UniformsLib.lights, - UniformsLib.fog, - { - color: { value: /* @__PURE__ */ new Color(0) }, - opacity: { value: 1 } - } - ]), - vertexShader: ShaderChunk.shadow_vert, - fragmentShader: ShaderChunk.shadow_frag - } -}; -ShaderLib.physical = { - uniforms: /* @__PURE__ */ mergeUniforms([ - ShaderLib.standard.uniforms, - { - clearcoat: { value: 0 }, - clearcoatMap: { value: null }, - clearcoatMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - clearcoatNormalMap: { value: null }, - clearcoatNormalMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - clearcoatNormalScale: { value: /* @__PURE__ */ new Vector2(1, 1) }, - clearcoatRoughness: { value: 0 }, - clearcoatRoughnessMap: { value: null }, - clearcoatRoughnessMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - dispersion: { value: 0 }, - iridescence: { value: 0 }, - iridescenceMap: { value: null }, - iridescenceMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - iridescenceIOR: { value: 1.3 }, - iridescenceThicknessMinimum: { value: 100 }, - iridescenceThicknessMaximum: { value: 400 }, - iridescenceThicknessMap: { value: null }, - iridescenceThicknessMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - sheen: { value: 0 }, - sheenColor: { value: /* @__PURE__ */ new Color(0) }, - sheenColorMap: { value: null }, - sheenColorMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - sheenRoughness: { value: 1 }, - sheenRoughnessMap: { value: null }, - sheenRoughnessMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - transmission: { value: 0 }, - transmissionMap: { value: null }, - transmissionMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - transmissionSamplerSize: { value: /* @__PURE__ */ new Vector2() }, - transmissionSamplerMap: { value: null }, - thickness: { value: 0 }, - thicknessMap: { value: null }, - thicknessMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - attenuationDistance: { value: 0 }, - attenuationColor: { value: /* @__PURE__ */ new Color(0) }, - specularColor: { value: /* @__PURE__ */ new Color(1, 1, 1) }, - specularColorMap: { value: null }, - specularColorMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - specularIntensity: { value: 1 }, - specularIntensityMap: { value: null }, - specularIntensityMapTransform: { value: /* @__PURE__ */ new Matrix3() }, - anisotropyVector: { value: /* @__PURE__ */ new Vector2() }, - anisotropyMap: { value: null }, - anisotropyMapTransform: { value: /* @__PURE__ */ new Matrix3() } - } - ]), - vertexShader: ShaderChunk.meshphysical_vert, - fragmentShader: ShaderChunk.meshphysical_frag -}; -const _rgb = { r: 0, b: 0, g: 0 }; -const _e1$1 = /* @__PURE__ */ new Euler(); -const _m1$1 = /* @__PURE__ */ new Matrix4(); -function WebGLBackground(renderer, cubemaps, cubeuvmaps, state, objects, alpha, premultipliedAlpha) { - const clearColor = new Color(0); - let clearAlpha = alpha === true ? 0 : 1; - let planeMesh; - let boxMesh; - let currentBackground = null; - let currentBackgroundVersion = 0; - let currentTonemapping = null; - function getBackground(scene) { - let background = scene.isScene === true ? scene.background : null; - if (background && background.isTexture) { - const usePMREM = scene.backgroundBlurriness > 0; - background = (usePMREM ? cubeuvmaps : cubemaps).get(background); - } - return background; - } - __name(getBackground, "getBackground"); - function render(scene) { - let forceClear = false; - const background = getBackground(scene); - if (background === null) { - setClear(clearColor, clearAlpha); - } else if (background && background.isColor) { - setClear(background, 1); - forceClear = true; - } - const environmentBlendMode = renderer.xr.getEnvironmentBlendMode(); - if (environmentBlendMode === "additive") { - state.buffers.color.setClear(0, 0, 0, 1, premultipliedAlpha); - } else if (environmentBlendMode === "alpha-blend") { - state.buffers.color.setClear(0, 0, 0, 0, premultipliedAlpha); - } - if (renderer.autoClear || forceClear) { - state.buffers.depth.setTest(true); - state.buffers.depth.setMask(true); - state.buffers.color.setMask(true); - renderer.clear(renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil); - } - } - __name(render, "render"); - function addToRenderList(renderList2, scene) { - const background = getBackground(scene); - if (background && (background.isCubeTexture || background.mapping === CubeUVReflectionMapping)) { - if (boxMesh === void 0) { - boxMesh = new Mesh( - new BoxGeometry(1, 1, 1), - new ShaderMaterial({ - name: "BackgroundCubeMaterial", - uniforms: cloneUniforms(ShaderLib.backgroundCube.uniforms), - vertexShader: ShaderLib.backgroundCube.vertexShader, - fragmentShader: ShaderLib.backgroundCube.fragmentShader, - side: BackSide, - depthTest: false, - depthWrite: false, - fog: false - }) - ); - boxMesh.geometry.deleteAttribute("normal"); - boxMesh.geometry.deleteAttribute("uv"); - boxMesh.onBeforeRender = function(renderer2, scene2, camera) { - this.matrixWorld.copyPosition(camera.matrixWorld); - }; - Object.defineProperty(boxMesh.material, "envMap", { - get: /* @__PURE__ */ __name(function() { - return this.uniforms.envMap.value; - }, "get") - }); - objects.update(boxMesh); - } - _e1$1.copy(scene.backgroundRotation); - _e1$1.x *= -1; - _e1$1.y *= -1; - _e1$1.z *= -1; - if (background.isCubeTexture && background.isRenderTargetTexture === false) { - _e1$1.y *= -1; - _e1$1.z *= -1; - } - boxMesh.material.uniforms.envMap.value = background; - boxMesh.material.uniforms.flipEnvMap.value = background.isCubeTexture && background.isRenderTargetTexture === false ? -1 : 1; - boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness; - boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity; - boxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4(_m1$1.makeRotationFromEuler(_e1$1)); - boxMesh.material.toneMapped = ColorManagement.getTransfer(background.colorSpace) !== SRGBTransfer; - if (currentBackground !== background || currentBackgroundVersion !== background.version || currentTonemapping !== renderer.toneMapping) { - boxMesh.material.needsUpdate = true; - currentBackground = background; - currentBackgroundVersion = background.version; - currentTonemapping = renderer.toneMapping; - } - boxMesh.layers.enableAll(); - renderList2.unshift(boxMesh, boxMesh.geometry, boxMesh.material, 0, 0, null); - } else if (background && background.isTexture) { - if (planeMesh === void 0) { - planeMesh = new Mesh( - new PlaneGeometry(2, 2), - new ShaderMaterial({ - name: "BackgroundMaterial", - uniforms: cloneUniforms(ShaderLib.background.uniforms), - vertexShader: ShaderLib.background.vertexShader, - fragmentShader: ShaderLib.background.fragmentShader, - side: FrontSide, - depthTest: false, - depthWrite: false, - fog: false - }) - ); - planeMesh.geometry.deleteAttribute("normal"); - Object.defineProperty(planeMesh.material, "map", { - get: /* @__PURE__ */ __name(function() { - return this.uniforms.t2D.value; - }, "get") - }); - objects.update(planeMesh); - } - planeMesh.material.uniforms.t2D.value = background; - planeMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity; - planeMesh.material.toneMapped = ColorManagement.getTransfer(background.colorSpace) !== SRGBTransfer; - if (background.matrixAutoUpdate === true) { - background.updateMatrix(); - } - planeMesh.material.uniforms.uvTransform.value.copy(background.matrix); - if (currentBackground !== background || currentBackgroundVersion !== background.version || currentTonemapping !== renderer.toneMapping) { - planeMesh.material.needsUpdate = true; - currentBackground = background; - currentBackgroundVersion = background.version; - currentTonemapping = renderer.toneMapping; - } - planeMesh.layers.enableAll(); - renderList2.unshift(planeMesh, planeMesh.geometry, planeMesh.material, 0, 0, null); - } - } - __name(addToRenderList, "addToRenderList"); - function setClear(color, alpha2) { - color.getRGB(_rgb, getUnlitUniformColorSpace(renderer)); - state.buffers.color.setClear(_rgb.r, _rgb.g, _rgb.b, alpha2, premultipliedAlpha); - } - __name(setClear, "setClear"); - return { - getClearColor: /* @__PURE__ */ __name(function() { - return clearColor; - }, "getClearColor"), - setClearColor: /* @__PURE__ */ __name(function(color, alpha2 = 1) { - clearColor.set(color); - clearAlpha = alpha2; - setClear(clearColor, clearAlpha); - }, "setClearColor"), - getClearAlpha: /* @__PURE__ */ __name(function() { - return clearAlpha; - }, "getClearAlpha"), - setClearAlpha: /* @__PURE__ */ __name(function(alpha2) { - clearAlpha = alpha2; - setClear(clearColor, clearAlpha); - }, "setClearAlpha"), - render, - addToRenderList - }; -} -__name(WebGLBackground, "WebGLBackground"); -function WebGLBindingStates(gl, attributes) { - const maxVertexAttributes = gl.getParameter(gl.MAX_VERTEX_ATTRIBS); - const bindingStates = {}; - const defaultState = createBindingState(null); - let currentState = defaultState; - let forceUpdate = false; - function setup(object, material, program, geometry, index) { - let updateBuffers = false; - const state = getBindingState(geometry, program, material); - if (currentState !== state) { - currentState = state; - bindVertexArrayObject(currentState.object); - } - updateBuffers = needsUpdate(object, geometry, program, index); - if (updateBuffers) saveCache(object, geometry, program, index); - if (index !== null) { - attributes.update(index, gl.ELEMENT_ARRAY_BUFFER); - } - if (updateBuffers || forceUpdate) { - forceUpdate = false; - setupVertexAttributes(object, material, program, geometry); - if (index !== null) { - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, attributes.get(index).buffer); - } - } - } - __name(setup, "setup"); - function createVertexArrayObject() { - return gl.createVertexArray(); - } - __name(createVertexArrayObject, "createVertexArrayObject"); - function bindVertexArrayObject(vao) { - return gl.bindVertexArray(vao); - } - __name(bindVertexArrayObject, "bindVertexArrayObject"); - function deleteVertexArrayObject(vao) { - return gl.deleteVertexArray(vao); - } - __name(deleteVertexArrayObject, "deleteVertexArrayObject"); - function getBindingState(geometry, program, material) { - const wireframe = material.wireframe === true; - let programMap = bindingStates[geometry.id]; - if (programMap === void 0) { - programMap = {}; - bindingStates[geometry.id] = programMap; - } - let stateMap = programMap[program.id]; - if (stateMap === void 0) { - stateMap = {}; - programMap[program.id] = stateMap; - } - let state = stateMap[wireframe]; - if (state === void 0) { - state = createBindingState(createVertexArrayObject()); - stateMap[wireframe] = state; - } - return state; - } - __name(getBindingState, "getBindingState"); - function createBindingState(vao) { - const newAttributes = []; - const enabledAttributes = []; - const attributeDivisors = []; - for (let i = 0; i < maxVertexAttributes; i++) { - newAttributes[i] = 0; - enabledAttributes[i] = 0; - attributeDivisors[i] = 0; - } - return { - // for backward compatibility on non-VAO support browser - geometry: null, - program: null, - wireframe: false, - newAttributes, - enabledAttributes, - attributeDivisors, - object: vao, - attributes: {}, - index: null - }; - } - __name(createBindingState, "createBindingState"); - function needsUpdate(object, geometry, program, index) { - const cachedAttributes = currentState.attributes; - const geometryAttributes = geometry.attributes; - let attributesNum = 0; - const programAttributes = program.getAttributes(); - for (const name in programAttributes) { - const programAttribute = programAttributes[name]; - if (programAttribute.location >= 0) { - const cachedAttribute = cachedAttributes[name]; - let geometryAttribute = geometryAttributes[name]; - if (geometryAttribute === void 0) { - if (name === "instanceMatrix" && object.instanceMatrix) geometryAttribute = object.instanceMatrix; - if (name === "instanceColor" && object.instanceColor) geometryAttribute = object.instanceColor; - } - if (cachedAttribute === void 0) return true; - if (cachedAttribute.attribute !== geometryAttribute) return true; - if (geometryAttribute && cachedAttribute.data !== geometryAttribute.data) return true; - attributesNum++; - } - } - if (currentState.attributesNum !== attributesNum) return true; - if (currentState.index !== index) return true; - return false; - } - __name(needsUpdate, "needsUpdate"); - function saveCache(object, geometry, program, index) { - const cache = {}; - const attributes2 = geometry.attributes; - let attributesNum = 0; - const programAttributes = program.getAttributes(); - for (const name in programAttributes) { - const programAttribute = programAttributes[name]; - if (programAttribute.location >= 0) { - let attribute = attributes2[name]; - if (attribute === void 0) { - if (name === "instanceMatrix" && object.instanceMatrix) attribute = object.instanceMatrix; - if (name === "instanceColor" && object.instanceColor) attribute = object.instanceColor; - } - const data = {}; - data.attribute = attribute; - if (attribute && attribute.data) { - data.data = attribute.data; - } - cache[name] = data; - attributesNum++; - } - } - currentState.attributes = cache; - currentState.attributesNum = attributesNum; - currentState.index = index; - } - __name(saveCache, "saveCache"); - function initAttributes() { - const newAttributes = currentState.newAttributes; - for (let i = 0, il = newAttributes.length; i < il; i++) { - newAttributes[i] = 0; - } - } - __name(initAttributes, "initAttributes"); - function enableAttribute(attribute) { - enableAttributeAndDivisor(attribute, 0); - } - __name(enableAttribute, "enableAttribute"); - function enableAttributeAndDivisor(attribute, meshPerAttribute) { - const newAttributes = currentState.newAttributes; - const enabledAttributes = currentState.enabledAttributes; - const attributeDivisors = currentState.attributeDivisors; - newAttributes[attribute] = 1; - if (enabledAttributes[attribute] === 0) { - gl.enableVertexAttribArray(attribute); - enabledAttributes[attribute] = 1; - } - if (attributeDivisors[attribute] !== meshPerAttribute) { - gl.vertexAttribDivisor(attribute, meshPerAttribute); - attributeDivisors[attribute] = meshPerAttribute; - } - } - __name(enableAttributeAndDivisor, "enableAttributeAndDivisor"); - function disableUnusedAttributes() { - const newAttributes = currentState.newAttributes; - const enabledAttributes = currentState.enabledAttributes; - for (let i = 0, il = enabledAttributes.length; i < il; i++) { - if (enabledAttributes[i] !== newAttributes[i]) { - gl.disableVertexAttribArray(i); - enabledAttributes[i] = 0; - } - } - } - __name(disableUnusedAttributes, "disableUnusedAttributes"); - function vertexAttribPointer(index, size, type, normalized, stride, offset, integer) { - if (integer === true) { - gl.vertexAttribIPointer(index, size, type, stride, offset); - } else { - gl.vertexAttribPointer(index, size, type, normalized, stride, offset); - } - } - __name(vertexAttribPointer, "vertexAttribPointer"); - function setupVertexAttributes(object, material, program, geometry) { - initAttributes(); - const geometryAttributes = geometry.attributes; - const programAttributes = program.getAttributes(); - const materialDefaultAttributeValues = material.defaultAttributeValues; - for (const name in programAttributes) { - const programAttribute = programAttributes[name]; - if (programAttribute.location >= 0) { - let geometryAttribute = geometryAttributes[name]; - if (geometryAttribute === void 0) { - if (name === "instanceMatrix" && object.instanceMatrix) geometryAttribute = object.instanceMatrix; - if (name === "instanceColor" && object.instanceColor) geometryAttribute = object.instanceColor; - } - if (geometryAttribute !== void 0) { - const normalized = geometryAttribute.normalized; - const size = geometryAttribute.itemSize; - const attribute = attributes.get(geometryAttribute); - if (attribute === void 0) continue; - const buffer = attribute.buffer; - const type = attribute.type; - const bytesPerElement = attribute.bytesPerElement; - const integer = type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType; - if (geometryAttribute.isInterleavedBufferAttribute) { - const data = geometryAttribute.data; - const stride = data.stride; - const offset = geometryAttribute.offset; - if (data.isInstancedInterleavedBuffer) { - for (let i = 0; i < programAttribute.locationSize; i++) { - enableAttributeAndDivisor(programAttribute.location + i, data.meshPerAttribute); - } - if (object.isInstancedMesh !== true && geometry._maxInstanceCount === void 0) { - geometry._maxInstanceCount = data.meshPerAttribute * data.count; - } - } else { - for (let i = 0; i < programAttribute.locationSize; i++) { - enableAttribute(programAttribute.location + i); - } - } - gl.bindBuffer(gl.ARRAY_BUFFER, buffer); - for (let i = 0; i < programAttribute.locationSize; i++) { - vertexAttribPointer( - programAttribute.location + i, - size / programAttribute.locationSize, - type, - normalized, - stride * bytesPerElement, - (offset + size / programAttribute.locationSize * i) * bytesPerElement, - integer - ); - } - } else { - if (geometryAttribute.isInstancedBufferAttribute) { - for (let i = 0; i < programAttribute.locationSize; i++) { - enableAttributeAndDivisor(programAttribute.location + i, geometryAttribute.meshPerAttribute); - } - if (object.isInstancedMesh !== true && geometry._maxInstanceCount === void 0) { - geometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count; - } - } else { - for (let i = 0; i < programAttribute.locationSize; i++) { - enableAttribute(programAttribute.location + i); - } - } - gl.bindBuffer(gl.ARRAY_BUFFER, buffer); - for (let i = 0; i < programAttribute.locationSize; i++) { - vertexAttribPointer( - programAttribute.location + i, - size / programAttribute.locationSize, - type, - normalized, - size * bytesPerElement, - size / programAttribute.locationSize * i * bytesPerElement, - integer - ); - } - } - } else if (materialDefaultAttributeValues !== void 0) { - const value = materialDefaultAttributeValues[name]; - if (value !== void 0) { - switch (value.length) { - case 2: - gl.vertexAttrib2fv(programAttribute.location, value); - break; - case 3: - gl.vertexAttrib3fv(programAttribute.location, value); - break; - case 4: - gl.vertexAttrib4fv(programAttribute.location, value); - break; - default: - gl.vertexAttrib1fv(programAttribute.location, value); - } - } - } - } - } - disableUnusedAttributes(); - } - __name(setupVertexAttributes, "setupVertexAttributes"); - function dispose() { - reset(); - for (const geometryId in bindingStates) { - const programMap = bindingStates[geometryId]; - for (const programId in programMap) { - const stateMap = programMap[programId]; - for (const wireframe in stateMap) { - deleteVertexArrayObject(stateMap[wireframe].object); - delete stateMap[wireframe]; - } - delete programMap[programId]; - } - delete bindingStates[geometryId]; - } - } - __name(dispose, "dispose"); - function releaseStatesOfGeometry(geometry) { - if (bindingStates[geometry.id] === void 0) return; - const programMap = bindingStates[geometry.id]; - for (const programId in programMap) { - const stateMap = programMap[programId]; - for (const wireframe in stateMap) { - deleteVertexArrayObject(stateMap[wireframe].object); - delete stateMap[wireframe]; - } - delete programMap[programId]; - } - delete bindingStates[geometry.id]; - } - __name(releaseStatesOfGeometry, "releaseStatesOfGeometry"); - function releaseStatesOfProgram(program) { - for (const geometryId in bindingStates) { - const programMap = bindingStates[geometryId]; - if (programMap[program.id] === void 0) continue; - const stateMap = programMap[program.id]; - for (const wireframe in stateMap) { - deleteVertexArrayObject(stateMap[wireframe].object); - delete stateMap[wireframe]; - } - delete programMap[program.id]; - } - } - __name(releaseStatesOfProgram, "releaseStatesOfProgram"); - function reset() { - resetDefaultState(); - forceUpdate = true; - if (currentState === defaultState) return; - currentState = defaultState; - bindVertexArrayObject(currentState.object); - } - __name(reset, "reset"); - function resetDefaultState() { - defaultState.geometry = null; - defaultState.program = null; - defaultState.wireframe = false; - } - __name(resetDefaultState, "resetDefaultState"); - return { - setup, - reset, - resetDefaultState, - dispose, - releaseStatesOfGeometry, - releaseStatesOfProgram, - initAttributes, - enableAttribute, - disableUnusedAttributes - }; -} -__name(WebGLBindingStates, "WebGLBindingStates"); -function WebGLBufferRenderer(gl, extensions, info) { - let mode; - function setMode(value) { - mode = value; - } - __name(setMode, "setMode"); - function render(start, count) { - gl.drawArrays(mode, start, count); - info.update(count, mode, 1); - } - __name(render, "render"); - function renderInstances(start, count, primcount) { - if (primcount === 0) return; - gl.drawArraysInstanced(mode, start, count, primcount); - info.update(count, mode, primcount); - } - __name(renderInstances, "renderInstances"); - function renderMultiDraw(starts, counts, drawCount) { - if (drawCount === 0) return; - const extension = extensions.get("WEBGL_multi_draw"); - extension.multiDrawArraysWEBGL(mode, starts, 0, counts, 0, drawCount); - let elementCount = 0; - for (let i = 0; i < drawCount; i++) { - elementCount += counts[i]; - } - info.update(elementCount, mode, 1); - } - __name(renderMultiDraw, "renderMultiDraw"); - function renderMultiDrawInstances(starts, counts, drawCount, primcount) { - if (drawCount === 0) return; - const extension = extensions.get("WEBGL_multi_draw"); - if (extension === null) { - for (let i = 0; i < starts.length; i++) { - renderInstances(starts[i], counts[i], primcount[i]); - } - } else { - extension.multiDrawArraysInstancedWEBGL(mode, starts, 0, counts, 0, primcount, 0, drawCount); - let elementCount = 0; - for (let i = 0; i < drawCount; i++) { - elementCount += counts[i] * primcount[i]; - } - info.update(elementCount, mode, 1); - } - } - __name(renderMultiDrawInstances, "renderMultiDrawInstances"); - this.setMode = setMode; - this.render = render; - this.renderInstances = renderInstances; - this.renderMultiDraw = renderMultiDraw; - this.renderMultiDrawInstances = renderMultiDrawInstances; -} -__name(WebGLBufferRenderer, "WebGLBufferRenderer"); -function WebGLCapabilities(gl, extensions, parameters, utils) { - let maxAnisotropy; - function getMaxAnisotropy() { - if (maxAnisotropy !== void 0) return maxAnisotropy; - if (extensions.has("EXT_texture_filter_anisotropic") === true) { - const extension = extensions.get("EXT_texture_filter_anisotropic"); - maxAnisotropy = gl.getParameter(extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT); - } else { - maxAnisotropy = 0; - } - return maxAnisotropy; - } - __name(getMaxAnisotropy, "getMaxAnisotropy"); - function textureFormatReadable(textureFormat) { - if (textureFormat !== RGBAFormat && utils.convert(textureFormat) !== gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT)) { - return false; - } - return true; - } - __name(textureFormatReadable, "textureFormatReadable"); - function textureTypeReadable(textureType) { - const halfFloatSupportedByExt = textureType === HalfFloatType && (extensions.has("EXT_color_buffer_half_float") || extensions.has("EXT_color_buffer_float")); - if (textureType !== UnsignedByteType && utils.convert(textureType) !== gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE) && // Edge and Chrome Mac < 52 (#9513) - textureType !== FloatType && !halfFloatSupportedByExt) { - return false; - } - return true; - } - __name(textureTypeReadable, "textureTypeReadable"); - function getMaxPrecision(precision2) { - if (precision2 === "highp") { - if (gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).precision > 0 && gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).precision > 0) { - return "highp"; - } - precision2 = "mediump"; - } - if (precision2 === "mediump") { - if (gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).precision > 0 && gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).precision > 0) { - return "mediump"; - } - } - return "lowp"; - } - __name(getMaxPrecision, "getMaxPrecision"); - let precision = parameters.precision !== void 0 ? parameters.precision : "highp"; - const maxPrecision = getMaxPrecision(precision); - if (maxPrecision !== precision) { - console.warn("THREE.WebGLRenderer:", precision, "not supported, using", maxPrecision, "instead."); - precision = maxPrecision; - } - const logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true; - const reverseDepthBuffer = parameters.reverseDepthBuffer === true && extensions.has("EXT_clip_control"); - const maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); - const maxVertexTextures = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS); - const maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); - const maxCubemapSize = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE); - const maxAttributes = gl.getParameter(gl.MAX_VERTEX_ATTRIBS); - const maxVertexUniforms = gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS); - const maxVaryings = gl.getParameter(gl.MAX_VARYING_VECTORS); - const maxFragmentUniforms = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS); - const vertexTextures = maxVertexTextures > 0; - const maxSamples = gl.getParameter(gl.MAX_SAMPLES); - return { - isWebGL2: true, - // keeping this for backwards compatibility - getMaxAnisotropy, - getMaxPrecision, - textureFormatReadable, - textureTypeReadable, - precision, - logarithmicDepthBuffer, - reverseDepthBuffer, - maxTextures, - maxVertexTextures, - maxTextureSize, - maxCubemapSize, - maxAttributes, - maxVertexUniforms, - maxVaryings, - maxFragmentUniforms, - vertexTextures, - maxSamples - }; -} -__name(WebGLCapabilities, "WebGLCapabilities"); -function WebGLClipping(properties) { - const scope = this; - let globalState = null, numGlobalPlanes = 0, localClippingEnabled = false, renderingShadows = false; - const plane = new Plane(), viewNormalMatrix = new Matrix3(), uniform = { value: null, needsUpdate: false }; - this.uniform = uniform; - this.numPlanes = 0; - this.numIntersection = 0; - this.init = function(planes, enableLocalClipping) { - const enabled = planes.length !== 0 || enableLocalClipping || // enable state of previous frame - the clipping code has to - // run another frame in order to reset the state: - numGlobalPlanes !== 0 || localClippingEnabled; - localClippingEnabled = enableLocalClipping; - numGlobalPlanes = planes.length; - return enabled; - }; - this.beginShadows = function() { - renderingShadows = true; - projectPlanes(null); - }; - this.endShadows = function() { - renderingShadows = false; - }; - this.setGlobalState = function(planes, camera) { - globalState = projectPlanes(planes, camera, 0); - }; - this.setState = function(material, camera, useCache) { - const planes = material.clippingPlanes, clipIntersection = material.clipIntersection, clipShadows = material.clipShadows; - const materialProperties = properties.get(material); - if (!localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && !clipShadows) { - if (renderingShadows) { - projectPlanes(null); - } else { - resetGlobalState(); - } - } else { - const nGlobal = renderingShadows ? 0 : numGlobalPlanes, lGlobal = nGlobal * 4; - let dstArray = materialProperties.clippingState || null; - uniform.value = dstArray; - dstArray = projectPlanes(planes, camera, lGlobal, useCache); - for (let i = 0; i !== lGlobal; ++i) { - dstArray[i] = globalState[i]; - } - materialProperties.clippingState = dstArray; - this.numIntersection = clipIntersection ? this.numPlanes : 0; - this.numPlanes += nGlobal; - } - }; - function resetGlobalState() { - if (uniform.value !== globalState) { - uniform.value = globalState; - uniform.needsUpdate = numGlobalPlanes > 0; - } - scope.numPlanes = numGlobalPlanes; - scope.numIntersection = 0; - } - __name(resetGlobalState, "resetGlobalState"); - function projectPlanes(planes, camera, dstOffset, skipTransform) { - const nPlanes = planes !== null ? planes.length : 0; - let dstArray = null; - if (nPlanes !== 0) { - dstArray = uniform.value; - if (skipTransform !== true || dstArray === null) { - const flatSize = dstOffset + nPlanes * 4, viewMatrix = camera.matrixWorldInverse; - viewNormalMatrix.getNormalMatrix(viewMatrix); - if (dstArray === null || dstArray.length < flatSize) { - dstArray = new Float32Array(flatSize); - } - for (let i = 0, i4 = dstOffset; i !== nPlanes; ++i, i4 += 4) { - plane.copy(planes[i]).applyMatrix4(viewMatrix, viewNormalMatrix); - plane.normal.toArray(dstArray, i4); - dstArray[i4 + 3] = plane.constant; - } - } - uniform.value = dstArray; - uniform.needsUpdate = true; - } - scope.numPlanes = nPlanes; - scope.numIntersection = 0; - return dstArray; - } - __name(projectPlanes, "projectPlanes"); -} -__name(WebGLClipping, "WebGLClipping"); -function WebGLCubeMaps(renderer) { - let cubemaps = /* @__PURE__ */ new WeakMap(); - function mapTextureMapping(texture, mapping) { - if (mapping === EquirectangularReflectionMapping) { - texture.mapping = CubeReflectionMapping; - } else if (mapping === EquirectangularRefractionMapping) { - texture.mapping = CubeRefractionMapping; - } - return texture; - } - __name(mapTextureMapping, "mapTextureMapping"); - function get(texture) { - if (texture && texture.isTexture) { - const mapping = texture.mapping; - if (mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping) { - if (cubemaps.has(texture)) { - const cubemap = cubemaps.get(texture).texture; - return mapTextureMapping(cubemap, texture.mapping); - } else { - const image = texture.image; - if (image && image.height > 0) { - const renderTarget = new WebGLCubeRenderTarget(image.height); - renderTarget.fromEquirectangularTexture(renderer, texture); - cubemaps.set(texture, renderTarget); - texture.addEventListener("dispose", onTextureDispose); - return mapTextureMapping(renderTarget.texture, texture.mapping); - } else { - return null; - } - } - } - } - return texture; - } - __name(get, "get"); - function onTextureDispose(event) { - const texture = event.target; - texture.removeEventListener("dispose", onTextureDispose); - const cubemap = cubemaps.get(texture); - if (cubemap !== void 0) { - cubemaps.delete(texture); - cubemap.dispose(); - } - } - __name(onTextureDispose, "onTextureDispose"); - function dispose() { - cubemaps = /* @__PURE__ */ new WeakMap(); - } - __name(dispose, "dispose"); - return { - get, - dispose - }; -} -__name(WebGLCubeMaps, "WebGLCubeMaps"); -class OrthographicCamera extends Camera { - static { - __name(this, "OrthographicCamera"); - } - constructor(left = -1, right = 1, top = 1, bottom = -1, near = 0.1, far = 2e3) { - super(); - this.isOrthographicCamera = true; - this.type = "OrthographicCamera"; - this.zoom = 1; - this.view = null; - this.left = left; - this.right = right; - this.top = top; - this.bottom = bottom; - this.near = near; - this.far = far; - this.updateProjectionMatrix(); - } - copy(source, recursive) { - super.copy(source, recursive); - this.left = source.left; - this.right = source.right; - this.top = source.top; - this.bottom = source.bottom; - this.near = source.near; - this.far = source.far; - this.zoom = source.zoom; - this.view = source.view === null ? null : Object.assign({}, source.view); - return this; - } - setViewOffset(fullWidth, fullHeight, x, y, width, height) { - if (this.view === null) { - this.view = { - enabled: true, - fullWidth: 1, - fullHeight: 1, - offsetX: 0, - offsetY: 0, - width: 1, - height: 1 - }; - } - this.view.enabled = true; - this.view.fullWidth = fullWidth; - this.view.fullHeight = fullHeight; - this.view.offsetX = x; - this.view.offsetY = y; - this.view.width = width; - this.view.height = height; - this.updateProjectionMatrix(); - } - clearViewOffset() { - if (this.view !== null) { - this.view.enabled = false; - } - this.updateProjectionMatrix(); - } - updateProjectionMatrix() { - const dx = (this.right - this.left) / (2 * this.zoom); - const dy = (this.top - this.bottom) / (2 * this.zoom); - const cx = (this.right + this.left) / 2; - const cy = (this.top + this.bottom) / 2; - let left = cx - dx; - let right = cx + dx; - let top = cy + dy; - let bottom = cy - dy; - if (this.view !== null && this.view.enabled) { - const scaleW = (this.right - this.left) / this.view.fullWidth / this.zoom; - const scaleH = (this.top - this.bottom) / this.view.fullHeight / this.zoom; - left += scaleW * this.view.offsetX; - right = left + scaleW * this.view.width; - top -= scaleH * this.view.offsetY; - bottom = top - scaleH * this.view.height; - } - this.projectionMatrix.makeOrthographic(left, right, top, bottom, this.near, this.far, this.coordinateSystem); - this.projectionMatrixInverse.copy(this.projectionMatrix).invert(); - } - toJSON(meta) { - const data = super.toJSON(meta); - data.object.zoom = this.zoom; - data.object.left = this.left; - data.object.right = this.right; - data.object.top = this.top; - data.object.bottom = this.bottom; - data.object.near = this.near; - data.object.far = this.far; - if (this.view !== null) data.object.view = Object.assign({}, this.view); - return data; - } -} -const LOD_MIN = 4; -const EXTRA_LOD_SIGMA = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582]; -const MAX_SAMPLES = 20; -const _flatCamera = /* @__PURE__ */ new OrthographicCamera(); -const _clearColor = /* @__PURE__ */ new Color(); -let _oldTarget = null; -let _oldActiveCubeFace = 0; -let _oldActiveMipmapLevel = 0; -let _oldXrEnabled = false; -const PHI = (1 + Math.sqrt(5)) / 2; -const INV_PHI = 1 / PHI; -const _axisDirections = [ - /* @__PURE__ */ new Vector3(-PHI, INV_PHI, 0), - /* @__PURE__ */ new Vector3(PHI, INV_PHI, 0), - /* @__PURE__ */ new Vector3(-INV_PHI, 0, PHI), - /* @__PURE__ */ new Vector3(INV_PHI, 0, PHI), - /* @__PURE__ */ new Vector3(0, PHI, -INV_PHI), - /* @__PURE__ */ new Vector3(0, PHI, INV_PHI), - /* @__PURE__ */ new Vector3(-1, 1, -1), - /* @__PURE__ */ new Vector3(1, 1, -1), - /* @__PURE__ */ new Vector3(-1, 1, 1), - /* @__PURE__ */ new Vector3(1, 1, 1) -]; -class PMREMGenerator { - static { - __name(this, "PMREMGenerator"); - } - constructor(renderer) { - this._renderer = renderer; - this._pingPongRenderTarget = null; - this._lodMax = 0; - this._cubeSize = 0; - this._lodPlanes = []; - this._sizeLods = []; - this._sigmas = []; - this._blurMaterial = null; - this._cubemapMaterial = null; - this._equirectMaterial = null; - this._compileMaterial(this._blurMaterial); - } - /** - * Generates a PMREM from a supplied Scene, which can be faster than using an - * image if networking bandwidth is low. Optional sigma specifies a blur radius - * in radians to be applied to the scene before PMREM generation. Optional near - * and far planes ensure the scene is rendered in its entirety (the cubeCamera - * is placed at the origin). - */ - fromScene(scene, sigma = 0, near = 0.1, far = 100) { - _oldTarget = this._renderer.getRenderTarget(); - _oldActiveCubeFace = this._renderer.getActiveCubeFace(); - _oldActiveMipmapLevel = this._renderer.getActiveMipmapLevel(); - _oldXrEnabled = this._renderer.xr.enabled; - this._renderer.xr.enabled = false; - this._setSize(256); - const cubeUVRenderTarget = this._allocateTargets(); - cubeUVRenderTarget.depthBuffer = true; - this._sceneToCubeUV(scene, near, far, cubeUVRenderTarget); - if (sigma > 0) { - this._blur(cubeUVRenderTarget, 0, 0, sigma); - } - this._applyPMREM(cubeUVRenderTarget); - this._cleanup(cubeUVRenderTarget); - return cubeUVRenderTarget; - } - /** - * Generates a PMREM from an equirectangular texture, which can be either LDR - * or HDR. The ideal input image size is 1k (1024 x 512), - * as this matches best with the 256 x 256 cubemap output. - * The smallest supported equirectangular image size is 64 x 32. - */ - fromEquirectangular(equirectangular, renderTarget = null) { - return this._fromTexture(equirectangular, renderTarget); - } - /** - * Generates a PMREM from an cubemap texture, which can be either LDR - * or HDR. The ideal input cube size is 256 x 256, - * as this matches best with the 256 x 256 cubemap output. - * The smallest supported cube size is 16 x 16. - */ - fromCubemap(cubemap, renderTarget = null) { - return this._fromTexture(cubemap, renderTarget); - } - /** - * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during - * your texture's network fetch for increased concurrency. - */ - compileCubemapShader() { - if (this._cubemapMaterial === null) { - this._cubemapMaterial = _getCubemapMaterial(); - this._compileMaterial(this._cubemapMaterial); - } - } - /** - * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during - * your texture's network fetch for increased concurrency. - */ - compileEquirectangularShader() { - if (this._equirectMaterial === null) { - this._equirectMaterial = _getEquirectMaterial(); - this._compileMaterial(this._equirectMaterial); - } - } - /** - * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, - * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on - * one of them will cause any others to also become unusable. - */ - dispose() { - this._dispose(); - if (this._cubemapMaterial !== null) this._cubemapMaterial.dispose(); - if (this._equirectMaterial !== null) this._equirectMaterial.dispose(); - } - // private interface - _setSize(cubeSize) { - this._lodMax = Math.floor(Math.log2(cubeSize)); - this._cubeSize = Math.pow(2, this._lodMax); - } - _dispose() { - if (this._blurMaterial !== null) this._blurMaterial.dispose(); - if (this._pingPongRenderTarget !== null) this._pingPongRenderTarget.dispose(); - for (let i = 0; i < this._lodPlanes.length; i++) { - this._lodPlanes[i].dispose(); - } - } - _cleanup(outputTarget) { - this._renderer.setRenderTarget(_oldTarget, _oldActiveCubeFace, _oldActiveMipmapLevel); - this._renderer.xr.enabled = _oldXrEnabled; - outputTarget.scissorTest = false; - _setViewport(outputTarget, 0, 0, outputTarget.width, outputTarget.height); - } - _fromTexture(texture, renderTarget) { - if (texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping) { - this._setSize(texture.image.length === 0 ? 16 : texture.image[0].width || texture.image[0].image.width); - } else { - this._setSize(texture.image.width / 4); - } - _oldTarget = this._renderer.getRenderTarget(); - _oldActiveCubeFace = this._renderer.getActiveCubeFace(); - _oldActiveMipmapLevel = this._renderer.getActiveMipmapLevel(); - _oldXrEnabled = this._renderer.xr.enabled; - this._renderer.xr.enabled = false; - const cubeUVRenderTarget = renderTarget || this._allocateTargets(); - this._textureToCubeUV(texture, cubeUVRenderTarget); - this._applyPMREM(cubeUVRenderTarget); - this._cleanup(cubeUVRenderTarget); - return cubeUVRenderTarget; - } - _allocateTargets() { - const width = 3 * Math.max(this._cubeSize, 16 * 7); - const height = 4 * this._cubeSize; - const params = { - magFilter: LinearFilter, - minFilter: LinearFilter, - generateMipmaps: false, - type: HalfFloatType, - format: RGBAFormat, - colorSpace: LinearSRGBColorSpace, - depthBuffer: false - }; - const cubeUVRenderTarget = _createRenderTarget(width, height, params); - if (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== width || this._pingPongRenderTarget.height !== height) { - if (this._pingPongRenderTarget !== null) { - this._dispose(); - } - this._pingPongRenderTarget = _createRenderTarget(width, height, params); - const { _lodMax } = this; - ({ sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas } = _createPlanes(_lodMax)); - this._blurMaterial = _getBlurShader(_lodMax, width, height); - } - return cubeUVRenderTarget; - } - _compileMaterial(material) { - const tmpMesh = new Mesh(this._lodPlanes[0], material); - this._renderer.compile(tmpMesh, _flatCamera); - } - _sceneToCubeUV(scene, near, far, cubeUVRenderTarget) { - const fov2 = 90; - const aspect2 = 1; - const cubeCamera = new PerspectiveCamera(fov2, aspect2, near, far); - const upSign = [1, -1, 1, 1, 1, 1]; - const forwardSign = [1, 1, 1, -1, -1, -1]; - const renderer = this._renderer; - const originalAutoClear = renderer.autoClear; - const toneMapping = renderer.toneMapping; - renderer.getClearColor(_clearColor); - renderer.toneMapping = NoToneMapping; - renderer.autoClear = false; - const backgroundMaterial = new MeshBasicMaterial({ - name: "PMREM.Background", - side: BackSide, - depthWrite: false, - depthTest: false - }); - const backgroundBox = new Mesh(new BoxGeometry(), backgroundMaterial); - let useSolidColor = false; - const background = scene.background; - if (background) { - if (background.isColor) { - backgroundMaterial.color.copy(background); - scene.background = null; - useSolidColor = true; - } - } else { - backgroundMaterial.color.copy(_clearColor); - useSolidColor = true; - } - for (let i = 0; i < 6; i++) { - const col = i % 3; - if (col === 0) { - cubeCamera.up.set(0, upSign[i], 0); - cubeCamera.lookAt(forwardSign[i], 0, 0); - } else if (col === 1) { - cubeCamera.up.set(0, 0, upSign[i]); - cubeCamera.lookAt(0, forwardSign[i], 0); - } else { - cubeCamera.up.set(0, upSign[i], 0); - cubeCamera.lookAt(0, 0, forwardSign[i]); - } - const size = this._cubeSize; - _setViewport(cubeUVRenderTarget, col * size, i > 2 ? size : 0, size, size); - renderer.setRenderTarget(cubeUVRenderTarget); - if (useSolidColor) { - renderer.render(backgroundBox, cubeCamera); - } - renderer.render(scene, cubeCamera); - } - backgroundBox.geometry.dispose(); - backgroundBox.material.dispose(); - renderer.toneMapping = toneMapping; - renderer.autoClear = originalAutoClear; - scene.background = background; - } - _textureToCubeUV(texture, cubeUVRenderTarget) { - const renderer = this._renderer; - const isCubeTexture = texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping; - if (isCubeTexture) { - if (this._cubemapMaterial === null) { - this._cubemapMaterial = _getCubemapMaterial(); - } - this._cubemapMaterial.uniforms.flipEnvMap.value = texture.isRenderTargetTexture === false ? -1 : 1; - } else { - if (this._equirectMaterial === null) { - this._equirectMaterial = _getEquirectMaterial(); - } - } - const material = isCubeTexture ? this._cubemapMaterial : this._equirectMaterial; - const mesh = new Mesh(this._lodPlanes[0], material); - const uniforms = material.uniforms; - uniforms["envMap"].value = texture; - const size = this._cubeSize; - _setViewport(cubeUVRenderTarget, 0, 0, 3 * size, 2 * size); - renderer.setRenderTarget(cubeUVRenderTarget); - renderer.render(mesh, _flatCamera); - } - _applyPMREM(cubeUVRenderTarget) { - const renderer = this._renderer; - const autoClear = renderer.autoClear; - renderer.autoClear = false; - const n = this._lodPlanes.length; - for (let i = 1; i < n; i++) { - const sigma = Math.sqrt(this._sigmas[i] * this._sigmas[i] - this._sigmas[i - 1] * this._sigmas[i - 1]); - const poleAxis = _axisDirections[(n - i - 1) % _axisDirections.length]; - this._blur(cubeUVRenderTarget, i - 1, i, sigma, poleAxis); - } - renderer.autoClear = autoClear; - } - /** - * This is a two-pass Gaussian blur for a cubemap. Normally this is done - * vertically and horizontally, but this breaks down on a cube. Here we apply - * the blur latitudinally (around the poles), and then longitudinally (towards - * the poles) to approximate the orthogonally-separable blur. It is least - * accurate at the poles, but still does a decent job. - */ - _blur(cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis) { - const pingPongRenderTarget = this._pingPongRenderTarget; - this._halfBlur( - cubeUVRenderTarget, - pingPongRenderTarget, - lodIn, - lodOut, - sigma, - "latitudinal", - poleAxis - ); - this._halfBlur( - pingPongRenderTarget, - cubeUVRenderTarget, - lodOut, - lodOut, - sigma, - "longitudinal", - poleAxis - ); - } - _halfBlur(targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis) { - const renderer = this._renderer; - const blurMaterial = this._blurMaterial; - if (direction !== "latitudinal" && direction !== "longitudinal") { - console.error( - "blur direction must be either latitudinal or longitudinal!" - ); - } - const STANDARD_DEVIATIONS = 3; - const blurMesh = new Mesh(this._lodPlanes[lodOut], blurMaterial); - const blurUniforms = blurMaterial.uniforms; - const pixels = this._sizeLods[lodIn] - 1; - const radiansPerPixel = isFinite(sigmaRadians) ? Math.PI / (2 * pixels) : 2 * Math.PI / (2 * MAX_SAMPLES - 1); - const sigmaPixels = sigmaRadians / radiansPerPixel; - const samples = isFinite(sigmaRadians) ? 1 + Math.floor(STANDARD_DEVIATIONS * sigmaPixels) : MAX_SAMPLES; - if (samples > MAX_SAMPLES) { - console.warn(`sigmaRadians, ${sigmaRadians}, is too large and will clip, as it requested ${samples} samples when the maximum is set to ${MAX_SAMPLES}`); - } - const weights = []; - let sum = 0; - for (let i = 0; i < MAX_SAMPLES; ++i) { - const x2 = i / sigmaPixels; - const weight = Math.exp(-x2 * x2 / 2); - weights.push(weight); - if (i === 0) { - sum += weight; - } else if (i < samples) { - sum += 2 * weight; - } - } - for (let i = 0; i < weights.length; i++) { - weights[i] = weights[i] / sum; - } - blurUniforms["envMap"].value = targetIn.texture; - blurUniforms["samples"].value = samples; - blurUniforms["weights"].value = weights; - blurUniforms["latitudinal"].value = direction === "latitudinal"; - if (poleAxis) { - blurUniforms["poleAxis"].value = poleAxis; - } - const { _lodMax } = this; - blurUniforms["dTheta"].value = radiansPerPixel; - blurUniforms["mipInt"].value = _lodMax - lodIn; - const outputSize = this._sizeLods[lodOut]; - const x = 3 * outputSize * (lodOut > _lodMax - LOD_MIN ? lodOut - _lodMax + LOD_MIN : 0); - const y = 4 * (this._cubeSize - outputSize); - _setViewport(targetOut, x, y, 3 * outputSize, 2 * outputSize); - renderer.setRenderTarget(targetOut); - renderer.render(blurMesh, _flatCamera); - } -} -function _createPlanes(lodMax) { - const lodPlanes = []; - const sizeLods = []; - const sigmas = []; - let lod = lodMax; - const totalLods = lodMax - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length; - for (let i = 0; i < totalLods; i++) { - const sizeLod = Math.pow(2, lod); - sizeLods.push(sizeLod); - let sigma = 1 / sizeLod; - if (i > lodMax - LOD_MIN) { - sigma = EXTRA_LOD_SIGMA[i - lodMax + LOD_MIN - 1]; - } else if (i === 0) { - sigma = 0; - } - sigmas.push(sigma); - const texelSize = 1 / (sizeLod - 2); - const min = -texelSize; - const max2 = 1 + texelSize; - const uv1 = [min, min, max2, min, max2, max2, min, min, max2, max2, min, max2]; - const cubeFaces = 6; - const vertices = 6; - const positionSize = 3; - const uvSize = 2; - const faceIndexSize = 1; - const position = new Float32Array(positionSize * vertices * cubeFaces); - const uv = new Float32Array(uvSize * vertices * cubeFaces); - const faceIndex = new Float32Array(faceIndexSize * vertices * cubeFaces); - for (let face = 0; face < cubeFaces; face++) { - const x = face % 3 * 2 / 3 - 1; - const y = face > 2 ? 0 : -1; - const coordinates = [ - x, - y, - 0, - x + 2 / 3, - y, - 0, - x + 2 / 3, - y + 1, - 0, - x, - y, - 0, - x + 2 / 3, - y + 1, - 0, - x, - y + 1, - 0 - ]; - position.set(coordinates, positionSize * vertices * face); - uv.set(uv1, uvSize * vertices * face); - const fill2 = [face, face, face, face, face, face]; - faceIndex.set(fill2, faceIndexSize * vertices * face); - } - const planes = new BufferGeometry(); - planes.setAttribute("position", new BufferAttribute(position, positionSize)); - planes.setAttribute("uv", new BufferAttribute(uv, uvSize)); - planes.setAttribute("faceIndex", new BufferAttribute(faceIndex, faceIndexSize)); - lodPlanes.push(planes); - if (lod > LOD_MIN) { - lod--; - } - } - return { lodPlanes, sizeLods, sigmas }; -} -__name(_createPlanes, "_createPlanes"); -function _createRenderTarget(width, height, params) { - const cubeUVRenderTarget = new WebGLRenderTarget(width, height, params); - cubeUVRenderTarget.texture.mapping = CubeUVReflectionMapping; - cubeUVRenderTarget.texture.name = "PMREM.cubeUv"; - cubeUVRenderTarget.scissorTest = true; - return cubeUVRenderTarget; -} -__name(_createRenderTarget, "_createRenderTarget"); -function _setViewport(target, x, y, width, height) { - target.viewport.set(x, y, width, height); - target.scissor.set(x, y, width, height); -} -__name(_setViewport, "_setViewport"); -function _getBlurShader(lodMax, width, height) { - const weights = new Float32Array(MAX_SAMPLES); - const poleAxis = new Vector3(0, 1, 0); - const shaderMaterial = new ShaderMaterial({ - name: "SphericalGaussianBlur", - defines: { - "n": MAX_SAMPLES, - "CUBEUV_TEXEL_WIDTH": 1 / width, - "CUBEUV_TEXEL_HEIGHT": 1 / height, - "CUBEUV_MAX_MIP": `${lodMax}.0` - }, - uniforms: { - "envMap": { value: null }, - "samples": { value: 1 }, - "weights": { value: weights }, - "latitudinal": { value: false }, - "dTheta": { value: 0 }, - "mipInt": { value: 0 }, - "poleAxis": { value: poleAxis } - }, - vertexShader: _getCommonVertexShader(), - fragmentShader: ( - /* glsl */ - ` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - ` - ), - blending: NoBlending, - depthTest: false, - depthWrite: false - }); - return shaderMaterial; -} -__name(_getBlurShader, "_getBlurShader"); -function _getEquirectMaterial() { - return new ShaderMaterial({ - name: "EquirectangularToCubeUV", - uniforms: { - "envMap": { value: null } - }, - vertexShader: _getCommonVertexShader(), - fragmentShader: ( - /* glsl */ - ` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - ` - ), - blending: NoBlending, - depthTest: false, - depthWrite: false - }); -} -__name(_getEquirectMaterial, "_getEquirectMaterial"); -function _getCubemapMaterial() { - return new ShaderMaterial({ - name: "CubemapToCubeUV", - uniforms: { - "envMap": { value: null }, - "flipEnvMap": { value: -1 } - }, - vertexShader: _getCommonVertexShader(), - fragmentShader: ( - /* glsl */ - ` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - ` - ), - blending: NoBlending, - depthTest: false, - depthWrite: false - }); -} -__name(_getCubemapMaterial, "_getCubemapMaterial"); -function _getCommonVertexShader() { - return ( - /* glsl */ - ` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - ` - ); -} -__name(_getCommonVertexShader, "_getCommonVertexShader"); -function WebGLCubeUVMaps(renderer) { - let cubeUVmaps = /* @__PURE__ */ new WeakMap(); - let pmremGenerator = null; - function get(texture) { - if (texture && texture.isTexture) { - const mapping = texture.mapping; - const isEquirectMap = mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping; - const isCubeMap = mapping === CubeReflectionMapping || mapping === CubeRefractionMapping; - if (isEquirectMap || isCubeMap) { - let renderTarget = cubeUVmaps.get(texture); - const currentPMREMVersion = renderTarget !== void 0 ? renderTarget.texture.pmremVersion : 0; - if (texture.isRenderTargetTexture && texture.pmremVersion !== currentPMREMVersion) { - if (pmremGenerator === null) pmremGenerator = new PMREMGenerator(renderer); - renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular(texture, renderTarget) : pmremGenerator.fromCubemap(texture, renderTarget); - renderTarget.texture.pmremVersion = texture.pmremVersion; - cubeUVmaps.set(texture, renderTarget); - return renderTarget.texture; - } else { - if (renderTarget !== void 0) { - return renderTarget.texture; - } else { - const image = texture.image; - if (isEquirectMap && image && image.height > 0 || isCubeMap && image && isCubeTextureComplete(image)) { - if (pmremGenerator === null) pmremGenerator = new PMREMGenerator(renderer); - renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular(texture) : pmremGenerator.fromCubemap(texture); - renderTarget.texture.pmremVersion = texture.pmremVersion; - cubeUVmaps.set(texture, renderTarget); - texture.addEventListener("dispose", onTextureDispose); - return renderTarget.texture; - } else { - return null; - } - } - } - } - } - return texture; - } - __name(get, "get"); - function isCubeTextureComplete(image) { - let count = 0; - const length = 6; - for (let i = 0; i < length; i++) { - if (image[i] !== void 0) count++; - } - return count === length; - } - __name(isCubeTextureComplete, "isCubeTextureComplete"); - function onTextureDispose(event) { - const texture = event.target; - texture.removeEventListener("dispose", onTextureDispose); - const cubemapUV = cubeUVmaps.get(texture); - if (cubemapUV !== void 0) { - cubeUVmaps.delete(texture); - cubemapUV.dispose(); - } - } - __name(onTextureDispose, "onTextureDispose"); - function dispose() { - cubeUVmaps = /* @__PURE__ */ new WeakMap(); - if (pmremGenerator !== null) { - pmremGenerator.dispose(); - pmremGenerator = null; - } - } - __name(dispose, "dispose"); - return { - get, - dispose - }; -} -__name(WebGLCubeUVMaps, "WebGLCubeUVMaps"); -function WebGLExtensions(gl) { - const extensions = {}; - function getExtension(name) { - if (extensions[name] !== void 0) { - return extensions[name]; - } - let extension; - switch (name) { - case "WEBGL_depth_texture": - extension = gl.getExtension("WEBGL_depth_texture") || gl.getExtension("MOZ_WEBGL_depth_texture") || gl.getExtension("WEBKIT_WEBGL_depth_texture"); - break; - case "EXT_texture_filter_anisotropic": - extension = gl.getExtension("EXT_texture_filter_anisotropic") || gl.getExtension("MOZ_EXT_texture_filter_anisotropic") || gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic"); - break; - case "WEBGL_compressed_texture_s3tc": - extension = gl.getExtension("WEBGL_compressed_texture_s3tc") || gl.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"); - break; - case "WEBGL_compressed_texture_pvrtc": - extension = gl.getExtension("WEBGL_compressed_texture_pvrtc") || gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"); - break; - default: - extension = gl.getExtension(name); - } - extensions[name] = extension; - return extension; - } - __name(getExtension, "getExtension"); - return { - has: /* @__PURE__ */ __name(function(name) { - return getExtension(name) !== null; - }, "has"), - init: /* @__PURE__ */ __name(function() { - getExtension("EXT_color_buffer_float"); - getExtension("WEBGL_clip_cull_distance"); - getExtension("OES_texture_float_linear"); - getExtension("EXT_color_buffer_half_float"); - getExtension("WEBGL_multisampled_render_to_texture"); - getExtension("WEBGL_render_shared_exponent"); - }, "init"), - get: /* @__PURE__ */ __name(function(name) { - const extension = getExtension(name); - if (extension === null) { - warnOnce("THREE.WebGLRenderer: " + name + " extension not supported."); - } - return extension; - }, "get") - }; -} -__name(WebGLExtensions, "WebGLExtensions"); -function WebGLGeometries(gl, attributes, info, bindingStates) { - const geometries = {}; - const wireframeAttributes = /* @__PURE__ */ new WeakMap(); - function onGeometryDispose(event) { - const geometry = event.target; - if (geometry.index !== null) { - attributes.remove(geometry.index); - } - for (const name in geometry.attributes) { - attributes.remove(geometry.attributes[name]); - } - for (const name in geometry.morphAttributes) { - const array = geometry.morphAttributes[name]; - for (let i = 0, l = array.length; i < l; i++) { - attributes.remove(array[i]); - } - } - geometry.removeEventListener("dispose", onGeometryDispose); - delete geometries[geometry.id]; - const attribute = wireframeAttributes.get(geometry); - if (attribute) { - attributes.remove(attribute); - wireframeAttributes.delete(geometry); - } - bindingStates.releaseStatesOfGeometry(geometry); - if (geometry.isInstancedBufferGeometry === true) { - delete geometry._maxInstanceCount; - } - info.memory.geometries--; - } - __name(onGeometryDispose, "onGeometryDispose"); - function get(object, geometry) { - if (geometries[geometry.id] === true) return geometry; - geometry.addEventListener("dispose", onGeometryDispose); - geometries[geometry.id] = true; - info.memory.geometries++; - return geometry; - } - __name(get, "get"); - function update(geometry) { - const geometryAttributes = geometry.attributes; - for (const name in geometryAttributes) { - attributes.update(geometryAttributes[name], gl.ARRAY_BUFFER); - } - const morphAttributes = geometry.morphAttributes; - for (const name in morphAttributes) { - const array = morphAttributes[name]; - for (let i = 0, l = array.length; i < l; i++) { - attributes.update(array[i], gl.ARRAY_BUFFER); - } - } - } - __name(update, "update"); - function updateWireframeAttribute(geometry) { - const indices = []; - const geometryIndex = geometry.index; - const geometryPosition = geometry.attributes.position; - let version = 0; - if (geometryIndex !== null) { - const array = geometryIndex.array; - version = geometryIndex.version; - for (let i = 0, l = array.length; i < l; i += 3) { - const a = array[i + 0]; - const b = array[i + 1]; - const c = array[i + 2]; - indices.push(a, b, b, c, c, a); - } - } else if (geometryPosition !== void 0) { - const array = geometryPosition.array; - version = geometryPosition.version; - for (let i = 0, l = array.length / 3 - 1; i < l; i += 3) { - const a = i + 0; - const b = i + 1; - const c = i + 2; - indices.push(a, b, b, c, c, a); - } - } else { - return; - } - const attribute = new (arrayNeedsUint32(indices) ? Uint32BufferAttribute : Uint16BufferAttribute)(indices, 1); - attribute.version = version; - const previousAttribute = wireframeAttributes.get(geometry); - if (previousAttribute) attributes.remove(previousAttribute); - wireframeAttributes.set(geometry, attribute); - } - __name(updateWireframeAttribute, "updateWireframeAttribute"); - function getWireframeAttribute(geometry) { - const currentAttribute = wireframeAttributes.get(geometry); - if (currentAttribute) { - const geometryIndex = geometry.index; - if (geometryIndex !== null) { - if (currentAttribute.version < geometryIndex.version) { - updateWireframeAttribute(geometry); - } - } - } else { - updateWireframeAttribute(geometry); - } - return wireframeAttributes.get(geometry); - } - __name(getWireframeAttribute, "getWireframeAttribute"); - return { - get, - update, - getWireframeAttribute - }; -} -__name(WebGLGeometries, "WebGLGeometries"); -function WebGLIndexedBufferRenderer(gl, extensions, info) { - let mode; - function setMode(value) { - mode = value; - } - __name(setMode, "setMode"); - let type, bytesPerElement; - function setIndex(value) { - type = value.type; - bytesPerElement = value.bytesPerElement; - } - __name(setIndex, "setIndex"); - function render(start, count) { - gl.drawElements(mode, count, type, start * bytesPerElement); - info.update(count, mode, 1); - } - __name(render, "render"); - function renderInstances(start, count, primcount) { - if (primcount === 0) return; - gl.drawElementsInstanced(mode, count, type, start * bytesPerElement, primcount); - info.update(count, mode, primcount); - } - __name(renderInstances, "renderInstances"); - function renderMultiDraw(starts, counts, drawCount) { - if (drawCount === 0) return; - const extension = extensions.get("WEBGL_multi_draw"); - extension.multiDrawElementsWEBGL(mode, counts, 0, type, starts, 0, drawCount); - let elementCount = 0; - for (let i = 0; i < drawCount; i++) { - elementCount += counts[i]; - } - info.update(elementCount, mode, 1); - } - __name(renderMultiDraw, "renderMultiDraw"); - function renderMultiDrawInstances(starts, counts, drawCount, primcount) { - if (drawCount === 0) return; - const extension = extensions.get("WEBGL_multi_draw"); - if (extension === null) { - for (let i = 0; i < starts.length; i++) { - renderInstances(starts[i] / bytesPerElement, counts[i], primcount[i]); - } - } else { - extension.multiDrawElementsInstancedWEBGL(mode, counts, 0, type, starts, 0, primcount, 0, drawCount); - let elementCount = 0; - for (let i = 0; i < drawCount; i++) { - elementCount += counts[i] * primcount[i]; - } - info.update(elementCount, mode, 1); - } - } - __name(renderMultiDrawInstances, "renderMultiDrawInstances"); - this.setMode = setMode; - this.setIndex = setIndex; - this.render = render; - this.renderInstances = renderInstances; - this.renderMultiDraw = renderMultiDraw; - this.renderMultiDrawInstances = renderMultiDrawInstances; -} -__name(WebGLIndexedBufferRenderer, "WebGLIndexedBufferRenderer"); -function WebGLInfo(gl) { - const memory = { - geometries: 0, - textures: 0 - }; - const render = { - frame: 0, - calls: 0, - triangles: 0, - points: 0, - lines: 0 - }; - function update(count, mode, instanceCount) { - render.calls++; - switch (mode) { - case gl.TRIANGLES: - render.triangles += instanceCount * (count / 3); - break; - case gl.LINES: - render.lines += instanceCount * (count / 2); - break; - case gl.LINE_STRIP: - render.lines += instanceCount * (count - 1); - break; - case gl.LINE_LOOP: - render.lines += instanceCount * count; - break; - case gl.POINTS: - render.points += instanceCount * count; - break; - default: - console.error("THREE.WebGLInfo: Unknown draw mode:", mode); - break; - } - } - __name(update, "update"); - function reset() { - render.calls = 0; - render.triangles = 0; - render.points = 0; - render.lines = 0; - } - __name(reset, "reset"); - return { - memory, - render, - programs: null, - autoReset: true, - reset, - update - }; -} -__name(WebGLInfo, "WebGLInfo"); -function WebGLMorphtargets(gl, capabilities, textures) { - const morphTextures = /* @__PURE__ */ new WeakMap(); - const morph = new Vector4(); - function update(object, geometry, program) { - const objectInfluences = object.morphTargetInfluences; - const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color; - const morphTargetsCount = morphAttribute !== void 0 ? morphAttribute.length : 0; - let entry = morphTextures.get(geometry); - if (entry === void 0 || entry.count !== morphTargetsCount) { - let disposeTexture = function() { - texture.dispose(); - morphTextures.delete(geometry); - geometry.removeEventListener("dispose", disposeTexture); - }; - __name(disposeTexture, "disposeTexture"); - if (entry !== void 0) entry.texture.dispose(); - const hasMorphPosition = geometry.morphAttributes.position !== void 0; - const hasMorphNormals = geometry.morphAttributes.normal !== void 0; - const hasMorphColors = geometry.morphAttributes.color !== void 0; - const morphTargets = geometry.morphAttributes.position || []; - const morphNormals = geometry.morphAttributes.normal || []; - const morphColors = geometry.morphAttributes.color || []; - let vertexDataCount = 0; - if (hasMorphPosition === true) vertexDataCount = 1; - if (hasMorphNormals === true) vertexDataCount = 2; - if (hasMorphColors === true) vertexDataCount = 3; - let width = geometry.attributes.position.count * vertexDataCount; - let height = 1; - if (width > capabilities.maxTextureSize) { - height = Math.ceil(width / capabilities.maxTextureSize); - width = capabilities.maxTextureSize; - } - const buffer = new Float32Array(width * height * 4 * morphTargetsCount); - const texture = new DataArrayTexture(buffer, width, height, morphTargetsCount); - texture.type = FloatType; - texture.needsUpdate = true; - const vertexDataStride = vertexDataCount * 4; - for (let i = 0; i < morphTargetsCount; i++) { - const morphTarget = morphTargets[i]; - const morphNormal = morphNormals[i]; - const morphColor = morphColors[i]; - const offset = width * height * 4 * i; - for (let j = 0; j < morphTarget.count; j++) { - const stride = j * vertexDataStride; - if (hasMorphPosition === true) { - morph.fromBufferAttribute(morphTarget, j); - buffer[offset + stride + 0] = morph.x; - buffer[offset + stride + 1] = morph.y; - buffer[offset + stride + 2] = morph.z; - buffer[offset + stride + 3] = 0; - } - if (hasMorphNormals === true) { - morph.fromBufferAttribute(morphNormal, j); - buffer[offset + stride + 4] = morph.x; - buffer[offset + stride + 5] = morph.y; - buffer[offset + stride + 6] = morph.z; - buffer[offset + stride + 7] = 0; - } - if (hasMorphColors === true) { - morph.fromBufferAttribute(morphColor, j); - buffer[offset + stride + 8] = morph.x; - buffer[offset + stride + 9] = morph.y; - buffer[offset + stride + 10] = morph.z; - buffer[offset + stride + 11] = morphColor.itemSize === 4 ? morph.w : 1; - } - } - } - entry = { - count: morphTargetsCount, - texture, - size: new Vector2(width, height) - }; - morphTextures.set(geometry, entry); - geometry.addEventListener("dispose", disposeTexture); - } - if (object.isInstancedMesh === true && object.morphTexture !== null) { - program.getUniforms().setValue(gl, "morphTexture", object.morphTexture, textures); - } else { - let morphInfluencesSum = 0; - for (let i = 0; i < objectInfluences.length; i++) { - morphInfluencesSum += objectInfluences[i]; - } - const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum; - program.getUniforms().setValue(gl, "morphTargetBaseInfluence", morphBaseInfluence); - program.getUniforms().setValue(gl, "morphTargetInfluences", objectInfluences); - } - program.getUniforms().setValue(gl, "morphTargetsTexture", entry.texture, textures); - program.getUniforms().setValue(gl, "morphTargetsTextureSize", entry.size); - } - __name(update, "update"); - return { - update - }; -} -__name(WebGLMorphtargets, "WebGLMorphtargets"); -function WebGLObjects(gl, geometries, attributes, info) { - let updateMap = /* @__PURE__ */ new WeakMap(); - function update(object) { - const frame = info.render.frame; - const geometry = object.geometry; - const buffergeometry = geometries.get(object, geometry); - if (updateMap.get(buffergeometry) !== frame) { - geometries.update(buffergeometry); - updateMap.set(buffergeometry, frame); - } - if (object.isInstancedMesh) { - if (object.hasEventListener("dispose", onInstancedMeshDispose) === false) { - object.addEventListener("dispose", onInstancedMeshDispose); - } - if (updateMap.get(object) !== frame) { - attributes.update(object.instanceMatrix, gl.ARRAY_BUFFER); - if (object.instanceColor !== null) { - attributes.update(object.instanceColor, gl.ARRAY_BUFFER); - } - updateMap.set(object, frame); - } - } - if (object.isSkinnedMesh) { - const skeleton = object.skeleton; - if (updateMap.get(skeleton) !== frame) { - skeleton.update(); - updateMap.set(skeleton, frame); - } - } - return buffergeometry; - } - __name(update, "update"); - function dispose() { - updateMap = /* @__PURE__ */ new WeakMap(); - } - __name(dispose, "dispose"); - function onInstancedMeshDispose(event) { - const instancedMesh = event.target; - instancedMesh.removeEventListener("dispose", onInstancedMeshDispose); - attributes.remove(instancedMesh.instanceMatrix); - if (instancedMesh.instanceColor !== null) attributes.remove(instancedMesh.instanceColor); - } - __name(onInstancedMeshDispose, "onInstancedMeshDispose"); - return { - update, - dispose - }; -} -__name(WebGLObjects, "WebGLObjects"); -class DepthTexture extends Texture { - static { - __name(this, "DepthTexture"); - } - constructor(width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format = DepthFormat) { - if (format !== DepthFormat && format !== DepthStencilFormat) { - throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat"); - } - if (type === void 0 && format === DepthFormat) type = UnsignedIntType; - if (type === void 0 && format === DepthStencilFormat) type = UnsignedInt248Type; - super(null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy); - this.isDepthTexture = true; - this.image = { width, height }; - this.magFilter = magFilter !== void 0 ? magFilter : NearestFilter; - this.minFilter = minFilter !== void 0 ? minFilter : NearestFilter; - this.flipY = false; - this.generateMipmaps = false; - this.compareFunction = null; - } - copy(source) { - super.copy(source); - this.compareFunction = source.compareFunction; - return this; - } - toJSON(meta) { - const data = super.toJSON(meta); - if (this.compareFunction !== null) data.compareFunction = this.compareFunction; - return data; - } -} -const emptyTexture = /* @__PURE__ */ new Texture(); -const emptyShadowTexture = /* @__PURE__ */ new DepthTexture(1, 1); -const emptyArrayTexture = /* @__PURE__ */ new DataArrayTexture(); -const empty3dTexture = /* @__PURE__ */ new Data3DTexture(); -const emptyCubeTexture = /* @__PURE__ */ new CubeTexture(); -const arrayCacheF32 = []; -const arrayCacheI32 = []; -const mat4array = new Float32Array(16); -const mat3array = new Float32Array(9); -const mat2array = new Float32Array(4); -function flatten(array, nBlocks, blockSize) { - const firstElem = array[0]; - if (firstElem <= 0 || firstElem > 0) return array; - const n = nBlocks * blockSize; - let r = arrayCacheF32[n]; - if (r === void 0) { - r = new Float32Array(n); - arrayCacheF32[n] = r; - } - if (nBlocks !== 0) { - firstElem.toArray(r, 0); - for (let i = 1, offset = 0; i !== nBlocks; ++i) { - offset += blockSize; - array[i].toArray(r, offset); - } - } - return r; -} -__name(flatten, "flatten"); -function arraysEqual(a, b) { - if (a.length !== b.length) return false; - for (let i = 0, l = a.length; i < l; i++) { - if (a[i] !== b[i]) return false; - } - return true; -} -__name(arraysEqual, "arraysEqual"); -function copyArray(a, b) { - for (let i = 0, l = b.length; i < l; i++) { - a[i] = b[i]; - } -} -__name(copyArray, "copyArray"); -function allocTexUnits(textures, n) { - let r = arrayCacheI32[n]; - if (r === void 0) { - r = new Int32Array(n); - arrayCacheI32[n] = r; - } - for (let i = 0; i !== n; ++i) { - r[i] = textures.allocateTextureUnit(); - } - return r; -} -__name(allocTexUnits, "allocTexUnits"); -function setValueV1f(gl, v) { - const cache = this.cache; - if (cache[0] === v) return; - gl.uniform1f(this.addr, v); - cache[0] = v; -} -__name(setValueV1f, "setValueV1f"); -function setValueV2f(gl, v) { - const cache = this.cache; - if (v.x !== void 0) { - if (cache[0] !== v.x || cache[1] !== v.y) { - gl.uniform2f(this.addr, v.x, v.y); - cache[0] = v.x; - cache[1] = v.y; - } - } else { - if (arraysEqual(cache, v)) return; - gl.uniform2fv(this.addr, v); - copyArray(cache, v); - } -} -__name(setValueV2f, "setValueV2f"); -function setValueV3f(gl, v) { - const cache = this.cache; - if (v.x !== void 0) { - if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z) { - gl.uniform3f(this.addr, v.x, v.y, v.z); - cache[0] = v.x; - cache[1] = v.y; - cache[2] = v.z; - } - } else if (v.r !== void 0) { - if (cache[0] !== v.r || cache[1] !== v.g || cache[2] !== v.b) { - gl.uniform3f(this.addr, v.r, v.g, v.b); - cache[0] = v.r; - cache[1] = v.g; - cache[2] = v.b; - } - } else { - if (arraysEqual(cache, v)) return; - gl.uniform3fv(this.addr, v); - copyArray(cache, v); - } -} -__name(setValueV3f, "setValueV3f"); -function setValueV4f(gl, v) { - const cache = this.cache; - if (v.x !== void 0) { - if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z || cache[3] !== v.w) { - gl.uniform4f(this.addr, v.x, v.y, v.z, v.w); - cache[0] = v.x; - cache[1] = v.y; - cache[2] = v.z; - cache[3] = v.w; - } - } else { - if (arraysEqual(cache, v)) return; - gl.uniform4fv(this.addr, v); - copyArray(cache, v); - } -} -__name(setValueV4f, "setValueV4f"); -function setValueM2(gl, v) { - const cache = this.cache; - const elements = v.elements; - if (elements === void 0) { - if (arraysEqual(cache, v)) return; - gl.uniformMatrix2fv(this.addr, false, v); - copyArray(cache, v); - } else { - if (arraysEqual(cache, elements)) return; - mat2array.set(elements); - gl.uniformMatrix2fv(this.addr, false, mat2array); - copyArray(cache, elements); - } -} -__name(setValueM2, "setValueM2"); -function setValueM3(gl, v) { - const cache = this.cache; - const elements = v.elements; - if (elements === void 0) { - if (arraysEqual(cache, v)) return; - gl.uniformMatrix3fv(this.addr, false, v); - copyArray(cache, v); - } else { - if (arraysEqual(cache, elements)) return; - mat3array.set(elements); - gl.uniformMatrix3fv(this.addr, false, mat3array); - copyArray(cache, elements); - } -} -__name(setValueM3, "setValueM3"); -function setValueM4(gl, v) { - const cache = this.cache; - const elements = v.elements; - if (elements === void 0) { - if (arraysEqual(cache, v)) return; - gl.uniformMatrix4fv(this.addr, false, v); - copyArray(cache, v); - } else { - if (arraysEqual(cache, elements)) return; - mat4array.set(elements); - gl.uniformMatrix4fv(this.addr, false, mat4array); - copyArray(cache, elements); - } -} -__name(setValueM4, "setValueM4"); -function setValueV1i(gl, v) { - const cache = this.cache; - if (cache[0] === v) return; - gl.uniform1i(this.addr, v); - cache[0] = v; -} -__name(setValueV1i, "setValueV1i"); -function setValueV2i(gl, v) { - const cache = this.cache; - if (v.x !== void 0) { - if (cache[0] !== v.x || cache[1] !== v.y) { - gl.uniform2i(this.addr, v.x, v.y); - cache[0] = v.x; - cache[1] = v.y; - } - } else { - if (arraysEqual(cache, v)) return; - gl.uniform2iv(this.addr, v); - copyArray(cache, v); - } -} -__name(setValueV2i, "setValueV2i"); -function setValueV3i(gl, v) { - const cache = this.cache; - if (v.x !== void 0) { - if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z) { - gl.uniform3i(this.addr, v.x, v.y, v.z); - cache[0] = v.x; - cache[1] = v.y; - cache[2] = v.z; - } - } else { - if (arraysEqual(cache, v)) return; - gl.uniform3iv(this.addr, v); - copyArray(cache, v); - } -} -__name(setValueV3i, "setValueV3i"); -function setValueV4i(gl, v) { - const cache = this.cache; - if (v.x !== void 0) { - if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z || cache[3] !== v.w) { - gl.uniform4i(this.addr, v.x, v.y, v.z, v.w); - cache[0] = v.x; - cache[1] = v.y; - cache[2] = v.z; - cache[3] = v.w; - } - } else { - if (arraysEqual(cache, v)) return; - gl.uniform4iv(this.addr, v); - copyArray(cache, v); - } -} -__name(setValueV4i, "setValueV4i"); -function setValueV1ui(gl, v) { - const cache = this.cache; - if (cache[0] === v) return; - gl.uniform1ui(this.addr, v); - cache[0] = v; -} -__name(setValueV1ui, "setValueV1ui"); -function setValueV2ui(gl, v) { - const cache = this.cache; - if (v.x !== void 0) { - if (cache[0] !== v.x || cache[1] !== v.y) { - gl.uniform2ui(this.addr, v.x, v.y); - cache[0] = v.x; - cache[1] = v.y; - } - } else { - if (arraysEqual(cache, v)) return; - gl.uniform2uiv(this.addr, v); - copyArray(cache, v); - } -} -__name(setValueV2ui, "setValueV2ui"); -function setValueV3ui(gl, v) { - const cache = this.cache; - if (v.x !== void 0) { - if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z) { - gl.uniform3ui(this.addr, v.x, v.y, v.z); - cache[0] = v.x; - cache[1] = v.y; - cache[2] = v.z; - } - } else { - if (arraysEqual(cache, v)) return; - gl.uniform3uiv(this.addr, v); - copyArray(cache, v); - } -} -__name(setValueV3ui, "setValueV3ui"); -function setValueV4ui(gl, v) { - const cache = this.cache; - if (v.x !== void 0) { - if (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z || cache[3] !== v.w) { - gl.uniform4ui(this.addr, v.x, v.y, v.z, v.w); - cache[0] = v.x; - cache[1] = v.y; - cache[2] = v.z; - cache[3] = v.w; - } - } else { - if (arraysEqual(cache, v)) return; - gl.uniform4uiv(this.addr, v); - copyArray(cache, v); - } -} -__name(setValueV4ui, "setValueV4ui"); -function setValueT1(gl, v, textures) { - const cache = this.cache; - const unit = textures.allocateTextureUnit(); - if (cache[0] !== unit) { - gl.uniform1i(this.addr, unit); - cache[0] = unit; - } - let emptyTexture2D; - if (this.type === gl.SAMPLER_2D_SHADOW) { - emptyShadowTexture.compareFunction = LessEqualCompare; - emptyTexture2D = emptyShadowTexture; - } else { - emptyTexture2D = emptyTexture; - } - textures.setTexture2D(v || emptyTexture2D, unit); -} -__name(setValueT1, "setValueT1"); -function setValueT3D1(gl, v, textures) { - const cache = this.cache; - const unit = textures.allocateTextureUnit(); - if (cache[0] !== unit) { - gl.uniform1i(this.addr, unit); - cache[0] = unit; - } - textures.setTexture3D(v || empty3dTexture, unit); -} -__name(setValueT3D1, "setValueT3D1"); -function setValueT6(gl, v, textures) { - const cache = this.cache; - const unit = textures.allocateTextureUnit(); - if (cache[0] !== unit) { - gl.uniform1i(this.addr, unit); - cache[0] = unit; - } - textures.setTextureCube(v || emptyCubeTexture, unit); -} -__name(setValueT6, "setValueT6"); -function setValueT2DArray1(gl, v, textures) { - const cache = this.cache; - const unit = textures.allocateTextureUnit(); - if (cache[0] !== unit) { - gl.uniform1i(this.addr, unit); - cache[0] = unit; - } - textures.setTexture2DArray(v || emptyArrayTexture, unit); -} -__name(setValueT2DArray1, "setValueT2DArray1"); -function getSingularSetter(type) { - switch (type) { - case 5126: - return setValueV1f; - case 35664: - return setValueV2f; - case 35665: - return setValueV3f; - case 35666: - return setValueV4f; - case 35674: - return setValueM2; - case 35675: - return setValueM3; - case 35676: - return setValueM4; - case 5124: - case 35670: - return setValueV1i; - case 35667: - case 35671: - return setValueV2i; - case 35668: - case 35672: - return setValueV3i; - case 35669: - case 35673: - return setValueV4i; - case 5125: - return setValueV1ui; - case 36294: - return setValueV2ui; - case 36295: - return setValueV3ui; - case 36296: - return setValueV4ui; - case 35678: - case 36198: - case 36298: - case 36306: - case 35682: - return setValueT1; - case 35679: - case 36299: - case 36307: - return setValueT3D1; - case 35680: - case 36300: - case 36308: - case 36293: - return setValueT6; - case 36289: - case 36303: - case 36311: - case 36292: - return setValueT2DArray1; - } -} -__name(getSingularSetter, "getSingularSetter"); -function setValueV1fArray(gl, v) { - gl.uniform1fv(this.addr, v); -} -__name(setValueV1fArray, "setValueV1fArray"); -function setValueV2fArray(gl, v) { - const data = flatten(v, this.size, 2); - gl.uniform2fv(this.addr, data); -} -__name(setValueV2fArray, "setValueV2fArray"); -function setValueV3fArray(gl, v) { - const data = flatten(v, this.size, 3); - gl.uniform3fv(this.addr, data); -} -__name(setValueV3fArray, "setValueV3fArray"); -function setValueV4fArray(gl, v) { - const data = flatten(v, this.size, 4); - gl.uniform4fv(this.addr, data); -} -__name(setValueV4fArray, "setValueV4fArray"); -function setValueM2Array(gl, v) { - const data = flatten(v, this.size, 4); - gl.uniformMatrix2fv(this.addr, false, data); -} -__name(setValueM2Array, "setValueM2Array"); -function setValueM3Array(gl, v) { - const data = flatten(v, this.size, 9); - gl.uniformMatrix3fv(this.addr, false, data); -} -__name(setValueM3Array, "setValueM3Array"); -function setValueM4Array(gl, v) { - const data = flatten(v, this.size, 16); - gl.uniformMatrix4fv(this.addr, false, data); -} -__name(setValueM4Array, "setValueM4Array"); -function setValueV1iArray(gl, v) { - gl.uniform1iv(this.addr, v); -} -__name(setValueV1iArray, "setValueV1iArray"); -function setValueV2iArray(gl, v) { - gl.uniform2iv(this.addr, v); -} -__name(setValueV2iArray, "setValueV2iArray"); -function setValueV3iArray(gl, v) { - gl.uniform3iv(this.addr, v); -} -__name(setValueV3iArray, "setValueV3iArray"); -function setValueV4iArray(gl, v) { - gl.uniform4iv(this.addr, v); -} -__name(setValueV4iArray, "setValueV4iArray"); -function setValueV1uiArray(gl, v) { - gl.uniform1uiv(this.addr, v); -} -__name(setValueV1uiArray, "setValueV1uiArray"); -function setValueV2uiArray(gl, v) { - gl.uniform2uiv(this.addr, v); -} -__name(setValueV2uiArray, "setValueV2uiArray"); -function setValueV3uiArray(gl, v) { - gl.uniform3uiv(this.addr, v); -} -__name(setValueV3uiArray, "setValueV3uiArray"); -function setValueV4uiArray(gl, v) { - gl.uniform4uiv(this.addr, v); -} -__name(setValueV4uiArray, "setValueV4uiArray"); -function setValueT1Array(gl, v, textures) { - const cache = this.cache; - const n = v.length; - const units = allocTexUnits(textures, n); - if (!arraysEqual(cache, units)) { - gl.uniform1iv(this.addr, units); - copyArray(cache, units); - } - for (let i = 0; i !== n; ++i) { - textures.setTexture2D(v[i] || emptyTexture, units[i]); - } -} -__name(setValueT1Array, "setValueT1Array"); -function setValueT3DArray(gl, v, textures) { - const cache = this.cache; - const n = v.length; - const units = allocTexUnits(textures, n); - if (!arraysEqual(cache, units)) { - gl.uniform1iv(this.addr, units); - copyArray(cache, units); - } - for (let i = 0; i !== n; ++i) { - textures.setTexture3D(v[i] || empty3dTexture, units[i]); - } -} -__name(setValueT3DArray, "setValueT3DArray"); -function setValueT6Array(gl, v, textures) { - const cache = this.cache; - const n = v.length; - const units = allocTexUnits(textures, n); - if (!arraysEqual(cache, units)) { - gl.uniform1iv(this.addr, units); - copyArray(cache, units); - } - for (let i = 0; i !== n; ++i) { - textures.setTextureCube(v[i] || emptyCubeTexture, units[i]); - } -} -__name(setValueT6Array, "setValueT6Array"); -function setValueT2DArrayArray(gl, v, textures) { - const cache = this.cache; - const n = v.length; - const units = allocTexUnits(textures, n); - if (!arraysEqual(cache, units)) { - gl.uniform1iv(this.addr, units); - copyArray(cache, units); - } - for (let i = 0; i !== n; ++i) { - textures.setTexture2DArray(v[i] || emptyArrayTexture, units[i]); - } -} -__name(setValueT2DArrayArray, "setValueT2DArrayArray"); -function getPureArraySetter(type) { - switch (type) { - case 5126: - return setValueV1fArray; - case 35664: - return setValueV2fArray; - case 35665: - return setValueV3fArray; - case 35666: - return setValueV4fArray; - case 35674: - return setValueM2Array; - case 35675: - return setValueM3Array; - case 35676: - return setValueM4Array; - case 5124: - case 35670: - return setValueV1iArray; - case 35667: - case 35671: - return setValueV2iArray; - case 35668: - case 35672: - return setValueV3iArray; - case 35669: - case 35673: - return setValueV4iArray; - case 5125: - return setValueV1uiArray; - case 36294: - return setValueV2uiArray; - case 36295: - return setValueV3uiArray; - case 36296: - return setValueV4uiArray; - case 35678: - case 36198: - case 36298: - case 36306: - case 35682: - return setValueT1Array; - case 35679: - case 36299: - case 36307: - return setValueT3DArray; - case 35680: - case 36300: - case 36308: - case 36293: - return setValueT6Array; - case 36289: - case 36303: - case 36311: - case 36292: - return setValueT2DArrayArray; - } -} -__name(getPureArraySetter, "getPureArraySetter"); -class SingleUniform { - static { - __name(this, "SingleUniform"); - } - constructor(id2, activeInfo, addr) { - this.id = id2; - this.addr = addr; - this.cache = []; - this.type = activeInfo.type; - this.setValue = getSingularSetter(activeInfo.type); - } -} -class PureArrayUniform { - static { - __name(this, "PureArrayUniform"); - } - constructor(id2, activeInfo, addr) { - this.id = id2; - this.addr = addr; - this.cache = []; - this.type = activeInfo.type; - this.size = activeInfo.size; - this.setValue = getPureArraySetter(activeInfo.type); - } -} -class StructuredUniform { - static { - __name(this, "StructuredUniform"); - } - constructor(id2) { - this.id = id2; - this.seq = []; - this.map = {}; - } - setValue(gl, value, textures) { - const seq = this.seq; - for (let i = 0, n = seq.length; i !== n; ++i) { - const u = seq[i]; - u.setValue(gl, value[u.id], textures); - } - } -} -const RePathPart = /(\w+)(\])?(\[|\.)?/g; -function addUniform(container, uniformObject) { - container.seq.push(uniformObject); - container.map[uniformObject.id] = uniformObject; -} -__name(addUniform, "addUniform"); -function parseUniform(activeInfo, addr, container) { - const path = activeInfo.name, pathLength = path.length; - RePathPart.lastIndex = 0; - while (true) { - const match = RePathPart.exec(path), matchEnd = RePathPart.lastIndex; - let id2 = match[1]; - const idIsIndex = match[2] === "]", subscript = match[3]; - if (idIsIndex) id2 = id2 | 0; - if (subscript === void 0 || subscript === "[" && matchEnd + 2 === pathLength) { - addUniform(container, subscript === void 0 ? new SingleUniform(id2, activeInfo, addr) : new PureArrayUniform(id2, activeInfo, addr)); - break; - } else { - const map = container.map; - let next = map[id2]; - if (next === void 0) { - next = new StructuredUniform(id2); - addUniform(container, next); - } - container = next; - } - } -} -__name(parseUniform, "parseUniform"); -class WebGLUniforms { - static { - __name(this, "WebGLUniforms"); - } - constructor(gl, program) { - this.seq = []; - this.map = {}; - const n = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS); - for (let i = 0; i < n; ++i) { - const info = gl.getActiveUniform(program, i), addr = gl.getUniformLocation(program, info.name); - parseUniform(info, addr, this); - } - } - setValue(gl, name, value, textures) { - const u = this.map[name]; - if (u !== void 0) u.setValue(gl, value, textures); - } - setOptional(gl, object, name) { - const v = object[name]; - if (v !== void 0) this.setValue(gl, name, v); - } - static upload(gl, seq, values, textures) { - for (let i = 0, n = seq.length; i !== n; ++i) { - const u = seq[i], v = values[u.id]; - if (v.needsUpdate !== false) { - u.setValue(gl, v.value, textures); - } - } - } - static seqWithValue(seq, values) { - const r = []; - for (let i = 0, n = seq.length; i !== n; ++i) { - const u = seq[i]; - if (u.id in values) r.push(u); - } - return r; - } -} -function WebGLShader(gl, type, string) { - const shader = gl.createShader(type); - gl.shaderSource(shader, string); - gl.compileShader(shader); - return shader; -} -__name(WebGLShader, "WebGLShader"); -const COMPLETION_STATUS_KHR = 37297; -let programIdCount = 0; -function handleSource(string, errorLine) { - const lines = string.split("\n"); - const lines2 = []; - const from = Math.max(errorLine - 6, 0); - const to = Math.min(errorLine + 6, lines.length); - for (let i = from; i < to; i++) { - const line = i + 1; - lines2.push(`${line === errorLine ? ">" : " "} ${line}: ${lines[i]}`); - } - return lines2.join("\n"); -} -__name(handleSource, "handleSource"); -const _m0 = /* @__PURE__ */ new Matrix3(); -function getEncodingComponents(colorSpace) { - ColorManagement._getMatrix(_m0, ColorManagement.workingColorSpace, colorSpace); - const encodingMatrix = `mat3( ${_m0.elements.map((v) => v.toFixed(4))} )`; - switch (ColorManagement.getTransfer(colorSpace)) { - case LinearTransfer: - return [encodingMatrix, "LinearTransferOETF"]; - case SRGBTransfer: - return [encodingMatrix, "sRGBTransferOETF"]; - default: - console.warn("THREE.WebGLProgram: Unsupported color space: ", colorSpace); - return [encodingMatrix, "LinearTransferOETF"]; - } -} -__name(getEncodingComponents, "getEncodingComponents"); -function getShaderErrors(gl, shader, type) { - const status = gl.getShaderParameter(shader, gl.COMPILE_STATUS); - const errors = gl.getShaderInfoLog(shader).trim(); - if (status && errors === "") return ""; - const errorMatches = /ERROR: 0:(\d+)/.exec(errors); - if (errorMatches) { - const errorLine = parseInt(errorMatches[1]); - return type.toUpperCase() + "\n\n" + errors + "\n\n" + handleSource(gl.getShaderSource(shader), errorLine); - } else { - return errors; - } -} -__name(getShaderErrors, "getShaderErrors"); -function getTexelEncodingFunction(functionName, colorSpace) { - const components = getEncodingComponents(colorSpace); - return [ - `vec4 ${functionName}( vec4 value ) {`, - ` return ${components[1]}( vec4( value.rgb * ${components[0]}, value.a ) );`, - "}" - ].join("\n"); -} -__name(getTexelEncodingFunction, "getTexelEncodingFunction"); -function getToneMappingFunction(functionName, toneMapping) { - let toneMappingName; - switch (toneMapping) { - case LinearToneMapping: - toneMappingName = "Linear"; - break; - case ReinhardToneMapping: - toneMappingName = "Reinhard"; - break; - case CineonToneMapping: - toneMappingName = "Cineon"; - break; - case ACESFilmicToneMapping: - toneMappingName = "ACESFilmic"; - break; - case AgXToneMapping: - toneMappingName = "AgX"; - break; - case NeutralToneMapping: - toneMappingName = "Neutral"; - break; - case CustomToneMapping: - toneMappingName = "Custom"; - break; - default: - console.warn("THREE.WebGLProgram: Unsupported toneMapping:", toneMapping); - toneMappingName = "Linear"; - } - return "vec3 " + functionName + "( vec3 color ) { return " + toneMappingName + "ToneMapping( color ); }"; -} -__name(getToneMappingFunction, "getToneMappingFunction"); -const _v0$1 = /* @__PURE__ */ new Vector3(); -function getLuminanceFunction() { - ColorManagement.getLuminanceCoefficients(_v0$1); - const r = _v0$1.x.toFixed(4); - const g = _v0$1.y.toFixed(4); - const b = _v0$1.z.toFixed(4); - return [ - "float luminance( const in vec3 rgb ) {", - ` const vec3 weights = vec3( ${r}, ${g}, ${b} );`, - " return dot( weights, rgb );", - "}" - ].join("\n"); -} -__name(getLuminanceFunction, "getLuminanceFunction"); -function generateVertexExtensions(parameters) { - const chunks = [ - parameters.extensionClipCullDistance ? "#extension GL_ANGLE_clip_cull_distance : require" : "", - parameters.extensionMultiDraw ? "#extension GL_ANGLE_multi_draw : require" : "" - ]; - return chunks.filter(filterEmptyLine).join("\n"); -} -__name(generateVertexExtensions, "generateVertexExtensions"); -function generateDefines(defines) { - const chunks = []; - for (const name in defines) { - const value = defines[name]; - if (value === false) continue; - chunks.push("#define " + name + " " + value); - } - return chunks.join("\n"); -} -__name(generateDefines, "generateDefines"); -function fetchAttributeLocations(gl, program) { - const attributes = {}; - const n = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES); - for (let i = 0; i < n; i++) { - const info = gl.getActiveAttrib(program, i); - const name = info.name; - let locationSize = 1; - if (info.type === gl.FLOAT_MAT2) locationSize = 2; - if (info.type === gl.FLOAT_MAT3) locationSize = 3; - if (info.type === gl.FLOAT_MAT4) locationSize = 4; - attributes[name] = { - type: info.type, - location: gl.getAttribLocation(program, name), - locationSize - }; - } - return attributes; -} -__name(fetchAttributeLocations, "fetchAttributeLocations"); -function filterEmptyLine(string) { - return string !== ""; -} -__name(filterEmptyLine, "filterEmptyLine"); -function replaceLightNums(string, parameters) { - const numSpotLightCoords = parameters.numSpotLightShadows + parameters.numSpotLightMaps - parameters.numSpotLightShadowsWithMaps; - return string.replace(/NUM_DIR_LIGHTS/g, parameters.numDirLights).replace(/NUM_SPOT_LIGHTS/g, parameters.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g, parameters.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g, numSpotLightCoords).replace(/NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, parameters.numPointLights).replace(/NUM_HEMI_LIGHTS/g, parameters.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, parameters.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows); -} -__name(replaceLightNums, "replaceLightNums"); -function replaceClippingPlaneNums(string, parameters) { - return string.replace(/NUM_CLIPPING_PLANES/g, parameters.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, parameters.numClippingPlanes - parameters.numClipIntersection); -} -__name(replaceClippingPlaneNums, "replaceClippingPlaneNums"); -const includePattern = /^[ \t]*#include +<([\w\d./]+)>/gm; -function resolveIncludes(string) { - return string.replace(includePattern, includeReplacer); -} -__name(resolveIncludes, "resolveIncludes"); -const shaderChunkMap = /* @__PURE__ */ new Map(); -function includeReplacer(match, include) { - let string = ShaderChunk[include]; - if (string === void 0) { - const newInclude = shaderChunkMap.get(include); - if (newInclude !== void 0) { - string = ShaderChunk[newInclude]; - console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include, newInclude); - } else { - throw new Error("Can not resolve #include <" + include + ">"); - } - } - return resolveIncludes(string); -} -__name(includeReplacer, "includeReplacer"); -const unrollLoopPattern = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g; -function unrollLoops(string) { - return string.replace(unrollLoopPattern, loopReplacer); -} -__name(unrollLoops, "unrollLoops"); -function loopReplacer(match, start, end, snippet) { - let string = ""; - for (let i = parseInt(start); i < parseInt(end); i++) { - string += snippet.replace(/\[\s*i\s*\]/g, "[ " + i + " ]").replace(/UNROLLED_LOOP_INDEX/g, i); - } - return string; -} -__name(loopReplacer, "loopReplacer"); -function generatePrecision(parameters) { - let precisionstring = `precision ${parameters.precision} float; - precision ${parameters.precision} int; - precision ${parameters.precision} sampler2D; - precision ${parameters.precision} samplerCube; - precision ${parameters.precision} sampler3D; - precision ${parameters.precision} sampler2DArray; - precision ${parameters.precision} sampler2DShadow; - precision ${parameters.precision} samplerCubeShadow; - precision ${parameters.precision} sampler2DArrayShadow; - precision ${parameters.precision} isampler2D; - precision ${parameters.precision} isampler3D; - precision ${parameters.precision} isamplerCube; - precision ${parameters.precision} isampler2DArray; - precision ${parameters.precision} usampler2D; - precision ${parameters.precision} usampler3D; - precision ${parameters.precision} usamplerCube; - precision ${parameters.precision} usampler2DArray; - `; - if (parameters.precision === "highp") { - precisionstring += "\n#define HIGH_PRECISION"; - } else if (parameters.precision === "mediump") { - precisionstring += "\n#define MEDIUM_PRECISION"; - } else if (parameters.precision === "lowp") { - precisionstring += "\n#define LOW_PRECISION"; - } - return precisionstring; -} -__name(generatePrecision, "generatePrecision"); -function generateShadowMapTypeDefine(parameters) { - let shadowMapTypeDefine = "SHADOWMAP_TYPE_BASIC"; - if (parameters.shadowMapType === PCFShadowMap) { - shadowMapTypeDefine = "SHADOWMAP_TYPE_PCF"; - } else if (parameters.shadowMapType === PCFSoftShadowMap) { - shadowMapTypeDefine = "SHADOWMAP_TYPE_PCF_SOFT"; - } else if (parameters.shadowMapType === VSMShadowMap) { - shadowMapTypeDefine = "SHADOWMAP_TYPE_VSM"; - } - return shadowMapTypeDefine; -} -__name(generateShadowMapTypeDefine, "generateShadowMapTypeDefine"); -function generateEnvMapTypeDefine(parameters) { - let envMapTypeDefine = "ENVMAP_TYPE_CUBE"; - if (parameters.envMap) { - switch (parameters.envMapMode) { - case CubeReflectionMapping: - case CubeRefractionMapping: - envMapTypeDefine = "ENVMAP_TYPE_CUBE"; - break; - case CubeUVReflectionMapping: - envMapTypeDefine = "ENVMAP_TYPE_CUBE_UV"; - break; - } - } - return envMapTypeDefine; -} -__name(generateEnvMapTypeDefine, "generateEnvMapTypeDefine"); -function generateEnvMapModeDefine(parameters) { - let envMapModeDefine = "ENVMAP_MODE_REFLECTION"; - if (parameters.envMap) { - switch (parameters.envMapMode) { - case CubeRefractionMapping: - envMapModeDefine = "ENVMAP_MODE_REFRACTION"; - break; - } - } - return envMapModeDefine; -} -__name(generateEnvMapModeDefine, "generateEnvMapModeDefine"); -function generateEnvMapBlendingDefine(parameters) { - let envMapBlendingDefine = "ENVMAP_BLENDING_NONE"; - if (parameters.envMap) { - switch (parameters.combine) { - case MultiplyOperation: - envMapBlendingDefine = "ENVMAP_BLENDING_MULTIPLY"; - break; - case MixOperation: - envMapBlendingDefine = "ENVMAP_BLENDING_MIX"; - break; - case AddOperation: - envMapBlendingDefine = "ENVMAP_BLENDING_ADD"; - break; - } - } - return envMapBlendingDefine; -} -__name(generateEnvMapBlendingDefine, "generateEnvMapBlendingDefine"); -function generateCubeUVSize(parameters) { - const imageHeight = parameters.envMapCubeUVHeight; - if (imageHeight === null) return null; - const maxMip = Math.log2(imageHeight) - 2; - const texelHeight = 1 / imageHeight; - const texelWidth = 1 / (3 * Math.max(Math.pow(2, maxMip), 7 * 16)); - return { texelWidth, texelHeight, maxMip }; -} -__name(generateCubeUVSize, "generateCubeUVSize"); -function WebGLProgram(renderer, cacheKey, parameters, bindingStates) { - const gl = renderer.getContext(); - const defines = parameters.defines; - let vertexShader = parameters.vertexShader; - let fragmentShader = parameters.fragmentShader; - const shadowMapTypeDefine = generateShadowMapTypeDefine(parameters); - const envMapTypeDefine = generateEnvMapTypeDefine(parameters); - const envMapModeDefine = generateEnvMapModeDefine(parameters); - const envMapBlendingDefine = generateEnvMapBlendingDefine(parameters); - const envMapCubeUVSize = generateCubeUVSize(parameters); - const customVertexExtensions = generateVertexExtensions(parameters); - const customDefines = generateDefines(defines); - const program = gl.createProgram(); - let prefixVertex, prefixFragment; - let versionString = parameters.glslVersion ? "#version " + parameters.glslVersion + "\n" : ""; - if (parameters.isRawShaderMaterial) { - prefixVertex = [ - "#define SHADER_TYPE " + parameters.shaderType, - "#define SHADER_NAME " + parameters.shaderName, - customDefines - ].filter(filterEmptyLine).join("\n"); - if (prefixVertex.length > 0) { - prefixVertex += "\n"; - } - prefixFragment = [ - "#define SHADER_TYPE " + parameters.shaderType, - "#define SHADER_NAME " + parameters.shaderName, - customDefines - ].filter(filterEmptyLine).join("\n"); - if (prefixFragment.length > 0) { - prefixFragment += "\n"; - } - } else { - prefixVertex = [ - generatePrecision(parameters), - "#define SHADER_TYPE " + parameters.shaderType, - "#define SHADER_NAME " + parameters.shaderName, - customDefines, - parameters.extensionClipCullDistance ? "#define USE_CLIP_DISTANCE" : "", - parameters.batching ? "#define USE_BATCHING" : "", - parameters.batchingColor ? "#define USE_BATCHING_COLOR" : "", - parameters.instancing ? "#define USE_INSTANCING" : "", - parameters.instancingColor ? "#define USE_INSTANCING_COLOR" : "", - parameters.instancingMorph ? "#define USE_INSTANCING_MORPH" : "", - parameters.useFog && parameters.fog ? "#define USE_FOG" : "", - parameters.useFog && parameters.fogExp2 ? "#define FOG_EXP2" : "", - parameters.map ? "#define USE_MAP" : "", - parameters.envMap ? "#define USE_ENVMAP" : "", - parameters.envMap ? "#define " + envMapModeDefine : "", - parameters.lightMap ? "#define USE_LIGHTMAP" : "", - parameters.aoMap ? "#define USE_AOMAP" : "", - parameters.bumpMap ? "#define USE_BUMPMAP" : "", - parameters.normalMap ? "#define USE_NORMALMAP" : "", - parameters.normalMapObjectSpace ? "#define USE_NORMALMAP_OBJECTSPACE" : "", - parameters.normalMapTangentSpace ? "#define USE_NORMALMAP_TANGENTSPACE" : "", - parameters.displacementMap ? "#define USE_DISPLACEMENTMAP" : "", - parameters.emissiveMap ? "#define USE_EMISSIVEMAP" : "", - parameters.anisotropy ? "#define USE_ANISOTROPY" : "", - parameters.anisotropyMap ? "#define USE_ANISOTROPYMAP" : "", - parameters.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", - parameters.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", - parameters.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", - parameters.iridescenceMap ? "#define USE_IRIDESCENCEMAP" : "", - parameters.iridescenceThicknessMap ? "#define USE_IRIDESCENCE_THICKNESSMAP" : "", - parameters.specularMap ? "#define USE_SPECULARMAP" : "", - parameters.specularColorMap ? "#define USE_SPECULAR_COLORMAP" : "", - parameters.specularIntensityMap ? "#define USE_SPECULAR_INTENSITYMAP" : "", - parameters.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", - parameters.metalnessMap ? "#define USE_METALNESSMAP" : "", - parameters.alphaMap ? "#define USE_ALPHAMAP" : "", - parameters.alphaHash ? "#define USE_ALPHAHASH" : "", - parameters.transmission ? "#define USE_TRANSMISSION" : "", - parameters.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", - parameters.thicknessMap ? "#define USE_THICKNESSMAP" : "", - parameters.sheenColorMap ? "#define USE_SHEEN_COLORMAP" : "", - parameters.sheenRoughnessMap ? "#define USE_SHEEN_ROUGHNESSMAP" : "", - // - parameters.mapUv ? "#define MAP_UV " + parameters.mapUv : "", - parameters.alphaMapUv ? "#define ALPHAMAP_UV " + parameters.alphaMapUv : "", - parameters.lightMapUv ? "#define LIGHTMAP_UV " + parameters.lightMapUv : "", - parameters.aoMapUv ? "#define AOMAP_UV " + parameters.aoMapUv : "", - parameters.emissiveMapUv ? "#define EMISSIVEMAP_UV " + parameters.emissiveMapUv : "", - parameters.bumpMapUv ? "#define BUMPMAP_UV " + parameters.bumpMapUv : "", - parameters.normalMapUv ? "#define NORMALMAP_UV " + parameters.normalMapUv : "", - parameters.displacementMapUv ? "#define DISPLACEMENTMAP_UV " + parameters.displacementMapUv : "", - parameters.metalnessMapUv ? "#define METALNESSMAP_UV " + parameters.metalnessMapUv : "", - parameters.roughnessMapUv ? "#define ROUGHNESSMAP_UV " + parameters.roughnessMapUv : "", - parameters.anisotropyMapUv ? "#define ANISOTROPYMAP_UV " + parameters.anisotropyMapUv : "", - parameters.clearcoatMapUv ? "#define CLEARCOATMAP_UV " + parameters.clearcoatMapUv : "", - parameters.clearcoatNormalMapUv ? "#define CLEARCOAT_NORMALMAP_UV " + parameters.clearcoatNormalMapUv : "", - parameters.clearcoatRoughnessMapUv ? "#define CLEARCOAT_ROUGHNESSMAP_UV " + parameters.clearcoatRoughnessMapUv : "", - parameters.iridescenceMapUv ? "#define IRIDESCENCEMAP_UV " + parameters.iridescenceMapUv : "", - parameters.iridescenceThicknessMapUv ? "#define IRIDESCENCE_THICKNESSMAP_UV " + parameters.iridescenceThicknessMapUv : "", - parameters.sheenColorMapUv ? "#define SHEEN_COLORMAP_UV " + parameters.sheenColorMapUv : "", - parameters.sheenRoughnessMapUv ? "#define SHEEN_ROUGHNESSMAP_UV " + parameters.sheenRoughnessMapUv : "", - parameters.specularMapUv ? "#define SPECULARMAP_UV " + parameters.specularMapUv : "", - parameters.specularColorMapUv ? "#define SPECULAR_COLORMAP_UV " + parameters.specularColorMapUv : "", - parameters.specularIntensityMapUv ? "#define SPECULAR_INTENSITYMAP_UV " + parameters.specularIntensityMapUv : "", - parameters.transmissionMapUv ? "#define TRANSMISSIONMAP_UV " + parameters.transmissionMapUv : "", - parameters.thicknessMapUv ? "#define THICKNESSMAP_UV " + parameters.thicknessMapUv : "", - // - parameters.vertexTangents && parameters.flatShading === false ? "#define USE_TANGENT" : "", - parameters.vertexColors ? "#define USE_COLOR" : "", - parameters.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", - parameters.vertexUv1s ? "#define USE_UV1" : "", - parameters.vertexUv2s ? "#define USE_UV2" : "", - parameters.vertexUv3s ? "#define USE_UV3" : "", - parameters.pointsUvs ? "#define USE_POINTS_UV" : "", - parameters.flatShading ? "#define FLAT_SHADED" : "", - parameters.skinning ? "#define USE_SKINNING" : "", - parameters.morphTargets ? "#define USE_MORPHTARGETS" : "", - parameters.morphNormals && parameters.flatShading === false ? "#define USE_MORPHNORMALS" : "", - parameters.morphColors ? "#define USE_MORPHCOLORS" : "", - parameters.morphTargetsCount > 0 ? "#define MORPHTARGETS_TEXTURE_STRIDE " + parameters.morphTextureStride : "", - parameters.morphTargetsCount > 0 ? "#define MORPHTARGETS_COUNT " + parameters.morphTargetsCount : "", - parameters.doubleSided ? "#define DOUBLE_SIDED" : "", - parameters.flipSided ? "#define FLIP_SIDED" : "", - parameters.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", - parameters.shadowMapEnabled ? "#define " + shadowMapTypeDefine : "", - parameters.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", - parameters.numLightProbes > 0 ? "#define USE_LIGHT_PROBES" : "", - parameters.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", - parameters.reverseDepthBuffer ? "#define USE_REVERSEDEPTHBUF" : "", - "uniform mat4 modelMatrix;", - "uniform mat4 modelViewMatrix;", - "uniform mat4 projectionMatrix;", - "uniform mat4 viewMatrix;", - "uniform mat3 normalMatrix;", - "uniform vec3 cameraPosition;", - "uniform bool isOrthographic;", - "#ifdef USE_INSTANCING", - " attribute mat4 instanceMatrix;", - "#endif", - "#ifdef USE_INSTANCING_COLOR", - " attribute vec3 instanceColor;", - "#endif", - "#ifdef USE_INSTANCING_MORPH", - " uniform sampler2D morphTexture;", - "#endif", - "attribute vec3 position;", - "attribute vec3 normal;", - "attribute vec2 uv;", - "#ifdef USE_UV1", - " attribute vec2 uv1;", - "#endif", - "#ifdef USE_UV2", - " attribute vec2 uv2;", - "#endif", - "#ifdef USE_UV3", - " attribute vec2 uv3;", - "#endif", - "#ifdef USE_TANGENT", - " attribute vec4 tangent;", - "#endif", - "#if defined( USE_COLOR_ALPHA )", - " attribute vec4 color;", - "#elif defined( USE_COLOR )", - " attribute vec3 color;", - "#endif", - "#ifdef USE_SKINNING", - " attribute vec4 skinIndex;", - " attribute vec4 skinWeight;", - "#endif", - "\n" - ].filter(filterEmptyLine).join("\n"); - prefixFragment = [ - generatePrecision(parameters), - "#define SHADER_TYPE " + parameters.shaderType, - "#define SHADER_NAME " + parameters.shaderName, - customDefines, - parameters.useFog && parameters.fog ? "#define USE_FOG" : "", - parameters.useFog && parameters.fogExp2 ? "#define FOG_EXP2" : "", - parameters.alphaToCoverage ? "#define ALPHA_TO_COVERAGE" : "", - parameters.map ? "#define USE_MAP" : "", - parameters.matcap ? "#define USE_MATCAP" : "", - parameters.envMap ? "#define USE_ENVMAP" : "", - parameters.envMap ? "#define " + envMapTypeDefine : "", - parameters.envMap ? "#define " + envMapModeDefine : "", - parameters.envMap ? "#define " + envMapBlendingDefine : "", - envMapCubeUVSize ? "#define CUBEUV_TEXEL_WIDTH " + envMapCubeUVSize.texelWidth : "", - envMapCubeUVSize ? "#define CUBEUV_TEXEL_HEIGHT " + envMapCubeUVSize.texelHeight : "", - envMapCubeUVSize ? "#define CUBEUV_MAX_MIP " + envMapCubeUVSize.maxMip + ".0" : "", - parameters.lightMap ? "#define USE_LIGHTMAP" : "", - parameters.aoMap ? "#define USE_AOMAP" : "", - parameters.bumpMap ? "#define USE_BUMPMAP" : "", - parameters.normalMap ? "#define USE_NORMALMAP" : "", - parameters.normalMapObjectSpace ? "#define USE_NORMALMAP_OBJECTSPACE" : "", - parameters.normalMapTangentSpace ? "#define USE_NORMALMAP_TANGENTSPACE" : "", - parameters.emissiveMap ? "#define USE_EMISSIVEMAP" : "", - parameters.anisotropy ? "#define USE_ANISOTROPY" : "", - parameters.anisotropyMap ? "#define USE_ANISOTROPYMAP" : "", - parameters.clearcoat ? "#define USE_CLEARCOAT" : "", - parameters.clearcoatMap ? "#define USE_CLEARCOATMAP" : "", - parameters.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "", - parameters.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "", - parameters.dispersion ? "#define USE_DISPERSION" : "", - parameters.iridescence ? "#define USE_IRIDESCENCE" : "", - parameters.iridescenceMap ? "#define USE_IRIDESCENCEMAP" : "", - parameters.iridescenceThicknessMap ? "#define USE_IRIDESCENCE_THICKNESSMAP" : "", - parameters.specularMap ? "#define USE_SPECULARMAP" : "", - parameters.specularColorMap ? "#define USE_SPECULAR_COLORMAP" : "", - parameters.specularIntensityMap ? "#define USE_SPECULAR_INTENSITYMAP" : "", - parameters.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", - parameters.metalnessMap ? "#define USE_METALNESSMAP" : "", - parameters.alphaMap ? "#define USE_ALPHAMAP" : "", - parameters.alphaTest ? "#define USE_ALPHATEST" : "", - parameters.alphaHash ? "#define USE_ALPHAHASH" : "", - parameters.sheen ? "#define USE_SHEEN" : "", - parameters.sheenColorMap ? "#define USE_SHEEN_COLORMAP" : "", - parameters.sheenRoughnessMap ? "#define USE_SHEEN_ROUGHNESSMAP" : "", - parameters.transmission ? "#define USE_TRANSMISSION" : "", - parameters.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "", - parameters.thicknessMap ? "#define USE_THICKNESSMAP" : "", - parameters.vertexTangents && parameters.flatShading === false ? "#define USE_TANGENT" : "", - parameters.vertexColors || parameters.instancingColor || parameters.batchingColor ? "#define USE_COLOR" : "", - parameters.vertexAlphas ? "#define USE_COLOR_ALPHA" : "", - parameters.vertexUv1s ? "#define USE_UV1" : "", - parameters.vertexUv2s ? "#define USE_UV2" : "", - parameters.vertexUv3s ? "#define USE_UV3" : "", - parameters.pointsUvs ? "#define USE_POINTS_UV" : "", - parameters.gradientMap ? "#define USE_GRADIENTMAP" : "", - parameters.flatShading ? "#define FLAT_SHADED" : "", - parameters.doubleSided ? "#define DOUBLE_SIDED" : "", - parameters.flipSided ? "#define FLIP_SIDED" : "", - parameters.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", - parameters.shadowMapEnabled ? "#define " + shadowMapTypeDefine : "", - parameters.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", - parameters.numLightProbes > 0 ? "#define USE_LIGHT_PROBES" : "", - parameters.decodeVideoTexture ? "#define DECODE_VIDEO_TEXTURE" : "", - parameters.decodeVideoTextureEmissive ? "#define DECODE_VIDEO_TEXTURE_EMISSIVE" : "", - parameters.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", - parameters.reverseDepthBuffer ? "#define USE_REVERSEDEPTHBUF" : "", - "uniform mat4 viewMatrix;", - "uniform vec3 cameraPosition;", - "uniform bool isOrthographic;", - parameters.toneMapping !== NoToneMapping ? "#define TONE_MAPPING" : "", - parameters.toneMapping !== NoToneMapping ? ShaderChunk["tonemapping_pars_fragment"] : "", - // this code is required here because it is used by the toneMapping() function defined below - parameters.toneMapping !== NoToneMapping ? getToneMappingFunction("toneMapping", parameters.toneMapping) : "", - parameters.dithering ? "#define DITHERING" : "", - parameters.opaque ? "#define OPAQUE" : "", - ShaderChunk["colorspace_pars_fragment"], - // this code is required here because it is used by the various encoding/decoding function defined below - getTexelEncodingFunction("linearToOutputTexel", parameters.outputColorSpace), - getLuminanceFunction(), - parameters.useDepthPacking ? "#define DEPTH_PACKING " + parameters.depthPacking : "", - "\n" - ].filter(filterEmptyLine).join("\n"); - } - vertexShader = resolveIncludes(vertexShader); - vertexShader = replaceLightNums(vertexShader, parameters); - vertexShader = replaceClippingPlaneNums(vertexShader, parameters); - fragmentShader = resolveIncludes(fragmentShader); - fragmentShader = replaceLightNums(fragmentShader, parameters); - fragmentShader = replaceClippingPlaneNums(fragmentShader, parameters); - vertexShader = unrollLoops(vertexShader); - fragmentShader = unrollLoops(fragmentShader); - if (parameters.isRawShaderMaterial !== true) { - versionString = "#version 300 es\n"; - prefixVertex = [ - customVertexExtensions, - "#define attribute in", - "#define varying out", - "#define texture2D texture" - ].join("\n") + "\n" + prefixVertex; - prefixFragment = [ - "#define varying in", - parameters.glslVersion === GLSL3 ? "" : "layout(location = 0) out highp vec4 pc_fragColor;", - parameters.glslVersion === GLSL3 ? "" : "#define gl_FragColor pc_fragColor", - "#define gl_FragDepthEXT gl_FragDepth", - "#define texture2D texture", - "#define textureCube texture", - "#define texture2DProj textureProj", - "#define texture2DLodEXT textureLod", - "#define texture2DProjLodEXT textureProjLod", - "#define textureCubeLodEXT textureLod", - "#define texture2DGradEXT textureGrad", - "#define texture2DProjGradEXT textureProjGrad", - "#define textureCubeGradEXT textureGrad" - ].join("\n") + "\n" + prefixFragment; - } - const vertexGlsl = versionString + prefixVertex + vertexShader; - const fragmentGlsl = versionString + prefixFragment + fragmentShader; - const glVertexShader = WebGLShader(gl, gl.VERTEX_SHADER, vertexGlsl); - const glFragmentShader = WebGLShader(gl, gl.FRAGMENT_SHADER, fragmentGlsl); - gl.attachShader(program, glVertexShader); - gl.attachShader(program, glFragmentShader); - if (parameters.index0AttributeName !== void 0) { - gl.bindAttribLocation(program, 0, parameters.index0AttributeName); - } else if (parameters.morphTargets === true) { - gl.bindAttribLocation(program, 0, "position"); - } - gl.linkProgram(program); - function onFirstUse(self2) { - if (renderer.debug.checkShaderErrors) { - const programLog = gl.getProgramInfoLog(program).trim(); - const vertexLog = gl.getShaderInfoLog(glVertexShader).trim(); - const fragmentLog = gl.getShaderInfoLog(glFragmentShader).trim(); - let runnable = true; - let haveDiagnostics = true; - if (gl.getProgramParameter(program, gl.LINK_STATUS) === false) { - runnable = false; - if (typeof renderer.debug.onShaderError === "function") { - renderer.debug.onShaderError(gl, program, glVertexShader, glFragmentShader); - } else { - const vertexErrors = getShaderErrors(gl, glVertexShader, "vertex"); - const fragmentErrors = getShaderErrors(gl, glFragmentShader, "fragment"); - console.error( - "THREE.WebGLProgram: Shader Error " + gl.getError() + " - VALIDATE_STATUS " + gl.getProgramParameter(program, gl.VALIDATE_STATUS) + "\n\nMaterial Name: " + self2.name + "\nMaterial Type: " + self2.type + "\n\nProgram Info Log: " + programLog + "\n" + vertexErrors + "\n" + fragmentErrors - ); - } - } else if (programLog !== "") { - console.warn("THREE.WebGLProgram: Program Info Log:", programLog); - } else if (vertexLog === "" || fragmentLog === "") { - haveDiagnostics = false; - } - if (haveDiagnostics) { - self2.diagnostics = { - runnable, - programLog, - vertexShader: { - log: vertexLog, - prefix: prefixVertex - }, - fragmentShader: { - log: fragmentLog, - prefix: prefixFragment - } - }; - } - } - gl.deleteShader(glVertexShader); - gl.deleteShader(glFragmentShader); - cachedUniforms = new WebGLUniforms(gl, program); - cachedAttributes = fetchAttributeLocations(gl, program); - } - __name(onFirstUse, "onFirstUse"); - let cachedUniforms; - this.getUniforms = function() { - if (cachedUniforms === void 0) { - onFirstUse(this); - } - return cachedUniforms; - }; - let cachedAttributes; - this.getAttributes = function() { - if (cachedAttributes === void 0) { - onFirstUse(this); - } - return cachedAttributes; - }; - let programReady = parameters.rendererExtensionParallelShaderCompile === false; - this.isReady = function() { - if (programReady === false) { - programReady = gl.getProgramParameter(program, COMPLETION_STATUS_KHR); - } - return programReady; - }; - this.destroy = function() { - bindingStates.releaseStatesOfProgram(this); - gl.deleteProgram(program); - this.program = void 0; - }; - this.type = parameters.shaderType; - this.name = parameters.shaderName; - this.id = programIdCount++; - this.cacheKey = cacheKey; - this.usedTimes = 1; - this.program = program; - this.vertexShader = glVertexShader; - this.fragmentShader = glFragmentShader; - return this; -} -__name(WebGLProgram, "WebGLProgram"); -let _id$1 = 0; -class WebGLShaderCache { - static { - __name(this, "WebGLShaderCache"); - } - constructor() { - this.shaderCache = /* @__PURE__ */ new Map(); - this.materialCache = /* @__PURE__ */ new Map(); - } - update(material) { - const vertexShader = material.vertexShader; - const fragmentShader = material.fragmentShader; - const vertexShaderStage = this._getShaderStage(vertexShader); - const fragmentShaderStage = this._getShaderStage(fragmentShader); - const materialShaders = this._getShaderCacheForMaterial(material); - if (materialShaders.has(vertexShaderStage) === false) { - materialShaders.add(vertexShaderStage); - vertexShaderStage.usedTimes++; - } - if (materialShaders.has(fragmentShaderStage) === false) { - materialShaders.add(fragmentShaderStage); - fragmentShaderStage.usedTimes++; - } - return this; - } - remove(material) { - const materialShaders = this.materialCache.get(material); - for (const shaderStage of materialShaders) { - shaderStage.usedTimes--; - if (shaderStage.usedTimes === 0) this.shaderCache.delete(shaderStage.code); - } - this.materialCache.delete(material); - return this; - } - getVertexShaderID(material) { - return this._getShaderStage(material.vertexShader).id; - } - getFragmentShaderID(material) { - return this._getShaderStage(material.fragmentShader).id; - } - dispose() { - this.shaderCache.clear(); - this.materialCache.clear(); - } - _getShaderCacheForMaterial(material) { - const cache = this.materialCache; - let set = cache.get(material); - if (set === void 0) { - set = /* @__PURE__ */ new Set(); - cache.set(material, set); - } - return set; - } - _getShaderStage(code) { - const cache = this.shaderCache; - let stage = cache.get(code); - if (stage === void 0) { - stage = new WebGLShaderStage(code); - cache.set(code, stage); - } - return stage; - } -} -class WebGLShaderStage { - static { - __name(this, "WebGLShaderStage"); - } - constructor(code) { - this.id = _id$1++; - this.code = code; - this.usedTimes = 0; - } -} -function WebGLPrograms(renderer, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping) { - const _programLayers = new Layers(); - const _customShaders = new WebGLShaderCache(); - const _activeChannels = /* @__PURE__ */ new Set(); - const programs = []; - const logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer; - const SUPPORTS_VERTEX_TEXTURES = capabilities.vertexTextures; - let precision = capabilities.precision; - const shaderIDs = { - MeshDepthMaterial: "depth", - MeshDistanceMaterial: "distanceRGBA", - MeshNormalMaterial: "normal", - MeshBasicMaterial: "basic", - MeshLambertMaterial: "lambert", - MeshPhongMaterial: "phong", - MeshToonMaterial: "toon", - MeshStandardMaterial: "physical", - MeshPhysicalMaterial: "physical", - MeshMatcapMaterial: "matcap", - LineBasicMaterial: "basic", - LineDashedMaterial: "dashed", - PointsMaterial: "points", - ShadowMaterial: "shadow", - SpriteMaterial: "sprite" - }; - function getChannel(value) { - _activeChannels.add(value); - if (value === 0) return "uv"; - return `uv${value}`; - } - __name(getChannel, "getChannel"); - function getParameters(material, lights, shadows, scene, object) { - const fog = scene.fog; - const geometry = object.geometry; - const environment = material.isMeshStandardMaterial ? scene.environment : null; - const envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || environment); - const envMapCubeUVHeight = !!envMap && envMap.mapping === CubeUVReflectionMapping ? envMap.image.height : null; - const shaderID = shaderIDs[material.type]; - if (material.precision !== null) { - precision = capabilities.getMaxPrecision(material.precision); - if (precision !== material.precision) { - console.warn("THREE.WebGLProgram.getParameters:", material.precision, "not supported, using", precision, "instead."); - } - } - const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color; - const morphTargetsCount = morphAttribute !== void 0 ? morphAttribute.length : 0; - let morphTextureStride = 0; - if (geometry.morphAttributes.position !== void 0) morphTextureStride = 1; - if (geometry.morphAttributes.normal !== void 0) morphTextureStride = 2; - if (geometry.morphAttributes.color !== void 0) morphTextureStride = 3; - let vertexShader, fragmentShader; - let customVertexShaderID, customFragmentShaderID; - if (shaderID) { - const shader = ShaderLib[shaderID]; - vertexShader = shader.vertexShader; - fragmentShader = shader.fragmentShader; - } else { - vertexShader = material.vertexShader; - fragmentShader = material.fragmentShader; - _customShaders.update(material); - customVertexShaderID = _customShaders.getVertexShaderID(material); - customFragmentShaderID = _customShaders.getFragmentShaderID(material); - } - const currentRenderTarget = renderer.getRenderTarget(); - const reverseDepthBuffer = renderer.state.buffers.depth.getReversed(); - const IS_INSTANCEDMESH = object.isInstancedMesh === true; - const IS_BATCHEDMESH = object.isBatchedMesh === true; - const HAS_MAP = !!material.map; - const HAS_MATCAP = !!material.matcap; - const HAS_ENVMAP = !!envMap; - const HAS_AOMAP = !!material.aoMap; - const HAS_LIGHTMAP = !!material.lightMap; - const HAS_BUMPMAP = !!material.bumpMap; - const HAS_NORMALMAP = !!material.normalMap; - const HAS_DISPLACEMENTMAP = !!material.displacementMap; - const HAS_EMISSIVEMAP = !!material.emissiveMap; - const HAS_METALNESSMAP = !!material.metalnessMap; - const HAS_ROUGHNESSMAP = !!material.roughnessMap; - const HAS_ANISOTROPY = material.anisotropy > 0; - const HAS_CLEARCOAT = material.clearcoat > 0; - const HAS_DISPERSION = material.dispersion > 0; - const HAS_IRIDESCENCE = material.iridescence > 0; - const HAS_SHEEN = material.sheen > 0; - const HAS_TRANSMISSION = material.transmission > 0; - const HAS_ANISOTROPYMAP = HAS_ANISOTROPY && !!material.anisotropyMap; - const HAS_CLEARCOATMAP = HAS_CLEARCOAT && !!material.clearcoatMap; - const HAS_CLEARCOAT_NORMALMAP = HAS_CLEARCOAT && !!material.clearcoatNormalMap; - const HAS_CLEARCOAT_ROUGHNESSMAP = HAS_CLEARCOAT && !!material.clearcoatRoughnessMap; - const HAS_IRIDESCENCEMAP = HAS_IRIDESCENCE && !!material.iridescenceMap; - const HAS_IRIDESCENCE_THICKNESSMAP = HAS_IRIDESCENCE && !!material.iridescenceThicknessMap; - const HAS_SHEEN_COLORMAP = HAS_SHEEN && !!material.sheenColorMap; - const HAS_SHEEN_ROUGHNESSMAP = HAS_SHEEN && !!material.sheenRoughnessMap; - const HAS_SPECULARMAP = !!material.specularMap; - const HAS_SPECULAR_COLORMAP = !!material.specularColorMap; - const HAS_SPECULAR_INTENSITYMAP = !!material.specularIntensityMap; - const HAS_TRANSMISSIONMAP = HAS_TRANSMISSION && !!material.transmissionMap; - const HAS_THICKNESSMAP = HAS_TRANSMISSION && !!material.thicknessMap; - const HAS_GRADIENTMAP = !!material.gradientMap; - const HAS_ALPHAMAP = !!material.alphaMap; - const HAS_ALPHATEST = material.alphaTest > 0; - const HAS_ALPHAHASH = !!material.alphaHash; - const HAS_EXTENSIONS = !!material.extensions; - let toneMapping = NoToneMapping; - if (material.toneMapped) { - if (currentRenderTarget === null || currentRenderTarget.isXRRenderTarget === true) { - toneMapping = renderer.toneMapping; - } - } - const parameters = { - shaderID, - shaderType: material.type, - shaderName: material.name, - vertexShader, - fragmentShader, - defines: material.defines, - customVertexShaderID, - customFragmentShaderID, - isRawShaderMaterial: material.isRawShaderMaterial === true, - glslVersion: material.glslVersion, - precision, - batching: IS_BATCHEDMESH, - batchingColor: IS_BATCHEDMESH && object._colorsTexture !== null, - instancing: IS_INSTANCEDMESH, - instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null, - instancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null, - supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES, - outputColorSpace: currentRenderTarget === null ? renderer.outputColorSpace : currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace, - alphaToCoverage: !!material.alphaToCoverage, - map: HAS_MAP, - matcap: HAS_MATCAP, - envMap: HAS_ENVMAP, - envMapMode: HAS_ENVMAP && envMap.mapping, - envMapCubeUVHeight, - aoMap: HAS_AOMAP, - lightMap: HAS_LIGHTMAP, - bumpMap: HAS_BUMPMAP, - normalMap: HAS_NORMALMAP, - displacementMap: SUPPORTS_VERTEX_TEXTURES && HAS_DISPLACEMENTMAP, - emissiveMap: HAS_EMISSIVEMAP, - normalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap, - normalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap, - metalnessMap: HAS_METALNESSMAP, - roughnessMap: HAS_ROUGHNESSMAP, - anisotropy: HAS_ANISOTROPY, - anisotropyMap: HAS_ANISOTROPYMAP, - clearcoat: HAS_CLEARCOAT, - clearcoatMap: HAS_CLEARCOATMAP, - clearcoatNormalMap: HAS_CLEARCOAT_NORMALMAP, - clearcoatRoughnessMap: HAS_CLEARCOAT_ROUGHNESSMAP, - dispersion: HAS_DISPERSION, - iridescence: HAS_IRIDESCENCE, - iridescenceMap: HAS_IRIDESCENCEMAP, - iridescenceThicknessMap: HAS_IRIDESCENCE_THICKNESSMAP, - sheen: HAS_SHEEN, - sheenColorMap: HAS_SHEEN_COLORMAP, - sheenRoughnessMap: HAS_SHEEN_ROUGHNESSMAP, - specularMap: HAS_SPECULARMAP, - specularColorMap: HAS_SPECULAR_COLORMAP, - specularIntensityMap: HAS_SPECULAR_INTENSITYMAP, - transmission: HAS_TRANSMISSION, - transmissionMap: HAS_TRANSMISSIONMAP, - thicknessMap: HAS_THICKNESSMAP, - gradientMap: HAS_GRADIENTMAP, - opaque: material.transparent === false && material.blending === NormalBlending && material.alphaToCoverage === false, - alphaMap: HAS_ALPHAMAP, - alphaTest: HAS_ALPHATEST, - alphaHash: HAS_ALPHAHASH, - combine: material.combine, - // - mapUv: HAS_MAP && getChannel(material.map.channel), - aoMapUv: HAS_AOMAP && getChannel(material.aoMap.channel), - lightMapUv: HAS_LIGHTMAP && getChannel(material.lightMap.channel), - bumpMapUv: HAS_BUMPMAP && getChannel(material.bumpMap.channel), - normalMapUv: HAS_NORMALMAP && getChannel(material.normalMap.channel), - displacementMapUv: HAS_DISPLACEMENTMAP && getChannel(material.displacementMap.channel), - emissiveMapUv: HAS_EMISSIVEMAP && getChannel(material.emissiveMap.channel), - metalnessMapUv: HAS_METALNESSMAP && getChannel(material.metalnessMap.channel), - roughnessMapUv: HAS_ROUGHNESSMAP && getChannel(material.roughnessMap.channel), - anisotropyMapUv: HAS_ANISOTROPYMAP && getChannel(material.anisotropyMap.channel), - clearcoatMapUv: HAS_CLEARCOATMAP && getChannel(material.clearcoatMap.channel), - clearcoatNormalMapUv: HAS_CLEARCOAT_NORMALMAP && getChannel(material.clearcoatNormalMap.channel), - clearcoatRoughnessMapUv: HAS_CLEARCOAT_ROUGHNESSMAP && getChannel(material.clearcoatRoughnessMap.channel), - iridescenceMapUv: HAS_IRIDESCENCEMAP && getChannel(material.iridescenceMap.channel), - iridescenceThicknessMapUv: HAS_IRIDESCENCE_THICKNESSMAP && getChannel(material.iridescenceThicknessMap.channel), - sheenColorMapUv: HAS_SHEEN_COLORMAP && getChannel(material.sheenColorMap.channel), - sheenRoughnessMapUv: HAS_SHEEN_ROUGHNESSMAP && getChannel(material.sheenRoughnessMap.channel), - specularMapUv: HAS_SPECULARMAP && getChannel(material.specularMap.channel), - specularColorMapUv: HAS_SPECULAR_COLORMAP && getChannel(material.specularColorMap.channel), - specularIntensityMapUv: HAS_SPECULAR_INTENSITYMAP && getChannel(material.specularIntensityMap.channel), - transmissionMapUv: HAS_TRANSMISSIONMAP && getChannel(material.transmissionMap.channel), - thicknessMapUv: HAS_THICKNESSMAP && getChannel(material.thicknessMap.channel), - alphaMapUv: HAS_ALPHAMAP && getChannel(material.alphaMap.channel), - // - vertexTangents: !!geometry.attributes.tangent && (HAS_NORMALMAP || HAS_ANISOTROPY), - vertexColors: material.vertexColors, - vertexAlphas: material.vertexColors === true && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4, - pointsUvs: object.isPoints === true && !!geometry.attributes.uv && (HAS_MAP || HAS_ALPHAMAP), - fog: !!fog, - useFog: material.fog === true, - fogExp2: !!fog && fog.isFogExp2, - flatShading: material.flatShading === true, - sizeAttenuation: material.sizeAttenuation === true, - logarithmicDepthBuffer, - reverseDepthBuffer, - skinning: object.isSkinnedMesh === true, - morphTargets: geometry.morphAttributes.position !== void 0, - morphNormals: geometry.morphAttributes.normal !== void 0, - morphColors: geometry.morphAttributes.color !== void 0, - morphTargetsCount, - morphTextureStride, - numDirLights: lights.directional.length, - numPointLights: lights.point.length, - numSpotLights: lights.spot.length, - numSpotLightMaps: lights.spotLightMap.length, - numRectAreaLights: lights.rectArea.length, - numHemiLights: lights.hemi.length, - numDirLightShadows: lights.directionalShadowMap.length, - numPointLightShadows: lights.pointShadowMap.length, - numSpotLightShadows: lights.spotShadowMap.length, - numSpotLightShadowsWithMaps: lights.numSpotLightShadowsWithMaps, - numLightProbes: lights.numLightProbes, - numClippingPlanes: clipping.numPlanes, - numClipIntersection: clipping.numIntersection, - dithering: material.dithering, - shadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0, - shadowMapType: renderer.shadowMap.type, - toneMapping, - decodeVideoTexture: HAS_MAP && material.map.isVideoTexture === true && ColorManagement.getTransfer(material.map.colorSpace) === SRGBTransfer, - decodeVideoTextureEmissive: HAS_EMISSIVEMAP && material.emissiveMap.isVideoTexture === true && ColorManagement.getTransfer(material.emissiveMap.colorSpace) === SRGBTransfer, - premultipliedAlpha: material.premultipliedAlpha, - doubleSided: material.side === DoubleSide, - flipSided: material.side === BackSide, - useDepthPacking: material.depthPacking >= 0, - depthPacking: material.depthPacking || 0, - index0AttributeName: material.index0AttributeName, - extensionClipCullDistance: HAS_EXTENSIONS && material.extensions.clipCullDistance === true && extensions.has("WEBGL_clip_cull_distance"), - extensionMultiDraw: (HAS_EXTENSIONS && material.extensions.multiDraw === true || IS_BATCHEDMESH) && extensions.has("WEBGL_multi_draw"), - rendererExtensionParallelShaderCompile: extensions.has("KHR_parallel_shader_compile"), - customProgramCacheKey: material.customProgramCacheKey() - }; - parameters.vertexUv1s = _activeChannels.has(1); - parameters.vertexUv2s = _activeChannels.has(2); - parameters.vertexUv3s = _activeChannels.has(3); - _activeChannels.clear(); - return parameters; - } - __name(getParameters, "getParameters"); - function getProgramCacheKey(parameters) { - const array = []; - if (parameters.shaderID) { - array.push(parameters.shaderID); - } else { - array.push(parameters.customVertexShaderID); - array.push(parameters.customFragmentShaderID); - } - if (parameters.defines !== void 0) { - for (const name in parameters.defines) { - array.push(name); - array.push(parameters.defines[name]); - } - } - if (parameters.isRawShaderMaterial === false) { - getProgramCacheKeyParameters(array, parameters); - getProgramCacheKeyBooleans(array, parameters); - array.push(renderer.outputColorSpace); - } - array.push(parameters.customProgramCacheKey); - return array.join(); - } - __name(getProgramCacheKey, "getProgramCacheKey"); - function getProgramCacheKeyParameters(array, parameters) { - array.push(parameters.precision); - array.push(parameters.outputColorSpace); - array.push(parameters.envMapMode); - array.push(parameters.envMapCubeUVHeight); - array.push(parameters.mapUv); - array.push(parameters.alphaMapUv); - array.push(parameters.lightMapUv); - array.push(parameters.aoMapUv); - array.push(parameters.bumpMapUv); - array.push(parameters.normalMapUv); - array.push(parameters.displacementMapUv); - array.push(parameters.emissiveMapUv); - array.push(parameters.metalnessMapUv); - array.push(parameters.roughnessMapUv); - array.push(parameters.anisotropyMapUv); - array.push(parameters.clearcoatMapUv); - array.push(parameters.clearcoatNormalMapUv); - array.push(parameters.clearcoatRoughnessMapUv); - array.push(parameters.iridescenceMapUv); - array.push(parameters.iridescenceThicknessMapUv); - array.push(parameters.sheenColorMapUv); - array.push(parameters.sheenRoughnessMapUv); - array.push(parameters.specularMapUv); - array.push(parameters.specularColorMapUv); - array.push(parameters.specularIntensityMapUv); - array.push(parameters.transmissionMapUv); - array.push(parameters.thicknessMapUv); - array.push(parameters.combine); - array.push(parameters.fogExp2); - array.push(parameters.sizeAttenuation); - array.push(parameters.morphTargetsCount); - array.push(parameters.morphAttributeCount); - array.push(parameters.numDirLights); - array.push(parameters.numPointLights); - array.push(parameters.numSpotLights); - array.push(parameters.numSpotLightMaps); - array.push(parameters.numHemiLights); - array.push(parameters.numRectAreaLights); - array.push(parameters.numDirLightShadows); - array.push(parameters.numPointLightShadows); - array.push(parameters.numSpotLightShadows); - array.push(parameters.numSpotLightShadowsWithMaps); - array.push(parameters.numLightProbes); - array.push(parameters.shadowMapType); - array.push(parameters.toneMapping); - array.push(parameters.numClippingPlanes); - array.push(parameters.numClipIntersection); - array.push(parameters.depthPacking); - } - __name(getProgramCacheKeyParameters, "getProgramCacheKeyParameters"); - function getProgramCacheKeyBooleans(array, parameters) { - _programLayers.disableAll(); - if (parameters.supportsVertexTextures) - _programLayers.enable(0); - if (parameters.instancing) - _programLayers.enable(1); - if (parameters.instancingColor) - _programLayers.enable(2); - if (parameters.instancingMorph) - _programLayers.enable(3); - if (parameters.matcap) - _programLayers.enable(4); - if (parameters.envMap) - _programLayers.enable(5); - if (parameters.normalMapObjectSpace) - _programLayers.enable(6); - if (parameters.normalMapTangentSpace) - _programLayers.enable(7); - if (parameters.clearcoat) - _programLayers.enable(8); - if (parameters.iridescence) - _programLayers.enable(9); - if (parameters.alphaTest) - _programLayers.enable(10); - if (parameters.vertexColors) - _programLayers.enable(11); - if (parameters.vertexAlphas) - _programLayers.enable(12); - if (parameters.vertexUv1s) - _programLayers.enable(13); - if (parameters.vertexUv2s) - _programLayers.enable(14); - if (parameters.vertexUv3s) - _programLayers.enable(15); - if (parameters.vertexTangents) - _programLayers.enable(16); - if (parameters.anisotropy) - _programLayers.enable(17); - if (parameters.alphaHash) - _programLayers.enable(18); - if (parameters.batching) - _programLayers.enable(19); - if (parameters.dispersion) - _programLayers.enable(20); - if (parameters.batchingColor) - _programLayers.enable(21); - array.push(_programLayers.mask); - _programLayers.disableAll(); - if (parameters.fog) - _programLayers.enable(0); - if (parameters.useFog) - _programLayers.enable(1); - if (parameters.flatShading) - _programLayers.enable(2); - if (parameters.logarithmicDepthBuffer) - _programLayers.enable(3); - if (parameters.reverseDepthBuffer) - _programLayers.enable(4); - if (parameters.skinning) - _programLayers.enable(5); - if (parameters.morphTargets) - _programLayers.enable(6); - if (parameters.morphNormals) - _programLayers.enable(7); - if (parameters.morphColors) - _programLayers.enable(8); - if (parameters.premultipliedAlpha) - _programLayers.enable(9); - if (parameters.shadowMapEnabled) - _programLayers.enable(10); - if (parameters.doubleSided) - _programLayers.enable(11); - if (parameters.flipSided) - _programLayers.enable(12); - if (parameters.useDepthPacking) - _programLayers.enable(13); - if (parameters.dithering) - _programLayers.enable(14); - if (parameters.transmission) - _programLayers.enable(15); - if (parameters.sheen) - _programLayers.enable(16); - if (parameters.opaque) - _programLayers.enable(17); - if (parameters.pointsUvs) - _programLayers.enable(18); - if (parameters.decodeVideoTexture) - _programLayers.enable(19); - if (parameters.decodeVideoTextureEmissive) - _programLayers.enable(20); - if (parameters.alphaToCoverage) - _programLayers.enable(21); - array.push(_programLayers.mask); - } - __name(getProgramCacheKeyBooleans, "getProgramCacheKeyBooleans"); - function getUniforms(material) { - const shaderID = shaderIDs[material.type]; - let uniforms; - if (shaderID) { - const shader = ShaderLib[shaderID]; - uniforms = UniformsUtils.clone(shader.uniforms); - } else { - uniforms = material.uniforms; - } - return uniforms; - } - __name(getUniforms, "getUniforms"); - function acquireProgram(parameters, cacheKey) { - let program; - for (let p = 0, pl = programs.length; p < pl; p++) { - const preexistingProgram = programs[p]; - if (preexistingProgram.cacheKey === cacheKey) { - program = preexistingProgram; - ++program.usedTimes; - break; - } - } - if (program === void 0) { - program = new WebGLProgram(renderer, cacheKey, parameters, bindingStates); - programs.push(program); - } - return program; - } - __name(acquireProgram, "acquireProgram"); - function releaseProgram(program) { - if (--program.usedTimes === 0) { - const i = programs.indexOf(program); - programs[i] = programs[programs.length - 1]; - programs.pop(); - program.destroy(); - } - } - __name(releaseProgram, "releaseProgram"); - function releaseShaderCache(material) { - _customShaders.remove(material); - } - __name(releaseShaderCache, "releaseShaderCache"); - function dispose() { - _customShaders.dispose(); - } - __name(dispose, "dispose"); - return { - getParameters, - getProgramCacheKey, - getUniforms, - acquireProgram, - releaseProgram, - releaseShaderCache, - // Exposed for resource monitoring & error feedback via renderer.info: - programs, - dispose - }; -} -__name(WebGLPrograms, "WebGLPrograms"); -function WebGLProperties() { - let properties = /* @__PURE__ */ new WeakMap(); - function has(object) { - return properties.has(object); - } - __name(has, "has"); - function get(object) { - let map = properties.get(object); - if (map === void 0) { - map = {}; - properties.set(object, map); - } - return map; - } - __name(get, "get"); - function remove(object) { - properties.delete(object); - } - __name(remove, "remove"); - function update(object, key, value) { - properties.get(object)[key] = value; - } - __name(update, "update"); - function dispose() { - properties = /* @__PURE__ */ new WeakMap(); - } - __name(dispose, "dispose"); - return { - has, - get, - remove, - update, - dispose - }; -} -__name(WebGLProperties, "WebGLProperties"); -function painterSortStable(a, b) { - if (a.groupOrder !== b.groupOrder) { - return a.groupOrder - b.groupOrder; - } else if (a.renderOrder !== b.renderOrder) { - return a.renderOrder - b.renderOrder; - } else if (a.material.id !== b.material.id) { - return a.material.id - b.material.id; - } else if (a.z !== b.z) { - return a.z - b.z; - } else { - return a.id - b.id; - } -} -__name(painterSortStable, "painterSortStable"); -function reversePainterSortStable(a, b) { - if (a.groupOrder !== b.groupOrder) { - return a.groupOrder - b.groupOrder; - } else if (a.renderOrder !== b.renderOrder) { - return a.renderOrder - b.renderOrder; - } else if (a.z !== b.z) { - return b.z - a.z; - } else { - return a.id - b.id; - } -} -__name(reversePainterSortStable, "reversePainterSortStable"); -function WebGLRenderList() { - const renderItems = []; - let renderItemsIndex = 0; - const opaque = []; - const transmissive = []; - const transparent = []; - function init() { - renderItemsIndex = 0; - opaque.length = 0; - transmissive.length = 0; - transparent.length = 0; - } - __name(init, "init"); - function getNextRenderItem(object, geometry, material, groupOrder, z, group) { - let renderItem = renderItems[renderItemsIndex]; - if (renderItem === void 0) { - renderItem = { - id: object.id, - object, - geometry, - material, - groupOrder, - renderOrder: object.renderOrder, - z, - group - }; - renderItems[renderItemsIndex] = renderItem; - } else { - renderItem.id = object.id; - renderItem.object = object; - renderItem.geometry = geometry; - renderItem.material = material; - renderItem.groupOrder = groupOrder; - renderItem.renderOrder = object.renderOrder; - renderItem.z = z; - renderItem.group = group; - } - renderItemsIndex++; - return renderItem; - } - __name(getNextRenderItem, "getNextRenderItem"); - function push(object, geometry, material, groupOrder, z, group) { - const renderItem = getNextRenderItem(object, geometry, material, groupOrder, z, group); - if (material.transmission > 0) { - transmissive.push(renderItem); - } else if (material.transparent === true) { - transparent.push(renderItem); - } else { - opaque.push(renderItem); - } - } - __name(push, "push"); - function unshift(object, geometry, material, groupOrder, z, group) { - const renderItem = getNextRenderItem(object, geometry, material, groupOrder, z, group); - if (material.transmission > 0) { - transmissive.unshift(renderItem); - } else if (material.transparent === true) { - transparent.unshift(renderItem); - } else { - opaque.unshift(renderItem); - } - } - __name(unshift, "unshift"); - function sort(customOpaqueSort, customTransparentSort) { - if (opaque.length > 1) opaque.sort(customOpaqueSort || painterSortStable); - if (transmissive.length > 1) transmissive.sort(customTransparentSort || reversePainterSortStable); - if (transparent.length > 1) transparent.sort(customTransparentSort || reversePainterSortStable); - } - __name(sort, "sort"); - function finish() { - for (let i = renderItemsIndex, il = renderItems.length; i < il; i++) { - const renderItem = renderItems[i]; - if (renderItem.id === null) break; - renderItem.id = null; - renderItem.object = null; - renderItem.geometry = null; - renderItem.material = null; - renderItem.group = null; - } - } - __name(finish, "finish"); - return { - opaque, - transmissive, - transparent, - init, - push, - unshift, - finish, - sort - }; -} -__name(WebGLRenderList, "WebGLRenderList"); -function WebGLRenderLists() { - let lists = /* @__PURE__ */ new WeakMap(); - function get(scene, renderCallDepth) { - const listArray = lists.get(scene); - let list; - if (listArray === void 0) { - list = new WebGLRenderList(); - lists.set(scene, [list]); - } else { - if (renderCallDepth >= listArray.length) { - list = new WebGLRenderList(); - listArray.push(list); - } else { - list = listArray[renderCallDepth]; - } - } - return list; - } - __name(get, "get"); - function dispose() { - lists = /* @__PURE__ */ new WeakMap(); - } - __name(dispose, "dispose"); - return { - get, - dispose - }; -} -__name(WebGLRenderLists, "WebGLRenderLists"); -function UniformsCache() { - const lights = {}; - return { - get: /* @__PURE__ */ __name(function(light) { - if (lights[light.id] !== void 0) { - return lights[light.id]; - } - let uniforms; - switch (light.type) { - case "DirectionalLight": - uniforms = { - direction: new Vector3(), - color: new Color() - }; - break; - case "SpotLight": - uniforms = { - position: new Vector3(), - direction: new Vector3(), - color: new Color(), - distance: 0, - coneCos: 0, - penumbraCos: 0, - decay: 0 - }; - break; - case "PointLight": - uniforms = { - position: new Vector3(), - color: new Color(), - distance: 0, - decay: 0 - }; - break; - case "HemisphereLight": - uniforms = { - direction: new Vector3(), - skyColor: new Color(), - groundColor: new Color() - }; - break; - case "RectAreaLight": - uniforms = { - color: new Color(), - position: new Vector3(), - halfWidth: new Vector3(), - halfHeight: new Vector3() - }; - break; - } - lights[light.id] = uniforms; - return uniforms; - }, "get") - }; -} -__name(UniformsCache, "UniformsCache"); -function ShadowUniformsCache() { - const lights = {}; - return { - get: /* @__PURE__ */ __name(function(light) { - if (lights[light.id] !== void 0) { - return lights[light.id]; - } - let uniforms; - switch (light.type) { - case "DirectionalLight": - uniforms = { - shadowIntensity: 1, - shadowBias: 0, - shadowNormalBias: 0, - shadowRadius: 1, - shadowMapSize: new Vector2() - }; - break; - case "SpotLight": - uniforms = { - shadowIntensity: 1, - shadowBias: 0, - shadowNormalBias: 0, - shadowRadius: 1, - shadowMapSize: new Vector2() - }; - break; - case "PointLight": - uniforms = { - shadowIntensity: 1, - shadowBias: 0, - shadowNormalBias: 0, - shadowRadius: 1, - shadowMapSize: new Vector2(), - shadowCameraNear: 1, - shadowCameraFar: 1e3 - }; - break; - } - lights[light.id] = uniforms; - return uniforms; - }, "get") - }; -} -__name(ShadowUniformsCache, "ShadowUniformsCache"); -let nextVersion = 0; -function shadowCastingAndTexturingLightsFirst(lightA, lightB) { - return (lightB.castShadow ? 2 : 0) - (lightA.castShadow ? 2 : 0) + (lightB.map ? 1 : 0) - (lightA.map ? 1 : 0); -} -__name(shadowCastingAndTexturingLightsFirst, "shadowCastingAndTexturingLightsFirst"); -function WebGLLights(extensions) { - const cache = new UniformsCache(); - const shadowCache = ShadowUniformsCache(); - const state = { - version: 0, - hash: { - directionalLength: -1, - pointLength: -1, - spotLength: -1, - rectAreaLength: -1, - hemiLength: -1, - numDirectionalShadows: -1, - numPointShadows: -1, - numSpotShadows: -1, - numSpotMaps: -1, - numLightProbes: -1 - }, - ambient: [0, 0, 0], - probe: [], - directional: [], - directionalShadow: [], - directionalShadowMap: [], - directionalShadowMatrix: [], - spot: [], - spotLightMap: [], - spotShadow: [], - spotShadowMap: [], - spotLightMatrix: [], - rectArea: [], - rectAreaLTC1: null, - rectAreaLTC2: null, - point: [], - pointShadow: [], - pointShadowMap: [], - pointShadowMatrix: [], - hemi: [], - numSpotLightShadowsWithMaps: 0, - numLightProbes: 0 - }; - for (let i = 0; i < 9; i++) state.probe.push(new Vector3()); - const vector3 = new Vector3(); - const matrix4 = new Matrix4(); - const matrix42 = new Matrix4(); - function setup(lights) { - let r = 0, g = 0, b = 0; - for (let i = 0; i < 9; i++) state.probe[i].set(0, 0, 0); - let directionalLength = 0; - let pointLength = 0; - let spotLength = 0; - let rectAreaLength = 0; - let hemiLength = 0; - let numDirectionalShadows = 0; - let numPointShadows = 0; - let numSpotShadows = 0; - let numSpotMaps = 0; - let numSpotShadowsWithMaps = 0; - let numLightProbes = 0; - lights.sort(shadowCastingAndTexturingLightsFirst); - for (let i = 0, l = lights.length; i < l; i++) { - const light = lights[i]; - const color = light.color; - const intensity = light.intensity; - const distance = light.distance; - const shadowMap = light.shadow && light.shadow.map ? light.shadow.map.texture : null; - if (light.isAmbientLight) { - r += color.r * intensity; - g += color.g * intensity; - b += color.b * intensity; - } else if (light.isLightProbe) { - for (let j = 0; j < 9; j++) { - state.probe[j].addScaledVector(light.sh.coefficients[j], intensity); - } - numLightProbes++; - } else if (light.isDirectionalLight) { - const uniforms = cache.get(light); - uniforms.color.copy(light.color).multiplyScalar(light.intensity); - if (light.castShadow) { - const shadow = light.shadow; - const shadowUniforms = shadowCache.get(light); - shadowUniforms.shadowIntensity = shadow.intensity; - shadowUniforms.shadowBias = shadow.bias; - shadowUniforms.shadowNormalBias = shadow.normalBias; - shadowUniforms.shadowRadius = shadow.radius; - shadowUniforms.shadowMapSize = shadow.mapSize; - state.directionalShadow[directionalLength] = shadowUniforms; - state.directionalShadowMap[directionalLength] = shadowMap; - state.directionalShadowMatrix[directionalLength] = light.shadow.matrix; - numDirectionalShadows++; - } - state.directional[directionalLength] = uniforms; - directionalLength++; - } else if (light.isSpotLight) { - const uniforms = cache.get(light); - uniforms.position.setFromMatrixPosition(light.matrixWorld); - uniforms.color.copy(color).multiplyScalar(intensity); - uniforms.distance = distance; - uniforms.coneCos = Math.cos(light.angle); - uniforms.penumbraCos = Math.cos(light.angle * (1 - light.penumbra)); - uniforms.decay = light.decay; - state.spot[spotLength] = uniforms; - const shadow = light.shadow; - if (light.map) { - state.spotLightMap[numSpotMaps] = light.map; - numSpotMaps++; - shadow.updateMatrices(light); - if (light.castShadow) numSpotShadowsWithMaps++; - } - state.spotLightMatrix[spotLength] = shadow.matrix; - if (light.castShadow) { - const shadowUniforms = shadowCache.get(light); - shadowUniforms.shadowIntensity = shadow.intensity; - shadowUniforms.shadowBias = shadow.bias; - shadowUniforms.shadowNormalBias = shadow.normalBias; - shadowUniforms.shadowRadius = shadow.radius; - shadowUniforms.shadowMapSize = shadow.mapSize; - state.spotShadow[spotLength] = shadowUniforms; - state.spotShadowMap[spotLength] = shadowMap; - numSpotShadows++; - } - spotLength++; - } else if (light.isRectAreaLight) { - const uniforms = cache.get(light); - uniforms.color.copy(color).multiplyScalar(intensity); - uniforms.halfWidth.set(light.width * 0.5, 0, 0); - uniforms.halfHeight.set(0, light.height * 0.5, 0); - state.rectArea[rectAreaLength] = uniforms; - rectAreaLength++; - } else if (light.isPointLight) { - const uniforms = cache.get(light); - uniforms.color.copy(light.color).multiplyScalar(light.intensity); - uniforms.distance = light.distance; - uniforms.decay = light.decay; - if (light.castShadow) { - const shadow = light.shadow; - const shadowUniforms = shadowCache.get(light); - shadowUniforms.shadowIntensity = shadow.intensity; - shadowUniforms.shadowBias = shadow.bias; - shadowUniforms.shadowNormalBias = shadow.normalBias; - shadowUniforms.shadowRadius = shadow.radius; - shadowUniforms.shadowMapSize = shadow.mapSize; - shadowUniforms.shadowCameraNear = shadow.camera.near; - shadowUniforms.shadowCameraFar = shadow.camera.far; - state.pointShadow[pointLength] = shadowUniforms; - state.pointShadowMap[pointLength] = shadowMap; - state.pointShadowMatrix[pointLength] = light.shadow.matrix; - numPointShadows++; - } - state.point[pointLength] = uniforms; - pointLength++; - } else if (light.isHemisphereLight) { - const uniforms = cache.get(light); - uniforms.skyColor.copy(light.color).multiplyScalar(intensity); - uniforms.groundColor.copy(light.groundColor).multiplyScalar(intensity); - state.hemi[hemiLength] = uniforms; - hemiLength++; - } - } - if (rectAreaLength > 0) { - if (extensions.has("OES_texture_float_linear") === true) { - state.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1; - state.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2; - } else { - state.rectAreaLTC1 = UniformsLib.LTC_HALF_1; - state.rectAreaLTC2 = UniformsLib.LTC_HALF_2; - } - } - state.ambient[0] = r; - state.ambient[1] = g; - state.ambient[2] = b; - const hash = state.hash; - if (hash.directionalLength !== directionalLength || hash.pointLength !== pointLength || hash.spotLength !== spotLength || hash.rectAreaLength !== rectAreaLength || hash.hemiLength !== hemiLength || hash.numDirectionalShadows !== numDirectionalShadows || hash.numPointShadows !== numPointShadows || hash.numSpotShadows !== numSpotShadows || hash.numSpotMaps !== numSpotMaps || hash.numLightProbes !== numLightProbes) { - state.directional.length = directionalLength; - state.spot.length = spotLength; - state.rectArea.length = rectAreaLength; - state.point.length = pointLength; - state.hemi.length = hemiLength; - state.directionalShadow.length = numDirectionalShadows; - state.directionalShadowMap.length = numDirectionalShadows; - state.pointShadow.length = numPointShadows; - state.pointShadowMap.length = numPointShadows; - state.spotShadow.length = numSpotShadows; - state.spotShadowMap.length = numSpotShadows; - state.directionalShadowMatrix.length = numDirectionalShadows; - state.pointShadowMatrix.length = numPointShadows; - state.spotLightMatrix.length = numSpotShadows + numSpotMaps - numSpotShadowsWithMaps; - state.spotLightMap.length = numSpotMaps; - state.numSpotLightShadowsWithMaps = numSpotShadowsWithMaps; - state.numLightProbes = numLightProbes; - hash.directionalLength = directionalLength; - hash.pointLength = pointLength; - hash.spotLength = spotLength; - hash.rectAreaLength = rectAreaLength; - hash.hemiLength = hemiLength; - hash.numDirectionalShadows = numDirectionalShadows; - hash.numPointShadows = numPointShadows; - hash.numSpotShadows = numSpotShadows; - hash.numSpotMaps = numSpotMaps; - hash.numLightProbes = numLightProbes; - state.version = nextVersion++; - } - } - __name(setup, "setup"); - function setupView(lights, camera) { - let directionalLength = 0; - let pointLength = 0; - let spotLength = 0; - let rectAreaLength = 0; - let hemiLength = 0; - const viewMatrix = camera.matrixWorldInverse; - for (let i = 0, l = lights.length; i < l; i++) { - const light = lights[i]; - if (light.isDirectionalLight) { - const uniforms = state.directional[directionalLength]; - uniforms.direction.setFromMatrixPosition(light.matrixWorld); - vector3.setFromMatrixPosition(light.target.matrixWorld); - uniforms.direction.sub(vector3); - uniforms.direction.transformDirection(viewMatrix); - directionalLength++; - } else if (light.isSpotLight) { - const uniforms = state.spot[spotLength]; - uniforms.position.setFromMatrixPosition(light.matrixWorld); - uniforms.position.applyMatrix4(viewMatrix); - uniforms.direction.setFromMatrixPosition(light.matrixWorld); - vector3.setFromMatrixPosition(light.target.matrixWorld); - uniforms.direction.sub(vector3); - uniforms.direction.transformDirection(viewMatrix); - spotLength++; - } else if (light.isRectAreaLight) { - const uniforms = state.rectArea[rectAreaLength]; - uniforms.position.setFromMatrixPosition(light.matrixWorld); - uniforms.position.applyMatrix4(viewMatrix); - matrix42.identity(); - matrix4.copy(light.matrixWorld); - matrix4.premultiply(viewMatrix); - matrix42.extractRotation(matrix4); - uniforms.halfWidth.set(light.width * 0.5, 0, 0); - uniforms.halfHeight.set(0, light.height * 0.5, 0); - uniforms.halfWidth.applyMatrix4(matrix42); - uniforms.halfHeight.applyMatrix4(matrix42); - rectAreaLength++; - } else if (light.isPointLight) { - const uniforms = state.point[pointLength]; - uniforms.position.setFromMatrixPosition(light.matrixWorld); - uniforms.position.applyMatrix4(viewMatrix); - pointLength++; - } else if (light.isHemisphereLight) { - const uniforms = state.hemi[hemiLength]; - uniforms.direction.setFromMatrixPosition(light.matrixWorld); - uniforms.direction.transformDirection(viewMatrix); - hemiLength++; - } - } - } - __name(setupView, "setupView"); - return { - setup, - setupView, - state - }; -} -__name(WebGLLights, "WebGLLights"); -function WebGLRenderState(extensions) { - const lights = new WebGLLights(extensions); - const lightsArray = []; - const shadowsArray = []; - function init(camera) { - state.camera = camera; - lightsArray.length = 0; - shadowsArray.length = 0; - } - __name(init, "init"); - function pushLight(light) { - lightsArray.push(light); - } - __name(pushLight, "pushLight"); - function pushShadow(shadowLight) { - shadowsArray.push(shadowLight); - } - __name(pushShadow, "pushShadow"); - function setupLights() { - lights.setup(lightsArray); - } - __name(setupLights, "setupLights"); - function setupLightsView(camera) { - lights.setupView(lightsArray, camera); - } - __name(setupLightsView, "setupLightsView"); - const state = { - lightsArray, - shadowsArray, - camera: null, - lights, - transmissionRenderTarget: {} - }; - return { - init, - state, - setupLights, - setupLightsView, - pushLight, - pushShadow - }; -} -__name(WebGLRenderState, "WebGLRenderState"); -function WebGLRenderStates(extensions) { - let renderStates = /* @__PURE__ */ new WeakMap(); - function get(scene, renderCallDepth = 0) { - const renderStateArray = renderStates.get(scene); - let renderState; - if (renderStateArray === void 0) { - renderState = new WebGLRenderState(extensions); - renderStates.set(scene, [renderState]); - } else { - if (renderCallDepth >= renderStateArray.length) { - renderState = new WebGLRenderState(extensions); - renderStateArray.push(renderState); - } else { - renderState = renderStateArray[renderCallDepth]; - } - } - return renderState; - } - __name(get, "get"); - function dispose() { - renderStates = /* @__PURE__ */ new WeakMap(); - } - __name(dispose, "dispose"); - return { - get, - dispose - }; -} -__name(WebGLRenderStates, "WebGLRenderStates"); -class MeshDepthMaterial extends Material { - static { - __name(this, "MeshDepthMaterial"); - } - static get type() { - return "MeshDepthMaterial"; - } - constructor(parameters) { - super(); - this.isMeshDepthMaterial = true; - this.depthPacking = BasicDepthPacking; - this.map = null; - this.alphaMap = null; - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - this.wireframe = false; - this.wireframeLinewidth = 1; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.depthPacking = source.depthPacking; - this.map = source.map; - this.alphaMap = source.alphaMap; - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - return this; - } -} -class MeshDistanceMaterial extends Material { - static { - __name(this, "MeshDistanceMaterial"); - } - static get type() { - return "MeshDistanceMaterial"; - } - constructor(parameters) { - super(); - this.isMeshDistanceMaterial = true; - this.map = null; - this.alphaMap = null; - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.map = source.map; - this.alphaMap = source.alphaMap; - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - return this; - } -} -const vertex = "void main() {\n gl_Position = vec4( position, 1.0 );\n}"; -const fragment = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"; -function WebGLShadowMap(renderer, objects, capabilities) { - let _frustum2 = new Frustum(); - const _shadowMapSize = new Vector2(), _viewportSize = new Vector2(), _viewport = new Vector4(), _depthMaterial = new MeshDepthMaterial({ depthPacking: RGBADepthPacking }), _distanceMaterial = new MeshDistanceMaterial(), _materialCache = {}, _maxTextureSize = capabilities.maxTextureSize; - const shadowSide = { [FrontSide]: BackSide, [BackSide]: FrontSide, [DoubleSide]: DoubleSide }; - const shadowMaterialVertical = new ShaderMaterial({ - defines: { - VSM_SAMPLES: 8 - }, - uniforms: { - shadow_pass: { value: null }, - resolution: { value: new Vector2() }, - radius: { value: 4 } - }, - vertexShader: vertex, - fragmentShader: fragment - }); - const shadowMaterialHorizontal = shadowMaterialVertical.clone(); - shadowMaterialHorizontal.defines.HORIZONTAL_PASS = 1; - const fullScreenTri = new BufferGeometry(); - fullScreenTri.setAttribute( - "position", - new BufferAttribute( - new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), - 3 - ) - ); - const fullScreenMesh = new Mesh(fullScreenTri, shadowMaterialVertical); - const scope = this; - this.enabled = false; - this.autoUpdate = true; - this.needsUpdate = false; - this.type = PCFShadowMap; - let _previousType = this.type; - this.render = function(lights, scene, camera) { - if (scope.enabled === false) return; - if (scope.autoUpdate === false && scope.needsUpdate === false) return; - if (lights.length === 0) return; - const currentRenderTarget = renderer.getRenderTarget(); - const activeCubeFace = renderer.getActiveCubeFace(); - const activeMipmapLevel = renderer.getActiveMipmapLevel(); - const _state = renderer.state; - _state.setBlending(NoBlending); - _state.buffers.color.setClear(1, 1, 1, 1); - _state.buffers.depth.setTest(true); - _state.setScissorTest(false); - const toVSM = _previousType !== VSMShadowMap && this.type === VSMShadowMap; - const fromVSM = _previousType === VSMShadowMap && this.type !== VSMShadowMap; - for (let i = 0, il = lights.length; i < il; i++) { - const light = lights[i]; - const shadow = light.shadow; - if (shadow === void 0) { - console.warn("THREE.WebGLShadowMap:", light, "has no shadow."); - continue; - } - if (shadow.autoUpdate === false && shadow.needsUpdate === false) continue; - _shadowMapSize.copy(shadow.mapSize); - const shadowFrameExtents = shadow.getFrameExtents(); - _shadowMapSize.multiply(shadowFrameExtents); - _viewportSize.copy(shadow.mapSize); - if (_shadowMapSize.x > _maxTextureSize || _shadowMapSize.y > _maxTextureSize) { - if (_shadowMapSize.x > _maxTextureSize) { - _viewportSize.x = Math.floor(_maxTextureSize / shadowFrameExtents.x); - _shadowMapSize.x = _viewportSize.x * shadowFrameExtents.x; - shadow.mapSize.x = _viewportSize.x; - } - if (_shadowMapSize.y > _maxTextureSize) { - _viewportSize.y = Math.floor(_maxTextureSize / shadowFrameExtents.y); - _shadowMapSize.y = _viewportSize.y * shadowFrameExtents.y; - shadow.mapSize.y = _viewportSize.y; - } - } - if (shadow.map === null || toVSM === true || fromVSM === true) { - const pars = this.type !== VSMShadowMap ? { minFilter: NearestFilter, magFilter: NearestFilter } : {}; - if (shadow.map !== null) { - shadow.map.dispose(); - } - shadow.map = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y, pars); - shadow.map.texture.name = light.name + ".shadowMap"; - shadow.camera.updateProjectionMatrix(); - } - renderer.setRenderTarget(shadow.map); - renderer.clear(); - const viewportCount = shadow.getViewportCount(); - for (let vp = 0; vp < viewportCount; vp++) { - const viewport = shadow.getViewport(vp); - _viewport.set( - _viewportSize.x * viewport.x, - _viewportSize.y * viewport.y, - _viewportSize.x * viewport.z, - _viewportSize.y * viewport.w - ); - _state.viewport(_viewport); - shadow.updateMatrices(light, vp); - _frustum2 = shadow.getFrustum(); - renderObject(scene, camera, shadow.camera, light, this.type); - } - if (shadow.isPointLightShadow !== true && this.type === VSMShadowMap) { - VSMPass(shadow, camera); - } - shadow.needsUpdate = false; - } - _previousType = this.type; - scope.needsUpdate = false; - renderer.setRenderTarget(currentRenderTarget, activeCubeFace, activeMipmapLevel); - }; - function VSMPass(shadow, camera) { - const geometry = objects.update(fullScreenMesh); - if (shadowMaterialVertical.defines.VSM_SAMPLES !== shadow.blurSamples) { - shadowMaterialVertical.defines.VSM_SAMPLES = shadow.blurSamples; - shadowMaterialHorizontal.defines.VSM_SAMPLES = shadow.blurSamples; - shadowMaterialVertical.needsUpdate = true; - shadowMaterialHorizontal.needsUpdate = true; - } - if (shadow.mapPass === null) { - shadow.mapPass = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y); - } - shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture; - shadowMaterialVertical.uniforms.resolution.value = shadow.mapSize; - shadowMaterialVertical.uniforms.radius.value = shadow.radius; - renderer.setRenderTarget(shadow.mapPass); - renderer.clear(); - renderer.renderBufferDirect(camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null); - shadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture; - shadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize; - shadowMaterialHorizontal.uniforms.radius.value = shadow.radius; - renderer.setRenderTarget(shadow.map); - renderer.clear(); - renderer.renderBufferDirect(camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null); - } - __name(VSMPass, "VSMPass"); - function getDepthMaterial(object, material, light, type) { - let result = null; - const customMaterial = light.isPointLight === true ? object.customDistanceMaterial : object.customDepthMaterial; - if (customMaterial !== void 0) { - result = customMaterial; - } else { - result = light.isPointLight === true ? _distanceMaterial : _depthMaterial; - if (renderer.localClippingEnabled && material.clipShadows === true && Array.isArray(material.clippingPlanes) && material.clippingPlanes.length !== 0 || material.displacementMap && material.displacementScale !== 0 || material.alphaMap && material.alphaTest > 0 || material.map && material.alphaTest > 0) { - const keyA = result.uuid, keyB = material.uuid; - let materialsForVariant = _materialCache[keyA]; - if (materialsForVariant === void 0) { - materialsForVariant = {}; - _materialCache[keyA] = materialsForVariant; - } - let cachedMaterial = materialsForVariant[keyB]; - if (cachedMaterial === void 0) { - cachedMaterial = result.clone(); - materialsForVariant[keyB] = cachedMaterial; - material.addEventListener("dispose", onMaterialDispose); - } - result = cachedMaterial; - } - } - result.visible = material.visible; - result.wireframe = material.wireframe; - if (type === VSMShadowMap) { - result.side = material.shadowSide !== null ? material.shadowSide : material.side; - } else { - result.side = material.shadowSide !== null ? material.shadowSide : shadowSide[material.side]; - } - result.alphaMap = material.alphaMap; - result.alphaTest = material.alphaTest; - result.map = material.map; - result.clipShadows = material.clipShadows; - result.clippingPlanes = material.clippingPlanes; - result.clipIntersection = material.clipIntersection; - result.displacementMap = material.displacementMap; - result.displacementScale = material.displacementScale; - result.displacementBias = material.displacementBias; - result.wireframeLinewidth = material.wireframeLinewidth; - result.linewidth = material.linewidth; - if (light.isPointLight === true && result.isMeshDistanceMaterial === true) { - const materialProperties = renderer.properties.get(result); - materialProperties.light = light; - } - return result; - } - __name(getDepthMaterial, "getDepthMaterial"); - function renderObject(object, camera, shadowCamera, light, type) { - if (object.visible === false) return; - const visible = object.layers.test(camera.layers); - if (visible && (object.isMesh || object.isLine || object.isPoints)) { - if ((object.castShadow || object.receiveShadow && type === VSMShadowMap) && (!object.frustumCulled || _frustum2.intersectsObject(object))) { - object.modelViewMatrix.multiplyMatrices(shadowCamera.matrixWorldInverse, object.matrixWorld); - const geometry = objects.update(object); - const material = object.material; - if (Array.isArray(material)) { - const groups = geometry.groups; - for (let k = 0, kl = groups.length; k < kl; k++) { - const group = groups[k]; - const groupMaterial = material[group.materialIndex]; - if (groupMaterial && groupMaterial.visible) { - const depthMaterial = getDepthMaterial(object, groupMaterial, light, type); - object.onBeforeShadow(renderer, object, camera, shadowCamera, geometry, depthMaterial, group); - renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, group); - object.onAfterShadow(renderer, object, camera, shadowCamera, geometry, depthMaterial, group); - } - } - } else if (material.visible) { - const depthMaterial = getDepthMaterial(object, material, light, type); - object.onBeforeShadow(renderer, object, camera, shadowCamera, geometry, depthMaterial, null); - renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, null); - object.onAfterShadow(renderer, object, camera, shadowCamera, geometry, depthMaterial, null); - } - } - } - const children = object.children; - for (let i = 0, l = children.length; i < l; i++) { - renderObject(children[i], camera, shadowCamera, light, type); - } - } - __name(renderObject, "renderObject"); - function onMaterialDispose(event) { - const material = event.target; - material.removeEventListener("dispose", onMaterialDispose); - for (const id2 in _materialCache) { - const cache = _materialCache[id2]; - const uuid = event.target.uuid; - if (uuid in cache) { - const shadowMaterial = cache[uuid]; - shadowMaterial.dispose(); - delete cache[uuid]; - } - } - } - __name(onMaterialDispose, "onMaterialDispose"); -} -__name(WebGLShadowMap, "WebGLShadowMap"); -const reversedFuncs = { - [NeverDepth]: AlwaysDepth, - [LessDepth]: GreaterDepth, - [EqualDepth]: NotEqualDepth, - [LessEqualDepth]: GreaterEqualDepth, - [AlwaysDepth]: NeverDepth, - [GreaterDepth]: LessDepth, - [NotEqualDepth]: EqualDepth, - [GreaterEqualDepth]: LessEqualDepth -}; -function WebGLState(gl, extensions) { - function ColorBuffer() { - let locked = false; - const color = new Vector4(); - let currentColorMask = null; - const currentColorClear = new Vector4(0, 0, 0, 0); - return { - setMask: /* @__PURE__ */ __name(function(colorMask) { - if (currentColorMask !== colorMask && !locked) { - gl.colorMask(colorMask, colorMask, colorMask, colorMask); - currentColorMask = colorMask; - } - }, "setMask"), - setLocked: /* @__PURE__ */ __name(function(lock) { - locked = lock; - }, "setLocked"), - setClear: /* @__PURE__ */ __name(function(r, g, b, a, premultipliedAlpha) { - if (premultipliedAlpha === true) { - r *= a; - g *= a; - b *= a; - } - color.set(r, g, b, a); - if (currentColorClear.equals(color) === false) { - gl.clearColor(r, g, b, a); - currentColorClear.copy(color); - } - }, "setClear"), - reset: /* @__PURE__ */ __name(function() { - locked = false; - currentColorMask = null; - currentColorClear.set(-1, 0, 0, 0); - }, "reset") - }; - } - __name(ColorBuffer, "ColorBuffer"); - function DepthBuffer() { - let locked = false; - let reversed = false; - let currentDepthMask = null; - let currentDepthFunc = null; - let currentDepthClear = null; - return { - setReversed: /* @__PURE__ */ __name(function(value) { - if (reversed !== value) { - const ext2 = extensions.get("EXT_clip_control"); - if (reversed) { - ext2.clipControlEXT(ext2.LOWER_LEFT_EXT, ext2.ZERO_TO_ONE_EXT); - } else { - ext2.clipControlEXT(ext2.LOWER_LEFT_EXT, ext2.NEGATIVE_ONE_TO_ONE_EXT); - } - const oldDepth = currentDepthClear; - currentDepthClear = null; - this.setClear(oldDepth); - } - reversed = value; - }, "setReversed"), - getReversed: /* @__PURE__ */ __name(function() { - return reversed; - }, "getReversed"), - setTest: /* @__PURE__ */ __name(function(depthTest) { - if (depthTest) { - enable(gl.DEPTH_TEST); - } else { - disable(gl.DEPTH_TEST); - } - }, "setTest"), - setMask: /* @__PURE__ */ __name(function(depthMask) { - if (currentDepthMask !== depthMask && !locked) { - gl.depthMask(depthMask); - currentDepthMask = depthMask; - } - }, "setMask"), - setFunc: /* @__PURE__ */ __name(function(depthFunc) { - if (reversed) depthFunc = reversedFuncs[depthFunc]; - if (currentDepthFunc !== depthFunc) { - switch (depthFunc) { - case NeverDepth: - gl.depthFunc(gl.NEVER); - break; - case AlwaysDepth: - gl.depthFunc(gl.ALWAYS); - break; - case LessDepth: - gl.depthFunc(gl.LESS); - break; - case LessEqualDepth: - gl.depthFunc(gl.LEQUAL); - break; - case EqualDepth: - gl.depthFunc(gl.EQUAL); - break; - case GreaterEqualDepth: - gl.depthFunc(gl.GEQUAL); - break; - case GreaterDepth: - gl.depthFunc(gl.GREATER); - break; - case NotEqualDepth: - gl.depthFunc(gl.NOTEQUAL); - break; - default: - gl.depthFunc(gl.LEQUAL); - } - currentDepthFunc = depthFunc; - } - }, "setFunc"), - setLocked: /* @__PURE__ */ __name(function(lock) { - locked = lock; - }, "setLocked"), - setClear: /* @__PURE__ */ __name(function(depth) { - if (currentDepthClear !== depth) { - if (reversed) { - depth = 1 - depth; - } - gl.clearDepth(depth); - currentDepthClear = depth; - } - }, "setClear"), - reset: /* @__PURE__ */ __name(function() { - locked = false; - currentDepthMask = null; - currentDepthFunc = null; - currentDepthClear = null; - reversed = false; - }, "reset") - }; - } - __name(DepthBuffer, "DepthBuffer"); - function StencilBuffer() { - let locked = false; - let currentStencilMask = null; - let currentStencilFunc = null; - let currentStencilRef = null; - let currentStencilFuncMask = null; - let currentStencilFail = null; - let currentStencilZFail = null; - let currentStencilZPass = null; - let currentStencilClear = null; - return { - setTest: /* @__PURE__ */ __name(function(stencilTest) { - if (!locked) { - if (stencilTest) { - enable(gl.STENCIL_TEST); - } else { - disable(gl.STENCIL_TEST); - } - } - }, "setTest"), - setMask: /* @__PURE__ */ __name(function(stencilMask) { - if (currentStencilMask !== stencilMask && !locked) { - gl.stencilMask(stencilMask); - currentStencilMask = stencilMask; - } - }, "setMask"), - setFunc: /* @__PURE__ */ __name(function(stencilFunc, stencilRef, stencilMask) { - if (currentStencilFunc !== stencilFunc || currentStencilRef !== stencilRef || currentStencilFuncMask !== stencilMask) { - gl.stencilFunc(stencilFunc, stencilRef, stencilMask); - currentStencilFunc = stencilFunc; - currentStencilRef = stencilRef; - currentStencilFuncMask = stencilMask; - } - }, "setFunc"), - setOp: /* @__PURE__ */ __name(function(stencilFail, stencilZFail, stencilZPass) { - if (currentStencilFail !== stencilFail || currentStencilZFail !== stencilZFail || currentStencilZPass !== stencilZPass) { - gl.stencilOp(stencilFail, stencilZFail, stencilZPass); - currentStencilFail = stencilFail; - currentStencilZFail = stencilZFail; - currentStencilZPass = stencilZPass; - } - }, "setOp"), - setLocked: /* @__PURE__ */ __name(function(lock) { - locked = lock; - }, "setLocked"), - setClear: /* @__PURE__ */ __name(function(stencil) { - if (currentStencilClear !== stencil) { - gl.clearStencil(stencil); - currentStencilClear = stencil; - } - }, "setClear"), - reset: /* @__PURE__ */ __name(function() { - locked = false; - currentStencilMask = null; - currentStencilFunc = null; - currentStencilRef = null; - currentStencilFuncMask = null; - currentStencilFail = null; - currentStencilZFail = null; - currentStencilZPass = null; - currentStencilClear = null; - }, "reset") - }; - } - __name(StencilBuffer, "StencilBuffer"); - const colorBuffer = new ColorBuffer(); - const depthBuffer = new DepthBuffer(); - const stencilBuffer = new StencilBuffer(); - const uboBindings = /* @__PURE__ */ new WeakMap(); - const uboProgramMap = /* @__PURE__ */ new WeakMap(); - let enabledCapabilities = {}; - let currentBoundFramebuffers = {}; - let currentDrawbuffers = /* @__PURE__ */ new WeakMap(); - let defaultDrawbuffers = []; - let currentProgram = null; - let currentBlendingEnabled = false; - let currentBlending = null; - let currentBlendEquation = null; - let currentBlendSrc = null; - let currentBlendDst = null; - let currentBlendEquationAlpha = null; - let currentBlendSrcAlpha = null; - let currentBlendDstAlpha = null; - let currentBlendColor = new Color(0, 0, 0); - let currentBlendAlpha = 0; - let currentPremultipledAlpha = false; - let currentFlipSided = null; - let currentCullFace = null; - let currentLineWidth = null; - let currentPolygonOffsetFactor = null; - let currentPolygonOffsetUnits = null; - const maxTextures = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); - let lineWidthAvailable = false; - let version = 0; - const glVersion = gl.getParameter(gl.VERSION); - if (glVersion.indexOf("WebGL") !== -1) { - version = parseFloat(/^WebGL (\d)/.exec(glVersion)[1]); - lineWidthAvailable = version >= 1; - } else if (glVersion.indexOf("OpenGL ES") !== -1) { - version = parseFloat(/^OpenGL ES (\d)/.exec(glVersion)[1]); - lineWidthAvailable = version >= 2; - } - let currentTextureSlot = null; - let currentBoundTextures = {}; - const scissorParam = gl.getParameter(gl.SCISSOR_BOX); - const viewportParam = gl.getParameter(gl.VIEWPORT); - const currentScissor = new Vector4().fromArray(scissorParam); - const currentViewport = new Vector4().fromArray(viewportParam); - function createTexture(type, target, count, dimensions) { - const data = new Uint8Array(4); - const texture = gl.createTexture(); - gl.bindTexture(type, texture); - gl.texParameteri(type, gl.TEXTURE_MIN_FILTER, gl.NEAREST); - gl.texParameteri(type, gl.TEXTURE_MAG_FILTER, gl.NEAREST); - for (let i = 0; i < count; i++) { - if (type === gl.TEXTURE_3D || type === gl.TEXTURE_2D_ARRAY) { - gl.texImage3D(target, 0, gl.RGBA, 1, 1, dimensions, 0, gl.RGBA, gl.UNSIGNED_BYTE, data); - } else { - gl.texImage2D(target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data); - } - } - return texture; - } - __name(createTexture, "createTexture"); - const emptyTextures = {}; - emptyTextures[gl.TEXTURE_2D] = createTexture(gl.TEXTURE_2D, gl.TEXTURE_2D, 1); - emptyTextures[gl.TEXTURE_CUBE_MAP] = createTexture(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6); - emptyTextures[gl.TEXTURE_2D_ARRAY] = createTexture(gl.TEXTURE_2D_ARRAY, gl.TEXTURE_2D_ARRAY, 1, 1); - emptyTextures[gl.TEXTURE_3D] = createTexture(gl.TEXTURE_3D, gl.TEXTURE_3D, 1, 1); - colorBuffer.setClear(0, 0, 0, 1); - depthBuffer.setClear(1); - stencilBuffer.setClear(0); - enable(gl.DEPTH_TEST); - depthBuffer.setFunc(LessEqualDepth); - setFlipSided(false); - setCullFace(CullFaceBack); - enable(gl.CULL_FACE); - setBlending(NoBlending); - function enable(id2) { - if (enabledCapabilities[id2] !== true) { - gl.enable(id2); - enabledCapabilities[id2] = true; - } - } - __name(enable, "enable"); - function disable(id2) { - if (enabledCapabilities[id2] !== false) { - gl.disable(id2); - enabledCapabilities[id2] = false; - } - } - __name(disable, "disable"); - function bindFramebuffer(target, framebuffer) { - if (currentBoundFramebuffers[target] !== framebuffer) { - gl.bindFramebuffer(target, framebuffer); - currentBoundFramebuffers[target] = framebuffer; - if (target === gl.DRAW_FRAMEBUFFER) { - currentBoundFramebuffers[gl.FRAMEBUFFER] = framebuffer; - } - if (target === gl.FRAMEBUFFER) { - currentBoundFramebuffers[gl.DRAW_FRAMEBUFFER] = framebuffer; - } - return true; - } - return false; - } - __name(bindFramebuffer, "bindFramebuffer"); - function drawBuffers(renderTarget, framebuffer) { - let drawBuffers2 = defaultDrawbuffers; - let needsUpdate = false; - if (renderTarget) { - drawBuffers2 = currentDrawbuffers.get(framebuffer); - if (drawBuffers2 === void 0) { - drawBuffers2 = []; - currentDrawbuffers.set(framebuffer, drawBuffers2); - } - const textures = renderTarget.textures; - if (drawBuffers2.length !== textures.length || drawBuffers2[0] !== gl.COLOR_ATTACHMENT0) { - for (let i = 0, il = textures.length; i < il; i++) { - drawBuffers2[i] = gl.COLOR_ATTACHMENT0 + i; - } - drawBuffers2.length = textures.length; - needsUpdate = true; - } - } else { - if (drawBuffers2[0] !== gl.BACK) { - drawBuffers2[0] = gl.BACK; - needsUpdate = true; - } - } - if (needsUpdate) { - gl.drawBuffers(drawBuffers2); - } - } - __name(drawBuffers, "drawBuffers"); - function useProgram(program) { - if (currentProgram !== program) { - gl.useProgram(program); - currentProgram = program; - return true; - } - return false; - } - __name(useProgram, "useProgram"); - const equationToGL = { - [AddEquation]: gl.FUNC_ADD, - [SubtractEquation]: gl.FUNC_SUBTRACT, - [ReverseSubtractEquation]: gl.FUNC_REVERSE_SUBTRACT - }; - equationToGL[MinEquation] = gl.MIN; - equationToGL[MaxEquation] = gl.MAX; - const factorToGL = { - [ZeroFactor]: gl.ZERO, - [OneFactor]: gl.ONE, - [SrcColorFactor]: gl.SRC_COLOR, - [SrcAlphaFactor]: gl.SRC_ALPHA, - [SrcAlphaSaturateFactor]: gl.SRC_ALPHA_SATURATE, - [DstColorFactor]: gl.DST_COLOR, - [DstAlphaFactor]: gl.DST_ALPHA, - [OneMinusSrcColorFactor]: gl.ONE_MINUS_SRC_COLOR, - [OneMinusSrcAlphaFactor]: gl.ONE_MINUS_SRC_ALPHA, - [OneMinusDstColorFactor]: gl.ONE_MINUS_DST_COLOR, - [OneMinusDstAlphaFactor]: gl.ONE_MINUS_DST_ALPHA, - [ConstantColorFactor]: gl.CONSTANT_COLOR, - [OneMinusConstantColorFactor]: gl.ONE_MINUS_CONSTANT_COLOR, - [ConstantAlphaFactor]: gl.CONSTANT_ALPHA, - [OneMinusConstantAlphaFactor]: gl.ONE_MINUS_CONSTANT_ALPHA - }; - function setBlending(blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, blendColor, blendAlpha, premultipliedAlpha) { - if (blending === NoBlending) { - if (currentBlendingEnabled === true) { - disable(gl.BLEND); - currentBlendingEnabled = false; - } - return; - } - if (currentBlendingEnabled === false) { - enable(gl.BLEND); - currentBlendingEnabled = true; - } - if (blending !== CustomBlending) { - if (blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha) { - if (currentBlendEquation !== AddEquation || currentBlendEquationAlpha !== AddEquation) { - gl.blendEquation(gl.FUNC_ADD); - currentBlendEquation = AddEquation; - currentBlendEquationAlpha = AddEquation; - } - if (premultipliedAlpha) { - switch (blending) { - case NormalBlending: - gl.blendFuncSeparate(gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - break; - case AdditiveBlending: - gl.blendFunc(gl.ONE, gl.ONE); - break; - case SubtractiveBlending: - gl.blendFuncSeparate(gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ZERO, gl.ONE); - break; - case MultiplyBlending: - gl.blendFuncSeparate(gl.ZERO, gl.SRC_COLOR, gl.ZERO, gl.SRC_ALPHA); - break; - default: - console.error("THREE.WebGLState: Invalid blending: ", blending); - break; - } - } else { - switch (blending) { - case NormalBlending: - gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - break; - case AdditiveBlending: - gl.blendFunc(gl.SRC_ALPHA, gl.ONE); - break; - case SubtractiveBlending: - gl.blendFuncSeparate(gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ZERO, gl.ONE); - break; - case MultiplyBlending: - gl.blendFunc(gl.ZERO, gl.SRC_COLOR); - break; - default: - console.error("THREE.WebGLState: Invalid blending: ", blending); - break; - } - } - currentBlendSrc = null; - currentBlendDst = null; - currentBlendSrcAlpha = null; - currentBlendDstAlpha = null; - currentBlendColor.set(0, 0, 0); - currentBlendAlpha = 0; - currentBlending = blending; - currentPremultipledAlpha = premultipliedAlpha; - } - return; - } - blendEquationAlpha = blendEquationAlpha || blendEquation; - blendSrcAlpha = blendSrcAlpha || blendSrc; - blendDstAlpha = blendDstAlpha || blendDst; - if (blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha) { - gl.blendEquationSeparate(equationToGL[blendEquation], equationToGL[blendEquationAlpha]); - currentBlendEquation = blendEquation; - currentBlendEquationAlpha = blendEquationAlpha; - } - if (blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha) { - gl.blendFuncSeparate(factorToGL[blendSrc], factorToGL[blendDst], factorToGL[blendSrcAlpha], factorToGL[blendDstAlpha]); - currentBlendSrc = blendSrc; - currentBlendDst = blendDst; - currentBlendSrcAlpha = blendSrcAlpha; - currentBlendDstAlpha = blendDstAlpha; - } - if (blendColor.equals(currentBlendColor) === false || blendAlpha !== currentBlendAlpha) { - gl.blendColor(blendColor.r, blendColor.g, blendColor.b, blendAlpha); - currentBlendColor.copy(blendColor); - currentBlendAlpha = blendAlpha; - } - currentBlending = blending; - currentPremultipledAlpha = false; - } - __name(setBlending, "setBlending"); - function setMaterial(material, frontFaceCW) { - material.side === DoubleSide ? disable(gl.CULL_FACE) : enable(gl.CULL_FACE); - let flipSided = material.side === BackSide; - if (frontFaceCW) flipSided = !flipSided; - setFlipSided(flipSided); - material.blending === NormalBlending && material.transparent === false ? setBlending(NoBlending) : setBlending(material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.blendColor, material.blendAlpha, material.premultipliedAlpha); - depthBuffer.setFunc(material.depthFunc); - depthBuffer.setTest(material.depthTest); - depthBuffer.setMask(material.depthWrite); - colorBuffer.setMask(material.colorWrite); - const stencilWrite = material.stencilWrite; - stencilBuffer.setTest(stencilWrite); - if (stencilWrite) { - stencilBuffer.setMask(material.stencilWriteMask); - stencilBuffer.setFunc(material.stencilFunc, material.stencilRef, material.stencilFuncMask); - stencilBuffer.setOp(material.stencilFail, material.stencilZFail, material.stencilZPass); - } - setPolygonOffset(material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits); - material.alphaToCoverage === true ? enable(gl.SAMPLE_ALPHA_TO_COVERAGE) : disable(gl.SAMPLE_ALPHA_TO_COVERAGE); - } - __name(setMaterial, "setMaterial"); - function setFlipSided(flipSided) { - if (currentFlipSided !== flipSided) { - if (flipSided) { - gl.frontFace(gl.CW); - } else { - gl.frontFace(gl.CCW); - } - currentFlipSided = flipSided; - } - } - __name(setFlipSided, "setFlipSided"); - function setCullFace(cullFace) { - if (cullFace !== CullFaceNone) { - enable(gl.CULL_FACE); - if (cullFace !== currentCullFace) { - if (cullFace === CullFaceBack) { - gl.cullFace(gl.BACK); - } else if (cullFace === CullFaceFront) { - gl.cullFace(gl.FRONT); - } else { - gl.cullFace(gl.FRONT_AND_BACK); - } - } - } else { - disable(gl.CULL_FACE); - } - currentCullFace = cullFace; - } - __name(setCullFace, "setCullFace"); - function setLineWidth(width) { - if (width !== currentLineWidth) { - if (lineWidthAvailable) gl.lineWidth(width); - currentLineWidth = width; - } - } - __name(setLineWidth, "setLineWidth"); - function setPolygonOffset(polygonOffset, factor, units) { - if (polygonOffset) { - enable(gl.POLYGON_OFFSET_FILL); - if (currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units) { - gl.polygonOffset(factor, units); - currentPolygonOffsetFactor = factor; - currentPolygonOffsetUnits = units; - } - } else { - disable(gl.POLYGON_OFFSET_FILL); - } - } - __name(setPolygonOffset, "setPolygonOffset"); - function setScissorTest(scissorTest) { - if (scissorTest) { - enable(gl.SCISSOR_TEST); - } else { - disable(gl.SCISSOR_TEST); - } - } - __name(setScissorTest, "setScissorTest"); - function activeTexture(webglSlot) { - if (webglSlot === void 0) webglSlot = gl.TEXTURE0 + maxTextures - 1; - if (currentTextureSlot !== webglSlot) { - gl.activeTexture(webglSlot); - currentTextureSlot = webglSlot; - } - } - __name(activeTexture, "activeTexture"); - function bindTexture(webglType, webglTexture, webglSlot) { - if (webglSlot === void 0) { - if (currentTextureSlot === null) { - webglSlot = gl.TEXTURE0 + maxTextures - 1; - } else { - webglSlot = currentTextureSlot; - } - } - let boundTexture = currentBoundTextures[webglSlot]; - if (boundTexture === void 0) { - boundTexture = { type: void 0, texture: void 0 }; - currentBoundTextures[webglSlot] = boundTexture; - } - if (boundTexture.type !== webglType || boundTexture.texture !== webglTexture) { - if (currentTextureSlot !== webglSlot) { - gl.activeTexture(webglSlot); - currentTextureSlot = webglSlot; - } - gl.bindTexture(webglType, webglTexture || emptyTextures[webglType]); - boundTexture.type = webglType; - boundTexture.texture = webglTexture; - } - } - __name(bindTexture, "bindTexture"); - function unbindTexture() { - const boundTexture = currentBoundTextures[currentTextureSlot]; - if (boundTexture !== void 0 && boundTexture.type !== void 0) { - gl.bindTexture(boundTexture.type, null); - boundTexture.type = void 0; - boundTexture.texture = void 0; - } - } - __name(unbindTexture, "unbindTexture"); - function compressedTexImage2D() { - try { - gl.compressedTexImage2D.apply(gl, arguments); - } catch (error) { - console.error("THREE.WebGLState:", error); - } - } - __name(compressedTexImage2D, "compressedTexImage2D"); - function compressedTexImage3D() { - try { - gl.compressedTexImage3D.apply(gl, arguments); - } catch (error) { - console.error("THREE.WebGLState:", error); - } - } - __name(compressedTexImage3D, "compressedTexImage3D"); - function texSubImage2D() { - try { - gl.texSubImage2D.apply(gl, arguments); - } catch (error) { - console.error("THREE.WebGLState:", error); - } - } - __name(texSubImage2D, "texSubImage2D"); - function texSubImage3D() { - try { - gl.texSubImage3D.apply(gl, arguments); - } catch (error) { - console.error("THREE.WebGLState:", error); - } - } - __name(texSubImage3D, "texSubImage3D"); - function compressedTexSubImage2D() { - try { - gl.compressedTexSubImage2D.apply(gl, arguments); - } catch (error) { - console.error("THREE.WebGLState:", error); - } - } - __name(compressedTexSubImage2D, "compressedTexSubImage2D"); - function compressedTexSubImage3D() { - try { - gl.compressedTexSubImage3D.apply(gl, arguments); - } catch (error) { - console.error("THREE.WebGLState:", error); - } - } - __name(compressedTexSubImage3D, "compressedTexSubImage3D"); - function texStorage2D() { - try { - gl.texStorage2D.apply(gl, arguments); - } catch (error) { - console.error("THREE.WebGLState:", error); - } - } - __name(texStorage2D, "texStorage2D"); - function texStorage3D() { - try { - gl.texStorage3D.apply(gl, arguments); - } catch (error) { - console.error("THREE.WebGLState:", error); - } - } - __name(texStorage3D, "texStorage3D"); - function texImage2D() { - try { - gl.texImage2D.apply(gl, arguments); - } catch (error) { - console.error("THREE.WebGLState:", error); - } - } - __name(texImage2D, "texImage2D"); - function texImage3D() { - try { - gl.texImage3D.apply(gl, arguments); - } catch (error) { - console.error("THREE.WebGLState:", error); - } - } - __name(texImage3D, "texImage3D"); - function scissor(scissor2) { - if (currentScissor.equals(scissor2) === false) { - gl.scissor(scissor2.x, scissor2.y, scissor2.z, scissor2.w); - currentScissor.copy(scissor2); - } - } - __name(scissor, "scissor"); - function viewport(viewport2) { - if (currentViewport.equals(viewport2) === false) { - gl.viewport(viewport2.x, viewport2.y, viewport2.z, viewport2.w); - currentViewport.copy(viewport2); - } - } - __name(viewport, "viewport"); - function updateUBOMapping(uniformsGroup, program) { - let mapping = uboProgramMap.get(program); - if (mapping === void 0) { - mapping = /* @__PURE__ */ new WeakMap(); - uboProgramMap.set(program, mapping); - } - let blockIndex = mapping.get(uniformsGroup); - if (blockIndex === void 0) { - blockIndex = gl.getUniformBlockIndex(program, uniformsGroup.name); - mapping.set(uniformsGroup, blockIndex); - } - } - __name(updateUBOMapping, "updateUBOMapping"); - function uniformBlockBinding(uniformsGroup, program) { - const mapping = uboProgramMap.get(program); - const blockIndex = mapping.get(uniformsGroup); - if (uboBindings.get(program) !== blockIndex) { - gl.uniformBlockBinding(program, blockIndex, uniformsGroup.__bindingPointIndex); - uboBindings.set(program, blockIndex); - } - } - __name(uniformBlockBinding, "uniformBlockBinding"); - function reset() { - gl.disable(gl.BLEND); - gl.disable(gl.CULL_FACE); - gl.disable(gl.DEPTH_TEST); - gl.disable(gl.POLYGON_OFFSET_FILL); - gl.disable(gl.SCISSOR_TEST); - gl.disable(gl.STENCIL_TEST); - gl.disable(gl.SAMPLE_ALPHA_TO_COVERAGE); - gl.blendEquation(gl.FUNC_ADD); - gl.blendFunc(gl.ONE, gl.ZERO); - gl.blendFuncSeparate(gl.ONE, gl.ZERO, gl.ONE, gl.ZERO); - gl.blendColor(0, 0, 0, 0); - gl.colorMask(true, true, true, true); - gl.clearColor(0, 0, 0, 0); - gl.depthMask(true); - gl.depthFunc(gl.LESS); - depthBuffer.setReversed(false); - gl.clearDepth(1); - gl.stencilMask(4294967295); - gl.stencilFunc(gl.ALWAYS, 0, 4294967295); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); - gl.clearStencil(0); - gl.cullFace(gl.BACK); - gl.frontFace(gl.CCW); - gl.polygonOffset(0, 0); - gl.activeTexture(gl.TEXTURE0); - gl.bindFramebuffer(gl.FRAMEBUFFER, null); - gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null); - gl.bindFramebuffer(gl.READ_FRAMEBUFFER, null); - gl.useProgram(null); - gl.lineWidth(1); - gl.scissor(0, 0, gl.canvas.width, gl.canvas.height); - gl.viewport(0, 0, gl.canvas.width, gl.canvas.height); - enabledCapabilities = {}; - currentTextureSlot = null; - currentBoundTextures = {}; - currentBoundFramebuffers = {}; - currentDrawbuffers = /* @__PURE__ */ new WeakMap(); - defaultDrawbuffers = []; - currentProgram = null; - currentBlendingEnabled = false; - currentBlending = null; - currentBlendEquation = null; - currentBlendSrc = null; - currentBlendDst = null; - currentBlendEquationAlpha = null; - currentBlendSrcAlpha = null; - currentBlendDstAlpha = null; - currentBlendColor = new Color(0, 0, 0); - currentBlendAlpha = 0; - currentPremultipledAlpha = false; - currentFlipSided = null; - currentCullFace = null; - currentLineWidth = null; - currentPolygonOffsetFactor = null; - currentPolygonOffsetUnits = null; - currentScissor.set(0, 0, gl.canvas.width, gl.canvas.height); - currentViewport.set(0, 0, gl.canvas.width, gl.canvas.height); - colorBuffer.reset(); - depthBuffer.reset(); - stencilBuffer.reset(); - } - __name(reset, "reset"); - return { - buffers: { - color: colorBuffer, - depth: depthBuffer, - stencil: stencilBuffer - }, - enable, - disable, - bindFramebuffer, - drawBuffers, - useProgram, - setBlending, - setMaterial, - setFlipSided, - setCullFace, - setLineWidth, - setPolygonOffset, - setScissorTest, - activeTexture, - bindTexture, - unbindTexture, - compressedTexImage2D, - compressedTexImage3D, - texImage2D, - texImage3D, - updateUBOMapping, - uniformBlockBinding, - texStorage2D, - texStorage3D, - texSubImage2D, - texSubImage3D, - compressedTexSubImage2D, - compressedTexSubImage3D, - scissor, - viewport, - reset - }; -} -__name(WebGLState, "WebGLState"); -function contain(texture, aspect2) { - const imageAspect = texture.image && texture.image.width ? texture.image.width / texture.image.height : 1; - if (imageAspect > aspect2) { - texture.repeat.x = 1; - texture.repeat.y = imageAspect / aspect2; - texture.offset.x = 0; - texture.offset.y = (1 - texture.repeat.y) / 2; - } else { - texture.repeat.x = aspect2 / imageAspect; - texture.repeat.y = 1; - texture.offset.x = (1 - texture.repeat.x) / 2; - texture.offset.y = 0; - } - return texture; -} -__name(contain, "contain"); -function cover(texture, aspect2) { - const imageAspect = texture.image && texture.image.width ? texture.image.width / texture.image.height : 1; - if (imageAspect > aspect2) { - texture.repeat.x = aspect2 / imageAspect; - texture.repeat.y = 1; - texture.offset.x = (1 - texture.repeat.x) / 2; - texture.offset.y = 0; - } else { - texture.repeat.x = 1; - texture.repeat.y = imageAspect / aspect2; - texture.offset.x = 0; - texture.offset.y = (1 - texture.repeat.y) / 2; - } - return texture; -} -__name(cover, "cover"); -function fill(texture) { - texture.repeat.x = 1; - texture.repeat.y = 1; - texture.offset.x = 0; - texture.offset.y = 0; - return texture; -} -__name(fill, "fill"); -function getByteLength(width, height, format, type) { - const typeByteLength = getTextureTypeByteLength(type); - switch (format) { - case AlphaFormat: - return width * height; - case LuminanceFormat: - return width * height; - case LuminanceAlphaFormat: - return width * height * 2; - case RedFormat: - return width * height / typeByteLength.components * typeByteLength.byteLength; - case RedIntegerFormat: - return width * height / typeByteLength.components * typeByteLength.byteLength; - case RGFormat: - return width * height * 2 / typeByteLength.components * typeByteLength.byteLength; - case RGIntegerFormat: - return width * height * 2 / typeByteLength.components * typeByteLength.byteLength; - case RGBFormat: - return width * height * 3 / typeByteLength.components * typeByteLength.byteLength; - case RGBAFormat: - return width * height * 4 / typeByteLength.components * typeByteLength.byteLength; - case RGBAIntegerFormat: - return width * height * 4 / typeByteLength.components * typeByteLength.byteLength; - case RGB_S3TC_DXT1_Format: - case RGBA_S3TC_DXT1_Format: - return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8; - case RGBA_S3TC_DXT3_Format: - case RGBA_S3TC_DXT5_Format: - return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16; - case RGB_PVRTC_2BPPV1_Format: - case RGBA_PVRTC_2BPPV1_Format: - return Math.max(width, 16) * Math.max(height, 8) / 4; - case RGB_PVRTC_4BPPV1_Format: - case RGBA_PVRTC_4BPPV1_Format: - return Math.max(width, 8) * Math.max(height, 8) / 2; - case RGB_ETC1_Format: - case RGB_ETC2_Format: - return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8; - case RGBA_ETC2_EAC_Format: - return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16; - case RGBA_ASTC_4x4_Format: - return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16; - case RGBA_ASTC_5x4_Format: - return Math.floor((width + 4) / 5) * Math.floor((height + 3) / 4) * 16; - case RGBA_ASTC_5x5_Format: - return Math.floor((width + 4) / 5) * Math.floor((height + 4) / 5) * 16; - case RGBA_ASTC_6x5_Format: - return Math.floor((width + 5) / 6) * Math.floor((height + 4) / 5) * 16; - case RGBA_ASTC_6x6_Format: - return Math.floor((width + 5) / 6) * Math.floor((height + 5) / 6) * 16; - case RGBA_ASTC_8x5_Format: - return Math.floor((width + 7) / 8) * Math.floor((height + 4) / 5) * 16; - case RGBA_ASTC_8x6_Format: - return Math.floor((width + 7) / 8) * Math.floor((height + 5) / 6) * 16; - case RGBA_ASTC_8x8_Format: - return Math.floor((width + 7) / 8) * Math.floor((height + 7) / 8) * 16; - case RGBA_ASTC_10x5_Format: - return Math.floor((width + 9) / 10) * Math.floor((height + 4) / 5) * 16; - case RGBA_ASTC_10x6_Format: - return Math.floor((width + 9) / 10) * Math.floor((height + 5) / 6) * 16; - case RGBA_ASTC_10x8_Format: - return Math.floor((width + 9) / 10) * Math.floor((height + 7) / 8) * 16; - case RGBA_ASTC_10x10_Format: - return Math.floor((width + 9) / 10) * Math.floor((height + 9) / 10) * 16; - case RGBA_ASTC_12x10_Format: - return Math.floor((width + 11) / 12) * Math.floor((height + 9) / 10) * 16; - case RGBA_ASTC_12x12_Format: - return Math.floor((width + 11) / 12) * Math.floor((height + 11) / 12) * 16; - case RGBA_BPTC_Format: - case RGB_BPTC_SIGNED_Format: - case RGB_BPTC_UNSIGNED_Format: - return Math.ceil(width / 4) * Math.ceil(height / 4) * 16; - case RED_RGTC1_Format: - case SIGNED_RED_RGTC1_Format: - return Math.ceil(width / 4) * Math.ceil(height / 4) * 8; - case RED_GREEN_RGTC2_Format: - case SIGNED_RED_GREEN_RGTC2_Format: - return Math.ceil(width / 4) * Math.ceil(height / 4) * 16; - } - throw new Error( - `Unable to determine texture byte length for ${format} format.` - ); -} -__name(getByteLength, "getByteLength"); -function getTextureTypeByteLength(type) { - switch (type) { - case UnsignedByteType: - case ByteType: - return { byteLength: 1, components: 1 }; - case UnsignedShortType: - case ShortType: - case HalfFloatType: - return { byteLength: 2, components: 1 }; - case UnsignedShort4444Type: - case UnsignedShort5551Type: - return { byteLength: 2, components: 4 }; - case UnsignedIntType: - case IntType: - case FloatType: - return { byteLength: 4, components: 1 }; - case UnsignedInt5999Type: - return { byteLength: 4, components: 3 }; - } - throw new Error(`Unknown texture type ${type}.`); -} -__name(getTextureTypeByteLength, "getTextureTypeByteLength"); -const TextureUtils = { - contain, - cover, - fill, - getByteLength -}; -function WebGLTextures(_gl, extensions, state, properties, capabilities, utils, info) { - const multisampledRTTExt = extensions.has("WEBGL_multisampled_render_to_texture") ? extensions.get("WEBGL_multisampled_render_to_texture") : null; - const supportsInvalidateFramebuffer = typeof navigator === "undefined" ? false : /OculusBrowser/g.test(navigator.userAgent); - const _imageDimensions = new Vector2(); - const _videoTextures = /* @__PURE__ */ new WeakMap(); - let _canvas2; - const _sources = /* @__PURE__ */ new WeakMap(); - let useOffscreenCanvas = false; - try { - useOffscreenCanvas = typeof OffscreenCanvas !== "undefined" && new OffscreenCanvas(1, 1).getContext("2d") !== null; - } catch (err2) { - } - function createCanvas(width, height) { - return useOffscreenCanvas ? ( - // eslint-disable-next-line compat/compat - new OffscreenCanvas(width, height) - ) : createElementNS("canvas"); - } - __name(createCanvas, "createCanvas"); - function resizeImage(image, needsNewCanvas, maxSize) { - let scale = 1; - const dimensions = getDimensions(image); - if (dimensions.width > maxSize || dimensions.height > maxSize) { - scale = maxSize / Math.max(dimensions.width, dimensions.height); - } - if (scale < 1) { - if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap || typeof VideoFrame !== "undefined" && image instanceof VideoFrame) { - const width = Math.floor(scale * dimensions.width); - const height = Math.floor(scale * dimensions.height); - if (_canvas2 === void 0) _canvas2 = createCanvas(width, height); - const canvas = needsNewCanvas ? createCanvas(width, height) : _canvas2; - canvas.width = width; - canvas.height = height; - const context = canvas.getContext("2d"); - context.drawImage(image, 0, 0, width, height); - console.warn("THREE.WebGLRenderer: Texture has been resized from (" + dimensions.width + "x" + dimensions.height + ") to (" + width + "x" + height + ")."); - return canvas; - } else { - if ("data" in image) { - console.warn("THREE.WebGLRenderer: Image in DataTexture is too big (" + dimensions.width + "x" + dimensions.height + ")."); - } - return image; - } - } - return image; - } - __name(resizeImage, "resizeImage"); - function textureNeedsGenerateMipmaps(texture) { - return texture.generateMipmaps; - } - __name(textureNeedsGenerateMipmaps, "textureNeedsGenerateMipmaps"); - function generateMipmap(target) { - _gl.generateMipmap(target); - } - __name(generateMipmap, "generateMipmap"); - function getTargetType(texture) { - if (texture.isWebGLCubeRenderTarget) return _gl.TEXTURE_CUBE_MAP; - if (texture.isWebGL3DRenderTarget) return _gl.TEXTURE_3D; - if (texture.isWebGLArrayRenderTarget || texture.isCompressedArrayTexture) return _gl.TEXTURE_2D_ARRAY; - return _gl.TEXTURE_2D; - } - __name(getTargetType, "getTargetType"); - function getInternalFormat(internalFormatName, glFormat, glType, colorSpace, forceLinearTransfer = false) { - if (internalFormatName !== null) { - if (_gl[internalFormatName] !== void 0) return _gl[internalFormatName]; - console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '" + internalFormatName + "'"); - } - let internalFormat = glFormat; - if (glFormat === _gl.RED) { - if (glType === _gl.FLOAT) internalFormat = _gl.R32F; - if (glType === _gl.HALF_FLOAT) internalFormat = _gl.R16F; - if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.R8; - } - if (glFormat === _gl.RED_INTEGER) { - if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.R8UI; - if (glType === _gl.UNSIGNED_SHORT) internalFormat = _gl.R16UI; - if (glType === _gl.UNSIGNED_INT) internalFormat = _gl.R32UI; - if (glType === _gl.BYTE) internalFormat = _gl.R8I; - if (glType === _gl.SHORT) internalFormat = _gl.R16I; - if (glType === _gl.INT) internalFormat = _gl.R32I; - } - if (glFormat === _gl.RG) { - if (glType === _gl.FLOAT) internalFormat = _gl.RG32F; - if (glType === _gl.HALF_FLOAT) internalFormat = _gl.RG16F; - if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.RG8; - } - if (glFormat === _gl.RG_INTEGER) { - if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.RG8UI; - if (glType === _gl.UNSIGNED_SHORT) internalFormat = _gl.RG16UI; - if (glType === _gl.UNSIGNED_INT) internalFormat = _gl.RG32UI; - if (glType === _gl.BYTE) internalFormat = _gl.RG8I; - if (glType === _gl.SHORT) internalFormat = _gl.RG16I; - if (glType === _gl.INT) internalFormat = _gl.RG32I; - } - if (glFormat === _gl.RGB_INTEGER) { - if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.RGB8UI; - if (glType === _gl.UNSIGNED_SHORT) internalFormat = _gl.RGB16UI; - if (glType === _gl.UNSIGNED_INT) internalFormat = _gl.RGB32UI; - if (glType === _gl.BYTE) internalFormat = _gl.RGB8I; - if (glType === _gl.SHORT) internalFormat = _gl.RGB16I; - if (glType === _gl.INT) internalFormat = _gl.RGB32I; - } - if (glFormat === _gl.RGBA_INTEGER) { - if (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.RGBA8UI; - if (glType === _gl.UNSIGNED_SHORT) internalFormat = _gl.RGBA16UI; - if (glType === _gl.UNSIGNED_INT) internalFormat = _gl.RGBA32UI; - if (glType === _gl.BYTE) internalFormat = _gl.RGBA8I; - if (glType === _gl.SHORT) internalFormat = _gl.RGBA16I; - if (glType === _gl.INT) internalFormat = _gl.RGBA32I; - } - if (glFormat === _gl.RGB) { - if (glType === _gl.UNSIGNED_INT_5_9_9_9_REV) internalFormat = _gl.RGB9_E5; - } - if (glFormat === _gl.RGBA) { - const transfer = forceLinearTransfer ? LinearTransfer : ColorManagement.getTransfer(colorSpace); - if (glType === _gl.FLOAT) internalFormat = _gl.RGBA32F; - if (glType === _gl.HALF_FLOAT) internalFormat = _gl.RGBA16F; - if (glType === _gl.UNSIGNED_BYTE) internalFormat = transfer === SRGBTransfer ? _gl.SRGB8_ALPHA8 : _gl.RGBA8; - if (glType === _gl.UNSIGNED_SHORT_4_4_4_4) internalFormat = _gl.RGBA4; - if (glType === _gl.UNSIGNED_SHORT_5_5_5_1) internalFormat = _gl.RGB5_A1; - } - if (internalFormat === _gl.R16F || internalFormat === _gl.R32F || internalFormat === _gl.RG16F || internalFormat === _gl.RG32F || internalFormat === _gl.RGBA16F || internalFormat === _gl.RGBA32F) { - extensions.get("EXT_color_buffer_float"); - } - return internalFormat; - } - __name(getInternalFormat, "getInternalFormat"); - function getInternalDepthFormat(useStencil, depthType) { - let glInternalFormat; - if (useStencil) { - if (depthType === null || depthType === UnsignedIntType || depthType === UnsignedInt248Type) { - glInternalFormat = _gl.DEPTH24_STENCIL8; - } else if (depthType === FloatType) { - glInternalFormat = _gl.DEPTH32F_STENCIL8; - } else if (depthType === UnsignedShortType) { - glInternalFormat = _gl.DEPTH24_STENCIL8; - console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment."); - } - } else { - if (depthType === null || depthType === UnsignedIntType || depthType === UnsignedInt248Type) { - glInternalFormat = _gl.DEPTH_COMPONENT24; - } else if (depthType === FloatType) { - glInternalFormat = _gl.DEPTH_COMPONENT32F; - } else if (depthType === UnsignedShortType) { - glInternalFormat = _gl.DEPTH_COMPONENT16; - } - } - return glInternalFormat; - } - __name(getInternalDepthFormat, "getInternalDepthFormat"); - function getMipLevels(texture, image) { - if (textureNeedsGenerateMipmaps(texture) === true || texture.isFramebufferTexture && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter) { - return Math.log2(Math.max(image.width, image.height)) + 1; - } else if (texture.mipmaps !== void 0 && texture.mipmaps.length > 0) { - return texture.mipmaps.length; - } else if (texture.isCompressedTexture && Array.isArray(texture.image)) { - return image.mipmaps.length; - } else { - return 1; - } - } - __name(getMipLevels, "getMipLevels"); - function onTextureDispose(event) { - const texture = event.target; - texture.removeEventListener("dispose", onTextureDispose); - deallocateTexture(texture); - if (texture.isVideoTexture) { - _videoTextures.delete(texture); - } - } - __name(onTextureDispose, "onTextureDispose"); - function onRenderTargetDispose(event) { - const renderTarget = event.target; - renderTarget.removeEventListener("dispose", onRenderTargetDispose); - deallocateRenderTarget(renderTarget); - } - __name(onRenderTargetDispose, "onRenderTargetDispose"); - function deallocateTexture(texture) { - const textureProperties = properties.get(texture); - if (textureProperties.__webglInit === void 0) return; - const source = texture.source; - const webglTextures = _sources.get(source); - if (webglTextures) { - const webglTexture = webglTextures[textureProperties.__cacheKey]; - webglTexture.usedTimes--; - if (webglTexture.usedTimes === 0) { - deleteTexture(texture); - } - if (Object.keys(webglTextures).length === 0) { - _sources.delete(source); - } - } - properties.remove(texture); - } - __name(deallocateTexture, "deallocateTexture"); - function deleteTexture(texture) { - const textureProperties = properties.get(texture); - _gl.deleteTexture(textureProperties.__webglTexture); - const source = texture.source; - const webglTextures = _sources.get(source); - delete webglTextures[textureProperties.__cacheKey]; - info.memory.textures--; - } - __name(deleteTexture, "deleteTexture"); - function deallocateRenderTarget(renderTarget) { - const renderTargetProperties = properties.get(renderTarget); - if (renderTarget.depthTexture) { - renderTarget.depthTexture.dispose(); - properties.remove(renderTarget.depthTexture); - } - if (renderTarget.isWebGLCubeRenderTarget) { - for (let i = 0; i < 6; i++) { - if (Array.isArray(renderTargetProperties.__webglFramebuffer[i])) { - for (let level = 0; level < renderTargetProperties.__webglFramebuffer[i].length; level++) _gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer[i][level]); - } else { - _gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer[i]); - } - if (renderTargetProperties.__webglDepthbuffer) _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer[i]); - } - } else { - if (Array.isArray(renderTargetProperties.__webglFramebuffer)) { - for (let level = 0; level < renderTargetProperties.__webglFramebuffer.length; level++) _gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer[level]); - } else { - _gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer); - } - if (renderTargetProperties.__webglDepthbuffer) _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer); - if (renderTargetProperties.__webglMultisampledFramebuffer) _gl.deleteFramebuffer(renderTargetProperties.__webglMultisampledFramebuffer); - if (renderTargetProperties.__webglColorRenderbuffer) { - for (let i = 0; i < renderTargetProperties.__webglColorRenderbuffer.length; i++) { - if (renderTargetProperties.__webglColorRenderbuffer[i]) _gl.deleteRenderbuffer(renderTargetProperties.__webglColorRenderbuffer[i]); - } - } - if (renderTargetProperties.__webglDepthRenderbuffer) _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthRenderbuffer); - } - const textures = renderTarget.textures; - for (let i = 0, il = textures.length; i < il; i++) { - const attachmentProperties = properties.get(textures[i]); - if (attachmentProperties.__webglTexture) { - _gl.deleteTexture(attachmentProperties.__webglTexture); - info.memory.textures--; - } - properties.remove(textures[i]); - } - properties.remove(renderTarget); - } - __name(deallocateRenderTarget, "deallocateRenderTarget"); - let textureUnits = 0; - function resetTextureUnits() { - textureUnits = 0; - } - __name(resetTextureUnits, "resetTextureUnits"); - function allocateTextureUnit() { - const textureUnit = textureUnits; - if (textureUnit >= capabilities.maxTextures) { - console.warn("THREE.WebGLTextures: Trying to use " + textureUnit + " texture units while this GPU supports only " + capabilities.maxTextures); - } - textureUnits += 1; - return textureUnit; - } - __name(allocateTextureUnit, "allocateTextureUnit"); - function getTextureCacheKey(texture) { - const array = []; - array.push(texture.wrapS); - array.push(texture.wrapT); - array.push(texture.wrapR || 0); - array.push(texture.magFilter); - array.push(texture.minFilter); - array.push(texture.anisotropy); - array.push(texture.internalFormat); - array.push(texture.format); - array.push(texture.type); - array.push(texture.generateMipmaps); - array.push(texture.premultiplyAlpha); - array.push(texture.flipY); - array.push(texture.unpackAlignment); - array.push(texture.colorSpace); - return array.join(); - } - __name(getTextureCacheKey, "getTextureCacheKey"); - function setTexture2D(texture, slot) { - const textureProperties = properties.get(texture); - if (texture.isVideoTexture) updateVideoTexture(texture); - if (texture.isRenderTargetTexture === false && texture.version > 0 && textureProperties.__version !== texture.version) { - const image = texture.image; - if (image === null) { - console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found."); - } else if (image.complete === false) { - console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete"); - } else { - uploadTexture(textureProperties, texture, slot); - return; - } - } - state.bindTexture(_gl.TEXTURE_2D, textureProperties.__webglTexture, _gl.TEXTURE0 + slot); - } - __name(setTexture2D, "setTexture2D"); - function setTexture2DArray(texture, slot) { - const textureProperties = properties.get(texture); - if (texture.version > 0 && textureProperties.__version !== texture.version) { - uploadTexture(textureProperties, texture, slot); - return; - } - state.bindTexture(_gl.TEXTURE_2D_ARRAY, textureProperties.__webglTexture, _gl.TEXTURE0 + slot); - } - __name(setTexture2DArray, "setTexture2DArray"); - function setTexture3D(texture, slot) { - const textureProperties = properties.get(texture); - if (texture.version > 0 && textureProperties.__version !== texture.version) { - uploadTexture(textureProperties, texture, slot); - return; - } - state.bindTexture(_gl.TEXTURE_3D, textureProperties.__webglTexture, _gl.TEXTURE0 + slot); - } - __name(setTexture3D, "setTexture3D"); - function setTextureCube(texture, slot) { - const textureProperties = properties.get(texture); - if (texture.version > 0 && textureProperties.__version !== texture.version) { - uploadCubeTexture(textureProperties, texture, slot); - return; - } - state.bindTexture(_gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture, _gl.TEXTURE0 + slot); - } - __name(setTextureCube, "setTextureCube"); - const wrappingToGL = { - [RepeatWrapping]: _gl.REPEAT, - [ClampToEdgeWrapping]: _gl.CLAMP_TO_EDGE, - [MirroredRepeatWrapping]: _gl.MIRRORED_REPEAT - }; - const filterToGL = { - [NearestFilter]: _gl.NEAREST, - [NearestMipmapNearestFilter]: _gl.NEAREST_MIPMAP_NEAREST, - [NearestMipmapLinearFilter]: _gl.NEAREST_MIPMAP_LINEAR, - [LinearFilter]: _gl.LINEAR, - [LinearMipmapNearestFilter]: _gl.LINEAR_MIPMAP_NEAREST, - [LinearMipmapLinearFilter]: _gl.LINEAR_MIPMAP_LINEAR - }; - const compareToGL = { - [NeverCompare]: _gl.NEVER, - [AlwaysCompare]: _gl.ALWAYS, - [LessCompare]: _gl.LESS, - [LessEqualCompare]: _gl.LEQUAL, - [EqualCompare]: _gl.EQUAL, - [GreaterEqualCompare]: _gl.GEQUAL, - [GreaterCompare]: _gl.GREATER, - [NotEqualCompare]: _gl.NOTEQUAL - }; - function setTextureParameters(textureType, texture) { - if (texture.type === FloatType && extensions.has("OES_texture_float_linear") === false && (texture.magFilter === LinearFilter || texture.magFilter === LinearMipmapNearestFilter || texture.magFilter === NearestMipmapLinearFilter || texture.magFilter === LinearMipmapLinearFilter || texture.minFilter === LinearFilter || texture.minFilter === LinearMipmapNearestFilter || texture.minFilter === NearestMipmapLinearFilter || texture.minFilter === LinearMipmapLinearFilter)) { - console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."); - } - _gl.texParameteri(textureType, _gl.TEXTURE_WRAP_S, wrappingToGL[texture.wrapS]); - _gl.texParameteri(textureType, _gl.TEXTURE_WRAP_T, wrappingToGL[texture.wrapT]); - if (textureType === _gl.TEXTURE_3D || textureType === _gl.TEXTURE_2D_ARRAY) { - _gl.texParameteri(textureType, _gl.TEXTURE_WRAP_R, wrappingToGL[texture.wrapR]); - } - _gl.texParameteri(textureType, _gl.TEXTURE_MAG_FILTER, filterToGL[texture.magFilter]); - _gl.texParameteri(textureType, _gl.TEXTURE_MIN_FILTER, filterToGL[texture.minFilter]); - if (texture.compareFunction) { - _gl.texParameteri(textureType, _gl.TEXTURE_COMPARE_MODE, _gl.COMPARE_REF_TO_TEXTURE); - _gl.texParameteri(textureType, _gl.TEXTURE_COMPARE_FUNC, compareToGL[texture.compareFunction]); - } - if (extensions.has("EXT_texture_filter_anisotropic") === true) { - if (texture.magFilter === NearestFilter) return; - if (texture.minFilter !== NearestMipmapLinearFilter && texture.minFilter !== LinearMipmapLinearFilter) return; - if (texture.type === FloatType && extensions.has("OES_texture_float_linear") === false) return; - if (texture.anisotropy > 1 || properties.get(texture).__currentAnisotropy) { - const extension = extensions.get("EXT_texture_filter_anisotropic"); - _gl.texParameterf(textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(texture.anisotropy, capabilities.getMaxAnisotropy())); - properties.get(texture).__currentAnisotropy = texture.anisotropy; - } - } - } - __name(setTextureParameters, "setTextureParameters"); - function initTexture(textureProperties, texture) { - let forceUpload = false; - if (textureProperties.__webglInit === void 0) { - textureProperties.__webglInit = true; - texture.addEventListener("dispose", onTextureDispose); - } - const source = texture.source; - let webglTextures = _sources.get(source); - if (webglTextures === void 0) { - webglTextures = {}; - _sources.set(source, webglTextures); - } - const textureCacheKey = getTextureCacheKey(texture); - if (textureCacheKey !== textureProperties.__cacheKey) { - if (webglTextures[textureCacheKey] === void 0) { - webglTextures[textureCacheKey] = { - texture: _gl.createTexture(), - usedTimes: 0 - }; - info.memory.textures++; - forceUpload = true; - } - webglTextures[textureCacheKey].usedTimes++; - const webglTexture = webglTextures[textureProperties.__cacheKey]; - if (webglTexture !== void 0) { - webglTextures[textureProperties.__cacheKey].usedTimes--; - if (webglTexture.usedTimes === 0) { - deleteTexture(texture); - } - } - textureProperties.__cacheKey = textureCacheKey; - textureProperties.__webglTexture = webglTextures[textureCacheKey].texture; - } - return forceUpload; - } - __name(initTexture, "initTexture"); - function uploadTexture(textureProperties, texture, slot) { - let textureType = _gl.TEXTURE_2D; - if (texture.isDataArrayTexture || texture.isCompressedArrayTexture) textureType = _gl.TEXTURE_2D_ARRAY; - if (texture.isData3DTexture) textureType = _gl.TEXTURE_3D; - const forceUpload = initTexture(textureProperties, texture); - const source = texture.source; - state.bindTexture(textureType, textureProperties.__webglTexture, _gl.TEXTURE0 + slot); - const sourceProperties = properties.get(source); - if (source.version !== sourceProperties.__version || forceUpload === true) { - state.activeTexture(_gl.TEXTURE0 + slot); - const workingPrimaries = ColorManagement.getPrimaries(ColorManagement.workingColorSpace); - const texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries(texture.colorSpace); - const unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL; - _gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY); - _gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha); - _gl.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment); - _gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion); - let image = resizeImage(texture.image, false, capabilities.maxTextureSize); - image = verifyColorSpace(texture, image); - const glFormat = utils.convert(texture.format, texture.colorSpace); - const glType = utils.convert(texture.type); - let glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture); - setTextureParameters(textureType, texture); - let mipmap; - const mipmaps = texture.mipmaps; - const useTexStorage = texture.isVideoTexture !== true; - const allocateMemory = sourceProperties.__version === void 0 || forceUpload === true; - const dataReady = source.dataReady; - const levels = getMipLevels(texture, image); - if (texture.isDepthTexture) { - glInternalFormat = getInternalDepthFormat(texture.format === DepthStencilFormat, texture.type); - if (allocateMemory) { - if (useTexStorage) { - state.texStorage2D(_gl.TEXTURE_2D, 1, glInternalFormat, image.width, image.height); - } else { - state.texImage2D(_gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null); - } - } - } else if (texture.isDataTexture) { - if (mipmaps.length > 0) { - if (useTexStorage && allocateMemory) { - state.texStorage2D(_gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[0].width, mipmaps[0].height); - } - for (let i = 0, il = mipmaps.length; i < il; i++) { - mipmap = mipmaps[i]; - if (useTexStorage) { - if (dataReady) { - state.texSubImage2D(_gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data); - } - } else { - state.texImage2D(_gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data); - } - } - texture.generateMipmaps = false; - } else { - if (useTexStorage) { - if (allocateMemory) { - state.texStorage2D(_gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height); - } - if (dataReady) { - state.texSubImage2D(_gl.TEXTURE_2D, 0, 0, 0, image.width, image.height, glFormat, glType, image.data); - } - } else { - state.texImage2D(_gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data); - } - } - } else if (texture.isCompressedTexture) { - if (texture.isCompressedArrayTexture) { - if (useTexStorage && allocateMemory) { - state.texStorage3D(_gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, mipmaps[0].width, mipmaps[0].height, image.depth); - } - for (let i = 0, il = mipmaps.length; i < il; i++) { - mipmap = mipmaps[i]; - if (texture.format !== RGBAFormat) { - if (glFormat !== null) { - if (useTexStorage) { - if (dataReady) { - if (texture.layerUpdates.size > 0) { - const layerByteLength = getByteLength(mipmap.width, mipmap.height, texture.format, texture.type); - for (const layerIndex of texture.layerUpdates) { - const layerData = mipmap.data.subarray( - layerIndex * layerByteLength / mipmap.data.BYTES_PER_ELEMENT, - (layerIndex + 1) * layerByteLength / mipmap.data.BYTES_PER_ELEMENT - ); - state.compressedTexSubImage3D(_gl.TEXTURE_2D_ARRAY, i, 0, 0, layerIndex, mipmap.width, mipmap.height, 1, glFormat, layerData); - } - texture.clearLayerUpdates(); - } else { - state.compressedTexSubImage3D(_gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, mipmap.data); - } - } - } else { - state.compressedTexImage3D(_gl.TEXTURE_2D_ARRAY, i, glInternalFormat, mipmap.width, mipmap.height, image.depth, 0, mipmap.data, 0, 0); - } - } else { - console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"); - } - } else { - if (useTexStorage) { - if (dataReady) { - state.texSubImage3D(_gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, glType, mipmap.data); - } - } else { - state.texImage3D(_gl.TEXTURE_2D_ARRAY, i, glInternalFormat, mipmap.width, mipmap.height, image.depth, 0, glFormat, glType, mipmap.data); - } - } - } - } else { - if (useTexStorage && allocateMemory) { - state.texStorage2D(_gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[0].width, mipmaps[0].height); - } - for (let i = 0, il = mipmaps.length; i < il; i++) { - mipmap = mipmaps[i]; - if (texture.format !== RGBAFormat) { - if (glFormat !== null) { - if (useTexStorage) { - if (dataReady) { - state.compressedTexSubImage2D(_gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data); - } - } else { - state.compressedTexImage2D(_gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data); - } - } else { - console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"); - } - } else { - if (useTexStorage) { - if (dataReady) { - state.texSubImage2D(_gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data); - } - } else { - state.texImage2D(_gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data); - } - } - } - } - } else if (texture.isDataArrayTexture) { - if (useTexStorage) { - if (allocateMemory) { - state.texStorage3D(_gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, image.width, image.height, image.depth); - } - if (dataReady) { - if (texture.layerUpdates.size > 0) { - const layerByteLength = getByteLength(image.width, image.height, texture.format, texture.type); - for (const layerIndex of texture.layerUpdates) { - const layerData = image.data.subarray( - layerIndex * layerByteLength / image.data.BYTES_PER_ELEMENT, - (layerIndex + 1) * layerByteLength / image.data.BYTES_PER_ELEMENT - ); - state.texSubImage3D(_gl.TEXTURE_2D_ARRAY, 0, 0, 0, layerIndex, image.width, image.height, 1, glFormat, glType, layerData); - } - texture.clearLayerUpdates(); - } else { - state.texSubImage3D(_gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data); - } - } - } else { - state.texImage3D(_gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data); - } - } else if (texture.isData3DTexture) { - if (useTexStorage) { - if (allocateMemory) { - state.texStorage3D(_gl.TEXTURE_3D, levels, glInternalFormat, image.width, image.height, image.depth); - } - if (dataReady) { - state.texSubImage3D(_gl.TEXTURE_3D, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data); - } - } else { - state.texImage3D(_gl.TEXTURE_3D, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data); - } - } else if (texture.isFramebufferTexture) { - if (allocateMemory) { - if (useTexStorage) { - state.texStorage2D(_gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height); - } else { - let width = image.width, height = image.height; - for (let i = 0; i < levels; i++) { - state.texImage2D(_gl.TEXTURE_2D, i, glInternalFormat, width, height, 0, glFormat, glType, null); - width >>= 1; - height >>= 1; - } - } - } - } else { - if (mipmaps.length > 0) { - if (useTexStorage && allocateMemory) { - const dimensions = getDimensions(mipmaps[0]); - state.texStorage2D(_gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height); - } - for (let i = 0, il = mipmaps.length; i < il; i++) { - mipmap = mipmaps[i]; - if (useTexStorage) { - if (dataReady) { - state.texSubImage2D(_gl.TEXTURE_2D, i, 0, 0, glFormat, glType, mipmap); - } - } else { - state.texImage2D(_gl.TEXTURE_2D, i, glInternalFormat, glFormat, glType, mipmap); - } - } - texture.generateMipmaps = false; - } else { - if (useTexStorage) { - if (allocateMemory) { - const dimensions = getDimensions(image); - state.texStorage2D(_gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height); - } - if (dataReady) { - state.texSubImage2D(_gl.TEXTURE_2D, 0, 0, 0, glFormat, glType, image); - } - } else { - state.texImage2D(_gl.TEXTURE_2D, 0, glInternalFormat, glFormat, glType, image); - } - } - } - if (textureNeedsGenerateMipmaps(texture)) { - generateMipmap(textureType); - } - sourceProperties.__version = source.version; - if (texture.onUpdate) texture.onUpdate(texture); - } - textureProperties.__version = texture.version; - } - __name(uploadTexture, "uploadTexture"); - function uploadCubeTexture(textureProperties, texture, slot) { - if (texture.image.length !== 6) return; - const forceUpload = initTexture(textureProperties, texture); - const source = texture.source; - state.bindTexture(_gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture, _gl.TEXTURE0 + slot); - const sourceProperties = properties.get(source); - if (source.version !== sourceProperties.__version || forceUpload === true) { - state.activeTexture(_gl.TEXTURE0 + slot); - const workingPrimaries = ColorManagement.getPrimaries(ColorManagement.workingColorSpace); - const texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries(texture.colorSpace); - const unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL; - _gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY); - _gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha); - _gl.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment); - _gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion); - const isCompressed = texture.isCompressedTexture || texture.image[0].isCompressedTexture; - const isDataTexture = texture.image[0] && texture.image[0].isDataTexture; - const cubeImage = []; - for (let i = 0; i < 6; i++) { - if (!isCompressed && !isDataTexture) { - cubeImage[i] = resizeImage(texture.image[i], true, capabilities.maxCubemapSize); - } else { - cubeImage[i] = isDataTexture ? texture.image[i].image : texture.image[i]; - } - cubeImage[i] = verifyColorSpace(texture, cubeImage[i]); - } - const image = cubeImage[0], glFormat = utils.convert(texture.format, texture.colorSpace), glType = utils.convert(texture.type), glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.colorSpace); - const useTexStorage = texture.isVideoTexture !== true; - const allocateMemory = sourceProperties.__version === void 0 || forceUpload === true; - const dataReady = source.dataReady; - let levels = getMipLevels(texture, image); - setTextureParameters(_gl.TEXTURE_CUBE_MAP, texture); - let mipmaps; - if (isCompressed) { - if (useTexStorage && allocateMemory) { - state.texStorage2D(_gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, image.width, image.height); - } - for (let i = 0; i < 6; i++) { - mipmaps = cubeImage[i].mipmaps; - for (let j = 0; j < mipmaps.length; j++) { - const mipmap = mipmaps[j]; - if (texture.format !== RGBAFormat) { - if (glFormat !== null) { - if (useTexStorage) { - if (dataReady) { - state.compressedTexSubImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data); - } - } else { - state.compressedTexImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data); - } - } else { - console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"); - } - } else { - if (useTexStorage) { - if (dataReady) { - state.texSubImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data); - } - } else { - state.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data); - } - } - } - } - } else { - mipmaps = texture.mipmaps; - if (useTexStorage && allocateMemory) { - if (mipmaps.length > 0) levels++; - const dimensions = getDimensions(cubeImage[0]); - state.texStorage2D(_gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, dimensions.width, dimensions.height); - } - for (let i = 0; i < 6; i++) { - if (isDataTexture) { - if (useTexStorage) { - if (dataReady) { - state.texSubImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, cubeImage[i].width, cubeImage[i].height, glFormat, glType, cubeImage[i].data); - } - } else { - state.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, cubeImage[i].width, cubeImage[i].height, 0, glFormat, glType, cubeImage[i].data); - } - for (let j = 0; j < mipmaps.length; j++) { - const mipmap = mipmaps[j]; - const mipmapImage = mipmap.image[i].image; - if (useTexStorage) { - if (dataReady) { - state.texSubImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, mipmapImage.width, mipmapImage.height, glFormat, glType, mipmapImage.data); - } - } else { - state.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, mipmapImage.width, mipmapImage.height, 0, glFormat, glType, mipmapImage.data); - } - } - } else { - if (useTexStorage) { - if (dataReady) { - state.texSubImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, glFormat, glType, cubeImage[i]); - } - } else { - state.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, glFormat, glType, cubeImage[i]); - } - for (let j = 0; j < mipmaps.length; j++) { - const mipmap = mipmaps[j]; - if (useTexStorage) { - if (dataReady) { - state.texSubImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, glFormat, glType, mipmap.image[i]); - } - } else { - state.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, glFormat, glType, mipmap.image[i]); - } - } - } - } - } - if (textureNeedsGenerateMipmaps(texture)) { - generateMipmap(_gl.TEXTURE_CUBE_MAP); - } - sourceProperties.__version = source.version; - if (texture.onUpdate) texture.onUpdate(texture); - } - textureProperties.__version = texture.version; - } - __name(uploadCubeTexture, "uploadCubeTexture"); - function setupFrameBufferTexture(framebuffer, renderTarget, texture, attachment, textureTarget, level) { - const glFormat = utils.convert(texture.format, texture.colorSpace); - const glType = utils.convert(texture.type); - const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.colorSpace); - const renderTargetProperties = properties.get(renderTarget); - const textureProperties = properties.get(texture); - textureProperties.__renderTarget = renderTarget; - if (!renderTargetProperties.__hasExternalTextures) { - const width = Math.max(1, renderTarget.width >> level); - const height = Math.max(1, renderTarget.height >> level); - if (textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY) { - state.texImage3D(textureTarget, level, glInternalFormat, width, height, renderTarget.depth, 0, glFormat, glType, null); - } else { - state.texImage2D(textureTarget, level, glInternalFormat, width, height, 0, glFormat, glType, null); - } - } - state.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer); - if (useMultisampledRTT(renderTarget)) { - multisampledRTTExt.framebufferTexture2DMultisampleEXT(_gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, 0, getRenderTargetSamples(renderTarget)); - } else if (textureTarget === _gl.TEXTURE_2D || textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z) { - _gl.framebufferTexture2D(_gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, level); - } - state.bindFramebuffer(_gl.FRAMEBUFFER, null); - } - __name(setupFrameBufferTexture, "setupFrameBufferTexture"); - function setupRenderBufferStorage(renderbuffer, renderTarget, isMultisample) { - _gl.bindRenderbuffer(_gl.RENDERBUFFER, renderbuffer); - if (renderTarget.depthBuffer) { - const depthTexture = renderTarget.depthTexture; - const depthType = depthTexture && depthTexture.isDepthTexture ? depthTexture.type : null; - const glInternalFormat = getInternalDepthFormat(renderTarget.stencilBuffer, depthType); - const glAttachmentType = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT; - const samples = getRenderTargetSamples(renderTarget); - const isUseMultisampledRTT = useMultisampledRTT(renderTarget); - if (isUseMultisampledRTT) { - multisampledRTTExt.renderbufferStorageMultisampleEXT(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height); - } else if (isMultisample) { - _gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height); - } else { - _gl.renderbufferStorage(_gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height); - } - _gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, glAttachmentType, _gl.RENDERBUFFER, renderbuffer); - } else { - const textures = renderTarget.textures; - for (let i = 0; i < textures.length; i++) { - const texture = textures[i]; - const glFormat = utils.convert(texture.format, texture.colorSpace); - const glType = utils.convert(texture.type); - const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.colorSpace); - const samples = getRenderTargetSamples(renderTarget); - if (isMultisample && useMultisampledRTT(renderTarget) === false) { - _gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height); - } else if (useMultisampledRTT(renderTarget)) { - multisampledRTTExt.renderbufferStorageMultisampleEXT(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height); - } else { - _gl.renderbufferStorage(_gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height); - } - } - } - _gl.bindRenderbuffer(_gl.RENDERBUFFER, null); - } - __name(setupRenderBufferStorage, "setupRenderBufferStorage"); - function setupDepthTexture(framebuffer, renderTarget) { - const isCube = renderTarget && renderTarget.isWebGLCubeRenderTarget; - if (isCube) throw new Error("Depth Texture with cube render targets is not supported"); - state.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer); - if (!(renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture)) { - throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture"); - } - const textureProperties = properties.get(renderTarget.depthTexture); - textureProperties.__renderTarget = renderTarget; - if (!textureProperties.__webglTexture || renderTarget.depthTexture.image.width !== renderTarget.width || renderTarget.depthTexture.image.height !== renderTarget.height) { - renderTarget.depthTexture.image.width = renderTarget.width; - renderTarget.depthTexture.image.height = renderTarget.height; - renderTarget.depthTexture.needsUpdate = true; - } - setTexture2D(renderTarget.depthTexture, 0); - const webglDepthTexture = textureProperties.__webglTexture; - const samples = getRenderTargetSamples(renderTarget); - if (renderTarget.depthTexture.format === DepthFormat) { - if (useMultisampledRTT(renderTarget)) { - multisampledRTTExt.framebufferTexture2DMultisampleEXT(_gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples); - } else { - _gl.framebufferTexture2D(_gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0); - } - } else if (renderTarget.depthTexture.format === DepthStencilFormat) { - if (useMultisampledRTT(renderTarget)) { - multisampledRTTExt.framebufferTexture2DMultisampleEXT(_gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples); - } else { - _gl.framebufferTexture2D(_gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0); - } - } else { - throw new Error("Unknown depthTexture format"); - } - } - __name(setupDepthTexture, "setupDepthTexture"); - function setupDepthRenderbuffer(renderTarget) { - const renderTargetProperties = properties.get(renderTarget); - const isCube = renderTarget.isWebGLCubeRenderTarget === true; - if (renderTargetProperties.__boundDepthTexture !== renderTarget.depthTexture) { - const depthTexture = renderTarget.depthTexture; - if (renderTargetProperties.__depthDisposeCallback) { - renderTargetProperties.__depthDisposeCallback(); - } - if (depthTexture) { - const disposeEvent = /* @__PURE__ */ __name(() => { - delete renderTargetProperties.__boundDepthTexture; - delete renderTargetProperties.__depthDisposeCallback; - depthTexture.removeEventListener("dispose", disposeEvent); - }, "disposeEvent"); - depthTexture.addEventListener("dispose", disposeEvent); - renderTargetProperties.__depthDisposeCallback = disposeEvent; - } - renderTargetProperties.__boundDepthTexture = depthTexture; - } - if (renderTarget.depthTexture && !renderTargetProperties.__autoAllocateDepthBuffer) { - if (isCube) throw new Error("target.depthTexture not supported in Cube render targets"); - setupDepthTexture(renderTargetProperties.__webglFramebuffer, renderTarget); - } else { - if (isCube) { - renderTargetProperties.__webglDepthbuffer = []; - for (let i = 0; i < 6; i++) { - state.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[i]); - if (renderTargetProperties.__webglDepthbuffer[i] === void 0) { - renderTargetProperties.__webglDepthbuffer[i] = _gl.createRenderbuffer(); - setupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer[i], renderTarget, false); - } else { - const glAttachmentType = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT; - const renderbuffer = renderTargetProperties.__webglDepthbuffer[i]; - _gl.bindRenderbuffer(_gl.RENDERBUFFER, renderbuffer); - _gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, glAttachmentType, _gl.RENDERBUFFER, renderbuffer); - } - } - } else { - state.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer); - if (renderTargetProperties.__webglDepthbuffer === void 0) { - renderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer(); - setupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer, renderTarget, false); - } else { - const glAttachmentType = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT; - const renderbuffer = renderTargetProperties.__webglDepthbuffer; - _gl.bindRenderbuffer(_gl.RENDERBUFFER, renderbuffer); - _gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, glAttachmentType, _gl.RENDERBUFFER, renderbuffer); - } - } - } - state.bindFramebuffer(_gl.FRAMEBUFFER, null); - } - __name(setupDepthRenderbuffer, "setupDepthRenderbuffer"); - function rebindTextures(renderTarget, colorTexture, depthTexture) { - const renderTargetProperties = properties.get(renderTarget); - if (colorTexture !== void 0) { - setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, 0); - } - if (depthTexture !== void 0) { - setupDepthRenderbuffer(renderTarget); - } - } - __name(rebindTextures, "rebindTextures"); - function setupRenderTarget(renderTarget) { - const texture = renderTarget.texture; - const renderTargetProperties = properties.get(renderTarget); - const textureProperties = properties.get(texture); - renderTarget.addEventListener("dispose", onRenderTargetDispose); - const textures = renderTarget.textures; - const isCube = renderTarget.isWebGLCubeRenderTarget === true; - const isMultipleRenderTargets = textures.length > 1; - if (!isMultipleRenderTargets) { - if (textureProperties.__webglTexture === void 0) { - textureProperties.__webglTexture = _gl.createTexture(); - } - textureProperties.__version = texture.version; - info.memory.textures++; - } - if (isCube) { - renderTargetProperties.__webglFramebuffer = []; - for (let i = 0; i < 6; i++) { - if (texture.mipmaps && texture.mipmaps.length > 0) { - renderTargetProperties.__webglFramebuffer[i] = []; - for (let level = 0; level < texture.mipmaps.length; level++) { - renderTargetProperties.__webglFramebuffer[i][level] = _gl.createFramebuffer(); - } - } else { - renderTargetProperties.__webglFramebuffer[i] = _gl.createFramebuffer(); - } - } - } else { - if (texture.mipmaps && texture.mipmaps.length > 0) { - renderTargetProperties.__webglFramebuffer = []; - for (let level = 0; level < texture.mipmaps.length; level++) { - renderTargetProperties.__webglFramebuffer[level] = _gl.createFramebuffer(); - } - } else { - renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); - } - if (isMultipleRenderTargets) { - for (let i = 0, il = textures.length; i < il; i++) { - const attachmentProperties = properties.get(textures[i]); - if (attachmentProperties.__webglTexture === void 0) { - attachmentProperties.__webglTexture = _gl.createTexture(); - info.memory.textures++; - } - } - } - if (renderTarget.samples > 0 && useMultisampledRTT(renderTarget) === false) { - renderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer(); - renderTargetProperties.__webglColorRenderbuffer = []; - state.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer); - for (let i = 0; i < textures.length; i++) { - const texture2 = textures[i]; - renderTargetProperties.__webglColorRenderbuffer[i] = _gl.createRenderbuffer(); - _gl.bindRenderbuffer(_gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[i]); - const glFormat = utils.convert(texture2.format, texture2.colorSpace); - const glType = utils.convert(texture2.type); - const glInternalFormat = getInternalFormat(texture2.internalFormat, glFormat, glType, texture2.colorSpace, renderTarget.isXRRenderTarget === true); - const samples = getRenderTargetSamples(renderTarget); - _gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height); - _gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[i]); - } - _gl.bindRenderbuffer(_gl.RENDERBUFFER, null); - if (renderTarget.depthBuffer) { - renderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer(); - setupRenderBufferStorage(renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true); - } - state.bindFramebuffer(_gl.FRAMEBUFFER, null); - } - } - if (isCube) { - state.bindTexture(_gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture); - setTextureParameters(_gl.TEXTURE_CUBE_MAP, texture); - for (let i = 0; i < 6; i++) { - if (texture.mipmaps && texture.mipmaps.length > 0) { - for (let level = 0; level < texture.mipmaps.length; level++) { - setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer[i][level], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, level); - } - } else { - setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer[i], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0); - } - } - if (textureNeedsGenerateMipmaps(texture)) { - generateMipmap(_gl.TEXTURE_CUBE_MAP); - } - state.unbindTexture(); - } else if (isMultipleRenderTargets) { - for (let i = 0, il = textures.length; i < il; i++) { - const attachment = textures[i]; - const attachmentProperties = properties.get(attachment); - state.bindTexture(_gl.TEXTURE_2D, attachmentProperties.__webglTexture); - setTextureParameters(_gl.TEXTURE_2D, attachment); - setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, 0); - if (textureNeedsGenerateMipmaps(attachment)) { - generateMipmap(_gl.TEXTURE_2D); - } - } - state.unbindTexture(); - } else { - let glTextureType = _gl.TEXTURE_2D; - if (renderTarget.isWebGL3DRenderTarget || renderTarget.isWebGLArrayRenderTarget) { - glTextureType = renderTarget.isWebGL3DRenderTarget ? _gl.TEXTURE_3D : _gl.TEXTURE_2D_ARRAY; - } - state.bindTexture(glTextureType, textureProperties.__webglTexture); - setTextureParameters(glTextureType, texture); - if (texture.mipmaps && texture.mipmaps.length > 0) { - for (let level = 0; level < texture.mipmaps.length; level++) { - setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer[level], renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, level); - } - } else { - setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, 0); - } - if (textureNeedsGenerateMipmaps(texture)) { - generateMipmap(glTextureType); - } - state.unbindTexture(); - } - if (renderTarget.depthBuffer) { - setupDepthRenderbuffer(renderTarget); - } - } - __name(setupRenderTarget, "setupRenderTarget"); - function updateRenderTargetMipmap(renderTarget) { - const textures = renderTarget.textures; - for (let i = 0, il = textures.length; i < il; i++) { - const texture = textures[i]; - if (textureNeedsGenerateMipmaps(texture)) { - const targetType = getTargetType(renderTarget); - const webglTexture = properties.get(texture).__webglTexture; - state.bindTexture(targetType, webglTexture); - generateMipmap(targetType); - state.unbindTexture(); - } - } - } - __name(updateRenderTargetMipmap, "updateRenderTargetMipmap"); - const invalidationArrayRead = []; - const invalidationArrayDraw = []; - function updateMultisampleRenderTarget(renderTarget) { - if (renderTarget.samples > 0) { - if (useMultisampledRTT(renderTarget) === false) { - const textures = renderTarget.textures; - const width = renderTarget.width; - const height = renderTarget.height; - let mask = _gl.COLOR_BUFFER_BIT; - const depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT; - const renderTargetProperties = properties.get(renderTarget); - const isMultipleRenderTargets = textures.length > 1; - if (isMultipleRenderTargets) { - for (let i = 0; i < textures.length; i++) { - state.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer); - _gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, null); - state.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer); - _gl.framebufferTexture2D(_gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, null, 0); - } - } - state.bindFramebuffer(_gl.READ_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer); - state.bindFramebuffer(_gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglFramebuffer); - for (let i = 0; i < textures.length; i++) { - if (renderTarget.resolveDepthBuffer) { - if (renderTarget.depthBuffer) mask |= _gl.DEPTH_BUFFER_BIT; - if (renderTarget.stencilBuffer && renderTarget.resolveStencilBuffer) mask |= _gl.STENCIL_BUFFER_BIT; - } - if (isMultipleRenderTargets) { - _gl.framebufferRenderbuffer(_gl.READ_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[i]); - const webglTexture = properties.get(textures[i]).__webglTexture; - _gl.framebufferTexture2D(_gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, webglTexture, 0); - } - _gl.blitFramebuffer(0, 0, width, height, 0, 0, width, height, mask, _gl.NEAREST); - if (supportsInvalidateFramebuffer === true) { - invalidationArrayRead.length = 0; - invalidationArrayDraw.length = 0; - invalidationArrayRead.push(_gl.COLOR_ATTACHMENT0 + i); - if (renderTarget.depthBuffer && renderTarget.resolveDepthBuffer === false) { - invalidationArrayRead.push(depthStyle); - invalidationArrayDraw.push(depthStyle); - _gl.invalidateFramebuffer(_gl.DRAW_FRAMEBUFFER, invalidationArrayDraw); - } - _gl.invalidateFramebuffer(_gl.READ_FRAMEBUFFER, invalidationArrayRead); - } - } - state.bindFramebuffer(_gl.READ_FRAMEBUFFER, null); - state.bindFramebuffer(_gl.DRAW_FRAMEBUFFER, null); - if (isMultipleRenderTargets) { - for (let i = 0; i < textures.length; i++) { - state.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer); - _gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[i]); - const webglTexture = properties.get(textures[i]).__webglTexture; - state.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer); - _gl.framebufferTexture2D(_gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, webglTexture, 0); - } - } - state.bindFramebuffer(_gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer); - } else { - if (renderTarget.depthBuffer && renderTarget.resolveDepthBuffer === false && supportsInvalidateFramebuffer) { - const depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT; - _gl.invalidateFramebuffer(_gl.DRAW_FRAMEBUFFER, [depthStyle]); - } - } - } - } - __name(updateMultisampleRenderTarget, "updateMultisampleRenderTarget"); - function getRenderTargetSamples(renderTarget) { - return Math.min(capabilities.maxSamples, renderTarget.samples); - } - __name(getRenderTargetSamples, "getRenderTargetSamples"); - function useMultisampledRTT(renderTarget) { - const renderTargetProperties = properties.get(renderTarget); - return renderTarget.samples > 0 && extensions.has("WEBGL_multisampled_render_to_texture") === true && renderTargetProperties.__useRenderToTexture !== false; - } - __name(useMultisampledRTT, "useMultisampledRTT"); - function updateVideoTexture(texture) { - const frame = info.render.frame; - if (_videoTextures.get(texture) !== frame) { - _videoTextures.set(texture, frame); - texture.update(); - } - } - __name(updateVideoTexture, "updateVideoTexture"); - function verifyColorSpace(texture, image) { - const colorSpace = texture.colorSpace; - const format = texture.format; - const type = texture.type; - if (texture.isCompressedTexture === true || texture.isVideoTexture === true) return image; - if (colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace) { - if (ColorManagement.getTransfer(colorSpace) === SRGBTransfer) { - if (format !== RGBAFormat || type !== UnsignedByteType) { - console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."); - } - } else { - console.error("THREE.WebGLTextures: Unsupported texture color space:", colorSpace); - } - } - return image; - } - __name(verifyColorSpace, "verifyColorSpace"); - function getDimensions(image) { - if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement) { - _imageDimensions.width = image.naturalWidth || image.width; - _imageDimensions.height = image.naturalHeight || image.height; - } else if (typeof VideoFrame !== "undefined" && image instanceof VideoFrame) { - _imageDimensions.width = image.displayWidth; - _imageDimensions.height = image.displayHeight; - } else { - _imageDimensions.width = image.width; - _imageDimensions.height = image.height; - } - return _imageDimensions; - } - __name(getDimensions, "getDimensions"); - this.allocateTextureUnit = allocateTextureUnit; - this.resetTextureUnits = resetTextureUnits; - this.setTexture2D = setTexture2D; - this.setTexture2DArray = setTexture2DArray; - this.setTexture3D = setTexture3D; - this.setTextureCube = setTextureCube; - this.rebindTextures = rebindTextures; - this.setupRenderTarget = setupRenderTarget; - this.updateRenderTargetMipmap = updateRenderTargetMipmap; - this.updateMultisampleRenderTarget = updateMultisampleRenderTarget; - this.setupDepthRenderbuffer = setupDepthRenderbuffer; - this.setupFrameBufferTexture = setupFrameBufferTexture; - this.useMultisampledRTT = useMultisampledRTT; -} -__name(WebGLTextures, "WebGLTextures"); -function WebGLUtils(gl, extensions) { - function convert(p, colorSpace = NoColorSpace) { - let extension; - const transfer = ColorManagement.getTransfer(colorSpace); - if (p === UnsignedByteType) return gl.UNSIGNED_BYTE; - if (p === UnsignedShort4444Type) return gl.UNSIGNED_SHORT_4_4_4_4; - if (p === UnsignedShort5551Type) return gl.UNSIGNED_SHORT_5_5_5_1; - if (p === UnsignedInt5999Type) return gl.UNSIGNED_INT_5_9_9_9_REV; - if (p === ByteType) return gl.BYTE; - if (p === ShortType) return gl.SHORT; - if (p === UnsignedShortType) return gl.UNSIGNED_SHORT; - if (p === IntType) return gl.INT; - if (p === UnsignedIntType) return gl.UNSIGNED_INT; - if (p === FloatType) return gl.FLOAT; - if (p === HalfFloatType) return gl.HALF_FLOAT; - if (p === AlphaFormat) return gl.ALPHA; - if (p === RGBFormat) return gl.RGB; - if (p === RGBAFormat) return gl.RGBA; - if (p === LuminanceFormat) return gl.LUMINANCE; - if (p === LuminanceAlphaFormat) return gl.LUMINANCE_ALPHA; - if (p === DepthFormat) return gl.DEPTH_COMPONENT; - if (p === DepthStencilFormat) return gl.DEPTH_STENCIL; - if (p === RedFormat) return gl.RED; - if (p === RedIntegerFormat) return gl.RED_INTEGER; - if (p === RGFormat) return gl.RG; - if (p === RGIntegerFormat) return gl.RG_INTEGER; - if (p === RGBAIntegerFormat) return gl.RGBA_INTEGER; - if (p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format) { - if (transfer === SRGBTransfer) { - extension = extensions.get("WEBGL_compressed_texture_s3tc_srgb"); - if (extension !== null) { - if (p === RGB_S3TC_DXT1_Format) return extension.COMPRESSED_SRGB_S3TC_DXT1_EXT; - if (p === RGBA_S3TC_DXT1_Format) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; - if (p === RGBA_S3TC_DXT3_Format) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; - if (p === RGBA_S3TC_DXT5_Format) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; - } else { - return null; - } - } else { - extension = extensions.get("WEBGL_compressed_texture_s3tc"); - if (extension !== null) { - if (p === RGB_S3TC_DXT1_Format) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT; - if (p === RGBA_S3TC_DXT1_Format) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT; - if (p === RGBA_S3TC_DXT3_Format) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT; - if (p === RGBA_S3TC_DXT5_Format) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT; - } else { - return null; - } - } - } - if (p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format) { - extension = extensions.get("WEBGL_compressed_texture_pvrtc"); - if (extension !== null) { - if (p === RGB_PVRTC_4BPPV1_Format) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; - if (p === RGB_PVRTC_2BPPV1_Format) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; - if (p === RGBA_PVRTC_4BPPV1_Format) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - if (p === RGBA_PVRTC_2BPPV1_Format) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; - } else { - return null; - } - } - if (p === RGB_ETC1_Format || p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format) { - extension = extensions.get("WEBGL_compressed_texture_etc"); - if (extension !== null) { - if (p === RGB_ETC1_Format || p === RGB_ETC2_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2; - if (p === RGBA_ETC2_EAC_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC; - } else { - return null; - } - } - if (p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format || p === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format || p === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format || p === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format || p === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format) { - extension = extensions.get("WEBGL_compressed_texture_astc"); - if (extension !== null) { - if (p === RGBA_ASTC_4x4_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR; - if (p === RGBA_ASTC_5x4_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR; - if (p === RGBA_ASTC_5x5_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR; - if (p === RGBA_ASTC_6x5_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR; - if (p === RGBA_ASTC_6x6_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR; - if (p === RGBA_ASTC_8x5_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR; - if (p === RGBA_ASTC_8x6_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR; - if (p === RGBA_ASTC_8x8_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR; - if (p === RGBA_ASTC_10x5_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR; - if (p === RGBA_ASTC_10x6_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR; - if (p === RGBA_ASTC_10x8_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR; - if (p === RGBA_ASTC_10x10_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR; - if (p === RGBA_ASTC_12x10_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR; - if (p === RGBA_ASTC_12x12_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR; - } else { - return null; - } - } - if (p === RGBA_BPTC_Format || p === RGB_BPTC_SIGNED_Format || p === RGB_BPTC_UNSIGNED_Format) { - extension = extensions.get("EXT_texture_compression_bptc"); - if (extension !== null) { - if (p === RGBA_BPTC_Format) return transfer === SRGBTransfer ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT; - if (p === RGB_BPTC_SIGNED_Format) return extension.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT; - if (p === RGB_BPTC_UNSIGNED_Format) return extension.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT; - } else { - return null; - } - } - if (p === RED_RGTC1_Format || p === SIGNED_RED_RGTC1_Format || p === RED_GREEN_RGTC2_Format || p === SIGNED_RED_GREEN_RGTC2_Format) { - extension = extensions.get("EXT_texture_compression_rgtc"); - if (extension !== null) { - if (p === RGBA_BPTC_Format) return extension.COMPRESSED_RED_RGTC1_EXT; - if (p === SIGNED_RED_RGTC1_Format) return extension.COMPRESSED_SIGNED_RED_RGTC1_EXT; - if (p === RED_GREEN_RGTC2_Format) return extension.COMPRESSED_RED_GREEN_RGTC2_EXT; - if (p === SIGNED_RED_GREEN_RGTC2_Format) return extension.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT; - } else { - return null; - } - } - if (p === UnsignedInt248Type) return gl.UNSIGNED_INT_24_8; - return gl[p] !== void 0 ? gl[p] : null; - } - __name(convert, "convert"); - return { convert }; -} -__name(WebGLUtils, "WebGLUtils"); -class ArrayCamera extends PerspectiveCamera { - static { - __name(this, "ArrayCamera"); - } - constructor(array = []) { - super(); - this.isArrayCamera = true; - this.cameras = array; - } -} -class Group extends Object3D { - static { - __name(this, "Group"); - } - constructor() { - super(); - this.isGroup = true; - this.type = "Group"; - } -} -const _moveEvent = { type: "move" }; -class WebXRController { - static { - __name(this, "WebXRController"); - } - constructor() { - this._targetRay = null; - this._grip = null; - this._hand = null; - } - getHandSpace() { - if (this._hand === null) { - this._hand = new Group(); - this._hand.matrixAutoUpdate = false; - this._hand.visible = false; - this._hand.joints = {}; - this._hand.inputState = { pinching: false }; - } - return this._hand; - } - getTargetRaySpace() { - if (this._targetRay === null) { - this._targetRay = new Group(); - this._targetRay.matrixAutoUpdate = false; - this._targetRay.visible = false; - this._targetRay.hasLinearVelocity = false; - this._targetRay.linearVelocity = new Vector3(); - this._targetRay.hasAngularVelocity = false; - this._targetRay.angularVelocity = new Vector3(); - } - return this._targetRay; - } - getGripSpace() { - if (this._grip === null) { - this._grip = new Group(); - this._grip.matrixAutoUpdate = false; - this._grip.visible = false; - this._grip.hasLinearVelocity = false; - this._grip.linearVelocity = new Vector3(); - this._grip.hasAngularVelocity = false; - this._grip.angularVelocity = new Vector3(); - } - return this._grip; - } - dispatchEvent(event) { - if (this._targetRay !== null) { - this._targetRay.dispatchEvent(event); - } - if (this._grip !== null) { - this._grip.dispatchEvent(event); - } - if (this._hand !== null) { - this._hand.dispatchEvent(event); - } - return this; - } - connect(inputSource) { - if (inputSource && inputSource.hand) { - const hand = this._hand; - if (hand) { - for (const inputjoint of inputSource.hand.values()) { - this._getHandJoint(hand, inputjoint); - } - } - } - this.dispatchEvent({ type: "connected", data: inputSource }); - return this; - } - disconnect(inputSource) { - this.dispatchEvent({ type: "disconnected", data: inputSource }); - if (this._targetRay !== null) { - this._targetRay.visible = false; - } - if (this._grip !== null) { - this._grip.visible = false; - } - if (this._hand !== null) { - this._hand.visible = false; - } - return this; - } - update(inputSource, frame, referenceSpace) { - let inputPose = null; - let gripPose = null; - let handPose = null; - const targetRay = this._targetRay; - const grip = this._grip; - const hand = this._hand; - if (inputSource && frame.session.visibilityState !== "visible-blurred") { - if (hand && inputSource.hand) { - handPose = true; - for (const inputjoint of inputSource.hand.values()) { - const jointPose = frame.getJointPose(inputjoint, referenceSpace); - const joint = this._getHandJoint(hand, inputjoint); - if (jointPose !== null) { - joint.matrix.fromArray(jointPose.transform.matrix); - joint.matrix.decompose(joint.position, joint.rotation, joint.scale); - joint.matrixWorldNeedsUpdate = true; - joint.jointRadius = jointPose.radius; - } - joint.visible = jointPose !== null; - } - const indexTip = hand.joints["index-finger-tip"]; - const thumbTip = hand.joints["thumb-tip"]; - const distance = indexTip.position.distanceTo(thumbTip.position); - const distanceToPinch = 0.02; - const threshold = 5e-3; - if (hand.inputState.pinching && distance > distanceToPinch + threshold) { - hand.inputState.pinching = false; - this.dispatchEvent({ - type: "pinchend", - handedness: inputSource.handedness, - target: this - }); - } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) { - hand.inputState.pinching = true; - this.dispatchEvent({ - type: "pinchstart", - handedness: inputSource.handedness, - target: this - }); - } - } else { - if (grip !== null && inputSource.gripSpace) { - gripPose = frame.getPose(inputSource.gripSpace, referenceSpace); - if (gripPose !== null) { - grip.matrix.fromArray(gripPose.transform.matrix); - grip.matrix.decompose(grip.position, grip.rotation, grip.scale); - grip.matrixWorldNeedsUpdate = true; - if (gripPose.linearVelocity) { - grip.hasLinearVelocity = true; - grip.linearVelocity.copy(gripPose.linearVelocity); - } else { - grip.hasLinearVelocity = false; - } - if (gripPose.angularVelocity) { - grip.hasAngularVelocity = true; - grip.angularVelocity.copy(gripPose.angularVelocity); - } else { - grip.hasAngularVelocity = false; - } - } - } - } - if (targetRay !== null) { - inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace); - if (inputPose === null && gripPose !== null) { - inputPose = gripPose; - } - if (inputPose !== null) { - targetRay.matrix.fromArray(inputPose.transform.matrix); - targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale); - targetRay.matrixWorldNeedsUpdate = true; - if (inputPose.linearVelocity) { - targetRay.hasLinearVelocity = true; - targetRay.linearVelocity.copy(inputPose.linearVelocity); - } else { - targetRay.hasLinearVelocity = false; - } - if (inputPose.angularVelocity) { - targetRay.hasAngularVelocity = true; - targetRay.angularVelocity.copy(inputPose.angularVelocity); - } else { - targetRay.hasAngularVelocity = false; - } - this.dispatchEvent(_moveEvent); - } - } - } - if (targetRay !== null) { - targetRay.visible = inputPose !== null; - } - if (grip !== null) { - grip.visible = gripPose !== null; - } - if (hand !== null) { - hand.visible = handPose !== null; - } - return this; - } - // private method - _getHandJoint(hand, inputjoint) { - if (hand.joints[inputjoint.jointName] === void 0) { - const joint = new Group(); - joint.matrixAutoUpdate = false; - joint.visible = false; - hand.joints[inputjoint.jointName] = joint; - hand.add(joint); - } - return hand.joints[inputjoint.jointName]; - } -} -const _occlusion_vertex = ` -void main() { - - gl_Position = vec4( position, 1.0 ); - -}`; -const _occlusion_fragment = ` -uniform sampler2DArray depthColor; -uniform float depthWidth; -uniform float depthHeight; - -void main() { - - vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); - - if ( coord.x >= 1.0 ) { - - gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`; -class WebXRDepthSensing { - static { - __name(this, "WebXRDepthSensing"); - } - constructor() { - this.texture = null; - this.mesh = null; - this.depthNear = 0; - this.depthFar = 0; - } - init(renderer, depthData, renderState) { - if (this.texture === null) { - const texture = new Texture(); - const texProps = renderer.properties.get(texture); - texProps.__webglTexture = depthData.texture; - if (depthData.depthNear != renderState.depthNear || depthData.depthFar != renderState.depthFar) { - this.depthNear = depthData.depthNear; - this.depthFar = depthData.depthFar; - } - this.texture = texture; - } - } - getMesh(cameraXR) { - if (this.texture !== null) { - if (this.mesh === null) { - const viewport = cameraXR.cameras[0].viewport; - const material = new ShaderMaterial({ - vertexShader: _occlusion_vertex, - fragmentShader: _occlusion_fragment, - uniforms: { - depthColor: { value: this.texture }, - depthWidth: { value: viewport.z }, - depthHeight: { value: viewport.w } - } - }); - this.mesh = new Mesh(new PlaneGeometry(20, 20), material); - } - } - return this.mesh; - } - reset() { - this.texture = null; - this.mesh = null; - } - getDepthTexture() { - return this.texture; - } -} -class WebXRManager extends EventDispatcher { - static { - __name(this, "WebXRManager"); - } - constructor(renderer, gl) { - super(); - const scope = this; - let session = null; - let framebufferScaleFactor = 1; - let referenceSpace = null; - let referenceSpaceType = "local-floor"; - let foveation = 1; - let customReferenceSpace = null; - let pose = null; - let glBinding = null; - let glProjLayer = null; - let glBaseLayer = null; - let xrFrame = null; - const depthSensing = new WebXRDepthSensing(); - const attributes = gl.getContextAttributes(); - let initialRenderTarget = null; - let newRenderTarget = null; - const controllers = []; - const controllerInputSources = []; - const currentSize = new Vector2(); - let currentPixelRatio = null; - const cameraL = new PerspectiveCamera(); - cameraL.viewport = new Vector4(); - const cameraR = new PerspectiveCamera(); - cameraR.viewport = new Vector4(); - const cameras = [cameraL, cameraR]; - const cameraXR = new ArrayCamera(); - let _currentDepthNear = null; - let _currentDepthFar = null; - this.cameraAutoUpdate = true; - this.enabled = false; - this.isPresenting = false; - this.getController = function(index) { - let controller = controllers[index]; - if (controller === void 0) { - controller = new WebXRController(); - controllers[index] = controller; - } - return controller.getTargetRaySpace(); - }; - this.getControllerGrip = function(index) { - let controller = controllers[index]; - if (controller === void 0) { - controller = new WebXRController(); - controllers[index] = controller; - } - return controller.getGripSpace(); - }; - this.getHand = function(index) { - let controller = controllers[index]; - if (controller === void 0) { - controller = new WebXRController(); - controllers[index] = controller; - } - return controller.getHandSpace(); - }; - function onSessionEvent(event) { - const controllerIndex = controllerInputSources.indexOf(event.inputSource); - if (controllerIndex === -1) { - return; - } - const controller = controllers[controllerIndex]; - if (controller !== void 0) { - controller.update(event.inputSource, event.frame, customReferenceSpace || referenceSpace); - controller.dispatchEvent({ type: event.type, data: event.inputSource }); - } - } - __name(onSessionEvent, "onSessionEvent"); - function onSessionEnd() { - session.removeEventListener("select", onSessionEvent); - session.removeEventListener("selectstart", onSessionEvent); - session.removeEventListener("selectend", onSessionEvent); - session.removeEventListener("squeeze", onSessionEvent); - session.removeEventListener("squeezestart", onSessionEvent); - session.removeEventListener("squeezeend", onSessionEvent); - session.removeEventListener("end", onSessionEnd); - session.removeEventListener("inputsourceschange", onInputSourcesChange); - for (let i = 0; i < controllers.length; i++) { - const inputSource = controllerInputSources[i]; - if (inputSource === null) continue; - controllerInputSources[i] = null; - controllers[i].disconnect(inputSource); - } - _currentDepthNear = null; - _currentDepthFar = null; - depthSensing.reset(); - renderer.setRenderTarget(initialRenderTarget); - glBaseLayer = null; - glProjLayer = null; - glBinding = null; - session = null; - newRenderTarget = null; - animation.stop(); - scope.isPresenting = false; - renderer.setPixelRatio(currentPixelRatio); - renderer.setSize(currentSize.width, currentSize.height, false); - scope.dispatchEvent({ type: "sessionend" }); - } - __name(onSessionEnd, "onSessionEnd"); - this.setFramebufferScaleFactor = function(value) { - framebufferScaleFactor = value; - if (scope.isPresenting === true) { - console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting."); - } - }; - this.setReferenceSpaceType = function(value) { - referenceSpaceType = value; - if (scope.isPresenting === true) { - console.warn("THREE.WebXRManager: Cannot change reference space type while presenting."); - } - }; - this.getReferenceSpace = function() { - return customReferenceSpace || referenceSpace; - }; - this.setReferenceSpace = function(space) { - customReferenceSpace = space; - }; - this.getBaseLayer = function() { - return glProjLayer !== null ? glProjLayer : glBaseLayer; - }; - this.getBinding = function() { - return glBinding; - }; - this.getFrame = function() { - return xrFrame; - }; - this.getSession = function() { - return session; - }; - this.setSession = async function(value) { - session = value; - if (session !== null) { - initialRenderTarget = renderer.getRenderTarget(); - session.addEventListener("select", onSessionEvent); - session.addEventListener("selectstart", onSessionEvent); - session.addEventListener("selectend", onSessionEvent); - session.addEventListener("squeeze", onSessionEvent); - session.addEventListener("squeezestart", onSessionEvent); - session.addEventListener("squeezeend", onSessionEvent); - session.addEventListener("end", onSessionEnd); - session.addEventListener("inputsourceschange", onInputSourcesChange); - if (attributes.xrCompatible !== true) { - await gl.makeXRCompatible(); - } - currentPixelRatio = renderer.getPixelRatio(); - renderer.getSize(currentSize); - if (session.renderState.layers === void 0) { - const layerInit = { - antialias: attributes.antialias, - alpha: true, - depth: attributes.depth, - stencil: attributes.stencil, - framebufferScaleFactor - }; - glBaseLayer = new XRWebGLLayer(session, gl, layerInit); - session.updateRenderState({ baseLayer: glBaseLayer }); - renderer.setPixelRatio(1); - renderer.setSize(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, false); - newRenderTarget = new WebGLRenderTarget( - glBaseLayer.framebufferWidth, - glBaseLayer.framebufferHeight, - { - format: RGBAFormat, - type: UnsignedByteType, - colorSpace: renderer.outputColorSpace, - stencilBuffer: attributes.stencil - } - ); - } else { - let depthFormat = null; - let depthType = null; - let glDepthFormat = null; - if (attributes.depth) { - glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24; - depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat; - depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType; - } - const projectionlayerInit = { - colorFormat: gl.RGBA8, - depthFormat: glDepthFormat, - scaleFactor: framebufferScaleFactor - }; - glBinding = new XRWebGLBinding(session, gl); - glProjLayer = glBinding.createProjectionLayer(projectionlayerInit); - session.updateRenderState({ layers: [glProjLayer] }); - renderer.setPixelRatio(1); - renderer.setSize(glProjLayer.textureWidth, glProjLayer.textureHeight, false); - newRenderTarget = new WebGLRenderTarget( - glProjLayer.textureWidth, - glProjLayer.textureHeight, - { - format: RGBAFormat, - type: UnsignedByteType, - depthTexture: new DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, void 0, void 0, void 0, void 0, void 0, void 0, depthFormat), - stencilBuffer: attributes.stencil, - colorSpace: renderer.outputColorSpace, - samples: attributes.antialias ? 4 : 0, - resolveDepthBuffer: glProjLayer.ignoreDepthValues === false - } - ); - } - newRenderTarget.isXRRenderTarget = true; - this.setFoveation(foveation); - customReferenceSpace = null; - referenceSpace = await session.requestReferenceSpace(referenceSpaceType); - animation.setContext(session); - animation.start(); - scope.isPresenting = true; - scope.dispatchEvent({ type: "sessionstart" }); - } - }; - this.getEnvironmentBlendMode = function() { - if (session !== null) { - return session.environmentBlendMode; - } - }; - this.getDepthTexture = function() { - return depthSensing.getDepthTexture(); - }; - function onInputSourcesChange(event) { - for (let i = 0; i < event.removed.length; i++) { - const inputSource = event.removed[i]; - const index = controllerInputSources.indexOf(inputSource); - if (index >= 0) { - controllerInputSources[index] = null; - controllers[index].disconnect(inputSource); - } - } - for (let i = 0; i < event.added.length; i++) { - const inputSource = event.added[i]; - let controllerIndex = controllerInputSources.indexOf(inputSource); - if (controllerIndex === -1) { - for (let i2 = 0; i2 < controllers.length; i2++) { - if (i2 >= controllerInputSources.length) { - controllerInputSources.push(inputSource); - controllerIndex = i2; - break; - } else if (controllerInputSources[i2] === null) { - controllerInputSources[i2] = inputSource; - controllerIndex = i2; - break; - } - } - if (controllerIndex === -1) break; - } - const controller = controllers[controllerIndex]; - if (controller) { - controller.connect(inputSource); - } - } - } - __name(onInputSourcesChange, "onInputSourcesChange"); - const cameraLPos = new Vector3(); - const cameraRPos = new Vector3(); - function setProjectionFromUnion(camera, cameraL2, cameraR2) { - cameraLPos.setFromMatrixPosition(cameraL2.matrixWorld); - cameraRPos.setFromMatrixPosition(cameraR2.matrixWorld); - const ipd = cameraLPos.distanceTo(cameraRPos); - const projL = cameraL2.projectionMatrix.elements; - const projR = cameraR2.projectionMatrix.elements; - const near = projL[14] / (projL[10] - 1); - const far = projL[14] / (projL[10] + 1); - const topFov = (projL[9] + 1) / projL[5]; - const bottomFov = (projL[9] - 1) / projL[5]; - const leftFov = (projL[8] - 1) / projL[0]; - const rightFov = (projR[8] + 1) / projR[0]; - const left = near * leftFov; - const right = near * rightFov; - const zOffset = ipd / (-leftFov + rightFov); - const xOffset = zOffset * -leftFov; - cameraL2.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale); - camera.translateX(xOffset); - camera.translateZ(zOffset); - camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale); - camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); - if (projL[10] === -1) { - camera.projectionMatrix.copy(cameraL2.projectionMatrix); - camera.projectionMatrixInverse.copy(cameraL2.projectionMatrixInverse); - } else { - const near2 = near + zOffset; - const far2 = far + zOffset; - const left2 = left - xOffset; - const right2 = right + (ipd - xOffset); - const top2 = topFov * far / far2 * near2; - const bottom2 = bottomFov * far / far2 * near2; - camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2); - camera.projectionMatrixInverse.copy(camera.projectionMatrix).invert(); - } - } - __name(setProjectionFromUnion, "setProjectionFromUnion"); - function updateCamera(camera, parent) { - if (parent === null) { - camera.matrixWorld.copy(camera.matrix); - } else { - camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix); - } - camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); - } - __name(updateCamera, "updateCamera"); - this.updateCamera = function(camera) { - if (session === null) return; - let depthNear = camera.near; - let depthFar = camera.far; - if (depthSensing.texture !== null) { - if (depthSensing.depthNear > 0) depthNear = depthSensing.depthNear; - if (depthSensing.depthFar > 0) depthFar = depthSensing.depthFar; - } - cameraXR.near = cameraR.near = cameraL.near = depthNear; - cameraXR.far = cameraR.far = cameraL.far = depthFar; - if (_currentDepthNear !== cameraXR.near || _currentDepthFar !== cameraXR.far) { - session.updateRenderState({ - depthNear: cameraXR.near, - depthFar: cameraXR.far - }); - _currentDepthNear = cameraXR.near; - _currentDepthFar = cameraXR.far; - } - cameraL.layers.mask = camera.layers.mask | 2; - cameraR.layers.mask = camera.layers.mask | 4; - cameraXR.layers.mask = cameraL.layers.mask | cameraR.layers.mask; - const parent = camera.parent; - const cameras2 = cameraXR.cameras; - updateCamera(cameraXR, parent); - for (let i = 0; i < cameras2.length; i++) { - updateCamera(cameras2[i], parent); - } - if (cameras2.length === 2) { - setProjectionFromUnion(cameraXR, cameraL, cameraR); - } else { - cameraXR.projectionMatrix.copy(cameraL.projectionMatrix); - } - updateUserCamera(camera, cameraXR, parent); - }; - function updateUserCamera(camera, cameraXR2, parent) { - if (parent === null) { - camera.matrix.copy(cameraXR2.matrixWorld); - } else { - camera.matrix.copy(parent.matrixWorld); - camera.matrix.invert(); - camera.matrix.multiply(cameraXR2.matrixWorld); - } - camera.matrix.decompose(camera.position, camera.quaternion, camera.scale); - camera.updateMatrixWorld(true); - camera.projectionMatrix.copy(cameraXR2.projectionMatrix); - camera.projectionMatrixInverse.copy(cameraXR2.projectionMatrixInverse); - if (camera.isPerspectiveCamera) { - camera.fov = RAD2DEG * 2 * Math.atan(1 / camera.projectionMatrix.elements[5]); - camera.zoom = 1; - } - } - __name(updateUserCamera, "updateUserCamera"); - this.getCamera = function() { - return cameraXR; - }; - this.getFoveation = function() { - if (glProjLayer === null && glBaseLayer === null) { - return void 0; - } - return foveation; - }; - this.setFoveation = function(value) { - foveation = value; - if (glProjLayer !== null) { - glProjLayer.fixedFoveation = value; - } - if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== void 0) { - glBaseLayer.fixedFoveation = value; - } - }; - this.hasDepthSensing = function() { - return depthSensing.texture !== null; - }; - this.getDepthSensingMesh = function() { - return depthSensing.getMesh(cameraXR); - }; - let onAnimationFrameCallback = null; - function onAnimationFrame(time, frame) { - pose = frame.getViewerPose(customReferenceSpace || referenceSpace); - xrFrame = frame; - if (pose !== null) { - const views = pose.views; - if (glBaseLayer !== null) { - renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer); - renderer.setRenderTarget(newRenderTarget); - } - let cameraXRNeedsUpdate = false; - if (views.length !== cameraXR.cameras.length) { - cameraXR.cameras.length = 0; - cameraXRNeedsUpdate = true; - } - for (let i = 0; i < views.length; i++) { - const view = views[i]; - let viewport = null; - if (glBaseLayer !== null) { - viewport = glBaseLayer.getViewport(view); - } else { - const glSubImage = glBinding.getViewSubImage(glProjLayer, view); - viewport = glSubImage.viewport; - if (i === 0) { - renderer.setRenderTargetTextures( - newRenderTarget, - glSubImage.colorTexture, - glProjLayer.ignoreDepthValues ? void 0 : glSubImage.depthStencilTexture - ); - renderer.setRenderTarget(newRenderTarget); - } - } - let camera = cameras[i]; - if (camera === void 0) { - camera = new PerspectiveCamera(); - camera.layers.enable(i); - camera.viewport = new Vector4(); - cameras[i] = camera; - } - camera.matrix.fromArray(view.transform.matrix); - camera.matrix.decompose(camera.position, camera.quaternion, camera.scale); - camera.projectionMatrix.fromArray(view.projectionMatrix); - camera.projectionMatrixInverse.copy(camera.projectionMatrix).invert(); - camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height); - if (i === 0) { - cameraXR.matrix.copy(camera.matrix); - cameraXR.matrix.decompose(cameraXR.position, cameraXR.quaternion, cameraXR.scale); - } - if (cameraXRNeedsUpdate === true) { - cameraXR.cameras.push(camera); - } - } - const enabledFeatures = session.enabledFeatures; - if (enabledFeatures && enabledFeatures.includes("depth-sensing")) { - const depthData = glBinding.getDepthInformation(views[0]); - if (depthData && depthData.isValid && depthData.texture) { - depthSensing.init(renderer, depthData, session.renderState); - } - } - } - for (let i = 0; i < controllers.length; i++) { - const inputSource = controllerInputSources[i]; - const controller = controllers[i]; - if (inputSource !== null && controller !== void 0) { - controller.update(inputSource, frame, customReferenceSpace || referenceSpace); - } - } - if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame); - if (frame.detectedPlanes) { - scope.dispatchEvent({ type: "planesdetected", data: frame }); - } - xrFrame = null; - } - __name(onAnimationFrame, "onAnimationFrame"); - const animation = new WebGLAnimation(); - animation.setAnimationLoop(onAnimationFrame); - this.setAnimationLoop = function(callback) { - onAnimationFrameCallback = callback; - }; - this.dispose = function() { - }; - } -} -const _e1 = /* @__PURE__ */ new Euler(); -const _m1 = /* @__PURE__ */ new Matrix4(); -function WebGLMaterials(renderer, properties) { - function refreshTransformUniform(map, uniform) { - if (map.matrixAutoUpdate === true) { - map.updateMatrix(); - } - uniform.value.copy(map.matrix); - } - __name(refreshTransformUniform, "refreshTransformUniform"); - function refreshFogUniforms(uniforms, fog) { - fog.color.getRGB(uniforms.fogColor.value, getUnlitUniformColorSpace(renderer)); - if (fog.isFog) { - uniforms.fogNear.value = fog.near; - uniforms.fogFar.value = fog.far; - } else if (fog.isFogExp2) { - uniforms.fogDensity.value = fog.density; - } - } - __name(refreshFogUniforms, "refreshFogUniforms"); - function refreshMaterialUniforms(uniforms, material, pixelRatio, height, transmissionRenderTarget) { - if (material.isMeshBasicMaterial) { - refreshUniformsCommon(uniforms, material); - } else if (material.isMeshLambertMaterial) { - refreshUniformsCommon(uniforms, material); - } else if (material.isMeshToonMaterial) { - refreshUniformsCommon(uniforms, material); - refreshUniformsToon(uniforms, material); - } else if (material.isMeshPhongMaterial) { - refreshUniformsCommon(uniforms, material); - refreshUniformsPhong(uniforms, material); - } else if (material.isMeshStandardMaterial) { - refreshUniformsCommon(uniforms, material); - refreshUniformsStandard(uniforms, material); - if (material.isMeshPhysicalMaterial) { - refreshUniformsPhysical(uniforms, material, transmissionRenderTarget); - } - } else if (material.isMeshMatcapMaterial) { - refreshUniformsCommon(uniforms, material); - refreshUniformsMatcap(uniforms, material); - } else if (material.isMeshDepthMaterial) { - refreshUniformsCommon(uniforms, material); - } else if (material.isMeshDistanceMaterial) { - refreshUniformsCommon(uniforms, material); - refreshUniformsDistance(uniforms, material); - } else if (material.isMeshNormalMaterial) { - refreshUniformsCommon(uniforms, material); - } else if (material.isLineBasicMaterial) { - refreshUniformsLine(uniforms, material); - if (material.isLineDashedMaterial) { - refreshUniformsDash(uniforms, material); - } - } else if (material.isPointsMaterial) { - refreshUniformsPoints(uniforms, material, pixelRatio, height); - } else if (material.isSpriteMaterial) { - refreshUniformsSprites(uniforms, material); - } else if (material.isShadowMaterial) { - uniforms.color.value.copy(material.color); - uniforms.opacity.value = material.opacity; - } else if (material.isShaderMaterial) { - material.uniformsNeedUpdate = false; - } - } - __name(refreshMaterialUniforms, "refreshMaterialUniforms"); - function refreshUniformsCommon(uniforms, material) { - uniforms.opacity.value = material.opacity; - if (material.color) { - uniforms.diffuse.value.copy(material.color); - } - if (material.emissive) { - uniforms.emissive.value.copy(material.emissive).multiplyScalar(material.emissiveIntensity); - } - if (material.map) { - uniforms.map.value = material.map; - refreshTransformUniform(material.map, uniforms.mapTransform); - } - if (material.alphaMap) { - uniforms.alphaMap.value = material.alphaMap; - refreshTransformUniform(material.alphaMap, uniforms.alphaMapTransform); - } - if (material.bumpMap) { - uniforms.bumpMap.value = material.bumpMap; - refreshTransformUniform(material.bumpMap, uniforms.bumpMapTransform); - uniforms.bumpScale.value = material.bumpScale; - if (material.side === BackSide) { - uniforms.bumpScale.value *= -1; - } - } - if (material.normalMap) { - uniforms.normalMap.value = material.normalMap; - refreshTransformUniform(material.normalMap, uniforms.normalMapTransform); - uniforms.normalScale.value.copy(material.normalScale); - if (material.side === BackSide) { - uniforms.normalScale.value.negate(); - } - } - if (material.displacementMap) { - uniforms.displacementMap.value = material.displacementMap; - refreshTransformUniform(material.displacementMap, uniforms.displacementMapTransform); - uniforms.displacementScale.value = material.displacementScale; - uniforms.displacementBias.value = material.displacementBias; - } - if (material.emissiveMap) { - uniforms.emissiveMap.value = material.emissiveMap; - refreshTransformUniform(material.emissiveMap, uniforms.emissiveMapTransform); - } - if (material.specularMap) { - uniforms.specularMap.value = material.specularMap; - refreshTransformUniform(material.specularMap, uniforms.specularMapTransform); - } - if (material.alphaTest > 0) { - uniforms.alphaTest.value = material.alphaTest; - } - const materialProperties = properties.get(material); - const envMap = materialProperties.envMap; - const envMapRotation = materialProperties.envMapRotation; - if (envMap) { - uniforms.envMap.value = envMap; - _e1.copy(envMapRotation); - _e1.x *= -1; - _e1.y *= -1; - _e1.z *= -1; - if (envMap.isCubeTexture && envMap.isRenderTargetTexture === false) { - _e1.y *= -1; - _e1.z *= -1; - } - uniforms.envMapRotation.value.setFromMatrix4(_m1.makeRotationFromEuler(_e1)); - uniforms.flipEnvMap.value = envMap.isCubeTexture && envMap.isRenderTargetTexture === false ? -1 : 1; - uniforms.reflectivity.value = material.reflectivity; - uniforms.ior.value = material.ior; - uniforms.refractionRatio.value = material.refractionRatio; - } - if (material.lightMap) { - uniforms.lightMap.value = material.lightMap; - uniforms.lightMapIntensity.value = material.lightMapIntensity; - refreshTransformUniform(material.lightMap, uniforms.lightMapTransform); - } - if (material.aoMap) { - uniforms.aoMap.value = material.aoMap; - uniforms.aoMapIntensity.value = material.aoMapIntensity; - refreshTransformUniform(material.aoMap, uniforms.aoMapTransform); - } - } - __name(refreshUniformsCommon, "refreshUniformsCommon"); - function refreshUniformsLine(uniforms, material) { - uniforms.diffuse.value.copy(material.color); - uniforms.opacity.value = material.opacity; - if (material.map) { - uniforms.map.value = material.map; - refreshTransformUniform(material.map, uniforms.mapTransform); - } - } - __name(refreshUniformsLine, "refreshUniformsLine"); - function refreshUniformsDash(uniforms, material) { - uniforms.dashSize.value = material.dashSize; - uniforms.totalSize.value = material.dashSize + material.gapSize; - uniforms.scale.value = material.scale; - } - __name(refreshUniformsDash, "refreshUniformsDash"); - function refreshUniformsPoints(uniforms, material, pixelRatio, height) { - uniforms.diffuse.value.copy(material.color); - uniforms.opacity.value = material.opacity; - uniforms.size.value = material.size * pixelRatio; - uniforms.scale.value = height * 0.5; - if (material.map) { - uniforms.map.value = material.map; - refreshTransformUniform(material.map, uniforms.uvTransform); - } - if (material.alphaMap) { - uniforms.alphaMap.value = material.alphaMap; - refreshTransformUniform(material.alphaMap, uniforms.alphaMapTransform); - } - if (material.alphaTest > 0) { - uniforms.alphaTest.value = material.alphaTest; - } - } - __name(refreshUniformsPoints, "refreshUniformsPoints"); - function refreshUniformsSprites(uniforms, material) { - uniforms.diffuse.value.copy(material.color); - uniforms.opacity.value = material.opacity; - uniforms.rotation.value = material.rotation; - if (material.map) { - uniforms.map.value = material.map; - refreshTransformUniform(material.map, uniforms.mapTransform); - } - if (material.alphaMap) { - uniforms.alphaMap.value = material.alphaMap; - refreshTransformUniform(material.alphaMap, uniforms.alphaMapTransform); - } - if (material.alphaTest > 0) { - uniforms.alphaTest.value = material.alphaTest; - } - } - __name(refreshUniformsSprites, "refreshUniformsSprites"); - function refreshUniformsPhong(uniforms, material) { - uniforms.specular.value.copy(material.specular); - uniforms.shininess.value = Math.max(material.shininess, 1e-4); - } - __name(refreshUniformsPhong, "refreshUniformsPhong"); - function refreshUniformsToon(uniforms, material) { - if (material.gradientMap) { - uniforms.gradientMap.value = material.gradientMap; - } - } - __name(refreshUniformsToon, "refreshUniformsToon"); - function refreshUniformsStandard(uniforms, material) { - uniforms.metalness.value = material.metalness; - if (material.metalnessMap) { - uniforms.metalnessMap.value = material.metalnessMap; - refreshTransformUniform(material.metalnessMap, uniforms.metalnessMapTransform); - } - uniforms.roughness.value = material.roughness; - if (material.roughnessMap) { - uniforms.roughnessMap.value = material.roughnessMap; - refreshTransformUniform(material.roughnessMap, uniforms.roughnessMapTransform); - } - if (material.envMap) { - uniforms.envMapIntensity.value = material.envMapIntensity; - } - } - __name(refreshUniformsStandard, "refreshUniformsStandard"); - function refreshUniformsPhysical(uniforms, material, transmissionRenderTarget) { - uniforms.ior.value = material.ior; - if (material.sheen > 0) { - uniforms.sheenColor.value.copy(material.sheenColor).multiplyScalar(material.sheen); - uniforms.sheenRoughness.value = material.sheenRoughness; - if (material.sheenColorMap) { - uniforms.sheenColorMap.value = material.sheenColorMap; - refreshTransformUniform(material.sheenColorMap, uniforms.sheenColorMapTransform); - } - if (material.sheenRoughnessMap) { - uniforms.sheenRoughnessMap.value = material.sheenRoughnessMap; - refreshTransformUniform(material.sheenRoughnessMap, uniforms.sheenRoughnessMapTransform); - } - } - if (material.clearcoat > 0) { - uniforms.clearcoat.value = material.clearcoat; - uniforms.clearcoatRoughness.value = material.clearcoatRoughness; - if (material.clearcoatMap) { - uniforms.clearcoatMap.value = material.clearcoatMap; - refreshTransformUniform(material.clearcoatMap, uniforms.clearcoatMapTransform); - } - if (material.clearcoatRoughnessMap) { - uniforms.clearcoatRoughnessMap.value = material.clearcoatRoughnessMap; - refreshTransformUniform(material.clearcoatRoughnessMap, uniforms.clearcoatRoughnessMapTransform); - } - if (material.clearcoatNormalMap) { - uniforms.clearcoatNormalMap.value = material.clearcoatNormalMap; - refreshTransformUniform(material.clearcoatNormalMap, uniforms.clearcoatNormalMapTransform); - uniforms.clearcoatNormalScale.value.copy(material.clearcoatNormalScale); - if (material.side === BackSide) { - uniforms.clearcoatNormalScale.value.negate(); - } - } - } - if (material.dispersion > 0) { - uniforms.dispersion.value = material.dispersion; - } - if (material.iridescence > 0) { - uniforms.iridescence.value = material.iridescence; - uniforms.iridescenceIOR.value = material.iridescenceIOR; - uniforms.iridescenceThicknessMinimum.value = material.iridescenceThicknessRange[0]; - uniforms.iridescenceThicknessMaximum.value = material.iridescenceThicknessRange[1]; - if (material.iridescenceMap) { - uniforms.iridescenceMap.value = material.iridescenceMap; - refreshTransformUniform(material.iridescenceMap, uniforms.iridescenceMapTransform); - } - if (material.iridescenceThicknessMap) { - uniforms.iridescenceThicknessMap.value = material.iridescenceThicknessMap; - refreshTransformUniform(material.iridescenceThicknessMap, uniforms.iridescenceThicknessMapTransform); - } - } - if (material.transmission > 0) { - uniforms.transmission.value = material.transmission; - uniforms.transmissionSamplerMap.value = transmissionRenderTarget.texture; - uniforms.transmissionSamplerSize.value.set(transmissionRenderTarget.width, transmissionRenderTarget.height); - if (material.transmissionMap) { - uniforms.transmissionMap.value = material.transmissionMap; - refreshTransformUniform(material.transmissionMap, uniforms.transmissionMapTransform); - } - uniforms.thickness.value = material.thickness; - if (material.thicknessMap) { - uniforms.thicknessMap.value = material.thicknessMap; - refreshTransformUniform(material.thicknessMap, uniforms.thicknessMapTransform); - } - uniforms.attenuationDistance.value = material.attenuationDistance; - uniforms.attenuationColor.value.copy(material.attenuationColor); - } - if (material.anisotropy > 0) { - uniforms.anisotropyVector.value.set(material.anisotropy * Math.cos(material.anisotropyRotation), material.anisotropy * Math.sin(material.anisotropyRotation)); - if (material.anisotropyMap) { - uniforms.anisotropyMap.value = material.anisotropyMap; - refreshTransformUniform(material.anisotropyMap, uniforms.anisotropyMapTransform); - } - } - uniforms.specularIntensity.value = material.specularIntensity; - uniforms.specularColor.value.copy(material.specularColor); - if (material.specularColorMap) { - uniforms.specularColorMap.value = material.specularColorMap; - refreshTransformUniform(material.specularColorMap, uniforms.specularColorMapTransform); - } - if (material.specularIntensityMap) { - uniforms.specularIntensityMap.value = material.specularIntensityMap; - refreshTransformUniform(material.specularIntensityMap, uniforms.specularIntensityMapTransform); - } - } - __name(refreshUniformsPhysical, "refreshUniformsPhysical"); - function refreshUniformsMatcap(uniforms, material) { - if (material.matcap) { - uniforms.matcap.value = material.matcap; - } - } - __name(refreshUniformsMatcap, "refreshUniformsMatcap"); - function refreshUniformsDistance(uniforms, material) { - const light = properties.get(material).light; - uniforms.referencePosition.value.setFromMatrixPosition(light.matrixWorld); - uniforms.nearDistance.value = light.shadow.camera.near; - uniforms.farDistance.value = light.shadow.camera.far; - } - __name(refreshUniformsDistance, "refreshUniformsDistance"); - return { - refreshFogUniforms, - refreshMaterialUniforms - }; -} -__name(WebGLMaterials, "WebGLMaterials"); -function WebGLUniformsGroups(gl, info, capabilities, state) { - let buffers = {}; - let updateList = {}; - let allocatedBindingPoints = []; - const maxBindingPoints = gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS); - function bind(uniformsGroup, program) { - const webglProgram = program.program; - state.uniformBlockBinding(uniformsGroup, webglProgram); - } - __name(bind, "bind"); - function update(uniformsGroup, program) { - let buffer = buffers[uniformsGroup.id]; - if (buffer === void 0) { - prepareUniformsGroup(uniformsGroup); - buffer = createBuffer(uniformsGroup); - buffers[uniformsGroup.id] = buffer; - uniformsGroup.addEventListener("dispose", onUniformsGroupsDispose); - } - const webglProgram = program.program; - state.updateUBOMapping(uniformsGroup, webglProgram); - const frame = info.render.frame; - if (updateList[uniformsGroup.id] !== frame) { - updateBufferData(uniformsGroup); - updateList[uniformsGroup.id] = frame; - } - } - __name(update, "update"); - function createBuffer(uniformsGroup) { - const bindingPointIndex = allocateBindingPointIndex(); - uniformsGroup.__bindingPointIndex = bindingPointIndex; - const buffer = gl.createBuffer(); - const size = uniformsGroup.__size; - const usage = uniformsGroup.usage; - gl.bindBuffer(gl.UNIFORM_BUFFER, buffer); - gl.bufferData(gl.UNIFORM_BUFFER, size, usage); - gl.bindBuffer(gl.UNIFORM_BUFFER, null); - gl.bindBufferBase(gl.UNIFORM_BUFFER, bindingPointIndex, buffer); - return buffer; - } - __name(createBuffer, "createBuffer"); - function allocateBindingPointIndex() { - for (let i = 0; i < maxBindingPoints; i++) { - if (allocatedBindingPoints.indexOf(i) === -1) { - allocatedBindingPoints.push(i); - return i; - } - } - console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."); - return 0; - } - __name(allocateBindingPointIndex, "allocateBindingPointIndex"); - function updateBufferData(uniformsGroup) { - const buffer = buffers[uniformsGroup.id]; - const uniforms = uniformsGroup.uniforms; - const cache = uniformsGroup.__cache; - gl.bindBuffer(gl.UNIFORM_BUFFER, buffer); - for (let i = 0, il = uniforms.length; i < il; i++) { - const uniformArray = Array.isArray(uniforms[i]) ? uniforms[i] : [uniforms[i]]; - for (let j = 0, jl = uniformArray.length; j < jl; j++) { - const uniform = uniformArray[j]; - if (hasUniformChanged(uniform, i, j, cache) === true) { - const offset = uniform.__offset; - const values = Array.isArray(uniform.value) ? uniform.value : [uniform.value]; - let arrayOffset = 0; - for (let k = 0; k < values.length; k++) { - const value = values[k]; - const info2 = getUniformSize(value); - if (typeof value === "number" || typeof value === "boolean") { - uniform.__data[0] = value; - gl.bufferSubData(gl.UNIFORM_BUFFER, offset + arrayOffset, uniform.__data); - } else if (value.isMatrix3) { - uniform.__data[0] = value.elements[0]; - uniform.__data[1] = value.elements[1]; - uniform.__data[2] = value.elements[2]; - uniform.__data[3] = 0; - uniform.__data[4] = value.elements[3]; - uniform.__data[5] = value.elements[4]; - uniform.__data[6] = value.elements[5]; - uniform.__data[7] = 0; - uniform.__data[8] = value.elements[6]; - uniform.__data[9] = value.elements[7]; - uniform.__data[10] = value.elements[8]; - uniform.__data[11] = 0; - } else { - value.toArray(uniform.__data, arrayOffset); - arrayOffset += info2.storage / Float32Array.BYTES_PER_ELEMENT; - } - } - gl.bufferSubData(gl.UNIFORM_BUFFER, offset, uniform.__data); - } - } - } - gl.bindBuffer(gl.UNIFORM_BUFFER, null); - } - __name(updateBufferData, "updateBufferData"); - function hasUniformChanged(uniform, index, indexArray, cache) { - const value = uniform.value; - const indexString = index + "_" + indexArray; - if (cache[indexString] === void 0) { - if (typeof value === "number" || typeof value === "boolean") { - cache[indexString] = value; - } else { - cache[indexString] = value.clone(); - } - return true; - } else { - const cachedObject = cache[indexString]; - if (typeof value === "number" || typeof value === "boolean") { - if (cachedObject !== value) { - cache[indexString] = value; - return true; - } - } else { - if (cachedObject.equals(value) === false) { - cachedObject.copy(value); - return true; - } - } - } - return false; - } - __name(hasUniformChanged, "hasUniformChanged"); - function prepareUniformsGroup(uniformsGroup) { - const uniforms = uniformsGroup.uniforms; - let offset = 0; - const chunkSize = 16; - for (let i = 0, l = uniforms.length; i < l; i++) { - const uniformArray = Array.isArray(uniforms[i]) ? uniforms[i] : [uniforms[i]]; - for (let j = 0, jl = uniformArray.length; j < jl; j++) { - const uniform = uniformArray[j]; - const values = Array.isArray(uniform.value) ? uniform.value : [uniform.value]; - for (let k = 0, kl = values.length; k < kl; k++) { - const value = values[k]; - const info2 = getUniformSize(value); - const chunkOffset2 = offset % chunkSize; - const chunkPadding = chunkOffset2 % info2.boundary; - const chunkStart = chunkOffset2 + chunkPadding; - offset += chunkPadding; - if (chunkStart !== 0 && chunkSize - chunkStart < info2.storage) { - offset += chunkSize - chunkStart; - } - uniform.__data = new Float32Array(info2.storage / Float32Array.BYTES_PER_ELEMENT); - uniform.__offset = offset; - offset += info2.storage; - } - } - } - const chunkOffset = offset % chunkSize; - if (chunkOffset > 0) offset += chunkSize - chunkOffset; - uniformsGroup.__size = offset; - uniformsGroup.__cache = {}; - return this; - } - __name(prepareUniformsGroup, "prepareUniformsGroup"); - function getUniformSize(value) { - const info2 = { - boundary: 0, - // bytes - storage: 0 - // bytes - }; - if (typeof value === "number" || typeof value === "boolean") { - info2.boundary = 4; - info2.storage = 4; - } else if (value.isVector2) { - info2.boundary = 8; - info2.storage = 8; - } else if (value.isVector3 || value.isColor) { - info2.boundary = 16; - info2.storage = 12; - } else if (value.isVector4) { - info2.boundary = 16; - info2.storage = 16; - } else if (value.isMatrix3) { - info2.boundary = 48; - info2.storage = 48; - } else if (value.isMatrix4) { - info2.boundary = 64; - info2.storage = 64; - } else if (value.isTexture) { - console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."); - } else { - console.warn("THREE.WebGLRenderer: Unsupported uniform value type.", value); - } - return info2; - } - __name(getUniformSize, "getUniformSize"); - function onUniformsGroupsDispose(event) { - const uniformsGroup = event.target; - uniformsGroup.removeEventListener("dispose", onUniformsGroupsDispose); - const index = allocatedBindingPoints.indexOf(uniformsGroup.__bindingPointIndex); - allocatedBindingPoints.splice(index, 1); - gl.deleteBuffer(buffers[uniformsGroup.id]); - delete buffers[uniformsGroup.id]; - delete updateList[uniformsGroup.id]; - } - __name(onUniformsGroupsDispose, "onUniformsGroupsDispose"); - function dispose() { - for (const id2 in buffers) { - gl.deleteBuffer(buffers[id2]); - } - allocatedBindingPoints = []; - buffers = {}; - updateList = {}; - } - __name(dispose, "dispose"); - return { - bind, - update, - dispose - }; -} -__name(WebGLUniformsGroups, "WebGLUniformsGroups"); -class WebGLRenderer { - static { - __name(this, "WebGLRenderer"); - } - constructor(parameters = {}) { - const { - canvas = createCanvasElement(), - context = null, - depth = true, - stencil = false, - alpha = false, - antialias = false, - premultipliedAlpha = true, - preserveDrawingBuffer = false, - powerPreference = "default", - failIfMajorPerformanceCaveat = false, - reverseDepthBuffer = false - } = parameters; - this.isWebGLRenderer = true; - let _alpha; - if (context !== null) { - if (typeof WebGLRenderingContext !== "undefined" && context instanceof WebGLRenderingContext) { - throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163."); - } - _alpha = context.getContextAttributes().alpha; - } else { - _alpha = alpha; - } - const uintClearColor = new Uint32Array(4); - const intClearColor = new Int32Array(4); - let currentRenderList = null; - let currentRenderState = null; - const renderListStack = []; - const renderStateStack = []; - this.domElement = canvas; - this.debug = { - /** - * Enables error checking and reporting when shader programs are being compiled - * @type {boolean} - */ - checkShaderErrors: true, - /** - * Callback for custom error reporting. - * @type {?Function} - */ - onShaderError: null - }; - this.autoClear = true; - this.autoClearColor = true; - this.autoClearDepth = true; - this.autoClearStencil = true; - this.sortObjects = true; - this.clippingPlanes = []; - this.localClippingEnabled = false; - this._outputColorSpace = SRGBColorSpace; - this.toneMapping = NoToneMapping; - this.toneMappingExposure = 1; - const _this = this; - let _isContextLost = false; - let _currentActiveCubeFace = 0; - let _currentActiveMipmapLevel = 0; - let _currentRenderTarget = null; - let _currentMaterialId = -1; - let _currentCamera = null; - const _currentViewport = new Vector4(); - const _currentScissor = new Vector4(); - let _currentScissorTest = null; - const _currentClearColor = new Color(0); - let _currentClearAlpha = 0; - let _width = canvas.width; - let _height = canvas.height; - let _pixelRatio = 1; - let _opaqueSort = null; - let _transparentSort = null; - const _viewport = new Vector4(0, 0, _width, _height); - const _scissor = new Vector4(0, 0, _width, _height); - let _scissorTest = false; - const _frustum2 = new Frustum(); - let _clippingEnabled = false; - let _localClippingEnabled = false; - const _currentProjectionMatrix = new Matrix4(); - const _projScreenMatrix2 = new Matrix4(); - const _vector32 = new Vector3(); - const _vector4 = new Vector4(); - const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true }; - let _renderBackground = false; - function getTargetPixelRatio() { - return _currentRenderTarget === null ? _pixelRatio : 1; - } - __name(getTargetPixelRatio, "getTargetPixelRatio"); - let _gl = context; - function getContext(contextName, contextAttributes) { - return canvas.getContext(contextName, contextAttributes); - } - __name(getContext, "getContext"); - try { - const contextAttributes = { - alpha: true, - depth, - stencil, - antialias, - premultipliedAlpha, - preserveDrawingBuffer, - powerPreference, - failIfMajorPerformanceCaveat - }; - if ("setAttribute" in canvas) canvas.setAttribute("data-engine", `three.js r${REVISION}`); - canvas.addEventListener("webglcontextlost", onContextLost, false); - canvas.addEventListener("webglcontextrestored", onContextRestore, false); - canvas.addEventListener("webglcontextcreationerror", onContextCreationError, false); - if (_gl === null) { - const contextName = "webgl2"; - _gl = getContext(contextName, contextAttributes); - if (_gl === null) { - if (getContext(contextName)) { - throw new Error("Error creating WebGL context with your selected attributes."); - } else { - throw new Error("Error creating WebGL context."); - } - } - } - } catch (error) { - console.error("THREE.WebGLRenderer: " + error.message); - throw error; - } - let extensions, capabilities, state, info; - let properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects; - let programCache, materials, renderLists, renderStates, clipping, shadowMap; - let background, morphtargets, bufferRenderer, indexedBufferRenderer; - let utils, bindingStates, uniformsGroups; - function initGLContext() { - extensions = new WebGLExtensions(_gl); - extensions.init(); - utils = new WebGLUtils(_gl, extensions); - capabilities = new WebGLCapabilities(_gl, extensions, parameters, utils); - state = new WebGLState(_gl, extensions); - if (capabilities.reverseDepthBuffer && reverseDepthBuffer) { - state.buffers.depth.setReversed(true); - } - info = new WebGLInfo(_gl); - properties = new WebGLProperties(); - textures = new WebGLTextures(_gl, extensions, state, properties, capabilities, utils, info); - cubemaps = new WebGLCubeMaps(_this); - cubeuvmaps = new WebGLCubeUVMaps(_this); - attributes = new WebGLAttributes(_gl); - bindingStates = new WebGLBindingStates(_gl, attributes); - geometries = new WebGLGeometries(_gl, attributes, info, bindingStates); - objects = new WebGLObjects(_gl, geometries, attributes, info); - morphtargets = new WebGLMorphtargets(_gl, capabilities, textures); - clipping = new WebGLClipping(properties); - programCache = new WebGLPrograms(_this, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping); - materials = new WebGLMaterials(_this, properties); - renderLists = new WebGLRenderLists(); - renderStates = new WebGLRenderStates(extensions); - background = new WebGLBackground(_this, cubemaps, cubeuvmaps, state, objects, _alpha, premultipliedAlpha); - shadowMap = new WebGLShadowMap(_this, objects, capabilities); - uniformsGroups = new WebGLUniformsGroups(_gl, info, capabilities, state); - bufferRenderer = new WebGLBufferRenderer(_gl, extensions, info); - indexedBufferRenderer = new WebGLIndexedBufferRenderer(_gl, extensions, info); - info.programs = programCache.programs; - _this.capabilities = capabilities; - _this.extensions = extensions; - _this.properties = properties; - _this.renderLists = renderLists; - _this.shadowMap = shadowMap; - _this.state = state; - _this.info = info; - } - __name(initGLContext, "initGLContext"); - initGLContext(); - const xr = new WebXRManager(_this, _gl); - this.xr = xr; - this.getContext = function() { - return _gl; - }; - this.getContextAttributes = function() { - return _gl.getContextAttributes(); - }; - this.forceContextLoss = function() { - const extension = extensions.get("WEBGL_lose_context"); - if (extension) extension.loseContext(); - }; - this.forceContextRestore = function() { - const extension = extensions.get("WEBGL_lose_context"); - if (extension) extension.restoreContext(); - }; - this.getPixelRatio = function() { - return _pixelRatio; - }; - this.setPixelRatio = function(value) { - if (value === void 0) return; - _pixelRatio = value; - this.setSize(_width, _height, false); - }; - this.getSize = function(target) { - return target.set(_width, _height); - }; - this.setSize = function(width, height, updateStyle = true) { - if (xr.isPresenting) { - console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."); - return; - } - _width = width; - _height = height; - canvas.width = Math.floor(width * _pixelRatio); - canvas.height = Math.floor(height * _pixelRatio); - if (updateStyle === true) { - canvas.style.width = width + "px"; - canvas.style.height = height + "px"; - } - this.setViewport(0, 0, width, height); - }; - this.getDrawingBufferSize = function(target) { - return target.set(_width * _pixelRatio, _height * _pixelRatio).floor(); - }; - this.setDrawingBufferSize = function(width, height, pixelRatio) { - _width = width; - _height = height; - _pixelRatio = pixelRatio; - canvas.width = Math.floor(width * pixelRatio); - canvas.height = Math.floor(height * pixelRatio); - this.setViewport(0, 0, width, height); - }; - this.getCurrentViewport = function(target) { - return target.copy(_currentViewport); - }; - this.getViewport = function(target) { - return target.copy(_viewport); - }; - this.setViewport = function(x, y, width, height) { - if (x.isVector4) { - _viewport.set(x.x, x.y, x.z, x.w); - } else { - _viewport.set(x, y, width, height); - } - state.viewport(_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).round()); - }; - this.getScissor = function(target) { - return target.copy(_scissor); - }; - this.setScissor = function(x, y, width, height) { - if (x.isVector4) { - _scissor.set(x.x, x.y, x.z, x.w); - } else { - _scissor.set(x, y, width, height); - } - state.scissor(_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).round()); - }; - this.getScissorTest = function() { - return _scissorTest; - }; - this.setScissorTest = function(boolean) { - state.setScissorTest(_scissorTest = boolean); - }; - this.setOpaqueSort = function(method) { - _opaqueSort = method; - }; - this.setTransparentSort = function(method) { - _transparentSort = method; - }; - this.getClearColor = function(target) { - return target.copy(background.getClearColor()); - }; - this.setClearColor = function() { - background.setClearColor.apply(background, arguments); - }; - this.getClearAlpha = function() { - return background.getClearAlpha(); - }; - this.setClearAlpha = function() { - background.setClearAlpha.apply(background, arguments); - }; - this.clear = function(color = true, depth2 = true, stencil2 = true) { - let bits2 = 0; - if (color) { - let isIntegerFormat = false; - if (_currentRenderTarget !== null) { - const targetFormat = _currentRenderTarget.texture.format; - isIntegerFormat = targetFormat === RGBAIntegerFormat || targetFormat === RGIntegerFormat || targetFormat === RedIntegerFormat; - } - if (isIntegerFormat) { - const targetType = _currentRenderTarget.texture.type; - const isUnsignedType = targetType === UnsignedByteType || targetType === UnsignedIntType || targetType === UnsignedShortType || targetType === UnsignedInt248Type || targetType === UnsignedShort4444Type || targetType === UnsignedShort5551Type; - const clearColor = background.getClearColor(); - const a = background.getClearAlpha(); - const r = clearColor.r; - const g = clearColor.g; - const b = clearColor.b; - if (isUnsignedType) { - uintClearColor[0] = r; - uintClearColor[1] = g; - uintClearColor[2] = b; - uintClearColor[3] = a; - _gl.clearBufferuiv(_gl.COLOR, 0, uintClearColor); - } else { - intClearColor[0] = r; - intClearColor[1] = g; - intClearColor[2] = b; - intClearColor[3] = a; - _gl.clearBufferiv(_gl.COLOR, 0, intClearColor); - } - } else { - bits2 |= _gl.COLOR_BUFFER_BIT; - } - } - if (depth2) { - bits2 |= _gl.DEPTH_BUFFER_BIT; - } - if (stencil2) { - bits2 |= _gl.STENCIL_BUFFER_BIT; - this.state.buffers.stencil.setMask(4294967295); - } - _gl.clear(bits2); - }; - this.clearColor = function() { - this.clear(true, false, false); - }; - this.clearDepth = function() { - this.clear(false, true, false); - }; - this.clearStencil = function() { - this.clear(false, false, true); - }; - this.dispose = function() { - canvas.removeEventListener("webglcontextlost", onContextLost, false); - canvas.removeEventListener("webglcontextrestored", onContextRestore, false); - canvas.removeEventListener("webglcontextcreationerror", onContextCreationError, false); - renderLists.dispose(); - renderStates.dispose(); - properties.dispose(); - cubemaps.dispose(); - cubeuvmaps.dispose(); - objects.dispose(); - bindingStates.dispose(); - uniformsGroups.dispose(); - programCache.dispose(); - xr.dispose(); - xr.removeEventListener("sessionstart", onXRSessionStart); - xr.removeEventListener("sessionend", onXRSessionEnd); - animation.stop(); - }; - function onContextLost(event) { - event.preventDefault(); - console.log("THREE.WebGLRenderer: Context Lost."); - _isContextLost = true; - } - __name(onContextLost, "onContextLost"); - function onContextRestore() { - console.log("THREE.WebGLRenderer: Context Restored."); - _isContextLost = false; - const infoAutoReset = info.autoReset; - const shadowMapEnabled = shadowMap.enabled; - const shadowMapAutoUpdate = shadowMap.autoUpdate; - const shadowMapNeedsUpdate = shadowMap.needsUpdate; - const shadowMapType = shadowMap.type; - initGLContext(); - info.autoReset = infoAutoReset; - shadowMap.enabled = shadowMapEnabled; - shadowMap.autoUpdate = shadowMapAutoUpdate; - shadowMap.needsUpdate = shadowMapNeedsUpdate; - shadowMap.type = shadowMapType; - } - __name(onContextRestore, "onContextRestore"); - function onContextCreationError(event) { - console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ", event.statusMessage); - } - __name(onContextCreationError, "onContextCreationError"); - function onMaterialDispose(event) { - const material = event.target; - material.removeEventListener("dispose", onMaterialDispose); - deallocateMaterial(material); - } - __name(onMaterialDispose, "onMaterialDispose"); - function deallocateMaterial(material) { - releaseMaterialProgramReferences(material); - properties.remove(material); - } - __name(deallocateMaterial, "deallocateMaterial"); - function releaseMaterialProgramReferences(material) { - const programs = properties.get(material).programs; - if (programs !== void 0) { - programs.forEach(function(program) { - programCache.releaseProgram(program); - }); - if (material.isShaderMaterial) { - programCache.releaseShaderCache(material); - } - } - } - __name(releaseMaterialProgramReferences, "releaseMaterialProgramReferences"); - this.renderBufferDirect = function(camera, scene, geometry, material, object, group) { - if (scene === null) scene = _emptyScene; - const frontFaceCW = object.isMesh && object.matrixWorld.determinant() < 0; - const program = setProgram(camera, scene, geometry, material, object); - state.setMaterial(material, frontFaceCW); - let index = geometry.index; - let rangeFactor = 1; - if (material.wireframe === true) { - index = geometries.getWireframeAttribute(geometry); - if (index === void 0) return; - rangeFactor = 2; - } - const drawRange = geometry.drawRange; - const position = geometry.attributes.position; - let drawStart = drawRange.start * rangeFactor; - let drawEnd = (drawRange.start + drawRange.count) * rangeFactor; - if (group !== null) { - drawStart = Math.max(drawStart, group.start * rangeFactor); - drawEnd = Math.min(drawEnd, (group.start + group.count) * rangeFactor); - } - if (index !== null) { - drawStart = Math.max(drawStart, 0); - drawEnd = Math.min(drawEnd, index.count); - } else if (position !== void 0 && position !== null) { - drawStart = Math.max(drawStart, 0); - drawEnd = Math.min(drawEnd, position.count); - } - const drawCount = drawEnd - drawStart; - if (drawCount < 0 || drawCount === Infinity) return; - bindingStates.setup(object, material, program, geometry, index); - let attribute; - let renderer = bufferRenderer; - if (index !== null) { - attribute = attributes.get(index); - renderer = indexedBufferRenderer; - renderer.setIndex(attribute); - } - if (object.isMesh) { - if (material.wireframe === true) { - state.setLineWidth(material.wireframeLinewidth * getTargetPixelRatio()); - renderer.setMode(_gl.LINES); - } else { - renderer.setMode(_gl.TRIANGLES); - } - } else if (object.isLine) { - let lineWidth = material.linewidth; - if (lineWidth === void 0) lineWidth = 1; - state.setLineWidth(lineWidth * getTargetPixelRatio()); - if (object.isLineSegments) { - renderer.setMode(_gl.LINES); - } else if (object.isLineLoop) { - renderer.setMode(_gl.LINE_LOOP); - } else { - renderer.setMode(_gl.LINE_STRIP); - } - } else if (object.isPoints) { - renderer.setMode(_gl.POINTS); - } else if (object.isSprite) { - renderer.setMode(_gl.TRIANGLES); - } - if (object.isBatchedMesh) { - if (object._multiDrawInstances !== null) { - renderer.renderMultiDrawInstances(object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances); - } else { - if (!extensions.get("WEBGL_multi_draw")) { - const starts = object._multiDrawStarts; - const counts = object._multiDrawCounts; - const drawCount2 = object._multiDrawCount; - const bytesPerElement = index ? attributes.get(index).bytesPerElement : 1; - const uniforms = properties.get(material).currentProgram.getUniforms(); - for (let i = 0; i < drawCount2; i++) { - uniforms.setValue(_gl, "_gl_DrawID", i); - renderer.render(starts[i] / bytesPerElement, counts[i]); - } - } else { - renderer.renderMultiDraw(object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount); - } - } - } else if (object.isInstancedMesh) { - renderer.renderInstances(drawStart, drawCount, object.count); - } else if (geometry.isInstancedBufferGeometry) { - const maxInstanceCount = geometry._maxInstanceCount !== void 0 ? geometry._maxInstanceCount : Infinity; - const instanceCount = Math.min(geometry.instanceCount, maxInstanceCount); - renderer.renderInstances(drawStart, drawCount, instanceCount); - } else { - renderer.render(drawStart, drawCount); - } - }; - function prepareMaterial(material, scene, object) { - if (material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false) { - material.side = BackSide; - material.needsUpdate = true; - getProgram(material, scene, object); - material.side = FrontSide; - material.needsUpdate = true; - getProgram(material, scene, object); - material.side = DoubleSide; - } else { - getProgram(material, scene, object); - } - } - __name(prepareMaterial, "prepareMaterial"); - this.compile = function(scene, camera, targetScene = null) { - if (targetScene === null) targetScene = scene; - currentRenderState = renderStates.get(targetScene); - currentRenderState.init(camera); - renderStateStack.push(currentRenderState); - targetScene.traverseVisible(function(object) { - if (object.isLight && object.layers.test(camera.layers)) { - currentRenderState.pushLight(object); - if (object.castShadow) { - currentRenderState.pushShadow(object); - } - } - }); - if (scene !== targetScene) { - scene.traverseVisible(function(object) { - if (object.isLight && object.layers.test(camera.layers)) { - currentRenderState.pushLight(object); - if (object.castShadow) { - currentRenderState.pushShadow(object); - } - } - }); - } - currentRenderState.setupLights(); - const materials2 = /* @__PURE__ */ new Set(); - scene.traverse(function(object) { - if (!(object.isMesh || object.isPoints || object.isLine || object.isSprite)) { - return; - } - const material = object.material; - if (material) { - if (Array.isArray(material)) { - for (let i = 0; i < material.length; i++) { - const material2 = material[i]; - prepareMaterial(material2, targetScene, object); - materials2.add(material2); - } - } else { - prepareMaterial(material, targetScene, object); - materials2.add(material); - } - } - }); - renderStateStack.pop(); - currentRenderState = null; - return materials2; - }; - this.compileAsync = function(scene, camera, targetScene = null) { - const materials2 = this.compile(scene, camera, targetScene); - return new Promise((resolve) => { - function checkMaterialsReady() { - materials2.forEach(function(material) { - const materialProperties = properties.get(material); - const program = materialProperties.currentProgram; - if (program.isReady()) { - materials2.delete(material); - } - }); - if (materials2.size === 0) { - resolve(scene); - return; - } - setTimeout(checkMaterialsReady, 10); - } - __name(checkMaterialsReady, "checkMaterialsReady"); - if (extensions.get("KHR_parallel_shader_compile") !== null) { - checkMaterialsReady(); - } else { - setTimeout(checkMaterialsReady, 10); - } - }); - }; - let onAnimationFrameCallback = null; - function onAnimationFrame(time) { - if (onAnimationFrameCallback) onAnimationFrameCallback(time); - } - __name(onAnimationFrame, "onAnimationFrame"); - function onXRSessionStart() { - animation.stop(); - } - __name(onXRSessionStart, "onXRSessionStart"); - function onXRSessionEnd() { - animation.start(); - } - __name(onXRSessionEnd, "onXRSessionEnd"); - const animation = new WebGLAnimation(); - animation.setAnimationLoop(onAnimationFrame); - if (typeof self !== "undefined") animation.setContext(self); - this.setAnimationLoop = function(callback) { - onAnimationFrameCallback = callback; - xr.setAnimationLoop(callback); - callback === null ? animation.stop() : animation.start(); - }; - xr.addEventListener("sessionstart", onXRSessionStart); - xr.addEventListener("sessionend", onXRSessionEnd); - this.render = function(scene, camera) { - if (camera !== void 0 && camera.isCamera !== true) { - console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."); - return; - } - if (_isContextLost === true) return; - if (scene.matrixWorldAutoUpdate === true) scene.updateMatrixWorld(); - if (camera.parent === null && camera.matrixWorldAutoUpdate === true) camera.updateMatrixWorld(); - if (xr.enabled === true && xr.isPresenting === true) { - if (xr.cameraAutoUpdate === true) xr.updateCamera(camera); - camera = xr.getCamera(); - } - if (scene.isScene === true) scene.onBeforeRender(_this, scene, camera, _currentRenderTarget); - currentRenderState = renderStates.get(scene, renderStateStack.length); - currentRenderState.init(camera); - renderStateStack.push(currentRenderState); - _projScreenMatrix2.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse); - _frustum2.setFromProjectionMatrix(_projScreenMatrix2); - _localClippingEnabled = this.localClippingEnabled; - _clippingEnabled = clipping.init(this.clippingPlanes, _localClippingEnabled); - currentRenderList = renderLists.get(scene, renderListStack.length); - currentRenderList.init(); - renderListStack.push(currentRenderList); - if (xr.enabled === true && xr.isPresenting === true) { - const depthSensingMesh = _this.xr.getDepthSensingMesh(); - if (depthSensingMesh !== null) { - projectObject(depthSensingMesh, camera, -Infinity, _this.sortObjects); - } - } - projectObject(scene, camera, 0, _this.sortObjects); - currentRenderList.finish(); - if (_this.sortObjects === true) { - currentRenderList.sort(_opaqueSort, _transparentSort); - } - _renderBackground = xr.enabled === false || xr.isPresenting === false || xr.hasDepthSensing() === false; - if (_renderBackground) { - background.addToRenderList(currentRenderList, scene); - } - this.info.render.frame++; - if (_clippingEnabled === true) clipping.beginShadows(); - const shadowsArray = currentRenderState.state.shadowsArray; - shadowMap.render(shadowsArray, scene, camera); - if (_clippingEnabled === true) clipping.endShadows(); - if (this.info.autoReset === true) this.info.reset(); - const opaqueObjects = currentRenderList.opaque; - const transmissiveObjects = currentRenderList.transmissive; - currentRenderState.setupLights(); - if (camera.isArrayCamera) { - const cameras = camera.cameras; - if (transmissiveObjects.length > 0) { - for (let i = 0, l = cameras.length; i < l; i++) { - const camera2 = cameras[i]; - renderTransmissionPass(opaqueObjects, transmissiveObjects, scene, camera2); - } - } - if (_renderBackground) background.render(scene); - for (let i = 0, l = cameras.length; i < l; i++) { - const camera2 = cameras[i]; - renderScene(currentRenderList, scene, camera2, camera2.viewport); - } - } else { - if (transmissiveObjects.length > 0) renderTransmissionPass(opaqueObjects, transmissiveObjects, scene, camera); - if (_renderBackground) background.render(scene); - renderScene(currentRenderList, scene, camera); - } - if (_currentRenderTarget !== null) { - textures.updateMultisampleRenderTarget(_currentRenderTarget); - textures.updateRenderTargetMipmap(_currentRenderTarget); - } - if (scene.isScene === true) scene.onAfterRender(_this, scene, camera); - bindingStates.resetDefaultState(); - _currentMaterialId = -1; - _currentCamera = null; - renderStateStack.pop(); - if (renderStateStack.length > 0) { - currentRenderState = renderStateStack[renderStateStack.length - 1]; - if (_clippingEnabled === true) clipping.setGlobalState(_this.clippingPlanes, currentRenderState.state.camera); - } else { - currentRenderState = null; - } - renderListStack.pop(); - if (renderListStack.length > 0) { - currentRenderList = renderListStack[renderListStack.length - 1]; - } else { - currentRenderList = null; - } - }; - function projectObject(object, camera, groupOrder, sortObjects) { - if (object.visible === false) return; - const visible = object.layers.test(camera.layers); - if (visible) { - if (object.isGroup) { - groupOrder = object.renderOrder; - } else if (object.isLOD) { - if (object.autoUpdate === true) object.update(camera); - } else if (object.isLight) { - currentRenderState.pushLight(object); - if (object.castShadow) { - currentRenderState.pushShadow(object); - } - } else if (object.isSprite) { - if (!object.frustumCulled || _frustum2.intersectsSprite(object)) { - if (sortObjects) { - _vector4.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix2); - } - const geometry = objects.update(object); - const material = object.material; - if (material.visible) { - currentRenderList.push(object, geometry, material, groupOrder, _vector4.z, null); - } - } - } else if (object.isMesh || object.isLine || object.isPoints) { - if (!object.frustumCulled || _frustum2.intersectsObject(object)) { - const geometry = objects.update(object); - const material = object.material; - if (sortObjects) { - if (object.boundingSphere !== void 0) { - if (object.boundingSphere === null) object.computeBoundingSphere(); - _vector4.copy(object.boundingSphere.center); - } else { - if (geometry.boundingSphere === null) geometry.computeBoundingSphere(); - _vector4.copy(geometry.boundingSphere.center); - } - _vector4.applyMatrix4(object.matrixWorld).applyMatrix4(_projScreenMatrix2); - } - if (Array.isArray(material)) { - const groups = geometry.groups; - for (let i = 0, l = groups.length; i < l; i++) { - const group = groups[i]; - const groupMaterial = material[group.materialIndex]; - if (groupMaterial && groupMaterial.visible) { - currentRenderList.push(object, geometry, groupMaterial, groupOrder, _vector4.z, group); - } - } - } else if (material.visible) { - currentRenderList.push(object, geometry, material, groupOrder, _vector4.z, null); - } - } - } - } - const children = object.children; - for (let i = 0, l = children.length; i < l; i++) { - projectObject(children[i], camera, groupOrder, sortObjects); - } - } - __name(projectObject, "projectObject"); - function renderScene(currentRenderList2, scene, camera, viewport) { - const opaqueObjects = currentRenderList2.opaque; - const transmissiveObjects = currentRenderList2.transmissive; - const transparentObjects = currentRenderList2.transparent; - currentRenderState.setupLightsView(camera); - if (_clippingEnabled === true) clipping.setGlobalState(_this.clippingPlanes, camera); - if (viewport) state.viewport(_currentViewport.copy(viewport)); - if (opaqueObjects.length > 0) renderObjects(opaqueObjects, scene, camera); - if (transmissiveObjects.length > 0) renderObjects(transmissiveObjects, scene, camera); - if (transparentObjects.length > 0) renderObjects(transparentObjects, scene, camera); - state.buffers.depth.setTest(true); - state.buffers.depth.setMask(true); - state.buffers.color.setMask(true); - state.setPolygonOffset(false); - } - __name(renderScene, "renderScene"); - function renderTransmissionPass(opaqueObjects, transmissiveObjects, scene, camera) { - const overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null; - if (overrideMaterial !== null) { - return; - } - if (currentRenderState.state.transmissionRenderTarget[camera.id] === void 0) { - currentRenderState.state.transmissionRenderTarget[camera.id] = new WebGLRenderTarget(1, 1, { - generateMipmaps: true, - type: extensions.has("EXT_color_buffer_half_float") || extensions.has("EXT_color_buffer_float") ? HalfFloatType : UnsignedByteType, - minFilter: LinearMipmapLinearFilter, - samples: 4, - stencilBuffer: stencil, - resolveDepthBuffer: false, - resolveStencilBuffer: false, - colorSpace: ColorManagement.workingColorSpace - }); - } - const transmissionRenderTarget = currentRenderState.state.transmissionRenderTarget[camera.id]; - const activeViewport = camera.viewport || _currentViewport; - transmissionRenderTarget.setSize(activeViewport.z, activeViewport.w); - const currentRenderTarget = _this.getRenderTarget(); - _this.setRenderTarget(transmissionRenderTarget); - _this.getClearColor(_currentClearColor); - _currentClearAlpha = _this.getClearAlpha(); - if (_currentClearAlpha < 1) _this.setClearColor(16777215, 0.5); - _this.clear(); - if (_renderBackground) background.render(scene); - const currentToneMapping = _this.toneMapping; - _this.toneMapping = NoToneMapping; - const currentCameraViewport = camera.viewport; - if (camera.viewport !== void 0) camera.viewport = void 0; - currentRenderState.setupLightsView(camera); - if (_clippingEnabled === true) clipping.setGlobalState(_this.clippingPlanes, camera); - renderObjects(opaqueObjects, scene, camera); - textures.updateMultisampleRenderTarget(transmissionRenderTarget); - textures.updateRenderTargetMipmap(transmissionRenderTarget); - if (extensions.has("WEBGL_multisampled_render_to_texture") === false) { - let renderTargetNeedsUpdate = false; - for (let i = 0, l = transmissiveObjects.length; i < l; i++) { - const renderItem = transmissiveObjects[i]; - const object = renderItem.object; - const geometry = renderItem.geometry; - const material = renderItem.material; - const group = renderItem.group; - if (material.side === DoubleSide && object.layers.test(camera.layers)) { - const currentSide = material.side; - material.side = BackSide; - material.needsUpdate = true; - renderObject(object, scene, camera, geometry, material, group); - material.side = currentSide; - material.needsUpdate = true; - renderTargetNeedsUpdate = true; - } - } - if (renderTargetNeedsUpdate === true) { - textures.updateMultisampleRenderTarget(transmissionRenderTarget); - textures.updateRenderTargetMipmap(transmissionRenderTarget); - } - } - _this.setRenderTarget(currentRenderTarget); - _this.setClearColor(_currentClearColor, _currentClearAlpha); - if (currentCameraViewport !== void 0) camera.viewport = currentCameraViewport; - _this.toneMapping = currentToneMapping; - } - __name(renderTransmissionPass, "renderTransmissionPass"); - function renderObjects(renderList2, scene, camera) { - const overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null; - for (let i = 0, l = renderList2.length; i < l; i++) { - const renderItem = renderList2[i]; - const object = renderItem.object; - const geometry = renderItem.geometry; - const material = overrideMaterial === null ? renderItem.material : overrideMaterial; - const group = renderItem.group; - if (object.layers.test(camera.layers)) { - renderObject(object, scene, camera, geometry, material, group); - } - } - } - __name(renderObjects, "renderObjects"); - function renderObject(object, scene, camera, geometry, material, group) { - object.onBeforeRender(_this, scene, camera, geometry, material, group); - object.modelViewMatrix.multiplyMatrices(camera.matrixWorldInverse, object.matrixWorld); - object.normalMatrix.getNormalMatrix(object.modelViewMatrix); - material.onBeforeRender(_this, scene, camera, geometry, object, group); - if (material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false) { - material.side = BackSide; - material.needsUpdate = true; - _this.renderBufferDirect(camera, scene, geometry, material, object, group); - material.side = FrontSide; - material.needsUpdate = true; - _this.renderBufferDirect(camera, scene, geometry, material, object, group); - material.side = DoubleSide; - } else { - _this.renderBufferDirect(camera, scene, geometry, material, object, group); - } - object.onAfterRender(_this, scene, camera, geometry, material, group); - } - __name(renderObject, "renderObject"); - function getProgram(material, scene, object) { - if (scene.isScene !== true) scene = _emptyScene; - const materialProperties = properties.get(material); - const lights = currentRenderState.state.lights; - const shadowsArray = currentRenderState.state.shadowsArray; - const lightsStateVersion = lights.state.version; - const parameters2 = programCache.getParameters(material, lights.state, shadowsArray, scene, object); - const programCacheKey = programCache.getProgramCacheKey(parameters2); - let programs = materialProperties.programs; - materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null; - materialProperties.fog = scene.fog; - materialProperties.envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || materialProperties.environment); - materialProperties.envMapRotation = materialProperties.environment !== null && material.envMap === null ? scene.environmentRotation : material.envMapRotation; - if (programs === void 0) { - material.addEventListener("dispose", onMaterialDispose); - programs = /* @__PURE__ */ new Map(); - materialProperties.programs = programs; - } - let program = programs.get(programCacheKey); - if (program !== void 0) { - if (materialProperties.currentProgram === program && materialProperties.lightsStateVersion === lightsStateVersion) { - updateCommonMaterialProperties(material, parameters2); - return program; - } - } else { - parameters2.uniforms = programCache.getUniforms(material); - material.onBeforeCompile(parameters2, _this); - program = programCache.acquireProgram(parameters2, programCacheKey); - programs.set(programCacheKey, program); - materialProperties.uniforms = parameters2.uniforms; - } - const uniforms = materialProperties.uniforms; - if (!material.isShaderMaterial && !material.isRawShaderMaterial || material.clipping === true) { - uniforms.clippingPlanes = clipping.uniform; - } - updateCommonMaterialProperties(material, parameters2); - materialProperties.needsLights = materialNeedsLights(material); - materialProperties.lightsStateVersion = lightsStateVersion; - if (materialProperties.needsLights) { - uniforms.ambientLightColor.value = lights.state.ambient; - uniforms.lightProbe.value = lights.state.probe; - uniforms.directionalLights.value = lights.state.directional; - uniforms.directionalLightShadows.value = lights.state.directionalShadow; - uniforms.spotLights.value = lights.state.spot; - uniforms.spotLightShadows.value = lights.state.spotShadow; - uniforms.rectAreaLights.value = lights.state.rectArea; - uniforms.ltc_1.value = lights.state.rectAreaLTC1; - uniforms.ltc_2.value = lights.state.rectAreaLTC2; - uniforms.pointLights.value = lights.state.point; - uniforms.pointLightShadows.value = lights.state.pointShadow; - uniforms.hemisphereLights.value = lights.state.hemi; - uniforms.directionalShadowMap.value = lights.state.directionalShadowMap; - uniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix; - uniforms.spotShadowMap.value = lights.state.spotShadowMap; - uniforms.spotLightMatrix.value = lights.state.spotLightMatrix; - uniforms.spotLightMap.value = lights.state.spotLightMap; - uniforms.pointShadowMap.value = lights.state.pointShadowMap; - uniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix; - } - materialProperties.currentProgram = program; - materialProperties.uniformsList = null; - return program; - } - __name(getProgram, "getProgram"); - function getUniformList(materialProperties) { - if (materialProperties.uniformsList === null) { - const progUniforms = materialProperties.currentProgram.getUniforms(); - materialProperties.uniformsList = WebGLUniforms.seqWithValue(progUniforms.seq, materialProperties.uniforms); - } - return materialProperties.uniformsList; - } - __name(getUniformList, "getUniformList"); - function updateCommonMaterialProperties(material, parameters2) { - const materialProperties = properties.get(material); - materialProperties.outputColorSpace = parameters2.outputColorSpace; - materialProperties.batching = parameters2.batching; - materialProperties.batchingColor = parameters2.batchingColor; - materialProperties.instancing = parameters2.instancing; - materialProperties.instancingColor = parameters2.instancingColor; - materialProperties.instancingMorph = parameters2.instancingMorph; - materialProperties.skinning = parameters2.skinning; - materialProperties.morphTargets = parameters2.morphTargets; - materialProperties.morphNormals = parameters2.morphNormals; - materialProperties.morphColors = parameters2.morphColors; - materialProperties.morphTargetsCount = parameters2.morphTargetsCount; - materialProperties.numClippingPlanes = parameters2.numClippingPlanes; - materialProperties.numIntersection = parameters2.numClipIntersection; - materialProperties.vertexAlphas = parameters2.vertexAlphas; - materialProperties.vertexTangents = parameters2.vertexTangents; - materialProperties.toneMapping = parameters2.toneMapping; - } - __name(updateCommonMaterialProperties, "updateCommonMaterialProperties"); - function setProgram(camera, scene, geometry, material, object) { - if (scene.isScene !== true) scene = _emptyScene; - textures.resetTextureUnits(); - const fog = scene.fog; - const environment = material.isMeshStandardMaterial ? scene.environment : null; - const colorSpace = _currentRenderTarget === null ? _this.outputColorSpace : _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace; - const envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || environment); - const vertexAlphas = material.vertexColors === true && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4; - const vertexTangents = !!geometry.attributes.tangent && (!!material.normalMap || material.anisotropy > 0); - const morphTargets = !!geometry.morphAttributes.position; - const morphNormals = !!geometry.morphAttributes.normal; - const morphColors = !!geometry.morphAttributes.color; - let toneMapping = NoToneMapping; - if (material.toneMapped) { - if (_currentRenderTarget === null || _currentRenderTarget.isXRRenderTarget === true) { - toneMapping = _this.toneMapping; - } - } - const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color; - const morphTargetsCount = morphAttribute !== void 0 ? morphAttribute.length : 0; - const materialProperties = properties.get(material); - const lights = currentRenderState.state.lights; - if (_clippingEnabled === true) { - if (_localClippingEnabled === true || camera !== _currentCamera) { - const useCache = camera === _currentCamera && material.id === _currentMaterialId; - clipping.setState(material, camera, useCache); - } - } - let needsProgramChange = false; - if (material.version === materialProperties.__version) { - if (materialProperties.needsLights && materialProperties.lightsStateVersion !== lights.state.version) { - needsProgramChange = true; - } else if (materialProperties.outputColorSpace !== colorSpace) { - needsProgramChange = true; - } else if (object.isBatchedMesh && materialProperties.batching === false) { - needsProgramChange = true; - } else if (!object.isBatchedMesh && materialProperties.batching === true) { - needsProgramChange = true; - } else if (object.isBatchedMesh && materialProperties.batchingColor === true && object.colorTexture === null) { - needsProgramChange = true; - } else if (object.isBatchedMesh && materialProperties.batchingColor === false && object.colorTexture !== null) { - needsProgramChange = true; - } else if (object.isInstancedMesh && materialProperties.instancing === false) { - needsProgramChange = true; - } else if (!object.isInstancedMesh && materialProperties.instancing === true) { - needsProgramChange = true; - } else if (object.isSkinnedMesh && materialProperties.skinning === false) { - needsProgramChange = true; - } else if (!object.isSkinnedMesh && materialProperties.skinning === true) { - needsProgramChange = true; - } else if (object.isInstancedMesh && materialProperties.instancingColor === true && object.instanceColor === null) { - needsProgramChange = true; - } else if (object.isInstancedMesh && materialProperties.instancingColor === false && object.instanceColor !== null) { - needsProgramChange = true; - } else if (object.isInstancedMesh && materialProperties.instancingMorph === true && object.morphTexture === null) { - needsProgramChange = true; - } else if (object.isInstancedMesh && materialProperties.instancingMorph === false && object.morphTexture !== null) { - needsProgramChange = true; - } else if (materialProperties.envMap !== envMap) { - needsProgramChange = true; - } else if (material.fog === true && materialProperties.fog !== fog) { - needsProgramChange = true; - } else if (materialProperties.numClippingPlanes !== void 0 && (materialProperties.numClippingPlanes !== clipping.numPlanes || materialProperties.numIntersection !== clipping.numIntersection)) { - needsProgramChange = true; - } else if (materialProperties.vertexAlphas !== vertexAlphas) { - needsProgramChange = true; - } else if (materialProperties.vertexTangents !== vertexTangents) { - needsProgramChange = true; - } else if (materialProperties.morphTargets !== morphTargets) { - needsProgramChange = true; - } else if (materialProperties.morphNormals !== morphNormals) { - needsProgramChange = true; - } else if (materialProperties.morphColors !== morphColors) { - needsProgramChange = true; - } else if (materialProperties.toneMapping !== toneMapping) { - needsProgramChange = true; - } else if (materialProperties.morphTargetsCount !== morphTargetsCount) { - needsProgramChange = true; - } - } else { - needsProgramChange = true; - materialProperties.__version = material.version; - } - let program = materialProperties.currentProgram; - if (needsProgramChange === true) { - program = getProgram(material, scene, object); - } - let refreshProgram = false; - let refreshMaterial = false; - let refreshLights = false; - const p_uniforms = program.getUniforms(), m_uniforms = materialProperties.uniforms; - if (state.useProgram(program.program)) { - refreshProgram = true; - refreshMaterial = true; - refreshLights = true; - } - if (material.id !== _currentMaterialId) { - _currentMaterialId = material.id; - refreshMaterial = true; - } - if (refreshProgram || _currentCamera !== camera) { - const reverseDepthBuffer2 = state.buffers.depth.getReversed(); - if (reverseDepthBuffer2) { - _currentProjectionMatrix.copy(camera.projectionMatrix); - toNormalizedProjectionMatrix(_currentProjectionMatrix); - toReversedProjectionMatrix(_currentProjectionMatrix); - p_uniforms.setValue(_gl, "projectionMatrix", _currentProjectionMatrix); - } else { - p_uniforms.setValue(_gl, "projectionMatrix", camera.projectionMatrix); - } - p_uniforms.setValue(_gl, "viewMatrix", camera.matrixWorldInverse); - const uCamPos = p_uniforms.map.cameraPosition; - if (uCamPos !== void 0) { - uCamPos.setValue(_gl, _vector32.setFromMatrixPosition(camera.matrixWorld)); - } - if (capabilities.logarithmicDepthBuffer) { - p_uniforms.setValue( - _gl, - "logDepthBufFC", - 2 / (Math.log(camera.far + 1) / Math.LN2) - ); - } - if (material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshLambertMaterial || material.isMeshBasicMaterial || material.isMeshStandardMaterial || material.isShaderMaterial) { - p_uniforms.setValue(_gl, "isOrthographic", camera.isOrthographicCamera === true); - } - if (_currentCamera !== camera) { - _currentCamera = camera; - refreshMaterial = true; - refreshLights = true; - } - } - if (object.isSkinnedMesh) { - p_uniforms.setOptional(_gl, object, "bindMatrix"); - p_uniforms.setOptional(_gl, object, "bindMatrixInverse"); - const skeleton = object.skeleton; - if (skeleton) { - if (skeleton.boneTexture === null) skeleton.computeBoneTexture(); - p_uniforms.setValue(_gl, "boneTexture", skeleton.boneTexture, textures); - } - } - if (object.isBatchedMesh) { - p_uniforms.setOptional(_gl, object, "batchingTexture"); - p_uniforms.setValue(_gl, "batchingTexture", object._matricesTexture, textures); - p_uniforms.setOptional(_gl, object, "batchingIdTexture"); - p_uniforms.setValue(_gl, "batchingIdTexture", object._indirectTexture, textures); - p_uniforms.setOptional(_gl, object, "batchingColorTexture"); - if (object._colorsTexture !== null) { - p_uniforms.setValue(_gl, "batchingColorTexture", object._colorsTexture, textures); - } - } - const morphAttributes = geometry.morphAttributes; - if (morphAttributes.position !== void 0 || morphAttributes.normal !== void 0 || morphAttributes.color !== void 0) { - morphtargets.update(object, geometry, program); - } - if (refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow) { - materialProperties.receiveShadow = object.receiveShadow; - p_uniforms.setValue(_gl, "receiveShadow", object.receiveShadow); - } - if (material.isMeshGouraudMaterial && material.envMap !== null) { - m_uniforms.envMap.value = envMap; - m_uniforms.flipEnvMap.value = envMap.isCubeTexture && envMap.isRenderTargetTexture === false ? -1 : 1; - } - if (material.isMeshStandardMaterial && material.envMap === null && scene.environment !== null) { - m_uniforms.envMapIntensity.value = scene.environmentIntensity; - } - if (refreshMaterial) { - p_uniforms.setValue(_gl, "toneMappingExposure", _this.toneMappingExposure); - if (materialProperties.needsLights) { - markUniformsLightsNeedsUpdate(m_uniforms, refreshLights); - } - if (fog && material.fog === true) { - materials.refreshFogUniforms(m_uniforms, fog); - } - materials.refreshMaterialUniforms(m_uniforms, material, _pixelRatio, _height, currentRenderState.state.transmissionRenderTarget[camera.id]); - WebGLUniforms.upload(_gl, getUniformList(materialProperties), m_uniforms, textures); - } - if (material.isShaderMaterial && material.uniformsNeedUpdate === true) { - WebGLUniforms.upload(_gl, getUniformList(materialProperties), m_uniforms, textures); - material.uniformsNeedUpdate = false; - } - if (material.isSpriteMaterial) { - p_uniforms.setValue(_gl, "center", object.center); - } - p_uniforms.setValue(_gl, "modelViewMatrix", object.modelViewMatrix); - p_uniforms.setValue(_gl, "normalMatrix", object.normalMatrix); - p_uniforms.setValue(_gl, "modelMatrix", object.matrixWorld); - if (material.isShaderMaterial || material.isRawShaderMaterial) { - const groups = material.uniformsGroups; - for (let i = 0, l = groups.length; i < l; i++) { - const group = groups[i]; - uniformsGroups.update(group, program); - uniformsGroups.bind(group, program); - } - } - return program; - } - __name(setProgram, "setProgram"); - function markUniformsLightsNeedsUpdate(uniforms, value) { - uniforms.ambientLightColor.needsUpdate = value; - uniforms.lightProbe.needsUpdate = value; - uniforms.directionalLights.needsUpdate = value; - uniforms.directionalLightShadows.needsUpdate = value; - uniforms.pointLights.needsUpdate = value; - uniforms.pointLightShadows.needsUpdate = value; - uniforms.spotLights.needsUpdate = value; - uniforms.spotLightShadows.needsUpdate = value; - uniforms.rectAreaLights.needsUpdate = value; - uniforms.hemisphereLights.needsUpdate = value; - } - __name(markUniformsLightsNeedsUpdate, "markUniformsLightsNeedsUpdate"); - function materialNeedsLights(material) { - return material.isMeshLambertMaterial || material.isMeshToonMaterial || material.isMeshPhongMaterial || material.isMeshStandardMaterial || material.isShadowMaterial || material.isShaderMaterial && material.lights === true; - } - __name(materialNeedsLights, "materialNeedsLights"); - this.getActiveCubeFace = function() { - return _currentActiveCubeFace; - }; - this.getActiveMipmapLevel = function() { - return _currentActiveMipmapLevel; - }; - this.getRenderTarget = function() { - return _currentRenderTarget; - }; - this.setRenderTargetTextures = function(renderTarget, colorTexture, depthTexture) { - properties.get(renderTarget.texture).__webglTexture = colorTexture; - properties.get(renderTarget.depthTexture).__webglTexture = depthTexture; - const renderTargetProperties = properties.get(renderTarget); - renderTargetProperties.__hasExternalTextures = true; - renderTargetProperties.__autoAllocateDepthBuffer = depthTexture === void 0; - if (!renderTargetProperties.__autoAllocateDepthBuffer) { - if (extensions.has("WEBGL_multisampled_render_to_texture") === true) { - console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"); - renderTargetProperties.__useRenderToTexture = false; - } - } - }; - this.setRenderTargetFramebuffer = function(renderTarget, defaultFramebuffer) { - const renderTargetProperties = properties.get(renderTarget); - renderTargetProperties.__webglFramebuffer = defaultFramebuffer; - renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === void 0; - }; - this.setRenderTarget = function(renderTarget, activeCubeFace = 0, activeMipmapLevel = 0) { - _currentRenderTarget = renderTarget; - _currentActiveCubeFace = activeCubeFace; - _currentActiveMipmapLevel = activeMipmapLevel; - let useDefaultFramebuffer = true; - let framebuffer = null; - let isCube = false; - let isRenderTarget3D = false; - if (renderTarget) { - const renderTargetProperties = properties.get(renderTarget); - if (renderTargetProperties.__useDefaultFramebuffer !== void 0) { - state.bindFramebuffer(_gl.FRAMEBUFFER, null); - useDefaultFramebuffer = false; - } else if (renderTargetProperties.__webglFramebuffer === void 0) { - textures.setupRenderTarget(renderTarget); - } else if (renderTargetProperties.__hasExternalTextures) { - textures.rebindTextures(renderTarget, properties.get(renderTarget.texture).__webglTexture, properties.get(renderTarget.depthTexture).__webglTexture); - } else if (renderTarget.depthBuffer) { - const depthTexture = renderTarget.depthTexture; - if (renderTargetProperties.__boundDepthTexture !== depthTexture) { - if (depthTexture !== null && properties.has(depthTexture) && (renderTarget.width !== depthTexture.image.width || renderTarget.height !== depthTexture.image.height)) { - throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size."); - } - textures.setupDepthRenderbuffer(renderTarget); - } - } - const texture = renderTarget.texture; - if (texture.isData3DTexture || texture.isDataArrayTexture || texture.isCompressedArrayTexture) { - isRenderTarget3D = true; - } - const __webglFramebuffer = properties.get(renderTarget).__webglFramebuffer; - if (renderTarget.isWebGLCubeRenderTarget) { - if (Array.isArray(__webglFramebuffer[activeCubeFace])) { - framebuffer = __webglFramebuffer[activeCubeFace][activeMipmapLevel]; - } else { - framebuffer = __webglFramebuffer[activeCubeFace]; - } - isCube = true; - } else if (renderTarget.samples > 0 && textures.useMultisampledRTT(renderTarget) === false) { - framebuffer = properties.get(renderTarget).__webglMultisampledFramebuffer; - } else { - if (Array.isArray(__webglFramebuffer)) { - framebuffer = __webglFramebuffer[activeMipmapLevel]; - } else { - framebuffer = __webglFramebuffer; - } - } - _currentViewport.copy(renderTarget.viewport); - _currentScissor.copy(renderTarget.scissor); - _currentScissorTest = renderTarget.scissorTest; - } else { - _currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor(); - _currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor(); - _currentScissorTest = _scissorTest; - } - const framebufferBound = state.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer); - if (framebufferBound && useDefaultFramebuffer) { - state.drawBuffers(renderTarget, framebuffer); - } - state.viewport(_currentViewport); - state.scissor(_currentScissor); - state.setScissorTest(_currentScissorTest); - if (isCube) { - const textureProperties = properties.get(renderTarget.texture); - _gl.framebufferTexture2D(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + activeCubeFace, textureProperties.__webglTexture, activeMipmapLevel); - } else if (isRenderTarget3D) { - const textureProperties = properties.get(renderTarget.texture); - const layer = activeCubeFace || 0; - _gl.framebufferTextureLayer(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureProperties.__webglTexture, activeMipmapLevel || 0, layer); - } - _currentMaterialId = -1; - }; - this.readRenderTargetPixels = function(renderTarget, x, y, width, height, buffer, activeCubeFaceIndex) { - if (!(renderTarget && renderTarget.isWebGLRenderTarget)) { - console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."); - return; - } - let framebuffer = properties.get(renderTarget).__webglFramebuffer; - if (renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== void 0) { - framebuffer = framebuffer[activeCubeFaceIndex]; - } - if (framebuffer) { - state.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer); - try { - const texture = renderTarget.texture; - const textureFormat = texture.format; - const textureType = texture.type; - if (!capabilities.textureFormatReadable(textureFormat)) { - console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."); - return; - } - if (!capabilities.textureTypeReadable(textureType)) { - console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."); - return; - } - if (x >= 0 && x <= renderTarget.width - width && (y >= 0 && y <= renderTarget.height - height)) { - _gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType), buffer); - } - } finally { - const framebuffer2 = _currentRenderTarget !== null ? properties.get(_currentRenderTarget).__webglFramebuffer : null; - state.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer2); - } - } - }; - this.readRenderTargetPixelsAsync = async function(renderTarget, x, y, width, height, buffer, activeCubeFaceIndex) { - if (!(renderTarget && renderTarget.isWebGLRenderTarget)) { - throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."); - } - let framebuffer = properties.get(renderTarget).__webglFramebuffer; - if (renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== void 0) { - framebuffer = framebuffer[activeCubeFaceIndex]; - } - if (framebuffer) { - const texture = renderTarget.texture; - const textureFormat = texture.format; - const textureType = texture.type; - if (!capabilities.textureFormatReadable(textureFormat)) { - throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format."); - } - if (!capabilities.textureTypeReadable(textureType)) { - throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type."); - } - if (x >= 0 && x <= renderTarget.width - width && (y >= 0 && y <= renderTarget.height - height)) { - state.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer); - const glBuffer = _gl.createBuffer(); - _gl.bindBuffer(_gl.PIXEL_PACK_BUFFER, glBuffer); - _gl.bufferData(_gl.PIXEL_PACK_BUFFER, buffer.byteLength, _gl.STREAM_READ); - _gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType), 0); - const currFramebuffer = _currentRenderTarget !== null ? properties.get(_currentRenderTarget).__webglFramebuffer : null; - state.bindFramebuffer(_gl.FRAMEBUFFER, currFramebuffer); - const sync = _gl.fenceSync(_gl.SYNC_GPU_COMMANDS_COMPLETE, 0); - _gl.flush(); - await probeAsync(_gl, sync, 4); - _gl.bindBuffer(_gl.PIXEL_PACK_BUFFER, glBuffer); - _gl.getBufferSubData(_gl.PIXEL_PACK_BUFFER, 0, buffer); - _gl.deleteBuffer(glBuffer); - _gl.deleteSync(sync); - return buffer; - } else { - throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range."); - } - } - }; - this.copyFramebufferToTexture = function(texture, position = null, level = 0) { - if (texture.isTexture !== true) { - warnOnce("WebGLRenderer: copyFramebufferToTexture function signature has changed."); - position = arguments[0] || null; - texture = arguments[1]; - } - const levelScale = Math.pow(2, -level); - const width = Math.floor(texture.image.width * levelScale); - const height = Math.floor(texture.image.height * levelScale); - const x = position !== null ? position.x : 0; - const y = position !== null ? position.y : 0; - textures.setTexture2D(texture, 0); - _gl.copyTexSubImage2D(_gl.TEXTURE_2D, level, 0, 0, x, y, width, height); - state.unbindTexture(); - }; - this.copyTextureToTexture = function(srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0) { - if (srcTexture.isTexture !== true) { - warnOnce("WebGLRenderer: copyTextureToTexture function signature has changed."); - dstPosition = arguments[0] || null; - srcTexture = arguments[1]; - dstTexture = arguments[2]; - level = arguments[3] || 0; - srcRegion = null; - } - let width, height, depth2, minX, minY, minZ; - let dstX, dstY, dstZ; - const image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[level] : srcTexture.image; - if (srcRegion !== null) { - width = srcRegion.max.x - srcRegion.min.x; - height = srcRegion.max.y - srcRegion.min.y; - depth2 = srcRegion.isBox3 ? srcRegion.max.z - srcRegion.min.z : 1; - minX = srcRegion.min.x; - minY = srcRegion.min.y; - minZ = srcRegion.isBox3 ? srcRegion.min.z : 0; - } else { - width = image.width; - height = image.height; - depth2 = image.depth || 1; - minX = 0; - minY = 0; - minZ = 0; - } - if (dstPosition !== null) { - dstX = dstPosition.x; - dstY = dstPosition.y; - dstZ = dstPosition.z; - } else { - dstX = 0; - dstY = 0; - dstZ = 0; - } - const glFormat = utils.convert(dstTexture.format); - const glType = utils.convert(dstTexture.type); - let glTarget; - if (dstTexture.isData3DTexture) { - textures.setTexture3D(dstTexture, 0); - glTarget = _gl.TEXTURE_3D; - } else if (dstTexture.isDataArrayTexture || dstTexture.isCompressedArrayTexture) { - textures.setTexture2DArray(dstTexture, 0); - glTarget = _gl.TEXTURE_2D_ARRAY; - } else { - textures.setTexture2D(dstTexture, 0); - glTarget = _gl.TEXTURE_2D; - } - _gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY); - _gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha); - _gl.pixelStorei(_gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment); - const currentUnpackRowLen = _gl.getParameter(_gl.UNPACK_ROW_LENGTH); - const currentUnpackImageHeight = _gl.getParameter(_gl.UNPACK_IMAGE_HEIGHT); - const currentUnpackSkipPixels = _gl.getParameter(_gl.UNPACK_SKIP_PIXELS); - const currentUnpackSkipRows = _gl.getParameter(_gl.UNPACK_SKIP_ROWS); - const currentUnpackSkipImages = _gl.getParameter(_gl.UNPACK_SKIP_IMAGES); - _gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, image.width); - _gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, image.height); - _gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, minX); - _gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, minY); - _gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, minZ); - const isSrc3D = srcTexture.isDataArrayTexture || srcTexture.isData3DTexture; - const isDst3D = dstTexture.isDataArrayTexture || dstTexture.isData3DTexture; - if (srcTexture.isRenderTargetTexture || srcTexture.isDepthTexture) { - const srcTextureProperties = properties.get(srcTexture); - const dstTextureProperties = properties.get(dstTexture); - const srcRenderTargetProperties = properties.get(srcTextureProperties.__renderTarget); - const dstRenderTargetProperties = properties.get(dstTextureProperties.__renderTarget); - state.bindFramebuffer(_gl.READ_FRAMEBUFFER, srcRenderTargetProperties.__webglFramebuffer); - state.bindFramebuffer(_gl.DRAW_FRAMEBUFFER, dstRenderTargetProperties.__webglFramebuffer); - for (let i = 0; i < depth2; i++) { - if (isSrc3D) { - _gl.framebufferTextureLayer(_gl.READ_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, properties.get(srcTexture).__webglTexture, level, minZ + i); - } - if (srcTexture.isDepthTexture) { - if (isDst3D) { - _gl.framebufferTextureLayer(_gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, properties.get(dstTexture).__webglTexture, level, dstZ + i); - } - _gl.blitFramebuffer(minX, minY, width, height, dstX, dstY, width, height, _gl.DEPTH_BUFFER_BIT, _gl.NEAREST); - } else if (isDst3D) { - _gl.copyTexSubImage3D(glTarget, level, dstX, dstY, dstZ + i, minX, minY, width, height); - } else { - _gl.copyTexSubImage2D(glTarget, level, dstX, dstY, dstZ + i, minX, minY, width, height); - } - } - state.bindFramebuffer(_gl.READ_FRAMEBUFFER, null); - state.bindFramebuffer(_gl.DRAW_FRAMEBUFFER, null); - } else { - if (isDst3D) { - if (srcTexture.isDataTexture || srcTexture.isData3DTexture) { - _gl.texSubImage3D(glTarget, level, dstX, dstY, dstZ, width, height, depth2, glFormat, glType, image.data); - } else if (dstTexture.isCompressedArrayTexture) { - _gl.compressedTexSubImage3D(glTarget, level, dstX, dstY, dstZ, width, height, depth2, glFormat, image.data); - } else { - _gl.texSubImage3D(glTarget, level, dstX, dstY, dstZ, width, height, depth2, glFormat, glType, image); - } - } else { - if (srcTexture.isDataTexture) { - _gl.texSubImage2D(_gl.TEXTURE_2D, level, dstX, dstY, width, height, glFormat, glType, image.data); - } else if (srcTexture.isCompressedTexture) { - _gl.compressedTexSubImage2D(_gl.TEXTURE_2D, level, dstX, dstY, image.width, image.height, glFormat, image.data); - } else { - _gl.texSubImage2D(_gl.TEXTURE_2D, level, dstX, dstY, width, height, glFormat, glType, image); - } - } - } - _gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, currentUnpackRowLen); - _gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, currentUnpackImageHeight); - _gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels); - _gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows); - _gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, currentUnpackSkipImages); - if (level === 0 && dstTexture.generateMipmaps) { - _gl.generateMipmap(glTarget); - } - state.unbindTexture(); - }; - this.copyTextureToTexture3D = function(srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0) { - if (srcTexture.isTexture !== true) { - warnOnce("WebGLRenderer: copyTextureToTexture3D function signature has changed."); - srcRegion = arguments[0] || null; - dstPosition = arguments[1] || null; - srcTexture = arguments[2]; - dstTexture = arguments[3]; - level = arguments[4] || 0; - } - warnOnce('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'); - return this.copyTextureToTexture(srcTexture, dstTexture, srcRegion, dstPosition, level); - }; - this.initRenderTarget = function(target) { - if (properties.get(target).__webglFramebuffer === void 0) { - textures.setupRenderTarget(target); - } - }; - this.initTexture = function(texture) { - if (texture.isCubeTexture) { - textures.setTextureCube(texture, 0); - } else if (texture.isData3DTexture) { - textures.setTexture3D(texture, 0); - } else if (texture.isDataArrayTexture || texture.isCompressedArrayTexture) { - textures.setTexture2DArray(texture, 0); - } else { - textures.setTexture2D(texture, 0); - } - state.unbindTexture(); - }; - this.resetState = function() { - _currentActiveCubeFace = 0; - _currentActiveMipmapLevel = 0; - _currentRenderTarget = null; - state.reset(); - bindingStates.reset(); - }; - if (typeof __THREE_DEVTOOLS__ !== "undefined") { - __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this })); - } - } - get coordinateSystem() { - return WebGLCoordinateSystem; - } - get outputColorSpace() { - return this._outputColorSpace; - } - set outputColorSpace(colorSpace) { - this._outputColorSpace = colorSpace; - const gl = this.getContext(); - gl.drawingBufferColorspace = ColorManagement._getDrawingBufferColorSpace(colorSpace); - gl.unpackColorSpace = ColorManagement._getUnpackColorSpace(); - } -} -class FogExp2 { - static { - __name(this, "FogExp2"); - } - constructor(color, density = 25e-5) { - this.isFogExp2 = true; - this.name = ""; - this.color = new Color(color); - this.density = density; - } - clone() { - return new FogExp2(this.color, this.density); - } - toJSON() { - return { - type: "FogExp2", - name: this.name, - color: this.color.getHex(), - density: this.density - }; - } -} -class Fog { - static { - __name(this, "Fog"); - } - constructor(color, near = 1, far = 1e3) { - this.isFog = true; - this.name = ""; - this.color = new Color(color); - this.near = near; - this.far = far; - } - clone() { - return new Fog(this.color, this.near, this.far); - } - toJSON() { - return { - type: "Fog", - name: this.name, - color: this.color.getHex(), - near: this.near, - far: this.far - }; - } -} -class Scene extends Object3D { - static { - __name(this, "Scene"); - } - constructor() { - super(); - this.isScene = true; - this.type = "Scene"; - this.background = null; - this.environment = null; - this.fog = null; - this.backgroundBlurriness = 0; - this.backgroundIntensity = 1; - this.backgroundRotation = new Euler(); - this.environmentIntensity = 1; - this.environmentRotation = new Euler(); - this.overrideMaterial = null; - if (typeof __THREE_DEVTOOLS__ !== "undefined") { - __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this })); - } - } - copy(source, recursive) { - super.copy(source, recursive); - if (source.background !== null) this.background = source.background.clone(); - if (source.environment !== null) this.environment = source.environment.clone(); - if (source.fog !== null) this.fog = source.fog.clone(); - this.backgroundBlurriness = source.backgroundBlurriness; - this.backgroundIntensity = source.backgroundIntensity; - this.backgroundRotation.copy(source.backgroundRotation); - this.environmentIntensity = source.environmentIntensity; - this.environmentRotation.copy(source.environmentRotation); - if (source.overrideMaterial !== null) this.overrideMaterial = source.overrideMaterial.clone(); - this.matrixAutoUpdate = source.matrixAutoUpdate; - return this; - } - toJSON(meta) { - const data = super.toJSON(meta); - if (this.fog !== null) data.object.fog = this.fog.toJSON(); - if (this.backgroundBlurriness > 0) data.object.backgroundBlurriness = this.backgroundBlurriness; - if (this.backgroundIntensity !== 1) data.object.backgroundIntensity = this.backgroundIntensity; - data.object.backgroundRotation = this.backgroundRotation.toArray(); - if (this.environmentIntensity !== 1) data.object.environmentIntensity = this.environmentIntensity; - data.object.environmentRotation = this.environmentRotation.toArray(); - return data; - } -} -class InterleavedBuffer { - static { - __name(this, "InterleavedBuffer"); - } - constructor(array, stride) { - this.isInterleavedBuffer = true; - this.array = array; - this.stride = stride; - this.count = array !== void 0 ? array.length / stride : 0; - this.usage = StaticDrawUsage; - this.updateRanges = []; - this.version = 0; - this.uuid = generateUUID(); - } - onUploadCallback() { - } - set needsUpdate(value) { - if (value === true) this.version++; - } - setUsage(value) { - this.usage = value; - return this; - } - addUpdateRange(start, count) { - this.updateRanges.push({ start, count }); - } - clearUpdateRanges() { - this.updateRanges.length = 0; - } - copy(source) { - this.array = new source.array.constructor(source.array); - this.count = source.count; - this.stride = source.stride; - this.usage = source.usage; - return this; - } - copyAt(index1, attribute, index2) { - index1 *= this.stride; - index2 *= attribute.stride; - for (let i = 0, l = this.stride; i < l; i++) { - this.array[index1 + i] = attribute.array[index2 + i]; - } - return this; - } - set(value, offset = 0) { - this.array.set(value, offset); - return this; - } - clone(data) { - if (data.arrayBuffers === void 0) { - data.arrayBuffers = {}; - } - if (this.array.buffer._uuid === void 0) { - this.array.buffer._uuid = generateUUID(); - } - if (data.arrayBuffers[this.array.buffer._uuid] === void 0) { - data.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer; - } - const array = new this.array.constructor(data.arrayBuffers[this.array.buffer._uuid]); - const ib = new this.constructor(array, this.stride); - ib.setUsage(this.usage); - return ib; - } - onUpload(callback) { - this.onUploadCallback = callback; - return this; - } - toJSON(data) { - if (data.arrayBuffers === void 0) { - data.arrayBuffers = {}; - } - if (this.array.buffer._uuid === void 0) { - this.array.buffer._uuid = generateUUID(); - } - if (data.arrayBuffers[this.array.buffer._uuid] === void 0) { - data.arrayBuffers[this.array.buffer._uuid] = Array.from(new Uint32Array(this.array.buffer)); - } - return { - uuid: this.uuid, - buffer: this.array.buffer._uuid, - type: this.array.constructor.name, - stride: this.stride - }; - } -} -const _vector$6 = /* @__PURE__ */ new Vector3(); -class InterleavedBufferAttribute { - static { - __name(this, "InterleavedBufferAttribute"); - } - constructor(interleavedBuffer, itemSize, offset, normalized = false) { - this.isInterleavedBufferAttribute = true; - this.name = ""; - this.data = interleavedBuffer; - this.itemSize = itemSize; - this.offset = offset; - this.normalized = normalized; - } - get count() { - return this.data.count; - } - get array() { - return this.data.array; - } - set needsUpdate(value) { - this.data.needsUpdate = value; - } - applyMatrix4(m) { - for (let i = 0, l = this.data.count; i < l; i++) { - _vector$6.fromBufferAttribute(this, i); - _vector$6.applyMatrix4(m); - this.setXYZ(i, _vector$6.x, _vector$6.y, _vector$6.z); - } - return this; - } - applyNormalMatrix(m) { - for (let i = 0, l = this.count; i < l; i++) { - _vector$6.fromBufferAttribute(this, i); - _vector$6.applyNormalMatrix(m); - this.setXYZ(i, _vector$6.x, _vector$6.y, _vector$6.z); - } - return this; - } - transformDirection(m) { - for (let i = 0, l = this.count; i < l; i++) { - _vector$6.fromBufferAttribute(this, i); - _vector$6.transformDirection(m); - this.setXYZ(i, _vector$6.x, _vector$6.y, _vector$6.z); - } - return this; - } - getComponent(index, component) { - let value = this.array[index * this.data.stride + this.offset + component]; - if (this.normalized) value = denormalize(value, this.array); - return value; - } - setComponent(index, component, value) { - if (this.normalized) value = normalize(value, this.array); - this.data.array[index * this.data.stride + this.offset + component] = value; - return this; - } - setX(index, x) { - if (this.normalized) x = normalize(x, this.array); - this.data.array[index * this.data.stride + this.offset] = x; - return this; - } - setY(index, y) { - if (this.normalized) y = normalize(y, this.array); - this.data.array[index * this.data.stride + this.offset + 1] = y; - return this; - } - setZ(index, z) { - if (this.normalized) z = normalize(z, this.array); - this.data.array[index * this.data.stride + this.offset + 2] = z; - return this; - } - setW(index, w) { - if (this.normalized) w = normalize(w, this.array); - this.data.array[index * this.data.stride + this.offset + 3] = w; - return this; - } - getX(index) { - let x = this.data.array[index * this.data.stride + this.offset]; - if (this.normalized) x = denormalize(x, this.array); - return x; - } - getY(index) { - let y = this.data.array[index * this.data.stride + this.offset + 1]; - if (this.normalized) y = denormalize(y, this.array); - return y; - } - getZ(index) { - let z = this.data.array[index * this.data.stride + this.offset + 2]; - if (this.normalized) z = denormalize(z, this.array); - return z; - } - getW(index) { - let w = this.data.array[index * this.data.stride + this.offset + 3]; - if (this.normalized) w = denormalize(w, this.array); - return w; - } - setXY(index, x, y) { - index = index * this.data.stride + this.offset; - if (this.normalized) { - x = normalize(x, this.array); - y = normalize(y, this.array); - } - this.data.array[index + 0] = x; - this.data.array[index + 1] = y; - return this; - } - setXYZ(index, x, y, z) { - index = index * this.data.stride + this.offset; - if (this.normalized) { - x = normalize(x, this.array); - y = normalize(y, this.array); - z = normalize(z, this.array); - } - this.data.array[index + 0] = x; - this.data.array[index + 1] = y; - this.data.array[index + 2] = z; - return this; - } - setXYZW(index, x, y, z, w) { - index = index * this.data.stride + this.offset; - if (this.normalized) { - x = normalize(x, this.array); - y = normalize(y, this.array); - z = normalize(z, this.array); - w = normalize(w, this.array); - } - this.data.array[index + 0] = x; - this.data.array[index + 1] = y; - this.data.array[index + 2] = z; - this.data.array[index + 3] = w; - return this; - } - clone(data) { - if (data === void 0) { - console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data."); - const array = []; - for (let i = 0; i < this.count; i++) { - const index = i * this.data.stride + this.offset; - for (let j = 0; j < this.itemSize; j++) { - array.push(this.data.array[index + j]); - } - } - return new BufferAttribute(new this.array.constructor(array), this.itemSize, this.normalized); - } else { - if (data.interleavedBuffers === void 0) { - data.interleavedBuffers = {}; - } - if (data.interleavedBuffers[this.data.uuid] === void 0) { - data.interleavedBuffers[this.data.uuid] = this.data.clone(data); - } - return new InterleavedBufferAttribute(data.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized); - } - } - toJSON(data) { - if (data === void 0) { - console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data."); - const array = []; - for (let i = 0; i < this.count; i++) { - const index = i * this.data.stride + this.offset; - for (let j = 0; j < this.itemSize; j++) { - array.push(this.data.array[index + j]); - } - } - return { - itemSize: this.itemSize, - type: this.array.constructor.name, - array, - normalized: this.normalized - }; - } else { - if (data.interleavedBuffers === void 0) { - data.interleavedBuffers = {}; - } - if (data.interleavedBuffers[this.data.uuid] === void 0) { - data.interleavedBuffers[this.data.uuid] = this.data.toJSON(data); - } - return { - isInterleavedBufferAttribute: true, - itemSize: this.itemSize, - data: this.data.uuid, - offset: this.offset, - normalized: this.normalized - }; - } - } -} -class SpriteMaterial extends Material { - static { - __name(this, "SpriteMaterial"); - } - static get type() { - return "SpriteMaterial"; - } - constructor(parameters) { - super(); - this.isSpriteMaterial = true; - this.color = new Color(16777215); - this.map = null; - this.alphaMap = null; - this.rotation = 0; - this.sizeAttenuation = true; - this.transparent = true; - this.fog = true; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.color.copy(source.color); - this.map = source.map; - this.alphaMap = source.alphaMap; - this.rotation = source.rotation; - this.sizeAttenuation = source.sizeAttenuation; - this.fog = source.fog; - return this; - } -} -let _geometry; -const _intersectPoint = /* @__PURE__ */ new Vector3(); -const _worldScale = /* @__PURE__ */ new Vector3(); -const _mvPosition = /* @__PURE__ */ new Vector3(); -const _alignedPosition = /* @__PURE__ */ new Vector2(); -const _rotatedPosition = /* @__PURE__ */ new Vector2(); -const _viewWorldMatrix = /* @__PURE__ */ new Matrix4(); -const _vA$2 = /* @__PURE__ */ new Vector3(); -const _vB$2 = /* @__PURE__ */ new Vector3(); -const _vC$2 = /* @__PURE__ */ new Vector3(); -const _uvA = /* @__PURE__ */ new Vector2(); -const _uvB = /* @__PURE__ */ new Vector2(); -const _uvC = /* @__PURE__ */ new Vector2(); -class Sprite extends Object3D { - static { - __name(this, "Sprite"); - } - constructor(material = new SpriteMaterial()) { - super(); - this.isSprite = true; - this.type = "Sprite"; - if (_geometry === void 0) { - _geometry = new BufferGeometry(); - const float32Array = new Float32Array([ - -0.5, - -0.5, - 0, - 0, - 0, - 0.5, - -0.5, - 0, - 1, - 0, - 0.5, - 0.5, - 0, - 1, - 1, - -0.5, - 0.5, - 0, - 0, - 1 - ]); - const interleavedBuffer = new InterleavedBuffer(float32Array, 5); - _geometry.setIndex([0, 1, 2, 0, 2, 3]); - _geometry.setAttribute("position", new InterleavedBufferAttribute(interleavedBuffer, 3, 0, false)); - _geometry.setAttribute("uv", new InterleavedBufferAttribute(interleavedBuffer, 2, 3, false)); - } - this.geometry = _geometry; - this.material = material; - this.center = new Vector2(0.5, 0.5); - } - raycast(raycaster, intersects2) { - if (raycaster.camera === null) { - console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'); - } - _worldScale.setFromMatrixScale(this.matrixWorld); - _viewWorldMatrix.copy(raycaster.camera.matrixWorld); - this.modelViewMatrix.multiplyMatrices(raycaster.camera.matrixWorldInverse, this.matrixWorld); - _mvPosition.setFromMatrixPosition(this.modelViewMatrix); - if (raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false) { - _worldScale.multiplyScalar(-_mvPosition.z); - } - const rotation = this.material.rotation; - let sin, cos; - if (rotation !== 0) { - cos = Math.cos(rotation); - sin = Math.sin(rotation); - } - const center = this.center; - transformVertex(_vA$2.set(-0.5, -0.5, 0), _mvPosition, center, _worldScale, sin, cos); - transformVertex(_vB$2.set(0.5, -0.5, 0), _mvPosition, center, _worldScale, sin, cos); - transformVertex(_vC$2.set(0.5, 0.5, 0), _mvPosition, center, _worldScale, sin, cos); - _uvA.set(0, 0); - _uvB.set(1, 0); - _uvC.set(1, 1); - let intersect2 = raycaster.ray.intersectTriangle(_vA$2, _vB$2, _vC$2, false, _intersectPoint); - if (intersect2 === null) { - transformVertex(_vB$2.set(-0.5, 0.5, 0), _mvPosition, center, _worldScale, sin, cos); - _uvB.set(0, 1); - intersect2 = raycaster.ray.intersectTriangle(_vA$2, _vC$2, _vB$2, false, _intersectPoint); - if (intersect2 === null) { - return; - } - } - const distance = raycaster.ray.origin.distanceTo(_intersectPoint); - if (distance < raycaster.near || distance > raycaster.far) return; - intersects2.push({ - distance, - point: _intersectPoint.clone(), - uv: Triangle.getInterpolation(_intersectPoint, _vA$2, _vB$2, _vC$2, _uvA, _uvB, _uvC, new Vector2()), - face: null, - object: this - }); - } - copy(source, recursive) { - super.copy(source, recursive); - if (source.center !== void 0) this.center.copy(source.center); - this.material = source.material; - return this; - } -} -function transformVertex(vertexPosition, mvPosition, center, scale, sin, cos) { - _alignedPosition.subVectors(vertexPosition, center).addScalar(0.5).multiply(scale); - if (sin !== void 0) { - _rotatedPosition.x = cos * _alignedPosition.x - sin * _alignedPosition.y; - _rotatedPosition.y = sin * _alignedPosition.x + cos * _alignedPosition.y; - } else { - _rotatedPosition.copy(_alignedPosition); - } - vertexPosition.copy(mvPosition); - vertexPosition.x += _rotatedPosition.x; - vertexPosition.y += _rotatedPosition.y; - vertexPosition.applyMatrix4(_viewWorldMatrix); -} -__name(transformVertex, "transformVertex"); -const _v1$2 = /* @__PURE__ */ new Vector3(); -const _v2$1 = /* @__PURE__ */ new Vector3(); -class LOD extends Object3D { - static { - __name(this, "LOD"); - } - constructor() { - super(); - this._currentLevel = 0; - this.type = "LOD"; - Object.defineProperties(this, { - levels: { - enumerable: true, - value: [] - }, - isLOD: { - value: true - } - }); - this.autoUpdate = true; - } - copy(source) { - super.copy(source, false); - const levels = source.levels; - for (let i = 0, l = levels.length; i < l; i++) { - const level = levels[i]; - this.addLevel(level.object.clone(), level.distance, level.hysteresis); - } - this.autoUpdate = source.autoUpdate; - return this; - } - addLevel(object, distance = 0, hysteresis = 0) { - distance = Math.abs(distance); - const levels = this.levels; - let l; - for (l = 0; l < levels.length; l++) { - if (distance < levels[l].distance) { - break; - } - } - levels.splice(l, 0, { distance, hysteresis, object }); - this.add(object); - return this; - } - removeLevel(distance) { - const levels = this.levels; - for (let i = 0; i < levels.length; i++) { - if (levels[i].distance === distance) { - const removedElements = levels.splice(i, 1); - this.remove(removedElements[0].object); - return true; - } - } - return false; - } - getCurrentLevel() { - return this._currentLevel; - } - getObjectForDistance(distance) { - const levels = this.levels; - if (levels.length > 0) { - let i, l; - for (i = 1, l = levels.length; i < l; i++) { - let levelDistance = levels[i].distance; - if (levels[i].object.visible) { - levelDistance -= levelDistance * levels[i].hysteresis; - } - if (distance < levelDistance) { - break; - } - } - return levels[i - 1].object; - } - return null; - } - raycast(raycaster, intersects2) { - const levels = this.levels; - if (levels.length > 0) { - _v1$2.setFromMatrixPosition(this.matrixWorld); - const distance = raycaster.ray.origin.distanceTo(_v1$2); - this.getObjectForDistance(distance).raycast(raycaster, intersects2); - } - } - update(camera) { - const levels = this.levels; - if (levels.length > 1) { - _v1$2.setFromMatrixPosition(camera.matrixWorld); - _v2$1.setFromMatrixPosition(this.matrixWorld); - const distance = _v1$2.distanceTo(_v2$1) / camera.zoom; - levels[0].object.visible = true; - let i, l; - for (i = 1, l = levels.length; i < l; i++) { - let levelDistance = levels[i].distance; - if (levels[i].object.visible) { - levelDistance -= levelDistance * levels[i].hysteresis; - } - if (distance >= levelDistance) { - levels[i - 1].object.visible = false; - levels[i].object.visible = true; - } else { - break; - } - } - this._currentLevel = i - 1; - for (; i < l; i++) { - levels[i].object.visible = false; - } - } - } - toJSON(meta) { - const data = super.toJSON(meta); - if (this.autoUpdate === false) data.object.autoUpdate = false; - data.object.levels = []; - const levels = this.levels; - for (let i = 0, l = levels.length; i < l; i++) { - const level = levels[i]; - data.object.levels.push({ - object: level.object.uuid, - distance: level.distance, - hysteresis: level.hysteresis - }); - } - return data; - } -} -const _basePosition = /* @__PURE__ */ new Vector3(); -const _skinIndex = /* @__PURE__ */ new Vector4(); -const _skinWeight = /* @__PURE__ */ new Vector4(); -const _vector3 = /* @__PURE__ */ new Vector3(); -const _matrix4 = /* @__PURE__ */ new Matrix4(); -const _vertex = /* @__PURE__ */ new Vector3(); -const _sphere$4 = /* @__PURE__ */ new Sphere(); -const _inverseMatrix$2 = /* @__PURE__ */ new Matrix4(); -const _ray$2 = /* @__PURE__ */ new Ray(); -class SkinnedMesh extends Mesh { - static { - __name(this, "SkinnedMesh"); - } - constructor(geometry, material) { - super(geometry, material); - this.isSkinnedMesh = true; - this.type = "SkinnedMesh"; - this.bindMode = AttachedBindMode; - this.bindMatrix = new Matrix4(); - this.bindMatrixInverse = new Matrix4(); - this.boundingBox = null; - this.boundingSphere = null; - } - computeBoundingBox() { - const geometry = this.geometry; - if (this.boundingBox === null) { - this.boundingBox = new Box3(); - } - this.boundingBox.makeEmpty(); - const positionAttribute = geometry.getAttribute("position"); - for (let i = 0; i < positionAttribute.count; i++) { - this.getVertexPosition(i, _vertex); - this.boundingBox.expandByPoint(_vertex); - } - } - computeBoundingSphere() { - const geometry = this.geometry; - if (this.boundingSphere === null) { - this.boundingSphere = new Sphere(); - } - this.boundingSphere.makeEmpty(); - const positionAttribute = geometry.getAttribute("position"); - for (let i = 0; i < positionAttribute.count; i++) { - this.getVertexPosition(i, _vertex); - this.boundingSphere.expandByPoint(_vertex); - } - } - copy(source, recursive) { - super.copy(source, recursive); - this.bindMode = source.bindMode; - this.bindMatrix.copy(source.bindMatrix); - this.bindMatrixInverse.copy(source.bindMatrixInverse); - this.skeleton = source.skeleton; - if (source.boundingBox !== null) this.boundingBox = source.boundingBox.clone(); - if (source.boundingSphere !== null) this.boundingSphere = source.boundingSphere.clone(); - return this; - } - raycast(raycaster, intersects2) { - const material = this.material; - const matrixWorld = this.matrixWorld; - if (material === void 0) return; - if (this.boundingSphere === null) this.computeBoundingSphere(); - _sphere$4.copy(this.boundingSphere); - _sphere$4.applyMatrix4(matrixWorld); - if (raycaster.ray.intersectsSphere(_sphere$4) === false) return; - _inverseMatrix$2.copy(matrixWorld).invert(); - _ray$2.copy(raycaster.ray).applyMatrix4(_inverseMatrix$2); - if (this.boundingBox !== null) { - if (_ray$2.intersectsBox(this.boundingBox) === false) return; - } - this._computeIntersections(raycaster, intersects2, _ray$2); - } - getVertexPosition(index, target) { - super.getVertexPosition(index, target); - this.applyBoneTransform(index, target); - return target; - } - bind(skeleton, bindMatrix) { - this.skeleton = skeleton; - if (bindMatrix === void 0) { - this.updateMatrixWorld(true); - this.skeleton.calculateInverses(); - bindMatrix = this.matrixWorld; - } - this.bindMatrix.copy(bindMatrix); - this.bindMatrixInverse.copy(bindMatrix).invert(); - } - pose() { - this.skeleton.pose(); - } - normalizeSkinWeights() { - const vector = new Vector4(); - const skinWeight = this.geometry.attributes.skinWeight; - for (let i = 0, l = skinWeight.count; i < l; i++) { - vector.fromBufferAttribute(skinWeight, i); - const scale = 1 / vector.manhattanLength(); - if (scale !== Infinity) { - vector.multiplyScalar(scale); - } else { - vector.set(1, 0, 0, 0); - } - skinWeight.setXYZW(i, vector.x, vector.y, vector.z, vector.w); - } - } - updateMatrixWorld(force) { - super.updateMatrixWorld(force); - if (this.bindMode === AttachedBindMode) { - this.bindMatrixInverse.copy(this.matrixWorld).invert(); - } else if (this.bindMode === DetachedBindMode) { - this.bindMatrixInverse.copy(this.bindMatrix).invert(); - } else { - console.warn("THREE.SkinnedMesh: Unrecognized bindMode: " + this.bindMode); - } - } - applyBoneTransform(index, vector) { - const skeleton = this.skeleton; - const geometry = this.geometry; - _skinIndex.fromBufferAttribute(geometry.attributes.skinIndex, index); - _skinWeight.fromBufferAttribute(geometry.attributes.skinWeight, index); - _basePosition.copy(vector).applyMatrix4(this.bindMatrix); - vector.set(0, 0, 0); - for (let i = 0; i < 4; i++) { - const weight = _skinWeight.getComponent(i); - if (weight !== 0) { - const boneIndex = _skinIndex.getComponent(i); - _matrix4.multiplyMatrices(skeleton.bones[boneIndex].matrixWorld, skeleton.boneInverses[boneIndex]); - vector.addScaledVector(_vector3.copy(_basePosition).applyMatrix4(_matrix4), weight); - } - } - return vector.applyMatrix4(this.bindMatrixInverse); - } -} -class Bone extends Object3D { - static { - __name(this, "Bone"); - } - constructor() { - super(); - this.isBone = true; - this.type = "Bone"; - } -} -class DataTexture extends Texture { - static { - __name(this, "DataTexture"); - } - constructor(data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, colorSpace) { - super(null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace); - this.isDataTexture = true; - this.image = { data, width, height }; - this.generateMipmaps = false; - this.flipY = false; - this.unpackAlignment = 1; - } -} -const _offsetMatrix = /* @__PURE__ */ new Matrix4(); -const _identityMatrix$1 = /* @__PURE__ */ new Matrix4(); -class Skeleton { - static { - __name(this, "Skeleton"); - } - constructor(bones = [], boneInverses = []) { - this.uuid = generateUUID(); - this.bones = bones.slice(0); - this.boneInverses = boneInverses; - this.boneMatrices = null; - this.boneTexture = null; - this.init(); - } - init() { - const bones = this.bones; - const boneInverses = this.boneInverses; - this.boneMatrices = new Float32Array(bones.length * 16); - if (boneInverses.length === 0) { - this.calculateInverses(); - } else { - if (bones.length !== boneInverses.length) { - console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."); - this.boneInverses = []; - for (let i = 0, il = this.bones.length; i < il; i++) { - this.boneInverses.push(new Matrix4()); - } - } - } - } - calculateInverses() { - this.boneInverses.length = 0; - for (let i = 0, il = this.bones.length; i < il; i++) { - const inverse = new Matrix4(); - if (this.bones[i]) { - inverse.copy(this.bones[i].matrixWorld).invert(); - } - this.boneInverses.push(inverse); - } - } - pose() { - for (let i = 0, il = this.bones.length; i < il; i++) { - const bone = this.bones[i]; - if (bone) { - bone.matrixWorld.copy(this.boneInverses[i]).invert(); - } - } - for (let i = 0, il = this.bones.length; i < il; i++) { - const bone = this.bones[i]; - if (bone) { - if (bone.parent && bone.parent.isBone) { - bone.matrix.copy(bone.parent.matrixWorld).invert(); - bone.matrix.multiply(bone.matrixWorld); - } else { - bone.matrix.copy(bone.matrixWorld); - } - bone.matrix.decompose(bone.position, bone.quaternion, bone.scale); - } - } - } - update() { - const bones = this.bones; - const boneInverses = this.boneInverses; - const boneMatrices = this.boneMatrices; - const boneTexture = this.boneTexture; - for (let i = 0, il = bones.length; i < il; i++) { - const matrix = bones[i] ? bones[i].matrixWorld : _identityMatrix$1; - _offsetMatrix.multiplyMatrices(matrix, boneInverses[i]); - _offsetMatrix.toArray(boneMatrices, i * 16); - } - if (boneTexture !== null) { - boneTexture.needsUpdate = true; - } - } - clone() { - return new Skeleton(this.bones, this.boneInverses); - } - computeBoneTexture() { - let size = Math.sqrt(this.bones.length * 4); - size = Math.ceil(size / 4) * 4; - size = Math.max(size, 4); - const boneMatrices = new Float32Array(size * size * 4); - boneMatrices.set(this.boneMatrices); - const boneTexture = new DataTexture(boneMatrices, size, size, RGBAFormat, FloatType); - boneTexture.needsUpdate = true; - this.boneMatrices = boneMatrices; - this.boneTexture = boneTexture; - return this; - } - getBoneByName(name) { - for (let i = 0, il = this.bones.length; i < il; i++) { - const bone = this.bones[i]; - if (bone.name === name) { - return bone; - } - } - return void 0; - } - dispose() { - if (this.boneTexture !== null) { - this.boneTexture.dispose(); - this.boneTexture = null; - } - } - fromJSON(json, bones) { - this.uuid = json.uuid; - for (let i = 0, l = json.bones.length; i < l; i++) { - const uuid = json.bones[i]; - let bone = bones[uuid]; - if (bone === void 0) { - console.warn("THREE.Skeleton: No bone found with UUID:", uuid); - bone = new Bone(); - } - this.bones.push(bone); - this.boneInverses.push(new Matrix4().fromArray(json.boneInverses[i])); - } - this.init(); - return this; - } - toJSON() { - const data = { - metadata: { - version: 4.6, - type: "Skeleton", - generator: "Skeleton.toJSON" - }, - bones: [], - boneInverses: [] - }; - data.uuid = this.uuid; - const bones = this.bones; - const boneInverses = this.boneInverses; - for (let i = 0, l = bones.length; i < l; i++) { - const bone = bones[i]; - data.bones.push(bone.uuid); - const boneInverse = boneInverses[i]; - data.boneInverses.push(boneInverse.toArray()); - } - return data; - } -} -class InstancedBufferAttribute extends BufferAttribute { - static { - __name(this, "InstancedBufferAttribute"); - } - constructor(array, itemSize, normalized, meshPerAttribute = 1) { - super(array, itemSize, normalized); - this.isInstancedBufferAttribute = true; - this.meshPerAttribute = meshPerAttribute; - } - copy(source) { - super.copy(source); - this.meshPerAttribute = source.meshPerAttribute; - return this; - } - toJSON() { - const data = super.toJSON(); - data.meshPerAttribute = this.meshPerAttribute; - data.isInstancedBufferAttribute = true; - return data; - } -} -const _instanceLocalMatrix = /* @__PURE__ */ new Matrix4(); -const _instanceWorldMatrix = /* @__PURE__ */ new Matrix4(); -const _instanceIntersects = []; -const _box3 = /* @__PURE__ */ new Box3(); -const _identity = /* @__PURE__ */ new Matrix4(); -const _mesh$1 = /* @__PURE__ */ new Mesh(); -const _sphere$3 = /* @__PURE__ */ new Sphere(); -class InstancedMesh extends Mesh { - static { - __name(this, "InstancedMesh"); - } - constructor(geometry, material, count) { - super(geometry, material); - this.isInstancedMesh = true; - this.instanceMatrix = new InstancedBufferAttribute(new Float32Array(count * 16), 16); - this.instanceColor = null; - this.morphTexture = null; - this.count = count; - this.boundingBox = null; - this.boundingSphere = null; - for (let i = 0; i < count; i++) { - this.setMatrixAt(i, _identity); - } - } - computeBoundingBox() { - const geometry = this.geometry; - const count = this.count; - if (this.boundingBox === null) { - this.boundingBox = new Box3(); - } - if (geometry.boundingBox === null) { - geometry.computeBoundingBox(); - } - this.boundingBox.makeEmpty(); - for (let i = 0; i < count; i++) { - this.getMatrixAt(i, _instanceLocalMatrix); - _box3.copy(geometry.boundingBox).applyMatrix4(_instanceLocalMatrix); - this.boundingBox.union(_box3); - } - } - computeBoundingSphere() { - const geometry = this.geometry; - const count = this.count; - if (this.boundingSphere === null) { - this.boundingSphere = new Sphere(); - } - if (geometry.boundingSphere === null) { - geometry.computeBoundingSphere(); - } - this.boundingSphere.makeEmpty(); - for (let i = 0; i < count; i++) { - this.getMatrixAt(i, _instanceLocalMatrix); - _sphere$3.copy(geometry.boundingSphere).applyMatrix4(_instanceLocalMatrix); - this.boundingSphere.union(_sphere$3); - } - } - copy(source, recursive) { - super.copy(source, recursive); - this.instanceMatrix.copy(source.instanceMatrix); - if (source.morphTexture !== null) this.morphTexture = source.morphTexture.clone(); - if (source.instanceColor !== null) this.instanceColor = source.instanceColor.clone(); - this.count = source.count; - if (source.boundingBox !== null) this.boundingBox = source.boundingBox.clone(); - if (source.boundingSphere !== null) this.boundingSphere = source.boundingSphere.clone(); - return this; - } - getColorAt(index, color) { - color.fromArray(this.instanceColor.array, index * 3); - } - getMatrixAt(index, matrix) { - matrix.fromArray(this.instanceMatrix.array, index * 16); - } - getMorphAt(index, object) { - const objectInfluences = object.morphTargetInfluences; - const array = this.morphTexture.source.data.data; - const len = objectInfluences.length + 1; - const dataIndex = index * len + 1; - for (let i = 0; i < objectInfluences.length; i++) { - objectInfluences[i] = array[dataIndex + i]; - } - } - raycast(raycaster, intersects2) { - const matrixWorld = this.matrixWorld; - const raycastTimes = this.count; - _mesh$1.geometry = this.geometry; - _mesh$1.material = this.material; - if (_mesh$1.material === void 0) return; - if (this.boundingSphere === null) this.computeBoundingSphere(); - _sphere$3.copy(this.boundingSphere); - _sphere$3.applyMatrix4(matrixWorld); - if (raycaster.ray.intersectsSphere(_sphere$3) === false) return; - for (let instanceId = 0; instanceId < raycastTimes; instanceId++) { - this.getMatrixAt(instanceId, _instanceLocalMatrix); - _instanceWorldMatrix.multiplyMatrices(matrixWorld, _instanceLocalMatrix); - _mesh$1.matrixWorld = _instanceWorldMatrix; - _mesh$1.raycast(raycaster, _instanceIntersects); - for (let i = 0, l = _instanceIntersects.length; i < l; i++) { - const intersect2 = _instanceIntersects[i]; - intersect2.instanceId = instanceId; - intersect2.object = this; - intersects2.push(intersect2); - } - _instanceIntersects.length = 0; - } - } - setColorAt(index, color) { - if (this.instanceColor === null) { - this.instanceColor = new InstancedBufferAttribute(new Float32Array(this.instanceMatrix.count * 3).fill(1), 3); - } - color.toArray(this.instanceColor.array, index * 3); - } - setMatrixAt(index, matrix) { - matrix.toArray(this.instanceMatrix.array, index * 16); - } - setMorphAt(index, object) { - const objectInfluences = object.morphTargetInfluences; - const len = objectInfluences.length + 1; - if (this.morphTexture === null) { - this.morphTexture = new DataTexture(new Float32Array(len * this.count), len, this.count, RedFormat, FloatType); - } - const array = this.morphTexture.source.data.data; - let morphInfluencesSum = 0; - for (let i = 0; i < objectInfluences.length; i++) { - morphInfluencesSum += objectInfluences[i]; - } - const morphBaseInfluence = this.geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum; - const dataIndex = len * index; - array[dataIndex] = morphBaseInfluence; - array.set(objectInfluences, dataIndex + 1); - } - updateMorphTargets() { - } - dispose() { - this.dispatchEvent({ type: "dispose" }); - if (this.morphTexture !== null) { - this.morphTexture.dispose(); - this.morphTexture = null; - } - return this; - } -} -function ascIdSort(a, b) { - return a - b; -} -__name(ascIdSort, "ascIdSort"); -function sortOpaque(a, b) { - return a.z - b.z; -} -__name(sortOpaque, "sortOpaque"); -function sortTransparent(a, b) { - return b.z - a.z; -} -__name(sortTransparent, "sortTransparent"); -class MultiDrawRenderList { - static { - __name(this, "MultiDrawRenderList"); - } - constructor() { - this.index = 0; - this.pool = []; - this.list = []; - } - push(start, count, z, index) { - const pool = this.pool; - const list = this.list; - if (this.index >= pool.length) { - pool.push({ - start: -1, - count: -1, - z: -1, - index: -1 - }); - } - const item = pool[this.index]; - list.push(item); - this.index++; - item.start = start; - item.count = count; - item.z = z; - item.index = index; - } - reset() { - this.list.length = 0; - this.index = 0; - } -} -const _matrix$1 = /* @__PURE__ */ new Matrix4(); -const _whiteColor = /* @__PURE__ */ new Color(1, 1, 1); -const _frustum = /* @__PURE__ */ new Frustum(); -const _box$1 = /* @__PURE__ */ new Box3(); -const _sphere$2 = /* @__PURE__ */ new Sphere(); -const _vector$5 = /* @__PURE__ */ new Vector3(); -const _forward = /* @__PURE__ */ new Vector3(); -const _temp = /* @__PURE__ */ new Vector3(); -const _renderList = /* @__PURE__ */ new MultiDrawRenderList(); -const _mesh = /* @__PURE__ */ new Mesh(); -const _batchIntersects = []; -function copyAttributeData(src, target, targetOffset = 0) { - const itemSize = target.itemSize; - if (src.isInterleavedBufferAttribute || src.array.constructor !== target.array.constructor) { - const vertexCount = src.count; - for (let i = 0; i < vertexCount; i++) { - for (let c = 0; c < itemSize; c++) { - target.setComponent(i + targetOffset, c, src.getComponent(i, c)); - } - } - } else { - target.array.set(src.array, targetOffset * itemSize); - } - target.needsUpdate = true; -} -__name(copyAttributeData, "copyAttributeData"); -function copyArrayContents(src, target) { - if (src.constructor !== target.constructor) { - const len = Math.min(src.length, target.length); - for (let i = 0; i < len; i++) { - target[i] = src[i]; - } - } else { - const len = Math.min(src.length, target.length); - target.set(new src.constructor(src.buffer, 0, len)); - } -} -__name(copyArrayContents, "copyArrayContents"); -class BatchedMesh extends Mesh { - static { - __name(this, "BatchedMesh"); - } - get maxInstanceCount() { - return this._maxInstanceCount; - } - get instanceCount() { - return this._instanceInfo.length - this._availableInstanceIds.length; - } - get unusedVertexCount() { - return this._maxVertexCount - this._nextVertexStart; - } - get unusedIndexCount() { - return this._maxIndexCount - this._nextIndexStart; - } - constructor(maxInstanceCount, maxVertexCount, maxIndexCount = maxVertexCount * 2, material) { - super(new BufferGeometry(), material); - this.isBatchedMesh = true; - this.perObjectFrustumCulled = true; - this.sortObjects = true; - this.boundingBox = null; - this.boundingSphere = null; - this.customSort = null; - this._instanceInfo = []; - this._geometryInfo = []; - this._availableInstanceIds = []; - this._availableGeometryIds = []; - this._nextIndexStart = 0; - this._nextVertexStart = 0; - this._geometryCount = 0; - this._visibilityChanged = true; - this._geometryInitialized = false; - this._maxInstanceCount = maxInstanceCount; - this._maxVertexCount = maxVertexCount; - this._maxIndexCount = maxIndexCount; - this._multiDrawCounts = new Int32Array(maxInstanceCount); - this._multiDrawStarts = new Int32Array(maxInstanceCount); - this._multiDrawCount = 0; - this._multiDrawInstances = null; - this._matricesTexture = null; - this._indirectTexture = null; - this._colorsTexture = null; - this._initMatricesTexture(); - this._initIndirectTexture(); - } - _initMatricesTexture() { - let size = Math.sqrt(this._maxInstanceCount * 4); - size = Math.ceil(size / 4) * 4; - size = Math.max(size, 4); - const matricesArray = new Float32Array(size * size * 4); - const matricesTexture = new DataTexture(matricesArray, size, size, RGBAFormat, FloatType); - this._matricesTexture = matricesTexture; - } - _initIndirectTexture() { - let size = Math.sqrt(this._maxInstanceCount); - size = Math.ceil(size); - const indirectArray = new Uint32Array(size * size); - const indirectTexture = new DataTexture(indirectArray, size, size, RedIntegerFormat, UnsignedIntType); - this._indirectTexture = indirectTexture; - } - _initColorsTexture() { - let size = Math.sqrt(this._maxInstanceCount); - size = Math.ceil(size); - const colorsArray = new Float32Array(size * size * 4).fill(1); - const colorsTexture = new DataTexture(colorsArray, size, size, RGBAFormat, FloatType); - colorsTexture.colorSpace = ColorManagement.workingColorSpace; - this._colorsTexture = colorsTexture; - } - _initializeGeometry(reference) { - const geometry = this.geometry; - const maxVertexCount = this._maxVertexCount; - const maxIndexCount = this._maxIndexCount; - if (this._geometryInitialized === false) { - for (const attributeName in reference.attributes) { - const srcAttribute = reference.getAttribute(attributeName); - const { array, itemSize, normalized } = srcAttribute; - const dstArray = new array.constructor(maxVertexCount * itemSize); - const dstAttribute = new BufferAttribute(dstArray, itemSize, normalized); - geometry.setAttribute(attributeName, dstAttribute); - } - if (reference.getIndex() !== null) { - const indexArray = maxVertexCount > 65535 ? new Uint32Array(maxIndexCount) : new Uint16Array(maxIndexCount); - geometry.setIndex(new BufferAttribute(indexArray, 1)); - } - this._geometryInitialized = true; - } - } - // Make sure the geometry is compatible with the existing combined geometry attributes - _validateGeometry(geometry) { - const batchGeometry = this.geometry; - if (Boolean(geometry.getIndex()) !== Boolean(batchGeometry.getIndex())) { - throw new Error('BatchedMesh: All geometries must consistently have "index".'); - } - for (const attributeName in batchGeometry.attributes) { - if (!geometry.hasAttribute(attributeName)) { - throw new Error(`BatchedMesh: Added geometry missing "${attributeName}". All geometries must have consistent attributes.`); - } - const srcAttribute = geometry.getAttribute(attributeName); - const dstAttribute = batchGeometry.getAttribute(attributeName); - if (srcAttribute.itemSize !== dstAttribute.itemSize || srcAttribute.normalized !== dstAttribute.normalized) { - throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value."); - } - } - } - setCustomSort(func) { - this.customSort = func; - return this; - } - computeBoundingBox() { - if (this.boundingBox === null) { - this.boundingBox = new Box3(); - } - const boundingBox = this.boundingBox; - const instanceInfo = this._instanceInfo; - boundingBox.makeEmpty(); - for (let i = 0, l = instanceInfo.length; i < l; i++) { - if (instanceInfo[i].active === false) continue; - const geometryId = instanceInfo[i].geometryIndex; - this.getMatrixAt(i, _matrix$1); - this.getBoundingBoxAt(geometryId, _box$1).applyMatrix4(_matrix$1); - boundingBox.union(_box$1); - } - } - computeBoundingSphere() { - if (this.boundingSphere === null) { - this.boundingSphere = new Sphere(); - } - const boundingSphere = this.boundingSphere; - const instanceInfo = this._instanceInfo; - boundingSphere.makeEmpty(); - for (let i = 0, l = instanceInfo.length; i < l; i++) { - if (instanceInfo[i].active === false) continue; - const geometryId = instanceInfo[i].geometryIndex; - this.getMatrixAt(i, _matrix$1); - this.getBoundingSphereAt(geometryId, _sphere$2).applyMatrix4(_matrix$1); - boundingSphere.union(_sphere$2); - } - } - addInstance(geometryId) { - const atCapacity = this._instanceInfo.length >= this.maxInstanceCount; - if (atCapacity && this._availableInstanceIds.length === 0) { - throw new Error("BatchedMesh: Maximum item count reached."); - } - const instanceInfo = { - visible: true, - active: true, - geometryIndex: geometryId - }; - let drawId = null; - if (this._availableInstanceIds.length > 0) { - this._availableInstanceIds.sort(ascIdSort); - drawId = this._availableInstanceIds.shift(); - this._instanceInfo[drawId] = instanceInfo; - } else { - drawId = this._instanceInfo.length; - this._instanceInfo.push(instanceInfo); - } - const matricesTexture = this._matricesTexture; - _matrix$1.identity().toArray(matricesTexture.image.data, drawId * 16); - matricesTexture.needsUpdate = true; - const colorsTexture = this._colorsTexture; - if (colorsTexture) { - _whiteColor.toArray(colorsTexture.image.data, drawId * 4); - colorsTexture.needsUpdate = true; - } - this._visibilityChanged = true; - return drawId; - } - addGeometry(geometry, reservedVertexCount = -1, reservedIndexCount = -1) { - this._initializeGeometry(geometry); - this._validateGeometry(geometry); - const geometryInfo = { - // geometry information - vertexStart: -1, - vertexCount: -1, - reservedVertexCount: -1, - indexStart: -1, - indexCount: -1, - reservedIndexCount: -1, - // draw range information - start: -1, - count: -1, - // state - boundingBox: null, - boundingSphere: null, - active: true - }; - const geometryInfoList = this._geometryInfo; - geometryInfo.vertexStart = this._nextVertexStart; - geometryInfo.reservedVertexCount = reservedVertexCount === -1 ? geometry.getAttribute("position").count : reservedVertexCount; - const index = geometry.getIndex(); - const hasIndex = index !== null; - if (hasIndex) { - geometryInfo.indexStart = this._nextIndexStart; - geometryInfo.reservedIndexCount = reservedIndexCount === -1 ? index.count : reservedIndexCount; - } - if (geometryInfo.indexStart !== -1 && geometryInfo.indexStart + geometryInfo.reservedIndexCount > this._maxIndexCount || geometryInfo.vertexStart + geometryInfo.reservedVertexCount > this._maxVertexCount) { - throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size."); - } - let geometryId; - if (this._availableGeometryIds.length > 0) { - this._availableGeometryIds.sort(ascIdSort); - geometryId = this._availableGeometryIds.shift(); - geometryInfoList[geometryId] = geometryInfo; - } else { - geometryId = this._geometryCount; - this._geometryCount++; - geometryInfoList.push(geometryInfo); - } - this.setGeometryAt(geometryId, geometry); - this._nextIndexStart = geometryInfo.indexStart + geometryInfo.reservedIndexCount; - this._nextVertexStart = geometryInfo.vertexStart + geometryInfo.reservedVertexCount; - return geometryId; - } - setGeometryAt(geometryId, geometry) { - if (geometryId >= this._geometryCount) { - throw new Error("BatchedMesh: Maximum geometry count reached."); - } - this._validateGeometry(geometry); - const batchGeometry = this.geometry; - const hasIndex = batchGeometry.getIndex() !== null; - const dstIndex = batchGeometry.getIndex(); - const srcIndex = geometry.getIndex(); - const geometryInfo = this._geometryInfo[geometryId]; - if (hasIndex && srcIndex.count > geometryInfo.reservedIndexCount || geometry.attributes.position.count > geometryInfo.reservedVertexCount) { - throw new Error("BatchedMesh: Reserved space not large enough for provided geometry."); - } - const vertexStart = geometryInfo.vertexStart; - const reservedVertexCount = geometryInfo.reservedVertexCount; - geometryInfo.vertexCount = geometry.getAttribute("position").count; - for (const attributeName in batchGeometry.attributes) { - const srcAttribute = geometry.getAttribute(attributeName); - const dstAttribute = batchGeometry.getAttribute(attributeName); - copyAttributeData(srcAttribute, dstAttribute, vertexStart); - const itemSize = srcAttribute.itemSize; - for (let i = srcAttribute.count, l = reservedVertexCount; i < l; i++) { - const index = vertexStart + i; - for (let c = 0; c < itemSize; c++) { - dstAttribute.setComponent(index, c, 0); - } - } - dstAttribute.needsUpdate = true; - dstAttribute.addUpdateRange(vertexStart * itemSize, reservedVertexCount * itemSize); - } - if (hasIndex) { - const indexStart = geometryInfo.indexStart; - const reservedIndexCount = geometryInfo.reservedIndexCount; - geometryInfo.indexCount = geometry.getIndex().count; - for (let i = 0; i < srcIndex.count; i++) { - dstIndex.setX(indexStart + i, vertexStart + srcIndex.getX(i)); - } - for (let i = srcIndex.count, l = reservedIndexCount; i < l; i++) { - dstIndex.setX(indexStart + i, vertexStart); - } - dstIndex.needsUpdate = true; - dstIndex.addUpdateRange(indexStart, geometryInfo.reservedIndexCount); - } - geometryInfo.start = hasIndex ? geometryInfo.indexStart : geometryInfo.vertexStart; - geometryInfo.count = hasIndex ? geometryInfo.indexCount : geometryInfo.vertexCount; - geometryInfo.boundingBox = null; - if (geometry.boundingBox !== null) { - geometryInfo.boundingBox = geometry.boundingBox.clone(); - } - geometryInfo.boundingSphere = null; - if (geometry.boundingSphere !== null) { - geometryInfo.boundingSphere = geometry.boundingSphere.clone(); - } - this._visibilityChanged = true; - return geometryId; - } - deleteGeometry(geometryId) { - const geometryInfoList = this._geometryInfo; - if (geometryId >= geometryInfoList.length || geometryInfoList[geometryId].active === false) { - return this; - } - const instanceInfo = this._instanceInfo; - for (let i = 0, l = instanceInfo.length; i < l; i++) { - if (instanceInfo[i].geometryIndex === geometryId) { - this.deleteInstance(i); - } - } - geometryInfoList[geometryId].active = false; - this._availableGeometryIds.push(geometryId); - this._visibilityChanged = true; - return this; - } - deleteInstance(instanceId) { - const instanceInfo = this._instanceInfo; - if (instanceId >= instanceInfo.length || instanceInfo[instanceId].active === false) { - return this; - } - instanceInfo[instanceId].active = false; - this._availableInstanceIds.push(instanceId); - this._visibilityChanged = true; - return this; - } - optimize() { - let nextVertexStart = 0; - let nextIndexStart = 0; - const geometryInfoList = this._geometryInfo; - const indices = geometryInfoList.map((e, i) => i).sort((a, b) => { - return geometryInfoList[a].vertexStart - geometryInfoList[b].vertexStart; - }); - const geometry = this.geometry; - for (let i = 0, l = geometryInfoList.length; i < l; i++) { - const index = indices[i]; - const geometryInfo = geometryInfoList[index]; - if (geometryInfo.active === false) { - continue; - } - if (geometry.index !== null) { - if (geometryInfo.indexStart !== nextIndexStart) { - const { indexStart, vertexStart, reservedIndexCount } = geometryInfo; - const index2 = geometry.index; - const array = index2.array; - const elementDelta = nextVertexStart - vertexStart; - for (let j = indexStart; j < indexStart + reservedIndexCount; j++) { - array[j] = array[j] + elementDelta; - } - index2.array.copyWithin(nextIndexStart, indexStart, indexStart + reservedIndexCount); - index2.addUpdateRange(nextIndexStart, reservedIndexCount); - geometryInfo.indexStart = nextIndexStart; - } - nextIndexStart += geometryInfo.reservedIndexCount; - } - if (geometryInfo.vertexStart !== nextVertexStart) { - const { vertexStart, reservedVertexCount } = geometryInfo; - const attributes = geometry.attributes; - for (const key in attributes) { - const attribute = attributes[key]; - const { array, itemSize } = attribute; - array.copyWithin(nextVertexStart * itemSize, vertexStart * itemSize, (vertexStart + reservedVertexCount) * itemSize); - attribute.addUpdateRange(nextVertexStart * itemSize, reservedVertexCount * itemSize); - } - geometryInfo.vertexStart = nextVertexStart; - } - nextVertexStart += geometryInfo.reservedVertexCount; - geometryInfo.start = geometry.index ? geometryInfo.indexStart : geometryInfo.vertexStart; - this._nextIndexStart = geometry.index ? geometryInfo.indexStart + geometryInfo.reservedIndexCount : 0; - this._nextVertexStart = geometryInfo.vertexStart + geometryInfo.reservedVertexCount; - } - return this; - } - // get bounding box and compute it if it doesn't exist - getBoundingBoxAt(geometryId, target) { - if (geometryId >= this._geometryCount) { - return null; - } - const geometry = this.geometry; - const geometryInfo = this._geometryInfo[geometryId]; - if (geometryInfo.boundingBox === null) { - const box = new Box3(); - const index = geometry.index; - const position = geometry.attributes.position; - for (let i = geometryInfo.start, l = geometryInfo.start + geometryInfo.count; i < l; i++) { - let iv = i; - if (index) { - iv = index.getX(iv); - } - box.expandByPoint(_vector$5.fromBufferAttribute(position, iv)); - } - geometryInfo.boundingBox = box; - } - target.copy(geometryInfo.boundingBox); - return target; - } - // get bounding sphere and compute it if it doesn't exist - getBoundingSphereAt(geometryId, target) { - if (geometryId >= this._geometryCount) { - return null; - } - const geometry = this.geometry; - const geometryInfo = this._geometryInfo[geometryId]; - if (geometryInfo.boundingSphere === null) { - const sphere = new Sphere(); - this.getBoundingBoxAt(geometryId, _box$1); - _box$1.getCenter(sphere.center); - const index = geometry.index; - const position = geometry.attributes.position; - let maxRadiusSq = 0; - for (let i = geometryInfo.start, l = geometryInfo.start + geometryInfo.count; i < l; i++) { - let iv = i; - if (index) { - iv = index.getX(iv); - } - _vector$5.fromBufferAttribute(position, iv); - maxRadiusSq = Math.max(maxRadiusSq, sphere.center.distanceToSquared(_vector$5)); - } - sphere.radius = Math.sqrt(maxRadiusSq); - geometryInfo.boundingSphere = sphere; - } - target.copy(geometryInfo.boundingSphere); - return target; - } - setMatrixAt(instanceId, matrix) { - const instanceInfo = this._instanceInfo; - const matricesTexture = this._matricesTexture; - const matricesArray = this._matricesTexture.image.data; - if (instanceId >= instanceInfo.length || instanceInfo[instanceId].active === false) { - return this; - } - matrix.toArray(matricesArray, instanceId * 16); - matricesTexture.needsUpdate = true; - return this; - } - getMatrixAt(instanceId, matrix) { - const instanceInfo = this._instanceInfo; - const matricesArray = this._matricesTexture.image.data; - if (instanceId >= instanceInfo.length || instanceInfo[instanceId].active === false) { - return null; - } - return matrix.fromArray(matricesArray, instanceId * 16); - } - setColorAt(instanceId, color) { - if (this._colorsTexture === null) { - this._initColorsTexture(); - } - const colorsTexture = this._colorsTexture; - const colorsArray = this._colorsTexture.image.data; - const instanceInfo = this._instanceInfo; - if (instanceId >= instanceInfo.length || instanceInfo[instanceId].active === false) { - return this; - } - color.toArray(colorsArray, instanceId * 4); - colorsTexture.needsUpdate = true; - return this; - } - getColorAt(instanceId, color) { - const colorsArray = this._colorsTexture.image.data; - const instanceInfo = this._instanceInfo; - if (instanceId >= instanceInfo.length || instanceInfo[instanceId].active === false) { - return null; - } - return color.fromArray(colorsArray, instanceId * 4); - } - setVisibleAt(instanceId, value) { - const instanceInfo = this._instanceInfo; - if (instanceId >= instanceInfo.length || instanceInfo[instanceId].active === false || instanceInfo[instanceId].visible === value) { - return this; - } - instanceInfo[instanceId].visible = value; - this._visibilityChanged = true; - return this; - } - getVisibleAt(instanceId) { - const instanceInfo = this._instanceInfo; - if (instanceId >= instanceInfo.length || instanceInfo[instanceId].active === false) { - return false; - } - return instanceInfo[instanceId].visible; - } - setGeometryIdAt(instanceId, geometryId) { - const instanceInfo = this._instanceInfo; - const geometryInfoList = this._geometryInfo; - if (instanceId >= instanceInfo.length || instanceInfo[instanceId].active === false) { - return null; - } - if (geometryId >= geometryInfoList.length || geometryInfoList[geometryId].active === false) { - return null; - } - instanceInfo[instanceId].geometryIndex = geometryId; - return this; - } - getGeometryIdAt(instanceId) { - const instanceInfo = this._instanceInfo; - if (instanceId >= instanceInfo.length || instanceInfo[instanceId].active === false) { - return -1; - } - return instanceInfo[instanceId].geometryIndex; - } - getGeometryRangeAt(geometryId, target = {}) { - if (geometryId < 0 || geometryId >= this._geometryCount) { - return null; - } - const geometryInfo = this._geometryInfo[geometryId]; - target.vertexStart = geometryInfo.vertexStart; - target.vertexCount = geometryInfo.vertexCount; - target.reservedVertexCount = geometryInfo.reservedVertexCount; - target.indexStart = geometryInfo.indexStart; - target.indexCount = geometryInfo.indexCount; - target.reservedIndexCount = geometryInfo.reservedIndexCount; - target.start = geometryInfo.start; - target.count = geometryInfo.count; - return target; - } - setInstanceCount(maxInstanceCount) { - const availableInstanceIds = this._availableInstanceIds; - const instanceInfo = this._instanceInfo; - availableInstanceIds.sort(ascIdSort); - while (availableInstanceIds[availableInstanceIds.length - 1] === instanceInfo.length) { - instanceInfo.pop(); - availableInstanceIds.pop(); - } - if (maxInstanceCount < instanceInfo.length) { - throw new Error(`BatchedMesh: Instance ids outside the range ${maxInstanceCount} are being used. Cannot shrink instance count.`); - } - const multiDrawCounts = new Int32Array(maxInstanceCount); - const multiDrawStarts = new Int32Array(maxInstanceCount); - copyArrayContents(this._multiDrawCounts, multiDrawCounts); - copyArrayContents(this._multiDrawStarts, multiDrawStarts); - this._multiDrawCounts = multiDrawCounts; - this._multiDrawStarts = multiDrawStarts; - this._maxInstanceCount = maxInstanceCount; - const indirectTexture = this._indirectTexture; - const matricesTexture = this._matricesTexture; - const colorsTexture = this._colorsTexture; - indirectTexture.dispose(); - this._initIndirectTexture(); - copyArrayContents(indirectTexture.image.data, this._indirectTexture.image.data); - matricesTexture.dispose(); - this._initMatricesTexture(); - copyArrayContents(matricesTexture.image.data, this._matricesTexture.image.data); - if (colorsTexture) { - colorsTexture.dispose(); - this._initColorsTexture(); - copyArrayContents(colorsTexture.image.data, this._colorsTexture.image.data); - } - } - setGeometrySize(maxVertexCount, maxIndexCount) { - const validRanges = [...this._geometryInfo].filter((info) => info.active); - const requiredVertexLength = Math.max(...validRanges.map((range) => range.vertexStart + range.reservedVertexCount)); - if (requiredVertexLength > maxVertexCount) { - throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${maxIndexCount}. Cannot shrink further.`); - } - if (this.geometry.index) { - const requiredIndexLength = Math.max(...validRanges.map((range) => range.indexStart + range.reservedIndexCount)); - if (requiredIndexLength > maxIndexCount) { - throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${maxIndexCount}. Cannot shrink further.`); - } - } - const oldGeometry = this.geometry; - oldGeometry.dispose(); - this._maxVertexCount = maxVertexCount; - this._maxIndexCount = maxIndexCount; - if (this._geometryInitialized) { - this._geometryInitialized = false; - this.geometry = new BufferGeometry(); - this._initializeGeometry(oldGeometry); - } - const geometry = this.geometry; - if (oldGeometry.index) { - copyArrayContents(oldGeometry.index.array, geometry.index.array); - } - for (const key in oldGeometry.attributes) { - copyArrayContents(oldGeometry.attributes[key].array, geometry.attributes[key].array); - } - } - raycast(raycaster, intersects2) { - const instanceInfo = this._instanceInfo; - const geometryInfoList = this._geometryInfo; - const matrixWorld = this.matrixWorld; - const batchGeometry = this.geometry; - _mesh.material = this.material; - _mesh.geometry.index = batchGeometry.index; - _mesh.geometry.attributes = batchGeometry.attributes; - if (_mesh.geometry.boundingBox === null) { - _mesh.geometry.boundingBox = new Box3(); - } - if (_mesh.geometry.boundingSphere === null) { - _mesh.geometry.boundingSphere = new Sphere(); - } - for (let i = 0, l = instanceInfo.length; i < l; i++) { - if (!instanceInfo[i].visible || !instanceInfo[i].active) { - continue; - } - const geometryId = instanceInfo[i].geometryIndex; - const geometryInfo = geometryInfoList[geometryId]; - _mesh.geometry.setDrawRange(geometryInfo.start, geometryInfo.count); - this.getMatrixAt(i, _mesh.matrixWorld).premultiply(matrixWorld); - this.getBoundingBoxAt(geometryId, _mesh.geometry.boundingBox); - this.getBoundingSphereAt(geometryId, _mesh.geometry.boundingSphere); - _mesh.raycast(raycaster, _batchIntersects); - for (let j = 0, l2 = _batchIntersects.length; j < l2; j++) { - const intersect2 = _batchIntersects[j]; - intersect2.object = this; - intersect2.batchId = i; - intersects2.push(intersect2); - } - _batchIntersects.length = 0; - } - _mesh.material = null; - _mesh.geometry.index = null; - _mesh.geometry.attributes = {}; - _mesh.geometry.setDrawRange(0, Infinity); - } - copy(source) { - super.copy(source); - this.geometry = source.geometry.clone(); - this.perObjectFrustumCulled = source.perObjectFrustumCulled; - this.sortObjects = source.sortObjects; - this.boundingBox = source.boundingBox !== null ? source.boundingBox.clone() : null; - this.boundingSphere = source.boundingSphere !== null ? source.boundingSphere.clone() : null; - this._geometryInfo = source._geometryInfo.map((info) => ({ - ...info, - boundingBox: info.boundingBox !== null ? info.boundingBox.clone() : null, - boundingSphere: info.boundingSphere !== null ? info.boundingSphere.clone() : null - })); - this._instanceInfo = source._instanceInfo.map((info) => ({ ...info })); - this._maxInstanceCount = source._maxInstanceCount; - this._maxVertexCount = source._maxVertexCount; - this._maxIndexCount = source._maxIndexCount; - this._geometryInitialized = source._geometryInitialized; - this._geometryCount = source._geometryCount; - this._multiDrawCounts = source._multiDrawCounts.slice(); - this._multiDrawStarts = source._multiDrawStarts.slice(); - this._matricesTexture = source._matricesTexture.clone(); - this._matricesTexture.image.data = this._matricesTexture.image.data.slice(); - if (this._colorsTexture !== null) { - this._colorsTexture = source._colorsTexture.clone(); - this._colorsTexture.image.data = this._colorsTexture.image.data.slice(); - } - return this; - } - dispose() { - this.geometry.dispose(); - this._matricesTexture.dispose(); - this._matricesTexture = null; - this._indirectTexture.dispose(); - this._indirectTexture = null; - if (this._colorsTexture !== null) { - this._colorsTexture.dispose(); - this._colorsTexture = null; - } - return this; - } - onBeforeRender(renderer, scene, camera, geometry, material) { - if (!this._visibilityChanged && !this.perObjectFrustumCulled && !this.sortObjects) { - return; - } - const index = geometry.getIndex(); - const bytesPerElement = index === null ? 1 : index.array.BYTES_PER_ELEMENT; - const instanceInfo = this._instanceInfo; - const multiDrawStarts = this._multiDrawStarts; - const multiDrawCounts = this._multiDrawCounts; - const geometryInfoList = this._geometryInfo; - const perObjectFrustumCulled = this.perObjectFrustumCulled; - const indirectTexture = this._indirectTexture; - const indirectArray = indirectTexture.image.data; - if (perObjectFrustumCulled) { - _matrix$1.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse).multiply(this.matrixWorld); - _frustum.setFromProjectionMatrix( - _matrix$1, - renderer.coordinateSystem - ); - } - let multiDrawCount = 0; - if (this.sortObjects) { - _matrix$1.copy(this.matrixWorld).invert(); - _vector$5.setFromMatrixPosition(camera.matrixWorld).applyMatrix4(_matrix$1); - _forward.set(0, 0, -1).transformDirection(camera.matrixWorld).transformDirection(_matrix$1); - for (let i = 0, l = instanceInfo.length; i < l; i++) { - if (instanceInfo[i].visible && instanceInfo[i].active) { - const geometryId = instanceInfo[i].geometryIndex; - this.getMatrixAt(i, _matrix$1); - this.getBoundingSphereAt(geometryId, _sphere$2).applyMatrix4(_matrix$1); - let culled = false; - if (perObjectFrustumCulled) { - culled = !_frustum.intersectsSphere(_sphere$2); - } - if (!culled) { - const geometryInfo = geometryInfoList[geometryId]; - const z = _temp.subVectors(_sphere$2.center, _vector$5).dot(_forward); - _renderList.push(geometryInfo.start, geometryInfo.count, z, i); - } - } - } - const list = _renderList.list; - const customSort = this.customSort; - if (customSort === null) { - list.sort(material.transparent ? sortTransparent : sortOpaque); - } else { - customSort.call(this, list, camera); - } - for (let i = 0, l = list.length; i < l; i++) { - const item = list[i]; - multiDrawStarts[multiDrawCount] = item.start * bytesPerElement; - multiDrawCounts[multiDrawCount] = item.count; - indirectArray[multiDrawCount] = item.index; - multiDrawCount++; - } - _renderList.reset(); - } else { - for (let i = 0, l = instanceInfo.length; i < l; i++) { - if (instanceInfo[i].visible && instanceInfo[i].active) { - const geometryId = instanceInfo[i].geometryIndex; - let culled = false; - if (perObjectFrustumCulled) { - this.getMatrixAt(i, _matrix$1); - this.getBoundingSphereAt(geometryId, _sphere$2).applyMatrix4(_matrix$1); - culled = !_frustum.intersectsSphere(_sphere$2); - } - if (!culled) { - const geometryInfo = geometryInfoList[geometryId]; - multiDrawStarts[multiDrawCount] = geometryInfo.start * bytesPerElement; - multiDrawCounts[multiDrawCount] = geometryInfo.count; - indirectArray[multiDrawCount] = i; - multiDrawCount++; - } - } - } - } - indirectTexture.needsUpdate = true; - this._multiDrawCount = multiDrawCount; - this._visibilityChanged = false; - } - onBeforeShadow(renderer, object, camera, shadowCamera, geometry, depthMaterial) { - this.onBeforeRender(renderer, null, shadowCamera, geometry, depthMaterial); - } -} -class LineBasicMaterial extends Material { - static { - __name(this, "LineBasicMaterial"); - } - static get type() { - return "LineBasicMaterial"; - } - constructor(parameters) { - super(); - this.isLineBasicMaterial = true; - this.color = new Color(16777215); - this.map = null; - this.linewidth = 1; - this.linecap = "round"; - this.linejoin = "round"; - this.fog = true; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.color.copy(source.color); - this.map = source.map; - this.linewidth = source.linewidth; - this.linecap = source.linecap; - this.linejoin = source.linejoin; - this.fog = source.fog; - return this; - } -} -const _vStart = /* @__PURE__ */ new Vector3(); -const _vEnd = /* @__PURE__ */ new Vector3(); -const _inverseMatrix$1 = /* @__PURE__ */ new Matrix4(); -const _ray$1 = /* @__PURE__ */ new Ray(); -const _sphere$1 = /* @__PURE__ */ new Sphere(); -const _intersectPointOnRay = /* @__PURE__ */ new Vector3(); -const _intersectPointOnSegment = /* @__PURE__ */ new Vector3(); -class Line extends Object3D { - static { - __name(this, "Line"); - } - constructor(geometry = new BufferGeometry(), material = new LineBasicMaterial()) { - super(); - this.isLine = true; - this.type = "Line"; - this.geometry = geometry; - this.material = material; - this.updateMorphTargets(); - } - copy(source, recursive) { - super.copy(source, recursive); - this.material = Array.isArray(source.material) ? source.material.slice() : source.material; - this.geometry = source.geometry; - return this; - } - computeLineDistances() { - const geometry = this.geometry; - if (geometry.index === null) { - const positionAttribute = geometry.attributes.position; - const lineDistances = [0]; - for (let i = 1, l = positionAttribute.count; i < l; i++) { - _vStart.fromBufferAttribute(positionAttribute, i - 1); - _vEnd.fromBufferAttribute(positionAttribute, i); - lineDistances[i] = lineDistances[i - 1]; - lineDistances[i] += _vStart.distanceTo(_vEnd); - } - geometry.setAttribute("lineDistance", new Float32BufferAttribute(lineDistances, 1)); - } else { - console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); - } - return this; - } - raycast(raycaster, intersects2) { - const geometry = this.geometry; - const matrixWorld = this.matrixWorld; - const threshold = raycaster.params.Line.threshold; - const drawRange = geometry.drawRange; - if (geometry.boundingSphere === null) geometry.computeBoundingSphere(); - _sphere$1.copy(geometry.boundingSphere); - _sphere$1.applyMatrix4(matrixWorld); - _sphere$1.radius += threshold; - if (raycaster.ray.intersectsSphere(_sphere$1) === false) return; - _inverseMatrix$1.copy(matrixWorld).invert(); - _ray$1.copy(raycaster.ray).applyMatrix4(_inverseMatrix$1); - const localThreshold = threshold / ((this.scale.x + this.scale.y + this.scale.z) / 3); - const localThresholdSq = localThreshold * localThreshold; - const step = this.isLineSegments ? 2 : 1; - const index = geometry.index; - const attributes = geometry.attributes; - const positionAttribute = attributes.position; - if (index !== null) { - const start = Math.max(0, drawRange.start); - const end = Math.min(index.count, drawRange.start + drawRange.count); - for (let i = start, l = end - 1; i < l; i += step) { - const a = index.getX(i); - const b = index.getX(i + 1); - const intersect2 = checkIntersection(this, raycaster, _ray$1, localThresholdSq, a, b); - if (intersect2) { - intersects2.push(intersect2); - } - } - if (this.isLineLoop) { - const a = index.getX(end - 1); - const b = index.getX(start); - const intersect2 = checkIntersection(this, raycaster, _ray$1, localThresholdSq, a, b); - if (intersect2) { - intersects2.push(intersect2); - } - } - } else { - const start = Math.max(0, drawRange.start); - const end = Math.min(positionAttribute.count, drawRange.start + drawRange.count); - for (let i = start, l = end - 1; i < l; i += step) { - const intersect2 = checkIntersection(this, raycaster, _ray$1, localThresholdSq, i, i + 1); - if (intersect2) { - intersects2.push(intersect2); - } - } - if (this.isLineLoop) { - const intersect2 = checkIntersection(this, raycaster, _ray$1, localThresholdSq, end - 1, start); - if (intersect2) { - intersects2.push(intersect2); - } - } - } - } - updateMorphTargets() { - const geometry = this.geometry; - const morphAttributes = geometry.morphAttributes; - const keys = Object.keys(morphAttributes); - if (keys.length > 0) { - const morphAttribute = morphAttributes[keys[0]]; - if (morphAttribute !== void 0) { - this.morphTargetInfluences = []; - this.morphTargetDictionary = {}; - for (let m = 0, ml = morphAttribute.length; m < ml; m++) { - const name = morphAttribute[m].name || String(m); - this.morphTargetInfluences.push(0); - this.morphTargetDictionary[name] = m; - } - } - } - } -} -function checkIntersection(object, raycaster, ray, thresholdSq, a, b) { - const positionAttribute = object.geometry.attributes.position; - _vStart.fromBufferAttribute(positionAttribute, a); - _vEnd.fromBufferAttribute(positionAttribute, b); - const distSq = ray.distanceSqToSegment(_vStart, _vEnd, _intersectPointOnRay, _intersectPointOnSegment); - if (distSq > thresholdSq) return; - _intersectPointOnRay.applyMatrix4(object.matrixWorld); - const distance = raycaster.ray.origin.distanceTo(_intersectPointOnRay); - if (distance < raycaster.near || distance > raycaster.far) return; - return { - distance, - // What do we want? intersection point on the ray or on the segment?? - // point: raycaster.ray.at( distance ), - point: _intersectPointOnSegment.clone().applyMatrix4(object.matrixWorld), - index: a, - face: null, - faceIndex: null, - barycoord: null, - object - }; -} -__name(checkIntersection, "checkIntersection"); -const _start = /* @__PURE__ */ new Vector3(); -const _end = /* @__PURE__ */ new Vector3(); -class LineSegments extends Line { - static { - __name(this, "LineSegments"); - } - constructor(geometry, material) { - super(geometry, material); - this.isLineSegments = true; - this.type = "LineSegments"; - } - computeLineDistances() { - const geometry = this.geometry; - if (geometry.index === null) { - const positionAttribute = geometry.attributes.position; - const lineDistances = []; - for (let i = 0, l = positionAttribute.count; i < l; i += 2) { - _start.fromBufferAttribute(positionAttribute, i); - _end.fromBufferAttribute(positionAttribute, i + 1); - lineDistances[i] = i === 0 ? 0 : lineDistances[i - 1]; - lineDistances[i + 1] = lineDistances[i] + _start.distanceTo(_end); - } - geometry.setAttribute("lineDistance", new Float32BufferAttribute(lineDistances, 1)); - } else { - console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); - } - return this; - } -} -class LineLoop extends Line { - static { - __name(this, "LineLoop"); - } - constructor(geometry, material) { - super(geometry, material); - this.isLineLoop = true; - this.type = "LineLoop"; - } -} -class PointsMaterial extends Material { - static { - __name(this, "PointsMaterial"); - } - static get type() { - return "PointsMaterial"; - } - constructor(parameters) { - super(); - this.isPointsMaterial = true; - this.color = new Color(16777215); - this.map = null; - this.alphaMap = null; - this.size = 1; - this.sizeAttenuation = true; - this.fog = true; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.color.copy(source.color); - this.map = source.map; - this.alphaMap = source.alphaMap; - this.size = source.size; - this.sizeAttenuation = source.sizeAttenuation; - this.fog = source.fog; - return this; - } -} -const _inverseMatrix = /* @__PURE__ */ new Matrix4(); -const _ray$4 = /* @__PURE__ */ new Ray(); -const _sphere = /* @__PURE__ */ new Sphere(); -const _position$2 = /* @__PURE__ */ new Vector3(); -class Points extends Object3D { - static { - __name(this, "Points"); - } - constructor(geometry = new BufferGeometry(), material = new PointsMaterial()) { - super(); - this.isPoints = true; - this.type = "Points"; - this.geometry = geometry; - this.material = material; - this.updateMorphTargets(); - } - copy(source, recursive) { - super.copy(source, recursive); - this.material = Array.isArray(source.material) ? source.material.slice() : source.material; - this.geometry = source.geometry; - return this; - } - raycast(raycaster, intersects2) { - const geometry = this.geometry; - const matrixWorld = this.matrixWorld; - const threshold = raycaster.params.Points.threshold; - const drawRange = geometry.drawRange; - if (geometry.boundingSphere === null) geometry.computeBoundingSphere(); - _sphere.copy(geometry.boundingSphere); - _sphere.applyMatrix4(matrixWorld); - _sphere.radius += threshold; - if (raycaster.ray.intersectsSphere(_sphere) === false) return; - _inverseMatrix.copy(matrixWorld).invert(); - _ray$4.copy(raycaster.ray).applyMatrix4(_inverseMatrix); - const localThreshold = threshold / ((this.scale.x + this.scale.y + this.scale.z) / 3); - const localThresholdSq = localThreshold * localThreshold; - const index = geometry.index; - const attributes = geometry.attributes; - const positionAttribute = attributes.position; - if (index !== null) { - const start = Math.max(0, drawRange.start); - const end = Math.min(index.count, drawRange.start + drawRange.count); - for (let i = start, il = end; i < il; i++) { - const a = index.getX(i); - _position$2.fromBufferAttribute(positionAttribute, a); - testPoint(_position$2, a, localThresholdSq, matrixWorld, raycaster, intersects2, this); - } - } else { - const start = Math.max(0, drawRange.start); - const end = Math.min(positionAttribute.count, drawRange.start + drawRange.count); - for (let i = start, l = end; i < l; i++) { - _position$2.fromBufferAttribute(positionAttribute, i); - testPoint(_position$2, i, localThresholdSq, matrixWorld, raycaster, intersects2, this); - } - } - } - updateMorphTargets() { - const geometry = this.geometry; - const morphAttributes = geometry.morphAttributes; - const keys = Object.keys(morphAttributes); - if (keys.length > 0) { - const morphAttribute = morphAttributes[keys[0]]; - if (morphAttribute !== void 0) { - this.morphTargetInfluences = []; - this.morphTargetDictionary = {}; - for (let m = 0, ml = morphAttribute.length; m < ml; m++) { - const name = morphAttribute[m].name || String(m); - this.morphTargetInfluences.push(0); - this.morphTargetDictionary[name] = m; - } - } - } - } -} -function testPoint(point, index, localThresholdSq, matrixWorld, raycaster, intersects2, object) { - const rayPointDistanceSq = _ray$4.distanceSqToPoint(point); - if (rayPointDistanceSq < localThresholdSq) { - const intersectPoint = new Vector3(); - _ray$4.closestPointToPoint(point, intersectPoint); - intersectPoint.applyMatrix4(matrixWorld); - const distance = raycaster.ray.origin.distanceTo(intersectPoint); - if (distance < raycaster.near || distance > raycaster.far) return; - intersects2.push({ - distance, - distanceToRay: Math.sqrt(rayPointDistanceSq), - point: intersectPoint, - index, - face: null, - faceIndex: null, - barycoord: null, - object - }); - } -} -__name(testPoint, "testPoint"); -class VideoTexture extends Texture { - static { - __name(this, "VideoTexture"); - } - constructor(video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) { - super(video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy); - this.isVideoTexture = true; - this.minFilter = minFilter !== void 0 ? minFilter : LinearFilter; - this.magFilter = magFilter !== void 0 ? magFilter : LinearFilter; - this.generateMipmaps = false; - const scope = this; - function updateVideo() { - scope.needsUpdate = true; - video.requestVideoFrameCallback(updateVideo); - } - __name(updateVideo, "updateVideo"); - if ("requestVideoFrameCallback" in video) { - video.requestVideoFrameCallback(updateVideo); - } - } - clone() { - return new this.constructor(this.image).copy(this); - } - update() { - const video = this.image; - const hasVideoFrameCallback = "requestVideoFrameCallback" in video; - if (hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA) { - this.needsUpdate = true; - } - } -} -class FramebufferTexture extends Texture { - static { - __name(this, "FramebufferTexture"); - } - constructor(width, height) { - super({ width, height }); - this.isFramebufferTexture = true; - this.magFilter = NearestFilter; - this.minFilter = NearestFilter; - this.generateMipmaps = false; - this.needsUpdate = true; - } -} -class CompressedTexture extends Texture { - static { - __name(this, "CompressedTexture"); - } - constructor(mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, colorSpace) { - super(null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace); - this.isCompressedTexture = true; - this.image = { width, height }; - this.mipmaps = mipmaps; - this.flipY = false; - this.generateMipmaps = false; - } -} -class CompressedArrayTexture extends CompressedTexture { - static { - __name(this, "CompressedArrayTexture"); - } - constructor(mipmaps, width, height, depth, format, type) { - super(mipmaps, width, height, format, type); - this.isCompressedArrayTexture = true; - this.image.depth = depth; - this.wrapR = ClampToEdgeWrapping; - this.layerUpdates = /* @__PURE__ */ new Set(); - } - addLayerUpdate(layerIndex) { - this.layerUpdates.add(layerIndex); - } - clearLayerUpdates() { - this.layerUpdates.clear(); - } -} -class CompressedCubeTexture extends CompressedTexture { - static { - __name(this, "CompressedCubeTexture"); - } - constructor(images, format, type) { - super(void 0, images[0].width, images[0].height, format, type, CubeReflectionMapping); - this.isCompressedCubeTexture = true; - this.isCubeTexture = true; - this.image = images; - } -} -class CanvasTexture extends Texture { - static { - __name(this, "CanvasTexture"); - } - constructor(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) { - super(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy); - this.isCanvasTexture = true; - this.needsUpdate = true; - } -} -class Curve { - static { - __name(this, "Curve"); - } - constructor() { - this.type = "Curve"; - this.arcLengthDivisions = 200; - } - // Virtual base class method to overwrite and implement in subclasses - // - t [0 .. 1] - getPoint() { - console.warn("THREE.Curve: .getPoint() not implemented."); - return null; - } - // Get point at relative position in curve according to arc length - // - u [0 .. 1] - getPointAt(u, optionalTarget) { - const t2 = this.getUtoTmapping(u); - return this.getPoint(t2, optionalTarget); - } - // Get sequence of points using getPoint( t ) - getPoints(divisions = 5) { - const points = []; - for (let d = 0; d <= divisions; d++) { - points.push(this.getPoint(d / divisions)); - } - return points; - } - // Get sequence of points using getPointAt( u ) - getSpacedPoints(divisions = 5) { - const points = []; - for (let d = 0; d <= divisions; d++) { - points.push(this.getPointAt(d / divisions)); - } - return points; - } - // Get total curve arc length - getLength() { - const lengths = this.getLengths(); - return lengths[lengths.length - 1]; - } - // Get list of cumulative segment lengths - getLengths(divisions = this.arcLengthDivisions) { - if (this.cacheArcLengths && this.cacheArcLengths.length === divisions + 1 && !this.needsUpdate) { - return this.cacheArcLengths; - } - this.needsUpdate = false; - const cache = []; - let current, last = this.getPoint(0); - let sum = 0; - cache.push(0); - for (let p = 1; p <= divisions; p++) { - current = this.getPoint(p / divisions); - sum += current.distanceTo(last); - cache.push(sum); - last = current; - } - this.cacheArcLengths = cache; - return cache; - } - updateArcLengths() { - this.needsUpdate = true; - this.getLengths(); - } - // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant - getUtoTmapping(u, distance) { - const arcLengths = this.getLengths(); - let i = 0; - const il = arcLengths.length; - let targetArcLength; - if (distance) { - targetArcLength = distance; - } else { - targetArcLength = u * arcLengths[il - 1]; - } - let low = 0, high = il - 1, comparison; - while (low <= high) { - i = Math.floor(low + (high - low) / 2); - comparison = arcLengths[i] - targetArcLength; - if (comparison < 0) { - low = i + 1; - } else if (comparison > 0) { - high = i - 1; - } else { - high = i; - break; - } - } - i = high; - if (arcLengths[i] === targetArcLength) { - return i / (il - 1); - } - const lengthBefore = arcLengths[i]; - const lengthAfter = arcLengths[i + 1]; - const segmentLength = lengthAfter - lengthBefore; - const segmentFraction = (targetArcLength - lengthBefore) / segmentLength; - const t2 = (i + segmentFraction) / (il - 1); - return t2; - } - // Returns a unit vector tangent at t - // In case any sub curve does not implement its tangent derivation, - // 2 points a small delta apart will be used to find its gradient - // which seems to give a reasonable approximation - getTangent(t2, optionalTarget) { - const delta = 1e-4; - let t1 = t2 - delta; - let t22 = t2 + delta; - if (t1 < 0) t1 = 0; - if (t22 > 1) t22 = 1; - const pt1 = this.getPoint(t1); - const pt2 = this.getPoint(t22); - const tangent = optionalTarget || (pt1.isVector2 ? new Vector2() : new Vector3()); - tangent.copy(pt2).sub(pt1).normalize(); - return tangent; - } - getTangentAt(u, optionalTarget) { - const t2 = this.getUtoTmapping(u); - return this.getTangent(t2, optionalTarget); - } - computeFrenetFrames(segments, closed) { - const normal = new Vector3(); - const tangents = []; - const normals = []; - const binormals = []; - const vec = new Vector3(); - const mat = new Matrix4(); - for (let i = 0; i <= segments; i++) { - const u = i / segments; - tangents[i] = this.getTangentAt(u, new Vector3()); - } - normals[0] = new Vector3(); - binormals[0] = new Vector3(); - let min = Number.MAX_VALUE; - const tx = Math.abs(tangents[0].x); - const ty = Math.abs(tangents[0].y); - const tz = Math.abs(tangents[0].z); - if (tx <= min) { - min = tx; - normal.set(1, 0, 0); - } - if (ty <= min) { - min = ty; - normal.set(0, 1, 0); - } - if (tz <= min) { - normal.set(0, 0, 1); - } - vec.crossVectors(tangents[0], normal).normalize(); - normals[0].crossVectors(tangents[0], vec); - binormals[0].crossVectors(tangents[0], normals[0]); - for (let i = 1; i <= segments; i++) { - normals[i] = normals[i - 1].clone(); - binormals[i] = binormals[i - 1].clone(); - vec.crossVectors(tangents[i - 1], tangents[i]); - if (vec.length() > Number.EPSILON) { - vec.normalize(); - const theta = Math.acos(clamp(tangents[i - 1].dot(tangents[i]), -1, 1)); - normals[i].applyMatrix4(mat.makeRotationAxis(vec, theta)); - } - binormals[i].crossVectors(tangents[i], normals[i]); - } - if (closed === true) { - let theta = Math.acos(clamp(normals[0].dot(normals[segments]), -1, 1)); - theta /= segments; - if (tangents[0].dot(vec.crossVectors(normals[0], normals[segments])) > 0) { - theta = -theta; - } - for (let i = 1; i <= segments; i++) { - normals[i].applyMatrix4(mat.makeRotationAxis(tangents[i], theta * i)); - binormals[i].crossVectors(tangents[i], normals[i]); - } - } - return { - tangents, - normals, - binormals - }; - } - clone() { - return new this.constructor().copy(this); - } - copy(source) { - this.arcLengthDivisions = source.arcLengthDivisions; - return this; - } - toJSON() { - const data = { - metadata: { - version: 4.6, - type: "Curve", - generator: "Curve.toJSON" - } - }; - data.arcLengthDivisions = this.arcLengthDivisions; - data.type = this.type; - return data; - } - fromJSON(json) { - this.arcLengthDivisions = json.arcLengthDivisions; - return this; - } -} -class EllipseCurve extends Curve { - static { - __name(this, "EllipseCurve"); - } - constructor(aX = 0, aY = 0, xRadius = 1, yRadius = 1, aStartAngle = 0, aEndAngle = Math.PI * 2, aClockwise = false, aRotation = 0) { - super(); - this.isEllipseCurve = true; - this.type = "EllipseCurve"; - this.aX = aX; - this.aY = aY; - this.xRadius = xRadius; - this.yRadius = yRadius; - this.aStartAngle = aStartAngle; - this.aEndAngle = aEndAngle; - this.aClockwise = aClockwise; - this.aRotation = aRotation; - } - getPoint(t2, optionalTarget = new Vector2()) { - const point = optionalTarget; - const twoPi = Math.PI * 2; - let deltaAngle = this.aEndAngle - this.aStartAngle; - const samePoints = Math.abs(deltaAngle) < Number.EPSILON; - while (deltaAngle < 0) deltaAngle += twoPi; - while (deltaAngle > twoPi) deltaAngle -= twoPi; - if (deltaAngle < Number.EPSILON) { - if (samePoints) { - deltaAngle = 0; - } else { - deltaAngle = twoPi; - } - } - if (this.aClockwise === true && !samePoints) { - if (deltaAngle === twoPi) { - deltaAngle = -twoPi; - } else { - deltaAngle = deltaAngle - twoPi; - } - } - const angle = this.aStartAngle + t2 * deltaAngle; - let x = this.aX + this.xRadius * Math.cos(angle); - let y = this.aY + this.yRadius * Math.sin(angle); - if (this.aRotation !== 0) { - const cos = Math.cos(this.aRotation); - const sin = Math.sin(this.aRotation); - const tx = x - this.aX; - const ty = y - this.aY; - x = tx * cos - ty * sin + this.aX; - y = tx * sin + ty * cos + this.aY; - } - return point.set(x, y); - } - copy(source) { - super.copy(source); - this.aX = source.aX; - this.aY = source.aY; - this.xRadius = source.xRadius; - this.yRadius = source.yRadius; - this.aStartAngle = source.aStartAngle; - this.aEndAngle = source.aEndAngle; - this.aClockwise = source.aClockwise; - this.aRotation = source.aRotation; - return this; - } - toJSON() { - const data = super.toJSON(); - data.aX = this.aX; - data.aY = this.aY; - data.xRadius = this.xRadius; - data.yRadius = this.yRadius; - data.aStartAngle = this.aStartAngle; - data.aEndAngle = this.aEndAngle; - data.aClockwise = this.aClockwise; - data.aRotation = this.aRotation; - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.aX = json.aX; - this.aY = json.aY; - this.xRadius = json.xRadius; - this.yRadius = json.yRadius; - this.aStartAngle = json.aStartAngle; - this.aEndAngle = json.aEndAngle; - this.aClockwise = json.aClockwise; - this.aRotation = json.aRotation; - return this; - } -} -class ArcCurve extends EllipseCurve { - static { - __name(this, "ArcCurve"); - } - constructor(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) { - super(aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise); - this.isArcCurve = true; - this.type = "ArcCurve"; - } -} -function CubicPoly() { - let c0 = 0, c1 = 0, c2 = 0, c3 = 0; - function init(x0, x1, t0, t1) { - c0 = x0; - c1 = t0; - c2 = -3 * x0 + 3 * x1 - 2 * t0 - t1; - c3 = 2 * x0 - 2 * x1 + t0 + t1; - } - __name(init, "init"); - return { - initCatmullRom: /* @__PURE__ */ __name(function(x0, x1, x2, x3, tension) { - init(x1, x2, tension * (x2 - x0), tension * (x3 - x1)); - }, "initCatmullRom"), - initNonuniformCatmullRom: /* @__PURE__ */ __name(function(x0, x1, x2, x3, dt0, dt1, dt2) { - let t1 = (x1 - x0) / dt0 - (x2 - x0) / (dt0 + dt1) + (x2 - x1) / dt1; - let t2 = (x2 - x1) / dt1 - (x3 - x1) / (dt1 + dt2) + (x3 - x2) / dt2; - t1 *= dt1; - t2 *= dt1; - init(x1, x2, t1, t2); - }, "initNonuniformCatmullRom"), - calc: /* @__PURE__ */ __name(function(t2) { - const t22 = t2 * t2; - const t3 = t22 * t2; - return c0 + c1 * t2 + c2 * t22 + c3 * t3; - }, "calc") - }; -} -__name(CubicPoly, "CubicPoly"); -const tmp = /* @__PURE__ */ new Vector3(); -const px = /* @__PURE__ */ new CubicPoly(); -const py = /* @__PURE__ */ new CubicPoly(); -const pz = /* @__PURE__ */ new CubicPoly(); -class CatmullRomCurve3 extends Curve { - static { - __name(this, "CatmullRomCurve3"); - } - constructor(points = [], closed = false, curveType = "centripetal", tension = 0.5) { - super(); - this.isCatmullRomCurve3 = true; - this.type = "CatmullRomCurve3"; - this.points = points; - this.closed = closed; - this.curveType = curveType; - this.tension = tension; - } - getPoint(t2, optionalTarget = new Vector3()) { - const point = optionalTarget; - const points = this.points; - const l = points.length; - const p = (l - (this.closed ? 0 : 1)) * t2; - let intPoint = Math.floor(p); - let weight = p - intPoint; - if (this.closed) { - intPoint += intPoint > 0 ? 0 : (Math.floor(Math.abs(intPoint) / l) + 1) * l; - } else if (weight === 0 && intPoint === l - 1) { - intPoint = l - 2; - weight = 1; - } - let p0, p3; - if (this.closed || intPoint > 0) { - p0 = points[(intPoint - 1) % l]; - } else { - tmp.subVectors(points[0], points[1]).add(points[0]); - p0 = tmp; - } - const p1 = points[intPoint % l]; - const p2 = points[(intPoint + 1) % l]; - if (this.closed || intPoint + 2 < l) { - p3 = points[(intPoint + 2) % l]; - } else { - tmp.subVectors(points[l - 1], points[l - 2]).add(points[l - 1]); - p3 = tmp; - } - if (this.curveType === "centripetal" || this.curveType === "chordal") { - const pow = this.curveType === "chordal" ? 0.5 : 0.25; - let dt0 = Math.pow(p0.distanceToSquared(p1), pow); - let dt1 = Math.pow(p1.distanceToSquared(p2), pow); - let dt2 = Math.pow(p2.distanceToSquared(p3), pow); - if (dt1 < 1e-4) dt1 = 1; - if (dt0 < 1e-4) dt0 = dt1; - if (dt2 < 1e-4) dt2 = dt1; - px.initNonuniformCatmullRom(p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2); - py.initNonuniformCatmullRom(p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2); - pz.initNonuniformCatmullRom(p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2); - } else if (this.curveType === "catmullrom") { - px.initCatmullRom(p0.x, p1.x, p2.x, p3.x, this.tension); - py.initCatmullRom(p0.y, p1.y, p2.y, p3.y, this.tension); - pz.initCatmullRom(p0.z, p1.z, p2.z, p3.z, this.tension); - } - point.set( - px.calc(weight), - py.calc(weight), - pz.calc(weight) - ); - return point; - } - copy(source) { - super.copy(source); - this.points = []; - for (let i = 0, l = source.points.length; i < l; i++) { - const point = source.points[i]; - this.points.push(point.clone()); - } - this.closed = source.closed; - this.curveType = source.curveType; - this.tension = source.tension; - return this; - } - toJSON() { - const data = super.toJSON(); - data.points = []; - for (let i = 0, l = this.points.length; i < l; i++) { - const point = this.points[i]; - data.points.push(point.toArray()); - } - data.closed = this.closed; - data.curveType = this.curveType; - data.tension = this.tension; - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.points = []; - for (let i = 0, l = json.points.length; i < l; i++) { - const point = json.points[i]; - this.points.push(new Vector3().fromArray(point)); - } - this.closed = json.closed; - this.curveType = json.curveType; - this.tension = json.tension; - return this; - } -} -function CatmullRom(t2, p0, p1, p2, p3) { - const v0 = (p2 - p0) * 0.5; - const v1 = (p3 - p1) * 0.5; - const t22 = t2 * t2; - const t3 = t2 * t22; - return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t22 + v0 * t2 + p1; -} -__name(CatmullRom, "CatmullRom"); -function QuadraticBezierP0(t2, p) { - const k = 1 - t2; - return k * k * p; -} -__name(QuadraticBezierP0, "QuadraticBezierP0"); -function QuadraticBezierP1(t2, p) { - return 2 * (1 - t2) * t2 * p; -} -__name(QuadraticBezierP1, "QuadraticBezierP1"); -function QuadraticBezierP2(t2, p) { - return t2 * t2 * p; -} -__name(QuadraticBezierP2, "QuadraticBezierP2"); -function QuadraticBezier(t2, p0, p1, p2) { - return QuadraticBezierP0(t2, p0) + QuadraticBezierP1(t2, p1) + QuadraticBezierP2(t2, p2); -} -__name(QuadraticBezier, "QuadraticBezier"); -function CubicBezierP0(t2, p) { - const k = 1 - t2; - return k * k * k * p; -} -__name(CubicBezierP0, "CubicBezierP0"); -function CubicBezierP1(t2, p) { - const k = 1 - t2; - return 3 * k * k * t2 * p; -} -__name(CubicBezierP1, "CubicBezierP1"); -function CubicBezierP2(t2, p) { - return 3 * (1 - t2) * t2 * t2 * p; -} -__name(CubicBezierP2, "CubicBezierP2"); -function CubicBezierP3(t2, p) { - return t2 * t2 * t2 * p; -} -__name(CubicBezierP3, "CubicBezierP3"); -function CubicBezier(t2, p0, p1, p2, p3) { - return CubicBezierP0(t2, p0) + CubicBezierP1(t2, p1) + CubicBezierP2(t2, p2) + CubicBezierP3(t2, p3); -} -__name(CubicBezier, "CubicBezier"); -class CubicBezierCurve extends Curve { - static { - __name(this, "CubicBezierCurve"); - } - constructor(v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2()) { - super(); - this.isCubicBezierCurve = true; - this.type = "CubicBezierCurve"; - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; - } - getPoint(t2, optionalTarget = new Vector2()) { - const point = optionalTarget; - const v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; - point.set( - CubicBezier(t2, v0.x, v1.x, v2.x, v3.x), - CubicBezier(t2, v0.y, v1.y, v2.y, v3.y) - ); - return point; - } - copy(source) { - super.copy(source); - this.v0.copy(source.v0); - this.v1.copy(source.v1); - this.v2.copy(source.v2); - this.v3.copy(source.v3); - return this; - } - toJSON() { - const data = super.toJSON(); - data.v0 = this.v0.toArray(); - data.v1 = this.v1.toArray(); - data.v2 = this.v2.toArray(); - data.v3 = this.v3.toArray(); - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.v0.fromArray(json.v0); - this.v1.fromArray(json.v1); - this.v2.fromArray(json.v2); - this.v3.fromArray(json.v3); - return this; - } -} -class CubicBezierCurve3 extends Curve { - static { - __name(this, "CubicBezierCurve3"); - } - constructor(v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3(), v3 = new Vector3()) { - super(); - this.isCubicBezierCurve3 = true; - this.type = "CubicBezierCurve3"; - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; - } - getPoint(t2, optionalTarget = new Vector3()) { - const point = optionalTarget; - const v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; - point.set( - CubicBezier(t2, v0.x, v1.x, v2.x, v3.x), - CubicBezier(t2, v0.y, v1.y, v2.y, v3.y), - CubicBezier(t2, v0.z, v1.z, v2.z, v3.z) - ); - return point; - } - copy(source) { - super.copy(source); - this.v0.copy(source.v0); - this.v1.copy(source.v1); - this.v2.copy(source.v2); - this.v3.copy(source.v3); - return this; - } - toJSON() { - const data = super.toJSON(); - data.v0 = this.v0.toArray(); - data.v1 = this.v1.toArray(); - data.v2 = this.v2.toArray(); - data.v3 = this.v3.toArray(); - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.v0.fromArray(json.v0); - this.v1.fromArray(json.v1); - this.v2.fromArray(json.v2); - this.v3.fromArray(json.v3); - return this; - } -} -class LineCurve extends Curve { - static { - __name(this, "LineCurve"); - } - constructor(v1 = new Vector2(), v2 = new Vector2()) { - super(); - this.isLineCurve = true; - this.type = "LineCurve"; - this.v1 = v1; - this.v2 = v2; - } - getPoint(t2, optionalTarget = new Vector2()) { - const point = optionalTarget; - if (t2 === 1) { - point.copy(this.v2); - } else { - point.copy(this.v2).sub(this.v1); - point.multiplyScalar(t2).add(this.v1); - } - return point; - } - // Line curve is linear, so we can overwrite default getPointAt - getPointAt(u, optionalTarget) { - return this.getPoint(u, optionalTarget); - } - getTangent(t2, optionalTarget = new Vector2()) { - return optionalTarget.subVectors(this.v2, this.v1).normalize(); - } - getTangentAt(u, optionalTarget) { - return this.getTangent(u, optionalTarget); - } - copy(source) { - super.copy(source); - this.v1.copy(source.v1); - this.v2.copy(source.v2); - return this; - } - toJSON() { - const data = super.toJSON(); - data.v1 = this.v1.toArray(); - data.v2 = this.v2.toArray(); - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.v1.fromArray(json.v1); - this.v2.fromArray(json.v2); - return this; - } -} -class LineCurve3 extends Curve { - static { - __name(this, "LineCurve3"); - } - constructor(v1 = new Vector3(), v2 = new Vector3()) { - super(); - this.isLineCurve3 = true; - this.type = "LineCurve3"; - this.v1 = v1; - this.v2 = v2; - } - getPoint(t2, optionalTarget = new Vector3()) { - const point = optionalTarget; - if (t2 === 1) { - point.copy(this.v2); - } else { - point.copy(this.v2).sub(this.v1); - point.multiplyScalar(t2).add(this.v1); - } - return point; - } - // Line curve is linear, so we can overwrite default getPointAt - getPointAt(u, optionalTarget) { - return this.getPoint(u, optionalTarget); - } - getTangent(t2, optionalTarget = new Vector3()) { - return optionalTarget.subVectors(this.v2, this.v1).normalize(); - } - getTangentAt(u, optionalTarget) { - return this.getTangent(u, optionalTarget); - } - copy(source) { - super.copy(source); - this.v1.copy(source.v1); - this.v2.copy(source.v2); - return this; - } - toJSON() { - const data = super.toJSON(); - data.v1 = this.v1.toArray(); - data.v2 = this.v2.toArray(); - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.v1.fromArray(json.v1); - this.v2.fromArray(json.v2); - return this; - } -} -class QuadraticBezierCurve extends Curve { - static { - __name(this, "QuadraticBezierCurve"); - } - constructor(v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2()) { - super(); - this.isQuadraticBezierCurve = true; - this.type = "QuadraticBezierCurve"; - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; - } - getPoint(t2, optionalTarget = new Vector2()) { - const point = optionalTarget; - const v0 = this.v0, v1 = this.v1, v2 = this.v2; - point.set( - QuadraticBezier(t2, v0.x, v1.x, v2.x), - QuadraticBezier(t2, v0.y, v1.y, v2.y) - ); - return point; - } - copy(source) { - super.copy(source); - this.v0.copy(source.v0); - this.v1.copy(source.v1); - this.v2.copy(source.v2); - return this; - } - toJSON() { - const data = super.toJSON(); - data.v0 = this.v0.toArray(); - data.v1 = this.v1.toArray(); - data.v2 = this.v2.toArray(); - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.v0.fromArray(json.v0); - this.v1.fromArray(json.v1); - this.v2.fromArray(json.v2); - return this; - } -} -class QuadraticBezierCurve3 extends Curve { - static { - __name(this, "QuadraticBezierCurve3"); - } - constructor(v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3()) { - super(); - this.isQuadraticBezierCurve3 = true; - this.type = "QuadraticBezierCurve3"; - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; - } - getPoint(t2, optionalTarget = new Vector3()) { - const point = optionalTarget; - const v0 = this.v0, v1 = this.v1, v2 = this.v2; - point.set( - QuadraticBezier(t2, v0.x, v1.x, v2.x), - QuadraticBezier(t2, v0.y, v1.y, v2.y), - QuadraticBezier(t2, v0.z, v1.z, v2.z) - ); - return point; - } - copy(source) { - super.copy(source); - this.v0.copy(source.v0); - this.v1.copy(source.v1); - this.v2.copy(source.v2); - return this; - } - toJSON() { - const data = super.toJSON(); - data.v0 = this.v0.toArray(); - data.v1 = this.v1.toArray(); - data.v2 = this.v2.toArray(); - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.v0.fromArray(json.v0); - this.v1.fromArray(json.v1); - this.v2.fromArray(json.v2); - return this; - } -} -class SplineCurve extends Curve { - static { - __name(this, "SplineCurve"); - } - constructor(points = []) { - super(); - this.isSplineCurve = true; - this.type = "SplineCurve"; - this.points = points; - } - getPoint(t2, optionalTarget = new Vector2()) { - const point = optionalTarget; - const points = this.points; - const p = (points.length - 1) * t2; - const intPoint = Math.floor(p); - const weight = p - intPoint; - const p0 = points[intPoint === 0 ? intPoint : intPoint - 1]; - const p1 = points[intPoint]; - const p2 = points[intPoint > points.length - 2 ? points.length - 1 : intPoint + 1]; - const p3 = points[intPoint > points.length - 3 ? points.length - 1 : intPoint + 2]; - point.set( - CatmullRom(weight, p0.x, p1.x, p2.x, p3.x), - CatmullRom(weight, p0.y, p1.y, p2.y, p3.y) - ); - return point; - } - copy(source) { - super.copy(source); - this.points = []; - for (let i = 0, l = source.points.length; i < l; i++) { - const point = source.points[i]; - this.points.push(point.clone()); - } - return this; - } - toJSON() { - const data = super.toJSON(); - data.points = []; - for (let i = 0, l = this.points.length; i < l; i++) { - const point = this.points[i]; - data.points.push(point.toArray()); - } - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.points = []; - for (let i = 0, l = json.points.length; i < l; i++) { - const point = json.points[i]; - this.points.push(new Vector2().fromArray(point)); - } - return this; - } -} -var Curves = /* @__PURE__ */ Object.freeze({ - __proto__: null, - ArcCurve, - CatmullRomCurve3, - CubicBezierCurve, - CubicBezierCurve3, - EllipseCurve, - LineCurve, - LineCurve3, - QuadraticBezierCurve, - QuadraticBezierCurve3, - SplineCurve -}); -class CurvePath extends Curve { - static { - __name(this, "CurvePath"); - } - constructor() { - super(); - this.type = "CurvePath"; - this.curves = []; - this.autoClose = false; - } - add(curve) { - this.curves.push(curve); - } - closePath() { - const startPoint = this.curves[0].getPoint(0); - const endPoint = this.curves[this.curves.length - 1].getPoint(1); - if (!startPoint.equals(endPoint)) { - const lineType = startPoint.isVector2 === true ? "LineCurve" : "LineCurve3"; - this.curves.push(new Curves[lineType](endPoint, startPoint)); - } - return this; - } - // To get accurate point with reference to - // entire path distance at time t, - // following has to be done: - // 1. Length of each sub path have to be known - // 2. Locate and identify type of curve - // 3. Get t for the curve - // 4. Return curve.getPointAt(t') - getPoint(t2, optionalTarget) { - const d = t2 * this.getLength(); - const curveLengths = this.getCurveLengths(); - let i = 0; - while (i < curveLengths.length) { - if (curveLengths[i] >= d) { - const diff = curveLengths[i] - d; - const curve = this.curves[i]; - const segmentLength = curve.getLength(); - const u = segmentLength === 0 ? 0 : 1 - diff / segmentLength; - return curve.getPointAt(u, optionalTarget); - } - i++; - } - return null; - } - // We cannot use the default THREE.Curve getPoint() with getLength() because in - // THREE.Curve, getLength() depends on getPoint() but in THREE.CurvePath - // getPoint() depends on getLength - getLength() { - const lens = this.getCurveLengths(); - return lens[lens.length - 1]; - } - // cacheLengths must be recalculated. - updateArcLengths() { - this.needsUpdate = true; - this.cacheLengths = null; - this.getCurveLengths(); - } - // Compute lengths and cache them - // We cannot overwrite getLengths() because UtoT mapping uses it. - getCurveLengths() { - if (this.cacheLengths && this.cacheLengths.length === this.curves.length) { - return this.cacheLengths; - } - const lengths = []; - let sums = 0; - for (let i = 0, l = this.curves.length; i < l; i++) { - sums += this.curves[i].getLength(); - lengths.push(sums); - } - this.cacheLengths = lengths; - return lengths; - } - getSpacedPoints(divisions = 40) { - const points = []; - for (let i = 0; i <= divisions; i++) { - points.push(this.getPoint(i / divisions)); - } - if (this.autoClose) { - points.push(points[0]); - } - return points; - } - getPoints(divisions = 12) { - const points = []; - let last; - for (let i = 0, curves = this.curves; i < curves.length; i++) { - const curve = curves[i]; - const resolution = curve.isEllipseCurve ? divisions * 2 : curve.isLineCurve || curve.isLineCurve3 ? 1 : curve.isSplineCurve ? divisions * curve.points.length : divisions; - const pts = curve.getPoints(resolution); - for (let j = 0; j < pts.length; j++) { - const point = pts[j]; - if (last && last.equals(point)) continue; - points.push(point); - last = point; - } - } - if (this.autoClose && points.length > 1 && !points[points.length - 1].equals(points[0])) { - points.push(points[0]); - } - return points; - } - copy(source) { - super.copy(source); - this.curves = []; - for (let i = 0, l = source.curves.length; i < l; i++) { - const curve = source.curves[i]; - this.curves.push(curve.clone()); - } - this.autoClose = source.autoClose; - return this; - } - toJSON() { - const data = super.toJSON(); - data.autoClose = this.autoClose; - data.curves = []; - for (let i = 0, l = this.curves.length; i < l; i++) { - const curve = this.curves[i]; - data.curves.push(curve.toJSON()); - } - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.autoClose = json.autoClose; - this.curves = []; - for (let i = 0, l = json.curves.length; i < l; i++) { - const curve = json.curves[i]; - this.curves.push(new Curves[curve.type]().fromJSON(curve)); - } - return this; - } -} -class Path extends CurvePath { - static { - __name(this, "Path"); - } - constructor(points) { - super(); - this.type = "Path"; - this.currentPoint = new Vector2(); - if (points) { - this.setFromPoints(points); - } - } - setFromPoints(points) { - this.moveTo(points[0].x, points[0].y); - for (let i = 1, l = points.length; i < l; i++) { - this.lineTo(points[i].x, points[i].y); - } - return this; - } - moveTo(x, y) { - this.currentPoint.set(x, y); - return this; - } - lineTo(x, y) { - const curve = new LineCurve(this.currentPoint.clone(), new Vector2(x, y)); - this.curves.push(curve); - this.currentPoint.set(x, y); - return this; - } - quadraticCurveTo(aCPx, aCPy, aX, aY) { - const curve = new QuadraticBezierCurve( - this.currentPoint.clone(), - new Vector2(aCPx, aCPy), - new Vector2(aX, aY) - ); - this.curves.push(curve); - this.currentPoint.set(aX, aY); - return this; - } - bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) { - const curve = new CubicBezierCurve( - this.currentPoint.clone(), - new Vector2(aCP1x, aCP1y), - new Vector2(aCP2x, aCP2y), - new Vector2(aX, aY) - ); - this.curves.push(curve); - this.currentPoint.set(aX, aY); - return this; - } - splineThru(pts) { - const npts = [this.currentPoint.clone()].concat(pts); - const curve = new SplineCurve(npts); - this.curves.push(curve); - this.currentPoint.copy(pts[pts.length - 1]); - return this; - } - arc(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) { - const x0 = this.currentPoint.x; - const y0 = this.currentPoint.y; - this.absarc( - aX + x0, - aY + y0, - aRadius, - aStartAngle, - aEndAngle, - aClockwise - ); - return this; - } - absarc(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) { - this.absellipse(aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise); - return this; - } - ellipse(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation) { - const x0 = this.currentPoint.x; - const y0 = this.currentPoint.y; - this.absellipse(aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation); - return this; - } - absellipse(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation) { - const curve = new EllipseCurve(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation); - if (this.curves.length > 0) { - const firstPoint = curve.getPoint(0); - if (!firstPoint.equals(this.currentPoint)) { - this.lineTo(firstPoint.x, firstPoint.y); - } - } - this.curves.push(curve); - const lastPoint = curve.getPoint(1); - this.currentPoint.copy(lastPoint); - return this; - } - copy(source) { - super.copy(source); - this.currentPoint.copy(source.currentPoint); - return this; - } - toJSON() { - const data = super.toJSON(); - data.currentPoint = this.currentPoint.toArray(); - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.currentPoint.fromArray(json.currentPoint); - return this; - } -} -class LatheGeometry extends BufferGeometry { - static { - __name(this, "LatheGeometry"); - } - constructor(points = [new Vector2(0, -0.5), new Vector2(0.5, 0), new Vector2(0, 0.5)], segments = 12, phiStart = 0, phiLength = Math.PI * 2) { - super(); - this.type = "LatheGeometry"; - this.parameters = { - points, - segments, - phiStart, - phiLength - }; - segments = Math.floor(segments); - phiLength = clamp(phiLength, 0, Math.PI * 2); - const indices = []; - const vertices = []; - const uvs = []; - const initNormals = []; - const normals = []; - const inverseSegments = 1 / segments; - const vertex2 = new Vector3(); - const uv = new Vector2(); - const normal = new Vector3(); - const curNormal = new Vector3(); - const prevNormal = new Vector3(); - let dx = 0; - let dy = 0; - for (let j = 0; j <= points.length - 1; j++) { - switch (j) { - case 0: - dx = points[j + 1].x - points[j].x; - dy = points[j + 1].y - points[j].y; - normal.x = dy * 1; - normal.y = -dx; - normal.z = dy * 0; - prevNormal.copy(normal); - normal.normalize(); - initNormals.push(normal.x, normal.y, normal.z); - break; - case points.length - 1: - initNormals.push(prevNormal.x, prevNormal.y, prevNormal.z); - break; - default: - dx = points[j + 1].x - points[j].x; - dy = points[j + 1].y - points[j].y; - normal.x = dy * 1; - normal.y = -dx; - normal.z = dy * 0; - curNormal.copy(normal); - normal.x += prevNormal.x; - normal.y += prevNormal.y; - normal.z += prevNormal.z; - normal.normalize(); - initNormals.push(normal.x, normal.y, normal.z); - prevNormal.copy(curNormal); - } - } - for (let i = 0; i <= segments; i++) { - const phi = phiStart + i * inverseSegments * phiLength; - const sin = Math.sin(phi); - const cos = Math.cos(phi); - for (let j = 0; j <= points.length - 1; j++) { - vertex2.x = points[j].x * sin; - vertex2.y = points[j].y; - vertex2.z = points[j].x * cos; - vertices.push(vertex2.x, vertex2.y, vertex2.z); - uv.x = i / segments; - uv.y = j / (points.length - 1); - uvs.push(uv.x, uv.y); - const x = initNormals[3 * j + 0] * sin; - const y = initNormals[3 * j + 1]; - const z = initNormals[3 * j + 0] * cos; - normals.push(x, y, z); - } - } - for (let i = 0; i < segments; i++) { - for (let j = 0; j < points.length - 1; j++) { - const base = j + i * points.length; - const a = base; - const b = base + points.length; - const c = base + points.length + 1; - const d = base + 1; - indices.push(a, b, d); - indices.push(c, d, b); - } - } - this.setIndex(indices); - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); - this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - static fromJSON(data) { - return new LatheGeometry(data.points, data.segments, data.phiStart, data.phiLength); - } -} -class CapsuleGeometry extends LatheGeometry { - static { - __name(this, "CapsuleGeometry"); - } - constructor(radius = 1, length = 1, capSegments = 4, radialSegments = 8) { - const path = new Path(); - path.absarc(0, -length / 2, radius, Math.PI * 1.5, 0); - path.absarc(0, length / 2, radius, 0, Math.PI * 0.5); - super(path.getPoints(capSegments), radialSegments); - this.type = "CapsuleGeometry"; - this.parameters = { - radius, - length, - capSegments, - radialSegments - }; - } - static fromJSON(data) { - return new CapsuleGeometry(data.radius, data.length, data.capSegments, data.radialSegments); - } -} -class CircleGeometry extends BufferGeometry { - static { - __name(this, "CircleGeometry"); - } - constructor(radius = 1, segments = 32, thetaStart = 0, thetaLength = Math.PI * 2) { - super(); - this.type = "CircleGeometry"; - this.parameters = { - radius, - segments, - thetaStart, - thetaLength - }; - segments = Math.max(3, segments); - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; - const vertex2 = new Vector3(); - const uv = new Vector2(); - vertices.push(0, 0, 0); - normals.push(0, 0, 1); - uvs.push(0.5, 0.5); - for (let s = 0, i = 3; s <= segments; s++, i += 3) { - const segment = thetaStart + s / segments * thetaLength; - vertex2.x = radius * Math.cos(segment); - vertex2.y = radius * Math.sin(segment); - vertices.push(vertex2.x, vertex2.y, vertex2.z); - normals.push(0, 0, 1); - uv.x = (vertices[i] / radius + 1) / 2; - uv.y = (vertices[i + 1] / radius + 1) / 2; - uvs.push(uv.x, uv.y); - } - for (let i = 1; i <= segments; i++) { - indices.push(i, i + 1, 0); - } - this.setIndex(indices); - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - static fromJSON(data) { - return new CircleGeometry(data.radius, data.segments, data.thetaStart, data.thetaLength); - } -} -class CylinderGeometry extends BufferGeometry { - static { - __name(this, "CylinderGeometry"); - } - constructor(radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2) { - super(); - this.type = "CylinderGeometry"; - this.parameters = { - radiusTop, - radiusBottom, - height, - radialSegments, - heightSegments, - openEnded, - thetaStart, - thetaLength - }; - const scope = this; - radialSegments = Math.floor(radialSegments); - heightSegments = Math.floor(heightSegments); - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; - let index = 0; - const indexArray = []; - const halfHeight = height / 2; - let groupStart = 0; - generateTorso(); - if (openEnded === false) { - if (radiusTop > 0) generateCap(true); - if (radiusBottom > 0) generateCap(false); - } - this.setIndex(indices); - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); - function generateTorso() { - const normal = new Vector3(); - const vertex2 = new Vector3(); - let groupCount = 0; - const slope = (radiusBottom - radiusTop) / height; - for (let y = 0; y <= heightSegments; y++) { - const indexRow = []; - const v = y / heightSegments; - const radius = v * (radiusBottom - radiusTop) + radiusTop; - for (let x = 0; x <= radialSegments; x++) { - const u = x / radialSegments; - const theta = u * thetaLength + thetaStart; - const sinTheta = Math.sin(theta); - const cosTheta = Math.cos(theta); - vertex2.x = radius * sinTheta; - vertex2.y = -v * height + halfHeight; - vertex2.z = radius * cosTheta; - vertices.push(vertex2.x, vertex2.y, vertex2.z); - normal.set(sinTheta, slope, cosTheta).normalize(); - normals.push(normal.x, normal.y, normal.z); - uvs.push(u, 1 - v); - indexRow.push(index++); - } - indexArray.push(indexRow); - } - for (let x = 0; x < radialSegments; x++) { - for (let y = 0; y < heightSegments; y++) { - const a = indexArray[y][x]; - const b = indexArray[y + 1][x]; - const c = indexArray[y + 1][x + 1]; - const d = indexArray[y][x + 1]; - if (radiusTop > 0 || y !== 0) { - indices.push(a, b, d); - groupCount += 3; - } - if (radiusBottom > 0 || y !== heightSegments - 1) { - indices.push(b, c, d); - groupCount += 3; - } - } - } - scope.addGroup(groupStart, groupCount, 0); - groupStart += groupCount; - } - __name(generateTorso, "generateTorso"); - function generateCap(top) { - const centerIndexStart = index; - const uv = new Vector2(); - const vertex2 = new Vector3(); - let groupCount = 0; - const radius = top === true ? radiusTop : radiusBottom; - const sign2 = top === true ? 1 : -1; - for (let x = 1; x <= radialSegments; x++) { - vertices.push(0, halfHeight * sign2, 0); - normals.push(0, sign2, 0); - uvs.push(0.5, 0.5); - index++; - } - const centerIndexEnd = index; - for (let x = 0; x <= radialSegments; x++) { - const u = x / radialSegments; - const theta = u * thetaLength + thetaStart; - const cosTheta = Math.cos(theta); - const sinTheta = Math.sin(theta); - vertex2.x = radius * sinTheta; - vertex2.y = halfHeight * sign2; - vertex2.z = radius * cosTheta; - vertices.push(vertex2.x, vertex2.y, vertex2.z); - normals.push(0, sign2, 0); - uv.x = cosTheta * 0.5 + 0.5; - uv.y = sinTheta * 0.5 * sign2 + 0.5; - uvs.push(uv.x, uv.y); - index++; - } - for (let x = 0; x < radialSegments; x++) { - const c = centerIndexStart + x; - const i = centerIndexEnd + x; - if (top === true) { - indices.push(i, i + 1, c); - } else { - indices.push(i + 1, i, c); - } - groupCount += 3; - } - scope.addGroup(groupStart, groupCount, top === true ? 1 : 2); - groupStart += groupCount; - } - __name(generateCap, "generateCap"); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - static fromJSON(data) { - return new CylinderGeometry(data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength); - } -} -class ConeGeometry extends CylinderGeometry { - static { - __name(this, "ConeGeometry"); - } - constructor(radius = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2) { - super(0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength); - this.type = "ConeGeometry"; - this.parameters = { - radius, - height, - radialSegments, - heightSegments, - openEnded, - thetaStart, - thetaLength - }; - } - static fromJSON(data) { - return new ConeGeometry(data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength); - } -} -class PolyhedronGeometry extends BufferGeometry { - static { - __name(this, "PolyhedronGeometry"); - } - constructor(vertices = [], indices = [], radius = 1, detail = 0) { - super(); - this.type = "PolyhedronGeometry"; - this.parameters = { - vertices, - indices, - radius, - detail - }; - const vertexBuffer = []; - const uvBuffer = []; - subdivide(detail); - applyRadius(radius); - generateUVs(); - this.setAttribute("position", new Float32BufferAttribute(vertexBuffer, 3)); - this.setAttribute("normal", new Float32BufferAttribute(vertexBuffer.slice(), 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvBuffer, 2)); - if (detail === 0) { - this.computeVertexNormals(); - } else { - this.normalizeNormals(); - } - function subdivide(detail2) { - const a = new Vector3(); - const b = new Vector3(); - const c = new Vector3(); - for (let i = 0; i < indices.length; i += 3) { - getVertexByIndex(indices[i + 0], a); - getVertexByIndex(indices[i + 1], b); - getVertexByIndex(indices[i + 2], c); - subdivideFace(a, b, c, detail2); - } - } - __name(subdivide, "subdivide"); - function subdivideFace(a, b, c, detail2) { - const cols = detail2 + 1; - const v = []; - for (let i = 0; i <= cols; i++) { - v[i] = []; - const aj = a.clone().lerp(c, i / cols); - const bj = b.clone().lerp(c, i / cols); - const rows = cols - i; - for (let j = 0; j <= rows; j++) { - if (j === 0 && i === cols) { - v[i][j] = aj; - } else { - v[i][j] = aj.clone().lerp(bj, j / rows); - } - } - } - for (let i = 0; i < cols; i++) { - for (let j = 0; j < 2 * (cols - i) - 1; j++) { - const k = Math.floor(j / 2); - if (j % 2 === 0) { - pushVertex(v[i][k + 1]); - pushVertex(v[i + 1][k]); - pushVertex(v[i][k]); - } else { - pushVertex(v[i][k + 1]); - pushVertex(v[i + 1][k + 1]); - pushVertex(v[i + 1][k]); - } - } - } - } - __name(subdivideFace, "subdivideFace"); - function applyRadius(radius2) { - const vertex2 = new Vector3(); - for (let i = 0; i < vertexBuffer.length; i += 3) { - vertex2.x = vertexBuffer[i + 0]; - vertex2.y = vertexBuffer[i + 1]; - vertex2.z = vertexBuffer[i + 2]; - vertex2.normalize().multiplyScalar(radius2); - vertexBuffer[i + 0] = vertex2.x; - vertexBuffer[i + 1] = vertex2.y; - vertexBuffer[i + 2] = vertex2.z; - } - } - __name(applyRadius, "applyRadius"); - function generateUVs() { - const vertex2 = new Vector3(); - for (let i = 0; i < vertexBuffer.length; i += 3) { - vertex2.x = vertexBuffer[i + 0]; - vertex2.y = vertexBuffer[i + 1]; - vertex2.z = vertexBuffer[i + 2]; - const u = azimuth(vertex2) / 2 / Math.PI + 0.5; - const v = inclination(vertex2) / Math.PI + 0.5; - uvBuffer.push(u, 1 - v); - } - correctUVs(); - correctSeam(); - } - __name(generateUVs, "generateUVs"); - function correctSeam() { - for (let i = 0; i < uvBuffer.length; i += 6) { - const x0 = uvBuffer[i + 0]; - const x1 = uvBuffer[i + 2]; - const x2 = uvBuffer[i + 4]; - const max2 = Math.max(x0, x1, x2); - const min = Math.min(x0, x1, x2); - if (max2 > 0.9 && min < 0.1) { - if (x0 < 0.2) uvBuffer[i + 0] += 1; - if (x1 < 0.2) uvBuffer[i + 2] += 1; - if (x2 < 0.2) uvBuffer[i + 4] += 1; - } - } - } - __name(correctSeam, "correctSeam"); - function pushVertex(vertex2) { - vertexBuffer.push(vertex2.x, vertex2.y, vertex2.z); - } - __name(pushVertex, "pushVertex"); - function getVertexByIndex(index, vertex2) { - const stride = index * 3; - vertex2.x = vertices[stride + 0]; - vertex2.y = vertices[stride + 1]; - vertex2.z = vertices[stride + 2]; - } - __name(getVertexByIndex, "getVertexByIndex"); - function correctUVs() { - const a = new Vector3(); - const b = new Vector3(); - const c = new Vector3(); - const centroid = new Vector3(); - const uvA = new Vector2(); - const uvB = new Vector2(); - const uvC = new Vector2(); - for (let i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6) { - a.set(vertexBuffer[i + 0], vertexBuffer[i + 1], vertexBuffer[i + 2]); - b.set(vertexBuffer[i + 3], vertexBuffer[i + 4], vertexBuffer[i + 5]); - c.set(vertexBuffer[i + 6], vertexBuffer[i + 7], vertexBuffer[i + 8]); - uvA.set(uvBuffer[j + 0], uvBuffer[j + 1]); - uvB.set(uvBuffer[j + 2], uvBuffer[j + 3]); - uvC.set(uvBuffer[j + 4], uvBuffer[j + 5]); - centroid.copy(a).add(b).add(c).divideScalar(3); - const azi = azimuth(centroid); - correctUV(uvA, j + 0, a, azi); - correctUV(uvB, j + 2, b, azi); - correctUV(uvC, j + 4, c, azi); - } - } - __name(correctUVs, "correctUVs"); - function correctUV(uv, stride, vector, azimuth2) { - if (azimuth2 < 0 && uv.x === 1) { - uvBuffer[stride] = uv.x - 1; - } - if (vector.x === 0 && vector.z === 0) { - uvBuffer[stride] = azimuth2 / 2 / Math.PI + 0.5; - } - } - __name(correctUV, "correctUV"); - function azimuth(vector) { - return Math.atan2(vector.z, -vector.x); - } - __name(azimuth, "azimuth"); - function inclination(vector) { - return Math.atan2(-vector.y, Math.sqrt(vector.x * vector.x + vector.z * vector.z)); - } - __name(inclination, "inclination"); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - static fromJSON(data) { - return new PolyhedronGeometry(data.vertices, data.indices, data.radius, data.details); - } -} -class DodecahedronGeometry extends PolyhedronGeometry { - static { - __name(this, "DodecahedronGeometry"); - } - constructor(radius = 1, detail = 0) { - const t2 = (1 + Math.sqrt(5)) / 2; - const r = 1 / t2; - const vertices = [ - // (±1, ±1, ±1) - -1, - -1, - -1, - -1, - -1, - 1, - -1, - 1, - -1, - -1, - 1, - 1, - 1, - -1, - -1, - 1, - -1, - 1, - 1, - 1, - -1, - 1, - 1, - 1, - // (0, ±1/φ, ±φ) - 0, - -r, - -t2, - 0, - -r, - t2, - 0, - r, - -t2, - 0, - r, - t2, - // (±1/φ, ±φ, 0) - -r, - -t2, - 0, - -r, - t2, - 0, - r, - -t2, - 0, - r, - t2, - 0, - // (±φ, 0, ±1/φ) - -t2, - 0, - -r, - t2, - 0, - -r, - -t2, - 0, - r, - t2, - 0, - r - ]; - const indices = [ - 3, - 11, - 7, - 3, - 7, - 15, - 3, - 15, - 13, - 7, - 19, - 17, - 7, - 17, - 6, - 7, - 6, - 15, - 17, - 4, - 8, - 17, - 8, - 10, - 17, - 10, - 6, - 8, - 0, - 16, - 8, - 16, - 2, - 8, - 2, - 10, - 0, - 12, - 1, - 0, - 1, - 18, - 0, - 18, - 16, - 6, - 10, - 2, - 6, - 2, - 13, - 6, - 13, - 15, - 2, - 16, - 18, - 2, - 18, - 3, - 2, - 3, - 13, - 18, - 1, - 9, - 18, - 9, - 11, - 18, - 11, - 3, - 4, - 14, - 12, - 4, - 12, - 0, - 4, - 0, - 8, - 11, - 9, - 5, - 11, - 5, - 19, - 11, - 19, - 7, - 19, - 5, - 14, - 19, - 14, - 4, - 19, - 4, - 17, - 1, - 12, - 14, - 1, - 14, - 5, - 1, - 5, - 9 - ]; - super(vertices, indices, radius, detail); - this.type = "DodecahedronGeometry"; - this.parameters = { - radius, - detail - }; - } - static fromJSON(data) { - return new DodecahedronGeometry(data.radius, data.detail); - } -} -const _v0 = /* @__PURE__ */ new Vector3(); -const _v1$1 = /* @__PURE__ */ new Vector3(); -const _normal = /* @__PURE__ */ new Vector3(); -const _triangle = /* @__PURE__ */ new Triangle(); -class EdgesGeometry extends BufferGeometry { - static { - __name(this, "EdgesGeometry"); - } - constructor(geometry = null, thresholdAngle = 1) { - super(); - this.type = "EdgesGeometry"; - this.parameters = { - geometry, - thresholdAngle - }; - if (geometry !== null) { - const precisionPoints = 4; - const precision = Math.pow(10, precisionPoints); - const thresholdDot = Math.cos(DEG2RAD * thresholdAngle); - const indexAttr = geometry.getIndex(); - const positionAttr = geometry.getAttribute("position"); - const indexCount = indexAttr ? indexAttr.count : positionAttr.count; - const indexArr = [0, 0, 0]; - const vertKeys = ["a", "b", "c"]; - const hashes = new Array(3); - const edgeData = {}; - const vertices = []; - for (let i = 0; i < indexCount; i += 3) { - if (indexAttr) { - indexArr[0] = indexAttr.getX(i); - indexArr[1] = indexAttr.getX(i + 1); - indexArr[2] = indexAttr.getX(i + 2); - } else { - indexArr[0] = i; - indexArr[1] = i + 1; - indexArr[2] = i + 2; - } - const { a, b, c } = _triangle; - a.fromBufferAttribute(positionAttr, indexArr[0]); - b.fromBufferAttribute(positionAttr, indexArr[1]); - c.fromBufferAttribute(positionAttr, indexArr[2]); - _triangle.getNormal(_normal); - hashes[0] = `${Math.round(a.x * precision)},${Math.round(a.y * precision)},${Math.round(a.z * precision)}`; - hashes[1] = `${Math.round(b.x * precision)},${Math.round(b.y * precision)},${Math.round(b.z * precision)}`; - hashes[2] = `${Math.round(c.x * precision)},${Math.round(c.y * precision)},${Math.round(c.z * precision)}`; - if (hashes[0] === hashes[1] || hashes[1] === hashes[2] || hashes[2] === hashes[0]) { - continue; - } - for (let j = 0; j < 3; j++) { - const jNext = (j + 1) % 3; - const vecHash0 = hashes[j]; - const vecHash1 = hashes[jNext]; - const v0 = _triangle[vertKeys[j]]; - const v1 = _triangle[vertKeys[jNext]]; - const hash = `${vecHash0}_${vecHash1}`; - const reverseHash = `${vecHash1}_${vecHash0}`; - if (reverseHash in edgeData && edgeData[reverseHash]) { - if (_normal.dot(edgeData[reverseHash].normal) <= thresholdDot) { - vertices.push(v0.x, v0.y, v0.z); - vertices.push(v1.x, v1.y, v1.z); - } - edgeData[reverseHash] = null; - } else if (!(hash in edgeData)) { - edgeData[hash] = { - index0: indexArr[j], - index1: indexArr[jNext], - normal: _normal.clone() - }; - } - } - } - for (const key in edgeData) { - if (edgeData[key]) { - const { index0, index1 } = edgeData[key]; - _v0.fromBufferAttribute(positionAttr, index0); - _v1$1.fromBufferAttribute(positionAttr, index1); - vertices.push(_v0.x, _v0.y, _v0.z); - vertices.push(_v1$1.x, _v1$1.y, _v1$1.z); - } - } - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - } - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } -} -class Shape extends Path { - static { - __name(this, "Shape"); - } - constructor(points) { - super(points); - this.uuid = generateUUID(); - this.type = "Shape"; - this.holes = []; - } - getPointsHoles(divisions) { - const holesPts = []; - for (let i = 0, l = this.holes.length; i < l; i++) { - holesPts[i] = this.holes[i].getPoints(divisions); - } - return holesPts; - } - // get points of shape and holes (keypoints based on segments parameter) - extractPoints(divisions) { - return { - shape: this.getPoints(divisions), - holes: this.getPointsHoles(divisions) - }; - } - copy(source) { - super.copy(source); - this.holes = []; - for (let i = 0, l = source.holes.length; i < l; i++) { - const hole = source.holes[i]; - this.holes.push(hole.clone()); - } - return this; - } - toJSON() { - const data = super.toJSON(); - data.uuid = this.uuid; - data.holes = []; - for (let i = 0, l = this.holes.length; i < l; i++) { - const hole = this.holes[i]; - data.holes.push(hole.toJSON()); - } - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.uuid = json.uuid; - this.holes = []; - for (let i = 0, l = json.holes.length; i < l; i++) { - const hole = json.holes[i]; - this.holes.push(new Path().fromJSON(hole)); - } - return this; - } -} -const Earcut = { - triangulate: /* @__PURE__ */ __name(function(data, holeIndices, dim = 2) { - const hasHoles = holeIndices && holeIndices.length; - const outerLen = hasHoles ? holeIndices[0] * dim : data.length; - let outerNode = linkedList(data, 0, outerLen, dim, true); - const triangles = []; - if (!outerNode || outerNode.next === outerNode.prev) return triangles; - let minX, minY, maxX, maxY, x, y, invSize; - if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim); - if (data.length > 80 * dim) { - minX = maxX = data[0]; - minY = maxY = data[1]; - for (let i = dim; i < outerLen; i += dim) { - x = data[i]; - y = data[i + 1]; - if (x < minX) minX = x; - if (y < minY) minY = y; - if (x > maxX) maxX = x; - if (y > maxY) maxY = y; - } - invSize = Math.max(maxX - minX, maxY - minY); - invSize = invSize !== 0 ? 32767 / invSize : 0; - } - earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0); - return triangles; - }, "triangulate") -}; -function linkedList(data, start, end, dim, clockwise) { - let i, last; - if (clockwise === signedArea(data, start, end, dim) > 0) { - for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last); - } else { - for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last); - } - if (last && equals(last, last.next)) { - removeNode(last); - last = last.next; - } - return last; -} -__name(linkedList, "linkedList"); -function filterPoints(start, end) { - if (!start) return start; - if (!end) end = start; - let p = start, again; - do { - again = false; - if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) { - removeNode(p); - p = end = p.prev; - if (p === p.next) break; - again = true; - } else { - p = p.next; - } - } while (again || p !== end); - return end; -} -__name(filterPoints, "filterPoints"); -function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) { - if (!ear) return; - if (!pass && invSize) indexCurve(ear, minX, minY, invSize); - let stop = ear, prev, next; - while (ear.prev !== ear.next) { - prev = ear.prev; - next = ear.next; - if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) { - triangles.push(prev.i / dim | 0); - triangles.push(ear.i / dim | 0); - triangles.push(next.i / dim | 0); - removeNode(ear); - ear = next.next; - stop = next.next; - continue; - } - ear = next; - if (ear === stop) { - if (!pass) { - earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1); - } else if (pass === 1) { - ear = cureLocalIntersections(filterPoints(ear), triangles, dim); - earcutLinked(ear, triangles, dim, minX, minY, invSize, 2); - } else if (pass === 2) { - splitEarcut(ear, triangles, dim, minX, minY, invSize); - } - break; - } - } -} -__name(earcutLinked, "earcutLinked"); -function isEar(ear) { - const a = ear.prev, b = ear, c = ear.next; - if (area(a, b, c) >= 0) return false; - const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y; - const x0 = ax < bx ? ax < cx ? ax : cx : bx < cx ? bx : cx, y0 = ay < by ? ay < cy ? ay : cy : by < cy ? by : cy, x1 = ax > bx ? ax > cx ? ax : cx : bx > cx ? bx : cx, y1 = ay > by ? ay > cy ? ay : cy : by > cy ? by : cy; - let p = c.next; - while (p !== a) { - if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false; - p = p.next; - } - return true; -} -__name(isEar, "isEar"); -function isEarHashed(ear, minX, minY, invSize) { - const a = ear.prev, b = ear, c = ear.next; - if (area(a, b, c) >= 0) return false; - const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y; - const x0 = ax < bx ? ax < cx ? ax : cx : bx < cx ? bx : cx, y0 = ay < by ? ay < cy ? ay : cy : by < cy ? by : cy, x1 = ax > bx ? ax > cx ? ax : cx : bx > cx ? bx : cx, y1 = ay > by ? ay > cy ? ay : cy : by > cy ? by : cy; - const minZ = zOrder(x0, y0, minX, minY, invSize), maxZ = zOrder(x1, y1, minX, minY, invSize); - let p = ear.prevZ, n = ear.nextZ; - while (p && p.z >= minZ && n && n.z <= maxZ) { - if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false; - p = p.prevZ; - if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false; - n = n.nextZ; - } - while (p && p.z >= minZ) { - if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false; - p = p.prevZ; - } - while (n && n.z <= maxZ) { - if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c && pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false; - n = n.nextZ; - } - return true; -} -__name(isEarHashed, "isEarHashed"); -function cureLocalIntersections(start, triangles, dim) { - let p = start; - do { - const a = p.prev, b = p.next.next; - if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) { - triangles.push(a.i / dim | 0); - triangles.push(p.i / dim | 0); - triangles.push(b.i / dim | 0); - removeNode(p); - removeNode(p.next); - p = start = b; - } - p = p.next; - } while (p !== start); - return filterPoints(p); -} -__name(cureLocalIntersections, "cureLocalIntersections"); -function splitEarcut(start, triangles, dim, minX, minY, invSize) { - let a = start; - do { - let b = a.next.next; - while (b !== a.prev) { - if (a.i !== b.i && isValidDiagonal(a, b)) { - let c = splitPolygon(a, b); - a = filterPoints(a, a.next); - c = filterPoints(c, c.next); - earcutLinked(a, triangles, dim, minX, minY, invSize, 0); - earcutLinked(c, triangles, dim, minX, minY, invSize, 0); - return; - } - b = b.next; - } - a = a.next; - } while (a !== start); -} -__name(splitEarcut, "splitEarcut"); -function eliminateHoles(data, holeIndices, outerNode, dim) { - const queue = []; - let i, len, start, end, list; - for (i = 0, len = holeIndices.length; i < len; i++) { - start = holeIndices[i] * dim; - end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; - list = linkedList(data, start, end, dim, false); - if (list === list.next) list.steiner = true; - queue.push(getLeftmost(list)); - } - queue.sort(compareX); - for (i = 0; i < queue.length; i++) { - outerNode = eliminateHole(queue[i], outerNode); - } - return outerNode; -} -__name(eliminateHoles, "eliminateHoles"); -function compareX(a, b) { - return a.x - b.x; -} -__name(compareX, "compareX"); -function eliminateHole(hole, outerNode) { - const bridge = findHoleBridge(hole, outerNode); - if (!bridge) { - return outerNode; - } - const bridgeReverse = splitPolygon(bridge, hole); - filterPoints(bridgeReverse, bridgeReverse.next); - return filterPoints(bridge, bridge.next); -} -__name(eliminateHole, "eliminateHole"); -function findHoleBridge(hole, outerNode) { - let p = outerNode, qx = -Infinity, m; - const hx = hole.x, hy = hole.y; - do { - if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) { - const x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y); - if (x <= hx && x > qx) { - qx = x; - m = p.x < p.next.x ? p : p.next; - if (x === hx) return m; - } - } - p = p.next; - } while (p !== outerNode); - if (!m) return null; - const stop = m, mx = m.x, my = m.y; - let tanMin = Infinity, tan; - p = m; - do { - if (hx >= p.x && p.x >= mx && hx !== p.x && pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) { - tan = Math.abs(hy - p.y) / (hx - p.x); - if (locallyInside(p, hole) && (tan < tanMin || tan === tanMin && (p.x > m.x || p.x === m.x && sectorContainsSector(m, p)))) { - m = p; - tanMin = tan; - } - } - p = p.next; - } while (p !== stop); - return m; -} -__name(findHoleBridge, "findHoleBridge"); -function sectorContainsSector(m, p) { - return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0; -} -__name(sectorContainsSector, "sectorContainsSector"); -function indexCurve(start, minX, minY, invSize) { - let p = start; - do { - if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize); - p.prevZ = p.prev; - p.nextZ = p.next; - p = p.next; - } while (p !== start); - p.prevZ.nextZ = null; - p.prevZ = null; - sortLinked(p); -} -__name(indexCurve, "indexCurve"); -function sortLinked(list) { - let i, p, q, e, tail, numMerges, pSize, qSize, inSize = 1; - do { - p = list; - list = null; - tail = null; - numMerges = 0; - while (p) { - numMerges++; - q = p; - pSize = 0; - for (i = 0; i < inSize; i++) { - pSize++; - q = q.nextZ; - if (!q) break; - } - qSize = inSize; - while (pSize > 0 || qSize > 0 && q) { - if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) { - e = p; - p = p.nextZ; - pSize--; - } else { - e = q; - q = q.nextZ; - qSize--; - } - if (tail) tail.nextZ = e; - else list = e; - e.prevZ = tail; - tail = e; - } - p = q; - } - tail.nextZ = null; - inSize *= 2; - } while (numMerges > 1); - return list; -} -__name(sortLinked, "sortLinked"); -function zOrder(x, y, minX, minY, invSize) { - x = (x - minX) * invSize | 0; - y = (y - minY) * invSize | 0; - x = (x | x << 8) & 16711935; - x = (x | x << 4) & 252645135; - x = (x | x << 2) & 858993459; - x = (x | x << 1) & 1431655765; - y = (y | y << 8) & 16711935; - y = (y | y << 4) & 252645135; - y = (y | y << 2) & 858993459; - y = (y | y << 1) & 1431655765; - return x | y << 1; -} -__name(zOrder, "zOrder"); -function getLeftmost(start) { - let p = start, leftmost = start; - do { - if (p.x < leftmost.x || p.x === leftmost.x && p.y < leftmost.y) leftmost = p; - p = p.next; - } while (p !== start); - return leftmost; -} -__name(getLeftmost, "getLeftmost"); -function pointInTriangle(ax, ay, bx, by, cx, cy, px2, py2) { - return (cx - px2) * (ay - py2) >= (ax - px2) * (cy - py2) && (ax - px2) * (by - py2) >= (bx - px2) * (ay - py2) && (bx - px2) * (cy - py2) >= (cx - px2) * (by - py2); -} -__name(pointInTriangle, "pointInTriangle"); -function isValidDiagonal(a, b) { - return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges - (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible - (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors - equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); -} -__name(isValidDiagonal, "isValidDiagonal"); -function area(p, q, r) { - return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y); -} -__name(area, "area"); -function equals(p1, p2) { - return p1.x === p2.x && p1.y === p2.y; -} -__name(equals, "equals"); -function intersects(p1, q1, p2, q2) { - const o1 = sign(area(p1, q1, p2)); - const o2 = sign(area(p1, q1, q2)); - const o3 = sign(area(p2, q2, p1)); - const o4 = sign(area(p2, q2, q1)); - if (o1 !== o2 && o3 !== o4) return true; - if (o1 === 0 && onSegment(p1, p2, q1)) return true; - if (o2 === 0 && onSegment(p1, q2, q1)) return true; - if (o3 === 0 && onSegment(p2, p1, q2)) return true; - if (o4 === 0 && onSegment(p2, q1, q2)) return true; - return false; -} -__name(intersects, "intersects"); -function onSegment(p, q, r) { - return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y); -} -__name(onSegment, "onSegment"); -function sign(num) { - return num > 0 ? 1 : num < 0 ? -1 : 0; -} -__name(sign, "sign"); -function intersectsPolygon(a, b) { - let p = a; - do { - if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b)) return true; - p = p.next; - } while (p !== a); - return false; -} -__name(intersectsPolygon, "intersectsPolygon"); -function locallyInside(a, b) { - return area(a.prev, a, a.next) < 0 ? area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : area(a, b, a.prev) < 0 || area(a, a.next, b) < 0; -} -__name(locallyInside, "locallyInside"); -function middleInside(a, b) { - let p = a, inside = false; - const px2 = (a.x + b.x) / 2, py2 = (a.y + b.y) / 2; - do { - if (p.y > py2 !== p.next.y > py2 && p.next.y !== p.y && px2 < (p.next.x - p.x) * (py2 - p.y) / (p.next.y - p.y) + p.x) - inside = !inside; - p = p.next; - } while (p !== a); - return inside; -} -__name(middleInside, "middleInside"); -function splitPolygon(a, b) { - const a2 = new Node(a.i, a.x, a.y), b22 = new Node(b.i, b.x, b.y), an = a.next, bp = b.prev; - a.next = b; - b.prev = a; - a2.next = an; - an.prev = a2; - b22.next = a2; - a2.prev = b22; - bp.next = b22; - b22.prev = bp; - return b22; -} -__name(splitPolygon, "splitPolygon"); -function insertNode(i, x, y, last) { - const p = new Node(i, x, y); - if (!last) { - p.prev = p; - p.next = p; - } else { - p.next = last.next; - p.prev = last; - last.next.prev = p; - last.next = p; - } - return p; -} -__name(insertNode, "insertNode"); -function removeNode(p) { - p.next.prev = p.prev; - p.prev.next = p.next; - if (p.prevZ) p.prevZ.nextZ = p.nextZ; - if (p.nextZ) p.nextZ.prevZ = p.prevZ; -} -__name(removeNode, "removeNode"); -function Node(i, x, y) { - this.i = i; - this.x = x; - this.y = y; - this.prev = null; - this.next = null; - this.z = 0; - this.prevZ = null; - this.nextZ = null; - this.steiner = false; -} -__name(Node, "Node"); -function signedArea(data, start, end, dim) { - let sum = 0; - for (let i = start, j = end - dim; i < end; i += dim) { - sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]); - j = i; - } - return sum; -} -__name(signedArea, "signedArea"); -class ShapeUtils { - static { - __name(this, "ShapeUtils"); - } - // calculate area of the contour polygon - static area(contour) { - const n = contour.length; - let a = 0; - for (let p = n - 1, q = 0; q < n; p = q++) { - a += contour[p].x * contour[q].y - contour[q].x * contour[p].y; - } - return a * 0.5; - } - static isClockWise(pts) { - return ShapeUtils.area(pts) < 0; - } - static triangulateShape(contour, holes) { - const vertices = []; - const holeIndices = []; - const faces = []; - removeDupEndPts(contour); - addContour(vertices, contour); - let holeIndex = contour.length; - holes.forEach(removeDupEndPts); - for (let i = 0; i < holes.length; i++) { - holeIndices.push(holeIndex); - holeIndex += holes[i].length; - addContour(vertices, holes[i]); - } - const triangles = Earcut.triangulate(vertices, holeIndices); - for (let i = 0; i < triangles.length; i += 3) { - faces.push(triangles.slice(i, i + 3)); - } - return faces; - } -} -function removeDupEndPts(points) { - const l = points.length; - if (l > 2 && points[l - 1].equals(points[0])) { - points.pop(); - } -} -__name(removeDupEndPts, "removeDupEndPts"); -function addContour(vertices, contour) { - for (let i = 0; i < contour.length; i++) { - vertices.push(contour[i].x); - vertices.push(contour[i].y); - } -} -__name(addContour, "addContour"); -class ExtrudeGeometry extends BufferGeometry { - static { - __name(this, "ExtrudeGeometry"); - } - constructor(shapes = new Shape([new Vector2(0.5, 0.5), new Vector2(-0.5, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)]), options = {}) { - super(); - this.type = "ExtrudeGeometry"; - this.parameters = { - shapes, - options - }; - shapes = Array.isArray(shapes) ? shapes : [shapes]; - const scope = this; - const verticesArray = []; - const uvArray = []; - for (let i = 0, l = shapes.length; i < l; i++) { - const shape = shapes[i]; - addShape(shape); - } - this.setAttribute("position", new Float32BufferAttribute(verticesArray, 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvArray, 2)); - this.computeVertexNormals(); - function addShape(shape) { - const placeholder = []; - const curveSegments = options.curveSegments !== void 0 ? options.curveSegments : 12; - const steps = options.steps !== void 0 ? options.steps : 1; - const depth = options.depth !== void 0 ? options.depth : 1; - let bevelEnabled = options.bevelEnabled !== void 0 ? options.bevelEnabled : true; - let bevelThickness = options.bevelThickness !== void 0 ? options.bevelThickness : 0.2; - let bevelSize = options.bevelSize !== void 0 ? options.bevelSize : bevelThickness - 0.1; - let bevelOffset = options.bevelOffset !== void 0 ? options.bevelOffset : 0; - let bevelSegments = options.bevelSegments !== void 0 ? options.bevelSegments : 3; - const extrudePath = options.extrudePath; - const uvgen = options.UVGenerator !== void 0 ? options.UVGenerator : WorldUVGenerator; - let extrudePts, extrudeByPath = false; - let splineTube, binormal, normal, position2; - if (extrudePath) { - extrudePts = extrudePath.getSpacedPoints(steps); - extrudeByPath = true; - bevelEnabled = false; - splineTube = extrudePath.computeFrenetFrames(steps, false); - binormal = new Vector3(); - normal = new Vector3(); - position2 = new Vector3(); - } - if (!bevelEnabled) { - bevelSegments = 0; - bevelThickness = 0; - bevelSize = 0; - bevelOffset = 0; - } - const shapePoints = shape.extractPoints(curveSegments); - let vertices = shapePoints.shape; - const holes = shapePoints.holes; - const reverse = !ShapeUtils.isClockWise(vertices); - if (reverse) { - vertices = vertices.reverse(); - for (let h = 0, hl = holes.length; h < hl; h++) { - const ahole = holes[h]; - if (ShapeUtils.isClockWise(ahole)) { - holes[h] = ahole.reverse(); - } - } - } - const faces = ShapeUtils.triangulateShape(vertices, holes); - const contour = vertices; - for (let h = 0, hl = holes.length; h < hl; h++) { - const ahole = holes[h]; - vertices = vertices.concat(ahole); - } - function scalePt2(pt, vec, size) { - if (!vec) console.error("THREE.ExtrudeGeometry: vec does not exist"); - return pt.clone().addScaledVector(vec, size); - } - __name(scalePt2, "scalePt2"); - const vlen = vertices.length, flen = faces.length; - function getBevelVec(inPt, inPrev, inNext) { - let v_trans_x, v_trans_y, shrink_by; - const v_prev_x = inPt.x - inPrev.x, v_prev_y = inPt.y - inPrev.y; - const v_next_x = inNext.x - inPt.x, v_next_y = inNext.y - inPt.y; - const v_prev_lensq = v_prev_x * v_prev_x + v_prev_y * v_prev_y; - const collinear0 = v_prev_x * v_next_y - v_prev_y * v_next_x; - if (Math.abs(collinear0) > Number.EPSILON) { - const v_prev_len = Math.sqrt(v_prev_lensq); - const v_next_len = Math.sqrt(v_next_x * v_next_x + v_next_y * v_next_y); - const ptPrevShift_x = inPrev.x - v_prev_y / v_prev_len; - const ptPrevShift_y = inPrev.y + v_prev_x / v_prev_len; - const ptNextShift_x = inNext.x - v_next_y / v_next_len; - const ptNextShift_y = inNext.y + v_next_x / v_next_len; - const sf = ((ptNextShift_x - ptPrevShift_x) * v_next_y - (ptNextShift_y - ptPrevShift_y) * v_next_x) / (v_prev_x * v_next_y - v_prev_y * v_next_x); - v_trans_x = ptPrevShift_x + v_prev_x * sf - inPt.x; - v_trans_y = ptPrevShift_y + v_prev_y * sf - inPt.y; - const v_trans_lensq = v_trans_x * v_trans_x + v_trans_y * v_trans_y; - if (v_trans_lensq <= 2) { - return new Vector2(v_trans_x, v_trans_y); - } else { - shrink_by = Math.sqrt(v_trans_lensq / 2); - } - } else { - let direction_eq = false; - if (v_prev_x > Number.EPSILON) { - if (v_next_x > Number.EPSILON) { - direction_eq = true; - } - } else { - if (v_prev_x < -Number.EPSILON) { - if (v_next_x < -Number.EPSILON) { - direction_eq = true; - } - } else { - if (Math.sign(v_prev_y) === Math.sign(v_next_y)) { - direction_eq = true; - } - } - } - if (direction_eq) { - v_trans_x = -v_prev_y; - v_trans_y = v_prev_x; - shrink_by = Math.sqrt(v_prev_lensq); - } else { - v_trans_x = v_prev_x; - v_trans_y = v_prev_y; - shrink_by = Math.sqrt(v_prev_lensq / 2); - } - } - return new Vector2(v_trans_x / shrink_by, v_trans_y / shrink_by); - } - __name(getBevelVec, "getBevelVec"); - const contourMovements = []; - for (let i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i++, j++, k++) { - if (j === il) j = 0; - if (k === il) k = 0; - contourMovements[i] = getBevelVec(contour[i], contour[j], contour[k]); - } - const holesMovements = []; - let oneHoleMovements, verticesMovements = contourMovements.concat(); - for (let h = 0, hl = holes.length; h < hl; h++) { - const ahole = holes[h]; - oneHoleMovements = []; - for (let i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i++, j++, k++) { - if (j === il) j = 0; - if (k === il) k = 0; - oneHoleMovements[i] = getBevelVec(ahole[i], ahole[j], ahole[k]); - } - holesMovements.push(oneHoleMovements); - verticesMovements = verticesMovements.concat(oneHoleMovements); - } - for (let b = 0; b < bevelSegments; b++) { - const t2 = b / bevelSegments; - const z = bevelThickness * Math.cos(t2 * Math.PI / 2); - const bs2 = bevelSize * Math.sin(t2 * Math.PI / 2) + bevelOffset; - for (let i = 0, il = contour.length; i < il; i++) { - const vert = scalePt2(contour[i], contourMovements[i], bs2); - v(vert.x, vert.y, -z); - } - for (let h = 0, hl = holes.length; h < hl; h++) { - const ahole = holes[h]; - oneHoleMovements = holesMovements[h]; - for (let i = 0, il = ahole.length; i < il; i++) { - const vert = scalePt2(ahole[i], oneHoleMovements[i], bs2); - v(vert.x, vert.y, -z); - } - } - } - const bs = bevelSize + bevelOffset; - for (let i = 0; i < vlen; i++) { - const vert = bevelEnabled ? scalePt2(vertices[i], verticesMovements[i], bs) : vertices[i]; - if (!extrudeByPath) { - v(vert.x, vert.y, 0); - } else { - normal.copy(splineTube.normals[0]).multiplyScalar(vert.x); - binormal.copy(splineTube.binormals[0]).multiplyScalar(vert.y); - position2.copy(extrudePts[0]).add(normal).add(binormal); - v(position2.x, position2.y, position2.z); - } - } - for (let s = 1; s <= steps; s++) { - for (let i = 0; i < vlen; i++) { - const vert = bevelEnabled ? scalePt2(vertices[i], verticesMovements[i], bs) : vertices[i]; - if (!extrudeByPath) { - v(vert.x, vert.y, depth / steps * s); - } else { - normal.copy(splineTube.normals[s]).multiplyScalar(vert.x); - binormal.copy(splineTube.binormals[s]).multiplyScalar(vert.y); - position2.copy(extrudePts[s]).add(normal).add(binormal); - v(position2.x, position2.y, position2.z); - } - } - } - for (let b = bevelSegments - 1; b >= 0; b--) { - const t2 = b / bevelSegments; - const z = bevelThickness * Math.cos(t2 * Math.PI / 2); - const bs2 = bevelSize * Math.sin(t2 * Math.PI / 2) + bevelOffset; - for (let i = 0, il = contour.length; i < il; i++) { - const vert = scalePt2(contour[i], contourMovements[i], bs2); - v(vert.x, vert.y, depth + z); - } - for (let h = 0, hl = holes.length; h < hl; h++) { - const ahole = holes[h]; - oneHoleMovements = holesMovements[h]; - for (let i = 0, il = ahole.length; i < il; i++) { - const vert = scalePt2(ahole[i], oneHoleMovements[i], bs2); - if (!extrudeByPath) { - v(vert.x, vert.y, depth + z); - } else { - v(vert.x, vert.y + extrudePts[steps - 1].y, extrudePts[steps - 1].x + z); - } - } - } - } - buildLidFaces(); - buildSideFaces(); - function buildLidFaces() { - const start = verticesArray.length / 3; - if (bevelEnabled) { - let layer = 0; - let offset = vlen * layer; - for (let i = 0; i < flen; i++) { - const face = faces[i]; - f3(face[2] + offset, face[1] + offset, face[0] + offset); - } - layer = steps + bevelSegments * 2; - offset = vlen * layer; - for (let i = 0; i < flen; i++) { - const face = faces[i]; - f3(face[0] + offset, face[1] + offset, face[2] + offset); - } - } else { - for (let i = 0; i < flen; i++) { - const face = faces[i]; - f3(face[2], face[1], face[0]); - } - for (let i = 0; i < flen; i++) { - const face = faces[i]; - f3(face[0] + vlen * steps, face[1] + vlen * steps, face[2] + vlen * steps); - } - } - scope.addGroup(start, verticesArray.length / 3 - start, 0); - } - __name(buildLidFaces, "buildLidFaces"); - function buildSideFaces() { - const start = verticesArray.length / 3; - let layeroffset = 0; - sidewalls(contour, layeroffset); - layeroffset += contour.length; - for (let h = 0, hl = holes.length; h < hl; h++) { - const ahole = holes[h]; - sidewalls(ahole, layeroffset); - layeroffset += ahole.length; - } - scope.addGroup(start, verticesArray.length / 3 - start, 1); - } - __name(buildSideFaces, "buildSideFaces"); - function sidewalls(contour2, layeroffset) { - let i = contour2.length; - while (--i >= 0) { - const j = i; - let k = i - 1; - if (k < 0) k = contour2.length - 1; - for (let s = 0, sl = steps + bevelSegments * 2; s < sl; s++) { - const slen1 = vlen * s; - const slen2 = vlen * (s + 1); - const a = layeroffset + j + slen1, b = layeroffset + k + slen1, c = layeroffset + k + slen2, d = layeroffset + j + slen2; - f4(a, b, c, d); - } - } - } - __name(sidewalls, "sidewalls"); - function v(x, y, z) { - placeholder.push(x); - placeholder.push(y); - placeholder.push(z); - } - __name(v, "v"); - function f3(a, b, c) { - addVertex(a); - addVertex(b); - addVertex(c); - const nextIndex = verticesArray.length / 3; - const uvs = uvgen.generateTopUV(scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1); - addUV(uvs[0]); - addUV(uvs[1]); - addUV(uvs[2]); - } - __name(f3, "f3"); - function f4(a, b, c, d) { - addVertex(a); - addVertex(b); - addVertex(d); - addVertex(b); - addVertex(c); - addVertex(d); - const nextIndex = verticesArray.length / 3; - const uvs = uvgen.generateSideWallUV(scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1); - addUV(uvs[0]); - addUV(uvs[1]); - addUV(uvs[3]); - addUV(uvs[1]); - addUV(uvs[2]); - addUV(uvs[3]); - } - __name(f4, "f4"); - function addVertex(index) { - verticesArray.push(placeholder[index * 3 + 0]); - verticesArray.push(placeholder[index * 3 + 1]); - verticesArray.push(placeholder[index * 3 + 2]); - } - __name(addVertex, "addVertex"); - function addUV(vector2) { - uvArray.push(vector2.x); - uvArray.push(vector2.y); - } - __name(addUV, "addUV"); - } - __name(addShape, "addShape"); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - toJSON() { - const data = super.toJSON(); - const shapes = this.parameters.shapes; - const options = this.parameters.options; - return toJSON$1(shapes, options, data); - } - static fromJSON(data, shapes) { - const geometryShapes = []; - for (let j = 0, jl = data.shapes.length; j < jl; j++) { - const shape = shapes[data.shapes[j]]; - geometryShapes.push(shape); - } - const extrudePath = data.options.extrudePath; - if (extrudePath !== void 0) { - data.options.extrudePath = new Curves[extrudePath.type]().fromJSON(extrudePath); - } - return new ExtrudeGeometry(geometryShapes, data.options); - } -} -const WorldUVGenerator = { - generateTopUV: /* @__PURE__ */ __name(function(geometry, vertices, indexA, indexB, indexC) { - const a_x = vertices[indexA * 3]; - const a_y = vertices[indexA * 3 + 1]; - const b_x = vertices[indexB * 3]; - const b_y = vertices[indexB * 3 + 1]; - const c_x = vertices[indexC * 3]; - const c_y = vertices[indexC * 3 + 1]; - return [ - new Vector2(a_x, a_y), - new Vector2(b_x, b_y), - new Vector2(c_x, c_y) - ]; - }, "generateTopUV"), - generateSideWallUV: /* @__PURE__ */ __name(function(geometry, vertices, indexA, indexB, indexC, indexD) { - const a_x = vertices[indexA * 3]; - const a_y = vertices[indexA * 3 + 1]; - const a_z = vertices[indexA * 3 + 2]; - const b_x = vertices[indexB * 3]; - const b_y = vertices[indexB * 3 + 1]; - const b_z = vertices[indexB * 3 + 2]; - const c_x = vertices[indexC * 3]; - const c_y = vertices[indexC * 3 + 1]; - const c_z = vertices[indexC * 3 + 2]; - const d_x = vertices[indexD * 3]; - const d_y = vertices[indexD * 3 + 1]; - const d_z = vertices[indexD * 3 + 2]; - if (Math.abs(a_y - b_y) < Math.abs(a_x - b_x)) { - return [ - new Vector2(a_x, 1 - a_z), - new Vector2(b_x, 1 - b_z), - new Vector2(c_x, 1 - c_z), - new Vector2(d_x, 1 - d_z) - ]; - } else { - return [ - new Vector2(a_y, 1 - a_z), - new Vector2(b_y, 1 - b_z), - new Vector2(c_y, 1 - c_z), - new Vector2(d_y, 1 - d_z) - ]; - } - }, "generateSideWallUV") -}; -function toJSON$1(shapes, options, data) { - data.shapes = []; - if (Array.isArray(shapes)) { - for (let i = 0, l = shapes.length; i < l; i++) { - const shape = shapes[i]; - data.shapes.push(shape.uuid); - } - } else { - data.shapes.push(shapes.uuid); - } - data.options = Object.assign({}, options); - if (options.extrudePath !== void 0) data.options.extrudePath = options.extrudePath.toJSON(); - return data; -} -__name(toJSON$1, "toJSON$1"); -class IcosahedronGeometry extends PolyhedronGeometry { - static { - __name(this, "IcosahedronGeometry"); - } - constructor(radius = 1, detail = 0) { - const t2 = (1 + Math.sqrt(5)) / 2; - const vertices = [ - -1, - t2, - 0, - 1, - t2, - 0, - -1, - -t2, - 0, - 1, - -t2, - 0, - 0, - -1, - t2, - 0, - 1, - t2, - 0, - -1, - -t2, - 0, - 1, - -t2, - t2, - 0, - -1, - t2, - 0, - 1, - -t2, - 0, - -1, - -t2, - 0, - 1 - ]; - const indices = [ - 0, - 11, - 5, - 0, - 5, - 1, - 0, - 1, - 7, - 0, - 7, - 10, - 0, - 10, - 11, - 1, - 5, - 9, - 5, - 11, - 4, - 11, - 10, - 2, - 10, - 7, - 6, - 7, - 1, - 8, - 3, - 9, - 4, - 3, - 4, - 2, - 3, - 2, - 6, - 3, - 6, - 8, - 3, - 8, - 9, - 4, - 9, - 5, - 2, - 4, - 11, - 6, - 2, - 10, - 8, - 6, - 7, - 9, - 8, - 1 - ]; - super(vertices, indices, radius, detail); - this.type = "IcosahedronGeometry"; - this.parameters = { - radius, - detail - }; - } - static fromJSON(data) { - return new IcosahedronGeometry(data.radius, data.detail); - } -} -class OctahedronGeometry extends PolyhedronGeometry { - static { - __name(this, "OctahedronGeometry"); - } - constructor(radius = 1, detail = 0) { - const vertices = [ - 1, - 0, - 0, - -1, - 0, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 0, - 1, - 0, - 0, - -1 - ]; - const indices = [ - 0, - 2, - 4, - 0, - 4, - 3, - 0, - 3, - 5, - 0, - 5, - 2, - 1, - 2, - 5, - 1, - 5, - 3, - 1, - 3, - 4, - 1, - 4, - 2 - ]; - super(vertices, indices, radius, detail); - this.type = "OctahedronGeometry"; - this.parameters = { - radius, - detail - }; - } - static fromJSON(data) { - return new OctahedronGeometry(data.radius, data.detail); - } -} -class RingGeometry extends BufferGeometry { - static { - __name(this, "RingGeometry"); - } - constructor(innerRadius = 0.5, outerRadius = 1, thetaSegments = 32, phiSegments = 1, thetaStart = 0, thetaLength = Math.PI * 2) { - super(); - this.type = "RingGeometry"; - this.parameters = { - innerRadius, - outerRadius, - thetaSegments, - phiSegments, - thetaStart, - thetaLength - }; - thetaSegments = Math.max(3, thetaSegments); - phiSegments = Math.max(1, phiSegments); - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; - let radius = innerRadius; - const radiusStep = (outerRadius - innerRadius) / phiSegments; - const vertex2 = new Vector3(); - const uv = new Vector2(); - for (let j = 0; j <= phiSegments; j++) { - for (let i = 0; i <= thetaSegments; i++) { - const segment = thetaStart + i / thetaSegments * thetaLength; - vertex2.x = radius * Math.cos(segment); - vertex2.y = radius * Math.sin(segment); - vertices.push(vertex2.x, vertex2.y, vertex2.z); - normals.push(0, 0, 1); - uv.x = (vertex2.x / outerRadius + 1) / 2; - uv.y = (vertex2.y / outerRadius + 1) / 2; - uvs.push(uv.x, uv.y); - } - radius += radiusStep; - } - for (let j = 0; j < phiSegments; j++) { - const thetaSegmentLevel = j * (thetaSegments + 1); - for (let i = 0; i < thetaSegments; i++) { - const segment = i + thetaSegmentLevel; - const a = segment; - const b = segment + thetaSegments + 1; - const c = segment + thetaSegments + 2; - const d = segment + 1; - indices.push(a, b, d); - indices.push(b, c, d); - } - } - this.setIndex(indices); - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - static fromJSON(data) { - return new RingGeometry(data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength); - } -} -class ShapeGeometry extends BufferGeometry { - static { - __name(this, "ShapeGeometry"); - } - constructor(shapes = new Shape([new Vector2(0, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)]), curveSegments = 12) { - super(); - this.type = "ShapeGeometry"; - this.parameters = { - shapes, - curveSegments - }; - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; - let groupStart = 0; - let groupCount = 0; - if (Array.isArray(shapes) === false) { - addShape(shapes); - } else { - for (let i = 0; i < shapes.length; i++) { - addShape(shapes[i]); - this.addGroup(groupStart, groupCount, i); - groupStart += groupCount; - groupCount = 0; - } - } - this.setIndex(indices); - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); - function addShape(shape) { - const indexOffset = vertices.length / 3; - const points = shape.extractPoints(curveSegments); - let shapeVertices = points.shape; - const shapeHoles = points.holes; - if (ShapeUtils.isClockWise(shapeVertices) === false) { - shapeVertices = shapeVertices.reverse(); - } - for (let i = 0, l = shapeHoles.length; i < l; i++) { - const shapeHole = shapeHoles[i]; - if (ShapeUtils.isClockWise(shapeHole) === true) { - shapeHoles[i] = shapeHole.reverse(); - } - } - const faces = ShapeUtils.triangulateShape(shapeVertices, shapeHoles); - for (let i = 0, l = shapeHoles.length; i < l; i++) { - const shapeHole = shapeHoles[i]; - shapeVertices = shapeVertices.concat(shapeHole); - } - for (let i = 0, l = shapeVertices.length; i < l; i++) { - const vertex2 = shapeVertices[i]; - vertices.push(vertex2.x, vertex2.y, 0); - normals.push(0, 0, 1); - uvs.push(vertex2.x, vertex2.y); - } - for (let i = 0, l = faces.length; i < l; i++) { - const face = faces[i]; - const a = face[0] + indexOffset; - const b = face[1] + indexOffset; - const c = face[2] + indexOffset; - indices.push(a, b, c); - groupCount += 3; - } - } - __name(addShape, "addShape"); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - toJSON() { - const data = super.toJSON(); - const shapes = this.parameters.shapes; - return toJSON(shapes, data); - } - static fromJSON(data, shapes) { - const geometryShapes = []; - for (let j = 0, jl = data.shapes.length; j < jl; j++) { - const shape = shapes[data.shapes[j]]; - geometryShapes.push(shape); - } - return new ShapeGeometry(geometryShapes, data.curveSegments); - } -} -function toJSON(shapes, data) { - data.shapes = []; - if (Array.isArray(shapes)) { - for (let i = 0, l = shapes.length; i < l; i++) { - const shape = shapes[i]; - data.shapes.push(shape.uuid); - } - } else { - data.shapes.push(shapes.uuid); - } - return data; -} -__name(toJSON, "toJSON"); -class SphereGeometry extends BufferGeometry { - static { - __name(this, "SphereGeometry"); - } - constructor(radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI) { - super(); - this.type = "SphereGeometry"; - this.parameters = { - radius, - widthSegments, - heightSegments, - phiStart, - phiLength, - thetaStart, - thetaLength - }; - widthSegments = Math.max(3, Math.floor(widthSegments)); - heightSegments = Math.max(2, Math.floor(heightSegments)); - const thetaEnd = Math.min(thetaStart + thetaLength, Math.PI); - let index = 0; - const grid = []; - const vertex2 = new Vector3(); - const normal = new Vector3(); - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; - for (let iy = 0; iy <= heightSegments; iy++) { - const verticesRow = []; - const v = iy / heightSegments; - let uOffset = 0; - if (iy === 0 && thetaStart === 0) { - uOffset = 0.5 / widthSegments; - } else if (iy === heightSegments && thetaEnd === Math.PI) { - uOffset = -0.5 / widthSegments; - } - for (let ix = 0; ix <= widthSegments; ix++) { - const u = ix / widthSegments; - vertex2.x = -radius * Math.cos(phiStart + u * phiLength) * Math.sin(thetaStart + v * thetaLength); - vertex2.y = radius * Math.cos(thetaStart + v * thetaLength); - vertex2.z = radius * Math.sin(phiStart + u * phiLength) * Math.sin(thetaStart + v * thetaLength); - vertices.push(vertex2.x, vertex2.y, vertex2.z); - normal.copy(vertex2).normalize(); - normals.push(normal.x, normal.y, normal.z); - uvs.push(u + uOffset, 1 - v); - verticesRow.push(index++); - } - grid.push(verticesRow); - } - for (let iy = 0; iy < heightSegments; iy++) { - for (let ix = 0; ix < widthSegments; ix++) { - const a = grid[iy][ix + 1]; - const b = grid[iy][ix]; - const c = grid[iy + 1][ix]; - const d = grid[iy + 1][ix + 1]; - if (iy !== 0 || thetaStart > 0) indices.push(a, b, d); - if (iy !== heightSegments - 1 || thetaEnd < Math.PI) indices.push(b, c, d); - } - } - this.setIndex(indices); - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - static fromJSON(data) { - return new SphereGeometry(data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength); - } -} -class TetrahedronGeometry extends PolyhedronGeometry { - static { - __name(this, "TetrahedronGeometry"); - } - constructor(radius = 1, detail = 0) { - const vertices = [ - 1, - 1, - 1, - -1, - -1, - 1, - -1, - 1, - -1, - 1, - -1, - -1 - ]; - const indices = [ - 2, - 1, - 0, - 0, - 3, - 2, - 1, - 3, - 0, - 2, - 3, - 1 - ]; - super(vertices, indices, radius, detail); - this.type = "TetrahedronGeometry"; - this.parameters = { - radius, - detail - }; - } - static fromJSON(data) { - return new TetrahedronGeometry(data.radius, data.detail); - } -} -class TorusGeometry extends BufferGeometry { - static { - __name(this, "TorusGeometry"); - } - constructor(radius = 1, tube = 0.4, radialSegments = 12, tubularSegments = 48, arc = Math.PI * 2) { - super(); - this.type = "TorusGeometry"; - this.parameters = { - radius, - tube, - radialSegments, - tubularSegments, - arc - }; - radialSegments = Math.floor(radialSegments); - tubularSegments = Math.floor(tubularSegments); - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; - const center = new Vector3(); - const vertex2 = new Vector3(); - const normal = new Vector3(); - for (let j = 0; j <= radialSegments; j++) { - for (let i = 0; i <= tubularSegments; i++) { - const u = i / tubularSegments * arc; - const v = j / radialSegments * Math.PI * 2; - vertex2.x = (radius + tube * Math.cos(v)) * Math.cos(u); - vertex2.y = (radius + tube * Math.cos(v)) * Math.sin(u); - vertex2.z = tube * Math.sin(v); - vertices.push(vertex2.x, vertex2.y, vertex2.z); - center.x = radius * Math.cos(u); - center.y = radius * Math.sin(u); - normal.subVectors(vertex2, center).normalize(); - normals.push(normal.x, normal.y, normal.z); - uvs.push(i / tubularSegments); - uvs.push(j / radialSegments); - } - } - for (let j = 1; j <= radialSegments; j++) { - for (let i = 1; i <= tubularSegments; i++) { - const a = (tubularSegments + 1) * j + i - 1; - const b = (tubularSegments + 1) * (j - 1) + i - 1; - const c = (tubularSegments + 1) * (j - 1) + i; - const d = (tubularSegments + 1) * j + i; - indices.push(a, b, d); - indices.push(b, c, d); - } - } - this.setIndex(indices); - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - static fromJSON(data) { - return new TorusGeometry(data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc); - } -} -class TorusKnotGeometry extends BufferGeometry { - static { - __name(this, "TorusKnotGeometry"); - } - constructor(radius = 1, tube = 0.4, tubularSegments = 64, radialSegments = 8, p = 2, q = 3) { - super(); - this.type = "TorusKnotGeometry"; - this.parameters = { - radius, - tube, - tubularSegments, - radialSegments, - p, - q - }; - tubularSegments = Math.floor(tubularSegments); - radialSegments = Math.floor(radialSegments); - const indices = []; - const vertices = []; - const normals = []; - const uvs = []; - const vertex2 = new Vector3(); - const normal = new Vector3(); - const P1 = new Vector3(); - const P2 = new Vector3(); - const B = new Vector3(); - const T = new Vector3(); - const N = new Vector3(); - for (let i = 0; i <= tubularSegments; ++i) { - const u = i / tubularSegments * p * Math.PI * 2; - calculatePositionOnCurve(u, p, q, radius, P1); - calculatePositionOnCurve(u + 0.01, p, q, radius, P2); - T.subVectors(P2, P1); - N.addVectors(P2, P1); - B.crossVectors(T, N); - N.crossVectors(B, T); - B.normalize(); - N.normalize(); - for (let j = 0; j <= radialSegments; ++j) { - const v = j / radialSegments * Math.PI * 2; - const cx = -tube * Math.cos(v); - const cy = tube * Math.sin(v); - vertex2.x = P1.x + (cx * N.x + cy * B.x); - vertex2.y = P1.y + (cx * N.y + cy * B.y); - vertex2.z = P1.z + (cx * N.z + cy * B.z); - vertices.push(vertex2.x, vertex2.y, vertex2.z); - normal.subVectors(vertex2, P1).normalize(); - normals.push(normal.x, normal.y, normal.z); - uvs.push(i / tubularSegments); - uvs.push(j / radialSegments); - } - } - for (let j = 1; j <= tubularSegments; j++) { - for (let i = 1; i <= radialSegments; i++) { - const a = (radialSegments + 1) * (j - 1) + (i - 1); - const b = (radialSegments + 1) * j + (i - 1); - const c = (radialSegments + 1) * j + i; - const d = (radialSegments + 1) * (j - 1) + i; - indices.push(a, b, d); - indices.push(b, c, d); - } - } - this.setIndex(indices); - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); - function calculatePositionOnCurve(u, p2, q2, radius2, position) { - const cu = Math.cos(u); - const su = Math.sin(u); - const quOverP = q2 / p2 * u; - const cs = Math.cos(quOverP); - position.x = radius2 * (2 + cs) * 0.5 * cu; - position.y = radius2 * (2 + cs) * su * 0.5; - position.z = radius2 * Math.sin(quOverP) * 0.5; - } - __name(calculatePositionOnCurve, "calculatePositionOnCurve"); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - static fromJSON(data) { - return new TorusKnotGeometry(data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q); - } -} -class TubeGeometry extends BufferGeometry { - static { - __name(this, "TubeGeometry"); - } - constructor(path = new QuadraticBezierCurve3(new Vector3(-1, -1, 0), new Vector3(-1, 1, 0), new Vector3(1, 1, 0)), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false) { - super(); - this.type = "TubeGeometry"; - this.parameters = { - path, - tubularSegments, - radius, - radialSegments, - closed - }; - const frames = path.computeFrenetFrames(tubularSegments, closed); - this.tangents = frames.tangents; - this.normals = frames.normals; - this.binormals = frames.binormals; - const vertex2 = new Vector3(); - const normal = new Vector3(); - const uv = new Vector2(); - let P = new Vector3(); - const vertices = []; - const normals = []; - const uvs = []; - const indices = []; - generateBufferData(); - this.setIndex(indices); - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - this.setAttribute("normal", new Float32BufferAttribute(normals, 3)); - this.setAttribute("uv", new Float32BufferAttribute(uvs, 2)); - function generateBufferData() { - for (let i = 0; i < tubularSegments; i++) { - generateSegment(i); - } - generateSegment(closed === false ? tubularSegments : 0); - generateUVs(); - generateIndices(); - } - __name(generateBufferData, "generateBufferData"); - function generateSegment(i) { - P = path.getPointAt(i / tubularSegments, P); - const N = frames.normals[i]; - const B = frames.binormals[i]; - for (let j = 0; j <= radialSegments; j++) { - const v = j / radialSegments * Math.PI * 2; - const sin = Math.sin(v); - const cos = -Math.cos(v); - normal.x = cos * N.x + sin * B.x; - normal.y = cos * N.y + sin * B.y; - normal.z = cos * N.z + sin * B.z; - normal.normalize(); - normals.push(normal.x, normal.y, normal.z); - vertex2.x = P.x + radius * normal.x; - vertex2.y = P.y + radius * normal.y; - vertex2.z = P.z + radius * normal.z; - vertices.push(vertex2.x, vertex2.y, vertex2.z); - } - } - __name(generateSegment, "generateSegment"); - function generateIndices() { - for (let j = 1; j <= tubularSegments; j++) { - for (let i = 1; i <= radialSegments; i++) { - const a = (radialSegments + 1) * (j - 1) + (i - 1); - const b = (radialSegments + 1) * j + (i - 1); - const c = (radialSegments + 1) * j + i; - const d = (radialSegments + 1) * (j - 1) + i; - indices.push(a, b, d); - indices.push(b, c, d); - } - } - } - __name(generateIndices, "generateIndices"); - function generateUVs() { - for (let i = 0; i <= tubularSegments; i++) { - for (let j = 0; j <= radialSegments; j++) { - uv.x = i / tubularSegments; - uv.y = j / radialSegments; - uvs.push(uv.x, uv.y); - } - } - } - __name(generateUVs, "generateUVs"); - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } - toJSON() { - const data = super.toJSON(); - data.path = this.parameters.path.toJSON(); - return data; - } - static fromJSON(data) { - return new TubeGeometry( - new Curves[data.path.type]().fromJSON(data.path), - data.tubularSegments, - data.radius, - data.radialSegments, - data.closed - ); - } -} -class WireframeGeometry extends BufferGeometry { - static { - __name(this, "WireframeGeometry"); - } - constructor(geometry = null) { - super(); - this.type = "WireframeGeometry"; - this.parameters = { - geometry - }; - if (geometry !== null) { - const vertices = []; - const edges = /* @__PURE__ */ new Set(); - const start = new Vector3(); - const end = new Vector3(); - if (geometry.index !== null) { - const position = geometry.attributes.position; - const indices = geometry.index; - let groups = geometry.groups; - if (groups.length === 0) { - groups = [{ start: 0, count: indices.count, materialIndex: 0 }]; - } - for (let o = 0, ol = groups.length; o < ol; ++o) { - const group = groups[o]; - const groupStart = group.start; - const groupCount = group.count; - for (let i = groupStart, l = groupStart + groupCount; i < l; i += 3) { - for (let j = 0; j < 3; j++) { - const index1 = indices.getX(i + j); - const index2 = indices.getX(i + (j + 1) % 3); - start.fromBufferAttribute(position, index1); - end.fromBufferAttribute(position, index2); - if (isUniqueEdge(start, end, edges) === true) { - vertices.push(start.x, start.y, start.z); - vertices.push(end.x, end.y, end.z); - } - } - } - } - } else { - const position = geometry.attributes.position; - for (let i = 0, l = position.count / 3; i < l; i++) { - for (let j = 0; j < 3; j++) { - const index1 = 3 * i + j; - const index2 = 3 * i + (j + 1) % 3; - start.fromBufferAttribute(position, index1); - end.fromBufferAttribute(position, index2); - if (isUniqueEdge(start, end, edges) === true) { - vertices.push(start.x, start.y, start.z); - vertices.push(end.x, end.y, end.z); - } - } - } - } - this.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - } - } - copy(source) { - super.copy(source); - this.parameters = Object.assign({}, source.parameters); - return this; - } -} -function isUniqueEdge(start, end, edges) { - const hash1 = `${start.x},${start.y},${start.z}-${end.x},${end.y},${end.z}`; - const hash2 = `${end.x},${end.y},${end.z}-${start.x},${start.y},${start.z}`; - if (edges.has(hash1) === true || edges.has(hash2) === true) { - return false; - } else { - edges.add(hash1); - edges.add(hash2); - return true; - } -} -__name(isUniqueEdge, "isUniqueEdge"); -var Geometries = /* @__PURE__ */ Object.freeze({ - __proto__: null, - BoxGeometry, - CapsuleGeometry, - CircleGeometry, - ConeGeometry, - CylinderGeometry, - DodecahedronGeometry, - EdgesGeometry, - ExtrudeGeometry, - IcosahedronGeometry, - LatheGeometry, - OctahedronGeometry, - PlaneGeometry, - PolyhedronGeometry, - RingGeometry, - ShapeGeometry, - SphereGeometry, - TetrahedronGeometry, - TorusGeometry, - TorusKnotGeometry, - TubeGeometry, - WireframeGeometry -}); -class ShadowMaterial extends Material { - static { - __name(this, "ShadowMaterial"); - } - static get type() { - return "ShadowMaterial"; - } - constructor(parameters) { - super(); - this.isShadowMaterial = true; - this.color = new Color(0); - this.transparent = true; - this.fog = true; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.color.copy(source.color); - this.fog = source.fog; - return this; - } -} -class RawShaderMaterial extends ShaderMaterial { - static { - __name(this, "RawShaderMaterial"); - } - static get type() { - return "RawShaderMaterial"; - } - constructor(parameters) { - super(parameters); - this.isRawShaderMaterial = true; - } -} -class MeshStandardMaterial extends Material { - static { - __name(this, "MeshStandardMaterial"); - } - static get type() { - return "MeshStandardMaterial"; - } - constructor(parameters) { - super(); - this.isMeshStandardMaterial = true; - this.defines = { "STANDARD": "" }; - this.color = new Color(16777215); - this.roughness = 1; - this.metalness = 0; - this.map = null; - this.lightMap = null; - this.lightMapIntensity = 1; - this.aoMap = null; - this.aoMapIntensity = 1; - this.emissive = new Color(0); - this.emissiveIntensity = 1; - this.emissiveMap = null; - this.bumpMap = null; - this.bumpScale = 1; - this.normalMap = null; - this.normalMapType = TangentSpaceNormalMap; - this.normalScale = new Vector2(1, 1); - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - this.roughnessMap = null; - this.metalnessMap = null; - this.alphaMap = null; - this.envMap = null; - this.envMapRotation = new Euler(); - this.envMapIntensity = 1; - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = "round"; - this.wireframeLinejoin = "round"; - this.flatShading = false; - this.fog = true; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.defines = { "STANDARD": "" }; - this.color.copy(source.color); - this.roughness = source.roughness; - this.metalness = source.metalness; - this.map = source.map; - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; - this.emissive.copy(source.emissive); - this.emissiveMap = source.emissiveMap; - this.emissiveIntensity = source.emissiveIntensity; - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; - this.normalMap = source.normalMap; - this.normalMapType = source.normalMapType; - this.normalScale.copy(source.normalScale); - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - this.roughnessMap = source.roughnessMap; - this.metalnessMap = source.metalnessMap; - this.alphaMap = source.alphaMap; - this.envMap = source.envMap; - this.envMapRotation.copy(source.envMapRotation); - this.envMapIntensity = source.envMapIntensity; - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; - this.flatShading = source.flatShading; - this.fog = source.fog; - return this; - } -} -class MeshPhysicalMaterial extends MeshStandardMaterial { - static { - __name(this, "MeshPhysicalMaterial"); - } - static get type() { - return "MeshPhysicalMaterial"; - } - constructor(parameters) { - super(); - this.isMeshPhysicalMaterial = true; - this.defines = { - "STANDARD": "", - "PHYSICAL": "" - }; - this.anisotropyRotation = 0; - this.anisotropyMap = null; - this.clearcoatMap = null; - this.clearcoatRoughness = 0; - this.clearcoatRoughnessMap = null; - this.clearcoatNormalScale = new Vector2(1, 1); - this.clearcoatNormalMap = null; - this.ior = 1.5; - Object.defineProperty(this, "reflectivity", { - get: /* @__PURE__ */ __name(function() { - return clamp(2.5 * (this.ior - 1) / (this.ior + 1), 0, 1); - }, "get"), - set: /* @__PURE__ */ __name(function(reflectivity) { - this.ior = (1 + 0.4 * reflectivity) / (1 - 0.4 * reflectivity); - }, "set") - }); - this.iridescenceMap = null; - this.iridescenceIOR = 1.3; - this.iridescenceThicknessRange = [100, 400]; - this.iridescenceThicknessMap = null; - this.sheenColor = new Color(0); - this.sheenColorMap = null; - this.sheenRoughness = 1; - this.sheenRoughnessMap = null; - this.transmissionMap = null; - this.thickness = 0; - this.thicknessMap = null; - this.attenuationDistance = Infinity; - this.attenuationColor = new Color(1, 1, 1); - this.specularIntensity = 1; - this.specularIntensityMap = null; - this.specularColor = new Color(1, 1, 1); - this.specularColorMap = null; - this._anisotropy = 0; - this._clearcoat = 0; - this._dispersion = 0; - this._iridescence = 0; - this._sheen = 0; - this._transmission = 0; - this.setValues(parameters); - } - get anisotropy() { - return this._anisotropy; - } - set anisotropy(value) { - if (this._anisotropy > 0 !== value > 0) { - this.version++; - } - this._anisotropy = value; - } - get clearcoat() { - return this._clearcoat; - } - set clearcoat(value) { - if (this._clearcoat > 0 !== value > 0) { - this.version++; - } - this._clearcoat = value; - } - get iridescence() { - return this._iridescence; - } - set iridescence(value) { - if (this._iridescence > 0 !== value > 0) { - this.version++; - } - this._iridescence = value; - } - get dispersion() { - return this._dispersion; - } - set dispersion(value) { - if (this._dispersion > 0 !== value > 0) { - this.version++; - } - this._dispersion = value; - } - get sheen() { - return this._sheen; - } - set sheen(value) { - if (this._sheen > 0 !== value > 0) { - this.version++; - } - this._sheen = value; - } - get transmission() { - return this._transmission; - } - set transmission(value) { - if (this._transmission > 0 !== value > 0) { - this.version++; - } - this._transmission = value; - } - copy(source) { - super.copy(source); - this.defines = { - "STANDARD": "", - "PHYSICAL": "" - }; - this.anisotropy = source.anisotropy; - this.anisotropyRotation = source.anisotropyRotation; - this.anisotropyMap = source.anisotropyMap; - this.clearcoat = source.clearcoat; - this.clearcoatMap = source.clearcoatMap; - this.clearcoatRoughness = source.clearcoatRoughness; - this.clearcoatRoughnessMap = source.clearcoatRoughnessMap; - this.clearcoatNormalMap = source.clearcoatNormalMap; - this.clearcoatNormalScale.copy(source.clearcoatNormalScale); - this.dispersion = source.dispersion; - this.ior = source.ior; - this.iridescence = source.iridescence; - this.iridescenceMap = source.iridescenceMap; - this.iridescenceIOR = source.iridescenceIOR; - this.iridescenceThicknessRange = [...source.iridescenceThicknessRange]; - this.iridescenceThicknessMap = source.iridescenceThicknessMap; - this.sheen = source.sheen; - this.sheenColor.copy(source.sheenColor); - this.sheenColorMap = source.sheenColorMap; - this.sheenRoughness = source.sheenRoughness; - this.sheenRoughnessMap = source.sheenRoughnessMap; - this.transmission = source.transmission; - this.transmissionMap = source.transmissionMap; - this.thickness = source.thickness; - this.thicknessMap = source.thicknessMap; - this.attenuationDistance = source.attenuationDistance; - this.attenuationColor.copy(source.attenuationColor); - this.specularIntensity = source.specularIntensity; - this.specularIntensityMap = source.specularIntensityMap; - this.specularColor.copy(source.specularColor); - this.specularColorMap = source.specularColorMap; - return this; - } -} -class MeshPhongMaterial extends Material { - static { - __name(this, "MeshPhongMaterial"); - } - static get type() { - return "MeshPhongMaterial"; - } - constructor(parameters) { - super(); - this.isMeshPhongMaterial = true; - this.color = new Color(16777215); - this.specular = new Color(1118481); - this.shininess = 30; - this.map = null; - this.lightMap = null; - this.lightMapIntensity = 1; - this.aoMap = null; - this.aoMapIntensity = 1; - this.emissive = new Color(0); - this.emissiveIntensity = 1; - this.emissiveMap = null; - this.bumpMap = null; - this.bumpScale = 1; - this.normalMap = null; - this.normalMapType = TangentSpaceNormalMap; - this.normalScale = new Vector2(1, 1); - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - this.specularMap = null; - this.alphaMap = null; - this.envMap = null; - this.envMapRotation = new Euler(); - this.combine = MultiplyOperation; - this.reflectivity = 1; - this.refractionRatio = 0.98; - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = "round"; - this.wireframeLinejoin = "round"; - this.flatShading = false; - this.fog = true; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.color.copy(source.color); - this.specular.copy(source.specular); - this.shininess = source.shininess; - this.map = source.map; - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; - this.emissive.copy(source.emissive); - this.emissiveMap = source.emissiveMap; - this.emissiveIntensity = source.emissiveIntensity; - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; - this.normalMap = source.normalMap; - this.normalMapType = source.normalMapType; - this.normalScale.copy(source.normalScale); - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - this.specularMap = source.specularMap; - this.alphaMap = source.alphaMap; - this.envMap = source.envMap; - this.envMapRotation.copy(source.envMapRotation); - this.combine = source.combine; - this.reflectivity = source.reflectivity; - this.refractionRatio = source.refractionRatio; - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; - this.flatShading = source.flatShading; - this.fog = source.fog; - return this; - } -} -class MeshToonMaterial extends Material { - static { - __name(this, "MeshToonMaterial"); - } - static get type() { - return "MeshToonMaterial"; - } - constructor(parameters) { - super(); - this.isMeshToonMaterial = true; - this.defines = { "TOON": "" }; - this.color = new Color(16777215); - this.map = null; - this.gradientMap = null; - this.lightMap = null; - this.lightMapIntensity = 1; - this.aoMap = null; - this.aoMapIntensity = 1; - this.emissive = new Color(0); - this.emissiveIntensity = 1; - this.emissiveMap = null; - this.bumpMap = null; - this.bumpScale = 1; - this.normalMap = null; - this.normalMapType = TangentSpaceNormalMap; - this.normalScale = new Vector2(1, 1); - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - this.alphaMap = null; - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = "round"; - this.wireframeLinejoin = "round"; - this.fog = true; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.color.copy(source.color); - this.map = source.map; - this.gradientMap = source.gradientMap; - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; - this.emissive.copy(source.emissive); - this.emissiveMap = source.emissiveMap; - this.emissiveIntensity = source.emissiveIntensity; - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; - this.normalMap = source.normalMap; - this.normalMapType = source.normalMapType; - this.normalScale.copy(source.normalScale); - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - this.alphaMap = source.alphaMap; - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; - this.fog = source.fog; - return this; - } -} -class MeshNormalMaterial extends Material { - static { - __name(this, "MeshNormalMaterial"); - } - static get type() { - return "MeshNormalMaterial"; - } - constructor(parameters) { - super(); - this.isMeshNormalMaterial = true; - this.bumpMap = null; - this.bumpScale = 1; - this.normalMap = null; - this.normalMapType = TangentSpaceNormalMap; - this.normalScale = new Vector2(1, 1); - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - this.wireframe = false; - this.wireframeLinewidth = 1; - this.flatShading = false; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; - this.normalMap = source.normalMap; - this.normalMapType = source.normalMapType; - this.normalScale.copy(source.normalScale); - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.flatShading = source.flatShading; - return this; - } -} -class MeshLambertMaterial extends Material { - static { - __name(this, "MeshLambertMaterial"); - } - static get type() { - return "MeshLambertMaterial"; - } - constructor(parameters) { - super(); - this.isMeshLambertMaterial = true; - this.color = new Color(16777215); - this.map = null; - this.lightMap = null; - this.lightMapIntensity = 1; - this.aoMap = null; - this.aoMapIntensity = 1; - this.emissive = new Color(0); - this.emissiveIntensity = 1; - this.emissiveMap = null; - this.bumpMap = null; - this.bumpScale = 1; - this.normalMap = null; - this.normalMapType = TangentSpaceNormalMap; - this.normalScale = new Vector2(1, 1); - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - this.specularMap = null; - this.alphaMap = null; - this.envMap = null; - this.envMapRotation = new Euler(); - this.combine = MultiplyOperation; - this.reflectivity = 1; - this.refractionRatio = 0.98; - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = "round"; - this.wireframeLinejoin = "round"; - this.flatShading = false; - this.fog = true; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.color.copy(source.color); - this.map = source.map; - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; - this.emissive.copy(source.emissive); - this.emissiveMap = source.emissiveMap; - this.emissiveIntensity = source.emissiveIntensity; - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; - this.normalMap = source.normalMap; - this.normalMapType = source.normalMapType; - this.normalScale.copy(source.normalScale); - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - this.specularMap = source.specularMap; - this.alphaMap = source.alphaMap; - this.envMap = source.envMap; - this.envMapRotation.copy(source.envMapRotation); - this.combine = source.combine; - this.reflectivity = source.reflectivity; - this.refractionRatio = source.refractionRatio; - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; - this.flatShading = source.flatShading; - this.fog = source.fog; - return this; - } -} -class MeshMatcapMaterial extends Material { - static { - __name(this, "MeshMatcapMaterial"); - } - static get type() { - return "MeshMatcapMaterial"; - } - constructor(parameters) { - super(); - this.isMeshMatcapMaterial = true; - this.defines = { "MATCAP": "" }; - this.color = new Color(16777215); - this.matcap = null; - this.map = null; - this.bumpMap = null; - this.bumpScale = 1; - this.normalMap = null; - this.normalMapType = TangentSpaceNormalMap; - this.normalScale = new Vector2(1, 1); - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - this.alphaMap = null; - this.flatShading = false; - this.fog = true; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.defines = { "MATCAP": "" }; - this.color.copy(source.color); - this.matcap = source.matcap; - this.map = source.map; - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; - this.normalMap = source.normalMap; - this.normalMapType = source.normalMapType; - this.normalScale.copy(source.normalScale); - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - this.alphaMap = source.alphaMap; - this.flatShading = source.flatShading; - this.fog = source.fog; - return this; - } -} -class LineDashedMaterial extends LineBasicMaterial { - static { - __name(this, "LineDashedMaterial"); - } - static get type() { - return "LineDashedMaterial"; - } - constructor(parameters) { - super(); - this.isLineDashedMaterial = true; - this.scale = 1; - this.dashSize = 3; - this.gapSize = 1; - this.setValues(parameters); - } - copy(source) { - super.copy(source); - this.scale = source.scale; - this.dashSize = source.dashSize; - this.gapSize = source.gapSize; - return this; - } -} -function convertArray(array, type, forceClone) { - if (!array || // let 'undefined' and 'null' pass - !forceClone && array.constructor === type) return array; - if (typeof type.BYTES_PER_ELEMENT === "number") { - return new type(array); - } - return Array.prototype.slice.call(array); -} -__name(convertArray, "convertArray"); -function isTypedArray(object) { - return ArrayBuffer.isView(object) && !(object instanceof DataView); -} -__name(isTypedArray, "isTypedArray"); -function getKeyframeOrder(times) { - function compareTime(i, j) { - return times[i] - times[j]; - } - __name(compareTime, "compareTime"); - const n = times.length; - const result = new Array(n); - for (let i = 0; i !== n; ++i) result[i] = i; - result.sort(compareTime); - return result; -} -__name(getKeyframeOrder, "getKeyframeOrder"); -function sortedArray(values, stride, order) { - const nValues = values.length; - const result = new values.constructor(nValues); - for (let i = 0, dstOffset = 0; dstOffset !== nValues; ++i) { - const srcOffset = order[i] * stride; - for (let j = 0; j !== stride; ++j) { - result[dstOffset++] = values[srcOffset + j]; - } - } - return result; -} -__name(sortedArray, "sortedArray"); -function flattenJSON(jsonKeys, times, values, valuePropertyName) { - let i = 1, key = jsonKeys[0]; - while (key !== void 0 && key[valuePropertyName] === void 0) { - key = jsonKeys[i++]; - } - if (key === void 0) return; - let value = key[valuePropertyName]; - if (value === void 0) return; - if (Array.isArray(value)) { - do { - value = key[valuePropertyName]; - if (value !== void 0) { - times.push(key.time); - values.push.apply(values, value); - } - key = jsonKeys[i++]; - } while (key !== void 0); - } else if (value.toArray !== void 0) { - do { - value = key[valuePropertyName]; - if (value !== void 0) { - times.push(key.time); - value.toArray(values, values.length); - } - key = jsonKeys[i++]; - } while (key !== void 0); - } else { - do { - value = key[valuePropertyName]; - if (value !== void 0) { - times.push(key.time); - values.push(value); - } - key = jsonKeys[i++]; - } while (key !== void 0); - } -} -__name(flattenJSON, "flattenJSON"); -function subclip(sourceClip, name, startFrame, endFrame, fps = 30) { - const clip = sourceClip.clone(); - clip.name = name; - const tracks = []; - for (let i = 0; i < clip.tracks.length; ++i) { - const track = clip.tracks[i]; - const valueSize = track.getValueSize(); - const times = []; - const values = []; - for (let j = 0; j < track.times.length; ++j) { - const frame = track.times[j] * fps; - if (frame < startFrame || frame >= endFrame) continue; - times.push(track.times[j]); - for (let k = 0; k < valueSize; ++k) { - values.push(track.values[j * valueSize + k]); - } - } - if (times.length === 0) continue; - track.times = convertArray(times, track.times.constructor); - track.values = convertArray(values, track.values.constructor); - tracks.push(track); - } - clip.tracks = tracks; - let minStartTime = Infinity; - for (let i = 0; i < clip.tracks.length; ++i) { - if (minStartTime > clip.tracks[i].times[0]) { - minStartTime = clip.tracks[i].times[0]; - } - } - for (let i = 0; i < clip.tracks.length; ++i) { - clip.tracks[i].shift(-1 * minStartTime); - } - clip.resetDuration(); - return clip; -} -__name(subclip, "subclip"); -function makeClipAdditive(targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30) { - if (fps <= 0) fps = 30; - const numTracks = referenceClip.tracks.length; - const referenceTime = referenceFrame / fps; - for (let i = 0; i < numTracks; ++i) { - const referenceTrack = referenceClip.tracks[i]; - const referenceTrackType = referenceTrack.ValueTypeName; - if (referenceTrackType === "bool" || referenceTrackType === "string") continue; - const targetTrack = targetClip.tracks.find(function(track) { - return track.name === referenceTrack.name && track.ValueTypeName === referenceTrackType; - }); - if (targetTrack === void 0) continue; - let referenceOffset = 0; - const referenceValueSize = referenceTrack.getValueSize(); - if (referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) { - referenceOffset = referenceValueSize / 3; - } - let targetOffset = 0; - const targetValueSize = targetTrack.getValueSize(); - if (targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) { - targetOffset = targetValueSize / 3; - } - const lastIndex = referenceTrack.times.length - 1; - let referenceValue; - if (referenceTime <= referenceTrack.times[0]) { - const startIndex = referenceOffset; - const endIndex = referenceValueSize - referenceOffset; - referenceValue = referenceTrack.values.slice(startIndex, endIndex); - } else if (referenceTime >= referenceTrack.times[lastIndex]) { - const startIndex = lastIndex * referenceValueSize + referenceOffset; - const endIndex = startIndex + referenceValueSize - referenceOffset; - referenceValue = referenceTrack.values.slice(startIndex, endIndex); - } else { - const interpolant = referenceTrack.createInterpolant(); - const startIndex = referenceOffset; - const endIndex = referenceValueSize - referenceOffset; - interpolant.evaluate(referenceTime); - referenceValue = interpolant.resultBuffer.slice(startIndex, endIndex); - } - if (referenceTrackType === "quaternion") { - const referenceQuat = new Quaternion().fromArray(referenceValue).normalize().conjugate(); - referenceQuat.toArray(referenceValue); - } - const numTimes = targetTrack.times.length; - for (let j = 0; j < numTimes; ++j) { - const valueStart = j * targetValueSize + targetOffset; - if (referenceTrackType === "quaternion") { - Quaternion.multiplyQuaternionsFlat( - targetTrack.values, - valueStart, - referenceValue, - 0, - targetTrack.values, - valueStart - ); - } else { - const valueEnd = targetValueSize - targetOffset * 2; - for (let k = 0; k < valueEnd; ++k) { - targetTrack.values[valueStart + k] -= referenceValue[k]; - } - } - } - } - targetClip.blendMode = AdditiveAnimationBlendMode; - return targetClip; -} -__name(makeClipAdditive, "makeClipAdditive"); -const AnimationUtils = { - convertArray, - isTypedArray, - getKeyframeOrder, - sortedArray, - flattenJSON, - subclip, - makeClipAdditive -}; -class Interpolant { - static { - __name(this, "Interpolant"); - } - constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) { - this.parameterPositions = parameterPositions; - this._cachedIndex = 0; - this.resultBuffer = resultBuffer !== void 0 ? resultBuffer : new sampleValues.constructor(sampleSize); - this.sampleValues = sampleValues; - this.valueSize = sampleSize; - this.settings = null; - this.DefaultSettings_ = {}; - } - evaluate(t2) { - const pp = this.parameterPositions; - let i1 = this._cachedIndex, t1 = pp[i1], t0 = pp[i1 - 1]; - validate_interval: { - seek: { - let right; - linear_scan: { - forward_scan: if (!(t2 < t1)) { - for (let giveUpAt = i1 + 2; ; ) { - if (t1 === void 0) { - if (t2 < t0) break forward_scan; - i1 = pp.length; - this._cachedIndex = i1; - return this.copySampleValue_(i1 - 1); - } - if (i1 === giveUpAt) break; - t0 = t1; - t1 = pp[++i1]; - if (t2 < t1) { - break seek; - } - } - right = pp.length; - break linear_scan; - } - if (!(t2 >= t0)) { - const t1global = pp[1]; - if (t2 < t1global) { - i1 = 2; - t0 = t1global; - } - for (let giveUpAt = i1 - 2; ; ) { - if (t0 === void 0) { - this._cachedIndex = 0; - return this.copySampleValue_(0); - } - if (i1 === giveUpAt) break; - t1 = t0; - t0 = pp[--i1 - 1]; - if (t2 >= t0) { - break seek; - } - } - right = i1; - i1 = 0; - break linear_scan; - } - break validate_interval; - } - while (i1 < right) { - const mid = i1 + right >>> 1; - if (t2 < pp[mid]) { - right = mid; - } else { - i1 = mid + 1; - } - } - t1 = pp[i1]; - t0 = pp[i1 - 1]; - if (t0 === void 0) { - this._cachedIndex = 0; - return this.copySampleValue_(0); - } - if (t1 === void 0) { - i1 = pp.length; - this._cachedIndex = i1; - return this.copySampleValue_(i1 - 1); - } - } - this._cachedIndex = i1; - this.intervalChanged_(i1, t0, t1); - } - return this.interpolate_(i1, t0, t2, t1); - } - getSettings_() { - return this.settings || this.DefaultSettings_; - } - copySampleValue_(index) { - const result = this.resultBuffer, values = this.sampleValues, stride = this.valueSize, offset = index * stride; - for (let i = 0; i !== stride; ++i) { - result[i] = values[offset + i]; - } - return result; - } - // Template methods for derived classes: - interpolate_() { - throw new Error("call to abstract method"); - } - intervalChanged_() { - } -} -class CubicInterpolant extends Interpolant { - static { - __name(this, "CubicInterpolant"); - } - constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) { - super(parameterPositions, sampleValues, sampleSize, resultBuffer); - this._weightPrev = -0; - this._offsetPrev = -0; - this._weightNext = -0; - this._offsetNext = -0; - this.DefaultSettings_ = { - endingStart: ZeroCurvatureEnding, - endingEnd: ZeroCurvatureEnding - }; - } - intervalChanged_(i1, t0, t1) { - const pp = this.parameterPositions; - let iPrev = i1 - 2, iNext = i1 + 1, tPrev = pp[iPrev], tNext = pp[iNext]; - if (tPrev === void 0) { - switch (this.getSettings_().endingStart) { - case ZeroSlopeEnding: - iPrev = i1; - tPrev = 2 * t0 - t1; - break; - case WrapAroundEnding: - iPrev = pp.length - 2; - tPrev = t0 + pp[iPrev] - pp[iPrev + 1]; - break; - default: - iPrev = i1; - tPrev = t1; - } - } - if (tNext === void 0) { - switch (this.getSettings_().endingEnd) { - case ZeroSlopeEnding: - iNext = i1; - tNext = 2 * t1 - t0; - break; - case WrapAroundEnding: - iNext = 1; - tNext = t1 + pp[1] - pp[0]; - break; - default: - iNext = i1 - 1; - tNext = t0; - } - } - const halfDt = (t1 - t0) * 0.5, stride = this.valueSize; - this._weightPrev = halfDt / (t0 - tPrev); - this._weightNext = halfDt / (tNext - t1); - this._offsetPrev = iPrev * stride; - this._offsetNext = iNext * stride; - } - interpolate_(i1, t0, t2, t1) { - const result = this.resultBuffer, values = this.sampleValues, stride = this.valueSize, o1 = i1 * stride, o0 = o1 - stride, oP = this._offsetPrev, oN = this._offsetNext, wP = this._weightPrev, wN = this._weightNext, p = (t2 - t0) / (t1 - t0), pp = p * p, ppp = pp * p; - const sP = -wP * ppp + 2 * wP * pp - wP * p; - const s0 = (1 + wP) * ppp + (-1.5 - 2 * wP) * pp + (-0.5 + wP) * p + 1; - const s1 = (-1 - wN) * ppp + (1.5 + wN) * pp + 0.5 * p; - const sN = wN * ppp - wN * pp; - for (let i = 0; i !== stride; ++i) { - result[i] = sP * values[oP + i] + s0 * values[o0 + i] + s1 * values[o1 + i] + sN * values[oN + i]; - } - return result; - } -} -class LinearInterpolant extends Interpolant { - static { - __name(this, "LinearInterpolant"); - } - constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) { - super(parameterPositions, sampleValues, sampleSize, resultBuffer); - } - interpolate_(i1, t0, t2, t1) { - const result = this.resultBuffer, values = this.sampleValues, stride = this.valueSize, offset1 = i1 * stride, offset0 = offset1 - stride, weight1 = (t2 - t0) / (t1 - t0), weight0 = 1 - weight1; - for (let i = 0; i !== stride; ++i) { - result[i] = values[offset0 + i] * weight0 + values[offset1 + i] * weight1; - } - return result; - } -} -class DiscreteInterpolant extends Interpolant { - static { - __name(this, "DiscreteInterpolant"); - } - constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) { - super(parameterPositions, sampleValues, sampleSize, resultBuffer); - } - interpolate_(i1) { - return this.copySampleValue_(i1 - 1); - } -} -class KeyframeTrack { - static { - __name(this, "KeyframeTrack"); - } - constructor(name, times, values, interpolation) { - if (name === void 0) throw new Error("THREE.KeyframeTrack: track name is undefined"); - if (times === void 0 || times.length === 0) throw new Error("THREE.KeyframeTrack: no keyframes in track named " + name); - this.name = name; - this.times = convertArray(times, this.TimeBufferType); - this.values = convertArray(values, this.ValueBufferType); - this.setInterpolation(interpolation || this.DefaultInterpolation); - } - // Serialization (in static context, because of constructor invocation - // and automatic invocation of .toJSON): - static toJSON(track) { - const trackType = track.constructor; - let json; - if (trackType.toJSON !== this.toJSON) { - json = trackType.toJSON(track); - } else { - json = { - "name": track.name, - "times": convertArray(track.times, Array), - "values": convertArray(track.values, Array) - }; - const interpolation = track.getInterpolation(); - if (interpolation !== track.DefaultInterpolation) { - json.interpolation = interpolation; - } - } - json.type = track.ValueTypeName; - return json; - } - InterpolantFactoryMethodDiscrete(result) { - return new DiscreteInterpolant(this.times, this.values, this.getValueSize(), result); - } - InterpolantFactoryMethodLinear(result) { - return new LinearInterpolant(this.times, this.values, this.getValueSize(), result); - } - InterpolantFactoryMethodSmooth(result) { - return new CubicInterpolant(this.times, this.values, this.getValueSize(), result); - } - setInterpolation(interpolation) { - let factoryMethod; - switch (interpolation) { - case InterpolateDiscrete: - factoryMethod = this.InterpolantFactoryMethodDiscrete; - break; - case InterpolateLinear: - factoryMethod = this.InterpolantFactoryMethodLinear; - break; - case InterpolateSmooth: - factoryMethod = this.InterpolantFactoryMethodSmooth; - break; - } - if (factoryMethod === void 0) { - const message = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name; - if (this.createInterpolant === void 0) { - if (interpolation !== this.DefaultInterpolation) { - this.setInterpolation(this.DefaultInterpolation); - } else { - throw new Error(message); - } - } - console.warn("THREE.KeyframeTrack:", message); - return this; - } - this.createInterpolant = factoryMethod; - return this; - } - getInterpolation() { - switch (this.createInterpolant) { - case this.InterpolantFactoryMethodDiscrete: - return InterpolateDiscrete; - case this.InterpolantFactoryMethodLinear: - return InterpolateLinear; - case this.InterpolantFactoryMethodSmooth: - return InterpolateSmooth; - } - } - getValueSize() { - return this.values.length / this.times.length; - } - // move all keyframes either forwards or backwards in time - shift(timeOffset) { - if (timeOffset !== 0) { - const times = this.times; - for (let i = 0, n = times.length; i !== n; ++i) { - times[i] += timeOffset; - } - } - return this; - } - // scale all keyframe times by a factor (useful for frame <-> seconds conversions) - scale(timeScale) { - if (timeScale !== 1) { - const times = this.times; - for (let i = 0, n = times.length; i !== n; ++i) { - times[i] *= timeScale; - } - } - return this; - } - // removes keyframes before and after animation without changing any values within the range [startTime, endTime]. - // IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values - trim(startTime, endTime) { - const times = this.times, nKeys = times.length; - let from = 0, to = nKeys - 1; - while (from !== nKeys && times[from] < startTime) { - ++from; - } - while (to !== -1 && times[to] > endTime) { - --to; - } - ++to; - if (from !== 0 || to !== nKeys) { - if (from >= to) { - to = Math.max(to, 1); - from = to - 1; - } - const stride = this.getValueSize(); - this.times = times.slice(from, to); - this.values = this.values.slice(from * stride, to * stride); - } - return this; - } - // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable - validate() { - let valid = true; - const valueSize = this.getValueSize(); - if (valueSize - Math.floor(valueSize) !== 0) { - console.error("THREE.KeyframeTrack: Invalid value size in track.", this); - valid = false; - } - const times = this.times, values = this.values, nKeys = times.length; - if (nKeys === 0) { - console.error("THREE.KeyframeTrack: Track is empty.", this); - valid = false; - } - let prevTime = null; - for (let i = 0; i !== nKeys; i++) { - const currTime = times[i]; - if (typeof currTime === "number" && isNaN(currTime)) { - console.error("THREE.KeyframeTrack: Time is not a valid number.", this, i, currTime); - valid = false; - break; - } - if (prevTime !== null && prevTime > currTime) { - console.error("THREE.KeyframeTrack: Out of order keys.", this, i, currTime, prevTime); - valid = false; - break; - } - prevTime = currTime; - } - if (values !== void 0) { - if (isTypedArray(values)) { - for (let i = 0, n = values.length; i !== n; ++i) { - const value = values[i]; - if (isNaN(value)) { - console.error("THREE.KeyframeTrack: Value is not a valid number.", this, i, value); - valid = false; - break; - } - } - } - } - return valid; - } - // removes equivalent sequential keys as common in morph target sequences - // (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0) - optimize() { - const times = this.times.slice(), values = this.values.slice(), stride = this.getValueSize(), smoothInterpolation = this.getInterpolation() === InterpolateSmooth, lastIndex = times.length - 1; - let writeIndex = 1; - for (let i = 1; i < lastIndex; ++i) { - let keep = false; - const time = times[i]; - const timeNext = times[i + 1]; - if (time !== timeNext && (i !== 1 || time !== times[0])) { - if (!smoothInterpolation) { - const offset = i * stride, offsetP = offset - stride, offsetN = offset + stride; - for (let j = 0; j !== stride; ++j) { - const value = values[offset + j]; - if (value !== values[offsetP + j] || value !== values[offsetN + j]) { - keep = true; - break; - } - } - } else { - keep = true; - } - } - if (keep) { - if (i !== writeIndex) { - times[writeIndex] = times[i]; - const readOffset = i * stride, writeOffset = writeIndex * stride; - for (let j = 0; j !== stride; ++j) { - values[writeOffset + j] = values[readOffset + j]; - } - } - ++writeIndex; - } - } - if (lastIndex > 0) { - times[writeIndex] = times[lastIndex]; - for (let readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++j) { - values[writeOffset + j] = values[readOffset + j]; - } - ++writeIndex; - } - if (writeIndex !== times.length) { - this.times = times.slice(0, writeIndex); - this.values = values.slice(0, writeIndex * stride); - } else { - this.times = times; - this.values = values; - } - return this; - } - clone() { - const times = this.times.slice(); - const values = this.values.slice(); - const TypedKeyframeTrack = this.constructor; - const track = new TypedKeyframeTrack(this.name, times, values); - track.createInterpolant = this.createInterpolant; - return track; - } -} -KeyframeTrack.prototype.TimeBufferType = Float32Array; -KeyframeTrack.prototype.ValueBufferType = Float32Array; -KeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear; -class BooleanKeyframeTrack extends KeyframeTrack { - static { - __name(this, "BooleanKeyframeTrack"); - } - // No interpolation parameter because only InterpolateDiscrete is valid. - constructor(name, times, values) { - super(name, times, values); - } -} -BooleanKeyframeTrack.prototype.ValueTypeName = "bool"; -BooleanKeyframeTrack.prototype.ValueBufferType = Array; -BooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete; -BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = void 0; -BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = void 0; -class ColorKeyframeTrack extends KeyframeTrack { - static { - __name(this, "ColorKeyframeTrack"); - } -} -ColorKeyframeTrack.prototype.ValueTypeName = "color"; -class NumberKeyframeTrack extends KeyframeTrack { - static { - __name(this, "NumberKeyframeTrack"); - } -} -NumberKeyframeTrack.prototype.ValueTypeName = "number"; -class QuaternionLinearInterpolant extends Interpolant { - static { - __name(this, "QuaternionLinearInterpolant"); - } - constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) { - super(parameterPositions, sampleValues, sampleSize, resultBuffer); - } - interpolate_(i1, t0, t2, t1) { - const result = this.resultBuffer, values = this.sampleValues, stride = this.valueSize, alpha = (t2 - t0) / (t1 - t0); - let offset = i1 * stride; - for (let end = offset + stride; offset !== end; offset += 4) { - Quaternion.slerpFlat(result, 0, values, offset - stride, values, offset, alpha); - } - return result; - } -} -class QuaternionKeyframeTrack extends KeyframeTrack { - static { - __name(this, "QuaternionKeyframeTrack"); - } - InterpolantFactoryMethodLinear(result) { - return new QuaternionLinearInterpolant(this.times, this.values, this.getValueSize(), result); - } -} -QuaternionKeyframeTrack.prototype.ValueTypeName = "quaternion"; -QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = void 0; -class StringKeyframeTrack extends KeyframeTrack { - static { - __name(this, "StringKeyframeTrack"); - } - // No interpolation parameter because only InterpolateDiscrete is valid. - constructor(name, times, values) { - super(name, times, values); - } -} -StringKeyframeTrack.prototype.ValueTypeName = "string"; -StringKeyframeTrack.prototype.ValueBufferType = Array; -StringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete; -StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = void 0; -StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = void 0; -class VectorKeyframeTrack extends KeyframeTrack { - static { - __name(this, "VectorKeyframeTrack"); - } -} -VectorKeyframeTrack.prototype.ValueTypeName = "vector"; -class AnimationClip { - static { - __name(this, "AnimationClip"); - } - constructor(name = "", duration = -1, tracks = [], blendMode = NormalAnimationBlendMode) { - this.name = name; - this.tracks = tracks; - this.duration = duration; - this.blendMode = blendMode; - this.uuid = generateUUID(); - if (this.duration < 0) { - this.resetDuration(); - } - } - static parse(json) { - const tracks = [], jsonTracks = json.tracks, frameTime = 1 / (json.fps || 1); - for (let i = 0, n = jsonTracks.length; i !== n; ++i) { - tracks.push(parseKeyframeTrack(jsonTracks[i]).scale(frameTime)); - } - const clip = new this(json.name, json.duration, tracks, json.blendMode); - clip.uuid = json.uuid; - return clip; - } - static toJSON(clip) { - const tracks = [], clipTracks = clip.tracks; - const json = { - "name": clip.name, - "duration": clip.duration, - "tracks": tracks, - "uuid": clip.uuid, - "blendMode": clip.blendMode - }; - for (let i = 0, n = clipTracks.length; i !== n; ++i) { - tracks.push(KeyframeTrack.toJSON(clipTracks[i])); - } - return json; - } - static CreateFromMorphTargetSequence(name, morphTargetSequence, fps, noLoop) { - const numMorphTargets = morphTargetSequence.length; - const tracks = []; - for (let i = 0; i < numMorphTargets; i++) { - let times = []; - let values = []; - times.push( - (i + numMorphTargets - 1) % numMorphTargets, - i, - (i + 1) % numMorphTargets - ); - values.push(0, 1, 0); - const order = getKeyframeOrder(times); - times = sortedArray(times, 1, order); - values = sortedArray(values, 1, order); - if (!noLoop && times[0] === 0) { - times.push(numMorphTargets); - values.push(values[0]); - } - tracks.push( - new NumberKeyframeTrack( - ".morphTargetInfluences[" + morphTargetSequence[i].name + "]", - times, - values - ).scale(1 / fps) - ); - } - return new this(name, -1, tracks); - } - static findByName(objectOrClipArray, name) { - let clipArray = objectOrClipArray; - if (!Array.isArray(objectOrClipArray)) { - const o = objectOrClipArray; - clipArray = o.geometry && o.geometry.animations || o.animations; - } - for (let i = 0; i < clipArray.length; i++) { - if (clipArray[i].name === name) { - return clipArray[i]; - } - } - return null; - } - static CreateClipsFromMorphTargetSequences(morphTargets, fps, noLoop) { - const animationToMorphTargets = {}; - const pattern = /^([\w-]*?)([\d]+)$/; - for (let i = 0, il = morphTargets.length; i < il; i++) { - const morphTarget = morphTargets[i]; - const parts = morphTarget.name.match(pattern); - if (parts && parts.length > 1) { - const name = parts[1]; - let animationMorphTargets = animationToMorphTargets[name]; - if (!animationMorphTargets) { - animationToMorphTargets[name] = animationMorphTargets = []; - } - animationMorphTargets.push(morphTarget); - } - } - const clips = []; - for (const name in animationToMorphTargets) { - clips.push(this.CreateFromMorphTargetSequence(name, animationToMorphTargets[name], fps, noLoop)); - } - return clips; - } - // parse the animation.hierarchy format - static parseAnimation(animation, bones) { - if (!animation) { - console.error("THREE.AnimationClip: No animation in JSONLoader data."); - return null; - } - const addNonemptyTrack = /* @__PURE__ */ __name(function(trackType, trackName, animationKeys, propertyName, destTracks) { - if (animationKeys.length !== 0) { - const times = []; - const values = []; - flattenJSON(animationKeys, times, values, propertyName); - if (times.length !== 0) { - destTracks.push(new trackType(trackName, times, values)); - } - } - }, "addNonemptyTrack"); - const tracks = []; - const clipName = animation.name || "default"; - const fps = animation.fps || 30; - const blendMode = animation.blendMode; - let duration = animation.length || -1; - const hierarchyTracks = animation.hierarchy || []; - for (let h = 0; h < hierarchyTracks.length; h++) { - const animationKeys = hierarchyTracks[h].keys; - if (!animationKeys || animationKeys.length === 0) continue; - if (animationKeys[0].morphTargets) { - const morphTargetNames = {}; - let k; - for (k = 0; k < animationKeys.length; k++) { - if (animationKeys[k].morphTargets) { - for (let m = 0; m < animationKeys[k].morphTargets.length; m++) { - morphTargetNames[animationKeys[k].morphTargets[m]] = -1; - } - } - } - for (const morphTargetName in morphTargetNames) { - const times = []; - const values = []; - for (let m = 0; m !== animationKeys[k].morphTargets.length; ++m) { - const animationKey = animationKeys[k]; - times.push(animationKey.time); - values.push(animationKey.morphTarget === morphTargetName ? 1 : 0); - } - tracks.push(new NumberKeyframeTrack(".morphTargetInfluence[" + morphTargetName + "]", times, values)); - } - duration = morphTargetNames.length * fps; - } else { - const boneName = ".bones[" + bones[h].name + "]"; - addNonemptyTrack( - VectorKeyframeTrack, - boneName + ".position", - animationKeys, - "pos", - tracks - ); - addNonemptyTrack( - QuaternionKeyframeTrack, - boneName + ".quaternion", - animationKeys, - "rot", - tracks - ); - addNonemptyTrack( - VectorKeyframeTrack, - boneName + ".scale", - animationKeys, - "scl", - tracks - ); - } - } - if (tracks.length === 0) { - return null; - } - const clip = new this(clipName, duration, tracks, blendMode); - return clip; - } - resetDuration() { - const tracks = this.tracks; - let duration = 0; - for (let i = 0, n = tracks.length; i !== n; ++i) { - const track = this.tracks[i]; - duration = Math.max(duration, track.times[track.times.length - 1]); - } - this.duration = duration; - return this; - } - trim() { - for (let i = 0; i < this.tracks.length; i++) { - this.tracks[i].trim(0, this.duration); - } - return this; - } - validate() { - let valid = true; - for (let i = 0; i < this.tracks.length; i++) { - valid = valid && this.tracks[i].validate(); - } - return valid; - } - optimize() { - for (let i = 0; i < this.tracks.length; i++) { - this.tracks[i].optimize(); - } - return this; - } - clone() { - const tracks = []; - for (let i = 0; i < this.tracks.length; i++) { - tracks.push(this.tracks[i].clone()); - } - return new this.constructor(this.name, this.duration, tracks, this.blendMode); - } - toJSON() { - return this.constructor.toJSON(this); - } -} -function getTrackTypeForValueTypeName(typeName) { - switch (typeName.toLowerCase()) { - case "scalar": - case "double": - case "float": - case "number": - case "integer": - return NumberKeyframeTrack; - case "vector": - case "vector2": - case "vector3": - case "vector4": - return VectorKeyframeTrack; - case "color": - return ColorKeyframeTrack; - case "quaternion": - return QuaternionKeyframeTrack; - case "bool": - case "boolean": - return BooleanKeyframeTrack; - case "string": - return StringKeyframeTrack; - } - throw new Error("THREE.KeyframeTrack: Unsupported typeName: " + typeName); -} -__name(getTrackTypeForValueTypeName, "getTrackTypeForValueTypeName"); -function parseKeyframeTrack(json) { - if (json.type === void 0) { - throw new Error("THREE.KeyframeTrack: track type undefined, can not parse"); - } - const trackType = getTrackTypeForValueTypeName(json.type); - if (json.times === void 0) { - const times = [], values = []; - flattenJSON(json.keys, times, values, "value"); - json.times = times; - json.values = values; - } - if (trackType.parse !== void 0) { - return trackType.parse(json); - } else { - return new trackType(json.name, json.times, json.values, json.interpolation); - } -} -__name(parseKeyframeTrack, "parseKeyframeTrack"); -const Cache = { - enabled: false, - files: {}, - add: /* @__PURE__ */ __name(function(key, file2) { - if (this.enabled === false) return; - this.files[key] = file2; - }, "add"), - get: /* @__PURE__ */ __name(function(key) { - if (this.enabled === false) return; - return this.files[key]; - }, "get"), - remove: /* @__PURE__ */ __name(function(key) { - delete this.files[key]; - }, "remove"), - clear: /* @__PURE__ */ __name(function() { - this.files = {}; - }, "clear") -}; -class LoadingManager { - static { - __name(this, "LoadingManager"); - } - constructor(onLoad, onProgress, onError) { - const scope = this; - let isLoading = false; - let itemsLoaded = 0; - let itemsTotal = 0; - let urlModifier = void 0; - const handlers = []; - this.onStart = void 0; - this.onLoad = onLoad; - this.onProgress = onProgress; - this.onError = onError; - this.itemStart = function(url) { - itemsTotal++; - if (isLoading === false) { - if (scope.onStart !== void 0) { - scope.onStart(url, itemsLoaded, itemsTotal); - } - } - isLoading = true; - }; - this.itemEnd = function(url) { - itemsLoaded++; - if (scope.onProgress !== void 0) { - scope.onProgress(url, itemsLoaded, itemsTotal); - } - if (itemsLoaded === itemsTotal) { - isLoading = false; - if (scope.onLoad !== void 0) { - scope.onLoad(); - } - } - }; - this.itemError = function(url) { - if (scope.onError !== void 0) { - scope.onError(url); - } - }; - this.resolveURL = function(url) { - if (urlModifier) { - return urlModifier(url); - } - return url; - }; - this.setURLModifier = function(transform) { - urlModifier = transform; - return this; - }; - this.addHandler = function(regex, loader) { - handlers.push(regex, loader); - return this; - }; - this.removeHandler = function(regex) { - const index = handlers.indexOf(regex); - if (index !== -1) { - handlers.splice(index, 2); - } - return this; - }; - this.getHandler = function(file2) { - for (let i = 0, l = handlers.length; i < l; i += 2) { - const regex = handlers[i]; - const loader = handlers[i + 1]; - if (regex.global) regex.lastIndex = 0; - if (regex.test(file2)) { - return loader; - } - } - return null; - }; - } -} -const DefaultLoadingManager = /* @__PURE__ */ new LoadingManager(); -class Loader { - static { - __name(this, "Loader"); - } - constructor(manager) { - this.manager = manager !== void 0 ? manager : DefaultLoadingManager; - this.crossOrigin = "anonymous"; - this.withCredentials = false; - this.path = ""; - this.resourcePath = ""; - this.requestHeader = {}; - } - load() { - } - loadAsync(url, onProgress) { - const scope = this; - return new Promise(function(resolve, reject) { - scope.load(url, resolve, onProgress, reject); - }); - } - parse() { - } - setCrossOrigin(crossOrigin) { - this.crossOrigin = crossOrigin; - return this; - } - setWithCredentials(value) { - this.withCredentials = value; - return this; - } - setPath(path) { - this.path = path; - return this; - } - setResourcePath(resourcePath) { - this.resourcePath = resourcePath; - return this; - } - setRequestHeader(requestHeader) { - this.requestHeader = requestHeader; - return this; - } -} -Loader.DEFAULT_MATERIAL_NAME = "__DEFAULT"; -const loading = {}; -class HttpError extends Error { - static { - __name(this, "HttpError"); - } - constructor(message, response) { - super(message); - this.response = response; - } -} -class FileLoader extends Loader { - static { - __name(this, "FileLoader"); - } - constructor(manager) { - super(manager); - } - load(url, onLoad, onProgress, onError) { - if (url === void 0) url = ""; - if (this.path !== void 0) url = this.path + url; - url = this.manager.resolveURL(url); - const cached = Cache.get(url); - if (cached !== void 0) { - this.manager.itemStart(url); - setTimeout(() => { - if (onLoad) onLoad(cached); - this.manager.itemEnd(url); - }, 0); - return cached; - } - if (loading[url] !== void 0) { - loading[url].push({ - onLoad, - onProgress, - onError - }); - return; - } - loading[url] = []; - loading[url].push({ - onLoad, - onProgress, - onError - }); - const req = new Request(url, { - headers: new Headers(this.requestHeader), - credentials: this.withCredentials ? "include" : "same-origin" - // An abort controller could be added within a future PR - }); - const mimeType = this.mimeType; - const responseType = this.responseType; - fetch(req).then((response) => { - if (response.status === 200 || response.status === 0) { - if (response.status === 0) { - console.warn("THREE.FileLoader: HTTP Status 0 received."); - } - if (typeof ReadableStream === "undefined" || response.body === void 0 || response.body.getReader === void 0) { - return response; - } - const callbacks = loading[url]; - const reader = response.body.getReader(); - const contentLength = response.headers.get("X-File-Size") || response.headers.get("Content-Length"); - const total = contentLength ? parseInt(contentLength) : 0; - const lengthComputable = total !== 0; - let loaded = 0; - const stream = new ReadableStream({ - start(controller) { - readData(); - function readData() { - reader.read().then(({ done, value }) => { - if (done) { - controller.close(); - } else { - loaded += value.byteLength; - const event = new ProgressEvent("progress", { lengthComputable, loaded, total }); - for (let i = 0, il = callbacks.length; i < il; i++) { - const callback = callbacks[i]; - if (callback.onProgress) callback.onProgress(event); - } - controller.enqueue(value); - readData(); - } - }, (e) => { - controller.error(e); - }); - } - __name(readData, "readData"); - } - }); - return new Response(stream); - } else { - throw new HttpError(`fetch for "${response.url}" responded with ${response.status}: ${response.statusText}`, response); - } - }).then((response) => { - switch (responseType) { - case "arraybuffer": - return response.arrayBuffer(); - case "blob": - return response.blob(); - case "document": - return response.text().then((text) => { - const parser = new DOMParser(); - return parser.parseFromString(text, mimeType); - }); - case "json": - return response.json(); - default: - if (mimeType === void 0) { - return response.text(); - } else { - const re = /charset="?([^;"\s]*)"?/i; - const exec = re.exec(mimeType); - const label = exec && exec[1] ? exec[1].toLowerCase() : void 0; - const decoder = new TextDecoder(label); - return response.arrayBuffer().then((ab) => decoder.decode(ab)); - } - } - }).then((data) => { - Cache.add(url, data); - const callbacks = loading[url]; - delete loading[url]; - for (let i = 0, il = callbacks.length; i < il; i++) { - const callback = callbacks[i]; - if (callback.onLoad) callback.onLoad(data); - } - }).catch((err2) => { - const callbacks = loading[url]; - if (callbacks === void 0) { - this.manager.itemError(url); - throw err2; - } - delete loading[url]; - for (let i = 0, il = callbacks.length; i < il; i++) { - const callback = callbacks[i]; - if (callback.onError) callback.onError(err2); - } - this.manager.itemError(url); - }).finally(() => { - this.manager.itemEnd(url); - }); - this.manager.itemStart(url); - } - setResponseType(value) { - this.responseType = value; - return this; - } - setMimeType(value) { - this.mimeType = value; - return this; - } -} -class AnimationLoader extends Loader { - static { - __name(this, "AnimationLoader"); - } - constructor(manager) { - super(manager); - } - load(url, onLoad, onProgress, onError) { - const scope = this; - const loader = new FileLoader(this.manager); - loader.setPath(this.path); - loader.setRequestHeader(this.requestHeader); - loader.setWithCredentials(this.withCredentials); - loader.load(url, function(text) { - try { - onLoad(scope.parse(JSON.parse(text))); - } catch (e) { - if (onError) { - onError(e); - } else { - console.error(e); - } - scope.manager.itemError(url); - } - }, onProgress, onError); - } - parse(json) { - const animations = []; - for (let i = 0; i < json.length; i++) { - const clip = AnimationClip.parse(json[i]); - animations.push(clip); - } - return animations; - } -} -class CompressedTextureLoader extends Loader { - static { - __name(this, "CompressedTextureLoader"); - } - constructor(manager) { - super(manager); - } - load(url, onLoad, onProgress, onError) { - const scope = this; - const images = []; - const texture = new CompressedTexture(); - const loader = new FileLoader(this.manager); - loader.setPath(this.path); - loader.setResponseType("arraybuffer"); - loader.setRequestHeader(this.requestHeader); - loader.setWithCredentials(scope.withCredentials); - let loaded = 0; - function loadTexture(i) { - loader.load(url[i], function(buffer) { - const texDatas = scope.parse(buffer, true); - images[i] = { - width: texDatas.width, - height: texDatas.height, - format: texDatas.format, - mipmaps: texDatas.mipmaps - }; - loaded += 1; - if (loaded === 6) { - if (texDatas.mipmapCount === 1) texture.minFilter = LinearFilter; - texture.image = images; - texture.format = texDatas.format; - texture.needsUpdate = true; - if (onLoad) onLoad(texture); - } - }, onProgress, onError); - } - __name(loadTexture, "loadTexture"); - if (Array.isArray(url)) { - for (let i = 0, il = url.length; i < il; ++i) { - loadTexture(i); - } - } else { - loader.load(url, function(buffer) { - const texDatas = scope.parse(buffer, true); - if (texDatas.isCubemap) { - const faces = texDatas.mipmaps.length / texDatas.mipmapCount; - for (let f = 0; f < faces; f++) { - images[f] = { mipmaps: [] }; - for (let i = 0; i < texDatas.mipmapCount; i++) { - images[f].mipmaps.push(texDatas.mipmaps[f * texDatas.mipmapCount + i]); - images[f].format = texDatas.format; - images[f].width = texDatas.width; - images[f].height = texDatas.height; - } - } - texture.image = images; - } else { - texture.image.width = texDatas.width; - texture.image.height = texDatas.height; - texture.mipmaps = texDatas.mipmaps; - } - if (texDatas.mipmapCount === 1) { - texture.minFilter = LinearFilter; - } - texture.format = texDatas.format; - texture.needsUpdate = true; - if (onLoad) onLoad(texture); - }, onProgress, onError); - } - return texture; - } -} -class ImageLoader extends Loader { - static { - __name(this, "ImageLoader"); - } - constructor(manager) { - super(manager); - } - load(url, onLoad, onProgress, onError) { - if (this.path !== void 0) url = this.path + url; - url = this.manager.resolveURL(url); - const scope = this; - const cached = Cache.get(url); - if (cached !== void 0) { - scope.manager.itemStart(url); - setTimeout(function() { - if (onLoad) onLoad(cached); - scope.manager.itemEnd(url); - }, 0); - return cached; - } - const image = createElementNS("img"); - function onImageLoad() { - removeEventListeners(); - Cache.add(url, this); - if (onLoad) onLoad(this); - scope.manager.itemEnd(url); - } - __name(onImageLoad, "onImageLoad"); - function onImageError(event) { - removeEventListeners(); - if (onError) onError(event); - scope.manager.itemError(url); - scope.manager.itemEnd(url); - } - __name(onImageError, "onImageError"); - function removeEventListeners() { - image.removeEventListener("load", onImageLoad, false); - image.removeEventListener("error", onImageError, false); - } - __name(removeEventListeners, "removeEventListeners"); - image.addEventListener("load", onImageLoad, false); - image.addEventListener("error", onImageError, false); - if (url.slice(0, 5) !== "data:") { - if (this.crossOrigin !== void 0) image.crossOrigin = this.crossOrigin; - } - scope.manager.itemStart(url); - image.src = url; - return image; - } -} -class CubeTextureLoader extends Loader { - static { - __name(this, "CubeTextureLoader"); - } - constructor(manager) { - super(manager); - } - load(urls, onLoad, onProgress, onError) { - const texture = new CubeTexture(); - texture.colorSpace = SRGBColorSpace; - const loader = new ImageLoader(this.manager); - loader.setCrossOrigin(this.crossOrigin); - loader.setPath(this.path); - let loaded = 0; - function loadTexture(i) { - loader.load(urls[i], function(image) { - texture.images[i] = image; - loaded++; - if (loaded === 6) { - texture.needsUpdate = true; - if (onLoad) onLoad(texture); - } - }, void 0, onError); - } - __name(loadTexture, "loadTexture"); - for (let i = 0; i < urls.length; ++i) { - loadTexture(i); - } - return texture; - } -} -class DataTextureLoader extends Loader { - static { - __name(this, "DataTextureLoader"); - } - constructor(manager) { - super(manager); - } - load(url, onLoad, onProgress, onError) { - const scope = this; - const texture = new DataTexture(); - const loader = new FileLoader(this.manager); - loader.setResponseType("arraybuffer"); - loader.setRequestHeader(this.requestHeader); - loader.setPath(this.path); - loader.setWithCredentials(scope.withCredentials); - loader.load(url, function(buffer) { - let texData; - try { - texData = scope.parse(buffer); - } catch (error) { - if (onError !== void 0) { - onError(error); - } else { - console.error(error); - return; - } - } - if (texData.image !== void 0) { - texture.image = texData.image; - } else if (texData.data !== void 0) { - texture.image.width = texData.width; - texture.image.height = texData.height; - texture.image.data = texData.data; - } - texture.wrapS = texData.wrapS !== void 0 ? texData.wrapS : ClampToEdgeWrapping; - texture.wrapT = texData.wrapT !== void 0 ? texData.wrapT : ClampToEdgeWrapping; - texture.magFilter = texData.magFilter !== void 0 ? texData.magFilter : LinearFilter; - texture.minFilter = texData.minFilter !== void 0 ? texData.minFilter : LinearFilter; - texture.anisotropy = texData.anisotropy !== void 0 ? texData.anisotropy : 1; - if (texData.colorSpace !== void 0) { - texture.colorSpace = texData.colorSpace; - } - if (texData.flipY !== void 0) { - texture.flipY = texData.flipY; - } - if (texData.format !== void 0) { - texture.format = texData.format; - } - if (texData.type !== void 0) { - texture.type = texData.type; - } - if (texData.mipmaps !== void 0) { - texture.mipmaps = texData.mipmaps; - texture.minFilter = LinearMipmapLinearFilter; - } - if (texData.mipmapCount === 1) { - texture.minFilter = LinearFilter; - } - if (texData.generateMipmaps !== void 0) { - texture.generateMipmaps = texData.generateMipmaps; - } - texture.needsUpdate = true; - if (onLoad) onLoad(texture, texData); - }, onProgress, onError); - return texture; - } -} -class TextureLoader extends Loader { - static { - __name(this, "TextureLoader"); - } - constructor(manager) { - super(manager); - } - load(url, onLoad, onProgress, onError) { - const texture = new Texture(); - const loader = new ImageLoader(this.manager); - loader.setCrossOrigin(this.crossOrigin); - loader.setPath(this.path); - loader.load(url, function(image) { - texture.image = image; - texture.needsUpdate = true; - if (onLoad !== void 0) { - onLoad(texture); - } - }, onProgress, onError); - return texture; - } -} -class Light extends Object3D { - static { - __name(this, "Light"); - } - constructor(color, intensity = 1) { - super(); - this.isLight = true; - this.type = "Light"; - this.color = new Color(color); - this.intensity = intensity; - } - dispose() { - } - copy(source, recursive) { - super.copy(source, recursive); - this.color.copy(source.color); - this.intensity = source.intensity; - return this; - } - toJSON(meta) { - const data = super.toJSON(meta); - data.object.color = this.color.getHex(); - data.object.intensity = this.intensity; - if (this.groundColor !== void 0) data.object.groundColor = this.groundColor.getHex(); - if (this.distance !== void 0) data.object.distance = this.distance; - if (this.angle !== void 0) data.object.angle = this.angle; - if (this.decay !== void 0) data.object.decay = this.decay; - if (this.penumbra !== void 0) data.object.penumbra = this.penumbra; - if (this.shadow !== void 0) data.object.shadow = this.shadow.toJSON(); - if (this.target !== void 0) data.object.target = this.target.uuid; - return data; - } -} -class HemisphereLight extends Light { - static { - __name(this, "HemisphereLight"); - } - constructor(skyColor, groundColor, intensity) { - super(skyColor, intensity); - this.isHemisphereLight = true; - this.type = "HemisphereLight"; - this.position.copy(Object3D.DEFAULT_UP); - this.updateMatrix(); - this.groundColor = new Color(groundColor); - } - copy(source, recursive) { - super.copy(source, recursive); - this.groundColor.copy(source.groundColor); - return this; - } -} -const _projScreenMatrix$1 = /* @__PURE__ */ new Matrix4(); -const _lightPositionWorld$1 = /* @__PURE__ */ new Vector3(); -const _lookTarget$1 = /* @__PURE__ */ new Vector3(); -class LightShadow { - static { - __name(this, "LightShadow"); - } - constructor(camera) { - this.camera = camera; - this.intensity = 1; - this.bias = 0; - this.normalBias = 0; - this.radius = 1; - this.blurSamples = 8; - this.mapSize = new Vector2(512, 512); - this.map = null; - this.mapPass = null; - this.matrix = new Matrix4(); - this.autoUpdate = true; - this.needsUpdate = false; - this._frustum = new Frustum(); - this._frameExtents = new Vector2(1, 1); - this._viewportCount = 1; - this._viewports = [ - new Vector4(0, 0, 1, 1) - ]; - } - getViewportCount() { - return this._viewportCount; - } - getFrustum() { - return this._frustum; - } - updateMatrices(light) { - const shadowCamera = this.camera; - const shadowMatrix = this.matrix; - _lightPositionWorld$1.setFromMatrixPosition(light.matrixWorld); - shadowCamera.position.copy(_lightPositionWorld$1); - _lookTarget$1.setFromMatrixPosition(light.target.matrixWorld); - shadowCamera.lookAt(_lookTarget$1); - shadowCamera.updateMatrixWorld(); - _projScreenMatrix$1.multiplyMatrices(shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse); - this._frustum.setFromProjectionMatrix(_projScreenMatrix$1); - shadowMatrix.set( - 0.5, - 0, - 0, - 0.5, - 0, - 0.5, - 0, - 0.5, - 0, - 0, - 0.5, - 0.5, - 0, - 0, - 0, - 1 - ); - shadowMatrix.multiply(_projScreenMatrix$1); - } - getViewport(viewportIndex) { - return this._viewports[viewportIndex]; - } - getFrameExtents() { - return this._frameExtents; - } - dispose() { - if (this.map) { - this.map.dispose(); - } - if (this.mapPass) { - this.mapPass.dispose(); - } - } - copy(source) { - this.camera = source.camera.clone(); - this.intensity = source.intensity; - this.bias = source.bias; - this.radius = source.radius; - this.mapSize.copy(source.mapSize); - return this; - } - clone() { - return new this.constructor().copy(this); - } - toJSON() { - const object = {}; - if (this.intensity !== 1) object.intensity = this.intensity; - if (this.bias !== 0) object.bias = this.bias; - if (this.normalBias !== 0) object.normalBias = this.normalBias; - if (this.radius !== 1) object.radius = this.radius; - if (this.mapSize.x !== 512 || this.mapSize.y !== 512) object.mapSize = this.mapSize.toArray(); - object.camera = this.camera.toJSON(false).object; - delete object.camera.matrix; - return object; - } -} -class SpotLightShadow extends LightShadow { - static { - __name(this, "SpotLightShadow"); - } - constructor() { - super(new PerspectiveCamera(50, 1, 0.5, 500)); - this.isSpotLightShadow = true; - this.focus = 1; - } - updateMatrices(light) { - const camera = this.camera; - const fov2 = RAD2DEG * 2 * light.angle * this.focus; - const aspect2 = this.mapSize.width / this.mapSize.height; - const far = light.distance || camera.far; - if (fov2 !== camera.fov || aspect2 !== camera.aspect || far !== camera.far) { - camera.fov = fov2; - camera.aspect = aspect2; - camera.far = far; - camera.updateProjectionMatrix(); - } - super.updateMatrices(light); - } - copy(source) { - super.copy(source); - this.focus = source.focus; - return this; - } -} -class SpotLight extends Light { - static { - __name(this, "SpotLight"); - } - constructor(color, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 2) { - super(color, intensity); - this.isSpotLight = true; - this.type = "SpotLight"; - this.position.copy(Object3D.DEFAULT_UP); - this.updateMatrix(); - this.target = new Object3D(); - this.distance = distance; - this.angle = angle; - this.penumbra = penumbra; - this.decay = decay; - this.map = null; - this.shadow = new SpotLightShadow(); - } - get power() { - return this.intensity * Math.PI; - } - set power(power) { - this.intensity = power / Math.PI; - } - dispose() { - this.shadow.dispose(); - } - copy(source, recursive) { - super.copy(source, recursive); - this.distance = source.distance; - this.angle = source.angle; - this.penumbra = source.penumbra; - this.decay = source.decay; - this.target = source.target.clone(); - this.shadow = source.shadow.clone(); - return this; - } -} -const _projScreenMatrix = /* @__PURE__ */ new Matrix4(); -const _lightPositionWorld = /* @__PURE__ */ new Vector3(); -const _lookTarget = /* @__PURE__ */ new Vector3(); -class PointLightShadow extends LightShadow { - static { - __name(this, "PointLightShadow"); - } - constructor() { - super(new PerspectiveCamera(90, 1, 0.5, 500)); - this.isPointLightShadow = true; - this._frameExtents = new Vector2(4, 2); - this._viewportCount = 6; - this._viewports = [ - // These viewports map a cube-map onto a 2D texture with the - // following orientation: - // - // xzXZ - // y Y - // - // X - Positive x direction - // x - Negative x direction - // Y - Positive y direction - // y - Negative y direction - // Z - Positive z direction - // z - Negative z direction - // positive X - new Vector4(2, 1, 1, 1), - // negative X - new Vector4(0, 1, 1, 1), - // positive Z - new Vector4(3, 1, 1, 1), - // negative Z - new Vector4(1, 1, 1, 1), - // positive Y - new Vector4(3, 0, 1, 1), - // negative Y - new Vector4(1, 0, 1, 1) - ]; - this._cubeDirections = [ - new Vector3(1, 0, 0), - new Vector3(-1, 0, 0), - new Vector3(0, 0, 1), - new Vector3(0, 0, -1), - new Vector3(0, 1, 0), - new Vector3(0, -1, 0) - ]; - this._cubeUps = [ - new Vector3(0, 1, 0), - new Vector3(0, 1, 0), - new Vector3(0, 1, 0), - new Vector3(0, 1, 0), - new Vector3(0, 0, 1), - new Vector3(0, 0, -1) - ]; - } - updateMatrices(light, viewportIndex = 0) { - const camera = this.camera; - const shadowMatrix = this.matrix; - const far = light.distance || camera.far; - if (far !== camera.far) { - camera.far = far; - camera.updateProjectionMatrix(); - } - _lightPositionWorld.setFromMatrixPosition(light.matrixWorld); - camera.position.copy(_lightPositionWorld); - _lookTarget.copy(camera.position); - _lookTarget.add(this._cubeDirections[viewportIndex]); - camera.up.copy(this._cubeUps[viewportIndex]); - camera.lookAt(_lookTarget); - camera.updateMatrixWorld(); - shadowMatrix.makeTranslation(-_lightPositionWorld.x, -_lightPositionWorld.y, -_lightPositionWorld.z); - _projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse); - this._frustum.setFromProjectionMatrix(_projScreenMatrix); - } -} -class PointLight extends Light { - static { - __name(this, "PointLight"); - } - constructor(color, intensity, distance = 0, decay = 2) { - super(color, intensity); - this.isPointLight = true; - this.type = "PointLight"; - this.distance = distance; - this.decay = decay; - this.shadow = new PointLightShadow(); - } - get power() { - return this.intensity * 4 * Math.PI; - } - set power(power) { - this.intensity = power / (4 * Math.PI); - } - dispose() { - this.shadow.dispose(); - } - copy(source, recursive) { - super.copy(source, recursive); - this.distance = source.distance; - this.decay = source.decay; - this.shadow = source.shadow.clone(); - return this; - } -} -class DirectionalLightShadow extends LightShadow { - static { - __name(this, "DirectionalLightShadow"); - } - constructor() { - super(new OrthographicCamera(-5, 5, 5, -5, 0.5, 500)); - this.isDirectionalLightShadow = true; - } -} -class DirectionalLight extends Light { - static { - __name(this, "DirectionalLight"); - } - constructor(color, intensity) { - super(color, intensity); - this.isDirectionalLight = true; - this.type = "DirectionalLight"; - this.position.copy(Object3D.DEFAULT_UP); - this.updateMatrix(); - this.target = new Object3D(); - this.shadow = new DirectionalLightShadow(); - } - dispose() { - this.shadow.dispose(); - } - copy(source) { - super.copy(source); - this.target = source.target.clone(); - this.shadow = source.shadow.clone(); - return this; - } -} -class AmbientLight extends Light { - static { - __name(this, "AmbientLight"); - } - constructor(color, intensity) { - super(color, intensity); - this.isAmbientLight = true; - this.type = "AmbientLight"; - } -} -class RectAreaLight extends Light { - static { - __name(this, "RectAreaLight"); - } - constructor(color, intensity, width = 10, height = 10) { - super(color, intensity); - this.isRectAreaLight = true; - this.type = "RectAreaLight"; - this.width = width; - this.height = height; - } - get power() { - return this.intensity * this.width * this.height * Math.PI; - } - set power(power) { - this.intensity = power / (this.width * this.height * Math.PI); - } - copy(source) { - super.copy(source); - this.width = source.width; - this.height = source.height; - return this; - } - toJSON(meta) { - const data = super.toJSON(meta); - data.object.width = this.width; - data.object.height = this.height; - return data; - } -} -class SphericalHarmonics3 { - static { - __name(this, "SphericalHarmonics3"); - } - constructor() { - this.isSphericalHarmonics3 = true; - this.coefficients = []; - for (let i = 0; i < 9; i++) { - this.coefficients.push(new Vector3()); - } - } - set(coefficients) { - for (let i = 0; i < 9; i++) { - this.coefficients[i].copy(coefficients[i]); - } - return this; - } - zero() { - for (let i = 0; i < 9; i++) { - this.coefficients[i].set(0, 0, 0); - } - return this; - } - // get the radiance in the direction of the normal - // target is a Vector3 - getAt(normal, target) { - const x = normal.x, y = normal.y, z = normal.z; - const coeff = this.coefficients; - target.copy(coeff[0]).multiplyScalar(0.282095); - target.addScaledVector(coeff[1], 0.488603 * y); - target.addScaledVector(coeff[2], 0.488603 * z); - target.addScaledVector(coeff[3], 0.488603 * x); - target.addScaledVector(coeff[4], 1.092548 * (x * y)); - target.addScaledVector(coeff[5], 1.092548 * (y * z)); - target.addScaledVector(coeff[6], 0.315392 * (3 * z * z - 1)); - target.addScaledVector(coeff[7], 1.092548 * (x * z)); - target.addScaledVector(coeff[8], 0.546274 * (x * x - y * y)); - return target; - } - // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal - // target is a Vector3 - // https://graphics.stanford.edu/papers/envmap/envmap.pdf - getIrradianceAt(normal, target) { - const x = normal.x, y = normal.y, z = normal.z; - const coeff = this.coefficients; - target.copy(coeff[0]).multiplyScalar(0.886227); - target.addScaledVector(coeff[1], 2 * 0.511664 * y); - target.addScaledVector(coeff[2], 2 * 0.511664 * z); - target.addScaledVector(coeff[3], 2 * 0.511664 * x); - target.addScaledVector(coeff[4], 2 * 0.429043 * x * y); - target.addScaledVector(coeff[5], 2 * 0.429043 * y * z); - target.addScaledVector(coeff[6], 0.743125 * z * z - 0.247708); - target.addScaledVector(coeff[7], 2 * 0.429043 * x * z); - target.addScaledVector(coeff[8], 0.429043 * (x * x - y * y)); - return target; - } - add(sh) { - for (let i = 0; i < 9; i++) { - this.coefficients[i].add(sh.coefficients[i]); - } - return this; - } - addScaledSH(sh, s) { - for (let i = 0; i < 9; i++) { - this.coefficients[i].addScaledVector(sh.coefficients[i], s); - } - return this; - } - scale(s) { - for (let i = 0; i < 9; i++) { - this.coefficients[i].multiplyScalar(s); - } - return this; - } - lerp(sh, alpha) { - for (let i = 0; i < 9; i++) { - this.coefficients[i].lerp(sh.coefficients[i], alpha); - } - return this; - } - equals(sh) { - for (let i = 0; i < 9; i++) { - if (!this.coefficients[i].equals(sh.coefficients[i])) { - return false; - } - } - return true; - } - copy(sh) { - return this.set(sh.coefficients); - } - clone() { - return new this.constructor().copy(this); - } - fromArray(array, offset = 0) { - const coefficients = this.coefficients; - for (let i = 0; i < 9; i++) { - coefficients[i].fromArray(array, offset + i * 3); - } - return this; - } - toArray(array = [], offset = 0) { - const coefficients = this.coefficients; - for (let i = 0; i < 9; i++) { - coefficients[i].toArray(array, offset + i * 3); - } - return array; - } - // evaluate the basis functions - // shBasis is an Array[ 9 ] - static getBasisAt(normal, shBasis) { - const x = normal.x, y = normal.y, z = normal.z; - shBasis[0] = 0.282095; - shBasis[1] = 0.488603 * y; - shBasis[2] = 0.488603 * z; - shBasis[3] = 0.488603 * x; - shBasis[4] = 1.092548 * x * y; - shBasis[5] = 1.092548 * y * z; - shBasis[6] = 0.315392 * (3 * z * z - 1); - shBasis[7] = 1.092548 * x * z; - shBasis[8] = 0.546274 * (x * x - y * y); - } -} -class LightProbe extends Light { - static { - __name(this, "LightProbe"); - } - constructor(sh = new SphericalHarmonics3(), intensity = 1) { - super(void 0, intensity); - this.isLightProbe = true; - this.sh = sh; - } - copy(source) { - super.copy(source); - this.sh.copy(source.sh); - return this; - } - fromJSON(json) { - this.intensity = json.intensity; - this.sh.fromArray(json.sh); - return this; - } - toJSON(meta) { - const data = super.toJSON(meta); - data.object.sh = this.sh.toArray(); - return data; - } -} -class MaterialLoader extends Loader { - static { - __name(this, "MaterialLoader"); - } - constructor(manager) { - super(manager); - this.textures = {}; - } - load(url, onLoad, onProgress, onError) { - const scope = this; - const loader = new FileLoader(scope.manager); - loader.setPath(scope.path); - loader.setRequestHeader(scope.requestHeader); - loader.setWithCredentials(scope.withCredentials); - loader.load(url, function(text) { - try { - onLoad(scope.parse(JSON.parse(text))); - } catch (e) { - if (onError) { - onError(e); - } else { - console.error(e); - } - scope.manager.itemError(url); - } - }, onProgress, onError); - } - parse(json) { - const textures = this.textures; - function getTexture(name) { - if (textures[name] === void 0) { - console.warn("THREE.MaterialLoader: Undefined texture", name); - } - return textures[name]; - } - __name(getTexture, "getTexture"); - const material = this.createMaterialFromType(json.type); - if (json.uuid !== void 0) material.uuid = json.uuid; - if (json.name !== void 0) material.name = json.name; - if (json.color !== void 0 && material.color !== void 0) material.color.setHex(json.color); - if (json.roughness !== void 0) material.roughness = json.roughness; - if (json.metalness !== void 0) material.metalness = json.metalness; - if (json.sheen !== void 0) material.sheen = json.sheen; - if (json.sheenColor !== void 0) material.sheenColor = new Color().setHex(json.sheenColor); - if (json.sheenRoughness !== void 0) material.sheenRoughness = json.sheenRoughness; - if (json.emissive !== void 0 && material.emissive !== void 0) material.emissive.setHex(json.emissive); - if (json.specular !== void 0 && material.specular !== void 0) material.specular.setHex(json.specular); - if (json.specularIntensity !== void 0) material.specularIntensity = json.specularIntensity; - if (json.specularColor !== void 0 && material.specularColor !== void 0) material.specularColor.setHex(json.specularColor); - if (json.shininess !== void 0) material.shininess = json.shininess; - if (json.clearcoat !== void 0) material.clearcoat = json.clearcoat; - if (json.clearcoatRoughness !== void 0) material.clearcoatRoughness = json.clearcoatRoughness; - if (json.dispersion !== void 0) material.dispersion = json.dispersion; - if (json.iridescence !== void 0) material.iridescence = json.iridescence; - if (json.iridescenceIOR !== void 0) material.iridescenceIOR = json.iridescenceIOR; - if (json.iridescenceThicknessRange !== void 0) material.iridescenceThicknessRange = json.iridescenceThicknessRange; - if (json.transmission !== void 0) material.transmission = json.transmission; - if (json.thickness !== void 0) material.thickness = json.thickness; - if (json.attenuationDistance !== void 0) material.attenuationDistance = json.attenuationDistance; - if (json.attenuationColor !== void 0 && material.attenuationColor !== void 0) material.attenuationColor.setHex(json.attenuationColor); - if (json.anisotropy !== void 0) material.anisotropy = json.anisotropy; - if (json.anisotropyRotation !== void 0) material.anisotropyRotation = json.anisotropyRotation; - if (json.fog !== void 0) material.fog = json.fog; - if (json.flatShading !== void 0) material.flatShading = json.flatShading; - if (json.blending !== void 0) material.blending = json.blending; - if (json.combine !== void 0) material.combine = json.combine; - if (json.side !== void 0) material.side = json.side; - if (json.shadowSide !== void 0) material.shadowSide = json.shadowSide; - if (json.opacity !== void 0) material.opacity = json.opacity; - if (json.transparent !== void 0) material.transparent = json.transparent; - if (json.alphaTest !== void 0) material.alphaTest = json.alphaTest; - if (json.alphaHash !== void 0) material.alphaHash = json.alphaHash; - if (json.depthFunc !== void 0) material.depthFunc = json.depthFunc; - if (json.depthTest !== void 0) material.depthTest = json.depthTest; - if (json.depthWrite !== void 0) material.depthWrite = json.depthWrite; - if (json.colorWrite !== void 0) material.colorWrite = json.colorWrite; - if (json.blendSrc !== void 0) material.blendSrc = json.blendSrc; - if (json.blendDst !== void 0) material.blendDst = json.blendDst; - if (json.blendEquation !== void 0) material.blendEquation = json.blendEquation; - if (json.blendSrcAlpha !== void 0) material.blendSrcAlpha = json.blendSrcAlpha; - if (json.blendDstAlpha !== void 0) material.blendDstAlpha = json.blendDstAlpha; - if (json.blendEquationAlpha !== void 0) material.blendEquationAlpha = json.blendEquationAlpha; - if (json.blendColor !== void 0 && material.blendColor !== void 0) material.blendColor.setHex(json.blendColor); - if (json.blendAlpha !== void 0) material.blendAlpha = json.blendAlpha; - if (json.stencilWriteMask !== void 0) material.stencilWriteMask = json.stencilWriteMask; - if (json.stencilFunc !== void 0) material.stencilFunc = json.stencilFunc; - if (json.stencilRef !== void 0) material.stencilRef = json.stencilRef; - if (json.stencilFuncMask !== void 0) material.stencilFuncMask = json.stencilFuncMask; - if (json.stencilFail !== void 0) material.stencilFail = json.stencilFail; - if (json.stencilZFail !== void 0) material.stencilZFail = json.stencilZFail; - if (json.stencilZPass !== void 0) material.stencilZPass = json.stencilZPass; - if (json.stencilWrite !== void 0) material.stencilWrite = json.stencilWrite; - if (json.wireframe !== void 0) material.wireframe = json.wireframe; - if (json.wireframeLinewidth !== void 0) material.wireframeLinewidth = json.wireframeLinewidth; - if (json.wireframeLinecap !== void 0) material.wireframeLinecap = json.wireframeLinecap; - if (json.wireframeLinejoin !== void 0) material.wireframeLinejoin = json.wireframeLinejoin; - if (json.rotation !== void 0) material.rotation = json.rotation; - if (json.linewidth !== void 0) material.linewidth = json.linewidth; - if (json.dashSize !== void 0) material.dashSize = json.dashSize; - if (json.gapSize !== void 0) material.gapSize = json.gapSize; - if (json.scale !== void 0) material.scale = json.scale; - if (json.polygonOffset !== void 0) material.polygonOffset = json.polygonOffset; - if (json.polygonOffsetFactor !== void 0) material.polygonOffsetFactor = json.polygonOffsetFactor; - if (json.polygonOffsetUnits !== void 0) material.polygonOffsetUnits = json.polygonOffsetUnits; - if (json.dithering !== void 0) material.dithering = json.dithering; - if (json.alphaToCoverage !== void 0) material.alphaToCoverage = json.alphaToCoverage; - if (json.premultipliedAlpha !== void 0) material.premultipliedAlpha = json.premultipliedAlpha; - if (json.forceSinglePass !== void 0) material.forceSinglePass = json.forceSinglePass; - if (json.visible !== void 0) material.visible = json.visible; - if (json.toneMapped !== void 0) material.toneMapped = json.toneMapped; - if (json.userData !== void 0) material.userData = json.userData; - if (json.vertexColors !== void 0) { - if (typeof json.vertexColors === "number") { - material.vertexColors = json.vertexColors > 0 ? true : false; - } else { - material.vertexColors = json.vertexColors; - } - } - if (json.uniforms !== void 0) { - for (const name in json.uniforms) { - const uniform = json.uniforms[name]; - material.uniforms[name] = {}; - switch (uniform.type) { - case "t": - material.uniforms[name].value = getTexture(uniform.value); - break; - case "c": - material.uniforms[name].value = new Color().setHex(uniform.value); - break; - case "v2": - material.uniforms[name].value = new Vector2().fromArray(uniform.value); - break; - case "v3": - material.uniforms[name].value = new Vector3().fromArray(uniform.value); - break; - case "v4": - material.uniforms[name].value = new Vector4().fromArray(uniform.value); - break; - case "m3": - material.uniforms[name].value = new Matrix3().fromArray(uniform.value); - break; - case "m4": - material.uniforms[name].value = new Matrix4().fromArray(uniform.value); - break; - default: - material.uniforms[name].value = uniform.value; - } - } - } - if (json.defines !== void 0) material.defines = json.defines; - if (json.vertexShader !== void 0) material.vertexShader = json.vertexShader; - if (json.fragmentShader !== void 0) material.fragmentShader = json.fragmentShader; - if (json.glslVersion !== void 0) material.glslVersion = json.glslVersion; - if (json.extensions !== void 0) { - for (const key in json.extensions) { - material.extensions[key] = json.extensions[key]; - } - } - if (json.lights !== void 0) material.lights = json.lights; - if (json.clipping !== void 0) material.clipping = json.clipping; - if (json.size !== void 0) material.size = json.size; - if (json.sizeAttenuation !== void 0) material.sizeAttenuation = json.sizeAttenuation; - if (json.map !== void 0) material.map = getTexture(json.map); - if (json.matcap !== void 0) material.matcap = getTexture(json.matcap); - if (json.alphaMap !== void 0) material.alphaMap = getTexture(json.alphaMap); - if (json.bumpMap !== void 0) material.bumpMap = getTexture(json.bumpMap); - if (json.bumpScale !== void 0) material.bumpScale = json.bumpScale; - if (json.normalMap !== void 0) material.normalMap = getTexture(json.normalMap); - if (json.normalMapType !== void 0) material.normalMapType = json.normalMapType; - if (json.normalScale !== void 0) { - let normalScale = json.normalScale; - if (Array.isArray(normalScale) === false) { - normalScale = [normalScale, normalScale]; - } - material.normalScale = new Vector2().fromArray(normalScale); - } - if (json.displacementMap !== void 0) material.displacementMap = getTexture(json.displacementMap); - if (json.displacementScale !== void 0) material.displacementScale = json.displacementScale; - if (json.displacementBias !== void 0) material.displacementBias = json.displacementBias; - if (json.roughnessMap !== void 0) material.roughnessMap = getTexture(json.roughnessMap); - if (json.metalnessMap !== void 0) material.metalnessMap = getTexture(json.metalnessMap); - if (json.emissiveMap !== void 0) material.emissiveMap = getTexture(json.emissiveMap); - if (json.emissiveIntensity !== void 0) material.emissiveIntensity = json.emissiveIntensity; - if (json.specularMap !== void 0) material.specularMap = getTexture(json.specularMap); - if (json.specularIntensityMap !== void 0) material.specularIntensityMap = getTexture(json.specularIntensityMap); - if (json.specularColorMap !== void 0) material.specularColorMap = getTexture(json.specularColorMap); - if (json.envMap !== void 0) material.envMap = getTexture(json.envMap); - if (json.envMapRotation !== void 0) material.envMapRotation.fromArray(json.envMapRotation); - if (json.envMapIntensity !== void 0) material.envMapIntensity = json.envMapIntensity; - if (json.reflectivity !== void 0) material.reflectivity = json.reflectivity; - if (json.refractionRatio !== void 0) material.refractionRatio = json.refractionRatio; - if (json.lightMap !== void 0) material.lightMap = getTexture(json.lightMap); - if (json.lightMapIntensity !== void 0) material.lightMapIntensity = json.lightMapIntensity; - if (json.aoMap !== void 0) material.aoMap = getTexture(json.aoMap); - if (json.aoMapIntensity !== void 0) material.aoMapIntensity = json.aoMapIntensity; - if (json.gradientMap !== void 0) material.gradientMap = getTexture(json.gradientMap); - if (json.clearcoatMap !== void 0) material.clearcoatMap = getTexture(json.clearcoatMap); - if (json.clearcoatRoughnessMap !== void 0) material.clearcoatRoughnessMap = getTexture(json.clearcoatRoughnessMap); - if (json.clearcoatNormalMap !== void 0) material.clearcoatNormalMap = getTexture(json.clearcoatNormalMap); - if (json.clearcoatNormalScale !== void 0) material.clearcoatNormalScale = new Vector2().fromArray(json.clearcoatNormalScale); - if (json.iridescenceMap !== void 0) material.iridescenceMap = getTexture(json.iridescenceMap); - if (json.iridescenceThicknessMap !== void 0) material.iridescenceThicknessMap = getTexture(json.iridescenceThicknessMap); - if (json.transmissionMap !== void 0) material.transmissionMap = getTexture(json.transmissionMap); - if (json.thicknessMap !== void 0) material.thicknessMap = getTexture(json.thicknessMap); - if (json.anisotropyMap !== void 0) material.anisotropyMap = getTexture(json.anisotropyMap); - if (json.sheenColorMap !== void 0) material.sheenColorMap = getTexture(json.sheenColorMap); - if (json.sheenRoughnessMap !== void 0) material.sheenRoughnessMap = getTexture(json.sheenRoughnessMap); - return material; - } - setTextures(value) { - this.textures = value; - return this; - } - createMaterialFromType(type) { - return MaterialLoader.createMaterialFromType(type); - } - static createMaterialFromType(type) { - const materialLib = { - ShadowMaterial, - SpriteMaterial, - RawShaderMaterial, - ShaderMaterial, - PointsMaterial, - MeshPhysicalMaterial, - MeshStandardMaterial, - MeshPhongMaterial, - MeshToonMaterial, - MeshNormalMaterial, - MeshLambertMaterial, - MeshDepthMaterial, - MeshDistanceMaterial, - MeshBasicMaterial, - MeshMatcapMaterial, - LineDashedMaterial, - LineBasicMaterial, - Material - }; - return new materialLib[type](); - } -} -class LoaderUtils { - static { - __name(this, "LoaderUtils"); - } - static decodeText(array) { - console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."); - if (typeof TextDecoder !== "undefined") { - return new TextDecoder().decode(array); - } - let s = ""; - for (let i = 0, il = array.length; i < il; i++) { - s += String.fromCharCode(array[i]); - } - try { - return decodeURIComponent(escape(s)); - } catch (e) { - return s; - } - } - static extractUrlBase(url) { - const index = url.lastIndexOf("/"); - if (index === -1) return "./"; - return url.slice(0, index + 1); - } - static resolveURL(url, path) { - if (typeof url !== "string" || url === "") return ""; - if (/^https?:\/\//i.test(path) && /^\//.test(url)) { - path = path.replace(/(^https?:\/\/[^\/]+).*/i, "$1"); - } - if (/^(https?:)?\/\//i.test(url)) return url; - if (/^data:.*,.*$/i.test(url)) return url; - if (/^blob:.*$/i.test(url)) return url; - return path + url; - } -} -class InstancedBufferGeometry extends BufferGeometry { - static { - __name(this, "InstancedBufferGeometry"); - } - constructor() { - super(); - this.isInstancedBufferGeometry = true; - this.type = "InstancedBufferGeometry"; - this.instanceCount = Infinity; - } - copy(source) { - super.copy(source); - this.instanceCount = source.instanceCount; - return this; - } - toJSON() { - const data = super.toJSON(); - data.instanceCount = this.instanceCount; - data.isInstancedBufferGeometry = true; - return data; - } -} -class BufferGeometryLoader extends Loader { - static { - __name(this, "BufferGeometryLoader"); - } - constructor(manager) { - super(manager); - } - load(url, onLoad, onProgress, onError) { - const scope = this; - const loader = new FileLoader(scope.manager); - loader.setPath(scope.path); - loader.setRequestHeader(scope.requestHeader); - loader.setWithCredentials(scope.withCredentials); - loader.load(url, function(text) { - try { - onLoad(scope.parse(JSON.parse(text))); - } catch (e) { - if (onError) { - onError(e); - } else { - console.error(e); - } - scope.manager.itemError(url); - } - }, onProgress, onError); - } - parse(json) { - const interleavedBufferMap = {}; - const arrayBufferMap = {}; - function getInterleavedBuffer(json2, uuid) { - if (interleavedBufferMap[uuid] !== void 0) return interleavedBufferMap[uuid]; - const interleavedBuffers = json2.interleavedBuffers; - const interleavedBuffer = interleavedBuffers[uuid]; - const buffer = getArrayBuffer(json2, interleavedBuffer.buffer); - const array = getTypedArray(interleavedBuffer.type, buffer); - const ib = new InterleavedBuffer(array, interleavedBuffer.stride); - ib.uuid = interleavedBuffer.uuid; - interleavedBufferMap[uuid] = ib; - return ib; - } - __name(getInterleavedBuffer, "getInterleavedBuffer"); - function getArrayBuffer(json2, uuid) { - if (arrayBufferMap[uuid] !== void 0) return arrayBufferMap[uuid]; - const arrayBuffers = json2.arrayBuffers; - const arrayBuffer = arrayBuffers[uuid]; - const ab = new Uint32Array(arrayBuffer).buffer; - arrayBufferMap[uuid] = ab; - return ab; - } - __name(getArrayBuffer, "getArrayBuffer"); - const geometry = json.isInstancedBufferGeometry ? new InstancedBufferGeometry() : new BufferGeometry(); - const index = json.data.index; - if (index !== void 0) { - const typedArray = getTypedArray(index.type, index.array); - geometry.setIndex(new BufferAttribute(typedArray, 1)); - } - const attributes = json.data.attributes; - for (const key in attributes) { - const attribute = attributes[key]; - let bufferAttribute; - if (attribute.isInterleavedBufferAttribute) { - const interleavedBuffer = getInterleavedBuffer(json.data, attribute.data); - bufferAttribute = new InterleavedBufferAttribute(interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized); - } else { - const typedArray = getTypedArray(attribute.type, attribute.array); - const bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute; - bufferAttribute = new bufferAttributeConstr(typedArray, attribute.itemSize, attribute.normalized); - } - if (attribute.name !== void 0) bufferAttribute.name = attribute.name; - if (attribute.usage !== void 0) bufferAttribute.setUsage(attribute.usage); - geometry.setAttribute(key, bufferAttribute); - } - const morphAttributes = json.data.morphAttributes; - if (morphAttributes) { - for (const key in morphAttributes) { - const attributeArray = morphAttributes[key]; - const array = []; - for (let i = 0, il = attributeArray.length; i < il; i++) { - const attribute = attributeArray[i]; - let bufferAttribute; - if (attribute.isInterleavedBufferAttribute) { - const interleavedBuffer = getInterleavedBuffer(json.data, attribute.data); - bufferAttribute = new InterleavedBufferAttribute(interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized); - } else { - const typedArray = getTypedArray(attribute.type, attribute.array); - bufferAttribute = new BufferAttribute(typedArray, attribute.itemSize, attribute.normalized); - } - if (attribute.name !== void 0) bufferAttribute.name = attribute.name; - array.push(bufferAttribute); - } - geometry.morphAttributes[key] = array; - } - } - const morphTargetsRelative = json.data.morphTargetsRelative; - if (morphTargetsRelative) { - geometry.morphTargetsRelative = true; - } - const groups = json.data.groups || json.data.drawcalls || json.data.offsets; - if (groups !== void 0) { - for (let i = 0, n = groups.length; i !== n; ++i) { - const group = groups[i]; - geometry.addGroup(group.start, group.count, group.materialIndex); - } - } - const boundingSphere = json.data.boundingSphere; - if (boundingSphere !== void 0) { - const center = new Vector3(); - if (boundingSphere.center !== void 0) { - center.fromArray(boundingSphere.center); - } - geometry.boundingSphere = new Sphere(center, boundingSphere.radius); - } - if (json.name) geometry.name = json.name; - if (json.userData) geometry.userData = json.userData; - return geometry; - } -} -class ObjectLoader extends Loader { - static { - __name(this, "ObjectLoader"); - } - constructor(manager) { - super(manager); - } - load(url, onLoad, onProgress, onError) { - const scope = this; - const path = this.path === "" ? LoaderUtils.extractUrlBase(url) : this.path; - this.resourcePath = this.resourcePath || path; - const loader = new FileLoader(this.manager); - loader.setPath(this.path); - loader.setRequestHeader(this.requestHeader); - loader.setWithCredentials(this.withCredentials); - loader.load(url, function(text) { - let json = null; - try { - json = JSON.parse(text); - } catch (error) { - if (onError !== void 0) onError(error); - console.error("THREE:ObjectLoader: Can't parse " + url + ".", error.message); - return; - } - const metadata = json.metadata; - if (metadata === void 0 || metadata.type === void 0 || metadata.type.toLowerCase() === "geometry") { - if (onError !== void 0) onError(new Error("THREE.ObjectLoader: Can't load " + url)); - console.error("THREE.ObjectLoader: Can't load " + url); - return; - } - scope.parse(json, onLoad); - }, onProgress, onError); - } - async loadAsync(url, onProgress) { - const scope = this; - const path = this.path === "" ? LoaderUtils.extractUrlBase(url) : this.path; - this.resourcePath = this.resourcePath || path; - const loader = new FileLoader(this.manager); - loader.setPath(this.path); - loader.setRequestHeader(this.requestHeader); - loader.setWithCredentials(this.withCredentials); - const text = await loader.loadAsync(url, onProgress); - const json = JSON.parse(text); - const metadata = json.metadata; - if (metadata === void 0 || metadata.type === void 0 || metadata.type.toLowerCase() === "geometry") { - throw new Error("THREE.ObjectLoader: Can't load " + url); - } - return await scope.parseAsync(json); - } - parse(json, onLoad) { - const animations = this.parseAnimations(json.animations); - const shapes = this.parseShapes(json.shapes); - const geometries = this.parseGeometries(json.geometries, shapes); - const images = this.parseImages(json.images, function() { - if (onLoad !== void 0) onLoad(object); - }); - const textures = this.parseTextures(json.textures, images); - const materials = this.parseMaterials(json.materials, textures); - const object = this.parseObject(json.object, geometries, materials, textures, animations); - const skeletons = this.parseSkeletons(json.skeletons, object); - this.bindSkeletons(object, skeletons); - this.bindLightTargets(object); - if (onLoad !== void 0) { - let hasImages = false; - for (const uuid in images) { - if (images[uuid].data instanceof HTMLImageElement) { - hasImages = true; - break; - } - } - if (hasImages === false) onLoad(object); - } - return object; - } - async parseAsync(json) { - const animations = this.parseAnimations(json.animations); - const shapes = this.parseShapes(json.shapes); - const geometries = this.parseGeometries(json.geometries, shapes); - const images = await this.parseImagesAsync(json.images); - const textures = this.parseTextures(json.textures, images); - const materials = this.parseMaterials(json.materials, textures); - const object = this.parseObject(json.object, geometries, materials, textures, animations); - const skeletons = this.parseSkeletons(json.skeletons, object); - this.bindSkeletons(object, skeletons); - this.bindLightTargets(object); - return object; - } - parseShapes(json) { - const shapes = {}; - if (json !== void 0) { - for (let i = 0, l = json.length; i < l; i++) { - const shape = new Shape().fromJSON(json[i]); - shapes[shape.uuid] = shape; - } - } - return shapes; - } - parseSkeletons(json, object) { - const skeletons = {}; - const bones = {}; - object.traverse(function(child) { - if (child.isBone) bones[child.uuid] = child; - }); - if (json !== void 0) { - for (let i = 0, l = json.length; i < l; i++) { - const skeleton = new Skeleton().fromJSON(json[i], bones); - skeletons[skeleton.uuid] = skeleton; - } - } - return skeletons; - } - parseGeometries(json, shapes) { - const geometries = {}; - if (json !== void 0) { - const bufferGeometryLoader = new BufferGeometryLoader(); - for (let i = 0, l = json.length; i < l; i++) { - let geometry; - const data = json[i]; - switch (data.type) { - case "BufferGeometry": - case "InstancedBufferGeometry": - geometry = bufferGeometryLoader.parse(data); - break; - default: - if (data.type in Geometries) { - geometry = Geometries[data.type].fromJSON(data, shapes); - } else { - console.warn(`THREE.ObjectLoader: Unsupported geometry type "${data.type}"`); - } - } - geometry.uuid = data.uuid; - if (data.name !== void 0) geometry.name = data.name; - if (data.userData !== void 0) geometry.userData = data.userData; - geometries[data.uuid] = geometry; - } - } - return geometries; - } - parseMaterials(json, textures) { - const cache = {}; - const materials = {}; - if (json !== void 0) { - const loader = new MaterialLoader(); - loader.setTextures(textures); - for (let i = 0, l = json.length; i < l; i++) { - const data = json[i]; - if (cache[data.uuid] === void 0) { - cache[data.uuid] = loader.parse(data); - } - materials[data.uuid] = cache[data.uuid]; - } - } - return materials; - } - parseAnimations(json) { - const animations = {}; - if (json !== void 0) { - for (let i = 0; i < json.length; i++) { - const data = json[i]; - const clip = AnimationClip.parse(data); - animations[clip.uuid] = clip; - } - } - return animations; - } - parseImages(json, onLoad) { - const scope = this; - const images = {}; - let loader; - function loadImage2(url) { - scope.manager.itemStart(url); - return loader.load(url, function() { - scope.manager.itemEnd(url); - }, void 0, function() { - scope.manager.itemError(url); - scope.manager.itemEnd(url); - }); - } - __name(loadImage2, "loadImage"); - function deserializeImage(image) { - if (typeof image === "string") { - const url = image; - const path = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(url) ? url : scope.resourcePath + url; - return loadImage2(path); - } else { - if (image.data) { - return { - data: getTypedArray(image.type, image.data), - width: image.width, - height: image.height - }; - } else { - return null; - } - } - } - __name(deserializeImage, "deserializeImage"); - if (json !== void 0 && json.length > 0) { - const manager = new LoadingManager(onLoad); - loader = new ImageLoader(manager); - loader.setCrossOrigin(this.crossOrigin); - for (let i = 0, il = json.length; i < il; i++) { - const image = json[i]; - const url = image.url; - if (Array.isArray(url)) { - const imageArray = []; - for (let j = 0, jl = url.length; j < jl; j++) { - const currentUrl = url[j]; - const deserializedImage = deserializeImage(currentUrl); - if (deserializedImage !== null) { - if (deserializedImage instanceof HTMLImageElement) { - imageArray.push(deserializedImage); - } else { - imageArray.push(new DataTexture(deserializedImage.data, deserializedImage.width, deserializedImage.height)); - } - } - } - images[image.uuid] = new Source(imageArray); - } else { - const deserializedImage = deserializeImage(image.url); - images[image.uuid] = new Source(deserializedImage); - } - } - } - return images; - } - async parseImagesAsync(json) { - const scope = this; - const images = {}; - let loader; - async function deserializeImage(image) { - if (typeof image === "string") { - const url = image; - const path = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(url) ? url : scope.resourcePath + url; - return await loader.loadAsync(path); - } else { - if (image.data) { - return { - data: getTypedArray(image.type, image.data), - width: image.width, - height: image.height - }; - } else { - return null; - } - } - } - __name(deserializeImage, "deserializeImage"); - if (json !== void 0 && json.length > 0) { - loader = new ImageLoader(this.manager); - loader.setCrossOrigin(this.crossOrigin); - for (let i = 0, il = json.length; i < il; i++) { - const image = json[i]; - const url = image.url; - if (Array.isArray(url)) { - const imageArray = []; - for (let j = 0, jl = url.length; j < jl; j++) { - const currentUrl = url[j]; - const deserializedImage = await deserializeImage(currentUrl); - if (deserializedImage !== null) { - if (deserializedImage instanceof HTMLImageElement) { - imageArray.push(deserializedImage); - } else { - imageArray.push(new DataTexture(deserializedImage.data, deserializedImage.width, deserializedImage.height)); - } - } - } - images[image.uuid] = new Source(imageArray); - } else { - const deserializedImage = await deserializeImage(image.url); - images[image.uuid] = new Source(deserializedImage); - } - } - } - return images; - } - parseTextures(json, images) { - function parseConstant(value, type) { - if (typeof value === "number") return value; - console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", value); - return type[value]; - } - __name(parseConstant, "parseConstant"); - const textures = {}; - if (json !== void 0) { - for (let i = 0, l = json.length; i < l; i++) { - const data = json[i]; - if (data.image === void 0) { - console.warn('THREE.ObjectLoader: No "image" specified for', data.uuid); - } - if (images[data.image] === void 0) { - console.warn("THREE.ObjectLoader: Undefined image", data.image); - } - const source = images[data.image]; - const image = source.data; - let texture; - if (Array.isArray(image)) { - texture = new CubeTexture(); - if (image.length === 6) texture.needsUpdate = true; - } else { - if (image && image.data) { - texture = new DataTexture(); - } else { - texture = new Texture(); - } - if (image) texture.needsUpdate = true; - } - texture.source = source; - texture.uuid = data.uuid; - if (data.name !== void 0) texture.name = data.name; - if (data.mapping !== void 0) texture.mapping = parseConstant(data.mapping, TEXTURE_MAPPING); - if (data.channel !== void 0) texture.channel = data.channel; - if (data.offset !== void 0) texture.offset.fromArray(data.offset); - if (data.repeat !== void 0) texture.repeat.fromArray(data.repeat); - if (data.center !== void 0) texture.center.fromArray(data.center); - if (data.rotation !== void 0) texture.rotation = data.rotation; - if (data.wrap !== void 0) { - texture.wrapS = parseConstant(data.wrap[0], TEXTURE_WRAPPING); - texture.wrapT = parseConstant(data.wrap[1], TEXTURE_WRAPPING); - } - if (data.format !== void 0) texture.format = data.format; - if (data.internalFormat !== void 0) texture.internalFormat = data.internalFormat; - if (data.type !== void 0) texture.type = data.type; - if (data.colorSpace !== void 0) texture.colorSpace = data.colorSpace; - if (data.minFilter !== void 0) texture.minFilter = parseConstant(data.minFilter, TEXTURE_FILTER); - if (data.magFilter !== void 0) texture.magFilter = parseConstant(data.magFilter, TEXTURE_FILTER); - if (data.anisotropy !== void 0) texture.anisotropy = data.anisotropy; - if (data.flipY !== void 0) texture.flipY = data.flipY; - if (data.generateMipmaps !== void 0) texture.generateMipmaps = data.generateMipmaps; - if (data.premultiplyAlpha !== void 0) texture.premultiplyAlpha = data.premultiplyAlpha; - if (data.unpackAlignment !== void 0) texture.unpackAlignment = data.unpackAlignment; - if (data.compareFunction !== void 0) texture.compareFunction = data.compareFunction; - if (data.userData !== void 0) texture.userData = data.userData; - textures[data.uuid] = texture; - } - } - return textures; - } - parseObject(data, geometries, materials, textures, animations) { - let object; - function getGeometry(name) { - if (geometries[name] === void 0) { - console.warn("THREE.ObjectLoader: Undefined geometry", name); - } - return geometries[name]; - } - __name(getGeometry, "getGeometry"); - function getMaterial(name) { - if (name === void 0) return void 0; - if (Array.isArray(name)) { - const array = []; - for (let i = 0, l = name.length; i < l; i++) { - const uuid = name[i]; - if (materials[uuid] === void 0) { - console.warn("THREE.ObjectLoader: Undefined material", uuid); - } - array.push(materials[uuid]); - } - return array; - } - if (materials[name] === void 0) { - console.warn("THREE.ObjectLoader: Undefined material", name); - } - return materials[name]; - } - __name(getMaterial, "getMaterial"); - function getTexture(uuid) { - if (textures[uuid] === void 0) { - console.warn("THREE.ObjectLoader: Undefined texture", uuid); - } - return textures[uuid]; - } - __name(getTexture, "getTexture"); - let geometry, material; - switch (data.type) { - case "Scene": - object = new Scene(); - if (data.background !== void 0) { - if (Number.isInteger(data.background)) { - object.background = new Color(data.background); - } else { - object.background = getTexture(data.background); - } - } - if (data.environment !== void 0) { - object.environment = getTexture(data.environment); - } - if (data.fog !== void 0) { - if (data.fog.type === "Fog") { - object.fog = new Fog(data.fog.color, data.fog.near, data.fog.far); - } else if (data.fog.type === "FogExp2") { - object.fog = new FogExp2(data.fog.color, data.fog.density); - } - if (data.fog.name !== "") { - object.fog.name = data.fog.name; - } - } - if (data.backgroundBlurriness !== void 0) object.backgroundBlurriness = data.backgroundBlurriness; - if (data.backgroundIntensity !== void 0) object.backgroundIntensity = data.backgroundIntensity; - if (data.backgroundRotation !== void 0) object.backgroundRotation.fromArray(data.backgroundRotation); - if (data.environmentIntensity !== void 0) object.environmentIntensity = data.environmentIntensity; - if (data.environmentRotation !== void 0) object.environmentRotation.fromArray(data.environmentRotation); - break; - case "PerspectiveCamera": - object = new PerspectiveCamera(data.fov, data.aspect, data.near, data.far); - if (data.focus !== void 0) object.focus = data.focus; - if (data.zoom !== void 0) object.zoom = data.zoom; - if (data.filmGauge !== void 0) object.filmGauge = data.filmGauge; - if (data.filmOffset !== void 0) object.filmOffset = data.filmOffset; - if (data.view !== void 0) object.view = Object.assign({}, data.view); - break; - case "OrthographicCamera": - object = new OrthographicCamera(data.left, data.right, data.top, data.bottom, data.near, data.far); - if (data.zoom !== void 0) object.zoom = data.zoom; - if (data.view !== void 0) object.view = Object.assign({}, data.view); - break; - case "AmbientLight": - object = new AmbientLight(data.color, data.intensity); - break; - case "DirectionalLight": - object = new DirectionalLight(data.color, data.intensity); - object.target = data.target || ""; - break; - case "PointLight": - object = new PointLight(data.color, data.intensity, data.distance, data.decay); - break; - case "RectAreaLight": - object = new RectAreaLight(data.color, data.intensity, data.width, data.height); - break; - case "SpotLight": - object = new SpotLight(data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay); - object.target = data.target || ""; - break; - case "HemisphereLight": - object = new HemisphereLight(data.color, data.groundColor, data.intensity); - break; - case "LightProbe": - object = new LightProbe().fromJSON(data); - break; - case "SkinnedMesh": - geometry = getGeometry(data.geometry); - material = getMaterial(data.material); - object = new SkinnedMesh(geometry, material); - if (data.bindMode !== void 0) object.bindMode = data.bindMode; - if (data.bindMatrix !== void 0) object.bindMatrix.fromArray(data.bindMatrix); - if (data.skeleton !== void 0) object.skeleton = data.skeleton; - break; - case "Mesh": - geometry = getGeometry(data.geometry); - material = getMaterial(data.material); - object = new Mesh(geometry, material); - break; - case "InstancedMesh": - geometry = getGeometry(data.geometry); - material = getMaterial(data.material); - const count = data.count; - const instanceMatrix = data.instanceMatrix; - const instanceColor = data.instanceColor; - object = new InstancedMesh(geometry, material, count); - object.instanceMatrix = new InstancedBufferAttribute(new Float32Array(instanceMatrix.array), 16); - if (instanceColor !== void 0) object.instanceColor = new InstancedBufferAttribute(new Float32Array(instanceColor.array), instanceColor.itemSize); - break; - case "BatchedMesh": - geometry = getGeometry(data.geometry); - material = getMaterial(data.material); - object = new BatchedMesh(data.maxInstanceCount, data.maxVertexCount, data.maxIndexCount, material); - object.geometry = geometry; - object.perObjectFrustumCulled = data.perObjectFrustumCulled; - object.sortObjects = data.sortObjects; - object._drawRanges = data.drawRanges; - object._reservedRanges = data.reservedRanges; - object._visibility = data.visibility; - object._active = data.active; - object._bounds = data.bounds.map((bound) => { - const box = new Box3(); - box.min.fromArray(bound.boxMin); - box.max.fromArray(bound.boxMax); - const sphere = new Sphere(); - sphere.radius = bound.sphereRadius; - sphere.center.fromArray(bound.sphereCenter); - return { - boxInitialized: bound.boxInitialized, - box, - sphereInitialized: bound.sphereInitialized, - sphere - }; - }); - object._maxInstanceCount = data.maxInstanceCount; - object._maxVertexCount = data.maxVertexCount; - object._maxIndexCount = data.maxIndexCount; - object._geometryInitialized = data.geometryInitialized; - object._geometryCount = data.geometryCount; - object._matricesTexture = getTexture(data.matricesTexture.uuid); - if (data.colorsTexture !== void 0) object._colorsTexture = getTexture(data.colorsTexture.uuid); - break; - case "LOD": - object = new LOD(); - break; - case "Line": - object = new Line(getGeometry(data.geometry), getMaterial(data.material)); - break; - case "LineLoop": - object = new LineLoop(getGeometry(data.geometry), getMaterial(data.material)); - break; - case "LineSegments": - object = new LineSegments(getGeometry(data.geometry), getMaterial(data.material)); - break; - case "PointCloud": - case "Points": - object = new Points(getGeometry(data.geometry), getMaterial(data.material)); - break; - case "Sprite": - object = new Sprite(getMaterial(data.material)); - break; - case "Group": - object = new Group(); - break; - case "Bone": - object = new Bone(); - break; - default: - object = new Object3D(); - } - object.uuid = data.uuid; - if (data.name !== void 0) object.name = data.name; - if (data.matrix !== void 0) { - object.matrix.fromArray(data.matrix); - if (data.matrixAutoUpdate !== void 0) object.matrixAutoUpdate = data.matrixAutoUpdate; - if (object.matrixAutoUpdate) object.matrix.decompose(object.position, object.quaternion, object.scale); - } else { - if (data.position !== void 0) object.position.fromArray(data.position); - if (data.rotation !== void 0) object.rotation.fromArray(data.rotation); - if (data.quaternion !== void 0) object.quaternion.fromArray(data.quaternion); - if (data.scale !== void 0) object.scale.fromArray(data.scale); - } - if (data.up !== void 0) object.up.fromArray(data.up); - if (data.castShadow !== void 0) object.castShadow = data.castShadow; - if (data.receiveShadow !== void 0) object.receiveShadow = data.receiveShadow; - if (data.shadow) { - if (data.shadow.intensity !== void 0) object.shadow.intensity = data.shadow.intensity; - if (data.shadow.bias !== void 0) object.shadow.bias = data.shadow.bias; - if (data.shadow.normalBias !== void 0) object.shadow.normalBias = data.shadow.normalBias; - if (data.shadow.radius !== void 0) object.shadow.radius = data.shadow.radius; - if (data.shadow.mapSize !== void 0) object.shadow.mapSize.fromArray(data.shadow.mapSize); - if (data.shadow.camera !== void 0) object.shadow.camera = this.parseObject(data.shadow.camera); - } - if (data.visible !== void 0) object.visible = data.visible; - if (data.frustumCulled !== void 0) object.frustumCulled = data.frustumCulled; - if (data.renderOrder !== void 0) object.renderOrder = data.renderOrder; - if (data.userData !== void 0) object.userData = data.userData; - if (data.layers !== void 0) object.layers.mask = data.layers; - if (data.children !== void 0) { - const children = data.children; - for (let i = 0; i < children.length; i++) { - object.add(this.parseObject(children[i], geometries, materials, textures, animations)); - } - } - if (data.animations !== void 0) { - const objectAnimations = data.animations; - for (let i = 0; i < objectAnimations.length; i++) { - const uuid = objectAnimations[i]; - object.animations.push(animations[uuid]); - } - } - if (data.type === "LOD") { - if (data.autoUpdate !== void 0) object.autoUpdate = data.autoUpdate; - const levels = data.levels; - for (let l = 0; l < levels.length; l++) { - const level = levels[l]; - const child = object.getObjectByProperty("uuid", level.object); - if (child !== void 0) { - object.addLevel(child, level.distance, level.hysteresis); - } - } - } - return object; - } - bindSkeletons(object, skeletons) { - if (Object.keys(skeletons).length === 0) return; - object.traverse(function(child) { - if (child.isSkinnedMesh === true && child.skeleton !== void 0) { - const skeleton = skeletons[child.skeleton]; - if (skeleton === void 0) { - console.warn("THREE.ObjectLoader: No skeleton found with UUID:", child.skeleton); - } else { - child.bind(skeleton, child.bindMatrix); - } - } - }); - } - bindLightTargets(object) { - object.traverse(function(child) { - if (child.isDirectionalLight || child.isSpotLight) { - const uuid = child.target; - const target = object.getObjectByProperty("uuid", uuid); - if (target !== void 0) { - child.target = target; - } else { - child.target = new Object3D(); - } - } - }); - } -} -const TEXTURE_MAPPING = { - UVMapping, - CubeReflectionMapping, - CubeRefractionMapping, - EquirectangularReflectionMapping, - EquirectangularRefractionMapping, - CubeUVReflectionMapping -}; -const TEXTURE_WRAPPING = { - RepeatWrapping, - ClampToEdgeWrapping, - MirroredRepeatWrapping -}; -const TEXTURE_FILTER = { - NearestFilter, - NearestMipmapNearestFilter, - NearestMipmapLinearFilter, - LinearFilter, - LinearMipmapNearestFilter, - LinearMipmapLinearFilter -}; -class ImageBitmapLoader extends Loader { - static { - __name(this, "ImageBitmapLoader"); - } - constructor(manager) { - super(manager); - this.isImageBitmapLoader = true; - if (typeof createImageBitmap === "undefined") { - console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."); - } - if (typeof fetch === "undefined") { - console.warn("THREE.ImageBitmapLoader: fetch() not supported."); - } - this.options = { premultiplyAlpha: "none" }; - } - setOptions(options) { - this.options = options; - return this; - } - load(url, onLoad, onProgress, onError) { - if (url === void 0) url = ""; - if (this.path !== void 0) url = this.path + url; - url = this.manager.resolveURL(url); - const scope = this; - const cached = Cache.get(url); - if (cached !== void 0) { - scope.manager.itemStart(url); - if (cached.then) { - cached.then((imageBitmap) => { - if (onLoad) onLoad(imageBitmap); - scope.manager.itemEnd(url); - }).catch((e) => { - if (onError) onError(e); - }); - return; - } - setTimeout(function() { - if (onLoad) onLoad(cached); - scope.manager.itemEnd(url); - }, 0); - return cached; - } - const fetchOptions = {}; - fetchOptions.credentials = this.crossOrigin === "anonymous" ? "same-origin" : "include"; - fetchOptions.headers = this.requestHeader; - const promise = fetch(url, fetchOptions).then(function(res) { - return res.blob(); - }).then(function(blob) { - return createImageBitmap(blob, Object.assign(scope.options, { colorSpaceConversion: "none" })); - }).then(function(imageBitmap) { - Cache.add(url, imageBitmap); - if (onLoad) onLoad(imageBitmap); - scope.manager.itemEnd(url); - return imageBitmap; - }).catch(function(e) { - if (onError) onError(e); - Cache.remove(url); - scope.manager.itemError(url); - scope.manager.itemEnd(url); - }); - Cache.add(url, promise); - scope.manager.itemStart(url); - } -} -let _context; -class AudioContext { - static { - __name(this, "AudioContext"); - } - static getContext() { - if (_context === void 0) { - _context = new (window.AudioContext || window.webkitAudioContext)(); - } - return _context; - } - static setContext(value) { - _context = value; - } -} -class AudioLoader extends Loader { - static { - __name(this, "AudioLoader"); - } - constructor(manager) { - super(manager); - } - load(url, onLoad, onProgress, onError) { - const scope = this; - const loader = new FileLoader(this.manager); - loader.setResponseType("arraybuffer"); - loader.setPath(this.path); - loader.setRequestHeader(this.requestHeader); - loader.setWithCredentials(this.withCredentials); - loader.load(url, function(buffer) { - try { - const bufferCopy = buffer.slice(0); - const context = AudioContext.getContext(); - context.decodeAudioData(bufferCopy, function(audioBuffer) { - onLoad(audioBuffer); - }).catch(handleError); - } catch (e) { - handleError(e); - } - }, onProgress, onError); - function handleError(e) { - if (onError) { - onError(e); - } else { - console.error(e); - } - scope.manager.itemError(url); - } - __name(handleError, "handleError"); - } -} -const _eyeRight = /* @__PURE__ */ new Matrix4(); -const _eyeLeft = /* @__PURE__ */ new Matrix4(); -const _projectionMatrix = /* @__PURE__ */ new Matrix4(); -class StereoCamera { - static { - __name(this, "StereoCamera"); - } - constructor() { - this.type = "StereoCamera"; - this.aspect = 1; - this.eyeSep = 0.064; - this.cameraL = new PerspectiveCamera(); - this.cameraL.layers.enable(1); - this.cameraL.matrixAutoUpdate = false; - this.cameraR = new PerspectiveCamera(); - this.cameraR.layers.enable(2); - this.cameraR.matrixAutoUpdate = false; - this._cache = { - focus: null, - fov: null, - aspect: null, - near: null, - far: null, - zoom: null, - eyeSep: null - }; - } - update(camera) { - const cache = this._cache; - const needsUpdate = cache.focus !== camera.focus || cache.fov !== camera.fov || cache.aspect !== camera.aspect * this.aspect || cache.near !== camera.near || cache.far !== camera.far || cache.zoom !== camera.zoom || cache.eyeSep !== this.eyeSep; - if (needsUpdate) { - cache.focus = camera.focus; - cache.fov = camera.fov; - cache.aspect = camera.aspect * this.aspect; - cache.near = camera.near; - cache.far = camera.far; - cache.zoom = camera.zoom; - cache.eyeSep = this.eyeSep; - _projectionMatrix.copy(camera.projectionMatrix); - const eyeSepHalf = cache.eyeSep / 2; - const eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus; - const ymax = cache.near * Math.tan(DEG2RAD * cache.fov * 0.5) / cache.zoom; - let xmin, xmax; - _eyeLeft.elements[12] = -eyeSepHalf; - _eyeRight.elements[12] = eyeSepHalf; - xmin = -ymax * cache.aspect + eyeSepOnProjection; - xmax = ymax * cache.aspect + eyeSepOnProjection; - _projectionMatrix.elements[0] = 2 * cache.near / (xmax - xmin); - _projectionMatrix.elements[8] = (xmax + xmin) / (xmax - xmin); - this.cameraL.projectionMatrix.copy(_projectionMatrix); - xmin = -ymax * cache.aspect - eyeSepOnProjection; - xmax = ymax * cache.aspect - eyeSepOnProjection; - _projectionMatrix.elements[0] = 2 * cache.near / (xmax - xmin); - _projectionMatrix.elements[8] = (xmax + xmin) / (xmax - xmin); - this.cameraR.projectionMatrix.copy(_projectionMatrix); - } - this.cameraL.matrixWorld.copy(camera.matrixWorld).multiply(_eyeLeft); - this.cameraR.matrixWorld.copy(camera.matrixWorld).multiply(_eyeRight); - } -} -class Clock { - static { - __name(this, "Clock"); - } - constructor(autoStart = true) { - this.autoStart = autoStart; - this.startTime = 0; - this.oldTime = 0; - this.elapsedTime = 0; - this.running = false; - } - start() { - this.startTime = now(); - this.oldTime = this.startTime; - this.elapsedTime = 0; - this.running = true; - } - stop() { - this.getElapsedTime(); - this.running = false; - this.autoStart = false; - } - getElapsedTime() { - this.getDelta(); - return this.elapsedTime; - } - getDelta() { - let diff = 0; - if (this.autoStart && !this.running) { - this.start(); - return 0; - } - if (this.running) { - const newTime = now(); - diff = (newTime - this.oldTime) / 1e3; - this.oldTime = newTime; - this.elapsedTime += diff; - } - return diff; - } -} -function now() { - return performance.now(); -} -__name(now, "now"); -const _position$1 = /* @__PURE__ */ new Vector3(); -const _quaternion$1 = /* @__PURE__ */ new Quaternion(); -const _scale$1 = /* @__PURE__ */ new Vector3(); -const _orientation$1 = /* @__PURE__ */ new Vector3(); -class AudioListener extends Object3D { - static { - __name(this, "AudioListener"); - } - constructor() { - super(); - this.type = "AudioListener"; - this.context = AudioContext.getContext(); - this.gain = this.context.createGain(); - this.gain.connect(this.context.destination); - this.filter = null; - this.timeDelta = 0; - this._clock = new Clock(); - } - getInput() { - return this.gain; - } - removeFilter() { - if (this.filter !== null) { - this.gain.disconnect(this.filter); - this.filter.disconnect(this.context.destination); - this.gain.connect(this.context.destination); - this.filter = null; - } - return this; - } - getFilter() { - return this.filter; - } - setFilter(value) { - if (this.filter !== null) { - this.gain.disconnect(this.filter); - this.filter.disconnect(this.context.destination); - } else { - this.gain.disconnect(this.context.destination); - } - this.filter = value; - this.gain.connect(this.filter); - this.filter.connect(this.context.destination); - return this; - } - getMasterVolume() { - return this.gain.gain.value; - } - setMasterVolume(value) { - this.gain.gain.setTargetAtTime(value, this.context.currentTime, 0.01); - return this; - } - updateMatrixWorld(force) { - super.updateMatrixWorld(force); - const listener = this.context.listener; - const up = this.up; - this.timeDelta = this._clock.getDelta(); - this.matrixWorld.decompose(_position$1, _quaternion$1, _scale$1); - _orientation$1.set(0, 0, -1).applyQuaternion(_quaternion$1); - if (listener.positionX) { - const endTime = this.context.currentTime + this.timeDelta; - listener.positionX.linearRampToValueAtTime(_position$1.x, endTime); - listener.positionY.linearRampToValueAtTime(_position$1.y, endTime); - listener.positionZ.linearRampToValueAtTime(_position$1.z, endTime); - listener.forwardX.linearRampToValueAtTime(_orientation$1.x, endTime); - listener.forwardY.linearRampToValueAtTime(_orientation$1.y, endTime); - listener.forwardZ.linearRampToValueAtTime(_orientation$1.z, endTime); - listener.upX.linearRampToValueAtTime(up.x, endTime); - listener.upY.linearRampToValueAtTime(up.y, endTime); - listener.upZ.linearRampToValueAtTime(up.z, endTime); - } else { - listener.setPosition(_position$1.x, _position$1.y, _position$1.z); - listener.setOrientation(_orientation$1.x, _orientation$1.y, _orientation$1.z, up.x, up.y, up.z); - } - } -} -class Audio extends Object3D { - static { - __name(this, "Audio"); - } - constructor(listener) { - super(); - this.type = "Audio"; - this.listener = listener; - this.context = listener.context; - this.gain = this.context.createGain(); - this.gain.connect(listener.getInput()); - this.autoplay = false; - this.buffer = null; - this.detune = 0; - this.loop = false; - this.loopStart = 0; - this.loopEnd = 0; - this.offset = 0; - this.duration = void 0; - this.playbackRate = 1; - this.isPlaying = false; - this.hasPlaybackControl = true; - this.source = null; - this.sourceType = "empty"; - this._startedAt = 0; - this._progress = 0; - this._connected = false; - this.filters = []; - } - getOutput() { - return this.gain; - } - setNodeSource(audioNode) { - this.hasPlaybackControl = false; - this.sourceType = "audioNode"; - this.source = audioNode; - this.connect(); - return this; - } - setMediaElementSource(mediaElement) { - this.hasPlaybackControl = false; - this.sourceType = "mediaNode"; - this.source = this.context.createMediaElementSource(mediaElement); - this.connect(); - return this; - } - setMediaStreamSource(mediaStream) { - this.hasPlaybackControl = false; - this.sourceType = "mediaStreamNode"; - this.source = this.context.createMediaStreamSource(mediaStream); - this.connect(); - return this; - } - setBuffer(audioBuffer) { - this.buffer = audioBuffer; - this.sourceType = "buffer"; - if (this.autoplay) this.play(); - return this; - } - play(delay = 0) { - if (this.isPlaying === true) { - console.warn("THREE.Audio: Audio is already playing."); - return; - } - if (this.hasPlaybackControl === false) { - console.warn("THREE.Audio: this Audio has no playback control."); - return; - } - this._startedAt = this.context.currentTime + delay; - const source = this.context.createBufferSource(); - source.buffer = this.buffer; - source.loop = this.loop; - source.loopStart = this.loopStart; - source.loopEnd = this.loopEnd; - source.onended = this.onEnded.bind(this); - source.start(this._startedAt, this._progress + this.offset, this.duration); - this.isPlaying = true; - this.source = source; - this.setDetune(this.detune); - this.setPlaybackRate(this.playbackRate); - return this.connect(); - } - pause() { - if (this.hasPlaybackControl === false) { - console.warn("THREE.Audio: this Audio has no playback control."); - return; - } - if (this.isPlaying === true) { - this._progress += Math.max(this.context.currentTime - this._startedAt, 0) * this.playbackRate; - if (this.loop === true) { - this._progress = this._progress % (this.duration || this.buffer.duration); - } - this.source.stop(); - this.source.onended = null; - this.isPlaying = false; - } - return this; - } - stop(delay = 0) { - if (this.hasPlaybackControl === false) { - console.warn("THREE.Audio: this Audio has no playback control."); - return; - } - this._progress = 0; - if (this.source !== null) { - this.source.stop(this.context.currentTime + delay); - this.source.onended = null; - } - this.isPlaying = false; - return this; - } - connect() { - if (this.filters.length > 0) { - this.source.connect(this.filters[0]); - for (let i = 1, l = this.filters.length; i < l; i++) { - this.filters[i - 1].connect(this.filters[i]); - } - this.filters[this.filters.length - 1].connect(this.getOutput()); - } else { - this.source.connect(this.getOutput()); - } - this._connected = true; - return this; - } - disconnect() { - if (this._connected === false) { - return; - } - if (this.filters.length > 0) { - this.source.disconnect(this.filters[0]); - for (let i = 1, l = this.filters.length; i < l; i++) { - this.filters[i - 1].disconnect(this.filters[i]); - } - this.filters[this.filters.length - 1].disconnect(this.getOutput()); - } else { - this.source.disconnect(this.getOutput()); - } - this._connected = false; - return this; - } - getFilters() { - return this.filters; - } - setFilters(value) { - if (!value) value = []; - if (this._connected === true) { - this.disconnect(); - this.filters = value.slice(); - this.connect(); - } else { - this.filters = value.slice(); - } - return this; - } - setDetune(value) { - this.detune = value; - if (this.isPlaying === true && this.source.detune !== void 0) { - this.source.detune.setTargetAtTime(this.detune, this.context.currentTime, 0.01); - } - return this; - } - getDetune() { - return this.detune; - } - getFilter() { - return this.getFilters()[0]; - } - setFilter(filter) { - return this.setFilters(filter ? [filter] : []); - } - setPlaybackRate(value) { - if (this.hasPlaybackControl === false) { - console.warn("THREE.Audio: this Audio has no playback control."); - return; - } - this.playbackRate = value; - if (this.isPlaying === true) { - this.source.playbackRate.setTargetAtTime(this.playbackRate, this.context.currentTime, 0.01); - } - return this; - } - getPlaybackRate() { - return this.playbackRate; - } - onEnded() { - this.isPlaying = false; - } - getLoop() { - if (this.hasPlaybackControl === false) { - console.warn("THREE.Audio: this Audio has no playback control."); - return false; - } - return this.loop; - } - setLoop(value) { - if (this.hasPlaybackControl === false) { - console.warn("THREE.Audio: this Audio has no playback control."); - return; - } - this.loop = value; - if (this.isPlaying === true) { - this.source.loop = this.loop; - } - return this; - } - setLoopStart(value) { - this.loopStart = value; - return this; - } - setLoopEnd(value) { - this.loopEnd = value; - return this; - } - getVolume() { - return this.gain.gain.value; - } - setVolume(value) { - this.gain.gain.setTargetAtTime(value, this.context.currentTime, 0.01); - return this; - } -} -const _position = /* @__PURE__ */ new Vector3(); -const _quaternion = /* @__PURE__ */ new Quaternion(); -const _scale = /* @__PURE__ */ new Vector3(); -const _orientation = /* @__PURE__ */ new Vector3(); -class PositionalAudio extends Audio { - static { - __name(this, "PositionalAudio"); - } - constructor(listener) { - super(listener); - this.panner = this.context.createPanner(); - this.panner.panningModel = "HRTF"; - this.panner.connect(this.gain); - } - connect() { - super.connect(); - this.panner.connect(this.gain); - } - disconnect() { - super.disconnect(); - this.panner.disconnect(this.gain); - } - getOutput() { - return this.panner; - } - getRefDistance() { - return this.panner.refDistance; - } - setRefDistance(value) { - this.panner.refDistance = value; - return this; - } - getRolloffFactor() { - return this.panner.rolloffFactor; - } - setRolloffFactor(value) { - this.panner.rolloffFactor = value; - return this; - } - getDistanceModel() { - return this.panner.distanceModel; - } - setDistanceModel(value) { - this.panner.distanceModel = value; - return this; - } - getMaxDistance() { - return this.panner.maxDistance; - } - setMaxDistance(value) { - this.panner.maxDistance = value; - return this; - } - setDirectionalCone(coneInnerAngle, coneOuterAngle, coneOuterGain) { - this.panner.coneInnerAngle = coneInnerAngle; - this.panner.coneOuterAngle = coneOuterAngle; - this.panner.coneOuterGain = coneOuterGain; - return this; - } - updateMatrixWorld(force) { - super.updateMatrixWorld(force); - if (this.hasPlaybackControl === true && this.isPlaying === false) return; - this.matrixWorld.decompose(_position, _quaternion, _scale); - _orientation.set(0, 0, 1).applyQuaternion(_quaternion); - const panner = this.panner; - if (panner.positionX) { - const endTime = this.context.currentTime + this.listener.timeDelta; - panner.positionX.linearRampToValueAtTime(_position.x, endTime); - panner.positionY.linearRampToValueAtTime(_position.y, endTime); - panner.positionZ.linearRampToValueAtTime(_position.z, endTime); - panner.orientationX.linearRampToValueAtTime(_orientation.x, endTime); - panner.orientationY.linearRampToValueAtTime(_orientation.y, endTime); - panner.orientationZ.linearRampToValueAtTime(_orientation.z, endTime); - } else { - panner.setPosition(_position.x, _position.y, _position.z); - panner.setOrientation(_orientation.x, _orientation.y, _orientation.z); - } - } -} -class AudioAnalyser { - static { - __name(this, "AudioAnalyser"); - } - constructor(audio, fftSize = 2048) { - this.analyser = audio.context.createAnalyser(); - this.analyser.fftSize = fftSize; - this.data = new Uint8Array(this.analyser.frequencyBinCount); - audio.getOutput().connect(this.analyser); - } - getFrequencyData() { - this.analyser.getByteFrequencyData(this.data); - return this.data; - } - getAverageFrequency() { - let value = 0; - const data = this.getFrequencyData(); - for (let i = 0; i < data.length; i++) { - value += data[i]; - } - return value / data.length; - } -} -class PropertyMixer { - static { - __name(this, "PropertyMixer"); - } - constructor(binding, typeName, valueSize) { - this.binding = binding; - this.valueSize = valueSize; - let mixFunction, mixFunctionAdditive, setIdentity; - switch (typeName) { - case "quaternion": - mixFunction = this._slerp; - mixFunctionAdditive = this._slerpAdditive; - setIdentity = this._setAdditiveIdentityQuaternion; - this.buffer = new Float64Array(valueSize * 6); - this._workIndex = 5; - break; - case "string": - case "bool": - mixFunction = this._select; - mixFunctionAdditive = this._select; - setIdentity = this._setAdditiveIdentityOther; - this.buffer = new Array(valueSize * 5); - break; - default: - mixFunction = this._lerp; - mixFunctionAdditive = this._lerpAdditive; - setIdentity = this._setAdditiveIdentityNumeric; - this.buffer = new Float64Array(valueSize * 5); - } - this._mixBufferRegion = mixFunction; - this._mixBufferRegionAdditive = mixFunctionAdditive; - this._setIdentity = setIdentity; - this._origIndex = 3; - this._addIndex = 4; - this.cumulativeWeight = 0; - this.cumulativeWeightAdditive = 0; - this.useCount = 0; - this.referenceCount = 0; - } - // accumulate data in the 'incoming' region into 'accu' - accumulate(accuIndex, weight) { - const buffer = this.buffer, stride = this.valueSize, offset = accuIndex * stride + stride; - let currentWeight = this.cumulativeWeight; - if (currentWeight === 0) { - for (let i = 0; i !== stride; ++i) { - buffer[offset + i] = buffer[i]; - } - currentWeight = weight; - } else { - currentWeight += weight; - const mix = weight / currentWeight; - this._mixBufferRegion(buffer, offset, 0, mix, stride); - } - this.cumulativeWeight = currentWeight; - } - // accumulate data in the 'incoming' region into 'add' - accumulateAdditive(weight) { - const buffer = this.buffer, stride = this.valueSize, offset = stride * this._addIndex; - if (this.cumulativeWeightAdditive === 0) { - this._setIdentity(); - } - this._mixBufferRegionAdditive(buffer, offset, 0, weight, stride); - this.cumulativeWeightAdditive += weight; - } - // apply the state of 'accu' to the binding when accus differ - apply(accuIndex) { - const stride = this.valueSize, buffer = this.buffer, offset = accuIndex * stride + stride, weight = this.cumulativeWeight, weightAdditive = this.cumulativeWeightAdditive, binding = this.binding; - this.cumulativeWeight = 0; - this.cumulativeWeightAdditive = 0; - if (weight < 1) { - const originalValueOffset = stride * this._origIndex; - this._mixBufferRegion( - buffer, - offset, - originalValueOffset, - 1 - weight, - stride - ); - } - if (weightAdditive > 0) { - this._mixBufferRegionAdditive(buffer, offset, this._addIndex * stride, 1, stride); - } - for (let i = stride, e = stride + stride; i !== e; ++i) { - if (buffer[i] !== buffer[i + stride]) { - binding.setValue(buffer, offset); - break; - } - } - } - // remember the state of the bound property and copy it to both accus - saveOriginalState() { - const binding = this.binding; - const buffer = this.buffer, stride = this.valueSize, originalValueOffset = stride * this._origIndex; - binding.getValue(buffer, originalValueOffset); - for (let i = stride, e = originalValueOffset; i !== e; ++i) { - buffer[i] = buffer[originalValueOffset + i % stride]; - } - this._setIdentity(); - this.cumulativeWeight = 0; - this.cumulativeWeightAdditive = 0; - } - // apply the state previously taken via 'saveOriginalState' to the binding - restoreOriginalState() { - const originalValueOffset = this.valueSize * 3; - this.binding.setValue(this.buffer, originalValueOffset); - } - _setAdditiveIdentityNumeric() { - const startIndex = this._addIndex * this.valueSize; - const endIndex = startIndex + this.valueSize; - for (let i = startIndex; i < endIndex; i++) { - this.buffer[i] = 0; - } - } - _setAdditiveIdentityQuaternion() { - this._setAdditiveIdentityNumeric(); - this.buffer[this._addIndex * this.valueSize + 3] = 1; - } - _setAdditiveIdentityOther() { - const startIndex = this._origIndex * this.valueSize; - const targetIndex = this._addIndex * this.valueSize; - for (let i = 0; i < this.valueSize; i++) { - this.buffer[targetIndex + i] = this.buffer[startIndex + i]; - } - } - // mix functions - _select(buffer, dstOffset, srcOffset, t2, stride) { - if (t2 >= 0.5) { - for (let i = 0; i !== stride; ++i) { - buffer[dstOffset + i] = buffer[srcOffset + i]; - } - } - } - _slerp(buffer, dstOffset, srcOffset, t2) { - Quaternion.slerpFlat(buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t2); - } - _slerpAdditive(buffer, dstOffset, srcOffset, t2, stride) { - const workOffset = this._workIndex * stride; - Quaternion.multiplyQuaternionsFlat(buffer, workOffset, buffer, dstOffset, buffer, srcOffset); - Quaternion.slerpFlat(buffer, dstOffset, buffer, dstOffset, buffer, workOffset, t2); - } - _lerp(buffer, dstOffset, srcOffset, t2, stride) { - const s = 1 - t2; - for (let i = 0; i !== stride; ++i) { - const j = dstOffset + i; - buffer[j] = buffer[j] * s + buffer[srcOffset + i] * t2; - } - } - _lerpAdditive(buffer, dstOffset, srcOffset, t2, stride) { - for (let i = 0; i !== stride; ++i) { - const j = dstOffset + i; - buffer[j] = buffer[j] + buffer[srcOffset + i] * t2; - } - } -} -const _RESERVED_CHARS_RE = "\\[\\]\\.:\\/"; -const _reservedRe = new RegExp("[" + _RESERVED_CHARS_RE + "]", "g"); -const _wordChar = "[^" + _RESERVED_CHARS_RE + "]"; -const _wordCharOrDot = "[^" + _RESERVED_CHARS_RE.replace("\\.", "") + "]"; -const _directoryRe = /* @__PURE__ */ /((?:WC+[\/:])*)/.source.replace("WC", _wordChar); -const _nodeRe = /* @__PURE__ */ /(WCOD+)?/.source.replace("WCOD", _wordCharOrDot); -const _objectRe = /* @__PURE__ */ /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC", _wordChar); -const _propertyRe = /* @__PURE__ */ /\.(WC+)(?:\[(.+)\])?/.source.replace("WC", _wordChar); -const _trackRe = new RegExp( - "^" + _directoryRe + _nodeRe + _objectRe + _propertyRe + "$" -); -const _supportedObjectNames = ["material", "materials", "bones", "map"]; -class Composite { - static { - __name(this, "Composite"); - } - constructor(targetGroup, path, optionalParsedPath) { - const parsedPath = optionalParsedPath || PropertyBinding.parseTrackName(path); - this._targetGroup = targetGroup; - this._bindings = targetGroup.subscribe_(path, parsedPath); - } - getValue(array, offset) { - this.bind(); - const firstValidIndex = this._targetGroup.nCachedObjects_, binding = this._bindings[firstValidIndex]; - if (binding !== void 0) binding.getValue(array, offset); - } - setValue(array, offset) { - const bindings = this._bindings; - for (let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++i) { - bindings[i].setValue(array, offset); - } - } - bind() { - const bindings = this._bindings; - for (let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++i) { - bindings[i].bind(); - } - } - unbind() { - const bindings = this._bindings; - for (let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++i) { - bindings[i].unbind(); - } - } -} -class PropertyBinding { - static { - __name(this, "PropertyBinding"); - } - constructor(rootNode, path, parsedPath) { - this.path = path; - this.parsedPath = parsedPath || PropertyBinding.parseTrackName(path); - this.node = PropertyBinding.findNode(rootNode, this.parsedPath.nodeName); - this.rootNode = rootNode; - this.getValue = this._getValue_unbound; - this.setValue = this._setValue_unbound; - } - static create(root, path, parsedPath) { - if (!(root && root.isAnimationObjectGroup)) { - return new PropertyBinding(root, path, parsedPath); - } else { - return new PropertyBinding.Composite(root, path, parsedPath); - } - } - /** - * Replaces spaces with underscores and removes unsupported characters from - * node names, to ensure compatibility with parseTrackName(). - * - * @param {string} name Node name to be sanitized. - * @return {string} - */ - static sanitizeNodeName(name) { - return name.replace(/\s/g, "_").replace(_reservedRe, ""); - } - static parseTrackName(trackName) { - const matches = _trackRe.exec(trackName); - if (matches === null) { - throw new Error("PropertyBinding: Cannot parse trackName: " + trackName); - } - const results = { - // directoryName: matches[ 1 ], // (tschw) currently unused - nodeName: matches[2], - objectName: matches[3], - objectIndex: matches[4], - propertyName: matches[5], - // required - propertyIndex: matches[6] - }; - const lastDot = results.nodeName && results.nodeName.lastIndexOf("."); - if (lastDot !== void 0 && lastDot !== -1) { - const objectName = results.nodeName.substring(lastDot + 1); - if (_supportedObjectNames.indexOf(objectName) !== -1) { - results.nodeName = results.nodeName.substring(0, lastDot); - results.objectName = objectName; - } - } - if (results.propertyName === null || results.propertyName.length === 0) { - throw new Error("PropertyBinding: can not parse propertyName from trackName: " + trackName); - } - return results; - } - static findNode(root, nodeName) { - if (nodeName === void 0 || nodeName === "" || nodeName === "." || nodeName === -1 || nodeName === root.name || nodeName === root.uuid) { - return root; - } - if (root.skeleton) { - const bone = root.skeleton.getBoneByName(nodeName); - if (bone !== void 0) { - return bone; - } - } - if (root.children) { - const searchNodeSubtree = /* @__PURE__ */ __name(function(children) { - for (let i = 0; i < children.length; i++) { - const childNode = children[i]; - if (childNode.name === nodeName || childNode.uuid === nodeName) { - return childNode; - } - const result = searchNodeSubtree(childNode.children); - if (result) return result; - } - return null; - }, "searchNodeSubtree"); - const subTreeNode = searchNodeSubtree(root.children); - if (subTreeNode) { - return subTreeNode; - } - } - return null; - } - // these are used to "bind" a nonexistent property - _getValue_unavailable() { - } - _setValue_unavailable() { - } - // Getters - _getValue_direct(buffer, offset) { - buffer[offset] = this.targetObject[this.propertyName]; - } - _getValue_array(buffer, offset) { - const source = this.resolvedProperty; - for (let i = 0, n = source.length; i !== n; ++i) { - buffer[offset++] = source[i]; - } - } - _getValue_arrayElement(buffer, offset) { - buffer[offset] = this.resolvedProperty[this.propertyIndex]; - } - _getValue_toArray(buffer, offset) { - this.resolvedProperty.toArray(buffer, offset); - } - // Direct - _setValue_direct(buffer, offset) { - this.targetObject[this.propertyName] = buffer[offset]; - } - _setValue_direct_setNeedsUpdate(buffer, offset) { - this.targetObject[this.propertyName] = buffer[offset]; - this.targetObject.needsUpdate = true; - } - _setValue_direct_setMatrixWorldNeedsUpdate(buffer, offset) { - this.targetObject[this.propertyName] = buffer[offset]; - this.targetObject.matrixWorldNeedsUpdate = true; - } - // EntireArray - _setValue_array(buffer, offset) { - const dest = this.resolvedProperty; - for (let i = 0, n = dest.length; i !== n; ++i) { - dest[i] = buffer[offset++]; - } - } - _setValue_array_setNeedsUpdate(buffer, offset) { - const dest = this.resolvedProperty; - for (let i = 0, n = dest.length; i !== n; ++i) { - dest[i] = buffer[offset++]; - } - this.targetObject.needsUpdate = true; - } - _setValue_array_setMatrixWorldNeedsUpdate(buffer, offset) { - const dest = this.resolvedProperty; - for (let i = 0, n = dest.length; i !== n; ++i) { - dest[i] = buffer[offset++]; - } - this.targetObject.matrixWorldNeedsUpdate = true; - } - // ArrayElement - _setValue_arrayElement(buffer, offset) { - this.resolvedProperty[this.propertyIndex] = buffer[offset]; - } - _setValue_arrayElement_setNeedsUpdate(buffer, offset) { - this.resolvedProperty[this.propertyIndex] = buffer[offset]; - this.targetObject.needsUpdate = true; - } - _setValue_arrayElement_setMatrixWorldNeedsUpdate(buffer, offset) { - this.resolvedProperty[this.propertyIndex] = buffer[offset]; - this.targetObject.matrixWorldNeedsUpdate = true; - } - // HasToFromArray - _setValue_fromArray(buffer, offset) { - this.resolvedProperty.fromArray(buffer, offset); - } - _setValue_fromArray_setNeedsUpdate(buffer, offset) { - this.resolvedProperty.fromArray(buffer, offset); - this.targetObject.needsUpdate = true; - } - _setValue_fromArray_setMatrixWorldNeedsUpdate(buffer, offset) { - this.resolvedProperty.fromArray(buffer, offset); - this.targetObject.matrixWorldNeedsUpdate = true; - } - _getValue_unbound(targetArray, offset) { - this.bind(); - this.getValue(targetArray, offset); - } - _setValue_unbound(sourceArray, offset) { - this.bind(); - this.setValue(sourceArray, offset); - } - // create getter / setter pair for a property in the scene graph - bind() { - let targetObject = this.node; - const parsedPath = this.parsedPath; - const objectName = parsedPath.objectName; - const propertyName = parsedPath.propertyName; - let propertyIndex = parsedPath.propertyIndex; - if (!targetObject) { - targetObject = PropertyBinding.findNode(this.rootNode, parsedPath.nodeName); - this.node = targetObject; - } - this.getValue = this._getValue_unavailable; - this.setValue = this._setValue_unavailable; - if (!targetObject) { - console.warn("THREE.PropertyBinding: No target node found for track: " + this.path + "."); - return; - } - if (objectName) { - let objectIndex = parsedPath.objectIndex; - switch (objectName) { - case "materials": - if (!targetObject.material) { - console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.", this); - return; - } - if (!targetObject.material.materials) { - console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.", this); - return; - } - targetObject = targetObject.material.materials; - break; - case "bones": - if (!targetObject.skeleton) { - console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.", this); - return; - } - targetObject = targetObject.skeleton.bones; - for (let i = 0; i < targetObject.length; i++) { - if (targetObject[i].name === objectIndex) { - objectIndex = i; - break; - } - } - break; - case "map": - if ("map" in targetObject) { - targetObject = targetObject.map; - break; - } - if (!targetObject.material) { - console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.", this); - return; - } - if (!targetObject.material.map) { - console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.", this); - return; - } - targetObject = targetObject.material.map; - break; - default: - if (targetObject[objectName] === void 0) { - console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.", this); - return; - } - targetObject = targetObject[objectName]; - } - if (objectIndex !== void 0) { - if (targetObject[objectIndex] === void 0) { - console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.", this, targetObject); - return; - } - targetObject = targetObject[objectIndex]; - } - } - const nodeProperty = targetObject[propertyName]; - if (nodeProperty === void 0) { - const nodeName = parsedPath.nodeName; - console.error("THREE.PropertyBinding: Trying to update property for track: " + nodeName + "." + propertyName + " but it wasn't found.", targetObject); - return; - } - let versioning = this.Versioning.None; - this.targetObject = targetObject; - if (targetObject.needsUpdate !== void 0) { - versioning = this.Versioning.NeedsUpdate; - } else if (targetObject.matrixWorldNeedsUpdate !== void 0) { - versioning = this.Versioning.MatrixWorldNeedsUpdate; - } - let bindingType = this.BindingType.Direct; - if (propertyIndex !== void 0) { - if (propertyName === "morphTargetInfluences") { - if (!targetObject.geometry) { - console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.", this); - return; - } - if (!targetObject.geometry.morphAttributes) { - console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.", this); - return; - } - if (targetObject.morphTargetDictionary[propertyIndex] !== void 0) { - propertyIndex = targetObject.morphTargetDictionary[propertyIndex]; - } - } - bindingType = this.BindingType.ArrayElement; - this.resolvedProperty = nodeProperty; - this.propertyIndex = propertyIndex; - } else if (nodeProperty.fromArray !== void 0 && nodeProperty.toArray !== void 0) { - bindingType = this.BindingType.HasFromToArray; - this.resolvedProperty = nodeProperty; - } else if (Array.isArray(nodeProperty)) { - bindingType = this.BindingType.EntireArray; - this.resolvedProperty = nodeProperty; - } else { - this.propertyName = propertyName; - } - this.getValue = this.GetterByBindingType[bindingType]; - this.setValue = this.SetterByBindingTypeAndVersioning[bindingType][versioning]; - } - unbind() { - this.node = null; - this.getValue = this._getValue_unbound; - this.setValue = this._setValue_unbound; - } -} -PropertyBinding.Composite = Composite; -PropertyBinding.prototype.BindingType = { - Direct: 0, - EntireArray: 1, - ArrayElement: 2, - HasFromToArray: 3 -}; -PropertyBinding.prototype.Versioning = { - None: 0, - NeedsUpdate: 1, - MatrixWorldNeedsUpdate: 2 -}; -PropertyBinding.prototype.GetterByBindingType = [ - PropertyBinding.prototype._getValue_direct, - PropertyBinding.prototype._getValue_array, - PropertyBinding.prototype._getValue_arrayElement, - PropertyBinding.prototype._getValue_toArray -]; -PropertyBinding.prototype.SetterByBindingTypeAndVersioning = [ - [ - // Direct - PropertyBinding.prototype._setValue_direct, - PropertyBinding.prototype._setValue_direct_setNeedsUpdate, - PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate - ], - [ - // EntireArray - PropertyBinding.prototype._setValue_array, - PropertyBinding.prototype._setValue_array_setNeedsUpdate, - PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate - ], - [ - // ArrayElement - PropertyBinding.prototype._setValue_arrayElement, - PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate, - PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate - ], - [ - // HasToFromArray - PropertyBinding.prototype._setValue_fromArray, - PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate, - PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate - ] -]; -class AnimationObjectGroup { - static { - __name(this, "AnimationObjectGroup"); - } - constructor() { - this.isAnimationObjectGroup = true; - this.uuid = generateUUID(); - this._objects = Array.prototype.slice.call(arguments); - this.nCachedObjects_ = 0; - const indices = {}; - this._indicesByUUID = indices; - for (let i = 0, n = arguments.length; i !== n; ++i) { - indices[arguments[i].uuid] = i; - } - this._paths = []; - this._parsedPaths = []; - this._bindings = []; - this._bindingsIndicesByPath = {}; - const scope = this; - this.stats = { - objects: { - get total() { - return scope._objects.length; - }, - get inUse() { - return this.total - scope.nCachedObjects_; - } - }, - get bindingsPerObject() { - return scope._bindings.length; - } - }; - } - add() { - const objects = this._objects, indicesByUUID = this._indicesByUUID, paths = this._paths, parsedPaths = this._parsedPaths, bindings = this._bindings, nBindings = bindings.length; - let knownObject = void 0, nObjects = objects.length, nCachedObjects = this.nCachedObjects_; - for (let i = 0, n = arguments.length; i !== n; ++i) { - const object = arguments[i], uuid = object.uuid; - let index = indicesByUUID[uuid]; - if (index === void 0) { - index = nObjects++; - indicesByUUID[uuid] = index; - objects.push(object); - for (let j = 0, m = nBindings; j !== m; ++j) { - bindings[j].push(new PropertyBinding(object, paths[j], parsedPaths[j])); - } - } else if (index < nCachedObjects) { - knownObject = objects[index]; - const firstActiveIndex = --nCachedObjects, lastCachedObject = objects[firstActiveIndex]; - indicesByUUID[lastCachedObject.uuid] = index; - objects[index] = lastCachedObject; - indicesByUUID[uuid] = firstActiveIndex; - objects[firstActiveIndex] = object; - for (let j = 0, m = nBindings; j !== m; ++j) { - const bindingsForPath = bindings[j], lastCached = bindingsForPath[firstActiveIndex]; - let binding = bindingsForPath[index]; - bindingsForPath[index] = lastCached; - if (binding === void 0) { - binding = new PropertyBinding(object, paths[j], parsedPaths[j]); - } - bindingsForPath[firstActiveIndex] = binding; - } - } else if (objects[index] !== knownObject) { - console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes."); - } - } - this.nCachedObjects_ = nCachedObjects; - } - remove() { - const objects = this._objects, indicesByUUID = this._indicesByUUID, bindings = this._bindings, nBindings = bindings.length; - let nCachedObjects = this.nCachedObjects_; - for (let i = 0, n = arguments.length; i !== n; ++i) { - const object = arguments[i], uuid = object.uuid, index = indicesByUUID[uuid]; - if (index !== void 0 && index >= nCachedObjects) { - const lastCachedIndex = nCachedObjects++, firstActiveObject = objects[lastCachedIndex]; - indicesByUUID[firstActiveObject.uuid] = index; - objects[index] = firstActiveObject; - indicesByUUID[uuid] = lastCachedIndex; - objects[lastCachedIndex] = object; - for (let j = 0, m = nBindings; j !== m; ++j) { - const bindingsForPath = bindings[j], firstActive = bindingsForPath[lastCachedIndex], binding = bindingsForPath[index]; - bindingsForPath[index] = firstActive; - bindingsForPath[lastCachedIndex] = binding; - } - } - } - this.nCachedObjects_ = nCachedObjects; - } - // remove & forget - uncache() { - const objects = this._objects, indicesByUUID = this._indicesByUUID, bindings = this._bindings, nBindings = bindings.length; - let nCachedObjects = this.nCachedObjects_, nObjects = objects.length; - for (let i = 0, n = arguments.length; i !== n; ++i) { - const object = arguments[i], uuid = object.uuid, index = indicesByUUID[uuid]; - if (index !== void 0) { - delete indicesByUUID[uuid]; - if (index < nCachedObjects) { - const firstActiveIndex = --nCachedObjects, lastCachedObject = objects[firstActiveIndex], lastIndex = --nObjects, lastObject = objects[lastIndex]; - indicesByUUID[lastCachedObject.uuid] = index; - objects[index] = lastCachedObject; - indicesByUUID[lastObject.uuid] = firstActiveIndex; - objects[firstActiveIndex] = lastObject; - objects.pop(); - for (let j = 0, m = nBindings; j !== m; ++j) { - const bindingsForPath = bindings[j], lastCached = bindingsForPath[firstActiveIndex], last = bindingsForPath[lastIndex]; - bindingsForPath[index] = lastCached; - bindingsForPath[firstActiveIndex] = last; - bindingsForPath.pop(); - } - } else { - const lastIndex = --nObjects, lastObject = objects[lastIndex]; - if (lastIndex > 0) { - indicesByUUID[lastObject.uuid] = index; - } - objects[index] = lastObject; - objects.pop(); - for (let j = 0, m = nBindings; j !== m; ++j) { - const bindingsForPath = bindings[j]; - bindingsForPath[index] = bindingsForPath[lastIndex]; - bindingsForPath.pop(); - } - } - } - } - this.nCachedObjects_ = nCachedObjects; - } - // Internal interface used by befriended PropertyBinding.Composite: - subscribe_(path, parsedPath) { - const indicesByPath = this._bindingsIndicesByPath; - let index = indicesByPath[path]; - const bindings = this._bindings; - if (index !== void 0) return bindings[index]; - const paths = this._paths, parsedPaths = this._parsedPaths, objects = this._objects, nObjects = objects.length, nCachedObjects = this.nCachedObjects_, bindingsForPath = new Array(nObjects); - index = bindings.length; - indicesByPath[path] = index; - paths.push(path); - parsedPaths.push(parsedPath); - bindings.push(bindingsForPath); - for (let i = nCachedObjects, n = objects.length; i !== n; ++i) { - const object = objects[i]; - bindingsForPath[i] = new PropertyBinding(object, path, parsedPath); - } - return bindingsForPath; - } - unsubscribe_(path) { - const indicesByPath = this._bindingsIndicesByPath, index = indicesByPath[path]; - if (index !== void 0) { - const paths = this._paths, parsedPaths = this._parsedPaths, bindings = this._bindings, lastBindingsIndex = bindings.length - 1, lastBindings = bindings[lastBindingsIndex], lastBindingsPath = path[lastBindingsIndex]; - indicesByPath[lastBindingsPath] = index; - bindings[index] = lastBindings; - bindings.pop(); - parsedPaths[index] = parsedPaths[lastBindingsIndex]; - parsedPaths.pop(); - paths[index] = paths[lastBindingsIndex]; - paths.pop(); - } - } -} -class AnimationAction { - static { - __name(this, "AnimationAction"); - } - constructor(mixer, clip, localRoot = null, blendMode = clip.blendMode) { - this._mixer = mixer; - this._clip = clip; - this._localRoot = localRoot; - this.blendMode = blendMode; - const tracks = clip.tracks, nTracks = tracks.length, interpolants = new Array(nTracks); - const interpolantSettings = { - endingStart: ZeroCurvatureEnding, - endingEnd: ZeroCurvatureEnding - }; - for (let i = 0; i !== nTracks; ++i) { - const interpolant = tracks[i].createInterpolant(null); - interpolants[i] = interpolant; - interpolant.settings = interpolantSettings; - } - this._interpolantSettings = interpolantSettings; - this._interpolants = interpolants; - this._propertyBindings = new Array(nTracks); - this._cacheIndex = null; - this._byClipCacheIndex = null; - this._timeScaleInterpolant = null; - this._weightInterpolant = null; - this.loop = LoopRepeat; - this._loopCount = -1; - this._startTime = null; - this.time = 0; - this.timeScale = 1; - this._effectiveTimeScale = 1; - this.weight = 1; - this._effectiveWeight = 1; - this.repetitions = Infinity; - this.paused = false; - this.enabled = true; - this.clampWhenFinished = false; - this.zeroSlopeAtStart = true; - this.zeroSlopeAtEnd = true; - } - // State & Scheduling - play() { - this._mixer._activateAction(this); - return this; - } - stop() { - this._mixer._deactivateAction(this); - return this.reset(); - } - reset() { - this.paused = false; - this.enabled = true; - this.time = 0; - this._loopCount = -1; - this._startTime = null; - return this.stopFading().stopWarping(); - } - isRunning() { - return this.enabled && !this.paused && this.timeScale !== 0 && this._startTime === null && this._mixer._isActiveAction(this); - } - // return true when play has been called - isScheduled() { - return this._mixer._isActiveAction(this); - } - startAt(time) { - this._startTime = time; - return this; - } - setLoop(mode, repetitions) { - this.loop = mode; - this.repetitions = repetitions; - return this; - } - // Weight - // set the weight stopping any scheduled fading - // although .enabled = false yields an effective weight of zero, this - // method does *not* change .enabled, because it would be confusing - setEffectiveWeight(weight) { - this.weight = weight; - this._effectiveWeight = this.enabled ? weight : 0; - return this.stopFading(); - } - // return the weight considering fading and .enabled - getEffectiveWeight() { - return this._effectiveWeight; - } - fadeIn(duration) { - return this._scheduleFading(duration, 0, 1); - } - fadeOut(duration) { - return this._scheduleFading(duration, 1, 0); - } - crossFadeFrom(fadeOutAction, duration, warp) { - fadeOutAction.fadeOut(duration); - this.fadeIn(duration); - if (warp) { - const fadeInDuration = this._clip.duration, fadeOutDuration = fadeOutAction._clip.duration, startEndRatio = fadeOutDuration / fadeInDuration, endStartRatio = fadeInDuration / fadeOutDuration; - fadeOutAction.warp(1, startEndRatio, duration); - this.warp(endStartRatio, 1, duration); - } - return this; - } - crossFadeTo(fadeInAction, duration, warp) { - return fadeInAction.crossFadeFrom(this, duration, warp); - } - stopFading() { - const weightInterpolant = this._weightInterpolant; - if (weightInterpolant !== null) { - this._weightInterpolant = null; - this._mixer._takeBackControlInterpolant(weightInterpolant); - } - return this; - } - // Time Scale Control - // set the time scale stopping any scheduled warping - // although .paused = true yields an effective time scale of zero, this - // method does *not* change .paused, because it would be confusing - setEffectiveTimeScale(timeScale) { - this.timeScale = timeScale; - this._effectiveTimeScale = this.paused ? 0 : timeScale; - return this.stopWarping(); - } - // return the time scale considering warping and .paused - getEffectiveTimeScale() { - return this._effectiveTimeScale; - } - setDuration(duration) { - this.timeScale = this._clip.duration / duration; - return this.stopWarping(); - } - syncWith(action) { - this.time = action.time; - this.timeScale = action.timeScale; - return this.stopWarping(); - } - halt(duration) { - return this.warp(this._effectiveTimeScale, 0, duration); - } - warp(startTimeScale, endTimeScale, duration) { - const mixer = this._mixer, now2 = mixer.time, timeScale = this.timeScale; - let interpolant = this._timeScaleInterpolant; - if (interpolant === null) { - interpolant = mixer._lendControlInterpolant(); - this._timeScaleInterpolant = interpolant; - } - const times = interpolant.parameterPositions, values = interpolant.sampleValues; - times[0] = now2; - times[1] = now2 + duration; - values[0] = startTimeScale / timeScale; - values[1] = endTimeScale / timeScale; - return this; - } - stopWarping() { - const timeScaleInterpolant = this._timeScaleInterpolant; - if (timeScaleInterpolant !== null) { - this._timeScaleInterpolant = null; - this._mixer._takeBackControlInterpolant(timeScaleInterpolant); - } - return this; - } - // Object Accessors - getMixer() { - return this._mixer; - } - getClip() { - return this._clip; - } - getRoot() { - return this._localRoot || this._mixer._root; - } - // Interna - _update(time, deltaTime, timeDirection, accuIndex) { - if (!this.enabled) { - this._updateWeight(time); - return; - } - const startTime = this._startTime; - if (startTime !== null) { - const timeRunning = (time - startTime) * timeDirection; - if (timeRunning < 0 || timeDirection === 0) { - deltaTime = 0; - } else { - this._startTime = null; - deltaTime = timeDirection * timeRunning; - } - } - deltaTime *= this._updateTimeScale(time); - const clipTime = this._updateTime(deltaTime); - const weight = this._updateWeight(time); - if (weight > 0) { - const interpolants = this._interpolants; - const propertyMixers = this._propertyBindings; - switch (this.blendMode) { - case AdditiveAnimationBlendMode: - for (let j = 0, m = interpolants.length; j !== m; ++j) { - interpolants[j].evaluate(clipTime); - propertyMixers[j].accumulateAdditive(weight); - } - break; - case NormalAnimationBlendMode: - default: - for (let j = 0, m = interpolants.length; j !== m; ++j) { - interpolants[j].evaluate(clipTime); - propertyMixers[j].accumulate(accuIndex, weight); - } - } - } - } - _updateWeight(time) { - let weight = 0; - if (this.enabled) { - weight = this.weight; - const interpolant = this._weightInterpolant; - if (interpolant !== null) { - const interpolantValue = interpolant.evaluate(time)[0]; - weight *= interpolantValue; - if (time > interpolant.parameterPositions[1]) { - this.stopFading(); - if (interpolantValue === 0) { - this.enabled = false; - } - } - } - } - this._effectiveWeight = weight; - return weight; - } - _updateTimeScale(time) { - let timeScale = 0; - if (!this.paused) { - timeScale = this.timeScale; - const interpolant = this._timeScaleInterpolant; - if (interpolant !== null) { - const interpolantValue = interpolant.evaluate(time)[0]; - timeScale *= interpolantValue; - if (time > interpolant.parameterPositions[1]) { - this.stopWarping(); - if (timeScale === 0) { - this.paused = true; - } else { - this.timeScale = timeScale; - } - } - } - } - this._effectiveTimeScale = timeScale; - return timeScale; - } - _updateTime(deltaTime) { - const duration = this._clip.duration; - const loop = this.loop; - let time = this.time + deltaTime; - let loopCount = this._loopCount; - const pingPong = loop === LoopPingPong; - if (deltaTime === 0) { - if (loopCount === -1) return time; - return pingPong && (loopCount & 1) === 1 ? duration - time : time; - } - if (loop === LoopOnce) { - if (loopCount === -1) { - this._loopCount = 0; - this._setEndings(true, true, false); - } - handle_stop: { - if (time >= duration) { - time = duration; - } else if (time < 0) { - time = 0; - } else { - this.time = time; - break handle_stop; - } - if (this.clampWhenFinished) this.paused = true; - else this.enabled = false; - this.time = time; - this._mixer.dispatchEvent({ - type: "finished", - action: this, - direction: deltaTime < 0 ? -1 : 1 - }); - } - } else { - if (loopCount === -1) { - if (deltaTime >= 0) { - loopCount = 0; - this._setEndings(true, this.repetitions === 0, pingPong); - } else { - this._setEndings(this.repetitions === 0, true, pingPong); - } - } - if (time >= duration || time < 0) { - const loopDelta = Math.floor(time / duration); - time -= duration * loopDelta; - loopCount += Math.abs(loopDelta); - const pending = this.repetitions - loopCount; - if (pending <= 0) { - if (this.clampWhenFinished) this.paused = true; - else this.enabled = false; - time = deltaTime > 0 ? duration : 0; - this.time = time; - this._mixer.dispatchEvent({ - type: "finished", - action: this, - direction: deltaTime > 0 ? 1 : -1 - }); - } else { - if (pending === 1) { - const atStart = deltaTime < 0; - this._setEndings(atStart, !atStart, pingPong); - } else { - this._setEndings(false, false, pingPong); - } - this._loopCount = loopCount; - this.time = time; - this._mixer.dispatchEvent({ - type: "loop", - action: this, - loopDelta - }); - } - } else { - this.time = time; - } - if (pingPong && (loopCount & 1) === 1) { - return duration - time; - } - } - return time; - } - _setEndings(atStart, atEnd, pingPong) { - const settings = this._interpolantSettings; - if (pingPong) { - settings.endingStart = ZeroSlopeEnding; - settings.endingEnd = ZeroSlopeEnding; - } else { - if (atStart) { - settings.endingStart = this.zeroSlopeAtStart ? ZeroSlopeEnding : ZeroCurvatureEnding; - } else { - settings.endingStart = WrapAroundEnding; - } - if (atEnd) { - settings.endingEnd = this.zeroSlopeAtEnd ? ZeroSlopeEnding : ZeroCurvatureEnding; - } else { - settings.endingEnd = WrapAroundEnding; - } - } - } - _scheduleFading(duration, weightNow, weightThen) { - const mixer = this._mixer, now2 = mixer.time; - let interpolant = this._weightInterpolant; - if (interpolant === null) { - interpolant = mixer._lendControlInterpolant(); - this._weightInterpolant = interpolant; - } - const times = interpolant.parameterPositions, values = interpolant.sampleValues; - times[0] = now2; - values[0] = weightNow; - times[1] = now2 + duration; - values[1] = weightThen; - return this; - } -} -const _controlInterpolantsResultBuffer = new Float32Array(1); -class AnimationMixer extends EventDispatcher { - static { - __name(this, "AnimationMixer"); - } - constructor(root) { - super(); - this._root = root; - this._initMemoryManager(); - this._accuIndex = 0; - this.time = 0; - this.timeScale = 1; - } - _bindAction(action, prototypeAction) { - const root = action._localRoot || this._root, tracks = action._clip.tracks, nTracks = tracks.length, bindings = action._propertyBindings, interpolants = action._interpolants, rootUuid = root.uuid, bindingsByRoot = this._bindingsByRootAndName; - let bindingsByName = bindingsByRoot[rootUuid]; - if (bindingsByName === void 0) { - bindingsByName = {}; - bindingsByRoot[rootUuid] = bindingsByName; - } - for (let i = 0; i !== nTracks; ++i) { - const track = tracks[i], trackName = track.name; - let binding = bindingsByName[trackName]; - if (binding !== void 0) { - ++binding.referenceCount; - bindings[i] = binding; - } else { - binding = bindings[i]; - if (binding !== void 0) { - if (binding._cacheIndex === null) { - ++binding.referenceCount; - this._addInactiveBinding(binding, rootUuid, trackName); - } - continue; - } - const path = prototypeAction && prototypeAction._propertyBindings[i].binding.parsedPath; - binding = new PropertyMixer( - PropertyBinding.create(root, trackName, path), - track.ValueTypeName, - track.getValueSize() - ); - ++binding.referenceCount; - this._addInactiveBinding(binding, rootUuid, trackName); - bindings[i] = binding; - } - interpolants[i].resultBuffer = binding.buffer; - } - } - _activateAction(action) { - if (!this._isActiveAction(action)) { - if (action._cacheIndex === null) { - const rootUuid = (action._localRoot || this._root).uuid, clipUuid = action._clip.uuid, actionsForClip = this._actionsByClip[clipUuid]; - this._bindAction( - action, - actionsForClip && actionsForClip.knownActions[0] - ); - this._addInactiveAction(action, clipUuid, rootUuid); - } - const bindings = action._propertyBindings; - for (let i = 0, n = bindings.length; i !== n; ++i) { - const binding = bindings[i]; - if (binding.useCount++ === 0) { - this._lendBinding(binding); - binding.saveOriginalState(); - } - } - this._lendAction(action); - } - } - _deactivateAction(action) { - if (this._isActiveAction(action)) { - const bindings = action._propertyBindings; - for (let i = 0, n = bindings.length; i !== n; ++i) { - const binding = bindings[i]; - if (--binding.useCount === 0) { - binding.restoreOriginalState(); - this._takeBackBinding(binding); - } - } - this._takeBackAction(action); - } - } - // Memory manager - _initMemoryManager() { - this._actions = []; - this._nActiveActions = 0; - this._actionsByClip = {}; - this._bindings = []; - this._nActiveBindings = 0; - this._bindingsByRootAndName = {}; - this._controlInterpolants = []; - this._nActiveControlInterpolants = 0; - const scope = this; - this.stats = { - actions: { - get total() { - return scope._actions.length; - }, - get inUse() { - return scope._nActiveActions; - } - }, - bindings: { - get total() { - return scope._bindings.length; - }, - get inUse() { - return scope._nActiveBindings; - } - }, - controlInterpolants: { - get total() { - return scope._controlInterpolants.length; - }, - get inUse() { - return scope._nActiveControlInterpolants; - } - } - }; - } - // Memory management for AnimationAction objects - _isActiveAction(action) { - const index = action._cacheIndex; - return index !== null && index < this._nActiveActions; - } - _addInactiveAction(action, clipUuid, rootUuid) { - const actions = this._actions, actionsByClip = this._actionsByClip; - let actionsForClip = actionsByClip[clipUuid]; - if (actionsForClip === void 0) { - actionsForClip = { - knownActions: [action], - actionByRoot: {} - }; - action._byClipCacheIndex = 0; - actionsByClip[clipUuid] = actionsForClip; - } else { - const knownActions = actionsForClip.knownActions; - action._byClipCacheIndex = knownActions.length; - knownActions.push(action); - } - action._cacheIndex = actions.length; - actions.push(action); - actionsForClip.actionByRoot[rootUuid] = action; - } - _removeInactiveAction(action) { - const actions = this._actions, lastInactiveAction = actions[actions.length - 1], cacheIndex = action._cacheIndex; - lastInactiveAction._cacheIndex = cacheIndex; - actions[cacheIndex] = lastInactiveAction; - actions.pop(); - action._cacheIndex = null; - const clipUuid = action._clip.uuid, actionsByClip = this._actionsByClip, actionsForClip = actionsByClip[clipUuid], knownActionsForClip = actionsForClip.knownActions, lastKnownAction = knownActionsForClip[knownActionsForClip.length - 1], byClipCacheIndex = action._byClipCacheIndex; - lastKnownAction._byClipCacheIndex = byClipCacheIndex; - knownActionsForClip[byClipCacheIndex] = lastKnownAction; - knownActionsForClip.pop(); - action._byClipCacheIndex = null; - const actionByRoot = actionsForClip.actionByRoot, rootUuid = (action._localRoot || this._root).uuid; - delete actionByRoot[rootUuid]; - if (knownActionsForClip.length === 0) { - delete actionsByClip[clipUuid]; - } - this._removeInactiveBindingsForAction(action); - } - _removeInactiveBindingsForAction(action) { - const bindings = action._propertyBindings; - for (let i = 0, n = bindings.length; i !== n; ++i) { - const binding = bindings[i]; - if (--binding.referenceCount === 0) { - this._removeInactiveBinding(binding); - } - } - } - _lendAction(action) { - const actions = this._actions, prevIndex = action._cacheIndex, lastActiveIndex = this._nActiveActions++, firstInactiveAction = actions[lastActiveIndex]; - action._cacheIndex = lastActiveIndex; - actions[lastActiveIndex] = action; - firstInactiveAction._cacheIndex = prevIndex; - actions[prevIndex] = firstInactiveAction; - } - _takeBackAction(action) { - const actions = this._actions, prevIndex = action._cacheIndex, firstInactiveIndex = --this._nActiveActions, lastActiveAction = actions[firstInactiveIndex]; - action._cacheIndex = firstInactiveIndex; - actions[firstInactiveIndex] = action; - lastActiveAction._cacheIndex = prevIndex; - actions[prevIndex] = lastActiveAction; - } - // Memory management for PropertyMixer objects - _addInactiveBinding(binding, rootUuid, trackName) { - const bindingsByRoot = this._bindingsByRootAndName, bindings = this._bindings; - let bindingByName = bindingsByRoot[rootUuid]; - if (bindingByName === void 0) { - bindingByName = {}; - bindingsByRoot[rootUuid] = bindingByName; - } - bindingByName[trackName] = binding; - binding._cacheIndex = bindings.length; - bindings.push(binding); - } - _removeInactiveBinding(binding) { - const bindings = this._bindings, propBinding = binding.binding, rootUuid = propBinding.rootNode.uuid, trackName = propBinding.path, bindingsByRoot = this._bindingsByRootAndName, bindingByName = bindingsByRoot[rootUuid], lastInactiveBinding = bindings[bindings.length - 1], cacheIndex = binding._cacheIndex; - lastInactiveBinding._cacheIndex = cacheIndex; - bindings[cacheIndex] = lastInactiveBinding; - bindings.pop(); - delete bindingByName[trackName]; - if (Object.keys(bindingByName).length === 0) { - delete bindingsByRoot[rootUuid]; - } - } - _lendBinding(binding) { - const bindings = this._bindings, prevIndex = binding._cacheIndex, lastActiveIndex = this._nActiveBindings++, firstInactiveBinding = bindings[lastActiveIndex]; - binding._cacheIndex = lastActiveIndex; - bindings[lastActiveIndex] = binding; - firstInactiveBinding._cacheIndex = prevIndex; - bindings[prevIndex] = firstInactiveBinding; - } - _takeBackBinding(binding) { - const bindings = this._bindings, prevIndex = binding._cacheIndex, firstInactiveIndex = --this._nActiveBindings, lastActiveBinding = bindings[firstInactiveIndex]; - binding._cacheIndex = firstInactiveIndex; - bindings[firstInactiveIndex] = binding; - lastActiveBinding._cacheIndex = prevIndex; - bindings[prevIndex] = lastActiveBinding; - } - // Memory management of Interpolants for weight and time scale - _lendControlInterpolant() { - const interpolants = this._controlInterpolants, lastActiveIndex = this._nActiveControlInterpolants++; - let interpolant = interpolants[lastActiveIndex]; - if (interpolant === void 0) { - interpolant = new LinearInterpolant( - new Float32Array(2), - new Float32Array(2), - 1, - _controlInterpolantsResultBuffer - ); - interpolant.__cacheIndex = lastActiveIndex; - interpolants[lastActiveIndex] = interpolant; - } - return interpolant; - } - _takeBackControlInterpolant(interpolant) { - const interpolants = this._controlInterpolants, prevIndex = interpolant.__cacheIndex, firstInactiveIndex = --this._nActiveControlInterpolants, lastActiveInterpolant = interpolants[firstInactiveIndex]; - interpolant.__cacheIndex = firstInactiveIndex; - interpolants[firstInactiveIndex] = interpolant; - lastActiveInterpolant.__cacheIndex = prevIndex; - interpolants[prevIndex] = lastActiveInterpolant; - } - // return an action for a clip optionally using a custom root target - // object (this method allocates a lot of dynamic memory in case a - // previously unknown clip/root combination is specified) - clipAction(clip, optionalRoot, blendMode) { - const root = optionalRoot || this._root, rootUuid = root.uuid; - let clipObject = typeof clip === "string" ? AnimationClip.findByName(root, clip) : clip; - const clipUuid = clipObject !== null ? clipObject.uuid : clip; - const actionsForClip = this._actionsByClip[clipUuid]; - let prototypeAction = null; - if (blendMode === void 0) { - if (clipObject !== null) { - blendMode = clipObject.blendMode; - } else { - blendMode = NormalAnimationBlendMode; - } - } - if (actionsForClip !== void 0) { - const existingAction = actionsForClip.actionByRoot[rootUuid]; - if (existingAction !== void 0 && existingAction.blendMode === blendMode) { - return existingAction; - } - prototypeAction = actionsForClip.knownActions[0]; - if (clipObject === null) - clipObject = prototypeAction._clip; - } - if (clipObject === null) return null; - const newAction = new AnimationAction(this, clipObject, optionalRoot, blendMode); - this._bindAction(newAction, prototypeAction); - this._addInactiveAction(newAction, clipUuid, rootUuid); - return newAction; - } - // get an existing action - existingAction(clip, optionalRoot) { - const root = optionalRoot || this._root, rootUuid = root.uuid, clipObject = typeof clip === "string" ? AnimationClip.findByName(root, clip) : clip, clipUuid = clipObject ? clipObject.uuid : clip, actionsForClip = this._actionsByClip[clipUuid]; - if (actionsForClip !== void 0) { - return actionsForClip.actionByRoot[rootUuid] || null; - } - return null; - } - // deactivates all previously scheduled actions - stopAllAction() { - const actions = this._actions, nActions = this._nActiveActions; - for (let i = nActions - 1; i >= 0; --i) { - actions[i].stop(); - } - return this; - } - // advance the time and update apply the animation - update(deltaTime) { - deltaTime *= this.timeScale; - const actions = this._actions, nActions = this._nActiveActions, time = this.time += deltaTime, timeDirection = Math.sign(deltaTime), accuIndex = this._accuIndex ^= 1; - for (let i = 0; i !== nActions; ++i) { - const action = actions[i]; - action._update(time, deltaTime, timeDirection, accuIndex); - } - const bindings = this._bindings, nBindings = this._nActiveBindings; - for (let i = 0; i !== nBindings; ++i) { - bindings[i].apply(accuIndex); - } - return this; - } - // Allows you to seek to a specific time in an animation. - setTime(timeInSeconds) { - this.time = 0; - for (let i = 0; i < this._actions.length; i++) { - this._actions[i].time = 0; - } - return this.update(timeInSeconds); - } - // return this mixer's root target object - getRoot() { - return this._root; - } - // free all resources specific to a particular clip - uncacheClip(clip) { - const actions = this._actions, clipUuid = clip.uuid, actionsByClip = this._actionsByClip, actionsForClip = actionsByClip[clipUuid]; - if (actionsForClip !== void 0) { - const actionsToRemove = actionsForClip.knownActions; - for (let i = 0, n = actionsToRemove.length; i !== n; ++i) { - const action = actionsToRemove[i]; - this._deactivateAction(action); - const cacheIndex = action._cacheIndex, lastInactiveAction = actions[actions.length - 1]; - action._cacheIndex = null; - action._byClipCacheIndex = null; - lastInactiveAction._cacheIndex = cacheIndex; - actions[cacheIndex] = lastInactiveAction; - actions.pop(); - this._removeInactiveBindingsForAction(action); - } - delete actionsByClip[clipUuid]; - } - } - // free all resources specific to a particular root target object - uncacheRoot(root) { - const rootUuid = root.uuid, actionsByClip = this._actionsByClip; - for (const clipUuid in actionsByClip) { - const actionByRoot = actionsByClip[clipUuid].actionByRoot, action = actionByRoot[rootUuid]; - if (action !== void 0) { - this._deactivateAction(action); - this._removeInactiveAction(action); - } - } - const bindingsByRoot = this._bindingsByRootAndName, bindingByName = bindingsByRoot[rootUuid]; - if (bindingByName !== void 0) { - for (const trackName in bindingByName) { - const binding = bindingByName[trackName]; - binding.restoreOriginalState(); - this._removeInactiveBinding(binding); - } - } - } - // remove a targeted clip from the cache - uncacheAction(clip, optionalRoot) { - const action = this.existingAction(clip, optionalRoot); - if (action !== null) { - this._deactivateAction(action); - this._removeInactiveAction(action); - } - } -} -class Uniform { - static { - __name(this, "Uniform"); - } - constructor(value) { - this.value = value; - } - clone() { - return new Uniform(this.value.clone === void 0 ? this.value : this.value.clone()); - } -} -let _id = 0; -class UniformsGroup extends EventDispatcher { - static { - __name(this, "UniformsGroup"); - } - constructor() { - super(); - this.isUniformsGroup = true; - Object.defineProperty(this, "id", { value: _id++ }); - this.name = ""; - this.usage = StaticDrawUsage; - this.uniforms = []; - } - add(uniform) { - this.uniforms.push(uniform); - return this; - } - remove(uniform) { - const index = this.uniforms.indexOf(uniform); - if (index !== -1) this.uniforms.splice(index, 1); - return this; - } - setName(name) { - this.name = name; - return this; - } - setUsage(value) { - this.usage = value; - return this; - } - dispose() { - this.dispatchEvent({ type: "dispose" }); - return this; - } - copy(source) { - this.name = source.name; - this.usage = source.usage; - const uniformsSource = source.uniforms; - this.uniforms.length = 0; - for (let i = 0, l = uniformsSource.length; i < l; i++) { - const uniforms = Array.isArray(uniformsSource[i]) ? uniformsSource[i] : [uniformsSource[i]]; - for (let j = 0; j < uniforms.length; j++) { - this.uniforms.push(uniforms[j].clone()); - } - } - return this; - } - clone() { - return new this.constructor().copy(this); - } -} -class InstancedInterleavedBuffer extends InterleavedBuffer { - static { - __name(this, "InstancedInterleavedBuffer"); - } - constructor(array, stride, meshPerAttribute = 1) { - super(array, stride); - this.isInstancedInterleavedBuffer = true; - this.meshPerAttribute = meshPerAttribute; - } - copy(source) { - super.copy(source); - this.meshPerAttribute = source.meshPerAttribute; - return this; - } - clone(data) { - const ib = super.clone(data); - ib.meshPerAttribute = this.meshPerAttribute; - return ib; - } - toJSON(data) { - const json = super.toJSON(data); - json.isInstancedInterleavedBuffer = true; - json.meshPerAttribute = this.meshPerAttribute; - return json; - } -} -class GLBufferAttribute { - static { - __name(this, "GLBufferAttribute"); - } - constructor(buffer, type, itemSize, elementSize, count) { - this.isGLBufferAttribute = true; - this.name = ""; - this.buffer = buffer; - this.type = type; - this.itemSize = itemSize; - this.elementSize = elementSize; - this.count = count; - this.version = 0; - } - set needsUpdate(value) { - if (value === true) this.version++; - } - setBuffer(buffer) { - this.buffer = buffer; - return this; - } - setType(type, elementSize) { - this.type = type; - this.elementSize = elementSize; - return this; - } - setItemSize(itemSize) { - this.itemSize = itemSize; - return this; - } - setCount(count) { - this.count = count; - return this; - } -} -const _matrix = /* @__PURE__ */ new Matrix4(); -class Raycaster { - static { - __name(this, "Raycaster"); - } - constructor(origin, direction, near = 0, far = Infinity) { - this.ray = new Ray(origin, direction); - this.near = near; - this.far = far; - this.camera = null; - this.layers = new Layers(); - this.params = { - Mesh: {}, - Line: { threshold: 1 }, - LOD: {}, - Points: { threshold: 1 }, - Sprite: {} - }; - } - set(origin, direction) { - this.ray.set(origin, direction); - } - setFromCamera(coords, camera) { - if (camera.isPerspectiveCamera) { - this.ray.origin.setFromMatrixPosition(camera.matrixWorld); - this.ray.direction.set(coords.x, coords.y, 0.5).unproject(camera).sub(this.ray.origin).normalize(); - this.camera = camera; - } else if (camera.isOrthographicCamera) { - this.ray.origin.set(coords.x, coords.y, (camera.near + camera.far) / (camera.near - camera.far)).unproject(camera); - this.ray.direction.set(0, 0, -1).transformDirection(camera.matrixWorld); - this.camera = camera; - } else { - console.error("THREE.Raycaster: Unsupported camera type: " + camera.type); - } - } - setFromXRController(controller) { - _matrix.identity().extractRotation(controller.matrixWorld); - this.ray.origin.setFromMatrixPosition(controller.matrixWorld); - this.ray.direction.set(0, 0, -1).applyMatrix4(_matrix); - return this; - } - intersectObject(object, recursive = true, intersects2 = []) { - intersect(object, this, intersects2, recursive); - intersects2.sort(ascSort); - return intersects2; - } - intersectObjects(objects, recursive = true, intersects2 = []) { - for (let i = 0, l = objects.length; i < l; i++) { - intersect(objects[i], this, intersects2, recursive); - } - intersects2.sort(ascSort); - return intersects2; - } -} -function ascSort(a, b) { - return a.distance - b.distance; -} -__name(ascSort, "ascSort"); -function intersect(object, raycaster, intersects2, recursive) { - let propagate = true; - if (object.layers.test(raycaster.layers)) { - const result = object.raycast(raycaster, intersects2); - if (result === false) propagate = false; - } - if (propagate === true && recursive === true) { - const children = object.children; - for (let i = 0, l = children.length; i < l; i++) { - intersect(children[i], raycaster, intersects2, true); - } - } -} -__name(intersect, "intersect"); -class Spherical { - static { - __name(this, "Spherical"); - } - constructor(radius = 1, phi = 0, theta = 0) { - this.radius = radius; - this.phi = phi; - this.theta = theta; - return this; - } - set(radius, phi, theta) { - this.radius = radius; - this.phi = phi; - this.theta = theta; - return this; - } - copy(other) { - this.radius = other.radius; - this.phi = other.phi; - this.theta = other.theta; - return this; - } - // restrict phi to be between EPS and PI-EPS - makeSafe() { - const EPS = 1e-6; - this.phi = Math.max(EPS, Math.min(Math.PI - EPS, this.phi)); - return this; - } - setFromVector3(v) { - return this.setFromCartesianCoords(v.x, v.y, v.z); - } - setFromCartesianCoords(x, y, z) { - this.radius = Math.sqrt(x * x + y * y + z * z); - if (this.radius === 0) { - this.theta = 0; - this.phi = 0; - } else { - this.theta = Math.atan2(x, z); - this.phi = Math.acos(clamp(y / this.radius, -1, 1)); - } - return this; - } - clone() { - return new this.constructor().copy(this); - } -} -class Cylindrical { - static { - __name(this, "Cylindrical"); - } - constructor(radius = 1, theta = 0, y = 0) { - this.radius = radius; - this.theta = theta; - this.y = y; - return this; - } - set(radius, theta, y) { - this.radius = radius; - this.theta = theta; - this.y = y; - return this; - } - copy(other) { - this.radius = other.radius; - this.theta = other.theta; - this.y = other.y; - return this; - } - setFromVector3(v) { - return this.setFromCartesianCoords(v.x, v.y, v.z); - } - setFromCartesianCoords(x, y, z) { - this.radius = Math.sqrt(x * x + z * z); - this.theta = Math.atan2(x, z); - this.y = y; - return this; - } - clone() { - return new this.constructor().copy(this); - } -} -class Matrix2 { - static { - __name(this, "Matrix2"); - } - constructor(n11, n12, n21, n22) { - Matrix2.prototype.isMatrix2 = true; - this.elements = [ - 1, - 0, - 0, - 1 - ]; - if (n11 !== void 0) { - this.set(n11, n12, n21, n22); - } - } - identity() { - this.set( - 1, - 0, - 0, - 1 - ); - return this; - } - fromArray(array, offset = 0) { - for (let i = 0; i < 4; i++) { - this.elements[i] = array[i + offset]; - } - return this; - } - set(n11, n12, n21, n22) { - const te2 = this.elements; - te2[0] = n11; - te2[2] = n12; - te2[1] = n21; - te2[3] = n22; - return this; - } -} -const _vector$4 = /* @__PURE__ */ new Vector2(); -class Box2 { - static { - __name(this, "Box2"); - } - constructor(min = new Vector2(Infinity, Infinity), max2 = new Vector2(-Infinity, -Infinity)) { - this.isBox2 = true; - this.min = min; - this.max = max2; - } - set(min, max2) { - this.min.copy(min); - this.max.copy(max2); - return this; - } - setFromPoints(points) { - this.makeEmpty(); - for (let i = 0, il = points.length; i < il; i++) { - this.expandByPoint(points[i]); - } - return this; - } - setFromCenterAndSize(center, size) { - const halfSize = _vector$4.copy(size).multiplyScalar(0.5); - this.min.copy(center).sub(halfSize); - this.max.copy(center).add(halfSize); - return this; - } - clone() { - return new this.constructor().copy(this); - } - copy(box) { - this.min.copy(box.min); - this.max.copy(box.max); - return this; - } - makeEmpty() { - this.min.x = this.min.y = Infinity; - this.max.x = this.max.y = -Infinity; - return this; - } - isEmpty() { - return this.max.x < this.min.x || this.max.y < this.min.y; - } - getCenter(target) { - return this.isEmpty() ? target.set(0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5); - } - getSize(target) { - return this.isEmpty() ? target.set(0, 0) : target.subVectors(this.max, this.min); - } - expandByPoint(point) { - this.min.min(point); - this.max.max(point); - return this; - } - expandByVector(vector) { - this.min.sub(vector); - this.max.add(vector); - return this; - } - expandByScalar(scalar) { - this.min.addScalar(-scalar); - this.max.addScalar(scalar); - return this; - } - containsPoint(point) { - return point.x >= this.min.x && point.x <= this.max.x && point.y >= this.min.y && point.y <= this.max.y; - } - containsBox(box) { - return this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y; - } - getParameter(point, target) { - return target.set( - (point.x - this.min.x) / (this.max.x - this.min.x), - (point.y - this.min.y) / (this.max.y - this.min.y) - ); - } - intersectsBox(box) { - return box.max.x >= this.min.x && box.min.x <= this.max.x && box.max.y >= this.min.y && box.min.y <= this.max.y; - } - clampPoint(point, target) { - return target.copy(point).clamp(this.min, this.max); - } - distanceToPoint(point) { - return this.clampPoint(point, _vector$4).distanceTo(point); - } - intersect(box) { - this.min.max(box.min); - this.max.min(box.max); - if (this.isEmpty()) this.makeEmpty(); - return this; - } - union(box) { - this.min.min(box.min); - this.max.max(box.max); - return this; - } - translate(offset) { - this.min.add(offset); - this.max.add(offset); - return this; - } - equals(box) { - return box.min.equals(this.min) && box.max.equals(this.max); - } -} -const _startP = /* @__PURE__ */ new Vector3(); -const _startEnd = /* @__PURE__ */ new Vector3(); -class Line3 { - static { - __name(this, "Line3"); - } - constructor(start = new Vector3(), end = new Vector3()) { - this.start = start; - this.end = end; - } - set(start, end) { - this.start.copy(start); - this.end.copy(end); - return this; - } - copy(line) { - this.start.copy(line.start); - this.end.copy(line.end); - return this; - } - getCenter(target) { - return target.addVectors(this.start, this.end).multiplyScalar(0.5); - } - delta(target) { - return target.subVectors(this.end, this.start); - } - distanceSq() { - return this.start.distanceToSquared(this.end); - } - distance() { - return this.start.distanceTo(this.end); - } - at(t2, target) { - return this.delta(target).multiplyScalar(t2).add(this.start); - } - closestPointToPointParameter(point, clampToLine) { - _startP.subVectors(point, this.start); - _startEnd.subVectors(this.end, this.start); - const startEnd2 = _startEnd.dot(_startEnd); - const startEnd_startP = _startEnd.dot(_startP); - let t2 = startEnd_startP / startEnd2; - if (clampToLine) { - t2 = clamp(t2, 0, 1); - } - return t2; - } - closestPointToPoint(point, clampToLine, target) { - const t2 = this.closestPointToPointParameter(point, clampToLine); - return this.delta(target).multiplyScalar(t2).add(this.start); - } - applyMatrix4(matrix) { - this.start.applyMatrix4(matrix); - this.end.applyMatrix4(matrix); - return this; - } - equals(line) { - return line.start.equals(this.start) && line.end.equals(this.end); - } - clone() { - return new this.constructor().copy(this); - } -} -const _vector$3 = /* @__PURE__ */ new Vector3(); -class SpotLightHelper extends Object3D { - static { - __name(this, "SpotLightHelper"); - } - constructor(light, color) { - super(); - this.light = light; - this.matrixAutoUpdate = false; - this.color = color; - this.type = "SpotLightHelper"; - const geometry = new BufferGeometry(); - const positions = [ - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - -1, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - -1, - 1 - ]; - for (let i = 0, j = 1, l = 32; i < l; i++, j++) { - const p1 = i / l * Math.PI * 2; - const p2 = j / l * Math.PI * 2; - positions.push( - Math.cos(p1), - Math.sin(p1), - 1, - Math.cos(p2), - Math.sin(p2), - 1 - ); - } - geometry.setAttribute("position", new Float32BufferAttribute(positions, 3)); - const material = new LineBasicMaterial({ fog: false, toneMapped: false }); - this.cone = new LineSegments(geometry, material); - this.add(this.cone); - this.update(); - } - dispose() { - this.cone.geometry.dispose(); - this.cone.material.dispose(); - } - update() { - this.light.updateWorldMatrix(true, false); - this.light.target.updateWorldMatrix(true, false); - if (this.parent) { - this.parent.updateWorldMatrix(true); - this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld); - } else { - this.matrix.copy(this.light.matrixWorld); - } - this.matrixWorld.copy(this.light.matrixWorld); - const coneLength = this.light.distance ? this.light.distance : 1e3; - const coneWidth = coneLength * Math.tan(this.light.angle); - this.cone.scale.set(coneWidth, coneWidth, coneLength); - _vector$3.setFromMatrixPosition(this.light.target.matrixWorld); - this.cone.lookAt(_vector$3); - if (this.color !== void 0) { - this.cone.material.color.set(this.color); - } else { - this.cone.material.color.copy(this.light.color); - } - } -} -const _vector$2 = /* @__PURE__ */ new Vector3(); -const _boneMatrix = /* @__PURE__ */ new Matrix4(); -const _matrixWorldInv = /* @__PURE__ */ new Matrix4(); -class SkeletonHelper extends LineSegments { - static { - __name(this, "SkeletonHelper"); - } - constructor(object) { - const bones = getBoneList(object); - const geometry = new BufferGeometry(); - const vertices = []; - const colors = []; - const color1 = new Color(0, 0, 1); - const color2 = new Color(0, 1, 0); - for (let i = 0; i < bones.length; i++) { - const bone = bones[i]; - if (bone.parent && bone.parent.isBone) { - vertices.push(0, 0, 0); - vertices.push(0, 0, 0); - colors.push(color1.r, color1.g, color1.b); - colors.push(color2.r, color2.g, color2.b); - } - } - geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - geometry.setAttribute("color", new Float32BufferAttribute(colors, 3)); - const material = new LineBasicMaterial({ vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true }); - super(geometry, material); - this.isSkeletonHelper = true; - this.type = "SkeletonHelper"; - this.root = object; - this.bones = bones; - this.matrix = object.matrixWorld; - this.matrixAutoUpdate = false; - } - updateMatrixWorld(force) { - const bones = this.bones; - const geometry = this.geometry; - const position = geometry.getAttribute("position"); - _matrixWorldInv.copy(this.root.matrixWorld).invert(); - for (let i = 0, j = 0; i < bones.length; i++) { - const bone = bones[i]; - if (bone.parent && bone.parent.isBone) { - _boneMatrix.multiplyMatrices(_matrixWorldInv, bone.matrixWorld); - _vector$2.setFromMatrixPosition(_boneMatrix); - position.setXYZ(j, _vector$2.x, _vector$2.y, _vector$2.z); - _boneMatrix.multiplyMatrices(_matrixWorldInv, bone.parent.matrixWorld); - _vector$2.setFromMatrixPosition(_boneMatrix); - position.setXYZ(j + 1, _vector$2.x, _vector$2.y, _vector$2.z); - j += 2; - } - } - geometry.getAttribute("position").needsUpdate = true; - super.updateMatrixWorld(force); - } - dispose() { - this.geometry.dispose(); - this.material.dispose(); - } -} -function getBoneList(object) { - const boneList = []; - if (object.isBone === true) { - boneList.push(object); - } - for (let i = 0; i < object.children.length; i++) { - boneList.push.apply(boneList, getBoneList(object.children[i])); - } - return boneList; -} -__name(getBoneList, "getBoneList"); -class PointLightHelper extends Mesh { - static { - __name(this, "PointLightHelper"); - } - constructor(light, sphereSize, color) { - const geometry = new SphereGeometry(sphereSize, 4, 2); - const material = new MeshBasicMaterial({ wireframe: true, fog: false, toneMapped: false }); - super(geometry, material); - this.light = light; - this.color = color; - this.type = "PointLightHelper"; - this.matrix = this.light.matrixWorld; - this.matrixAutoUpdate = false; - this.update(); - } - dispose() { - this.geometry.dispose(); - this.material.dispose(); - } - update() { - this.light.updateWorldMatrix(true, false); - if (this.color !== void 0) { - this.material.color.set(this.color); - } else { - this.material.color.copy(this.light.color); - } - } -} -const _vector$1 = /* @__PURE__ */ new Vector3(); -const _color1 = /* @__PURE__ */ new Color(); -const _color2 = /* @__PURE__ */ new Color(); -class HemisphereLightHelper extends Object3D { - static { - __name(this, "HemisphereLightHelper"); - } - constructor(light, size, color) { - super(); - this.light = light; - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; - this.color = color; - this.type = "HemisphereLightHelper"; - const geometry = new OctahedronGeometry(size); - geometry.rotateY(Math.PI * 0.5); - this.material = new MeshBasicMaterial({ wireframe: true, fog: false, toneMapped: false }); - if (this.color === void 0) this.material.vertexColors = true; - const position = geometry.getAttribute("position"); - const colors = new Float32Array(position.count * 3); - geometry.setAttribute("color", new BufferAttribute(colors, 3)); - this.add(new Mesh(geometry, this.material)); - this.update(); - } - dispose() { - this.children[0].geometry.dispose(); - this.children[0].material.dispose(); - } - update() { - const mesh = this.children[0]; - if (this.color !== void 0) { - this.material.color.set(this.color); - } else { - const colors = mesh.geometry.getAttribute("color"); - _color1.copy(this.light.color); - _color2.copy(this.light.groundColor); - for (let i = 0, l = colors.count; i < l; i++) { - const color = i < l / 2 ? _color1 : _color2; - colors.setXYZ(i, color.r, color.g, color.b); - } - colors.needsUpdate = true; - } - this.light.updateWorldMatrix(true, false); - mesh.lookAt(_vector$1.setFromMatrixPosition(this.light.matrixWorld).negate()); - } -} -class GridHelper extends LineSegments { - static { - __name(this, "GridHelper"); - } - constructor(size = 10, divisions = 10, color1 = 4473924, color2 = 8947848) { - color1 = new Color(color1); - color2 = new Color(color2); - const center = divisions / 2; - const step = size / divisions; - const halfSize = size / 2; - const vertices = [], colors = []; - for (let i = 0, j = 0, k = -halfSize; i <= divisions; i++, k += step) { - vertices.push(-halfSize, 0, k, halfSize, 0, k); - vertices.push(k, 0, -halfSize, k, 0, halfSize); - const color = i === center ? color1 : color2; - color.toArray(colors, j); - j += 3; - color.toArray(colors, j); - j += 3; - color.toArray(colors, j); - j += 3; - color.toArray(colors, j); - j += 3; - } - const geometry = new BufferGeometry(); - geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - geometry.setAttribute("color", new Float32BufferAttribute(colors, 3)); - const material = new LineBasicMaterial({ vertexColors: true, toneMapped: false }); - super(geometry, material); - this.type = "GridHelper"; - } - dispose() { - this.geometry.dispose(); - this.material.dispose(); - } -} -class PolarGridHelper extends LineSegments { - static { - __name(this, "PolarGridHelper"); - } - constructor(radius = 10, sectors = 16, rings = 8, divisions = 64, color1 = 4473924, color2 = 8947848) { - color1 = new Color(color1); - color2 = new Color(color2); - const vertices = []; - const colors = []; - if (sectors > 1) { - for (let i = 0; i < sectors; i++) { - const v = i / sectors * (Math.PI * 2); - const x = Math.sin(v) * radius; - const z = Math.cos(v) * radius; - vertices.push(0, 0, 0); - vertices.push(x, 0, z); - const color = i & 1 ? color1 : color2; - colors.push(color.r, color.g, color.b); - colors.push(color.r, color.g, color.b); - } - } - for (let i = 0; i < rings; i++) { - const color = i & 1 ? color1 : color2; - const r = radius - radius / rings * i; - for (let j = 0; j < divisions; j++) { - let v = j / divisions * (Math.PI * 2); - let x = Math.sin(v) * r; - let z = Math.cos(v) * r; - vertices.push(x, 0, z); - colors.push(color.r, color.g, color.b); - v = (j + 1) / divisions * (Math.PI * 2); - x = Math.sin(v) * r; - z = Math.cos(v) * r; - vertices.push(x, 0, z); - colors.push(color.r, color.g, color.b); - } - } - const geometry = new BufferGeometry(); - geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - geometry.setAttribute("color", new Float32BufferAttribute(colors, 3)); - const material = new LineBasicMaterial({ vertexColors: true, toneMapped: false }); - super(geometry, material); - this.type = "PolarGridHelper"; - } - dispose() { - this.geometry.dispose(); - this.material.dispose(); - } -} -const _v1 = /* @__PURE__ */ new Vector3(); -const _v2 = /* @__PURE__ */ new Vector3(); -const _v3 = /* @__PURE__ */ new Vector3(); -class DirectionalLightHelper extends Object3D { - static { - __name(this, "DirectionalLightHelper"); - } - constructor(light, size, color) { - super(); - this.light = light; - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; - this.color = color; - this.type = "DirectionalLightHelper"; - if (size === void 0) size = 1; - let geometry = new BufferGeometry(); - geometry.setAttribute("position", new Float32BufferAttribute([ - -size, - size, - 0, - size, - size, - 0, - size, - -size, - 0, - -size, - -size, - 0, - -size, - size, - 0 - ], 3)); - const material = new LineBasicMaterial({ fog: false, toneMapped: false }); - this.lightPlane = new Line(geometry, material); - this.add(this.lightPlane); - geometry = new BufferGeometry(); - geometry.setAttribute("position", new Float32BufferAttribute([0, 0, 0, 0, 0, 1], 3)); - this.targetLine = new Line(geometry, material); - this.add(this.targetLine); - this.update(); - } - dispose() { - this.lightPlane.geometry.dispose(); - this.lightPlane.material.dispose(); - this.targetLine.geometry.dispose(); - this.targetLine.material.dispose(); - } - update() { - this.light.updateWorldMatrix(true, false); - this.light.target.updateWorldMatrix(true, false); - _v1.setFromMatrixPosition(this.light.matrixWorld); - _v2.setFromMatrixPosition(this.light.target.matrixWorld); - _v3.subVectors(_v2, _v1); - this.lightPlane.lookAt(_v2); - if (this.color !== void 0) { - this.lightPlane.material.color.set(this.color); - this.targetLine.material.color.set(this.color); - } else { - this.lightPlane.material.color.copy(this.light.color); - this.targetLine.material.color.copy(this.light.color); - } - this.targetLine.lookAt(_v2); - this.targetLine.scale.z = _v3.length(); - } -} -const _vector = /* @__PURE__ */ new Vector3(); -const _camera = /* @__PURE__ */ new Camera(); -class CameraHelper extends LineSegments { - static { - __name(this, "CameraHelper"); - } - constructor(camera) { - const geometry = new BufferGeometry(); - const material = new LineBasicMaterial({ color: 16777215, vertexColors: true, toneMapped: false }); - const vertices = []; - const colors = []; - const pointMap = {}; - addLine("n1", "n2"); - addLine("n2", "n4"); - addLine("n4", "n3"); - addLine("n3", "n1"); - addLine("f1", "f2"); - addLine("f2", "f4"); - addLine("f4", "f3"); - addLine("f3", "f1"); - addLine("n1", "f1"); - addLine("n2", "f2"); - addLine("n3", "f3"); - addLine("n4", "f4"); - addLine("p", "n1"); - addLine("p", "n2"); - addLine("p", "n3"); - addLine("p", "n4"); - addLine("u1", "u2"); - addLine("u2", "u3"); - addLine("u3", "u1"); - addLine("c", "t"); - addLine("p", "c"); - addLine("cn1", "cn2"); - addLine("cn3", "cn4"); - addLine("cf1", "cf2"); - addLine("cf3", "cf4"); - function addLine(a, b) { - addPoint(a); - addPoint(b); - } - __name(addLine, "addLine"); - function addPoint(id2) { - vertices.push(0, 0, 0); - colors.push(0, 0, 0); - if (pointMap[id2] === void 0) { - pointMap[id2] = []; - } - pointMap[id2].push(vertices.length / 3 - 1); - } - __name(addPoint, "addPoint"); - geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - geometry.setAttribute("color", new Float32BufferAttribute(colors, 3)); - super(geometry, material); - this.type = "CameraHelper"; - this.camera = camera; - if (this.camera.updateProjectionMatrix) this.camera.updateProjectionMatrix(); - this.matrix = camera.matrixWorld; - this.matrixAutoUpdate = false; - this.pointMap = pointMap; - this.update(); - const colorFrustum = new Color(16755200); - const colorCone = new Color(16711680); - const colorUp = new Color(43775); - const colorTarget = new Color(16777215); - const colorCross = new Color(3355443); - this.setColors(colorFrustum, colorCone, colorUp, colorTarget, colorCross); - } - setColors(frustum, cone, up, target, cross) { - const geometry = this.geometry; - const colorAttribute = geometry.getAttribute("color"); - colorAttribute.setXYZ(0, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(1, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(2, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(3, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(4, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(5, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(6, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(7, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(8, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(9, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(10, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(11, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(12, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(13, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(14, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(15, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(16, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(17, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(18, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(19, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(20, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(21, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(22, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(23, frustum.r, frustum.g, frustum.b); - colorAttribute.setXYZ(24, cone.r, cone.g, cone.b); - colorAttribute.setXYZ(25, cone.r, cone.g, cone.b); - colorAttribute.setXYZ(26, cone.r, cone.g, cone.b); - colorAttribute.setXYZ(27, cone.r, cone.g, cone.b); - colorAttribute.setXYZ(28, cone.r, cone.g, cone.b); - colorAttribute.setXYZ(29, cone.r, cone.g, cone.b); - colorAttribute.setXYZ(30, cone.r, cone.g, cone.b); - colorAttribute.setXYZ(31, cone.r, cone.g, cone.b); - colorAttribute.setXYZ(32, up.r, up.g, up.b); - colorAttribute.setXYZ(33, up.r, up.g, up.b); - colorAttribute.setXYZ(34, up.r, up.g, up.b); - colorAttribute.setXYZ(35, up.r, up.g, up.b); - colorAttribute.setXYZ(36, up.r, up.g, up.b); - colorAttribute.setXYZ(37, up.r, up.g, up.b); - colorAttribute.setXYZ(38, target.r, target.g, target.b); - colorAttribute.setXYZ(39, target.r, target.g, target.b); - colorAttribute.setXYZ(40, cross.r, cross.g, cross.b); - colorAttribute.setXYZ(41, cross.r, cross.g, cross.b); - colorAttribute.setXYZ(42, cross.r, cross.g, cross.b); - colorAttribute.setXYZ(43, cross.r, cross.g, cross.b); - colorAttribute.setXYZ(44, cross.r, cross.g, cross.b); - colorAttribute.setXYZ(45, cross.r, cross.g, cross.b); - colorAttribute.setXYZ(46, cross.r, cross.g, cross.b); - colorAttribute.setXYZ(47, cross.r, cross.g, cross.b); - colorAttribute.setXYZ(48, cross.r, cross.g, cross.b); - colorAttribute.setXYZ(49, cross.r, cross.g, cross.b); - colorAttribute.needsUpdate = true; - } - update() { - const geometry = this.geometry; - const pointMap = this.pointMap; - const w = 1, h = 1; - _camera.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse); - setPoint("c", pointMap, geometry, _camera, 0, 0, -1); - setPoint("t", pointMap, geometry, _camera, 0, 0, 1); - setPoint("n1", pointMap, geometry, _camera, -w, -h, -1); - setPoint("n2", pointMap, geometry, _camera, w, -h, -1); - setPoint("n3", pointMap, geometry, _camera, -w, h, -1); - setPoint("n4", pointMap, geometry, _camera, w, h, -1); - setPoint("f1", pointMap, geometry, _camera, -w, -h, 1); - setPoint("f2", pointMap, geometry, _camera, w, -h, 1); - setPoint("f3", pointMap, geometry, _camera, -w, h, 1); - setPoint("f4", pointMap, geometry, _camera, w, h, 1); - setPoint("u1", pointMap, geometry, _camera, w * 0.7, h * 1.1, -1); - setPoint("u2", pointMap, geometry, _camera, -w * 0.7, h * 1.1, -1); - setPoint("u3", pointMap, geometry, _camera, 0, h * 2, -1); - setPoint("cf1", pointMap, geometry, _camera, -w, 0, 1); - setPoint("cf2", pointMap, geometry, _camera, w, 0, 1); - setPoint("cf3", pointMap, geometry, _camera, 0, -h, 1); - setPoint("cf4", pointMap, geometry, _camera, 0, h, 1); - setPoint("cn1", pointMap, geometry, _camera, -w, 0, -1); - setPoint("cn2", pointMap, geometry, _camera, w, 0, -1); - setPoint("cn3", pointMap, geometry, _camera, 0, -h, -1); - setPoint("cn4", pointMap, geometry, _camera, 0, h, -1); - geometry.getAttribute("position").needsUpdate = true; - } - dispose() { - this.geometry.dispose(); - this.material.dispose(); - } -} -function setPoint(point, pointMap, geometry, camera, x, y, z) { - _vector.set(x, y, z).unproject(camera); - const points = pointMap[point]; - if (points !== void 0) { - const position = geometry.getAttribute("position"); - for (let i = 0, l = points.length; i < l; i++) { - position.setXYZ(points[i], _vector.x, _vector.y, _vector.z); - } - } -} -__name(setPoint, "setPoint"); -const _box = /* @__PURE__ */ new Box3(); -class BoxHelper extends LineSegments { - static { - __name(this, "BoxHelper"); - } - constructor(object, color = 16776960) { - const indices = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]); - const positions = new Float32Array(8 * 3); - const geometry = new BufferGeometry(); - geometry.setIndex(new BufferAttribute(indices, 1)); - geometry.setAttribute("position", new BufferAttribute(positions, 3)); - super(geometry, new LineBasicMaterial({ color, toneMapped: false })); - this.object = object; - this.type = "BoxHelper"; - this.matrixAutoUpdate = false; - this.update(); - } - update(object) { - if (object !== void 0) { - console.warn("THREE.BoxHelper: .update() has no longer arguments."); - } - if (this.object !== void 0) { - _box.setFromObject(this.object); - } - if (_box.isEmpty()) return; - const min = _box.min; - const max2 = _box.max; - const position = this.geometry.attributes.position; - const array = position.array; - array[0] = max2.x; - array[1] = max2.y; - array[2] = max2.z; - array[3] = min.x; - array[4] = max2.y; - array[5] = max2.z; - array[6] = min.x; - array[7] = min.y; - array[8] = max2.z; - array[9] = max2.x; - array[10] = min.y; - array[11] = max2.z; - array[12] = max2.x; - array[13] = max2.y; - array[14] = min.z; - array[15] = min.x; - array[16] = max2.y; - array[17] = min.z; - array[18] = min.x; - array[19] = min.y; - array[20] = min.z; - array[21] = max2.x; - array[22] = min.y; - array[23] = min.z; - position.needsUpdate = true; - this.geometry.computeBoundingSphere(); - } - setFromObject(object) { - this.object = object; - this.update(); - return this; - } - copy(source, recursive) { - super.copy(source, recursive); - this.object = source.object; - return this; - } - dispose() { - this.geometry.dispose(); - this.material.dispose(); - } -} -class Box3Helper extends LineSegments { - static { - __name(this, "Box3Helper"); - } - constructor(box, color = 16776960) { - const indices = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]); - const positions = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1]; - const geometry = new BufferGeometry(); - geometry.setIndex(new BufferAttribute(indices, 1)); - geometry.setAttribute("position", new Float32BufferAttribute(positions, 3)); - super(geometry, new LineBasicMaterial({ color, toneMapped: false })); - this.box = box; - this.type = "Box3Helper"; - this.geometry.computeBoundingSphere(); - } - updateMatrixWorld(force) { - const box = this.box; - if (box.isEmpty()) return; - box.getCenter(this.position); - box.getSize(this.scale); - this.scale.multiplyScalar(0.5); - super.updateMatrixWorld(force); - } - dispose() { - this.geometry.dispose(); - this.material.dispose(); - } -} -class PlaneHelper extends Line { - static { - __name(this, "PlaneHelper"); - } - constructor(plane, size = 1, hex = 16776960) { - const color = hex; - const positions = [1, -1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0]; - const geometry = new BufferGeometry(); - geometry.setAttribute("position", new Float32BufferAttribute(positions, 3)); - geometry.computeBoundingSphere(); - super(geometry, new LineBasicMaterial({ color, toneMapped: false })); - this.type = "PlaneHelper"; - this.plane = plane; - this.size = size; - const positions2 = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0]; - const geometry2 = new BufferGeometry(); - geometry2.setAttribute("position", new Float32BufferAttribute(positions2, 3)); - geometry2.computeBoundingSphere(); - this.add(new Mesh(geometry2, new MeshBasicMaterial({ color, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false }))); - } - updateMatrixWorld(force) { - this.position.set(0, 0, 0); - this.scale.set(0.5 * this.size, 0.5 * this.size, 1); - this.lookAt(this.plane.normal); - this.translateZ(-this.plane.constant); - super.updateMatrixWorld(force); - } - dispose() { - this.geometry.dispose(); - this.material.dispose(); - this.children[0].geometry.dispose(); - this.children[0].material.dispose(); - } -} -const _axis = /* @__PURE__ */ new Vector3(); -let _lineGeometry, _coneGeometry; -class ArrowHelper extends Object3D { - static { - __name(this, "ArrowHelper"); - } - // dir is assumed to be normalized - constructor(dir = new Vector3(0, 0, 1), origin = new Vector3(0, 0, 0), length = 1, color = 16776960, headLength = length * 0.2, headWidth = headLength * 0.2) { - super(); - this.type = "ArrowHelper"; - if (_lineGeometry === void 0) { - _lineGeometry = new BufferGeometry(); - _lineGeometry.setAttribute("position", new Float32BufferAttribute([0, 0, 0, 0, 1, 0], 3)); - _coneGeometry = new CylinderGeometry(0, 0.5, 1, 5, 1); - _coneGeometry.translate(0, -0.5, 0); - } - this.position.copy(origin); - this.line = new Line(_lineGeometry, new LineBasicMaterial({ color, toneMapped: false })); - this.line.matrixAutoUpdate = false; - this.add(this.line); - this.cone = new Mesh(_coneGeometry, new MeshBasicMaterial({ color, toneMapped: false })); - this.cone.matrixAutoUpdate = false; - this.add(this.cone); - this.setDirection(dir); - this.setLength(length, headLength, headWidth); - } - setDirection(dir) { - if (dir.y > 0.99999) { - this.quaternion.set(0, 0, 0, 1); - } else if (dir.y < -0.99999) { - this.quaternion.set(1, 0, 0, 0); - } else { - _axis.set(dir.z, 0, -dir.x).normalize(); - const radians = Math.acos(dir.y); - this.quaternion.setFromAxisAngle(_axis, radians); - } - } - setLength(length, headLength = length * 0.2, headWidth = headLength * 0.2) { - this.line.scale.set(1, Math.max(1e-4, length - headLength), 1); - this.line.updateMatrix(); - this.cone.scale.set(headWidth, headLength, headWidth); - this.cone.position.y = length; - this.cone.updateMatrix(); - } - setColor(color) { - this.line.material.color.set(color); - this.cone.material.color.set(color); - } - copy(source) { - super.copy(source, false); - this.line.copy(source.line); - this.cone.copy(source.cone); - return this; - } - dispose() { - this.line.geometry.dispose(); - this.line.material.dispose(); - this.cone.geometry.dispose(); - this.cone.material.dispose(); - } -} -class AxesHelper extends LineSegments { - static { - __name(this, "AxesHelper"); - } - constructor(size = 1) { - const vertices = [ - 0, - 0, - 0, - size, - 0, - 0, - 0, - 0, - 0, - 0, - size, - 0, - 0, - 0, - 0, - 0, - 0, - size - ]; - const colors = [ - 1, - 0, - 0, - 1, - 0.6, - 0, - 0, - 1, - 0, - 0.6, - 1, - 0, - 0, - 0, - 1, - 0, - 0.6, - 1 - ]; - const geometry = new BufferGeometry(); - geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - geometry.setAttribute("color", new Float32BufferAttribute(colors, 3)); - const material = new LineBasicMaterial({ vertexColors: true, toneMapped: false }); - super(geometry, material); - this.type = "AxesHelper"; - } - setColors(xAxisColor, yAxisColor, zAxisColor) { - const color = new Color(); - const array = this.geometry.attributes.color.array; - color.set(xAxisColor); - color.toArray(array, 0); - color.toArray(array, 3); - color.set(yAxisColor); - color.toArray(array, 6); - color.toArray(array, 9); - color.set(zAxisColor); - color.toArray(array, 12); - color.toArray(array, 15); - this.geometry.attributes.color.needsUpdate = true; - return this; - } - dispose() { - this.geometry.dispose(); - this.material.dispose(); - } -} -class ShapePath { - static { - __name(this, "ShapePath"); - } - constructor() { - this.type = "ShapePath"; - this.color = new Color(); - this.subPaths = []; - this.currentPath = null; - } - moveTo(x, y) { - this.currentPath = new Path(); - this.subPaths.push(this.currentPath); - this.currentPath.moveTo(x, y); - return this; - } - lineTo(x, y) { - this.currentPath.lineTo(x, y); - return this; - } - quadraticCurveTo(aCPx, aCPy, aX, aY) { - this.currentPath.quadraticCurveTo(aCPx, aCPy, aX, aY); - return this; - } - bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) { - this.currentPath.bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY); - return this; - } - splineThru(pts) { - this.currentPath.splineThru(pts); - return this; - } - toShapes(isCCW) { - function toShapesNoHoles(inSubpaths) { - const shapes2 = []; - for (let i = 0, l = inSubpaths.length; i < l; i++) { - const tmpPath2 = inSubpaths[i]; - const tmpShape2 = new Shape(); - tmpShape2.curves = tmpPath2.curves; - shapes2.push(tmpShape2); - } - return shapes2; - } - __name(toShapesNoHoles, "toShapesNoHoles"); - function isPointInsidePolygon(inPt, inPolygon) { - const polyLen = inPolygon.length; - let inside = false; - for (let p = polyLen - 1, q = 0; q < polyLen; p = q++) { - let edgeLowPt = inPolygon[p]; - let edgeHighPt = inPolygon[q]; - let edgeDx = edgeHighPt.x - edgeLowPt.x; - let edgeDy = edgeHighPt.y - edgeLowPt.y; - if (Math.abs(edgeDy) > Number.EPSILON) { - if (edgeDy < 0) { - edgeLowPt = inPolygon[q]; - edgeDx = -edgeDx; - edgeHighPt = inPolygon[p]; - edgeDy = -edgeDy; - } - if (inPt.y < edgeLowPt.y || inPt.y > edgeHighPt.y) continue; - if (inPt.y === edgeLowPt.y) { - if (inPt.x === edgeLowPt.x) return true; - } else { - const perpEdge = edgeDy * (inPt.x - edgeLowPt.x) - edgeDx * (inPt.y - edgeLowPt.y); - if (perpEdge === 0) return true; - if (perpEdge < 0) continue; - inside = !inside; - } - } else { - if (inPt.y !== edgeLowPt.y) continue; - if (edgeHighPt.x <= inPt.x && inPt.x <= edgeLowPt.x || edgeLowPt.x <= inPt.x && inPt.x <= edgeHighPt.x) return true; - } - } - return inside; - } - __name(isPointInsidePolygon, "isPointInsidePolygon"); - const isClockWise = ShapeUtils.isClockWise; - const subPaths = this.subPaths; - if (subPaths.length === 0) return []; - let solid, tmpPath, tmpShape; - const shapes = []; - if (subPaths.length === 1) { - tmpPath = subPaths[0]; - tmpShape = new Shape(); - tmpShape.curves = tmpPath.curves; - shapes.push(tmpShape); - return shapes; - } - let holesFirst = !isClockWise(subPaths[0].getPoints()); - holesFirst = isCCW ? !holesFirst : holesFirst; - const betterShapeHoles = []; - const newShapes = []; - let newShapeHoles = []; - let mainIdx = 0; - let tmpPoints; - newShapes[mainIdx] = void 0; - newShapeHoles[mainIdx] = []; - for (let i = 0, l = subPaths.length; i < l; i++) { - tmpPath = subPaths[i]; - tmpPoints = tmpPath.getPoints(); - solid = isClockWise(tmpPoints); - solid = isCCW ? !solid : solid; - if (solid) { - if (!holesFirst && newShapes[mainIdx]) mainIdx++; - newShapes[mainIdx] = { s: new Shape(), p: tmpPoints }; - newShapes[mainIdx].s.curves = tmpPath.curves; - if (holesFirst) mainIdx++; - newShapeHoles[mainIdx] = []; - } else { - newShapeHoles[mainIdx].push({ h: tmpPath, p: tmpPoints[0] }); - } - } - if (!newShapes[0]) return toShapesNoHoles(subPaths); - if (newShapes.length > 1) { - let ambiguous = false; - let toChange = 0; - for (let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx++) { - betterShapeHoles[sIdx] = []; - } - for (let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx++) { - const sho = newShapeHoles[sIdx]; - for (let hIdx = 0; hIdx < sho.length; hIdx++) { - const ho = sho[hIdx]; - let hole_unassigned = true; - for (let s2Idx = 0; s2Idx < newShapes.length; s2Idx++) { - if (isPointInsidePolygon(ho.p, newShapes[s2Idx].p)) { - if (sIdx !== s2Idx) toChange++; - if (hole_unassigned) { - hole_unassigned = false; - betterShapeHoles[s2Idx].push(ho); - } else { - ambiguous = true; - } - } - } - if (hole_unassigned) { - betterShapeHoles[sIdx].push(ho); - } - } - } - if (toChange > 0 && ambiguous === false) { - newShapeHoles = betterShapeHoles; - } - } - let tmpHoles; - for (let i = 0, il = newShapes.length; i < il; i++) { - tmpShape = newShapes[i].s; - shapes.push(tmpShape); - tmpHoles = newShapeHoles[i]; - for (let j = 0, jl = tmpHoles.length; j < jl; j++) { - tmpShape.holes.push(tmpHoles[j].h); - } - } - return shapes; - } -} -class Controls extends EventDispatcher { - static { - __name(this, "Controls"); - } - constructor(object, domElement = null) { - super(); - this.object = object; - this.domElement = domElement; - this.enabled = true; - this.state = -1; - this.keys = {}; - this.mouseButtons = { LEFT: null, MIDDLE: null, RIGHT: null }; - this.touches = { ONE: null, TWO: null }; - } - connect() { - } - disconnect() { - } - dispose() { - } - update() { - } -} -class WebGLMultipleRenderTargets extends WebGLRenderTarget { - static { - __name(this, "WebGLMultipleRenderTargets"); - } - // @deprecated, r162 - constructor(width = 1, height = 1, count = 1, options = {}) { - console.warn('THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.'); - super(width, height, { ...options, count }); - this.isWebGLMultipleRenderTargets = true; - } - get texture() { - return this.textures; - } -} -if (typeof __THREE_DEVTOOLS__ !== "undefined") { - __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { - revision: REVISION - } })); -} -if (typeof window !== "undefined") { - if (window.__THREE__) { - console.warn("WARNING: Multiple instances of Three.js being imported."); - } else { - window.__THREE__ = REVISION; - } -} -class CameraManager { - static { - __name(this, "CameraManager"); - } - perspectiveCamera; - orthographicCamera; - activeCamera; - renderer; - eventManager; - nodeStorage; - controls = null; - DEFAULT_DISTANCE = 10; - DEFAULT_LOOK_AT = 0; - DEFAULT_CAMERA = { - near: 0.01, - far: 1e4 - }; - DEFAULT_PERSPECTIVE_CAMERA = { - fov: 35, - aspect: 1 - }; - DEFAULT_FRUSTUM_SIZE = 10; - DEFAULT_ORTHOGRAPHIC_CAMERA = { - left: -this.DEFAULT_FRUSTUM_SIZE / 2, - right: this.DEFAULT_FRUSTUM_SIZE / 2, - top: this.DEFAULT_FRUSTUM_SIZE / 2, - bottom: -this.DEFAULT_FRUSTUM_SIZE / 2 - }; - constructor(renderer, eventManager, nodeStorage) { - this.renderer = renderer; - this.eventManager = eventManager; - this.nodeStorage = nodeStorage; - this.perspectiveCamera = new PerspectiveCamera( - this.DEFAULT_PERSPECTIVE_CAMERA.fov, - this.DEFAULT_PERSPECTIVE_CAMERA.aspect, - this.DEFAULT_CAMERA.near, - this.DEFAULT_CAMERA.far - ); - this.orthographicCamera = new OrthographicCamera( - this.DEFAULT_ORTHOGRAPHIC_CAMERA.left, - this.DEFAULT_ORTHOGRAPHIC_CAMERA.right, - this.DEFAULT_ORTHOGRAPHIC_CAMERA.top, - this.DEFAULT_ORTHOGRAPHIC_CAMERA.bottom, - this.DEFAULT_CAMERA.near, - this.DEFAULT_CAMERA.far - ); - this.reset(); - this.activeCamera = this.perspectiveCamera; - } - init() { - } - dispose() { - } - setControls(controls) { - this.controls = controls; - if (this.controls) { - this.controls.addEventListener("end", () => { - this.nodeStorage.storeNodeProperty("Camera Info", this.getCameraState()); - }); - } - } - getCurrentCameraType() { - return this.activeCamera === this.perspectiveCamera ? "perspective" : "orthographic"; - } - toggleCamera(cameraType) { - const oldCamera = this.activeCamera; - const position = oldCamera.position.clone(); - const rotation = oldCamera.rotation.clone(); - const target = this.controls?.target.clone() || new Vector3(); - const oldZoom = oldCamera instanceof OrthographicCamera ? oldCamera.zoom : oldCamera.zoom; - if (!cameraType) { - this.activeCamera = oldCamera === this.perspectiveCamera ? this.orthographicCamera : this.perspectiveCamera; - } else { - this.activeCamera = cameraType === "perspective" ? this.perspectiveCamera : this.orthographicCamera; - if (oldCamera === this.activeCamera) { - return; - } - } - this.activeCamera.position.copy(position); - this.activeCamera.rotation.copy(rotation); - if (this.activeCamera instanceof OrthographicCamera) { - this.activeCamera.zoom = oldZoom; - this.activeCamera.updateProjectionMatrix(); - } else if (this.activeCamera instanceof PerspectiveCamera) { - this.activeCamera.zoom = oldZoom; - this.activeCamera.updateProjectionMatrix(); - } - if (this.controls) { - this.controls.object = this.activeCamera; - this.controls.target.copy(target); - this.controls.update(); - } - this.eventManager.emitEvent("cameraTypeChange", cameraType); - } - setFOV(fov2) { - if (this.activeCamera === this.perspectiveCamera) { - this.perspectiveCamera.fov = fov2; - this.perspectiveCamera.updateProjectionMatrix(); - } - this.eventManager.emitEvent("fovChange", fov2); - } - getCameraState() { - return { - position: this.activeCamera.position.clone(), - target: this.controls?.target.clone() || new Vector3(), - zoom: this.activeCamera instanceof OrthographicCamera ? this.activeCamera.zoom : this.activeCamera.zoom, - cameraType: this.getCurrentCameraType() - }; - } - setCameraState(state) { - this.activeCamera.position.copy(state.position); - this.controls?.target.copy(state.target); - if (this.activeCamera instanceof OrthographicCamera) { - this.activeCamera.zoom = state.zoom; - this.activeCamera.updateProjectionMatrix(); - } else if (this.activeCamera instanceof PerspectiveCamera) { - this.activeCamera.zoom = state.zoom; - this.activeCamera.updateProjectionMatrix(); - } - this.controls?.update(); - } - handleResize(width, height) { - if (this.activeCamera === this.perspectiveCamera) { - this.perspectiveCamera.aspect = width / height; - this.perspectiveCamera.updateProjectionMatrix(); - } else { - const frustumSize = 10; - const aspect2 = width / height; - this.orthographicCamera.left = -frustumSize * aspect2 / 2; - this.orthographicCamera.right = frustumSize * aspect2 / 2; - this.orthographicCamera.top = frustumSize / 2; - this.orthographicCamera.bottom = -frustumSize / 2; - this.orthographicCamera.updateProjectionMatrix(); - } - } - setupForModel(size) { - const distance = Math.max(size.x, size.z) * 2; - const height = size.y * 2; - this.perspectiveCamera.position.set(distance, height, distance); - this.orthographicCamera.position.set(distance, height, distance); - if (this.activeCamera === this.perspectiveCamera) { - this.perspectiveCamera.lookAt(0, size.y / 2, 0); - this.perspectiveCamera.updateProjectionMatrix(); - } else { - const frustumSize = Math.max(size.x, size.y, size.z) * 2; - const aspect2 = this.perspectiveCamera.aspect; - this.orthographicCamera.left = -frustumSize * aspect2 / 2; - this.orthographicCamera.right = frustumSize * aspect2 / 2; - this.orthographicCamera.top = frustumSize / 2; - this.orthographicCamera.bottom = -frustumSize / 2; - this.orthographicCamera.lookAt(0, size.y / 2, 0); - this.orthographicCamera.updateProjectionMatrix(); - } - this.controls?.target.set(0, size.y / 2, 0); - this.controls?.update(); - } - reset() { - this.perspectiveCamera.position.set( - this.DEFAULT_DISTANCE, - this.DEFAULT_DISTANCE, - this.DEFAULT_DISTANCE - ); - this.orthographicCamera.position.set( - this.DEFAULT_DISTANCE, - this.DEFAULT_DISTANCE, - this.DEFAULT_DISTANCE - ); - this.perspectiveCamera.lookAt( - this.DEFAULT_LOOK_AT, - this.DEFAULT_LOOK_AT, - this.DEFAULT_LOOK_AT - ); - this.orthographicCamera.lookAt( - this.DEFAULT_LOOK_AT, - this.DEFAULT_LOOK_AT, - this.DEFAULT_LOOK_AT - ); - this.perspectiveCamera.updateProjectionMatrix(); - this.orthographicCamera.updateProjectionMatrix(); - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.CameraManager = window.comfyAPI.CameraManager || {}; -window.comfyAPI.CameraManager.CameraManager = CameraManager; -const _changeEvent = { type: "change" }; -const _startEvent = { type: "start" }; -const _endEvent = { type: "end" }; -const _ray = new Ray(); -const _plane = new Plane(); -const _TILT_LIMIT = Math.cos(70 * MathUtils.DEG2RAD); -const _v = new Vector3(); -const _twoPI = 2 * Math.PI; -const _STATE = { - NONE: -1, - ROTATE: 0, - DOLLY: 1, - PAN: 2, - TOUCH_ROTATE: 3, - TOUCH_PAN: 4, - TOUCH_DOLLY_PAN: 5, - TOUCH_DOLLY_ROTATE: 6 -}; -const _EPS = 1e-6; -class OrbitControls extends Controls { - static { - __name(this, "OrbitControls"); - } - constructor(object, domElement = null) { - super(object, domElement); - this.state = _STATE.NONE; - this.enabled = true; - this.target = new Vector3(); - this.cursor = new Vector3(); - this.minDistance = 0; - this.maxDistance = Infinity; - this.minZoom = 0; - this.maxZoom = Infinity; - this.minTargetRadius = 0; - this.maxTargetRadius = Infinity; - this.minPolarAngle = 0; - this.maxPolarAngle = Math.PI; - this.minAzimuthAngle = -Infinity; - this.maxAzimuthAngle = Infinity; - this.enableDamping = false; - this.dampingFactor = 0.05; - this.enableZoom = true; - this.zoomSpeed = 1; - this.enableRotate = true; - this.rotateSpeed = 1; - this.enablePan = true; - this.panSpeed = 1; - this.screenSpacePanning = true; - this.keyPanSpeed = 7; - this.zoomToCursor = false; - this.autoRotate = false; - this.autoRotateSpeed = 2; - this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }; - this.mouseButtons = { LEFT: MOUSE.ROTATE, MIDDLE: MOUSE.DOLLY, RIGHT: MOUSE.PAN }; - this.touches = { ONE: TOUCH.ROTATE, TWO: TOUCH.DOLLY_PAN }; - this.target0 = this.target.clone(); - this.position0 = this.object.position.clone(); - this.zoom0 = this.object.zoom; - this._domElementKeyEvents = null; - this._lastPosition = new Vector3(); - this._lastQuaternion = new Quaternion(); - this._lastTargetPosition = new Vector3(); - this._quat = new Quaternion().setFromUnitVectors(object.up, new Vector3(0, 1, 0)); - this._quatInverse = this._quat.clone().invert(); - this._spherical = new Spherical(); - this._sphericalDelta = new Spherical(); - this._scale = 1; - this._panOffset = new Vector3(); - this._rotateStart = new Vector2(); - this._rotateEnd = new Vector2(); - this._rotateDelta = new Vector2(); - this._panStart = new Vector2(); - this._panEnd = new Vector2(); - this._panDelta = new Vector2(); - this._dollyStart = new Vector2(); - this._dollyEnd = new Vector2(); - this._dollyDelta = new Vector2(); - this._dollyDirection = new Vector3(); - this._mouse = new Vector2(); - this._performCursorZoom = false; - this._pointers = []; - this._pointerPositions = {}; - this._controlActive = false; - this._onPointerMove = onPointerMove.bind(this); - this._onPointerDown = onPointerDown.bind(this); - this._onPointerUp = onPointerUp.bind(this); - this._onContextMenu = onContextMenu.bind(this); - this._onMouseWheel = onMouseWheel.bind(this); - this._onKeyDown = onKeyDown.bind(this); - this._onTouchStart = onTouchStart.bind(this); - this._onTouchMove = onTouchMove.bind(this); - this._onMouseDown = onMouseDown.bind(this); - this._onMouseMove = onMouseMove.bind(this); - this._interceptControlDown = interceptControlDown.bind(this); - this._interceptControlUp = interceptControlUp.bind(this); - if (this.domElement !== null) { - this.connect(); - } - this.update(); - } - connect() { - this.domElement.addEventListener("pointerdown", this._onPointerDown); - this.domElement.addEventListener("pointercancel", this._onPointerUp); - this.domElement.addEventListener("contextmenu", this._onContextMenu); - this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: false }); - const document2 = this.domElement.getRootNode(); - document2.addEventListener("keydown", this._interceptControlDown, { passive: true, capture: true }); - this.domElement.style.touchAction = "none"; - } - disconnect() { - this.domElement.removeEventListener("pointerdown", this._onPointerDown); - this.domElement.removeEventListener("pointermove", this._onPointerMove); - this.domElement.removeEventListener("pointerup", this._onPointerUp); - this.domElement.removeEventListener("pointercancel", this._onPointerUp); - this.domElement.removeEventListener("wheel", this._onMouseWheel); - this.domElement.removeEventListener("contextmenu", this._onContextMenu); - this.stopListenToKeyEvents(); - const document2 = this.domElement.getRootNode(); - document2.removeEventListener("keydown", this._interceptControlDown, { capture: true }); - this.domElement.style.touchAction = "auto"; - } - dispose() { - this.disconnect(); - } - getPolarAngle() { - return this._spherical.phi; - } - getAzimuthalAngle() { - return this._spherical.theta; - } - getDistance() { - return this.object.position.distanceTo(this.target); - } - listenToKeyEvents(domElement) { - domElement.addEventListener("keydown", this._onKeyDown); - this._domElementKeyEvents = domElement; - } - stopListenToKeyEvents() { - if (this._domElementKeyEvents !== null) { - this._domElementKeyEvents.removeEventListener("keydown", this._onKeyDown); - this._domElementKeyEvents = null; - } - } - saveState() { - this.target0.copy(this.target); - this.position0.copy(this.object.position); - this.zoom0 = this.object.zoom; - } - reset() { - this.target.copy(this.target0); - this.object.position.copy(this.position0); - this.object.zoom = this.zoom0; - this.object.updateProjectionMatrix(); - this.dispatchEvent(_changeEvent); - this.update(); - this.state = _STATE.NONE; - } - update(deltaTime = null) { - const position = this.object.position; - _v.copy(position).sub(this.target); - _v.applyQuaternion(this._quat); - this._spherical.setFromVector3(_v); - if (this.autoRotate && this.state === _STATE.NONE) { - this._rotateLeft(this._getAutoRotationAngle(deltaTime)); - } - if (this.enableDamping) { - this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor; - this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor; - } else { - this._spherical.theta += this._sphericalDelta.theta; - this._spherical.phi += this._sphericalDelta.phi; - } - let min = this.minAzimuthAngle; - let max2 = this.maxAzimuthAngle; - if (isFinite(min) && isFinite(max2)) { - if (min < -Math.PI) min += _twoPI; - else if (min > Math.PI) min -= _twoPI; - if (max2 < -Math.PI) max2 += _twoPI; - else if (max2 > Math.PI) max2 -= _twoPI; - if (min <= max2) { - this._spherical.theta = Math.max(min, Math.min(max2, this._spherical.theta)); - } else { - this._spherical.theta = this._spherical.theta > (min + max2) / 2 ? Math.max(min, this._spherical.theta) : Math.min(max2, this._spherical.theta); - } - } - this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)); - this._spherical.makeSafe(); - if (this.enableDamping === true) { - this.target.addScaledVector(this._panOffset, this.dampingFactor); - } else { - this.target.add(this._panOffset); - } - this.target.sub(this.cursor); - this.target.clampLength(this.minTargetRadius, this.maxTargetRadius); - this.target.add(this.cursor); - let zoomChanged = false; - if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera) { - this._spherical.radius = this._clampDistance(this._spherical.radius); - } else { - const prevRadius = this._spherical.radius; - this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale); - zoomChanged = prevRadius != this._spherical.radius; - } - _v.setFromSpherical(this._spherical); - _v.applyQuaternion(this._quatInverse); - position.copy(this.target).add(_v); - this.object.lookAt(this.target); - if (this.enableDamping === true) { - this._sphericalDelta.theta *= 1 - this.dampingFactor; - this._sphericalDelta.phi *= 1 - this.dampingFactor; - this._panOffset.multiplyScalar(1 - this.dampingFactor); - } else { - this._sphericalDelta.set(0, 0, 0); - this._panOffset.set(0, 0, 0); - } - if (this.zoomToCursor && this._performCursorZoom) { - let newRadius = null; - if (this.object.isPerspectiveCamera) { - const prevRadius = _v.length(); - newRadius = this._clampDistance(prevRadius * this._scale); - const radiusDelta = prevRadius - newRadius; - this.object.position.addScaledVector(this._dollyDirection, radiusDelta); - this.object.updateMatrixWorld(); - zoomChanged = !!radiusDelta; - } else if (this.object.isOrthographicCamera) { - const mouseBefore = new Vector3(this._mouse.x, this._mouse.y, 0); - mouseBefore.unproject(this.object); - const prevZoom = this.object.zoom; - this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)); - this.object.updateProjectionMatrix(); - zoomChanged = prevZoom !== this.object.zoom; - const mouseAfter = new Vector3(this._mouse.x, this._mouse.y, 0); - mouseAfter.unproject(this.object); - this.object.position.sub(mouseAfter).add(mouseBefore); - this.object.updateMatrixWorld(); - newRadius = _v.length(); - } else { - console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."); - this.zoomToCursor = false; - } - if (newRadius !== null) { - if (this.screenSpacePanning) { - this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(newRadius).add(this.object.position); - } else { - _ray.origin.copy(this.object.position); - _ray.direction.set(0, 0, -1).transformDirection(this.object.matrix); - if (Math.abs(this.object.up.dot(_ray.direction)) < _TILT_LIMIT) { - this.object.lookAt(this.target); - } else { - _plane.setFromNormalAndCoplanarPoint(this.object.up, this.target); - _ray.intersectPlane(_plane, this.target); - } - } - } - } else if (this.object.isOrthographicCamera) { - const prevZoom = this.object.zoom; - this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)); - if (prevZoom !== this.object.zoom) { - this.object.updateProjectionMatrix(); - zoomChanged = true; - } - } - this._scale = 1; - this._performCursorZoom = false; - if (zoomChanged || this._lastPosition.distanceToSquared(this.object.position) > _EPS || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > _EPS || this._lastTargetPosition.distanceToSquared(this.target) > _EPS) { - this.dispatchEvent(_changeEvent); - this._lastPosition.copy(this.object.position); - this._lastQuaternion.copy(this.object.quaternion); - this._lastTargetPosition.copy(this.target); - return true; - } - return false; - } - _getAutoRotationAngle(deltaTime) { - if (deltaTime !== null) { - return _twoPI / 60 * this.autoRotateSpeed * deltaTime; - } else { - return _twoPI / 60 / 60 * this.autoRotateSpeed; - } - } - _getZoomScale(delta) { - const normalizedDelta = Math.abs(delta * 0.01); - return Math.pow(0.95, this.zoomSpeed * normalizedDelta); - } - _rotateLeft(angle) { - this._sphericalDelta.theta -= angle; - } - _rotateUp(angle) { - this._sphericalDelta.phi -= angle; - } - _panLeft(distance, objectMatrix) { - _v.setFromMatrixColumn(objectMatrix, 0); - _v.multiplyScalar(-distance); - this._panOffset.add(_v); - } - _panUp(distance, objectMatrix) { - if (this.screenSpacePanning === true) { - _v.setFromMatrixColumn(objectMatrix, 1); - } else { - _v.setFromMatrixColumn(objectMatrix, 0); - _v.crossVectors(this.object.up, _v); - } - _v.multiplyScalar(distance); - this._panOffset.add(_v); - } - // deltaX and deltaY are in pixels; right and down are positive - _pan(deltaX, deltaY) { - const element = this.domElement; - if (this.object.isPerspectiveCamera) { - const position = this.object.position; - _v.copy(position).sub(this.target); - let targetDistance = _v.length(); - targetDistance *= Math.tan(this.object.fov / 2 * Math.PI / 180); - this._panLeft(2 * deltaX * targetDistance / element.clientHeight, this.object.matrix); - this._panUp(2 * deltaY * targetDistance / element.clientHeight, this.object.matrix); - } else if (this.object.isOrthographicCamera) { - this._panLeft(deltaX * (this.object.right - this.object.left) / this.object.zoom / element.clientWidth, this.object.matrix); - this._panUp(deltaY * (this.object.top - this.object.bottom) / this.object.zoom / element.clientHeight, this.object.matrix); - } else { - console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."); - this.enablePan = false; - } - } - _dollyOut(dollyScale) { - if (this.object.isPerspectiveCamera || this.object.isOrthographicCamera) { - this._scale /= dollyScale; - } else { - console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."); - this.enableZoom = false; - } - } - _dollyIn(dollyScale) { - if (this.object.isPerspectiveCamera || this.object.isOrthographicCamera) { - this._scale *= dollyScale; - } else { - console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."); - this.enableZoom = false; - } - } - _updateZoomParameters(x, y) { - if (!this.zoomToCursor) { - return; - } - this._performCursorZoom = true; - const rect = this.domElement.getBoundingClientRect(); - const dx = x - rect.left; - const dy = y - rect.top; - const w = rect.width; - const h = rect.height; - this._mouse.x = dx / w * 2 - 1; - this._mouse.y = -(dy / h) * 2 + 1; - this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize(); - } - _clampDistance(dist) { - return Math.max(this.minDistance, Math.min(this.maxDistance, dist)); - } - // - // event callbacks - update the object state - // - _handleMouseDownRotate(event) { - this._rotateStart.set(event.clientX, event.clientY); - } - _handleMouseDownDolly(event) { - this._updateZoomParameters(event.clientX, event.clientX); - this._dollyStart.set(event.clientX, event.clientY); - } - _handleMouseDownPan(event) { - this._panStart.set(event.clientX, event.clientY); - } - _handleMouseMoveRotate(event) { - this._rotateEnd.set(event.clientX, event.clientY); - this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed); - const element = this.domElement; - this._rotateLeft(_twoPI * this._rotateDelta.x / element.clientHeight); - this._rotateUp(_twoPI * this._rotateDelta.y / element.clientHeight); - this._rotateStart.copy(this._rotateEnd); - this.update(); - } - _handleMouseMoveDolly(event) { - this._dollyEnd.set(event.clientX, event.clientY); - this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart); - if (this._dollyDelta.y > 0) { - this._dollyOut(this._getZoomScale(this._dollyDelta.y)); - } else if (this._dollyDelta.y < 0) { - this._dollyIn(this._getZoomScale(this._dollyDelta.y)); - } - this._dollyStart.copy(this._dollyEnd); - this.update(); - } - _handleMouseMovePan(event) { - this._panEnd.set(event.clientX, event.clientY); - this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed); - this._pan(this._panDelta.x, this._panDelta.y); - this._panStart.copy(this._panEnd); - this.update(); - } - _handleMouseWheel(event) { - this._updateZoomParameters(event.clientX, event.clientY); - if (event.deltaY < 0) { - this._dollyIn(this._getZoomScale(event.deltaY)); - } else if (event.deltaY > 0) { - this._dollyOut(this._getZoomScale(event.deltaY)); - } - this.update(); - } - _handleKeyDown(event) { - let needsUpdate = false; - switch (event.code) { - case this.keys.UP: - if (event.ctrlKey || event.metaKey || event.shiftKey) { - this._rotateUp(_twoPI * this.rotateSpeed / this.domElement.clientHeight); - } else { - this._pan(0, this.keyPanSpeed); - } - needsUpdate = true; - break; - case this.keys.BOTTOM: - if (event.ctrlKey || event.metaKey || event.shiftKey) { - this._rotateUp(-_twoPI * this.rotateSpeed / this.domElement.clientHeight); - } else { - this._pan(0, -this.keyPanSpeed); - } - needsUpdate = true; - break; - case this.keys.LEFT: - if (event.ctrlKey || event.metaKey || event.shiftKey) { - this._rotateLeft(_twoPI * this.rotateSpeed / this.domElement.clientHeight); - } else { - this._pan(this.keyPanSpeed, 0); - } - needsUpdate = true; - break; - case this.keys.RIGHT: - if (event.ctrlKey || event.metaKey || event.shiftKey) { - this._rotateLeft(-_twoPI * this.rotateSpeed / this.domElement.clientHeight); - } else { - this._pan(-this.keyPanSpeed, 0); - } - needsUpdate = true; - break; - } - if (needsUpdate) { - event.preventDefault(); - this.update(); - } - } - _handleTouchStartRotate(event) { - if (this._pointers.length === 1) { - this._rotateStart.set(event.pageX, event.pageY); - } else { - const position = this._getSecondPointerPosition(event); - const x = 0.5 * (event.pageX + position.x); - const y = 0.5 * (event.pageY + position.y); - this._rotateStart.set(x, y); - } - } - _handleTouchStartPan(event) { - if (this._pointers.length === 1) { - this._panStart.set(event.pageX, event.pageY); - } else { - const position = this._getSecondPointerPosition(event); - const x = 0.5 * (event.pageX + position.x); - const y = 0.5 * (event.pageY + position.y); - this._panStart.set(x, y); - } - } - _handleTouchStartDolly(event) { - const position = this._getSecondPointerPosition(event); - const dx = event.pageX - position.x; - const dy = event.pageY - position.y; - const distance = Math.sqrt(dx * dx + dy * dy); - this._dollyStart.set(0, distance); - } - _handleTouchStartDollyPan(event) { - if (this.enableZoom) this._handleTouchStartDolly(event); - if (this.enablePan) this._handleTouchStartPan(event); - } - _handleTouchStartDollyRotate(event) { - if (this.enableZoom) this._handleTouchStartDolly(event); - if (this.enableRotate) this._handleTouchStartRotate(event); - } - _handleTouchMoveRotate(event) { - if (this._pointers.length == 1) { - this._rotateEnd.set(event.pageX, event.pageY); - } else { - const position = this._getSecondPointerPosition(event); - const x = 0.5 * (event.pageX + position.x); - const y = 0.5 * (event.pageY + position.y); - this._rotateEnd.set(x, y); - } - this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed); - const element = this.domElement; - this._rotateLeft(_twoPI * this._rotateDelta.x / element.clientHeight); - this._rotateUp(_twoPI * this._rotateDelta.y / element.clientHeight); - this._rotateStart.copy(this._rotateEnd); - } - _handleTouchMovePan(event) { - if (this._pointers.length === 1) { - this._panEnd.set(event.pageX, event.pageY); - } else { - const position = this._getSecondPointerPosition(event); - const x = 0.5 * (event.pageX + position.x); - const y = 0.5 * (event.pageY + position.y); - this._panEnd.set(x, y); - } - this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed); - this._pan(this._panDelta.x, this._panDelta.y); - this._panStart.copy(this._panEnd); - } - _handleTouchMoveDolly(event) { - const position = this._getSecondPointerPosition(event); - const dx = event.pageX - position.x; - const dy = event.pageY - position.y; - const distance = Math.sqrt(dx * dx + dy * dy); - this._dollyEnd.set(0, distance); - this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)); - this._dollyOut(this._dollyDelta.y); - this._dollyStart.copy(this._dollyEnd); - const centerX = (event.pageX + position.x) * 0.5; - const centerY = (event.pageY + position.y) * 0.5; - this._updateZoomParameters(centerX, centerY); - } - _handleTouchMoveDollyPan(event) { - if (this.enableZoom) this._handleTouchMoveDolly(event); - if (this.enablePan) this._handleTouchMovePan(event); - } - _handleTouchMoveDollyRotate(event) { - if (this.enableZoom) this._handleTouchMoveDolly(event); - if (this.enableRotate) this._handleTouchMoveRotate(event); - } - // pointers - _addPointer(event) { - this._pointers.push(event.pointerId); - } - _removePointer(event) { - delete this._pointerPositions[event.pointerId]; - for (let i = 0; i < this._pointers.length; i++) { - if (this._pointers[i] == event.pointerId) { - this._pointers.splice(i, 1); - return; - } - } - } - _isTrackingPointer(event) { - for (let i = 0; i < this._pointers.length; i++) { - if (this._pointers[i] == event.pointerId) return true; - } - return false; - } - _trackPointer(event) { - let position = this._pointerPositions[event.pointerId]; - if (position === void 0) { - position = new Vector2(); - this._pointerPositions[event.pointerId] = position; - } - position.set(event.pageX, event.pageY); - } - _getSecondPointerPosition(event) { - const pointerId = event.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0]; - return this._pointerPositions[pointerId]; - } - // - _customWheelEvent(event) { - const mode = event.deltaMode; - const newEvent = { - clientX: event.clientX, - clientY: event.clientY, - deltaY: event.deltaY - }; - switch (mode) { - case 1: - newEvent.deltaY *= 16; - break; - case 2: - newEvent.deltaY *= 100; - break; - } - if (event.ctrlKey && !this._controlActive) { - newEvent.deltaY *= 10; - } - return newEvent; - } -} -function onPointerDown(event) { - if (this.enabled === false) return; - if (this._pointers.length === 0) { - this.domElement.setPointerCapture(event.pointerId); - this.domElement.addEventListener("pointermove", this._onPointerMove); - this.domElement.addEventListener("pointerup", this._onPointerUp); - } - if (this._isTrackingPointer(event)) return; - this._addPointer(event); - if (event.pointerType === "touch") { - this._onTouchStart(event); - } else { - this._onMouseDown(event); - } -} -__name(onPointerDown, "onPointerDown"); -function onPointerMove(event) { - if (this.enabled === false) return; - if (event.pointerType === "touch") { - this._onTouchMove(event); - } else { - this._onMouseMove(event); - } -} -__name(onPointerMove, "onPointerMove"); -function onPointerUp(event) { - this._removePointer(event); - switch (this._pointers.length) { - case 0: - this.domElement.releasePointerCapture(event.pointerId); - this.domElement.removeEventListener("pointermove", this._onPointerMove); - this.domElement.removeEventListener("pointerup", this._onPointerUp); - this.dispatchEvent(_endEvent); - this.state = _STATE.NONE; - break; - case 1: - const pointerId = this._pointers[0]; - const position = this._pointerPositions[pointerId]; - this._onTouchStart({ pointerId, pageX: position.x, pageY: position.y }); - break; - } -} -__name(onPointerUp, "onPointerUp"); -function onMouseDown(event) { - let mouseAction; - switch (event.button) { - case 0: - mouseAction = this.mouseButtons.LEFT; - break; - case 1: - mouseAction = this.mouseButtons.MIDDLE; - break; - case 2: - mouseAction = this.mouseButtons.RIGHT; - break; - default: - mouseAction = -1; - } - switch (mouseAction) { - case MOUSE.DOLLY: - if (this.enableZoom === false) return; - this._handleMouseDownDolly(event); - this.state = _STATE.DOLLY; - break; - case MOUSE.ROTATE: - if (event.ctrlKey || event.metaKey || event.shiftKey) { - if (this.enablePan === false) return; - this._handleMouseDownPan(event); - this.state = _STATE.PAN; - } else { - if (this.enableRotate === false) return; - this._handleMouseDownRotate(event); - this.state = _STATE.ROTATE; - } - break; - case MOUSE.PAN: - if (event.ctrlKey || event.metaKey || event.shiftKey) { - if (this.enableRotate === false) return; - this._handleMouseDownRotate(event); - this.state = _STATE.ROTATE; - } else { - if (this.enablePan === false) return; - this._handleMouseDownPan(event); - this.state = _STATE.PAN; - } - break; - default: - this.state = _STATE.NONE; - } - if (this.state !== _STATE.NONE) { - this.dispatchEvent(_startEvent); - } -} -__name(onMouseDown, "onMouseDown"); -function onMouseMove(event) { - switch (this.state) { - case _STATE.ROTATE: - if (this.enableRotate === false) return; - this._handleMouseMoveRotate(event); - break; - case _STATE.DOLLY: - if (this.enableZoom === false) return; - this._handleMouseMoveDolly(event); - break; - case _STATE.PAN: - if (this.enablePan === false) return; - this._handleMouseMovePan(event); - break; - } -} -__name(onMouseMove, "onMouseMove"); -function onMouseWheel(event) { - if (this.enabled === false || this.enableZoom === false || this.state !== _STATE.NONE) return; - event.preventDefault(); - this.dispatchEvent(_startEvent); - this._handleMouseWheel(this._customWheelEvent(event)); - this.dispatchEvent(_endEvent); -} -__name(onMouseWheel, "onMouseWheel"); -function onKeyDown(event) { - if (this.enabled === false || this.enablePan === false) return; - this._handleKeyDown(event); -} -__name(onKeyDown, "onKeyDown"); -function onTouchStart(event) { - this._trackPointer(event); - switch (this._pointers.length) { - case 1: - switch (this.touches.ONE) { - case TOUCH.ROTATE: - if (this.enableRotate === false) return; - this._handleTouchStartRotate(event); - this.state = _STATE.TOUCH_ROTATE; - break; - case TOUCH.PAN: - if (this.enablePan === false) return; - this._handleTouchStartPan(event); - this.state = _STATE.TOUCH_PAN; - break; - default: - this.state = _STATE.NONE; - } - break; - case 2: - switch (this.touches.TWO) { - case TOUCH.DOLLY_PAN: - if (this.enableZoom === false && this.enablePan === false) return; - this._handleTouchStartDollyPan(event); - this.state = _STATE.TOUCH_DOLLY_PAN; - break; - case TOUCH.DOLLY_ROTATE: - if (this.enableZoom === false && this.enableRotate === false) return; - this._handleTouchStartDollyRotate(event); - this.state = _STATE.TOUCH_DOLLY_ROTATE; - break; - default: - this.state = _STATE.NONE; - } - break; - default: - this.state = _STATE.NONE; - } - if (this.state !== _STATE.NONE) { - this.dispatchEvent(_startEvent); - } -} -__name(onTouchStart, "onTouchStart"); -function onTouchMove(event) { - this._trackPointer(event); - switch (this.state) { - case _STATE.TOUCH_ROTATE: - if (this.enableRotate === false) return; - this._handleTouchMoveRotate(event); - this.update(); - break; - case _STATE.TOUCH_PAN: - if (this.enablePan === false) return; - this._handleTouchMovePan(event); - this.update(); - break; - case _STATE.TOUCH_DOLLY_PAN: - if (this.enableZoom === false && this.enablePan === false) return; - this._handleTouchMoveDollyPan(event); - this.update(); - break; - case _STATE.TOUCH_DOLLY_ROTATE: - if (this.enableZoom === false && this.enableRotate === false) return; - this._handleTouchMoveDollyRotate(event); - this.update(); - break; - default: - this.state = _STATE.NONE; - } -} -__name(onTouchMove, "onTouchMove"); -function onContextMenu(event) { - if (this.enabled === false) return; - event.preventDefault(); -} -__name(onContextMenu, "onContextMenu"); -function interceptControlDown(event) { - if (event.key === "Control") { - this._controlActive = true; - const document2 = this.domElement.getRootNode(); - document2.addEventListener("keyup", this._interceptControlUp, { passive: true, capture: true }); - } -} -__name(interceptControlDown, "interceptControlDown"); -function interceptControlUp(event) { - if (event.key === "Control") { - this._controlActive = false; - const document2 = this.domElement.getRootNode(); - document2.removeEventListener("keyup", this._interceptControlUp, { passive: true, capture: true }); - } -} -__name(interceptControlUp, "interceptControlUp"); -class ControlsManager { - static { - __name(this, "ControlsManager"); - } - controls; - eventManager; - nodeStorage; - camera; - constructor(renderer, camera, eventManager, nodeStorage) { - this.eventManager = eventManager; - this.nodeStorage = nodeStorage; - this.camera = camera; - this.controls = new OrbitControls(camera, renderer.domElement); - this.controls.enableDamping = true; - } - init() { - this.controls.addEventListener("end", () => { - this.nodeStorage.storeNodeProperty("Camera Info", { - position: this.camera.position.clone(), - target: this.controls.target.clone(), - zoom: this.camera instanceof OrthographicCamera ? this.camera.zoom : this.camera.zoom, - cameraType: this.camera instanceof PerspectiveCamera ? "perspective" : "orthographic" - }); - }); - } - dispose() { - this.controls.dispose(); - } - handleResize() { - } - update() { - this.controls.update(); - } - updateCamera(camera) { - const position = this.controls.object.position.clone(); - const target = this.controls.target.clone(); - this.camera = camera; - this.controls.object = camera; - this.controls.target = target; - camera.position.copy(position); - this.controls.update(); - } - reset() { - this.controls.target.set(0, 0, 0); - this.controls.update(); - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.ControlsManager = window.comfyAPI.ControlsManager || {}; -window.comfyAPI.ControlsManager.ControlsManager = ControlsManager; -class EventManager { - static { - __name(this, "EventManager"); - } - listeners = {}; - addEventListener(event, callback) { - if (!this.listeners[event]) { - this.listeners[event] = []; - } - this.listeners[event].push(callback); - } - removeEventListener(event, callback) { - if (this.listeners[event]) { - this.listeners[event] = this.listeners[event].filter( - (cb) => cb !== callback - ); - } - } - emitEvent(event, data) { - if (this.listeners[event]) { - this.listeners[event].forEach((callback) => callback(data)); - } - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.EventManager = window.comfyAPI.EventManager || {}; -window.comfyAPI.EventManager.EventManager = EventManager; -class LightingManager { - static { - __name(this, "LightingManager"); - } - lights = []; - scene; - eventManager; - constructor(scene, eventManager) { - this.scene = scene; - this.eventManager = eventManager; - } - init() { - this.setupLights(); - } - dispose() { - this.lights.forEach((light) => { - this.scene.remove(light); - }); - this.lights = []; - } - setupLights() { - const ambientLight = new AmbientLight(16777215, 0.5); - this.scene.add(ambientLight); - this.lights.push(ambientLight); - const mainLight = new DirectionalLight(16777215, 0.8); - mainLight.position.set(0, 10, 10); - this.scene.add(mainLight); - this.lights.push(mainLight); - const backLight = new DirectionalLight(16777215, 0.5); - backLight.position.set(0, 10, -10); - this.scene.add(backLight); - this.lights.push(backLight); - const leftFillLight = new DirectionalLight(16777215, 0.3); - leftFillLight.position.set(-10, 0, 0); - this.scene.add(leftFillLight); - this.lights.push(leftFillLight); - const rightFillLight = new DirectionalLight(16777215, 0.3); - rightFillLight.position.set(10, 0, 0); - this.scene.add(rightFillLight); - this.lights.push(rightFillLight); - const bottomLight = new DirectionalLight(16777215, 0.2); - bottomLight.position.set(0, -10, 0); - this.scene.add(bottomLight); - this.lights.push(bottomLight); - } - setLightIntensity(intensity) { - this.lights.forEach((light) => { - if (light instanceof DirectionalLight) { - if (light === this.lights[1]) { - light.intensity = intensity * 0.8; - } else if (light === this.lights[2]) { - light.intensity = intensity * 0.5; - } else if (light === this.lights[5]) { - light.intensity = intensity * 0.2; - } else { - light.intensity = intensity * 0.3; - } - } else if (light instanceof AmbientLight) { - light.intensity = intensity * 0.5; - } - }); - this.eventManager.emitEvent("lightIntensityChange", intensity); - } - reset() { - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.LightingManager = window.comfyAPI.LightingManager || {}; -window.comfyAPI.LightingManager.LightingManager = LightingManager; -/*! -fflate - fast JavaScript compression/decompression - -Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE -version 0.8.2 -*/ -var ch2 = {}; -var wk = /* @__PURE__ */ __name(function(c, id2, msg, transfer, cb) { - var w = new Worker(ch2[id2] || (ch2[id2] = URL.createObjectURL(new Blob([ - c + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})' - ], { type: "text/javascript" })))); - w.onmessage = function(e) { - var d = e.data, ed = d.$e$; - if (ed) { - var err2 = new Error(ed[0]); - err2["code"] = ed[1]; - err2.stack = ed[2]; - cb(err2, null); - } else - cb(null, d); - }; - w.postMessage(msg, transfer); - return w; -}, "wk"); -var u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array; -var fleb = new u8([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 2, - 2, - 2, - 2, - 3, - 3, - 3, - 3, - 4, - 4, - 4, - 4, - 5, - 5, - 5, - 5, - 0, - /* unused */ - 0, - 0, - /* impossible */ - 0 -]); -var fdeb = new u8([ - 0, - 0, - 0, - 0, - 1, - 1, - 2, - 2, - 3, - 3, - 4, - 4, - 5, - 5, - 6, - 6, - 7, - 7, - 8, - 8, - 9, - 9, - 10, - 10, - 11, - 11, - 12, - 12, - 13, - 13, - /* unused */ - 0, - 0 -]); -var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); -var freb = /* @__PURE__ */ __name(function(eb, start) { - var b = new u16(31); - for (var i = 0; i < 31; ++i) { - b[i] = start += 1 << eb[i - 1]; - } - var r = new i32(b[30]); - for (var i = 1; i < 30; ++i) { - for (var j = b[i]; j < b[i + 1]; ++j) { - r[j] = j - b[i] << 5 | i; - } - } - return { b, r }; -}, "freb"); -var _a = freb(fleb, 2), fl = _a.b, revfl = _a.r; -fl[28] = 258, revfl[258] = 28; -var _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r; -var rev = new u16(32768); -for (var i = 0; i < 32768; ++i) { - var x = (i & 43690) >> 1 | (i & 21845) << 1; - x = (x & 52428) >> 2 | (x & 13107) << 2; - x = (x & 61680) >> 4 | (x & 3855) << 4; - rev[i] = ((x & 65280) >> 8 | (x & 255) << 8) >> 1; -} -var hMap = /* @__PURE__ */ __name(function(cd, mb, r) { - var s = cd.length; - var i = 0; - var l = new u16(mb); - for (; i < s; ++i) { - if (cd[i]) - ++l[cd[i] - 1]; - } - var le = new u16(mb); - for (i = 1; i < mb; ++i) { - le[i] = le[i - 1] + l[i - 1] << 1; - } - var co; - if (r) { - co = new u16(1 << mb); - var rvb = 15 - mb; - for (i = 0; i < s; ++i) { - if (cd[i]) { - var sv = i << 4 | cd[i]; - var r_1 = mb - cd[i]; - var v = le[cd[i] - 1]++ << r_1; - for (var m = v | (1 << r_1) - 1; v <= m; ++v) { - co[rev[v] >> rvb] = sv; - } - } - } - } else { - co = new u16(s); - for (i = 0; i < s; ++i) { - if (cd[i]) { - co[i] = rev[le[cd[i] - 1]++] >> 15 - cd[i]; - } - } - } - return co; -}, "hMap"); -var flt = new u8(288); -for (var i = 0; i < 144; ++i) - flt[i] = 8; -for (var i = 144; i < 256; ++i) - flt[i] = 9; -for (var i = 256; i < 280; ++i) - flt[i] = 7; -for (var i = 280; i < 288; ++i) - flt[i] = 8; -var fdt = new u8(32); -for (var i = 0; i < 32; ++i) - fdt[i] = 5; -var flm = /* @__PURE__ */ hMap(flt, 9, 0), flrm = /* @__PURE__ */ hMap(flt, 9, 1); -var fdm = /* @__PURE__ */ hMap(fdt, 5, 0), fdrm = /* @__PURE__ */ hMap(fdt, 5, 1); -var max = /* @__PURE__ */ __name(function(a) { - var m = a[0]; - for (var i = 1; i < a.length; ++i) { - if (a[i] > m) - m = a[i]; - } - return m; -}, "max"); -var bits = /* @__PURE__ */ __name(function(d, p, m) { - var o = p / 8 | 0; - return (d[o] | d[o + 1] << 8) >> (p & 7) & m; -}, "bits"); -var bits16 = /* @__PURE__ */ __name(function(d, p) { - var o = p / 8 | 0; - return (d[o] | d[o + 1] << 8 | d[o + 2] << 16) >> (p & 7); -}, "bits16"); -var shft = /* @__PURE__ */ __name(function(p) { - return (p + 7) / 8 | 0; -}, "shft"); -var slc = /* @__PURE__ */ __name(function(v, s, e) { - if (s == null || s < 0) - s = 0; - if (e == null || e > v.length) - e = v.length; - return new u8(v.subarray(s, e)); -}, "slc"); -var FlateErrorCode = { - UnexpectedEOF: 0, - InvalidBlockType: 1, - InvalidLengthLiteral: 2, - InvalidDistance: 3, - StreamFinished: 4, - NoStreamHandler: 5, - InvalidHeader: 6, - NoCallback: 7, - InvalidUTF8: 8, - ExtraFieldTooLong: 9, - InvalidDate: 10, - FilenameTooLong: 11, - StreamFinishing: 12, - InvalidZipData: 13, - UnknownCompressionMethod: 14 -}; -var ec = [ - "unexpected EOF", - "invalid block type", - "invalid length/literal", - "invalid distance", - "stream finished", - "no stream handler", - , - "no callback", - "invalid UTF-8 data", - "extra field too long", - "date not in range 1980-2099", - "filename too long", - "stream finishing", - "invalid zip data" - // determined by unknown compression method -]; -; -var err = /* @__PURE__ */ __name(function(ind, msg, nt) { - var e = new Error(msg || ec[ind]); - e.code = ind; - if (Error.captureStackTrace) - Error.captureStackTrace(e, err); - if (!nt) - throw e; - return e; -}, "err"); -var inflt = /* @__PURE__ */ __name(function(dat, st, buf, dict) { - var sl = dat.length, dl = dict ? dict.length : 0; - if (!sl || st.f && !st.l) - return buf || new u8(0); - var noBuf = !buf; - var resize = noBuf || st.i != 2; - var noSt = st.i; - if (noBuf) - buf = new u8(sl * 3); - var cbuf = /* @__PURE__ */ __name(function(l2) { - var bl = buf.length; - if (l2 > bl) { - var nbuf = new u8(Math.max(bl * 2, l2)); - nbuf.set(buf); - buf = nbuf; - } - }, "cbuf"); - var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n; - var tbts = sl * 8; - do { - if (!lm) { - final = bits(dat, pos, 1); - var type = bits(dat, pos + 1, 3); - pos += 3; - if (!type) { - var s = shft(pos) + 4, l = dat[s - 4] | dat[s - 3] << 8, t2 = s + l; - if (t2 > sl) { - if (noSt) - err(0); - break; - } - if (resize) - cbuf(bt + l); - buf.set(dat.subarray(s, t2), bt); - st.b = bt += l, st.p = pos = t2 * 8, st.f = final; - continue; - } else if (type == 1) - lm = flrm, dm = fdrm, lbt = 9, dbt = 5; - else if (type == 2) { - var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4; - var tl = hLit + bits(dat, pos + 5, 31) + 1; - pos += 14; - var ldt = new u8(tl); - var clt = new u8(19); - for (var i = 0; i < hcLen; ++i) { - clt[clim[i]] = bits(dat, pos + i * 3, 7); - } - pos += hcLen * 3; - var clb = max(clt), clbmsk = (1 << clb) - 1; - var clm = hMap(clt, clb, 1); - for (var i = 0; i < tl; ) { - var r = clm[bits(dat, pos, clbmsk)]; - pos += r & 15; - var s = r >> 4; - if (s < 16) { - ldt[i++] = s; - } else { - var c = 0, n = 0; - if (s == 16) - n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1]; - else if (s == 17) - n = 3 + bits(dat, pos, 7), pos += 3; - else if (s == 18) - n = 11 + bits(dat, pos, 127), pos += 7; - while (n--) - ldt[i++] = c; - } - } - var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit); - lbt = max(lt); - dbt = max(dt); - lm = hMap(lt, lbt, 1); - dm = hMap(dt, dbt, 1); - } else - err(1); - if (pos > tbts) { - if (noSt) - err(0); - break; - } - } - if (resize) - cbuf(bt + 131072); - var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1; - var lpos = pos; - for (; ; lpos = pos) { - var c = lm[bits16(dat, pos) & lms], sym = c >> 4; - pos += c & 15; - if (pos > tbts) { - if (noSt) - err(0); - break; - } - if (!c) - err(2); - if (sym < 256) - buf[bt++] = sym; - else if (sym == 256) { - lpos = pos, lm = null; - break; - } else { - var add = sym - 254; - if (sym > 264) { - var i = sym - 257, b = fleb[i]; - add = bits(dat, pos, (1 << b) - 1) + fl[i]; - pos += b; - } - var d = dm[bits16(dat, pos) & dms], dsym = d >> 4; - if (!d) - err(3); - pos += d & 15; - var dt = fd[dsym]; - if (dsym > 3) { - var b = fdeb[dsym]; - dt += bits16(dat, pos) & (1 << b) - 1, pos += b; - } - if (pos > tbts) { - if (noSt) - err(0); - break; - } - if (resize) - cbuf(bt + 131072); - var end = bt + add; - if (bt < dt) { - var shift = dl - dt, dend = Math.min(dt, end); - if (shift + bt < 0) - err(3); - for (; bt < dend; ++bt) - buf[bt] = dict[shift + bt]; - } - for (; bt < end; ++bt) - buf[bt] = buf[bt - dt]; - } - } - st.l = lm, st.p = lpos, st.b = bt, st.f = final; - if (lm) - final = 1, st.m = lbt, st.d = dm, st.n = dbt; - } while (!final); - return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt); -}, "inflt"); -var wbits = /* @__PURE__ */ __name(function(d, p, v) { - v <<= p & 7; - var o = p / 8 | 0; - d[o] |= v; - d[o + 1] |= v >> 8; -}, "wbits"); -var wbits16 = /* @__PURE__ */ __name(function(d, p, v) { - v <<= p & 7; - var o = p / 8 | 0; - d[o] |= v; - d[o + 1] |= v >> 8; - d[o + 2] |= v >> 16; -}, "wbits16"); -var hTree = /* @__PURE__ */ __name(function(d, mb) { - var t2 = []; - for (var i = 0; i < d.length; ++i) { - if (d[i]) - t2.push({ s: i, f: d[i] }); - } - var s = t2.length; - var t22 = t2.slice(); - if (!s) - return { t: et, l: 0 }; - if (s == 1) { - var v = new u8(t2[0].s + 1); - v[t2[0].s] = 1; - return { t: v, l: 1 }; - } - t2.sort(function(a, b) { - return a.f - b.f; - }); - t2.push({ s: -1, f: 25001 }); - var l = t2[0], r = t2[1], i0 = 0, i1 = 1, i2 = 2; - t2[0] = { s: -1, f: l.f + r.f, l, r }; - while (i1 != s - 1) { - l = t2[t2[i0].f < t2[i2].f ? i0++ : i2++]; - r = t2[i0 != i1 && t2[i0].f < t2[i2].f ? i0++ : i2++]; - t2[i1++] = { s: -1, f: l.f + r.f, l, r }; - } - var maxSym = t22[0].s; - for (var i = 1; i < s; ++i) { - if (t22[i].s > maxSym) - maxSym = t22[i].s; - } - var tr = new u16(maxSym + 1); - var mbt = ln(t2[i1 - 1], tr, 0); - if (mbt > mb) { - var i = 0, dt = 0; - var lft = mbt - mb, cst = 1 << lft; - t22.sort(function(a, b) { - return tr[b.s] - tr[a.s] || a.f - b.f; - }); - for (; i < s; ++i) { - var i2_1 = t22[i].s; - if (tr[i2_1] > mb) { - dt += cst - (1 << mbt - tr[i2_1]); - tr[i2_1] = mb; - } else - break; - } - dt >>= lft; - while (dt > 0) { - var i2_2 = t22[i].s; - if (tr[i2_2] < mb) - dt -= 1 << mb - tr[i2_2]++ - 1; - else - ++i; - } - for (; i >= 0 && dt; --i) { - var i2_3 = t22[i].s; - if (tr[i2_3] == mb) { - --tr[i2_3]; - ++dt; - } - } - mbt = mb; - } - return { t: new u8(tr), l: mbt }; -}, "hTree"); -var ln = /* @__PURE__ */ __name(function(n, l, d) { - return n.s == -1 ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) : l[n.s] = d; -}, "ln"); -var lc = /* @__PURE__ */ __name(function(c) { - var s = c.length; - while (s && !c[--s]) - ; - var cl = new u16(++s); - var cli = 0, cln = c[0], cls = 1; - var w = /* @__PURE__ */ __name(function(v) { - cl[cli++] = v; - }, "w"); - for (var i = 1; i <= s; ++i) { - if (c[i] == cln && i != s) - ++cls; - else { - if (!cln && cls > 2) { - for (; cls > 138; cls -= 138) - w(32754); - if (cls > 2) { - w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305); - cls = 0; - } - } else if (cls > 3) { - w(cln), --cls; - for (; cls > 6; cls -= 6) - w(8304); - if (cls > 2) - w(cls - 3 << 5 | 8208), cls = 0; - } - while (cls--) - w(cln); - cls = 1; - cln = c[i]; - } - } - return { c: cl.subarray(0, cli), n: s }; -}, "lc"); -var clen = /* @__PURE__ */ __name(function(cf, cl) { - var l = 0; - for (var i = 0; i < cl.length; ++i) - l += cf[i] * cl[i]; - return l; -}, "clen"); -var wfblk = /* @__PURE__ */ __name(function(out, pos, dat) { - var s = dat.length; - var o = shft(pos + 2); - out[o] = s & 255; - out[o + 1] = s >> 8; - out[o + 2] = out[o] ^ 255; - out[o + 3] = out[o + 1] ^ 255; - for (var i = 0; i < s; ++i) - out[o + i + 4] = dat[i]; - return (o + 4 + s) * 8; -}, "wfblk"); -var wblk = /* @__PURE__ */ __name(function(dat, out, final, syms, lf, df, eb, li, bs, bl, p) { - wbits(out, p++, final); - ++lf[256]; - var _a2 = hTree(lf, 15), dlt = _a2.t, mlb = _a2.l; - var _b2 = hTree(df, 15), ddt = _b2.t, mdb = _b2.l; - var _c = lc(dlt), lclt = _c.c, nlc = _c.n; - var _d = lc(ddt), lcdt = _d.c, ndc = _d.n; - var lcfreq = new u16(19); - for (var i = 0; i < lclt.length; ++i) - ++lcfreq[lclt[i] & 31]; - for (var i = 0; i < lcdt.length; ++i) - ++lcfreq[lcdt[i] & 31]; - var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l; - var nlcc = 19; - for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc) - ; - var flen = bl + 5 << 3; - var ftlen = clen(lf, flt) + clen(df, fdt) + eb; - var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]; - if (bs >= 0 && flen <= ftlen && flen <= dtlen) - return wfblk(out, p, dat.subarray(bs, bs + bl)); - var lm, ll, dm, dl; - wbits(out, p, 1 + (dtlen < ftlen)), p += 2; - if (dtlen < ftlen) { - lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt; - var llm = hMap(lct, mlcb, 0); - wbits(out, p, nlc - 257); - wbits(out, p + 5, ndc - 1); - wbits(out, p + 10, nlcc - 4); - p += 14; - for (var i = 0; i < nlcc; ++i) - wbits(out, p + 3 * i, lct[clim[i]]); - p += 3 * nlcc; - var lcts = [lclt, lcdt]; - for (var it = 0; it < 2; ++it) { - var clct = lcts[it]; - for (var i = 0; i < clct.length; ++i) { - var len = clct[i] & 31; - wbits(out, p, llm[len]), p += lct[len]; - if (len > 15) - wbits(out, p, clct[i] >> 5 & 127), p += clct[i] >> 12; - } - } - } else { - lm = flm, ll = flt, dm = fdm, dl = fdt; - } - for (var i = 0; i < li; ++i) { - var sym = syms[i]; - if (sym > 255) { - var len = sym >> 18 & 31; - wbits16(out, p, lm[len + 257]), p += ll[len + 257]; - if (len > 7) - wbits(out, p, sym >> 23 & 31), p += fleb[len]; - var dst = sym & 31; - wbits16(out, p, dm[dst]), p += dl[dst]; - if (dst > 3) - wbits16(out, p, sym >> 5 & 8191), p += fdeb[dst]; - } else { - wbits16(out, p, lm[sym]), p += ll[sym]; - } - } - wbits16(out, p, lm[256]); - return p + ll[256]; -}, "wblk"); -var deo = /* @__PURE__ */ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]); -var et = /* @__PURE__ */ new u8(0); -var dflt = /* @__PURE__ */ __name(function(dat, lvl, plvl, pre, post, st) { - var s = st.z || dat.length; - var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7e3)) + post); - var w = o.subarray(pre, o.length - post); - var lst = st.l; - var pos = (st.r || 0) & 7; - if (lvl) { - if (pos) - w[0] = st.r >> 3; - var opt = deo[lvl - 1]; - var n = opt >> 13, c = opt & 8191; - var msk_1 = (1 << plvl) - 1; - var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1); - var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1; - var hsh = /* @__PURE__ */ __name(function(i2) { - return (dat[i2] ^ dat[i2 + 1] << bs1_1 ^ dat[i2 + 2] << bs2_1) & msk_1; - }, "hsh"); - var syms = new i32(25e3); - var lf = new u16(288), df = new u16(32); - var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0; - for (; i + 2 < s; ++i) { - var hv = hsh(i); - var imod = i & 32767, pimod = head[hv]; - prev[imod] = pimod; - head[hv] = imod; - if (wi <= i) { - var rem = s - i; - if ((lc_1 > 7e3 || li > 24576) && (rem > 423 || !lst)) { - pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos); - li = lc_1 = eb = 0, bs = i; - for (var j = 0; j < 286; ++j) - lf[j] = 0; - for (var j = 0; j < 30; ++j) - df[j] = 0; - } - var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767; - if (rem > 2 && hv == hsh(i - dif)) { - var maxn = Math.min(n, rem) - 1; - var maxd = Math.min(32767, i); - var ml = Math.min(258, rem); - while (dif <= maxd && --ch_1 && imod != pimod) { - if (dat[i + l] == dat[i + l - dif]) { - var nl = 0; - for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl) - ; - if (nl > l) { - l = nl, d = dif; - if (nl > maxn) - break; - var mmd = Math.min(dif, nl - 2); - var md = 0; - for (var j = 0; j < mmd; ++j) { - var ti = i - dif + j & 32767; - var pti = prev[ti]; - var cd = ti - pti & 32767; - if (cd > md) - md = cd, pimod = ti; - } - } - } - imod = pimod, pimod = prev[imod]; - dif += imod - pimod & 32767; - } - } - if (d) { - syms[li++] = 268435456 | revfl[l] << 18 | revfd[d]; - var lin = revfl[l] & 31, din = revfd[d] & 31; - eb += fleb[lin] + fdeb[din]; - ++lf[257 + lin]; - ++df[din]; - wi = i + l; - ++lc_1; - } else { - syms[li++] = dat[i]; - ++lf[dat[i]]; - } - } - } - for (i = Math.max(i, wi); i < s; ++i) { - syms[li++] = dat[i]; - ++lf[dat[i]]; - } - pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos); - if (!lst) { - st.r = pos & 7 | w[pos / 8 | 0] << 3; - pos -= 7; - st.h = head, st.p = prev, st.i = i, st.w = wi; - } - } else { - for (var i = st.w || 0; i < s + lst; i += 65535) { - var e = i + 65535; - if (e >= s) { - w[pos / 8 | 0] = lst; - e = s; - } - pos = wfblk(w, pos + 1, dat.subarray(i, e)); - } - st.i = s; - } - return slc(o, 0, pre + shft(pos) + post); -}, "dflt"); -var crct = /* @__PURE__ */ function() { - var t2 = new Int32Array(256); - for (var i = 0; i < 256; ++i) { - var c = i, k = 9; - while (--k) - c = (c & 1 && -306674912) ^ c >>> 1; - t2[i] = c; - } - return t2; -}(); -var crc = /* @__PURE__ */ __name(function() { - var c = -1; - return { - p: /* @__PURE__ */ __name(function(d) { - var cr = c; - for (var i = 0; i < d.length; ++i) - cr = crct[cr & 255 ^ d[i]] ^ cr >>> 8; - c = cr; - }, "p"), - d: /* @__PURE__ */ __name(function() { - return ~c; - }, "d") - }; -}, "crc"); -var adler = /* @__PURE__ */ __name(function() { - var a = 1, b = 0; - return { - p: /* @__PURE__ */ __name(function(d) { - var n = a, m = b; - var l = d.length | 0; - for (var i = 0; i != l; ) { - var e = Math.min(i + 2655, l); - for (; i < e; ++i) - m += n += d[i]; - n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16); - } - a = n, b = m; - }, "p"), - d: /* @__PURE__ */ __name(function() { - a %= 65521, b %= 65521; - return (a & 255) << 24 | (a & 65280) << 8 | (b & 255) << 8 | b >> 8; - }, "d") - }; -}, "adler"); -; -var dopt = /* @__PURE__ */ __name(function(dat, opt, pre, post, st) { - if (!st) { - st = { l: 1 }; - if (opt.dictionary) { - var dict = opt.dictionary.subarray(-32768); - var newDat = new u8(dict.length + dat.length); - newDat.set(dict); - newDat.set(dat, dict.length); - dat = newDat; - st.w = dict.length; - } - } - return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre, post, st); -}, "dopt"); -var mrg = /* @__PURE__ */ __name(function(a, b) { - var o = {}; - for (var k in a) - o[k] = a[k]; - for (var k in b) - o[k] = b[k]; - return o; -}, "mrg"); -var wcln = /* @__PURE__ */ __name(function(fn, fnStr, td2) { - var dt = fn(); - var st = fn.toString(); - var ks = st.slice(st.indexOf("[") + 1, st.lastIndexOf("]")).replace(/\s+/g, "").split(","); - for (var i = 0; i < dt.length; ++i) { - var v = dt[i], k = ks[i]; - if (typeof v == "function") { - fnStr += ";" + k + "="; - var st_1 = v.toString(); - if (v.prototype) { - if (st_1.indexOf("[native code]") != -1) { - var spInd = st_1.indexOf(" ", 8) + 1; - fnStr += st_1.slice(spInd, st_1.indexOf("(", spInd)); - } else { - fnStr += st_1; - for (var t2 in v.prototype) - fnStr += ";" + k + ".prototype." + t2 + "=" + v.prototype[t2].toString(); - } - } else - fnStr += st_1; - } else - td2[k] = v; - } - return fnStr; -}, "wcln"); -var ch = []; -var cbfs = /* @__PURE__ */ __name(function(v) { - var tl = []; - for (var k in v) { - if (v[k].buffer) { - tl.push((v[k] = new v[k].constructor(v[k])).buffer); - } - } - return tl; -}, "cbfs"); -var wrkr = /* @__PURE__ */ __name(function(fns, init, id2, cb) { - if (!ch[id2]) { - var fnStr = "", td_1 = {}, m = fns.length - 1; - for (var i = 0; i < m; ++i) - fnStr = wcln(fns[i], fnStr, td_1); - ch[id2] = { c: wcln(fns[m], fnStr, td_1), e: td_1 }; - } - var td2 = mrg({}, ch[id2].e); - return wk(ch[id2].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + init.toString() + "}", id2, td2, cbfs(td2), cb); -}, "wrkr"); -var bInflt = /* @__PURE__ */ __name(function() { - return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; -}, "bInflt"); -var bDflt = /* @__PURE__ */ __name(function() { - return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; -}, "bDflt"); -var gze = /* @__PURE__ */ __name(function() { - return [gzh, gzhl, wbytes, crc, crct]; -}, "gze"); -var guze = /* @__PURE__ */ __name(function() { - return [gzs, gzl]; -}, "guze"); -var zle = /* @__PURE__ */ __name(function() { - return [zlh, wbytes, adler]; -}, "zle"); -var zule = /* @__PURE__ */ __name(function() { - return [zls]; -}, "zule"); -var pbf = /* @__PURE__ */ __name(function(msg) { - return postMessage(msg, [msg.buffer]); -}, "pbf"); -var gopt = /* @__PURE__ */ __name(function(o) { - return o && { - out: o.size && new u8(o.size), - dictionary: o.dictionary - }; -}, "gopt"); -var cbify = /* @__PURE__ */ __name(function(dat, opts, fns, init, id2, cb) { - var w = wrkr(fns, init, id2, function(err2, dat2) { - w.terminate(); - cb(err2, dat2); - }); - w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []); - return function() { - w.terminate(); - }; -}, "cbify"); -var astrm = /* @__PURE__ */ __name(function(strm) { - strm.ondata = function(dat, final) { - return postMessage([dat, final], [dat.buffer]); - }; - return function(ev) { - if (ev.data.length) { - strm.push(ev.data[0], ev.data[1]); - postMessage([ev.data[0].length]); - } else - strm.flush(); - }; -}, "astrm"); -var astrmify = /* @__PURE__ */ __name(function(fns, strm, opts, init, id2, flush, ext2) { - var t2; - var w = wrkr(fns, init, id2, function(err2, dat) { - if (err2) - w.terminate(), strm.ondata.call(strm, err2); - else if (!Array.isArray(dat)) - ext2(dat); - else if (dat.length == 1) { - strm.queuedSize -= dat[0]; - if (strm.ondrain) - strm.ondrain(dat[0]); - } else { - if (dat[1]) - w.terminate(); - strm.ondata.call(strm, err2, dat[0], dat[1]); - } - }); - w.postMessage(opts); - strm.queuedSize = 0; - strm.push = function(d, f) { - if (!strm.ondata) - err(5); - if (t2) - strm.ondata(err(4, 0, 1), null, !!f); - strm.queuedSize += d.length; - w.postMessage([d, t2 = f], [d.buffer]); - }; - strm.terminate = function() { - w.terminate(); - }; - if (flush) { - strm.flush = function() { - w.postMessage([]); - }; - } -}, "astrmify"); -var b2 = /* @__PURE__ */ __name(function(d, b) { - return d[b] | d[b + 1] << 8; -}, "b2"); -var b4 = /* @__PURE__ */ __name(function(d, b) { - return (d[b] | d[b + 1] << 8 | d[b + 2] << 16 | d[b + 3] << 24) >>> 0; -}, "b4"); -var b8 = /* @__PURE__ */ __name(function(d, b) { - return b4(d, b) + b4(d, b + 4) * 4294967296; -}, "b8"); -var wbytes = /* @__PURE__ */ __name(function(d, b, v) { - for (; v; ++b) - d[b] = v, v >>>= 8; -}, "wbytes"); -var gzh = /* @__PURE__ */ __name(function(c, o) { - var fn = o.filename; - c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; - if (o.mtime != 0) - wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1e3)); - if (fn) { - c[3] = 8; - for (var i = 0; i <= fn.length; ++i) - c[i + 10] = fn.charCodeAt(i); - } -}, "gzh"); -var gzs = /* @__PURE__ */ __name(function(d) { - if (d[0] != 31 || d[1] != 139 || d[2] != 8) - err(6, "invalid gzip data"); - var flg = d[3]; - var st = 10; - if (flg & 4) - st += (d[10] | d[11] << 8) + 2; - for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++]) - ; - return st + (flg & 2); -}, "gzs"); -var gzl = /* @__PURE__ */ __name(function(d) { - var l = d.length; - return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0; -}, "gzl"); -var gzhl = /* @__PURE__ */ __name(function(o) { - return 10 + (o.filename ? o.filename.length + 1 : 0); -}, "gzhl"); -var zlh = /* @__PURE__ */ __name(function(c, o) { - var lv = o.level, fl2 = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2; - c[0] = 120, c[1] = fl2 << 6 | (o.dictionary && 32); - c[1] |= 31 - (c[0] << 8 | c[1]) % 31; - if (o.dictionary) { - var h = adler(); - h.p(o.dictionary); - wbytes(c, 2, h.d()); - } -}, "zlh"); -var zls = /* @__PURE__ */ __name(function(d, dict) { - if ((d[0] & 15) != 8 || d[0] >> 4 > 7 || (d[0] << 8 | d[1]) % 31) - err(6, "invalid zlib data"); - if ((d[1] >> 5 & 1) == +!dict) - err(6, "invalid zlib data: " + (d[1] & 32 ? "need" : "unexpected") + " dictionary"); - return (d[1] >> 3 & 4) + 2; -}, "zls"); -function StrmOpt(opts, cb) { - if (typeof opts == "function") - cb = opts, opts = {}; - this.ondata = cb; - return opts; -} -__name(StrmOpt, "StrmOpt"); -var Deflate = /* @__PURE__ */ function() { - function Deflate2(opts, cb) { - if (typeof opts == "function") - cb = opts, opts = {}; - this.ondata = cb; - this.o = opts || {}; - this.s = { l: 0, i: 32768, w: 32768, z: 32768 }; - this.b = new u8(98304); - if (this.o.dictionary) { - var dict = this.o.dictionary.subarray(-32768); - this.b.set(dict, 32768 - dict.length); - this.s.i = 32768 - dict.length; - } - } - __name(Deflate2, "Deflate"); - Deflate2.prototype.p = function(c, f) { - this.ondata(dopt(c, this.o, 0, 0, this.s), f); - }; - Deflate2.prototype.push = function(chunk, final) { - if (!this.ondata) - err(5); - if (this.s.l) - err(4); - var endLen = chunk.length + this.s.z; - if (endLen > this.b.length) { - if (endLen > 2 * this.b.length - 32768) { - var newBuf = new u8(endLen & -32768); - newBuf.set(this.b.subarray(0, this.s.z)); - this.b = newBuf; - } - var split = this.b.length - this.s.z; - this.b.set(chunk.subarray(0, split), this.s.z); - this.s.z = this.b.length; - this.p(this.b, false); - this.b.set(this.b.subarray(-32768)); - this.b.set(chunk.subarray(split), 32768); - this.s.z = chunk.length - split + 32768; - this.s.i = 32766, this.s.w = 32768; - } else { - this.b.set(chunk, this.s.z); - this.s.z += chunk.length; - } - this.s.l = final & 1; - if (this.s.z > this.s.w + 8191 || final) { - this.p(this.b, final || false); - this.s.w = this.s.i, this.s.i -= 2; - } - }; - Deflate2.prototype.flush = function() { - if (!this.ondata) - err(5); - if (this.s.l) - err(4); - this.p(this.b, false); - this.s.w = this.s.i, this.s.i -= 2; - }; - return Deflate2; -}(); -var AsyncDeflate = /* @__PURE__ */ function() { - function AsyncDeflate2(opts, cb) { - astrmify([ - bDflt, - function() { - return [astrm, Deflate]; - } - ], this, StrmOpt.call(this, opts, cb), function(ev) { - var strm = new Deflate(ev.data); - onmessage = astrm(strm); - }, 6, 1); - } - __name(AsyncDeflate2, "AsyncDeflate"); - return AsyncDeflate2; -}(); -function deflate(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err(7); - return cbify(data, opts, [ - bDflt - ], function(ev) { - return pbf(deflateSync(ev.data[0], ev.data[1])); - }, 0, cb); -} -__name(deflate, "deflate"); -function deflateSync(data, opts) { - return dopt(data, opts || {}, 0, 0); -} -__name(deflateSync, "deflateSync"); -var Inflate = /* @__PURE__ */ function() { - function Inflate2(opts, cb) { - if (typeof opts == "function") - cb = opts, opts = {}; - this.ondata = cb; - var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768); - this.s = { i: 0, b: dict ? dict.length : 0 }; - this.o = new u8(32768); - this.p = new u8(0); - if (dict) - this.o.set(dict); - } - __name(Inflate2, "Inflate"); - Inflate2.prototype.e = function(c) { - if (!this.ondata) - err(5); - if (this.d) - err(4); - if (!this.p.length) - this.p = c; - else if (c.length) { - var n = new u8(this.p.length + c.length); - n.set(this.p), n.set(c, this.p.length), this.p = n; - } - }; - Inflate2.prototype.c = function(final) { - this.s.i = +(this.d = final || false); - var bts = this.s.b; - var dt = inflt(this.p, this.s, this.o); - this.ondata(slc(dt, bts, this.s.b), this.d); - this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length; - this.p = slc(this.p, this.s.p / 8 | 0), this.s.p &= 7; - }; - Inflate2.prototype.push = function(chunk, final) { - this.e(chunk), this.c(final); - }; - return Inflate2; -}(); -var AsyncInflate = /* @__PURE__ */ function() { - function AsyncInflate2(opts, cb) { - astrmify([ - bInflt, - function() { - return [astrm, Inflate]; - } - ], this, StrmOpt.call(this, opts, cb), function(ev) { - var strm = new Inflate(ev.data); - onmessage = astrm(strm); - }, 7, 0); - } - __name(AsyncInflate2, "AsyncInflate"); - return AsyncInflate2; -}(); -function inflate(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err(7); - return cbify(data, opts, [ - bInflt - ], function(ev) { - return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); - }, 1, cb); -} -__name(inflate, "inflate"); -function inflateSync(data, opts) { - return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary); -} -__name(inflateSync, "inflateSync"); -var Gzip = /* @__PURE__ */ function() { - function Gzip2(opts, cb) { - this.c = crc(); - this.l = 0; - this.v = 1; - Deflate.call(this, opts, cb); - } - __name(Gzip2, "Gzip"); - Gzip2.prototype.push = function(chunk, final) { - this.c.p(chunk); - this.l += chunk.length; - Deflate.prototype.push.call(this, chunk, final); - }; - Gzip2.prototype.p = function(c, f) { - var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s); - if (this.v) - gzh(raw, this.o), this.v = 0; - if (f) - wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l); - this.ondata(raw, f); - }; - Gzip2.prototype.flush = function() { - Deflate.prototype.flush.call(this); - }; - return Gzip2; -}(); -var AsyncGzip = /* @__PURE__ */ function() { - function AsyncGzip2(opts, cb) { - astrmify([ - bDflt, - gze, - function() { - return [astrm, Deflate, Gzip]; - } - ], this, StrmOpt.call(this, opts, cb), function(ev) { - var strm = new Gzip(ev.data); - onmessage = astrm(strm); - }, 8, 1); - } - __name(AsyncGzip2, "AsyncGzip"); - return AsyncGzip2; -}(); -function gzip(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err(7); - return cbify(data, opts, [ - bDflt, - gze, - function() { - return [gzipSync]; - } - ], function(ev) { - return pbf(gzipSync(ev.data[0], ev.data[1])); - }, 2, cb); -} -__name(gzip, "gzip"); -function gzipSync(data, opts) { - if (!opts) - opts = {}; - var c = crc(), l = data.length; - c.p(data); - var d = dopt(data, opts, gzhl(opts), 8), s = d.length; - return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d; -} -__name(gzipSync, "gzipSync"); -var Gunzip = /* @__PURE__ */ function() { - function Gunzip2(opts, cb) { - this.v = 1; - this.r = 0; - Inflate.call(this, opts, cb); - } - __name(Gunzip2, "Gunzip"); - Gunzip2.prototype.push = function(chunk, final) { - Inflate.prototype.e.call(this, chunk); - this.r += chunk.length; - if (this.v) { - var p = this.p.subarray(this.v - 1); - var s = p.length > 3 ? gzs(p) : 4; - if (s > p.length) { - if (!final) - return; - } else if (this.v > 1 && this.onmember) { - this.onmember(this.r - p.length); - } - this.p = p.subarray(s), this.v = 0; - } - Inflate.prototype.c.call(this, final); - if (this.s.f && !this.s.l && !final) { - this.v = shft(this.s.p) + 9; - this.s = { i: 0 }; - this.o = new u8(0); - this.push(new u8(0), final); - } - }; - return Gunzip2; -}(); -var AsyncGunzip = /* @__PURE__ */ function() { - function AsyncGunzip2(opts, cb) { - var _this = this; - astrmify([ - bInflt, - guze, - function() { - return [astrm, Inflate, Gunzip]; - } - ], this, StrmOpt.call(this, opts, cb), function(ev) { - var strm = new Gunzip(ev.data); - strm.onmember = function(offset) { - return postMessage(offset); - }; - onmessage = astrm(strm); - }, 9, 0, function(offset) { - return _this.onmember && _this.onmember(offset); - }); - } - __name(AsyncGunzip2, "AsyncGunzip"); - return AsyncGunzip2; -}(); -function gunzip(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err(7); - return cbify(data, opts, [ - bInflt, - guze, - function() { - return [gunzipSync]; - } - ], function(ev) { - return pbf(gunzipSync(ev.data[0], ev.data[1])); - }, 3, cb); -} -__name(gunzip, "gunzip"); -function gunzipSync(data, opts) { - var st = gzs(data); - if (st + 8 > data.length) - err(6, "invalid gzip data"); - return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary); -} -__name(gunzipSync, "gunzipSync"); -var Zlib = /* @__PURE__ */ function() { - function Zlib2(opts, cb) { - this.c = adler(); - this.v = 1; - Deflate.call(this, opts, cb); - } - __name(Zlib2, "Zlib"); - Zlib2.prototype.push = function(chunk, final) { - this.c.p(chunk); - Deflate.prototype.push.call(this, chunk, final); - }; - Zlib2.prototype.p = function(c, f) { - var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s); - if (this.v) - zlh(raw, this.o), this.v = 0; - if (f) - wbytes(raw, raw.length - 4, this.c.d()); - this.ondata(raw, f); - }; - Zlib2.prototype.flush = function() { - Deflate.prototype.flush.call(this); - }; - return Zlib2; -}(); -var AsyncZlib = /* @__PURE__ */ function() { - function AsyncZlib2(opts, cb) { - astrmify([ - bDflt, - zle, - function() { - return [astrm, Deflate, Zlib]; - } - ], this, StrmOpt.call(this, opts, cb), function(ev) { - var strm = new Zlib(ev.data); - onmessage = astrm(strm); - }, 10, 1); - } - __name(AsyncZlib2, "AsyncZlib"); - return AsyncZlib2; -}(); -function zlib(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err(7); - return cbify(data, opts, [ - bDflt, - zle, - function() { - return [zlibSync]; - } - ], function(ev) { - return pbf(zlibSync(ev.data[0], ev.data[1])); - }, 4, cb); -} -__name(zlib, "zlib"); -function zlibSync(data, opts) { - if (!opts) - opts = {}; - var a = adler(); - a.p(data); - var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4); - return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d; -} -__name(zlibSync, "zlibSync"); -var Unzlib = /* @__PURE__ */ function() { - function Unzlib2(opts, cb) { - Inflate.call(this, opts, cb); - this.v = opts && opts.dictionary ? 2 : 1; - } - __name(Unzlib2, "Unzlib"); - Unzlib2.prototype.push = function(chunk, final) { - Inflate.prototype.e.call(this, chunk); - if (this.v) { - if (this.p.length < 6 && !final) - return; - this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0; - } - if (final) { - if (this.p.length < 4) - err(6, "invalid zlib data"); - this.p = this.p.subarray(0, -4); - } - Inflate.prototype.c.call(this, final); - }; - return Unzlib2; -}(); -var AsyncUnzlib = /* @__PURE__ */ function() { - function AsyncUnzlib2(opts, cb) { - astrmify([ - bInflt, - zule, - function() { - return [astrm, Inflate, Unzlib]; - } - ], this, StrmOpt.call(this, opts, cb), function(ev) { - var strm = new Unzlib(ev.data); - onmessage = astrm(strm); - }, 11, 0); - } - __name(AsyncUnzlib2, "AsyncUnzlib"); - return AsyncUnzlib2; -}(); -function unzlib(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err(7); - return cbify(data, opts, [ - bInflt, - zule, - function() { - return [unzlibSync]; - } - ], function(ev) { - return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); - }, 5, cb); -} -__name(unzlib, "unzlib"); -function unzlibSync(data, opts) { - return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary); -} -__name(unzlibSync, "unzlibSync"); -var Decompress = /* @__PURE__ */ function() { - function Decompress2(opts, cb) { - this.o = StrmOpt.call(this, opts, cb) || {}; - this.G = Gunzip; - this.I = Inflate; - this.Z = Unzlib; - } - __name(Decompress2, "Decompress"); - Decompress2.prototype.i = function() { - var _this = this; - this.s.ondata = function(dat, final) { - _this.ondata(dat, final); - }; - }; - Decompress2.prototype.push = function(chunk, final) { - if (!this.ondata) - err(5); - if (!this.s) { - if (this.p && this.p.length) { - var n = new u8(this.p.length + chunk.length); - n.set(this.p), n.set(chunk, this.p.length); - } else - this.p = chunk; - if (this.p.length > 2) { - this.s = this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8 ? new this.G(this.o) : (this.p[0] & 15) != 8 || this.p[0] >> 4 > 7 || (this.p[0] << 8 | this.p[1]) % 31 ? new this.I(this.o) : new this.Z(this.o); - this.i(); - this.s.push(this.p, final); - this.p = null; - } - } else - this.s.push(chunk, final); - }; - return Decompress2; -}(); -var AsyncDecompress = /* @__PURE__ */ function() { - function AsyncDecompress2(opts, cb) { - Decompress.call(this, opts, cb); - this.queuedSize = 0; - this.G = AsyncGunzip; - this.I = AsyncInflate; - this.Z = AsyncUnzlib; - } - __name(AsyncDecompress2, "AsyncDecompress"); - AsyncDecompress2.prototype.i = function() { - var _this = this; - this.s.ondata = function(err2, dat, final) { - _this.ondata(err2, dat, final); - }; - this.s.ondrain = function(size) { - _this.queuedSize -= size; - if (_this.ondrain) - _this.ondrain(size); - }; - }; - AsyncDecompress2.prototype.push = function(chunk, final) { - this.queuedSize += chunk.length; - Decompress.prototype.push.call(this, chunk, final); - }; - return AsyncDecompress2; -}(); -function decompress(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err(7); - return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzip(data, opts, cb) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflate(data, opts, cb) : unzlib(data, opts, cb); -} -__name(decompress, "decompress"); -function decompressSync(data, opts) { - return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzipSync(data, opts) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflateSync(data, opts) : unzlibSync(data, opts); -} -__name(decompressSync, "decompressSync"); -var fltn = /* @__PURE__ */ __name(function(d, p, t2, o) { - for (var k in d) { - var val = d[k], n = p + k, op = o; - if (Array.isArray(val)) - op = mrg(o, val[1]), val = val[0]; - if (val instanceof u8) - t2[n] = [val, op]; - else { - t2[n += "/"] = [new u8(0), op]; - fltn(val, n, t2, o); - } - } -}, "fltn"); -var te = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder(); -var td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder(); -var tds = 0; -try { - td.decode(et, { stream: true }); - tds = 1; -} catch (e) { -} -var dutf8 = /* @__PURE__ */ __name(function(d) { - for (var r = "", i = 0; ; ) { - var c = d[i++]; - var eb = (c > 127) + (c > 223) + (c > 239); - if (i + eb > d.length) - return { s: r, r: slc(d, i - 1) }; - if (!eb) - r += String.fromCharCode(c); - else if (eb == 3) { - c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | d[i++] & 63) - 65536, r += String.fromCharCode(55296 | c >> 10, 56320 | c & 1023); - } else if (eb & 1) - r += String.fromCharCode((c & 31) << 6 | d[i++] & 63); - else - r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | d[i++] & 63); - } -}, "dutf8"); -var DecodeUTF8 = /* @__PURE__ */ function() { - function DecodeUTF82(cb) { - this.ondata = cb; - if (tds) - this.t = new TextDecoder(); - else - this.p = et; - } - __name(DecodeUTF82, "DecodeUTF8"); - DecodeUTF82.prototype.push = function(chunk, final) { - if (!this.ondata) - err(5); - final = !!final; - if (this.t) { - this.ondata(this.t.decode(chunk, { stream: true }), final); - if (final) { - if (this.t.decode().length) - err(8); - this.t = null; - } - return; - } - if (!this.p) - err(4); - var dat = new u8(this.p.length + chunk.length); - dat.set(this.p); - dat.set(chunk, this.p.length); - var _a2 = dutf8(dat), s = _a2.s, r = _a2.r; - if (final) { - if (r.length) - err(8); - this.p = null; - } else - this.p = r; - this.ondata(s, final); - }; - return DecodeUTF82; -}(); -var EncodeUTF8 = /* @__PURE__ */ function() { - function EncodeUTF82(cb) { - this.ondata = cb; - } - __name(EncodeUTF82, "EncodeUTF8"); - EncodeUTF82.prototype.push = function(chunk, final) { - if (!this.ondata) - err(5); - if (this.d) - err(4); - this.ondata(strToU8(chunk), this.d = final || false); - }; - return EncodeUTF82; -}(); -function strToU8(str, latin1) { - if (latin1) { - var ar_1 = new u8(str.length); - for (var i = 0; i < str.length; ++i) - ar_1[i] = str.charCodeAt(i); - return ar_1; - } - if (te) - return te.encode(str); - var l = str.length; - var ar = new u8(str.length + (str.length >> 1)); - var ai = 0; - var w = /* @__PURE__ */ __name(function(v) { - ar[ai++] = v; - }, "w"); - for (var i = 0; i < l; ++i) { - if (ai + 5 > ar.length) { - var n = new u8(ai + 8 + (l - i << 1)); - n.set(ar); - ar = n; - } - var c = str.charCodeAt(i); - if (c < 128 || latin1) - w(c); - else if (c < 2048) - w(192 | c >> 6), w(128 | c & 63); - else if (c > 55295 && c < 57344) - c = 65536 + (c & 1023 << 10) | str.charCodeAt(++i) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63); - else - w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63); - } - return slc(ar, 0, ai); -} -__name(strToU8, "strToU8"); -function strFromU8(dat, latin1) { - if (latin1) { - var r = ""; - for (var i = 0; i < dat.length; i += 16384) - r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384)); - return r; - } else if (td) { - return td.decode(dat); - } else { - var _a2 = dutf8(dat), s = _a2.s, r = _a2.r; - if (r.length) - err(8); - return s; - } -} -__name(strFromU8, "strFromU8"); -; -var dbf = /* @__PURE__ */ __name(function(l) { - return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; -}, "dbf"); -var slzh = /* @__PURE__ */ __name(function(d, b) { - return b + 30 + b2(d, b + 26) + b2(d, b + 28); -}, "slzh"); -var zh = /* @__PURE__ */ __name(function(d, b, z) { - var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20); - var _a2 = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a2[0], su = _a2[1], off = _a2[2]; - return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off]; -}, "zh"); -var z64e = /* @__PURE__ */ __name(function(d, b) { - for (; b2(d, b) != 1; b += 4 + b2(d, b + 2)) - ; - return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)]; -}, "z64e"); -var exfl = /* @__PURE__ */ __name(function(ex) { - var le = 0; - if (ex) { - for (var k in ex) { - var l = ex[k].length; - if (l > 65535) - err(9); - le += l + 4; - } - } - return le; -}, "exfl"); -var wzh = /* @__PURE__ */ __name(function(d, b, f, fn, u, c, ce, co) { - var fl2 = fn.length, ex = f.extra, col = co && co.length; - var exl = exfl(ex); - wbytes(d, b, ce != null ? 33639248 : 67324752), b += 4; - if (ce != null) - d[b++] = 20, d[b++] = f.os; - d[b] = 20, b += 2; - d[b++] = f.flag << 1 | (c < 0 && 8), d[b++] = u && 8; - d[b++] = f.compression & 255, d[b++] = f.compression >> 8; - var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980; - if (y < 0 || y > 119) - err(10); - wbytes(d, b, y << 25 | dt.getMonth() + 1 << 21 | dt.getDate() << 16 | dt.getHours() << 11 | dt.getMinutes() << 5 | dt.getSeconds() >> 1), b += 4; - if (c != -1) { - wbytes(d, b, f.crc); - wbytes(d, b + 4, c < 0 ? -c - 2 : c); - wbytes(d, b + 8, f.size); - } - wbytes(d, b + 12, fl2); - wbytes(d, b + 14, exl), b += 16; - if (ce != null) { - wbytes(d, b, col); - wbytes(d, b + 6, f.attrs); - wbytes(d, b + 10, ce), b += 14; - } - d.set(fn, b); - b += fl2; - if (exl) { - for (var k in ex) { - var exf = ex[k], l = exf.length; - wbytes(d, b, +k); - wbytes(d, b + 2, l); - d.set(exf, b + 4), b += 4 + l; - } - } - if (col) - d.set(co, b), b += col; - return b; -}, "wzh"); -var wzf = /* @__PURE__ */ __name(function(o, b, c, d, e) { - wbytes(o, b, 101010256); - wbytes(o, b + 8, c); - wbytes(o, b + 10, c); - wbytes(o, b + 12, d); - wbytes(o, b + 16, e); -}, "wzf"); -var ZipPassThrough = /* @__PURE__ */ function() { - function ZipPassThrough2(filename) { - this.filename = filename; - this.c = crc(); - this.size = 0; - this.compression = 0; - } - __name(ZipPassThrough2, "ZipPassThrough"); - ZipPassThrough2.prototype.process = function(chunk, final) { - this.ondata(null, chunk, final); - }; - ZipPassThrough2.prototype.push = function(chunk, final) { - if (!this.ondata) - err(5); - this.c.p(chunk); - this.size += chunk.length; - if (final) - this.crc = this.c.d(); - this.process(chunk, final || false); - }; - return ZipPassThrough2; -}(); -var ZipDeflate = /* @__PURE__ */ function() { - function ZipDeflate2(filename, opts) { - var _this = this; - if (!opts) - opts = {}; - ZipPassThrough.call(this, filename); - this.d = new Deflate(opts, function(dat, final) { - _this.ondata(null, dat, final); - }); - this.compression = 8; - this.flag = dbf(opts.level); - } - __name(ZipDeflate2, "ZipDeflate"); - ZipDeflate2.prototype.process = function(chunk, final) { - try { - this.d.push(chunk, final); - } catch (e) { - this.ondata(e, null, final); - } - }; - ZipDeflate2.prototype.push = function(chunk, final) { - ZipPassThrough.prototype.push.call(this, chunk, final); - }; - return ZipDeflate2; -}(); -var AsyncZipDeflate = /* @__PURE__ */ function() { - function AsyncZipDeflate2(filename, opts) { - var _this = this; - if (!opts) - opts = {}; - ZipPassThrough.call(this, filename); - this.d = new AsyncDeflate(opts, function(err2, dat, final) { - _this.ondata(err2, dat, final); - }); - this.compression = 8; - this.flag = dbf(opts.level); - this.terminate = this.d.terminate; - } - __name(AsyncZipDeflate2, "AsyncZipDeflate"); - AsyncZipDeflate2.prototype.process = function(chunk, final) { - this.d.push(chunk, final); - }; - AsyncZipDeflate2.prototype.push = function(chunk, final) { - ZipPassThrough.prototype.push.call(this, chunk, final); - }; - return AsyncZipDeflate2; -}(); -var Zip = /* @__PURE__ */ function() { - function Zip2(cb) { - this.ondata = cb; - this.u = []; - this.d = 1; - } - __name(Zip2, "Zip"); - Zip2.prototype.add = function(file2) { - var _this = this; - if (!this.ondata) - err(5); - if (this.d & 2) - this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false); - else { - var f = strToU8(file2.filename), fl_1 = f.length; - var com = file2.comment, o = com && strToU8(com); - var u = fl_1 != file2.filename.length || o && com.length != o.length; - var hl_1 = fl_1 + exfl(file2.extra) + 30; - if (fl_1 > 65535) - this.ondata(err(11, 0, 1), null, false); - var header = new u8(hl_1); - wzh(header, 0, file2, f, u, -1); - var chks_1 = [header]; - var pAll_1 = /* @__PURE__ */ __name(function() { - for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) { - var chk = chks_2[_i]; - _this.ondata(null, chk, false); - } - chks_1 = []; - }, "pAll_1"); - var tr_1 = this.d; - this.d = 0; - var ind_1 = this.u.length; - var uf_1 = mrg(file2, { - f, - u, - o, - t: /* @__PURE__ */ __name(function() { - if (file2.terminate) - file2.terminate(); - }, "t"), - r: /* @__PURE__ */ __name(function() { - pAll_1(); - if (tr_1) { - var nxt = _this.u[ind_1 + 1]; - if (nxt) - nxt.r(); - else - _this.d = 1; - } - tr_1 = 1; - }, "r") - }); - var cl_1 = 0; - file2.ondata = function(err2, dat, final) { - if (err2) { - _this.ondata(err2, dat, final); - _this.terminate(); - } else { - cl_1 += dat.length; - chks_1.push(dat); - if (final) { - var dd = new u8(16); - wbytes(dd, 0, 134695760); - wbytes(dd, 4, file2.crc); - wbytes(dd, 8, cl_1); - wbytes(dd, 12, file2.size); - chks_1.push(dd); - uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file2.crc, uf_1.size = file2.size; - if (tr_1) - uf_1.r(); - tr_1 = 1; - } else if (tr_1) - pAll_1(); - } - }; - this.u.push(uf_1); - } - }; - Zip2.prototype.end = function() { - var _this = this; - if (this.d & 2) { - this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true); - return; - } - if (this.d) - this.e(); - else - this.u.push({ - r: /* @__PURE__ */ __name(function() { - if (!(_this.d & 1)) - return; - _this.u.splice(-1, 1); - _this.e(); - }, "r"), - t: /* @__PURE__ */ __name(function() { - }, "t") - }); - this.d = 3; - }; - Zip2.prototype.e = function() { - var bt = 0, l = 0, tl = 0; - for (var _i = 0, _a2 = this.u; _i < _a2.length; _i++) { - var f = _a2[_i]; - tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0); - } - var out = new u8(tl + 22); - for (var _b2 = 0, _c = this.u; _b2 < _c.length; _b2++) { - var f = _c[_b2]; - wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o); - bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b; - } - wzf(out, bt, this.u.length, tl, l); - this.ondata(null, out, true); - this.d = 2; - }; - Zip2.prototype.terminate = function() { - for (var _i = 0, _a2 = this.u; _i < _a2.length; _i++) { - var f = _a2[_i]; - f.t(); - } - this.d = 2; - }; - return Zip2; -}(); -function zip(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err(7); - var r = {}; - fltn(data, "", r, opts); - var k = Object.keys(r); - var lft = k.length, o = 0, tot = 0; - var slft = lft, files = new Array(lft); - var term = []; - var tAll = /* @__PURE__ */ __name(function() { - for (var i2 = 0; i2 < term.length; ++i2) - term[i2](); - }, "tAll"); - var cbd = /* @__PURE__ */ __name(function(a, b) { - mt(function() { - cb(a, b); - }); - }, "cbd"); - mt(function() { - cbd = cb; - }); - var cbf = /* @__PURE__ */ __name(function() { - var out = new u8(tot + 22), oe = o, cdl = tot - o; - tot = 0; - for (var i2 = 0; i2 < slft; ++i2) { - var f = files[i2]; - try { - var l = f.c.length; - wzh(out, tot, f, f.f, f.u, l); - var badd = 30 + f.f.length + exfl(f.extra); - var loc = tot + badd; - out.set(f.c, loc); - wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l; - } catch (e) { - return cbd(e, null); - } - } - wzf(out, o, files.length, cdl, oe); - cbd(null, out); - }, "cbf"); - if (!lft) - cbf(); - var _loop_1 = /* @__PURE__ */ __name(function(i2) { - var fn = k[i2]; - var _a2 = r[fn], file2 = _a2[0], p = _a2[1]; - var c = crc(), size = file2.length; - c.p(file2); - var f = strToU8(fn), s = f.length; - var com = p.comment, m = com && strToU8(com), ms = m && m.length; - var exl = exfl(p.extra); - var compression = p.level == 0 ? 0 : 8; - var cbl = /* @__PURE__ */ __name(function(e, d) { - if (e) { - tAll(); - cbd(e, null); - } else { - var l = d.length; - files[i2] = mrg(p, { - size, - crc: c.d(), - c: d, - f, - m, - u: s != fn.length || m && com.length != ms, - compression - }); - o += 30 + s + exl + l; - tot += 76 + 2 * (s + exl) + (ms || 0) + l; - if (!--lft) - cbf(); - } - }, "cbl"); - if (s > 65535) - cbl(err(11, 0, 1), null); - if (!compression) - cbl(null, file2); - else if (size < 16e4) { - try { - cbl(null, deflateSync(file2, p)); - } catch (e) { - cbl(e, null); - } - } else - term.push(deflate(file2, p, cbl)); - }, "_loop_1"); - for (var i = 0; i < slft; ++i) { - _loop_1(i); - } - return tAll; -} -__name(zip, "zip"); -function zipSync(data, opts) { - if (!opts) - opts = {}; - var r = {}; - var files = []; - fltn(data, "", r, opts); - var o = 0; - var tot = 0; - for (var fn in r) { - var _a2 = r[fn], file2 = _a2[0], p = _a2[1]; - var compression = p.level == 0 ? 0 : 8; - var f = strToU8(fn), s = f.length; - var com = p.comment, m = com && strToU8(com), ms = m && m.length; - var exl = exfl(p.extra); - if (s > 65535) - err(11); - var d = compression ? deflateSync(file2, p) : file2, l = d.length; - var c = crc(); - c.p(file2); - files.push(mrg(p, { - size: file2.length, - crc: c.d(), - c: d, - f, - m, - u: s != fn.length || m && com.length != ms, - o, - compression - })); - o += 30 + s + exl + l; - tot += 76 + 2 * (s + exl) + (ms || 0) + l; - } - var out = new u8(tot + 22), oe = o, cdl = tot - o; - for (var i = 0; i < files.length; ++i) { - var f = files[i]; - wzh(out, f.o, f, f.f, f.u, f.c.length); - var badd = 30 + f.f.length + exfl(f.extra); - out.set(f.c, f.o + badd); - wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0); - } - wzf(out, o, files.length, cdl, oe); - return out; -} -__name(zipSync, "zipSync"); -var UnzipPassThrough = /* @__PURE__ */ function() { - function UnzipPassThrough2() { - } - __name(UnzipPassThrough2, "UnzipPassThrough"); - UnzipPassThrough2.prototype.push = function(data, final) { - this.ondata(null, data, final); - }; - UnzipPassThrough2.compression = 0; - return UnzipPassThrough2; -}(); -var UnzipInflate = /* @__PURE__ */ function() { - function UnzipInflate2() { - var _this = this; - this.i = new Inflate(function(dat, final) { - _this.ondata(null, dat, final); - }); - } - __name(UnzipInflate2, "UnzipInflate"); - UnzipInflate2.prototype.push = function(data, final) { - try { - this.i.push(data, final); - } catch (e) { - this.ondata(e, null, final); - } - }; - UnzipInflate2.compression = 8; - return UnzipInflate2; -}(); -var AsyncUnzipInflate = /* @__PURE__ */ function() { - function AsyncUnzipInflate2(_, sz) { - var _this = this; - if (sz < 32e4) { - this.i = new Inflate(function(dat, final) { - _this.ondata(null, dat, final); - }); - } else { - this.i = new AsyncInflate(function(err2, dat, final) { - _this.ondata(err2, dat, final); - }); - this.terminate = this.i.terminate; - } - } - __name(AsyncUnzipInflate2, "AsyncUnzipInflate"); - AsyncUnzipInflate2.prototype.push = function(data, final) { - if (this.i.terminate) - data = slc(data, 0); - this.i.push(data, final); - }; - AsyncUnzipInflate2.compression = 8; - return AsyncUnzipInflate2; -}(); -var Unzip = /* @__PURE__ */ function() { - function Unzip2(cb) { - this.onfile = cb; - this.k = []; - this.o = { - 0: UnzipPassThrough - }; - this.p = et; - } - __name(Unzip2, "Unzip"); - Unzip2.prototype.push = function(chunk, final) { - var _this = this; - if (!this.onfile) - err(5); - if (!this.p) - err(4); - if (this.c > 0) { - var len = Math.min(this.c, chunk.length); - var toAdd = chunk.subarray(0, len); - this.c -= len; - if (this.d) - this.d.push(toAdd, !this.c); - else - this.k[0].push(toAdd); - chunk = chunk.subarray(len); - if (chunk.length) - return this.push(chunk, final); - } else { - var f = 0, i = 0, is = void 0, buf = void 0; - if (!this.p.length) - buf = chunk; - else if (!chunk.length) - buf = this.p; - else { - buf = new u8(this.p.length + chunk.length); - buf.set(this.p), buf.set(chunk, this.p.length); - } - var l = buf.length, oc = this.c, add = oc && this.d; - var _loop_2 = /* @__PURE__ */ __name(function() { - var _a2; - var sig = b4(buf, i); - if (sig == 67324752) { - f = 1, is = i; - this_1.d = null; - this_1.c = 0; - var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28); - if (l > i + 30 + fnl + es) { - var chks_3 = []; - this_1.k.unshift(chks_3); - f = 2; - var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22); - var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u); - if (sc_1 == 4294967295) { - _a2 = dd ? [-2] : z64e(buf, i), sc_1 = _a2[0], su_1 = _a2[1]; - } else if (dd) - sc_1 = -1; - i += es; - this_1.c = sc_1; - var d_1; - var file_1 = { - name: fn_1, - compression: cmp_1, - start: /* @__PURE__ */ __name(function() { - if (!file_1.ondata) - err(5); - if (!sc_1) - file_1.ondata(null, et, true); - else { - var ctr = _this.o[cmp_1]; - if (!ctr) - file_1.ondata(err(14, "unknown compression type " + cmp_1, 1), null, false); - d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1); - d_1.ondata = function(err2, dat3, final2) { - file_1.ondata(err2, dat3, final2); - }; - for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) { - var dat2 = chks_4[_i]; - d_1.push(dat2, false); - } - if (_this.k[0] == chks_3 && _this.c) - _this.d = d_1; - else - d_1.push(et, true); - } - }, "start"), - terminate: /* @__PURE__ */ __name(function() { - if (d_1 && d_1.terminate) - d_1.terminate(); - }, "terminate") - }; - if (sc_1 >= 0) - file_1.size = sc_1, file_1.originalSize = su_1; - this_1.onfile(file_1); - } - return "break"; - } else if (oc) { - if (sig == 134695760) { - is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0; - return "break"; - } else if (sig == 33639248) { - is = i -= 4, f = 3, this_1.c = 0; - return "break"; - } - } - }, "_loop_2"); - var this_1 = this; - for (; i < l - 4; ++i) { - var state_1 = _loop_2(); - if (state_1 === "break") - break; - } - this.p = et; - if (oc < 0) { - var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 134695760 && 4)) : buf.subarray(0, i); - if (add) - add.push(dat, !!f); - else - this.k[+(f == 2)].push(dat); - } - if (f & 2) - return this.push(buf.subarray(i), final); - this.p = buf.subarray(i); - } - if (final) { - if (this.c) - err(13); - this.p = null; - } - }; - Unzip2.prototype.register = function(decoder) { - this.o[decoder.compression] = decoder; - }; - return Unzip2; -}(); -var mt = typeof queueMicrotask == "function" ? queueMicrotask : typeof setTimeout == "function" ? setTimeout : function(fn) { - fn(); -}; -function unzip(data, opts, cb) { - if (!cb) - cb = opts, opts = {}; - if (typeof cb != "function") - err(7); - var term = []; - var tAll = /* @__PURE__ */ __name(function() { - for (var i2 = 0; i2 < term.length; ++i2) - term[i2](); - }, "tAll"); - var files = {}; - var cbd = /* @__PURE__ */ __name(function(a, b) { - mt(function() { - cb(a, b); - }); - }, "cbd"); - mt(function() { - cbd = cb; - }); - var e = data.length - 22; - for (; b4(data, e) != 101010256; --e) { - if (!e || data.length - e > 65558) { - cbd(err(13, 0, 1), null); - return tAll; - } - } - ; - var lft = b2(data, e + 8); - if (lft) { - var c = lft; - var o = b4(data, e + 16); - var z = o == 4294967295 || c == 65535; - if (z) { - var ze = b4(data, e - 12); - z = b4(data, ze) == 101075792; - if (z) { - c = lft = b4(data, ze + 32); - o = b4(data, ze + 48); - } - } - var fltr = opts && opts.filter; - var _loop_3 = /* @__PURE__ */ __name(function(i2) { - var _a2 = zh(data, o, z), c_1 = _a2[0], sc = _a2[1], su = _a2[2], fn = _a2[3], no = _a2[4], off = _a2[5], b = slzh(data, off); - o = no; - var cbl = /* @__PURE__ */ __name(function(e2, d) { - if (e2) { - tAll(); - cbd(e2, null); - } else { - if (d) - files[fn] = d; - if (!--lft) - cbd(null, files); - } - }, "cbl"); - if (!fltr || fltr({ - name: fn, - size: sc, - originalSize: su, - compression: c_1 - })) { - if (!c_1) - cbl(null, slc(data, b, b + sc)); - else if (c_1 == 8) { - var infl = data.subarray(b, b + sc); - if (su < 524288 || sc > 0.8 * su) { - try { - cbl(null, inflateSync(infl, { out: new u8(su) })); - } catch (e2) { - cbl(e2, null); - } - } else - term.push(inflate(infl, { size: su }, cbl)); - } else - cbl(err(14, "unknown compression type " + c_1, 1), null); - } else - cbl(null, null); - }, "_loop_3"); - for (var i = 0; i < c; ++i) { - _loop_3(i); - } - } else - cbd(null, {}); - return tAll; -} -__name(unzip, "unzip"); -function unzipSync(data, opts) { - var files = {}; - var e = data.length - 22; - for (; b4(data, e) != 101010256; --e) { - if (!e || data.length - e > 65558) - err(13); - } - ; - var c = b2(data, e + 8); - if (!c) - return {}; - var o = b4(data, e + 16); - var z = o == 4294967295 || c == 65535; - if (z) { - var ze = b4(data, e - 12); - z = b4(data, ze) == 101075792; - if (z) { - c = b4(data, ze + 32); - o = b4(data, ze + 48); - } - } - var fltr = opts && opts.filter; - for (var i = 0; i < c; ++i) { - var _a2 = zh(data, o, z), c_2 = _a2[0], sc = _a2[1], su = _a2[2], fn = _a2[3], no = _a2[4], off = _a2[5], b = slzh(data, off); - o = no; - if (!fltr || fltr({ - name: fn, - size: sc, - originalSize: su, - compression: c_2 - })) { - if (!c_2) - files[fn] = slc(data, b, b + sc); - else if (c_2 == 8) - files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) }); - else - err(14, "unknown compression type " + c_2); - } - } - return files; -} -__name(unzipSync, "unzipSync"); -function findSpan(p, u, U) { - const n = U.length - p - 1; - if (u >= U[n]) { - return n - 1; - } - if (u <= U[p]) { - return p; - } - let low = p; - let high = n; - let mid = Math.floor((low + high) / 2); - while (u < U[mid] || u >= U[mid + 1]) { - if (u < U[mid]) { - high = mid; - } else { - low = mid; - } - mid = Math.floor((low + high) / 2); - } - return mid; -} -__name(findSpan, "findSpan"); -function calcBasisFunctions(span, u, p, U) { - const N = []; - const left = []; - const right = []; - N[0] = 1; - for (let j = 1; j <= p; ++j) { - left[j] = u - U[span + 1 - j]; - right[j] = U[span + j] - u; - let saved = 0; - for (let r = 0; r < j; ++r) { - const rv = right[r + 1]; - const lv = left[j - r]; - const temp = N[r] / (rv + lv); - N[r] = saved + rv * temp; - saved = lv * temp; - } - N[j] = saved; - } - return N; -} -__name(calcBasisFunctions, "calcBasisFunctions"); -function calcBSplinePoint(p, U, P, u) { - const span = findSpan(p, u, U); - const N = calcBasisFunctions(span, u, p, U); - const C = new Vector4(0, 0, 0, 0); - for (let j = 0; j <= p; ++j) { - const point = P[span - p + j]; - const Nj = N[j]; - const wNj = point.w * Nj; - C.x += point.x * wNj; - C.y += point.y * wNj; - C.z += point.z * wNj; - C.w += point.w * Nj; - } - return C; -} -__name(calcBSplinePoint, "calcBSplinePoint"); -function calcBasisFunctionDerivatives(span, u, p, n, U) { - const zeroArr = []; - for (let i = 0; i <= p; ++i) - zeroArr[i] = 0; - const ders = []; - for (let i = 0; i <= n; ++i) - ders[i] = zeroArr.slice(0); - const ndu = []; - for (let i = 0; i <= p; ++i) - ndu[i] = zeroArr.slice(0); - ndu[0][0] = 1; - const left = zeroArr.slice(0); - const right = zeroArr.slice(0); - for (let j = 1; j <= p; ++j) { - left[j] = u - U[span + 1 - j]; - right[j] = U[span + j] - u; - let saved = 0; - for (let r2 = 0; r2 < j; ++r2) { - const rv = right[r2 + 1]; - const lv = left[j - r2]; - ndu[j][r2] = rv + lv; - const temp = ndu[r2][j - 1] / ndu[j][r2]; - ndu[r2][j] = saved + rv * temp; - saved = lv * temp; - } - ndu[j][j] = saved; - } - for (let j = 0; j <= p; ++j) { - ders[0][j] = ndu[j][p]; - } - for (let r2 = 0; r2 <= p; ++r2) { - let s1 = 0; - let s2 = 1; - const a = []; - for (let i = 0; i <= p; ++i) { - a[i] = zeroArr.slice(0); - } - a[0][0] = 1; - for (let k = 1; k <= n; ++k) { - let d = 0; - const rk = r2 - k; - const pk = p - k; - if (r2 >= k) { - a[s2][0] = a[s1][0] / ndu[pk + 1][rk]; - d = a[s2][0] * ndu[rk][pk]; - } - const j1 = rk >= -1 ? 1 : -rk; - const j2 = r2 - 1 <= pk ? k - 1 : p - r2; - for (let j3 = j1; j3 <= j2; ++j3) { - a[s2][j3] = (a[s1][j3] - a[s1][j3 - 1]) / ndu[pk + 1][rk + j3]; - d += a[s2][j3] * ndu[rk + j3][pk]; - } - if (r2 <= pk) { - a[s2][k] = -a[s1][k - 1] / ndu[pk + 1][r2]; - d += a[s2][k] * ndu[r2][pk]; - } - ders[k][r2] = d; - const j = s1; - s1 = s2; - s2 = j; - } - } - let r = p; - for (let k = 1; k <= n; ++k) { - for (let j = 0; j <= p; ++j) { - ders[k][j] *= r; - } - r *= p - k; - } - return ders; -} -__name(calcBasisFunctionDerivatives, "calcBasisFunctionDerivatives"); -function calcBSplineDerivatives(p, U, P, u, nd) { - const du = nd < p ? nd : p; - const CK = []; - const span = findSpan(p, u, U); - const nders = calcBasisFunctionDerivatives(span, u, p, du, U); - const Pw = []; - for (let i = 0; i < P.length; ++i) { - const point = P[i].clone(); - const w = point.w; - point.x *= w; - point.y *= w; - point.z *= w; - Pw[i] = point; - } - for (let k = 0; k <= du; ++k) { - const point = Pw[span - p].clone().multiplyScalar(nders[k][0]); - for (let j = 1; j <= p; ++j) { - point.add(Pw[span - p + j].clone().multiplyScalar(nders[k][j])); - } - CK[k] = point; - } - for (let k = du + 1; k <= nd + 1; ++k) { - CK[k] = new Vector4(0, 0, 0); - } - return CK; -} -__name(calcBSplineDerivatives, "calcBSplineDerivatives"); -function calcKoverI(k, i) { - let nom = 1; - for (let j = 2; j <= k; ++j) { - nom *= j; - } - let denom = 1; - for (let j = 2; j <= i; ++j) { - denom *= j; - } - for (let j = 2; j <= k - i; ++j) { - denom *= j; - } - return nom / denom; -} -__name(calcKoverI, "calcKoverI"); -function calcRationalCurveDerivatives(Pders) { - const nd = Pders.length; - const Aders = []; - const wders = []; - for (let i = 0; i < nd; ++i) { - const point = Pders[i]; - Aders[i] = new Vector3(point.x, point.y, point.z); - wders[i] = point.w; - } - const CK = []; - for (let k = 0; k < nd; ++k) { - const v = Aders[k].clone(); - for (let i = 1; i <= k; ++i) { - v.sub(CK[k - i].clone().multiplyScalar(calcKoverI(k, i) * wders[i])); - } - CK[k] = v.divideScalar(wders[0]); - } - return CK; -} -__name(calcRationalCurveDerivatives, "calcRationalCurveDerivatives"); -function calcNURBSDerivatives(p, U, P, u, nd) { - const Pders = calcBSplineDerivatives(p, U, P, u, nd); - return calcRationalCurveDerivatives(Pders); -} -__name(calcNURBSDerivatives, "calcNURBSDerivatives"); -function calcSurfacePoint(p, q, U, V, P, u, v, target) { - const uspan = findSpan(p, u, U); - const vspan = findSpan(q, v, V); - const Nu = calcBasisFunctions(uspan, u, p, U); - const Nv = calcBasisFunctions(vspan, v, q, V); - const temp = []; - for (let l = 0; l <= q; ++l) { - temp[l] = new Vector4(0, 0, 0, 0); - for (let k = 0; k <= p; ++k) { - const point = P[uspan - p + k][vspan - q + l].clone(); - const w = point.w; - point.x *= w; - point.y *= w; - point.z *= w; - temp[l].add(point.multiplyScalar(Nu[k])); - } - } - const Sw = new Vector4(0, 0, 0, 0); - for (let l = 0; l <= q; ++l) { - Sw.add(temp[l].multiplyScalar(Nv[l])); - } - Sw.divideScalar(Sw.w); - target.set(Sw.x, Sw.y, Sw.z); -} -__name(calcSurfacePoint, "calcSurfacePoint"); -function calcVolumePoint(p, q, r, U, V, W, P, u, v, w, target) { - const uspan = findSpan(p, u, U); - const vspan = findSpan(q, v, V); - const wspan = findSpan(r, w, W); - const Nu = calcBasisFunctions(uspan, u, p, U); - const Nv = calcBasisFunctions(vspan, v, q, V); - const Nw = calcBasisFunctions(wspan, w, r, W); - const temp = []; - for (let m = 0; m <= r; ++m) { - temp[m] = []; - for (let l = 0; l <= q; ++l) { - temp[m][l] = new Vector4(0, 0, 0, 0); - for (let k = 0; k <= p; ++k) { - const point = P[uspan - p + k][vspan - q + l][wspan - r + m].clone(); - const w2 = point.w; - point.x *= w2; - point.y *= w2; - point.z *= w2; - temp[m][l].add(point.multiplyScalar(Nu[k])); - } - } - } - const Sw = new Vector4(0, 0, 0, 0); - for (let m = 0; m <= r; ++m) { - for (let l = 0; l <= q; ++l) { - Sw.add(temp[m][l].multiplyScalar(Nw[m]).multiplyScalar(Nv[l])); - } - } - Sw.divideScalar(Sw.w); - target.set(Sw.x, Sw.y, Sw.z); -} -__name(calcVolumePoint, "calcVolumePoint"); -class NURBSCurve extends Curve { - static { - __name(this, "NURBSCurve"); - } - constructor(degree, knots, controlPoints, startKnot, endKnot) { - super(); - const knotsLength = knots ? knots.length - 1 : 0; - const pointsLength = controlPoints ? controlPoints.length : 0; - this.degree = degree; - this.knots = knots; - this.controlPoints = []; - this.startKnot = startKnot || 0; - this.endKnot = endKnot || knotsLength; - for (let i = 0; i < pointsLength; ++i) { - const point = controlPoints[i]; - this.controlPoints[i] = new Vector4(point.x, point.y, point.z, point.w); - } - } - getPoint(t2, optionalTarget = new Vector3()) { - const point = optionalTarget; - const u = this.knots[this.startKnot] + t2 * (this.knots[this.endKnot] - this.knots[this.startKnot]); - const hpoint = calcBSplinePoint(this.degree, this.knots, this.controlPoints, u); - if (hpoint.w !== 1) { - hpoint.divideScalar(hpoint.w); - } - return point.set(hpoint.x, hpoint.y, hpoint.z); - } - getTangent(t2, optionalTarget = new Vector3()) { - const tangent = optionalTarget; - const u = this.knots[0] + t2 * (this.knots[this.knots.length - 1] - this.knots[0]); - const ders = calcNURBSDerivatives(this.degree, this.knots, this.controlPoints, u, 1); - tangent.copy(ders[1]).normalize(); - return tangent; - } - toJSON() { - const data = super.toJSON(); - data.degree = this.degree; - data.knots = [...this.knots]; - data.controlPoints = this.controlPoints.map((p) => p.toArray()); - data.startKnot = this.startKnot; - data.endKnot = this.endKnot; - return data; - } - fromJSON(json) { - super.fromJSON(json); - this.degree = json.degree; - this.knots = [...json.knots]; - this.controlPoints = json.controlPoints.map((p) => new Vector4(p[0], p[1], p[2], p[3])); - this.startKnot = json.startKnot; - this.endKnot = json.endKnot; - return this; - } -} -let fbxTree; -let connections; -let sceneGraph; -class FBXLoader extends Loader { - static { - __name(this, "FBXLoader"); - } - constructor(manager) { - super(manager); - } - load(url, onLoad, onProgress, onError) { - const scope = this; - const path = scope.path === "" ? LoaderUtils.extractUrlBase(url) : scope.path; - const loader = new FileLoader(this.manager); - loader.setPath(scope.path); - loader.setResponseType("arraybuffer"); - loader.setRequestHeader(scope.requestHeader); - loader.setWithCredentials(scope.withCredentials); - loader.load(url, function(buffer) { - try { - onLoad(scope.parse(buffer, path)); - } catch (e) { - if (onError) { - onError(e); - } else { - console.error(e); - } - scope.manager.itemError(url); - } - }, onProgress, onError); - } - parse(FBXBuffer, path) { - if (isFbxFormatBinary(FBXBuffer)) { - fbxTree = new BinaryParser().parse(FBXBuffer); - } else { - const FBXText = convertArrayBufferToString(FBXBuffer); - if (!isFbxFormatASCII(FBXText)) { - throw new Error("THREE.FBXLoader: Unknown format."); - } - if (getFbxVersion(FBXText) < 7e3) { - throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: " + getFbxVersion(FBXText)); - } - fbxTree = new TextParser().parse(FBXText); - } - const textureLoader = new TextureLoader(this.manager).setPath(this.resourcePath || path).setCrossOrigin(this.crossOrigin); - return new FBXTreeParser(textureLoader, this.manager).parse(fbxTree); - } -} -class FBXTreeParser { - static { - __name(this, "FBXTreeParser"); - } - constructor(textureLoader, manager) { - this.textureLoader = textureLoader; - this.manager = manager; - } - parse() { - connections = this.parseConnections(); - const images = this.parseImages(); - const textures = this.parseTextures(images); - const materials = this.parseMaterials(textures); - const deformers = this.parseDeformers(); - const geometryMap = new GeometryParser().parse(deformers); - this.parseScene(deformers, geometryMap, materials); - return sceneGraph; - } - // Parses FBXTree.Connections which holds parent-child connections between objects (e.g. material -> texture, model->geometry ) - // and details the connection type - parseConnections() { - const connectionMap = /* @__PURE__ */ new Map(); - if ("Connections" in fbxTree) { - const rawConnections = fbxTree.Connections.connections; - rawConnections.forEach(function(rawConnection) { - const fromID = rawConnection[0]; - const toID = rawConnection[1]; - const relationship = rawConnection[2]; - if (!connectionMap.has(fromID)) { - connectionMap.set(fromID, { - parents: [], - children: [] - }); - } - const parentRelationship = { ID: toID, relationship }; - connectionMap.get(fromID).parents.push(parentRelationship); - if (!connectionMap.has(toID)) { - connectionMap.set(toID, { - parents: [], - children: [] - }); - } - const childRelationship = { ID: fromID, relationship }; - connectionMap.get(toID).children.push(childRelationship); - }); - } - return connectionMap; - } - // Parse FBXTree.Objects.Video for embedded image data - // These images are connected to textures in FBXTree.Objects.Textures - // via FBXTree.Connections. - parseImages() { - const images = {}; - const blobs = {}; - if ("Video" in fbxTree.Objects) { - const videoNodes = fbxTree.Objects.Video; - for (const nodeID in videoNodes) { - const videoNode = videoNodes[nodeID]; - const id2 = parseInt(nodeID); - images[id2] = videoNode.RelativeFilename || videoNode.Filename; - if ("Content" in videoNode) { - const arrayBufferContent = videoNode.Content instanceof ArrayBuffer && videoNode.Content.byteLength > 0; - const base64Content = typeof videoNode.Content === "string" && videoNode.Content !== ""; - if (arrayBufferContent || base64Content) { - const image = this.parseImage(videoNodes[nodeID]); - blobs[videoNode.RelativeFilename || videoNode.Filename] = image; - } - } - } - } - for (const id2 in images) { - const filename = images[id2]; - if (blobs[filename] !== void 0) images[id2] = blobs[filename]; - else images[id2] = images[id2].split("\\").pop(); - } - return images; - } - // Parse embedded image data in FBXTree.Video.Content - parseImage(videoNode) { - const content = videoNode.Content; - const fileName = videoNode.RelativeFilename || videoNode.Filename; - const extension = fileName.slice(fileName.lastIndexOf(".") + 1).toLowerCase(); - let type; - switch (extension) { - case "bmp": - type = "image/bmp"; - break; - case "jpg": - case "jpeg": - type = "image/jpeg"; - break; - case "png": - type = "image/png"; - break; - case "tif": - type = "image/tiff"; - break; - case "tga": - if (this.manager.getHandler(".tga") === null) { - console.warn("FBXLoader: TGA loader not found, skipping ", fileName); - } - type = "image/tga"; - break; - default: - console.warn('FBXLoader: Image type "' + extension + '" is not supported.'); - return; - } - if (typeof content === "string") { - return "data:" + type + ";base64," + content; - } else { - const array = new Uint8Array(content); - return window.URL.createObjectURL(new Blob([array], { type })); - } - } - // Parse nodes in FBXTree.Objects.Texture - // These contain details such as UV scaling, cropping, rotation etc and are connected - // to images in FBXTree.Objects.Video - parseTextures(images) { - const textureMap = /* @__PURE__ */ new Map(); - if ("Texture" in fbxTree.Objects) { - const textureNodes = fbxTree.Objects.Texture; - for (const nodeID in textureNodes) { - const texture = this.parseTexture(textureNodes[nodeID], images); - textureMap.set(parseInt(nodeID), texture); - } - } - return textureMap; - } - // Parse individual node in FBXTree.Objects.Texture - parseTexture(textureNode, images) { - const texture = this.loadTexture(textureNode, images); - texture.ID = textureNode.id; - texture.name = textureNode.attrName; - const wrapModeU = textureNode.WrapModeU; - const wrapModeV = textureNode.WrapModeV; - const valueU = wrapModeU !== void 0 ? wrapModeU.value : 0; - const valueV = wrapModeV !== void 0 ? wrapModeV.value : 0; - texture.wrapS = valueU === 0 ? RepeatWrapping : ClampToEdgeWrapping; - texture.wrapT = valueV === 0 ? RepeatWrapping : ClampToEdgeWrapping; - if ("Scaling" in textureNode) { - const values = textureNode.Scaling.value; - texture.repeat.x = values[0]; - texture.repeat.y = values[1]; - } - if ("Translation" in textureNode) { - const values = textureNode.Translation.value; - texture.offset.x = values[0]; - texture.offset.y = values[1]; - } - return texture; - } - // load a texture specified as a blob or data URI, or via an external URL using TextureLoader - loadTexture(textureNode, images) { - const nonNativeExtensions = /* @__PURE__ */ new Set(["tga", "tif", "tiff", "exr", "dds", "hdr", "ktx2"]); - const extension = textureNode.FileName.split(".").pop().toLowerCase(); - const loader = nonNativeExtensions.has(extension) ? this.manager.getHandler(`.${extension}`) : this.textureLoader; - if (!loader) { - console.warn( - `FBXLoader: ${extension.toUpperCase()} loader not found, creating placeholder texture for`, - textureNode.RelativeFilename - ); - return new Texture(); - } - const loaderPath = loader.path; - if (!loaderPath) { - loader.setPath(this.textureLoader.path); - } - const children = connections.get(textureNode.id).children; - let fileName; - if (children !== void 0 && children.length > 0 && images[children[0].ID] !== void 0) { - fileName = images[children[0].ID]; - if (fileName.indexOf("blob:") === 0 || fileName.indexOf("data:") === 0) { - loader.setPath(void 0); - } - } - const texture = loader.load(fileName); - loader.setPath(loaderPath); - return texture; - } - // Parse nodes in FBXTree.Objects.Material - parseMaterials(textureMap) { - const materialMap = /* @__PURE__ */ new Map(); - if ("Material" in fbxTree.Objects) { - const materialNodes = fbxTree.Objects.Material; - for (const nodeID in materialNodes) { - const material = this.parseMaterial(materialNodes[nodeID], textureMap); - if (material !== null) materialMap.set(parseInt(nodeID), material); - } - } - return materialMap; - } - // Parse single node in FBXTree.Objects.Material - // Materials are connected to texture maps in FBXTree.Objects.Textures - // FBX format currently only supports Lambert and Phong shading models - parseMaterial(materialNode, textureMap) { - const ID = materialNode.id; - const name = materialNode.attrName; - let type = materialNode.ShadingModel; - if (typeof type === "object") { - type = type.value; - } - if (!connections.has(ID)) return null; - const parameters = this.parseParameters(materialNode, textureMap, ID); - let material; - switch (type.toLowerCase()) { - case "phong": - material = new MeshPhongMaterial(); - break; - case "lambert": - material = new MeshLambertMaterial(); - break; - default: - console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.', type); - material = new MeshPhongMaterial(); - break; - } - material.setValues(parameters); - material.name = name; - return material; - } - // Parse FBX material and return parameters suitable for a three.js material - // Also parse the texture map and return any textures associated with the material - parseParameters(materialNode, textureMap, ID) { - const parameters = {}; - if (materialNode.BumpFactor) { - parameters.bumpScale = materialNode.BumpFactor.value; - } - if (materialNode.Diffuse) { - parameters.color = ColorManagement.toWorkingColorSpace(new Color().fromArray(materialNode.Diffuse.value), SRGBColorSpace); - } else if (materialNode.DiffuseColor && (materialNode.DiffuseColor.type === "Color" || materialNode.DiffuseColor.type === "ColorRGB")) { - parameters.color = ColorManagement.toWorkingColorSpace(new Color().fromArray(materialNode.DiffuseColor.value), SRGBColorSpace); - } - if (materialNode.DisplacementFactor) { - parameters.displacementScale = materialNode.DisplacementFactor.value; - } - if (materialNode.Emissive) { - parameters.emissive = ColorManagement.toWorkingColorSpace(new Color().fromArray(materialNode.Emissive.value), SRGBColorSpace); - } else if (materialNode.EmissiveColor && (materialNode.EmissiveColor.type === "Color" || materialNode.EmissiveColor.type === "ColorRGB")) { - parameters.emissive = ColorManagement.toWorkingColorSpace(new Color().fromArray(materialNode.EmissiveColor.value), SRGBColorSpace); - } - if (materialNode.EmissiveFactor) { - parameters.emissiveIntensity = parseFloat(materialNode.EmissiveFactor.value); - } - parameters.opacity = 1 - (materialNode.TransparencyFactor ? parseFloat(materialNode.TransparencyFactor.value) : 0); - if (parameters.opacity === 1 || parameters.opacity === 0) { - parameters.opacity = materialNode.Opacity ? parseFloat(materialNode.Opacity.value) : null; - if (parameters.opacity === null) { - parameters.opacity = 1 - (materialNode.TransparentColor ? parseFloat(materialNode.TransparentColor.value[0]) : 0); - } - } - if (parameters.opacity < 1) { - parameters.transparent = true; - } - if (materialNode.ReflectionFactor) { - parameters.reflectivity = materialNode.ReflectionFactor.value; - } - if (materialNode.Shininess) { - parameters.shininess = materialNode.Shininess.value; - } - if (materialNode.Specular) { - parameters.specular = ColorManagement.toWorkingColorSpace(new Color().fromArray(materialNode.Specular.value), SRGBColorSpace); - } else if (materialNode.SpecularColor && materialNode.SpecularColor.type === "Color") { - parameters.specular = ColorManagement.toWorkingColorSpace(new Color().fromArray(materialNode.SpecularColor.value), SRGBColorSpace); - } - const scope = this; - connections.get(ID).children.forEach(function(child) { - const type = child.relationship; - switch (type) { - case "Bump": - parameters.bumpMap = scope.getTexture(textureMap, child.ID); - break; - case "Maya|TEX_ao_map": - parameters.aoMap = scope.getTexture(textureMap, child.ID); - break; - case "DiffuseColor": - case "Maya|TEX_color_map": - parameters.map = scope.getTexture(textureMap, child.ID); - if (parameters.map !== void 0) { - parameters.map.colorSpace = SRGBColorSpace; - } - break; - case "DisplacementColor": - parameters.displacementMap = scope.getTexture(textureMap, child.ID); - break; - case "EmissiveColor": - parameters.emissiveMap = scope.getTexture(textureMap, child.ID); - if (parameters.emissiveMap !== void 0) { - parameters.emissiveMap.colorSpace = SRGBColorSpace; - } - break; - case "NormalMap": - case "Maya|TEX_normal_map": - parameters.normalMap = scope.getTexture(textureMap, child.ID); - break; - case "ReflectionColor": - parameters.envMap = scope.getTexture(textureMap, child.ID); - if (parameters.envMap !== void 0) { - parameters.envMap.mapping = EquirectangularReflectionMapping; - parameters.envMap.colorSpace = SRGBColorSpace; - } - break; - case "SpecularColor": - parameters.specularMap = scope.getTexture(textureMap, child.ID); - if (parameters.specularMap !== void 0) { - parameters.specularMap.colorSpace = SRGBColorSpace; - } - break; - case "TransparentColor": - case "TransparencyFactor": - parameters.alphaMap = scope.getTexture(textureMap, child.ID); - parameters.transparent = true; - break; - case "AmbientColor": - case "ShininessExponent": - case "SpecularFactor": - case "VectorDisplacementColor": - default: - console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.", type); - break; - } - }); - return parameters; - } - // get a texture from the textureMap for use by a material. - getTexture(textureMap, id2) { - if ("LayeredTexture" in fbxTree.Objects && id2 in fbxTree.Objects.LayeredTexture) { - console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."); - id2 = connections.get(id2).children[0].ID; - } - return textureMap.get(id2); - } - // Parse nodes in FBXTree.Objects.Deformer - // Deformer node can contain skinning or Vertex Cache animation data, however only skinning is supported here - // Generates map of Skeleton-like objects for use later when generating and binding skeletons. - parseDeformers() { - const skeletons = {}; - const morphTargets = {}; - if ("Deformer" in fbxTree.Objects) { - const DeformerNodes = fbxTree.Objects.Deformer; - for (const nodeID in DeformerNodes) { - const deformerNode = DeformerNodes[nodeID]; - const relationships = connections.get(parseInt(nodeID)); - if (deformerNode.attrType === "Skin") { - const skeleton = this.parseSkeleton(relationships, DeformerNodes); - skeleton.ID = nodeID; - if (relationships.parents.length > 1) console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."); - skeleton.geometryID = relationships.parents[0].ID; - skeletons[nodeID] = skeleton; - } else if (deformerNode.attrType === "BlendShape") { - const morphTarget = { - id: nodeID - }; - morphTarget.rawTargets = this.parseMorphTargets(relationships, DeformerNodes); - morphTarget.id = nodeID; - if (relationships.parents.length > 1) console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."); - morphTargets[nodeID] = morphTarget; - } - } - } - return { - skeletons, - morphTargets - }; - } - // Parse single nodes in FBXTree.Objects.Deformer - // The top level skeleton node has type 'Skin' and sub nodes have type 'Cluster' - // Each skin node represents a skeleton and each cluster node represents a bone - parseSkeleton(relationships, deformerNodes) { - const rawBones = []; - relationships.children.forEach(function(child) { - const boneNode = deformerNodes[child.ID]; - if (boneNode.attrType !== "Cluster") return; - const rawBone = { - ID: child.ID, - indices: [], - weights: [], - transformLink: new Matrix4().fromArray(boneNode.TransformLink.a) - // transform: new Matrix4().fromArray( boneNode.Transform.a ), - // linkMode: boneNode.Mode, - }; - if ("Indexes" in boneNode) { - rawBone.indices = boneNode.Indexes.a; - rawBone.weights = boneNode.Weights.a; - } - rawBones.push(rawBone); - }); - return { - rawBones, - bones: [] - }; - } - // The top level morph deformer node has type "BlendShape" and sub nodes have type "BlendShapeChannel" - parseMorphTargets(relationships, deformerNodes) { - const rawMorphTargets = []; - for (let i = 0; i < relationships.children.length; i++) { - const child = relationships.children[i]; - const morphTargetNode = deformerNodes[child.ID]; - const rawMorphTarget = { - name: morphTargetNode.attrName, - initialWeight: morphTargetNode.DeformPercent, - id: morphTargetNode.id, - fullWeights: morphTargetNode.FullWeights.a - }; - if (morphTargetNode.attrType !== "BlendShapeChannel") return; - rawMorphTarget.geoID = connections.get(parseInt(child.ID)).children.filter(function(child2) { - return child2.relationship === void 0; - })[0].ID; - rawMorphTargets.push(rawMorphTarget); - } - return rawMorphTargets; - } - // create the main Group() to be returned by the loader - parseScene(deformers, geometryMap, materialMap) { - sceneGraph = new Group(); - const modelMap = this.parseModels(deformers.skeletons, geometryMap, materialMap); - const modelNodes = fbxTree.Objects.Model; - const scope = this; - modelMap.forEach(function(model) { - const modelNode = modelNodes[model.ID]; - scope.setLookAtProperties(model, modelNode); - const parentConnections = connections.get(model.ID).parents; - parentConnections.forEach(function(connection) { - const parent = modelMap.get(connection.ID); - if (parent !== void 0) parent.add(model); - }); - if (model.parent === null) { - sceneGraph.add(model); - } - }); - this.bindSkeleton(deformers.skeletons, geometryMap, modelMap); - this.addGlobalSceneSettings(); - sceneGraph.traverse(function(node) { - if (node.userData.transformData) { - if (node.parent) { - node.userData.transformData.parentMatrix = node.parent.matrix; - node.userData.transformData.parentMatrixWorld = node.parent.matrixWorld; - } - const transform = generateTransform(node.userData.transformData); - node.applyMatrix4(transform); - node.updateWorldMatrix(); - } - }); - const animations = new AnimationParser().parse(); - if (sceneGraph.children.length === 1 && sceneGraph.children[0].isGroup) { - sceneGraph.children[0].animations = animations; - sceneGraph = sceneGraph.children[0]; - } - sceneGraph.animations = animations; - } - // parse nodes in FBXTree.Objects.Model - parseModels(skeletons, geometryMap, materialMap) { - const modelMap = /* @__PURE__ */ new Map(); - const modelNodes = fbxTree.Objects.Model; - for (const nodeID in modelNodes) { - const id2 = parseInt(nodeID); - const node = modelNodes[nodeID]; - const relationships = connections.get(id2); - let model = this.buildSkeleton(relationships, skeletons, id2, node.attrName); - if (!model) { - switch (node.attrType) { - case "Camera": - model = this.createCamera(relationships); - break; - case "Light": - model = this.createLight(relationships); - break; - case "Mesh": - model = this.createMesh(relationships, geometryMap, materialMap); - break; - case "NurbsCurve": - model = this.createCurve(relationships, geometryMap); - break; - case "LimbNode": - case "Root": - model = new Bone(); - break; - case "Null": - default: - model = new Group(); - break; - } - model.name = node.attrName ? PropertyBinding.sanitizeNodeName(node.attrName) : ""; - model.userData.originalName = node.attrName; - model.ID = id2; - } - this.getTransformData(model, node); - modelMap.set(id2, model); - } - return modelMap; - } - buildSkeleton(relationships, skeletons, id2, name) { - let bone = null; - relationships.parents.forEach(function(parent) { - for (const ID in skeletons) { - const skeleton = skeletons[ID]; - skeleton.rawBones.forEach(function(rawBone, i) { - if (rawBone.ID === parent.ID) { - const subBone = bone; - bone = new Bone(); - bone.matrixWorld.copy(rawBone.transformLink); - bone.name = name ? PropertyBinding.sanitizeNodeName(name) : ""; - bone.userData.originalName = name; - bone.ID = id2; - skeleton.bones[i] = bone; - if (subBone !== null) { - bone.add(subBone); - } - } - }); - } - }); - return bone; - } - // create a PerspectiveCamera or OrthographicCamera - createCamera(relationships) { - let model; - let cameraAttribute; - relationships.children.forEach(function(child) { - const attr = fbxTree.Objects.NodeAttribute[child.ID]; - if (attr !== void 0) { - cameraAttribute = attr; - } - }); - if (cameraAttribute === void 0) { - model = new Object3D(); - } else { - let type = 0; - if (cameraAttribute.CameraProjectionType !== void 0 && cameraAttribute.CameraProjectionType.value === 1) { - type = 1; - } - let nearClippingPlane = 1; - if (cameraAttribute.NearPlane !== void 0) { - nearClippingPlane = cameraAttribute.NearPlane.value / 1e3; - } - let farClippingPlane = 1e3; - if (cameraAttribute.FarPlane !== void 0) { - farClippingPlane = cameraAttribute.FarPlane.value / 1e3; - } - let width = window.innerWidth; - let height = window.innerHeight; - if (cameraAttribute.AspectWidth !== void 0 && cameraAttribute.AspectHeight !== void 0) { - width = cameraAttribute.AspectWidth.value; - height = cameraAttribute.AspectHeight.value; - } - const aspect2 = width / height; - let fov2 = 45; - if (cameraAttribute.FieldOfView !== void 0) { - fov2 = cameraAttribute.FieldOfView.value; - } - const focalLength = cameraAttribute.FocalLength ? cameraAttribute.FocalLength.value : null; - switch (type) { - case 0: - model = new PerspectiveCamera(fov2, aspect2, nearClippingPlane, farClippingPlane); - if (focalLength !== null) model.setFocalLength(focalLength); - break; - case 1: - console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."); - model = new Object3D(); - break; - default: - console.warn("THREE.FBXLoader: Unknown camera type " + type + "."); - model = new Object3D(); - break; - } - } - return model; - } - // Create a DirectionalLight, PointLight or SpotLight - createLight(relationships) { - let model; - let lightAttribute; - relationships.children.forEach(function(child) { - const attr = fbxTree.Objects.NodeAttribute[child.ID]; - if (attr !== void 0) { - lightAttribute = attr; - } - }); - if (lightAttribute === void 0) { - model = new Object3D(); - } else { - let type; - if (lightAttribute.LightType === void 0) { - type = 0; - } else { - type = lightAttribute.LightType.value; - } - let color = 16777215; - if (lightAttribute.Color !== void 0) { - color = ColorManagement.toWorkingColorSpace(new Color().fromArray(lightAttribute.Color.value), SRGBColorSpace); - } - let intensity = lightAttribute.Intensity === void 0 ? 1 : lightAttribute.Intensity.value / 100; - if (lightAttribute.CastLightOnObject !== void 0 && lightAttribute.CastLightOnObject.value === 0) { - intensity = 0; - } - let distance = 0; - if (lightAttribute.FarAttenuationEnd !== void 0) { - if (lightAttribute.EnableFarAttenuation !== void 0 && lightAttribute.EnableFarAttenuation.value === 0) { - distance = 0; - } else { - distance = lightAttribute.FarAttenuationEnd.value; - } - } - const decay = 1; - switch (type) { - case 0: - model = new PointLight(color, intensity, distance, decay); - break; - case 1: - model = new DirectionalLight(color, intensity); - break; - case 2: - let angle = Math.PI / 3; - if (lightAttribute.InnerAngle !== void 0) { - angle = MathUtils.degToRad(lightAttribute.InnerAngle.value); - } - let penumbra = 0; - if (lightAttribute.OuterAngle !== void 0) { - penumbra = MathUtils.degToRad(lightAttribute.OuterAngle.value); - penumbra = Math.max(penumbra, 1); - } - model = new SpotLight(color, intensity, distance, angle, penumbra, decay); - break; - default: - console.warn("THREE.FBXLoader: Unknown light type " + lightAttribute.LightType.value + ", defaulting to a PointLight."); - model = new PointLight(color, intensity); - break; - } - if (lightAttribute.CastShadows !== void 0 && lightAttribute.CastShadows.value === 1) { - model.castShadow = true; - } - } - return model; - } - createMesh(relationships, geometryMap, materialMap) { - let model; - let geometry = null; - let material = null; - const materials = []; - relationships.children.forEach(function(child) { - if (geometryMap.has(child.ID)) { - geometry = geometryMap.get(child.ID); - } - if (materialMap.has(child.ID)) { - materials.push(materialMap.get(child.ID)); - } - }); - if (materials.length > 1) { - material = materials; - } else if (materials.length > 0) { - material = materials[0]; - } else { - material = new MeshPhongMaterial({ - name: Loader.DEFAULT_MATERIAL_NAME, - color: 13421772 - }); - materials.push(material); - } - if ("color" in geometry.attributes) { - materials.forEach(function(material2) { - material2.vertexColors = true; - }); - } - if (geometry.FBX_Deformer) { - model = new SkinnedMesh(geometry, material); - model.normalizeSkinWeights(); - } else { - model = new Mesh(geometry, material); - } - return model; - } - createCurve(relationships, geometryMap) { - const geometry = relationships.children.reduce(function(geo, child) { - if (geometryMap.has(child.ID)) geo = geometryMap.get(child.ID); - return geo; - }, null); - const material = new LineBasicMaterial({ - name: Loader.DEFAULT_MATERIAL_NAME, - color: 3342591, - linewidth: 1 - }); - return new Line(geometry, material); - } - // parse the model node for transform data - getTransformData(model, modelNode) { - const transformData = {}; - if ("InheritType" in modelNode) transformData.inheritType = parseInt(modelNode.InheritType.value); - if ("RotationOrder" in modelNode) transformData.eulerOrder = getEulerOrder(modelNode.RotationOrder.value); - else transformData.eulerOrder = getEulerOrder(0); - if ("Lcl_Translation" in modelNode) transformData.translation = modelNode.Lcl_Translation.value; - if ("PreRotation" in modelNode) transformData.preRotation = modelNode.PreRotation.value; - if ("Lcl_Rotation" in modelNode) transformData.rotation = modelNode.Lcl_Rotation.value; - if ("PostRotation" in modelNode) transformData.postRotation = modelNode.PostRotation.value; - if ("Lcl_Scaling" in modelNode) transformData.scale = modelNode.Lcl_Scaling.value; - if ("ScalingOffset" in modelNode) transformData.scalingOffset = modelNode.ScalingOffset.value; - if ("ScalingPivot" in modelNode) transformData.scalingPivot = modelNode.ScalingPivot.value; - if ("RotationOffset" in modelNode) transformData.rotationOffset = modelNode.RotationOffset.value; - if ("RotationPivot" in modelNode) transformData.rotationPivot = modelNode.RotationPivot.value; - model.userData.transformData = transformData; - } - setLookAtProperties(model, modelNode) { - if ("LookAtProperty" in modelNode) { - const children = connections.get(model.ID).children; - children.forEach(function(child) { - if (child.relationship === "LookAtProperty") { - const lookAtTarget = fbxTree.Objects.Model[child.ID]; - if ("Lcl_Translation" in lookAtTarget) { - const pos = lookAtTarget.Lcl_Translation.value; - if (model.target !== void 0) { - model.target.position.fromArray(pos); - sceneGraph.add(model.target); - } else { - model.lookAt(new Vector3().fromArray(pos)); - } - } - } - }); - } - } - bindSkeleton(skeletons, geometryMap, modelMap) { - const bindMatrices = this.parsePoseNodes(); - for (const ID in skeletons) { - const skeleton = skeletons[ID]; - const parents = connections.get(parseInt(skeleton.ID)).parents; - parents.forEach(function(parent) { - if (geometryMap.has(parent.ID)) { - const geoID = parent.ID; - const geoRelationships = connections.get(geoID); - geoRelationships.parents.forEach(function(geoConnParent) { - if (modelMap.has(geoConnParent.ID)) { - const model = modelMap.get(geoConnParent.ID); - model.bind(new Skeleton(skeleton.bones), bindMatrices[geoConnParent.ID]); - } - }); - } - }); - } - } - parsePoseNodes() { - const bindMatrices = {}; - if ("Pose" in fbxTree.Objects) { - const BindPoseNode = fbxTree.Objects.Pose; - for (const nodeID in BindPoseNode) { - if (BindPoseNode[nodeID].attrType === "BindPose" && BindPoseNode[nodeID].NbPoseNodes > 0) { - const poseNodes = BindPoseNode[nodeID].PoseNode; - if (Array.isArray(poseNodes)) { - poseNodes.forEach(function(poseNode) { - bindMatrices[poseNode.Node] = new Matrix4().fromArray(poseNode.Matrix.a); - }); - } else { - bindMatrices[poseNodes.Node] = new Matrix4().fromArray(poseNodes.Matrix.a); - } - } - } - } - return bindMatrices; - } - addGlobalSceneSettings() { - if ("GlobalSettings" in fbxTree) { - if ("AmbientColor" in fbxTree.GlobalSettings) { - const ambientColor = fbxTree.GlobalSettings.AmbientColor.value; - const r = ambientColor[0]; - const g = ambientColor[1]; - const b = ambientColor[2]; - if (r !== 0 || g !== 0 || b !== 0) { - const color = new Color().setRGB(r, g, b, SRGBColorSpace); - sceneGraph.add(new AmbientLight(color, 1)); - } - } - if ("UnitScaleFactor" in fbxTree.GlobalSettings) { - sceneGraph.userData.unitScaleFactor = fbxTree.GlobalSettings.UnitScaleFactor.value; - } - } - } -} -class GeometryParser { - static { - __name(this, "GeometryParser"); - } - constructor() { - this.negativeMaterialIndices = false; - } - // Parse nodes in FBXTree.Objects.Geometry - parse(deformers) { - const geometryMap = /* @__PURE__ */ new Map(); - if ("Geometry" in fbxTree.Objects) { - const geoNodes = fbxTree.Objects.Geometry; - for (const nodeID in geoNodes) { - const relationships = connections.get(parseInt(nodeID)); - const geo = this.parseGeometry(relationships, geoNodes[nodeID], deformers); - geometryMap.set(parseInt(nodeID), geo); - } - } - if (this.negativeMaterialIndices === true) { - console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."); - } - return geometryMap; - } - // Parse single node in FBXTree.Objects.Geometry - parseGeometry(relationships, geoNode, deformers) { - switch (geoNode.attrType) { - case "Mesh": - return this.parseMeshGeometry(relationships, geoNode, deformers); - break; - case "NurbsCurve": - return this.parseNurbsGeometry(geoNode); - break; - } - } - // Parse single node mesh geometry in FBXTree.Objects.Geometry - parseMeshGeometry(relationships, geoNode, deformers) { - const skeletons = deformers.skeletons; - const morphTargets = []; - const modelNodes = relationships.parents.map(function(parent) { - return fbxTree.Objects.Model[parent.ID]; - }); - if (modelNodes.length === 0) return; - const skeleton = relationships.children.reduce(function(skeleton2, child) { - if (skeletons[child.ID] !== void 0) skeleton2 = skeletons[child.ID]; - return skeleton2; - }, null); - relationships.children.forEach(function(child) { - if (deformers.morphTargets[child.ID] !== void 0) { - morphTargets.push(deformers.morphTargets[child.ID]); - } - }); - const modelNode = modelNodes[0]; - const transformData = {}; - if ("RotationOrder" in modelNode) transformData.eulerOrder = getEulerOrder(modelNode.RotationOrder.value); - if ("InheritType" in modelNode) transformData.inheritType = parseInt(modelNode.InheritType.value); - if ("GeometricTranslation" in modelNode) transformData.translation = modelNode.GeometricTranslation.value; - if ("GeometricRotation" in modelNode) transformData.rotation = modelNode.GeometricRotation.value; - if ("GeometricScaling" in modelNode) transformData.scale = modelNode.GeometricScaling.value; - const transform = generateTransform(transformData); - return this.genGeometry(geoNode, skeleton, morphTargets, transform); - } - // Generate a BufferGeometry from a node in FBXTree.Objects.Geometry - genGeometry(geoNode, skeleton, morphTargets, preTransform) { - const geo = new BufferGeometry(); - if (geoNode.attrName) geo.name = geoNode.attrName; - const geoInfo = this.parseGeoNode(geoNode, skeleton); - const buffers = this.genBuffers(geoInfo); - const positionAttribute = new Float32BufferAttribute(buffers.vertex, 3); - positionAttribute.applyMatrix4(preTransform); - geo.setAttribute("position", positionAttribute); - if (buffers.colors.length > 0) { - geo.setAttribute("color", new Float32BufferAttribute(buffers.colors, 3)); - } - if (skeleton) { - geo.setAttribute("skinIndex", new Uint16BufferAttribute(buffers.weightsIndices, 4)); - geo.setAttribute("skinWeight", new Float32BufferAttribute(buffers.vertexWeights, 4)); - geo.FBX_Deformer = skeleton; - } - if (buffers.normal.length > 0) { - const normalMatrix = new Matrix3().getNormalMatrix(preTransform); - const normalAttribute = new Float32BufferAttribute(buffers.normal, 3); - normalAttribute.applyNormalMatrix(normalMatrix); - geo.setAttribute("normal", normalAttribute); - } - buffers.uvs.forEach(function(uvBuffer, i) { - const name = i === 0 ? "uv" : `uv${i}`; - geo.setAttribute(name, new Float32BufferAttribute(buffers.uvs[i], 2)); - }); - if (geoInfo.material && geoInfo.material.mappingType !== "AllSame") { - let prevMaterialIndex = buffers.materialIndex[0]; - let startIndex = 0; - buffers.materialIndex.forEach(function(currentIndex, i) { - if (currentIndex !== prevMaterialIndex) { - geo.addGroup(startIndex, i - startIndex, prevMaterialIndex); - prevMaterialIndex = currentIndex; - startIndex = i; - } - }); - if (geo.groups.length > 0) { - const lastGroup = geo.groups[geo.groups.length - 1]; - const lastIndex = lastGroup.start + lastGroup.count; - if (lastIndex !== buffers.materialIndex.length) { - geo.addGroup(lastIndex, buffers.materialIndex.length - lastIndex, prevMaterialIndex); - } - } - if (geo.groups.length === 0) { - geo.addGroup(0, buffers.materialIndex.length, buffers.materialIndex[0]); - } - } - this.addMorphTargets(geo, geoNode, morphTargets, preTransform); - return geo; - } - parseGeoNode(geoNode, skeleton) { - const geoInfo = {}; - geoInfo.vertexPositions = geoNode.Vertices !== void 0 ? geoNode.Vertices.a : []; - geoInfo.vertexIndices = geoNode.PolygonVertexIndex !== void 0 ? geoNode.PolygonVertexIndex.a : []; - if (geoNode.LayerElementColor) { - geoInfo.color = this.parseVertexColors(geoNode.LayerElementColor[0]); - } - if (geoNode.LayerElementMaterial) { - geoInfo.material = this.parseMaterialIndices(geoNode.LayerElementMaterial[0]); - } - if (geoNode.LayerElementNormal) { - geoInfo.normal = this.parseNormals(geoNode.LayerElementNormal[0]); - } - if (geoNode.LayerElementUV) { - geoInfo.uv = []; - let i = 0; - while (geoNode.LayerElementUV[i]) { - if (geoNode.LayerElementUV[i].UV) { - geoInfo.uv.push(this.parseUVs(geoNode.LayerElementUV[i])); - } - i++; - } - } - geoInfo.weightTable = {}; - if (skeleton !== null) { - geoInfo.skeleton = skeleton; - skeleton.rawBones.forEach(function(rawBone, i) { - rawBone.indices.forEach(function(index, j) { - if (geoInfo.weightTable[index] === void 0) geoInfo.weightTable[index] = []; - geoInfo.weightTable[index].push({ - id: i, - weight: rawBone.weights[j] - }); - }); - }); - } - return geoInfo; - } - genBuffers(geoInfo) { - const buffers = { - vertex: [], - normal: [], - colors: [], - uvs: [], - materialIndex: [], - vertexWeights: [], - weightsIndices: [] - }; - let polygonIndex = 0; - let faceLength = 0; - let displayedWeightsWarning = false; - let facePositionIndexes = []; - let faceNormals = []; - let faceColors = []; - let faceUVs = []; - let faceWeights = []; - let faceWeightIndices = []; - const scope = this; - geoInfo.vertexIndices.forEach(function(vertexIndex, polygonVertexIndex) { - let materialIndex; - let endOfFace = false; - if (vertexIndex < 0) { - vertexIndex = vertexIndex ^ -1; - endOfFace = true; - } - let weightIndices = []; - let weights = []; - facePositionIndexes.push(vertexIndex * 3, vertexIndex * 3 + 1, vertexIndex * 3 + 2); - if (geoInfo.color) { - const data = getData(polygonVertexIndex, polygonIndex, vertexIndex, geoInfo.color); - faceColors.push(data[0], data[1], data[2]); - } - if (geoInfo.skeleton) { - if (geoInfo.weightTable[vertexIndex] !== void 0) { - geoInfo.weightTable[vertexIndex].forEach(function(wt) { - weights.push(wt.weight); - weightIndices.push(wt.id); - }); - } - if (weights.length > 4) { - if (!displayedWeightsWarning) { - console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."); - displayedWeightsWarning = true; - } - const wIndex = [0, 0, 0, 0]; - const Weight = [0, 0, 0, 0]; - weights.forEach(function(weight, weightIndex) { - let currentWeight = weight; - let currentIndex = weightIndices[weightIndex]; - Weight.forEach(function(comparedWeight, comparedWeightIndex, comparedWeightArray) { - if (currentWeight > comparedWeight) { - comparedWeightArray[comparedWeightIndex] = currentWeight; - currentWeight = comparedWeight; - const tmp2 = wIndex[comparedWeightIndex]; - wIndex[comparedWeightIndex] = currentIndex; - currentIndex = tmp2; - } - }); - }); - weightIndices = wIndex; - weights = Weight; - } - while (weights.length < 4) { - weights.push(0); - weightIndices.push(0); - } - for (let i = 0; i < 4; ++i) { - faceWeights.push(weights[i]); - faceWeightIndices.push(weightIndices[i]); - } - } - if (geoInfo.normal) { - const data = getData(polygonVertexIndex, polygonIndex, vertexIndex, geoInfo.normal); - faceNormals.push(data[0], data[1], data[2]); - } - if (geoInfo.material && geoInfo.material.mappingType !== "AllSame") { - materialIndex = getData(polygonVertexIndex, polygonIndex, vertexIndex, geoInfo.material)[0]; - if (materialIndex < 0) { - scope.negativeMaterialIndices = true; - materialIndex = 0; - } - } - if (geoInfo.uv) { - geoInfo.uv.forEach(function(uv, i) { - const data = getData(polygonVertexIndex, polygonIndex, vertexIndex, uv); - if (faceUVs[i] === void 0) { - faceUVs[i] = []; - } - faceUVs[i].push(data[0]); - faceUVs[i].push(data[1]); - }); - } - faceLength++; - if (endOfFace) { - scope.genFace(buffers, geoInfo, facePositionIndexes, materialIndex, faceNormals, faceColors, faceUVs, faceWeights, faceWeightIndices, faceLength); - polygonIndex++; - faceLength = 0; - facePositionIndexes = []; - faceNormals = []; - faceColors = []; - faceUVs = []; - faceWeights = []; - faceWeightIndices = []; - } - }); - return buffers; - } - // See https://www.khronos.org/opengl/wiki/Calculating_a_Surface_Normal - getNormalNewell(vertices) { - const normal = new Vector3(0, 0, 0); - for (let i = 0; i < vertices.length; i++) { - const current = vertices[i]; - const next = vertices[(i + 1) % vertices.length]; - normal.x += (current.y - next.y) * (current.z + next.z); - normal.y += (current.z - next.z) * (current.x + next.x); - normal.z += (current.x - next.x) * (current.y + next.y); - } - normal.normalize(); - return normal; - } - getNormalTangentAndBitangent(vertices) { - const normalVector = this.getNormalNewell(vertices); - const up = Math.abs(normalVector.z) > 0.5 ? new Vector3(0, 1, 0) : new Vector3(0, 0, 1); - const tangent = up.cross(normalVector).normalize(); - const bitangent = normalVector.clone().cross(tangent).normalize(); - return { - normal: normalVector, - tangent, - bitangent - }; - } - flattenVertex(vertex2, normalTangent, normalBitangent) { - return new Vector2( - vertex2.dot(normalTangent), - vertex2.dot(normalBitangent) - ); - } - // Generate data for a single face in a geometry. If the face is a quad then split it into 2 tris - genFace(buffers, geoInfo, facePositionIndexes, materialIndex, faceNormals, faceColors, faceUVs, faceWeights, faceWeightIndices, faceLength) { - let triangles; - if (faceLength > 3) { - const vertices = []; - const positions = geoInfo.baseVertexPositions || geoInfo.vertexPositions; - for (let i = 0; i < facePositionIndexes.length; i += 3) { - vertices.push( - new Vector3( - positions[facePositionIndexes[i]], - positions[facePositionIndexes[i + 1]], - positions[facePositionIndexes[i + 2]] - ) - ); - } - const { tangent, bitangent } = this.getNormalTangentAndBitangent(vertices); - const triangulationInput = []; - for (const vertex2 of vertices) { - triangulationInput.push(this.flattenVertex(vertex2, tangent, bitangent)); - } - triangles = ShapeUtils.triangulateShape(triangulationInput, []); - } else { - triangles = [[0, 1, 2]]; - } - for (const [i0, i1, i2] of triangles) { - buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i0 * 3]]); - buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i0 * 3 + 1]]); - buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i0 * 3 + 2]]); - buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i1 * 3]]); - buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i1 * 3 + 1]]); - buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i1 * 3 + 2]]); - buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i2 * 3]]); - buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i2 * 3 + 1]]); - buffers.vertex.push(geoInfo.vertexPositions[facePositionIndexes[i2 * 3 + 2]]); - if (geoInfo.skeleton) { - buffers.vertexWeights.push(faceWeights[i0 * 4]); - buffers.vertexWeights.push(faceWeights[i0 * 4 + 1]); - buffers.vertexWeights.push(faceWeights[i0 * 4 + 2]); - buffers.vertexWeights.push(faceWeights[i0 * 4 + 3]); - buffers.vertexWeights.push(faceWeights[i1 * 4]); - buffers.vertexWeights.push(faceWeights[i1 * 4 + 1]); - buffers.vertexWeights.push(faceWeights[i1 * 4 + 2]); - buffers.vertexWeights.push(faceWeights[i1 * 4 + 3]); - buffers.vertexWeights.push(faceWeights[i2 * 4]); - buffers.vertexWeights.push(faceWeights[i2 * 4 + 1]); - buffers.vertexWeights.push(faceWeights[i2 * 4 + 2]); - buffers.vertexWeights.push(faceWeights[i2 * 4 + 3]); - buffers.weightsIndices.push(faceWeightIndices[i0 * 4]); - buffers.weightsIndices.push(faceWeightIndices[i0 * 4 + 1]); - buffers.weightsIndices.push(faceWeightIndices[i0 * 4 + 2]); - buffers.weightsIndices.push(faceWeightIndices[i0 * 4 + 3]); - buffers.weightsIndices.push(faceWeightIndices[i1 * 4]); - buffers.weightsIndices.push(faceWeightIndices[i1 * 4 + 1]); - buffers.weightsIndices.push(faceWeightIndices[i1 * 4 + 2]); - buffers.weightsIndices.push(faceWeightIndices[i1 * 4 + 3]); - buffers.weightsIndices.push(faceWeightIndices[i2 * 4]); - buffers.weightsIndices.push(faceWeightIndices[i2 * 4 + 1]); - buffers.weightsIndices.push(faceWeightIndices[i2 * 4 + 2]); - buffers.weightsIndices.push(faceWeightIndices[i2 * 4 + 3]); - } - if (geoInfo.color) { - buffers.colors.push(faceColors[i0 * 3]); - buffers.colors.push(faceColors[i0 * 3 + 1]); - buffers.colors.push(faceColors[i0 * 3 + 2]); - buffers.colors.push(faceColors[i1 * 3]); - buffers.colors.push(faceColors[i1 * 3 + 1]); - buffers.colors.push(faceColors[i1 * 3 + 2]); - buffers.colors.push(faceColors[i2 * 3]); - buffers.colors.push(faceColors[i2 * 3 + 1]); - buffers.colors.push(faceColors[i2 * 3 + 2]); - } - if (geoInfo.material && geoInfo.material.mappingType !== "AllSame") { - buffers.materialIndex.push(materialIndex); - buffers.materialIndex.push(materialIndex); - buffers.materialIndex.push(materialIndex); - } - if (geoInfo.normal) { - buffers.normal.push(faceNormals[i0 * 3]); - buffers.normal.push(faceNormals[i0 * 3 + 1]); - buffers.normal.push(faceNormals[i0 * 3 + 2]); - buffers.normal.push(faceNormals[i1 * 3]); - buffers.normal.push(faceNormals[i1 * 3 + 1]); - buffers.normal.push(faceNormals[i1 * 3 + 2]); - buffers.normal.push(faceNormals[i2 * 3]); - buffers.normal.push(faceNormals[i2 * 3 + 1]); - buffers.normal.push(faceNormals[i2 * 3 + 2]); - } - if (geoInfo.uv) { - geoInfo.uv.forEach(function(uv, j) { - if (buffers.uvs[j] === void 0) buffers.uvs[j] = []; - buffers.uvs[j].push(faceUVs[j][i0 * 2]); - buffers.uvs[j].push(faceUVs[j][i0 * 2 + 1]); - buffers.uvs[j].push(faceUVs[j][i1 * 2]); - buffers.uvs[j].push(faceUVs[j][i1 * 2 + 1]); - buffers.uvs[j].push(faceUVs[j][i2 * 2]); - buffers.uvs[j].push(faceUVs[j][i2 * 2 + 1]); - }); - } - } - } - addMorphTargets(parentGeo, parentGeoNode, morphTargets, preTransform) { - if (morphTargets.length === 0) return; - parentGeo.morphTargetsRelative = true; - parentGeo.morphAttributes.position = []; - const scope = this; - morphTargets.forEach(function(morphTarget) { - morphTarget.rawTargets.forEach(function(rawTarget) { - const morphGeoNode = fbxTree.Objects.Geometry[rawTarget.geoID]; - if (morphGeoNode !== void 0) { - scope.genMorphGeometry(parentGeo, parentGeoNode, morphGeoNode, preTransform, rawTarget.name); - } - }); - }); - } - // a morph geometry node is similar to a standard node, and the node is also contained - // in FBXTree.Objects.Geometry, however it can only have attributes for position, normal - // and a special attribute Index defining which vertices of the original geometry are affected - // Normal and position attributes only have data for the vertices that are affected by the morph - genMorphGeometry(parentGeo, parentGeoNode, morphGeoNode, preTransform, name) { - const basePositions = parentGeoNode.Vertices !== void 0 ? parentGeoNode.Vertices.a : []; - const baseIndices = parentGeoNode.PolygonVertexIndex !== void 0 ? parentGeoNode.PolygonVertexIndex.a : []; - const morphPositionsSparse = morphGeoNode.Vertices !== void 0 ? morphGeoNode.Vertices.a : []; - const morphIndices = morphGeoNode.Indexes !== void 0 ? morphGeoNode.Indexes.a : []; - const length = parentGeo.attributes.position.count * 3; - const morphPositions = new Float32Array(length); - for (let i = 0; i < morphIndices.length; i++) { - const morphIndex = morphIndices[i] * 3; - morphPositions[morphIndex] = morphPositionsSparse[i * 3]; - morphPositions[morphIndex + 1] = morphPositionsSparse[i * 3 + 1]; - morphPositions[morphIndex + 2] = morphPositionsSparse[i * 3 + 2]; - } - const morphGeoInfo = { - vertexIndices: baseIndices, - vertexPositions: morphPositions, - baseVertexPositions: basePositions - }; - const morphBuffers = this.genBuffers(morphGeoInfo); - const positionAttribute = new Float32BufferAttribute(morphBuffers.vertex, 3); - positionAttribute.name = name || morphGeoNode.attrName; - positionAttribute.applyMatrix4(preTransform); - parentGeo.morphAttributes.position.push(positionAttribute); - } - // Parse normal from FBXTree.Objects.Geometry.LayerElementNormal if it exists - parseNormals(NormalNode) { - const mappingType = NormalNode.MappingInformationType; - const referenceType = NormalNode.ReferenceInformationType; - const buffer = NormalNode.Normals.a; - let indexBuffer = []; - if (referenceType === "IndexToDirect") { - if ("NormalIndex" in NormalNode) { - indexBuffer = NormalNode.NormalIndex.a; - } else if ("NormalsIndex" in NormalNode) { - indexBuffer = NormalNode.NormalsIndex.a; - } - } - return { - dataSize: 3, - buffer, - indices: indexBuffer, - mappingType, - referenceType - }; - } - // Parse UVs from FBXTree.Objects.Geometry.LayerElementUV if it exists - parseUVs(UVNode) { - const mappingType = UVNode.MappingInformationType; - const referenceType = UVNode.ReferenceInformationType; - const buffer = UVNode.UV.a; - let indexBuffer = []; - if (referenceType === "IndexToDirect") { - indexBuffer = UVNode.UVIndex.a; - } - return { - dataSize: 2, - buffer, - indices: indexBuffer, - mappingType, - referenceType - }; - } - // Parse Vertex Colors from FBXTree.Objects.Geometry.LayerElementColor if it exists - parseVertexColors(ColorNode) { - const mappingType = ColorNode.MappingInformationType; - const referenceType = ColorNode.ReferenceInformationType; - const buffer = ColorNode.Colors.a; - let indexBuffer = []; - if (referenceType === "IndexToDirect") { - indexBuffer = ColorNode.ColorIndex.a; - } - for (let i = 0, c = new Color(); i < buffer.length; i += 4) { - c.fromArray(buffer, i); - ColorManagement.toWorkingColorSpace(c, SRGBColorSpace); - c.toArray(buffer, i); - } - return { - dataSize: 4, - buffer, - indices: indexBuffer, - mappingType, - referenceType - }; - } - // Parse mapping and material data in FBXTree.Objects.Geometry.LayerElementMaterial if it exists - parseMaterialIndices(MaterialNode) { - const mappingType = MaterialNode.MappingInformationType; - const referenceType = MaterialNode.ReferenceInformationType; - if (mappingType === "NoMappingInformation") { - return { - dataSize: 1, - buffer: [0], - indices: [0], - mappingType: "AllSame", - referenceType - }; - } - const materialIndexBuffer = MaterialNode.Materials.a; - const materialIndices = []; - for (let i = 0; i < materialIndexBuffer.length; ++i) { - materialIndices.push(i); - } - return { - dataSize: 1, - buffer: materialIndexBuffer, - indices: materialIndices, - mappingType, - referenceType - }; - } - // Generate a NurbGeometry from a node in FBXTree.Objects.Geometry - parseNurbsGeometry(geoNode) { - const order = parseInt(geoNode.Order); - if (isNaN(order)) { - console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s", geoNode.Order, geoNode.id); - return new BufferGeometry(); - } - const degree = order - 1; - const knots = geoNode.KnotVector.a; - const controlPoints = []; - const pointsValues = geoNode.Points.a; - for (let i = 0, l = pointsValues.length; i < l; i += 4) { - controlPoints.push(new Vector4().fromArray(pointsValues, i)); - } - let startKnot, endKnot; - if (geoNode.Form === "Closed") { - controlPoints.push(controlPoints[0]); - } else if (geoNode.Form === "Periodic") { - startKnot = degree; - endKnot = knots.length - 1 - startKnot; - for (let i = 0; i < degree; ++i) { - controlPoints.push(controlPoints[i]); - } - } - const curve = new NURBSCurve(degree, knots, controlPoints, startKnot, endKnot); - const points = curve.getPoints(controlPoints.length * 12); - return new BufferGeometry().setFromPoints(points); - } -} -class AnimationParser { - static { - __name(this, "AnimationParser"); - } - // take raw animation clips and turn them into three.js animation clips - parse() { - const animationClips = []; - const rawClips = this.parseClips(); - if (rawClips !== void 0) { - for (const key in rawClips) { - const rawClip = rawClips[key]; - const clip = this.addClip(rawClip); - animationClips.push(clip); - } - } - return animationClips; - } - parseClips() { - if (fbxTree.Objects.AnimationCurve === void 0) return void 0; - const curveNodesMap = this.parseAnimationCurveNodes(); - this.parseAnimationCurves(curveNodesMap); - const layersMap = this.parseAnimationLayers(curveNodesMap); - const rawClips = this.parseAnimStacks(layersMap); - return rawClips; - } - // parse nodes in FBXTree.Objects.AnimationCurveNode - // each AnimationCurveNode holds data for an animation transform for a model (e.g. left arm rotation ) - // and is referenced by an AnimationLayer - parseAnimationCurveNodes() { - const rawCurveNodes = fbxTree.Objects.AnimationCurveNode; - const curveNodesMap = /* @__PURE__ */ new Map(); - for (const nodeID in rawCurveNodes) { - const rawCurveNode = rawCurveNodes[nodeID]; - if (rawCurveNode.attrName.match(/S|R|T|DeformPercent/) !== null) { - const curveNode = { - id: rawCurveNode.id, - attr: rawCurveNode.attrName, - curves: {} - }; - curveNodesMap.set(curveNode.id, curveNode); - } - } - return curveNodesMap; - } - // parse nodes in FBXTree.Objects.AnimationCurve and connect them up to - // previously parsed AnimationCurveNodes. Each AnimationCurve holds data for a single animated - // axis ( e.g. times and values of x rotation) - parseAnimationCurves(curveNodesMap) { - const rawCurves = fbxTree.Objects.AnimationCurve; - for (const nodeID in rawCurves) { - const animationCurve = { - id: rawCurves[nodeID].id, - times: rawCurves[nodeID].KeyTime.a.map(convertFBXTimeToSeconds), - values: rawCurves[nodeID].KeyValueFloat.a - }; - const relationships = connections.get(animationCurve.id); - if (relationships !== void 0) { - const animationCurveID = relationships.parents[0].ID; - const animationCurveRelationship = relationships.parents[0].relationship; - if (animationCurveRelationship.match(/X/)) { - curveNodesMap.get(animationCurveID).curves["x"] = animationCurve; - } else if (animationCurveRelationship.match(/Y/)) { - curveNodesMap.get(animationCurveID).curves["y"] = animationCurve; - } else if (animationCurveRelationship.match(/Z/)) { - curveNodesMap.get(animationCurveID).curves["z"] = animationCurve; - } else if (animationCurveRelationship.match(/DeformPercent/) && curveNodesMap.has(animationCurveID)) { - curveNodesMap.get(animationCurveID).curves["morph"] = animationCurve; - } - } - } - } - // parse nodes in FBXTree.Objects.AnimationLayer. Each layers holds references - // to various AnimationCurveNodes and is referenced by an AnimationStack node - // note: theoretically a stack can have multiple layers, however in practice there always seems to be one per stack - parseAnimationLayers(curveNodesMap) { - const rawLayers = fbxTree.Objects.AnimationLayer; - const layersMap = /* @__PURE__ */ new Map(); - for (const nodeID in rawLayers) { - const layerCurveNodes = []; - const connection = connections.get(parseInt(nodeID)); - if (connection !== void 0) { - const children = connection.children; - children.forEach(function(child, i) { - if (curveNodesMap.has(child.ID)) { - const curveNode = curveNodesMap.get(child.ID); - if (curveNode.curves.x !== void 0 || curveNode.curves.y !== void 0 || curveNode.curves.z !== void 0) { - if (layerCurveNodes[i] === void 0) { - const modelID = connections.get(child.ID).parents.filter(function(parent) { - return parent.relationship !== void 0; - })[0].ID; - if (modelID !== void 0) { - const rawModel = fbxTree.Objects.Model[modelID.toString()]; - if (rawModel === void 0) { - console.warn("THREE.FBXLoader: Encountered a unused curve.", child); - return; - } - const node = { - modelName: rawModel.attrName ? PropertyBinding.sanitizeNodeName(rawModel.attrName) : "", - ID: rawModel.id, - initialPosition: [0, 0, 0], - initialRotation: [0, 0, 0], - initialScale: [1, 1, 1] - }; - sceneGraph.traverse(function(child2) { - if (child2.ID === rawModel.id) { - node.transform = child2.matrix; - if (child2.userData.transformData) node.eulerOrder = child2.userData.transformData.eulerOrder; - } - }); - if (!node.transform) node.transform = new Matrix4(); - if ("PreRotation" in rawModel) node.preRotation = rawModel.PreRotation.value; - if ("PostRotation" in rawModel) node.postRotation = rawModel.PostRotation.value; - layerCurveNodes[i] = node; - } - } - if (layerCurveNodes[i]) layerCurveNodes[i][curveNode.attr] = curveNode; - } else if (curveNode.curves.morph !== void 0) { - if (layerCurveNodes[i] === void 0) { - const deformerID = connections.get(child.ID).parents.filter(function(parent) { - return parent.relationship !== void 0; - })[0].ID; - const morpherID = connections.get(deformerID).parents[0].ID; - const geoID = connections.get(morpherID).parents[0].ID; - const modelID = connections.get(geoID).parents[0].ID; - const rawModel = fbxTree.Objects.Model[modelID]; - const node = { - modelName: rawModel.attrName ? PropertyBinding.sanitizeNodeName(rawModel.attrName) : "", - morphName: fbxTree.Objects.Deformer[deformerID].attrName - }; - layerCurveNodes[i] = node; - } - layerCurveNodes[i][curveNode.attr] = curveNode; - } - } - }); - layersMap.set(parseInt(nodeID), layerCurveNodes); - } - } - return layersMap; - } - // parse nodes in FBXTree.Objects.AnimationStack. These are the top level node in the animation - // hierarchy. Each Stack node will be used to create a AnimationClip - parseAnimStacks(layersMap) { - const rawStacks = fbxTree.Objects.AnimationStack; - const rawClips = {}; - for (const nodeID in rawStacks) { - const children = connections.get(parseInt(nodeID)).children; - if (children.length > 1) { - console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers."); - } - const layer = layersMap.get(children[0].ID); - rawClips[nodeID] = { - name: rawStacks[nodeID].attrName, - layer - }; - } - return rawClips; - } - addClip(rawClip) { - let tracks = []; - const scope = this; - rawClip.layer.forEach(function(rawTracks) { - tracks = tracks.concat(scope.generateTracks(rawTracks)); - }); - return new AnimationClip(rawClip.name, -1, tracks); - } - generateTracks(rawTracks) { - const tracks = []; - let initialPosition = new Vector3(); - let initialScale = new Vector3(); - if (rawTracks.transform) rawTracks.transform.decompose(initialPosition, new Quaternion(), initialScale); - initialPosition = initialPosition.toArray(); - initialScale = initialScale.toArray(); - if (rawTracks.T !== void 0 && Object.keys(rawTracks.T.curves).length > 0) { - const positionTrack = this.generateVectorTrack(rawTracks.modelName, rawTracks.T.curves, initialPosition, "position"); - if (positionTrack !== void 0) tracks.push(positionTrack); - } - if (rawTracks.R !== void 0 && Object.keys(rawTracks.R.curves).length > 0) { - const rotationTrack = this.generateRotationTrack(rawTracks.modelName, rawTracks.R.curves, rawTracks.preRotation, rawTracks.postRotation, rawTracks.eulerOrder); - if (rotationTrack !== void 0) tracks.push(rotationTrack); - } - if (rawTracks.S !== void 0 && Object.keys(rawTracks.S.curves).length > 0) { - const scaleTrack = this.generateVectorTrack(rawTracks.modelName, rawTracks.S.curves, initialScale, "scale"); - if (scaleTrack !== void 0) tracks.push(scaleTrack); - } - if (rawTracks.DeformPercent !== void 0) { - const morphTrack = this.generateMorphTrack(rawTracks); - if (morphTrack !== void 0) tracks.push(morphTrack); - } - return tracks; - } - generateVectorTrack(modelName, curves, initialValue, type) { - const times = this.getTimesForAllAxes(curves); - const values = this.getKeyframeTrackValues(times, curves, initialValue); - return new VectorKeyframeTrack(modelName + "." + type, times, values); - } - generateRotationTrack(modelName, curves, preRotation, postRotation, eulerOrder) { - let times; - let values; - if (curves.x !== void 0 && curves.y !== void 0 && curves.z !== void 0) { - const result = this.interpolateRotations(curves.x, curves.y, curves.z, eulerOrder); - times = result[0]; - values = result[1]; - } - const defaultEulerOrder = getEulerOrder(0); - if (preRotation !== void 0) { - preRotation = preRotation.map(MathUtils.degToRad); - preRotation.push(defaultEulerOrder); - preRotation = new Euler().fromArray(preRotation); - preRotation = new Quaternion().setFromEuler(preRotation); - } - if (postRotation !== void 0) { - postRotation = postRotation.map(MathUtils.degToRad); - postRotation.push(defaultEulerOrder); - postRotation = new Euler().fromArray(postRotation); - postRotation = new Quaternion().setFromEuler(postRotation).invert(); - } - const quaternion = new Quaternion(); - const euler = new Euler(); - const quaternionValues = []; - if (!values || !times) return new QuaternionKeyframeTrack(modelName + ".quaternion", [0], [0]); - for (let i = 0; i < values.length; i += 3) { - euler.set(values[i], values[i + 1], values[i + 2], eulerOrder); - quaternion.setFromEuler(euler); - if (preRotation !== void 0) quaternion.premultiply(preRotation); - if (postRotation !== void 0) quaternion.multiply(postRotation); - if (i > 2) { - const prevQuat = new Quaternion().fromArray( - quaternionValues, - (i - 3) / 3 * 4 - ); - if (prevQuat.dot(quaternion) < 0) { - quaternion.set(-quaternion.x, -quaternion.y, -quaternion.z, -quaternion.w); - } - } - quaternion.toArray(quaternionValues, i / 3 * 4); - } - return new QuaternionKeyframeTrack(modelName + ".quaternion", times, quaternionValues); - } - generateMorphTrack(rawTracks) { - const curves = rawTracks.DeformPercent.curves.morph; - const values = curves.values.map(function(val) { - return val / 100; - }); - const morphNum = sceneGraph.getObjectByName(rawTracks.modelName).morphTargetDictionary[rawTracks.morphName]; - return new NumberKeyframeTrack(rawTracks.modelName + ".morphTargetInfluences[" + morphNum + "]", curves.times, values); - } - // For all animated objects, times are defined separately for each axis - // Here we'll combine the times into one sorted array without duplicates - getTimesForAllAxes(curves) { - let times = []; - if (curves.x !== void 0) times = times.concat(curves.x.times); - if (curves.y !== void 0) times = times.concat(curves.y.times); - if (curves.z !== void 0) times = times.concat(curves.z.times); - times = times.sort(function(a, b) { - return a - b; - }); - if (times.length > 1) { - let targetIndex = 1; - let lastValue = times[0]; - for (let i = 1; i < times.length; i++) { - const currentValue = times[i]; - if (currentValue !== lastValue) { - times[targetIndex] = currentValue; - lastValue = currentValue; - targetIndex++; - } - } - times = times.slice(0, targetIndex); - } - return times; - } - getKeyframeTrackValues(times, curves, initialValue) { - const prevValue = initialValue; - const values = []; - let xIndex = -1; - let yIndex = -1; - let zIndex = -1; - times.forEach(function(time) { - if (curves.x) xIndex = curves.x.times.indexOf(time); - if (curves.y) yIndex = curves.y.times.indexOf(time); - if (curves.z) zIndex = curves.z.times.indexOf(time); - if (xIndex !== -1) { - const xValue = curves.x.values[xIndex]; - values.push(xValue); - prevValue[0] = xValue; - } else { - values.push(prevValue[0]); - } - if (yIndex !== -1) { - const yValue = curves.y.values[yIndex]; - values.push(yValue); - prevValue[1] = yValue; - } else { - values.push(prevValue[1]); - } - if (zIndex !== -1) { - const zValue = curves.z.values[zIndex]; - values.push(zValue); - prevValue[2] = zValue; - } else { - values.push(prevValue[2]); - } - }); - return values; - } - // Rotations are defined as Euler angles which can have values of any size - // These will be converted to quaternions which don't support values greater than - // PI, so we'll interpolate large rotations - interpolateRotations(curvex, curvey, curvez, eulerOrder) { - const times = []; - const values = []; - times.push(curvex.times[0]); - values.push(MathUtils.degToRad(curvex.values[0])); - values.push(MathUtils.degToRad(curvey.values[0])); - values.push(MathUtils.degToRad(curvez.values[0])); - for (let i = 1; i < curvex.values.length; i++) { - const initialValue = [ - curvex.values[i - 1], - curvey.values[i - 1], - curvez.values[i - 1] - ]; - if (isNaN(initialValue[0]) || isNaN(initialValue[1]) || isNaN(initialValue[2])) { - continue; - } - const initialValueRad = initialValue.map(MathUtils.degToRad); - const currentValue = [ - curvex.values[i], - curvey.values[i], - curvez.values[i] - ]; - if (isNaN(currentValue[0]) || isNaN(currentValue[1]) || isNaN(currentValue[2])) { - continue; - } - const currentValueRad = currentValue.map(MathUtils.degToRad); - const valuesSpan = [ - currentValue[0] - initialValue[0], - currentValue[1] - initialValue[1], - currentValue[2] - initialValue[2] - ]; - const absoluteSpan = [ - Math.abs(valuesSpan[0]), - Math.abs(valuesSpan[1]), - Math.abs(valuesSpan[2]) - ]; - if (absoluteSpan[0] >= 180 || absoluteSpan[1] >= 180 || absoluteSpan[2] >= 180) { - const maxAbsSpan = Math.max(...absoluteSpan); - const numSubIntervals = maxAbsSpan / 180; - const E1 = new Euler(...initialValueRad, eulerOrder); - const E2 = new Euler(...currentValueRad, eulerOrder); - const Q1 = new Quaternion().setFromEuler(E1); - const Q2 = new Quaternion().setFromEuler(E2); - if (Q1.dot(Q2)) { - Q2.set(-Q2.x, -Q2.y, -Q2.z, -Q2.w); - } - const initialTime = curvex.times[i - 1]; - const timeSpan = curvex.times[i] - initialTime; - const Q = new Quaternion(); - const E = new Euler(); - for (let t2 = 0; t2 < 1; t2 += 1 / numSubIntervals) { - Q.copy(Q1.clone().slerp(Q2.clone(), t2)); - times.push(initialTime + t2 * timeSpan); - E.setFromQuaternion(Q, eulerOrder); - values.push(E.x); - values.push(E.y); - values.push(E.z); - } - } else { - times.push(curvex.times[i]); - values.push(MathUtils.degToRad(curvex.values[i])); - values.push(MathUtils.degToRad(curvey.values[i])); - values.push(MathUtils.degToRad(curvez.values[i])); - } - } - return [times, values]; - } -} -class TextParser { - static { - __name(this, "TextParser"); - } - getPrevNode() { - return this.nodeStack[this.currentIndent - 2]; - } - getCurrentNode() { - return this.nodeStack[this.currentIndent - 1]; - } - getCurrentProp() { - return this.currentProp; - } - pushStack(node) { - this.nodeStack.push(node); - this.currentIndent += 1; - } - popStack() { - this.nodeStack.pop(); - this.currentIndent -= 1; - } - setCurrentProp(val, name) { - this.currentProp = val; - this.currentPropName = name; - } - parse(text) { - this.currentIndent = 0; - this.allNodes = new FBXTree(); - this.nodeStack = []; - this.currentProp = []; - this.currentPropName = ""; - const scope = this; - const split = text.split(/[\r\n]+/); - split.forEach(function(line, i) { - const matchComment = line.match(/^[\s\t]*;/); - const matchEmpty = line.match(/^[\s\t]*$/); - if (matchComment || matchEmpty) return; - const matchBeginning = line.match("^\\t{" + scope.currentIndent + "}(\\w+):(.*){", ""); - const matchProperty = line.match("^\\t{" + scope.currentIndent + "}(\\w+):[\\s\\t\\r\\n](.*)"); - const matchEnd = line.match("^\\t{" + (scope.currentIndent - 1) + "}}"); - if (matchBeginning) { - scope.parseNodeBegin(line, matchBeginning); - } else if (matchProperty) { - scope.parseNodeProperty(line, matchProperty, split[++i]); - } else if (matchEnd) { - scope.popStack(); - } else if (line.match(/^[^\s\t}]/)) { - scope.parseNodePropertyContinued(line); - } - }); - return this.allNodes; - } - parseNodeBegin(line, property) { - const nodeName = property[1].trim().replace(/^"/, "").replace(/"$/, ""); - const nodeAttrs = property[2].split(",").map(function(attr) { - return attr.trim().replace(/^"/, "").replace(/"$/, ""); - }); - const node = { name: nodeName }; - const attrs = this.parseNodeAttr(nodeAttrs); - const currentNode = this.getCurrentNode(); - if (this.currentIndent === 0) { - this.allNodes.add(nodeName, node); - } else { - if (nodeName in currentNode) { - if (nodeName === "PoseNode") { - currentNode.PoseNode.push(node); - } else if (currentNode[nodeName].id !== void 0) { - currentNode[nodeName] = {}; - currentNode[nodeName][currentNode[nodeName].id] = currentNode[nodeName]; - } - if (attrs.id !== "") currentNode[nodeName][attrs.id] = node; - } else if (typeof attrs.id === "number") { - currentNode[nodeName] = {}; - currentNode[nodeName][attrs.id] = node; - } else if (nodeName !== "Properties70") { - if (nodeName === "PoseNode") currentNode[nodeName] = [node]; - else currentNode[nodeName] = node; - } - } - if (typeof attrs.id === "number") node.id = attrs.id; - if (attrs.name !== "") node.attrName = attrs.name; - if (attrs.type !== "") node.attrType = attrs.type; - this.pushStack(node); - } - parseNodeAttr(attrs) { - let id2 = attrs[0]; - if (attrs[0] !== "") { - id2 = parseInt(attrs[0]); - if (isNaN(id2)) { - id2 = attrs[0]; - } - } - let name = "", type = ""; - if (attrs.length > 1) { - name = attrs[1].replace(/^(\w+)::/, ""); - type = attrs[2]; - } - return { id: id2, name, type }; - } - parseNodeProperty(line, property, contentLine) { - let propName = property[1].replace(/^"/, "").replace(/"$/, "").trim(); - let propValue = property[2].replace(/^"/, "").replace(/"$/, "").trim(); - if (propName === "Content" && propValue === ",") { - propValue = contentLine.replace(/"/g, "").replace(/,$/, "").trim(); - } - const currentNode = this.getCurrentNode(); - const parentName = currentNode.name; - if (parentName === "Properties70") { - this.parseNodeSpecialProperty(line, propName, propValue); - return; - } - if (propName === "C") { - const connProps = propValue.split(",").slice(1); - const from = parseInt(connProps[0]); - const to = parseInt(connProps[1]); - let rest = propValue.split(",").slice(3); - rest = rest.map(function(elem) { - return elem.trim().replace(/^"/, ""); - }); - propName = "connections"; - propValue = [from, to]; - append(propValue, rest); - if (currentNode[propName] === void 0) { - currentNode[propName] = []; - } - } - if (propName === "Node") currentNode.id = propValue; - if (propName in currentNode && Array.isArray(currentNode[propName])) { - currentNode[propName].push(propValue); - } else { - if (propName !== "a") currentNode[propName] = propValue; - else currentNode.a = propValue; - } - this.setCurrentProp(currentNode, propName); - if (propName === "a" && propValue.slice(-1) !== ",") { - currentNode.a = parseNumberArray(propValue); - } - } - parseNodePropertyContinued(line) { - const currentNode = this.getCurrentNode(); - currentNode.a += line; - if (line.slice(-1) !== ",") { - currentNode.a = parseNumberArray(currentNode.a); - } - } - // parse "Property70" - parseNodeSpecialProperty(line, propName, propValue) { - const props = propValue.split('",').map(function(prop) { - return prop.trim().replace(/^\"/, "").replace(/\s/, "_"); - }); - const innerPropName = props[0]; - const innerPropType1 = props[1]; - const innerPropType2 = props[2]; - const innerPropFlag = props[3]; - let innerPropValue = props[4]; - switch (innerPropType1) { - case "int": - case "enum": - case "bool": - case "ULongLong": - case "double": - case "Number": - case "FieldOfView": - innerPropValue = parseFloat(innerPropValue); - break; - case "Color": - case "ColorRGB": - case "Vector3D": - case "Lcl_Translation": - case "Lcl_Rotation": - case "Lcl_Scaling": - innerPropValue = parseNumberArray(innerPropValue); - break; - } - this.getPrevNode()[innerPropName] = { - "type": innerPropType1, - "type2": innerPropType2, - "flag": innerPropFlag, - "value": innerPropValue - }; - this.setCurrentProp(this.getPrevNode(), innerPropName); - } -} -class BinaryParser { - static { - __name(this, "BinaryParser"); - } - parse(buffer) { - const reader = new BinaryReader(buffer); - reader.skip(23); - const version = reader.getUint32(); - if (version < 6400) { - throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: " + version); - } - const allNodes = new FBXTree(); - while (!this.endOfContent(reader)) { - const node = this.parseNode(reader, version); - if (node !== null) allNodes.add(node.name, node); - } - return allNodes; - } - // Check if reader has reached the end of content. - endOfContent(reader) { - if (reader.size() % 16 === 0) { - return (reader.getOffset() + 160 + 16 & ~15) >= reader.size(); - } else { - return reader.getOffset() + 160 + 16 >= reader.size(); - } - } - // recursively parse nodes until the end of the file is reached - parseNode(reader, version) { - const node = {}; - const endOffset = version >= 7500 ? reader.getUint64() : reader.getUint32(); - const numProperties = version >= 7500 ? reader.getUint64() : reader.getUint32(); - version >= 7500 ? reader.getUint64() : reader.getUint32(); - const nameLen = reader.getUint8(); - const name = reader.getString(nameLen); - if (endOffset === 0) return null; - const propertyList = []; - for (let i = 0; i < numProperties; i++) { - propertyList.push(this.parseProperty(reader)); - } - const id2 = propertyList.length > 0 ? propertyList[0] : ""; - const attrName = propertyList.length > 1 ? propertyList[1] : ""; - const attrType = propertyList.length > 2 ? propertyList[2] : ""; - node.singleProperty = numProperties === 1 && reader.getOffset() === endOffset ? true : false; - while (endOffset > reader.getOffset()) { - const subNode = this.parseNode(reader, version); - if (subNode !== null) this.parseSubNode(name, node, subNode); - } - node.propertyList = propertyList; - if (typeof id2 === "number") node.id = id2; - if (attrName !== "") node.attrName = attrName; - if (attrType !== "") node.attrType = attrType; - if (name !== "") node.name = name; - return node; - } - parseSubNode(name, node, subNode) { - if (subNode.singleProperty === true) { - const value = subNode.propertyList[0]; - if (Array.isArray(value)) { - node[subNode.name] = subNode; - subNode.a = value; - } else { - node[subNode.name] = value; - } - } else if (name === "Connections" && subNode.name === "C") { - const array = []; - subNode.propertyList.forEach(function(property, i) { - if (i !== 0) array.push(property); - }); - if (node.connections === void 0) { - node.connections = []; - } - node.connections.push(array); - } else if (subNode.name === "Properties70") { - const keys = Object.keys(subNode); - keys.forEach(function(key) { - node[key] = subNode[key]; - }); - } else if (name === "Properties70" && subNode.name === "P") { - let innerPropName = subNode.propertyList[0]; - let innerPropType1 = subNode.propertyList[1]; - const innerPropType2 = subNode.propertyList[2]; - const innerPropFlag = subNode.propertyList[3]; - let innerPropValue; - if (innerPropName.indexOf("Lcl ") === 0) innerPropName = innerPropName.replace("Lcl ", "Lcl_"); - if (innerPropType1.indexOf("Lcl ") === 0) innerPropType1 = innerPropType1.replace("Lcl ", "Lcl_"); - if (innerPropType1 === "Color" || innerPropType1 === "ColorRGB" || innerPropType1 === "Vector" || innerPropType1 === "Vector3D" || innerPropType1.indexOf("Lcl_") === 0) { - innerPropValue = [ - subNode.propertyList[4], - subNode.propertyList[5], - subNode.propertyList[6] - ]; - } else { - innerPropValue = subNode.propertyList[4]; - } - node[innerPropName] = { - "type": innerPropType1, - "type2": innerPropType2, - "flag": innerPropFlag, - "value": innerPropValue - }; - } else if (node[subNode.name] === void 0) { - if (typeof subNode.id === "number") { - node[subNode.name] = {}; - node[subNode.name][subNode.id] = subNode; - } else { - node[subNode.name] = subNode; - } - } else { - if (subNode.name === "PoseNode") { - if (!Array.isArray(node[subNode.name])) { - node[subNode.name] = [node[subNode.name]]; - } - node[subNode.name].push(subNode); - } else if (node[subNode.name][subNode.id] === void 0) { - node[subNode.name][subNode.id] = subNode; - } - } - } - parseProperty(reader) { - const type = reader.getString(1); - let length; - switch (type) { - case "C": - return reader.getBoolean(); - case "D": - return reader.getFloat64(); - case "F": - return reader.getFloat32(); - case "I": - return reader.getInt32(); - case "L": - return reader.getInt64(); - case "R": - length = reader.getUint32(); - return reader.getArrayBuffer(length); - case "S": - length = reader.getUint32(); - return reader.getString(length); - case "Y": - return reader.getInt16(); - case "b": - case "c": - case "d": - case "f": - case "i": - case "l": - const arrayLength = reader.getUint32(); - const encoding = reader.getUint32(); - const compressedLength = reader.getUint32(); - if (encoding === 0) { - switch (type) { - case "b": - case "c": - return reader.getBooleanArray(arrayLength); - case "d": - return reader.getFloat64Array(arrayLength); - case "f": - return reader.getFloat32Array(arrayLength); - case "i": - return reader.getInt32Array(arrayLength); - case "l": - return reader.getInt64Array(arrayLength); - } - } - const data = unzlibSync(new Uint8Array(reader.getArrayBuffer(compressedLength))); - const reader2 = new BinaryReader(data.buffer); - switch (type) { - case "b": - case "c": - return reader2.getBooleanArray(arrayLength); - case "d": - return reader2.getFloat64Array(arrayLength); - case "f": - return reader2.getFloat32Array(arrayLength); - case "i": - return reader2.getInt32Array(arrayLength); - case "l": - return reader2.getInt64Array(arrayLength); - } - break; - default: - throw new Error("THREE.FBXLoader: Unknown property type " + type); - } - } -} -class BinaryReader { - static { - __name(this, "BinaryReader"); - } - constructor(buffer, littleEndian) { - this.dv = new DataView(buffer); - this.offset = 0; - this.littleEndian = littleEndian !== void 0 ? littleEndian : true; - this._textDecoder = new TextDecoder(); - } - getOffset() { - return this.offset; - } - size() { - return this.dv.buffer.byteLength; - } - skip(length) { - this.offset += length; - } - // seems like true/false representation depends on exporter. - // true: 1 or 'Y'(=0x59), false: 0 or 'T'(=0x54) - // then sees LSB. - getBoolean() { - return (this.getUint8() & 1) === 1; - } - getBooleanArray(size) { - const a = []; - for (let i = 0; i < size; i++) { - a.push(this.getBoolean()); - } - return a; - } - getUint8() { - const value = this.dv.getUint8(this.offset); - this.offset += 1; - return value; - } - getInt16() { - const value = this.dv.getInt16(this.offset, this.littleEndian); - this.offset += 2; - return value; - } - getInt32() { - const value = this.dv.getInt32(this.offset, this.littleEndian); - this.offset += 4; - return value; - } - getInt32Array(size) { - const a = []; - for (let i = 0; i < size; i++) { - a.push(this.getInt32()); - } - return a; - } - getUint32() { - const value = this.dv.getUint32(this.offset, this.littleEndian); - this.offset += 4; - return value; - } - // JavaScript doesn't support 64-bit integer so calculate this here - // 1 << 32 will return 1 so using multiply operation instead here. - // There's a possibility that this method returns wrong value if the value - // is out of the range between Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER. - // TODO: safely handle 64-bit integer - getInt64() { - let low, high; - if (this.littleEndian) { - low = this.getUint32(); - high = this.getUint32(); - } else { - high = this.getUint32(); - low = this.getUint32(); - } - if (high & 2147483648) { - high = ~high & 4294967295; - low = ~low & 4294967295; - if (low === 4294967295) high = high + 1 & 4294967295; - low = low + 1 & 4294967295; - return -(high * 4294967296 + low); - } - return high * 4294967296 + low; - } - getInt64Array(size) { - const a = []; - for (let i = 0; i < size; i++) { - a.push(this.getInt64()); - } - return a; - } - // Note: see getInt64() comment - getUint64() { - let low, high; - if (this.littleEndian) { - low = this.getUint32(); - high = this.getUint32(); - } else { - high = this.getUint32(); - low = this.getUint32(); - } - return high * 4294967296 + low; - } - getFloat32() { - const value = this.dv.getFloat32(this.offset, this.littleEndian); - this.offset += 4; - return value; - } - getFloat32Array(size) { - const a = []; - for (let i = 0; i < size; i++) { - a.push(this.getFloat32()); - } - return a; - } - getFloat64() { - const value = this.dv.getFloat64(this.offset, this.littleEndian); - this.offset += 8; - return value; - } - getFloat64Array(size) { - const a = []; - for (let i = 0; i < size; i++) { - a.push(this.getFloat64()); - } - return a; - } - getArrayBuffer(size) { - const value = this.dv.buffer.slice(this.offset, this.offset + size); - this.offset += size; - return value; - } - getString(size) { - const start = this.offset; - let a = new Uint8Array(this.dv.buffer, start, size); - this.skip(size); - const nullByte = a.indexOf(0); - if (nullByte >= 0) a = new Uint8Array(this.dv.buffer, start, nullByte); - return this._textDecoder.decode(a); - } -} -class FBXTree { - static { - __name(this, "FBXTree"); - } - add(key, val) { - this[key] = val; - } -} -function isFbxFormatBinary(buffer) { - const CORRECT = "Kaydara FBX Binary \0"; - return buffer.byteLength >= CORRECT.length && CORRECT === convertArrayBufferToString(buffer, 0, CORRECT.length); -} -__name(isFbxFormatBinary, "isFbxFormatBinary"); -function isFbxFormatASCII(text) { - const CORRECT = ["K", "a", "y", "d", "a", "r", "a", "\\", "F", "B", "X", "\\", "B", "i", "n", "a", "r", "y", "\\", "\\"]; - let cursor = 0; - function read(offset) { - const result = text[offset - 1]; - text = text.slice(cursor + offset); - cursor++; - return result; - } - __name(read, "read"); - for (let i = 0; i < CORRECT.length; ++i) { - const num = read(1); - if (num === CORRECT[i]) { - return false; - } - } - return true; -} -__name(isFbxFormatASCII, "isFbxFormatASCII"); -function getFbxVersion(text) { - const versionRegExp = /FBXVersion: (\d+)/; - const match = text.match(versionRegExp); - if (match) { - const version = parseInt(match[1]); - return version; - } - throw new Error("THREE.FBXLoader: Cannot find the version number for the file given."); -} -__name(getFbxVersion, "getFbxVersion"); -function convertFBXTimeToSeconds(time) { - return time / 46186158e3; -} -__name(convertFBXTimeToSeconds, "convertFBXTimeToSeconds"); -const dataArray = []; -function getData(polygonVertexIndex, polygonIndex, vertexIndex, infoObject) { - let index; - switch (infoObject.mappingType) { - case "ByPolygonVertex": - index = polygonVertexIndex; - break; - case "ByPolygon": - index = polygonIndex; - break; - case "ByVertice": - index = vertexIndex; - break; - case "AllSame": - index = infoObject.indices[0]; - break; - default: - console.warn("THREE.FBXLoader: unknown attribute mapping type " + infoObject.mappingType); - } - if (infoObject.referenceType === "IndexToDirect") index = infoObject.indices[index]; - const from = index * infoObject.dataSize; - const to = from + infoObject.dataSize; - return slice(dataArray, infoObject.buffer, from, to); -} -__name(getData, "getData"); -const tempEuler = new Euler(); -const tempVec = new Vector3(); -function generateTransform(transformData) { - const lTranslationM = new Matrix4(); - const lPreRotationM = new Matrix4(); - const lRotationM = new Matrix4(); - const lPostRotationM = new Matrix4(); - const lScalingM = new Matrix4(); - const lScalingPivotM = new Matrix4(); - const lScalingOffsetM = new Matrix4(); - const lRotationOffsetM = new Matrix4(); - const lRotationPivotM = new Matrix4(); - const lParentGX = new Matrix4(); - const lParentLX = new Matrix4(); - const lGlobalT = new Matrix4(); - const inheritType = transformData.inheritType ? transformData.inheritType : 0; - if (transformData.translation) lTranslationM.setPosition(tempVec.fromArray(transformData.translation)); - const defaultEulerOrder = getEulerOrder(0); - if (transformData.preRotation) { - const array = transformData.preRotation.map(MathUtils.degToRad); - array.push(defaultEulerOrder); - lPreRotationM.makeRotationFromEuler(tempEuler.fromArray(array)); - } - if (transformData.rotation) { - const array = transformData.rotation.map(MathUtils.degToRad); - array.push(transformData.eulerOrder || defaultEulerOrder); - lRotationM.makeRotationFromEuler(tempEuler.fromArray(array)); - } - if (transformData.postRotation) { - const array = transformData.postRotation.map(MathUtils.degToRad); - array.push(defaultEulerOrder); - lPostRotationM.makeRotationFromEuler(tempEuler.fromArray(array)); - lPostRotationM.invert(); - } - if (transformData.scale) lScalingM.scale(tempVec.fromArray(transformData.scale)); - if (transformData.scalingOffset) lScalingOffsetM.setPosition(tempVec.fromArray(transformData.scalingOffset)); - if (transformData.scalingPivot) lScalingPivotM.setPosition(tempVec.fromArray(transformData.scalingPivot)); - if (transformData.rotationOffset) lRotationOffsetM.setPosition(tempVec.fromArray(transformData.rotationOffset)); - if (transformData.rotationPivot) lRotationPivotM.setPosition(tempVec.fromArray(transformData.rotationPivot)); - if (transformData.parentMatrixWorld) { - lParentLX.copy(transformData.parentMatrix); - lParentGX.copy(transformData.parentMatrixWorld); - } - const lLRM = lPreRotationM.clone().multiply(lRotationM).multiply(lPostRotationM); - const lParentGRM = new Matrix4(); - lParentGRM.extractRotation(lParentGX); - const lParentTM = new Matrix4(); - lParentTM.copyPosition(lParentGX); - const lParentGRSM = lParentTM.clone().invert().multiply(lParentGX); - const lParentGSM = lParentGRM.clone().invert().multiply(lParentGRSM); - const lLSM = lScalingM; - const lGlobalRS = new Matrix4(); - if (inheritType === 0) { - lGlobalRS.copy(lParentGRM).multiply(lLRM).multiply(lParentGSM).multiply(lLSM); - } else if (inheritType === 1) { - lGlobalRS.copy(lParentGRM).multiply(lParentGSM).multiply(lLRM).multiply(lLSM); - } else { - const lParentLSM = new Matrix4().scale(new Vector3().setFromMatrixScale(lParentLX)); - const lParentLSM_inv = lParentLSM.clone().invert(); - const lParentGSM_noLocal = lParentGSM.clone().multiply(lParentLSM_inv); - lGlobalRS.copy(lParentGRM).multiply(lLRM).multiply(lParentGSM_noLocal).multiply(lLSM); - } - const lRotationPivotM_inv = lRotationPivotM.clone().invert(); - const lScalingPivotM_inv = lScalingPivotM.clone().invert(); - let lTransform = lTranslationM.clone().multiply(lRotationOffsetM).multiply(lRotationPivotM).multiply(lPreRotationM).multiply(lRotationM).multiply(lPostRotationM).multiply(lRotationPivotM_inv).multiply(lScalingOffsetM).multiply(lScalingPivotM).multiply(lScalingM).multiply(lScalingPivotM_inv); - const lLocalTWithAllPivotAndOffsetInfo = new Matrix4().copyPosition(lTransform); - const lGlobalTranslation = lParentGX.clone().multiply(lLocalTWithAllPivotAndOffsetInfo); - lGlobalT.copyPosition(lGlobalTranslation); - lTransform = lGlobalT.clone().multiply(lGlobalRS); - lTransform.premultiply(lParentGX.invert()); - return lTransform; -} -__name(generateTransform, "generateTransform"); -function getEulerOrder(order) { - order = order || 0; - const enums = [ - "ZYX", - // -> XYZ extrinsic - "YZX", - // -> XZY extrinsic - "XZY", - // -> YZX extrinsic - "ZXY", - // -> YXZ extrinsic - "YXZ", - // -> ZXY extrinsic - "XYZ" - // -> ZYX extrinsic - //'SphericXYZ', // not possible to support - ]; - if (order === 6) { - console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."); - return enums[0]; - } - return enums[order]; -} -__name(getEulerOrder, "getEulerOrder"); -function parseNumberArray(value) { - const array = value.split(",").map(function(val) { - return parseFloat(val); - }); - return array; -} -__name(parseNumberArray, "parseNumberArray"); -function convertArrayBufferToString(buffer, from, to) { - if (from === void 0) from = 0; - if (to === void 0) to = buffer.byteLength; - return new TextDecoder().decode(new Uint8Array(buffer, from, to)); -} -__name(convertArrayBufferToString, "convertArrayBufferToString"); -function append(a, b) { - for (let i = 0, j = a.length, l = b.length; i < l; i++, j++) { - a[j] = b[i]; - } -} -__name(append, "append"); -function slice(a, b, from, to) { - for (let i = from, j = 0; i < to; i++, j++) { - a[j] = b[i]; - } - return a; -} -__name(slice, "slice"); -function computeMikkTSpaceTangents(geometry, MikkTSpace, negateSign = true) { - if (!MikkTSpace || !MikkTSpace.isReady) { - throw new Error("BufferGeometryUtils: Initialized MikkTSpace library required."); - } - if (!geometry.hasAttribute("position") || !geometry.hasAttribute("normal") || !geometry.hasAttribute("uv")) { - throw new Error('BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.'); - } - function getAttributeArray(attribute) { - if (attribute.normalized || attribute.isInterleavedBufferAttribute) { - const dstArray = new Float32Array(attribute.count * attribute.itemSize); - for (let i = 0, j = 0; i < attribute.count; i++) { - dstArray[j++] = attribute.getX(i); - dstArray[j++] = attribute.getY(i); - if (attribute.itemSize > 2) { - dstArray[j++] = attribute.getZ(i); - } - } - return dstArray; - } - if (attribute.array instanceof Float32Array) { - return attribute.array; - } - return new Float32Array(attribute.array); - } - __name(getAttributeArray, "getAttributeArray"); - const _geometry2 = geometry.index ? geometry.toNonIndexed() : geometry; - const tangents = MikkTSpace.generateTangents( - getAttributeArray(_geometry2.attributes.position), - getAttributeArray(_geometry2.attributes.normal), - getAttributeArray(_geometry2.attributes.uv) - ); - if (negateSign) { - for (let i = 3; i < tangents.length; i += 4) { - tangents[i] *= -1; - } - } - _geometry2.setAttribute("tangent", new BufferAttribute(tangents, 4)); - if (geometry !== _geometry2) { - geometry.copy(_geometry2); - } - return geometry; -} -__name(computeMikkTSpaceTangents, "computeMikkTSpaceTangents"); -function mergeGeometries(geometries, useGroups = false) { - const isIndexed = geometries[0].index !== null; - const attributesUsed = new Set(Object.keys(geometries[0].attributes)); - const morphAttributesUsed = new Set(Object.keys(geometries[0].morphAttributes)); - const attributes = {}; - const morphAttributes = {}; - const morphTargetsRelative = geometries[0].morphTargetsRelative; - const mergedGeometry = new BufferGeometry(); - let offset = 0; - for (let i = 0; i < geometries.length; ++i) { - const geometry = geometries[i]; - let attributesCount = 0; - if (isIndexed !== (geometry.index !== null)) { - console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + i + ". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."); - return null; - } - for (const name in geometry.attributes) { - if (!attributesUsed.has(name)) { - console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + i + '. All geometries must have compatible attributes; make sure "' + name + '" attribute exists among all geometries, or in none of them.'); - return null; - } - if (attributes[name] === void 0) attributes[name] = []; - attributes[name].push(geometry.attributes[name]); - attributesCount++; - } - if (attributesCount !== attributesUsed.size) { - console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + i + ". Make sure all geometries have the same number of attributes."); - return null; - } - if (morphTargetsRelative !== geometry.morphTargetsRelative) { - console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + i + ". .morphTargetsRelative must be consistent throughout all geometries."); - return null; - } - for (const name in geometry.morphAttributes) { - if (!morphAttributesUsed.has(name)) { - console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + i + ". .morphAttributes must be consistent throughout all geometries."); - return null; - } - if (morphAttributes[name] === void 0) morphAttributes[name] = []; - morphAttributes[name].push(geometry.morphAttributes[name]); - } - if (useGroups) { - let count; - if (isIndexed) { - count = geometry.index.count; - } else if (geometry.attributes.position !== void 0) { - count = geometry.attributes.position.count; - } else { - console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + i + ". The geometry must have either an index or a position attribute"); - return null; - } - mergedGeometry.addGroup(offset, count, i); - offset += count; - } - } - if (isIndexed) { - let indexOffset = 0; - const mergedIndex = []; - for (let i = 0; i < geometries.length; ++i) { - const index = geometries[i].index; - for (let j = 0; j < index.count; ++j) { - mergedIndex.push(index.getX(j) + indexOffset); - } - indexOffset += geometries[i].attributes.position.count; - } - mergedGeometry.setIndex(mergedIndex); - } - for (const name in attributes) { - const mergedAttribute = mergeAttributes(attributes[name]); - if (!mergedAttribute) { - console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + name + " attribute."); - return null; - } - mergedGeometry.setAttribute(name, mergedAttribute); - } - for (const name in morphAttributes) { - const numMorphTargets = morphAttributes[name][0].length; - if (numMorphTargets === 0) break; - mergedGeometry.morphAttributes = mergedGeometry.morphAttributes || {}; - mergedGeometry.morphAttributes[name] = []; - for (let i = 0; i < numMorphTargets; ++i) { - const morphAttributesToMerge = []; - for (let j = 0; j < morphAttributes[name].length; ++j) { - morphAttributesToMerge.push(morphAttributes[name][j][i]); - } - const mergedMorphAttribute = mergeAttributes(morphAttributesToMerge); - if (!mergedMorphAttribute) { - console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + name + " morphAttribute."); - return null; - } - mergedGeometry.morphAttributes[name].push(mergedMorphAttribute); - } - } - return mergedGeometry; -} -__name(mergeGeometries, "mergeGeometries"); -function mergeAttributes(attributes) { - let TypedArray; - let itemSize; - let normalized; - let gpuType = -1; - let arrayLength = 0; - for (let i = 0; i < attributes.length; ++i) { - const attribute = attributes[i]; - if (TypedArray === void 0) TypedArray = attribute.array.constructor; - if (TypedArray !== attribute.array.constructor) { - console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."); - return null; - } - if (itemSize === void 0) itemSize = attribute.itemSize; - if (itemSize !== attribute.itemSize) { - console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."); - return null; - } - if (normalized === void 0) normalized = attribute.normalized; - if (normalized !== attribute.normalized) { - console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."); - return null; - } - if (gpuType === -1) gpuType = attribute.gpuType; - if (gpuType !== attribute.gpuType) { - console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."); - return null; - } - arrayLength += attribute.count * itemSize; - } - const array = new TypedArray(arrayLength); - const result = new BufferAttribute(array, itemSize, normalized); - let offset = 0; - for (let i = 0; i < attributes.length; ++i) { - const attribute = attributes[i]; - if (attribute.isInterleavedBufferAttribute) { - const tupleOffset = offset / itemSize; - for (let j = 0, l = attribute.count; j < l; j++) { - for (let c = 0; c < itemSize; c++) { - const value = attribute.getComponent(j, c); - result.setComponent(j + tupleOffset, c, value); - } - } - } else { - array.set(attribute.array, offset); - } - offset += attribute.count * itemSize; - } - if (gpuType !== void 0) { - result.gpuType = gpuType; - } - return result; -} -__name(mergeAttributes, "mergeAttributes"); -function deepCloneAttribute(attribute) { - if (attribute.isInstancedInterleavedBufferAttribute || attribute.isInterleavedBufferAttribute) { - return deinterleaveAttribute(attribute); - } - if (attribute.isInstancedBufferAttribute) { - return new InstancedBufferAttribute().copy(attribute); - } - return new BufferAttribute().copy(attribute); -} -__name(deepCloneAttribute, "deepCloneAttribute"); -function interleaveAttributes(attributes) { - let TypedArray; - let arrayLength = 0; - let stride = 0; - for (let i = 0, l = attributes.length; i < l; ++i) { - const attribute = attributes[i]; - if (TypedArray === void 0) TypedArray = attribute.array.constructor; - if (TypedArray !== attribute.array.constructor) { - console.error("AttributeBuffers of different types cannot be interleaved"); - return null; - } - arrayLength += attribute.array.length; - stride += attribute.itemSize; - } - const interleavedBuffer = new InterleavedBuffer(new TypedArray(arrayLength), stride); - let offset = 0; - const res = []; - const getters = ["getX", "getY", "getZ", "getW"]; - const setters = ["setX", "setY", "setZ", "setW"]; - for (let j = 0, l = attributes.length; j < l; j++) { - const attribute = attributes[j]; - const itemSize = attribute.itemSize; - const count = attribute.count; - const iba = new InterleavedBufferAttribute(interleavedBuffer, itemSize, offset, attribute.normalized); - res.push(iba); - offset += itemSize; - for (let c = 0; c < count; c++) { - for (let k = 0; k < itemSize; k++) { - iba[setters[k]](c, attribute[getters[k]](c)); - } - } - } - return res; -} -__name(interleaveAttributes, "interleaveAttributes"); -function deinterleaveAttribute(attribute) { - const cons = attribute.data.array.constructor; - const count = attribute.count; - const itemSize = attribute.itemSize; - const normalized = attribute.normalized; - const array = new cons(count * itemSize); - let newAttribute; - if (attribute.isInstancedInterleavedBufferAttribute) { - newAttribute = new InstancedBufferAttribute(array, itemSize, normalized, attribute.meshPerAttribute); - } else { - newAttribute = new BufferAttribute(array, itemSize, normalized); - } - for (let i = 0; i < count; i++) { - newAttribute.setX(i, attribute.getX(i)); - if (itemSize >= 2) { - newAttribute.setY(i, attribute.getY(i)); - } - if (itemSize >= 3) { - newAttribute.setZ(i, attribute.getZ(i)); - } - if (itemSize >= 4) { - newAttribute.setW(i, attribute.getW(i)); - } - } - return newAttribute; -} -__name(deinterleaveAttribute, "deinterleaveAttribute"); -function deinterleaveGeometry(geometry) { - const attributes = geometry.attributes; - const morphTargets = geometry.morphTargets; - const attrMap = /* @__PURE__ */ new Map(); - for (const key in attributes) { - const attr = attributes[key]; - if (attr.isInterleavedBufferAttribute) { - if (!attrMap.has(attr)) { - attrMap.set(attr, deinterleaveAttribute(attr)); - } - attributes[key] = attrMap.get(attr); - } - } - for (const key in morphTargets) { - const attr = morphTargets[key]; - if (attr.isInterleavedBufferAttribute) { - if (!attrMap.has(attr)) { - attrMap.set(attr, deinterleaveAttribute(attr)); - } - morphTargets[key] = attrMap.get(attr); - } - } -} -__name(deinterleaveGeometry, "deinterleaveGeometry"); -function estimateBytesUsed(geometry) { - let mem = 0; - for (const name in geometry.attributes) { - const attr = geometry.getAttribute(name); - mem += attr.count * attr.itemSize * attr.array.BYTES_PER_ELEMENT; - } - const indices = geometry.getIndex(); - mem += indices ? indices.count * indices.itemSize * indices.array.BYTES_PER_ELEMENT : 0; - return mem; -} -__name(estimateBytesUsed, "estimateBytesUsed"); -function mergeVertices(geometry, tolerance = 1e-4) { - tolerance = Math.max(tolerance, Number.EPSILON); - const hashToIndex = {}; - const indices = geometry.getIndex(); - const positions = geometry.getAttribute("position"); - const vertexCount = indices ? indices.count : positions.count; - let nextIndex = 0; - const attributeNames = Object.keys(geometry.attributes); - const tmpAttributes = {}; - const tmpMorphAttributes = {}; - const newIndices = []; - const getters = ["getX", "getY", "getZ", "getW"]; - const setters = ["setX", "setY", "setZ", "setW"]; - for (let i = 0, l = attributeNames.length; i < l; i++) { - const name = attributeNames[i]; - const attr = geometry.attributes[name]; - tmpAttributes[name] = new attr.constructor( - new attr.array.constructor(attr.count * attr.itemSize), - attr.itemSize, - attr.normalized - ); - const morphAttributes = geometry.morphAttributes[name]; - if (morphAttributes) { - if (!tmpMorphAttributes[name]) tmpMorphAttributes[name] = []; - morphAttributes.forEach((morphAttr, i2) => { - const array = new morphAttr.array.constructor(morphAttr.count * morphAttr.itemSize); - tmpMorphAttributes[name][i2] = new morphAttr.constructor(array, morphAttr.itemSize, morphAttr.normalized); - }); - } - } - const halfTolerance = tolerance * 0.5; - const exponent = Math.log10(1 / tolerance); - const hashMultiplier = Math.pow(10, exponent); - const hashAdditive = halfTolerance * hashMultiplier; - for (let i = 0; i < vertexCount; i++) { - const index = indices ? indices.getX(i) : i; - let hash = ""; - for (let j = 0, l = attributeNames.length; j < l; j++) { - const name = attributeNames[j]; - const attribute = geometry.getAttribute(name); - const itemSize = attribute.itemSize; - for (let k = 0; k < itemSize; k++) { - hash += `${~~(attribute[getters[k]](index) * hashMultiplier + hashAdditive)},`; - } - } - if (hash in hashToIndex) { - newIndices.push(hashToIndex[hash]); - } else { - for (let j = 0, l = attributeNames.length; j < l; j++) { - const name = attributeNames[j]; - const attribute = geometry.getAttribute(name); - const morphAttributes = geometry.morphAttributes[name]; - const itemSize = attribute.itemSize; - const newArray = tmpAttributes[name]; - const newMorphArrays = tmpMorphAttributes[name]; - for (let k = 0; k < itemSize; k++) { - const getterFunc = getters[k]; - const setterFunc = setters[k]; - newArray[setterFunc](nextIndex, attribute[getterFunc](index)); - if (morphAttributes) { - for (let m = 0, ml = morphAttributes.length; m < ml; m++) { - newMorphArrays[m][setterFunc](nextIndex, morphAttributes[m][getterFunc](index)); - } - } - } - } - hashToIndex[hash] = nextIndex; - newIndices.push(nextIndex); - nextIndex++; - } - } - const result = geometry.clone(); - for (const name in geometry.attributes) { - const tmpAttribute = tmpAttributes[name]; - result.setAttribute(name, new tmpAttribute.constructor( - tmpAttribute.array.slice(0, nextIndex * tmpAttribute.itemSize), - tmpAttribute.itemSize, - tmpAttribute.normalized - )); - if (!(name in tmpMorphAttributes)) continue; - for (let j = 0; j < tmpMorphAttributes[name].length; j++) { - const tmpMorphAttribute = tmpMorphAttributes[name][j]; - result.morphAttributes[name][j] = new tmpMorphAttribute.constructor( - tmpMorphAttribute.array.slice(0, nextIndex * tmpMorphAttribute.itemSize), - tmpMorphAttribute.itemSize, - tmpMorphAttribute.normalized - ); - } - } - result.setIndex(newIndices); - return result; -} -__name(mergeVertices, "mergeVertices"); -function toTrianglesDrawMode(geometry, drawMode) { - if (drawMode === TrianglesDrawMode) { - console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."); - return geometry; - } - if (drawMode === TriangleFanDrawMode || drawMode === TriangleStripDrawMode) { - let index = geometry.getIndex(); - if (index === null) { - const indices = []; - const position = geometry.getAttribute("position"); - if (position !== void 0) { - for (let i = 0; i < position.count; i++) { - indices.push(i); - } - geometry.setIndex(indices); - index = geometry.getIndex(); - } else { - console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."); - return geometry; - } - } - const numberOfTriangles = index.count - 2; - const newIndices = []; - if (drawMode === TriangleFanDrawMode) { - for (let i = 1; i <= numberOfTriangles; i++) { - newIndices.push(index.getX(0)); - newIndices.push(index.getX(i)); - newIndices.push(index.getX(i + 1)); - } - } else { - for (let i = 0; i < numberOfTriangles; i++) { - if (i % 2 === 0) { - newIndices.push(index.getX(i)); - newIndices.push(index.getX(i + 1)); - newIndices.push(index.getX(i + 2)); - } else { - newIndices.push(index.getX(i + 2)); - newIndices.push(index.getX(i + 1)); - newIndices.push(index.getX(i)); - } - } - } - if (newIndices.length / 3 !== numberOfTriangles) { - console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles."); - } - const newGeometry = geometry.clone(); - newGeometry.setIndex(newIndices); - newGeometry.clearGroups(); - return newGeometry; - } else { - console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", drawMode); - return geometry; - } -} -__name(toTrianglesDrawMode, "toTrianglesDrawMode"); -function computeMorphedAttributes(object) { - const _vA2 = new Vector3(); - const _vB2 = new Vector3(); - const _vC2 = new Vector3(); - const _tempA2 = new Vector3(); - const _tempB = new Vector3(); - const _tempC = new Vector3(); - const _morphA2 = new Vector3(); - const _morphB = new Vector3(); - const _morphC = new Vector3(); - function _calculateMorphedAttributeData(object2, attribute, morphAttribute, morphTargetsRelative2, a2, b3, c2, modifiedAttributeArray) { - _vA2.fromBufferAttribute(attribute, a2); - _vB2.fromBufferAttribute(attribute, b3); - _vC2.fromBufferAttribute(attribute, c2); - const morphInfluences = object2.morphTargetInfluences; - if (morphAttribute && morphInfluences) { - _morphA2.set(0, 0, 0); - _morphB.set(0, 0, 0); - _morphC.set(0, 0, 0); - for (let i2 = 0, il2 = morphAttribute.length; i2 < il2; i2++) { - const influence = morphInfluences[i2]; - const morph = morphAttribute[i2]; - if (influence === 0) continue; - _tempA2.fromBufferAttribute(morph, a2); - _tempB.fromBufferAttribute(morph, b3); - _tempC.fromBufferAttribute(morph, c2); - if (morphTargetsRelative2) { - _morphA2.addScaledVector(_tempA2, influence); - _morphB.addScaledVector(_tempB, influence); - _morphC.addScaledVector(_tempC, influence); - } else { - _morphA2.addScaledVector(_tempA2.sub(_vA2), influence); - _morphB.addScaledVector(_tempB.sub(_vB2), influence); - _morphC.addScaledVector(_tempC.sub(_vC2), influence); - } - } - _vA2.add(_morphA2); - _vB2.add(_morphB); - _vC2.add(_morphC); - } - if (object2.isSkinnedMesh) { - object2.applyBoneTransform(a2, _vA2); - object2.applyBoneTransform(b3, _vB2); - object2.applyBoneTransform(c2, _vC2); - } - modifiedAttributeArray[a2 * 3 + 0] = _vA2.x; - modifiedAttributeArray[a2 * 3 + 1] = _vA2.y; - modifiedAttributeArray[a2 * 3 + 2] = _vA2.z; - modifiedAttributeArray[b3 * 3 + 0] = _vB2.x; - modifiedAttributeArray[b3 * 3 + 1] = _vB2.y; - modifiedAttributeArray[b3 * 3 + 2] = _vB2.z; - modifiedAttributeArray[c2 * 3 + 0] = _vC2.x; - modifiedAttributeArray[c2 * 3 + 1] = _vC2.y; - modifiedAttributeArray[c2 * 3 + 2] = _vC2.z; - } - __name(_calculateMorphedAttributeData, "_calculateMorphedAttributeData"); - const geometry = object.geometry; - const material = object.material; - let a, b, c; - const index = geometry.index; - const positionAttribute = geometry.attributes.position; - const morphPosition = geometry.morphAttributes.position; - const morphTargetsRelative = geometry.morphTargetsRelative; - const normalAttribute = geometry.attributes.normal; - const morphNormal = geometry.morphAttributes.position; - const groups = geometry.groups; - const drawRange = geometry.drawRange; - let i, j, il, jl; - let group; - let start, end; - const modifiedPosition = new Float32Array(positionAttribute.count * positionAttribute.itemSize); - const modifiedNormal = new Float32Array(normalAttribute.count * normalAttribute.itemSize); - if (index !== null) { - if (Array.isArray(material)) { - for (i = 0, il = groups.length; i < il; i++) { - group = groups[i]; - start = Math.max(group.start, drawRange.start); - end = Math.min(group.start + group.count, drawRange.start + drawRange.count); - for (j = start, jl = end; j < jl; j += 3) { - a = index.getX(j); - b = index.getX(j + 1); - c = index.getX(j + 2); - _calculateMorphedAttributeData( - object, - positionAttribute, - morphPosition, - morphTargetsRelative, - a, - b, - c, - modifiedPosition - ); - _calculateMorphedAttributeData( - object, - normalAttribute, - morphNormal, - morphTargetsRelative, - a, - b, - c, - modifiedNormal - ); - } - } - } else { - start = Math.max(0, drawRange.start); - end = Math.min(index.count, drawRange.start + drawRange.count); - for (i = start, il = end; i < il; i += 3) { - a = index.getX(i); - b = index.getX(i + 1); - c = index.getX(i + 2); - _calculateMorphedAttributeData( - object, - positionAttribute, - morphPosition, - morphTargetsRelative, - a, - b, - c, - modifiedPosition - ); - _calculateMorphedAttributeData( - object, - normalAttribute, - morphNormal, - morphTargetsRelative, - a, - b, - c, - modifiedNormal - ); - } - } - } else { - if (Array.isArray(material)) { - for (i = 0, il = groups.length; i < il; i++) { - group = groups[i]; - start = Math.max(group.start, drawRange.start); - end = Math.min(group.start + group.count, drawRange.start + drawRange.count); - for (j = start, jl = end; j < jl; j += 3) { - a = j; - b = j + 1; - c = j + 2; - _calculateMorphedAttributeData( - object, - positionAttribute, - morphPosition, - morphTargetsRelative, - a, - b, - c, - modifiedPosition - ); - _calculateMorphedAttributeData( - object, - normalAttribute, - morphNormal, - morphTargetsRelative, - a, - b, - c, - modifiedNormal - ); - } - } - } else { - start = Math.max(0, drawRange.start); - end = Math.min(positionAttribute.count, drawRange.start + drawRange.count); - for (i = start, il = end; i < il; i += 3) { - a = i; - b = i + 1; - c = i + 2; - _calculateMorphedAttributeData( - object, - positionAttribute, - morphPosition, - morphTargetsRelative, - a, - b, - c, - modifiedPosition - ); - _calculateMorphedAttributeData( - object, - normalAttribute, - morphNormal, - morphTargetsRelative, - a, - b, - c, - modifiedNormal - ); - } - } - } - const morphedPositionAttribute = new Float32BufferAttribute(modifiedPosition, 3); - const morphedNormalAttribute = new Float32BufferAttribute(modifiedNormal, 3); - return { - positionAttribute, - normalAttribute, - morphedPositionAttribute, - morphedNormalAttribute - }; -} -__name(computeMorphedAttributes, "computeMorphedAttributes"); -function mergeGroups(geometry) { - if (geometry.groups.length === 0) { - console.warn("THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge."); - return geometry; - } - let groups = geometry.groups; - groups = groups.sort((a, b) => { - if (a.materialIndex !== b.materialIndex) return a.materialIndex - b.materialIndex; - return a.start - b.start; - }); - if (geometry.getIndex() === null) { - const positionAttribute = geometry.getAttribute("position"); - const indices = []; - for (let i = 0; i < positionAttribute.count; i += 3) { - indices.push(i, i + 1, i + 2); - } - geometry.setIndex(indices); - } - const index = geometry.getIndex(); - const newIndices = []; - for (let i = 0; i < groups.length; i++) { - const group = groups[i]; - const groupStart = group.start; - const groupLength = groupStart + group.count; - for (let j = groupStart; j < groupLength; j++) { - newIndices.push(index.getX(j)); - } - } - geometry.dispose(); - geometry.setIndex(newIndices); - let start = 0; - for (let i = 0; i < groups.length; i++) { - const group = groups[i]; - group.start = start; - start += group.count; - } - let currentGroup = groups[0]; - geometry.groups = [currentGroup]; - for (let i = 1; i < groups.length; i++) { - const group = groups[i]; - if (currentGroup.materialIndex === group.materialIndex) { - currentGroup.count += group.count; - } else { - currentGroup = group; - geometry.groups.push(currentGroup); - } - } - return geometry; -} -__name(mergeGroups, "mergeGroups"); -function toCreasedNormals(geometry, creaseAngle = Math.PI / 3) { - const creaseDot = Math.cos(creaseAngle); - const hashMultiplier = (1 + 1e-10) * 100; - const verts = [new Vector3(), new Vector3(), new Vector3()]; - const tempVec1 = new Vector3(); - const tempVec2 = new Vector3(); - const tempNorm = new Vector3(); - const tempNorm2 = new Vector3(); - function hashVertex(v) { - const x = ~~(v.x * hashMultiplier); - const y = ~~(v.y * hashMultiplier); - const z = ~~(v.z * hashMultiplier); - return `${x},${y},${z}`; - } - __name(hashVertex, "hashVertex"); - const resultGeometry = geometry.index ? geometry.toNonIndexed() : geometry; - const posAttr = resultGeometry.attributes.position; - const vertexMap = {}; - for (let i = 0, l = posAttr.count / 3; i < l; i++) { - const i3 = 3 * i; - const a = verts[0].fromBufferAttribute(posAttr, i3 + 0); - const b = verts[1].fromBufferAttribute(posAttr, i3 + 1); - const c = verts[2].fromBufferAttribute(posAttr, i3 + 2); - tempVec1.subVectors(c, b); - tempVec2.subVectors(a, b); - const normal = new Vector3().crossVectors(tempVec1, tempVec2).normalize(); - for (let n = 0; n < 3; n++) { - const vert = verts[n]; - const hash = hashVertex(vert); - if (!(hash in vertexMap)) { - vertexMap[hash] = []; - } - vertexMap[hash].push(normal); - } - } - const normalArray = new Float32Array(posAttr.count * 3); - const normAttr = new BufferAttribute(normalArray, 3, false); - for (let i = 0, l = posAttr.count / 3; i < l; i++) { - const i3 = 3 * i; - const a = verts[0].fromBufferAttribute(posAttr, i3 + 0); - const b = verts[1].fromBufferAttribute(posAttr, i3 + 1); - const c = verts[2].fromBufferAttribute(posAttr, i3 + 2); - tempVec1.subVectors(c, b); - tempVec2.subVectors(a, b); - tempNorm.crossVectors(tempVec1, tempVec2).normalize(); - for (let n = 0; n < 3; n++) { - const vert = verts[n]; - const hash = hashVertex(vert); - const otherNormals = vertexMap[hash]; - tempNorm2.set(0, 0, 0); - for (let k = 0, lk = otherNormals.length; k < lk; k++) { - const otherNorm = otherNormals[k]; - if (tempNorm.dot(otherNorm) > creaseDot) { - tempNorm2.add(otherNorm); - } - } - tempNorm2.normalize(); - normAttr.setXYZ(i3 + n, tempNorm2.x, tempNorm2.y, tempNorm2.z); - } - } - resultGeometry.setAttribute("normal", normAttr); - return resultGeometry; -} -__name(toCreasedNormals, "toCreasedNormals"); -class GLTFLoader extends Loader { - static { - __name(this, "GLTFLoader"); - } - constructor(manager) { - super(manager); - this.dracoLoader = null; - this.ktx2Loader = null; - this.meshoptDecoder = null; - this.pluginCallbacks = []; - this.register(function(parser) { - return new GLTFMaterialsClearcoatExtension(parser); - }); - this.register(function(parser) { - return new GLTFMaterialsDispersionExtension(parser); - }); - this.register(function(parser) { - return new GLTFTextureBasisUExtension(parser); - }); - this.register(function(parser) { - return new GLTFTextureWebPExtension(parser); - }); - this.register(function(parser) { - return new GLTFTextureAVIFExtension(parser); - }); - this.register(function(parser) { - return new GLTFMaterialsSheenExtension(parser); - }); - this.register(function(parser) { - return new GLTFMaterialsTransmissionExtension(parser); - }); - this.register(function(parser) { - return new GLTFMaterialsVolumeExtension(parser); - }); - this.register(function(parser) { - return new GLTFMaterialsIorExtension(parser); - }); - this.register(function(parser) { - return new GLTFMaterialsEmissiveStrengthExtension(parser); - }); - this.register(function(parser) { - return new GLTFMaterialsSpecularExtension(parser); - }); - this.register(function(parser) { - return new GLTFMaterialsIridescenceExtension(parser); - }); - this.register(function(parser) { - return new GLTFMaterialsAnisotropyExtension(parser); - }); - this.register(function(parser) { - return new GLTFMaterialsBumpExtension(parser); - }); - this.register(function(parser) { - return new GLTFLightsExtension(parser); - }); - this.register(function(parser) { - return new GLTFMeshoptCompression(parser); - }); - this.register(function(parser) { - return new GLTFMeshGpuInstancing(parser); - }); - } - load(url, onLoad, onProgress, onError) { - const scope = this; - let resourcePath; - if (this.resourcePath !== "") { - resourcePath = this.resourcePath; - } else if (this.path !== "") { - const relativeUrl = LoaderUtils.extractUrlBase(url); - resourcePath = LoaderUtils.resolveURL(relativeUrl, this.path); - } else { - resourcePath = LoaderUtils.extractUrlBase(url); - } - this.manager.itemStart(url); - const _onError = /* @__PURE__ */ __name(function(e) { - if (onError) { - onError(e); - } else { - console.error(e); - } - scope.manager.itemError(url); - scope.manager.itemEnd(url); - }, "_onError"); - const loader = new FileLoader(this.manager); - loader.setPath(this.path); - loader.setResponseType("arraybuffer"); - loader.setRequestHeader(this.requestHeader); - loader.setWithCredentials(this.withCredentials); - loader.load(url, function(data) { - try { - scope.parse(data, resourcePath, function(gltf) { - onLoad(gltf); - scope.manager.itemEnd(url); - }, _onError); - } catch (e) { - _onError(e); - } - }, onProgress, _onError); - } - setDRACOLoader(dracoLoader) { - this.dracoLoader = dracoLoader; - return this; - } - setKTX2Loader(ktx2Loader) { - this.ktx2Loader = ktx2Loader; - return this; - } - setMeshoptDecoder(meshoptDecoder) { - this.meshoptDecoder = meshoptDecoder; - return this; - } - register(callback) { - if (this.pluginCallbacks.indexOf(callback) === -1) { - this.pluginCallbacks.push(callback); - } - return this; - } - unregister(callback) { - if (this.pluginCallbacks.indexOf(callback) !== -1) { - this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(callback), 1); - } - return this; - } - parse(data, path, onLoad, onError) { - let json; - const extensions = {}; - const plugins = {}; - const textDecoder = new TextDecoder(); - if (typeof data === "string") { - json = JSON.parse(data); - } else if (data instanceof ArrayBuffer) { - const magic = textDecoder.decode(new Uint8Array(data, 0, 4)); - if (magic === BINARY_EXTENSION_HEADER_MAGIC) { - try { - extensions[EXTENSIONS.KHR_BINARY_GLTF] = new GLTFBinaryExtension(data); - } catch (error) { - if (onError) onError(error); - return; - } - json = JSON.parse(extensions[EXTENSIONS.KHR_BINARY_GLTF].content); - } else { - json = JSON.parse(textDecoder.decode(data)); - } - } else { - json = data; - } - if (json.asset === void 0 || json.asset.version[0] < 2) { - if (onError) onError(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")); - return; - } - const parser = new GLTFParser(json, { - path: path || this.resourcePath || "", - crossOrigin: this.crossOrigin, - requestHeader: this.requestHeader, - manager: this.manager, - ktx2Loader: this.ktx2Loader, - meshoptDecoder: this.meshoptDecoder - }); - parser.fileLoader.setRequestHeader(this.requestHeader); - for (let i = 0; i < this.pluginCallbacks.length; i++) { - const plugin = this.pluginCallbacks[i](parser); - if (!plugin.name) console.error("THREE.GLTFLoader: Invalid plugin found: missing name"); - plugins[plugin.name] = plugin; - extensions[plugin.name] = true; - } - if (json.extensionsUsed) { - for (let i = 0; i < json.extensionsUsed.length; ++i) { - const extensionName = json.extensionsUsed[i]; - const extensionsRequired = json.extensionsRequired || []; - switch (extensionName) { - case EXTENSIONS.KHR_MATERIALS_UNLIT: - extensions[extensionName] = new GLTFMaterialsUnlitExtension(); - break; - case EXTENSIONS.KHR_DRACO_MESH_COMPRESSION: - extensions[extensionName] = new GLTFDracoMeshCompressionExtension(json, this.dracoLoader); - break; - case EXTENSIONS.KHR_TEXTURE_TRANSFORM: - extensions[extensionName] = new GLTFTextureTransformExtension(); - break; - case EXTENSIONS.KHR_MESH_QUANTIZATION: - extensions[extensionName] = new GLTFMeshQuantizationExtension(); - break; - default: - if (extensionsRequired.indexOf(extensionName) >= 0 && plugins[extensionName] === void 0) { - console.warn('THREE.GLTFLoader: Unknown extension "' + extensionName + '".'); - } - } - } - } - parser.setExtensions(extensions); - parser.setPlugins(plugins); - parser.parse(onLoad, onError); - } - parseAsync(data, path) { - const scope = this; - return new Promise(function(resolve, reject) { - scope.parse(data, path, resolve, reject); - }); - } -} -function GLTFRegistry() { - let objects = {}; - return { - get: /* @__PURE__ */ __name(function(key) { - return objects[key]; - }, "get"), - add: /* @__PURE__ */ __name(function(key, object) { - objects[key] = object; - }, "add"), - remove: /* @__PURE__ */ __name(function(key) { - delete objects[key]; - }, "remove"), - removeAll: /* @__PURE__ */ __name(function() { - objects = {}; - }, "removeAll") - }; -} -__name(GLTFRegistry, "GLTFRegistry"); -const EXTENSIONS = { - KHR_BINARY_GLTF: "KHR_binary_glTF", - KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression", - KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual", - KHR_MATERIALS_CLEARCOAT: "KHR_materials_clearcoat", - KHR_MATERIALS_DISPERSION: "KHR_materials_dispersion", - KHR_MATERIALS_IOR: "KHR_materials_ior", - KHR_MATERIALS_SHEEN: "KHR_materials_sheen", - KHR_MATERIALS_SPECULAR: "KHR_materials_specular", - KHR_MATERIALS_TRANSMISSION: "KHR_materials_transmission", - KHR_MATERIALS_IRIDESCENCE: "KHR_materials_iridescence", - KHR_MATERIALS_ANISOTROPY: "KHR_materials_anisotropy", - KHR_MATERIALS_UNLIT: "KHR_materials_unlit", - KHR_MATERIALS_VOLUME: "KHR_materials_volume", - KHR_TEXTURE_BASISU: "KHR_texture_basisu", - KHR_TEXTURE_TRANSFORM: "KHR_texture_transform", - KHR_MESH_QUANTIZATION: "KHR_mesh_quantization", - KHR_MATERIALS_EMISSIVE_STRENGTH: "KHR_materials_emissive_strength", - EXT_MATERIALS_BUMP: "EXT_materials_bump", - EXT_TEXTURE_WEBP: "EXT_texture_webp", - EXT_TEXTURE_AVIF: "EXT_texture_avif", - EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression", - EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing" -}; -class GLTFLightsExtension { - static { - __name(this, "GLTFLightsExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.KHR_LIGHTS_PUNCTUAL; - this.cache = { refs: {}, uses: {} }; - } - _markDefs() { - const parser = this.parser; - const nodeDefs = this.parser.json.nodes || []; - for (let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex++) { - const nodeDef = nodeDefs[nodeIndex]; - if (nodeDef.extensions && nodeDef.extensions[this.name] && nodeDef.extensions[this.name].light !== void 0) { - parser._addNodeRef(this.cache, nodeDef.extensions[this.name].light); - } - } - } - _loadLight(lightIndex) { - const parser = this.parser; - const cacheKey = "light:" + lightIndex; - let dependency = parser.cache.get(cacheKey); - if (dependency) return dependency; - const json = parser.json; - const extensions = json.extensions && json.extensions[this.name] || {}; - const lightDefs = extensions.lights || []; - const lightDef = lightDefs[lightIndex]; - let lightNode; - const color = new Color(16777215); - if (lightDef.color !== void 0) color.setRGB(lightDef.color[0], lightDef.color[1], lightDef.color[2], LinearSRGBColorSpace); - const range = lightDef.range !== void 0 ? lightDef.range : 0; - switch (lightDef.type) { - case "directional": - lightNode = new DirectionalLight(color); - lightNode.target.position.set(0, 0, -1); - lightNode.add(lightNode.target); - break; - case "point": - lightNode = new PointLight(color); - lightNode.distance = range; - break; - case "spot": - lightNode = new SpotLight(color); - lightNode.distance = range; - lightDef.spot = lightDef.spot || {}; - lightDef.spot.innerConeAngle = lightDef.spot.innerConeAngle !== void 0 ? lightDef.spot.innerConeAngle : 0; - lightDef.spot.outerConeAngle = lightDef.spot.outerConeAngle !== void 0 ? lightDef.spot.outerConeAngle : Math.PI / 4; - lightNode.angle = lightDef.spot.outerConeAngle; - lightNode.penumbra = 1 - lightDef.spot.innerConeAngle / lightDef.spot.outerConeAngle; - lightNode.target.position.set(0, 0, -1); - lightNode.add(lightNode.target); - break; - default: - throw new Error("THREE.GLTFLoader: Unexpected light type: " + lightDef.type); - } - lightNode.position.set(0, 0, 0); - lightNode.decay = 2; - assignExtrasToUserData(lightNode, lightDef); - if (lightDef.intensity !== void 0) lightNode.intensity = lightDef.intensity; - lightNode.name = parser.createUniqueName(lightDef.name || "light_" + lightIndex); - dependency = Promise.resolve(lightNode); - parser.cache.add(cacheKey, dependency); - return dependency; - } - getDependency(type, index) { - if (type !== "light") return; - return this._loadLight(index); - } - createNodeAttachment(nodeIndex) { - const self2 = this; - const parser = this.parser; - const json = parser.json; - const nodeDef = json.nodes[nodeIndex]; - const lightDef = nodeDef.extensions && nodeDef.extensions[this.name] || {}; - const lightIndex = lightDef.light; - if (lightIndex === void 0) return null; - return this._loadLight(lightIndex).then(function(light) { - return parser._getNodeRef(self2.cache, lightIndex, light); - }); - } -} -class GLTFMaterialsUnlitExtension { - static { - __name(this, "GLTFMaterialsUnlitExtension"); - } - constructor() { - this.name = EXTENSIONS.KHR_MATERIALS_UNLIT; - } - getMaterialType() { - return MeshBasicMaterial; - } - extendParams(materialParams, materialDef, parser) { - const pending = []; - materialParams.color = new Color(1, 1, 1); - materialParams.opacity = 1; - const metallicRoughness = materialDef.pbrMetallicRoughness; - if (metallicRoughness) { - if (Array.isArray(metallicRoughness.baseColorFactor)) { - const array = metallicRoughness.baseColorFactor; - materialParams.color.setRGB(array[0], array[1], array[2], LinearSRGBColorSpace); - materialParams.opacity = array[3]; - } - if (metallicRoughness.baseColorTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "map", metallicRoughness.baseColorTexture, SRGBColorSpace)); - } - } - return Promise.all(pending); - } -} -class GLTFMaterialsEmissiveStrengthExtension { - static { - __name(this, "GLTFMaterialsEmissiveStrengthExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_EMISSIVE_STRENGTH; - } - extendMaterialParams(materialIndex, materialParams) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) { - return Promise.resolve(); - } - const emissiveStrength = materialDef.extensions[this.name].emissiveStrength; - if (emissiveStrength !== void 0) { - materialParams.emissiveIntensity = emissiveStrength; - } - return Promise.resolve(); - } -} -class GLTFMaterialsClearcoatExtension { - static { - __name(this, "GLTFMaterialsClearcoatExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_CLEARCOAT; - } - getMaterialType(materialIndex) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) return null; - return MeshPhysicalMaterial; - } - extendMaterialParams(materialIndex, materialParams) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) { - return Promise.resolve(); - } - const pending = []; - const extension = materialDef.extensions[this.name]; - if (extension.clearcoatFactor !== void 0) { - materialParams.clearcoat = extension.clearcoatFactor; - } - if (extension.clearcoatTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "clearcoatMap", extension.clearcoatTexture)); - } - if (extension.clearcoatRoughnessFactor !== void 0) { - materialParams.clearcoatRoughness = extension.clearcoatRoughnessFactor; - } - if (extension.clearcoatRoughnessTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "clearcoatRoughnessMap", extension.clearcoatRoughnessTexture)); - } - if (extension.clearcoatNormalTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "clearcoatNormalMap", extension.clearcoatNormalTexture)); - if (extension.clearcoatNormalTexture.scale !== void 0) { - const scale = extension.clearcoatNormalTexture.scale; - materialParams.clearcoatNormalScale = new Vector2(scale, scale); - } - } - return Promise.all(pending); - } -} -class GLTFMaterialsDispersionExtension { - static { - __name(this, "GLTFMaterialsDispersionExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_DISPERSION; - } - getMaterialType(materialIndex) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) return null; - return MeshPhysicalMaterial; - } - extendMaterialParams(materialIndex, materialParams) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) { - return Promise.resolve(); - } - const extension = materialDef.extensions[this.name]; - materialParams.dispersion = extension.dispersion !== void 0 ? extension.dispersion : 0; - return Promise.resolve(); - } -} -class GLTFMaterialsIridescenceExtension { - static { - __name(this, "GLTFMaterialsIridescenceExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_IRIDESCENCE; - } - getMaterialType(materialIndex) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) return null; - return MeshPhysicalMaterial; - } - extendMaterialParams(materialIndex, materialParams) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) { - return Promise.resolve(); - } - const pending = []; - const extension = materialDef.extensions[this.name]; - if (extension.iridescenceFactor !== void 0) { - materialParams.iridescence = extension.iridescenceFactor; - } - if (extension.iridescenceTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "iridescenceMap", extension.iridescenceTexture)); - } - if (extension.iridescenceIor !== void 0) { - materialParams.iridescenceIOR = extension.iridescenceIor; - } - if (materialParams.iridescenceThicknessRange === void 0) { - materialParams.iridescenceThicknessRange = [100, 400]; - } - if (extension.iridescenceThicknessMinimum !== void 0) { - materialParams.iridescenceThicknessRange[0] = extension.iridescenceThicknessMinimum; - } - if (extension.iridescenceThicknessMaximum !== void 0) { - materialParams.iridescenceThicknessRange[1] = extension.iridescenceThicknessMaximum; - } - if (extension.iridescenceThicknessTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "iridescenceThicknessMap", extension.iridescenceThicknessTexture)); - } - return Promise.all(pending); - } -} -class GLTFMaterialsSheenExtension { - static { - __name(this, "GLTFMaterialsSheenExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_SHEEN; - } - getMaterialType(materialIndex) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) return null; - return MeshPhysicalMaterial; - } - extendMaterialParams(materialIndex, materialParams) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) { - return Promise.resolve(); - } - const pending = []; - materialParams.sheenColor = new Color(0, 0, 0); - materialParams.sheenRoughness = 0; - materialParams.sheen = 1; - const extension = materialDef.extensions[this.name]; - if (extension.sheenColorFactor !== void 0) { - const colorFactor = extension.sheenColorFactor; - materialParams.sheenColor.setRGB(colorFactor[0], colorFactor[1], colorFactor[2], LinearSRGBColorSpace); - } - if (extension.sheenRoughnessFactor !== void 0) { - materialParams.sheenRoughness = extension.sheenRoughnessFactor; - } - if (extension.sheenColorTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "sheenColorMap", extension.sheenColorTexture, SRGBColorSpace)); - } - if (extension.sheenRoughnessTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "sheenRoughnessMap", extension.sheenRoughnessTexture)); - } - return Promise.all(pending); - } -} -class GLTFMaterialsTransmissionExtension { - static { - __name(this, "GLTFMaterialsTransmissionExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_TRANSMISSION; - } - getMaterialType(materialIndex) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) return null; - return MeshPhysicalMaterial; - } - extendMaterialParams(materialIndex, materialParams) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) { - return Promise.resolve(); - } - const pending = []; - const extension = materialDef.extensions[this.name]; - if (extension.transmissionFactor !== void 0) { - materialParams.transmission = extension.transmissionFactor; - } - if (extension.transmissionTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "transmissionMap", extension.transmissionTexture)); - } - return Promise.all(pending); - } -} -class GLTFMaterialsVolumeExtension { - static { - __name(this, "GLTFMaterialsVolumeExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_VOLUME; - } - getMaterialType(materialIndex) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) return null; - return MeshPhysicalMaterial; - } - extendMaterialParams(materialIndex, materialParams) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) { - return Promise.resolve(); - } - const pending = []; - const extension = materialDef.extensions[this.name]; - materialParams.thickness = extension.thicknessFactor !== void 0 ? extension.thicknessFactor : 0; - if (extension.thicknessTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "thicknessMap", extension.thicknessTexture)); - } - materialParams.attenuationDistance = extension.attenuationDistance || Infinity; - const colorArray = extension.attenuationColor || [1, 1, 1]; - materialParams.attenuationColor = new Color().setRGB(colorArray[0], colorArray[1], colorArray[2], LinearSRGBColorSpace); - return Promise.all(pending); - } -} -class GLTFMaterialsIorExtension { - static { - __name(this, "GLTFMaterialsIorExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_IOR; - } - getMaterialType(materialIndex) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) return null; - return MeshPhysicalMaterial; - } - extendMaterialParams(materialIndex, materialParams) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) { - return Promise.resolve(); - } - const extension = materialDef.extensions[this.name]; - materialParams.ior = extension.ior !== void 0 ? extension.ior : 1.5; - return Promise.resolve(); - } -} -class GLTFMaterialsSpecularExtension { - static { - __name(this, "GLTFMaterialsSpecularExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_SPECULAR; - } - getMaterialType(materialIndex) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) return null; - return MeshPhysicalMaterial; - } - extendMaterialParams(materialIndex, materialParams) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) { - return Promise.resolve(); - } - const pending = []; - const extension = materialDef.extensions[this.name]; - materialParams.specularIntensity = extension.specularFactor !== void 0 ? extension.specularFactor : 1; - if (extension.specularTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "specularIntensityMap", extension.specularTexture)); - } - const colorArray = extension.specularColorFactor || [1, 1, 1]; - materialParams.specularColor = new Color().setRGB(colorArray[0], colorArray[1], colorArray[2], LinearSRGBColorSpace); - if (extension.specularColorTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "specularColorMap", extension.specularColorTexture, SRGBColorSpace)); - } - return Promise.all(pending); - } -} -class GLTFMaterialsBumpExtension { - static { - __name(this, "GLTFMaterialsBumpExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.EXT_MATERIALS_BUMP; - } - getMaterialType(materialIndex) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) return null; - return MeshPhysicalMaterial; - } - extendMaterialParams(materialIndex, materialParams) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) { - return Promise.resolve(); - } - const pending = []; - const extension = materialDef.extensions[this.name]; - materialParams.bumpScale = extension.bumpFactor !== void 0 ? extension.bumpFactor : 1; - if (extension.bumpTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "bumpMap", extension.bumpTexture)); - } - return Promise.all(pending); - } -} -class GLTFMaterialsAnisotropyExtension { - static { - __name(this, "GLTFMaterialsAnisotropyExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.KHR_MATERIALS_ANISOTROPY; - } - getMaterialType(materialIndex) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) return null; - return MeshPhysicalMaterial; - } - extendMaterialParams(materialIndex, materialParams) { - const parser = this.parser; - const materialDef = parser.json.materials[materialIndex]; - if (!materialDef.extensions || !materialDef.extensions[this.name]) { - return Promise.resolve(); - } - const pending = []; - const extension = materialDef.extensions[this.name]; - if (extension.anisotropyStrength !== void 0) { - materialParams.anisotropy = extension.anisotropyStrength; - } - if (extension.anisotropyRotation !== void 0) { - materialParams.anisotropyRotation = extension.anisotropyRotation; - } - if (extension.anisotropyTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "anisotropyMap", extension.anisotropyTexture)); - } - return Promise.all(pending); - } -} -class GLTFTextureBasisUExtension { - static { - __name(this, "GLTFTextureBasisUExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.KHR_TEXTURE_BASISU; - } - loadTexture(textureIndex) { - const parser = this.parser; - const json = parser.json; - const textureDef = json.textures[textureIndex]; - if (!textureDef.extensions || !textureDef.extensions[this.name]) { - return null; - } - const extension = textureDef.extensions[this.name]; - const loader = parser.options.ktx2Loader; - if (!loader) { - if (json.extensionsRequired && json.extensionsRequired.indexOf(this.name) >= 0) { - throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures"); - } else { - return null; - } - } - return parser.loadTextureImage(textureIndex, extension.source, loader); - } -} -class GLTFTextureWebPExtension { - static { - __name(this, "GLTFTextureWebPExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.EXT_TEXTURE_WEBP; - this.isSupported = null; - } - loadTexture(textureIndex) { - const name = this.name; - const parser = this.parser; - const json = parser.json; - const textureDef = json.textures[textureIndex]; - if (!textureDef.extensions || !textureDef.extensions[name]) { - return null; - } - const extension = textureDef.extensions[name]; - const source = json.images[extension.source]; - let loader = parser.textureLoader; - if (source.uri) { - const handler = parser.options.manager.getHandler(source.uri); - if (handler !== null) loader = handler; - } - return this.detectSupport().then(function(isSupported) { - if (isSupported) return parser.loadTextureImage(textureIndex, extension.source, loader); - if (json.extensionsRequired && json.extensionsRequired.indexOf(name) >= 0) { - throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported."); - } - return parser.loadTexture(textureIndex); - }); - } - detectSupport() { - if (!this.isSupported) { - this.isSupported = new Promise(function(resolve) { - const image = new Image(); - image.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"; - image.onload = image.onerror = function() { - resolve(image.height === 1); - }; - }); - } - return this.isSupported; - } -} -class GLTFTextureAVIFExtension { - static { - __name(this, "GLTFTextureAVIFExtension"); - } - constructor(parser) { - this.parser = parser; - this.name = EXTENSIONS.EXT_TEXTURE_AVIF; - this.isSupported = null; - } - loadTexture(textureIndex) { - const name = this.name; - const parser = this.parser; - const json = parser.json; - const textureDef = json.textures[textureIndex]; - if (!textureDef.extensions || !textureDef.extensions[name]) { - return null; - } - const extension = textureDef.extensions[name]; - const source = json.images[extension.source]; - let loader = parser.textureLoader; - if (source.uri) { - const handler = parser.options.manager.getHandler(source.uri); - if (handler !== null) loader = handler; - } - return this.detectSupport().then(function(isSupported) { - if (isSupported) return parser.loadTextureImage(textureIndex, extension.source, loader); - if (json.extensionsRequired && json.extensionsRequired.indexOf(name) >= 0) { - throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported."); - } - return parser.loadTexture(textureIndex); - }); - } - detectSupport() { - if (!this.isSupported) { - this.isSupported = new Promise(function(resolve) { - const image = new Image(); - image.src = "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI="; - image.onload = image.onerror = function() { - resolve(image.height === 1); - }; - }); - } - return this.isSupported; - } -} -class GLTFMeshoptCompression { - static { - __name(this, "GLTFMeshoptCompression"); - } - constructor(parser) { - this.name = EXTENSIONS.EXT_MESHOPT_COMPRESSION; - this.parser = parser; - } - loadBufferView(index) { - const json = this.parser.json; - const bufferView = json.bufferViews[index]; - if (bufferView.extensions && bufferView.extensions[this.name]) { - const extensionDef = bufferView.extensions[this.name]; - const buffer = this.parser.getDependency("buffer", extensionDef.buffer); - const decoder = this.parser.options.meshoptDecoder; - if (!decoder || !decoder.supported) { - if (json.extensionsRequired && json.extensionsRequired.indexOf(this.name) >= 0) { - throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files"); - } else { - return null; - } - } - return buffer.then(function(res) { - const byteOffset = extensionDef.byteOffset || 0; - const byteLength = extensionDef.byteLength || 0; - const count = extensionDef.count; - const stride = extensionDef.byteStride; - const source = new Uint8Array(res, byteOffset, byteLength); - if (decoder.decodeGltfBufferAsync) { - return decoder.decodeGltfBufferAsync(count, stride, source, extensionDef.mode, extensionDef.filter).then(function(res2) { - return res2.buffer; - }); - } else { - return decoder.ready.then(function() { - const result = new ArrayBuffer(count * stride); - decoder.decodeGltfBuffer(new Uint8Array(result), count, stride, source, extensionDef.mode, extensionDef.filter); - return result; - }); - } - }); - } else { - return null; - } - } -} -class GLTFMeshGpuInstancing { - static { - __name(this, "GLTFMeshGpuInstancing"); - } - constructor(parser) { - this.name = EXTENSIONS.EXT_MESH_GPU_INSTANCING; - this.parser = parser; - } - createNodeMesh(nodeIndex) { - const json = this.parser.json; - const nodeDef = json.nodes[nodeIndex]; - if (!nodeDef.extensions || !nodeDef.extensions[this.name] || nodeDef.mesh === void 0) { - return null; - } - const meshDef = json.meshes[nodeDef.mesh]; - for (const primitive of meshDef.primitives) { - if (primitive.mode !== WEBGL_CONSTANTS.TRIANGLES && primitive.mode !== WEBGL_CONSTANTS.TRIANGLE_STRIP && primitive.mode !== WEBGL_CONSTANTS.TRIANGLE_FAN && primitive.mode !== void 0) { - return null; - } - } - const extensionDef = nodeDef.extensions[this.name]; - const attributesDef = extensionDef.attributes; - const pending = []; - const attributes = {}; - for (const key in attributesDef) { - pending.push(this.parser.getDependency("accessor", attributesDef[key]).then((accessor) => { - attributes[key] = accessor; - return attributes[key]; - })); - } - if (pending.length < 1) { - return null; - } - pending.push(this.parser.createNodeMesh(nodeIndex)); - return Promise.all(pending).then((results) => { - const nodeObject = results.pop(); - const meshes = nodeObject.isGroup ? nodeObject.children : [nodeObject]; - const count = results[0].count; - const instancedMeshes = []; - for (const mesh of meshes) { - const m = new Matrix4(); - const p = new Vector3(); - const q = new Quaternion(); - const s = new Vector3(1, 1, 1); - const instancedMesh = new InstancedMesh(mesh.geometry, mesh.material, count); - for (let i = 0; i < count; i++) { - if (attributes.TRANSLATION) { - p.fromBufferAttribute(attributes.TRANSLATION, i); - } - if (attributes.ROTATION) { - q.fromBufferAttribute(attributes.ROTATION, i); - } - if (attributes.SCALE) { - s.fromBufferAttribute(attributes.SCALE, i); - } - instancedMesh.setMatrixAt(i, m.compose(p, q, s)); - } - for (const attributeName in attributes) { - if (attributeName === "_COLOR_0") { - const attr = attributes[attributeName]; - instancedMesh.instanceColor = new InstancedBufferAttribute(attr.array, attr.itemSize, attr.normalized); - } else if (attributeName !== "TRANSLATION" && attributeName !== "ROTATION" && attributeName !== "SCALE") { - mesh.geometry.setAttribute(attributeName, attributes[attributeName]); - } - } - Object3D.prototype.copy.call(instancedMesh, mesh); - this.parser.assignFinalMaterial(instancedMesh); - instancedMeshes.push(instancedMesh); - } - if (nodeObject.isGroup) { - nodeObject.clear(); - nodeObject.add(...instancedMeshes); - return nodeObject; - } - return instancedMeshes[0]; - }); - } -} -const BINARY_EXTENSION_HEADER_MAGIC = "glTF"; -const BINARY_EXTENSION_HEADER_LENGTH = 12; -const BINARY_EXTENSION_CHUNK_TYPES = { JSON: 1313821514, BIN: 5130562 }; -class GLTFBinaryExtension { - static { - __name(this, "GLTFBinaryExtension"); - } - constructor(data) { - this.name = EXTENSIONS.KHR_BINARY_GLTF; - this.content = null; - this.body = null; - const headerView = new DataView(data, 0, BINARY_EXTENSION_HEADER_LENGTH); - const textDecoder = new TextDecoder(); - this.header = { - magic: textDecoder.decode(new Uint8Array(data.slice(0, 4))), - version: headerView.getUint32(4, true), - length: headerView.getUint32(8, true) - }; - if (this.header.magic !== BINARY_EXTENSION_HEADER_MAGIC) { - throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header."); - } else if (this.header.version < 2) { - throw new Error("THREE.GLTFLoader: Legacy binary file detected."); - } - const chunkContentsLength = this.header.length - BINARY_EXTENSION_HEADER_LENGTH; - const chunkView = new DataView(data, BINARY_EXTENSION_HEADER_LENGTH); - let chunkIndex = 0; - while (chunkIndex < chunkContentsLength) { - const chunkLength = chunkView.getUint32(chunkIndex, true); - chunkIndex += 4; - const chunkType = chunkView.getUint32(chunkIndex, true); - chunkIndex += 4; - if (chunkType === BINARY_EXTENSION_CHUNK_TYPES.JSON) { - const contentArray = new Uint8Array(data, BINARY_EXTENSION_HEADER_LENGTH + chunkIndex, chunkLength); - this.content = textDecoder.decode(contentArray); - } else if (chunkType === BINARY_EXTENSION_CHUNK_TYPES.BIN) { - const byteOffset = BINARY_EXTENSION_HEADER_LENGTH + chunkIndex; - this.body = data.slice(byteOffset, byteOffset + chunkLength); - } - chunkIndex += chunkLength; - } - if (this.content === null) { - throw new Error("THREE.GLTFLoader: JSON content not found."); - } - } -} -class GLTFDracoMeshCompressionExtension { - static { - __name(this, "GLTFDracoMeshCompressionExtension"); - } - constructor(json, dracoLoader) { - if (!dracoLoader) { - throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided."); - } - this.name = EXTENSIONS.KHR_DRACO_MESH_COMPRESSION; - this.json = json; - this.dracoLoader = dracoLoader; - this.dracoLoader.preload(); - } - decodePrimitive(primitive, parser) { - const json = this.json; - const dracoLoader = this.dracoLoader; - const bufferViewIndex = primitive.extensions[this.name].bufferView; - const gltfAttributeMap = primitive.extensions[this.name].attributes; - const threeAttributeMap = {}; - const attributeNormalizedMap = {}; - const attributeTypeMap = {}; - for (const attributeName in gltfAttributeMap) { - const threeAttributeName = ATTRIBUTES[attributeName] || attributeName.toLowerCase(); - threeAttributeMap[threeAttributeName] = gltfAttributeMap[attributeName]; - } - for (const attributeName in primitive.attributes) { - const threeAttributeName = ATTRIBUTES[attributeName] || attributeName.toLowerCase(); - if (gltfAttributeMap[attributeName] !== void 0) { - const accessorDef = json.accessors[primitive.attributes[attributeName]]; - const componentType = WEBGL_COMPONENT_TYPES[accessorDef.componentType]; - attributeTypeMap[threeAttributeName] = componentType.name; - attributeNormalizedMap[threeAttributeName] = accessorDef.normalized === true; - } - } - return parser.getDependency("bufferView", bufferViewIndex).then(function(bufferView) { - return new Promise(function(resolve, reject) { - dracoLoader.decodeDracoFile(bufferView, function(geometry) { - for (const attributeName in geometry.attributes) { - const attribute = geometry.attributes[attributeName]; - const normalized = attributeNormalizedMap[attributeName]; - if (normalized !== void 0) attribute.normalized = normalized; - } - resolve(geometry); - }, threeAttributeMap, attributeTypeMap, LinearSRGBColorSpace, reject); - }); - }); - } -} -class GLTFTextureTransformExtension { - static { - __name(this, "GLTFTextureTransformExtension"); - } - constructor() { - this.name = EXTENSIONS.KHR_TEXTURE_TRANSFORM; - } - extendTexture(texture, transform) { - if ((transform.texCoord === void 0 || transform.texCoord === texture.channel) && transform.offset === void 0 && transform.rotation === void 0 && transform.scale === void 0) { - return texture; - } - texture = texture.clone(); - if (transform.texCoord !== void 0) { - texture.channel = transform.texCoord; - } - if (transform.offset !== void 0) { - texture.offset.fromArray(transform.offset); - } - if (transform.rotation !== void 0) { - texture.rotation = transform.rotation; - } - if (transform.scale !== void 0) { - texture.repeat.fromArray(transform.scale); - } - texture.needsUpdate = true; - return texture; - } -} -class GLTFMeshQuantizationExtension { - static { - __name(this, "GLTFMeshQuantizationExtension"); - } - constructor() { - this.name = EXTENSIONS.KHR_MESH_QUANTIZATION; - } -} -class GLTFCubicSplineInterpolant extends Interpolant { - static { - __name(this, "GLTFCubicSplineInterpolant"); - } - constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) { - super(parameterPositions, sampleValues, sampleSize, resultBuffer); - } - copySampleValue_(index) { - const result = this.resultBuffer, values = this.sampleValues, valueSize = this.valueSize, offset = index * valueSize * 3 + valueSize; - for (let i = 0; i !== valueSize; i++) { - result[i] = values[offset + i]; - } - return result; - } - interpolate_(i1, t0, t2, t1) { - const result = this.resultBuffer; - const values = this.sampleValues; - const stride = this.valueSize; - const stride2 = stride * 2; - const stride3 = stride * 3; - const td2 = t1 - t0; - const p = (t2 - t0) / td2; - const pp = p * p; - const ppp = pp * p; - const offset1 = i1 * stride3; - const offset0 = offset1 - stride3; - const s2 = -2 * ppp + 3 * pp; - const s3 = ppp - pp; - const s0 = 1 - s2; - const s1 = s3 - pp + p; - for (let i = 0; i !== stride; i++) { - const p0 = values[offset0 + i + stride]; - const m0 = values[offset0 + i + stride2] * td2; - const p1 = values[offset1 + i + stride]; - const m1 = values[offset1 + i] * td2; - result[i] = s0 * p0 + s1 * m0 + s2 * p1 + s3 * m1; - } - return result; - } -} -const _q = new Quaternion(); -class GLTFCubicSplineQuaternionInterpolant extends GLTFCubicSplineInterpolant { - static { - __name(this, "GLTFCubicSplineQuaternionInterpolant"); - } - interpolate_(i1, t0, t2, t1) { - const result = super.interpolate_(i1, t0, t2, t1); - _q.fromArray(result).normalize().toArray(result); - return result; - } -} -const WEBGL_CONSTANTS = { - FLOAT: 5126, - //FLOAT_MAT2: 35674, - FLOAT_MAT3: 35675, - FLOAT_MAT4: 35676, - FLOAT_VEC2: 35664, - FLOAT_VEC3: 35665, - FLOAT_VEC4: 35666, - LINEAR: 9729, - REPEAT: 10497, - SAMPLER_2D: 35678, - POINTS: 0, - LINES: 1, - LINE_LOOP: 2, - LINE_STRIP: 3, - TRIANGLES: 4, - TRIANGLE_STRIP: 5, - TRIANGLE_FAN: 6, - UNSIGNED_BYTE: 5121, - UNSIGNED_SHORT: 5123 -}; -const WEBGL_COMPONENT_TYPES = { - 5120: Int8Array, - 5121: Uint8Array, - 5122: Int16Array, - 5123: Uint16Array, - 5125: Uint32Array, - 5126: Float32Array -}; -const WEBGL_FILTERS = { - 9728: NearestFilter, - 9729: LinearFilter, - 9984: NearestMipmapNearestFilter, - 9985: LinearMipmapNearestFilter, - 9986: NearestMipmapLinearFilter, - 9987: LinearMipmapLinearFilter -}; -const WEBGL_WRAPPINGS = { - 33071: ClampToEdgeWrapping, - 33648: MirroredRepeatWrapping, - 10497: RepeatWrapping -}; -const WEBGL_TYPE_SIZES = { - "SCALAR": 1, - "VEC2": 2, - "VEC3": 3, - "VEC4": 4, - "MAT2": 4, - "MAT3": 9, - "MAT4": 16 -}; -const ATTRIBUTES = { - POSITION: "position", - NORMAL: "normal", - TANGENT: "tangent", - TEXCOORD_0: "uv", - TEXCOORD_1: "uv1", - TEXCOORD_2: "uv2", - TEXCOORD_3: "uv3", - COLOR_0: "color", - WEIGHTS_0: "skinWeight", - JOINTS_0: "skinIndex" -}; -const PATH_PROPERTIES = { - scale: "scale", - translation: "position", - rotation: "quaternion", - weights: "morphTargetInfluences" -}; -const INTERPOLATION = { - CUBICSPLINE: void 0, - // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each - // keyframe track will be initialized with a default interpolation type, then modified. - LINEAR: InterpolateLinear, - STEP: InterpolateDiscrete -}; -const ALPHA_MODES = { - OPAQUE: "OPAQUE", - MASK: "MASK", - BLEND: "BLEND" -}; -function createDefaultMaterial(cache) { - if (cache["DefaultMaterial"] === void 0) { - cache["DefaultMaterial"] = new MeshStandardMaterial({ - color: 16777215, - emissive: 0, - metalness: 1, - roughness: 1, - transparent: false, - depthTest: true, - side: FrontSide - }); - } - return cache["DefaultMaterial"]; -} -__name(createDefaultMaterial, "createDefaultMaterial"); -function addUnknownExtensionsToUserData(knownExtensions, object, objectDef) { - for (const name in objectDef.extensions) { - if (knownExtensions[name] === void 0) { - object.userData.gltfExtensions = object.userData.gltfExtensions || {}; - object.userData.gltfExtensions[name] = objectDef.extensions[name]; - } - } -} -__name(addUnknownExtensionsToUserData, "addUnknownExtensionsToUserData"); -function assignExtrasToUserData(object, gltfDef) { - if (gltfDef.extras !== void 0) { - if (typeof gltfDef.extras === "object") { - Object.assign(object.userData, gltfDef.extras); - } else { - console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + gltfDef.extras); - } - } -} -__name(assignExtrasToUserData, "assignExtrasToUserData"); -function addMorphTargets(geometry, targets, parser) { - let hasMorphPosition = false; - let hasMorphNormal = false; - let hasMorphColor = false; - for (let i = 0, il = targets.length; i < il; i++) { - const target = targets[i]; - if (target.POSITION !== void 0) hasMorphPosition = true; - if (target.NORMAL !== void 0) hasMorphNormal = true; - if (target.COLOR_0 !== void 0) hasMorphColor = true; - if (hasMorphPosition && hasMorphNormal && hasMorphColor) break; - } - if (!hasMorphPosition && !hasMorphNormal && !hasMorphColor) return Promise.resolve(geometry); - const pendingPositionAccessors = []; - const pendingNormalAccessors = []; - const pendingColorAccessors = []; - for (let i = 0, il = targets.length; i < il; i++) { - const target = targets[i]; - if (hasMorphPosition) { - const pendingAccessor = target.POSITION !== void 0 ? parser.getDependency("accessor", target.POSITION) : geometry.attributes.position; - pendingPositionAccessors.push(pendingAccessor); - } - if (hasMorphNormal) { - const pendingAccessor = target.NORMAL !== void 0 ? parser.getDependency("accessor", target.NORMAL) : geometry.attributes.normal; - pendingNormalAccessors.push(pendingAccessor); - } - if (hasMorphColor) { - const pendingAccessor = target.COLOR_0 !== void 0 ? parser.getDependency("accessor", target.COLOR_0) : geometry.attributes.color; - pendingColorAccessors.push(pendingAccessor); - } - } - return Promise.all([ - Promise.all(pendingPositionAccessors), - Promise.all(pendingNormalAccessors), - Promise.all(pendingColorAccessors) - ]).then(function(accessors) { - const morphPositions = accessors[0]; - const morphNormals = accessors[1]; - const morphColors = accessors[2]; - if (hasMorphPosition) geometry.morphAttributes.position = morphPositions; - if (hasMorphNormal) geometry.morphAttributes.normal = morphNormals; - if (hasMorphColor) geometry.morphAttributes.color = morphColors; - geometry.morphTargetsRelative = true; - return geometry; - }); -} -__name(addMorphTargets, "addMorphTargets"); -function updateMorphTargets(mesh, meshDef) { - mesh.updateMorphTargets(); - if (meshDef.weights !== void 0) { - for (let i = 0, il = meshDef.weights.length; i < il; i++) { - mesh.morphTargetInfluences[i] = meshDef.weights[i]; - } - } - if (meshDef.extras && Array.isArray(meshDef.extras.targetNames)) { - const targetNames = meshDef.extras.targetNames; - if (mesh.morphTargetInfluences.length === targetNames.length) { - mesh.morphTargetDictionary = {}; - for (let i = 0, il = targetNames.length; i < il; i++) { - mesh.morphTargetDictionary[targetNames[i]] = i; - } - } else { - console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names."); - } - } -} -__name(updateMorphTargets, "updateMorphTargets"); -function createPrimitiveKey(primitiveDef) { - let geometryKey; - const dracoExtension = primitiveDef.extensions && primitiveDef.extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION]; - if (dracoExtension) { - geometryKey = "draco:" + dracoExtension.bufferView + ":" + dracoExtension.indices + ":" + createAttributesKey(dracoExtension.attributes); - } else { - geometryKey = primitiveDef.indices + ":" + createAttributesKey(primitiveDef.attributes) + ":" + primitiveDef.mode; - } - if (primitiveDef.targets !== void 0) { - for (let i = 0, il = primitiveDef.targets.length; i < il; i++) { - geometryKey += ":" + createAttributesKey(primitiveDef.targets[i]); - } - } - return geometryKey; -} -__name(createPrimitiveKey, "createPrimitiveKey"); -function createAttributesKey(attributes) { - let attributesKey = ""; - const keys = Object.keys(attributes).sort(); - for (let i = 0, il = keys.length; i < il; i++) { - attributesKey += keys[i] + ":" + attributes[keys[i]] + ";"; - } - return attributesKey; -} -__name(createAttributesKey, "createAttributesKey"); -function getNormalizedComponentScale(constructor) { - switch (constructor) { - case Int8Array: - return 1 / 127; - case Uint8Array: - return 1 / 255; - case Int16Array: - return 1 / 32767; - case Uint16Array: - return 1 / 65535; - default: - throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type."); - } -} -__name(getNormalizedComponentScale, "getNormalizedComponentScale"); -function getImageURIMimeType(uri) { - if (uri.search(/\.jpe?g($|\?)/i) > 0 || uri.search(/^data\:image\/jpeg/) === 0) return "image/jpeg"; - if (uri.search(/\.webp($|\?)/i) > 0 || uri.search(/^data\:image\/webp/) === 0) return "image/webp"; - if (uri.search(/\.ktx2($|\?)/i) > 0 || uri.search(/^data\:image\/ktx2/) === 0) return "image/ktx2"; - return "image/png"; -} -__name(getImageURIMimeType, "getImageURIMimeType"); -const _identityMatrix = new Matrix4(); -class GLTFParser { - static { - __name(this, "GLTFParser"); - } - constructor(json = {}, options = {}) { - this.json = json; - this.extensions = {}; - this.plugins = {}; - this.options = options; - this.cache = new GLTFRegistry(); - this.associations = /* @__PURE__ */ new Map(); - this.primitiveCache = {}; - this.nodeCache = {}; - this.meshCache = { refs: {}, uses: {} }; - this.cameraCache = { refs: {}, uses: {} }; - this.lightCache = { refs: {}, uses: {} }; - this.sourceCache = {}; - this.textureCache = {}; - this.nodeNamesUsed = {}; - let isSafari = false; - let safariVersion = -1; - let isFirefox = false; - let firefoxVersion = -1; - if (typeof navigator !== "undefined") { - const userAgent = navigator.userAgent; - isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) === true; - const safariMatch = userAgent.match(/Version\/(\d+)/); - safariVersion = isSafari && safariMatch ? parseInt(safariMatch[1], 10) : -1; - isFirefox = userAgent.indexOf("Firefox") > -1; - firefoxVersion = isFirefox ? userAgent.match(/Firefox\/([0-9]+)\./)[1] : -1; - } - if (typeof createImageBitmap === "undefined" || isSafari && safariVersion < 17 || isFirefox && firefoxVersion < 98) { - this.textureLoader = new TextureLoader(this.options.manager); - } else { - this.textureLoader = new ImageBitmapLoader(this.options.manager); - } - this.textureLoader.setCrossOrigin(this.options.crossOrigin); - this.textureLoader.setRequestHeader(this.options.requestHeader); - this.fileLoader = new FileLoader(this.options.manager); - this.fileLoader.setResponseType("arraybuffer"); - if (this.options.crossOrigin === "use-credentials") { - this.fileLoader.setWithCredentials(true); - } - } - setExtensions(extensions) { - this.extensions = extensions; - } - setPlugins(plugins) { - this.plugins = plugins; - } - parse(onLoad, onError) { - const parser = this; - const json = this.json; - const extensions = this.extensions; - this.cache.removeAll(); - this.nodeCache = {}; - this._invokeAll(function(ext2) { - return ext2._markDefs && ext2._markDefs(); - }); - Promise.all(this._invokeAll(function(ext2) { - return ext2.beforeRoot && ext2.beforeRoot(); - })).then(function() { - return Promise.all([ - parser.getDependencies("scene"), - parser.getDependencies("animation"), - parser.getDependencies("camera") - ]); - }).then(function(dependencies) { - const result = { - scene: dependencies[0][json.scene || 0], - scenes: dependencies[0], - animations: dependencies[1], - cameras: dependencies[2], - asset: json.asset, - parser, - userData: {} - }; - addUnknownExtensionsToUserData(extensions, result, json); - assignExtrasToUserData(result, json); - return Promise.all(parser._invokeAll(function(ext2) { - return ext2.afterRoot && ext2.afterRoot(result); - })).then(function() { - for (const scene of result.scenes) { - scene.updateMatrixWorld(); - } - onLoad(result); - }); - }).catch(onError); - } - /** - * Marks the special nodes/meshes in json for efficient parse. - */ - _markDefs() { - const nodeDefs = this.json.nodes || []; - const skinDefs = this.json.skins || []; - const meshDefs = this.json.meshes || []; - for (let skinIndex = 0, skinLength = skinDefs.length; skinIndex < skinLength; skinIndex++) { - const joints = skinDefs[skinIndex].joints; - for (let i = 0, il = joints.length; i < il; i++) { - nodeDefs[joints[i]].isBone = true; - } - } - for (let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex++) { - const nodeDef = nodeDefs[nodeIndex]; - if (nodeDef.mesh !== void 0) { - this._addNodeRef(this.meshCache, nodeDef.mesh); - if (nodeDef.skin !== void 0) { - meshDefs[nodeDef.mesh].isSkinnedMesh = true; - } - } - if (nodeDef.camera !== void 0) { - this._addNodeRef(this.cameraCache, nodeDef.camera); - } - } - } - /** - * Counts references to shared node / Object3D resources. These resources - * can be reused, or "instantiated", at multiple nodes in the scene - * hierarchy. Mesh, Camera, and Light instances are instantiated and must - * be marked. Non-scenegraph resources (like Materials, Geometries, and - * Textures) can be reused directly and are not marked here. - * - * Example: CesiumMilkTruck sample model reuses "Wheel" meshes. - */ - _addNodeRef(cache, index) { - if (index === void 0) return; - if (cache.refs[index] === void 0) { - cache.refs[index] = cache.uses[index] = 0; - } - cache.refs[index]++; - } - /** Returns a reference to a shared resource, cloning it if necessary. */ - _getNodeRef(cache, index, object) { - if (cache.refs[index] <= 1) return object; - const ref2 = object.clone(); - const updateMappings = /* @__PURE__ */ __name((original, clone) => { - const mappings = this.associations.get(original); - if (mappings != null) { - this.associations.set(clone, mappings); - } - for (const [i, child] of original.children.entries()) { - updateMappings(child, clone.children[i]); - } - }, "updateMappings"); - updateMappings(object, ref2); - ref2.name += "_instance_" + cache.uses[index]++; - return ref2; - } - _invokeOne(func) { - const extensions = Object.values(this.plugins); - extensions.push(this); - for (let i = 0; i < extensions.length; i++) { - const result = func(extensions[i]); - if (result) return result; - } - return null; - } - _invokeAll(func) { - const extensions = Object.values(this.plugins); - extensions.unshift(this); - const pending = []; - for (let i = 0; i < extensions.length; i++) { - const result = func(extensions[i]); - if (result) pending.push(result); - } - return pending; - } - /** - * Requests the specified dependency asynchronously, with caching. - * @param {string} type - * @param {number} index - * @return {Promise} - */ - getDependency(type, index) { - const cacheKey = type + ":" + index; - let dependency = this.cache.get(cacheKey); - if (!dependency) { - switch (type) { - case "scene": - dependency = this.loadScene(index); - break; - case "node": - dependency = this._invokeOne(function(ext2) { - return ext2.loadNode && ext2.loadNode(index); - }); - break; - case "mesh": - dependency = this._invokeOne(function(ext2) { - return ext2.loadMesh && ext2.loadMesh(index); - }); - break; - case "accessor": - dependency = this.loadAccessor(index); - break; - case "bufferView": - dependency = this._invokeOne(function(ext2) { - return ext2.loadBufferView && ext2.loadBufferView(index); - }); - break; - case "buffer": - dependency = this.loadBuffer(index); - break; - case "material": - dependency = this._invokeOne(function(ext2) { - return ext2.loadMaterial && ext2.loadMaterial(index); - }); - break; - case "texture": - dependency = this._invokeOne(function(ext2) { - return ext2.loadTexture && ext2.loadTexture(index); - }); - break; - case "skin": - dependency = this.loadSkin(index); - break; - case "animation": - dependency = this._invokeOne(function(ext2) { - return ext2.loadAnimation && ext2.loadAnimation(index); - }); - break; - case "camera": - dependency = this.loadCamera(index); - break; - default: - dependency = this._invokeOne(function(ext2) { - return ext2 != this && ext2.getDependency && ext2.getDependency(type, index); - }); - if (!dependency) { - throw new Error("Unknown type: " + type); - } - break; - } - this.cache.add(cacheKey, dependency); - } - return dependency; - } - /** - * Requests all dependencies of the specified type asynchronously, with caching. - * @param {string} type - * @return {Promise>} - */ - getDependencies(type) { - let dependencies = this.cache.get(type); - if (!dependencies) { - const parser = this; - const defs = this.json[type + (type === "mesh" ? "es" : "s")] || []; - dependencies = Promise.all(defs.map(function(def, index) { - return parser.getDependency(type, index); - })); - this.cache.add(type, dependencies); - } - return dependencies; - } - /** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views - * @param {number} bufferIndex - * @return {Promise} - */ - loadBuffer(bufferIndex) { - const bufferDef = this.json.buffers[bufferIndex]; - const loader = this.fileLoader; - if (bufferDef.type && bufferDef.type !== "arraybuffer") { - throw new Error("THREE.GLTFLoader: " + bufferDef.type + " buffer type is not supported."); - } - if (bufferDef.uri === void 0 && bufferIndex === 0) { - return Promise.resolve(this.extensions[EXTENSIONS.KHR_BINARY_GLTF].body); - } - const options = this.options; - return new Promise(function(resolve, reject) { - loader.load(LoaderUtils.resolveURL(bufferDef.uri, options.path), resolve, void 0, function() { - reject(new Error('THREE.GLTFLoader: Failed to load buffer "' + bufferDef.uri + '".')); - }); - }); - } - /** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views - * @param {number} bufferViewIndex - * @return {Promise} - */ - loadBufferView(bufferViewIndex) { - const bufferViewDef = this.json.bufferViews[bufferViewIndex]; - return this.getDependency("buffer", bufferViewDef.buffer).then(function(buffer) { - const byteLength = bufferViewDef.byteLength || 0; - const byteOffset = bufferViewDef.byteOffset || 0; - return buffer.slice(byteOffset, byteOffset + byteLength); - }); - } - /** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors - * @param {number} accessorIndex - * @return {Promise} - */ - loadAccessor(accessorIndex) { - const parser = this; - const json = this.json; - const accessorDef = this.json.accessors[accessorIndex]; - if (accessorDef.bufferView === void 0 && accessorDef.sparse === void 0) { - const itemSize = WEBGL_TYPE_SIZES[accessorDef.type]; - const TypedArray = WEBGL_COMPONENT_TYPES[accessorDef.componentType]; - const normalized = accessorDef.normalized === true; - const array = new TypedArray(accessorDef.count * itemSize); - return Promise.resolve(new BufferAttribute(array, itemSize, normalized)); - } - const pendingBufferViews = []; - if (accessorDef.bufferView !== void 0) { - pendingBufferViews.push(this.getDependency("bufferView", accessorDef.bufferView)); - } else { - pendingBufferViews.push(null); - } - if (accessorDef.sparse !== void 0) { - pendingBufferViews.push(this.getDependency("bufferView", accessorDef.sparse.indices.bufferView)); - pendingBufferViews.push(this.getDependency("bufferView", accessorDef.sparse.values.bufferView)); - } - return Promise.all(pendingBufferViews).then(function(bufferViews) { - const bufferView = bufferViews[0]; - const itemSize = WEBGL_TYPE_SIZES[accessorDef.type]; - const TypedArray = WEBGL_COMPONENT_TYPES[accessorDef.componentType]; - const elementBytes = TypedArray.BYTES_PER_ELEMENT; - const itemBytes = elementBytes * itemSize; - const byteOffset = accessorDef.byteOffset || 0; - const byteStride = accessorDef.bufferView !== void 0 ? json.bufferViews[accessorDef.bufferView].byteStride : void 0; - const normalized = accessorDef.normalized === true; - let array, bufferAttribute; - if (byteStride && byteStride !== itemBytes) { - const ibSlice = Math.floor(byteOffset / byteStride); - const ibCacheKey = "InterleavedBuffer:" + accessorDef.bufferView + ":" + accessorDef.componentType + ":" + ibSlice + ":" + accessorDef.count; - let ib = parser.cache.get(ibCacheKey); - if (!ib) { - array = new TypedArray(bufferView, ibSlice * byteStride, accessorDef.count * byteStride / elementBytes); - ib = new InterleavedBuffer(array, byteStride / elementBytes); - parser.cache.add(ibCacheKey, ib); - } - bufferAttribute = new InterleavedBufferAttribute(ib, itemSize, byteOffset % byteStride / elementBytes, normalized); - } else { - if (bufferView === null) { - array = new TypedArray(accessorDef.count * itemSize); - } else { - array = new TypedArray(bufferView, byteOffset, accessorDef.count * itemSize); - } - bufferAttribute = new BufferAttribute(array, itemSize, normalized); - } - if (accessorDef.sparse !== void 0) { - const itemSizeIndices = WEBGL_TYPE_SIZES.SCALAR; - const TypedArrayIndices = WEBGL_COMPONENT_TYPES[accessorDef.sparse.indices.componentType]; - const byteOffsetIndices = accessorDef.sparse.indices.byteOffset || 0; - const byteOffsetValues = accessorDef.sparse.values.byteOffset || 0; - const sparseIndices = new TypedArrayIndices(bufferViews[1], byteOffsetIndices, accessorDef.sparse.count * itemSizeIndices); - const sparseValues = new TypedArray(bufferViews[2], byteOffsetValues, accessorDef.sparse.count * itemSize); - if (bufferView !== null) { - bufferAttribute = new BufferAttribute(bufferAttribute.array.slice(), bufferAttribute.itemSize, bufferAttribute.normalized); - } - bufferAttribute.normalized = false; - for (let i = 0, il = sparseIndices.length; i < il; i++) { - const index = sparseIndices[i]; - bufferAttribute.setX(index, sparseValues[i * itemSize]); - if (itemSize >= 2) bufferAttribute.setY(index, sparseValues[i * itemSize + 1]); - if (itemSize >= 3) bufferAttribute.setZ(index, sparseValues[i * itemSize + 2]); - if (itemSize >= 4) bufferAttribute.setW(index, sparseValues[i * itemSize + 3]); - if (itemSize >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute."); - } - bufferAttribute.normalized = normalized; - } - return bufferAttribute; - }); - } - /** - * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures - * @param {number} textureIndex - * @return {Promise} - */ - loadTexture(textureIndex) { - const json = this.json; - const options = this.options; - const textureDef = json.textures[textureIndex]; - const sourceIndex = textureDef.source; - const sourceDef = json.images[sourceIndex]; - let loader = this.textureLoader; - if (sourceDef.uri) { - const handler = options.manager.getHandler(sourceDef.uri); - if (handler !== null) loader = handler; - } - return this.loadTextureImage(textureIndex, sourceIndex, loader); - } - loadTextureImage(textureIndex, sourceIndex, loader) { - const parser = this; - const json = this.json; - const textureDef = json.textures[textureIndex]; - const sourceDef = json.images[sourceIndex]; - const cacheKey = (sourceDef.uri || sourceDef.bufferView) + ":" + textureDef.sampler; - if (this.textureCache[cacheKey]) { - return this.textureCache[cacheKey]; - } - const promise = this.loadImageSource(sourceIndex, loader).then(function(texture) { - texture.flipY = false; - texture.name = textureDef.name || sourceDef.name || ""; - if (texture.name === "" && typeof sourceDef.uri === "string" && sourceDef.uri.startsWith("data:image/") === false) { - texture.name = sourceDef.uri; - } - const samplers = json.samplers || {}; - const sampler = samplers[textureDef.sampler] || {}; - texture.magFilter = WEBGL_FILTERS[sampler.magFilter] || LinearFilter; - texture.minFilter = WEBGL_FILTERS[sampler.minFilter] || LinearMipmapLinearFilter; - texture.wrapS = WEBGL_WRAPPINGS[sampler.wrapS] || RepeatWrapping; - texture.wrapT = WEBGL_WRAPPINGS[sampler.wrapT] || RepeatWrapping; - texture.generateMipmaps = !texture.isCompressedTexture && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter; - parser.associations.set(texture, { textures: textureIndex }); - return texture; - }).catch(function() { - return null; - }); - this.textureCache[cacheKey] = promise; - return promise; - } - loadImageSource(sourceIndex, loader) { - const parser = this; - const json = this.json; - const options = this.options; - if (this.sourceCache[sourceIndex] !== void 0) { - return this.sourceCache[sourceIndex].then((texture) => texture.clone()); - } - const sourceDef = json.images[sourceIndex]; - const URL2 = self.URL || self.webkitURL; - let sourceURI = sourceDef.uri || ""; - let isObjectURL = false; - if (sourceDef.bufferView !== void 0) { - sourceURI = parser.getDependency("bufferView", sourceDef.bufferView).then(function(bufferView) { - isObjectURL = true; - const blob = new Blob([bufferView], { type: sourceDef.mimeType }); - sourceURI = URL2.createObjectURL(blob); - return sourceURI; - }); - } else if (sourceDef.uri === void 0) { - throw new Error("THREE.GLTFLoader: Image " + sourceIndex + " is missing URI and bufferView"); - } - const promise = Promise.resolve(sourceURI).then(function(sourceURI2) { - return new Promise(function(resolve, reject) { - let onLoad = resolve; - if (loader.isImageBitmapLoader === true) { - onLoad = /* @__PURE__ */ __name(function(imageBitmap) { - const texture = new Texture(imageBitmap); - texture.needsUpdate = true; - resolve(texture); - }, "onLoad"); - } - loader.load(LoaderUtils.resolveURL(sourceURI2, options.path), onLoad, void 0, reject); - }); - }).then(function(texture) { - if (isObjectURL === true) { - URL2.revokeObjectURL(sourceURI); - } - assignExtrasToUserData(texture, sourceDef); - texture.userData.mimeType = sourceDef.mimeType || getImageURIMimeType(sourceDef.uri); - return texture; - }).catch(function(error) { - console.error("THREE.GLTFLoader: Couldn't load texture", sourceURI); - throw error; - }); - this.sourceCache[sourceIndex] = promise; - return promise; - } - /** - * Asynchronously assigns a texture to the given material parameters. - * @param {Object} materialParams - * @param {string} mapName - * @param {Object} mapDef - * @return {Promise} - */ - assignTexture(materialParams, mapName, mapDef, colorSpace) { - const parser = this; - return this.getDependency("texture", mapDef.index).then(function(texture) { - if (!texture) return null; - if (mapDef.texCoord !== void 0 && mapDef.texCoord > 0) { - texture = texture.clone(); - texture.channel = mapDef.texCoord; - } - if (parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]) { - const transform = mapDef.extensions !== void 0 ? mapDef.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM] : void 0; - if (transform) { - const gltfReference = parser.associations.get(texture); - texture = parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(texture, transform); - parser.associations.set(texture, gltfReference); - } - } - if (colorSpace !== void 0) { - texture.colorSpace = colorSpace; - } - materialParams[mapName] = texture; - return texture; - }); - } - /** - * Assigns final material to a Mesh, Line, or Points instance. The instance - * already has a material (generated from the glTF material options alone) - * but reuse of the same glTF material may require multiple threejs materials - * to accommodate different primitive types, defines, etc. New materials will - * be created if necessary, and reused from a cache. - * @param {Object3D} mesh Mesh, Line, or Points instance. - */ - assignFinalMaterial(mesh) { - const geometry = mesh.geometry; - let material = mesh.material; - const useDerivativeTangents = geometry.attributes.tangent === void 0; - const useVertexColors = geometry.attributes.color !== void 0; - const useFlatShading = geometry.attributes.normal === void 0; - if (mesh.isPoints) { - const cacheKey = "PointsMaterial:" + material.uuid; - let pointsMaterial = this.cache.get(cacheKey); - if (!pointsMaterial) { - pointsMaterial = new PointsMaterial(); - Material.prototype.copy.call(pointsMaterial, material); - pointsMaterial.color.copy(material.color); - pointsMaterial.map = material.map; - pointsMaterial.sizeAttenuation = false; - this.cache.add(cacheKey, pointsMaterial); - } - material = pointsMaterial; - } else if (mesh.isLine) { - const cacheKey = "LineBasicMaterial:" + material.uuid; - let lineMaterial = this.cache.get(cacheKey); - if (!lineMaterial) { - lineMaterial = new LineBasicMaterial(); - Material.prototype.copy.call(lineMaterial, material); - lineMaterial.color.copy(material.color); - lineMaterial.map = material.map; - this.cache.add(cacheKey, lineMaterial); - } - material = lineMaterial; - } - if (useDerivativeTangents || useVertexColors || useFlatShading) { - let cacheKey = "ClonedMaterial:" + material.uuid + ":"; - if (useDerivativeTangents) cacheKey += "derivative-tangents:"; - if (useVertexColors) cacheKey += "vertex-colors:"; - if (useFlatShading) cacheKey += "flat-shading:"; - let cachedMaterial = this.cache.get(cacheKey); - if (!cachedMaterial) { - cachedMaterial = material.clone(); - if (useVertexColors) cachedMaterial.vertexColors = true; - if (useFlatShading) cachedMaterial.flatShading = true; - if (useDerivativeTangents) { - if (cachedMaterial.normalScale) cachedMaterial.normalScale.y *= -1; - if (cachedMaterial.clearcoatNormalScale) cachedMaterial.clearcoatNormalScale.y *= -1; - } - this.cache.add(cacheKey, cachedMaterial); - this.associations.set(cachedMaterial, this.associations.get(material)); - } - material = cachedMaterial; - } - mesh.material = material; - } - getMaterialType() { - return MeshStandardMaterial; - } - /** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials - * @param {number} materialIndex - * @return {Promise} - */ - loadMaterial(materialIndex) { - const parser = this; - const json = this.json; - const extensions = this.extensions; - const materialDef = json.materials[materialIndex]; - let materialType; - const materialParams = {}; - const materialExtensions = materialDef.extensions || {}; - const pending = []; - if (materialExtensions[EXTENSIONS.KHR_MATERIALS_UNLIT]) { - const kmuExtension = extensions[EXTENSIONS.KHR_MATERIALS_UNLIT]; - materialType = kmuExtension.getMaterialType(); - pending.push(kmuExtension.extendParams(materialParams, materialDef, parser)); - } else { - const metallicRoughness = materialDef.pbrMetallicRoughness || {}; - materialParams.color = new Color(1, 1, 1); - materialParams.opacity = 1; - if (Array.isArray(metallicRoughness.baseColorFactor)) { - const array = metallicRoughness.baseColorFactor; - materialParams.color.setRGB(array[0], array[1], array[2], LinearSRGBColorSpace); - materialParams.opacity = array[3]; - } - if (metallicRoughness.baseColorTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "map", metallicRoughness.baseColorTexture, SRGBColorSpace)); - } - materialParams.metalness = metallicRoughness.metallicFactor !== void 0 ? metallicRoughness.metallicFactor : 1; - materialParams.roughness = metallicRoughness.roughnessFactor !== void 0 ? metallicRoughness.roughnessFactor : 1; - if (metallicRoughness.metallicRoughnessTexture !== void 0) { - pending.push(parser.assignTexture(materialParams, "metalnessMap", metallicRoughness.metallicRoughnessTexture)); - pending.push(parser.assignTexture(materialParams, "roughnessMap", metallicRoughness.metallicRoughnessTexture)); - } - materialType = this._invokeOne(function(ext2) { - return ext2.getMaterialType && ext2.getMaterialType(materialIndex); - }); - pending.push(Promise.all(this._invokeAll(function(ext2) { - return ext2.extendMaterialParams && ext2.extendMaterialParams(materialIndex, materialParams); - }))); - } - if (materialDef.doubleSided === true) { - materialParams.side = DoubleSide; - } - const alphaMode = materialDef.alphaMode || ALPHA_MODES.OPAQUE; - if (alphaMode === ALPHA_MODES.BLEND) { - materialParams.transparent = true; - materialParams.depthWrite = false; - } else { - materialParams.transparent = false; - if (alphaMode === ALPHA_MODES.MASK) { - materialParams.alphaTest = materialDef.alphaCutoff !== void 0 ? materialDef.alphaCutoff : 0.5; - } - } - if (materialDef.normalTexture !== void 0 && materialType !== MeshBasicMaterial) { - pending.push(parser.assignTexture(materialParams, "normalMap", materialDef.normalTexture)); - materialParams.normalScale = new Vector2(1, 1); - if (materialDef.normalTexture.scale !== void 0) { - const scale = materialDef.normalTexture.scale; - materialParams.normalScale.set(scale, scale); - } - } - if (materialDef.occlusionTexture !== void 0 && materialType !== MeshBasicMaterial) { - pending.push(parser.assignTexture(materialParams, "aoMap", materialDef.occlusionTexture)); - if (materialDef.occlusionTexture.strength !== void 0) { - materialParams.aoMapIntensity = materialDef.occlusionTexture.strength; - } - } - if (materialDef.emissiveFactor !== void 0 && materialType !== MeshBasicMaterial) { - const emissiveFactor = materialDef.emissiveFactor; - materialParams.emissive = new Color().setRGB(emissiveFactor[0], emissiveFactor[1], emissiveFactor[2], LinearSRGBColorSpace); - } - if (materialDef.emissiveTexture !== void 0 && materialType !== MeshBasicMaterial) { - pending.push(parser.assignTexture(materialParams, "emissiveMap", materialDef.emissiveTexture, SRGBColorSpace)); - } - return Promise.all(pending).then(function() { - const material = new materialType(materialParams); - if (materialDef.name) material.name = materialDef.name; - assignExtrasToUserData(material, materialDef); - parser.associations.set(material, { materials: materialIndex }); - if (materialDef.extensions) addUnknownExtensionsToUserData(extensions, material, materialDef); - return material; - }); - } - /** When Object3D instances are targeted by animation, they need unique names. */ - createUniqueName(originalName) { - const sanitizedName = PropertyBinding.sanitizeNodeName(originalName || ""); - if (sanitizedName in this.nodeNamesUsed) { - return sanitizedName + "_" + ++this.nodeNamesUsed[sanitizedName]; - } else { - this.nodeNamesUsed[sanitizedName] = 0; - return sanitizedName; - } - } - /** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry - * - * Creates BufferGeometries from primitives. - * - * @param {Array} primitives - * @return {Promise>} - */ - loadGeometries(primitives) { - const parser = this; - const extensions = this.extensions; - const cache = this.primitiveCache; - function createDracoPrimitive(primitive) { - return extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(primitive, parser).then(function(geometry) { - return addPrimitiveAttributes(geometry, primitive, parser); - }); - } - __name(createDracoPrimitive, "createDracoPrimitive"); - const pending = []; - for (let i = 0, il = primitives.length; i < il; i++) { - const primitive = primitives[i]; - const cacheKey = createPrimitiveKey(primitive); - const cached = cache[cacheKey]; - if (cached) { - pending.push(cached.promise); - } else { - let geometryPromise; - if (primitive.extensions && primitive.extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION]) { - geometryPromise = createDracoPrimitive(primitive); - } else { - geometryPromise = addPrimitiveAttributes(new BufferGeometry(), primitive, parser); - } - cache[cacheKey] = { primitive, promise: geometryPromise }; - pending.push(geometryPromise); - } - } - return Promise.all(pending); - } - /** - * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes - * @param {number} meshIndex - * @return {Promise} - */ - loadMesh(meshIndex) { - const parser = this; - const json = this.json; - const extensions = this.extensions; - const meshDef = json.meshes[meshIndex]; - const primitives = meshDef.primitives; - const pending = []; - for (let i = 0, il = primitives.length; i < il; i++) { - const material = primitives[i].material === void 0 ? createDefaultMaterial(this.cache) : this.getDependency("material", primitives[i].material); - pending.push(material); - } - pending.push(parser.loadGeometries(primitives)); - return Promise.all(pending).then(function(results) { - const materials = results.slice(0, results.length - 1); - const geometries = results[results.length - 1]; - const meshes = []; - for (let i = 0, il = geometries.length; i < il; i++) { - const geometry = geometries[i]; - const primitive = primitives[i]; - let mesh; - const material = materials[i]; - if (primitive.mode === WEBGL_CONSTANTS.TRIANGLES || primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP || primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN || primitive.mode === void 0) { - mesh = meshDef.isSkinnedMesh === true ? new SkinnedMesh(geometry, material) : new Mesh(geometry, material); - if (mesh.isSkinnedMesh === true) { - mesh.normalizeSkinWeights(); - } - if (primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP) { - mesh.geometry = toTrianglesDrawMode(mesh.geometry, TriangleStripDrawMode); - } else if (primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN) { - mesh.geometry = toTrianglesDrawMode(mesh.geometry, TriangleFanDrawMode); - } - } else if (primitive.mode === WEBGL_CONSTANTS.LINES) { - mesh = new LineSegments(geometry, material); - } else if (primitive.mode === WEBGL_CONSTANTS.LINE_STRIP) { - mesh = new Line(geometry, material); - } else if (primitive.mode === WEBGL_CONSTANTS.LINE_LOOP) { - mesh = new LineLoop(geometry, material); - } else if (primitive.mode === WEBGL_CONSTANTS.POINTS) { - mesh = new Points(geometry, material); - } else { - throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + primitive.mode); - } - if (Object.keys(mesh.geometry.morphAttributes).length > 0) { - updateMorphTargets(mesh, meshDef); - } - mesh.name = parser.createUniqueName(meshDef.name || "mesh_" + meshIndex); - assignExtrasToUserData(mesh, meshDef); - if (primitive.extensions) addUnknownExtensionsToUserData(extensions, mesh, primitive); - parser.assignFinalMaterial(mesh); - meshes.push(mesh); - } - for (let i = 0, il = meshes.length; i < il; i++) { - parser.associations.set(meshes[i], { - meshes: meshIndex, - primitives: i - }); - } - if (meshes.length === 1) { - if (meshDef.extensions) addUnknownExtensionsToUserData(extensions, meshes[0], meshDef); - return meshes[0]; - } - const group = new Group(); - if (meshDef.extensions) addUnknownExtensionsToUserData(extensions, group, meshDef); - parser.associations.set(group, { meshes: meshIndex }); - for (let i = 0, il = meshes.length; i < il; i++) { - group.add(meshes[i]); - } - return group; - }); - } - /** - * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras - * @param {number} cameraIndex - * @return {Promise} - */ - loadCamera(cameraIndex) { - let camera; - const cameraDef = this.json.cameras[cameraIndex]; - const params = cameraDef[cameraDef.type]; - if (!params) { - console.warn("THREE.GLTFLoader: Missing camera parameters."); - return; - } - if (cameraDef.type === "perspective") { - camera = new PerspectiveCamera(MathUtils.radToDeg(params.yfov), params.aspectRatio || 1, params.znear || 1, params.zfar || 2e6); - } else if (cameraDef.type === "orthographic") { - camera = new OrthographicCamera(-params.xmag, params.xmag, params.ymag, -params.ymag, params.znear, params.zfar); - } - if (cameraDef.name) camera.name = this.createUniqueName(cameraDef.name); - assignExtrasToUserData(camera, cameraDef); - return Promise.resolve(camera); - } - /** - * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins - * @param {number} skinIndex - * @return {Promise} - */ - loadSkin(skinIndex) { - const skinDef = this.json.skins[skinIndex]; - const pending = []; - for (let i = 0, il = skinDef.joints.length; i < il; i++) { - pending.push(this._loadNodeShallow(skinDef.joints[i])); - } - if (skinDef.inverseBindMatrices !== void 0) { - pending.push(this.getDependency("accessor", skinDef.inverseBindMatrices)); - } else { - pending.push(null); - } - return Promise.all(pending).then(function(results) { - const inverseBindMatrices = results.pop(); - const jointNodes = results; - const bones = []; - const boneInverses = []; - for (let i = 0, il = jointNodes.length; i < il; i++) { - const jointNode = jointNodes[i]; - if (jointNode) { - bones.push(jointNode); - const mat = new Matrix4(); - if (inverseBindMatrices !== null) { - mat.fromArray(inverseBindMatrices.array, i * 16); - } - boneInverses.push(mat); - } else { - console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', skinDef.joints[i]); - } - } - return new Skeleton(bones, boneInverses); - }); - } - /** - * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations - * @param {number} animationIndex - * @return {Promise} - */ - loadAnimation(animationIndex) { - const json = this.json; - const parser = this; - const animationDef = json.animations[animationIndex]; - const animationName = animationDef.name ? animationDef.name : "animation_" + animationIndex; - const pendingNodes = []; - const pendingInputAccessors = []; - const pendingOutputAccessors = []; - const pendingSamplers = []; - const pendingTargets = []; - for (let i = 0, il = animationDef.channels.length; i < il; i++) { - const channel = animationDef.channels[i]; - const sampler = animationDef.samplers[channel.sampler]; - const target = channel.target; - const name = target.node; - const input = animationDef.parameters !== void 0 ? animationDef.parameters[sampler.input] : sampler.input; - const output = animationDef.parameters !== void 0 ? animationDef.parameters[sampler.output] : sampler.output; - if (target.node === void 0) continue; - pendingNodes.push(this.getDependency("node", name)); - pendingInputAccessors.push(this.getDependency("accessor", input)); - pendingOutputAccessors.push(this.getDependency("accessor", output)); - pendingSamplers.push(sampler); - pendingTargets.push(target); - } - return Promise.all([ - Promise.all(pendingNodes), - Promise.all(pendingInputAccessors), - Promise.all(pendingOutputAccessors), - Promise.all(pendingSamplers), - Promise.all(pendingTargets) - ]).then(function(dependencies) { - const nodes = dependencies[0]; - const inputAccessors = dependencies[1]; - const outputAccessors = dependencies[2]; - const samplers = dependencies[3]; - const targets = dependencies[4]; - const tracks = []; - for (let i = 0, il = nodes.length; i < il; i++) { - const node = nodes[i]; - const inputAccessor = inputAccessors[i]; - const outputAccessor = outputAccessors[i]; - const sampler = samplers[i]; - const target = targets[i]; - if (node === void 0) continue; - if (node.updateMatrix) { - node.updateMatrix(); - } - const createdTracks = parser._createAnimationTracks(node, inputAccessor, outputAccessor, sampler, target); - if (createdTracks) { - for (let k = 0; k < createdTracks.length; k++) { - tracks.push(createdTracks[k]); - } - } - } - return new AnimationClip(animationName, void 0, tracks); - }); - } - createNodeMesh(nodeIndex) { - const json = this.json; - const parser = this; - const nodeDef = json.nodes[nodeIndex]; - if (nodeDef.mesh === void 0) return null; - return parser.getDependency("mesh", nodeDef.mesh).then(function(mesh) { - const node = parser._getNodeRef(parser.meshCache, nodeDef.mesh, mesh); - if (nodeDef.weights !== void 0) { - node.traverse(function(o) { - if (!o.isMesh) return; - for (let i = 0, il = nodeDef.weights.length; i < il; i++) { - o.morphTargetInfluences[i] = nodeDef.weights[i]; - } - }); - } - return node; - }); - } - /** - * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy - * @param {number} nodeIndex - * @return {Promise} - */ - loadNode(nodeIndex) { - const json = this.json; - const parser = this; - const nodeDef = json.nodes[nodeIndex]; - const nodePending = parser._loadNodeShallow(nodeIndex); - const childPending = []; - const childrenDef = nodeDef.children || []; - for (let i = 0, il = childrenDef.length; i < il; i++) { - childPending.push(parser.getDependency("node", childrenDef[i])); - } - const skeletonPending = nodeDef.skin === void 0 ? Promise.resolve(null) : parser.getDependency("skin", nodeDef.skin); - return Promise.all([ - nodePending, - Promise.all(childPending), - skeletonPending - ]).then(function(results) { - const node = results[0]; - const children = results[1]; - const skeleton = results[2]; - if (skeleton !== null) { - node.traverse(function(mesh) { - if (!mesh.isSkinnedMesh) return; - mesh.bind(skeleton, _identityMatrix); - }); - } - for (let i = 0, il = children.length; i < il; i++) { - node.add(children[i]); - } - return node; - }); - } - // ._loadNodeShallow() parses a single node. - // skin and child nodes are created and added in .loadNode() (no '_' prefix). - _loadNodeShallow(nodeIndex) { - const json = this.json; - const extensions = this.extensions; - const parser = this; - if (this.nodeCache[nodeIndex] !== void 0) { - return this.nodeCache[nodeIndex]; - } - const nodeDef = json.nodes[nodeIndex]; - const nodeName = nodeDef.name ? parser.createUniqueName(nodeDef.name) : ""; - const pending = []; - const meshPromise = parser._invokeOne(function(ext2) { - return ext2.createNodeMesh && ext2.createNodeMesh(nodeIndex); - }); - if (meshPromise) { - pending.push(meshPromise); - } - if (nodeDef.camera !== void 0) { - pending.push(parser.getDependency("camera", nodeDef.camera).then(function(camera) { - return parser._getNodeRef(parser.cameraCache, nodeDef.camera, camera); - })); - } - parser._invokeAll(function(ext2) { - return ext2.createNodeAttachment && ext2.createNodeAttachment(nodeIndex); - }).forEach(function(promise) { - pending.push(promise); - }); - this.nodeCache[nodeIndex] = Promise.all(pending).then(function(objects) { - let node; - if (nodeDef.isBone === true) { - node = new Bone(); - } else if (objects.length > 1) { - node = new Group(); - } else if (objects.length === 1) { - node = objects[0]; - } else { - node = new Object3D(); - } - if (node !== objects[0]) { - for (let i = 0, il = objects.length; i < il; i++) { - node.add(objects[i]); - } - } - if (nodeDef.name) { - node.userData.name = nodeDef.name; - node.name = nodeName; - } - assignExtrasToUserData(node, nodeDef); - if (nodeDef.extensions) addUnknownExtensionsToUserData(extensions, node, nodeDef); - if (nodeDef.matrix !== void 0) { - const matrix = new Matrix4(); - matrix.fromArray(nodeDef.matrix); - node.applyMatrix4(matrix); - } else { - if (nodeDef.translation !== void 0) { - node.position.fromArray(nodeDef.translation); - } - if (nodeDef.rotation !== void 0) { - node.quaternion.fromArray(nodeDef.rotation); - } - if (nodeDef.scale !== void 0) { - node.scale.fromArray(nodeDef.scale); - } - } - if (!parser.associations.has(node)) { - parser.associations.set(node, {}); - } - parser.associations.get(node).nodes = nodeIndex; - return node; - }); - return this.nodeCache[nodeIndex]; - } - /** - * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes - * @param {number} sceneIndex - * @return {Promise} - */ - loadScene(sceneIndex) { - const extensions = this.extensions; - const sceneDef = this.json.scenes[sceneIndex]; - const parser = this; - const scene = new Group(); - if (sceneDef.name) scene.name = parser.createUniqueName(sceneDef.name); - assignExtrasToUserData(scene, sceneDef); - if (sceneDef.extensions) addUnknownExtensionsToUserData(extensions, scene, sceneDef); - const nodeIds = sceneDef.nodes || []; - const pending = []; - for (let i = 0, il = nodeIds.length; i < il; i++) { - pending.push(parser.getDependency("node", nodeIds[i])); - } - return Promise.all(pending).then(function(nodes) { - for (let i = 0, il = nodes.length; i < il; i++) { - scene.add(nodes[i]); - } - const reduceAssociations = /* @__PURE__ */ __name((node) => { - const reducedAssociations = /* @__PURE__ */ new Map(); - for (const [key, value] of parser.associations) { - if (key instanceof Material || key instanceof Texture) { - reducedAssociations.set(key, value); - } - } - node.traverse((node2) => { - const mappings = parser.associations.get(node2); - if (mappings != null) { - reducedAssociations.set(node2, mappings); - } - }); - return reducedAssociations; - }, "reduceAssociations"); - parser.associations = reduceAssociations(scene); - return scene; - }); - } - _createAnimationTracks(node, inputAccessor, outputAccessor, sampler, target) { - const tracks = []; - const targetName = node.name ? node.name : node.uuid; - const targetNames = []; - if (PATH_PROPERTIES[target.path] === PATH_PROPERTIES.weights) { - node.traverse(function(object) { - if (object.morphTargetInfluences) { - targetNames.push(object.name ? object.name : object.uuid); - } - }); - } else { - targetNames.push(targetName); - } - let TypedKeyframeTrack; - switch (PATH_PROPERTIES[target.path]) { - case PATH_PROPERTIES.weights: - TypedKeyframeTrack = NumberKeyframeTrack; - break; - case PATH_PROPERTIES.rotation: - TypedKeyframeTrack = QuaternionKeyframeTrack; - break; - case PATH_PROPERTIES.position: - case PATH_PROPERTIES.scale: - TypedKeyframeTrack = VectorKeyframeTrack; - break; - default: - switch (outputAccessor.itemSize) { - case 1: - TypedKeyframeTrack = NumberKeyframeTrack; - break; - case 2: - case 3: - default: - TypedKeyframeTrack = VectorKeyframeTrack; - break; - } - break; - } - const interpolation = sampler.interpolation !== void 0 ? INTERPOLATION[sampler.interpolation] : InterpolateLinear; - const outputArray = this._getArrayFromAccessor(outputAccessor); - for (let j = 0, jl = targetNames.length; j < jl; j++) { - const track = new TypedKeyframeTrack( - targetNames[j] + "." + PATH_PROPERTIES[target.path], - inputAccessor.array, - outputArray, - interpolation - ); - if (sampler.interpolation === "CUBICSPLINE") { - this._createCubicSplineTrackInterpolant(track); - } - tracks.push(track); - } - return tracks; - } - _getArrayFromAccessor(accessor) { - let outputArray = accessor.array; - if (accessor.normalized) { - const scale = getNormalizedComponentScale(outputArray.constructor); - const scaled = new Float32Array(outputArray.length); - for (let j = 0, jl = outputArray.length; j < jl; j++) { - scaled[j] = outputArray[j] * scale; - } - outputArray = scaled; - } - return outputArray; - } - _createCubicSplineTrackInterpolant(track) { - track.createInterpolant = /* @__PURE__ */ __name(function InterpolantFactoryMethodGLTFCubicSpline(result) { - const interpolantType = this instanceof QuaternionKeyframeTrack ? GLTFCubicSplineQuaternionInterpolant : GLTFCubicSplineInterpolant; - return new interpolantType(this.times, this.values, this.getValueSize() / 3, result); - }, "InterpolantFactoryMethodGLTFCubicSpline"); - track.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = true; - } -} -function computeBounds(geometry, primitiveDef, parser) { - const attributes = primitiveDef.attributes; - const box = new Box3(); - if (attributes.POSITION !== void 0) { - const accessor = parser.json.accessors[attributes.POSITION]; - const min = accessor.min; - const max2 = accessor.max; - if (min !== void 0 && max2 !== void 0) { - box.set( - new Vector3(min[0], min[1], min[2]), - new Vector3(max2[0], max2[1], max2[2]) - ); - if (accessor.normalized) { - const boxScale = getNormalizedComponentScale(WEBGL_COMPONENT_TYPES[accessor.componentType]); - box.min.multiplyScalar(boxScale); - box.max.multiplyScalar(boxScale); - } - } else { - console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."); - return; - } - } else { - return; - } - const targets = primitiveDef.targets; - if (targets !== void 0) { - const maxDisplacement = new Vector3(); - const vector = new Vector3(); - for (let i = 0, il = targets.length; i < il; i++) { - const target = targets[i]; - if (target.POSITION !== void 0) { - const accessor = parser.json.accessors[target.POSITION]; - const min = accessor.min; - const max2 = accessor.max; - if (min !== void 0 && max2 !== void 0) { - vector.setX(Math.max(Math.abs(min[0]), Math.abs(max2[0]))); - vector.setY(Math.max(Math.abs(min[1]), Math.abs(max2[1]))); - vector.setZ(Math.max(Math.abs(min[2]), Math.abs(max2[2]))); - if (accessor.normalized) { - const boxScale = getNormalizedComponentScale(WEBGL_COMPONENT_TYPES[accessor.componentType]); - vector.multiplyScalar(boxScale); - } - maxDisplacement.max(vector); - } else { - console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION."); - } - } - } - box.expandByVector(maxDisplacement); - } - geometry.boundingBox = box; - const sphere = new Sphere(); - box.getCenter(sphere.center); - sphere.radius = box.min.distanceTo(box.max) / 2; - geometry.boundingSphere = sphere; -} -__name(computeBounds, "computeBounds"); -function addPrimitiveAttributes(geometry, primitiveDef, parser) { - const attributes = primitiveDef.attributes; - const pending = []; - function assignAttributeAccessor(accessorIndex, attributeName) { - return parser.getDependency("accessor", accessorIndex).then(function(accessor) { - geometry.setAttribute(attributeName, accessor); - }); - } - __name(assignAttributeAccessor, "assignAttributeAccessor"); - for (const gltfAttributeName in attributes) { - const threeAttributeName = ATTRIBUTES[gltfAttributeName] || gltfAttributeName.toLowerCase(); - if (threeAttributeName in geometry.attributes) continue; - pending.push(assignAttributeAccessor(attributes[gltfAttributeName], threeAttributeName)); - } - if (primitiveDef.indices !== void 0 && !geometry.index) { - const accessor = parser.getDependency("accessor", primitiveDef.indices).then(function(accessor2) { - geometry.setIndex(accessor2); - }); - pending.push(accessor); - } - if (ColorManagement.workingColorSpace !== LinearSRGBColorSpace && "COLOR_0" in attributes) { - console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${ColorManagement.workingColorSpace}" not supported.`); - } - assignExtrasToUserData(geometry, primitiveDef); - computeBounds(geometry, primitiveDef, parser); - return Promise.all(pending).then(function() { - return primitiveDef.targets !== void 0 ? addMorphTargets(geometry, primitiveDef.targets, parser) : geometry; - }); -} -__name(addPrimitiveAttributes, "addPrimitiveAttributes"); -class MTLLoader extends Loader { - static { - __name(this, "MTLLoader"); - } - constructor(manager) { - super(manager); - } - /** - * Loads and parses a MTL asset from a URL. - * - * @param {String} url - URL to the MTL file. - * @param {Function} [onLoad] - Callback invoked with the loaded object. - * @param {Function} [onProgress] - Callback for download progress. - * @param {Function} [onError] - Callback for download errors. - * - * @see setPath setResourcePath - * - * @note In order for relative texture references to resolve correctly - * you must call setResourcePath() explicitly prior to load. - */ - load(url, onLoad, onProgress, onError) { - const scope = this; - const path = this.path === "" ? LoaderUtils.extractUrlBase(url) : this.path; - const loader = new FileLoader(this.manager); - loader.setPath(this.path); - loader.setRequestHeader(this.requestHeader); - loader.setWithCredentials(this.withCredentials); - loader.load(url, function(text) { - try { - onLoad(scope.parse(text, path)); - } catch (e) { - if (onError) { - onError(e); - } else { - console.error(e); - } - scope.manager.itemError(url); - } - }, onProgress, onError); - } - setMaterialOptions(value) { - this.materialOptions = value; - return this; - } - /** - * Parses a MTL file. - * - * @param {String} text - Content of MTL file - * @return {MaterialCreator} - * - * @see setPath setResourcePath - * - * @note In order for relative texture references to resolve correctly - * you must call setResourcePath() explicitly prior to parse. - */ - parse(text, path) { - const lines = text.split("\n"); - let info = {}; - const delimiter_pattern = /\s+/; - const materialsInfo = {}; - for (let i = 0; i < lines.length; i++) { - let line = lines[i]; - line = line.trim(); - if (line.length === 0 || line.charAt(0) === "#") { - continue; - } - const pos = line.indexOf(" "); - let key = pos >= 0 ? line.substring(0, pos) : line; - key = key.toLowerCase(); - let value = pos >= 0 ? line.substring(pos + 1) : ""; - value = value.trim(); - if (key === "newmtl") { - info = { name: value }; - materialsInfo[value] = info; - } else { - if (key === "ka" || key === "kd" || key === "ks" || key === "ke") { - const ss = value.split(delimiter_pattern, 3); - info[key] = [parseFloat(ss[0]), parseFloat(ss[1]), parseFloat(ss[2])]; - } else { - info[key] = value; - } - } - } - const materialCreator = new MaterialCreator(this.resourcePath || path, this.materialOptions); - materialCreator.setCrossOrigin(this.crossOrigin); - materialCreator.setManager(this.manager); - materialCreator.setMaterials(materialsInfo); - return materialCreator; - } -} -class MaterialCreator { - static { - __name(this, "MaterialCreator"); - } - constructor(baseUrl = "", options = {}) { - this.baseUrl = baseUrl; - this.options = options; - this.materialsInfo = {}; - this.materials = {}; - this.materialsArray = []; - this.nameLookup = {}; - this.crossOrigin = "anonymous"; - this.side = this.options.side !== void 0 ? this.options.side : FrontSide; - this.wrap = this.options.wrap !== void 0 ? this.options.wrap : RepeatWrapping; - } - setCrossOrigin(value) { - this.crossOrigin = value; - return this; - } - setManager(value) { - this.manager = value; - } - setMaterials(materialsInfo) { - this.materialsInfo = this.convert(materialsInfo); - this.materials = {}; - this.materialsArray = []; - this.nameLookup = {}; - } - convert(materialsInfo) { - if (!this.options) return materialsInfo; - const converted = {}; - for (const mn in materialsInfo) { - const mat = materialsInfo[mn]; - const covmat = {}; - converted[mn] = covmat; - for (const prop in mat) { - let save = true; - let value = mat[prop]; - const lprop = prop.toLowerCase(); - switch (lprop) { - case "kd": - case "ka": - case "ks": - if (this.options && this.options.normalizeRGB) { - value = [value[0] / 255, value[1] / 255, value[2] / 255]; - } - if (this.options && this.options.ignoreZeroRGBs) { - if (value[0] === 0 && value[1] === 0 && value[2] === 0) { - save = false; - } - } - break; - default: - break; - } - if (save) { - covmat[lprop] = value; - } - } - } - return converted; - } - preload() { - for (const mn in this.materialsInfo) { - this.create(mn); - } - } - getIndex(materialName) { - return this.nameLookup[materialName]; - } - getAsArray() { - let index = 0; - for (const mn in this.materialsInfo) { - this.materialsArray[index] = this.create(mn); - this.nameLookup[mn] = index; - index++; - } - return this.materialsArray; - } - create(materialName) { - if (this.materials[materialName] === void 0) { - this.createMaterial_(materialName); - } - return this.materials[materialName]; - } - createMaterial_(materialName) { - const scope = this; - const mat = this.materialsInfo[materialName]; - const params = { - name: materialName, - side: this.side - }; - function resolveURL(baseUrl, url) { - if (typeof url !== "string" || url === "") - return ""; - if (/^https?:\/\//i.test(url)) return url; - return baseUrl + url; - } - __name(resolveURL, "resolveURL"); - function setMapForType(mapType, value) { - if (params[mapType]) return; - const texParams = scope.getTextureParams(value, params); - const map = scope.loadTexture(resolveURL(scope.baseUrl, texParams.url)); - map.repeat.copy(texParams.scale); - map.offset.copy(texParams.offset); - map.wrapS = scope.wrap; - map.wrapT = scope.wrap; - if (mapType === "map" || mapType === "emissiveMap") { - map.colorSpace = SRGBColorSpace; - } - params[mapType] = map; - } - __name(setMapForType, "setMapForType"); - for (const prop in mat) { - const value = mat[prop]; - let n; - if (value === "") continue; - switch (prop.toLowerCase()) { - case "kd": - params.color = ColorManagement.toWorkingColorSpace(new Color().fromArray(value), SRGBColorSpace); - break; - case "ks": - params.specular = ColorManagement.toWorkingColorSpace(new Color().fromArray(value), SRGBColorSpace); - break; - case "ke": - params.emissive = ColorManagement.toWorkingColorSpace(new Color().fromArray(value), SRGBColorSpace); - break; - case "map_kd": - setMapForType("map", value); - break; - case "map_ks": - setMapForType("specularMap", value); - break; - case "map_ke": - setMapForType("emissiveMap", value); - break; - case "norm": - setMapForType("normalMap", value); - break; - case "map_bump": - case "bump": - setMapForType("bumpMap", value); - break; - case "map_d": - setMapForType("alphaMap", value); - params.transparent = true; - break; - case "ns": - params.shininess = parseFloat(value); - break; - case "d": - n = parseFloat(value); - if (n < 1) { - params.opacity = n; - params.transparent = true; - } - break; - case "tr": - n = parseFloat(value); - if (this.options && this.options.invertTrProperty) n = 1 - n; - if (n > 0) { - params.opacity = 1 - n; - params.transparent = true; - } - break; - default: - break; - } - } - this.materials[materialName] = new MeshPhongMaterial(params); - return this.materials[materialName]; - } - getTextureParams(value, matParams) { - const texParams = { - scale: new Vector2(1, 1), - offset: new Vector2(0, 0) - }; - const items = value.split(/\s+/); - let pos; - pos = items.indexOf("-bm"); - if (pos >= 0) { - matParams.bumpScale = parseFloat(items[pos + 1]); - items.splice(pos, 2); - } - pos = items.indexOf("-s"); - if (pos >= 0) { - texParams.scale.set(parseFloat(items[pos + 1]), parseFloat(items[pos + 2])); - items.splice(pos, 4); - } - pos = items.indexOf("-o"); - if (pos >= 0) { - texParams.offset.set(parseFloat(items[pos + 1]), parseFloat(items[pos + 2])); - items.splice(pos, 4); - } - texParams.url = items.join(" ").trim(); - return texParams; - } - loadTexture(url, mapping, onLoad, onProgress, onError) { - const manager = this.manager !== void 0 ? this.manager : DefaultLoadingManager; - let loader = manager.getHandler(url); - if (loader === null) { - loader = new TextureLoader(manager); - } - if (loader.setCrossOrigin) loader.setCrossOrigin(this.crossOrigin); - const texture = loader.load(url, onLoad, onProgress, onError); - if (mapping !== void 0) texture.mapping = mapping; - return texture; - } -} -const _object_pattern = /^[og]\s*(.+)?/; -const _material_library_pattern = /^mtllib /; -const _material_use_pattern = /^usemtl /; -const _map_use_pattern = /^usemap /; -const _face_vertex_data_separator_pattern = /\s+/; -const _vA = new Vector3(); -const _vB = new Vector3(); -const _vC = new Vector3(); -const _ab = new Vector3(); -const _cb = new Vector3(); -const _color = new Color(); -function ParserState() { - const state = { - objects: [], - object: {}, - vertices: [], - normals: [], - colors: [], - uvs: [], - materials: {}, - materialLibraries: [], - startObject: /* @__PURE__ */ __name(function(name, fromDeclaration) { - if (this.object && this.object.fromDeclaration === false) { - this.object.name = name; - this.object.fromDeclaration = fromDeclaration !== false; - return; - } - const previousMaterial = this.object && typeof this.object.currentMaterial === "function" ? this.object.currentMaterial() : void 0; - if (this.object && typeof this.object._finalize === "function") { - this.object._finalize(true); - } - this.object = { - name: name || "", - fromDeclaration: fromDeclaration !== false, - geometry: { - vertices: [], - normals: [], - colors: [], - uvs: [], - hasUVIndices: false - }, - materials: [], - smooth: true, - startMaterial: /* @__PURE__ */ __name(function(name2, libraries) { - const previous = this._finalize(false); - if (previous && (previous.inherited || previous.groupCount <= 0)) { - this.materials.splice(previous.index, 1); - } - const material = { - index: this.materials.length, - name: name2 || "", - mtllib: Array.isArray(libraries) && libraries.length > 0 ? libraries[libraries.length - 1] : "", - smooth: previous !== void 0 ? previous.smooth : this.smooth, - groupStart: previous !== void 0 ? previous.groupEnd : 0, - groupEnd: -1, - groupCount: -1, - inherited: false, - clone: /* @__PURE__ */ __name(function(index) { - const cloned = { - index: typeof index === "number" ? index : this.index, - name: this.name, - mtllib: this.mtllib, - smooth: this.smooth, - groupStart: 0, - groupEnd: -1, - groupCount: -1, - inherited: false - }; - cloned.clone = this.clone.bind(cloned); - return cloned; - }, "clone") - }; - this.materials.push(material); - return material; - }, "startMaterial"), - currentMaterial: /* @__PURE__ */ __name(function() { - if (this.materials.length > 0) { - return this.materials[this.materials.length - 1]; - } - return void 0; - }, "currentMaterial"), - _finalize: /* @__PURE__ */ __name(function(end) { - const lastMultiMaterial = this.currentMaterial(); - if (lastMultiMaterial && lastMultiMaterial.groupEnd === -1) { - lastMultiMaterial.groupEnd = this.geometry.vertices.length / 3; - lastMultiMaterial.groupCount = lastMultiMaterial.groupEnd - lastMultiMaterial.groupStart; - lastMultiMaterial.inherited = false; - } - if (end && this.materials.length > 1) { - for (let mi = this.materials.length - 1; mi >= 0; mi--) { - if (this.materials[mi].groupCount <= 0) { - this.materials.splice(mi, 1); - } - } - } - if (end && this.materials.length === 0) { - this.materials.push({ - name: "", - smooth: this.smooth - }); - } - return lastMultiMaterial; - }, "_finalize") - }; - if (previousMaterial && previousMaterial.name && typeof previousMaterial.clone === "function") { - const declared = previousMaterial.clone(0); - declared.inherited = true; - this.object.materials.push(declared); - } - this.objects.push(this.object); - }, "startObject"), - finalize: /* @__PURE__ */ __name(function() { - if (this.object && typeof this.object._finalize === "function") { - this.object._finalize(true); - } - }, "finalize"), - parseVertexIndex: /* @__PURE__ */ __name(function(value, len) { - const index = parseInt(value, 10); - return (index >= 0 ? index - 1 : index + len / 3) * 3; - }, "parseVertexIndex"), - parseNormalIndex: /* @__PURE__ */ __name(function(value, len) { - const index = parseInt(value, 10); - return (index >= 0 ? index - 1 : index + len / 3) * 3; - }, "parseNormalIndex"), - parseUVIndex: /* @__PURE__ */ __name(function(value, len) { - const index = parseInt(value, 10); - return (index >= 0 ? index - 1 : index + len / 2) * 2; - }, "parseUVIndex"), - addVertex: /* @__PURE__ */ __name(function(a, b, c) { - const src = this.vertices; - const dst = this.object.geometry.vertices; - dst.push(src[a + 0], src[a + 1], src[a + 2]); - dst.push(src[b + 0], src[b + 1], src[b + 2]); - dst.push(src[c + 0], src[c + 1], src[c + 2]); - }, "addVertex"), - addVertexPoint: /* @__PURE__ */ __name(function(a) { - const src = this.vertices; - const dst = this.object.geometry.vertices; - dst.push(src[a + 0], src[a + 1], src[a + 2]); - }, "addVertexPoint"), - addVertexLine: /* @__PURE__ */ __name(function(a) { - const src = this.vertices; - const dst = this.object.geometry.vertices; - dst.push(src[a + 0], src[a + 1], src[a + 2]); - }, "addVertexLine"), - addNormal: /* @__PURE__ */ __name(function(a, b, c) { - const src = this.normals; - const dst = this.object.geometry.normals; - dst.push(src[a + 0], src[a + 1], src[a + 2]); - dst.push(src[b + 0], src[b + 1], src[b + 2]); - dst.push(src[c + 0], src[c + 1], src[c + 2]); - }, "addNormal"), - addFaceNormal: /* @__PURE__ */ __name(function(a, b, c) { - const src = this.vertices; - const dst = this.object.geometry.normals; - _vA.fromArray(src, a); - _vB.fromArray(src, b); - _vC.fromArray(src, c); - _cb.subVectors(_vC, _vB); - _ab.subVectors(_vA, _vB); - _cb.cross(_ab); - _cb.normalize(); - dst.push(_cb.x, _cb.y, _cb.z); - dst.push(_cb.x, _cb.y, _cb.z); - dst.push(_cb.x, _cb.y, _cb.z); - }, "addFaceNormal"), - addColor: /* @__PURE__ */ __name(function(a, b, c) { - const src = this.colors; - const dst = this.object.geometry.colors; - if (src[a] !== void 0) dst.push(src[a + 0], src[a + 1], src[a + 2]); - if (src[b] !== void 0) dst.push(src[b + 0], src[b + 1], src[b + 2]); - if (src[c] !== void 0) dst.push(src[c + 0], src[c + 1], src[c + 2]); - }, "addColor"), - addUV: /* @__PURE__ */ __name(function(a, b, c) { - const src = this.uvs; - const dst = this.object.geometry.uvs; - dst.push(src[a + 0], src[a + 1]); - dst.push(src[b + 0], src[b + 1]); - dst.push(src[c + 0], src[c + 1]); - }, "addUV"), - addDefaultUV: /* @__PURE__ */ __name(function() { - const dst = this.object.geometry.uvs; - dst.push(0, 0); - dst.push(0, 0); - dst.push(0, 0); - }, "addDefaultUV"), - addUVLine: /* @__PURE__ */ __name(function(a) { - const src = this.uvs; - const dst = this.object.geometry.uvs; - dst.push(src[a + 0], src[a + 1]); - }, "addUVLine"), - addFace: /* @__PURE__ */ __name(function(a, b, c, ua, ub, uc, na, nb, nc) { - const vLen = this.vertices.length; - let ia = this.parseVertexIndex(a, vLen); - let ib = this.parseVertexIndex(b, vLen); - let ic = this.parseVertexIndex(c, vLen); - this.addVertex(ia, ib, ic); - this.addColor(ia, ib, ic); - if (na !== void 0 && na !== "") { - const nLen = this.normals.length; - ia = this.parseNormalIndex(na, nLen); - ib = this.parseNormalIndex(nb, nLen); - ic = this.parseNormalIndex(nc, nLen); - this.addNormal(ia, ib, ic); - } else { - this.addFaceNormal(ia, ib, ic); - } - if (ua !== void 0 && ua !== "") { - const uvLen = this.uvs.length; - ia = this.parseUVIndex(ua, uvLen); - ib = this.parseUVIndex(ub, uvLen); - ic = this.parseUVIndex(uc, uvLen); - this.addUV(ia, ib, ic); - this.object.geometry.hasUVIndices = true; - } else { - this.addDefaultUV(); - } - }, "addFace"), - addPointGeometry: /* @__PURE__ */ __name(function(vertices) { - this.object.geometry.type = "Points"; - const vLen = this.vertices.length; - for (let vi = 0, l = vertices.length; vi < l; vi++) { - const index = this.parseVertexIndex(vertices[vi], vLen); - this.addVertexPoint(index); - this.addColor(index); - } - }, "addPointGeometry"), - addLineGeometry: /* @__PURE__ */ __name(function(vertices, uvs) { - this.object.geometry.type = "Line"; - const vLen = this.vertices.length; - const uvLen = this.uvs.length; - for (let vi = 0, l = vertices.length; vi < l; vi++) { - this.addVertexLine(this.parseVertexIndex(vertices[vi], vLen)); - } - for (let uvi = 0, l = uvs.length; uvi < l; uvi++) { - this.addUVLine(this.parseUVIndex(uvs[uvi], uvLen)); - } - }, "addLineGeometry") - }; - state.startObject("", false); - return state; -} -__name(ParserState, "ParserState"); -class OBJLoader extends Loader { - static { - __name(this, "OBJLoader"); - } - constructor(manager) { - super(manager); - this.materials = null; - } - load(url, onLoad, onProgress, onError) { - const scope = this; - const loader = new FileLoader(this.manager); - loader.setPath(this.path); - loader.setRequestHeader(this.requestHeader); - loader.setWithCredentials(this.withCredentials); - loader.load(url, function(text) { - try { - onLoad(scope.parse(text)); - } catch (e) { - if (onError) { - onError(e); - } else { - console.error(e); - } - scope.manager.itemError(url); - } - }, onProgress, onError); - } - setMaterials(materials) { - this.materials = materials; - return this; - } - parse(text) { - const state = new ParserState(); - if (text.indexOf("\r\n") !== -1) { - text = text.replace(/\r\n/g, "\n"); - } - if (text.indexOf("\\\n") !== -1) { - text = text.replace(/\\\n/g, ""); - } - const lines = text.split("\n"); - let result = []; - for (let i = 0, l = lines.length; i < l; i++) { - const line = lines[i].trimStart(); - if (line.length === 0) continue; - const lineFirstChar = line.charAt(0); - if (lineFirstChar === "#") continue; - if (lineFirstChar === "v") { - const data = line.split(_face_vertex_data_separator_pattern); - switch (data[0]) { - case "v": - state.vertices.push( - parseFloat(data[1]), - parseFloat(data[2]), - parseFloat(data[3]) - ); - if (data.length >= 7) { - _color.setRGB( - parseFloat(data[4]), - parseFloat(data[5]), - parseFloat(data[6]), - SRGBColorSpace - ); - state.colors.push(_color.r, _color.g, _color.b); - } else { - state.colors.push(void 0, void 0, void 0); - } - break; - case "vn": - state.normals.push( - parseFloat(data[1]), - parseFloat(data[2]), - parseFloat(data[3]) - ); - break; - case "vt": - state.uvs.push( - parseFloat(data[1]), - parseFloat(data[2]) - ); - break; - } - } else if (lineFirstChar === "f") { - const lineData = line.slice(1).trim(); - const vertexData = lineData.split(_face_vertex_data_separator_pattern); - const faceVertices = []; - for (let j = 0, jl = vertexData.length; j < jl; j++) { - const vertex2 = vertexData[j]; - if (vertex2.length > 0) { - const vertexParts = vertex2.split("/"); - faceVertices.push(vertexParts); - } - } - const v1 = faceVertices[0]; - for (let j = 1, jl = faceVertices.length - 1; j < jl; j++) { - const v2 = faceVertices[j]; - const v3 = faceVertices[j + 1]; - state.addFace( - v1[0], - v2[0], - v3[0], - v1[1], - v2[1], - v3[1], - v1[2], - v2[2], - v3[2] - ); - } - } else if (lineFirstChar === "l") { - const lineParts = line.substring(1).trim().split(" "); - let lineVertices = []; - const lineUVs = []; - if (line.indexOf("/") === -1) { - lineVertices = lineParts; - } else { - for (let li = 0, llen = lineParts.length; li < llen; li++) { - const parts = lineParts[li].split("/"); - if (parts[0] !== "") lineVertices.push(parts[0]); - if (parts[1] !== "") lineUVs.push(parts[1]); - } - } - state.addLineGeometry(lineVertices, lineUVs); - } else if (lineFirstChar === "p") { - const lineData = line.slice(1).trim(); - const pointData = lineData.split(" "); - state.addPointGeometry(pointData); - } else if ((result = _object_pattern.exec(line)) !== null) { - const name = (" " + result[0].slice(1).trim()).slice(1); - state.startObject(name); - } else if (_material_use_pattern.test(line)) { - state.object.startMaterial(line.substring(7).trim(), state.materialLibraries); - } else if (_material_library_pattern.test(line)) { - state.materialLibraries.push(line.substring(7).trim()); - } else if (_map_use_pattern.test(line)) { - console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.'); - } else if (lineFirstChar === "s") { - result = line.split(" "); - if (result.length > 1) { - const value = result[1].trim().toLowerCase(); - state.object.smooth = value !== "0" && value !== "off"; - } else { - state.object.smooth = true; - } - const material = state.object.currentMaterial(); - if (material) material.smooth = state.object.smooth; - } else { - if (line === "\0") continue; - console.warn('THREE.OBJLoader: Unexpected line: "' + line + '"'); - } - } - state.finalize(); - const container = new Group(); - container.materialLibraries = [].concat(state.materialLibraries); - const hasPrimitives = !(state.objects.length === 1 && state.objects[0].geometry.vertices.length === 0); - if (hasPrimitives === true) { - for (let i = 0, l = state.objects.length; i < l; i++) { - const object = state.objects[i]; - const geometry = object.geometry; - const materials = object.materials; - const isLine = geometry.type === "Line"; - const isPoints = geometry.type === "Points"; - let hasVertexColors = false; - if (geometry.vertices.length === 0) continue; - const buffergeometry = new BufferGeometry(); - buffergeometry.setAttribute("position", new Float32BufferAttribute(geometry.vertices, 3)); - if (geometry.normals.length > 0) { - buffergeometry.setAttribute("normal", new Float32BufferAttribute(geometry.normals, 3)); - } - if (geometry.colors.length > 0) { - hasVertexColors = true; - buffergeometry.setAttribute("color", new Float32BufferAttribute(geometry.colors, 3)); - } - if (geometry.hasUVIndices === true) { - buffergeometry.setAttribute("uv", new Float32BufferAttribute(geometry.uvs, 2)); - } - const createdMaterials = []; - for (let mi = 0, miLen = materials.length; mi < miLen; mi++) { - const sourceMaterial = materials[mi]; - const materialHash = sourceMaterial.name + "_" + sourceMaterial.smooth + "_" + hasVertexColors; - let material = state.materials[materialHash]; - if (this.materials !== null) { - material = this.materials.create(sourceMaterial.name); - if (isLine && material && !(material instanceof LineBasicMaterial)) { - const materialLine = new LineBasicMaterial(); - Material.prototype.copy.call(materialLine, material); - materialLine.color.copy(material.color); - material = materialLine; - } else if (isPoints && material && !(material instanceof PointsMaterial)) { - const materialPoints = new PointsMaterial({ size: 10, sizeAttenuation: false }); - Material.prototype.copy.call(materialPoints, material); - materialPoints.color.copy(material.color); - materialPoints.map = material.map; - material = materialPoints; - } - } - if (material === void 0) { - if (isLine) { - material = new LineBasicMaterial(); - } else if (isPoints) { - material = new PointsMaterial({ size: 1, sizeAttenuation: false }); - } else { - material = new MeshPhongMaterial(); - } - material.name = sourceMaterial.name; - material.flatShading = sourceMaterial.smooth ? false : true; - material.vertexColors = hasVertexColors; - state.materials[materialHash] = material; - } - createdMaterials.push(material); - } - let mesh; - if (createdMaterials.length > 1) { - for (let mi = 0, miLen = materials.length; mi < miLen; mi++) { - const sourceMaterial = materials[mi]; - buffergeometry.addGroup(sourceMaterial.groupStart, sourceMaterial.groupCount, mi); - } - if (isLine) { - mesh = new LineSegments(buffergeometry, createdMaterials); - } else if (isPoints) { - mesh = new Points(buffergeometry, createdMaterials); - } else { - mesh = new Mesh(buffergeometry, createdMaterials); - } - } else { - if (isLine) { - mesh = new LineSegments(buffergeometry, createdMaterials[0]); - } else if (isPoints) { - mesh = new Points(buffergeometry, createdMaterials[0]); - } else { - mesh = new Mesh(buffergeometry, createdMaterials[0]); - } - } - mesh.name = object.name; - container.add(mesh); - } - } else { - if (state.vertices.length > 0) { - const material = new PointsMaterial({ size: 1, sizeAttenuation: false }); - const buffergeometry = new BufferGeometry(); - buffergeometry.setAttribute("position", new Float32BufferAttribute(state.vertices, 3)); - if (state.colors.length > 0 && state.colors[0] !== void 0) { - buffergeometry.setAttribute("color", new Float32BufferAttribute(state.colors, 3)); - material.vertexColors = true; - } - const points = new Points(buffergeometry, material); - container.add(points); - } - } - return container; - } -} -class STLLoader extends Loader { - static { - __name(this, "STLLoader"); - } - constructor(manager) { - super(manager); - } - load(url, onLoad, onProgress, onError) { - const scope = this; - const loader = new FileLoader(this.manager); - loader.setPath(this.path); - loader.setResponseType("arraybuffer"); - loader.setRequestHeader(this.requestHeader); - loader.setWithCredentials(this.withCredentials); - loader.load(url, function(text) { - try { - onLoad(scope.parse(text)); - } catch (e) { - if (onError) { - onError(e); - } else { - console.error(e); - } - scope.manager.itemError(url); - } - }, onProgress, onError); - } - parse(data) { - function isBinary(data2) { - const reader = new DataView(data2); - const face_size = 32 / 8 * 3 + 32 / 8 * 3 * 3 + 16 / 8; - const n_faces = reader.getUint32(80, true); - const expect = 80 + 32 / 8 + n_faces * face_size; - if (expect === reader.byteLength) { - return true; - } - const solid = [115, 111, 108, 105, 100]; - for (let off = 0; off < 5; off++) { - if (matchDataViewAt(solid, reader, off)) return false; - } - return true; - } - __name(isBinary, "isBinary"); - function matchDataViewAt(query, reader, offset) { - for (let i = 0, il = query.length; i < il; i++) { - if (query[i] !== reader.getUint8(offset + i)) return false; - } - return true; - } - __name(matchDataViewAt, "matchDataViewAt"); - function parseBinary(data2) { - const reader = new DataView(data2); - const faces = reader.getUint32(80, true); - let r, g, b, hasColors = false, colors; - let defaultR, defaultG, defaultB, alpha; - for (let index = 0; index < 80 - 10; index++) { - if (reader.getUint32(index, false) == 1129270351 && reader.getUint8(index + 4) == 82 && reader.getUint8(index + 5) == 61) { - hasColors = true; - colors = new Float32Array(faces * 3 * 3); - defaultR = reader.getUint8(index + 6) / 255; - defaultG = reader.getUint8(index + 7) / 255; - defaultB = reader.getUint8(index + 8) / 255; - alpha = reader.getUint8(index + 9) / 255; - } - } - const dataOffset = 84; - const faceLength = 12 * 4 + 2; - const geometry = new BufferGeometry(); - const vertices = new Float32Array(faces * 3 * 3); - const normals = new Float32Array(faces * 3 * 3); - const color = new Color(); - for (let face = 0; face < faces; face++) { - const start = dataOffset + face * faceLength; - const normalX = reader.getFloat32(start, true); - const normalY = reader.getFloat32(start + 4, true); - const normalZ = reader.getFloat32(start + 8, true); - if (hasColors) { - const packedColor = reader.getUint16(start + 48, true); - if ((packedColor & 32768) === 0) { - r = (packedColor & 31) / 31; - g = (packedColor >> 5 & 31) / 31; - b = (packedColor >> 10 & 31) / 31; - } else { - r = defaultR; - g = defaultG; - b = defaultB; - } - } - for (let i = 1; i <= 3; i++) { - const vertexstart = start + i * 12; - const componentIdx = face * 3 * 3 + (i - 1) * 3; - vertices[componentIdx] = reader.getFloat32(vertexstart, true); - vertices[componentIdx + 1] = reader.getFloat32(vertexstart + 4, true); - vertices[componentIdx + 2] = reader.getFloat32(vertexstart + 8, true); - normals[componentIdx] = normalX; - normals[componentIdx + 1] = normalY; - normals[componentIdx + 2] = normalZ; - if (hasColors) { - color.setRGB(r, g, b, SRGBColorSpace); - colors[componentIdx] = color.r; - colors[componentIdx + 1] = color.g; - colors[componentIdx + 2] = color.b; - } - } - } - geometry.setAttribute("position", new BufferAttribute(vertices, 3)); - geometry.setAttribute("normal", new BufferAttribute(normals, 3)); - if (hasColors) { - geometry.setAttribute("color", new BufferAttribute(colors, 3)); - geometry.hasColors = true; - geometry.alpha = alpha; - } - return geometry; - } - __name(parseBinary, "parseBinary"); - function parseASCII(data2) { - const geometry = new BufferGeometry(); - const patternSolid = /solid([\s\S]*?)endsolid/g; - const patternFace = /facet([\s\S]*?)endfacet/g; - const patternName = /solid\s(.+)/; - let faceCounter = 0; - const patternFloat = /[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source; - const patternVertex = new RegExp("vertex" + patternFloat + patternFloat + patternFloat, "g"); - const patternNormal = new RegExp("normal" + patternFloat + patternFloat + patternFloat, "g"); - const vertices = []; - const normals = []; - const groupNames = []; - const normal = new Vector3(); - let result; - let groupCount = 0; - let startVertex = 0; - let endVertex = 0; - while ((result = patternSolid.exec(data2)) !== null) { - startVertex = endVertex; - const solid = result[0]; - const name = (result = patternName.exec(solid)) !== null ? result[1] : ""; - groupNames.push(name); - while ((result = patternFace.exec(solid)) !== null) { - let vertexCountPerFace = 0; - let normalCountPerFace = 0; - const text = result[0]; - while ((result = patternNormal.exec(text)) !== null) { - normal.x = parseFloat(result[1]); - normal.y = parseFloat(result[2]); - normal.z = parseFloat(result[3]); - normalCountPerFace++; - } - while ((result = patternVertex.exec(text)) !== null) { - vertices.push(parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3])); - normals.push(normal.x, normal.y, normal.z); - vertexCountPerFace++; - endVertex++; - } - if (normalCountPerFace !== 1) { - console.error("THREE.STLLoader: Something isn't right with the normal of face number " + faceCounter); - } - if (vertexCountPerFace !== 3) { - console.error("THREE.STLLoader: Something isn't right with the vertices of face number " + faceCounter); - } - faceCounter++; - } - const start = startVertex; - const count = endVertex - startVertex; - geometry.userData.groupNames = groupNames; - geometry.addGroup(start, count, groupCount); - groupCount++; - } - geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3)); - geometry.setAttribute("normal", new Float32BufferAttribute(normals, 3)); - return geometry; - } - __name(parseASCII, "parseASCII"); - function ensureString(buffer) { - if (typeof buffer !== "string") { - return new TextDecoder().decode(buffer); - } - return buffer; - } - __name(ensureString, "ensureString"); - function ensureBinary(buffer) { - if (typeof buffer === "string") { - const array_buffer = new Uint8Array(buffer.length); - for (let i = 0; i < buffer.length; i++) { - array_buffer[i] = buffer.charCodeAt(i) & 255; - } - return array_buffer.buffer || array_buffer; - } else { - return buffer; - } - } - __name(ensureBinary, "ensureBinary"); - const binData = ensureBinary(data); - return isBinary(binData) ? parseBinary(binData) : parseASCII(ensureString(data)); - } -} -class LoaderManager { - static { - __name(this, "LoaderManager"); - } - gltfLoader; - objLoader; - mtlLoader; - fbxLoader; - stlLoader; - modelManager; - eventManager; - constructor(modelManager, eventManager) { - this.modelManager = modelManager; - this.eventManager = eventManager; - this.gltfLoader = new GLTFLoader(); - this.objLoader = new OBJLoader(); - this.mtlLoader = new MTLLoader(); - this.fbxLoader = new FBXLoader(); - this.stlLoader = new STLLoader(); - } - init() { - } - dispose() { - } - async loadModel(url, originalFileName) { - try { - this.eventManager.emitEvent("modelLoadingStart", null); - this.modelManager.clearModel(); - let fileExtension; - if (originalFileName) { - fileExtension = originalFileName.split(".").pop()?.toLowerCase(); - } else { - const filename = new URLSearchParams(url.split("?")[1]).get("filename"); - fileExtension = filename?.split(".").pop()?.toLowerCase(); - } - if (!fileExtension) { - useToastStore().addAlert("Could not determine file type"); - return; - } - let model = await this.loadModelInternal(url, fileExtension); - if (model) { - await this.modelManager.setupModel(model); - } - this.eventManager.emitEvent("modelLoadingEnd", null); - } catch (error) { - this.eventManager.emitEvent("modelLoadingEnd", null); - console.error("Error loading model:", error); - useToastStore().addAlert("Error loading model"); - } - } - async loadModelInternal(url, fileExtension) { - let model = null; - switch (fileExtension) { - case "stl": - const geometry = await this.stlLoader.loadAsync(url); - this.modelManager.setOriginalModel(geometry); - geometry.computeVertexNormals(); - const mesh = new Mesh( - geometry, - this.modelManager.standardMaterial - ); - const group = new Group(); - group.add(mesh); - model = group; - break; - case "fbx": - const fbxModel = await this.fbxLoader.loadAsync(url); - this.modelManager.setOriginalModel(fbxModel); - model = fbxModel; - fbxModel.traverse((child) => { - if (child instanceof Mesh) { - this.modelManager.originalMaterials.set(child, child.material); - } - }); - break; - case "obj": - if (this.modelManager.materialMode === "original") { - const mtlUrl = url.replace(/\.obj([^.]*$)/, ".mtl$1"); - try { - const materials = await this.mtlLoader.loadAsync(mtlUrl); - materials.preload(); - this.objLoader.setMaterials(materials); - } catch (e) { - console.log( - "No MTL file found or error loading it, continuing without materials" - ); - } - } - model = await this.objLoader.loadAsync(url); - model.traverse((child) => { - if (child instanceof Mesh) { - this.modelManager.originalMaterials.set(child, child.material); - } - }); - break; - case "gltf": - case "glb": - const gltf = await this.gltfLoader.loadAsync(url); - this.modelManager.setOriginalModel(gltf); - model = gltf.scene; - gltf.scene.traverse((child) => { - if (child instanceof Mesh) { - child.geometry.computeVertexNormals(); - this.modelManager.originalMaterials.set(child, child.material); - } - }); - break; - } - return model; - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.LoaderManager = window.comfyAPI.LoaderManager || {}; -window.comfyAPI.LoaderManager.LoaderManager = LoaderManager; -class ModelManager { - static { - __name(this, "ModelManager"); - } - currentModel = null; - originalModel = null; - originalRotation = null; - currentUpDirection = "original"; - materialMode = "original"; - originalMaterials = /* @__PURE__ */ new WeakMap(); - normalMaterial; - standardMaterial; - wireframeMaterial; - depthMaterial; - scene; - renderer; - eventManager; - activeCamera; - setupCamera; - constructor(scene, renderer, eventManager, getActiveCamera, setupCamera) { - this.scene = scene; - this.renderer = renderer; - this.eventManager = eventManager; - this.activeCamera = getActiveCamera(); - this.setupCamera = setupCamera; - this.normalMaterial = new MeshNormalMaterial({ - flatShading: false, - side: DoubleSide, - normalScale: new Vector2(1, 1), - transparent: false, - opacity: 1 - }); - this.wireframeMaterial = new MeshBasicMaterial({ - color: 16777215, - wireframe: true, - transparent: false, - opacity: 1 - }); - this.depthMaterial = new MeshDepthMaterial({ - depthPacking: BasicDepthPacking, - side: DoubleSide - }); - this.standardMaterial = this.createSTLMaterial(); - } - init() { - } - dispose() { - this.clearModel(); - this.normalMaterial.dispose(); - this.standardMaterial.dispose(); - this.wireframeMaterial.dispose(); - this.depthMaterial.dispose(); - } - createSTLMaterial() { - return new MeshStandardMaterial({ - color: 8421504, - metalness: 0.1, - roughness: 0.8, - flatShading: false, - side: DoubleSide - }); - } - setMaterialMode(mode) { - this.materialMode = mode; - if (!this.currentModel) return; - if (mode === "depth") { - this.renderer.outputColorSpace = LinearSRGBColorSpace; - } else { - this.renderer.outputColorSpace = SRGBColorSpace; - } - this.currentModel.traverse((child) => { - if (child instanceof Mesh) { - switch (mode) { - case "depth": - if (!this.originalMaterials.has(child)) { - this.originalMaterials.set(child, child.material); - } - const depthMat = new MeshDepthMaterial({ - depthPacking: BasicDepthPacking, - side: DoubleSide - }); - depthMat.onBeforeCompile = (shader) => { - shader.uniforms.cameraType = { - value: this.activeCamera instanceof OrthographicCamera ? 1 : 0 - }; - shader.fragmentShader = ` - uniform float cameraType; - ${shader.fragmentShader} - `; - shader.fragmentShader = shader.fragmentShader.replace( - /gl_FragColor\s*=\s*vec4\(\s*vec3\(\s*1.0\s*-\s*fragCoordZ\s*\)\s*,\s*opacity\s*\)\s*;/, - ` - float depth = 1.0 - fragCoordZ; - if (cameraType > 0.5) { - depth = pow(depth, 400.0); - } else { - depth = pow(depth, 0.6); - } - gl_FragColor = vec4(vec3(depth), opacity); - ` - ); - }; - depthMat.customProgramCacheKey = () => { - return this.activeCamera instanceof OrthographicCamera ? "ortho" : "persp"; - }; - child.material = depthMat; - break; - case "normal": - if (!this.originalMaterials.has(child)) { - this.originalMaterials.set(child, child.material); - } - child.material = new MeshNormalMaterial({ - flatShading: false, - side: DoubleSide, - normalScale: new Vector2(1, 1), - transparent: false, - opacity: 1 - }); - break; - case "wireframe": - if (!this.originalMaterials.has(child)) { - this.originalMaterials.set(child, child.material); - } - child.material = new MeshBasicMaterial({ - color: 16777215, - wireframe: true, - transparent: false, - opacity: 1 - }); - break; - case "original": - const originalMaterial = this.originalMaterials.get(child); - if (originalMaterial) { - child.material = originalMaterial; - } else { - child.material = this.standardMaterial; - } - break; - } - } - }); - this.eventManager.emitEvent("materialModeChange", mode); - } - setupModelMaterials(model) { - model.traverse((child) => { - if (child instanceof Mesh) { - this.originalMaterials.set(child, child.material); - } - }); - if (this.materialMode !== "original") { - this.setMaterialMode(this.materialMode); - } - } - clearModel() { - const objectsToRemove = []; - this.scene.traverse((object) => { - const isEnvironmentObject = object instanceof GridHelper || object instanceof Light || object instanceof Camera; - if (!isEnvironmentObject) { - objectsToRemove.push(object); - } - }); - objectsToRemove.forEach((obj) => { - if (obj.parent && obj.parent !== this.scene) { - obj.parent.remove(obj); - } else { - this.scene.remove(obj); - } - if (obj instanceof Mesh) { - obj.geometry?.dispose(); - if (Array.isArray(obj.material)) { - obj.material.forEach((material) => material.dispose()); - } else { - obj.material?.dispose(); - } - } - }); - this.reset(); - } - reset() { - this.currentModel = null; - this.originalRotation = null; - this.currentUpDirection = "original"; - this.setMaterialMode("original"); - this.originalMaterials = /* @__PURE__ */ new WeakMap(); - } - async setupModel(model) { - this.currentModel = model; - const box = new Box3().setFromObject(model); - const size = box.getSize(new Vector3()); - const center = box.getCenter(new Vector3()); - const maxDim = Math.max(size.x, size.y, size.z); - const targetSize = 5; - const scale = targetSize / maxDim; - model.scale.multiplyScalar(scale); - box.setFromObject(model); - box.getCenter(center); - box.getSize(size); - model.position.set(-center.x, -box.min.y, -center.z); - this.scene.add(model); - if (this.materialMode !== "original") { - this.setMaterialMode(this.materialMode); - } - if (this.currentUpDirection !== "original") { - this.setUpDirection(this.currentUpDirection); - } - this.setupModelMaterials(model); - this.setupCamera(size); - } - setOriginalModel(model) { - this.originalModel = model; - } - setUpDirection(direction) { - if (!this.currentModel) return; - if (!this.originalRotation && this.currentModel.rotation) { - this.originalRotation = this.currentModel.rotation.clone(); - } - this.currentUpDirection = direction; - if (this.originalRotation) { - this.currentModel.rotation.copy(this.originalRotation); - } - switch (direction) { - case "original": - break; - case "-x": - this.currentModel.rotation.z = Math.PI / 2; - break; - case "+x": - this.currentModel.rotation.z = -Math.PI / 2; - break; - case "-y": - this.currentModel.rotation.x = Math.PI; - break; - case "+y": - break; - case "-z": - this.currentModel.rotation.x = Math.PI / 2; - break; - case "+z": - this.currentModel.rotation.x = -Math.PI / 2; - break; - } - this.eventManager.emitEvent("upDirectionChange", direction); - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.ModelManager = window.comfyAPI.ModelManager || {}; -window.comfyAPI.ModelManager.ModelManager = ModelManager; -class NodeStorage { - static { - __name(this, "NodeStorage"); - } - node; - constructor(node = {}) { - this.node = node; - } - storeNodeProperty(name, value) { - if (this.node && this.node.properties) { - this.node.properties[name] = value; - } - } - loadNodeProperty(name, defaultValue) { - if (!this.node || !this.node.properties || !(name in this.node.properties)) { - return defaultValue; - } - return this.node.properties[name]; - } - setNode(node) { - this.node = node; - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.NodeStorage = window.comfyAPI.NodeStorage || {}; -window.comfyAPI.NodeStorage.NodeStorage = NodeStorage; -class PreviewManager { - static { - __name(this, "PreviewManager"); - } - previewRenderer = null; - previewCamera; - previewContainer = {}; - showPreview = true; - previewWidth = 120; - targetWidth = 1024; - targetHeight = 1024; - scene; - getActiveCamera; - getControls; - eventManager; - getRenderer; - previewBackgroundScene; - previewBackgroundCamera; - previewBackgroundMesh = null; - previewBackgroundTexture = null; - constructor(scene, getActiveCamera, getControls, getRenderer, eventManager, backgroundScene, backgroundCamera) { - this.scene = scene; - this.getActiveCamera = getActiveCamera; - this.getControls = getControls; - this.getRenderer = getRenderer; - this.eventManager = eventManager; - this.previewCamera = this.getActiveCamera().clone(); - this.previewBackgroundScene = backgroundScene.clone(); - this.previewBackgroundCamera = backgroundCamera.clone(); - const planeGeometry = new PlaneGeometry(2, 2); - const planeMaterial = new MeshBasicMaterial({ - transparent: true, - depthWrite: false, - depthTest: false, - side: DoubleSide - }); - this.previewBackgroundMesh = new Mesh(planeGeometry, planeMaterial); - this.previewBackgroundMesh.position.set(0, 0, 0); - this.previewBackgroundScene.add(this.previewBackgroundMesh); - } - init() { - } - dispose() { - if (this.previewRenderer) { - this.previewRenderer.dispose(); - } - if (this.previewBackgroundTexture) { - this.previewBackgroundTexture.dispose(); - } - if (this.previewBackgroundMesh) { - this.previewBackgroundMesh.geometry.dispose(); - this.previewBackgroundMesh.material.dispose(); - } - } - createCapturePreview(container) { - this.previewRenderer = new WebGLRenderer({ - alpha: true, - antialias: true, - preserveDrawingBuffer: true - }); - this.previewRenderer.setSize(this.targetWidth, this.targetHeight); - this.previewRenderer.setClearColor(2631720); - this.previewRenderer.autoClear = false; - this.previewRenderer.outputColorSpace = SRGBColorSpace; - this.previewContainer = document.createElement("div"); - this.previewContainer.style.cssText = ` - position: absolute; - right: 0; - bottom: 0; - background: rgba(0, 0, 0, 0.2); - display: block; - transition: border-color 0.1s ease; - `; - this.previewContainer.appendChild(this.previewRenderer.domElement); - const MIN_PREVIEW_WIDTH = 120; - const MAX_PREVIEW_WIDTH = 240; - this.previewContainer.addEventListener("wheel", (event) => { - event.preventDefault(); - event.stopPropagation(); - const delta = event.deltaY; - const oldWidth = this.previewWidth; - if (delta > 0) { - this.previewWidth = Math.max(MIN_PREVIEW_WIDTH, this.previewWidth - 10); - } else { - this.previewWidth = Math.min(MAX_PREVIEW_WIDTH, this.previewWidth + 10); - } - if (oldWidth !== this.previewWidth && (this.previewWidth === MIN_PREVIEW_WIDTH || this.previewWidth === MAX_PREVIEW_WIDTH)) { - this.flashPreviewBorder(); - } - this.updatePreviewSize(); - this.updatePreviewRender(); - }); - this.previewContainer.style.display = this.showPreview ? "block" : "none"; - container.appendChild(this.previewContainer); - this.updatePreviewSize(); - } - flashPreviewBorder() { - const originalBorder = this.previewContainer.style.border; - const originalBoxShadow = this.previewContainer.style.boxShadow; - this.previewContainer.style.border = "2px solid rgba(255, 255, 255, 0.8)"; - this.previewContainer.style.boxShadow = "0 0 8px rgba(255, 255, 255, 0.5)"; - setTimeout(() => { - this.previewContainer.style.border = originalBorder; - this.previewContainer.style.boxShadow = originalBoxShadow; - }, 100); - } - updatePreviewSize() { - if (!this.previewContainer) return; - const previewHeight = this.previewWidth * this.targetHeight / this.targetWidth; - this.previewRenderer?.setSize(this.previewWidth, previewHeight, false); - } - updatePreviewRender() { - if (!this.previewRenderer || !this.previewContainer || !this.showPreview) - return; - if (!this.previewCamera || this.getActiveCamera() instanceof PerspectiveCamera && !(this.previewCamera instanceof PerspectiveCamera) || this.getActiveCamera() instanceof OrthographicCamera && !(this.previewCamera instanceof OrthographicCamera)) { - this.previewCamera = this.getActiveCamera().clone(); - } - this.previewCamera.position.copy(this.getActiveCamera().position); - this.previewCamera.rotation.copy(this.getActiveCamera().rotation); - const aspect2 = this.targetWidth / this.targetHeight; - if (this.getActiveCamera() instanceof OrthographicCamera) { - const activeOrtho = this.getActiveCamera(); - const previewOrtho = this.previewCamera; - const frustumHeight = (activeOrtho.top - activeOrtho.bottom) / activeOrtho.zoom; - const frustumWidth = frustumHeight * aspect2; - previewOrtho.top = frustumHeight / 2; - previewOrtho.left = -frustumWidth / 2; - previewOrtho.right = frustumWidth / 2; - previewOrtho.bottom = -frustumHeight / 2; - previewOrtho.zoom = 1; - previewOrtho.updateProjectionMatrix(); - } else { - ; - this.previewCamera.aspect = aspect2; - this.previewCamera.fov = this.getActiveCamera().fov; - this.previewCamera.updateProjectionMatrix(); - } - this.previewCamera.lookAt(this.getControls().target); - const previewHeight = this.previewWidth * this.targetHeight / this.targetWidth; - this.previewRenderer.setSize(this.previewWidth, previewHeight, false); - this.previewRenderer.outputColorSpace = SRGBColorSpace; - this.previewRenderer.clear(); - if (this.previewBackgroundMesh && this.previewBackgroundTexture) { - const material = this.previewBackgroundMesh.material; - if (material.map) { - const currentToneMapping = this.previewRenderer.toneMapping; - const currentExposure = this.previewRenderer.toneMappingExposure; - this.previewRenderer.toneMapping = NoToneMapping; - this.previewRenderer.render( - this.previewBackgroundScene, - this.previewBackgroundCamera - ); - this.previewRenderer.toneMapping = currentToneMapping; - this.previewRenderer.toneMappingExposure = currentExposure; - } - } - this.previewRenderer.render(this.scene, this.previewCamera); - } - togglePreview(showPreview) { - if (this.previewRenderer) { - this.showPreview = showPreview; - this.previewContainer.style.display = this.showPreview ? "block" : "none"; - } - this.eventManager.emitEvent("showPreviewChange", showPreview); - } - setTargetSize(width, height) { - const oldAspect = this.targetWidth / this.targetHeight; - this.targetWidth = width; - this.targetHeight = height; - this.updatePreviewSize(); - const newAspect = width / height; - if (Math.abs(oldAspect - newAspect) > 1e-3) { - this.updateBackgroundSize( - this.previewBackgroundTexture, - this.previewBackgroundMesh, - width, - height - ); - } - if (this.previewRenderer && this.previewCamera) { - if (this.previewCamera instanceof PerspectiveCamera) { - this.previewCamera.aspect = width / height; - this.previewCamera.updateProjectionMatrix(); - } else if (this.previewCamera instanceof OrthographicCamera) { - const frustumSize = 10; - const aspect2 = width / height; - this.previewCamera.left = -frustumSize * aspect2 / 2; - this.previewCamera.right = frustumSize * aspect2 / 2; - this.previewCamera.updateProjectionMatrix(); - } - } - } - handleResize() { - this.updatePreviewSize(); - this.updatePreviewRender(); - } - updateBackgroundTexture(texture) { - if (this.previewBackgroundTexture) { - this.previewBackgroundTexture.dispose(); - } - this.previewBackgroundTexture = texture; - if (texture && this.previewBackgroundMesh) { - const material2 = this.previewBackgroundMesh.material; - material2.map = texture; - material2.needsUpdate = true; - this.previewBackgroundMesh.position.set(0, 0, 0); - this.updateBackgroundSize( - this.previewBackgroundTexture, - this.previewBackgroundMesh, - this.targetWidth, - this.targetHeight - ); - } - } - updateBackgroundSize(backgroundTexture, backgroundMesh, targetWidth, targetHeight) { - if (!backgroundTexture || !backgroundMesh) return; - const material = backgroundMesh.material; - if (!material.map) return; - const imageAspect = backgroundTexture.image.width / backgroundTexture.image.height; - const targetAspect = targetWidth / targetHeight; - if (imageAspect > targetAspect) { - backgroundMesh.scale.set(imageAspect / targetAspect, 1, 1); - } else { - backgroundMesh.scale.set(1, targetAspect / imageAspect, 1); - } - material.needsUpdate = true; - } - reset() { - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.PreviewManager = window.comfyAPI.PreviewManager || {}; -window.comfyAPI.PreviewManager.PreviewManager = PreviewManager; -class Load3dUtils { - static { - __name(this, "Load3dUtils"); - } - static async uploadTempImage(imageData, prefix) { - const blob = await fetch(imageData).then((r) => r.blob()); - const name = `${prefix}_${Date.now()}.png`; - const file2 = new File([blob], name); - const body = new FormData(); - body.append("image", file2); - body.append("subfolder", "threed"); - body.append("type", "temp"); - const resp = await api.fetchApi("/upload/image", { - method: "POST", - body - }); - if (resp.status !== 200) { - const err2 = `Error uploading temp image: ${resp.status} - ${resp.statusText}`; - useToastStore().addAlert(err2); - throw new Error(err2); - } - return await resp.json(); - } - static async uploadFile(file2) { - let uploadPath; - try { - const body = new FormData(); - body.append("image", file2); - body.append("subfolder", "3d"); - const resp = await api.fetchApi("/upload/image", { - method: "POST", - body - }); - if (resp.status === 200) { - const data = await resp.json(); - let path = data.name; - if (data.subfolder) { - path = data.subfolder + "/" + path; - } - uploadPath = path; - } else { - useToastStore().addAlert(resp.status + " - " + resp.statusText); - } - } catch (error) { - console.error("Upload error:", error); - useToastStore().addAlert( - error instanceof Error ? error.message : "Upload failed" - ); - } - return uploadPath; - } - static splitFilePath(path) { - const folder_separator = path.lastIndexOf("/"); - if (folder_separator === -1) { - return ["", path]; - } - return [ - path.substring(0, folder_separator), - path.substring(folder_separator + 1) - ]; - } - static getResourceURL(subfolder, filename, type = "input") { - const params = [ - "filename=" + encodeURIComponent(filename), - "type=" + type, - "subfolder=" + subfolder, - app.getRandParam().substring(1) - ].join("&"); - return `/view?${params}`; - } -} -class SceneManager { - static { - __name(this, "SceneManager"); - } - scene; - gridHelper; - backgroundScene; - backgroundCamera; - backgroundMesh = null; - backgroundTexture = null; - eventManager; - renderer; - getActiveCamera; - getControls; - constructor(renderer, getActiveCamera, getControls, eventManager) { - this.renderer = renderer; - this.eventManager = eventManager; - this.scene = new Scene(); - this.getActiveCamera = getActiveCamera; - this.getControls = getControls; - this.gridHelper = new GridHelper(20, 20); - this.gridHelper.position.set(0, 0, 0); - this.scene.add(this.gridHelper); - this.backgroundScene = new Scene(); - this.backgroundCamera = new OrthographicCamera(-1, 1, 1, -1, -1, 1); - const planeGeometry = new PlaneGeometry(2, 2); - const planeMaterial = new MeshBasicMaterial({ - transparent: true, - depthWrite: false, - depthTest: false, - side: DoubleSide - }); - this.backgroundMesh = new Mesh(planeGeometry, planeMaterial); - this.backgroundMesh.position.set(0, 0, 0); - this.backgroundScene.add(this.backgroundMesh); - } - init() { - } - dispose() { - if (this.backgroundTexture) { - this.backgroundTexture.dispose(); - } - if (this.backgroundMesh) { - this.backgroundMesh.geometry.dispose(); - this.backgroundMesh.material.dispose(); - } - this.scene.clear(); - } - toggleGrid(showGrid) { - if (this.gridHelper) { - this.gridHelper.visible = showGrid; - } - this.eventManager.emitEvent("showGridChange", showGrid); - } - setBackgroundColor(color) { - this.renderer.setClearColor(new Color(color)); - this.eventManager.emitEvent("backgroundColorChange", color); - } - async setBackgroundImage(uploadPath) { - if (uploadPath === "") { - this.removeBackgroundImage(); - return; - } - let imageUrl = Load3dUtils.getResourceURL( - ...Load3dUtils.splitFilePath(uploadPath) - ); - if (!imageUrl.startsWith("/api")) { - imageUrl = "/api" + imageUrl; - } - try { - const textureLoader = new TextureLoader(); - const texture = await new Promise((resolve, reject) => { - textureLoader.load(imageUrl, resolve, void 0, reject); - }); - if (this.backgroundTexture) { - this.backgroundTexture.dispose(); - } - texture.colorSpace = SRGBColorSpace; - this.backgroundTexture = texture; - const material = this.backgroundMesh?.material; - material.map = texture; - material.needsUpdate = true; - this.backgroundMesh?.position.set(0, 0, 0); - this.updateBackgroundSize( - this.backgroundTexture, - this.backgroundMesh, - this.renderer.domElement.width, - this.renderer.domElement.height - ); - this.eventManager.emitEvent("backgroundImageChange", uploadPath); - } catch (error) { - console.error("Error loading background image:", error); - } - } - removeBackgroundImage() { - if (this.backgroundMesh) { - const material = this.backgroundMesh.material; - material.map = null; - material.needsUpdate = true; - } - if (this.backgroundTexture) { - this.backgroundTexture.dispose(); - this.backgroundTexture = null; - } - } - updateBackgroundSize(backgroundTexture, backgroundMesh, targetWidth, targetHeight) { - if (!backgroundTexture || !backgroundMesh) return; - const material = backgroundMesh.material; - if (!material.map) return; - const imageAspect = backgroundTexture.image.width / backgroundTexture.image.height; - const targetAspect = targetWidth / targetHeight; - if (imageAspect > targetAspect) { - backgroundMesh.scale.set(imageAspect / targetAspect, 1, 1); - } else { - backgroundMesh.scale.set(1, targetAspect / imageAspect, 1); - } - material.needsUpdate = true; - } - handleResize(width, height) { - if (this.backgroundTexture && this.backgroundMesh) { - this.updateBackgroundSize( - this.backgroundTexture, - this.backgroundMesh, - width, - height - ); - } - } - renderBackground() { - if (this.backgroundMesh && this.backgroundTexture) { - const material = this.backgroundMesh.material; - if (material.map) { - const currentToneMapping = this.renderer.toneMapping; - const currentExposure = this.renderer.toneMappingExposure; - this.renderer.toneMapping = NoToneMapping; - this.renderer.render(this.backgroundScene, this.backgroundCamera); - this.renderer.toneMapping = currentToneMapping; - this.renderer.toneMappingExposure = currentExposure; - } - } - } - captureScene(width, height) { - return new Promise(async (resolve, reject) => { - try { - const originalWidth = this.renderer.domElement.width; - const originalHeight = this.renderer.domElement.height; - const originalClearColor = this.renderer.getClearColor( - new Color() - ); - const originalClearAlpha = this.renderer.getClearAlpha(); - const originalToneMapping = this.renderer.toneMapping; - const originalExposure = this.renderer.toneMappingExposure; - this.renderer.setSize(width, height); - if (this.getActiveCamera() instanceof PerspectiveCamera) { - const perspectiveCamera = this.getActiveCamera(); - perspectiveCamera.aspect = width / height; - perspectiveCamera.updateProjectionMatrix(); - } else { - const orthographicCamera = this.getActiveCamera(); - const frustumSize = 10; - const aspect2 = width / height; - orthographicCamera.left = -frustumSize * aspect2 / 2; - orthographicCamera.right = frustumSize * aspect2 / 2; - orthographicCamera.top = frustumSize / 2; - orthographicCamera.bottom = -frustumSize / 2; - orthographicCamera.updateProjectionMatrix(); - } - if (this.backgroundTexture && this.backgroundMesh) { - this.updateBackgroundSize( - this.backgroundTexture, - this.backgroundMesh, - width, - height - ); - } - this.renderer.clear(); - if (this.backgroundMesh && this.backgroundTexture) { - const material = this.backgroundMesh.material; - if (material.map) { - this.renderer.toneMapping = NoToneMapping; - this.renderer.render(this.backgroundScene, this.backgroundCamera); - this.renderer.toneMapping = originalToneMapping; - this.renderer.toneMappingExposure = originalExposure; - } - } - this.renderer.render(this.scene, this.getActiveCamera()); - const sceneData = this.renderer.domElement.toDataURL("image/png"); - this.renderer.setClearColor(0, 0); - this.renderer.clear(); - this.renderer.render(this.scene, this.getActiveCamera()); - const maskData = this.renderer.domElement.toDataURL("image/png"); - this.renderer.setClearColor(originalClearColor, originalClearAlpha); - this.renderer.setSize(originalWidth, originalHeight); - this.handleResize(width, height); - resolve({ scene: sceneData, mask: maskData }); - } catch (error) { - reject(error); - } - }); - } - reset() { - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.SceneManager = window.comfyAPI.SceneManager || {}; -window.comfyAPI.SceneManager.SceneManager = SceneManager; -class ViewHelper extends Object3D { - static { - __name(this, "ViewHelper"); - } - constructor(camera, domElement) { - super(); - this.isViewHelper = true; - this.animating = false; - this.center = new Vector3(); - const color1 = new Color("#ff4466"); - const color2 = new Color("#88ff44"); - const color3 = new Color("#4488ff"); - const color4 = new Color("#000000"); - const options = {}; - const interactiveObjects = []; - const raycaster = new Raycaster(); - const mouse = new Vector2(); - const dummy = new Object3D(); - const orthoCamera = new OrthographicCamera(-2, 2, 2, -2, 0, 4); - orthoCamera.position.set(0, 0, 2); - const geometry = new CylinderGeometry(0.04, 0.04, 0.8, 5).rotateZ(-Math.PI / 2).translate(0.4, 0, 0); - const xAxis = new Mesh(geometry, getAxisMaterial(color1)); - const yAxis = new Mesh(geometry, getAxisMaterial(color2)); - const zAxis = new Mesh(geometry, getAxisMaterial(color3)); - yAxis.rotation.z = Math.PI / 2; - zAxis.rotation.y = -Math.PI / 2; - this.add(xAxis); - this.add(zAxis); - this.add(yAxis); - const spriteMaterial1 = getSpriteMaterial(color1); - const spriteMaterial2 = getSpriteMaterial(color2); - const spriteMaterial3 = getSpriteMaterial(color3); - const spriteMaterial4 = getSpriteMaterial(color4); - const posXAxisHelper = new Sprite(spriteMaterial1); - const posYAxisHelper = new Sprite(spriteMaterial2); - const posZAxisHelper = new Sprite(spriteMaterial3); - const negXAxisHelper = new Sprite(spriteMaterial4); - const negYAxisHelper = new Sprite(spriteMaterial4); - const negZAxisHelper = new Sprite(spriteMaterial4); - posXAxisHelper.position.x = 1; - posYAxisHelper.position.y = 1; - posZAxisHelper.position.z = 1; - negXAxisHelper.position.x = -1; - negYAxisHelper.position.y = -1; - negZAxisHelper.position.z = -1; - negXAxisHelper.material.opacity = 0.2; - negYAxisHelper.material.opacity = 0.2; - negZAxisHelper.material.opacity = 0.2; - posXAxisHelper.userData.type = "posX"; - posYAxisHelper.userData.type = "posY"; - posZAxisHelper.userData.type = "posZ"; - negXAxisHelper.userData.type = "negX"; - negYAxisHelper.userData.type = "negY"; - negZAxisHelper.userData.type = "negZ"; - this.add(posXAxisHelper); - this.add(posYAxisHelper); - this.add(posZAxisHelper); - this.add(negXAxisHelper); - this.add(negYAxisHelper); - this.add(negZAxisHelper); - interactiveObjects.push(posXAxisHelper); - interactiveObjects.push(posYAxisHelper); - interactiveObjects.push(posZAxisHelper); - interactiveObjects.push(negXAxisHelper); - interactiveObjects.push(negYAxisHelper); - interactiveObjects.push(negZAxisHelper); - const point = new Vector3(); - const dim = 128; - const turnRate = 2 * Math.PI; - this.render = function(renderer) { - this.quaternion.copy(camera.quaternion).invert(); - this.updateMatrixWorld(); - point.set(0, 0, 1); - point.applyQuaternion(camera.quaternion); - const x = domElement.offsetWidth - dim; - renderer.clearDepth(); - renderer.getViewport(viewport); - renderer.setViewport(x, 0, dim, dim); - renderer.render(this, orthoCamera); - renderer.setViewport(viewport.x, viewport.y, viewport.z, viewport.w); - }; - const targetPosition = new Vector3(); - const targetQuaternion = new Quaternion(); - const q1 = new Quaternion(); - const q2 = new Quaternion(); - const viewport = new Vector4(); - let radius = 0; - this.handleClick = function(event) { - if (this.animating === true) return false; - const rect = domElement.getBoundingClientRect(); - const offsetX = rect.left + (domElement.offsetWidth - dim); - const offsetY = rect.top + (domElement.offsetHeight - dim); - mouse.x = (event.clientX - offsetX) / (rect.right - offsetX) * 2 - 1; - mouse.y = -((event.clientY - offsetY) / (rect.bottom - offsetY)) * 2 + 1; - raycaster.setFromCamera(mouse, orthoCamera); - const intersects2 = raycaster.intersectObjects(interactiveObjects); - if (intersects2.length > 0) { - const intersection = intersects2[0]; - const object = intersection.object; - prepareAnimationData(object, this.center); - this.animating = true; - return true; - } else { - return false; - } - }; - this.setLabels = function(labelX, labelY, labelZ) { - options.labelX = labelX; - options.labelY = labelY; - options.labelZ = labelZ; - updateLabels(); - }; - this.setLabelStyle = function(font, color, radius2) { - options.font = font; - options.color = color; - options.radius = radius2; - updateLabels(); - }; - this.update = function(delta) { - const step = delta * turnRate; - q1.rotateTowards(q2, step); - camera.position.set(0, 0, 1).applyQuaternion(q1).multiplyScalar(radius).add(this.center); - camera.quaternion.rotateTowards(targetQuaternion, step); - if (q1.angleTo(q2) === 0) { - this.animating = false; - } - }; - this.dispose = function() { - geometry.dispose(); - xAxis.material.dispose(); - yAxis.material.dispose(); - zAxis.material.dispose(); - posXAxisHelper.material.map.dispose(); - posYAxisHelper.material.map.dispose(); - posZAxisHelper.material.map.dispose(); - negXAxisHelper.material.map.dispose(); - negYAxisHelper.material.map.dispose(); - negZAxisHelper.material.map.dispose(); - posXAxisHelper.material.dispose(); - posYAxisHelper.material.dispose(); - posZAxisHelper.material.dispose(); - negXAxisHelper.material.dispose(); - negYAxisHelper.material.dispose(); - negZAxisHelper.material.dispose(); - }; - function prepareAnimationData(object, focusPoint) { - switch (object.userData.type) { - case "posX": - targetPosition.set(1, 0, 0); - targetQuaternion.setFromEuler(new Euler(0, Math.PI * 0.5, 0)); - break; - case "posY": - targetPosition.set(0, 1, 0); - targetQuaternion.setFromEuler(new Euler(-Math.PI * 0.5, 0, 0)); - break; - case "posZ": - targetPosition.set(0, 0, 1); - targetQuaternion.setFromEuler(new Euler()); - break; - case "negX": - targetPosition.set(-1, 0, 0); - targetQuaternion.setFromEuler(new Euler(0, -Math.PI * 0.5, 0)); - break; - case "negY": - targetPosition.set(0, -1, 0); - targetQuaternion.setFromEuler(new Euler(Math.PI * 0.5, 0, 0)); - break; - case "negZ": - targetPosition.set(0, 0, -1); - targetQuaternion.setFromEuler(new Euler(0, Math.PI, 0)); - break; - default: - console.error("ViewHelper: Invalid axis."); - } - radius = camera.position.distanceTo(focusPoint); - targetPosition.multiplyScalar(radius).add(focusPoint); - dummy.position.copy(focusPoint); - dummy.lookAt(camera.position); - q1.copy(dummy.quaternion); - dummy.lookAt(targetPosition); - q2.copy(dummy.quaternion); - } - __name(prepareAnimationData, "prepareAnimationData"); - function getAxisMaterial(color) { - return new MeshBasicMaterial({ color, toneMapped: false }); - } - __name(getAxisMaterial, "getAxisMaterial"); - function getSpriteMaterial(color, text) { - const { font = "24px Arial", color: labelColor = "#000000", radius: radius2 = 14 } = options; - const canvas = document.createElement("canvas"); - canvas.width = 64; - canvas.height = 64; - const context = canvas.getContext("2d"); - context.beginPath(); - context.arc(32, 32, radius2, 0, 2 * Math.PI); - context.closePath(); - context.fillStyle = color.getStyle(); - context.fill(); - if (text) { - context.font = font; - context.textAlign = "center"; - context.fillStyle = labelColor; - context.fillText(text, 32, 41); - } - const texture = new CanvasTexture(canvas); - texture.colorSpace = SRGBColorSpace; - return new SpriteMaterial({ map: texture, toneMapped: false }); - } - __name(getSpriteMaterial, "getSpriteMaterial"); - function updateLabels() { - posXAxisHelper.material.map.dispose(); - posYAxisHelper.material.map.dispose(); - posZAxisHelper.material.map.dispose(); - posXAxisHelper.material.dispose(); - posYAxisHelper.material.dispose(); - posZAxisHelper.material.dispose(); - posXAxisHelper.material = getSpriteMaterial(color1, options.labelX); - posYAxisHelper.material = getSpriteMaterial(color2, options.labelY); - posZAxisHelper.material = getSpriteMaterial(color3, options.labelZ); - } - __name(updateLabels, "updateLabels"); - } -} -class ViewHelperManager { - static { - __name(this, "ViewHelperManager"); - } - viewHelper = {}; - viewHelperContainer = {}; - getActiveCamera; - getControls; - nodeStorage; - renderer; - constructor(renderer, getActiveCamera, getControls, nodeStorage) { - this.renderer = renderer; - this.getActiveCamera = getActiveCamera; - this.getControls = getControls; - this.nodeStorage = nodeStorage; - } - init() { - } - dispose() { - if (this.viewHelper) { - this.viewHelper.dispose(); - } - if (this.viewHelperContainer && this.viewHelperContainer.parentNode) { - this.viewHelperContainer.parentNode.removeChild(this.viewHelperContainer); - } - } - createViewHelper(container) { - this.viewHelperContainer = document.createElement("div"); - this.viewHelperContainer.style.position = "absolute"; - this.viewHelperContainer.style.bottom = "0"; - this.viewHelperContainer.style.left = "0"; - this.viewHelperContainer.style.width = "128px"; - this.viewHelperContainer.style.height = "128px"; - this.viewHelperContainer.addEventListener("pointerup", (event) => { - event.stopPropagation(); - this.viewHelper.handleClick(event); - }); - this.viewHelperContainer.addEventListener("pointerdown", (event) => { - event.stopPropagation(); - }); - container.appendChild(this.viewHelperContainer); - this.viewHelper = new ViewHelper( - this.getActiveCamera(), - this.viewHelperContainer - ); - this.viewHelper.center = this.getControls().target; - } - update(delta) { - if (this.viewHelper.animating) { - this.viewHelper.update(delta); - if (!this.viewHelper.animating) { - this.nodeStorage.storeNodeProperty("Camera Info", { - position: this.getActiveCamera().position.clone(), - target: this.getControls().target.clone(), - zoom: this.getActiveCamera() instanceof OrthographicCamera ? this.getActiveCamera().zoom : this.getActiveCamera().zoom, - cameraType: this.getActiveCamera() instanceof PerspectiveCamera ? "perspective" : "orthographic" - }); - } - } - } - handleResize() { - } - recreateViewHelper() { - if (this.viewHelper) { - this.viewHelper.dispose(); - } - this.viewHelper = new ViewHelper( - this.getActiveCamera(), - this.viewHelperContainer - ); - this.viewHelper.center = this.getControls().target; - } - reset() { - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.ViewHelperManager = window.comfyAPI.ViewHelperManager || {}; -window.comfyAPI.ViewHelperManager.ViewHelperManager = ViewHelperManager; -class Load3d { - static { - __name(this, "Load3d"); - } - renderer; - clock; - animationFrameId = null; - node; - eventManager; - nodeStorage; - sceneManager; - cameraManager; - controlsManager; - lightingManager; - viewHelperManager; - previewManager; - loaderManager; - modelManager; - constructor(container, options = { - node: {} - }) { - this.node = options.node || {}; - this.clock = new Clock(); - this.renderer = new WebGLRenderer({ alpha: true, antialias: true }); - this.renderer.setSize(300, 300); - this.renderer.setClearColor(2631720); - this.renderer.autoClear = false; - this.renderer.outputColorSpace = SRGBColorSpace; - container.appendChild(this.renderer.domElement); - this.eventManager = new EventManager(); - this.nodeStorage = new NodeStorage(this.node); - this.sceneManager = new SceneManager( - this.renderer, - this.getActiveCamera.bind(this), - this.getControls.bind(this), - this.eventManager - ); - this.cameraManager = new CameraManager( - this.renderer, - this.eventManager, - this.nodeStorage - ); - this.controlsManager = new ControlsManager( - this.renderer, - this.cameraManager.activeCamera, - this.eventManager, - this.nodeStorage - ); - this.cameraManager.setControls(this.controlsManager.controls); - this.lightingManager = new LightingManager( - this.sceneManager.scene, - this.eventManager - ); - this.viewHelperManager = new ViewHelperManager( - this.renderer, - this.getActiveCamera.bind(this), - this.getControls.bind(this), - this.nodeStorage - ); - this.previewManager = new PreviewManager( - this.sceneManager.scene, - this.getActiveCamera.bind(this), - this.getControls.bind(this), - () => this.renderer, - this.eventManager, - this.sceneManager.backgroundScene, - this.sceneManager.backgroundCamera - ); - this.modelManager = new ModelManager( - this.sceneManager.scene, - this.renderer, - this.eventManager, - this.getActiveCamera.bind(this), - this.setupCamera.bind(this) - ); - this.loaderManager = new LoaderManager(this.modelManager, this.eventManager); - this.sceneManager.init(); - this.cameraManager.init(); - this.controlsManager.init(); - this.lightingManager.init(); - this.loaderManager.init(); - this.loaderManager.init(); - this.viewHelperManager.createViewHelper(container); - this.viewHelperManager.init(); - if (options && options.createPreview) { - this.previewManager.createCapturePreview(container); - this.previewManager.init(); - } - this.handleResize(); - this.startAnimation(); - } - getActiveCamera() { - return this.cameraManager.activeCamera; - } - getControls() { - return this.controlsManager.controls; - } - setupCamera(size) { - this.cameraManager.setupForModel(size); - } - startAnimation() { - const animate = /* @__PURE__ */ __name(() => { - this.animationFrameId = requestAnimationFrame(animate); - if (this.previewManager.showPreview) { - this.previewManager.updatePreviewRender(); - } - const delta = this.clock.getDelta(); - this.viewHelperManager.update(delta); - this.controlsManager.update(); - this.renderer.clear(); - this.sceneManager.renderBackground(); - this.renderer.render( - this.sceneManager.scene, - this.cameraManager.activeCamera - ); - if (this.viewHelperManager.viewHelper.render) { - this.viewHelperManager.viewHelper.render(this.renderer); - } - }, "animate"); - animate(); - } - setBackgroundColor(color) { - this.sceneManager.setBackgroundColor(color); - this.renderer.render( - this.sceneManager.scene, - this.cameraManager.activeCamera - ); - } - async setBackgroundImage(uploadPath) { - await this.sceneManager.setBackgroundImage(uploadPath); - if (this.previewManager.previewRenderer) { - this.previewManager.updateBackgroundTexture( - this.sceneManager.backgroundTexture - ); - } - } - removeBackgroundImage() { - this.sceneManager.removeBackgroundImage(); - if (this.previewManager.previewRenderer && this.previewManager.previewCamera) { - this.previewManager.updateBackgroundTexture(null); - } - } - toggleGrid(showGrid) { - this.sceneManager.toggleGrid(showGrid); - } - toggleCamera(cameraType) { - this.cameraManager.toggleCamera(cameraType); - this.controlsManager.updateCamera(this.cameraManager.activeCamera); - this.viewHelperManager.recreateViewHelper(); - this.handleResize(); - } - getCurrentCameraType() { - return this.cameraManager.getCurrentCameraType(); - } - setCameraState(state) { - this.cameraManager.setCameraState(state); - } - getCameraState() { - return this.cameraManager.getCameraState(); - } - setFOV(fov2) { - this.cameraManager.setFOV(fov2); - this.renderer.render( - this.sceneManager.scene, - this.cameraManager.activeCamera - ); - } - setMaterialMode(mode) { - this.modelManager.setMaterialMode(mode); - this.renderer.render( - this.sceneManager.scene, - this.cameraManager.activeCamera - ); - } - async loadModel(url, originalFileName) { - this.cameraManager.reset(); - this.controlsManager.reset(); - this.modelManager.reset(); - await this.loaderManager.loadModel(url, originalFileName); - this.handleResize(); - } - clearModel() { - this.modelManager.clearModel(); - } - setUpDirection(direction) { - this.modelManager.setUpDirection(direction); - this.renderer.render( - this.sceneManager.scene, - this.cameraManager.activeCamera - ); - } - setLightIntensity(intensity) { - this.lightingManager.setLightIntensity(intensity); - } - togglePreview(showPreview) { - this.previewManager.togglePreview(showPreview); - } - setTargetSize(width, height) { - this.previewManager.setTargetSize(width, height); - } - addEventListener(event, callback) { - this.eventManager.addEventListener(event, callback); - } - removeEventListener(event, callback) { - this.eventManager.removeEventListener(event, callback); - } - refreshViewport() { - this.handleResize(); - } - handleResize() { - const parentElement = this.renderer?.domElement?.parentElement; - if (!parentElement) { - console.warn("Parent element not found"); - return; - } - const width = parentElement.clientWidth; - const height = parentElement.clientHeight; - this.cameraManager.handleResize(width, height); - this.sceneManager.handleResize(width, height); - this.renderer.setSize(width, height); - this.previewManager.handleResize(); - } - captureScene(width, height) { - return this.sceneManager.captureScene(width, height); - } - loadNodeProperty(name, defaultValue) { - return this.nodeStorage.loadNodeProperty(name, defaultValue); - } - remove() { - if (this.animationFrameId !== null) { - cancelAnimationFrame(this.animationFrameId); - } - this.sceneManager.dispose(); - this.cameraManager.dispose(); - this.controlsManager.dispose(); - this.lightingManager.dispose(); - this.viewHelperManager.dispose(); - this.previewManager.dispose(); - this.loaderManager.dispose(); - this.modelManager.dispose(); - this.renderer.dispose(); - this.renderer.domElement.remove(); - } -} -class AnimationManager { - static { - __name(this, "AnimationManager"); - } - currentAnimation = null; - animationActions = []; - animationClips = []; - selectedAnimationIndex = 0; - isAnimationPlaying = false; - animationSpeed = 1; - eventManager; - getCurrentModel; - constructor(eventManager, getCurrentModel) { - this.eventManager = eventManager; - this.getCurrentModel = getCurrentModel; - } - init() { - } - dispose() { - if (this.currentAnimation) { - this.animationActions.forEach((action) => { - action.stop(); - }); - this.currentAnimation = null; - } - this.animationActions = []; - this.animationClips = []; - this.selectedAnimationIndex = 0; - this.isAnimationPlaying = false; - this.animationSpeed = 1; - this.eventManager.emitEvent("animationListChange", []); - } - setupModelAnimations(model, originalModel) { - if (this.currentAnimation) { - this.currentAnimation.stopAllAction(); - this.animationActions = []; - } - let animations = []; - if (model.animations?.length > 0) { - animations = model.animations; - } else if (originalModel && "animations" in originalModel) { - animations = originalModel.animations; - } - if (animations.length > 0) { - this.animationClips = animations; - if (model.type === "Scene") { - this.currentAnimation = new AnimationMixer(model); - } else { - this.currentAnimation = new AnimationMixer( - this.getCurrentModel() - ); - } - if (this.animationClips.length > 0) { - this.updateSelectedAnimation(0); - } - } - this.updateAnimationList(); - } - updateAnimationList() { - let updatedAnimationList = []; - if (this.animationClips.length > 0) { - updatedAnimationList = this.animationClips.map((clip, index) => ({ - name: clip.name || `Animation ${index + 1}`, - index - })); - } - this.eventManager.emitEvent("animationListChange", updatedAnimationList); - } - setAnimationSpeed(speed) { - this.animationSpeed = speed; - this.animationActions.forEach((action) => { - action.setEffectiveTimeScale(speed); - }); - } - updateSelectedAnimation(index) { - if (!this.currentAnimation || !this.animationClips || index >= this.animationClips.length) { - console.warn("Invalid animation update request"); - return; - } - this.animationActions.forEach((action2) => { - action2.stop(); - }); - this.currentAnimation.stopAllAction(); - this.animationActions = []; - this.selectedAnimationIndex = index; - const clip = this.animationClips[index]; - const action = this.currentAnimation.clipAction(clip); - action.setEffectiveTimeScale(this.animationSpeed); - action.reset(); - action.clampWhenFinished = false; - action.loop = LoopRepeat; - if (this.isAnimationPlaying) { - action.play(); - } else { - action.play(); - action.paused = true; - } - this.animationActions = [action]; - } - toggleAnimation(play) { - if (!this.currentAnimation || this.animationActions.length === 0) { - console.warn("No animation to toggle"); - return; - } - this.isAnimationPlaying = play ?? !this.isAnimationPlaying; - this.animationActions.forEach((action) => { - if (this.isAnimationPlaying) { - action.paused = false; - if (action.time === 0 || action.time === action.getClip().duration) { - action.reset(); - } - } else { - action.paused = true; - } - }); - } - update(delta) { - if (this.currentAnimation && this.isAnimationPlaying) { - this.currentAnimation.update(delta); - } - } - reset() { - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.AnimationManager = window.comfyAPI.AnimationManager || {}; -window.comfyAPI.AnimationManager.AnimationManager = AnimationManager; -class Load3dAnimation extends Load3d { - static { - __name(this, "Load3dAnimation"); - } - animationManager; - constructor(container, options = { - node: {} - }) { - super(container, options); - this.animationManager = new AnimationManager( - this.eventManager, - this.getCurrentModel.bind(this) - ); - this.animationManager.init(); - this.overrideAnimationLoop(); - } - getCurrentModel() { - return this.modelManager.currentModel; - } - overrideAnimationLoop() { - if (this.animationFrameId !== null) { - cancelAnimationFrame(this.animationFrameId); - } - const animate = /* @__PURE__ */ __name(() => { - this.animationFrameId = requestAnimationFrame(animate); - if (this.previewManager.showPreview) { - this.previewManager.updatePreviewRender(); - } - const delta = this.clock.getDelta(); - this.animationManager.update(delta); - this.viewHelperManager.update(delta); - this.controlsManager.update(); - this.renderer.clear(); - this.sceneManager.renderBackground(); - this.renderer.render( - this.sceneManager.scene, - this.cameraManager.activeCamera - ); - if (this.viewHelperManager.viewHelper.render) { - this.viewHelperManager.viewHelper.render(this.renderer); - } - }, "animate"); - animate(); - } - async loadModel(url, originalFileName) { - await super.loadModel(url, originalFileName); - if (this.modelManager.currentModel) { - this.animationManager.setupModelAnimations( - this.modelManager.currentModel, - this.modelManager.originalModel - ); - } - } - clearModel() { - this.animationManager.dispose(); - super.clearModel(); - } - updateAnimationList() { - this.animationManager.updateAnimationList(); - } - setAnimationSpeed(speed) { - this.animationManager.setAnimationSpeed(speed); - } - updateSelectedAnimation(index) { - this.animationManager.updateSelectedAnimation(index); - } - toggleAnimation(play) { - this.animationManager.toggleAnimation(play); - } - get isAnimationPlaying() { - return this.animationManager.isAnimationPlaying; - } - get animationSpeed() { - return this.animationManager.animationSpeed; - } - get selectedAnimationIndex() { - return this.animationManager.selectedAnimationIndex; - } - get animationClips() { - return this.animationManager.animationClips; - } - get animationActions() { - return this.animationManager.animationActions; - } - get currentAnimation() { - return this.animationManager.currentAnimation; - } - remove() { - this.animationManager.dispose(); - super.remove(); - } -} -class Load3dService { - static { - __name(this, "Load3dService"); - } - static instance; - nodeToLoad3dMap = /* @__PURE__ */ new Map(); - constructor() { - } - static getInstance() { - if (!Load3dService.instance) { - Load3dService.instance = new Load3dService(); - } - return Load3dService.instance; - } - registerLoad3d(node, container, type) { - const rawNode = toRaw(node); - if (this.nodeToLoad3dMap.has(rawNode)) { - this.removeLoad3d(rawNode); - } - const isAnimation = type.includes("Animation"); - const Load3dClass = isAnimation ? Load3dAnimation : Load3d; - const isPreview = type.includes("Preview"); - const instance = new Load3dClass(container, { - createPreview: !isPreview, - node: rawNode - }); - rawNode.onMouseEnter = function() { - instance.refreshViewport(); - }; - rawNode.onResize = function() { - instance.handleResize(); - }; - rawNode.onDrawBackground = function() { - instance.renderer.domElement.hidden = this.flags.collapsed ?? false; - }; - this.nodeToLoad3dMap.set(rawNode, instance); - return instance; - } - getLoad3d(node) { - const rawNode = toRaw(node); - return this.nodeToLoad3dMap.get(rawNode) || null; - } - getNodeByLoad3d(load3d) { - for (const [node, instance] of this.nodeToLoad3dMap) { - if (instance === load3d) { - return node; - } - } - return null; - } - removeLoad3d(node) { - const rawNode = toRaw(node); - const instance = this.nodeToLoad3dMap.get(rawNode); - if (instance) { - instance.remove(); - this.nodeToLoad3dMap.delete(rawNode); - } - } - clear() { - for (const [node] of this.nodeToLoad3dMap) { - this.removeLoad3d(node); - } - } -} -const useLoad3dService = /* @__PURE__ */ __name(() => { - return Load3dService.getInstance(); -}, "useLoad3dService"); -const _sfc_main$4 = /* @__PURE__ */ defineComponent({ - __name: "Load3DScene", - props: { - node: {}, - type: {}, - backgroundColor: {}, - showGrid: { type: Boolean }, - lightIntensity: {}, - fov: {}, - cameraType: {}, - showPreview: { type: Boolean }, - backgroundImage: {}, - upDirection: {}, - materialMode: {}, - extraListeners: {} - }, - emits: ["materialModeChange", "backgroundColorChange", "lightIntensityChange", "fovChange", "cameraTypeChange", "showGridChange", "showPreviewChange", "backgroundImageChange", "upDirectionChange"], - setup(__props, { expose: __expose, emit: __emit }) { - const props = __props; - const container = ref(null); - const node = ref(props.node); - const load3d = ref(null); - const loadingOverlayRef = ref(null); - const eventConfig = { - materialModeChange: /* @__PURE__ */ __name((value) => emit("materialModeChange", value), "materialModeChange"), - backgroundColorChange: /* @__PURE__ */ __name((value) => emit("backgroundColorChange", value), "backgroundColorChange"), - lightIntensityChange: /* @__PURE__ */ __name((value) => emit("lightIntensityChange", value), "lightIntensityChange"), - fovChange: /* @__PURE__ */ __name((value) => emit("fovChange", value), "fovChange"), - cameraTypeChange: /* @__PURE__ */ __name((value) => emit("cameraTypeChange", value), "cameraTypeChange"), - showGridChange: /* @__PURE__ */ __name((value) => emit("showGridChange", value), "showGridChange"), - showPreviewChange: /* @__PURE__ */ __name((value) => emit("showPreviewChange", value), "showPreviewChange"), - backgroundImageChange: /* @__PURE__ */ __name((value) => emit("backgroundImageChange", value), "backgroundImageChange"), - upDirectionChange: /* @__PURE__ */ __name((value) => emit("upDirectionChange", value), "upDirectionChange"), - modelLoadingStart: /* @__PURE__ */ __name(() => loadingOverlayRef.value?.startLoading(), "modelLoadingStart"), - modelLoadingEnd: /* @__PURE__ */ __name(() => loadingOverlayRef.value?.endLoading(), "modelLoadingEnd") - }; - watchEffect(() => { - if (load3d.value) { - const rawLoad3d = toRaw(load3d.value); - rawLoad3d.setBackgroundColor(props.backgroundColor); - rawLoad3d.toggleGrid(props.showGrid); - rawLoad3d.setLightIntensity(props.lightIntensity); - rawLoad3d.setFOV(props.fov); - rawLoad3d.toggleCamera(props.cameraType); - rawLoad3d.togglePreview(props.showPreview); - rawLoad3d.setBackgroundImage(props.backgroundImage); - rawLoad3d.setUpDirection(props.upDirection); - rawLoad3d.setMaterialMode(props.materialMode); - } - }); - const emit = __emit; - const handleEvents = /* @__PURE__ */ __name((action) => { - if (!load3d.value) return; - Object.entries(eventConfig).forEach(([event, handler]) => { - const method = `${action}EventListener`; - load3d.value?.[method](event, handler); - }); - if (props.extraListeners) { - Object.entries(props.extraListeners).forEach(([event, handler]) => { - const method = `${action}EventListener`; - load3d.value?.[method](event, handler); - }); - } - }, "handleEvents"); - onMounted(() => { - load3d.value = useLoad3dService().registerLoad3d( - node.value, - container.value, - props.type - ); - handleEvents("add"); - }); - onUnmounted(() => { - handleEvents("remove"); - useLoad3dService().removeLoad3d(node.value); - }); - __expose({ - load3d - }); - return (_ctx, _cache2) => { - return openBlock(), createElementBlock("div", { - ref_key: "container", - ref: container, - class: "w-full h-full relative" - }, [ - createVNode(LoadingOverlay, { - ref_key: "loadingOverlayRef", - ref: loadingOverlayRef - }, null, 512) - ], 512); - }; - } -}); -const _hoisted_1$2 = { class: "relative w-full h-full" }; -const _sfc_main$3 = /* @__PURE__ */ defineComponent({ - __name: "Load3D", - props: { - node: {}, - type: {} - }, - setup(__props) { - const props = __props; - const node = ref(props.node); - const backgroundColor = ref("#000000"); - const showGrid = ref(true); - const showPreview = ref(false); - const lightIntensity = ref(5); - const showLightIntensityButton = ref(true); - const fov2 = ref(75); - const showFOVButton = ref(true); - const cameraType = ref("perspective"); - const hasBackgroundImage = ref(false); - const backgroundImage = ref(""); - const upDirection = ref("original"); - const materialMode = ref("original"); - const showPreviewButton = computed(() => { - return !props.type.includes("Preview"); - }); - const switchCamera = /* @__PURE__ */ __name(() => { - cameraType.value = cameraType.value === "perspective" ? "orthographic" : "perspective"; - showFOVButton.value = cameraType.value === "perspective"; - node.value.properties["Camera Type"] = cameraType.value; - }, "switchCamera"); - const togglePreview = /* @__PURE__ */ __name((value) => { - showPreview.value = value; - node.value.properties["Show Preview"] = showPreview.value; - }, "togglePreview"); - const toggleGrid = /* @__PURE__ */ __name((value) => { - showGrid.value = value; - node.value.properties["Show Grid"] = showGrid.value; - }, "toggleGrid"); - const handleUpdateLightIntensity = /* @__PURE__ */ __name((value) => { - lightIntensity.value = value; - node.value.properties["Light Intensity"] = lightIntensity.value; - }, "handleUpdateLightIntensity"); - const handleBackgroundImageUpdate = /* @__PURE__ */ __name(async (file2) => { - if (!file2) { - hasBackgroundImage.value = false; - backgroundImage.value = ""; - node.value.properties["Background Image"] = ""; - return; - } - backgroundImage.value = await Load3dUtils.uploadFile(file2); - node.value.properties["Background Image"] = backgroundImage.value; - }, "handleBackgroundImageUpdate"); - const handleUpdateFOV = /* @__PURE__ */ __name((value) => { - fov2.value = value; - node.value.properties["FOV"] = fov2.value; - }, "handleUpdateFOV"); - const handleBackgroundColorChange = /* @__PURE__ */ __name((value) => { - backgroundColor.value = value; - node.value.properties["Background Color"] = value; - }, "handleBackgroundColorChange"); - const handleUpdateUpDirection = /* @__PURE__ */ __name((value) => { - upDirection.value = value; - node.value.properties["Up Direction"] = value; - }, "handleUpdateUpDirection"); - const handleUpdateMaterialMode = /* @__PURE__ */ __name((value) => { - materialMode.value = value; - node.value.properties["Material Mode"] = value; - }, "handleUpdateMaterialMode"); - const listenMaterialModeChange = /* @__PURE__ */ __name((mode) => { - materialMode.value = mode; - showLightIntensityButton.value = mode === "original"; - }, "listenMaterialModeChange"); - const listenUpDirectionChange = /* @__PURE__ */ __name((value) => { - upDirection.value = value; - }, "listenUpDirectionChange"); - const listenBackgroundColorChange = /* @__PURE__ */ __name((value) => { - backgroundColor.value = value; - }, "listenBackgroundColorChange"); - const listenLightIntensityChange = /* @__PURE__ */ __name((value) => { - lightIntensity.value = value; - }, "listenLightIntensityChange"); - const listenFOVChange = /* @__PURE__ */ __name((value) => { - fov2.value = value; - }, "listenFOVChange"); - const listenCameraTypeChange = /* @__PURE__ */ __name((value) => { - cameraType.value = value; - showFOVButton.value = cameraType.value === "perspective"; - }, "listenCameraTypeChange"); - const listenShowGridChange = /* @__PURE__ */ __name((value) => { - showGrid.value = value; - }, "listenShowGridChange"); - const listenShowPreviewChange = /* @__PURE__ */ __name((value) => { - showPreview.value = value; - }, "listenShowPreviewChange"); - const listenBackgroundImageChange = /* @__PURE__ */ __name((value) => { - backgroundImage.value = value; - if (backgroundImage.value && backgroundImage.value !== "") { - hasBackgroundImage.value = true; - } - }, "listenBackgroundImageChange"); - return (_ctx, _cache2) => { - return openBlock(), createElementBlock("div", _hoisted_1$2, [ - createVNode(_sfc_main$4, { - node: node.value, - type: _ctx.type, - backgroundColor: backgroundColor.value, - showGrid: showGrid.value, - lightIntensity: lightIntensity.value, - fov: fov2.value, - cameraType: cameraType.value, - showPreview: showPreview.value, - backgroundImage: backgroundImage.value, - upDirection: upDirection.value, - materialMode: materialMode.value, - onMaterialModeChange: listenMaterialModeChange, - onBackgroundColorChange: listenBackgroundColorChange, - onLightIntensityChange: listenLightIntensityChange, - onFovChange: listenFOVChange, - onCameraTypeChange: listenCameraTypeChange, - onShowGridChange: listenShowGridChange, - onShowPreviewChange: listenShowPreviewChange, - onBackgroundImageChange: listenBackgroundImageChange, - onUpDirectionChange: listenUpDirectionChange - }, null, 8, ["node", "type", "backgroundColor", "showGrid", "lightIntensity", "fov", "cameraType", "showPreview", "backgroundImage", "upDirection", "materialMode"]), - createVNode(_sfc_main$6, { - backgroundColor: backgroundColor.value, - showGrid: showGrid.value, - showPreview: showPreview.value, - lightIntensity: lightIntensity.value, - showLightIntensityButton: showLightIntensityButton.value, - fov: fov2.value, - showFOVButton: showFOVButton.value, - showPreviewButton: showPreviewButton.value, - cameraType: cameraType.value, - hasBackgroundImage: hasBackgroundImage.value, - upDirection: upDirection.value, - materialMode: materialMode.value, - onUpdateBackgroundImage: handleBackgroundImageUpdate, - onSwitchCamera: switchCamera, - onToggleGrid: toggleGrid, - onUpdateBackgroundColor: handleBackgroundColorChange, - onUpdateLightIntensity: handleUpdateLightIntensity, - onTogglePreview: togglePreview, - onUpdateFOV: handleUpdateFOV, - onUpdateUpDirection: handleUpdateUpDirection, - onUpdateMaterialMode: handleUpdateMaterialMode - }, null, 8, ["backgroundColor", "showGrid", "showPreview", "lightIntensity", "showLightIntensityButton", "fov", "showFOVButton", "showPreviewButton", "cameraType", "hasBackgroundImage", "upDirection", "materialMode"]) - ]); - }; - } -}); -const _hoisted_1$1 = { - key: 0, - class: "absolute top-0 left-0 w-full flex justify-center pt-2 gap-2 items-center pointer-events-auto z-10" -}; -const _sfc_main$2 = /* @__PURE__ */ defineComponent({ - __name: "Load3DAnimationControls", - props: { - animations: {}, - playing: { type: Boolean } - }, - emits: ["togglePlay", "speedChange", "animationChange"], - setup(__props, { emit: __emit }) { - const props = __props; - const emit = __emit; - const animations = ref(props.animations); - const playing = ref(props.playing); - const selectedSpeed = ref(1); - const selectedAnimation = ref(0); - const speedOptions = [ - { name: "0.1x", value: 0.1 }, - { name: "0.5x", value: 0.5 }, - { name: "1x", value: 1 }, - { name: "1.5x", value: 1.5 }, - { name: "2x", value: 2 } - ]; - watch( - () => props.animations, - (newVal) => { - animations.value = newVal; - } - ); - const togglePlay = /* @__PURE__ */ __name(() => { - playing.value = !playing.value; - emit("togglePlay", playing.value); - }, "togglePlay"); - const speedChange = /* @__PURE__ */ __name(() => { - emit("speedChange", selectedSpeed.value); - }, "speedChange"); - const animationChange = /* @__PURE__ */ __name(() => { - emit("animationChange", selectedAnimation.value); - }, "animationChange"); - return (_ctx, _cache2) => { - return animations.value && animations.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$1, [ - createVNode(unref(script), { - class: "p-button-rounded p-button-text", - onClick: togglePlay - }, { - default: withCtx(() => [ - createBaseVNode("i", { - class: normalizeClass(["pi", playing.value ? "pi-pause" : "pi-play", "text-white text-lg"]) - }, null, 2) - ]), - _: 1 - }), - createVNode(unref(script$2), { - modelValue: selectedSpeed.value, - "onUpdate:modelValue": _cache2[0] || (_cache2[0] = ($event) => selectedSpeed.value = $event), - options: speedOptions, - optionLabel: "name", - optionValue: "value", - onChange: speedChange, - class: "w-24" - }, null, 8, ["modelValue"]), - createVNode(unref(script$2), { - modelValue: selectedAnimation.value, - "onUpdate:modelValue": _cache2[1] || (_cache2[1] = ($event) => selectedAnimation.value = $event), - options: animations.value, - optionLabel: "name", - optionValue: "index", - onChange: animationChange, - class: "w-32" - }, null, 8, ["modelValue", "options"]) - ])) : createCommentVNode("", true); - }; - } -}); -const _sfc_main$1 = /* @__PURE__ */ defineComponent({ - __name: "Load3DAnimationScene", - props: { - node: {}, - type: {}, - backgroundColor: {}, - showGrid: { type: Boolean }, - lightIntensity: {}, - fov: {}, - cameraType: {}, - showPreview: { type: Boolean }, - materialMode: {}, - upDirection: {}, - showFOVButton: { type: Boolean }, - showLightIntensityButton: { type: Boolean }, - playing: { type: Boolean }, - selectedSpeed: {}, - selectedAnimation: {}, - backgroundImage: {} - }, - emits: ["animationListChange"], - setup(__props, { emit: __emit }) { - const props = __props; - const node = ref(props.node); - const backgroundColor = ref(props.backgroundColor); - const showPreview = ref(props.showPreview); - const fov2 = ref(props.fov); - const lightIntensity = ref(props.lightIntensity); - const cameraType = ref(props.cameraType); - const showGrid = ref(props.showGrid); - const upDirection = ref(props.upDirection); - const materialMode = ref(props.materialMode); - const showFOVButton = ref(props.showFOVButton); - const showLightIntensityButton = ref(props.showLightIntensityButton); - const load3DSceneRef = ref(null); - watch( - () => props.cameraType, - (newValue) => { - cameraType.value = newValue; - } - ); - watch( - () => props.showGrid, - (newValue) => { - showGrid.value = newValue; - } - ); - watch( - () => props.backgroundColor, - (newValue) => { - backgroundColor.value = newValue; - } - ); - watch( - () => props.lightIntensity, - (newValue) => { - lightIntensity.value = newValue; - } - ); - watch( - () => props.fov, - (newValue) => { - fov2.value = newValue; - } - ); - watch( - () => props.upDirection, - (newValue) => { - upDirection.value = newValue; - } - ); - watch( - () => props.materialMode, - (newValue) => { - materialMode.value = newValue; - } - ); - watch( - () => props.showPreview, - (newValue) => { - showPreview.value = newValue; - } - ); - watch( - () => props.playing, - (newValue) => { - load3DSceneRef.value.load3d.toggleAnimation(newValue); - } - ); - watch( - () => props.selectedSpeed, - (newValue) => { - load3DSceneRef.value.load3d.setAnimationSpeed(newValue); - } - ); - watch( - () => props.selectedAnimation, - (newValue) => { - load3DSceneRef.value.load3d.updateSelectedAnimation(newValue); - } - ); - const emit = __emit; - const listenMaterialModeChange = /* @__PURE__ */ __name((mode) => { - materialMode.value = mode; - showLightIntensityButton.value = mode === "original"; - }, "listenMaterialModeChange"); - const listenBackgroundColorChange = /* @__PURE__ */ __name((value) => { - backgroundColor.value = value; - }, "listenBackgroundColorChange"); - const listenLightIntensityChange = /* @__PURE__ */ __name((value) => { - lightIntensity.value = value; - }, "listenLightIntensityChange"); - const listenFOVChange = /* @__PURE__ */ __name((value) => { - fov2.value = value; - }, "listenFOVChange"); - const listenCameraTypeChange = /* @__PURE__ */ __name((value) => { - cameraType.value = value; - showFOVButton.value = cameraType.value === "perspective"; - }, "listenCameraTypeChange"); - const listenShowGridChange = /* @__PURE__ */ __name((value) => { - showGrid.value = value; - }, "listenShowGridChange"); - const listenShowPreviewChange = /* @__PURE__ */ __name((value) => { - showPreview.value = value; - }, "listenShowPreviewChange"); - const animationListeners = { - animationListChange: /* @__PURE__ */ __name((newValue) => { - emit("animationListChange", newValue); - }, "animationListChange") - }; - return (_ctx, _cache2) => { - return openBlock(), createBlock(_sfc_main$4, { - node: node.value, - type: _ctx.type, - backgroundColor: backgroundColor.value, - showGrid: showGrid.value, - lightIntensity: lightIntensity.value, - fov: fov2.value, - cameraType: cameraType.value, - showPreview: showPreview.value, - extraListeners: animationListeners, - backgroundImage: _ctx.backgroundImage, - upDirection: upDirection.value, - materialMode: materialMode.value, - onMaterialModeChange: listenMaterialModeChange, - onBackgroundColorChange: listenBackgroundColorChange, - onLightIntensityChange: listenLightIntensityChange, - onFovChange: listenFOVChange, - onCameraTypeChange: listenCameraTypeChange, - onShowGridChange: listenShowGridChange, - onShowPreviewChange: listenShowPreviewChange, - ref_key: "load3DSceneRef", - ref: load3DSceneRef - }, null, 8, ["node", "type", "backgroundColor", "showGrid", "lightIntensity", "fov", "cameraType", "showPreview", "backgroundImage", "upDirection", "materialMode"]); - }; - } -}); -const _hoisted_1 = { class: "relative w-full h-full" }; -const _hoisted_2 = { class: "absolute top-0 left-0 w-full h-full pointer-events-none" }; -const _sfc_main = /* @__PURE__ */ defineComponent({ - __name: "Load3DAnimation", - props: { - node: {}, - type: {} - }, - setup(__props) { - const props = __props; - const node = ref(props.node); - const backgroundColor = ref("#000000"); - const showGrid = ref(true); - const showPreview = ref(false); - const lightIntensity = ref(5); - const showLightIntensityButton = ref(true); - const fov2 = ref(75); - const showFOVButton = ref(true); - const cameraType = ref("perspective"); - const hasBackgroundImage = ref(false); - const animations = ref([]); - const playing = ref(false); - const selectedSpeed = ref(1); - const selectedAnimation = ref(0); - const backgroundImage = ref(""); - const showPreviewButton = computed(() => { - return !props.type.includes("Preview"); - }); - const switchCamera = /* @__PURE__ */ __name(() => { - cameraType.value = cameraType.value === "perspective" ? "orthographic" : "perspective"; - showFOVButton.value = cameraType.value === "perspective"; - node.value.properties["Camera Type"] = cameraType.value; - }, "switchCamera"); - const togglePreview = /* @__PURE__ */ __name((value) => { - showPreview.value = value; - node.value.properties["Show Preview"] = showPreview.value; - }, "togglePreview"); - const toggleGrid = /* @__PURE__ */ __name((value) => { - showGrid.value = value; - node.value.properties["Show Grid"] = showGrid.value; - }, "toggleGrid"); - const handleUpdateLightIntensity = /* @__PURE__ */ __name((value) => { - lightIntensity.value = value; - node.value.properties["Light Intensity"] = lightIntensity.value; - }, "handleUpdateLightIntensity"); - const handleBackgroundImageUpdate = /* @__PURE__ */ __name(async (file2) => { - if (!file2) { - hasBackgroundImage.value = false; - backgroundImage.value = ""; - node.value.properties["Background Image"] = ""; - return; - } - backgroundImage.value = await Load3dUtils.uploadFile(file2); - node.value.properties["Background Image"] = backgroundImage.value; - }, "handleBackgroundImageUpdate"); - const handleUpdateFOV = /* @__PURE__ */ __name((value) => { - fov2.value = value; - node.value.properties["FOV"] = fov2.value; - }, "handleUpdateFOV"); - const materialMode = ref("original"); - const upDirection = ref("original"); - const handleUpdateUpDirection = /* @__PURE__ */ __name((value) => { - upDirection.value = value; - node.value.properties["Up Direction"] = value; - }, "handleUpdateUpDirection"); - const handleUpdateMaterialMode = /* @__PURE__ */ __name((value) => { - materialMode.value = value; - node.value.properties["Material Mode"] = value; - }, "handleUpdateMaterialMode"); - const handleBackgroundColorChange = /* @__PURE__ */ __name((value) => { - backgroundColor.value = value; - node.value.properties["Background Color"] = value; - }, "handleBackgroundColorChange"); - const togglePlay = /* @__PURE__ */ __name((value) => { - playing.value = value; - }, "togglePlay"); - const speedChange = /* @__PURE__ */ __name((value) => { - selectedSpeed.value = value; - }, "speedChange"); - const animationChange = /* @__PURE__ */ __name((value) => { - selectedAnimation.value = value; - }, "animationChange"); - const animationListChange = /* @__PURE__ */ __name((value) => { - animations.value = value; - }, "animationListChange"); - const listenMaterialModeChange = /* @__PURE__ */ __name((mode) => { - materialMode.value = mode; - showLightIntensityButton.value = mode === "original"; - }, "listenMaterialModeChange"); - const listenUpDirectionChange = /* @__PURE__ */ __name((value) => { - upDirection.value = value; - }, "listenUpDirectionChange"); - const listenBackgroundColorChange = /* @__PURE__ */ __name((value) => { - backgroundColor.value = value; - }, "listenBackgroundColorChange"); - const listenLightIntensityChange = /* @__PURE__ */ __name((value) => { - lightIntensity.value = value; - }, "listenLightIntensityChange"); - const listenFOVChange = /* @__PURE__ */ __name((value) => { - fov2.value = value; - }, "listenFOVChange"); - const listenCameraTypeChange = /* @__PURE__ */ __name((value) => { - cameraType.value = value; - showFOVButton.value = cameraType.value === "perspective"; - }, "listenCameraTypeChange"); - const listenShowGridChange = /* @__PURE__ */ __name((value) => { - showGrid.value = value; - }, "listenShowGridChange"); - const listenShowPreviewChange = /* @__PURE__ */ __name((value) => { - showPreview.value = value; - }, "listenShowPreviewChange"); - const listenBackgroundImageChange = /* @__PURE__ */ __name((value) => { - backgroundImage.value = value; - if (backgroundImage.value && backgroundImage.value !== "") { - hasBackgroundImage.value = true; - } - }, "listenBackgroundImageChange"); - return (_ctx, _cache2) => { - return openBlock(), createElementBlock("div", _hoisted_1, [ - createVNode(_sfc_main$1, { - node: node.value, - type: _ctx.type, - backgroundColor: backgroundColor.value, - showGrid: showGrid.value, - lightIntensity: lightIntensity.value, - fov: fov2.value, - cameraType: cameraType.value, - showPreview: showPreview.value, - showFOVButton: showFOVButton.value, - showLightIntensityButton: showLightIntensityButton.value, - playing: playing.value, - selectedSpeed: selectedSpeed.value, - selectedAnimation: selectedAnimation.value, - backgroundImage: backgroundImage.value, - upDirection: upDirection.value, - materialMode: materialMode.value, - onMaterialModeChange: listenMaterialModeChange, - onBackgroundColorChange: listenBackgroundColorChange, - onLightIntensityChange: listenLightIntensityChange, - onFovChange: listenFOVChange, - onCameraTypeChange: listenCameraTypeChange, - onShowGridChange: listenShowGridChange, - onShowPreviewChange: listenShowPreviewChange, - onBackgroundImageChange: listenBackgroundImageChange, - onAnimationListChange: animationListChange, - onUpDirectionChange: listenUpDirectionChange - }, null, 8, ["node", "type", "backgroundColor", "showGrid", "lightIntensity", "fov", "cameraType", "showPreview", "showFOVButton", "showLightIntensityButton", "playing", "selectedSpeed", "selectedAnimation", "backgroundImage", "upDirection", "materialMode"]), - createBaseVNode("div", _hoisted_2, [ - createVNode(_sfc_main$6, { - backgroundColor: backgroundColor.value, - showGrid: showGrid.value, - showPreview: showPreview.value, - lightIntensity: lightIntensity.value, - showLightIntensityButton: showLightIntensityButton.value, - fov: fov2.value, - showFOVButton: showFOVButton.value, - showPreviewButton: showPreviewButton.value, - cameraType: cameraType.value, - hasBackgroundImage: hasBackgroundImage.value, - upDirection: upDirection.value, - materialMode: materialMode.value, - onUpdateBackgroundImage: handleBackgroundImageUpdate, - onSwitchCamera: switchCamera, - onToggleGrid: toggleGrid, - onUpdateBackgroundColor: handleBackgroundColorChange, - onUpdateLightIntensity: handleUpdateLightIntensity, - onTogglePreview: togglePreview, - onUpdateFOV: handleUpdateFOV, - onUpdateUpDirection: handleUpdateUpDirection, - onUpdateMaterialMode: handleUpdateMaterialMode - }, null, 8, ["backgroundColor", "showGrid", "showPreview", "lightIntensity", "showLightIntensityButton", "fov", "showFOVButton", "showPreviewButton", "cameraType", "hasBackgroundImage", "upDirection", "materialMode"]), - createVNode(_sfc_main$2, { - animations: animations.value, - playing: playing.value, - onTogglePlay: togglePlay, - onSpeedChange: speedChange, - onAnimationChange: animationChange - }, null, 8, ["animations", "playing"]) - ]) - ]); - }; - } -}); -class Load3DConfiguration { - static { - __name(this, "Load3DConfiguration"); - } - constructor(load3d) { - this.load3d = load3d; - } - configure(loadFolder, modelWidget, cameraState, width = null, height = null) { - this.setupModelHandling(modelWidget, loadFolder, cameraState); - this.setupTargetSize(width, height); - this.setupDefaultProperties(); - } - setupTargetSize(width, height) { - if (width && height) { - this.load3d.setTargetSize(width.value, height.value); - width.callback = (value) => { - this.load3d.setTargetSize(value, height.value); - }; - height.callback = (value) => { - this.load3d.setTargetSize(width.value, value); - }; - } - } - setupModelHandling(modelWidget, loadFolder, cameraState) { - const onModelWidgetUpdate = this.createModelUpdateHandler( - loadFolder, - cameraState - ); - if (modelWidget.value) { - onModelWidgetUpdate(modelWidget.value); - } - modelWidget.callback = onModelWidgetUpdate; - } - setupDefaultProperties() { - const cameraType = this.load3d.loadNodeProperty( - "Camera Type", - "perspective" - ); - this.load3d.toggleCamera(cameraType); - const showGrid = this.load3d.loadNodeProperty("Show Grid", true); - this.load3d.toggleGrid(showGrid); - const showPreview = this.load3d.loadNodeProperty("Show Preview", true); - this.load3d.togglePreview(showPreview); - const bgColor = this.load3d.loadNodeProperty("Background Color", "#282828"); - this.load3d.setBackgroundColor(bgColor); - const lightIntensity = this.load3d.loadNodeProperty("Light Intensity", 5); - this.load3d.setLightIntensity(lightIntensity); - const fov2 = this.load3d.loadNodeProperty("FOV", 35); - this.load3d.setFOV(fov2); - const backgroundImage = this.load3d.loadNodeProperty("Background Image", ""); - this.load3d.setBackgroundImage(backgroundImage); - } - createModelUpdateHandler(loadFolder, cameraState) { - let isFirstLoad = true; - return async (value) => { - if (!value) return; - const filename = value; - const modelUrl = api.apiURL( - Load3dUtils.getResourceURL( - ...Load3dUtils.splitFilePath(filename), - loadFolder - ) - ); - await this.load3d.loadModel(modelUrl, filename); - const upDirection = this.load3d.loadNodeProperty( - "Up Direction", - "original" - ); - this.load3d.setUpDirection(upDirection); - const materialMode = this.load3d.loadNodeProperty( - "Material Mode", - "original" - ); - this.load3d.setMaterialMode(materialMode); - if (isFirstLoad && cameraState && typeof cameraState === "object") { - try { - this.load3d.setCameraState(cameraState); - } catch (error) { - console.warn("Failed to restore camera state:", error); - } - isFirstLoad = false; - } - }; - } -} -app.registerExtension({ - name: "Comfy.Load3D", - getCustomWidgets(app2) { - return { - LOAD_3D(node, inputName) { - node.addProperty("Camera Info", ""); - const container = document.createElement("div"); - container.classList.add("comfy-load-3d"); - let controlsApp = createApp(_sfc_main$3, { - node, - type: "Load3D" - }); - controlsApp.mount(container); - const origOnRemoved = node.onRemoved; - node.onRemoved = function() { - if (controlsApp) { - controlsApp.unmount(); - controlsApp = null; - } - origOnRemoved?.apply(this, []); - }; - const fileInput = document.createElement("input"); - fileInput.type = "file"; - fileInput.accept = ".gltf,.glb,.obj,.mtl,.fbx,.stl"; - fileInput.style.display = "none"; - fileInput.onchange = async () => { - if (fileInput.files?.length) { - const modelWidget = node.widgets?.find( - (w) => w.name === "model_file" - ); - const uploadPath = await Load3dUtils.uploadFile( - fileInput.files[0] - ).catch((error) => { - console.error("File upload failed:", error); - useToastStore().addAlert("File upload failed"); - }); - const modelUrl = api.apiURL( - Load3dUtils.getResourceURL( - ...Load3dUtils.splitFilePath(uploadPath), - "input" - ) - ); - await useLoad3dService().getLoad3d(node).loadModel(modelUrl); - if (uploadPath && modelWidget) { - if (!modelWidget.options?.values?.includes(uploadPath)) { - modelWidget.options?.values?.push(uploadPath); - } - modelWidget.value = uploadPath; - } - } - }; - node.addWidget("button", "upload 3d model", "upload3dmodel", () => { - fileInput.click(); - }); - node.addWidget("button", "clear", "clear", () => { - useLoad3dService().getLoad3d(node).clearModel(); - const modelWidget = node.widgets?.find( - (w) => w.name === "model_file" - ); - if (modelWidget) { - modelWidget.value = ""; - } - }); - return { - widget: node.addDOMWidget(inputName, "LOAD_3D", container) - }; - } - }; - }, - async nodeCreated(node) { - if (node.constructor.comfyClass !== "Load3D") return; - const [oldWidth, oldHeight] = node.size; - node.setSize([Math.max(oldWidth, 300), Math.max(oldHeight, 600)]); - await nextTick(); - const sceneWidget = node.widgets.find((w) => w.name === "image"); - const load3d = useLoad3dService().getLoad3d(node); - const modelWidget = node.widgets.find( - (w) => w.name === "model_file" - ); - let cameraState = node.properties["Camera Info"]; - const config = new Load3DConfiguration(load3d); - const width = node.widgets.find((w) => w.name === "width"); - const height = node.widgets.find((w) => w.name === "height"); - config.configure("input", modelWidget, cameraState, width, height); - sceneWidget.serializeValue = async () => { - node.properties["Camera Info"] = load3d.getCameraState(); - const { scene: imageData, mask: maskData } = await load3d.captureScene( - width.value, - height.value - ); - const [data, dataMask] = await Promise.all([ - Load3dUtils.uploadTempImage(imageData, "scene"), - Load3dUtils.uploadTempImage(maskData, "scene_mask") - ]); - load3d.handleResize(); - return { - image: `threed/${data.name} [temp]`, - mask: `threed/${dataMask.name} [temp]` - }; - }; - } -}); -app.registerExtension({ - name: "Comfy.Load3DAnimation", - getCustomWidgets(app2) { - return { - LOAD_3D_ANIMATION(node, inputName) { - node.addProperty("Camera Info", ""); - const container = document.createElement("div"); - container.classList.add("comfy-load-3d-animation"); - let controlsApp = createApp(_sfc_main, { - node, - type: "Load3DAnimation" - }); - controlsApp.use(PrimeVue); - controlsApp.mount(container); - const origOnRemoved = node.onRemoved; - node.onRemoved = function() { - if (controlsApp) { - controlsApp.unmount(); - controlsApp = null; - } - origOnRemoved?.apply(this, []); - }; - const fileInput = document.createElement("input"); - fileInput.type = "file"; - fileInput.accept = ".fbx,glb,gltf"; - fileInput.style.display = "none"; - fileInput.onchange = async () => { - if (fileInput.files?.length) { - const modelWidget = node.widgets?.find( - (w) => w.name === "model_file" - ); - const uploadPath = await Load3dUtils.uploadFile( - fileInput.files[0] - ).catch((error) => { - console.error("File upload failed:", error); - useToastStore().addAlert("File upload failed"); - }); - const modelUrl = api.apiURL( - Load3dUtils.getResourceURL( - ...Load3dUtils.splitFilePath(uploadPath), - "input" - ) - ); - await useLoad3dService().getLoad3d(node).loadModel(modelUrl); - if (uploadPath && modelWidget) { - if (!modelWidget.options?.values?.includes(uploadPath)) { - modelWidget.options?.values?.push(uploadPath); - } - modelWidget.value = uploadPath; - } - } - }; - node.addWidget("button", "upload 3d model", "upload3dmodel", () => { - fileInput.click(); - }); - node.addWidget("button", "clear", "clear", () => { - useLoad3dService().getLoad3d(node).clearModel(); - const modelWidget = node.widgets?.find( - (w) => w.name === "model_file" - ); - if (modelWidget) { - modelWidget.value = ""; - } - }); - return { - widget: node.addDOMWidget(inputName, "LOAD_3D_ANIMATION", container) - }; - } - }; - }, - async nodeCreated(node) { - if (node.constructor.comfyClass !== "Load3DAnimation") return; - const [oldWidth, oldHeight] = node.size; - node.setSize([Math.max(oldWidth, 400), Math.max(oldHeight, 700)]); - await nextTick(); - const sceneWidget = node.widgets.find((w) => w.name === "image"); - const load3d = useLoad3dService().getLoad3d(node); - const modelWidget = node.widgets.find( - (w) => w.name === "model_file" - ); - let cameraState = node.properties["Camera Info"]; - const config = new Load3DConfiguration(load3d); - const width = node.widgets.find((w) => w.name === "width"); - const height = node.widgets.find((w) => w.name === "height"); - config.configure("input", modelWidget, cameraState, width, height); - sceneWidget.serializeValue = async () => { - node.properties["Camera Info"] = load3d.getCameraState(); - load3d.toggleAnimation(false); - const { scene: imageData, mask: maskData } = await load3d.captureScene( - width.value, - height.value - ); - const [data, dataMask] = await Promise.all([ - Load3dUtils.uploadTempImage(imageData, "scene"), - Load3dUtils.uploadTempImage(maskData, "scene_mask") - ]); - load3d.handleResize(); - return { - image: `threed/${data.name} [temp]`, - mask: `threed/${dataMask.name} [temp]` - }; - }; - } -}); -app.registerExtension({ - name: "Comfy.Preview3D", - async beforeRegisterNodeDef(nodeType, nodeData) { - if ( - // @ts-expect-error ComfyNode - ["Preview3D"].includes(nodeType.comfyClass) - ) { - nodeData.input.required.image = ["PREVIEW_3D"]; - } - }, - getCustomWidgets(app2) { - return { - PREVIEW_3D(node, inputName) { - const container = document.createElement("div"); - container.classList.add("comfy-preview-3d"); - let controlsApp = createApp(_sfc_main$3, { - node, - type: "Preview3D" - }); - controlsApp.mount(container); - const origOnRemoved = node.onRemoved; - node.onRemoved = function() { - if (controlsApp) { - controlsApp.unmount(); - controlsApp = null; - } - origOnRemoved?.apply(this, []); - }; - return { - widget: node.addDOMWidget(inputName, "PREVIEW_3D", container) - }; - } - }; - }, - async nodeCreated(node) { - if (node.constructor.comfyClass !== "Preview3D") return; - const [oldWidth, oldHeight] = node.size; - node.setSize([Math.max(oldWidth, 400), Math.max(oldHeight, 550)]); - await nextTick(); - const load3d = useLoad3dService().getLoad3d(node); - const modelWidget = node.widgets.find( - (w) => w.name === "model_file" - ); - const onExecuted = node.onExecuted; - node.onExecuted = function(message) { - onExecuted?.apply(this, arguments); - let filePath = message.model_file[0]; - if (!filePath) { - const msg = "unable to get model file path."; - console.error(msg); - useToastStore().addAlert(msg); - } - modelWidget.value = filePath.replaceAll("\\", "/"); - const config = new Load3DConfiguration(load3d); - config.configure("output", modelWidget); - }; - } -}); -app.registerExtension({ - name: "Comfy.Preview3DAnimation", - async beforeRegisterNodeDef(nodeType, nodeData) { - if ( - // @ts-expect-error ComfyNode - ["Preview3DAnimation"].includes(nodeType.comfyClass) - ) { - nodeData.input.required.image = ["PREVIEW_3D_ANIMATION"]; - } - }, - getCustomWidgets(app2) { - return { - PREVIEW_3D_ANIMATION(node, inputName) { - const container = document.createElement("div"); - container.classList.add("comfy-preview-3d-animation"); - let controlsApp = createApp(_sfc_main, { - node, - type: "Preview3DAnimation" - }); - controlsApp.use(PrimeVue); - controlsApp.mount(container); - const origOnRemoved = node.onRemoved; - node.onRemoved = function() { - if (controlsApp) { - controlsApp.unmount(); - controlsApp = null; - } - origOnRemoved?.apply(this, []); - }; - return { - widget: node.addDOMWidget( - inputName, - "PREVIEW_3D_ANIMATION", - container - ) - }; - } - }; - }, - async nodeCreated(node) { - if (node.constructor.comfyClass !== "Preview3DAnimation") return; - const [oldWidth, oldHeight] = node.size; - node.setSize([Math.max(oldWidth, 300), Math.max(oldHeight, 550)]); - await nextTick(); - const load3d = useLoad3dService().getLoad3d(node); - const modelWidget = node.widgets.find( - (w) => w.name === "model_file" - ); - const onExecuted = node.onExecuted; - node.onExecuted = function(message) { - onExecuted?.apply(this, arguments); - let filePath = message.model_file[0]; - if (!filePath) { - const msg = "unable to get model file path."; - console.error(msg); - useToastStore().addAlert(msg); - } - modelWidget.value = filePath.replaceAll("\\", "/"); - const config = new Load3DConfiguration(load3d); - config.configure("output", modelWidget); - }; - } -}); -function dataURLToBlob(dataURL) { - const parts = dataURL.split(";base64,"); - const contentType = parts[0].split(":")[1]; - const byteString = atob(parts[1]); - const arrayBuffer = new ArrayBuffer(byteString.length); - const uint8Array = new Uint8Array(arrayBuffer); - for (let i = 0; i < byteString.length; i++) { - uint8Array[i] = byteString.charCodeAt(i); - } - return new Blob([arrayBuffer], { type: contentType }); -} -__name(dataURLToBlob, "dataURLToBlob"); -function loadedImageToBlob(image) { - const canvas = document.createElement("canvas"); - canvas.width = image.width; - canvas.height = image.height; - const ctx = canvas.getContext("2d"); - ctx.drawImage(image, 0, 0); - const dataURL = canvas.toDataURL("image/png", 1); - const blob = dataURLToBlob(dataURL); - return blob; -} -__name(loadedImageToBlob, "loadedImageToBlob"); -function loadImage(imagePath) { - return new Promise((resolve, reject) => { - const image = new Image(); - image.onload = function() { - resolve(image); - }; - image.src = imagePath; - }); -} -__name(loadImage, "loadImage"); -async function uploadMask(filepath, formData) { - await api.fetchApi("/upload/mask", { - method: "POST", - body: formData - }).then((response) => { - }).catch((error) => { - console.error("Error:", error); - }); - ComfyApp.clipspace.imgs[ComfyApp.clipspace["selectedIndex"]] = new Image(); - ComfyApp.clipspace.imgs[ComfyApp.clipspace["selectedIndex"]].src = api.apiURL( - "/view?" + new URLSearchParams(filepath).toString() + app.getPreviewFormatParam() + app.getRandParam() - ); - if (ComfyApp.clipspace.images) - ComfyApp.clipspace.images[ComfyApp.clipspace["selectedIndex"]] = filepath; - ClipspaceDialog.invalidatePreview(); -} -__name(uploadMask, "uploadMask"); -function prepare_mask(image, maskCanvas, maskCtx, maskColor) { - maskCtx.drawImage(image, 0, 0, maskCanvas.width, maskCanvas.height); - const maskData = maskCtx.getImageData( - 0, - 0, - maskCanvas.width, - maskCanvas.height - ); - for (let i = 0; i < maskData.data.length; i += 4) { - if (maskData.data[i + 3] == 255) maskData.data[i + 3] = 0; - else maskData.data[i + 3] = 255; - maskData.data[i] = maskColor.r; - maskData.data[i + 1] = maskColor.g; - maskData.data[i + 2] = maskColor.b; - } - maskCtx.globalCompositeOperation = "source-over"; - maskCtx.putImageData(maskData, 0, 0); -} -__name(prepare_mask, "prepare_mask"); -var PointerType = /* @__PURE__ */ ((PointerType2) => { - PointerType2["Arc"] = "arc"; - PointerType2["Rect"] = "rect"; - return PointerType2; -})(PointerType || {}); -var CompositionOperation$1 = /* @__PURE__ */ ((CompositionOperation2) => { - CompositionOperation2["SourceOver"] = "source-over"; - CompositionOperation2["DestinationOut"] = "destination-out"; - return CompositionOperation2; -})(CompositionOperation$1 || {}); -class MaskEditorDialogOld extends ComfyDialog { - static { - __name(this, "MaskEditorDialogOld"); - } - static instance = null; - static mousedown_x = null; - static mousedown_y = null; - brush; - maskCtx; - maskCanvas; - brush_size_slider; - brush_opacity_slider; - colorButton; - saveButton; - zoom_ratio; - pan_x; - pan_y; - imgCanvas; - last_display_style; - is_visible; - image; - handler_registered; - brush_slider_input; - cursorX; - cursorY; - mousedown_pan_x; - mousedown_pan_y; - last_pressure; - pointer_type; - brush_pointer_type_select; - static getInstance() { - if (!MaskEditorDialogOld.instance) { - MaskEditorDialogOld.instance = new MaskEditorDialogOld(); - } - return MaskEditorDialogOld.instance; - } - is_layout_created = false; - constructor() { - super(); - this.element = $el("div.comfy-modal", { parent: document.body }, [ - $el("div.comfy-modal-content", [...this.createButtons()]) - ]); - } - createButtons() { - return []; - } - createButton(name, callback) { - var button = document.createElement("button"); - button.style.pointerEvents = "auto"; - button.innerText = name; - button.addEventListener("click", callback); - return button; - } - createLeftButton(name, callback) { - var button = this.createButton(name, callback); - button.style.cssFloat = "left"; - button.style.marginRight = "4px"; - return button; - } - createRightButton(name, callback) { - var button = this.createButton(name, callback); - button.style.cssFloat = "right"; - button.style.marginLeft = "4px"; - return button; - } - createLeftSlider(self2, name, callback) { - const divElement = document.createElement("div"); - divElement.id = "maskeditor-slider"; - divElement.style.cssFloat = "left"; - divElement.style.fontFamily = "sans-serif"; - divElement.style.marginRight = "4px"; - divElement.style.color = "var(--input-text)"; - divElement.style.backgroundColor = "var(--comfy-input-bg)"; - divElement.style.borderRadius = "8px"; - divElement.style.borderColor = "var(--border-color)"; - divElement.style.borderStyle = "solid"; - divElement.style.fontSize = "15px"; - divElement.style.height = "25px"; - divElement.style.padding = "1px 6px"; - divElement.style.display = "flex"; - divElement.style.position = "relative"; - divElement.style.top = "2px"; - divElement.style.pointerEvents = "auto"; - self2.brush_slider_input = document.createElement("input"); - self2.brush_slider_input.setAttribute("type", "range"); - self2.brush_slider_input.setAttribute("min", "1"); - self2.brush_slider_input.setAttribute("max", "100"); - self2.brush_slider_input.setAttribute("value", "10"); - const labelElement = document.createElement("label"); - labelElement.textContent = name; - divElement.appendChild(labelElement); - divElement.appendChild(self2.brush_slider_input); - self2.brush_slider_input.addEventListener("change", callback); - return divElement; - } - createOpacitySlider(self2, name, callback) { - const divElement = document.createElement("div"); - divElement.id = "maskeditor-opacity-slider"; - divElement.style.cssFloat = "left"; - divElement.style.fontFamily = "sans-serif"; - divElement.style.marginRight = "4px"; - divElement.style.color = "var(--input-text)"; - divElement.style.backgroundColor = "var(--comfy-input-bg)"; - divElement.style.borderRadius = "8px"; - divElement.style.borderColor = "var(--border-color)"; - divElement.style.borderStyle = "solid"; - divElement.style.fontSize = "15px"; - divElement.style.height = "25px"; - divElement.style.padding = "1px 6px"; - divElement.style.display = "flex"; - divElement.style.position = "relative"; - divElement.style.top = "2px"; - divElement.style.pointerEvents = "auto"; - self2.opacity_slider_input = document.createElement("input"); - self2.opacity_slider_input.setAttribute("type", "range"); - self2.opacity_slider_input.setAttribute("min", "0.1"); - self2.opacity_slider_input.setAttribute("max", "1.0"); - self2.opacity_slider_input.setAttribute("step", "0.01"); - self2.opacity_slider_input.setAttribute("value", "0.7"); - const labelElement = document.createElement("label"); - labelElement.textContent = name; - divElement.appendChild(labelElement); - divElement.appendChild(self2.opacity_slider_input); - self2.opacity_slider_input.addEventListener("input", callback); - return divElement; - } - createPointerTypeSelect(self2) { - const divElement = document.createElement("div"); - divElement.id = "maskeditor-pointer-type"; - divElement.style.cssFloat = "left"; - divElement.style.fontFamily = "sans-serif"; - divElement.style.marginRight = "4px"; - divElement.style.color = "var(--input-text)"; - divElement.style.backgroundColor = "var(--comfy-input-bg)"; - divElement.style.borderRadius = "8px"; - divElement.style.borderColor = "var(--border-color)"; - divElement.style.borderStyle = "solid"; - divElement.style.fontSize = "15px"; - divElement.style.height = "25px"; - divElement.style.padding = "1px 6px"; - divElement.style.display = "flex"; - divElement.style.position = "relative"; - divElement.style.top = "2px"; - divElement.style.pointerEvents = "auto"; - const labelElement = document.createElement("label"); - labelElement.textContent = "Pointer Type:"; - const selectElement = document.createElement("select"); - selectElement.style.borderRadius = "0"; - selectElement.style.borderColor = "transparent"; - selectElement.style.borderStyle = "unset"; - selectElement.style.fontSize = "0.9em"; - const optionArc = document.createElement("option"); - optionArc.value = "arc"; - optionArc.text = "Circle"; - optionArc.selected = true; - const optionRect = document.createElement("option"); - optionRect.value = "rect"; - optionRect.text = "Square"; - selectElement.appendChild(optionArc); - selectElement.appendChild(optionRect); - selectElement.addEventListener("change", (event) => { - const target = event.target; - self2.pointer_type = target.value; - this.setBrushBorderRadius(self2); - }); - divElement.appendChild(labelElement); - divElement.appendChild(selectElement); - return divElement; - } - setBrushBorderRadius(self2) { - if (self2.pointer_type === "rect") { - this.brush.style.borderRadius = "0%"; - this.brush.style.MozBorderRadius = "0%"; - this.brush.style.WebkitBorderRadius = "0%"; - } else { - this.brush.style.borderRadius = "50%"; - this.brush.style.MozBorderRadius = "50%"; - this.brush.style.WebkitBorderRadius = "50%"; - } - } - setlayout(imgCanvas, maskCanvas) { - const self2 = this; - self2.pointer_type = "arc"; - var bottom_panel = document.createElement("div"); - bottom_panel.style.position = "absolute"; - bottom_panel.style.bottom = "0px"; - bottom_panel.style.left = "20px"; - bottom_panel.style.right = "20px"; - bottom_panel.style.height = "50px"; - bottom_panel.style.pointerEvents = "none"; - var brush = document.createElement("div"); - brush.id = "brush"; - brush.style.backgroundColor = "transparent"; - brush.style.outline = "1px dashed black"; - brush.style.boxShadow = "0 0 0 1px white"; - brush.style.position = "absolute"; - brush.style.zIndex = "8889"; - brush.style.pointerEvents = "none"; - this.brush = brush; - this.setBrushBorderRadius(self2); - this.element.appendChild(imgCanvas); - this.element.appendChild(maskCanvas); - this.element.appendChild(bottom_panel); - document.body.appendChild(brush); - var clearButton = this.createLeftButton("Clear", () => { - self2.maskCtx.clearRect( - 0, - 0, - self2.maskCanvas.width, - self2.maskCanvas.height - ); - }); - this.brush_size_slider = this.createLeftSlider( - self2, - "Thickness", - (event) => { - self2.brush_size = event.target.value; - self2.updateBrushPreview(self2); - } - ); - this.brush_opacity_slider = this.createOpacitySlider( - self2, - "Opacity", - (event) => { - self2.brush_opacity = event.target.value; - if (self2.brush_color_mode !== "negative") { - self2.maskCanvas.style.opacity = self2.brush_opacity.toString(); - } - } - ); - this.brush_pointer_type_select = this.createPointerTypeSelect(self2); - this.colorButton = this.createLeftButton(this.getColorButtonText(), () => { - if (self2.brush_color_mode === "black") { - self2.brush_color_mode = "white"; - } else if (self2.brush_color_mode === "white") { - self2.brush_color_mode = "negative"; - } else { - self2.brush_color_mode = "black"; - } - self2.updateWhenBrushColorModeChanged(); - }); - var cancelButton = this.createRightButton("Cancel", () => { - document.removeEventListener("keydown", MaskEditorDialogOld.handleKeyDown); - self2.close(); - }); - this.saveButton = this.createRightButton("Save", () => { - document.removeEventListener("keydown", MaskEditorDialogOld.handleKeyDown); - self2.save(); - }); - this.element.appendChild(imgCanvas); - this.element.appendChild(maskCanvas); - this.element.appendChild(bottom_panel); - bottom_panel.appendChild(clearButton); - bottom_panel.appendChild(this.saveButton); - bottom_panel.appendChild(cancelButton); - bottom_panel.appendChild(this.brush_size_slider); - bottom_panel.appendChild(this.brush_opacity_slider); - bottom_panel.appendChild(this.brush_pointer_type_select); - bottom_panel.appendChild(this.colorButton); - imgCanvas.style.position = "absolute"; - maskCanvas.style.position = "absolute"; - imgCanvas.style.top = "200"; - imgCanvas.style.left = "0"; - maskCanvas.style.top = imgCanvas.style.top; - maskCanvas.style.left = imgCanvas.style.left; - const maskCanvasStyle = this.getMaskCanvasStyle(); - maskCanvas.style.mixBlendMode = maskCanvasStyle.mixBlendMode; - maskCanvas.style.opacity = maskCanvasStyle.opacity.toString(); - } - async show() { - this.zoom_ratio = 1; - this.pan_x = 0; - this.pan_y = 0; - if (!this.is_layout_created) { - const imgCanvas = document.createElement("canvas"); - const maskCanvas = document.createElement("canvas"); - imgCanvas.id = "imageCanvas"; - maskCanvas.id = "maskCanvas"; - this.setlayout(imgCanvas, maskCanvas); - this.imgCanvas = imgCanvas; - this.maskCanvas = maskCanvas; - this.maskCtx = maskCanvas.getContext("2d", { willReadFrequently: true }); - this.setEventHandler(maskCanvas); - this.is_layout_created = true; - const self2 = this; - const observer = new MutationObserver(function(mutations) { - mutations.forEach(function(mutation) { - if (mutation.type === "attributes" && mutation.attributeName === "style") { - if (self2.last_display_style && self2.last_display_style != "none" && self2.element.style.display == "none") { - self2.brush.style.display = "none"; - ComfyApp.onClipspaceEditorClosed(); - } - self2.last_display_style = self2.element.style.display; - } - }); - }); - const config = { attributes: true }; - observer.observe(this.element, config); - } - document.addEventListener("keydown", MaskEditorDialogOld.handleKeyDown); - if (ComfyApp.clipspace_return_node) { - this.saveButton.innerText = "Save to node"; - } else { - this.saveButton.innerText = "Save"; - } - this.saveButton.disabled = false; - this.element.style.display = "block"; - this.element.style.width = "85%"; - this.element.style.margin = "0 7.5%"; - this.element.style.height = "100vh"; - this.element.style.top = "50%"; - this.element.style.left = "42%"; - this.element.style.zIndex = "8888"; - await this.setImages(this.imgCanvas); - this.is_visible = true; - } - isOpened() { - return this.element.style.display == "block"; - } - invalidateCanvas(orig_image, mask_image) { - this.imgCanvas.width = orig_image.width; - this.imgCanvas.height = orig_image.height; - this.maskCanvas.width = orig_image.width; - this.maskCanvas.height = orig_image.height; - let imgCtx = this.imgCanvas.getContext("2d", { willReadFrequently: true }); - let maskCtx = this.maskCanvas.getContext("2d", { - willReadFrequently: true - }); - imgCtx.drawImage(orig_image, 0, 0, orig_image.width, orig_image.height); - prepare_mask(mask_image, this.maskCanvas, maskCtx, this.getMaskColor()); - } - async setImages(imgCanvas) { - let self2 = this; - const imgCtx = imgCanvas.getContext("2d", { willReadFrequently: true }); - const maskCtx = this.maskCtx; - const maskCanvas = this.maskCanvas; - imgCtx.clearRect(0, 0, this.imgCanvas.width, this.imgCanvas.height); - maskCtx.clearRect(0, 0, this.maskCanvas.width, this.maskCanvas.height); - const filepath = ComfyApp.clipspace.images; - const alpha_url = new URL( - ComfyApp.clipspace.imgs[ComfyApp.clipspace["selectedIndex"]].src - ); - alpha_url.searchParams.delete("channel"); - alpha_url.searchParams.delete("preview"); - alpha_url.searchParams.set("channel", "a"); - let mask_image = await loadImage(alpha_url); - const rgb_url = new URL( - ComfyApp.clipspace.imgs[ComfyApp.clipspace["selectedIndex"]].src - ); - rgb_url.searchParams.delete("channel"); - rgb_url.searchParams.set("channel", "rgb"); - this.image = new Image(); - this.image.onload = function() { - maskCanvas.width = self2.image.width; - maskCanvas.height = self2.image.height; - self2.invalidateCanvas(self2.image, mask_image); - self2.initializeCanvasPanZoom(); - }; - this.image.src = rgb_url.toString(); - } - initializeCanvasPanZoom() { - let drawWidth = this.image.width; - let drawHeight = this.image.height; - let width = this.element.clientWidth; - let height = this.element.clientHeight; - if (this.image.width > width) { - drawWidth = width; - drawHeight = drawWidth / this.image.width * this.image.height; - } - if (drawHeight > height) { - drawHeight = height; - drawWidth = drawHeight / this.image.height * this.image.width; - } - this.zoom_ratio = drawWidth / this.image.width; - const canvasX = (width - drawWidth) / 2; - const canvasY = (height - drawHeight) / 2; - this.pan_x = canvasX; - this.pan_y = canvasY; - this.invalidatePanZoom(); - } - invalidatePanZoom() { - let raw_width = this.image.width * this.zoom_ratio; - let raw_height = this.image.height * this.zoom_ratio; - if (this.pan_x + raw_width < 10) { - this.pan_x = 10 - raw_width; - } - if (this.pan_y + raw_height < 10) { - this.pan_y = 10 - raw_height; - } - let width = `${raw_width}px`; - let height = `${raw_height}px`; - let left = `${this.pan_x}px`; - let top = `${this.pan_y}px`; - this.maskCanvas.style.width = width; - this.maskCanvas.style.height = height; - this.maskCanvas.style.left = left; - this.maskCanvas.style.top = top; - this.imgCanvas.style.width = width; - this.imgCanvas.style.height = height; - this.imgCanvas.style.left = left; - this.imgCanvas.style.top = top; - } - setEventHandler(maskCanvas) { - const self2 = this; - if (!this.handler_registered) { - maskCanvas.addEventListener("contextmenu", (event) => { - event.preventDefault(); - }); - this.element.addEventListener( - "wheel", - (event) => this.handleWheelEvent(self2, event) - ); - this.element.addEventListener( - "pointermove", - (event) => this.pointMoveEvent(self2, event) - ); - this.element.addEventListener( - "touchmove", - (event) => this.pointMoveEvent(self2, event) - ); - this.element.addEventListener("dragstart", (event) => { - if (event.ctrlKey) { - event.preventDefault(); - } - }); - maskCanvas.addEventListener( - "pointerdown", - (event) => this.handlePointerDown(self2, event) - ); - maskCanvas.addEventListener( - "pointermove", - (event) => this.draw_move(self2, event) - ); - maskCanvas.addEventListener( - "touchmove", - (event) => this.draw_move(self2, event) - ); - maskCanvas.addEventListener("pointerover", (event) => { - this.brush.style.display = "block"; - }); - maskCanvas.addEventListener("pointerleave", (event) => { - this.brush.style.display = "none"; - }); - document.addEventListener( - "pointerup", - MaskEditorDialogOld.handlePointerUp - ); - this.handler_registered = true; - } - } - getMaskCanvasStyle() { - if (this.brush_color_mode === "negative") { - return { - mixBlendMode: "difference", - opacity: "1" - }; - } else { - return { - mixBlendMode: "initial", - opacity: this.brush_opacity - }; - } - } - getMaskColor() { - if (this.brush_color_mode === "black") { - return { r: 0, g: 0, b: 0 }; - } - if (this.brush_color_mode === "white") { - return { r: 255, g: 255, b: 255 }; - } - if (this.brush_color_mode === "negative") { - return { r: 255, g: 255, b: 255 }; - } - return { r: 0, g: 0, b: 0 }; - } - getMaskFillStyle() { - const maskColor = this.getMaskColor(); - return "rgb(" + maskColor.r + "," + maskColor.g + "," + maskColor.b + ")"; - } - getColorButtonText() { - let colorCaption = "unknown"; - if (this.brush_color_mode === "black") { - colorCaption = "black"; - } else if (this.brush_color_mode === "white") { - colorCaption = "white"; - } else if (this.brush_color_mode === "negative") { - colorCaption = "negative"; - } - return "Color: " + colorCaption; - } - updateWhenBrushColorModeChanged() { - this.colorButton.innerText = this.getColorButtonText(); - const maskCanvasStyle = this.getMaskCanvasStyle(); - this.maskCanvas.style.mixBlendMode = maskCanvasStyle.mixBlendMode; - this.maskCanvas.style.opacity = maskCanvasStyle.opacity.toString(); - const maskColor = this.getMaskColor(); - const maskData = this.maskCtx.getImageData( - 0, - 0, - this.maskCanvas.width, - this.maskCanvas.height - ); - for (let i = 0; i < maskData.data.length; i += 4) { - maskData.data[i] = maskColor.r; - maskData.data[i + 1] = maskColor.g; - maskData.data[i + 2] = maskColor.b; - } - this.maskCtx.putImageData(maskData, 0, 0); - } - brush_opacity = 0.7; - brush_size = 10; - brush_color_mode = "black"; - drawing_mode = false; - lastx = -1; - lasty = -1; - lasttime = 0; - static handleKeyDown(event) { - const self2 = MaskEditorDialogOld.instance; - if (event.key === "]") { - self2.brush_size = Math.min(self2.brush_size + 2, 100); - self2.brush_slider_input.value = self2.brush_size; - } else if (event.key === "[") { - self2.brush_size = Math.max(self2.brush_size - 2, 1); - self2.brush_slider_input.value = self2.brush_size; - } else if (event.key === "Enter") { - self2.save(); - } - self2.updateBrushPreview(self2); - } - static handlePointerUp(event) { - event.preventDefault(); - this.mousedown_x = null; - this.mousedown_y = null; - MaskEditorDialogOld.instance.drawing_mode = false; - } - updateBrushPreview(self2) { - const brush = self2.brush; - var centerX = self2.cursorX; - var centerY = self2.cursorY; - brush.style.width = self2.brush_size * 2 * this.zoom_ratio + "px"; - brush.style.height = self2.brush_size * 2 * this.zoom_ratio + "px"; - brush.style.left = centerX - self2.brush_size * this.zoom_ratio + "px"; - brush.style.top = centerY - self2.brush_size * this.zoom_ratio + "px"; - } - handleWheelEvent(self2, event) { - event.preventDefault(); - if (event.ctrlKey) { - if (event.deltaY < 0) { - this.zoom_ratio = Math.min(10, this.zoom_ratio + 0.2); - } else { - this.zoom_ratio = Math.max(0.2, this.zoom_ratio - 0.2); - } - this.invalidatePanZoom(); - } else { - if (event.deltaY < 0) this.brush_size = Math.min(this.brush_size + 2, 100); - else this.brush_size = Math.max(this.brush_size - 2, 1); - this.brush_slider_input.value = this.brush_size.toString(); - this.updateBrushPreview(this); - } - } - pointMoveEvent(self2, event) { - this.cursorX = event.pageX; - this.cursorY = event.pageY; - self2.updateBrushPreview(self2); - if (event.ctrlKey) { - event.preventDefault(); - self2.pan_move(self2, event); - } - let left_button_down = window.TouchEvent && event instanceof TouchEvent || event.buttons == 1; - if (event.shiftKey && left_button_down) { - self2.drawing_mode = false; - const y = event.clientY; - let delta = (self2.zoom_lasty - y) * 5e-3; - self2.zoom_ratio = Math.max( - Math.min(10, self2.last_zoom_ratio - delta), - 0.2 - ); - this.invalidatePanZoom(); - return; - } - } - pan_move(self2, event) { - if (event.buttons == 1) { - if (MaskEditorDialogOld.mousedown_x) { - let deltaX = MaskEditorDialogOld.mousedown_x - event.clientX; - let deltaY = MaskEditorDialogOld.mousedown_y - event.clientY; - self2.pan_x = this.mousedown_pan_x - deltaX; - self2.pan_y = this.mousedown_pan_y - deltaY; - self2.invalidatePanZoom(); - } - } - } - draw_move(self2, event) { - if (event.ctrlKey || event.shiftKey) { - return; - } - event.preventDefault(); - this.cursorX = event.pageX; - this.cursorY = event.pageY; - self2.updateBrushPreview(self2); - let left_button_down = window.TouchEvent && event instanceof TouchEvent || event.buttons == 1; - let right_button_down = [2, 5, 32].includes(event.buttons); - if (!event.altKey && left_button_down) { - var diff = performance.now() - self2.lasttime; - const maskRect = self2.maskCanvas.getBoundingClientRect(); - var x = event.offsetX; - var y = event.offsetY; - if (event.offsetX == null) { - x = event.targetTouches[0].clientX - maskRect.left; - } - if (event.offsetY == null) { - y = event.targetTouches[0].clientY - maskRect.top; - } - x /= self2.zoom_ratio; - y /= self2.zoom_ratio; - var brush_size = this.brush_size; - if (event instanceof PointerEvent && event.pointerType == "pen") { - brush_size *= event.pressure; - this.last_pressure = event.pressure; - } else if (window.TouchEvent && event instanceof TouchEvent && diff < 20) { - brush_size *= this.last_pressure; - } else { - brush_size = this.brush_size; - } - if (diff > 20 && !this.drawing_mode) - requestAnimationFrame(() => { - self2.init_shape( - self2, - "source-over" - /* SourceOver */ - ); - self2.draw_shape(self2, x, y, brush_size); - self2.lastx = x; - self2.lasty = y; - }); - else - requestAnimationFrame(() => { - self2.init_shape( - self2, - "source-over" - /* SourceOver */ - ); - var dx = x - self2.lastx; - var dy = y - self2.lasty; - var distance = Math.sqrt(dx * dx + dy * dy); - var directionX = dx / distance; - var directionY = dy / distance; - for (var i = 0; i < distance; i += 5) { - var px2 = self2.lastx + directionX * i; - var py2 = self2.lasty + directionY * i; - self2.draw_shape(self2, px2, py2, brush_size); - } - self2.lastx = x; - self2.lasty = y; - }); - self2.lasttime = performance.now(); - } else if (event.altKey && left_button_down || right_button_down) { - const maskRect = self2.maskCanvas.getBoundingClientRect(); - const x2 = (event.offsetX || event.targetTouches[0].clientX - maskRect.left) / self2.zoom_ratio; - const y2 = (event.offsetY || event.targetTouches[0].clientY - maskRect.top) / self2.zoom_ratio; - var brush_size = this.brush_size; - if (event instanceof PointerEvent && event.pointerType == "pen") { - brush_size *= event.pressure; - this.last_pressure = event.pressure; - } else if (window.TouchEvent && event instanceof TouchEvent && diff < 20) { - brush_size *= this.last_pressure; - } else { - brush_size = this.brush_size; - } - if (diff > 20 && !this.drawing_mode) - requestAnimationFrame(() => { - self2.init_shape( - self2, - "destination-out" - /* DestinationOut */ - ); - self2.draw_shape(self2, x2, y2, brush_size); - self2.lastx = x2; - self2.lasty = y2; - }); - else - requestAnimationFrame(() => { - self2.init_shape( - self2, - "destination-out" - /* DestinationOut */ - ); - var dx = x2 - self2.lastx; - var dy = y2 - self2.lasty; - var distance = Math.sqrt(dx * dx + dy * dy); - var directionX = dx / distance; - var directionY = dy / distance; - for (var i = 0; i < distance; i += 5) { - var px2 = self2.lastx + directionX * i; - var py2 = self2.lasty + directionY * i; - self2.draw_shape(self2, px2, py2, brush_size); - } - self2.lastx = x2; - self2.lasty = y2; - }); - self2.lasttime = performance.now(); - } - } - handlePointerDown(self2, event) { - if (event.ctrlKey) { - if (event.buttons == 1) { - MaskEditorDialogOld.mousedown_x = event.clientX; - MaskEditorDialogOld.mousedown_y = event.clientY; - this.mousedown_pan_x = this.pan_x; - this.mousedown_pan_y = this.pan_y; - } - return; - } - var brush_size = this.brush_size; - if (event instanceof PointerEvent && event.pointerType == "pen") { - brush_size *= event.pressure; - this.last_pressure = event.pressure; - } - if ([0, 2, 5].includes(event.button)) { - self2.drawing_mode = true; - event.preventDefault(); - if (event.shiftKey) { - self2.zoom_lasty = event.clientY; - self2.last_zoom_ratio = self2.zoom_ratio; - return; - } - const maskRect = self2.maskCanvas.getBoundingClientRect(); - const x = (event.offsetX || event.targetTouches[0].clientX - maskRect.left) / self2.zoom_ratio; - const y = (event.offsetY || event.targetTouches[0].clientY - maskRect.top) / self2.zoom_ratio; - if (!event.altKey && event.button == 0) { - self2.init_shape( - self2, - "source-over" - /* SourceOver */ - ); - } else { - self2.init_shape( - self2, - "destination-out" - /* DestinationOut */ - ); - } - self2.draw_shape(self2, x, y, brush_size); - self2.lastx = x; - self2.lasty = y; - self2.lasttime = performance.now(); - } - } - init_shape(self2, compositionOperation) { - self2.maskCtx.beginPath(); - if (compositionOperation == "source-over") { - self2.maskCtx.fillStyle = this.getMaskFillStyle(); - self2.maskCtx.globalCompositeOperation = "source-over"; - } else if (compositionOperation == "destination-out") { - self2.maskCtx.globalCompositeOperation = "destination-out"; - } - } - draw_shape(self2, x, y, brush_size) { - if (self2.pointer_type === "rect") { - self2.maskCtx.rect( - x - brush_size, - y - brush_size, - brush_size * 2, - brush_size * 2 - ); - } else { - self2.maskCtx.arc(x, y, brush_size, 0, Math.PI * 2, false); - } - self2.maskCtx.fill(); - } - async save() { - const backupCanvas = document.createElement("canvas"); - const backupCtx = backupCanvas.getContext("2d", { - willReadFrequently: true - }); - backupCanvas.width = this.image.width; - backupCanvas.height = this.image.height; - backupCtx.clearRect(0, 0, backupCanvas.width, backupCanvas.height); - backupCtx.drawImage( - this.maskCanvas, - 0, - 0, - this.maskCanvas.width, - this.maskCanvas.height, - 0, - 0, - backupCanvas.width, - backupCanvas.height - ); - const backupData = backupCtx.getImageData( - 0, - 0, - backupCanvas.width, - backupCanvas.height - ); - for (let i = 0; i < backupData.data.length; i += 4) { - if (backupData.data[i + 3] == 255) backupData.data[i + 3] = 0; - else backupData.data[i + 3] = 255; - backupData.data[i] = 0; - backupData.data[i + 1] = 0; - backupData.data[i + 2] = 0; - } - backupCtx.globalCompositeOperation = "source-over"; - backupCtx.putImageData(backupData, 0, 0); - const formData = new FormData(); - const filename = "clipspace-mask-" + performance.now() + ".png"; - const item = { - filename, - subfolder: "clipspace", - type: "input" - }; - if (ComfyApp.clipspace.images) ComfyApp.clipspace.images[0] = item; - if (ComfyApp.clipspace.widgets) { - const index = ComfyApp.clipspace.widgets.findIndex( - (obj) => obj.name === "image" - ); - if (index >= 0) ComfyApp.clipspace.widgets[index].value = item; - } - const dataURL = backupCanvas.toDataURL(); - const blob = dataURLToBlob(dataURL); - let original_url = new URL(this.image.src); - const original_ref = { - filename: original_url.searchParams.get("filename") - }; - let original_subfolder = original_url.searchParams.get("subfolder"); - if (original_subfolder) original_ref.subfolder = original_subfolder; - let original_type = original_url.searchParams.get("type"); - if (original_type) original_ref.type = original_type; - formData.append("image", blob, filename); - formData.append("original_ref", JSON.stringify(original_ref)); - formData.append("type", "input"); - formData.append("subfolder", "clipspace"); - this.saveButton.innerText = "Saving..."; - this.saveButton.disabled = true; - await uploadMask(item, formData); - ComfyApp.onClipspaceEditorSave(); - this.close(); - } -} -window.comfyAPI = window.comfyAPI || {}; -window.comfyAPI.maskEditorOld = window.comfyAPI.maskEditorOld || {}; -window.comfyAPI.maskEditorOld.MaskEditorDialogOld = MaskEditorDialogOld; -var styles = ` - #maskEditorContainer { - display: fixed; - } - #maskEditor_brush { - position: absolute; - backgroundColor: transparent; - z-index: 8889; - pointer-events: none; - border-radius: 50%; - overflow: visible; - outline: 1px dashed black; - box-shadow: 0 0 0 1px white; - } - #maskEditor_brushPreviewGradient { - position: absolute; - width: 100%; - height: 100%; - border-radius: 50%; - display: none; - } - #maskEditor { - display: block; - width: 100%; - height: 100vh; - left: 0; - z-index: 8888; - position: fixed; - background: rgba(50,50,50,0.75); - backdrop-filter: blur(10px); - overflow: hidden; - user-select: none; - } - #maskEditor_sidePanelContainer { - height: 100%; - width: 220px; - z-index: 8888; - display: flex; - flex-direction: column; - } - #maskEditor_sidePanel { - background: var(--comfy-menu-bg); - height: 100%; - display: flex; - align-items: center; - overflow-y: hidden; - width: 220px; - } - #maskEditor_sidePanelShortcuts { - display: flex; - flex-direction: row; - width: 200px; - margin-top: 10px; - gap: 10px; - justify-content: center; - } - .maskEditor_sidePanelIconButton { - width: 40px; - height: 40px; - pointer-events: auto; - display: flex; - justify-content: center; - align-items: center; - transition: background-color 0.1s; - } - .maskEditor_sidePanelIconButton:hover { - background-color: rgba(0, 0, 0, 0.2); - } - #maskEditor_sidePanelBrushSettings { - display: flex; - flex-direction: column; - gap: 10px; - width: 200px; - padding: 10px; - } - .maskEditor_sidePanelTitle { - text-align: center; - font-size: 15px; - font-family: sans-serif; - color: var(--descrip-text); - margin-top: 10px; - } - #maskEditor_sidePanelBrushShapeContainer { - display: flex; - width: 180px; - height: 50px; - border: 1px solid var(--border-color); - pointer-events: auto; - background: rgba(0, 0, 0, 0.2); - } - #maskEditor_sidePanelBrushShapeCircle { - width: 35px; - height: 35px; - border-radius: 50%; - border: 1px solid var(--border-color); - pointer-events: auto; - transition: background 0.1s; - margin-left: 7.5px; - } - .maskEditor_sidePanelBrushRange { - width: 180px; - -webkit-appearance: none; - appearance: none; - background: transparent; - cursor: pointer; - } - .maskEditor_sidePanelBrushRange::-webkit-slider-thumb { - height: 20px; - width: 20px; - border-radius: 50%; - cursor: grab; - margin-top: -8px; - background: var(--p-surface-700); - border: 1px solid var(--border-color); - } - .maskEditor_sidePanelBrushRange::-moz-range-thumb { - height: 20px; - width: 20px; - border-radius: 50%; - cursor: grab; - background: var(--p-surface-800); - border: 1px solid var(--border-color); - } - .maskEditor_sidePanelBrushRange::-webkit-slider-runnable-track { - background: var(--p-surface-700); - height: 3px; - } - .maskEditor_sidePanelBrushRange::-moz-range-track { - background: var(--p-surface-700); - height: 3px; - } - - #maskEditor_sidePanelBrushShapeSquare { - width: 35px; - height: 35px; - margin: 5px; - border: 1px solid var(--border-color); - pointer-events: auto; - transition: background 0.1s; - } - - .maskEditor_brushShape_dark { - background: transparent; - } - - .maskEditor_brushShape_dark:hover { - background: var(--p-surface-900); - } - - .maskEditor_brushShape_light { - background: transparent; - } - - .maskEditor_brushShape_light:hover { - background: var(--comfy-menu-bg); - } - - #maskEditor_sidePanelImageLayerSettings { - display: flex; - flex-direction: column; - gap: 10px; - width: 200px; - align-items: center; - } - .maskEditor_sidePanelLayer { - display: flex; - width: 200px; - height: 50px; - } - .maskEditor_sidePanelLayerVisibilityContainer { - width: 50px; - height: 50px; - border-radius: 8px; - display: flex; - justify-content: center; - align-items: center; - } - .maskEditor_sidePanelVisibilityToggle { - width: 12px; - height: 12px; - border-radius: 50%; - pointer-events: auto; - } - .maskEditor_sidePanelLayerIconContainer { - width: 60px; - height: 50px; - border-radius: 8px; - display: flex; - justify-content: center; - align-items: center; - fill: var(--input-text); - } - .maskEditor_sidePanelLayerIconContainer svg { - width: 30px; - height: 30px; - } - #maskEditor_sidePanelMaskLayerBlendingContainer { - width: 80px; - height: 50px; - border-radius: 8px; - display: flex; - justify-content: center; - align-items: center; - } - #maskEditor_sidePanelMaskLayerBlendingSelect { - width: 80px; - height: 30px; - border: 1px solid var(--border-color); - background-color: rgba(0, 0, 0, 0.2); - color: var(--input-text); - font-family: sans-serif; - font-size: 15px; - pointer-events: auto; - transition: background-color border 0.1s; - } - #maskEditor_sidePanelClearCanvasButton:hover { - background-color: var(--p-overlaybadge-outline-color); - border: none; - } - #maskEditor_sidePanelClearCanvasButton { - width: 180px; - height: 30px; - border: none; - background: rgba(0, 0, 0, 0.2); - border: 1px solid var(--border-color); - color: var(--input-text); - font-family: sans-serif; - font-size: 15px; - pointer-events: auto; - transition: background-color 0.1s; - } - #maskEditor_sidePanelClearCanvasButton:hover { - background-color: var(--p-overlaybadge-outline-color); - } - #maskEditor_sidePanelHorizontalButtonContainer { - display: flex; - gap: 10px; - height: 40px; - } - .maskEditor_sidePanelBigButton { - width: 85px; - height: 30px; - border: none; - background: rgba(0, 0, 0, 0.2); - border: 1px solid var(--border-color); - color: var(--input-text); - font-family: sans-serif; - font-size: 15px; - pointer-events: auto; - transition: background-color border 0.1s; - } - .maskEditor_sidePanelBigButton:hover { - background-color: var(--p-overlaybadge-outline-color); - border: none; - } - #maskEditor_toolPanel { - height: 100%; - width: 4rem; - z-index: 8888; - background: var(--comfy-menu-bg); - display: flex; - flex-direction: column; - } - .maskEditor_toolPanelContainer { - width: 4rem; - height: 4rem; - display: flex; - justify-content: center; - align-items: center; - position: relative; - transition: background-color 0.2s; - } - .maskEditor_toolPanelContainerSelected svg { - fill: var(--p-button-text-primary-color) !important; - } - .maskEditor_toolPanelContainerSelected .maskEditor_toolPanelIndicator { - display: block; - } - .maskEditor_toolPanelContainer svg { - width: 75%; - aspect-ratio: 1/1; - fill: var(--p-button-text-secondary-color); - } - - .maskEditor_toolPanelContainerDark:hover { - background-color: var(--p-surface-800); - } - - .maskEditor_toolPanelContainerLight:hover { - background-color: var(--p-surface-300); - } - - .maskEditor_toolPanelIndicator { - display: none; - height: 100%; - width: 4px; - position: absolute; - left: 0; - background: var(--p-button-text-primary-color); - } - #maskEditor_sidePanelPaintBucketSettings { - display: flex; - flex-direction: column; - gap: 10px; - width: 200px; - padding: 10px; - } - #canvasBackground { - background: white; - width: 100%; - height: 100%; - } - #maskEditor_sidePanelButtonsContainer { - display: flex; - flex-direction: column; - gap: 10px; - margin-top: 10px; - } - .maskEditor_sidePanelSeparator { - width: 200px; - height: 2px; - background: var(--border-color); - margin-top: 5px; - margin-bottom: 5px; - } - #maskEditor_pointerZone { - width: calc(100% - 4rem - 220px); - height: 100%; - } - #maskEditor_uiContainer { - width: 100%; - height: 100%; - position: absolute; - z-index: 8888; - display: flex; - flex-direction: column; - } - #maskEditorCanvasContainer { - position: absolute; - width: 1000px; - height: 667px; - left: 359px; - top: 280px; - } - #imageCanvas { - width: 100%; - height: 100%; - } - #maskCanvas { - width: 100%; - height: 100%; - } - #maskEditor_uiHorizontalContainer { - width: 100%; - height: 100%; - display: flex; - } - #maskEditor_topBar { - display: flex; - height: 44px; - align-items: center; - background: var(--comfy-menu-bg); - } - #maskEditor_topBarTitle { - margin: 0; - margin-left: 0.5rem; - margin-right: 0.5rem; - font-size: 1.2em; - } - #maskEditor_topBarButtonContainer { - display: flex; - gap: 10px; - margin-right: 0.5rem; - position: absolute; - right: 0; - width: 200px; - } - #maskEditor_topBarShortcutsContainer { - display: flex; - gap: 10px; - margin-left: 5px; - } - - .maskEditor_topPanelIconButton_dark { - width: 50px; - height: 30px; - pointer-events: auto; - display: flex; - justify-content: center; - align-items: center; - transition: background-color 0.1s; - background: var(--p-surface-800); - border: 1px solid var(--p-form-field-border-color); - border-radius: 10px; - } - - .maskEditor_topPanelIconButton_dark:hover { - background-color: var(--p-surface-900); - } - - .maskEditor_topPanelIconButton_dark svg { - width: 25px; - height: 25px; - pointer-events: none; - fill: var(--input-text); - } - - .maskEditor_topPanelIconButton_light { - width: 50px; - height: 30px; - pointer-events: auto; - display: flex; - justify-content: center; - align-items: center; - transition: background-color 0.1s; - background: var(--comfy-menu-bg); - border: 1px solid var(--p-form-field-border-color); - border-radius: 10px; - } - - .maskEditor_topPanelIconButton_light:hover { - background-color: var(--p-surface-300); - } - - .maskEditor_topPanelIconButton_light svg { - width: 25px; - height: 25px; - pointer-events: none; - fill: var(--input-text); - } - - .maskEditor_topPanelButton_dark { - height: 30px; - background: var(--p-surface-800); - border: 1px solid var(--p-form-field-border-color); - border-radius: 10px; - color: var(--input-text); - font-family: sans-serif; - pointer-events: auto; - transition: 0.1s; - width: 60px; - } - - .maskEditor_topPanelButton_dark:hover { - background-color: var(--p-surface-900); - } - - .maskEditor_topPanelButton_light { - height: 30px; - background: var(--comfy-menu-bg); - border: 1px solid var(--p-form-field-border-color); - border-radius: 10px; - color: var(--input-text); - font-family: sans-serif; - pointer-events: auto; - transition: 0.1s; - width: 60px; - } - - .maskEditor_topPanelButton_light:hover { - background-color: var(--p-surface-300); - } - - - #maskEditor_sidePanelColorSelectSettings { - flex-direction: column; - } - - .maskEditor_sidePanel_paintBucket_Container { - width: 180px; - display: flex; - flex-direction: column; - position: relative; - } - - .maskEditor_sidePanel_colorSelect_Container { - display: flex; - width: 180px; - align-items: center; - gap: 5px; - height: 30px; - } - - #maskEditor_sidePanelVisibilityToggle { - position: absolute; - right: 0; - } - - #maskEditor_sidePanelColorSelectMethodSelect { - position: absolute; - right: 0; - height: 30px; - border-radius: 0; - border: 1px solid var(--border-color); - background: rgba(0,0,0,0.2); - } - - #maskEditor_sidePanelVisibilityToggle { - position: absolute; - right: 0; - } - - .maskEditor_sidePanel_colorSelect_tolerance_container { - display: flex; - flex-direction: column; - gap: 10px; - margin-bottom: 10px; - } - - .maskEditor_sidePanelContainerColumn { - display: flex; - flex-direction: column; - gap: 12px; - } - - .maskEditor_sidePanelContainerRow { - display: flex; - flex-direction: row; - gap: 10px; - align-items: center; - min-height: 24px; - position: relative; - } - - .maskEditor_accent_bg_dark { - background: var(--p-surface-800); - } - - .maskEditor_accent_bg_very_dark { - background: var(--p-surface-900); - } - - .maskEditor_accent_bg_light { - background: var(--p-surface-300); - } - - .maskEditor_accent_bg_very_light { - background: var(--comfy-menu-bg); - } - - #maskEditor_paintBucketSettings { - display: none; - } - - #maskEditor_colorSelectSettings { - display: none; - } - - .maskEditor_sidePanelToggleContainer { - cursor: pointer; - display: inline-block; - position: absolute; - right: 0; - } - - .maskEditor_toggle_bg_dark { - background: var(--p-surface-700); - } - - .maskEditor_toggle_bg_light { - background: var(--p-surface-300); - } - - .maskEditor_sidePanelToggleSwitch { - display: inline-block; - border-radius: 16px; - width: 40px; - height: 24px; - position: relative; - vertical-align: middle; - transition: background 0.25s; - } - .maskEditor_sidePanelToggleSwitch:before, .maskEditor_sidePanelToggleSwitch:after { - content: ""; - } - .maskEditor_sidePanelToggleSwitch:before { - display: block; - background: linear-gradient(to bottom, #fff 0%, #eee 100%); - border-radius: 50%; - width: 16px; - height: 16px; - position: absolute; - top: 4px; - left: 4px; - transition: ease 0.2s; - } - .maskEditor_sidePanelToggleContainer:hover .maskEditor_sidePanelToggleSwitch:before { - background: linear-gradient(to bottom, #fff 0%, #fff 100%); - } - .maskEditor_sidePanelToggleCheckbox:checked + .maskEditor_sidePanelToggleSwitch { - background: var(--p-button-text-primary-color); - } - .maskEditor_sidePanelToggleCheckbox:checked + .maskEditor_toggle_bg_dark:before { - background: var(--p-surface-900); - } - .maskEditor_sidePanelToggleCheckbox:checked + .maskEditor_toggle_bg_light:before { - background: var(--comfy-menu-bg); - } - .maskEditor_sidePanelToggleCheckbox:checked + .maskEditor_sidePanelToggleSwitch:before { - left: 20px; - } - - .maskEditor_sidePanelToggleCheckbox { - position: absolute; - visibility: hidden; - } - - .maskEditor_sidePanelDropdown_dark { - border: 1px solid var(--p-form-field-border-color); - background: var(--p-surface-900); - height: 24px; - padding-left: 5px; - padding-right: 5px; - border-radius: 6px; - transition: background 0.1s; - } - - .maskEditor_sidePanelDropdown_dark option { - background: var(--p-surface-900); - } - - .maskEditor_sidePanelDropdown_dark:focus { - outline: 1px solid var(--p-button-text-primary-color); - } - - .maskEditor_sidePanelDropdown_dark option:hover { - background: white; - } - .maskEditor_sidePanelDropdown_dark option:active { - background: var(--p-highlight-background); - } - - .maskEditor_sidePanelDropdown_light { - border: 1px solid var(--p-form-field-border-color); - background: var(--comfy-menu-bg); - height: 24px; - padding-left: 5px; - padding-right: 5px; - border-radius: 6px; - transition: background 0.1s; - } - - .maskEditor_sidePanelDropdown_light option { - background: var(--comfy-menu-bg); - } - - .maskEditor_sidePanelDropdown_light:focus { - outline: 1px solid var(--p-surface-300); - } - - .maskEditor_sidePanelDropdown_light option:hover { - background: white; - } - .maskEditor_sidePanelDropdown_light option:active { - background: var(--p-surface-300); - } - - .maskEditor_layerRow { - height: 50px; - width: 200px; - border-radius: 10px; - } - - .maskEditor_sidePanelLayerPreviewContainer { - width: 40px; - height: 30px; - } - - .maskEditor_sidePanelLayerPreviewContainer > svg{ - width: 100%; - height: 100%; - object-fit: contain; - fill: var(--p-surface-100); - } - - #maskEditor_sidePanelImageLayerImage { - width: 100%; - height: 100%; - object-fit: contain; - } - - .maskEditor_sidePanelSubTitle { - text-align: left; - font-size: 12px; - font-family: sans-serif; - color: var(--descrip-text); - } - - .maskEditor_containerDropdown { - position: absolute; - right: 0; - } - - .maskEditor_sidePanelLayerCheckbox { - margin-left: 15px; - } - - .maskEditor_toolPanelZoomIndicator { - width: 4rem; - height: 4rem; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - gap: 5px; - color: var(--p-button-text-secondary-color); - position: absolute; - bottom: 0; - transition: background-color 0.2s; - } - - #maskEditor_toolPanelDimensionsText { - font-size: 12px; - } - - #maskEditor_topBarSaveButton { - background: var(--p-primary-color) !important; - color: var(--p-button-primary-color) !important; - } - - #maskEditor_topBarSaveButton:hover { - background: var(--p-primary-hover-color) !important; - } - -`; -var styleSheet = document.createElement("style"); -styleSheet.type = "text/css"; -styleSheet.innerText = styles; -document.head.appendChild(styleSheet); -var BrushShape = /* @__PURE__ */ ((BrushShape2) => { - BrushShape2["Arc"] = "arc"; - BrushShape2["Rect"] = "rect"; - return BrushShape2; -})(BrushShape || {}); -var Tools = /* @__PURE__ */ ((Tools2) => { - Tools2["Pen"] = "pen"; - Tools2["Eraser"] = "eraser"; - Tools2["PaintBucket"] = "paintBucket"; - Tools2["ColorSelect"] = "colorSelect"; - return Tools2; -})(Tools || {}); -var CompositionOperation = /* @__PURE__ */ ((CompositionOperation2) => { - CompositionOperation2["SourceOver"] = "source-over"; - CompositionOperation2["DestinationOut"] = "destination-out"; - return CompositionOperation2; -})(CompositionOperation || {}); -var MaskBlendMode = /* @__PURE__ */ ((MaskBlendMode2) => { - MaskBlendMode2["Black"] = "black"; - MaskBlendMode2["White"] = "white"; - MaskBlendMode2["Negative"] = "negative"; - return MaskBlendMode2; -})(MaskBlendMode || {}); -var ColorComparisonMethod = /* @__PURE__ */ ((ColorComparisonMethod2) => { - ColorComparisonMethod2["Simple"] = "simple"; - ColorComparisonMethod2["HSL"] = "hsl"; - ColorComparisonMethod2["LAB"] = "lab"; - return ColorComparisonMethod2; -})(ColorComparisonMethod || {}); -const saveBrushToCache = lodashExports.debounce(function(key, brush) { - try { - const brushString = JSON.stringify(brush); - setStorageValue(key, brushString); - } catch (error) { - console.error("Failed to save brush to cache:", error); - } -}, 300); -function loadBrushFromCache(key) { - try { - const brushString = getStorageValue(key); - if (brushString) { - const brush = JSON.parse(brushString); - console.log("Loaded brush from cache:", brush); - return brush; - } else { - console.log("No brush found in cache."); - return null; - } - } catch (error) { - console.error("Failed to load brush from cache:", error); - return null; - } -} -__name(loadBrushFromCache, "loadBrushFromCache"); -class MaskEditorDialog extends ComfyDialog { - static { - __name(this, "MaskEditorDialog"); - } - static instance = null; - //new - uiManager; - toolManager; - panAndZoomManager; - brushTool; - paintBucketTool; - colorSelectTool; - canvasHistory; - messageBroker; - keyboardManager; - rootElement; - imageURL; - isLayoutCreated = false; - isOpen = false; - //variables needed? - last_display_style = null; - constructor() { - super(); - this.rootElement = $el( - "div.maskEditor_hidden", - { parent: document.body }, - [] - ); - this.element = this.rootElement; - } - static getInstance() { - if (!ComfyApp.clipspace || !ComfyApp.clipspace.imgs) { - throw new Error("No clipspace images found"); - } - const currentSrc = ComfyApp.clipspace.imgs[ComfyApp.clipspace["selectedIndex"]].src; - if (!MaskEditorDialog.instance || currentSrc !== MaskEditorDialog.instance.imageURL) { - MaskEditorDialog.instance = new MaskEditorDialog(); - } - return MaskEditorDialog.instance; - } - async show() { - this.cleanup(); - if (!this.isLayoutCreated) { - this.messageBroker = new MessageBroker(); - this.canvasHistory = new CanvasHistory(this, 20); - this.paintBucketTool = new PaintBucketTool(this); - this.brushTool = new BrushTool(this); - this.panAndZoomManager = new PanAndZoomManager(this); - this.toolManager = new ToolManager(this); - this.keyboardManager = new KeyboardManager(this); - this.uiManager = new UIManager(this.rootElement, this); - this.colorSelectTool = new ColorSelectTool(this); - const self2 = this; - const observer = new MutationObserver(function(mutations) { - mutations.forEach(function(mutation) { - if (mutation.type === "attributes" && mutation.attributeName === "style") { - if (self2.last_display_style && self2.last_display_style != "none" && self2.element.style.display == "none") { - ComfyApp.onClipspaceEditorClosed(); - } - self2.last_display_style = self2.element.style.display; - } - }); - }); - const config = { attributes: true }; - observer.observe(this.rootElement, config); - this.isLayoutCreated = true; - await this.uiManager.setlayout(); - } - this.rootElement.id = "maskEditor"; - this.rootElement.style.display = "flex"; - this.element.style.display = "flex"; - await this.uiManager.initUI(); - this.paintBucketTool.initPaintBucketTool(); - this.colorSelectTool.initColorSelectTool(); - await this.canvasHistory.saveInitialState(); - this.isOpen = true; - if (ComfyApp.clipspace && ComfyApp.clipspace.imgs) { - this.uiManager.setSidebarImage(); - } - this.keyboardManager.addListeners(); - } - cleanup() { - const maskEditors = document.querySelectorAll('[id^="maskEditor"]'); - maskEditors.forEach((element) => element.remove()); - const brushElements = document.querySelectorAll("#maskEditor_brush"); - brushElements.forEach((element) => element.remove()); - } - isOpened() { - return this.isOpen; - } - async save() { - const backupCanvas = document.createElement("canvas"); - const imageCanvas = this.uiManager.getImgCanvas(); - const maskCanvas = this.uiManager.getMaskCanvas(); - const image = this.uiManager.getImage(); - const backupCtx = backupCanvas.getContext("2d", { - willReadFrequently: true - }); - backupCanvas.width = imageCanvas.width; - backupCanvas.height = imageCanvas.height; - if (!backupCtx) { - return; - } - const maskImageLoaded = new Promise((resolve, reject) => { - const maskImage = new Image(); - maskImage.src = maskCanvas.toDataURL(); - maskImage.onload = () => { - resolve(); - }; - maskImage.onerror = (error) => { - reject(error); - }; - }); - try { - await maskImageLoaded; - } catch (error) { - console.error("Error loading mask image:", error); - return; - } - backupCtx.clearRect(0, 0, backupCanvas.width, backupCanvas.height); - backupCtx.drawImage( - maskCanvas, - 0, - 0, - maskCanvas.width, - maskCanvas.height, - 0, - 0, - backupCanvas.width, - backupCanvas.height - ); - let maskHasContent = false; - const maskData = backupCtx.getImageData( - 0, - 0, - backupCanvas.width, - backupCanvas.height - ); - for (let i = 0; i < maskData.data.length; i += 4) { - if (maskData.data[i + 3] !== 0) { - maskHasContent = true; - break; - } - } - const backupData = backupCtx.getImageData( - 0, - 0, - backupCanvas.width, - backupCanvas.height - ); - let backupHasContent = false; - for (let i = 0; i < backupData.data.length; i += 4) { - if (backupData.data[i + 3] !== 0) { - backupHasContent = true; - break; - } - } - if (maskHasContent && !backupHasContent) { - console.error("Mask appears to be empty"); - alert("Cannot save empty mask"); - return; - } - for (let i = 0; i < backupData.data.length; i += 4) { - const alpha = backupData.data[i + 3]; - backupData.data[i] = 0; - backupData.data[i + 1] = 0; - backupData.data[i + 2] = 0; - backupData.data[i + 3] = 255 - alpha; - } - backupCtx.globalCompositeOperation = "source-over"; - backupCtx.putImageData(backupData, 0, 0); - const formData = new FormData(); - const filename = "clipspace-mask-" + performance.now() + ".png"; - const item = { - filename, - subfolder: "clipspace", - type: "input" - }; - if (ComfyApp?.clipspace?.widgets?.length) { - const index = ComfyApp.clipspace.widgets.findIndex( - (obj) => obj?.name === "image" - ); - if (index >= 0 && item !== void 0) { - try { - ComfyApp.clipspace.widgets[index].value = item; - } catch (err2) { - console.warn("Failed to set widget value:", err2); - } - } - } - const dataURL = backupCanvas.toDataURL(); - const blob = this.dataURLToBlob(dataURL); - let original_url = new URL(image.src); - this.uiManager.setBrushOpacity(0); - const filenameRef = original_url.searchParams.get("filename"); - if (!filenameRef) { - throw new Error("filename parameter is required"); - } - const original_ref = { - filename: filenameRef - }; - let original_subfolder = original_url.searchParams.get("subfolder"); - if (original_subfolder) original_ref.subfolder = original_subfolder; - let original_type = original_url.searchParams.get("type"); - if (original_type) original_ref.type = original_type; - formData.append("image", blob, filename); - formData.append("original_ref", JSON.stringify(original_ref)); - formData.append("type", "input"); - formData.append("subfolder", "clipspace"); - this.uiManager.setSaveButtonText("Saving"); - this.uiManager.setSaveButtonEnabled(false); - this.keyboardManager.removeListeners(); - const maxRetries = 3; - let attempt = 0; - let success = false; - while (attempt < maxRetries && !success) { - try { - await this.uploadMask(item, formData); - success = true; - } catch (error) { - console.error(`Upload attempt ${attempt + 1} failed:`, error); - attempt++; - if (attempt < maxRetries) { - console.log("Retrying upload..."); - } else { - console.log("Max retries reached. Upload failed."); - } - } - } - if (success) { - ComfyApp.onClipspaceEditorSave(); - this.close(); - this.isOpen = false; - } else { - this.uiManager.setSaveButtonText("Save"); - this.uiManager.setSaveButtonEnabled(true); - this.keyboardManager.addListeners(); - } - } - getMessageBroker() { - return this.messageBroker; - } - // Helper function to convert a data URL to a Blob object - dataURLToBlob(dataURL) { - const parts = dataURL.split(";base64,"); - const contentType = parts[0].split(":")[1]; - const byteString = atob(parts[1]); - const arrayBuffer = new ArrayBuffer(byteString.length); - const uint8Array = new Uint8Array(arrayBuffer); - for (let i = 0; i < byteString.length; i++) { - uint8Array[i] = byteString.charCodeAt(i); - } - return new Blob([arrayBuffer], { type: contentType }); - } - async uploadMask(filepath, formData, retries = 3) { - if (retries <= 0) { - throw new Error("Max retries reached"); - return; - } - await api.fetchApi("/upload/mask", { - method: "POST", - body: formData - }).then((response) => { - if (!response.ok) { - console.log("Failed to upload mask:", response); - this.uploadMask(filepath, formData, retries - 1); - } - }).catch((error) => { - console.error("Error:", error); - }); - try { - const selectedIndex = ComfyApp.clipspace?.selectedIndex; - if (ComfyApp.clipspace?.imgs && selectedIndex !== void 0) { - const newImage = new Image(); - newImage.src = api.apiURL( - "/view?" + new URLSearchParams(filepath).toString() + app.getPreviewFormatParam() + app.getRandParam() - ); - ComfyApp.clipspace.imgs[selectedIndex] = newImage; - if (ComfyApp.clipspace.images) { - ComfyApp.clipspace.images[selectedIndex] = filepath; - } - } - } catch (err2) { - console.warn("Failed to update clipspace image:", err2); - } - ClipspaceDialog.invalidatePreview(); - } -} -class CanvasHistory { - static { - __name(this, "CanvasHistory"); - } - maskEditor; - messageBroker; - canvas; - ctx; - states = []; - currentStateIndex = -1; - maxStates = 20; - initialized = false; - constructor(maskEditor, maxStates = 20) { - this.maskEditor = maskEditor; - this.messageBroker = maskEditor.getMessageBroker(); - this.maxStates = maxStates; - this.createListeners(); - } - async pullCanvas() { - this.canvas = await this.messageBroker.pull("maskCanvas"); - this.ctx = await this.messageBroker.pull("maskCtx"); - } - createListeners() { - this.messageBroker.subscribe("saveState", () => this.saveState()); - this.messageBroker.subscribe("undo", () => this.undo()); - this.messageBroker.subscribe("redo", () => this.redo()); - } - clearStates() { - this.states = []; - this.currentStateIndex = -1; - this.initialized = false; - } - async saveInitialState() { - await this.pullCanvas(); - if (!this.canvas.width || !this.canvas.height) { - requestAnimationFrame(() => this.saveInitialState()); - return; - } - this.clearStates(); - const state = this.ctx.getImageData( - 0, - 0, - this.canvas.width, - this.canvas.height - ); - this.states.push(state); - this.currentStateIndex = 0; - this.initialized = true; - } - saveState() { - if (!this.initialized || this.currentStateIndex === -1) { - this.saveInitialState(); - return; - } - this.states = this.states.slice(0, this.currentStateIndex + 1); - const state = this.ctx.getImageData( - 0, - 0, - this.canvas.width, - this.canvas.height - ); - this.states.push(state); - this.currentStateIndex++; - if (this.states.length > this.maxStates) { - this.states.shift(); - this.currentStateIndex--; - } - } - undo() { - if (this.states.length > 1 && this.currentStateIndex > 0) { - this.currentStateIndex--; - this.restoreState(this.states[this.currentStateIndex]); - } else { - alert("No more undo states available"); - } - } - redo() { - if (this.states.length > 1 && this.currentStateIndex < this.states.length - 1) { - this.currentStateIndex++; - this.restoreState(this.states[this.currentStateIndex]); - } else { - alert("No more redo states available"); - } - } - restoreState(state) { - if (state && this.initialized) { - this.ctx.putImageData(state, 0, 0); - } - } -} -class PaintBucketTool { - static { - __name(this, "PaintBucketTool"); - } - maskEditor; - messageBroker; - canvas; - ctx; - width = null; - height = null; - imageData = null; - data = null; - tolerance = 5; - constructor(maskEditor) { - this.maskEditor = maskEditor; - this.messageBroker = maskEditor.getMessageBroker(); - this.createListeners(); - this.addPullTopics(); - } - initPaintBucketTool() { - this.pullCanvas(); - } - async pullCanvas() { - this.canvas = await this.messageBroker.pull("maskCanvas"); - this.ctx = await this.messageBroker.pull("maskCtx"); - } - createListeners() { - this.messageBroker.subscribe( - "setPaintBucketTolerance", - (tolerance) => this.setTolerance(tolerance) - ); - this.messageBroker.subscribe( - "paintBucketFill", - (point) => this.floodFill(point) - ); - this.messageBroker.subscribe("invert", () => this.invertMask()); - } - addPullTopics() { - this.messageBroker.createPullTopic( - "getTolerance", - async () => this.tolerance - ); - } - getPixel(x, y) { - return this.data[(y * this.width + x) * 4 + 3]; - } - setPixel(x, y, alpha, color) { - const index = (y * this.width + x) * 4; - this.data[index] = color.r; - this.data[index + 1] = color.g; - this.data[index + 2] = color.b; - this.data[index + 3] = alpha; - } - shouldProcessPixel(currentAlpha, targetAlpha, tolerance, isFillMode) { - if (currentAlpha === -1) return false; - if (isFillMode) { - return currentAlpha !== 255 && Math.abs(currentAlpha - targetAlpha) <= tolerance; - } else { - return currentAlpha === 255 || Math.abs(currentAlpha - targetAlpha) <= tolerance; - } - } - async floodFill(point) { - let startX = Math.floor(point.x); - let startY = Math.floor(point.y); - this.width = this.canvas.width; - this.height = this.canvas.height; - if (startX < 0 || startX >= this.width || startY < 0 || startY >= this.height) { - return; - } - this.imageData = this.ctx.getImageData(0, 0, this.width, this.height); - this.data = this.imageData.data; - const targetAlpha = this.getPixel(startX, startY); - const isFillMode = targetAlpha !== 255; - if (targetAlpha === -1) return; - const maskColor = await this.messageBroker.pull("getMaskColor"); - const stack = []; - const visited = new Uint8Array(this.width * this.height); - if (this.shouldProcessPixel( - targetAlpha, - targetAlpha, - this.tolerance, - isFillMode - )) { - stack.push([startX, startY]); - } - while (stack.length > 0) { - const [x, y] = stack.pop(); - const visitedIndex = y * this.width + x; - if (visited[visitedIndex]) continue; - const currentAlpha = this.getPixel(x, y); - if (!this.shouldProcessPixel( - currentAlpha, - targetAlpha, - this.tolerance, - isFillMode - )) { - continue; - } - visited[visitedIndex] = 1; - this.setPixel(x, y, isFillMode ? 255 : 0, maskColor); - const checkNeighbor = /* @__PURE__ */ __name((nx, ny) => { - if (nx < 0 || nx >= this.width || ny < 0 || ny >= this.height) return; - if (!visited[ny * this.width + nx]) { - const alpha = this.getPixel(nx, ny); - if (this.shouldProcessPixel( - alpha, - targetAlpha, - this.tolerance, - isFillMode - )) { - stack.push([nx, ny]); - } - } - }, "checkNeighbor"); - checkNeighbor(x - 1, y); - checkNeighbor(x + 1, y); - checkNeighbor(x, y - 1); - checkNeighbor(x, y + 1); - } - this.ctx.putImageData(this.imageData, 0, 0); - this.imageData = null; - this.data = null; - } - setTolerance(tolerance) { - this.tolerance = tolerance; - } - getTolerance() { - return this.tolerance; - } - //invert mask - invertMask() { - const imageData = this.ctx.getImageData( - 0, - 0, - this.canvas.width, - this.canvas.height - ); - const data = imageData.data; - let maskR = 0, maskG = 0, maskB = 0; - for (let i = 0; i < data.length; i += 4) { - if (data[i + 3] > 0) { - maskR = data[i]; - maskG = data[i + 1]; - maskB = data[i + 2]; - break; - } - } - for (let i = 0; i < data.length; i += 4) { - const alpha = data[i + 3]; - data[i + 3] = 255 - alpha; - if (alpha === 0) { - data[i] = maskR; - data[i + 1] = maskG; - data[i + 2] = maskB; - } - } - this.ctx.putImageData(imageData, 0, 0); - this.messageBroker.publish("saveState"); - } -} -class ColorSelectTool { - static { - __name(this, "ColorSelectTool"); - } - maskEditor; - messageBroker; - width = null; - height = null; - canvas; - maskCTX; - imageCTX; - maskData = null; - imageData = null; - tolerance = 20; - livePreview = false; - lastPoint = null; - colorComparisonMethod = "simple"; - applyWholeImage = false; - maskBoundry = false; - maskTolerance = 0; - constructor(maskEditor) { - this.maskEditor = maskEditor; - this.messageBroker = maskEditor.getMessageBroker(); - this.createListeners(); - this.addPullTopics(); - } - async initColorSelectTool() { - await this.pullCanvas(); - } - async pullCanvas() { - this.canvas = await this.messageBroker.pull("imgCanvas"); - this.maskCTX = await this.messageBroker.pull("maskCtx"); - this.imageCTX = await this.messageBroker.pull("imageCtx"); - } - createListeners() { - this.messageBroker.subscribe( - "colorSelectFill", - (point) => this.fillColorSelection(point) - ); - this.messageBroker.subscribe( - "setColorSelectTolerance", - (tolerance) => this.setTolerance(tolerance) - ); - this.messageBroker.subscribe( - "setLivePreview", - (livePreview) => this.setLivePreview(livePreview) - ); - this.messageBroker.subscribe( - "setColorComparisonMethod", - (method) => this.setComparisonMethod(method) - ); - this.messageBroker.subscribe("clearLastPoint", () => this.clearLastPoint()); - this.messageBroker.subscribe( - "setWholeImage", - (applyWholeImage) => this.setApplyWholeImage(applyWholeImage) - ); - this.messageBroker.subscribe( - "setMaskBoundary", - (maskBoundry) => this.setMaskBoundary(maskBoundry) - ); - this.messageBroker.subscribe( - "setMaskTolerance", - (maskTolerance) => this.setMaskTolerance(maskTolerance) - ); - } - async addPullTopics() { - this.messageBroker.createPullTopic( - "getLivePreview", - async () => this.livePreview - ); - } - getPixel(x, y) { - const index = (y * this.width + x) * 4; - return { - r: this.imageData[index], - g: this.imageData[index + 1], - b: this.imageData[index + 2] - }; - } - getMaskAlpha(x, y) { - return this.maskData[(y * this.width + x) * 4 + 3]; - } - isPixelInRange(pixel, target) { - switch (this.colorComparisonMethod) { - case "simple": - return this.isPixelInRangeSimple(pixel, target); - case "hsl": - return this.isPixelInRangeHSL(pixel, target); - case "lab": - return this.isPixelInRangeLab(pixel, target); - default: - return this.isPixelInRangeSimple(pixel, target); - } - } - isPixelInRangeSimple(pixel, target) { - const distance = Math.sqrt( - Math.pow(pixel.r - target.r, 2) + Math.pow(pixel.g - target.g, 2) + Math.pow(pixel.b - target.b, 2) - ); - return distance <= this.tolerance; - } - isPixelInRangeHSL(pixel, target) { - const pixelHSL = this.rgbToHSL(pixel.r, pixel.g, pixel.b); - const targetHSL = this.rgbToHSL(target.r, target.g, target.b); - const hueDiff = Math.abs(pixelHSL.h - targetHSL.h); - const satDiff = Math.abs(pixelHSL.s - targetHSL.s); - const lightDiff = Math.abs(pixelHSL.l - targetHSL.l); - const distance = Math.sqrt( - Math.pow(hueDiff / 360 * 255, 2) + Math.pow(satDiff / 100 * 255, 2) + Math.pow(lightDiff / 100 * 255, 2) - ); - return distance <= this.tolerance; - } - rgbToHSL(r, g, b) { - r /= 255; - g /= 255; - b /= 255; - const max2 = Math.max(r, g, b); - const min = Math.min(r, g, b); - let h = 0, s = 0, l = (max2 + min) / 2; - if (max2 !== min) { - const d = max2 - min; - s = l > 0.5 ? d / (2 - max2 - min) : d / (max2 + min); - switch (max2) { - case r: - h = (g - b) / d + (g < b ? 6 : 0); - break; - case g: - h = (b - r) / d + 2; - break; - case b: - h = (r - g) / d + 4; - break; - } - h /= 6; - } - return { - h: h * 360, - s: s * 100, - l: l * 100 - }; - } - isPixelInRangeLab(pixel, target) { - const pixelLab = this.rgbToLab(pixel); - const targetLab = this.rgbToLab(target); - const deltaE = Math.sqrt( - Math.pow(pixelLab.l - targetLab.l, 2) + Math.pow(pixelLab.a - targetLab.a, 2) + Math.pow(pixelLab.b - targetLab.b, 2) - ); - const normalizedDeltaE = deltaE / 100 * 255; - return normalizedDeltaE <= this.tolerance; - } - rgbToLab(rgb) { - let r = rgb.r / 255; - let g = rgb.g / 255; - let b = rgb.b / 255; - r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92; - g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92; - b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92; - r *= 100; - g *= 100; - b *= 100; - const x = r * 0.4124 + g * 0.3576 + b * 0.1805; - const y = r * 0.2126 + g * 0.7152 + b * 0.0722; - const z = r * 0.0193 + g * 0.1192 + b * 0.9505; - const xn = 95.047; - const yn = 100; - const zn = 108.883; - const xyz = [x / xn, y / yn, z / zn]; - for (let i = 0; i < xyz.length; i++) { - xyz[i] = xyz[i] > 8856e-6 ? Math.pow(xyz[i], 1 / 3) : 7.787 * xyz[i] + 16 / 116; - } - return { - l: 116 * xyz[1] - 16, - a: 500 * (xyz[0] - xyz[1]), - b: 200 * (xyz[1] - xyz[2]) - }; - } - setPixel(x, y, alpha, color) { - const index = (y * this.width + x) * 4; - this.maskData[index] = color.r; - this.maskData[index + 1] = color.g; - this.maskData[index + 2] = color.b; - this.maskData[index + 3] = alpha; - } - async fillColorSelection(point) { - this.width = this.canvas.width; - this.height = this.canvas.height; - this.lastPoint = point; - const maskData = this.maskCTX.getImageData(0, 0, this.width, this.height); - this.maskData = maskData.data; - this.imageData = this.imageCTX.getImageData( - 0, - 0, - this.width, - this.height - ).data; - if (this.applyWholeImage) { - const targetPixel = this.getPixel( - Math.floor(point.x), - Math.floor(point.y) - ); - const maskColor = await this.messageBroker.pull("getMaskColor"); - const width = this.width; - const height = this.height; - const CHUNK_SIZE = 1e4; - for (let i = 0; i < width * height; i += CHUNK_SIZE) { - const endIndex = Math.min(i + CHUNK_SIZE, width * height); - for (let pixelIndex = i; pixelIndex < endIndex; pixelIndex++) { - const x = pixelIndex % width; - const y = Math.floor(pixelIndex / width); - if (this.isPixelInRange(this.getPixel(x, y), targetPixel)) { - this.setPixel(x, y, 255, maskColor); - } - } - await new Promise((resolve) => setTimeout(resolve, 0)); - } - } else { - let startX = Math.floor(point.x); - let startY = Math.floor(point.y); - if (startX < 0 || startX >= this.width || startY < 0 || startY >= this.height) { - return; - } - const pixel = this.getPixel(startX, startY); - const stack = []; - const visited = new Uint8Array(this.width * this.height); - stack.push([startX, startY]); - const maskColor = await this.messageBroker.pull("getMaskColor"); - while (stack.length > 0) { - const [x, y] = stack.pop(); - const visitedIndex = y * this.width + x; - if (visited[visitedIndex] || !this.isPixelInRange(this.getPixel(x, y), pixel)) { - continue; - } - visited[visitedIndex] = 1; - this.setPixel(x, y, 255, maskColor); - if (x > 0 && !visited[y * this.width + (x - 1)] && this.isPixelInRange(this.getPixel(x - 1, y), pixel)) { - if (!this.maskBoundry || 255 - this.getMaskAlpha(x - 1, y) > this.maskTolerance) { - stack.push([x - 1, y]); - } - } - if (x < this.width - 1 && !visited[y * this.width + (x + 1)] && this.isPixelInRange(this.getPixel(x + 1, y), pixel)) { - if (!this.maskBoundry || 255 - this.getMaskAlpha(x + 1, y) > this.maskTolerance) { - stack.push([x + 1, y]); - } - } - if (y > 0 && !visited[(y - 1) * this.width + x] && this.isPixelInRange(this.getPixel(x, y - 1), pixel)) { - if (!this.maskBoundry || 255 - this.getMaskAlpha(x, y - 1) > this.maskTolerance) { - stack.push([x, y - 1]); - } - } - if (y < this.height - 1 && !visited[(y + 1) * this.width + x] && this.isPixelInRange(this.getPixel(x, y + 1), pixel)) { - if (!this.maskBoundry || 255 - this.getMaskAlpha(x, y + 1) > this.maskTolerance) { - stack.push([x, y + 1]); - } - } - } - } - this.maskCTX.putImageData(maskData, 0, 0); - this.messageBroker.publish("saveState"); - this.maskData = null; - this.imageData = null; - } - setTolerance(tolerance) { - this.tolerance = tolerance; - if (this.lastPoint && this.livePreview) { - this.messageBroker.publish("undo"); - this.fillColorSelection(this.lastPoint); - } - } - setLivePreview(livePreview) { - this.livePreview = livePreview; - } - setComparisonMethod(method) { - this.colorComparisonMethod = method; - if (this.lastPoint && this.livePreview) { - this.messageBroker.publish("undo"); - this.fillColorSelection(this.lastPoint); - } - } - clearLastPoint() { - this.lastPoint = null; - } - setApplyWholeImage(applyWholeImage) { - this.applyWholeImage = applyWholeImage; - } - setMaskBoundary(maskBoundry) { - this.maskBoundry = maskBoundry; - } - setMaskTolerance(maskTolerance) { - this.maskTolerance = maskTolerance; - } -} -class BrushTool { - static { - __name(this, "BrushTool"); - } - brushSettings; - //this saves the current brush settings - maskBlendMode; - isDrawing = false; - isDrawingLine = false; - lineStartPoint = null; - smoothingPrecision = 10; - smoothingCordsArray = []; - smoothingLastDrawTime; - maskCtx = null; - initialDraw = true; - brushStrokeCanvas = null; - brushStrokeCtx = null; - //brush adjustment - isBrushAdjusting = false; - brushPreviewGradient = null; - initialPoint = null; - useDominantAxis = false; - brushAdjustmentSpeed = 1; - maskEditor; - messageBroker; - constructor(maskEditor) { - this.maskEditor = maskEditor; - this.messageBroker = maskEditor.getMessageBroker(); - this.createListeners(); - this.addPullTopics(); - this.useDominantAxis = app.extensionManager.setting.get( - "Comfy.MaskEditor.UseDominantAxis" - ); - this.brushAdjustmentSpeed = app.extensionManager.setting.get( - "Comfy.MaskEditor.BrushAdjustmentSpeed" - ); - const cachedBrushSettings = loadBrushFromCache("maskeditor_brush_settings"); - if (cachedBrushSettings) { - this.brushSettings = cachedBrushSettings; - } else { - this.brushSettings = { - type: "arc", - size: 10, - opacity: 0.7, - hardness: 1, - smoothingPrecision: 10 - }; - } - this.maskBlendMode = "black"; - } - createListeners() { - this.messageBroker.subscribe( - "setBrushSize", - (size) => this.setBrushSize(size) - ); - this.messageBroker.subscribe( - "setBrushOpacity", - (opacity) => this.setBrushOpacity(opacity) - ); - this.messageBroker.subscribe( - "setBrushHardness", - (hardness) => this.setBrushHardness(hardness) - ); - this.messageBroker.subscribe( - "setBrushShape", - (type) => this.setBrushType(type) - ); - this.messageBroker.subscribe( - "setBrushSmoothingPrecision", - (precision) => this.setBrushSmoothingPrecision(precision) - ); - this.messageBroker.subscribe( - "brushAdjustmentStart", - (event) => this.startBrushAdjustment(event) - ); - this.messageBroker.subscribe( - "brushAdjustment", - (event) => this.handleBrushAdjustment(event) - ); - this.messageBroker.subscribe( - "drawStart", - (event) => this.startDrawing(event) - ); - this.messageBroker.subscribe( - "draw", - (event) => this.handleDrawing(event) - ); - this.messageBroker.subscribe( - "drawEnd", - (event) => this.drawEnd(event) - ); - } - addPullTopics() { - this.messageBroker.createPullTopic( - "brushSize", - async () => this.brushSettings.size - ); - this.messageBroker.createPullTopic( - "brushOpacity", - async () => this.brushSettings.opacity - ); - this.messageBroker.createPullTopic( - "brushHardness", - async () => this.brushSettings.hardness - ); - this.messageBroker.createPullTopic( - "brushType", - async () => this.brushSettings.type - ); - this.messageBroker.createPullTopic( - "brushSmoothingPrecision", - async () => this.brushSettings.smoothingPrecision - ); - this.messageBroker.createPullTopic( - "maskBlendMode", - async () => this.maskBlendMode - ); - this.messageBroker.createPullTopic( - "brushSettings", - async () => this.brushSettings - ); - } - async createBrushStrokeCanvas() { - if (this.brushStrokeCanvas !== null) { - return; - } - const maskCanvas = await this.messageBroker.pull("maskCanvas"); - const canvas = document.createElement("canvas"); - canvas.width = maskCanvas.width; - canvas.height = maskCanvas.height; - this.brushStrokeCanvas = canvas; - this.brushStrokeCtx = canvas.getContext("2d"); - } - async startDrawing(event) { - this.isDrawing = true; - let compositionOp; - let currentTool = await this.messageBroker.pull("currentTool"); - let coords = { x: event.offsetX, y: event.offsetY }; - let coords_canvas = await this.messageBroker.pull("screenToCanvas", coords); - await this.createBrushStrokeCanvas(); - if (currentTool === "eraser" || event.buttons == 2) { - compositionOp = "destination-out"; - } else { - compositionOp = "source-over"; - } - if (event.shiftKey && this.lineStartPoint) { - this.isDrawingLine = true; - this.drawLine(this.lineStartPoint, coords_canvas, compositionOp); - } else { - this.isDrawingLine = false; - this.init_shape(compositionOp); - this.draw_shape(coords_canvas); - } - this.lineStartPoint = coords_canvas; - this.smoothingCordsArray = [coords_canvas]; - this.smoothingLastDrawTime = /* @__PURE__ */ new Date(); - } - async handleDrawing(event) { - var diff = performance.now() - this.smoothingLastDrawTime.getTime(); - let coords = { x: event.offsetX, y: event.offsetY }; - let coords_canvas = await this.messageBroker.pull("screenToCanvas", coords); - let currentTool = await this.messageBroker.pull("currentTool"); - if (diff > 20 && !this.isDrawing) - requestAnimationFrame(() => { - this.init_shape( - "source-over" - /* SourceOver */ - ); - this.draw_shape(coords_canvas); - this.smoothingCordsArray.push(coords_canvas); - }); - else - requestAnimationFrame(() => { - if (currentTool === "eraser" || event.buttons == 2) { - this.init_shape( - "destination-out" - /* DestinationOut */ - ); - } else { - this.init_shape( - "source-over" - /* SourceOver */ - ); - } - this.drawWithBetterSmoothing(coords_canvas); - }); - this.smoothingLastDrawTime = /* @__PURE__ */ new Date(); - } - async drawEnd(event) { - const coords = { x: event.offsetX, y: event.offsetY }; - const coords_canvas = await this.messageBroker.pull( - "screenToCanvas", - coords - ); - if (this.isDrawing) { - this.isDrawing = false; - this.messageBroker.publish("saveState"); - this.lineStartPoint = coords_canvas; - this.initialDraw = true; - } - } - drawWithBetterSmoothing(point) { - if (!this.smoothingCordsArray) { - this.smoothingCordsArray = []; - } - const opacityConstant = 1 / (1 + Math.exp(3)); - const interpolatedOpacity = 1 / (1 + Math.exp(-6 * (this.brushSettings.opacity - 0.5))) - opacityConstant; - this.smoothingCordsArray.push(point); - const POINTS_NR = 5; - if (this.smoothingCordsArray.length < POINTS_NR) { - return; - } - let totalLength = 0; - const points = this.smoothingCordsArray; - const len = points.length - 1; - let dx, dy; - for (let i = 0; i < len; i++) { - dx = points[i + 1].x - points[i].x; - dy = points[i + 1].y - points[i].y; - totalLength += Math.sqrt(dx * dx + dy * dy); - } - const distanceBetweenPoints = this.brushSettings.size / this.brushSettings.smoothingPrecision * 6; - const stepNr = Math.ceil(totalLength / distanceBetweenPoints); - let interpolatedPoints = points; - if (stepNr > 0) { - interpolatedPoints = this.generateEquidistantPoints( - this.smoothingCordsArray, - distanceBetweenPoints - // Distance between interpolated points - ); - } - if (!this.initialDraw) { - const spliceIndex = interpolatedPoints.findIndex( - (point2) => point2.x === this.smoothingCordsArray[2].x && point2.y === this.smoothingCordsArray[2].y - ); - if (spliceIndex !== -1) { - interpolatedPoints = interpolatedPoints.slice(spliceIndex + 1); - } - } - for (const point2 of interpolatedPoints) { - this.draw_shape(point2, interpolatedOpacity); - } - if (!this.initialDraw) { - this.smoothingCordsArray = this.smoothingCordsArray.slice(2); - } else { - this.initialDraw = false; - } - } - async drawLine(p1, p2, compositionOp) { - const brush_size = await this.messageBroker.pull("brushSize"); - const distance = Math.sqrt((p2.x - p1.x) ** 2 + (p2.y - p1.y) ** 2); - const steps = Math.ceil( - distance / (brush_size / this.brushSettings.smoothingPrecision * 4) - ); - const interpolatedOpacity = 1 / (1 + Math.exp(-6 * (this.brushSettings.opacity - 0.5))) - 1 / (1 + Math.exp(3)); - this.init_shape(compositionOp); - for (let i = 0; i <= steps; i++) { - const t2 = i / steps; - const x = p1.x + (p2.x - p1.x) * t2; - const y = p1.y + (p2.y - p1.y) * t2; - const point = { x, y }; - this.draw_shape(point, interpolatedOpacity); - } - } - //brush adjustment - async startBrushAdjustment(event) { - event.preventDefault(); - const coords = { x: event.offsetX, y: event.offsetY }; - let coords_canvas = await this.messageBroker.pull("screenToCanvas", coords); - this.messageBroker.publish("setBrushPreviewGradientVisibility", true); - this.initialPoint = coords_canvas; - this.isBrushAdjusting = true; - return; - } - async handleBrushAdjustment(event) { - const coords = { x: event.offsetX, y: event.offsetY }; - const brushDeadZone = 5; - let coords_canvas = await this.messageBroker.pull("screenToCanvas", coords); - const delta_x = coords_canvas.x - this.initialPoint.x; - const delta_y = coords_canvas.y - this.initialPoint.y; - const effectiveDeltaX = Math.abs(delta_x) < brushDeadZone ? 0 : delta_x; - const effectiveDeltaY = Math.abs(delta_y) < brushDeadZone ? 0 : delta_y; - let finalDeltaX = effectiveDeltaX; - let finalDeltaY = effectiveDeltaY; - console.log(this.useDominantAxis); - if (this.useDominantAxis) { - const ratio = Math.abs(effectiveDeltaX) / Math.abs(effectiveDeltaY); - const threshold = 2; - if (ratio > threshold) { - finalDeltaY = 0; - } else if (ratio < 1 / threshold) { - finalDeltaX = 0; - } - } - const cappedDeltaX = Math.max(-100, Math.min(100, finalDeltaX)); - const cappedDeltaY = Math.max(-100, Math.min(100, finalDeltaY)); - const sizeDelta = cappedDeltaX / 40; - const hardnessDelta = cappedDeltaY / 800; - const newSize = Math.max( - 1, - Math.min( - 100, - this.brushSettings.size + cappedDeltaX / 35 * this.brushAdjustmentSpeed - ) - ); - const newHardness = Math.max( - 0, - Math.min( - 1, - this.brushSettings.hardness - cappedDeltaY / 4e3 * this.brushAdjustmentSpeed - ) - ); - this.brushSettings.size = newSize; - this.brushSettings.hardness = newHardness; - this.messageBroker.publish("updateBrushPreview"); - } - //helper functions - async draw_shape(point, overrideOpacity) { - const brushSettings = this.brushSettings; - const maskCtx = this.maskCtx || await this.messageBroker.pull("maskCtx"); - const brushType = await this.messageBroker.pull("brushType"); - const maskColor = await this.messageBroker.pull("getMaskColor"); - const size = brushSettings.size; - const sliderOpacity = brushSettings.opacity; - const opacity = overrideOpacity == void 0 ? sliderOpacity : overrideOpacity; - const hardness = brushSettings.hardness; - const x = point.x; - const y = point.y; - const extendedSize = size * (2 - hardness); - let gradient = maskCtx.createRadialGradient(x, y, 0, x, y, extendedSize); - const isErasing = maskCtx.globalCompositeOperation === "destination-out"; - if (hardness === 1) { - console.log(sliderOpacity, opacity); - gradient.addColorStop( - 0, - isErasing ? `rgba(255, 255, 255, ${opacity})` : `rgba(${maskColor.r}, ${maskColor.g}, ${maskColor.b}, ${opacity})` - ); - gradient.addColorStop( - 1, - isErasing ? `rgba(255, 255, 255, ${opacity})` : `rgba(${maskColor.r}, ${maskColor.g}, ${maskColor.b}, ${opacity})` - ); - } else { - let softness = 1 - hardness; - let innerStop = Math.max(0, hardness - softness); - let outerStop = size / extendedSize; - if (isErasing) { - gradient.addColorStop(0, `rgba(255, 255, 255, ${opacity})`); - gradient.addColorStop(innerStop, `rgba(255, 255, 255, ${opacity})`); - gradient.addColorStop(outerStop, `rgba(255, 255, 255, ${opacity / 2})`); - gradient.addColorStop(1, `rgba(255, 255, 255, 0)`); - } else { - gradient.addColorStop( - 0, - `rgba(${maskColor.r}, ${maskColor.g}, ${maskColor.b}, ${opacity})` - ); - gradient.addColorStop( - innerStop, - `rgba(${maskColor.r}, ${maskColor.g}, ${maskColor.b}, ${opacity})` - ); - gradient.addColorStop( - outerStop, - `rgba(${maskColor.r}, ${maskColor.g}, ${maskColor.b}, ${opacity / 2})` - ); - gradient.addColorStop( - 1, - `rgba(${maskColor.r}, ${maskColor.g}, ${maskColor.b}, 0)` - ); - } - } - maskCtx.fillStyle = gradient; - maskCtx.beginPath(); - if (brushType === "rect") { - maskCtx.rect( - x - extendedSize, - y - extendedSize, - extendedSize * 2, - extendedSize * 2 - ); - } else { - maskCtx.arc(x, y, extendedSize, 0, Math.PI * 2, false); - } - maskCtx.fill(); - } - async init_shape(compositionOperation) { - const maskBlendMode = await this.messageBroker.pull("maskBlendMode"); - const maskCtx = this.maskCtx || await this.messageBroker.pull("maskCtx"); - maskCtx.beginPath(); - if (compositionOperation == "source-over") { - maskCtx.fillStyle = maskBlendMode; - maskCtx.globalCompositeOperation = "source-over"; - } else if (compositionOperation == "destination-out") { - maskCtx.globalCompositeOperation = "destination-out"; - } - } - calculateCubicSplinePoints(points, numSegments = 10) { - const result = []; - const xCoords = points.map((p) => p.x); - const yCoords = points.map((p) => p.y); - const xDerivatives = this.calculateSplineCoefficients(xCoords); - const yDerivatives = this.calculateSplineCoefficients(yCoords); - for (let i = 0; i < points.length - 1; i++) { - const p0 = points[i]; - const p1 = points[i + 1]; - const d0x = xDerivatives[i]; - const d1x = xDerivatives[i + 1]; - const d0y = yDerivatives[i]; - const d1y = yDerivatives[i + 1]; - for (let t2 = 0; t2 <= numSegments; t2++) { - const t_normalized = t2 / numSegments; - const h00 = 2 * t_normalized ** 3 - 3 * t_normalized ** 2 + 1; - const h10 = t_normalized ** 3 - 2 * t_normalized ** 2 + t_normalized; - const h01 = -2 * t_normalized ** 3 + 3 * t_normalized ** 2; - const h11 = t_normalized ** 3 - t_normalized ** 2; - const x = h00 * p0.x + h10 * d0x + h01 * p1.x + h11 * d1x; - const y = h00 * p0.y + h10 * d0y + h01 * p1.y + h11 * d1y; - result.push({ x, y }); - } - } - return result; - } - generateEvenlyDistributedPoints(splinePoints, numPoints) { - const distances = [0]; - for (let i = 1; i < splinePoints.length; i++) { - const dx = splinePoints[i].x - splinePoints[i - 1].x; - const dy = splinePoints[i].y - splinePoints[i - 1].y; - const dist = Math.hypot(dx, dy); - distances.push(distances[i - 1] + dist); - } - const totalLength = distances[distances.length - 1]; - const interval = totalLength / (numPoints - 1); - const result = []; - let currentIndex = 0; - for (let i = 0; i < numPoints; i++) { - const targetDistance = i * interval; - while (currentIndex < distances.length - 1 && distances[currentIndex + 1] < targetDistance) { - currentIndex++; - } - const t2 = (targetDistance - distances[currentIndex]) / (distances[currentIndex + 1] - distances[currentIndex]); - const x = splinePoints[currentIndex].x + t2 * (splinePoints[currentIndex + 1].x - splinePoints[currentIndex].x); - const y = splinePoints[currentIndex].y + t2 * (splinePoints[currentIndex + 1].y - splinePoints[currentIndex].y); - result.push({ x, y }); - } - return result; - } - generateEquidistantPoints(points, distance) { - const result = []; - const cumulativeDistances = [0]; - for (let i = 1; i < points.length; i++) { - const dx = points[i].x - points[i - 1].x; - const dy = points[i].y - points[i - 1].y; - const dist = Math.hypot(dx, dy); - cumulativeDistances[i] = cumulativeDistances[i - 1] + dist; - } - const totalLength = cumulativeDistances[cumulativeDistances.length - 1]; - const numPoints = Math.floor(totalLength / distance); - for (let i = 0; i <= numPoints; i++) { - const targetDistance = i * distance; - let idx = 0; - while (idx < cumulativeDistances.length - 1 && cumulativeDistances[idx + 1] < targetDistance) { - idx++; - } - if (idx >= points.length - 1) { - result.push(points[points.length - 1]); - continue; - } - const d0 = cumulativeDistances[idx]; - const d1 = cumulativeDistances[idx + 1]; - const t2 = (targetDistance - d0) / (d1 - d0); - const x = points[idx].x + t2 * (points[idx + 1].x - points[idx].x); - const y = points[idx].y + t2 * (points[idx + 1].y - points[idx].y); - result.push({ x, y }); - } - return result; - } - calculateSplineCoefficients(values) { - const n = values.length - 1; - const matrix = new Array(n + 1).fill(0).map(() => new Array(n + 1).fill(0)); - const rhs = new Array(n + 1).fill(0); - for (let i = 1; i < n; i++) { - matrix[i][i - 1] = 1; - matrix[i][i] = 4; - matrix[i][i + 1] = 1; - rhs[i] = 3 * (values[i + 1] - values[i - 1]); - } - matrix[0][0] = 2; - matrix[0][1] = 1; - matrix[n][n - 1] = 1; - matrix[n][n] = 2; - rhs[0] = 3 * (values[1] - values[0]); - rhs[n] = 3 * (values[n] - values[n - 1]); - for (let i = 1; i <= n; i++) { - const m = matrix[i][i - 1] / matrix[i - 1][i - 1]; - matrix[i][i] -= m * matrix[i - 1][i]; - rhs[i] -= m * rhs[i - 1]; - } - const solution = new Array(n + 1); - solution[n] = rhs[n] / matrix[n][n]; - for (let i = n - 1; i >= 0; i--) { - solution[i] = (rhs[i] - matrix[i][i + 1] * solution[i + 1]) / matrix[i][i]; - } - return solution; - } - setBrushSize(size) { - this.brushSettings.size = size; - saveBrushToCache("maskeditor_brush_settings", this.brushSettings); - } - setBrushOpacity(opacity) { - this.brushSettings.opacity = opacity; - saveBrushToCache("maskeditor_brush_settings", this.brushSettings); - } - setBrushHardness(hardness) { - this.brushSettings.hardness = hardness; - saveBrushToCache("maskeditor_brush_settings", this.brushSettings); - } - setBrushType(type) { - this.brushSettings.type = type; - saveBrushToCache("maskeditor_brush_settings", this.brushSettings); - } - setBrushSmoothingPrecision(precision) { - this.brushSettings.smoothingPrecision = precision; - saveBrushToCache("maskeditor_brush_settings", this.brushSettings); - } -} -class UIManager { - static { - __name(this, "UIManager"); - } - rootElement; - brush; - brushPreviewGradient; - maskCtx; - imageCtx; - maskCanvas; - imgCanvas; - brushSettingsHTML; - paintBucketSettingsHTML; - colorSelectSettingsHTML; - maskOpacitySlider; - brushHardnessSlider; - brushSizeSlider; - brushOpacitySlider; - sidebarImage; - saveButton; - toolPanel; - sidePanel; - pointerZone; - canvasBackground; - canvasContainer; - image; - imageURL; - darkMode = true; - maskEditor; - messageBroker; - mask_opacity = 1; - maskBlendMode = "black"; - zoomTextHTML; - dimensionsTextHTML; - constructor(rootElement, maskEditor) { - this.rootElement = rootElement; - this.maskEditor = maskEditor; - this.messageBroker = maskEditor.getMessageBroker(); - this.addListeners(); - this.addPullTopics(); - } - addListeners() { - this.messageBroker.subscribe( - "updateBrushPreview", - async () => this.updateBrushPreview() - ); - this.messageBroker.subscribe( - "paintBucketCursor", - (isPaintBucket) => this.handlePaintBucketCursor(isPaintBucket) - ); - this.messageBroker.subscribe( - "panCursor", - (isPan) => this.handlePanCursor(isPan) - ); - this.messageBroker.subscribe( - "setBrushVisibility", - (isVisible) => this.setBrushVisibility(isVisible) - ); - this.messageBroker.subscribe( - "setBrushPreviewGradientVisibility", - (isVisible) => this.setBrushPreviewGradientVisibility(isVisible) - ); - this.messageBroker.subscribe("updateCursor", () => this.updateCursor()); - this.messageBroker.subscribe( - "setZoomText", - (text) => this.setZoomText(text) - ); - } - addPullTopics() { - this.messageBroker.createPullTopic( - "maskCanvas", - async () => this.maskCanvas - ); - this.messageBroker.createPullTopic("maskCtx", async () => this.maskCtx); - this.messageBroker.createPullTopic("imageCtx", async () => this.imageCtx); - this.messageBroker.createPullTopic("imgCanvas", async () => this.imgCanvas); - this.messageBroker.createPullTopic( - "screenToCanvas", - async (coords) => this.screenToCanvas(coords) - ); - this.messageBroker.createPullTopic( - "getCanvasContainer", - async () => this.canvasContainer - ); - this.messageBroker.createPullTopic( - "getMaskColor", - async () => this.getMaskColor() - ); - } - async setlayout() { - this.detectLightMode(); - var user_ui = await this.createUI(); - var canvasContainer = this.createBackgroundUI(); - var brush = await this.createBrush(); - await this.setBrushBorderRadius(); - this.setBrushOpacity(1); - this.rootElement.appendChild(canvasContainer); - this.rootElement.appendChild(user_ui); - document.body.appendChild(brush); - } - async createUI() { - var ui_container = document.createElement("div"); - ui_container.id = "maskEditor_uiContainer"; - var top_bar = await this.createTopBar(); - var ui_horizontal_container = document.createElement("div"); - ui_horizontal_container.id = "maskEditor_uiHorizontalContainer"; - var side_panel_container = await this.createSidePanel(); - var pointer_zone = this.createPointerZone(); - var tool_panel = this.createToolPanel(); - ui_horizontal_container.appendChild(tool_panel); - ui_horizontal_container.appendChild(pointer_zone); - ui_horizontal_container.appendChild(side_panel_container); - ui_container.appendChild(top_bar); - ui_container.appendChild(ui_horizontal_container); - return ui_container; - } - createBackgroundUI() { - const canvasContainer = document.createElement("div"); - canvasContainer.id = "maskEditorCanvasContainer"; - const imgCanvas = document.createElement("canvas"); - imgCanvas.id = "imageCanvas"; - const maskCanvas = document.createElement("canvas"); - maskCanvas.id = "maskCanvas"; - const canvas_background = document.createElement("div"); - canvas_background.id = "canvasBackground"; - canvasContainer.appendChild(imgCanvas); - canvasContainer.appendChild(maskCanvas); - canvasContainer.appendChild(canvas_background); - this.imgCanvas = imgCanvas; - this.maskCanvas = maskCanvas; - this.canvasContainer = canvasContainer; - this.canvasBackground = canvas_background; - let maskCtx = maskCanvas.getContext("2d", { willReadFrequently: true }); - if (maskCtx) { - this.maskCtx = maskCtx; - } - let imgCtx = imgCanvas.getContext("2d", { willReadFrequently: true }); - if (imgCtx) { - this.imageCtx = imgCtx; - } - this.setEventHandler(); - this.imgCanvas.style.position = "absolute"; - this.maskCanvas.style.position = "absolute"; - this.imgCanvas.style.top = "200"; - this.imgCanvas.style.left = "0"; - this.maskCanvas.style.top = this.imgCanvas.style.top; - this.maskCanvas.style.left = this.imgCanvas.style.left; - const maskCanvasStyle = this.getMaskCanvasStyle(); - this.maskCanvas.style.mixBlendMode = maskCanvasStyle.mixBlendMode; - this.maskCanvas.style.opacity = maskCanvasStyle.opacity.toString(); - return canvasContainer; - } - async setBrushBorderRadius() { - const brushSettings = await this.messageBroker.pull("brushSettings"); - if (brushSettings.type === "rect") { - this.brush.style.borderRadius = "0%"; - this.brush.style.MozBorderRadius = "0%"; - this.brush.style.WebkitBorderRadius = "0%"; - } else { - this.brush.style.borderRadius = "50%"; - this.brush.style.MozBorderRadius = "50%"; - this.brush.style.WebkitBorderRadius = "50%"; - } - } - async initUI() { - this.saveButton.innerText = "Save"; - this.saveButton.disabled = false; - await this.setImages(this.imgCanvas); - } - async createSidePanel() { - const side_panel = this.createContainer(true); - side_panel.id = "maskEditor_sidePanel"; - const brush_settings = await this.createBrushSettings(); - brush_settings.id = "maskEditor_brushSettings"; - this.brushSettingsHTML = brush_settings; - const paint_bucket_settings = await this.createPaintBucketSettings(); - paint_bucket_settings.id = "maskEditor_paintBucketSettings"; - this.paintBucketSettingsHTML = paint_bucket_settings; - const color_select_settings = await this.createColorSelectSettings(); - color_select_settings.id = "maskEditor_colorSelectSettings"; - this.colorSelectSettingsHTML = color_select_settings; - const image_layer_settings = await this.createImageLayerSettings(); - const separator = this.createSeparator(); - side_panel.appendChild(brush_settings); - side_panel.appendChild(paint_bucket_settings); - side_panel.appendChild(color_select_settings); - side_panel.appendChild(separator); - side_panel.appendChild(image_layer_settings); - return side_panel; - } - async createBrushSettings() { - const shapeColor = this.darkMode ? "maskEditor_brushShape_dark" : "maskEditor_brushShape_light"; - const brush_settings_container = this.createContainer(true); - const brush_settings_title = this.createHeadline("Brush Settings"); - const brush_shape_outer_container = this.createContainer(true); - const brush_shape_title = this.createContainerTitle("Brush Shape"); - const brush_shape_container = this.createContainer(false); - const accentColor = this.darkMode ? "maskEditor_accent_bg_dark" : "maskEditor_accent_bg_light"; - brush_shape_container.classList.add(accentColor); - brush_shape_container.classList.add("maskEditor_layerRow"); - const circle_shape = document.createElement("div"); - circle_shape.id = "maskEditor_sidePanelBrushShapeCircle"; - circle_shape.classList.add(shapeColor); - circle_shape.addEventListener("click", () => { - this.messageBroker.publish( - "setBrushShape", - "arc" - /* Arc */ - ); - this.setBrushBorderRadius(); - circle_shape.style.background = "var(--p-button-text-primary-color)"; - square_shape.style.background = ""; - }); - const square_shape = document.createElement("div"); - square_shape.id = "maskEditor_sidePanelBrushShapeSquare"; - square_shape.classList.add(shapeColor); - square_shape.addEventListener("click", () => { - this.messageBroker.publish( - "setBrushShape", - "rect" - /* Rect */ - ); - this.setBrushBorderRadius(); - square_shape.style.background = "var(--p-button-text-primary-color)"; - circle_shape.style.background = ""; - }); - if ((await this.messageBroker.pull("brushSettings")).type === "arc") { - circle_shape.style.background = "var(--p-button-text-primary-color)"; - square_shape.style.background = ""; - } else { - circle_shape.style.background = ""; - square_shape.style.background = "var(--p-button-text-primary-color)"; - } - brush_shape_container.appendChild(circle_shape); - brush_shape_container.appendChild(square_shape); - brush_shape_outer_container.appendChild(brush_shape_title); - brush_shape_outer_container.appendChild(brush_shape_container); - const thicknesSliderObj = this.createSlider( - "Thickness", - 1, - 100, - 1, - (await this.messageBroker.pull("brushSettings")).size, - (event, value) => { - this.messageBroker.publish("setBrushSize", parseInt(value)); - this.updateBrushPreview(); - } - ); - this.brushSizeSlider = thicknesSliderObj.slider; - const opacitySliderObj = this.createSlider( - "Opacity", - 0, - 1, - 0.01, - (await this.messageBroker.pull("brushSettings")).opacity, - (event, value) => { - this.messageBroker.publish("setBrushOpacity", parseFloat(value)); - this.updateBrushPreview(); - } - ); - this.brushOpacitySlider = opacitySliderObj.slider; - const hardnessSliderObj = this.createSlider( - "Hardness", - 0, - 1, - 0.01, - (await this.messageBroker.pull("brushSettings")).hardness, - (event, value) => { - this.messageBroker.publish("setBrushHardness", parseFloat(value)); - this.updateBrushPreview(); - } - ); - this.brushHardnessSlider = hardnessSliderObj.slider; - const brushSmoothingPrecisionSliderObj = this.createSlider( - "Smoothing Precision", - 1, - 100, - 1, - (await this.messageBroker.pull("brushSettings")).smoothingPrecision, - (event, value) => { - this.messageBroker.publish( - "setBrushSmoothingPrecision", - parseInt(value) - ); - } - ); - const resetBrushSettingsButton = document.createElement("button"); - resetBrushSettingsButton.id = "resetBrushSettingsButton"; - resetBrushSettingsButton.innerText = "Reset to Default"; - resetBrushSettingsButton.addEventListener("click", () => { - this.messageBroker.publish( - "setBrushShape", - "arc" - /* Arc */ - ); - this.messageBroker.publish("setBrushSize", 10); - this.messageBroker.publish("setBrushOpacity", 0.7); - this.messageBroker.publish("setBrushHardness", 1); - this.messageBroker.publish("setBrushSmoothingPrecision", 10); - circle_shape.style.background = "var(--p-button-text-primary-color)"; - square_shape.style.background = ""; - thicknesSliderObj.slider.value = "10"; - opacitySliderObj.slider.value = "0.7"; - hardnessSliderObj.slider.value = "1"; - brushSmoothingPrecisionSliderObj.slider.value = "10"; - this.setBrushBorderRadius(); - this.updateBrushPreview(); - }); - brush_settings_container.appendChild(brush_settings_title); - brush_settings_container.appendChild(resetBrushSettingsButton); - brush_settings_container.appendChild(brush_shape_outer_container); - brush_settings_container.appendChild(thicknesSliderObj.container); - brush_settings_container.appendChild(opacitySliderObj.container); - brush_settings_container.appendChild(hardnessSliderObj.container); - brush_settings_container.appendChild( - brushSmoothingPrecisionSliderObj.container - ); - return brush_settings_container; - } - async createPaintBucketSettings() { - const paint_bucket_settings_container = this.createContainer(true); - const paint_bucket_settings_title = this.createHeadline( - "Paint Bucket Settings" - ); - const tolerance = await this.messageBroker.pull("getTolerance"); - const paintBucketToleranceSliderObj = this.createSlider( - "Tolerance", - 0, - 255, - 1, - tolerance, - (event, value) => { - this.messageBroker.publish("setPaintBucketTolerance", parseInt(value)); - } - ); - paint_bucket_settings_container.appendChild(paint_bucket_settings_title); - paint_bucket_settings_container.appendChild( - paintBucketToleranceSliderObj.container - ); - return paint_bucket_settings_container; - } - async createColorSelectSettings() { - const color_select_settings_container = this.createContainer(true); - const color_select_settings_title = this.createHeadline( - "Color Select Settings" - ); - var tolerance = await this.messageBroker.pull("getTolerance"); - const colorSelectToleranceSliderObj = this.createSlider( - "Tolerance", - 0, - 255, - 1, - tolerance, - (event, value) => { - this.messageBroker.publish("setColorSelectTolerance", parseInt(value)); - } - ); - const livePreviewToggle = this.createToggle( - "Live Preview", - (event, value) => { - this.messageBroker.publish("setLivePreview", value); - } - ); - const wholeImageToggle = this.createToggle( - "Apply to Whole Image", - (event, value) => { - this.messageBroker.publish("setWholeImage", value); - } - ); - const methodOptions = Object.values(ColorComparisonMethod); - const methodSelect = this.createDropdown( - "Method", - methodOptions, - (event, value) => { - this.messageBroker.publish("setColorComparisonMethod", value); - } - ); - const maskBoundaryToggle = this.createToggle( - "Stop at mask", - (event, value) => { - this.messageBroker.publish("setMaskBoundary", value); - } - ); - const maskToleranceSliderObj = this.createSlider( - "Mask Tolerance", - 0, - 255, - 1, - 0, - (event, value) => { - this.messageBroker.publish("setMaskTolerance", parseInt(value)); - } - ); - color_select_settings_container.appendChild(color_select_settings_title); - color_select_settings_container.appendChild( - colorSelectToleranceSliderObj.container - ); - color_select_settings_container.appendChild(livePreviewToggle); - color_select_settings_container.appendChild(wholeImageToggle); - color_select_settings_container.appendChild(methodSelect); - color_select_settings_container.appendChild(maskBoundaryToggle); - color_select_settings_container.appendChild( - maskToleranceSliderObj.container - ); - return color_select_settings_container; - } - async createImageLayerSettings() { - const accentColor = this.darkMode ? "maskEditor_accent_bg_dark" : "maskEditor_accent_bg_light"; - const image_layer_settings_container = this.createContainer(true); - const image_layer_settings_title = this.createHeadline("Layers"); - const mask_layer_title = this.createContainerTitle("Mask Layer"); - const mask_layer_container = this.createContainer(false); - mask_layer_container.classList.add(accentColor); - mask_layer_container.classList.add("maskEditor_layerRow"); - const mask_layer_visibility_checkbox = document.createElement("input"); - mask_layer_visibility_checkbox.setAttribute("type", "checkbox"); - mask_layer_visibility_checkbox.checked = true; - mask_layer_visibility_checkbox.classList.add( - "maskEditor_sidePanelLayerCheckbox" - ); - mask_layer_visibility_checkbox.addEventListener("change", (event) => { - if (!event.target.checked) { - this.maskCanvas.style.opacity = "0"; - } else { - this.maskCanvas.style.opacity = String(this.mask_opacity); - } - }); - var mask_layer_image_container = document.createElement("div"); - mask_layer_image_container.classList.add( - "maskEditor_sidePanelLayerPreviewContainer" - ); - mask_layer_image_container.innerHTML = ' '; - var blending_options = ["black", "white", "negative"]; - const sidePanelDropdownAccent = this.darkMode ? "maskEditor_sidePanelDropdown_dark" : "maskEditor_sidePanelDropdown_light"; - var mask_layer_dropdown = document.createElement("select"); - mask_layer_dropdown.classList.add(sidePanelDropdownAccent); - mask_layer_dropdown.classList.add(sidePanelDropdownAccent); - blending_options.forEach((option) => { - var option_element = document.createElement("option"); - option_element.value = option; - option_element.innerText = option; - mask_layer_dropdown.appendChild(option_element); - if (option == this.maskBlendMode) { - option_element.selected = true; - } - }); - mask_layer_dropdown.addEventListener("change", (event) => { - const selectedValue = event.target.value; - this.maskBlendMode = selectedValue; - this.updateMaskColor(); - }); - mask_layer_container.appendChild(mask_layer_visibility_checkbox); - mask_layer_container.appendChild(mask_layer_image_container); - mask_layer_container.appendChild(mask_layer_dropdown); - const mask_layer_opacity_sliderObj = this.createSlider( - "Mask Opacity", - 0, - 1, - 0.01, - this.mask_opacity, - (event, value) => { - this.mask_opacity = parseFloat(value); - this.maskCanvas.style.opacity = String(this.mask_opacity); - if (this.mask_opacity == 0) { - mask_layer_visibility_checkbox.checked = false; - } else { - mask_layer_visibility_checkbox.checked = true; - } - } - ); - this.maskOpacitySlider = mask_layer_opacity_sliderObj.slider; - const image_layer_title = this.createContainerTitle("Image Layer"); - const image_layer_container = this.createContainer(false); - image_layer_container.classList.add(accentColor); - image_layer_container.classList.add("maskEditor_layerRow"); - const image_layer_visibility_checkbox = document.createElement("input"); - image_layer_visibility_checkbox.setAttribute("type", "checkbox"); - image_layer_visibility_checkbox.classList.add( - "maskEditor_sidePanelLayerCheckbox" - ); - image_layer_visibility_checkbox.checked = true; - image_layer_visibility_checkbox.addEventListener("change", (event) => { - if (!event.target.checked) { - this.imgCanvas.style.opacity = "0"; - } else { - this.imgCanvas.style.opacity = "1"; - } - }); - const image_layer_image_container = document.createElement("div"); - image_layer_image_container.classList.add( - "maskEditor_sidePanelLayerPreviewContainer" - ); - const image_layer_image = document.createElement("img"); - image_layer_image.id = "maskEditor_sidePanelImageLayerImage"; - image_layer_image.src = ComfyApp.clipspace?.imgs?.[ComfyApp.clipspace?.selectedIndex ?? 0]?.src ?? ""; - this.sidebarImage = image_layer_image; - image_layer_image_container.appendChild(image_layer_image); - image_layer_container.appendChild(image_layer_visibility_checkbox); - image_layer_container.appendChild(image_layer_image_container); - image_layer_settings_container.appendChild(image_layer_settings_title); - image_layer_settings_container.appendChild(mask_layer_title); - image_layer_settings_container.appendChild(mask_layer_container); - image_layer_settings_container.appendChild( - mask_layer_opacity_sliderObj.container - ); - image_layer_settings_container.appendChild(image_layer_title); - image_layer_settings_container.appendChild(image_layer_container); - return image_layer_settings_container; - } - createHeadline(title) { - var headline = document.createElement("h3"); - headline.classList.add("maskEditor_sidePanelTitle"); - headline.innerText = title; - return headline; - } - createContainer(flexDirection) { - var container = document.createElement("div"); - if (flexDirection) { - container.classList.add("maskEditor_sidePanelContainerColumn"); - } else { - container.classList.add("maskEditor_sidePanelContainerRow"); - } - return container; - } - createContainerTitle(title) { - var container_title = document.createElement("span"); - container_title.classList.add("maskEditor_sidePanelSubTitle"); - container_title.innerText = title; - return container_title; - } - createSlider(title, min, max2, step, value, callback) { - var slider_container = this.createContainer(true); - var slider_title = this.createContainerTitle(title); - var slider = document.createElement("input"); - slider.classList.add("maskEditor_sidePanelBrushRange"); - slider.setAttribute("type", "range"); - slider.setAttribute("min", String(min)); - slider.setAttribute("max", String(max2)); - slider.setAttribute("step", String(step)); - slider.setAttribute("value", String(value)); - slider.addEventListener("input", (event) => { - callback(event, event.target.value); - }); - slider_container.appendChild(slider_title); - slider_container.appendChild(slider); - return { container: slider_container, slider }; - } - createToggle(title, callback) { - var outer_Container = this.createContainer(false); - var toggle_title = this.createContainerTitle(title); - var toggle_container = document.createElement("label"); - toggle_container.classList.add("maskEditor_sidePanelToggleContainer"); - var toggle_checkbox = document.createElement("input"); - toggle_checkbox.setAttribute("type", "checkbox"); - toggle_checkbox.classList.add("maskEditor_sidePanelToggleCheckbox"); - toggle_checkbox.addEventListener("change", (event) => { - callback(event, event.target.checked); - }); - var toggleAccentColor = this.darkMode ? "maskEditor_toggle_bg_dark" : "maskEditor_toggle_bg_light"; - var toggle_switch = document.createElement("div"); - toggle_switch.classList.add("maskEditor_sidePanelToggleSwitch"); - toggle_switch.classList.add(toggleAccentColor); - toggle_container.appendChild(toggle_checkbox); - toggle_container.appendChild(toggle_switch); - outer_Container.appendChild(toggle_title); - outer_Container.appendChild(toggle_container); - return outer_Container; - } - createDropdown(title, options, callback) { - const sidePanelDropdownAccent = this.darkMode ? "maskEditor_sidePanelDropdown_dark" : "maskEditor_sidePanelDropdown_light"; - var dropdown_container = this.createContainer(false); - var dropdown_title = this.createContainerTitle(title); - var dropdown = document.createElement("select"); - dropdown.classList.add(sidePanelDropdownAccent); - dropdown.classList.add("maskEditor_containerDropdown"); - options.forEach((option) => { - var option_element = document.createElement("option"); - option_element.value = option; - option_element.innerText = option; - dropdown.appendChild(option_element); - }); - dropdown.addEventListener("change", (event) => { - callback(event, event.target.value); - }); - dropdown_container.appendChild(dropdown_title); - dropdown_container.appendChild(dropdown); - return dropdown_container; - } - createSeparator() { - var separator = document.createElement("div"); - separator.classList.add("maskEditor_sidePanelSeparator"); - return separator; - } - //---------------- - async createTopBar() { - const buttonAccentColor = this.darkMode ? "maskEditor_topPanelButton_dark" : "maskEditor_topPanelButton_light"; - const iconButtonAccentColor = this.darkMode ? "maskEditor_topPanelIconButton_dark" : "maskEditor_topPanelIconButton_light"; - var top_bar = document.createElement("div"); - top_bar.id = "maskEditor_topBar"; - var top_bar_title_container = document.createElement("div"); - top_bar_title_container.id = "maskEditor_topBarTitleContainer"; - var top_bar_title = document.createElement("h1"); - top_bar_title.id = "maskEditor_topBarTitle"; - top_bar_title.innerText = "ComfyUI"; - top_bar_title_container.appendChild(top_bar_title); - var top_bar_shortcuts_container = document.createElement("div"); - top_bar_shortcuts_container.id = "maskEditor_topBarShortcutsContainer"; - var top_bar_undo_button = document.createElement("div"); - top_bar_undo_button.id = "maskEditor_topBarUndoButton"; - top_bar_undo_button.classList.add(iconButtonAccentColor); - top_bar_undo_button.innerHTML = ' '; - top_bar_undo_button.addEventListener("click", () => { - this.messageBroker.publish("undo"); - }); - var top_bar_redo_button = document.createElement("div"); - top_bar_redo_button.id = "maskEditor_topBarRedoButton"; - top_bar_redo_button.classList.add(iconButtonAccentColor); - top_bar_redo_button.innerHTML = ' '; - top_bar_redo_button.addEventListener("click", () => { - this.messageBroker.publish("redo"); - }); - var top_bar_invert_button = document.createElement("button"); - top_bar_invert_button.id = "maskEditor_topBarInvertButton"; - top_bar_invert_button.classList.add(buttonAccentColor); - top_bar_invert_button.innerText = "Invert"; - top_bar_invert_button.addEventListener("click", () => { - this.messageBroker.publish("invert"); - }); - var top_bar_clear_button = document.createElement("button"); - top_bar_clear_button.id = "maskEditor_topBarClearButton"; - top_bar_clear_button.classList.add(buttonAccentColor); - top_bar_clear_button.innerText = "Clear"; - top_bar_clear_button.addEventListener("click", () => { - this.maskCtx.clearRect( - 0, - 0, - this.maskCanvas.width, - this.maskCanvas.height - ); - this.messageBroker.publish("saveState"); - }); - var top_bar_save_button = document.createElement("button"); - top_bar_save_button.id = "maskEditor_topBarSaveButton"; - top_bar_save_button.classList.add(buttonAccentColor); - top_bar_save_button.innerText = "Save"; - this.saveButton = top_bar_save_button; - top_bar_save_button.addEventListener("click", () => { - this.maskEditor.save(); - }); - var top_bar_cancel_button = document.createElement("button"); - top_bar_cancel_button.id = "maskEditor_topBarCancelButton"; - top_bar_cancel_button.classList.add(buttonAccentColor); - top_bar_cancel_button.innerText = "Cancel"; - top_bar_cancel_button.addEventListener("click", () => { - this.maskEditor.close(); - }); - top_bar_shortcuts_container.appendChild(top_bar_undo_button); - top_bar_shortcuts_container.appendChild(top_bar_redo_button); - top_bar_shortcuts_container.appendChild(top_bar_invert_button); - top_bar_shortcuts_container.appendChild(top_bar_clear_button); - top_bar_shortcuts_container.appendChild(top_bar_save_button); - top_bar_shortcuts_container.appendChild(top_bar_cancel_button); - top_bar.appendChild(top_bar_title_container); - top_bar.appendChild(top_bar_shortcuts_container); - return top_bar; - } - createToolPanel() { - var tool_panel = document.createElement("div"); - tool_panel.id = "maskEditor_toolPanel"; - this.toolPanel = tool_panel; - var toolPanelHoverAccent = this.darkMode ? "maskEditor_toolPanelContainerDark" : "maskEditor_toolPanelContainerLight"; - var toolElements = []; - var toolPanel_brushToolContainer = document.createElement("div"); - toolPanel_brushToolContainer.classList.add("maskEditor_toolPanelContainer"); - toolPanel_brushToolContainer.classList.add( - "maskEditor_toolPanelContainerSelected" - ); - toolPanel_brushToolContainer.classList.add(toolPanelHoverAccent); - toolPanel_brushToolContainer.innerHTML = ` - - - - - `; - toolElements.push(toolPanel_brushToolContainer); - toolPanel_brushToolContainer.addEventListener("click", () => { - this.messageBroker.publish( - "setTool", - "pen" - /* Pen */ - ); - for (let toolElement of toolElements) { - if (toolElement != toolPanel_brushToolContainer) { - toolElement.classList.remove("maskEditor_toolPanelContainerSelected"); - } else { - toolElement.classList.add("maskEditor_toolPanelContainerSelected"); - this.brushSettingsHTML.style.display = "flex"; - this.colorSelectSettingsHTML.style.display = "none"; - this.paintBucketSettingsHTML.style.display = "none"; - } - } - this.messageBroker.publish( - "setTool", - "pen" - /* Pen */ - ); - this.pointerZone.style.cursor = "none"; - }); - var toolPanel_brushToolIndicator = document.createElement("div"); - toolPanel_brushToolIndicator.classList.add("maskEditor_toolPanelIndicator"); - toolPanel_brushToolContainer.appendChild(toolPanel_brushToolIndicator); - var toolPanel_eraserToolContainer = document.createElement("div"); - toolPanel_eraserToolContainer.classList.add("maskEditor_toolPanelContainer"); - toolPanel_eraserToolContainer.classList.add(toolPanelHoverAccent); - toolPanel_eraserToolContainer.innerHTML = ` - - - - - - - - `; - toolElements.push(toolPanel_eraserToolContainer); - toolPanel_eraserToolContainer.addEventListener("click", () => { - this.messageBroker.publish( - "setTool", - "eraser" - /* Eraser */ - ); - for (let toolElement of toolElements) { - if (toolElement != toolPanel_eraserToolContainer) { - toolElement.classList.remove("maskEditor_toolPanelContainerSelected"); - } else { - toolElement.classList.add("maskEditor_toolPanelContainerSelected"); - this.brushSettingsHTML.style.display = "flex"; - this.colorSelectSettingsHTML.style.display = "none"; - this.paintBucketSettingsHTML.style.display = "none"; - } - } - this.messageBroker.publish( - "setTool", - "eraser" - /* Eraser */ - ); - this.pointerZone.style.cursor = "none"; - }); - var toolPanel_eraserToolIndicator = document.createElement("div"); - toolPanel_eraserToolIndicator.classList.add("maskEditor_toolPanelIndicator"); - toolPanel_eraserToolContainer.appendChild(toolPanel_eraserToolIndicator); - var toolPanel_paintBucketToolContainer = document.createElement("div"); - toolPanel_paintBucketToolContainer.classList.add( - "maskEditor_toolPanelContainer" - ); - toolPanel_paintBucketToolContainer.classList.add(toolPanelHoverAccent); - toolPanel_paintBucketToolContainer.innerHTML = ` - - - - - - `; - toolElements.push(toolPanel_paintBucketToolContainer); - toolPanel_paintBucketToolContainer.addEventListener("click", () => { - this.messageBroker.publish( - "setTool", - "paintBucket" - /* PaintBucket */ - ); - for (let toolElement of toolElements) { - if (toolElement != toolPanel_paintBucketToolContainer) { - toolElement.classList.remove("maskEditor_toolPanelContainerSelected"); - } else { - toolElement.classList.add("maskEditor_toolPanelContainerSelected"); - this.brushSettingsHTML.style.display = "none"; - this.colorSelectSettingsHTML.style.display = "none"; - this.paintBucketSettingsHTML.style.display = "flex"; - } - } - this.messageBroker.publish( - "setTool", - "paintBucket" - /* PaintBucket */ - ); - this.pointerZone.style.cursor = "url('/cursor/paintBucket.png') 30 25, auto"; - this.brush.style.opacity = "0"; - }); - var toolPanel_paintBucketToolIndicator = document.createElement("div"); - toolPanel_paintBucketToolIndicator.classList.add( - "maskEditor_toolPanelIndicator" - ); - toolPanel_paintBucketToolContainer.appendChild( - toolPanel_paintBucketToolIndicator - ); - var toolPanel_colorSelectToolContainer = document.createElement("div"); - toolPanel_colorSelectToolContainer.classList.add( - "maskEditor_toolPanelContainer" - ); - toolPanel_colorSelectToolContainer.classList.add(toolPanelHoverAccent); - toolPanel_colorSelectToolContainer.innerHTML = ` - - - - `; - toolElements.push(toolPanel_colorSelectToolContainer); - toolPanel_colorSelectToolContainer.addEventListener("click", () => { - this.messageBroker.publish("setTool", "colorSelect"); - for (let toolElement of toolElements) { - if (toolElement != toolPanel_colorSelectToolContainer) { - toolElement.classList.remove("maskEditor_toolPanelContainerSelected"); - } else { - toolElement.classList.add("maskEditor_toolPanelContainerSelected"); - this.brushSettingsHTML.style.display = "none"; - this.paintBucketSettingsHTML.style.display = "none"; - this.colorSelectSettingsHTML.style.display = "flex"; - } - } - this.messageBroker.publish( - "setTool", - "colorSelect" - /* ColorSelect */ - ); - this.pointerZone.style.cursor = "url('/cursor/colorSelect.png') 15 25, auto"; - this.brush.style.opacity = "0"; - }); - var toolPanel_colorSelectToolIndicator = document.createElement("div"); - toolPanel_colorSelectToolIndicator.classList.add( - "maskEditor_toolPanelIndicator" - ); - toolPanel_colorSelectToolContainer.appendChild( - toolPanel_colorSelectToolIndicator - ); - var toolPanel_zoomIndicator = document.createElement("div"); - toolPanel_zoomIndicator.classList.add("maskEditor_toolPanelZoomIndicator"); - toolPanel_zoomIndicator.classList.add(toolPanelHoverAccent); - var toolPanel_zoomText = document.createElement("span"); - toolPanel_zoomText.id = "maskEditor_toolPanelZoomText"; - toolPanel_zoomText.innerText = "100%"; - this.zoomTextHTML = toolPanel_zoomText; - var toolPanel_DimensionsText = document.createElement("span"); - toolPanel_DimensionsText.id = "maskEditor_toolPanelDimensionsText"; - toolPanel_DimensionsText.innerText = " "; - this.dimensionsTextHTML = toolPanel_DimensionsText; - toolPanel_zoomIndicator.appendChild(toolPanel_zoomText); - toolPanel_zoomIndicator.appendChild(toolPanel_DimensionsText); - toolPanel_zoomIndicator.addEventListener("click", () => { - this.messageBroker.publish("resetZoom"); - }); - tool_panel.appendChild(toolPanel_brushToolContainer); - tool_panel.appendChild(toolPanel_eraserToolContainer); - tool_panel.appendChild(toolPanel_paintBucketToolContainer); - tool_panel.appendChild(toolPanel_colorSelectToolContainer); - tool_panel.appendChild(toolPanel_zoomIndicator); - return tool_panel; - } - createPointerZone() { - const pointer_zone = document.createElement("div"); - pointer_zone.id = "maskEditor_pointerZone"; - this.pointerZone = pointer_zone; - pointer_zone.addEventListener("pointerdown", (event) => { - this.messageBroker.publish("pointerDown", event); - }); - pointer_zone.addEventListener("pointermove", (event) => { - this.messageBroker.publish("pointerMove", event); - }); - pointer_zone.addEventListener("pointerup", (event) => { - this.messageBroker.publish("pointerUp", event); - }); - pointer_zone.addEventListener("pointerleave", (event) => { - this.brush.style.opacity = "0"; - this.pointerZone.style.cursor = ""; - }); - pointer_zone.addEventListener("touchstart", (event) => { - this.messageBroker.publish("handleTouchStart", event); - }); - pointer_zone.addEventListener("touchmove", (event) => { - this.messageBroker.publish("handleTouchMove", event); - }); - pointer_zone.addEventListener("touchend", (event) => { - this.messageBroker.publish("handleTouchEnd", event); - }); - pointer_zone.addEventListener( - "wheel", - (event) => this.messageBroker.publish("wheel", event) - ); - pointer_zone.addEventListener( - "pointerenter", - async (event) => { - this.updateCursor(); - } - ); - return pointer_zone; - } - async screenToCanvas(clientPoint) { - const zoomRatio = await this.messageBroker.pull("zoomRatio"); - const canvasRect = this.maskCanvas.getBoundingClientRect(); - const offsetX = clientPoint.x - canvasRect.left + this.toolPanel.clientWidth; - const offsetY = clientPoint.y - canvasRect.top + 44; - const x = offsetX / zoomRatio; - const y = offsetY / zoomRatio; - return { x, y }; - } - setEventHandler() { - this.maskCanvas.addEventListener("contextmenu", (event) => { - event.preventDefault(); - }); - this.rootElement.addEventListener("contextmenu", (event) => { - event.preventDefault(); - }); - this.rootElement.addEventListener("dragstart", (event) => { - if (event.ctrlKey) { - event.preventDefault(); - } - }); - } - async createBrush() { - var brush = document.createElement("div"); - const brushSettings = await this.messageBroker.pull("brushSettings"); - brush.id = "maskEditor_brush"; - var brush_preview_gradient = document.createElement("div"); - brush_preview_gradient.id = "maskEditor_brushPreviewGradient"; - brush.appendChild(brush_preview_gradient); - this.brush = brush; - this.brushPreviewGradient = brush_preview_gradient; - return brush; - } - async setImages(imgCanvas) { - const imgCtx = imgCanvas.getContext("2d", { willReadFrequently: true }); - const maskCtx = this.maskCtx; - const maskCanvas = this.maskCanvas; - imgCtx.clearRect(0, 0, this.imgCanvas.width, this.imgCanvas.height); - maskCtx.clearRect(0, 0, this.maskCanvas.width, this.maskCanvas.height); - const alpha_url = new URL( - ComfyApp.clipspace?.imgs?.[ComfyApp.clipspace?.selectedIndex ?? 0]?.src ?? "" - ); - alpha_url.searchParams.delete("channel"); - alpha_url.searchParams.delete("preview"); - alpha_url.searchParams.set("channel", "a"); - let mask_image = await this.loadImage(alpha_url); - if (!ComfyApp.clipspace?.imgs?.[ComfyApp.clipspace?.selectedIndex ?? 0]?.src) { - throw new Error( - "Unable to access image source - clipspace or image is null" - ); - } - const rgb_url = new URL( - ComfyApp.clipspace.imgs[ComfyApp.clipspace.selectedIndex].src - ); - this.imageURL = rgb_url; - console.log(rgb_url); - rgb_url.searchParams.delete("channel"); - rgb_url.searchParams.set("channel", "rgb"); - this.image = new Image(); - this.image = await new Promise((resolve, reject) => { - const img = new Image(); - img.onload = () => resolve(img); - img.onerror = reject; - img.src = rgb_url.toString(); - }); - maskCanvas.width = this.image.width; - maskCanvas.height = this.image.height; - this.dimensionsTextHTML.innerText = `${this.image.width}x${this.image.height}`; - await this.invalidateCanvas(this.image, mask_image); - this.messageBroker.publish("initZoomPan", [this.image, this.rootElement]); - } - async invalidateCanvas(orig_image, mask_image) { - this.imgCanvas.width = orig_image.width; - this.imgCanvas.height = orig_image.height; - this.maskCanvas.width = orig_image.width; - this.maskCanvas.height = orig_image.height; - let imgCtx = this.imgCanvas.getContext("2d", { willReadFrequently: true }); - let maskCtx = this.maskCanvas.getContext("2d", { - willReadFrequently: true - }); - imgCtx.drawImage(orig_image, 0, 0, orig_image.width, orig_image.height); - await this.prepare_mask( - mask_image, - this.maskCanvas, - maskCtx, - await this.getMaskColor() - ); - } - async prepare_mask(image, maskCanvas, maskCtx, maskColor) { - maskCtx.drawImage(image, 0, 0, maskCanvas.width, maskCanvas.height); - const maskData = maskCtx.getImageData( - 0, - 0, - maskCanvas.width, - maskCanvas.height - ); - for (let i = 0; i < maskData.data.length; i += 4) { - const alpha = maskData.data[i + 3]; - maskData.data[i] = maskColor.r; - maskData.data[i + 1] = maskColor.g; - maskData.data[i + 2] = maskColor.b; - maskData.data[i + 3] = 255 - alpha; - } - maskCtx.globalCompositeOperation = "source-over"; - maskCtx.putImageData(maskData, 0, 0); - } - async updateMaskColor() { - const maskCanvasStyle = this.getMaskCanvasStyle(); - this.maskCanvas.style.mixBlendMode = maskCanvasStyle.mixBlendMode; - this.maskCanvas.style.opacity = maskCanvasStyle.opacity.toString(); - const maskColor = await this.getMaskColor(); - this.maskCtx.fillStyle = `rgb(${maskColor.r}, ${maskColor.g}, ${maskColor.b})`; - this.setCanvasBackground(); - const maskData = this.maskCtx.getImageData( - 0, - 0, - this.maskCanvas.width, - this.maskCanvas.height - ); - for (let i = 0; i < maskData.data.length; i += 4) { - maskData.data[i] = maskColor.r; - maskData.data[i + 1] = maskColor.g; - maskData.data[i + 2] = maskColor.b; - } - this.maskCtx.putImageData(maskData, 0, 0); - } - getMaskCanvasStyle() { - if (this.maskBlendMode === "negative") { - return { - mixBlendMode: "difference", - opacity: "1" - }; - } else { - return { - mixBlendMode: "initial", - opacity: this.mask_opacity - }; - } - } - detectLightMode() { - this.darkMode = document.body.classList.contains("dark-theme"); - } - loadImage(imagePath) { - return new Promise((resolve, reject) => { - const image = new Image(); - image.onload = function() { - resolve(image); - }; - image.onerror = function(error) { - reject(error); - }; - image.src = imagePath.href; - }); - } - async updateBrushPreview() { - const cursorPoint = await this.messageBroker.pull("cursorPoint"); - const pan_offset = await this.messageBroker.pull("panOffset"); - const brushSettings = await this.messageBroker.pull("brushSettings"); - const zoom_ratio = await this.messageBroker.pull("zoomRatio"); - const centerX = cursorPoint.x + pan_offset.x; - const centerY = cursorPoint.y + pan_offset.y; - const brush = this.brush; - const hardness = brushSettings.hardness; - const extendedSize = brushSettings.size * (2 - hardness) * 2 * zoom_ratio; - this.brushSizeSlider.value = String(brushSettings.size); - this.brushHardnessSlider.value = String(hardness); - brush.style.width = extendedSize + "px"; - brush.style.height = extendedSize + "px"; - brush.style.left = centerX - extendedSize / 2 + "px"; - brush.style.top = centerY - extendedSize / 2 + "px"; - if (hardness === 1) { - this.brushPreviewGradient.style.background = "rgba(255, 0, 0, 0.5)"; - return; - } - const opacityStop = hardness / 4 + 0.25; - this.brushPreviewGradient.style.background = ` - radial-gradient( - circle, - rgba(255, 0, 0, 0.5) 0%, - rgba(255, 0, 0, ${opacityStop}) ${hardness * 100}%, - rgba(255, 0, 0, 0) 100% - ) - `; - } - getMaskBlendMode() { - return this.maskBlendMode; - } - setSidebarImage() { - this.sidebarImage.src = this.imageURL.href; - } - async getMaskColor() { - if (this.maskBlendMode === "black") { - return { r: 0, g: 0, b: 0 }; - } - if (this.maskBlendMode === "white") { - return { r: 255, g: 255, b: 255 }; - } - if (this.maskBlendMode === "negative") { - return { r: 255, g: 255, b: 255 }; - } - return { r: 0, g: 0, b: 0 }; - } - async getMaskFillStyle() { - const maskColor = await this.getMaskColor(); - return "rgb(" + maskColor.r + "," + maskColor.g + "," + maskColor.b + ")"; - } - async setCanvasBackground() { - if (this.maskBlendMode === "white") { - this.canvasBackground.style.background = "black"; - } else { - this.canvasBackground.style.background = "white"; - } - } - getMaskCanvas() { - return this.maskCanvas; - } - getImgCanvas() { - return this.imgCanvas; - } - getImage() { - return this.image; - } - setBrushOpacity(opacity) { - this.brush.style.opacity = String(opacity); - } - setSaveButtonEnabled(enabled) { - this.saveButton.disabled = !enabled; - } - setSaveButtonText(text) { - this.saveButton.innerText = text; - } - handlePaintBucketCursor(isPaintBucket) { - if (isPaintBucket) { - this.pointerZone.style.cursor = "url('/cursor/paintBucket.png') 30 25, auto"; - } else { - this.pointerZone.style.cursor = "none"; - } - } - handlePanCursor(isPanning) { - if (isPanning) { - this.pointerZone.style.cursor = "grabbing"; - } else { - this.pointerZone.style.cursor = "none"; - } - } - setBrushVisibility(visible) { - this.brush.style.opacity = visible ? "1" : "0"; - } - setBrushPreviewGradientVisibility(visible) { - this.brushPreviewGradient.style.display = visible ? "block" : "none"; - } - async updateCursor() { - const currentTool = await this.messageBroker.pull("currentTool"); - if (currentTool === "paintBucket") { - this.pointerZone.style.cursor = "url('/cursor/paintBucket.png') 30 25, auto"; - this.setBrushOpacity(0); - } else if (currentTool === "colorSelect") { - this.pointerZone.style.cursor = "url('/cursor/colorSelect.png') 15 25, auto"; - this.setBrushOpacity(0); - } else { - this.pointerZone.style.cursor = "none"; - this.setBrushOpacity(1); - } - this.updateBrushPreview(); - this.setBrushPreviewGradientVisibility(false); - } - setZoomText(zoomText) { - this.zoomTextHTML.innerText = zoomText; - } - setDimensionsText(dimensionsText) { - this.dimensionsTextHTML.innerText = dimensionsText; - } -} -class ToolManager { - static { - __name(this, "ToolManager"); - } - maskEditor; - messageBroker; - mouseDownPoint = null; - currentTool = "pen"; - isAdjustingBrush = false; - // is user adjusting brush size or hardness with alt + right mouse button - constructor(maskEditor) { - this.maskEditor = maskEditor; - this.messageBroker = maskEditor.getMessageBroker(); - this.addListeners(); - this.addPullTopics(); - } - addListeners() { - this.messageBroker.subscribe("setTool", async (tool) => { - this.setTool(tool); - }); - this.messageBroker.subscribe("pointerDown", async (event) => { - this.handlePointerDown(event); - }); - this.messageBroker.subscribe("pointerMove", async (event) => { - this.handlePointerMove(event); - }); - this.messageBroker.subscribe("pointerUp", async (event) => { - this.handlePointerUp(event); - }); - this.messageBroker.subscribe("wheel", async (event) => { - this.handleWheelEvent(event); - }); - } - async addPullTopics() { - this.messageBroker.createPullTopic( - "currentTool", - async () => this.getCurrentTool() - ); - } - //tools - setTool(tool) { - this.currentTool = tool; - if (tool != "colorSelect") { - this.messageBroker.publish("clearLastPoint"); - } - } - getCurrentTool() { - return this.currentTool; - } - async handlePointerDown(event) { - event.preventDefault(); - if (event.pointerType == "touch") return; - var isSpacePressed = await this.messageBroker.pull("isKeyPressed", " "); - if (event.buttons === 4 || event.buttons === 1 && isSpacePressed) { - this.messageBroker.publish("panStart", event); - this.messageBroker.publish("setBrushVisibility", false); - return; - } - if (this.currentTool === "paintBucket" && event.button === 0) { - const offset = { x: event.offsetX, y: event.offsetY }; - const coords_canvas = await this.messageBroker.pull( - "screenToCanvas", - offset - ); - this.messageBroker.publish("paintBucketFill", coords_canvas); - this.messageBroker.publish("saveState"); - return; - } - if (this.currentTool === "colorSelect" && event.button === 0) { - const offset = { x: event.offsetX, y: event.offsetY }; - const coords_canvas = await this.messageBroker.pull( - "screenToCanvas", - offset - ); - this.messageBroker.publish("colorSelectFill", coords_canvas); - return; - } - if (event.altKey && event.button === 2) { - this.isAdjustingBrush = true; - this.messageBroker.publish("brushAdjustmentStart", event); - return; - } - var isDrawingTool = [ - "pen", - "eraser" - /* Eraser */ - ].includes(this.currentTool); - if ([0, 2].includes(event.button) && isDrawingTool) { - this.messageBroker.publish("drawStart", event); - return; - } - } - async handlePointerMove(event) { - event.preventDefault(); - if (event.pointerType == "touch") return; - const newCursorPoint = { x: event.clientX, y: event.clientY }; - this.messageBroker.publish("cursorPoint", newCursorPoint); - var isSpacePressed = await this.messageBroker.pull("isKeyPressed", " "); - this.messageBroker.publish("updateBrushPreview"); - if (event.buttons === 4 || event.buttons === 1 && isSpacePressed) { - this.messageBroker.publish("panMove", event); - return; - } - var isDrawingTool = [ - "pen", - "eraser" - /* Eraser */ - ].includes(this.currentTool); - if (!isDrawingTool) return; - if (this.isAdjustingBrush && (this.currentTool === "pen" || this.currentTool === "eraser") && event.altKey && event.buttons === 2) { - this.messageBroker.publish("brushAdjustment", event); - return; - } - if (event.buttons == 1 || event.buttons == 2) { - this.messageBroker.publish("draw", event); - return; - } - } - handlePointerUp(event) { - this.messageBroker.publish("panCursor", false); - if (event.pointerType === "touch") return; - this.messageBroker.publish("updateCursor"); - this.isAdjustingBrush = false; - this.messageBroker.publish("drawEnd", event); - this.mouseDownPoint = null; - } - handleWheelEvent(event) { - this.messageBroker.publish("zoom", event); - const newCursorPoint = { x: event.clientX, y: event.clientY }; - this.messageBroker.publish("cursorPoint", newCursorPoint); - } -} -class PanAndZoomManager { - static { - __name(this, "PanAndZoomManager"); - } - maskEditor; - messageBroker; - DOUBLE_TAP_DELAY = 300; - lastTwoFingerTap = 0; - isTouchZooming = false; - lastTouchZoomDistance = 0; - lastTouchMidPoint = { x: 0, y: 0 }; - lastTouchPoint = { x: 0, y: 0 }; - zoom_ratio = 1; - interpolatedZoomRatio = 1; - pan_offset = { x: 0, y: 0 }; - mouseDownPoint = null; - initialPan = { x: 0, y: 0 }; - canvasContainer = null; - maskCanvas = null; - rootElement = null; - image = null; - imageRootWidth = 0; - imageRootHeight = 0; - cursorPoint = { x: 0, y: 0 }; - constructor(maskEditor) { - this.maskEditor = maskEditor; - this.messageBroker = maskEditor.getMessageBroker(); - this.addListeners(); - this.addPullTopics(); - } - addListeners() { - this.messageBroker.subscribe( - "initZoomPan", - async (args) => { - await this.initializeCanvasPanZoom(args[0], args[1]); - } - ); - this.messageBroker.subscribe("panStart", async (event) => { - this.handlePanStart(event); - }); - this.messageBroker.subscribe("panMove", async (event) => { - this.handlePanMove(event); - }); - this.messageBroker.subscribe("zoom", async (event) => { - this.zoom(event); - }); - this.messageBroker.subscribe("cursorPoint", async (point) => { - this.updateCursorPosition(point); - }); - this.messageBroker.subscribe( - "handleTouchStart", - async (event) => { - this.handleTouchStart(event); - } - ); - this.messageBroker.subscribe( - "handleTouchMove", - async (event) => { - this.handleTouchMove(event); - } - ); - this.messageBroker.subscribe( - "handleTouchEnd", - async (event) => { - this.handleTouchEnd(event); - } - ); - this.messageBroker.subscribe("resetZoom", async () => { - if (this.interpolatedZoomRatio === 1) return; - await this.smoothResetView(); - }); - } - addPullTopics() { - this.messageBroker.createPullTopic( - "cursorPoint", - async () => this.cursorPoint - ); - this.messageBroker.createPullTopic("zoomRatio", async () => this.zoom_ratio); - this.messageBroker.createPullTopic("panOffset", async () => this.pan_offset); - } - handleTouchStart(event) { - event.preventDefault(); - if (event.touches[0].touchType === "stylus") return; - this.messageBroker.publish("setBrushVisibility", false); - if (event.touches.length === 2) { - const currentTime = (/* @__PURE__ */ new Date()).getTime(); - const tapTimeDiff = currentTime - this.lastTwoFingerTap; - if (tapTimeDiff < this.DOUBLE_TAP_DELAY) { - this.handleDoubleTap(); - this.lastTwoFingerTap = 0; - } else { - this.lastTwoFingerTap = currentTime; - this.isTouchZooming = true; - this.lastTouchZoomDistance = this.getTouchDistance(event.touches); - const midpoint = this.getTouchMidpoint(event.touches); - this.lastTouchMidPoint = midpoint; - } - } else if (event.touches.length === 1) { - this.lastTouchPoint = { - x: event.touches[0].clientX, - y: event.touches[0].clientY - }; - } - } - async handleTouchMove(event) { - event.preventDefault(); - if (event.touches[0].touchType === "stylus") return; - this.lastTwoFingerTap = 0; - if (this.isTouchZooming && event.touches.length === 2) { - const newDistance = this.getTouchDistance(event.touches); - const zoomFactor = newDistance / this.lastTouchZoomDistance; - const oldZoom = this.zoom_ratio; - this.zoom_ratio = Math.max( - 0.2, - Math.min(10, this.zoom_ratio * zoomFactor) - ); - const newZoom = this.zoom_ratio; - const midpoint = this.getTouchMidpoint(event.touches); - if (this.lastTouchMidPoint) { - const deltaX = midpoint.x - this.lastTouchMidPoint.x; - const deltaY = midpoint.y - this.lastTouchMidPoint.y; - this.pan_offset.x += deltaX; - this.pan_offset.y += deltaY; - } - if (this.maskCanvas === null) { - this.maskCanvas = await this.messageBroker.pull("maskCanvas"); - } - const rect = this.maskCanvas.getBoundingClientRect(); - const touchX = midpoint.x - rect.left; - const touchY = midpoint.y - rect.top; - const scaleFactor = newZoom / oldZoom; - this.pan_offset.x += touchX - touchX * scaleFactor; - this.pan_offset.y += touchY - touchY * scaleFactor; - this.invalidatePanZoom(); - this.lastTouchZoomDistance = newDistance; - this.lastTouchMidPoint = midpoint; - } else if (event.touches.length === 1) { - this.handleSingleTouchPan(event.touches[0]); - } - } - handleTouchEnd(event) { - event.preventDefault(); - if (event.touches.length === 0 && event.touches[0].touchType === "stylus") { - return; - } - this.isTouchZooming = false; - this.lastTouchMidPoint = { x: 0, y: 0 }; - if (event.touches.length === 0) { - this.lastTouchPoint = { x: 0, y: 0 }; - } else if (event.touches.length === 1) { - this.lastTouchPoint = { - x: event.touches[0].clientX, - y: event.touches[0].clientY - }; - } - } - getTouchDistance(touches) { - const dx = touches[0].clientX - touches[1].clientX; - const dy = touches[0].clientY - touches[1].clientY; - return Math.sqrt(dx * dx + dy * dy); - } - getTouchMidpoint(touches) { - return { - x: (touches[0].clientX + touches[1].clientX) / 2, - y: (touches[0].clientY + touches[1].clientY) / 2 - }; - } - async handleSingleTouchPan(touch) { - if (this.lastTouchPoint === null) { - this.lastTouchPoint = { x: touch.clientX, y: touch.clientY }; - return; - } - const deltaX = touch.clientX - this.lastTouchPoint.x; - const deltaY = touch.clientY - this.lastTouchPoint.y; - this.pan_offset.x += deltaX; - this.pan_offset.y += deltaY; - await this.invalidatePanZoom(); - this.lastTouchPoint = { x: touch.clientX, y: touch.clientY }; - } - updateCursorPosition(clientPoint) { - var cursorX = clientPoint.x - this.pan_offset.x; - var cursorY = clientPoint.y - this.pan_offset.y; - this.cursorPoint = { x: cursorX, y: cursorY }; - } - //prob redundant - handleDoubleTap() { - this.messageBroker.publish("undo"); - } - async zoom(event) { - const cursorPoint = { x: event.clientX, y: event.clientY }; - const oldZoom = this.zoom_ratio; - const zoomFactor = event.deltaY < 0 ? 1.1 : 0.9; - this.zoom_ratio = Math.max( - 0.2, - Math.min(10, this.zoom_ratio * zoomFactor) - ); - const newZoom = this.zoom_ratio; - const maskCanvas = await this.messageBroker.pull("maskCanvas"); - const rect = maskCanvas.getBoundingClientRect(); - const mouseX = cursorPoint.x - rect.left; - const mouseY = cursorPoint.y - rect.top; - console.log(oldZoom, newZoom); - const scaleFactor = newZoom / oldZoom; - this.pan_offset.x += mouseX - mouseX * scaleFactor; - this.pan_offset.y += mouseY - mouseY * scaleFactor; - await this.invalidatePanZoom(); - const newImageWidth = maskCanvas.clientWidth; - const zoomRatio = newImageWidth / this.imageRootWidth; - this.interpolatedZoomRatio = zoomRatio; - this.messageBroker.publish("setZoomText", `${Math.round(zoomRatio * 100)}%`); - this.updateCursorPosition(cursorPoint); - requestAnimationFrame(() => { - this.messageBroker.publish("updateBrushPreview"); - }); - } - async smoothResetView(duration = 500) { - const startZoom = this.zoom_ratio; - const startPan = { ...this.pan_offset }; - const sidePanelWidth = 220; - const toolPanelWidth = 64; - const topBarHeight = 44; - const availableWidth = this.rootElement.clientWidth - sidePanelWidth - toolPanelWidth; - const availableHeight = this.rootElement.clientHeight - topBarHeight; - const zoomRatioWidth = availableWidth / this.image.width; - const zoomRatioHeight = availableHeight / this.image.height; - const targetZoom = Math.min(zoomRatioWidth, zoomRatioHeight); - const aspectRatio = this.image.width / this.image.height; - let finalWidth = 0; - let finalHeight = 0; - const targetPan = { x: toolPanelWidth, y: topBarHeight }; - if (zoomRatioHeight > zoomRatioWidth) { - finalWidth = availableWidth; - finalHeight = finalWidth / aspectRatio; - targetPan.y = (availableHeight - finalHeight) / 2 + topBarHeight; - } else { - finalHeight = availableHeight; - finalWidth = finalHeight * aspectRatio; - targetPan.x = (availableWidth - finalWidth) / 2 + toolPanelWidth; - } - const startTime = performance.now(); - const animate = /* @__PURE__ */ __name((currentTime) => { - const elapsed = currentTime - startTime; - const progress = Math.min(elapsed / duration, 1); - const eased = 1 - Math.pow(1 - progress, 3); - const currentZoom = startZoom + (targetZoom - startZoom) * eased; - this.zoom_ratio = currentZoom; - this.pan_offset.x = startPan.x + (targetPan.x - startPan.x) * eased; - this.pan_offset.y = startPan.y + (targetPan.y - startPan.y) * eased; - this.invalidatePanZoom(); - const interpolatedZoomRatio = startZoom + (1 - startZoom) * eased; - this.messageBroker.publish( - "setZoomText", - `${Math.round(interpolatedZoomRatio * 100)}%` - ); - if (progress < 1) { - requestAnimationFrame(animate); - } - }, "animate"); - requestAnimationFrame(animate); - this.interpolatedZoomRatio = 1; - } - async initializeCanvasPanZoom(image, rootElement) { - let sidePanelWidth = 220; - const toolPanelWidth = 64; - let topBarHeight = 44; - this.rootElement = rootElement; - let availableWidth = rootElement.clientWidth - sidePanelWidth - toolPanelWidth; - let availableHeight = rootElement.clientHeight - topBarHeight; - let zoomRatioWidth = availableWidth / image.width; - let zoomRatioHeight = availableHeight / image.height; - let aspectRatio = image.width / image.height; - let finalWidth = 0; - let finalHeight = 0; - let pan_offset = { x: toolPanelWidth, y: topBarHeight }; - if (zoomRatioHeight > zoomRatioWidth) { - finalWidth = availableWidth; - finalHeight = finalWidth / aspectRatio; - pan_offset.y = (availableHeight - finalHeight) / 2 + topBarHeight; - } else { - finalHeight = availableHeight; - finalWidth = finalHeight * aspectRatio; - pan_offset.x = (availableWidth - finalWidth) / 2 + toolPanelWidth; - } - if (this.image === null) { - this.image = image; - } - this.imageRootWidth = finalWidth; - this.imageRootHeight = finalHeight; - this.zoom_ratio = Math.min(zoomRatioWidth, zoomRatioHeight); - this.pan_offset = pan_offset; - await this.invalidatePanZoom(); - } - async invalidatePanZoom() { - if (!this.image?.width || !this.image?.height || !this.pan_offset || !this.zoom_ratio) { - console.warn("Missing required properties for pan/zoom"); - return; - } - const raw_width = this.image.width * this.zoom_ratio; - const raw_height = this.image.height * this.zoom_ratio; - this.canvasContainer ??= await this.messageBroker?.pull("getCanvasContainer"); - if (!this.canvasContainer) return; - Object.assign(this.canvasContainer.style, { - width: `${raw_width}px`, - height: `${raw_height}px`, - left: `${this.pan_offset.x}px`, - top: `${this.pan_offset.y}px` - }); - } - handlePanStart(event) { - let coords_canvas = this.messageBroker.pull("screenToCanvas", { - x: event.offsetX, - y: event.offsetY - }); - this.mouseDownPoint = { x: event.clientX, y: event.clientY }; - this.messageBroker.publish("panCursor", true); - this.initialPan = this.pan_offset; - return; - } - handlePanMove(event) { - if (this.mouseDownPoint === null) throw new Error("mouseDownPoint is null"); - let deltaX = this.mouseDownPoint.x - event.clientX; - let deltaY = this.mouseDownPoint.y - event.clientY; - let pan_x = this.initialPan.x - deltaX; - let pan_y = this.initialPan.y - deltaY; - this.pan_offset = { x: pan_x, y: pan_y }; - this.invalidatePanZoom(); - } -} -class MessageBroker { - static { - __name(this, "MessageBroker"); - } - pushTopics = {}; - pullTopics = {}; - constructor() { - this.registerListeners(); - } - // Push - registerListeners() { - this.createPushTopic("panStart"); - this.createPushTopic("paintBucketFill"); - this.createPushTopic("saveState"); - this.createPushTopic("brushAdjustmentStart"); - this.createPushTopic("drawStart"); - this.createPushTopic("panMove"); - this.createPushTopic("updateBrushPreview"); - this.createPushTopic("brushAdjustment"); - this.createPushTopic("draw"); - this.createPushTopic("paintBucketCursor"); - this.createPushTopic("panCursor"); - this.createPushTopic("drawEnd"); - this.createPushTopic("zoom"); - this.createPushTopic("undo"); - this.createPushTopic("redo"); - this.createPushTopic("cursorPoint"); - this.createPushTopic("panOffset"); - this.createPushTopic("zoomRatio"); - this.createPushTopic("getMaskCanvas"); - this.createPushTopic("getCanvasContainer"); - this.createPushTopic("screenToCanvas"); - this.createPushTopic("isKeyPressed"); - this.createPushTopic("isCombinationPressed"); - this.createPushTopic("setPaintBucketTolerance"); - this.createPushTopic("setBrushSize"); - this.createPushTopic("setBrushHardness"); - this.createPushTopic("setBrushOpacity"); - this.createPushTopic("setBrushShape"); - this.createPushTopic("initZoomPan"); - this.createPushTopic("setTool"); - this.createPushTopic("pointerDown"); - this.createPushTopic("pointerMove"); - this.createPushTopic("pointerUp"); - this.createPushTopic("wheel"); - this.createPushTopic("initPaintBucketTool"); - this.createPushTopic("setBrushVisibility"); - this.createPushTopic("setBrushPreviewGradientVisibility"); - this.createPushTopic("handleTouchStart"); - this.createPushTopic("handleTouchMove"); - this.createPushTopic("handleTouchEnd"); - this.createPushTopic("colorSelectFill"); - this.createPushTopic("setColorSelectTolerance"); - this.createPushTopic("setLivePreview"); - this.createPushTopic("updateCursor"); - this.createPushTopic("setColorComparisonMethod"); - this.createPushTopic("clearLastPoint"); - this.createPushTopic("setWholeImage"); - this.createPushTopic("setMaskBoundary"); - this.createPushTopic("setMaskTolerance"); - this.createPushTopic("setBrushSmoothingPrecision"); - this.createPushTopic("setZoomText"); - this.createPushTopic("resetZoom"); - this.createPushTopic("invert"); - } - /** - * Creates a new push topic (listener is notified) - * - * @param {string} topicName - The name of the topic to create. - * @throws {Error} If the topic already exists. - */ - createPushTopic(topicName) { - if (this.topicExists(this.pushTopics, topicName)) { - throw new Error("Topic already exists"); - } - this.pushTopics[topicName] = []; - } - /** - * Subscribe a callback function to the given topic. - * - * @param {string} topicName - The name of the topic to subscribe to. - * @param {Callback} callback - The callback function to be subscribed. - * @throws {Error} If the topic does not exist. - */ - subscribe(topicName, callback) { - if (!this.topicExists(this.pushTopics, topicName)) { - throw new Error(`Topic "${topicName}" does not exist!`); - } - this.pushTopics[topicName].push(callback); - } - /** - * Removes a callback function from the list of subscribers for a given topic. - * - * @param {string} topicName - The name of the topic to unsubscribe from. - * @param {Callback} callback - The callback function to remove from the subscribers list. - * @throws {Error} If the topic does not exist in the list of topics. - */ - unsubscribe(topicName, callback) { - if (!this.topicExists(this.pushTopics, topicName)) { - throw new Error("Topic does not exist"); - } - const index = this.pushTopics[topicName].indexOf(callback); - if (index > -1) { - this.pushTopics[topicName].splice(index, 1); - } - } - /** - * Publishes data to a specified topic with variable number of arguments. - * @param {string} topicName - The name of the topic to publish to. - * @param {...any[]} args - Variable number of arguments to pass to subscribers - * @throws {Error} If the specified topic does not exist. - */ - publish(topicName, ...args) { - if (!this.topicExists(this.pushTopics, topicName)) { - throw new Error(`Topic "${topicName}" does not exist!`); - } - this.pushTopics[topicName].forEach((callback) => { - callback(...args); - }); - } - // Pull - /** - * Creates a new pull topic (listener must request data) - * - * @param {string} topicName - The name of the topic to create. - * @param {() => Promise} callBack - The callback function to be called when data is requested. - * @throws {Error} If the topic already exists. - */ - createPullTopic(topicName, callBack) { - if (this.topicExists(this.pullTopics, topicName)) { - throw new Error("Topic already exists"); - } - this.pullTopics[topicName] = callBack; - } - /** - * Requests data from a specified pull topic. - * @param {string} topicName - The name of the topic to request data from. - * @returns {Promise} - The data from the pull topic. - * @throws {Error} If the specified topic does not exist. - */ - async pull(topicName, data) { - if (!this.topicExists(this.pullTopics, topicName)) { - throw new Error("Topic does not exist"); - } - const callBack = this.pullTopics[topicName]; - try { - const result = await callBack(data); - return result; - } catch (error) { - console.error(`Error pulling data from topic "${topicName}":`, error); - throw error; - } - } - // Helper Methods - /** - * Checks if a topic exists in the given topics object. - * @param {Record} topics - The topics object to check. - * @param {string} topicName - The name of the topic to check. - * @returns {boolean} - True if the topic exists, false otherwise. - */ - topicExists(topics, topicName) { - return topics.hasOwnProperty(topicName); - } -} -class KeyboardManager { - static { - __name(this, "KeyboardManager"); - } - keysDown = []; - maskEditor; - messageBroker; - constructor(maskEditor) { - this.maskEditor = maskEditor; - this.messageBroker = maskEditor.getMessageBroker(); - this.addPullTopics(); - } - addPullTopics() { - this.messageBroker.createPullTopic( - "isKeyPressed", - (key) => Promise.resolve(this.isKeyDown(key)) - ); - } - addListeners() { - document.addEventListener("keydown", (event) => this.handleKeyDown(event)); - document.addEventListener("keyup", (event) => this.handleKeyUp(event)); - window.addEventListener("blur", () => this.clearKeys()); - } - removeListeners() { - document.removeEventListener( - "keydown", - (event) => this.handleKeyDown(event) - ); - document.removeEventListener("keyup", (event) => this.handleKeyUp(event)); - } - clearKeys() { - this.keysDown = []; - } - handleKeyDown(event) { - if (!this.keysDown.includes(event.key)) { - this.keysDown.push(event.key); - } - } - handleKeyUp(event) { - this.keysDown = this.keysDown.filter((key) => key !== event.key); - } - isKeyDown(key) { - return this.keysDown.includes(key); - } - // combinations - undoCombinationPressed() { - const combination = ["ctrl", "z"]; - const keysDownLower = this.keysDown.map((key) => key.toLowerCase()); - const result = combination.every((key) => keysDownLower.includes(key)); - if (result) this.messageBroker.publish("undo"); - return result; - } - redoCombinationPressed() { - const combination = ["ctrl", "shift", "z"]; - const keysDownLower = this.keysDown.map((key) => key.toLowerCase()); - const result = combination.every((key) => keysDownLower.includes(key)); - if (result) this.messageBroker.publish("redo"); - return result; - } -} -app.registerExtension({ - name: "Comfy.MaskEditor", - settings: [ - { - id: "Comfy.MaskEditor.UseNewEditor", - category: ["Mask Editor", "NewEditor"], - name: "Use new mask editor", - tooltip: "Switch to the new mask editor interface", - type: "boolean", - defaultValue: true, - experimental: true - }, - { - id: "Comfy.MaskEditor.BrushAdjustmentSpeed", - category: ["Mask Editor", "BrushAdjustment", "Sensitivity"], - name: "Brush adjustment speed multiplier", - tooltip: "Controls how quickly the brush size and hardness change when adjusting. Higher values mean faster changes.", - experimental: true, - type: "slider", - attrs: { - min: 0.1, - max: 2, - step: 0.1 - }, - defaultValue: 1, - versionAdded: "1.0.0" - }, - { - id: "Comfy.MaskEditor.UseDominantAxis", - category: ["Mask Editor", "BrushAdjustment", "UseDominantAxis"], - name: "Lock brush adjustment to dominant axis", - tooltip: "When enabled, brush adjustments will only affect size OR hardness based on which direction you move more", - type: "boolean", - defaultValue: true, - experimental: true - } - ], - init(app2) { - function openMaskEditor() { - const useNewEditor = app2.extensionManager.setting.get( - "Comfy.MaskEditor.UseNewEditor" - ); - if (useNewEditor) { - const dlg = MaskEditorDialog.getInstance(); - if (dlg?.isOpened && !dlg.isOpened()) { - dlg.show(); - } - } else { - const dlg = MaskEditorDialogOld.getInstance(); - if (dlg?.isOpened && !dlg.isOpened()) { - dlg.show(); - } - } - } - __name(openMaskEditor, "openMaskEditor"); - ; - ComfyApp.open_maskeditor = openMaskEditor; - const context_predicate = /* @__PURE__ */ __name(() => { - return !!(ComfyApp.clipspace && ComfyApp.clipspace.imgs && ComfyApp.clipspace.imgs.length > 0); - }, "context_predicate"); - ClipspaceDialog.registerButton( - "MaskEditor", - context_predicate, - openMaskEditor - ); - } -}); -const id = "Comfy.NodeTemplates"; -const file = "comfy.templates.json"; -class ManageTemplates extends ComfyDialog { - static { - __name(this, "ManageTemplates"); - } - templates; - draggedEl; - saveVisualCue; - emptyImg; - importInput; - constructor() { - super(); - this.load().then((v) => { - this.templates = v; - }); - this.element.classList.add("comfy-manage-templates"); - this.draggedEl = null; - this.saveVisualCue = null; - this.emptyImg = new Image(); - this.emptyImg.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="; - this.importInput = $el("input", { - type: "file", - accept: ".json", - multiple: true, - style: { display: "none" }, - parent: document.body, - onchange: /* @__PURE__ */ __name(() => this.importAll(), "onchange") - }); - } - createButtons() { - const btns = super.createButtons(); - btns[0].textContent = "Close"; - btns[0].onclick = (e) => { - clearTimeout(this.saveVisualCue); - this.close(); - }; - btns.unshift( - $el("button", { - type: "button", - textContent: "Export", - onclick: /* @__PURE__ */ __name(() => this.exportAll(), "onclick") - }) - ); - btns.unshift( - $el("button", { - type: "button", - textContent: "Import", - onclick: /* @__PURE__ */ __name(() => { - this.importInput.click(); - }, "onclick") - }) - ); - return btns; - } - async load() { - let templates = []; - const res = await api.getUserData(file); - if (res.status === 200) { - try { - templates = await res.json(); - } catch (error) { - } - } else if (res.status !== 404) { - console.error(res.status + " " + res.statusText); - } - return templates ?? []; - } - async store() { - const templates = JSON.stringify(this.templates, void 0, 4); - try { - await api.storeUserData(file, templates, { stringify: false }); - } catch (error) { - console.error(error); - useToastStore().addAlert(error.message); - } - } - async importAll() { - for (const file2 of this.importInput.files) { - if (file2.type === "application/json" || file2.name.endsWith(".json")) { - const reader = new FileReader(); - reader.onload = async () => { - const importFile = JSON.parse(reader.result); - if (importFile?.templates) { - for (const template of importFile.templates) { - if (template?.name && template?.data) { - this.templates.push(template); - } - } - await this.store(); - } - }; - await reader.readAsText(file2); - } - } - this.importInput.value = null; - this.close(); - } - exportAll() { - if (this.templates.length == 0) { - useToastStore().addAlert("No templates to export."); - return; - } - const json = JSON.stringify({ templates: this.templates }, null, 2); - const blob = new Blob([json], { type: "application/json" }); - const url = URL.createObjectURL(blob); - const a = $el("a", { - href: url, - download: "node_templates.json", - style: { display: "none" }, - parent: document.body - }); - a.click(); - setTimeout(function() { - a.remove(); - window.URL.revokeObjectURL(url); - }, 0); - } - show() { - super.show( - $el( - "div", - {}, - this.templates.flatMap((t2, i) => { - let nameInput; - return [ - $el( - "div", - { - dataset: { id: i.toString() }, - className: "templateManagerRow", - style: { - display: "grid", - gridTemplateColumns: "1fr auto", - border: "1px dashed transparent", - gap: "5px", - backgroundColor: "var(--comfy-menu-bg)" - }, - ondragstart: /* @__PURE__ */ __name((e) => { - this.draggedEl = e.currentTarget; - e.currentTarget.style.opacity = "0.6"; - e.currentTarget.style.border = "1px dashed yellow"; - e.dataTransfer.effectAllowed = "move"; - e.dataTransfer.setDragImage(this.emptyImg, 0, 0); - }, "ondragstart"), - ondragend: /* @__PURE__ */ __name((e) => { - e.target.style.opacity = "1"; - e.currentTarget.style.border = "1px dashed transparent"; - e.currentTarget.removeAttribute("draggable"); - this.element.querySelectorAll(".templateManagerRow").forEach((el, i2) => { - var prev_i = Number.parseInt(el.dataset.id); - if (el == this.draggedEl && prev_i != i2) { - this.templates.splice( - i2, - 0, - this.templates.splice(prev_i, 1)[0] - ); - } - el.dataset.id = i2.toString(); - }); - this.store(); - }, "ondragend"), - ondragover: /* @__PURE__ */ __name((e) => { - e.preventDefault(); - if (e.currentTarget == this.draggedEl) return; - let rect = e.currentTarget.getBoundingClientRect(); - if (e.clientY > rect.top + rect.height / 2) { - e.currentTarget.parentNode.insertBefore( - this.draggedEl, - e.currentTarget.nextSibling - ); - } else { - e.currentTarget.parentNode.insertBefore( - this.draggedEl, - e.currentTarget - ); - } - }, "ondragover") - }, - [ - $el( - "label", - { - textContent: "Name: ", - style: { - cursor: "grab" - }, - onmousedown: /* @__PURE__ */ __name((e) => { - if (e.target.localName == "label") - e.currentTarget.parentNode.draggable = "true"; - }, "onmousedown") - }, - [ - $el("input", { - value: t2.name, - dataset: { name: t2.name }, - style: { - transitionProperty: "background-color", - transitionDuration: "0s" - }, - onchange: /* @__PURE__ */ __name((e) => { - clearTimeout(this.saveVisualCue); - var el = e.target; - var row = el.parentNode.parentNode; - this.templates[row.dataset.id].name = el.value.trim() || "untitled"; - this.store(); - el.style.backgroundColor = "rgb(40, 95, 40)"; - el.style.transitionDuration = "0s"; - this.saveVisualCue = setTimeout(function() { - el.style.transitionDuration = ".7s"; - el.style.backgroundColor = "var(--comfy-input-bg)"; - }, 15); - }, "onchange"), - onkeypress: /* @__PURE__ */ __name((e) => { - var el = e.target; - clearTimeout(this.saveVisualCue); - el.style.transitionDuration = "0s"; - el.style.backgroundColor = "var(--comfy-input-bg)"; - }, "onkeypress"), - $: /* @__PURE__ */ __name((el) => nameInput = el, "$") - }) - ] - ), - $el("div", {}, [ - $el("button", { - textContent: "Export", - style: { - fontSize: "12px", - fontWeight: "normal" - }, - onclick: /* @__PURE__ */ __name((e) => { - const json = JSON.stringify({ templates: [t2] }, null, 2); - const blob = new Blob([json], { - type: "application/json" - }); - const url = URL.createObjectURL(blob); - const a = $el("a", { - href: url, - download: (nameInput.value || t2.name) + ".json", - style: { display: "none" }, - parent: document.body - }); - a.click(); - setTimeout(function() { - a.remove(); - window.URL.revokeObjectURL(url); - }, 0); - }, "onclick") - }), - $el("button", { - textContent: "Delete", - style: { - fontSize: "12px", - color: "red", - fontWeight: "normal" - }, - onclick: /* @__PURE__ */ __name((e) => { - const item = e.target.parentNode.parentNode; - item.parentNode.removeChild(item); - this.templates.splice(item.dataset.id * 1, 1); - this.store(); - var that = this; - setTimeout(function() { - that.element.querySelectorAll(".templateManagerRow").forEach((el, i2) => { - el.dataset.id = i2.toString(); - }); - }, 0); - }, "onclick") - }) - ]) - ] - ) - ]; - }) - ) - ); - } -} -app.registerExtension({ - name: id, - setup() { - const manage = new ManageTemplates(); - const clipboardAction = /* @__PURE__ */ __name(async (cb) => { - const old = localStorage.getItem("litegrapheditor_clipboard"); - await cb(); - localStorage.setItem("litegrapheditor_clipboard", old); - }, "clipboardAction"); - const orig = LGraphCanvas.prototype.getCanvasMenuOptions; - LGraphCanvas.prototype.getCanvasMenuOptions = function() { - const options = orig.apply(this, arguments); - options.push(null); - options.push({ - content: `Save Selected as Template`, - disabled: !Object.keys(app.canvas.selected_nodes || {}).length, - callback: /* @__PURE__ */ __name(async () => { - const name = await useDialogService().prompt({ - title: t("nodeTemplates.saveAsTemplate"), - message: t("nodeTemplates.enterName"), - defaultValue: "" - }); - if (!name?.trim()) return; - clipboardAction(() => { - app.canvas.copyToClipboard(); - let data = localStorage.getItem("litegrapheditor_clipboard"); - data = JSON.parse(data); - const nodeIds = Object.keys(app.canvas.selected_nodes); - for (let i = 0; i < nodeIds.length; i++) { - const node = app.graph.getNodeById(nodeIds[i]); - const nodeData = node?.constructor.nodeData; - let groupData = GroupNodeHandler.getGroupData(node); - if (groupData) { - groupData = groupData.nodeData; - if (!data.groupNodes) { - data.groupNodes = {}; - } - data.groupNodes[nodeData.name] = groupData; - data.nodes[i].type = nodeData.name; - } - } - manage.templates.push({ - name, - data: JSON.stringify(data) - }); - manage.store(); - }); - }, "callback") - }); - const subItems = manage.templates.map((t2) => { - return { - content: t2.name, - callback: /* @__PURE__ */ __name(() => { - clipboardAction(async () => { - const data = JSON.parse(t2.data); - await GroupNodeConfig.registerFromWorkflow(data.groupNodes, {}); - if (!data.reroutes) { - deserialiseAndCreate(t2.data, app.canvas); - } else { - localStorage.setItem("litegrapheditor_clipboard", t2.data); - app.canvas.pasteFromClipboard(); - } - }); - }, "callback") - }; - }); - subItems.push(null, { - content: "Manage", - callback: /* @__PURE__ */ __name(() => manage.show(), "callback") - }); - options.push({ - content: "Node Templates", - submenu: { - options: subItems - } - }); - return options; - }; - } -}); -app.registerExtension({ - name: "Comfy.NoteNode", - registerCustomNodes() { - class NoteNode extends LGraphNode { - static { - __name(this, "NoteNode"); - } - static category; - static collapsable; - static title_mode; - color = LGraphCanvas.node_colors.yellow.color; - bgcolor = LGraphCanvas.node_colors.yellow.bgcolor; - groupcolor = LGraphCanvas.node_colors.yellow.groupcolor; - isVirtualNode; - constructor(title) { - super(title); - if (!this.properties) { - this.properties = { text: "" }; - } - ComfyWidgets.STRING( - // Should we extends LGraphNode? Yesss - this, - "", - ["", { default: this.properties.text, multiline: true }], - app - ); - this.serialize_widgets = true; - this.isVirtualNode = true; - } - } - LiteGraph.registerNodeType( - "Note", - Object.assign(NoteNode, { - title_mode: LiteGraph.NORMAL_TITLE, - title: "Note", - collapsable: true - }) - ); - NoteNode.category = "utils"; - class MarkdownNoteNode extends LGraphNode { - static { - __name(this, "MarkdownNoteNode"); - } - static title = "Markdown Note"; - color = LGraphCanvas.node_colors.yellow.color; - bgcolor = LGraphCanvas.node_colors.yellow.bgcolor; - groupcolor = LGraphCanvas.node_colors.yellow.groupcolor; - constructor(title) { - super(title); - if (!this.properties) { - this.properties = { text: "" }; - } - ComfyWidgets.MARKDOWN( - this, - "", - ["", { default: this.properties.text }], - app - ); - this.serialize_widgets = true; - this.isVirtualNode = true; - } - } - LiteGraph.registerNodeType("MarkdownNote", MarkdownNoteNode); - MarkdownNoteNode.category = "utils"; - } -}); -app.registerExtension({ - name: "Comfy.RerouteNode", - registerCustomNodes(app2) { - class RerouteNode extends LGraphNode { - static { - __name(this, "RerouteNode"); - } - static category; - static defaultVisibility = false; - constructor(title) { - super(title); - if (!this.properties) { - this.properties = {}; - } - this.properties.showOutputText = RerouteNode.defaultVisibility; - this.properties.horizontal = false; - this.addInput("", "*"); - this.addOutput(this.properties.showOutputText ? "*" : "", "*"); - this.onAfterGraphConfigured = function() { - requestAnimationFrame(() => { - this.onConnectionsChange(LiteGraph.INPUT, null, true, null); - }); - }; - this.onConnectionsChange = (type, index, connected, link_info) => { - if (app2.configuringGraph) return; - if (connected && type === LiteGraph.OUTPUT) { - const types = new Set( - this.outputs[0].links.map((l) => app2.graph.links[l].type).filter((t2) => t2 !== "*") - ); - if (types.size > 1) { - const linksToDisconnect = []; - for (let i = 0; i < this.outputs[0].links.length - 1; i++) { - const linkId = this.outputs[0].links[i]; - const link = app2.graph.links[linkId]; - linksToDisconnect.push(link); - } - for (const link of linksToDisconnect) { - const node = app2.graph.getNodeById(link.target_id); - node.disconnectInput(link.target_slot); - } - } - } - let currentNode = this; - let updateNodes = []; - let inputType = null; - let inputNode = null; - while (currentNode) { - updateNodes.unshift(currentNode); - const linkId = currentNode.inputs[0].link; - if (linkId !== null) { - const link = app2.graph.links[linkId]; - if (!link) return; - const node = app2.graph.getNodeById(link.origin_id); - const type2 = node.constructor.type; - if (type2 === "Reroute") { - if (node === this) { - currentNode.disconnectInput(link.target_slot); - currentNode = null; - } else { - currentNode = node; - } - } else { - inputNode = currentNode; - inputType = node.outputs[link.origin_slot]?.type ?? null; - break; - } - } else { - currentNode = null; - break; - } - } - const nodes = [this]; - let outputType = null; - while (nodes.length) { - currentNode = nodes.pop(); - const outputs = (currentNode.outputs ? currentNode.outputs[0].links : []) || []; - if (outputs.length) { - for (const linkId of outputs) { - const link = app2.graph.links[linkId]; - if (!link) continue; - const node = app2.graph.getNodeById(link.target_id); - const type2 = node.constructor.type; - if (type2 === "Reroute") { - nodes.push(node); - updateNodes.push(node); - } else { - const nodeOutType = node.inputs && node.inputs[link?.target_slot] && node.inputs[link.target_slot].type ? node.inputs[link.target_slot].type : null; - if (inputType && !LiteGraph.isValidConnection(inputType, nodeOutType)) { - node.disconnectInput(link.target_slot); - } else { - outputType = nodeOutType; - } - } - } - } else { - } - } - const displayType = inputType || outputType || "*"; - const color = LGraphCanvas.link_type_colors[displayType]; - let widgetConfig; - let targetWidget; - let widgetType; - for (const node of updateNodes) { - node.outputs[0].type = inputType || "*"; - node.__outputType = displayType; - node.outputs[0].name = node.properties.showOutputText ? displayType : ""; - node.setSize(node.computeSize()); - for (const l of node.outputs[0].links || []) { - const link = app2.graph.links[l]; - if (link) { - link.color = color; - if (app2.configuringGraph) continue; - const targetNode = app2.graph.getNodeById(link.target_id); - const targetInput = targetNode.inputs?.[link.target_slot]; - if (targetInput?.widget) { - const config = getWidgetConfig(targetInput); - if (!widgetConfig) { - widgetConfig = config[1] ?? {}; - widgetType = config[0]; - } - if (!targetWidget) { - targetWidget = targetNode.widgets?.find( - (w) => w.name === targetInput.widget.name - ); - } - const merged = mergeIfValid(targetInput, [ - config[0], - widgetConfig - ]); - if (merged.customConfig) { - widgetConfig = merged.customConfig; - } - } - } - } - } - for (const node of updateNodes) { - if (widgetConfig && outputType) { - node.inputs[0].widget = { name: "value" }; - setWidgetConfig( - node.inputs[0], - [widgetType ?? displayType, widgetConfig], - targetWidget - ); - } else { - setWidgetConfig(node.inputs[0], null); - } - } - if (inputNode) { - const link = app2.graph.links[inputNode.inputs[0].link]; - if (link) { - link.color = color; - } - } - }; - this.clone = function() { - const cloned = RerouteNode.prototype.clone.apply(this); - cloned.removeOutput(0); - cloned.addOutput(this.properties.showOutputText ? "*" : "", "*"); - cloned.setSize(cloned.computeSize()); - return cloned; - }; - this.isVirtualNode = true; - } - getExtraMenuOptions(_, options) { - options.unshift( - { - content: (this.properties.showOutputText ? "Hide" : "Show") + " Type", - callback: /* @__PURE__ */ __name(() => { - this.properties.showOutputText = !this.properties.showOutputText; - if (this.properties.showOutputText) { - this.outputs[0].name = this.__outputType || this.outputs[0].type; - } else { - this.outputs[0].name = ""; - } - this.setSize(this.computeSize()); - app2.graph.setDirtyCanvas(true, true); - }, "callback") - }, - { - content: (RerouteNode.defaultVisibility ? "Hide" : "Show") + " Type By Default", - callback: /* @__PURE__ */ __name(() => { - RerouteNode.setDefaultTextVisibility( - !RerouteNode.defaultVisibility - ); - }, "callback") - } - ); - return []; - } - computeSize() { - return [ - this.properties.showOutputText && this.outputs && this.outputs.length ? Math.max( - 75, - LiteGraph.NODE_TEXT_SIZE * this.outputs[0].name.length * 0.6 + 40 - ) : 75, - 26 - ]; - } - static setDefaultTextVisibility(visible) { - RerouteNode.defaultVisibility = visible; - if (visible) { - localStorage["Comfy.RerouteNode.DefaultVisibility"] = "true"; - } else { - delete localStorage["Comfy.RerouteNode.DefaultVisibility"]; - } - } - } - RerouteNode.setDefaultTextVisibility( - !!localStorage["Comfy.RerouteNode.DefaultVisibility"] - ); - LiteGraph.registerNodeType( - "Reroute", - Object.assign(RerouteNode, { - title_mode: LiteGraph.NO_TITLE, - title: "Reroute", - collapsable: false - }) - ); - RerouteNode.category = "utils"; - } -}); -app.registerExtension({ - name: "Comfy.SaveImageExtraOutput", - async beforeRegisterNodeDef(nodeType, nodeData, app2) { - if (nodeData.name === "SaveImage" || nodeData.name === "SaveAnimatedWEBP" || nodeData.name === "SaveAnimatedWEBM") { - const onNodeCreated = nodeType.prototype.onNodeCreated; - nodeType.prototype.onNodeCreated = function() { - const r = onNodeCreated ? onNodeCreated.apply(this, arguments) : void 0; - const widget = this.widgets.find((w) => w.name === "filename_prefix"); - widget.serializeValue = () => { - return applyTextReplacements(app2, widget.value); - }; - return r; - }; - } else { - const onNodeCreated = nodeType.prototype.onNodeCreated; - nodeType.prototype.onNodeCreated = function() { - const r = onNodeCreated ? onNodeCreated.apply(this, arguments) : void 0; - if (!this.properties || !("Node name for S&R" in this.properties)) { - this.addProperty("Node name for S&R", this.constructor.type, "string"); - } - return r; - }; - } - } -}); -let touchZooming; -let touchCount = 0; -app.registerExtension({ - name: "Comfy.SimpleTouchSupport", - setup() { - let touchDist; - let touchTime; - let lastTouch; - let lastScale; - function getMultiTouchPos(e) { - return Math.hypot( - e.touches[0].clientX - e.touches[1].clientX, - e.touches[0].clientY - e.touches[1].clientY - ); - } - __name(getMultiTouchPos, "getMultiTouchPos"); - function getMultiTouchCenter(e) { - return { - clientX: (e.touches[0].clientX + e.touches[1].clientX) / 2, - clientY: (e.touches[0].clientY + e.touches[1].clientY) / 2 - }; - } - __name(getMultiTouchCenter, "getMultiTouchCenter"); - app.canvasEl.parentElement.addEventListener( - "touchstart", - (e) => { - touchCount++; - lastTouch = null; - lastScale = null; - if (e.touches?.length === 1) { - touchTime = /* @__PURE__ */ new Date(); - lastTouch = e.touches[0]; - } else { - touchTime = null; - if (e.touches?.length === 2) { - lastScale = app.canvas.ds.scale; - lastTouch = getMultiTouchCenter(e); - touchDist = getMultiTouchPos(e); - app.canvas.pointer.isDown = false; - } - } - }, - true - ); - app.canvasEl.parentElement.addEventListener("touchend", (e) => { - touchCount--; - if (e.touches?.length !== 1) touchZooming = false; - if (touchTime && !e.touches?.length) { - if ((/* @__PURE__ */ new Date()).getTime() - touchTime > 600) { - if (e.target === app.canvasEl) { - app.canvasEl.dispatchEvent( - new PointerEvent("pointerdown", { - button: 2, - clientX: e.changedTouches[0].clientX, - clientY: e.changedTouches[0].clientY - }) - ); - e.preventDefault(); - } - } - touchTime = null; - } - }); - app.canvasEl.parentElement.addEventListener( - "touchmove", - (e) => { - touchTime = null; - if (e.touches?.length === 2 && lastTouch && !e.ctrlKey && !e.shiftKey) { - e.preventDefault(); - app.canvas.pointer.isDown = false; - touchZooming = true; - LiteGraph.closeAllContextMenus(window); - app.canvas.search_box?.close(); - const newTouchDist = getMultiTouchPos(e); - const center = getMultiTouchCenter(e); - let scale = lastScale * newTouchDist / touchDist; - const newX = (center.clientX - lastTouch.clientX) / scale; - const newY = (center.clientY - lastTouch.clientY) / scale; - if (scale < app.canvas.ds.min_scale) { - scale = app.canvas.ds.min_scale; - } else if (scale > app.canvas.ds.max_scale) { - scale = app.canvas.ds.max_scale; - } - const oldScale = app.canvas.ds.scale; - app.canvas.ds.scale = scale; - if (Math.abs(app.canvas.ds.scale - 1) < 0.01) { - app.canvas.ds.scale = 1; - } - const newScale = app.canvas.ds.scale; - const convertScaleToOffset = /* @__PURE__ */ __name((scale2) => [ - center.clientX / scale2 - app.canvas.ds.offset[0], - center.clientY / scale2 - app.canvas.ds.offset[1] - ], "convertScaleToOffset"); - var oldCenter = convertScaleToOffset(oldScale); - var newCenter = convertScaleToOffset(newScale); - app.canvas.ds.offset[0] += newX + newCenter[0] - oldCenter[0]; - app.canvas.ds.offset[1] += newY + newCenter[1] - oldCenter[1]; - lastTouch.clientX = center.clientX; - lastTouch.clientY = center.clientY; - app.canvas.setDirty(true, true); - } - }, - true - ); - } -}); -const processMouseDown = LGraphCanvas.prototype.processMouseDown; -LGraphCanvas.prototype.processMouseDown = function(e) { - if (touchZooming || touchCount) { - return; - } - app.canvas.pointer.isDown = false; - return processMouseDown.apply(this, arguments); -}; -const processMouseMove = LGraphCanvas.prototype.processMouseMove; -LGraphCanvas.prototype.processMouseMove = function(e) { - if (touchZooming || touchCount > 1) { - return; - } - return processMouseMove.apply(this, arguments); -}; -app.registerExtension({ - name: "Comfy.SlotDefaults", - suggestionsNumber: null, - init() { - LiteGraph.search_filter_enabled = true; - LiteGraph.middle_click_slot_add_default_node = true; - this.suggestionsNumber = app.ui.settings.addSetting({ - id: "Comfy.NodeSuggestions.number", - category: ["Comfy", "Node Search Box", "NodeSuggestions"], - name: "Number of nodes suggestions", - tooltip: "Only for litegraph searchbox/context menu", - type: "slider", - attrs: { - min: 1, - max: 100, - step: 1 - }, - defaultValue: 5, - onChange: /* @__PURE__ */ __name((newVal, oldVal) => { - this.setDefaults(newVal); - }, "onChange") - }); - }, - slot_types_default_out: {}, - slot_types_default_in: {}, - async beforeRegisterNodeDef(nodeType, nodeData, app2) { - var nodeId = nodeData.name; - const inputs = nodeData["input"]?.["required"]; - for (const inputKey in inputs) { - var input = inputs[inputKey]; - if (typeof input[0] !== "string") continue; - var type = input[0]; - if (type in ComfyWidgets) { - var customProperties = input[1]; - if (!customProperties?.forceInput) continue; - } - if (!(type in this.slot_types_default_out)) { - this.slot_types_default_out[type] = ["Reroute"]; - } - if (this.slot_types_default_out[type].includes(nodeId)) continue; - this.slot_types_default_out[type].push(nodeId); - const lowerType = type.toLocaleLowerCase(); - if (!(lowerType in LiteGraph.registered_slot_in_types)) { - LiteGraph.registered_slot_in_types[lowerType] = { nodes: [] }; - } - LiteGraph.registered_slot_in_types[lowerType].nodes.push( - // @ts-expect-error ComfyNode - nodeType.comfyClass - ); - } - var outputs = nodeData["output"] ?? []; - for (const el of outputs) { - const type2 = el; - if (!(type2 in this.slot_types_default_in)) { - this.slot_types_default_in[type2] = ["Reroute"]; - } - this.slot_types_default_in[type2].push(nodeId); - if (!(type2 in LiteGraph.registered_slot_out_types)) { - LiteGraph.registered_slot_out_types[type2] = { nodes: [] }; - } - LiteGraph.registered_slot_out_types[type2].nodes.push(nodeType.comfyClass); - if (!LiteGraph.slot_types_out.includes(type2)) { - LiteGraph.slot_types_out.push(type2); - } - } - var maxNum = this.suggestionsNumber.value; - this.setDefaults(maxNum); - }, - setDefaults(maxNum) { - LiteGraph.slot_types_default_out = {}; - LiteGraph.slot_types_default_in = {}; - for (const type in this.slot_types_default_out) { - LiteGraph.slot_types_default_out[type] = this.slot_types_default_out[type].slice(0, maxNum); - } - for (const type in this.slot_types_default_in) { - LiteGraph.slot_types_default_in[type] = this.slot_types_default_in[type].slice(0, maxNum); - } - } -}); -function splitFilePath(path) { - const folder_separator = path.lastIndexOf("/"); - if (folder_separator === -1) { - return ["", path]; - } - return [ - path.substring(0, folder_separator), - path.substring(folder_separator + 1) - ]; -} -__name(splitFilePath, "splitFilePath"); -function getResourceURL(subfolder, filename, type = "input") { - const params = [ - "filename=" + encodeURIComponent(filename), - "type=" + type, - "subfolder=" + subfolder, - app.getRandParam().substring(1) - ].join("&"); - return `/view?${params}`; -} -__name(getResourceURL, "getResourceURL"); -async function uploadFile(audioWidget, audioUIWidget, file2, updateNode, pasted = false) { - try { - const body = new FormData(); - body.append("image", file2); - if (pasted) body.append("subfolder", "pasted"); - const resp = await api.fetchApi("/upload/image", { - method: "POST", - body - }); - if (resp.status === 200) { - const data = await resp.json(); - let path = data.name; - if (data.subfolder) path = data.subfolder + "/" + path; - if (!audioWidget.options.values.includes(path)) { - audioWidget.options.values.push(path); - } - if (updateNode) { - audioUIWidget.element.src = api.apiURL( - getResourceURL(...splitFilePath(path)) - ); - audioWidget.value = path; - } - } else { - useToastStore().addAlert(resp.status + " - " + resp.statusText); - } - } catch (error) { - useToastStore().addAlert(error); - } -} -__name(uploadFile, "uploadFile"); -app.registerExtension({ - name: "Comfy.AudioWidget", - async beforeRegisterNodeDef(nodeType, nodeData) { - if ( - // @ts-expect-error ComfyNode - ["LoadAudio", "SaveAudio", "PreviewAudio"].includes(nodeType.comfyClass) - ) { - nodeData.input.required.audioUI = ["AUDIO_UI"]; - } - }, - getCustomWidgets() { - return { - AUDIO_UI(node, inputName) { - const audio = document.createElement("audio"); - audio.controls = true; - audio.classList.add("comfy-audio"); - audio.setAttribute("name", "media"); - const audioUIWidget = node.addDOMWidget( - inputName, - /* name=*/ - "audioUI", - audio, - { - serialize: false - } - ); - const isOutputNode = node.constructor.nodeData.output_node; - if (isOutputNode) { - audioUIWidget.element.classList.add("empty-audio-widget"); - const onExecuted = node.onExecuted; - node.onExecuted = function(message) { - onExecuted?.apply(this, arguments); - const audios = message.audio; - if (!audios) return; - const audio2 = audios[0]; - audioUIWidget.element.src = api.apiURL( - getResourceURL(audio2.subfolder, audio2.filename, audio2.type) - ); - audioUIWidget.element.classList.remove("empty-audio-widget"); - }; - } - return { widget: audioUIWidget }; - } - }; - }, - onNodeOutputsUpdated(nodeOutputs) { - for (const [nodeId, output] of Object.entries(nodeOutputs)) { - const node = app.graph.getNodeById(nodeId); - if ("audio" in output) { - const audioUIWidget = node.widgets.find( - (w) => w.name === "audioUI" - ); - const audio = output.audio[0]; - audioUIWidget.element.src = api.apiURL( - getResourceURL(audio.subfolder, audio.filename, audio.type) - ); - audioUIWidget.element.classList.remove("empty-audio-widget"); - } - } - } -}); -app.registerExtension({ - name: "Comfy.UploadAudio", - async beforeRegisterNodeDef(nodeType, nodeData) { - if (nodeData?.input?.required?.audio?.[1]?.audio_upload === true) { - nodeData.input.required.upload = ["AUDIOUPLOAD"]; - } - }, - getCustomWidgets() { - return { - AUDIOUPLOAD(node, inputName) { - const audioWidget = node.widgets.find( - (w) => w.name === "audio" - ); - const audioUIWidget = node.widgets.find( - (w) => w.name === "audioUI" - ); - const onAudioWidgetUpdate = /* @__PURE__ */ __name(() => { - audioUIWidget.element.src = api.apiURL( - getResourceURL(...splitFilePath(audioWidget.value)) - ); - }, "onAudioWidgetUpdate"); - if (audioWidget.value) { - onAudioWidgetUpdate(); - } - audioWidget.callback = onAudioWidgetUpdate; - const onGraphConfigured = node.onGraphConfigured; - node.onGraphConfigured = function() { - onGraphConfigured?.apply(this, arguments); - if (audioWidget.value) { - onAudioWidgetUpdate(); - } - }; - const handleUpload = /* @__PURE__ */ __name(async (files) => { - if (files?.length) { - uploadFile(audioWidget, audioUIWidget, files[0], true); - } - return files; - }, "handleUpload"); - const { openFileSelection } = useNodeFileInput(node, { - accept: "audio/*", - onSelect: handleUpload - }); - const uploadWidget = node.addWidget( - "button", - inputName, - "", - openFileSelection, - { serialize: false } - ); - uploadWidget.label = "choose file to upload"; - useNodeDragAndDrop(node, { - fileFilter: /* @__PURE__ */ __name((file2) => file2.type.startsWith("audio/"), "fileFilter"), - onDrop: handleUpload - }); - node.previewMediaType = "audio"; - return { widget: uploadWidget }; - } - }; - } -}); -const isMediaUploadComboInput = /* @__PURE__ */ __name((inputSpec) => { - const [inputName, inputOptions] = inputSpec; - if (!inputOptions) return false; - const isUploadInput = inputOptions["image_upload"] === true || inputOptions["video_upload"] === true; - return isUploadInput && (isComboInputSpecV1(inputSpec) || inputName === "COMBO"); -}, "isMediaUploadComboInput"); -const createUploadInput = /* @__PURE__ */ __name((imageInputName, imageInputOptions) => [ - "IMAGEUPLOAD", - { - ...imageInputOptions[1], - imageInputName - } -], "createUploadInput"); -app.registerExtension({ - name: "Comfy.UploadImage", - beforeRegisterNodeDef(nodeType, nodeData) { - const { input } = nodeData ?? {}; - const { required } = input ?? {}; - if (!required) return; - const found = Object.entries(required).find( - ([_, input2]) => isMediaUploadComboInput(input2) - ); - if (found) { - const [inputName, inputSpec] = found; - required.upload = createUploadInput(inputName, inputSpec); - } - } -}); -const WEBCAM_READY = Symbol(); -app.registerExtension({ - name: "Comfy.WebcamCapture", - getCustomWidgets(app2) { - return { - WEBCAM(node, inputName) { - let res; - node[WEBCAM_READY] = new Promise((resolve) => res = resolve); - const container = document.createElement("div"); - container.style.background = "rgba(0,0,0,0.25)"; - container.style.textAlign = "center"; - const video = document.createElement("video"); - video.style.height = video.style.width = "100%"; - const loadVideo = /* @__PURE__ */ __name(async () => { - try { - const stream = await navigator.mediaDevices.getUserMedia({ - video: true, - audio: false - }); - container.replaceChildren(video); - setTimeout(() => res(video), 500); - video.addEventListener("loadedmetadata", () => res(video), false); - video.srcObject = stream; - video.play(); - } catch (error) { - const label = document.createElement("div"); - label.style.color = "red"; - label.style.overflow = "auto"; - label.style.maxHeight = "100%"; - label.style.whiteSpace = "pre-wrap"; - if (window.isSecureContext) { - label.textContent = "Unable to load webcam, please ensure access is granted:\n" + error.message; - } else { - label.textContent = "Unable to load webcam. A secure context is required, if you are not accessing ComfyUI on localhost (127.0.0.1) you will have to enable TLS (https)\n\n" + error.message; - } - container.replaceChildren(label); - } - }, "loadVideo"); - loadVideo(); - return { widget: node.addDOMWidget(inputName, "WEBCAM", container) }; - } - }; - }, - nodeCreated(node) { - if (node.type, node.constructor.comfyClass !== "WebcamCapture") return; - let video; - const camera = node.widgets.find((w2) => w2.name === "image"); - const w = node.widgets.find((w2) => w2.name === "width"); - const h = node.widgets.find((w2) => w2.name === "height"); - const captureOnQueue = node.widgets.find( - (w2) => w2.name === "capture_on_queue" - ); - const canvas = document.createElement("canvas"); - const capture = /* @__PURE__ */ __name(() => { - canvas.width = w.value; - canvas.height = h.value; - const ctx = canvas.getContext("2d"); - ctx.drawImage(video, 0, 0, w.value, h.value); - const data = canvas.toDataURL("image/png"); - const img = new Image(); - img.onload = () => { - node.imgs = [img]; - app.graph.setDirtyCanvas(true); - requestAnimationFrame(() => { - node.setSizeForImage?.(); - }); - }; - img.src = data; - }, "capture"); - const btn = node.addWidget( - "button", - "waiting for camera...", - "capture", - capture - ); - btn.disabled = true; - btn.serializeValue = () => void 0; - camera.serializeValue = async () => { - if (captureOnQueue.value) { - capture(); - } else if (!node.imgs?.length) { - const err2 = `No webcam image captured`; - useToastStore().addAlert(err2); - throw new Error(err2); - } - const blob = await new Promise((r) => canvas.toBlob(r)); - const name = `${+/* @__PURE__ */ new Date()}.png`; - const file2 = new File([blob], name); - const body = new FormData(); - body.append("image", file2); - body.append("subfolder", "webcam"); - body.append("type", "temp"); - const resp = await api.fetchApi("/upload/image", { - method: "POST", - body - }); - if (resp.status !== 200) { - const err2 = `Error uploading camera image: ${resp.status} - ${resp.statusText}`; - useToastStore().addAlert(err2); - throw new Error(err2); - } - return `webcam/${name} [temp]`; - }; - node[WEBCAM_READY].then((v) => { - video = v; - if (!w.value) { - w.value = video.videoWidth || 640; - h.value = video.videoHeight || 480; - } - btn.disabled = false; - btn.label = "capture"; - }); - } -}); -//# sourceMappingURL=index-CpICyVZm.js.map diff --git a/comfy/web/assets/index-CpICyVZm.js.map b/comfy/web/assets/index-CpICyVZm.js.map deleted file mode 100644 index 1bbb90571..000000000 --- a/comfy/web/assets/index-CpICyVZm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-CpICyVZm.js","sources":["../../src/extensions/core/clipspace.ts","../../src/extensions/core/contextMenuFilter.ts","../../src/extensions/core/dynamicPrompts.ts","../../src/extensions/core/editAttention.ts","../../src/extensions/core/electronAdapter.ts","../../src/extensions/core/groupNodeManage.ts","../../src/extensions/core/widgetInputs.ts","../../src/extensions/core/groupNode.ts","../../src/extensions/core/groupOptions.ts","../../src/components/load3d/Load3DControls.vue","../../src/components/load3d/LoadingOverlay.vue","../../../../../node_modules/three/build/three.module.js","../../src/extensions/core/load3d/CameraManager.ts","../../../../../node_modules/three/examples/jsm/controls/OrbitControls.js","../../src/extensions/core/load3d/ControlsManager.ts","../../src/extensions/core/load3d/EventManager.ts","../../src/extensions/core/load3d/LightingManager.ts","../../../../../node_modules/three/examples/jsm/libs/fflate.module.js","../../../../../node_modules/three/examples/jsm/curves/NURBSUtils.js","../../../../../node_modules/three/examples/jsm/curves/NURBSCurve.js","../../../../../node_modules/three/examples/jsm/loaders/FBXLoader.js","../../../../../node_modules/three/examples/jsm/utils/BufferGeometryUtils.js","../../../../../node_modules/three/examples/jsm/loaders/GLTFLoader.js","../../../../../node_modules/three/examples/jsm/loaders/MTLLoader.js","../../../../../node_modules/three/examples/jsm/loaders/OBJLoader.js","../../../../../node_modules/three/examples/jsm/loaders/STLLoader.js","../../src/extensions/core/load3d/LoaderManager.ts","../../src/extensions/core/load3d/ModelManager.ts","../../src/extensions/core/load3d/NodeStorage.ts","../../src/extensions/core/load3d/PreviewManager.ts","../../src/extensions/core/load3d/Load3dUtils.ts","../../src/extensions/core/load3d/SceneManager.ts","../../../../../node_modules/three/examples/jsm/helpers/ViewHelper.js","../../src/extensions/core/load3d/ViewHelperManager.ts","../../src/extensions/core/load3d/Load3d.ts","../../src/extensions/core/load3d/AnimationManager.ts","../../src/extensions/core/load3d/Load3dAnimation.ts","../../src/services/load3dService.ts","../../src/components/load3d/Load3DScene.vue","../../src/components/load3d/Load3D.vue","../../src/components/load3d/Load3DAnimationControls.vue","../../src/components/load3d/Load3DAnimationScene.vue","../../src/components/load3d/Load3DAnimation.vue","../../src/extensions/core/load3d/Load3DConfiguration.ts","../../src/extensions/core/load3d.ts","../../src/extensions/core/maskEditorOld.ts","../../src/extensions/core/maskeditor.ts","../../src/extensions/core/nodeTemplates.ts","../../src/extensions/core/noteNode.ts","../../src/extensions/core/rerouteNode.ts","../../src/extensions/core/saveImageExtraOutput.ts","../../src/extensions/core/simpleTouchSupport.ts","../../src/extensions/core/slotDefaults.ts","../../src/extensions/core/uploadAudio.ts","../../src/extensions/core/uploadImage.ts","../../src/extensions/core/webcamCapture.ts"],"sourcesContent":["import { app } from '../../scripts/app'\nimport { ComfyApp } from '../../scripts/app'\nimport { $el, ComfyDialog } from '../../scripts/ui'\n\nexport class ClipspaceDialog extends ComfyDialog {\n static items: Array<\n HTMLButtonElement & {\n contextPredicate?: () => boolean\n }\n > = []\n static instance: ClipspaceDialog | null = null\n\n static registerButton(\n name: string,\n contextPredicate: () => boolean,\n callback: () => void\n ) {\n const item = $el('button', {\n type: 'button',\n textContent: name,\n contextPredicate: contextPredicate,\n onclick: callback\n })\n\n ClipspaceDialog.items.push(item)\n }\n\n static invalidatePreview() {\n if (\n ComfyApp.clipspace &&\n ComfyApp.clipspace.imgs &&\n ComfyApp.clipspace.imgs.length > 0\n ) {\n const img_preview = document.getElementById(\n 'clipspace_preview'\n ) as HTMLImageElement\n if (img_preview) {\n img_preview.src =\n ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']].src\n img_preview.style.maxHeight = '100%'\n img_preview.style.maxWidth = '100%'\n }\n }\n }\n\n static invalidate() {\n if (ClipspaceDialog.instance) {\n const self = ClipspaceDialog.instance\n // allow reconstruct controls when copying from non-image to image content.\n const children = $el('div.comfy-modal-content', [\n self.createImgSettings(),\n ...self.createButtons()\n ])\n\n if (self.element) {\n // update\n if (self.element.firstChild) {\n self.element.removeChild(self.element.firstChild)\n }\n self.element.appendChild(children)\n } else {\n // new\n self.element = $el('div.comfy-modal', { parent: document.body }, [\n children\n ])\n }\n\n if (self.element.children[0].children.length <= 1) {\n self.element.children[0].appendChild(\n $el('p', {}, [\n 'Unable to find the features to edit content of a format stored in the current Clipspace.'\n ])\n )\n }\n\n ClipspaceDialog.invalidatePreview()\n }\n }\n\n constructor() {\n super()\n }\n\n createButtons() {\n const buttons = []\n\n for (let idx in ClipspaceDialog.items) {\n const item = ClipspaceDialog.items[idx]\n if (!item.contextPredicate || item.contextPredicate())\n buttons.push(ClipspaceDialog.items[idx])\n }\n\n buttons.push(\n $el('button', {\n type: 'button',\n textContent: 'Close',\n onclick: () => {\n this.close()\n }\n })\n )\n\n return buttons\n }\n\n createImgSettings() {\n if (ComfyApp.clipspace?.imgs) {\n const combo_items = []\n const imgs = ComfyApp.clipspace.imgs\n\n for (let i = 0; i < imgs.length; i++) {\n combo_items.push($el('option', { value: i }, [`${i}`]))\n }\n\n const combo1 = $el(\n 'select',\n {\n id: 'clipspace_img_selector',\n onchange: (event: Event) => {\n if (event.target && ComfyApp.clipspace) {\n ComfyApp.clipspace['selectedIndex'] = (\n event.target as HTMLSelectElement\n ).selectedIndex\n ClipspaceDialog.invalidatePreview()\n }\n }\n },\n combo_items\n )\n\n const row1 = $el('tr', {}, [\n $el('td', {}, [$el('font', { color: 'white' }, ['Select Image'])]),\n $el('td', {}, [combo1])\n ])\n\n const combo2 = $el(\n 'select',\n {\n id: 'clipspace_img_paste_mode',\n onchange: (event: Event) => {\n if (event.target && ComfyApp.clipspace) {\n ComfyApp.clipspace['img_paste_mode'] = (\n event.target as HTMLSelectElement\n ).value\n }\n }\n },\n [\n $el('option', { value: 'selected' }, 'selected'),\n $el('option', { value: 'all' }, 'all')\n ]\n ) as HTMLSelectElement\n combo2.value = ComfyApp.clipspace['img_paste_mode']\n\n const row2 = $el('tr', {}, [\n $el('td', {}, [$el('font', { color: 'white' }, ['Paste Mode'])]),\n $el('td', {}, [combo2])\n ])\n\n const td = $el(\n 'td',\n { align: 'center', width: '100px', height: '100px', colSpan: '2' },\n [$el('img', { id: 'clipspace_preview', ondragstart: () => false }, [])]\n )\n\n const row3 = $el('tr', {}, [td])\n\n return $el('table', {}, [row1, row2, row3])\n } else {\n return []\n }\n }\n\n createImgPreview() {\n if (ComfyApp.clipspace?.imgs) {\n return $el('img', { id: 'clipspace_preview', ondragstart: () => false })\n } else return []\n }\n\n show() {\n const img_preview = document.getElementById('clipspace_preview')\n ClipspaceDialog.invalidate()\n\n this.element.style.display = 'block'\n }\n}\n\napp.registerExtension({\n name: 'Comfy.Clipspace',\n init(app) {\n app.openClipspace = function () {\n if (!ClipspaceDialog.instance) {\n ClipspaceDialog.instance = new ClipspaceDialog()\n ComfyApp.clipspace_invalidate_handler = ClipspaceDialog.invalidate\n }\n\n if (ComfyApp.clipspace) {\n ClipspaceDialog.instance.show()\n } else app.ui.dialog.show('Clipspace is Empty!')\n }\n }\n})\n","import { LGraphCanvas, LiteGraph } from '@comfyorg/litegraph'\n\nimport { app } from '../../scripts/app'\n\n// Adds filtering to combo context menus\n\nconst ext = {\n name: 'Comfy.ContextMenuFilter',\n init() {\n const ctxMenu = LiteGraph.ContextMenu\n\n // @ts-expect-error TODO Very hacky way to modify Litegraph behaviour. Fix ctx later.\n LiteGraph.ContextMenu = function (values, options) {\n const ctx = new ctxMenu(values, options)\n\n // If we are a dark menu (only used for combo boxes) then add a filter input\n if (options?.className === 'dark' && values?.length > 4) {\n const filter = document.createElement('input')\n filter.classList.add('comfy-context-menu-filter')\n filter.placeholder = 'Filter list'\n\n ctx.root.prepend(filter)\n\n const items = Array.from(\n ctx.root.querySelectorAll('.litemenu-entry')\n ) as HTMLElement[]\n let displayedItems = [...items]\n let itemCount = displayedItems.length\n\n // We must request an animation frame for the current node of the active canvas to update.\n requestAnimationFrame(() => {\n const currentNode = LGraphCanvas.active_canvas.current_node\n const clickedComboValue = currentNode?.widgets\n ?.filter(\n (w) =>\n w.type === 'combo' && w.options.values?.length === values.length\n )\n .find((w) =>\n w.options.values?.every((v, i) => v === values[i])\n )?.value\n\n let selectedIndex = clickedComboValue\n ? values.findIndex((v: string) => v === clickedComboValue)\n : 0\n if (selectedIndex < 0) {\n selectedIndex = 0\n }\n let selectedItem = displayedItems[selectedIndex]\n updateSelected()\n\n // Apply highlighting to the selected item\n function updateSelected() {\n selectedItem?.style.setProperty('background-color', '')\n selectedItem?.style.setProperty('color', '')\n selectedItem = displayedItems[selectedIndex]\n selectedItem?.style.setProperty(\n 'background-color',\n '#ccc',\n 'important'\n )\n selectedItem?.style.setProperty('color', '#000', 'important')\n }\n\n const positionList = () => {\n const rect = ctx.root.getBoundingClientRect()\n\n // If the top is off-screen then shift the element with scaling applied\n if (rect.top < 0) {\n const scale =\n 1 -\n ctx.root.getBoundingClientRect().height / ctx.root.clientHeight\n\n const shift = (ctx.root.clientHeight * scale) / 2\n\n ctx.root.style.top = -shift + 'px'\n }\n }\n\n // Arrow up/down to select items\n filter.addEventListener('keydown', (event) => {\n switch (event.key) {\n case 'ArrowUp':\n event.preventDefault()\n if (selectedIndex === 0) {\n selectedIndex = itemCount - 1\n } else {\n selectedIndex--\n }\n updateSelected()\n break\n case 'ArrowRight':\n event.preventDefault()\n selectedIndex = itemCount - 1\n updateSelected()\n break\n case 'ArrowDown':\n event.preventDefault()\n if (selectedIndex === itemCount - 1) {\n selectedIndex = 0\n } else {\n selectedIndex++\n }\n updateSelected()\n break\n case 'ArrowLeft':\n event.preventDefault()\n selectedIndex = 0\n updateSelected()\n break\n case 'Enter':\n selectedItem?.click()\n break\n case 'Escape':\n ctx.close()\n break\n }\n })\n\n filter.addEventListener('input', () => {\n // Hide all items that don't match our filter\n const term = filter.value.toLocaleLowerCase()\n // When filtering, recompute which items are visible for arrow up/down and maintain selection.\n displayedItems = items.filter((item) => {\n const isVisible =\n !term || item.textContent?.toLocaleLowerCase().includes(term)\n item.style.display = isVisible ? 'block' : 'none'\n return isVisible\n })\n\n selectedIndex = 0\n if (displayedItems.includes(selectedItem)) {\n selectedIndex = displayedItems.findIndex(\n (d) => d === selectedItem\n )\n }\n itemCount = displayedItems.length\n\n updateSelected()\n\n // If we have an event then we can try and position the list under the source\n if (options.event) {\n let top = options.event.clientY - 10\n\n const bodyRect = document.body.getBoundingClientRect()\n\n const rootRect = ctx.root.getBoundingClientRect()\n if (\n bodyRect.height &&\n top > bodyRect.height - rootRect.height - 10\n ) {\n top = Math.max(0, bodyRect.height - rootRect.height - 10)\n }\n\n ctx.root.style.top = top + 'px'\n positionList()\n }\n })\n\n requestAnimationFrame(() => {\n // Focus the filter box when opening\n filter.focus()\n\n positionList()\n })\n })\n }\n\n return ctx\n }\n\n LiteGraph.ContextMenu.prototype = ctxMenu.prototype\n }\n}\n\napp.registerExtension(ext)\n","import { useExtensionService } from '@/services/extensionService'\nimport { processDynamicPrompt } from '@/utils/formatUtil'\n\n// Allows for simple dynamic prompt replacement\n// Inputs in the format {a|b} will have a random value of a or b chosen when the prompt is queued.\n\nuseExtensionService().registerExtension({\n name: 'Comfy.DynamicPrompts',\n nodeCreated(node) {\n if (node.widgets) {\n // Locate dynamic prompt text widgets\n // Include any widgets with dynamicPrompts set to true, and customtext\n const widgets = node.widgets.filter((w) => w.dynamicPrompts)\n for (const widget of widgets) {\n // Override the serialization of the value to resolve dynamic prompts for all widgets supporting it in this node\n widget.serializeValue = (workflowNode, widgetIndex) => {\n if (typeof widget.value !== 'string') return widget.value\n\n const prompt = processDynamicPrompt(widget.value)\n\n // Overwrite the value in the serialized workflow pnginfo\n if (workflowNode?.widgets_values)\n workflowNode.widgets_values[widgetIndex] = prompt\n\n return prompt\n }\n }\n }\n }\n})\n","import { app } from '../../scripts/app'\n\n// Allows you to edit the attention weight by holding ctrl (or cmd) and using the up/down arrow keys\n\napp.registerExtension({\n name: 'Comfy.EditAttention',\n init() {\n const editAttentionDelta = app.ui.settings.addSetting({\n id: 'Comfy.EditAttention.Delta',\n category: ['Comfy', 'EditTokenWeight', 'Delta'],\n name: 'Ctrl+up/down precision',\n type: 'slider',\n attrs: {\n min: 0.01,\n max: 0.5,\n step: 0.01\n },\n defaultValue: 0.05\n })\n\n function incrementWeight(weight: string, delta: number): string {\n const floatWeight = parseFloat(weight)\n if (isNaN(floatWeight)) return weight\n const newWeight = floatWeight + delta\n return String(Number(newWeight.toFixed(10)))\n }\n\n type Enclosure = {\n start: number\n end: number\n }\n\n function findNearestEnclosure(\n text: string,\n cursorPos: number\n ): Enclosure | null {\n let start = cursorPos,\n end = cursorPos\n let openCount = 0,\n closeCount = 0\n\n // Find opening parenthesis before cursor\n while (start >= 0) {\n start--\n if (text[start] === '(' && openCount === closeCount) break\n if (text[start] === '(') openCount++\n if (text[start] === ')') closeCount++\n }\n if (start < 0) return null\n\n openCount = 0\n closeCount = 0\n\n // Find closing parenthesis after cursor\n while (end < text.length) {\n if (text[end] === ')' && openCount === closeCount) break\n if (text[end] === '(') openCount++\n if (text[end] === ')') closeCount++\n end++\n }\n if (end === text.length) return null\n\n return { start: start + 1, end: end }\n }\n\n function addWeightToParentheses(text: string): string {\n const parenRegex = /^\\((.*)\\)$/\n const parenMatch = text.match(parenRegex)\n\n const floatRegex = /:([+-]?(\\d*\\.)?\\d+([eE][+-]?\\d+)?)/\n const floatMatch = text.match(floatRegex)\n\n if (parenMatch && !floatMatch) {\n return `(${parenMatch[1]}:1.0)`\n } else {\n return text\n }\n }\n\n function editAttention(event: KeyboardEvent) {\n // @ts-expect-error Runtime narrowing not impl.\n const inputField: HTMLTextAreaElement = event.composedPath()[0]\n const delta = parseFloat(editAttentionDelta.value)\n\n if (inputField.tagName !== 'TEXTAREA') return\n if (!(event.key === 'ArrowUp' || event.key === 'ArrowDown')) return\n if (!event.ctrlKey && !event.metaKey) return\n\n event.preventDefault()\n\n let start = inputField.selectionStart\n let end = inputField.selectionEnd\n let selectedText = inputField.value.substring(start, end)\n\n // If there is no selection, attempt to find the nearest enclosure, or select the current word\n if (!selectedText) {\n const nearestEnclosure = findNearestEnclosure(inputField.value, start)\n if (nearestEnclosure) {\n start = nearestEnclosure.start\n end = nearestEnclosure.end\n selectedText = inputField.value.substring(start, end)\n } else {\n // Select the current word, find the start and end of the word\n const delimiters = ' .,\\\\/!?%^*;:{}=-_`~()\\r\\n\\t'\n\n while (\n !delimiters.includes(inputField.value[start - 1]) &&\n start > 0\n ) {\n start--\n }\n\n while (\n !delimiters.includes(inputField.value[end]) &&\n end < inputField.value.length\n ) {\n end++\n }\n\n selectedText = inputField.value.substring(start, end)\n if (!selectedText) return\n }\n }\n\n // If the selection ends with a space, remove it\n if (selectedText[selectedText.length - 1] === ' ') {\n selectedText = selectedText.substring(0, selectedText.length - 1)\n end -= 1\n }\n\n // If there are parentheses left and right of the selection, select them\n if (\n inputField.value[start - 1] === '(' &&\n inputField.value[end] === ')'\n ) {\n start -= 1\n end += 1\n selectedText = inputField.value.substring(start, end)\n }\n\n // If the selection is not enclosed in parentheses, add them\n if (\n selectedText[0] !== '(' ||\n selectedText[selectedText.length - 1] !== ')'\n ) {\n selectedText = `(${selectedText})`\n }\n\n // If the selection does not have a weight, add a weight of 1.0\n selectedText = addWeightToParentheses(selectedText)\n\n // Increment the weight\n const weightDelta = event.key === 'ArrowUp' ? delta : -delta\n const updatedText = selectedText.replace(\n /\\((.*):([+-]?\\d+(?:\\.\\d+)?)\\)/,\n (match, text, weight) => {\n weight = incrementWeight(weight, weightDelta)\n if (weight == 1) {\n return text\n } else {\n return `(${text}:${weight})`\n }\n }\n )\n\n inputField.setSelectionRange(start, end)\n // Intentional use of deprecated: https://developer.mozilla.org/docs/Web/API/Document/execCommand#using_inserttext\n document.execCommand('insertText', false, updatedText)\n inputField.setSelectionRange(start, start + updatedText.length)\n }\n window.addEventListener('keydown', editAttention)\n }\n})\n","import { PYTHON_MIRROR } from '@/constants/uvMirrors'\nimport { t } from '@/i18n'\nimport { app } from '@/scripts/app'\nimport { useDialogService } from '@/services/dialogService'\nimport { useWorkflowStore } from '@/stores/workflowStore'\nimport { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'\nimport { checkMirrorReachable } from '@/utils/networkUtil'\n\n;(async () => {\n if (!isElectron()) return\n\n const electronAPI = getElectronAPI()\n const desktopAppVersion = await electronAPI.getElectronVersion()\n const workflowStore = useWorkflowStore()\n\n const onChangeRestartApp = (newValue: string, oldValue: string) => {\n // Add a delay to allow changes to take effect before restarting.\n if (oldValue !== undefined && newValue !== oldValue) {\n electronAPI.restartApp('Restart ComfyUI to apply changes.', 1500)\n }\n }\n\n app.registerExtension({\n name: 'Comfy.ElectronAdapter',\n settings: [\n {\n id: 'Comfy-Desktop.AutoUpdate',\n category: ['Comfy-Desktop', 'General', 'AutoUpdate'],\n name: 'Automatically check for updates',\n type: 'boolean',\n defaultValue: true,\n onChange: onChangeRestartApp\n },\n {\n id: 'Comfy-Desktop.SendStatistics',\n category: ['Comfy-Desktop', 'General', 'Send Statistics'],\n name: 'Send anonymous usage metrics',\n type: 'boolean',\n defaultValue: true,\n onChange: onChangeRestartApp\n },\n {\n id: 'Comfy-Desktop.WindowStyle',\n category: ['Comfy-Desktop', 'General', 'Window Style'],\n name: 'Window Style',\n tooltip: \"Custom: Replace the system title bar with ComfyUI's Top menu\",\n type: 'combo',\n experimental: true,\n defaultValue: 'default',\n options: ['default', 'custom'],\n onChange: (\n newValue: 'default' | 'custom',\n oldValue?: 'default' | 'custom'\n ) => {\n if (!oldValue) return\n\n electronAPI.Config.setWindowStyle(newValue)\n }\n },\n {\n id: 'Comfy-Desktop.UV.PythonInstallMirror',\n name: 'Python Install Mirror',\n tooltip: `Managed Python installations are downloaded from the Astral python-build-standalone project. This variable can be set to a mirror URL to use a different source for Python installations. The provided URL will replace https://github.com/astral-sh/python-build-standalone/releases/download in, e.g., https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz. Distributions can be read from a local directory by using the file:// URL scheme.`,\n type: 'url',\n defaultValue: '',\n attrs: {\n validateUrlFn(mirror: string) {\n return checkMirrorReachable(\n mirror + PYTHON_MIRROR.validationPathSuffix\n )\n }\n }\n },\n {\n id: 'Comfy-Desktop.UV.PypiInstallMirror',\n name: 'Pypi Install Mirror',\n tooltip: `Default pip install mirror`,\n type: 'url',\n defaultValue: '',\n attrs: {\n validateUrlFn: checkMirrorReachable\n }\n },\n {\n id: 'Comfy-Desktop.UV.TorchInstallMirror',\n name: 'Torch Install Mirror',\n tooltip: `Pip install mirror for pytorch`,\n type: 'url',\n defaultValue: '',\n attrs: {\n validateUrlFn: checkMirrorReachable\n }\n }\n ],\n\n commands: [\n {\n id: 'Comfy-Desktop.Folders.OpenLogsFolder',\n label: 'Open Logs Folder',\n icon: 'pi pi-folder-open',\n function() {\n electronAPI.openLogsFolder()\n }\n },\n {\n id: 'Comfy-Desktop.Folders.OpenModelsFolder',\n label: 'Open Models Folder',\n icon: 'pi pi-folder-open',\n function() {\n electronAPI.openModelsFolder()\n }\n },\n {\n id: 'Comfy-Desktop.Folders.OpenOutputsFolder',\n label: 'Open Outputs Folder',\n icon: 'pi pi-folder-open',\n function() {\n electronAPI.openOutputsFolder()\n }\n },\n {\n id: 'Comfy-Desktop.Folders.OpenInputsFolder',\n label: 'Open Inputs Folder',\n icon: 'pi pi-folder-open',\n function() {\n electronAPI.openInputsFolder()\n }\n },\n {\n id: 'Comfy-Desktop.Folders.OpenCustomNodesFolder',\n label: 'Open Custom Nodes Folder',\n icon: 'pi pi-folder-open',\n function() {\n electronAPI.openCustomNodesFolder()\n }\n },\n {\n id: 'Comfy-Desktop.Folders.OpenModelConfig',\n label: 'Open extra_model_paths.yaml',\n icon: 'pi pi-file',\n function() {\n electronAPI.openModelConfig()\n }\n },\n {\n id: 'Comfy-Desktop.OpenDevTools',\n label: 'Open DevTools',\n icon: 'pi pi-code',\n function() {\n electronAPI.openDevTools()\n }\n },\n {\n id: 'Comfy-Desktop.OpenUserGuide',\n label: 'Desktop User Guide',\n icon: 'pi pi-book',\n function() {\n window.open('https://comfyorg.notion.site/', '_blank')\n }\n },\n {\n id: 'Comfy-Desktop.Reinstall',\n label: 'Reinstall',\n icon: 'pi pi-refresh',\n async function() {\n const proceed = await useDialogService().confirm({\n message: t('desktopMenu.confirmReinstall'),\n title: t('desktopMenu.reinstall'),\n type: 'reinstall'\n })\n\n if (proceed) electronAPI.reinstall()\n }\n },\n {\n id: 'Comfy-Desktop.Restart',\n label: 'Restart',\n icon: 'pi pi-refresh',\n function() {\n electronAPI.restartApp()\n }\n },\n {\n id: 'Comfy-Desktop.Quit',\n label: 'Quit',\n icon: 'pi pi-sign-out',\n async function() {\n // Confirm if unsaved workflows are open\n if (workflowStore.modifiedWorkflows.length > 0) {\n const confirmed = await useDialogService().confirm({\n message: t('desktopMenu.confirmQuit'),\n title: t('desktopMenu.quit'),\n type: 'default'\n })\n\n if (!confirmed) return\n }\n\n electronAPI.quit()\n }\n }\n ],\n\n menuCommands: [\n {\n path: ['Help'],\n commands: ['Comfy-Desktop.OpenUserGuide']\n },\n {\n path: ['Help'],\n commands: ['Comfy-Desktop.OpenDevTools']\n },\n {\n path: ['Help', 'Open Folder'],\n commands: [\n 'Comfy-Desktop.Folders.OpenLogsFolder',\n 'Comfy-Desktop.Folders.OpenModelsFolder',\n 'Comfy-Desktop.Folders.OpenOutputsFolder',\n 'Comfy-Desktop.Folders.OpenInputsFolder',\n 'Comfy-Desktop.Folders.OpenCustomNodesFolder',\n 'Comfy-Desktop.Folders.OpenModelConfig'\n ]\n },\n {\n path: ['Help'],\n commands: ['Comfy-Desktop.Reinstall']\n }\n ],\n\n keybindings: [\n {\n commandId: 'Workspace.CloseWorkflow',\n combo: {\n key: 'w',\n ctrl: true\n }\n }\n ],\n\n aboutPageBadges: [\n {\n label: 'ComfyUI_desktop v' + desktopAppVersion,\n url: 'https://github.com/Comfy-Org/electron',\n icon: 'pi pi-github'\n }\n ]\n })\n})()\n","// @ts-strict-ignore\nimport {\n type LGraphNode,\n type LGraphNodeConstructor,\n LiteGraph\n} from '@comfyorg/litegraph'\n\nimport { useToastStore } from '@/stores/toastStore'\n\nimport { type ComfyApp, app } from '../../scripts/app'\nimport { $el, ComfyDialog } from '../../scripts/ui'\nimport { DraggableList } from '../../scripts/ui/draggableList'\nimport { GroupNodeConfig, GroupNodeHandler } from './groupNode'\nimport './groupNodeManage.css'\n\nconst ORDER: symbol = Symbol()\nconst PREFIX = 'workflow'\nconst SEPARATOR = '>'\n\nfunction merge(target, source) {\n if (typeof target === 'object' && typeof source === 'object') {\n for (const key in source) {\n const sv = source[key]\n if (typeof sv === 'object') {\n let tv = target[key]\n if (!tv) tv = target[key] = {}\n merge(tv, source[key])\n } else {\n target[key] = sv\n }\n }\n }\n\n return target\n}\n\nexport class ManageGroupDialog extends ComfyDialog {\n tabs: Record<\n 'Inputs' | 'Outputs' | 'Widgets',\n { tab: HTMLAnchorElement; page: HTMLElement }\n >\n selectedNodeIndex: number | null | undefined\n selectedTab: keyof ManageGroupDialog['tabs'] = 'Inputs'\n selectedGroup: string | undefined\n modifications: Record<\n string,\n Record<\n string,\n Record<\n string,\n { name?: string | undefined; visible?: boolean | undefined }\n >\n >\n > = {}\n nodeItems: any[]\n app: ComfyApp\n groupNodeType: LGraphNodeConstructor\n groupNodeDef: any\n groupData: any\n\n innerNodesList: HTMLUListElement\n widgetsPage: HTMLElement\n inputsPage: HTMLElement\n outputsPage: HTMLElement\n draggable: any\n\n get selectedNodeInnerIndex() {\n return +this.nodeItems[this.selectedNodeIndex].dataset.nodeindex\n }\n\n constructor(app) {\n super()\n this.app = app\n this.element = $el('dialog.comfy-group-manage', {\n parent: document.body\n }) as HTMLDialogElement\n }\n\n changeTab(tab) {\n this.tabs[this.selectedTab].tab.classList.remove('active')\n this.tabs[this.selectedTab].page.classList.remove('active')\n this.tabs[tab].tab.classList.add('active')\n this.tabs[tab].page.classList.add('active')\n this.selectedTab = tab\n }\n\n changeNode(index, force?) {\n if (!force && this.selectedNodeIndex === index) return\n\n if (this.selectedNodeIndex != null) {\n this.nodeItems[this.selectedNodeIndex].classList.remove('selected')\n }\n this.nodeItems[index].classList.add('selected')\n this.selectedNodeIndex = index\n\n if (!this.buildInputsPage() && this.selectedTab === 'Inputs') {\n this.changeTab('Widgets')\n }\n if (!this.buildWidgetsPage() && this.selectedTab === 'Widgets') {\n this.changeTab('Outputs')\n }\n if (!this.buildOutputsPage() && this.selectedTab === 'Outputs') {\n this.changeTab('Inputs')\n }\n\n this.changeTab(this.selectedTab)\n }\n\n getGroupData() {\n this.groupNodeType =\n LiteGraph.registered_node_types[\n `${PREFIX}${SEPARATOR}` + this.selectedGroup\n ]\n this.groupNodeDef = this.groupNodeType.nodeData\n this.groupData = GroupNodeHandler.getGroupData(this.groupNodeType)\n }\n\n changeGroup(group, reset = true) {\n this.selectedGroup = group\n this.getGroupData()\n\n const nodes = this.groupData.nodeData.nodes\n this.nodeItems = nodes.map((n, i) =>\n $el(\n 'li.draggable-item',\n {\n dataset: {\n nodeindex: n.index + ''\n },\n onclick: () => {\n this.changeNode(i)\n }\n },\n [\n $el('span.drag-handle'),\n $el(\n 'div',\n {\n textContent: n.title ?? n.type\n },\n n.title\n ? $el('span', {\n textContent: n.type\n })\n : []\n )\n ]\n )\n )\n\n this.innerNodesList.replaceChildren(...this.nodeItems)\n\n if (reset) {\n this.selectedNodeIndex = null\n this.changeNode(0)\n } else {\n const items = this.draggable.getAllItems()\n let index = items.findIndex((item) => item.classList.contains('selected'))\n if (index === -1) index = this.selectedNodeIndex\n this.changeNode(index, true)\n }\n\n const ordered = [...nodes]\n this.draggable?.dispose()\n this.draggable = new DraggableList(this.innerNodesList, 'li')\n this.draggable.addEventListener(\n 'dragend',\n ({ detail: { oldPosition, newPosition } }) => {\n if (oldPosition === newPosition) return\n ordered.splice(newPosition, 0, ordered.splice(oldPosition, 1)[0])\n for (let i = 0; i < ordered.length; i++) {\n this.storeModification({\n nodeIndex: ordered[i].index,\n section: ORDER,\n prop: 'order',\n value: i\n })\n }\n }\n )\n }\n\n storeModification(props: {\n nodeIndex?: number\n section: symbol\n prop: string\n value: any\n }) {\n const { nodeIndex, section, prop, value } = props\n const groupMod = (this.modifications[this.selectedGroup] ??= {})\n const nodesMod = (groupMod.nodes ??= {})\n const nodeMod = (nodesMod[nodeIndex ?? this.selectedNodeInnerIndex] ??= {})\n const typeMod = (nodeMod[section] ??= {})\n if (typeof value === 'object') {\n const objMod = (typeMod[prop] ??= {})\n Object.assign(objMod, value)\n } else {\n typeMod[prop] = value\n }\n }\n\n getEditElement(section, prop, value, placeholder, checked, checkable = true) {\n if (value === placeholder) value = ''\n\n const mods =\n this.modifications[this.selectedGroup]?.nodes?.[\n this.selectedNodeInnerIndex\n ]?.[section]?.[prop]\n if (mods) {\n if (mods.name != null) {\n value = mods.name\n }\n if (mods.visible != null) {\n checked = mods.visible\n }\n }\n\n return $el('div', [\n $el('input', {\n value,\n placeholder,\n type: 'text',\n onchange: (e) => {\n this.storeModification({\n section,\n prop,\n value: { name: e.target.value }\n })\n }\n }),\n $el('label', { textContent: 'Visible' }, [\n $el('input', {\n type: 'checkbox',\n checked,\n disabled: !checkable,\n onchange: (e) => {\n this.storeModification({\n section,\n prop,\n value: { visible: !!e.target.checked }\n })\n }\n })\n ])\n ])\n }\n\n buildWidgetsPage() {\n const widgets =\n this.groupData.oldToNewWidgetMap[this.selectedNodeInnerIndex]\n const items = Object.keys(widgets ?? {})\n const type = app.graph.extra.groupNodes[this.selectedGroup]\n const config = type.config?.[this.selectedNodeInnerIndex]?.input\n this.widgetsPage.replaceChildren(\n ...items.map((oldName) => {\n return this.getEditElement(\n 'input',\n oldName,\n widgets[oldName],\n oldName,\n config?.[oldName]?.visible !== false\n )\n })\n )\n return !!items.length\n }\n\n buildInputsPage() {\n const inputs = this.groupData.nodeInputs[this.selectedNodeInnerIndex]\n const items = Object.keys(inputs ?? {})\n const type = app.graph.extra.groupNodes[this.selectedGroup]\n const config = type.config?.[this.selectedNodeInnerIndex]?.input\n this.inputsPage.replaceChildren(\n ...items\n .map((oldName) => {\n let value = inputs[oldName]\n if (!value) {\n return\n }\n\n return this.getEditElement(\n 'input',\n oldName,\n value,\n oldName,\n config?.[oldName]?.visible !== false\n )\n })\n .filter(Boolean)\n )\n return !!items.length\n }\n\n buildOutputsPage() {\n const nodes = this.groupData.nodeData.nodes\n const innerNodeDef = this.groupData.getNodeDef(\n nodes[this.selectedNodeInnerIndex]\n )\n const outputs = innerNodeDef?.output ?? []\n const groupOutputs =\n this.groupData.oldToNewOutputMap[this.selectedNodeInnerIndex]\n\n const type = app.graph.extra.groupNodes[this.selectedGroup]\n const config = type.config?.[this.selectedNodeInnerIndex]?.output\n const node = this.groupData.nodeData.nodes[this.selectedNodeInnerIndex]\n const checkable = node.type !== 'PrimitiveNode'\n this.outputsPage.replaceChildren(\n ...outputs\n .map((type, slot) => {\n const groupOutputIndex = groupOutputs?.[slot]\n const oldName = innerNodeDef.output_name?.[slot] ?? type\n let value = config?.[slot]?.name\n const visible = config?.[slot]?.visible || groupOutputIndex != null\n if (!value || value === oldName) {\n value = ''\n }\n return this.getEditElement(\n 'output',\n slot,\n value,\n oldName,\n visible,\n checkable\n )\n })\n .filter(Boolean)\n )\n return !!outputs.length\n }\n\n show(type?) {\n const groupNodes = Object.keys(app.graph.extra?.groupNodes ?? {}).sort(\n (a, b) => a.localeCompare(b)\n )\n\n this.innerNodesList = $el(\n 'ul.comfy-group-manage-list-items'\n ) as HTMLUListElement\n this.widgetsPage = $el('section.comfy-group-manage-node-page')\n this.inputsPage = $el('section.comfy-group-manage-node-page')\n this.outputsPage = $el('section.comfy-group-manage-node-page')\n const pages = $el('div', [\n this.widgetsPage,\n this.inputsPage,\n this.outputsPage\n ])\n\n this.tabs = [\n ['Inputs', this.inputsPage],\n ['Widgets', this.widgetsPage],\n ['Outputs', this.outputsPage]\n ].reduce((p, [name, page]: [string, HTMLElement]) => {\n p[name] = {\n tab: $el('a', {\n onclick: () => {\n this.changeTab(name)\n },\n textContent: name\n }),\n page\n }\n return p\n }, {}) as any\n\n const outer = $el('div.comfy-group-manage-outer', [\n $el('header', [\n $el('h2', 'Group Nodes'),\n $el(\n 'select',\n {\n onchange: (e) => {\n this.changeGroup(e.target.value)\n }\n },\n groupNodes.map((g) =>\n $el('option', {\n textContent: g,\n selected: `${PREFIX}${SEPARATOR}${g}` === type,\n value: g\n })\n )\n )\n ]),\n $el('main', [\n $el('section.comfy-group-manage-list', this.innerNodesList),\n $el('section.comfy-group-manage-node', [\n $el(\n 'header',\n Object.values(this.tabs).map((t) => t.tab)\n ),\n pages\n ])\n ]),\n $el('footer', [\n $el(\n 'button.comfy-btn',\n {\n onclick: (e) => {\n const node = app.graph.nodes.find(\n (n) => n.type === `${PREFIX}${SEPARATOR}` + this.selectedGroup\n )\n if (node) {\n useToastStore().addAlert(\n 'This group node is in use in the current workflow, please first remove these.'\n )\n return\n }\n if (\n confirm(\n `Are you sure you want to remove the node: \"${this.selectedGroup}\"`\n )\n ) {\n delete app.graph.extra.groupNodes[this.selectedGroup]\n LiteGraph.unregisterNodeType(\n `${PREFIX}${SEPARATOR}` + this.selectedGroup\n )\n }\n this.show()\n }\n },\n 'Delete Group Node'\n ),\n $el(\n 'button.comfy-btn',\n {\n onclick: async () => {\n let nodesByType\n let recreateNodes = []\n const types = {}\n for (const g in this.modifications) {\n const type = app.graph.extra.groupNodes[g]\n let config = (type.config ??= {})\n\n let nodeMods = this.modifications[g]?.nodes\n if (nodeMods) {\n const keys = Object.keys(nodeMods)\n if (nodeMods[keys[0]][ORDER]) {\n // If any node is reordered, they will all need sequencing\n const orderedNodes = []\n const orderedMods = {}\n const orderedConfig = {}\n\n for (const n of keys) {\n const order = nodeMods[n][ORDER].order\n orderedNodes[order] = type.nodes[+n]\n orderedMods[order] = nodeMods[n]\n orderedNodes[order].index = order\n }\n\n // Rewrite links\n for (const l of type.links) {\n if (l[0] != null) l[0] = type.nodes[l[0]].index\n if (l[2] != null) l[2] = type.nodes[l[2]].index\n }\n\n // Rewrite externals\n if (type.external) {\n for (const ext of type.external) {\n ext[0] = type.nodes[ext[0]]\n }\n }\n\n // Rewrite modifications\n for (const id of keys) {\n if (config[id]) {\n orderedConfig[type.nodes[id].index] = config[id]\n }\n delete config[id]\n }\n\n type.nodes = orderedNodes\n nodeMods = orderedMods\n type.config = config = orderedConfig\n }\n\n merge(config, nodeMods)\n }\n\n types[g] = type\n\n if (!nodesByType) {\n nodesByType = app.graph.nodes.reduce((p, n) => {\n p[n.type] ??= []\n p[n.type].push(n)\n return p\n }, {})\n }\n\n const nodes = nodesByType[`${PREFIX}${SEPARATOR}` + g]\n if (nodes) recreateNodes.push(...nodes)\n }\n\n await GroupNodeConfig.registerFromWorkflow(types, {})\n\n for (const node of recreateNodes) {\n node.recreate()\n }\n\n this.modifications = {}\n this.app.graph.setDirtyCanvas(true, true)\n this.changeGroup(this.selectedGroup, false)\n }\n },\n 'Save'\n ),\n $el(\n 'button.comfy-btn',\n { onclick: () => this.element.close() },\n 'Close'\n )\n ])\n ])\n\n this.element.replaceChildren(outer)\n this.changeGroup(\n type\n ? groupNodes.find((g) => `${PREFIX}${SEPARATOR}${g}` === type) ??\n groupNodes[0]\n : groupNodes[0]\n )\n this.element.showModal()\n\n this.element.addEventListener('close', () => {\n this.draggable?.dispose()\n this.element.remove()\n })\n }\n}\n","// @ts-strict-ignore\nimport { LGraphNode, LiteGraph } from '@comfyorg/litegraph'\nimport type {\n INodeInputSlot,\n IWidget,\n LiteGraphCanvasEvent\n} from '@comfyorg/litegraph'\nimport type { IFoundSlot } from '@comfyorg/litegraph'\nimport { INodeSlot } from '@comfyorg/litegraph'\n\nimport { useNodeDefStore } from '@/stores/nodeDefStore'\nimport { useSettingStore } from '@/stores/settingStore'\nimport type { InputSpec } from '@/types/apiTypes'\n\nimport { app } from '../../scripts/app'\nimport { applyTextReplacements } from '../../scripts/utils'\nimport { ComfyWidgets, addValueControlWidgets } from '../../scripts/widgets'\n\nconst CONVERTED_TYPE = 'converted-widget'\nconst VALID_TYPES = [\n 'STRING',\n 'combo',\n 'number',\n 'toggle',\n 'BOOLEAN',\n 'text',\n 'string'\n]\nconst CONFIG = Symbol()\nconst GET_CONFIG = Symbol()\nconst TARGET = Symbol() // Used for reroutes to specify the real target widget\n\ninterface PrimitiveNode extends LGraphNode {}\n\nconst replacePropertyName = 'Run widget replace on values'\nclass PrimitiveNode extends LGraphNode {\n controlValues: any[]\n lastType: string\n static category: string\n constructor(title?: string) {\n super(title)\n this.addOutput('connect to widget input', '*')\n this.serialize_widgets = true\n this.isVirtualNode = true\n\n if (!this.properties || !(replacePropertyName in this.properties)) {\n this.addProperty(replacePropertyName, false, 'boolean')\n }\n }\n\n applyToGraph(extraLinks = []) {\n if (!this.outputs[0].links?.length) return\n\n function get_links(node) {\n let links = []\n for (const l of node.outputs[0].links) {\n const linkInfo = app.graph.links[l]\n const n = node.graph.getNodeById(linkInfo.target_id)\n if (n.type == 'Reroute') {\n links = links.concat(get_links(n))\n } else {\n links.push(l)\n }\n }\n return links\n }\n\n let links = [\n ...get_links(this).map((l) => app.graph.links[l]),\n ...extraLinks\n ]\n let v = this.widgets?.[0].value\n if (v && this.properties[replacePropertyName]) {\n v = applyTextReplacements(app, v as string)\n }\n\n // For each output link copy our value over the original widget value\n for (const linkInfo of links) {\n const node = this.graph.getNodeById(linkInfo.target_id)\n const input = node.inputs[linkInfo.target_slot]\n let widget\n if (input.widget[TARGET]) {\n widget = input.widget[TARGET]\n } else {\n const widgetName = (input.widget as { name: string }).name\n if (widgetName) {\n widget = node.widgets.find((w) => w.name === widgetName)\n }\n }\n\n if (widget) {\n widget.value = v\n if (widget.callback) {\n widget.callback(\n widget.value,\n app.canvas,\n node,\n app.canvas.graph_mouse,\n {}\n )\n }\n }\n }\n }\n\n refreshComboInNode() {\n const widget = this.widgets?.[0]\n if (widget?.type === 'combo') {\n widget.options.values = this.outputs[0].widget[GET_CONFIG]()[0]\n\n if (!widget.options.values.includes(widget.value as string)) {\n widget.value = widget.options.values[0]\n ;(widget.callback as Function)(widget.value)\n }\n }\n }\n\n onAfterGraphConfigured() {\n if (this.outputs[0].links?.length && !this.widgets?.length) {\n // TODO: Review this check\n // @ts-expect-error\n if (!this.#onFirstConnection()) return\n\n // Populate widget values from config data\n if (this.widgets) {\n for (let i = 0; i < this.widgets_values.length; i++) {\n const w = this.widgets[i]\n if (w) {\n // @ts-expect-error change widget type from string to unknown\n w.value = this.widgets_values[i]\n }\n }\n }\n\n // Merge values if required\n this.#mergeWidgetConfig()\n }\n }\n\n onConnectionsChange(_, index, connected) {\n if (app.configuringGraph) {\n // Dont run while the graph is still setting up\n return\n }\n\n const links = this.outputs[0].links\n if (connected) {\n if (links?.length && !this.widgets?.length) {\n this.#onFirstConnection()\n }\n } else {\n // We may have removed a link that caused the constraints to change\n this.#mergeWidgetConfig()\n\n if (!links?.length) {\n this.onLastDisconnect()\n }\n }\n }\n\n onConnectOutput(slot, type, input, target_node, target_slot) {\n // Fires before the link is made allowing us to reject it if it isn't valid\n // No widget, we cant connect\n if (!input.widget) {\n if (!(input.type in ComfyWidgets)) return false\n }\n\n if (this.outputs[slot].links?.length) {\n const valid = this.#isValidConnection(input)\n if (valid) {\n // On connect of additional outputs, copy our value to their widget\n this.applyToGraph([{ target_id: target_node.id, target_slot }])\n }\n return valid\n }\n }\n\n #onFirstConnection(recreating?: boolean) {\n // First connection can fire before the graph is ready on initial load so random things can be missing\n if (!this.outputs[0].links) {\n this.onLastDisconnect()\n return\n }\n const linkId = this.outputs[0].links[0]\n const link = this.graph.links[linkId]\n if (!link) return\n\n const theirNode = this.graph.getNodeById(link.target_id)\n if (!theirNode || !theirNode.inputs) return\n\n const input = theirNode.inputs[link.target_slot]\n if (!input) return\n\n let widget\n if (!input.widget) {\n if (!(input.type in ComfyWidgets)) return\n widget = { name: input.name, [GET_CONFIG]: () => [input.type, {}] } //fake widget\n } else {\n widget = input.widget\n }\n\n const config = widget[GET_CONFIG]?.()\n if (!config) return\n\n const { type } = getWidgetType(config)\n // Update our output to restrict to the widget type\n this.outputs[0].type = type\n this.outputs[0].name = type\n this.outputs[0].widget = widget\n\n this.#createWidget(\n widget[CONFIG] ?? config,\n theirNode,\n widget.name,\n recreating,\n widget[TARGET]\n )\n }\n\n #createWidget(inputData, node, widgetName, recreating, targetWidget) {\n let type = inputData[0]\n\n if (type instanceof Array) {\n type = 'COMBO'\n }\n\n // Store current size as addWidget resizes the node\n const [oldWidth, oldHeight] = this.size\n let widget\n if (type in ComfyWidgets) {\n widget = (ComfyWidgets[type](this, 'value', inputData, app) || {}).widget\n } else {\n widget = this.addWidget(type, 'value', null, () => {}, {})\n }\n\n if (targetWidget) {\n widget.value = targetWidget.value\n } else if (node?.widgets && widget) {\n const theirWidget = node.widgets.find((w) => w.name === widgetName)\n if (theirWidget) {\n widget.value = theirWidget.value\n }\n }\n\n if (\n !inputData?.[1]?.control_after_generate &&\n (widget.type === 'number' || widget.type === 'combo')\n ) {\n let control_value = this.widgets_values?.[1]\n if (!control_value) {\n control_value = 'fixed'\n }\n addValueControlWidgets(\n this,\n widget,\n control_value as string,\n undefined,\n inputData\n )\n let filter = this.widgets_values?.[2]\n if (filter && this.widgets.length === 3) {\n // @ts-expect-error change widget type from string to unknown\n this.widgets[2].value = filter\n }\n }\n\n // Restore any saved control values\n const controlValues = this.controlValues\n if (\n this.lastType === this.widgets[0].type &&\n controlValues?.length === this.widgets.length - 1\n ) {\n for (let i = 0; i < controlValues.length; i++) {\n this.widgets[i + 1].value = controlValues[i]\n }\n }\n\n // When our value changes, update other widgets to reflect our changes\n // e.g. so LoadImage shows correct image\n const callback = widget.callback\n const self = this\n widget.callback = function () {\n const r = callback ? callback.apply(this, arguments) : undefined\n self.applyToGraph()\n return r\n }\n\n // Use the biggest dimensions in case the widgets caused the node to grow\n this.setSize([\n Math.max(this.size[0], oldWidth),\n Math.max(this.size[1], oldHeight)\n ])\n\n if (!recreating) {\n // Grow our node more if required\n const sz = this.computeSize()\n if (this.size[0] < sz[0]) {\n this.size[0] = sz[0]\n }\n if (this.size[1] < sz[1]) {\n this.size[1] = sz[1]\n }\n\n requestAnimationFrame(() => {\n if (this.onResize) {\n this.onResize(this.size)\n }\n })\n }\n }\n\n recreateWidget() {\n const values = this.widgets?.map((w) => w.value)\n this.#removeWidgets()\n this.#onFirstConnection(true)\n if (values?.length) {\n for (let i = 0; i < this.widgets?.length; i++)\n this.widgets[i].value = values[i]\n }\n return this.widgets?.[0]\n }\n\n #mergeWidgetConfig() {\n // Merge widget configs if the node has multiple outputs\n const output = this.outputs[0]\n const links = output.links\n\n const hasConfig = !!output.widget[CONFIG]\n if (hasConfig) {\n delete output.widget[CONFIG]\n }\n\n if (links?.length < 2 && hasConfig) {\n // Copy the widget options from the source\n if (links.length) {\n this.recreateWidget()\n }\n\n return\n }\n\n const config1 = output.widget[GET_CONFIG]()\n const isNumber = config1[0] === 'INT' || config1[0] === 'FLOAT'\n if (!isNumber) return\n\n for (const linkId of links) {\n const link = app.graph.links[linkId]\n if (!link) continue // Can be null when removing a node\n\n const theirNode = app.graph.getNodeById(link.target_id)\n const theirInput = theirNode.inputs[link.target_slot]\n\n // Call is valid connection so it can merge the configs when validating\n this.#isValidConnection(theirInput, hasConfig)\n }\n }\n\n isValidWidgetLink(\n originSlot: number,\n targetNode: LGraphNode,\n targetWidget: IWidget\n ) {\n const config2 = getConfig.call(targetNode, targetWidget.name) ?? [\n targetWidget.type,\n targetWidget.options || {}\n ]\n if (!isConvertibleWidget(targetWidget, config2)) return false\n\n const output = this.outputs[originSlot]\n if (!(output.widget?.[CONFIG] ?? output.widget?.[GET_CONFIG]())) {\n // No widget defined for this primitive yet so allow it\n return true\n }\n\n return !!mergeIfValid.call(this, output, config2)\n }\n\n #isValidConnection(input: INodeInputSlot, forceUpdate?: boolean) {\n // Only allow connections where the configs match\n const output = this.outputs[0]\n const config2 = input.widget[GET_CONFIG]()\n return !!mergeIfValid.call(\n this,\n output,\n config2,\n forceUpdate,\n this.recreateWidget\n )\n }\n\n #removeWidgets() {\n if (this.widgets) {\n // Allow widgets to cleanup\n for (const w of this.widgets) {\n if (w.onRemove) {\n w.onRemove()\n }\n }\n\n // Temporarily store the current values in case the node is being recreated\n // e.g. by group node conversion\n this.controlValues = []\n this.lastType = this.widgets[0]?.type\n for (let i = 1; i < this.widgets.length; i++) {\n this.controlValues.push(this.widgets[i].value)\n }\n setTimeout(() => {\n delete this.lastType\n delete this.controlValues\n }, 15)\n this.widgets.length = 0\n }\n }\n\n onLastDisconnect() {\n // We cant remove + re-add the output here as if you drag a link over the same link\n // it removes, then re-adds, causing it to break\n this.outputs[0].type = '*'\n this.outputs[0].name = 'connect to widget input'\n delete this.outputs[0].widget\n\n this.#removeWidgets()\n }\n}\n\nexport function getWidgetConfig(slot: INodeSlot) {\n return slot.widget[CONFIG] ?? slot.widget[GET_CONFIG]?.() ?? ['*', {}]\n}\n\nfunction getConfig(widgetName: string) {\n const { nodeData } = this.constructor\n return (\n nodeData?.input?.required?.[widgetName] ??\n nodeData?.input?.optional?.[widgetName]\n )\n}\n\nfunction isConvertibleWidget(widget: IWidget, config: InputSpec): boolean {\n return (\n (VALID_TYPES.includes(widget.type) || VALID_TYPES.includes(config[0])) &&\n !widget.options?.forceInput\n )\n}\n\nfunction hideWidget(\n node: LGraphNode,\n widget: IWidget,\n options: { suffix?: string; holdSpace?: boolean } = {}\n) {\n const { suffix = '', holdSpace = true } = options\n\n if (widget.type?.startsWith(CONVERTED_TYPE)) return\n widget.origType = widget.type\n widget.origComputeSize = widget.computeSize\n widget.origSerializeValue = widget.serializeValue\n // @ts-expect-error custom widget type\n widget.type = CONVERTED_TYPE + suffix\n if (holdSpace) {\n widget.computeSize = () => [0, LiteGraph.NODE_WIDGET_HEIGHT]\n } else {\n // -4 is due to the gap litegraph adds between widgets automatically\n widget.computeSize = () => [0, -4]\n }\n widget.serializeValue = (node: LGraphNode, index: number) => {\n // Prevent serializing the widget if we have no input linked\n if (!node.inputs) {\n return undefined\n }\n let node_input = node.inputs.find((i) => i.widget?.name === widget.name)\n\n if (!node_input || !node_input.link) {\n return undefined\n }\n return widget.origSerializeValue\n ? widget.origSerializeValue(node, index)\n : widget.value\n }\n\n // Hide any linked widgets, e.g. seed+seedControl\n if (widget.linkedWidgets) {\n for (const w of widget.linkedWidgets) {\n hideWidget(node, w, { suffix: ':' + widget.name, holdSpace: false })\n }\n }\n}\n\nfunction showWidget(widget: IWidget) {\n // @ts-expect-error custom widget type\n widget.type = widget.origType\n widget.computeSize = widget.origComputeSize\n widget.serializeValue = widget.origSerializeValue\n\n delete widget.origType\n delete widget.origComputeSize\n delete widget.origSerializeValue\n\n // Hide any linked widgets, e.g. seed+seedControl\n if (widget.linkedWidgets) {\n for (const w of widget.linkedWidgets) {\n showWidget(w)\n }\n }\n}\n\nexport function convertToInput(\n node: LGraphNode,\n widget: IWidget,\n config: InputSpec\n) {\n hideWidget(node, widget)\n\n const { type } = getWidgetType(config)\n\n // Add input and store widget config for creating on primitive node\n const [oldWidth, oldHeight] = node.size\n const inputIsOptional = !!widget.options?.inputIsOptional\n const input = node.addInput(widget.name, type, {\n widget: { name: widget.name, [GET_CONFIG]: () => config },\n ...(inputIsOptional ? { shape: LiteGraph.SlotShape.HollowCircle } : {})\n })\n\n for (const widget of node.widgets) {\n widget.last_y += LiteGraph.NODE_SLOT_HEIGHT\n }\n\n // Restore original size but grow if needed\n node.setSize([\n Math.max(oldWidth, node.size[0]),\n Math.max(oldHeight, node.size[1])\n ])\n return input\n}\n\nfunction convertToWidget(node: LGraphNode, widget: IWidget) {\n showWidget(widget)\n const [oldWidth, oldHeight] = node.size\n node.removeInput(node.inputs.findIndex((i) => i.widget?.name === widget.name))\n\n for (const widget of node.widgets) {\n widget.last_y -= LiteGraph.NODE_SLOT_HEIGHT\n }\n\n // Restore original size but grow if needed\n node.setSize([\n Math.max(oldWidth, node.size[0]),\n Math.max(oldHeight, node.size[1])\n ])\n}\n\nfunction getWidgetType(config: InputSpec) {\n // Special handling for COMBO so we restrict links based on the entries\n let type = config[0]\n if (type instanceof Array) {\n type = 'COMBO'\n }\n return { type }\n}\n\nfunction isValidCombo(combo: string[], obj: unknown) {\n // New input isnt a combo\n if (!(obj instanceof Array)) {\n console.log(`connection rejected: tried to connect combo to ${obj}`)\n return false\n }\n // New input combo has a different size\n if (combo.length !== obj.length) {\n console.log(`connection rejected: combo lists dont match`)\n return false\n }\n // New input combo has different elements\n if (combo.find((v, i) => obj[i] !== v)) {\n console.log(`connection rejected: combo lists dont match`)\n return false\n }\n\n return true\n}\n\nfunction isPrimitiveNode(node: LGraphNode): node is PrimitiveNode {\n return node.type === 'PrimitiveNode'\n}\n\nexport function setWidgetConfig(slot, config, target?: IWidget) {\n if (!slot.widget) return\n if (config) {\n slot.widget[GET_CONFIG] = () => config\n slot.widget[TARGET] = target\n } else {\n delete slot.widget\n }\n\n if (slot.link) {\n const link = app.graph.links[slot.link]\n if (link) {\n const originNode = app.graph.getNodeById(link.origin_id)\n if (isPrimitiveNode(originNode)) {\n if (config) {\n originNode.recreateWidget()\n } else if (!app.configuringGraph) {\n originNode.disconnectOutput(0)\n originNode.onLastDisconnect()\n }\n }\n }\n }\n}\n\nexport function mergeIfValid(\n output,\n config2,\n forceUpdate?: boolean,\n recreateWidget?: () => void,\n config1?: unknown\n) {\n if (!config1) {\n config1 = getWidgetConfig(output)\n }\n\n if (config1[0] instanceof Array) {\n if (!isValidCombo(config1[0], config2[0])) return\n } else if (config1[0] !== config2[0]) {\n // Types dont match\n console.log(`connection rejected: types dont match`, config1[0], config2[0])\n return\n }\n\n const keys = new Set([\n ...Object.keys(config1[1] ?? {}),\n ...Object.keys(config2[1] ?? {})\n ])\n\n let customConfig\n const getCustomConfig = () => {\n if (!customConfig) {\n if (typeof structuredClone === 'undefined') {\n customConfig = JSON.parse(JSON.stringify(config1[1] ?? {}))\n } else {\n customConfig = structuredClone(config1[1] ?? {})\n }\n }\n return customConfig\n }\n\n const isNumber = config1[0] === 'INT' || config1[0] === 'FLOAT'\n for (const k of keys.values()) {\n if (\n k !== 'default' &&\n k !== 'forceInput' &&\n k !== 'defaultInput' &&\n k !== 'control_after_generate' &&\n k !== 'multiline' &&\n k !== 'tooltip' &&\n k !== 'dynamicPrompts'\n ) {\n let v1 = config1[1][k]\n let v2 = config2[1]?.[k]\n\n if (v1 === v2 || (!v1 && !v2)) continue\n\n if (isNumber) {\n if (k === 'min') {\n const theirMax = config2[1]?.['max']\n if (theirMax != null && v1 > theirMax) {\n console.log('connection rejected: min > max', v1, theirMax)\n return\n }\n getCustomConfig()[k] =\n v1 == null ? v2 : v2 == null ? v1 : Math.max(v1, v2)\n continue\n } else if (k === 'max') {\n const theirMin = config2[1]?.['min']\n if (theirMin != null && v1 < theirMin) {\n console.log('connection rejected: max < min', v1, theirMin)\n return\n }\n getCustomConfig()[k] =\n v1 == null ? v2 : v2 == null ? v1 : Math.min(v1, v2)\n continue\n } else if (k === 'step') {\n let step\n if (v1 == null) {\n // No current step\n step = v2\n } else if (v2 == null) {\n // No new step\n step = v1\n } else {\n if (v1 < v2) {\n // Ensure v1 is larger for the mod\n const a = v2\n v2 = v1\n v1 = a\n }\n if (v1 % v2) {\n console.log(\n 'connection rejected: steps not divisible',\n 'current:',\n v1,\n 'new:',\n v2\n )\n return\n }\n\n step = v1\n }\n\n getCustomConfig()[k] = step\n continue\n }\n }\n\n console.log(`connection rejected: config ${k} values dont match`, v1, v2)\n return\n }\n }\n\n if (customConfig || forceUpdate) {\n if (customConfig) {\n output.widget[CONFIG] = [config1[0], customConfig]\n }\n\n const widget = recreateWidget?.call(this)\n // When deleting a node this can be null\n if (widget) {\n const min = widget.options.min\n const max = widget.options.max\n if (min != null && widget.value < min) widget.value = min\n if (max != null && widget.value > max) widget.value = max\n widget.callback(widget.value)\n }\n }\n\n return { customConfig }\n}\n\napp.registerExtension({\n name: 'Comfy.WidgetInputs',\n settings: [\n {\n id: 'Comfy.NodeInputConversionSubmenus',\n name: 'In the node context menu, place the entries that convert between input/widget in sub-menus.',\n type: 'boolean',\n defaultValue: true\n }\n ],\n setup() {\n app.canvas.getWidgetLinkType = function (widget, node) {\n const nodeDefStore = useNodeDefStore()\n const nodeDef = nodeDefStore.nodeDefsByName[node.type]\n const input = nodeDef.inputs.getInput(widget.name)\n return input?.type\n }\n\n document.addEventListener(\n 'litegraph:canvas',\n async (e: LiteGraphCanvasEvent) => {\n if (e.detail.subType === 'connectingWidgetLink') {\n const { node, link, widget } = e.detail\n if (!node || !link || !widget) return\n\n const nodeData = node.constructor.nodeData\n if (!nodeData) return\n const all = {\n ...nodeData?.input?.required,\n ...nodeData?.input?.optional\n }\n const inputSpec = all[widget.name]\n if (!inputSpec) return\n\n const input = convertToInput(node, widget, inputSpec)\n if (!input) return\n\n const originNode = link.node\n\n originNode.connect(link.slot, node, node.inputs.lastIndexOf(input))\n }\n }\n )\n },\n async beforeRegisterNodeDef(nodeType, nodeData, app) {\n // Add menu options to convert to/from widgets\n const origGetExtraMenuOptions = nodeType.prototype.getExtraMenuOptions\n // @ts-expect-error adding extra property\n nodeType.prototype.convertWidgetToInput = function (widget) {\n const config = getConfig.call(this, widget.name) ?? [\n widget.type,\n widget.options || {}\n ]\n if (!isConvertibleWidget(widget, config)) return false\n if (widget.type?.startsWith(CONVERTED_TYPE)) return false\n convertToInput(this, widget, config)\n return true\n }\n\n nodeType.prototype.getExtraSlotMenuOptions = function (\n this: LGraphNode,\n slot: IFoundSlot\n ) {\n if (!slot.input || !slot.input.widget) return []\n\n const widget = this.widgets.find((w) => w.name === slot.input.widget.name)\n if (!widget) return []\n return [\n {\n content: `Convert to widget`,\n callback: () => convertToWidget(this, widget)\n }\n ]\n }\n\n nodeType.prototype.getExtraMenuOptions = function (_, options) {\n const r = origGetExtraMenuOptions\n ? origGetExtraMenuOptions.apply(this, arguments)\n : undefined\n\n const getPointerCanvasPos = () => {\n const pos = this.graph?.list_of_graphcanvas?.at(0)?.graph_mouse\n return pos ? { canvasX: pos[0], canvasY: pos[1] } : undefined\n }\n\n if (this.widgets) {\n const { canvasX, canvasY } = getPointerCanvasPos()\n const widget = this.getWidgetOnPos(canvasX, canvasY)\n // @ts-expect-error custom widget type\n if (widget && widget.type !== CONVERTED_TYPE) {\n const config = getConfig.call(this, widget.name) ?? [\n widget.type,\n widget.options || {}\n ]\n if (isConvertibleWidget(widget, config)) {\n options.push({\n content: `Convert ${widget.name} to input`,\n callback: () => convertToInput(this, widget, config) && false\n })\n }\n }\n let toInput = []\n let toWidget = []\n for (const w of this.widgets) {\n if (w.options?.forceInput) {\n continue\n }\n // @ts-expect-error custom widget type\n if (w.type === CONVERTED_TYPE) {\n toWidget.push({\n // @ts-expect-error never\n content: `Convert ${w.name} to widget`,\n callback: () => convertToWidget(this, w)\n })\n } else {\n const config = getConfig.call(this, w.name) ?? [\n w.type,\n w.options || {}\n ]\n if (isConvertibleWidget(w, config)) {\n toInput.push({\n content: `Convert ${w.name} to input`,\n callback: () => convertToInput(this, w, config)\n })\n }\n }\n }\n\n //Convert.. main menu\n if (toInput.length) {\n if (useSettingStore().get('Comfy.NodeInputConversionSubmenus')) {\n options.push({\n content: 'Convert Widget to Input',\n submenu: {\n options: toInput\n }\n })\n } else {\n options.push(...toInput, null)\n }\n }\n if (toWidget.length) {\n if (useSettingStore().get('Comfy.NodeInputConversionSubmenus')) {\n options.push({\n content: 'Convert Input to Widget',\n submenu: {\n options: toWidget\n }\n })\n } else {\n options.push(...toWidget, null)\n }\n }\n }\n\n return r\n }\n\n nodeType.prototype.onGraphConfigured = function () {\n if (!this.inputs) return\n this.widgets ??= []\n\n for (const input of this.inputs) {\n if (input.widget) {\n if (!input.widget[GET_CONFIG]) {\n input.widget[GET_CONFIG] = () =>\n getConfig.call(this, input.widget.name)\n }\n\n // Cleanup old widget config\n if (input.widget.config) {\n if (input.widget.config[0] instanceof Array) {\n // If we are an old converted combo then replace the input type and the stored link data\n input.type = 'COMBO'\n\n const link = app.graph.links[input.link]\n if (link) {\n link.type = input.type\n }\n }\n delete input.widget.config\n }\n\n const w = this.widgets.find((w) => w.name === input.widget.name)\n if (w) {\n hideWidget(this, w)\n } else {\n convertToWidget(this, input)\n }\n }\n }\n }\n\n const origOnNodeCreated = nodeType.prototype.onNodeCreated\n nodeType.prototype.onNodeCreated = function () {\n const r = origOnNodeCreated ? origOnNodeCreated.apply(this) : undefined\n\n // When node is created, convert any force/default inputs\n if (!app.configuringGraph && this.widgets) {\n for (const w of this.widgets) {\n if (w?.options?.forceInput || w?.options?.defaultInput) {\n const config = getConfig.call(this, w.name) ?? [\n w.type,\n w.options || {}\n ]\n convertToInput(this, w, config)\n }\n }\n }\n\n return r\n }\n\n const origOnConfigure = nodeType.prototype.onConfigure\n nodeType.prototype.onConfigure = function () {\n const r = origOnConfigure\n ? origOnConfigure.apply(this, arguments)\n : undefined\n if (!app.configuringGraph && this.inputs) {\n // On copy + paste of nodes, ensure that widget configs are set up\n for (const input of this.inputs) {\n if (input.widget && !input.widget[GET_CONFIG]) {\n input.widget[GET_CONFIG] = () =>\n getConfig.call(this, input.widget.name)\n const w = this.widgets.find((w) => w.name === input.widget.name)\n if (w) {\n hideWidget(this, w)\n }\n }\n }\n }\n\n return r\n }\n\n function isNodeAtPos(pos) {\n for (const n of app.graph.nodes) {\n if (n.pos[0] === pos[0] && n.pos[1] === pos[1]) {\n return true\n }\n }\n return false\n }\n\n // Double click a widget input to automatically attach a primitive\n const origOnInputDblClick = nodeType.prototype.onInputDblClick\n const ignoreDblClick = Symbol()\n nodeType.prototype.onInputDblClick = function (slot) {\n const r = origOnInputDblClick\n ? origOnInputDblClick.apply(this, arguments)\n : undefined\n\n const input = this.inputs[slot]\n if (!input.widget || !input[ignoreDblClick]) {\n // Not a widget input or already handled input\n if (\n !(input.type in ComfyWidgets) &&\n !(input.widget?.[GET_CONFIG]?.()?.[0] instanceof Array)\n ) {\n return r //also Not a ComfyWidgets input or combo (do nothing)\n }\n }\n\n // Create a primitive node\n const node = LiteGraph.createNode('PrimitiveNode')\n app.graph.add(node)\n\n // Calculate a position that wont directly overlap another node\n const pos: [number, number] = [\n this.pos[0] - node.size[0] - 30,\n this.pos[1]\n ]\n while (isNodeAtPos(pos)) {\n pos[1] += LiteGraph.NODE_TITLE_HEIGHT\n }\n\n node.pos = pos\n node.connect(0, this, slot)\n node.title = input.name\n\n // Prevent adding duplicates due to triple clicking\n input[ignoreDblClick] = true\n setTimeout(() => {\n delete input[ignoreDblClick]\n }, 300)\n\n return r\n }\n\n // Prevent connecting COMBO lists to converted inputs that dont match types\n const onConnectInput = nodeType.prototype.onConnectInput\n nodeType.prototype.onConnectInput = function (\n targetSlot,\n type,\n output,\n originNode,\n originSlot\n ) {\n // @ts-expect-error onConnectInput has 5 arguments\n const v = onConnectInput?.(this, arguments)\n // Not a combo, ignore\n if (type !== 'COMBO') return v\n // Primitive output, allow that to handle\n if (originNode.outputs[originSlot].widget) return v\n\n // Ensure target is also a combo\n const targetCombo = this.inputs[targetSlot].widget?.[GET_CONFIG]?.()?.[0]\n if (!targetCombo || !(targetCombo instanceof Array)) return v\n\n // Check they match\n const originConfig =\n originNode.constructor?.nodeData?.output?.[originSlot]\n if (!originConfig || !isValidCombo(targetCombo, originConfig)) {\n return false\n }\n\n return v\n }\n },\n registerCustomNodes() {\n LiteGraph.registerNodeType(\n 'PrimitiveNode',\n Object.assign(PrimitiveNode, {\n title: 'Primitive'\n })\n )\n PrimitiveNode.category = 'utils'\n }\n})\n","// @ts-strict-ignore\nimport { type LGraph, LGraphCanvas, LiteGraph } from '@comfyorg/litegraph'\nimport { LGraphNode, type NodeId } from '@comfyorg/litegraph/dist/LGraphNode'\n\nimport { t } from '@/i18n'\nimport { useDialogService } from '@/services/dialogService'\nimport { useNodeDefStore } from '@/stores/nodeDefStore'\nimport { useToastStore } from '@/stores/toastStore'\nimport type { ComfyNodeDef } from '@/types/apiTypes'\nimport { ComfyExtension } from '@/types/comfy'\nimport { ComfyLink, ComfyNode, ComfyWorkflowJSON } from '@/types/comfyWorkflow'\nimport { deserialiseAndCreate, serialise } from '@/utils/vintageClipboard'\n\nimport { api } from '../../scripts/api'\nimport { app } from '../../scripts/app'\nimport { ManageGroupDialog } from './groupNodeManage'\nimport { mergeIfValid } from './widgetInputs'\n\ntype GroupNodeWorkflowData = {\n external: ComfyLink[]\n links: ComfyLink[]\n nodes: ComfyNode[]\n}\n\nconst GROUP = Symbol()\n\n// v1 Prefix + Separator: workflow/\n// v2 Prefix + Separator: workflow> (ComfyUI_frontend v1.2.63)\nconst PREFIX = 'workflow'\nconst SEPARATOR = '>'\n\nconst Workflow = {\n InUse: {\n Free: 0,\n Registered: 1,\n InWorkflow: 2\n },\n isInUseGroupNode(name) {\n const id = `${PREFIX}${SEPARATOR}${name}`\n // Check if lready registered/in use in this workflow\n if (app.graph.extra?.groupNodes?.[name]) {\n if (app.graph.nodes.find((n) => n.type === id)) {\n return Workflow.InUse.InWorkflow\n } else {\n return Workflow.InUse.Registered\n }\n }\n return Workflow.InUse.Free\n },\n storeGroupNode(name: string, data: GroupNodeWorkflowData) {\n let extra = app.graph.extra\n if (!extra) app.graph.extra = extra = {}\n let groupNodes = extra.groupNodes\n if (!groupNodes) extra.groupNodes = groupNodes = {}\n groupNodes[name] = data\n }\n}\n\nclass GroupNodeBuilder {\n nodes: LGraphNode[]\n nodeData: GroupNodeWorkflowData\n\n constructor(nodes: LGraphNode[]) {\n this.nodes = nodes\n }\n\n async build() {\n const name = await this.getName()\n if (!name) return\n\n // Sort the nodes so they are in execution order\n // this allows for widgets to be in the correct order when reconstructing\n this.sortNodes()\n\n this.nodeData = this.getNodeData()\n Workflow.storeGroupNode(name, this.nodeData)\n\n return { name, nodeData: this.nodeData }\n }\n\n async getName() {\n const name = await useDialogService().prompt({\n title: t('groupNode.create'),\n message: t('groupNode.enterName'),\n defaultValue: ''\n })\n if (!name) return\n const used = Workflow.isInUseGroupNode(name)\n switch (used) {\n case Workflow.InUse.InWorkflow:\n useToastStore().addAlert(\n 'An in use group node with this name already exists embedded in this workflow, please remove any instances or use a new name.'\n )\n return\n case Workflow.InUse.Registered:\n if (\n !confirm(\n 'A group node with this name already exists embedded in this workflow, are you sure you want to overwrite it?'\n )\n ) {\n return\n }\n break\n }\n return name\n }\n\n sortNodes() {\n // Gets the builders nodes in graph execution order\n const nodesInOrder = app.graph.computeExecutionOrder(false)\n this.nodes = this.nodes\n .map((node) => ({ index: nodesInOrder.indexOf(node), node }))\n // @ts-expect-error id might be string\n .sort((a, b) => a.index - b.index || a.node.id - b.node.id)\n .map(({ node }) => node)\n }\n\n getNodeData() {\n const storeLinkTypes = (config) => {\n // Store link types for dynamically typed nodes e.g. reroutes\n for (const link of config.links) {\n const origin = app.graph.getNodeById(link[4])\n const type = origin.outputs[link[1]].type\n link.push(type)\n }\n }\n\n const storeExternalLinks = (config) => {\n // Store any external links to the group in the config so when rebuilding we add extra slots\n config.external = []\n for (let i = 0; i < this.nodes.length; i++) {\n const node = this.nodes[i]\n if (!node.outputs?.length) continue\n for (let slot = 0; slot < node.outputs.length; slot++) {\n let hasExternal = false\n const output = node.outputs[slot]\n let type = output.type\n if (!output.links?.length) continue\n for (const l of output.links) {\n const link = app.graph.links[l]\n if (!link) continue\n if (type === '*') type = link.type\n\n if (!app.canvas.selected_nodes[link.target_id]) {\n hasExternal = true\n break\n }\n }\n if (hasExternal) {\n config.external.push([i, slot, type])\n }\n }\n }\n }\n\n // Use the built in copyToClipboard function to generate the node data we need\n try {\n const serialised = serialise(this.nodes, app.canvas.graph)\n const config = JSON.parse(serialised)\n\n storeLinkTypes(config)\n storeExternalLinks(config)\n\n return config\n } finally {\n }\n }\n}\n\nexport class GroupNodeConfig {\n name: string\n nodeData: any\n inputCount: number\n oldToNewOutputMap: {}\n newToOldOutputMap: {}\n oldToNewInputMap: {}\n oldToNewWidgetMap: {}\n newToOldWidgetMap: {}\n primitiveDefs: {}\n widgetToPrimitive: {}\n primitiveToWidget: {}\n nodeInputs: {}\n outputVisibility: any[]\n nodeDef: ComfyNodeDef\n inputs: any[]\n linksFrom: {}\n linksTo: {}\n externalFrom: {}\n\n constructor(name, nodeData) {\n this.name = name\n this.nodeData = nodeData\n this.getLinks()\n\n this.inputCount = 0\n this.oldToNewOutputMap = {}\n this.newToOldOutputMap = {}\n this.oldToNewInputMap = {}\n this.oldToNewWidgetMap = {}\n this.newToOldWidgetMap = {}\n this.primitiveDefs = {}\n this.widgetToPrimitive = {}\n this.primitiveToWidget = {}\n this.nodeInputs = {}\n this.outputVisibility = []\n }\n\n async registerType(source = PREFIX) {\n this.nodeDef = {\n output: [],\n output_name: [],\n output_is_list: [],\n // @ts-expect-error Unused, doesn't exist\n output_is_hidden: [],\n name: source + SEPARATOR + this.name,\n display_name: this.name,\n category: 'group nodes' + (SEPARATOR + source),\n input: { required: {} },\n description: `Group node combining ${this.nodeData.nodes\n .map((n) => n.type)\n .join(', ')}`,\n python_module: 'custom_nodes.' + this.name,\n\n [GROUP]: this\n }\n\n this.inputs = []\n const seenInputs = {}\n const seenOutputs = {}\n for (let i = 0; i < this.nodeData.nodes.length; i++) {\n const node = this.nodeData.nodes[i]\n node.index = i\n this.processNode(node, seenInputs, seenOutputs)\n }\n\n for (const p of this.#convertedToProcess) {\n p()\n }\n this.#convertedToProcess = null\n await app.registerNodeDef(`${PREFIX}${SEPARATOR}` + this.name, this.nodeDef)\n useNodeDefStore().addNodeDef(this.nodeDef)\n }\n\n getLinks() {\n this.linksFrom = {}\n this.linksTo = {}\n this.externalFrom = {}\n\n // Extract links for easy lookup\n for (const l of this.nodeData.links) {\n const [sourceNodeId, sourceNodeSlot, targetNodeId, targetNodeSlot] = l\n\n // Skip links outside the copy config\n if (sourceNodeId == null) continue\n\n if (!this.linksFrom[sourceNodeId]) {\n this.linksFrom[sourceNodeId] = {}\n }\n if (!this.linksFrom[sourceNodeId][sourceNodeSlot]) {\n this.linksFrom[sourceNodeId][sourceNodeSlot] = []\n }\n this.linksFrom[sourceNodeId][sourceNodeSlot].push(l)\n\n if (!this.linksTo[targetNodeId]) {\n this.linksTo[targetNodeId] = {}\n }\n this.linksTo[targetNodeId][targetNodeSlot] = l\n }\n\n if (this.nodeData.external) {\n for (const ext of this.nodeData.external) {\n if (!this.externalFrom[ext[0]]) {\n this.externalFrom[ext[0]] = { [ext[1]]: ext[2] }\n } else {\n this.externalFrom[ext[0]][ext[1]] = ext[2]\n }\n }\n }\n }\n\n processNode(node, seenInputs, seenOutputs) {\n const def = this.getNodeDef(node)\n if (!def) return\n\n const inputs = { ...def.input?.required, ...def.input?.optional }\n\n this.inputs.push(this.processNodeInputs(node, seenInputs, inputs))\n if (def.output?.length) this.processNodeOutputs(node, seenOutputs, def)\n }\n\n getNodeDef(node) {\n const def = globalDefs[node.type]\n if (def) return def\n\n const linksFrom = this.linksFrom[node.index]\n if (node.type === 'PrimitiveNode') {\n // Skip as its not linked\n if (!linksFrom) return\n\n let type = linksFrom['0'][0][5]\n if (type === 'COMBO') {\n // Use the array items\n const source = node.outputs[0].widget.name\n const fromTypeName = this.nodeData.nodes[linksFrom['0'][0][2]].type\n const fromType = globalDefs[fromTypeName]\n const input =\n fromType.input.required[source] ?? fromType.input.optional[source]\n type = input[0]\n }\n\n const def = (this.primitiveDefs[node.index] = {\n input: {\n required: {\n value: [type, {}]\n }\n },\n output: [type],\n output_name: [],\n output_is_list: []\n })\n return def\n } else if (node.type === 'Reroute') {\n const linksTo = this.linksTo[node.index]\n if (linksTo && linksFrom && !this.externalFrom[node.index]?.[0]) {\n // Being used internally\n return null\n }\n\n let config = {}\n let rerouteType = '*'\n if (linksFrom) {\n for (const [, , id, slot] of linksFrom['0']) {\n const node = this.nodeData.nodes[id]\n const input = node.inputs[slot]\n if (rerouteType === '*') {\n rerouteType = input.type\n }\n if (input.widget) {\n const targetDef = globalDefs[node.type]\n const targetWidget =\n targetDef.input.required[input.widget.name] ??\n targetDef.input.optional[input.widget.name]\n\n const widget = [targetWidget[0], config]\n const res = mergeIfValid(\n {\n widget\n },\n targetWidget,\n false,\n null,\n widget\n )\n config = res?.customConfig ?? config\n }\n }\n } else if (linksTo) {\n const [id, slot] = linksTo['0']\n rerouteType = this.nodeData.nodes[id].outputs[slot].type\n } else {\n // Reroute used as a pipe\n for (const l of this.nodeData.links) {\n if (l[2] === node.index) {\n rerouteType = l[5]\n break\n }\n }\n if (rerouteType === '*') {\n // Check for an external link\n const t = this.externalFrom[node.index]?.[0]\n if (t) {\n rerouteType = t\n }\n }\n }\n\n // @ts-expect-error\n config.forceInput = true\n return {\n input: {\n required: {\n [rerouteType]: [rerouteType, config]\n }\n },\n output: [rerouteType],\n output_name: [],\n output_is_list: []\n }\n }\n\n console.warn(\n 'Skipping virtual node ' +\n node.type +\n ' when building group node ' +\n this.name\n )\n }\n\n getInputConfig(node, inputName, seenInputs, config, extra?) {\n const customConfig = this.nodeData.config?.[node.index]?.input?.[inputName]\n let name =\n customConfig?.name ??\n node.inputs?.find((inp) => inp.name === inputName)?.label ??\n inputName\n let key = name\n let prefix = ''\n // Special handling for primitive to include the title if it is set rather than just \"value\"\n if ((node.type === 'PrimitiveNode' && node.title) || name in seenInputs) {\n prefix = `${node.title ?? node.type} `\n key = name = `${prefix}${inputName}`\n if (name in seenInputs) {\n name = `${prefix}${seenInputs[name]} ${inputName}`\n }\n }\n seenInputs[key] = (seenInputs[key] ?? 1) + 1\n\n if (inputName === 'seed' || inputName === 'noise_seed') {\n if (!extra) extra = {}\n extra.control_after_generate = `${prefix}control_after_generate`\n }\n if (config[0] === 'IMAGEUPLOAD') {\n if (!extra) extra = {}\n extra.widget =\n this.oldToNewWidgetMap[node.index]?.[config[1]?.widget ?? 'image'] ??\n 'image'\n }\n\n if (extra) {\n config = [config[0], { ...config[1], ...extra }]\n }\n\n return { name, config, customConfig }\n }\n\n processWidgetInputs(inputs, node, inputNames, seenInputs) {\n const slots = []\n const converted = new Map()\n const widgetMap = (this.oldToNewWidgetMap[node.index] = {})\n for (const inputName of inputNames) {\n let widgetType = app.getWidgetType(inputs[inputName], inputName)\n if (widgetType) {\n const convertedIndex = node.inputs?.findIndex(\n (inp) => inp.name === inputName && inp.widget?.name === inputName\n )\n if (convertedIndex > -1) {\n // This widget has been converted to a widget\n // We need to store this in the correct position so link ids line up\n converted.set(convertedIndex, inputName)\n widgetMap[inputName] = null\n } else {\n // Normal widget\n const { name, config } = this.getInputConfig(\n node,\n inputName,\n seenInputs,\n inputs[inputName]\n )\n this.nodeDef.input.required[name] = config\n widgetMap[inputName] = name\n this.newToOldWidgetMap[name] = { node, inputName }\n }\n } else {\n // Normal input\n slots.push(inputName)\n }\n }\n return { converted, slots }\n }\n\n checkPrimitiveConnection(link, inputName, inputs) {\n const sourceNode = this.nodeData.nodes[link[0]]\n if (sourceNode.type === 'PrimitiveNode') {\n // Merge link configurations\n const [sourceNodeId, _, targetNodeId, __] = link\n const primitiveDef = this.primitiveDefs[sourceNodeId]\n const targetWidget = inputs[inputName]\n const primitiveConfig = primitiveDef.input.required.value\n const output = { widget: primitiveConfig }\n const config = mergeIfValid(\n output,\n targetWidget,\n false,\n null,\n primitiveConfig\n )\n primitiveConfig[1] =\n config?.customConfig ?? inputs[inputName][1]\n ? { ...inputs[inputName][1] }\n : {}\n\n let name = this.oldToNewWidgetMap[sourceNodeId]['value']\n name = name.substr(0, name.length - 6)\n primitiveConfig[1].control_after_generate = true\n primitiveConfig[1].control_prefix = name\n\n let toPrimitive = this.widgetToPrimitive[targetNodeId]\n if (!toPrimitive) {\n toPrimitive = this.widgetToPrimitive[targetNodeId] = {}\n }\n if (toPrimitive[inputName]) {\n toPrimitive[inputName].push(sourceNodeId)\n }\n toPrimitive[inputName] = sourceNodeId\n\n let toWidget = this.primitiveToWidget[sourceNodeId]\n if (!toWidget) {\n toWidget = this.primitiveToWidget[sourceNodeId] = []\n }\n toWidget.push({ nodeId: targetNodeId, inputName })\n }\n }\n\n processInputSlots(inputs, node, slots, linksTo, inputMap, seenInputs) {\n this.nodeInputs[node.index] = {}\n for (let i = 0; i < slots.length; i++) {\n const inputName = slots[i]\n if (linksTo[i]) {\n this.checkPrimitiveConnection(linksTo[i], inputName, inputs)\n // This input is linked so we can skip it\n continue\n }\n\n const { name, config, customConfig } = this.getInputConfig(\n node,\n inputName,\n seenInputs,\n inputs[inputName]\n )\n\n this.nodeInputs[node.index][inputName] = name\n if (customConfig?.visible === false) continue\n\n this.nodeDef.input.required[name] = config\n inputMap[i] = this.inputCount++\n }\n }\n\n processConvertedWidgets(\n inputs,\n node,\n slots,\n converted,\n linksTo,\n inputMap,\n seenInputs\n ) {\n // Add converted widgets sorted into their index order (ordered as they were converted) so link ids match up\n const convertedSlots = [...converted.keys()]\n .sort()\n .map((k) => converted.get(k))\n for (let i = 0; i < convertedSlots.length; i++) {\n const inputName = convertedSlots[i]\n if (linksTo[slots.length + i]) {\n this.checkPrimitiveConnection(\n linksTo[slots.length + i],\n inputName,\n inputs\n )\n // This input is linked so we can skip it\n continue\n }\n\n const { name, config } = this.getInputConfig(\n node,\n inputName,\n seenInputs,\n inputs[inputName],\n {\n defaultInput: true\n }\n )\n\n this.nodeDef.input.required[name] = config\n this.newToOldWidgetMap[name] = { node, inputName }\n\n if (!this.oldToNewWidgetMap[node.index]) {\n this.oldToNewWidgetMap[node.index] = {}\n }\n this.oldToNewWidgetMap[node.index][inputName] = name\n\n inputMap[slots.length + i] = this.inputCount++\n }\n }\n\n #convertedToProcess = []\n processNodeInputs(node, seenInputs, inputs) {\n const inputMapping = []\n\n const inputNames = Object.keys(inputs)\n if (!inputNames.length) return\n\n const { converted, slots } = this.processWidgetInputs(\n inputs,\n node,\n inputNames,\n seenInputs\n )\n const linksTo = this.linksTo[node.index] ?? {}\n const inputMap = (this.oldToNewInputMap[node.index] = {})\n this.processInputSlots(inputs, node, slots, linksTo, inputMap, seenInputs)\n\n // Converted inputs have to be processed after all other nodes as they'll be at the end of the list\n this.#convertedToProcess.push(() =>\n this.processConvertedWidgets(\n inputs,\n node,\n slots,\n converted,\n linksTo,\n inputMap,\n seenInputs\n )\n )\n\n return inputMapping\n }\n\n processNodeOutputs(node, seenOutputs, def) {\n const oldToNew = (this.oldToNewOutputMap[node.index] = {})\n\n // Add outputs\n for (let outputId = 0; outputId < def.output.length; outputId++) {\n const linksFrom = this.linksFrom[node.index]\n // If this output is linked internally we flag it to hide\n const hasLink =\n linksFrom?.[outputId] && !this.externalFrom[node.index]?.[outputId]\n const customConfig =\n this.nodeData.config?.[node.index]?.output?.[outputId]\n const visible = customConfig?.visible ?? !hasLink\n this.outputVisibility.push(visible)\n if (!visible) {\n continue\n }\n\n oldToNew[outputId] = this.nodeDef.output.length\n this.newToOldOutputMap[this.nodeDef.output.length] = {\n node,\n slot: outputId\n }\n this.nodeDef.output.push(def.output[outputId])\n this.nodeDef.output_is_list.push(def.output_is_list[outputId])\n\n let label = customConfig?.name\n if (!label) {\n label = def.output_name?.[outputId] ?? def.output[outputId]\n const output = node.outputs.find((o) => o.name === label)\n if (output?.label) {\n label = output.label\n }\n }\n\n let name = label\n if (name in seenOutputs) {\n const prefix = `${node.title ?? node.type} `\n name = `${prefix}${label}`\n if (name in seenOutputs) {\n name = `${prefix}${node.index} ${label}`\n }\n }\n seenOutputs[name] = 1\n\n this.nodeDef.output_name.push(name)\n }\n }\n\n static async registerFromWorkflow(groupNodes, missingNodeTypes) {\n for (const g in groupNodes) {\n const groupData = groupNodes[g]\n\n let hasMissing = false\n for (const n of groupData.nodes) {\n // Find missing node types\n if (!(n.type in LiteGraph.registered_node_types)) {\n missingNodeTypes.push({\n type: n.type,\n hint: ` (In group node '${PREFIX}${SEPARATOR}${g}')`\n })\n\n missingNodeTypes.push({\n type: `${PREFIX}${SEPARATOR}` + g,\n action: {\n text: 'Remove from workflow',\n callback: (e) => {\n delete groupNodes[g]\n e.target.textContent = 'Removed'\n e.target.style.pointerEvents = 'none'\n e.target.style.opacity = 0.7\n }\n }\n })\n\n hasMissing = true\n }\n }\n\n if (hasMissing) continue\n\n const config = new GroupNodeConfig(g, groupData)\n await config.registerType()\n }\n }\n}\n\nexport class GroupNodeHandler {\n node: LGraphNode\n groupData\n innerNodes: any\n\n constructor(node: LGraphNode) {\n this.node = node\n this.groupData = node.constructor?.nodeData?.[GROUP]\n\n this.node.setInnerNodes = (innerNodes) => {\n this.innerNodes = innerNodes\n\n for (\n let innerNodeIndex = 0;\n innerNodeIndex < this.innerNodes.length;\n innerNodeIndex++\n ) {\n const innerNode = this.innerNodes[innerNodeIndex]\n\n for (const w of innerNode.widgets ?? []) {\n if (w.type === 'converted-widget') {\n w.serializeValue = w.origSerializeValue\n }\n }\n\n innerNode.index = innerNodeIndex\n innerNode.getInputNode = (slot) => {\n // Check if this input is internal or external\n const externalSlot =\n this.groupData.oldToNewInputMap[innerNode.index]?.[slot]\n if (externalSlot != null) {\n return this.node.getInputNode(externalSlot)\n }\n\n // Internal link\n const innerLink = this.groupData.linksTo[innerNode.index]?.[slot]\n if (!innerLink) return null\n\n const inputNode = innerNodes[innerLink[0]]\n // Primitives will already apply their values\n if (inputNode.type === 'PrimitiveNode') return null\n\n return inputNode\n }\n\n innerNode.getInputLink = (slot) => {\n const externalSlot =\n this.groupData.oldToNewInputMap[innerNode.index]?.[slot]\n if (externalSlot != null) {\n // The inner node is connected via the group node inputs\n const linkId = this.node.inputs[externalSlot].link\n let link = app.graph.links[linkId]\n\n // Use the outer link, but update the target to the inner node\n // @ts-expect-error\n // TODO: Fix this\n link = {\n ...link,\n target_id: innerNode.id,\n target_slot: +slot\n }\n return link\n }\n\n let link = this.groupData.linksTo[innerNode.index]?.[slot]\n if (!link) return null\n // Use the inner link, but update the origin node to be inner node id\n link = {\n origin_id: innerNodes[link[0]].id,\n origin_slot: link[1],\n target_id: innerNode.id,\n target_slot: +slot\n }\n return link\n }\n }\n }\n\n this.node.updateLink = (link) => {\n // Replace the group node reference with the internal node\n // @ts-expect-error Can this be removed? Or replaced with: LLink.create(link.asSerialisable())\n link = { ...link }\n const output = this.groupData.newToOldOutputMap[link.origin_slot]\n let innerNode = this.innerNodes[output.node.index]\n let l\n while (innerNode?.type === 'Reroute') {\n l = innerNode.getInputLink(0)\n innerNode = innerNode.getInputNode(0)\n }\n\n if (!innerNode) {\n return null\n }\n\n if (l && GroupNodeHandler.isGroupNode(innerNode)) {\n return innerNode.updateLink(l)\n }\n\n link.origin_id = innerNode.id\n link.origin_slot = l?.origin_slot ?? output.slot\n return link\n }\n\n this.node.getInnerNodes = () => {\n if (!this.innerNodes) {\n this.node.setInnerNodes(\n this.groupData.nodeData.nodes.map((n, i) => {\n const innerNode = LiteGraph.createNode(n.type)\n innerNode.configure(n)\n innerNode.id = `${this.node.id}:${i}`\n return innerNode\n })\n )\n }\n\n this.updateInnerWidgets()\n\n return this.innerNodes\n }\n\n this.node.recreate = async () => {\n const id = this.node.id\n const sz = this.node.size\n const nodes = this.node.convertToNodes()\n\n const groupNode = LiteGraph.createNode(this.node.type)\n groupNode.id = id\n\n // Reuse the existing nodes for this instance\n groupNode.setInnerNodes(nodes)\n groupNode[GROUP].populateWidgets()\n app.graph.add(groupNode)\n groupNode.setSize([\n Math.max(groupNode.size[0], sz[0]),\n Math.max(groupNode.size[1], sz[1])\n ])\n\n // Remove all converted nodes and relink them\n const builder = new GroupNodeBuilder(nodes)\n const nodeData = builder.getNodeData()\n groupNode[GROUP].groupData.nodeData.links = nodeData.links\n groupNode[GROUP].replaceNodes(nodes)\n return groupNode\n }\n\n this.node.convertToNodes = () => {\n const addInnerNodes = () => {\n // Clone the node data so we dont mutate it for other nodes\n const c = { ...this.groupData.nodeData }\n c.nodes = [...c.nodes]\n const innerNodes = this.node.getInnerNodes()\n let ids = []\n for (let i = 0; i < c.nodes.length; i++) {\n let id = innerNodes?.[i]?.id\n // Use existing IDs if they are set on the inner nodes\n // @ts-expect-error id can be string or number\n if (id == null || isNaN(id)) {\n id = undefined\n } else {\n ids.push(id)\n }\n c.nodes[i] = { ...c.nodes[i], id }\n }\n deserialiseAndCreate(JSON.stringify(c), app.canvas)\n\n const [x, y] = this.node.pos\n let top\n let left\n // Configure nodes with current widget data\n const selectedIds = ids.length\n ? ids\n : Object.keys(app.canvas.selected_nodes)\n const newNodes = []\n for (let i = 0; i < selectedIds.length; i++) {\n const id = selectedIds[i]\n const newNode = app.graph.getNodeById(id)\n const innerNode = innerNodes[i]\n newNodes.push(newNode)\n\n if (left == null || newNode.pos[0] < left) {\n left = newNode.pos[0]\n }\n if (top == null || newNode.pos[1] < top) {\n top = newNode.pos[1]\n }\n\n if (!newNode.widgets) continue\n\n const map = this.groupData.oldToNewWidgetMap[innerNode.index]\n if (map) {\n const widgets = Object.keys(map)\n\n for (const oldName of widgets) {\n const newName = map[oldName]\n if (!newName) continue\n\n const widgetIndex = this.node.widgets.findIndex(\n (w) => w.name === newName\n )\n if (widgetIndex === -1) continue\n\n // Populate the main and any linked widgets\n if (innerNode.type === 'PrimitiveNode') {\n for (let i = 0; i < newNode.widgets.length; i++) {\n newNode.widgets[i].value =\n this.node.widgets[widgetIndex + i].value\n }\n } else {\n const outerWidget = this.node.widgets[widgetIndex]\n const newWidget = newNode.widgets.find(\n (w) => w.name === oldName\n )\n if (!newWidget) continue\n\n newWidget.value = outerWidget.value\n for (let w = 0; w < outerWidget.linkedWidgets?.length; w++) {\n newWidget.linkedWidgets[w].value =\n outerWidget.linkedWidgets[w].value\n }\n }\n }\n }\n }\n\n // Shift each node\n for (const newNode of newNodes) {\n newNode.pos[0] -= left - x\n newNode.pos[1] -= top - y\n }\n\n return { newNodes, selectedIds }\n }\n\n const reconnectInputs = (selectedIds) => {\n for (const innerNodeIndex in this.groupData.oldToNewInputMap) {\n const id = selectedIds[innerNodeIndex]\n const newNode = app.graph.getNodeById(id)\n const map = this.groupData.oldToNewInputMap[innerNodeIndex]\n for (const innerInputId in map) {\n const groupSlotId = map[innerInputId]\n if (groupSlotId == null) continue\n const slot = node.inputs[groupSlotId]\n if (slot.link == null) continue\n const link = app.graph.links[slot.link]\n if (!link) continue\n // connect this node output to the input of another node\n const originNode = app.graph.getNodeById(link.origin_id)\n originNode.connect(link.origin_slot, newNode, +innerInputId)\n }\n }\n }\n\n const reconnectOutputs = (selectedIds) => {\n for (\n let groupOutputId = 0;\n groupOutputId < node.outputs?.length;\n groupOutputId++\n ) {\n const output = node.outputs[groupOutputId]\n if (!output.links) continue\n const links = [...output.links]\n for (const l of links) {\n const slot = this.groupData.newToOldOutputMap[groupOutputId]\n const link = app.graph.links[l]\n const targetNode = app.graph.getNodeById(link.target_id)\n const newNode = app.graph.getNodeById(selectedIds[slot.node.index])\n newNode.connect(slot.slot, targetNode, link.target_slot)\n }\n }\n }\n\n app.canvas.emitBeforeChange()\n\n try {\n const { newNodes, selectedIds } = addInnerNodes()\n reconnectInputs(selectedIds)\n reconnectOutputs(selectedIds)\n app.graph.remove(this.node)\n\n return newNodes\n } finally {\n app.canvas.emitAfterChange()\n }\n }\n\n const getExtraMenuOptions = this.node.getExtraMenuOptions\n // @ts-expect-error Should pass patched return value getExtraMenuOptions\n this.node.getExtraMenuOptions = function (_, options) {\n getExtraMenuOptions?.apply(this, arguments)\n\n let optionIndex = options.findIndex((o) => o.content === 'Outputs')\n if (optionIndex === -1) optionIndex = options.length\n else optionIndex++\n options.splice(\n optionIndex,\n 0,\n null,\n {\n content: 'Convert to nodes',\n // @ts-expect-error\n callback: () => {\n return this.convertToNodes()\n }\n },\n {\n content: 'Manage Group Node',\n callback: () => manageGroupNodes(this.type)\n }\n )\n }\n\n // Draw custom collapse icon to identity this as a group\n const onDrawTitleBox = this.node.onDrawTitleBox\n this.node.onDrawTitleBox = function (ctx, height, size, scale) {\n onDrawTitleBox?.apply(this, arguments)\n\n const fill = ctx.fillStyle\n ctx.beginPath()\n ctx.rect(11, -height + 11, 2, 2)\n ctx.rect(14, -height + 11, 2, 2)\n ctx.rect(17, -height + 11, 2, 2)\n ctx.rect(11, -height + 14, 2, 2)\n ctx.rect(14, -height + 14, 2, 2)\n ctx.rect(17, -height + 14, 2, 2)\n ctx.rect(11, -height + 17, 2, 2)\n ctx.rect(14, -height + 17, 2, 2)\n ctx.rect(17, -height + 17, 2, 2)\n\n ctx.fillStyle = this.boxcolor || LiteGraph.NODE_DEFAULT_BOXCOLOR\n ctx.fill()\n ctx.fillStyle = fill\n }\n\n // Draw progress label\n const onDrawForeground = node.onDrawForeground\n const groupData = this.groupData.nodeData\n node.onDrawForeground = function (ctx) {\n const r = onDrawForeground?.apply?.(this, arguments)\n if (\n +app.runningNodeId === this.id &&\n this.runningInternalNodeId !== null\n ) {\n const n = groupData.nodes[this.runningInternalNodeId]\n if (!n) return\n const message = `Running ${n.title || n.type} (${this.runningInternalNodeId}/${groupData.nodes.length})`\n ctx.save()\n ctx.font = '12px sans-serif'\n const sz = ctx.measureText(message)\n ctx.fillStyle = node.boxcolor || LiteGraph.NODE_DEFAULT_BOXCOLOR\n ctx.beginPath()\n ctx.roundRect(\n 0,\n -LiteGraph.NODE_TITLE_HEIGHT - 20,\n sz.width + 12,\n 20,\n 5\n )\n ctx.fill()\n\n ctx.fillStyle = '#fff'\n ctx.fillText(message, 6, -LiteGraph.NODE_TITLE_HEIGHT - 6)\n ctx.restore()\n }\n }\n\n // Flag this node as needing to be reset\n const onExecutionStart = this.node.onExecutionStart\n this.node.onExecutionStart = function () {\n this.resetExecution = true\n return onExecutionStart?.apply(this, arguments)\n }\n\n const self = this\n const onNodeCreated = this.node.onNodeCreated\n this.node.onNodeCreated = function () {\n if (!this.widgets) {\n return\n }\n const config = self.groupData.nodeData.config\n if (config) {\n for (const n in config) {\n const inputs = config[n]?.input\n for (const w in inputs) {\n if (inputs[w].visible !== false) continue\n const widgetName = self.groupData.oldToNewWidgetMap[n][w]\n const widget = this.widgets.find((w) => w.name === widgetName)\n if (widget) {\n widget.type = 'hidden'\n widget.computeSize = () => [0, -4]\n }\n }\n }\n }\n\n return onNodeCreated?.apply(this, arguments)\n }\n\n function handleEvent(type, getId, getEvent) {\n const handler = ({ detail }) => {\n const id = getId(detail)\n if (!id) return\n const node = app.graph.getNodeById(id)\n if (node) return\n\n const innerNodeIndex = this.innerNodes?.findIndex((n) => n.id == id)\n if (innerNodeIndex > -1) {\n this.node.runningInternalNodeId = innerNodeIndex\n api.dispatchCustomEvent(\n type,\n getEvent(detail, `${this.node.id}`, this.node)\n )\n }\n }\n api.addEventListener(type, handler)\n return handler\n }\n\n const executing = handleEvent.call(\n this,\n 'executing',\n (d) => d,\n (d, id, node) => id\n )\n\n const executed = handleEvent.call(\n this,\n 'executed',\n (d) => d?.display_node || d?.node,\n (d, id, node) => ({\n ...d,\n node: id,\n display_node: id,\n merge: !node.resetExecution\n })\n )\n\n const onRemoved = node.onRemoved\n this.node.onRemoved = function () {\n onRemoved?.apply(this, arguments)\n api.removeEventListener('executing', executing)\n api.removeEventListener('executed', executed)\n }\n\n this.node.refreshComboInNode = (defs) => {\n // Update combo widget options\n for (const widgetName in this.groupData.newToOldWidgetMap) {\n const widget = this.node.widgets.find((w) => w.name === widgetName)\n if (widget?.type === 'combo') {\n const old = this.groupData.newToOldWidgetMap[widgetName]\n const def = defs[old.node.type]\n const input =\n def?.input?.required?.[old.inputName] ??\n def?.input?.optional?.[old.inputName]\n if (!input) continue\n\n widget.options.values = input[0]\n\n if (\n old.inputName !== 'image' &&\n // @ts-expect-error Widget values\n !widget.options.values.includes(widget.value)\n ) {\n widget.value = widget.options.values[0]\n widget.callback(widget.value)\n }\n }\n }\n }\n }\n\n updateInnerWidgets() {\n for (const newWidgetName in this.groupData.newToOldWidgetMap) {\n const newWidget = this.node.widgets.find((w) => w.name === newWidgetName)\n if (!newWidget) continue\n\n const newValue = newWidget.value\n const old = this.groupData.newToOldWidgetMap[newWidgetName]\n let innerNode = this.innerNodes[old.node.index]\n\n if (innerNode.type === 'PrimitiveNode') {\n innerNode.primitiveValue = newValue\n const primitiveLinked = this.groupData.primitiveToWidget[old.node.index]\n for (const linked of primitiveLinked ?? []) {\n const node = this.innerNodes[linked.nodeId]\n const widget = node.widgets.find((w) => w.name === linked.inputName)\n\n if (widget) {\n widget.value = newValue\n }\n }\n continue\n } else if (innerNode.type === 'Reroute') {\n const rerouteLinks = this.groupData.linksFrom[old.node.index]\n if (rerouteLinks) {\n for (const [_, , targetNodeId, targetSlot] of rerouteLinks['0']) {\n const node = this.innerNodes[targetNodeId]\n const input = node.inputs[targetSlot]\n if (input.widget) {\n const widget = node.widgets?.find(\n (w) => w.name === input.widget.name\n )\n if (widget) {\n widget.value = newValue\n }\n }\n }\n }\n }\n\n const widget = innerNode.widgets?.find((w) => w.name === old.inputName)\n if (widget) {\n widget.value = newValue\n }\n }\n }\n\n populatePrimitive(node, nodeId, oldName, i, linkedShift) {\n // Converted widget, populate primitive if linked\n const primitiveId = this.groupData.widgetToPrimitive[nodeId]?.[oldName]\n if (primitiveId == null) return\n const targetWidgetName =\n this.groupData.oldToNewWidgetMap[primitiveId]['value']\n const targetWidgetIndex = this.node.widgets.findIndex(\n (w) => w.name === targetWidgetName\n )\n if (targetWidgetIndex > -1) {\n const primitiveNode = this.innerNodes[primitiveId]\n let len = primitiveNode.widgets.length\n if (\n len - 1 !==\n this.node.widgets[targetWidgetIndex].linkedWidgets?.length\n ) {\n // Fallback handling for if some reason the primitive has a different number of widgets\n // we dont want to overwrite random widgets, better to leave blank\n len = 1\n }\n for (let i = 0; i < len; i++) {\n this.node.widgets[targetWidgetIndex + i].value =\n primitiveNode.widgets[i].value\n }\n }\n return true\n }\n\n populateReroute(node, nodeId, map) {\n if (node.type !== 'Reroute') return\n\n const link = this.groupData.linksFrom[nodeId]?.[0]?.[0]\n if (!link) return\n const [, , targetNodeId, targetNodeSlot] = link\n const targetNode = this.groupData.nodeData.nodes[targetNodeId]\n const inputs = targetNode.inputs\n const targetWidget = inputs?.[targetNodeSlot]?.widget\n if (!targetWidget) return\n\n const offset = inputs.length - (targetNode.widgets_values?.length ?? 0)\n const v = targetNode.widgets_values?.[targetNodeSlot - offset]\n if (v == null) return\n\n const widgetName = Object.values(map)[0]\n const widget = this.node.widgets.find((w) => w.name === widgetName)\n if (widget) {\n widget.value = v\n }\n }\n\n populateWidgets() {\n if (!this.node.widgets) return\n\n for (\n let nodeId = 0;\n nodeId < this.groupData.nodeData.nodes.length;\n nodeId++\n ) {\n const node = this.groupData.nodeData.nodes[nodeId]\n const map = this.groupData.oldToNewWidgetMap[nodeId] ?? {}\n const widgets = Object.keys(map)\n\n if (!node.widgets_values?.length) {\n // special handling for populating values into reroutes\n // this allows primitives connect to them to pick up the correct value\n this.populateReroute(node, nodeId, map)\n continue\n }\n\n let linkedShift = 0\n for (let i = 0; i < widgets.length; i++) {\n const oldName = widgets[i]\n const newName = map[oldName]\n const widgetIndex = this.node.widgets.findIndex(\n (w) => w.name === newName\n )\n const mainWidget = this.node.widgets[widgetIndex]\n if (\n this.populatePrimitive(node, nodeId, oldName, i, linkedShift) ||\n widgetIndex === -1\n ) {\n // Find the inner widget and shift by the number of linked widgets as they will have been removed too\n const innerWidget = this.innerNodes[nodeId].widgets?.find(\n (w) => w.name === oldName\n )\n linkedShift += innerWidget?.linkedWidgets?.length ?? 0\n }\n if (widgetIndex === -1) {\n continue\n }\n\n // Populate the main and any linked widget\n mainWidget.value = node.widgets_values[i + linkedShift]\n for (let w = 0; w < mainWidget.linkedWidgets?.length; w++) {\n this.node.widgets[widgetIndex + w + 1].value =\n node.widgets_values[i + ++linkedShift]\n }\n }\n }\n }\n\n replaceNodes(nodes) {\n let top\n let left\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i]\n if (left == null || node.pos[0] < left) {\n left = node.pos[0]\n }\n if (top == null || node.pos[1] < top) {\n top = node.pos[1]\n }\n\n this.linkOutputs(node, i)\n app.graph.remove(node)\n }\n\n this.linkInputs()\n this.node.pos = [left, top]\n }\n\n linkOutputs(originalNode, nodeId) {\n if (!originalNode.outputs) return\n\n for (const output of originalNode.outputs) {\n if (!output.links) continue\n // Clone the links as they'll be changed if we reconnect\n const links = [...output.links]\n for (const l of links) {\n const link = app.graph.links[l]\n if (!link) continue\n\n const targetNode = app.graph.getNodeById(link.target_id)\n const newSlot =\n this.groupData.oldToNewOutputMap[nodeId]?.[link.origin_slot]\n if (newSlot != null) {\n this.node.connect(newSlot, targetNode, link.target_slot)\n }\n }\n }\n }\n\n linkInputs() {\n for (const link of this.groupData.nodeData.links ?? []) {\n const [, originSlot, targetId, targetSlot, actualOriginId] = link\n const originNode = app.graph.getNodeById(actualOriginId)\n if (!originNode) continue // this node is in the group\n originNode.connect(\n originSlot,\n // @ts-expect-error Valid - uses deprecated interface. Required check: if (graph.getNodeById(this.node.id) !== this.node) report()\n this.node.id,\n this.groupData.oldToNewInputMap[targetId][targetSlot]\n )\n }\n }\n\n static getGroupData(node) {\n return (node.nodeData ?? node.constructor?.nodeData)?.[GROUP]\n }\n\n static isGroupNode(node: LGraphNode) {\n return !!node.constructor?.nodeData?.[GROUP]\n }\n\n static async fromNodes(nodes: LGraphNode[]) {\n // Process the nodes into the stored workflow group node data\n const builder = new GroupNodeBuilder(nodes)\n const res = await builder.build()\n if (!res) return\n\n const { name, nodeData } = res\n\n // Convert this data into a LG node definition and register it\n const config = new GroupNodeConfig(name, nodeData)\n await config.registerType()\n\n const groupNode = LiteGraph.createNode(`${PREFIX}${SEPARATOR}${name}`)\n // Reuse the existing nodes for this instance\n groupNode.setInnerNodes(builder.nodes)\n groupNode[GROUP].populateWidgets()\n app.graph.add(groupNode)\n\n // Remove all converted nodes and relink them\n groupNode[GROUP].replaceNodes(builder.nodes)\n return groupNode\n }\n}\n\nfunction addConvertToGroupOptions() {\n function addConvertOption(options, index) {\n const selected = Object.values(app.canvas.selected_nodes ?? {})\n const disabled =\n selected.length < 2 ||\n selected.find((n) => GroupNodeHandler.isGroupNode(n))\n options.splice(index + 1, null, {\n content: `Convert to Group Node`,\n disabled,\n callback: convertSelectedNodesToGroupNode\n })\n }\n\n function addManageOption(options, index) {\n const groups = app.graph.extra?.groupNodes\n const disabled = !groups || !Object.keys(groups).length\n options.splice(index + 1, null, {\n content: `Manage Group Nodes`,\n disabled,\n callback: () => manageGroupNodes()\n })\n }\n\n // Add to canvas\n const getCanvasMenuOptions = LGraphCanvas.prototype.getCanvasMenuOptions\n LGraphCanvas.prototype.getCanvasMenuOptions = function () {\n const options = getCanvasMenuOptions.apply(this, arguments)\n const index =\n options.findIndex((o) => o?.content === 'Add Group') + 1 || options.length\n addConvertOption(options, index)\n addManageOption(options, index + 1)\n return options\n }\n\n // Add to nodes\n const getNodeMenuOptions = LGraphCanvas.prototype.getNodeMenuOptions\n LGraphCanvas.prototype.getNodeMenuOptions = function (node) {\n const options = getNodeMenuOptions.apply(this, arguments)\n if (!GroupNodeHandler.isGroupNode(node)) {\n const index =\n options.findIndex((o) => o?.content === 'Outputs') + 1 ||\n options.length - 1\n addConvertOption(options, index)\n }\n return options\n }\n}\n\nconst replaceLegacySeparators = (nodes: ComfyNode[]): void => {\n for (const node of nodes) {\n if (typeof node.type === 'string' && node.type.startsWith('workflow/')) {\n node.type = node.type.replace(/^workflow\\//, `${PREFIX}${SEPARATOR}`)\n }\n }\n}\n\n/**\n * Convert selected nodes to a group node\n * @throws {Error} if no nodes are selected\n * @throws {Error} if a group node is already selected\n * @throws {Error} if a group node is selected\n *\n * The context menu item should not be available if any of the above conditions are met.\n * The error is automatically handled by the commandStore when the command is executed.\n */\nasync function convertSelectedNodesToGroupNode() {\n const nodes = Object.values(app.canvas.selected_nodes ?? {})\n if (nodes.length === 0) {\n throw new Error('No nodes selected')\n }\n if (nodes.length === 1) {\n throw new Error('Please select multiple nodes to convert to group node')\n }\n if (nodes.some((n) => GroupNodeHandler.isGroupNode(n))) {\n throw new Error('Selected nodes contain a group node')\n }\n return await GroupNodeHandler.fromNodes(nodes)\n}\n\nfunction ungroupSelectedGroupNodes() {\n const nodes = Object.values(app.canvas.selected_nodes ?? {})\n for (const node of nodes) {\n if (GroupNodeHandler.isGroupNode(node)) {\n node.convertToNodes?.()\n }\n }\n}\n\nfunction manageGroupNodes(type?: string) {\n new ManageGroupDialog(app).show(type)\n}\n\nconst id = 'Comfy.GroupNode'\nlet globalDefs\nconst ext: ComfyExtension = {\n name: id,\n commands: [\n {\n id: 'Comfy.GroupNode.ConvertSelectedNodesToGroupNode',\n label: 'Convert selected nodes to group node',\n icon: 'pi pi-sitemap',\n versionAdded: '1.3.17',\n function: convertSelectedNodesToGroupNode\n },\n {\n id: 'Comfy.GroupNode.UngroupSelectedGroupNodes',\n label: 'Ungroup selected group nodes',\n icon: 'pi pi-sitemap',\n versionAdded: '1.3.17',\n function: ungroupSelectedGroupNodes\n },\n {\n id: 'Comfy.GroupNode.ManageGroupNodes',\n label: 'Manage group nodes',\n icon: 'pi pi-cog',\n versionAdded: '1.3.17',\n function: manageGroupNodes\n }\n ],\n keybindings: [\n {\n commandId: 'Comfy.GroupNode.ConvertSelectedNodesToGroupNode',\n combo: {\n alt: true,\n key: 'g'\n }\n },\n {\n commandId: 'Comfy.GroupNode.UngroupSelectedGroupNodes',\n combo: {\n alt: true,\n shift: true,\n key: 'G'\n }\n }\n ],\n setup() {\n addConvertToGroupOptions()\n },\n async beforeConfigureGraph(\n graphData: ComfyWorkflowJSON,\n missingNodeTypes: string[]\n ) {\n const nodes = graphData?.extra?.groupNodes\n if (nodes) {\n replaceLegacySeparators(graphData.nodes)\n await GroupNodeConfig.registerFromWorkflow(nodes, missingNodeTypes)\n }\n },\n addCustomNodeDefs(defs) {\n // Store this so we can mutate it later with group nodes\n globalDefs = defs\n },\n nodeCreated(node) {\n if (GroupNodeHandler.isGroupNode(node)) {\n node[GROUP] = new GroupNodeHandler(node)\n\n // Ensure group nodes pasted from other workflows are stored\n if (node.title && node[GROUP]?.groupData?.nodeData) {\n Workflow.storeGroupNode(node.title, node[GROUP].groupData.nodeData)\n }\n }\n },\n async refreshComboInNodes(defs) {\n // Re-register group nodes so new ones are created with the correct options\n Object.assign(globalDefs, defs)\n const nodes = app.graph.extra?.groupNodes\n if (nodes) {\n await GroupNodeConfig.registerFromWorkflow(nodes, {})\n }\n }\n}\n\napp.registerExtension(ext)\n","// @ts-strict-ignore\nimport { LGraphGroup } from '@comfyorg/litegraph'\nimport { LGraphCanvas } from '@comfyorg/litegraph'\nimport type { LGraphNode } from '@comfyorg/litegraph'\nimport type { Positionable } from '@comfyorg/litegraph/dist/interfaces'\n\nimport { useSettingStore } from '@/stores/settingStore'\n\nimport { app } from '../../scripts/app'\n\nfunction setNodeMode(node: LGraphNode, mode: number) {\n node.mode = mode\n node.graph?.change()\n}\n\nfunction addNodesToGroup(group: LGraphGroup, items: Iterable) {\n const padding = useSettingStore().get('Comfy.GroupSelectedNodes.Padding')\n group.resizeTo([...group.children, ...items], padding)\n}\n\napp.registerExtension({\n name: 'Comfy.GroupOptions',\n setup() {\n const orig = LGraphCanvas.prototype.getCanvasMenuOptions\n // graph_mouse\n LGraphCanvas.prototype.getCanvasMenuOptions = function (\n this: LGraphCanvas\n ) {\n const options = orig.apply(this, arguments)\n const group = this.graph.getGroupOnPos(\n this.graph_mouse[0],\n this.graph_mouse[1]\n )\n if (!group) {\n options.push({\n content: 'Add Group For Selected Nodes',\n disabled: !this.selectedItems?.size,\n callback: () => {\n const group = new LGraphGroup()\n addNodesToGroup(group, this.selectedItems)\n this.graph.add(group)\n this.graph.change()\n }\n })\n\n return options\n }\n\n // Group nodes aren't recomputed until the group is moved, this ensures the nodes are up-to-date\n group.recomputeInsideNodes()\n const nodesInGroup = group.nodes\n\n options.push({\n content: 'Add Selected Nodes To Group',\n disabled: !this.selectedItems?.size,\n callback: () => {\n addNodesToGroup(group, this.selectedItems)\n this.graph.change()\n }\n })\n\n // No nodes in group, return default options\n if (nodesInGroup.length === 0) {\n return options\n } else {\n // Add a separator between the default options and the group options\n options.push(null)\n }\n\n // Check if all nodes are the same mode\n let allNodesAreSameMode = true\n for (let i = 1; i < nodesInGroup.length; i++) {\n if (nodesInGroup[i].mode !== nodesInGroup[0].mode) {\n allNodesAreSameMode = false\n break\n }\n }\n\n options.push({\n content: 'Fit Group To Nodes',\n callback: () => {\n group.recomputeInsideNodes()\n const padding = useSettingStore().get(\n 'Comfy.GroupSelectedNodes.Padding'\n )\n group.resizeTo(group.children, padding)\n this.graph.change()\n }\n })\n\n options.push({\n content: 'Select Nodes',\n callback: () => {\n this.selectNodes(nodesInGroup)\n this.graph.change()\n this.canvas.focus()\n }\n })\n\n // Modes\n // 0: Always\n // 1: On Event\n // 2: Never\n // 3: On Trigger\n // 4: Bypass\n // If all nodes are the same mode, add a menu option to change the mode\n if (allNodesAreSameMode) {\n const mode = nodesInGroup[0].mode\n switch (mode) {\n case 0:\n // All nodes are always, option to disable, and bypass\n options.push({\n content: 'Set Group Nodes to Never',\n callback: () => {\n for (const node of nodesInGroup) {\n setNodeMode(node, 2)\n }\n }\n })\n options.push({\n content: 'Bypass Group Nodes',\n callback: () => {\n for (const node of nodesInGroup) {\n setNodeMode(node, 4)\n }\n }\n })\n break\n case 2:\n // All nodes are never, option to enable, and bypass\n options.push({\n content: 'Set Group Nodes to Always',\n callback: () => {\n for (const node of nodesInGroup) {\n setNodeMode(node, 0)\n }\n }\n })\n options.push({\n content: 'Bypass Group Nodes',\n callback: () => {\n for (const node of nodesInGroup) {\n setNodeMode(node, 4)\n }\n }\n })\n break\n case 4:\n // All nodes are bypass, option to enable, and disable\n options.push({\n content: 'Set Group Nodes to Always',\n callback: () => {\n for (const node of nodesInGroup) {\n setNodeMode(node, 0)\n }\n }\n })\n options.push({\n content: 'Set Group Nodes to Never',\n callback: () => {\n for (const node of nodesInGroup) {\n setNodeMode(node, 2)\n }\n }\n })\n break\n default:\n // All nodes are On Trigger or On Event(Or other?), option to disable, set to always, or bypass\n options.push({\n content: 'Set Group Nodes to Always',\n callback: () => {\n for (const node of nodesInGroup) {\n setNodeMode(node, 0)\n }\n }\n })\n options.push({\n content: 'Set Group Nodes to Never',\n callback: () => {\n for (const node of nodesInGroup) {\n setNodeMode(node, 2)\n }\n }\n })\n options.push({\n content: 'Bypass Group Nodes',\n callback: () => {\n for (const node of nodesInGroup) {\n setNodeMode(node, 4)\n }\n }\n })\n break\n }\n } else {\n // Nodes are not all the same mode, add a menu option to change the mode to always, never, or bypass\n options.push({\n content: 'Set Group Nodes to Always',\n callback: () => {\n for (const node of nodesInGroup) {\n setNodeMode(node, 0)\n }\n }\n })\n options.push({\n content: 'Set Group Nodes to Never',\n callback: () => {\n for (const node of nodesInGroup) {\n setNodeMode(node, 2)\n }\n }\n })\n options.push({\n content: 'Bypass Group Nodes',\n callback: () => {\n for (const node of nodesInGroup) {\n setNodeMode(node, 4)\n }\n }\n })\n }\n\n return options\n }\n }\n})\n","\n\n\n","\n\n\n\n\n","/**\n * @license\n * Copyright 2010-2024 Three.js Authors\n * SPDX-License-Identifier: MIT\n */\nconst REVISION = '170';\n\nconst MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };\nconst TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };\nconst CullFaceNone = 0;\nconst CullFaceBack = 1;\nconst CullFaceFront = 2;\nconst CullFaceFrontBack = 3;\nconst BasicShadowMap = 0;\nconst PCFShadowMap = 1;\nconst PCFSoftShadowMap = 2;\nconst VSMShadowMap = 3;\nconst FrontSide = 0;\nconst BackSide = 1;\nconst DoubleSide = 2;\nconst NoBlending = 0;\nconst NormalBlending = 1;\nconst AdditiveBlending = 2;\nconst SubtractiveBlending = 3;\nconst MultiplyBlending = 4;\nconst CustomBlending = 5;\nconst AddEquation = 100;\nconst SubtractEquation = 101;\nconst ReverseSubtractEquation = 102;\nconst MinEquation = 103;\nconst MaxEquation = 104;\nconst ZeroFactor = 200;\nconst OneFactor = 201;\nconst SrcColorFactor = 202;\nconst OneMinusSrcColorFactor = 203;\nconst SrcAlphaFactor = 204;\nconst OneMinusSrcAlphaFactor = 205;\nconst DstAlphaFactor = 206;\nconst OneMinusDstAlphaFactor = 207;\nconst DstColorFactor = 208;\nconst OneMinusDstColorFactor = 209;\nconst SrcAlphaSaturateFactor = 210;\nconst ConstantColorFactor = 211;\nconst OneMinusConstantColorFactor = 212;\nconst ConstantAlphaFactor = 213;\nconst OneMinusConstantAlphaFactor = 214;\nconst NeverDepth = 0;\nconst AlwaysDepth = 1;\nconst LessDepth = 2;\nconst LessEqualDepth = 3;\nconst EqualDepth = 4;\nconst GreaterEqualDepth = 5;\nconst GreaterDepth = 6;\nconst NotEqualDepth = 7;\nconst MultiplyOperation = 0;\nconst MixOperation = 1;\nconst AddOperation = 2;\nconst NoToneMapping = 0;\nconst LinearToneMapping = 1;\nconst ReinhardToneMapping = 2;\nconst CineonToneMapping = 3;\nconst ACESFilmicToneMapping = 4;\nconst CustomToneMapping = 5;\nconst AgXToneMapping = 6;\nconst NeutralToneMapping = 7;\nconst AttachedBindMode = 'attached';\nconst DetachedBindMode = 'detached';\n\nconst UVMapping = 300;\nconst CubeReflectionMapping = 301;\nconst CubeRefractionMapping = 302;\nconst EquirectangularReflectionMapping = 303;\nconst EquirectangularRefractionMapping = 304;\nconst CubeUVReflectionMapping = 306;\nconst RepeatWrapping = 1000;\nconst ClampToEdgeWrapping = 1001;\nconst MirroredRepeatWrapping = 1002;\nconst NearestFilter = 1003;\nconst NearestMipmapNearestFilter = 1004;\nconst NearestMipMapNearestFilter = 1004;\nconst NearestMipmapLinearFilter = 1005;\nconst NearestMipMapLinearFilter = 1005;\nconst LinearFilter = 1006;\nconst LinearMipmapNearestFilter = 1007;\nconst LinearMipMapNearestFilter = 1007;\nconst LinearMipmapLinearFilter = 1008;\nconst LinearMipMapLinearFilter = 1008;\nconst UnsignedByteType = 1009;\nconst ByteType = 1010;\nconst ShortType = 1011;\nconst UnsignedShortType = 1012;\nconst IntType = 1013;\nconst UnsignedIntType = 1014;\nconst FloatType = 1015;\nconst HalfFloatType = 1016;\nconst UnsignedShort4444Type = 1017;\nconst UnsignedShort5551Type = 1018;\nconst UnsignedInt248Type = 1020;\nconst UnsignedInt5999Type = 35902;\nconst AlphaFormat = 1021;\nconst RGBFormat = 1022;\nconst RGBAFormat = 1023;\nconst LuminanceFormat = 1024;\nconst LuminanceAlphaFormat = 1025;\nconst DepthFormat = 1026;\nconst DepthStencilFormat = 1027;\nconst RedFormat = 1028;\nconst RedIntegerFormat = 1029;\nconst RGFormat = 1030;\nconst RGIntegerFormat = 1031;\nconst RGBIntegerFormat = 1032;\nconst RGBAIntegerFormat = 1033;\n\nconst RGB_S3TC_DXT1_Format = 33776;\nconst RGBA_S3TC_DXT1_Format = 33777;\nconst RGBA_S3TC_DXT3_Format = 33778;\nconst RGBA_S3TC_DXT5_Format = 33779;\nconst RGB_PVRTC_4BPPV1_Format = 35840;\nconst RGB_PVRTC_2BPPV1_Format = 35841;\nconst RGBA_PVRTC_4BPPV1_Format = 35842;\nconst RGBA_PVRTC_2BPPV1_Format = 35843;\nconst RGB_ETC1_Format = 36196;\nconst RGB_ETC2_Format = 37492;\nconst RGBA_ETC2_EAC_Format = 37496;\nconst RGBA_ASTC_4x4_Format = 37808;\nconst RGBA_ASTC_5x4_Format = 37809;\nconst RGBA_ASTC_5x5_Format = 37810;\nconst RGBA_ASTC_6x5_Format = 37811;\nconst RGBA_ASTC_6x6_Format = 37812;\nconst RGBA_ASTC_8x5_Format = 37813;\nconst RGBA_ASTC_8x6_Format = 37814;\nconst RGBA_ASTC_8x8_Format = 37815;\nconst RGBA_ASTC_10x5_Format = 37816;\nconst RGBA_ASTC_10x6_Format = 37817;\nconst RGBA_ASTC_10x8_Format = 37818;\nconst RGBA_ASTC_10x10_Format = 37819;\nconst RGBA_ASTC_12x10_Format = 37820;\nconst RGBA_ASTC_12x12_Format = 37821;\nconst RGBA_BPTC_Format = 36492;\nconst RGB_BPTC_SIGNED_Format = 36494;\nconst RGB_BPTC_UNSIGNED_Format = 36495;\nconst RED_RGTC1_Format = 36283;\nconst SIGNED_RED_RGTC1_Format = 36284;\nconst RED_GREEN_RGTC2_Format = 36285;\nconst SIGNED_RED_GREEN_RGTC2_Format = 36286;\nconst LoopOnce = 2200;\nconst LoopRepeat = 2201;\nconst LoopPingPong = 2202;\nconst InterpolateDiscrete = 2300;\nconst InterpolateLinear = 2301;\nconst InterpolateSmooth = 2302;\nconst ZeroCurvatureEnding = 2400;\nconst ZeroSlopeEnding = 2401;\nconst WrapAroundEnding = 2402;\nconst NormalAnimationBlendMode = 2500;\nconst AdditiveAnimationBlendMode = 2501;\nconst TrianglesDrawMode = 0;\nconst TriangleStripDrawMode = 1;\nconst TriangleFanDrawMode = 2;\nconst BasicDepthPacking = 3200;\nconst RGBADepthPacking = 3201;\nconst RGBDepthPacking = 3202;\nconst RGDepthPacking = 3203;\nconst TangentSpaceNormalMap = 0;\nconst ObjectSpaceNormalMap = 1;\n\n// Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available.\nconst NoColorSpace = '';\nconst SRGBColorSpace = 'srgb';\nconst LinearSRGBColorSpace = 'srgb-linear';\n\nconst LinearTransfer = 'linear';\nconst SRGBTransfer = 'srgb';\n\nconst ZeroStencilOp = 0;\nconst KeepStencilOp = 7680;\nconst ReplaceStencilOp = 7681;\nconst IncrementStencilOp = 7682;\nconst DecrementStencilOp = 7683;\nconst IncrementWrapStencilOp = 34055;\nconst DecrementWrapStencilOp = 34056;\nconst InvertStencilOp = 5386;\n\nconst NeverStencilFunc = 512;\nconst LessStencilFunc = 513;\nconst EqualStencilFunc = 514;\nconst LessEqualStencilFunc = 515;\nconst GreaterStencilFunc = 516;\nconst NotEqualStencilFunc = 517;\nconst GreaterEqualStencilFunc = 518;\nconst AlwaysStencilFunc = 519;\n\nconst NeverCompare = 512;\nconst LessCompare = 513;\nconst EqualCompare = 514;\nconst LessEqualCompare = 515;\nconst GreaterCompare = 516;\nconst NotEqualCompare = 517;\nconst GreaterEqualCompare = 518;\nconst AlwaysCompare = 519;\n\nconst StaticDrawUsage = 35044;\nconst DynamicDrawUsage = 35048;\nconst StreamDrawUsage = 35040;\nconst StaticReadUsage = 35045;\nconst DynamicReadUsage = 35049;\nconst StreamReadUsage = 35041;\nconst StaticCopyUsage = 35046;\nconst DynamicCopyUsage = 35050;\nconst StreamCopyUsage = 35042;\n\nconst GLSL1 = '100';\nconst GLSL3 = '300 es';\n\nconst WebGLCoordinateSystem = 2000;\nconst WebGPUCoordinateSystem = 2001;\n\n/**\n * https://github.com/mrdoob/eventdispatcher.js/\n */\n\nclass EventDispatcher {\n\n\taddEventListener( type, listener ) {\n\n\t\tif ( this._listeners === undefined ) this._listeners = {};\n\n\t\tconst listeners = this._listeners;\n\n\t\tif ( listeners[ type ] === undefined ) {\n\n\t\t\tlisteners[ type ] = [];\n\n\t\t}\n\n\t\tif ( listeners[ type ].indexOf( listener ) === - 1 ) {\n\n\t\t\tlisteners[ type ].push( listener );\n\n\t\t}\n\n\t}\n\n\thasEventListener( type, listener ) {\n\n\t\tif ( this._listeners === undefined ) return false;\n\n\t\tconst listeners = this._listeners;\n\n\t\treturn listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1;\n\n\t}\n\n\tremoveEventListener( type, listener ) {\n\n\t\tif ( this._listeners === undefined ) return;\n\n\t\tconst listeners = this._listeners;\n\t\tconst listenerArray = listeners[ type ];\n\n\t\tif ( listenerArray !== undefined ) {\n\n\t\t\tconst index = listenerArray.indexOf( listener );\n\n\t\t\tif ( index !== - 1 ) {\n\n\t\t\t\tlistenerArray.splice( index, 1 );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tdispatchEvent( event ) {\n\n\t\tif ( this._listeners === undefined ) return;\n\n\t\tconst listeners = this._listeners;\n\t\tconst listenerArray = listeners[ event.type ];\n\n\t\tif ( listenerArray !== undefined ) {\n\n\t\t\tevent.target = this;\n\n\t\t\t// Make a copy, in case listeners are removed while iterating.\n\t\t\tconst array = listenerArray.slice( 0 );\n\n\t\t\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\n\n\t\t\t\tarray[ i ].call( this, event );\n\n\t\t\t}\n\n\t\t\tevent.target = null;\n\n\t\t}\n\n\t}\n\n}\n\nconst _lut = [ '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff' ];\n\nlet _seed = 1234567;\n\n\nconst DEG2RAD = Math.PI / 180;\nconst RAD2DEG = 180 / Math.PI;\n\n// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\nfunction generateUUID() {\n\n\tconst d0 = Math.random() * 0xffffffff | 0;\n\tconst d1 = Math.random() * 0xffffffff | 0;\n\tconst d2 = Math.random() * 0xffffffff | 0;\n\tconst d3 = Math.random() * 0xffffffff | 0;\n\tconst uuid = _lut[ d0 & 0xff ] + _lut[ d0 >> 8 & 0xff ] + _lut[ d0 >> 16 & 0xff ] + _lut[ d0 >> 24 & 0xff ] + '-' +\n\t\t\t_lut[ d1 & 0xff ] + _lut[ d1 >> 8 & 0xff ] + '-' + _lut[ d1 >> 16 & 0x0f | 0x40 ] + _lut[ d1 >> 24 & 0xff ] + '-' +\n\t\t\t_lut[ d2 & 0x3f | 0x80 ] + _lut[ d2 >> 8 & 0xff ] + '-' + _lut[ d2 >> 16 & 0xff ] + _lut[ d2 >> 24 & 0xff ] +\n\t\t\t_lut[ d3 & 0xff ] + _lut[ d3 >> 8 & 0xff ] + _lut[ d3 >> 16 & 0xff ] + _lut[ d3 >> 24 & 0xff ];\n\n\t// .toLowerCase() here flattens concatenated strings to save heap memory space.\n\treturn uuid.toLowerCase();\n\n}\n\nfunction clamp( value, min, max ) {\n\n\treturn Math.max( min, Math.min( max, value ) );\n\n}\n\n// compute euclidean modulo of m % n\n// https://en.wikipedia.org/wiki/Modulo_operation\nfunction euclideanModulo( n, m ) {\n\n\treturn ( ( n % m ) + m ) % m;\n\n}\n\n// Linear mapping from range to range \nfunction mapLinear( x, a1, a2, b1, b2 ) {\n\n\treturn b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 );\n\n}\n\n// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\nfunction inverseLerp( x, y, value ) {\n\n\tif ( x !== y ) {\n\n\t\treturn ( value - x ) / ( y - x );\n\n\t} else {\n\n\t\treturn 0;\n\n\t}\n\n}\n\n// https://en.wikipedia.org/wiki/Linear_interpolation\nfunction lerp( x, y, t ) {\n\n\treturn ( 1 - t ) * x + t * y;\n\n}\n\n// http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\nfunction damp( x, y, lambda, dt ) {\n\n\treturn lerp( x, y, 1 - Math.exp( - lambda * dt ) );\n\n}\n\n// https://www.desmos.com/calculator/vcsjnyz7x4\nfunction pingpong( x, length = 1 ) {\n\n\treturn length - Math.abs( euclideanModulo( x, length * 2 ) - length );\n\n}\n\n// http://en.wikipedia.org/wiki/Smoothstep\nfunction smoothstep( x, min, max ) {\n\n\tif ( x <= min ) return 0;\n\tif ( x >= max ) return 1;\n\n\tx = ( x - min ) / ( max - min );\n\n\treturn x * x * ( 3 - 2 * x );\n\n}\n\nfunction smootherstep( x, min, max ) {\n\n\tif ( x <= min ) return 0;\n\tif ( x >= max ) return 1;\n\n\tx = ( x - min ) / ( max - min );\n\n\treturn x * x * x * ( x * ( x * 6 - 15 ) + 10 );\n\n}\n\n// Random integer from interval\nfunction randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}\n\n// Random float from interval\nfunction randFloat( low, high ) {\n\n\treturn low + Math.random() * ( high - low );\n\n}\n\n// Random float from <-range/2, range/2> interval\nfunction randFloatSpread( range ) {\n\n\treturn range * ( 0.5 - Math.random() );\n\n}\n\n// Deterministic pseudo-random float in the interval [ 0, 1 ]\nfunction seededRandom( s ) {\n\n\tif ( s !== undefined ) _seed = s;\n\n\t// Mulberry32 generator\n\n\tlet t = _seed += 0x6D2B79F5;\n\n\tt = Math.imul( t ^ t >>> 15, t | 1 );\n\n\tt ^= t + Math.imul( t ^ t >>> 7, t | 61 );\n\n\treturn ( ( t ^ t >>> 14 ) >>> 0 ) / 4294967296;\n\n}\n\nfunction degToRad( degrees ) {\n\n\treturn degrees * DEG2RAD;\n\n}\n\nfunction radToDeg( radians ) {\n\n\treturn radians * RAD2DEG;\n\n}\n\nfunction isPowerOfTwo( value ) {\n\n\treturn ( value & ( value - 1 ) ) === 0 && value !== 0;\n\n}\n\nfunction ceilPowerOfTwo( value ) {\n\n\treturn Math.pow( 2, Math.ceil( Math.log( value ) / Math.LN2 ) );\n\n}\n\nfunction floorPowerOfTwo( value ) {\n\n\treturn Math.pow( 2, Math.floor( Math.log( value ) / Math.LN2 ) );\n\n}\n\nfunction setQuaternionFromProperEuler( q, a, b, c, order ) {\n\n\t// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n\n\t// rotations are applied to the axes in the order specified by 'order'\n\t// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n\t// angles are in radians\n\n\tconst cos = Math.cos;\n\tconst sin = Math.sin;\n\n\tconst c2 = cos( b / 2 );\n\tconst s2 = sin( b / 2 );\n\n\tconst c13 = cos( ( a + c ) / 2 );\n\tconst s13 = sin( ( a + c ) / 2 );\n\n\tconst c1_3 = cos( ( a - c ) / 2 );\n\tconst s1_3 = sin( ( a - c ) / 2 );\n\n\tconst c3_1 = cos( ( c - a ) / 2 );\n\tconst s3_1 = sin( ( c - a ) / 2 );\n\n\tswitch ( order ) {\n\n\t\tcase 'XYX':\n\t\t\tq.set( c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'YZY':\n\t\t\tq.set( s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'ZXZ':\n\t\t\tq.set( s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'XZX':\n\t\t\tq.set( c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'YXY':\n\t\t\tq.set( s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'ZYZ':\n\t\t\tq.set( s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13 );\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order );\n\n\t}\n\n}\n\nfunction denormalize( value, array ) {\n\n\tswitch ( array.constructor ) {\n\n\t\tcase Float32Array:\n\n\t\t\treturn value;\n\n\t\tcase Uint32Array:\n\n\t\t\treturn value / 4294967295.0;\n\n\t\tcase Uint16Array:\n\n\t\t\treturn value / 65535.0;\n\n\t\tcase Uint8Array:\n\n\t\t\treturn value / 255.0;\n\n\t\tcase Int32Array:\n\n\t\t\treturn Math.max( value / 2147483647.0, - 1.0 );\n\n\t\tcase Int16Array:\n\n\t\t\treturn Math.max( value / 32767.0, - 1.0 );\n\n\t\tcase Int8Array:\n\n\t\t\treturn Math.max( value / 127.0, - 1.0 );\n\n\t\tdefault:\n\n\t\t\tthrow new Error( 'Invalid component type.' );\n\n\t}\n\n}\n\nfunction normalize( value, array ) {\n\n\tswitch ( array.constructor ) {\n\n\t\tcase Float32Array:\n\n\t\t\treturn value;\n\n\t\tcase Uint32Array:\n\n\t\t\treturn Math.round( value * 4294967295.0 );\n\n\t\tcase Uint16Array:\n\n\t\t\treturn Math.round( value * 65535.0 );\n\n\t\tcase Uint8Array:\n\n\t\t\treturn Math.round( value * 255.0 );\n\n\t\tcase Int32Array:\n\n\t\t\treturn Math.round( value * 2147483647.0 );\n\n\t\tcase Int16Array:\n\n\t\t\treturn Math.round( value * 32767.0 );\n\n\t\tcase Int8Array:\n\n\t\t\treturn Math.round( value * 127.0 );\n\n\t\tdefault:\n\n\t\t\tthrow new Error( 'Invalid component type.' );\n\n\t}\n\n}\n\nconst MathUtils = {\n\tDEG2RAD: DEG2RAD,\n\tRAD2DEG: RAD2DEG,\n\tgenerateUUID: generateUUID,\n\tclamp: clamp,\n\teuclideanModulo: euclideanModulo,\n\tmapLinear: mapLinear,\n\tinverseLerp: inverseLerp,\n\tlerp: lerp,\n\tdamp: damp,\n\tpingpong: pingpong,\n\tsmoothstep: smoothstep,\n\tsmootherstep: smootherstep,\n\trandInt: randInt,\n\trandFloat: randFloat,\n\trandFloatSpread: randFloatSpread,\n\tseededRandom: seededRandom,\n\tdegToRad: degToRad,\n\tradToDeg: radToDeg,\n\tisPowerOfTwo: isPowerOfTwo,\n\tceilPowerOfTwo: ceilPowerOfTwo,\n\tfloorPowerOfTwo: floorPowerOfTwo,\n\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler,\n\tnormalize: normalize,\n\tdenormalize: denormalize\n};\n\nclass Vector2 {\n\n\tconstructor( x = 0, y = 0 ) {\n\n\t\tVector2.prototype.isVector2 = true;\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t}\n\n\tget width() {\n\n\t\treturn this.x;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.x = value;\n\n\t}\n\n\tget height() {\n\n\t\treturn this.y;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.y = value;\n\n\t}\n\n\tset( x, y ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y );\n\n\t}\n\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\n\t\treturn this;\n\n\t}\n\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\n\t\treturn this;\n\n\t}\n\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\n\t\treturn this;\n\n\t}\n\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\n\t\treturn this;\n\n\t}\n\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\n\t\treturn this;\n\n\t}\n\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\n\t\treturn this;\n\n\t}\n\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\tapplyMatrix3( m ) {\n\n\t\tconst x = this.x, y = this.y;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ];\n\t\tthis.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ];\n\n\t\treturn this;\n\n\t}\n\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\n\t\treturn this;\n\n\t}\n\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\n\t\treturn this;\n\n\t}\n\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = Math.max( minVal, Math.min( maxVal, this.x ) );\n\t\tthis.y = Math.max( minVal, Math.min( maxVal, this.y ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );\n\n\t}\n\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\n\t\treturn this;\n\n\t}\n\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\n\t\treturn this;\n\n\t}\n\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\n\t\treturn this;\n\n\t}\n\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y;\n\n\t}\n\n\tcross( v ) {\n\n\t\treturn this.x * v.y - this.y * v.x;\n\n\t}\n\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y );\n\n\t}\n\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y );\n\n\t}\n\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\tangle() {\n\n\t\t// computes the angle in radians with respect to the positive x-axis\n\n\t\tconst angle = Math.atan2( - this.y, - this.x ) + Math.PI;\n\n\t\treturn angle;\n\n\t}\n\n\tangleTo( v ) {\n\n\t\tconst denominator = Math.sqrt( this.lengthSq() * v.lengthSq() );\n\n\t\tif ( denominator === 0 ) return Math.PI / 2;\n\n\t\tconst theta = this.dot( v ) / denominator;\n\n\t\t// clamp, to handle numerical problems\n\n\t\treturn Math.acos( clamp( theta, - 1, 1 ) );\n\n\t}\n\n\tdistanceTo( v ) {\n\n\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t}\n\n\tdistanceToSquared( v ) {\n\n\t\tconst dx = this.x - v.x, dy = this.y - v.y;\n\t\treturn dx * dx + dy * dy;\n\n\t}\n\n\tmanhattanDistanceTo( v ) {\n\n\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y );\n\n\t}\n\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\n\t\treturn this;\n\n\t}\n\n\trotateAround( center, angle ) {\n\n\t\tconst c = Math.cos( angle ), s = Math.sin( angle );\n\n\t\tconst x = this.x - center.x;\n\t\tconst y = this.y - center.y;\n\n\t\tthis.x = x * c - y * s + center.x;\n\t\tthis.y = x * s + y * c + center.y;\n\n\t\treturn this;\n\n\t}\n\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\n\t}\n\n}\n\nclass Matrix3 {\n\n\tconstructor( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {\n\n\t\tMatrix3.prototype.isMatrix3 = true;\n\n\t\tthis.elements = [\n\n\t\t\t1, 0, 0,\n\t\t\t0, 1, 0,\n\t\t\t0, 0, 1\n\n\t\t];\n\n\t\tif ( n11 !== undefined ) {\n\n\t\t\tthis.set( n11, n12, n13, n21, n22, n23, n31, n32, n33 );\n\n\t\t}\n\n\t}\n\n\tset( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31;\n\t\tte[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32;\n\t\tte[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33;\n\n\t\treturn this;\n\n\t}\n\n\tidentity() {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0,\n\t\t\t0, 1, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tcopy( m ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tte[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ];\n\t\tte[ 3 ] = me[ 3 ]; te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ];\n\t\tte[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; te[ 8 ] = me[ 8 ];\n\n\t\treturn this;\n\n\t}\n\n\textractBasis( xAxis, yAxis, zAxis ) {\n\n\t\txAxis.setFromMatrix3Column( this, 0 );\n\t\tyAxis.setFromMatrix3Column( this, 1 );\n\t\tzAxis.setFromMatrix3Column( this, 2 );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrix4( m ) {\n\n\t\tconst me = m.elements;\n\n\t\tthis.set(\n\n\t\t\tme[ 0 ], me[ 4 ], me[ 8 ],\n\t\t\tme[ 1 ], me[ 5 ], me[ 9 ],\n\t\t\tme[ 2 ], me[ 6 ], me[ 10 ]\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( m ) {\n\n\t\treturn this.multiplyMatrices( this, m );\n\n\t}\n\n\tpremultiply( m ) {\n\n\t\treturn this.multiplyMatrices( m, this );\n\n\t}\n\n\tmultiplyMatrices( a, b ) {\n\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\n\t\tconst a11 = ae[ 0 ], a12 = ae[ 3 ], a13 = ae[ 6 ];\n\t\tconst a21 = ae[ 1 ], a22 = ae[ 4 ], a23 = ae[ 7 ];\n\t\tconst a31 = ae[ 2 ], a32 = ae[ 5 ], a33 = ae[ 8 ];\n\n\t\tconst b11 = be[ 0 ], b12 = be[ 3 ], b13 = be[ 6 ];\n\t\tconst b21 = be[ 1 ], b22 = be[ 4 ], b23 = be[ 7 ];\n\t\tconst b31 = be[ 2 ], b32 = be[ 5 ], b33 = be[ 8 ];\n\n\t\tte[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\tte[ 3 ] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\tte[ 6 ] = a11 * b13 + a12 * b23 + a13 * b33;\n\n\t\tte[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\tte[ 4 ] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\tte[ 7 ] = a21 * b13 + a22 * b23 + a23 * b33;\n\n\t\tte[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\tte[ 5 ] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\tte[ 8 ] = a31 * b13 + a32 * b23 + a33 * b33;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( s ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s;\n\t\tte[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s;\n\t\tte[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s;\n\n\t\treturn this;\n\n\t}\n\n\tdeterminant() {\n\n\t\tconst te = this.elements;\n\n\t\tconst a = te[ 0 ], b = te[ 1 ], c = te[ 2 ],\n\t\t\td = te[ 3 ], e = te[ 4 ], f = te[ 5 ],\n\t\t\tg = te[ 6 ], h = te[ 7 ], i = te[ 8 ];\n\n\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\n\t}\n\n\tinvert() {\n\n\t\tconst te = this.elements,\n\n\t\t\tn11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ],\n\t\t\tn12 = te[ 3 ], n22 = te[ 4 ], n32 = te[ 5 ],\n\t\t\tn13 = te[ 6 ], n23 = te[ 7 ], n33 = te[ 8 ],\n\n\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\tt13 = n23 * n12 - n22 * n13,\n\n\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\n\t\tif ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 );\n\n\t\tconst detInv = 1 / det;\n\n\t\tte[ 0 ] = t11 * detInv;\n\t\tte[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv;\n\t\tte[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv;\n\n\t\tte[ 3 ] = t12 * detInv;\n\t\tte[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv;\n\t\tte[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv;\n\n\t\tte[ 6 ] = t13 * detInv;\n\t\tte[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv;\n\t\tte[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv;\n\n\t\treturn this;\n\n\t}\n\n\ttranspose() {\n\n\t\tlet tmp;\n\t\tconst m = this.elements;\n\n\t\ttmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp;\n\t\ttmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp;\n\t\ttmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp;\n\n\t\treturn this;\n\n\t}\n\n\tgetNormalMatrix( matrix4 ) {\n\n\t\treturn this.setFromMatrix4( matrix4 ).invert().transpose();\n\n\t}\n\n\ttransposeIntoArray( r ) {\n\n\t\tconst m = this.elements;\n\n\t\tr[ 0 ] = m[ 0 ];\n\t\tr[ 1 ] = m[ 3 ];\n\t\tr[ 2 ] = m[ 6 ];\n\t\tr[ 3 ] = m[ 1 ];\n\t\tr[ 4 ] = m[ 4 ];\n\t\tr[ 5 ] = m[ 7 ];\n\t\tr[ 6 ] = m[ 2 ];\n\t\tr[ 7 ] = m[ 5 ];\n\t\tr[ 8 ] = m[ 8 ];\n\n\t\treturn this;\n\n\t}\n\n\tsetUvTransform( tx, ty, sx, sy, rotation, cx, cy ) {\n\n\t\tconst c = Math.cos( rotation );\n\t\tconst s = Math.sin( rotation );\n\n\t\tthis.set(\n\t\t\tsx * c, sx * s, - sx * ( c * cx + s * cy ) + cx + tx,\n\t\t\t- sy * s, sy * c, - sy * ( - s * cx + c * cy ) + cy + ty,\n\t\t\t0, 0, 1\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t//\n\n\tscale( sx, sy ) {\n\n\t\tthis.premultiply( _m3.makeScale( sx, sy ) );\n\n\t\treturn this;\n\n\t}\n\n\trotate( theta ) {\n\n\t\tthis.premultiply( _m3.makeRotation( - theta ) );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( tx, ty ) {\n\n\t\tthis.premultiply( _m3.makeTranslation( tx, ty ) );\n\n\t\treturn this;\n\n\t}\n\n\t// for 2D Transforms\n\n\tmakeTranslation( x, y ) {\n\n\t\tif ( x.isVector2 ) {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, x.x,\n\t\t\t\t0, 1, x.y,\n\t\t\t\t0, 0, 1\n\n\t\t\t);\n\n\t\t} else {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, x,\n\t\t\t\t0, 1, y,\n\t\t\t\t0, 0, 1\n\n\t\t\t);\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotation( theta ) {\n\n\t\t// counterclockwise\n\n\t\tconst c = Math.cos( theta );\n\t\tconst s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\tc, - s, 0,\n\t\t\ts, c, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeScale( x, y ) {\n\n\t\tthis.set(\n\n\t\t\tx, 0, 0,\n\t\t\t0, y, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t//\n\n\tequals( matrix ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tif ( te[ i ] !== me[ i ] ) return false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst te = this.elements;\n\n\t\tarray[ offset ] = te[ 0 ];\n\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\tarray[ offset + 2 ] = te[ 2 ];\n\n\t\tarray[ offset + 3 ] = te[ 3 ];\n\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\tarray[ offset + 5 ] = te[ 5 ];\n\n\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\tarray[ offset + 7 ] = te[ 7 ];\n\t\tarray[ offset + 8 ] = te[ 8 ];\n\n\t\treturn array;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().fromArray( this.elements );\n\n\t}\n\n}\n\nconst _m3 = /*@__PURE__*/ new Matrix3();\n\nfunction arrayNeedsUint32( array ) {\n\n\t// assumes larger values usually on last\n\n\tfor ( let i = array.length - 1; i >= 0; -- i ) {\n\n\t\tif ( array[ i ] >= 65535 ) return true; // account for PRIMITIVE_RESTART_FIXED_INDEX, #24565\n\n\t}\n\n\treturn false;\n\n}\n\nconst TYPED_ARRAYS = {\n\tInt8Array: Int8Array,\n\tUint8Array: Uint8Array,\n\tUint8ClampedArray: Uint8ClampedArray,\n\tInt16Array: Int16Array,\n\tUint16Array: Uint16Array,\n\tInt32Array: Int32Array,\n\tUint32Array: Uint32Array,\n\tFloat32Array: Float32Array,\n\tFloat64Array: Float64Array\n};\n\nfunction getTypedArray( type, buffer ) {\n\n\treturn new TYPED_ARRAYS[ type ]( buffer );\n\n}\n\nfunction createElementNS( name ) {\n\n\treturn document.createElementNS( 'http://www.w3.org/1999/xhtml', name );\n\n}\n\nfunction createCanvasElement() {\n\n\tconst canvas = createElementNS( 'canvas' );\n\tcanvas.style.display = 'block';\n\treturn canvas;\n\n}\n\nconst _cache = {};\n\nfunction warnOnce( message ) {\n\n\tif ( message in _cache ) return;\n\n\t_cache[ message ] = true;\n\n\tconsole.warn( message );\n\n}\n\nfunction probeAsync( gl, sync, interval ) {\n\n\treturn new Promise( function ( resolve, reject ) {\n\n\t\tfunction probe() {\n\n\t\t\tswitch ( gl.clientWaitSync( sync, gl.SYNC_FLUSH_COMMANDS_BIT, 0 ) ) {\n\n\t\t\t\tcase gl.WAIT_FAILED:\n\t\t\t\t\treject();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gl.TIMEOUT_EXPIRED:\n\t\t\t\t\tsetTimeout( probe, interval );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tresolve();\n\n\t\t\t}\n\n\t\t}\n\n\t\tsetTimeout( probe, interval );\n\n\t} );\n\n}\n\nfunction toNormalizedProjectionMatrix( projectionMatrix ) {\n\n\tconst m = projectionMatrix.elements;\n\n\t// Convert [-1, 1] to [0, 1] projection matrix\n\tm[ 2 ] = 0.5 * m[ 2 ] + 0.5 * m[ 3 ];\n\tm[ 6 ] = 0.5 * m[ 6 ] + 0.5 * m[ 7 ];\n\tm[ 10 ] = 0.5 * m[ 10 ] + 0.5 * m[ 11 ];\n\tm[ 14 ] = 0.5 * m[ 14 ] + 0.5 * m[ 15 ];\n\n}\n\nfunction toReversedProjectionMatrix( projectionMatrix ) {\n\n\tconst m = projectionMatrix.elements;\n\tconst isPerspectiveMatrix = m[ 11 ] === - 1;\n\n\t// Reverse [0, 1] projection matrix\n\tif ( isPerspectiveMatrix ) {\n\n\t\tm[ 10 ] = - m[ 10 ] - 1;\n\t\tm[ 14 ] = - m[ 14 ];\n\n\t} else {\n\n\t\tm[ 10 ] = - m[ 10 ];\n\t\tm[ 14 ] = - m[ 14 ] + 1;\n\n\t}\n\n}\n\nconst ColorManagement = {\n\n\tenabled: true,\n\n\tworkingColorSpace: LinearSRGBColorSpace,\n\n\t/**\n\t * Implementations of supported color spaces.\n\t *\n\t * Required:\n\t *\t- primaries: chromaticity coordinates [ rx ry gx gy bx by ]\n\t *\t- whitePoint: reference white [ x y ]\n\t *\t- transfer: transfer function (pre-defined)\n\t *\t- toXYZ: Matrix3 RGB to XYZ transform\n\t *\t- fromXYZ: Matrix3 XYZ to RGB transform\n\t *\t- luminanceCoefficients: RGB luminance coefficients\n\t *\n\t * Optional:\n\t * - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace }\n\t * - workingColorSpaceConfig: { unpackColorSpace: ColorSpace }\n\t *\n\t * Reference:\n\t * - https://www.russellcottrell.com/photo/matrixCalculator.htm\n\t */\n\tspaces: {},\n\n\tconvert: function ( color, sourceColorSpace, targetColorSpace ) {\n\n\t\tif ( this.enabled === false || sourceColorSpace === targetColorSpace || ! sourceColorSpace || ! targetColorSpace ) {\n\n\t\t\treturn color;\n\n\t\t}\n\n\t\tif ( this.spaces[ sourceColorSpace ].transfer === SRGBTransfer ) {\n\n\t\t\tcolor.r = SRGBToLinear( color.r );\n\t\t\tcolor.g = SRGBToLinear( color.g );\n\t\t\tcolor.b = SRGBToLinear( color.b );\n\n\t\t}\n\n\t\tif ( this.spaces[ sourceColorSpace ].primaries !== this.spaces[ targetColorSpace ].primaries ) {\n\n\t\t\tcolor.applyMatrix3( this.spaces[ sourceColorSpace ].toXYZ );\n\t\t\tcolor.applyMatrix3( this.spaces[ targetColorSpace ].fromXYZ );\n\n\t\t}\n\n\t\tif ( this.spaces[ targetColorSpace ].transfer === SRGBTransfer ) {\n\n\t\t\tcolor.r = LinearToSRGB( color.r );\n\t\t\tcolor.g = LinearToSRGB( color.g );\n\t\t\tcolor.b = LinearToSRGB( color.b );\n\n\t\t}\n\n\t\treturn color;\n\n\t},\n\n\tfromWorkingColorSpace: function ( color, targetColorSpace ) {\n\n\t\treturn this.convert( color, this.workingColorSpace, targetColorSpace );\n\n\t},\n\n\ttoWorkingColorSpace: function ( color, sourceColorSpace ) {\n\n\t\treturn this.convert( color, sourceColorSpace, this.workingColorSpace );\n\n\t},\n\n\tgetPrimaries: function ( colorSpace ) {\n\n\t\treturn this.spaces[ colorSpace ].primaries;\n\n\t},\n\n\tgetTransfer: function ( colorSpace ) {\n\n\t\tif ( colorSpace === NoColorSpace ) return LinearTransfer;\n\n\t\treturn this.spaces[ colorSpace ].transfer;\n\n\t},\n\n\tgetLuminanceCoefficients: function ( target, colorSpace = this.workingColorSpace ) {\n\n\t\treturn target.fromArray( this.spaces[ colorSpace ].luminanceCoefficients );\n\n\t},\n\n\tdefine: function ( colorSpaces ) {\n\n\t\tObject.assign( this.spaces, colorSpaces );\n\n\t},\n\n\t// Internal APIs\n\n\t_getMatrix: function ( targetMatrix, sourceColorSpace, targetColorSpace ) {\n\n\t\treturn targetMatrix\n\t\t\t.copy( this.spaces[ sourceColorSpace ].toXYZ )\n\t\t\t.multiply( this.spaces[ targetColorSpace ].fromXYZ );\n\n\t},\n\n\t_getDrawingBufferColorSpace: function ( colorSpace ) {\n\n\t\treturn this.spaces[ colorSpace ].outputColorSpaceConfig.drawingBufferColorSpace;\n\n\t},\n\n\t_getUnpackColorSpace: function ( colorSpace = this.workingColorSpace ) {\n\n\t\treturn this.spaces[ colorSpace ].workingColorSpaceConfig.unpackColorSpace;\n\n\t}\n\n};\n\nfunction SRGBToLinear( c ) {\n\n\treturn ( c < 0.04045 ) ? c * 0.0773993808 : Math.pow( c * 0.9478672986 + 0.0521327014, 2.4 );\n\n}\n\nfunction LinearToSRGB( c ) {\n\n\treturn ( c < 0.0031308 ) ? c * 12.92 : 1.055 * ( Math.pow( c, 0.41666 ) ) - 0.055;\n\n}\n\n/******************************************************************************\n * sRGB definitions\n */\n\nconst REC709_PRIMARIES = [ 0.640, 0.330, 0.300, 0.600, 0.150, 0.060 ];\nconst REC709_LUMINANCE_COEFFICIENTS = [ 0.2126, 0.7152, 0.0722 ];\nconst D65 = [ 0.3127, 0.3290 ];\n\nconst LINEAR_REC709_TO_XYZ = /*@__PURE__*/ new Matrix3().set(\n\t0.4123908, 0.3575843, 0.1804808,\n\t0.2126390, 0.7151687, 0.0721923,\n\t0.0193308, 0.1191948, 0.9505322\n);\n\nconst XYZ_TO_LINEAR_REC709 = /*@__PURE__*/ new Matrix3().set(\n\t3.2409699, - 1.5373832, - 0.4986108,\n\t- 0.9692436, 1.8759675, 0.0415551,\n\t0.0556301, - 0.2039770, 1.0569715\n);\n\nColorManagement.define( {\n\n\t[ LinearSRGBColorSpace ]: {\n\t\tprimaries: REC709_PRIMARIES,\n\t\twhitePoint: D65,\n\t\ttransfer: LinearTransfer,\n\t\ttoXYZ: LINEAR_REC709_TO_XYZ,\n\t\tfromXYZ: XYZ_TO_LINEAR_REC709,\n\t\tluminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS,\n\t\tworkingColorSpaceConfig: { unpackColorSpace: SRGBColorSpace },\n\t\toutputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace }\n\t},\n\n\t[ SRGBColorSpace ]: {\n\t\tprimaries: REC709_PRIMARIES,\n\t\twhitePoint: D65,\n\t\ttransfer: SRGBTransfer,\n\t\ttoXYZ: LINEAR_REC709_TO_XYZ,\n\t\tfromXYZ: XYZ_TO_LINEAR_REC709,\n\t\tluminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS,\n\t\toutputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace }\n\t},\n\n} );\n\nlet _canvas;\n\nclass ImageUtils {\n\n\tstatic getDataURL( image ) {\n\n\t\tif ( /^data:/i.test( image.src ) ) {\n\n\t\t\treturn image.src;\n\n\t\t}\n\n\t\tif ( typeof HTMLCanvasElement === 'undefined' ) {\n\n\t\t\treturn image.src;\n\n\t\t}\n\n\t\tlet canvas;\n\n\t\tif ( image instanceof HTMLCanvasElement ) {\n\n\t\t\tcanvas = image;\n\n\t\t} else {\n\n\t\t\tif ( _canvas === undefined ) _canvas = createElementNS( 'canvas' );\n\n\t\t\t_canvas.width = image.width;\n\t\t\t_canvas.height = image.height;\n\n\t\t\tconst context = _canvas.getContext( '2d' );\n\n\t\t\tif ( image instanceof ImageData ) {\n\n\t\t\t\tcontext.putImageData( image, 0, 0 );\n\n\t\t\t} else {\n\n\t\t\t\tcontext.drawImage( image, 0, 0, image.width, image.height );\n\n\t\t\t}\n\n\t\t\tcanvas = _canvas;\n\n\t\t}\n\n\t\tif ( canvas.width > 2048 || canvas.height > 2048 ) {\n\n\t\t\tconsole.warn( 'THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons', image );\n\n\t\t\treturn canvas.toDataURL( 'image/jpeg', 0.6 );\n\n\t\t} else {\n\n\t\t\treturn canvas.toDataURL( 'image/png' );\n\n\t\t}\n\n\t}\n\n\tstatic sRGBToLinear( image ) {\n\n\t\tif ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||\n\t\t\t( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||\n\t\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {\n\n\t\t\tconst canvas = createElementNS( 'canvas' );\n\n\t\t\tcanvas.width = image.width;\n\t\t\tcanvas.height = image.height;\n\n\t\t\tconst context = canvas.getContext( '2d' );\n\t\t\tcontext.drawImage( image, 0, 0, image.width, image.height );\n\n\t\t\tconst imageData = context.getImageData( 0, 0, image.width, image.height );\n\t\t\tconst data = imageData.data;\n\n\t\t\tfor ( let i = 0; i < data.length; i ++ ) {\n\n\t\t\t\tdata[ i ] = SRGBToLinear( data[ i ] / 255 ) * 255;\n\n\t\t\t}\n\n\t\t\tcontext.putImageData( imageData, 0, 0 );\n\n\t\t\treturn canvas;\n\n\t\t} else if ( image.data ) {\n\n\t\t\tconst data = image.data.slice( 0 );\n\n\t\t\tfor ( let i = 0; i < data.length; i ++ ) {\n\n\t\t\t\tif ( data instanceof Uint8Array || data instanceof Uint8ClampedArray ) {\n\n\t\t\t\t\tdata[ i ] = Math.floor( SRGBToLinear( data[ i ] / 255 ) * 255 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// assuming float\n\n\t\t\t\t\tdata[ i ] = SRGBToLinear( data[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tdata: data,\n\t\t\t\twidth: image.width,\n\t\t\t\theight: image.height\n\t\t\t};\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.' );\n\t\t\treturn image;\n\n\t\t}\n\n\t}\n\n}\n\nlet _sourceId = 0;\n\nclass Source {\n\n\tconstructor( data = null ) {\n\n\t\tthis.isSource = true;\n\n\t\tObject.defineProperty( this, 'id', { value: _sourceId ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.data = data;\n\t\tthis.dataReady = true;\n\n\t\tthis.version = 0;\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( ! isRootObject && meta.images[ this.uuid ] !== undefined ) {\n\n\t\t\treturn meta.images[ this.uuid ];\n\n\t\t}\n\n\t\tconst output = {\n\t\t\tuuid: this.uuid,\n\t\t\turl: ''\n\t\t};\n\n\t\tconst data = this.data;\n\n\t\tif ( data !== null ) {\n\n\t\t\tlet url;\n\n\t\t\tif ( Array.isArray( data ) ) {\n\n\t\t\t\t// cube texture\n\n\t\t\t\turl = [];\n\n\t\t\t\tfor ( let i = 0, l = data.length; i < l; i ++ ) {\n\n\t\t\t\t\tif ( data[ i ].isDataTexture ) {\n\n\t\t\t\t\t\turl.push( serializeImage( data[ i ].image ) );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\turl.push( serializeImage( data[ i ] ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// texture\n\n\t\t\t\turl = serializeImage( data );\n\n\t\t\t}\n\n\t\t\toutput.url = url;\n\n\t\t}\n\n\t\tif ( ! isRootObject ) {\n\n\t\t\tmeta.images[ this.uuid ] = output;\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n}\n\nfunction serializeImage( image ) {\n\n\tif ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||\n\t\t( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||\n\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {\n\n\t\t// default images\n\n\t\treturn ImageUtils.getDataURL( image );\n\n\t} else {\n\n\t\tif ( image.data ) {\n\n\t\t\t// images of DataTexture\n\n\t\t\treturn {\n\t\t\t\tdata: Array.from( image.data ),\n\t\t\t\twidth: image.width,\n\t\t\t\theight: image.height,\n\t\t\t\ttype: image.data.constructor.name\n\t\t\t};\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.Texture: Unable to serialize Texture.' );\n\t\t\treturn {};\n\n\t\t}\n\n\t}\n\n}\n\nlet _textureId = 0;\n\nclass Texture extends EventDispatcher {\n\n\tconstructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = Texture.DEFAULT_ANISOTROPY, colorSpace = NoColorSpace ) {\n\n\t\tsuper();\n\n\t\tthis.isTexture = true;\n\n\t\tObject.defineProperty( this, 'id', { value: _textureId ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.name = '';\n\n\t\tthis.source = new Source( image );\n\t\tthis.mipmaps = [];\n\n\t\tthis.mapping = mapping;\n\t\tthis.channel = 0;\n\n\t\tthis.wrapS = wrapS;\n\t\tthis.wrapT = wrapT;\n\n\t\tthis.magFilter = magFilter;\n\t\tthis.minFilter = minFilter;\n\n\t\tthis.anisotropy = anisotropy;\n\n\t\tthis.format = format;\n\t\tthis.internalFormat = null;\n\t\tthis.type = type;\n\n\t\tthis.offset = new Vector2( 0, 0 );\n\t\tthis.repeat = new Vector2( 1, 1 );\n\t\tthis.center = new Vector2( 0, 0 );\n\t\tthis.rotation = 0;\n\n\t\tthis.matrixAutoUpdate = true;\n\t\tthis.matrix = new Matrix3();\n\n\t\tthis.generateMipmaps = true;\n\t\tthis.premultiplyAlpha = false;\n\t\tthis.flipY = true;\n\t\tthis.unpackAlignment = 4;\t// valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)\n\n\t\tthis.colorSpace = colorSpace;\n\n\t\tthis.userData = {};\n\n\t\tthis.version = 0;\n\t\tthis.onUpdate = null;\n\n\t\tthis.isRenderTargetTexture = false; // indicates whether a texture belongs to a render target or not\n\t\tthis.pmremVersion = 0; // indicates whether this texture should be processed by PMREMGenerator or not (only relevant for render target textures)\n\n\t}\n\n\tget image() {\n\n\t\treturn this.source.data;\n\n\t}\n\n\tset image( value = null ) {\n\n\t\tthis.source.data = value;\n\n\t}\n\n\tupdateMatrix() {\n\n\t\tthis.matrix.setUvTransform( this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.source = source.source;\n\t\tthis.mipmaps = source.mipmaps.slice( 0 );\n\n\t\tthis.mapping = source.mapping;\n\t\tthis.channel = source.channel;\n\n\t\tthis.wrapS = source.wrapS;\n\t\tthis.wrapT = source.wrapT;\n\n\t\tthis.magFilter = source.magFilter;\n\t\tthis.minFilter = source.minFilter;\n\n\t\tthis.anisotropy = source.anisotropy;\n\n\t\tthis.format = source.format;\n\t\tthis.internalFormat = source.internalFormat;\n\t\tthis.type = source.type;\n\n\t\tthis.offset.copy( source.offset );\n\t\tthis.repeat.copy( source.repeat );\n\t\tthis.center.copy( source.center );\n\t\tthis.rotation = source.rotation;\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\tthis.matrix.copy( source.matrix );\n\n\t\tthis.generateMipmaps = source.generateMipmaps;\n\t\tthis.premultiplyAlpha = source.premultiplyAlpha;\n\t\tthis.flipY = source.flipY;\n\t\tthis.unpackAlignment = source.unpackAlignment;\n\t\tthis.colorSpace = source.colorSpace;\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\tthis.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( ! isRootObject && meta.textures[ this.uuid ] !== undefined ) {\n\n\t\t\treturn meta.textures[ this.uuid ];\n\n\t\t}\n\n\t\tconst output = {\n\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.6,\n\t\t\t\ttype: 'Texture',\n\t\t\t\tgenerator: 'Texture.toJSON'\n\t\t\t},\n\n\t\t\tuuid: this.uuid,\n\t\t\tname: this.name,\n\n\t\t\timage: this.source.toJSON( meta ).uuid,\n\n\t\t\tmapping: this.mapping,\n\t\t\tchannel: this.channel,\n\n\t\t\trepeat: [ this.repeat.x, this.repeat.y ],\n\t\t\toffset: [ this.offset.x, this.offset.y ],\n\t\t\tcenter: [ this.center.x, this.center.y ],\n\t\t\trotation: this.rotation,\n\n\t\t\twrap: [ this.wrapS, this.wrapT ],\n\n\t\t\tformat: this.format,\n\t\t\tinternalFormat: this.internalFormat,\n\t\t\ttype: this.type,\n\t\t\tcolorSpace: this.colorSpace,\n\n\t\t\tminFilter: this.minFilter,\n\t\t\tmagFilter: this.magFilter,\n\t\t\tanisotropy: this.anisotropy,\n\n\t\t\tflipY: this.flipY,\n\n\t\t\tgenerateMipmaps: this.generateMipmaps,\n\t\t\tpremultiplyAlpha: this.premultiplyAlpha,\n\t\t\tunpackAlignment: this.unpackAlignment\n\n\t\t};\n\n\t\tif ( Object.keys( this.userData ).length > 0 ) output.userData = this.userData;\n\n\t\tif ( ! isRootObject ) {\n\n\t\t\tmeta.textures[ this.uuid ] = output;\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\ttransformUv( uv ) {\n\n\t\tif ( this.mapping !== UVMapping ) return uv;\n\n\t\tuv.applyMatrix3( this.matrix );\n\n\t\tif ( uv.x < 0 || uv.x > 1 ) {\n\n\t\t\tswitch ( this.wrapS ) {\n\n\t\t\t\tcase RepeatWrapping:\n\n\t\t\t\t\tuv.x = uv.x - Math.floor( uv.x );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ClampToEdgeWrapping:\n\n\t\t\t\t\tuv.x = uv.x < 0 ? 0 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MirroredRepeatWrapping:\n\n\t\t\t\t\tif ( Math.abs( Math.floor( uv.x ) % 2 ) === 1 ) {\n\n\t\t\t\t\t\tuv.x = Math.ceil( uv.x ) - uv.x;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tuv.x = uv.x - Math.floor( uv.x );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( uv.y < 0 || uv.y > 1 ) {\n\n\t\t\tswitch ( this.wrapT ) {\n\n\t\t\t\tcase RepeatWrapping:\n\n\t\t\t\t\tuv.y = uv.y - Math.floor( uv.y );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ClampToEdgeWrapping:\n\n\t\t\t\t\tuv.y = uv.y < 0 ? 0 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MirroredRepeatWrapping:\n\n\t\t\t\t\tif ( Math.abs( Math.floor( uv.y ) % 2 ) === 1 ) {\n\n\t\t\t\t\t\tuv.y = Math.ceil( uv.y ) - uv.y;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tuv.y = uv.y - Math.floor( uv.y );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.flipY ) {\n\n\t\t\tuv.y = 1 - uv.y;\n\n\t\t}\n\n\t\treturn uv;\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) {\n\n\t\t\tthis.version ++;\n\t\t\tthis.source.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\tset needsPMREMUpdate( value ) {\n\n\t\tif ( value === true ) {\n\n\t\t\tthis.pmremVersion ++;\n\n\t\t}\n\n\t}\n\n}\n\nTexture.DEFAULT_IMAGE = null;\nTexture.DEFAULT_MAPPING = UVMapping;\nTexture.DEFAULT_ANISOTROPY = 1;\n\nclass Vector4 {\n\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\tVector4.prototype.isVector4 = true;\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\n\t}\n\n\tget width() {\n\n\t\treturn this.z;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.z = value;\n\n\t}\n\n\tget height() {\n\n\t\treturn this.w;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.w = value;\n\n\t}\n\n\tset( x, y, z, w ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetW( w ) {\n\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tcase 3: this.w = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tcase 3: return this.w;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z, this.w );\n\n\t}\n\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = ( v.w !== undefined ) ? v.w : 1;\n\n\t\treturn this;\n\n\t}\n\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\n\t\treturn this;\n\n\t}\n\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\n\t\treturn this;\n\n\t}\n\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\n\t\treturn this;\n\n\t}\n\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\n\t\treturn this;\n\n\t}\n\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z, w = this.w;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w;\n\t\tthis.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w;\n\n\t\treturn this;\n\n\t}\n\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\t\tthis.w /= v.w;\n\n\t\treturn this;\n\n\t}\n\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\tsetAxisAngleFromQuaternion( q ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\n\t\t// q is assumed to be normalized\n\n\t\tthis.w = 2 * Math.acos( q.w );\n\n\t\tconst s = Math.sqrt( 1 - q.w * q.w );\n\n\t\tif ( s < 0.0001 ) {\n\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\n\t\t} else {\n\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetAxisAngleFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tlet angle, x, y, z; // variables for result\n\t\tconst epsilon = 0.01,\t\t// margin to allow for rounding errors\n\t\t\tepsilon2 = 0.1,\t\t// margin to distinguish between 0 and 180 degrees\n\n\t\t\tte = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tif ( ( Math.abs( m12 - m21 ) < epsilon ) &&\n\t\t ( Math.abs( m13 - m31 ) < epsilon ) &&\n\t\t ( Math.abs( m23 - m32 ) < epsilon ) ) {\n\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\n\t\t\tif ( ( Math.abs( m12 + m21 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m13 + m31 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m23 + m32 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) {\n\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\n\t\t\t\tthis.set( 1, 0, 0, 0 );\n\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\n\t\t\t}\n\n\t\t\t// otherwise this singularity is angle = 180\n\n\t\t\tangle = Math.PI;\n\n\t\t\tconst xx = ( m11 + 1 ) / 2;\n\t\t\tconst yy = ( m22 + 1 ) / 2;\n\t\t\tconst zz = ( m33 + 1 ) / 2;\n\t\t\tconst xy = ( m12 + m21 ) / 4;\n\t\t\tconst xz = ( m13 + m31 ) / 4;\n\t\t\tconst yz = ( m23 + m32 ) / 4;\n\n\t\t\tif ( ( xx > yy ) && ( xx > zz ) ) {\n\n\t\t\t\t// m11 is the largest diagonal term\n\n\t\t\t\tif ( xx < epsilon ) {\n\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tx = Math.sqrt( xx );\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\n\t\t\t\t}\n\n\t\t\t} else if ( yy > zz ) {\n\n\t\t\t\t// m22 is the largest diagonal term\n\n\t\t\t\tif ( yy < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ty = Math.sqrt( yy );\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\n\t\t\t\tif ( zz < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tz = Math.sqrt( zz );\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.set( x, y, z, angle );\n\n\t\t\treturn this; // return 180 deg rotation\n\n\t\t}\n\n\t\t// as we have reached here there are no singularities so we can handle normally\n\n\t\tlet s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) +\n\t\t\t( m13 - m31 ) * ( m13 - m31 ) +\n\t\t\t( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize\n\n\t\tif ( Math.abs( s ) < 0.001 ) s = 1;\n\n\t\t// prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = ( m32 - m23 ) / s;\n\t\tthis.y = ( m13 - m31 ) / s;\n\t\tthis.z = ( m21 - m12 ) / s;\n\t\tthis.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrixPosition( m ) {\n\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 12 ];\n\t\tthis.y = e[ 13 ];\n\t\tthis.z = e[ 14 ];\n\t\tthis.w = e[ 15 ];\n\n\t\treturn this;\n\n\t}\n\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\t\tthis.w = Math.min( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\t\tthis.w = Math.max( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\t\tthis.z = Math.max( min.z, Math.min( max.z, this.z ) );\n\t\tthis.w = Math.max( min.w, Math.min( max.w, this.w ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = Math.max( minVal, Math.min( maxVal, this.x ) );\n\t\tthis.y = Math.max( minVal, Math.min( maxVal, this.y ) );\n\t\tthis.z = Math.max( minVal, Math.min( maxVal, this.z ) );\n\t\tthis.w = Math.max( minVal, Math.min( maxVal, this.w ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );\n\n\t}\n\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\t\tthis.w = Math.floor( this.w );\n\n\t\treturn this;\n\n\t}\n\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\t\tthis.w = Math.ceil( this.w );\n\n\t\treturn this;\n\n\t}\n\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\t\tthis.w = Math.round( this.w );\n\n\t\treturn this;\n\n\t}\n\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\t\tthis.z = Math.trunc( this.z );\n\t\tthis.w = Math.trunc( this.w );\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\t\tthis.w = - this.w;\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\n\t}\n\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w );\n\n\t}\n\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );\n\n\t}\n\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\t\tthis.w += ( v.w - this.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\t\tthis.w = v1.w + ( v2.w - v1.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\t\tthis.w = array[ offset + 3 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\t\tarray[ offset + 3 ] = this.w;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\t\tthis.w = attribute.getW( index );\n\n\t\treturn this;\n\n\t}\n\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\n\t}\n\n}\n\n/*\n In options, we can specify:\n * Texture parameters for an auto-generated target texture\n * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers\n*/\nclass RenderTarget extends EventDispatcher {\n\n\tconstructor( width = 1, height = 1, options = {} ) {\n\n\t\tsuper();\n\n\t\tthis.isRenderTarget = true;\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tthis.depth = 1;\n\n\t\tthis.scissor = new Vector4( 0, 0, width, height );\n\t\tthis.scissorTest = false;\n\n\t\tthis.viewport = new Vector4( 0, 0, width, height );\n\n\t\tconst image = { width: width, height: height, depth: 1 };\n\n\t\toptions = Object.assign( {\n\t\t\tgenerateMipmaps: false,\n\t\t\tinternalFormat: null,\n\t\t\tminFilter: LinearFilter,\n\t\t\tdepthBuffer: true,\n\t\t\tstencilBuffer: false,\n\t\t\tresolveDepthBuffer: true,\n\t\t\tresolveStencilBuffer: true,\n\t\t\tdepthTexture: null,\n\t\t\tsamples: 0,\n\t\t\tcount: 1\n\t\t}, options );\n\n\t\tconst texture = new Texture( image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );\n\n\t\ttexture.flipY = false;\n\t\ttexture.generateMipmaps = options.generateMipmaps;\n\t\ttexture.internalFormat = options.internalFormat;\n\n\t\tthis.textures = [];\n\n\t\tconst count = options.count;\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.textures[ i ] = texture.clone();\n\t\t\tthis.textures[ i ].isRenderTargetTexture = true;\n\n\t\t}\n\n\t\tthis.depthBuffer = options.depthBuffer;\n\t\tthis.stencilBuffer = options.stencilBuffer;\n\n\t\tthis.resolveDepthBuffer = options.resolveDepthBuffer;\n\t\tthis.resolveStencilBuffer = options.resolveStencilBuffer;\n\n\t\tthis.depthTexture = options.depthTexture;\n\n\t\tthis.samples = options.samples;\n\n\t}\n\n\tget texture() {\n\n\t\treturn this.textures[ 0 ];\n\n\t}\n\n\tset texture( value ) {\n\n\t\tthis.textures[ 0 ] = value;\n\n\t}\n\n\tsetSize( width, height, depth = 1 ) {\n\n\t\tif ( this.width !== width || this.height !== height || this.depth !== depth ) {\n\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t\tthis.depth = depth;\n\n\t\t\tfor ( let i = 0, il = this.textures.length; i < il; i ++ ) {\n\n\t\t\t\tthis.textures[ i ].image.width = width;\n\t\t\t\tthis.textures[ i ].image.height = height;\n\t\t\t\tthis.textures[ i ].image.depth = depth;\n\n\t\t\t}\n\n\t\t\tthis.dispose();\n\n\t\t}\n\n\t\tthis.viewport.set( 0, 0, width, height );\n\t\tthis.scissor.set( 0, 0, width, height );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.width = source.width;\n\t\tthis.height = source.height;\n\t\tthis.depth = source.depth;\n\n\t\tthis.scissor.copy( source.scissor );\n\t\tthis.scissorTest = source.scissorTest;\n\n\t\tthis.viewport.copy( source.viewport );\n\n\t\tthis.textures.length = 0;\n\n\t\tfor ( let i = 0, il = source.textures.length; i < il; i ++ ) {\n\n\t\t\tthis.textures[ i ] = source.textures[ i ].clone();\n\t\t\tthis.textures[ i ].isRenderTargetTexture = true;\n\n\t\t}\n\n\t\t// ensure image object is not shared, see #20328\n\n\t\tconst image = Object.assign( {}, source.texture.image );\n\t\tthis.texture.source = new Source( image );\n\n\t\tthis.depthBuffer = source.depthBuffer;\n\t\tthis.stencilBuffer = source.stencilBuffer;\n\n\t\tthis.resolveDepthBuffer = source.resolveDepthBuffer;\n\t\tthis.resolveStencilBuffer = source.resolveStencilBuffer;\n\n\t\tif ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone();\n\n\t\tthis.samples = source.samples;\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n}\n\nclass WebGLRenderTarget extends RenderTarget {\n\n\tconstructor( width = 1, height = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\tthis.isWebGLRenderTarget = true;\n\n\t}\n\n}\n\nclass DataArrayTexture extends Texture {\n\n\tconstructor( data = null, width = 1, height = 1, depth = 1 ) {\n\n\t\tsuper( null );\n\n\t\tthis.isDataArrayTexture = true;\n\n\t\tthis.image = { data, width, height, depth };\n\n\t\tthis.magFilter = NearestFilter;\n\t\tthis.minFilter = NearestFilter;\n\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\tthis.generateMipmaps = false;\n\t\tthis.flipY = false;\n\t\tthis.unpackAlignment = 1;\n\n\t\tthis.layerUpdates = new Set();\n\n\t}\n\n\taddLayerUpdate( layerIndex ) {\n\n\t\tthis.layerUpdates.add( layerIndex );\n\n\t}\n\n\tclearLayerUpdates() {\n\n\t\tthis.layerUpdates.clear();\n\n\t}\n\n}\n\nclass WebGLArrayRenderTarget extends WebGLRenderTarget {\n\n\tconstructor( width = 1, height = 1, depth = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\tthis.isWebGLArrayRenderTarget = true;\n\n\t\tthis.depth = depth;\n\n\t\tthis.texture = new DataArrayTexture( null, width, height, depth );\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t}\n\n}\n\nclass Data3DTexture extends Texture {\n\n\tconstructor( data = null, width = 1, height = 1, depth = 1 ) {\n\n\t\t// We're going to add .setXXX() methods for setting properties later.\n\t\t// Users can still set in DataTexture3D directly.\n\t\t//\n\t\t//\tconst texture = new THREE.DataTexture3D( data, width, height, depth );\n\t\t// \ttexture.anisotropy = 16;\n\t\t//\n\t\t// See #14839\n\n\t\tsuper( null );\n\n\t\tthis.isData3DTexture = true;\n\n\t\tthis.image = { data, width, height, depth };\n\n\t\tthis.magFilter = NearestFilter;\n\t\tthis.minFilter = NearestFilter;\n\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\tthis.generateMipmaps = false;\n\t\tthis.flipY = false;\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n}\n\nclass WebGL3DRenderTarget extends WebGLRenderTarget {\n\n\tconstructor( width = 1, height = 1, depth = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\tthis.isWebGL3DRenderTarget = true;\n\n\t\tthis.depth = depth;\n\n\t\tthis.texture = new Data3DTexture( null, width, height, depth );\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t}\n\n}\n\nclass Quaternion {\n\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\tthis.isQuaternion = true;\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t}\n\n\tstatic slerpFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) {\n\n\t\t// fuzz-free, array-based Quaternion SLERP operation\n\n\t\tlet x0 = src0[ srcOffset0 + 0 ],\n\t\t\ty0 = src0[ srcOffset0 + 1 ],\n\t\t\tz0 = src0[ srcOffset0 + 2 ],\n\t\t\tw0 = src0[ srcOffset0 + 3 ];\n\n\t\tconst x1 = src1[ srcOffset1 + 0 ],\n\t\t\ty1 = src1[ srcOffset1 + 1 ],\n\t\t\tz1 = src1[ srcOffset1 + 2 ],\n\t\t\tw1 = src1[ srcOffset1 + 3 ];\n\n\t\tif ( t === 0 ) {\n\n\t\t\tdst[ dstOffset + 0 ] = x0;\n\t\t\tdst[ dstOffset + 1 ] = y0;\n\t\t\tdst[ dstOffset + 2 ] = z0;\n\t\t\tdst[ dstOffset + 3 ] = w0;\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( t === 1 ) {\n\n\t\t\tdst[ dstOffset + 0 ] = x1;\n\t\t\tdst[ dstOffset + 1 ] = y1;\n\t\t\tdst[ dstOffset + 2 ] = z1;\n\t\t\tdst[ dstOffset + 3 ] = w1;\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) {\n\n\t\t\tlet s = 1 - t;\n\t\t\tconst cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\t\t\t\tdir = ( cos >= 0 ? 1 : - 1 ),\n\t\t\t\tsqrSin = 1 - cos * cos;\n\n\t\t\t// Skip the Slerp for tiny steps to avoid numeric problems:\n\t\t\tif ( sqrSin > Number.EPSILON ) {\n\n\t\t\t\tconst sin = Math.sqrt( sqrSin ),\n\t\t\t\t\tlen = Math.atan2( sin, cos * dir );\n\n\t\t\t\ts = Math.sin( s * len ) / sin;\n\t\t\t\tt = Math.sin( t * len ) / sin;\n\n\t\t\t}\n\n\t\t\tconst tDir = t * dir;\n\n\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\tw0 = w0 * s + w1 * tDir;\n\n\t\t\t// Normalize in case we just did a lerp:\n\t\t\tif ( s === 1 - t ) {\n\n\t\t\t\tconst f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 );\n\n\t\t\t\tx0 *= f;\n\t\t\t\ty0 *= f;\n\t\t\t\tz0 *= f;\n\t\t\t\tw0 *= f;\n\n\t\t\t}\n\n\t\t}\n\n\t\tdst[ dstOffset ] = x0;\n\t\tdst[ dstOffset + 1 ] = y0;\n\t\tdst[ dstOffset + 2 ] = z0;\n\t\tdst[ dstOffset + 3 ] = w0;\n\n\t}\n\n\tstatic multiplyQuaternionsFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1 ) {\n\n\t\tconst x0 = src0[ srcOffset0 ];\n\t\tconst y0 = src0[ srcOffset0 + 1 ];\n\t\tconst z0 = src0[ srcOffset0 + 2 ];\n\t\tconst w0 = src0[ srcOffset0 + 3 ];\n\n\t\tconst x1 = src1[ srcOffset1 ];\n\t\tconst y1 = src1[ srcOffset1 + 1 ];\n\t\tconst z1 = src1[ srcOffset1 + 2 ];\n\t\tconst w1 = src1[ srcOffset1 + 3 ];\n\n\t\tdst[ dstOffset ] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\tdst[ dstOffset + 1 ] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\tdst[ dstOffset + 2 ] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\tdst[ dstOffset + 3 ] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\n\t\treturn dst;\n\n\t}\n\n\tget x() {\n\n\t\treturn this._x;\n\n\t}\n\n\tset x( value ) {\n\n\t\tthis._x = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget y() {\n\n\t\treturn this._y;\n\n\t}\n\n\tset y( value ) {\n\n\t\tthis._y = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget z() {\n\n\t\treturn this._z;\n\n\t}\n\n\tset z( value ) {\n\n\t\tthis._z = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget w() {\n\n\t\treturn this._w;\n\n\t}\n\n\tset w( value ) {\n\n\t\tthis._w = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tset( x, y, z, w ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this._x, this._y, this._z, this._w );\n\n\t}\n\n\tcopy( quaternion ) {\n\n\t\tthis._x = quaternion.x;\n\t\tthis._y = quaternion.y;\n\t\tthis._z = quaternion.z;\n\t\tthis._w = quaternion.w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromEuler( euler, update = true ) {\n\n\t\tconst x = euler._x, y = euler._y, z = euler._z, order = euler._order;\n\n\t\t// http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t//\tcontent/SpinCalc.m\n\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\n\t\tconst c1 = cos( x / 2 );\n\t\tconst c2 = cos( y / 2 );\n\t\tconst c3 = cos( z / 2 );\n\n\t\tconst s1 = sin( x / 2 );\n\t\tconst s2 = sin( y / 2 );\n\t\tconst s3 = sin( z / 2 );\n\n\t\tswitch ( order ) {\n\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn( 'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order );\n\n\t\t}\n\n\t\tif ( update === true ) this._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromAxisAngle( axis, angle ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\n\t\t// assumes axis is normalized\n\n\t\tconst halfAngle = angle / 2, s = Math.sin( halfAngle );\n\n\t\tthis._x = axis.x * s;\n\t\tthis._y = axis.y * s;\n\t\tthis._z = axis.z * s;\n\t\tthis._w = Math.cos( halfAngle );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tconst te = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ],\n\n\t\t\ttrace = m11 + m22 + m33;\n\n\t\tif ( trace > 0 ) {\n\n\t\t\tconst s = 0.5 / Math.sqrt( trace + 1.0 );\n\n\t\t\tthis._w = 0.25 / s;\n\t\t\tthis._x = ( m32 - m23 ) * s;\n\t\t\tthis._y = ( m13 - m31 ) * s;\n\t\t\tthis._z = ( m21 - m12 ) * s;\n\n\t\t} else if ( m11 > m22 && m11 > m33 ) {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 );\n\n\t\t\tthis._w = ( m32 - m23 ) / s;\n\t\t\tthis._x = 0.25 * s;\n\t\t\tthis._y = ( m12 + m21 ) / s;\n\t\t\tthis._z = ( m13 + m31 ) / s;\n\n\t\t} else if ( m22 > m33 ) {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 );\n\n\t\t\tthis._w = ( m13 - m31 ) / s;\n\t\t\tthis._x = ( m12 + m21 ) / s;\n\t\t\tthis._y = 0.25 * s;\n\t\t\tthis._z = ( m23 + m32 ) / s;\n\n\t\t} else {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 );\n\n\t\t\tthis._w = ( m21 - m12 ) / s;\n\t\t\tthis._x = ( m13 + m31 ) / s;\n\t\t\tthis._y = ( m23 + m32 ) / s;\n\t\t\tthis._z = 0.25 * s;\n\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromUnitVectors( vFrom, vTo ) {\n\n\t\t// assumes direction vectors vFrom and vTo are normalized\n\n\t\tlet r = vFrom.dot( vTo ) + 1;\n\n\t\tif ( r < Number.EPSILON ) {\n\n\t\t\t// vFrom and vTo point in opposite directions\n\n\t\t\tr = 0;\n\n\t\t\tif ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) {\n\n\t\t\t\tthis._x = - vFrom.y;\n\t\t\t\tthis._y = vFrom.x;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = r;\n\n\t\t\t} else {\n\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = - vFrom.z;\n\t\t\t\tthis._z = vFrom.y;\n\t\t\t\tthis._w = r;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\n\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\tthis._w = r;\n\n\t\t}\n\n\t\treturn this.normalize();\n\n\t}\n\n\tangleTo( q ) {\n\n\t\treturn 2 * Math.acos( Math.abs( clamp( this.dot( q ), - 1, 1 ) ) );\n\n\t}\n\n\trotateTowards( q, step ) {\n\n\t\tconst angle = this.angleTo( q );\n\n\t\tif ( angle === 0 ) return this;\n\n\t\tconst t = Math.min( 1, step / angle );\n\n\t\tthis.slerp( q, t );\n\n\t\treturn this;\n\n\t}\n\n\tidentity() {\n\n\t\treturn this.set( 0, 0, 0, 1 );\n\n\t}\n\n\tinvert() {\n\n\t\t// quaternion is assumed to have unit length\n\n\t\treturn this.conjugate();\n\n\t}\n\n\tconjugate() {\n\n\t\tthis._x *= - 1;\n\t\tthis._y *= - 1;\n\t\tthis._z *= - 1;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\n\t}\n\n\tlengthSq() {\n\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w );\n\n\t}\n\n\tnormalize() {\n\n\t\tlet l = this.length();\n\n\t\tif ( l === 0 ) {\n\n\t\t\tthis._x = 0;\n\t\t\tthis._y = 0;\n\t\t\tthis._z = 0;\n\t\t\tthis._w = 1;\n\n\t\t} else {\n\n\t\t\tl = 1 / l;\n\n\t\t\tthis._x = this._x * l;\n\t\t\tthis._y = this._y * l;\n\t\t\tthis._z = this._z * l;\n\t\t\tthis._w = this._w * l;\n\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( q ) {\n\n\t\treturn this.multiplyQuaternions( this, q );\n\n\t}\n\n\tpremultiply( q ) {\n\n\t\treturn this.multiplyQuaternions( q, this );\n\n\t}\n\n\tmultiplyQuaternions( a, b ) {\n\n\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\n\t\tconst qax = a._x, qay = a._y, qaz = a._z, qaw = a._w;\n\t\tconst qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;\n\n\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tslerp( qb, t ) {\n\n\t\tif ( t === 0 ) return this;\n\t\tif ( t === 1 ) return this.copy( qb );\n\n\t\tconst x = this._x, y = this._y, z = this._z, w = this._w;\n\n\t\t// http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\tlet cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\tif ( cosHalfTheta < 0 ) {\n\n\t\t\tthis._w = - qb._w;\n\t\t\tthis._x = - qb._x;\n\t\t\tthis._y = - qb._y;\n\t\t\tthis._z = - qb._z;\n\n\t\t\tcosHalfTheta = - cosHalfTheta;\n\n\t\t} else {\n\n\t\t\tthis.copy( qb );\n\n\t\t}\n\n\t\tif ( cosHalfTheta >= 1.0 ) {\n\n\t\t\tthis._w = w;\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\tif ( sqrSinHalfTheta <= Number.EPSILON ) {\n\n\t\t\tconst s = 1 - t;\n\t\t\tthis._w = s * w + t * this._w;\n\t\t\tthis._x = s * x + t * this._x;\n\t\t\tthis._y = s * y + t * this._y;\n\t\t\tthis._z = s * z + t * this._z;\n\n\t\t\tthis.normalize(); // normalize calls _onChangeCallback()\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst sinHalfTheta = Math.sqrt( sqrSinHalfTheta );\n\t\tconst halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta );\n\t\tconst ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta,\n\t\t\tratioB = Math.sin( t * halfTheta ) / sinHalfTheta;\n\n\t\tthis._w = ( w * ratioA + this._w * ratioB );\n\t\tthis._x = ( x * ratioA + this._x * ratioB );\n\t\tthis._y = ( y * ratioA + this._y * ratioB );\n\t\tthis._z = ( z * ratioA + this._z * ratioB );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tslerpQuaternions( qa, qb, t ) {\n\n\t\treturn this.copy( qa ).slerp( qb, t );\n\n\t}\n\n\trandom() {\n\n\t\t// sets this quaternion to a uniform random unit quaternnion\n\n\t\t// Ken Shoemake\n\t\t// Uniform random rotations\n\t\t// D. Kirk, editor, Graphics Gems III, pages 124-132. Academic Press, New York, 1992.\n\n\t\tconst theta1 = 2 * Math.PI * Math.random();\n\t\tconst theta2 = 2 * Math.PI * Math.random();\n\n\t\tconst x0 = Math.random();\n\t\tconst r1 = Math.sqrt( 1 - x0 );\n\t\tconst r2 = Math.sqrt( x0 );\n\n\t\treturn this.set(\n\t\t\tr1 * Math.sin( theta1 ),\n\t\t\tr1 * Math.cos( theta1 ),\n\t\t\tr2 * Math.sin( theta2 ),\n\t\t\tr2 * Math.cos( theta2 ),\n\t\t);\n\n\t}\n\n\tequals( quaternion ) {\n\n\t\treturn ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis._x = array[ offset ];\n\t\tthis._y = array[ offset + 1 ];\n\t\tthis._z = array[ offset + 2 ];\n\t\tthis._w = array[ offset + 3 ];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this._x;\n\t\tarray[ offset + 1 ] = this._y;\n\t\tarray[ offset + 2 ] = this._z;\n\t\tarray[ offset + 3 ] = this._w;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis._x = attribute.getX( index );\n\t\tthis._y = attribute.getY( index );\n\t\tthis._z = attribute.getZ( index );\n\t\tthis._w = attribute.getW( index );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\treturn this.toArray();\n\n\t}\n\n\t_onChange( callback ) {\n\n\t\tthis._onChangeCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._w;\n\n\t}\n\n}\n\nclass Vector3 {\n\n\tconstructor( x = 0, y = 0, z = 0 ) {\n\n\t\tVector3.prototype.isVector3 = true;\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\n\t}\n\n\tset( x, y, z ) {\n\n\t\tif ( z === undefined ) z = this.z; // sprite.scale.set(x,y)\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z );\n\n\t}\n\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\n\t\treturn this;\n\n\t}\n\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\n\t\treturn this;\n\n\t}\n\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\n\t\treturn this;\n\n\t}\n\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\n\t\treturn this;\n\n\t}\n\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\n\t\treturn this;\n\n\t}\n\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyVectors( a, b ) {\n\n\t\tthis.x = a.x * b.x;\n\t\tthis.y = a.y * b.y;\n\t\tthis.z = a.z * b.z;\n\n\t\treturn this;\n\n\t}\n\n\tapplyEuler( euler ) {\n\n\t\treturn this.applyQuaternion( _quaternion$4.setFromEuler( euler ) );\n\n\t}\n\n\tapplyAxisAngle( axis, angle ) {\n\n\t\treturn this.applyQuaternion( _quaternion$4.setFromAxisAngle( axis, angle ) );\n\n\t}\n\n\tapplyMatrix3( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z;\n\t\tthis.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z;\n\t\tthis.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z;\n\n\t\treturn this;\n\n\t}\n\n\tapplyNormalMatrix( m ) {\n\n\t\treturn this.applyMatrix3( m ).normalize();\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tconst w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] );\n\n\t\tthis.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w;\n\t\tthis.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w;\n\t\tthis.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w;\n\n\t\treturn this;\n\n\t}\n\n\tapplyQuaternion( q ) {\n\n\t\t// quaternion q is assumed to have unit length\n\n\t\tconst vx = this.x, vy = this.y, vz = this.z;\n\t\tconst qx = q.x, qy = q.y, qz = q.z, qw = q.w;\n\n\t\t// t = 2 * cross( q.xyz, v );\n\t\tconst tx = 2 * ( qy * vz - qz * vy );\n\t\tconst ty = 2 * ( qz * vx - qx * vz );\n\t\tconst tz = 2 * ( qx * vy - qy * vx );\n\n\t\t// v + q.w * t + cross( q.xyz, t );\n\t\tthis.x = vx + qw * tx + qy * tz - qz * ty;\n\t\tthis.y = vy + qw * ty + qz * tx - qx * tz;\n\t\tthis.z = vz + qw * tz + qx * ty - qy * tx;\n\n\t\treturn this;\n\n\t}\n\n\tproject( camera ) {\n\n\t\treturn this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );\n\n\t}\n\n\tunproject( camera ) {\n\n\t\treturn this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );\n\n\t}\n\n\ttransformDirection( m ) {\n\n\t\t// input: THREE.Matrix4 affine matrix\n\t\t// vector interpreted as a direction\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z;\n\n\t\treturn this.normalize();\n\n\t}\n\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\n\t\treturn this;\n\n\t}\n\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\n\t\treturn this;\n\n\t}\n\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\n\t\treturn this;\n\n\t}\n\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = Math.max( min.x, Math.min( max.x, this.x ) );\n\t\tthis.y = Math.max( min.y, Math.min( max.y, this.y ) );\n\t\tthis.z = Math.max( min.z, Math.min( max.z, this.z ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = Math.max( minVal, Math.min( maxVal, this.x ) );\n\t\tthis.y = Math.max( minVal, Math.min( maxVal, this.y ) );\n\t\tthis.z = Math.max( minVal, Math.min( maxVal, this.z ) );\n\n\t\treturn this;\n\n\t}\n\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );\n\n\t}\n\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\n\t\treturn this;\n\n\t}\n\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\n\t\treturn this;\n\n\t}\n\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\n\t\treturn this;\n\n\t}\n\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\t\tthis.z = Math.trunc( this.z );\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\n\t}\n\n\t// TODO lengthSquared?\n\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z );\n\n\t}\n\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z );\n\n\t}\n\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tcross( v ) {\n\n\t\treturn this.crossVectors( this, v );\n\n\t}\n\n\tcrossVectors( a, b ) {\n\n\t\tconst ax = a.x, ay = a.y, az = a.z;\n\t\tconst bx = b.x, by = b.y, bz = b.z;\n\n\t\tthis.x = ay * bz - az * by;\n\t\tthis.y = az * bx - ax * bz;\n\t\tthis.z = ax * by - ay * bx;\n\n\t\treturn this;\n\n\t}\n\n\tprojectOnVector( v ) {\n\n\t\tconst denominator = v.lengthSq();\n\n\t\tif ( denominator === 0 ) return this.set( 0, 0, 0 );\n\n\t\tconst scalar = v.dot( this ) / denominator;\n\n\t\treturn this.copy( v ).multiplyScalar( scalar );\n\n\t}\n\n\tprojectOnPlane( planeNormal ) {\n\n\t\t_vector$c.copy( this ).projectOnVector( planeNormal );\n\n\t\treturn this.sub( _vector$c );\n\n\t}\n\n\treflect( normal ) {\n\n\t\t// reflect incident vector off plane orthogonal to normal\n\t\t// normal is assumed to have unit length\n\n\t\treturn this.sub( _vector$c.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) );\n\n\t}\n\n\tangleTo( v ) {\n\n\t\tconst denominator = Math.sqrt( this.lengthSq() * v.lengthSq() );\n\n\t\tif ( denominator === 0 ) return Math.PI / 2;\n\n\t\tconst theta = this.dot( v ) / denominator;\n\n\t\t// clamp, to handle numerical problems\n\n\t\treturn Math.acos( clamp( theta, - 1, 1 ) );\n\n\t}\n\n\tdistanceTo( v ) {\n\n\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t}\n\n\tdistanceToSquared( v ) {\n\n\t\tconst dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;\n\n\t\treturn dx * dx + dy * dy + dz * dz;\n\n\t}\n\n\tmanhattanDistanceTo( v ) {\n\n\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z );\n\n\t}\n\n\tsetFromSpherical( s ) {\n\n\t\treturn this.setFromSphericalCoords( s.radius, s.phi, s.theta );\n\n\t}\n\n\tsetFromSphericalCoords( radius, phi, theta ) {\n\n\t\tconst sinPhiRadius = Math.sin( phi ) * radius;\n\n\t\tthis.x = sinPhiRadius * Math.sin( theta );\n\t\tthis.y = Math.cos( phi ) * radius;\n\t\tthis.z = sinPhiRadius * Math.cos( theta );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCylindrical( c ) {\n\n\t\treturn this.setFromCylindricalCoords( c.radius, c.theta, c.y );\n\n\t}\n\n\tsetFromCylindricalCoords( radius, theta, y ) {\n\n\t\tthis.x = radius * Math.sin( theta );\n\t\tthis.y = y;\n\t\tthis.z = radius * Math.cos( theta );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrixPosition( m ) {\n\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 12 ];\n\t\tthis.y = e[ 13 ];\n\t\tthis.z = e[ 14 ];\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrixScale( m ) {\n\n\t\tconst sx = this.setFromMatrixColumn( m, 0 ).length();\n\t\tconst sy = this.setFromMatrixColumn( m, 1 ).length();\n\t\tconst sz = this.setFromMatrixColumn( m, 2 ).length();\n\n\t\tthis.x = sx;\n\t\tthis.y = sy;\n\t\tthis.z = sz;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrixColumn( m, index ) {\n\n\t\treturn this.fromArray( m.elements, index * 4 );\n\n\t}\n\n\tsetFromMatrix3Column( m, index ) {\n\n\t\treturn this.fromArray( m.elements, index * 3 );\n\n\t}\n\n\tsetFromEuler( e ) {\n\n\t\tthis.x = e._x;\n\t\tthis.y = e._y;\n\t\tthis.z = e._z;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromColor( c ) {\n\n\t\tthis.x = c.r;\n\t\tthis.y = c.g;\n\t\tthis.z = c.b;\n\n\t\treturn this;\n\n\t}\n\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\n\t\treturn this;\n\n\t}\n\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\trandomDirection() {\n\n\t\t// https://mathworld.wolfram.com/SpherePointPicking.html\n\n\t\tconst theta = Math.random() * Math.PI * 2;\n\t\tconst u = Math.random() * 2 - 1;\n\t\tconst c = Math.sqrt( 1 - u * u );\n\n\t\tthis.x = c * Math.cos( theta );\n\t\tthis.y = u;\n\t\tthis.z = c * Math.sin( theta );\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\n\t}\n\n}\n\nconst _vector$c = /*@__PURE__*/ new Vector3();\nconst _quaternion$4 = /*@__PURE__*/ new Quaternion();\n\nclass Box3 {\n\n\tconstructor( min = new Vector3( + Infinity, + Infinity, + Infinity ), max = new Vector3( - Infinity, - Infinity, - Infinity ) ) {\n\n\t\tthis.isBox3 = true;\n\n\t\tthis.min = min;\n\t\tthis.max = max;\n\n\t}\n\n\tset( min, max ) {\n\n\t\tthis.min.copy( min );\n\t\tthis.max.copy( max );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromArray( array ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = array.length; i < il; i += 3 ) {\n\n\t\t\tthis.expandByPoint( _vector$b.fromArray( array, i ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromBufferAttribute( attribute ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = attribute.count; i < il; i ++ ) {\n\n\t\t\tthis.expandByPoint( _vector$b.fromBufferAttribute( attribute, i ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPoints( points ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\tthis.expandByPoint( points[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCenterAndSize( center, size ) {\n\n\t\tconst halfSize = _vector$b.copy( size ).multiplyScalar( 0.5 );\n\n\t\tthis.min.copy( center ).sub( halfSize );\n\t\tthis.max.copy( center ).add( halfSize );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromObject( object, precise = false ) {\n\n\t\tthis.makeEmpty();\n\n\t\treturn this.expandByObject( object, precise );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( box ) {\n\n\t\tthis.min.copy( box.min );\n\t\tthis.max.copy( box.max );\n\n\t\treturn this;\n\n\t}\n\n\tmakeEmpty() {\n\n\t\tthis.min.x = this.min.y = this.min.z = + Infinity;\n\t\tthis.max.x = this.max.y = this.max.z = - Infinity;\n\n\t\treturn this;\n\n\t}\n\n\tisEmpty() {\n\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\n\t\treturn ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z );\n\n\t}\n\n\tgetCenter( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );\n\n\t}\n\n\tgetSize( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min );\n\n\t}\n\n\texpandByPoint( point ) {\n\n\t\tthis.min.min( point );\n\t\tthis.max.max( point );\n\n\t\treturn this;\n\n\t}\n\n\texpandByVector( vector ) {\n\n\t\tthis.min.sub( vector );\n\t\tthis.max.add( vector );\n\n\t\treturn this;\n\n\t}\n\n\texpandByScalar( scalar ) {\n\n\t\tthis.min.addScalar( - scalar );\n\t\tthis.max.addScalar( scalar );\n\n\t\treturn this;\n\n\t}\n\n\texpandByObject( object, precise = false ) {\n\n\t\t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t\t// accounting for both the object's, and children's, world transforms\n\n\t\tobject.updateWorldMatrix( false, false );\n\n\t\tconst geometry = object.geometry;\n\n\t\tif ( geometry !== undefined ) {\n\n\t\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\n\t\t\t// precise AABB computation based on vertex data requires at least a position attribute.\n\t\t\t// instancing isn't supported so far and uses the normal (conservative) code path.\n\n\t\t\tif ( precise === true && positionAttribute !== undefined && object.isInstancedMesh !== true ) {\n\n\t\t\t\tfor ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {\n\n\t\t\t\t\tif ( object.isMesh === true ) {\n\n\t\t\t\t\t\tobject.getVertexPosition( i, _vector$b );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_vector$b.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_vector$b.applyMatrix4( object.matrixWorld );\n\t\t\t\t\tthis.expandByPoint( _vector$b );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( object.boundingBox !== undefined ) {\n\n\t\t\t\t\t// object-level bounding box\n\n\t\t\t\t\tif ( object.boundingBox === null ) {\n\n\t\t\t\t\t\tobject.computeBoundingBox();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_box$4.copy( object.boundingBox );\n\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// geometry-level bounding box\n\n\t\t\t\t\tif ( geometry.boundingBox === null ) {\n\n\t\t\t\t\t\tgeometry.computeBoundingBox();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_box$4.copy( geometry.boundingBox );\n\n\t\t\t\t}\n\n\t\t\t\t_box$4.applyMatrix4( object.matrixWorld );\n\n\t\t\t\tthis.union( _box$4 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tthis.expandByObject( children[ i ], precise );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\treturn point.x >= this.min.x && point.x <= this.max.x &&\n\t\t\tpoint.y >= this.min.y && point.y <= this.max.y &&\n\t\t\tpoint.z >= this.min.z && point.z <= this.max.z;\n\n\t}\n\n\tcontainsBox( box ) {\n\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x &&\n\t\t\tthis.min.y <= box.min.y && box.max.y <= this.max.y &&\n\t\t\tthis.min.z <= box.min.z && box.max.z <= this.max.z;\n\n\t}\n\n\tgetParameter( point, target ) {\n\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\n\t\treturn target.set(\n\t\t\t( point.x - this.min.x ) / ( this.max.x - this.min.x ),\n\t\t\t( point.y - this.min.y ) / ( this.max.y - this.min.y ),\n\t\t\t( point.z - this.min.z ) / ( this.max.z - this.min.z )\n\t\t);\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\t// using 6 splitting planes to rule out intersections.\n\t\treturn box.max.x >= this.min.x && box.min.x <= this.max.x &&\n\t\t\tbox.max.y >= this.min.y && box.min.y <= this.max.y &&\n\t\t\tbox.max.z >= this.min.z && box.min.z <= this.max.z;\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\t// Find the point on the AABB closest to the sphere center.\n\t\tthis.clampPoint( sphere.center, _vector$b );\n\n\t\t// If that point is inside the sphere, the AABB and sphere intersect.\n\t\treturn _vector$b.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius );\n\n\t}\n\n\tintersectsPlane( plane ) {\n\n\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\n\t\tlet min, max;\n\n\t\tif ( plane.normal.x > 0 ) {\n\n\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\tmax = plane.normal.x * this.max.x;\n\n\t\t} else {\n\n\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\tmax = plane.normal.x * this.min.x;\n\n\t\t}\n\n\t\tif ( plane.normal.y > 0 ) {\n\n\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\tmax += plane.normal.y * this.max.y;\n\n\t\t} else {\n\n\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\tmax += plane.normal.y * this.min.y;\n\n\t\t}\n\n\t\tif ( plane.normal.z > 0 ) {\n\n\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\tmax += plane.normal.z * this.max.z;\n\n\t\t} else {\n\n\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\tmax += plane.normal.z * this.min.z;\n\n\t\t}\n\n\t\treturn ( min <= - plane.constant && max >= - plane.constant );\n\n\t}\n\n\tintersectsTriangle( triangle ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// compute box center and extents\n\t\tthis.getCenter( _center );\n\t\t_extents.subVectors( this.max, _center );\n\n\t\t// translate triangle to aabb origin\n\t\t_v0$3.subVectors( triangle.a, _center );\n\t\t_v1$7.subVectors( triangle.b, _center );\n\t\t_v2$4.subVectors( triangle.c, _center );\n\n\t\t// compute edge vectors for triangle\n\t\t_f0.subVectors( _v1$7, _v0$3 );\n\t\t_f1.subVectors( _v2$4, _v1$7 );\n\t\t_f2.subVectors( _v0$3, _v2$4 );\n\n\t\t// test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\t\tlet axes = [\n\t\t\t0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y,\n\t\t\t_f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x,\n\t\t\t- _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0\n\t\t];\n\t\tif ( ! satForAxes( axes, _v0$3, _v1$7, _v2$4, _extents ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// test 3 face normals from the aabb\n\t\taxes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ];\n\t\tif ( ! satForAxes( axes, _v0$3, _v1$7, _v2$4, _extents ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// finally testing the face normal of the triangle\n\t\t// use already existing triangle edge vectors here\n\t\t_triangleNormal.crossVectors( _f0, _f1 );\n\t\taxes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ];\n\n\t\treturn satForAxes( axes, _v0$3, _v1$7, _v2$4, _extents );\n\n\t}\n\n\tclampPoint( point, target ) {\n\n\t\treturn target.copy( point ).clamp( this.min, this.max );\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn this.clampPoint( point, _vector$b ).distanceTo( point );\n\n\t}\n\n\tgetBoundingSphere( target ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\ttarget.makeEmpty();\n\n\t\t} else {\n\n\t\t\tthis.getCenter( target.center );\n\n\t\t\ttarget.radius = this.getSize( _vector$b ).length() * 0.5;\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\tintersect( box ) {\n\n\t\tthis.min.max( box.min );\n\t\tthis.max.min( box.max );\n\n\t\t// ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\t\tif ( this.isEmpty() ) this.makeEmpty();\n\n\t\treturn this;\n\n\t}\n\n\tunion( box ) {\n\n\t\tthis.min.min( box.min );\n\t\tthis.max.max( box.max );\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix4( matrix ) {\n\n\t\t// transform of empty box is an empty box.\n\t\tif ( this.isEmpty() ) return this;\n\n\t\t// NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\t\t_points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000\n\t\t_points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001\n\t\t_points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010\n\t\t_points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011\n\t\t_points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100\n\t\t_points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101\n\t\t_points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110\n\t\t_points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111\n\n\t\tthis.setFromPoints( _points );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.min.add( offset );\n\t\tthis.max.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\tequals( box ) {\n\n\t\treturn box.min.equals( this.min ) && box.max.equals( this.max );\n\n\t}\n\n}\n\nconst _points = [\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3()\n];\n\nconst _vector$b = /*@__PURE__*/ new Vector3();\n\nconst _box$4 = /*@__PURE__*/ new Box3();\n\n// triangle centered vertices\n\nconst _v0$3 = /*@__PURE__*/ new Vector3();\nconst _v1$7 = /*@__PURE__*/ new Vector3();\nconst _v2$4 = /*@__PURE__*/ new Vector3();\n\n// triangle edge vectors\n\nconst _f0 = /*@__PURE__*/ new Vector3();\nconst _f1 = /*@__PURE__*/ new Vector3();\nconst _f2 = /*@__PURE__*/ new Vector3();\n\nconst _center = /*@__PURE__*/ new Vector3();\nconst _extents = /*@__PURE__*/ new Vector3();\nconst _triangleNormal = /*@__PURE__*/ new Vector3();\nconst _testAxis = /*@__PURE__*/ new Vector3();\n\nfunction satForAxes( axes, v0, v1, v2, extents ) {\n\n\tfor ( let i = 0, j = axes.length - 3; i <= j; i += 3 ) {\n\n\t\t_testAxis.fromArray( axes, i );\n\t\t// project the aabb onto the separating axis\n\t\tconst r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z );\n\t\t// project all 3 vertices of the triangle onto the separating axis\n\t\tconst p0 = v0.dot( _testAxis );\n\t\tconst p1 = v1.dot( _testAxis );\n\t\tconst p2 = v2.dot( _testAxis );\n\t\t// actual test, basically see if either of the most extreme of the triangle points intersects r\n\t\tif ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) > r ) {\n\n\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t// the axis is separating and we can exit\n\t\t\treturn false;\n\n\t\t}\n\n\t}\n\n\treturn true;\n\n}\n\nconst _box$3 = /*@__PURE__*/ new Box3();\nconst _v1$6 = /*@__PURE__*/ new Vector3();\nconst _v2$3 = /*@__PURE__*/ new Vector3();\n\nclass Sphere {\n\n\tconstructor( center = new Vector3(), radius = - 1 ) {\n\n\t\tthis.isSphere = true;\n\n\t\tthis.center = center;\n\t\tthis.radius = radius;\n\n\t}\n\n\tset( center, radius ) {\n\n\t\tthis.center.copy( center );\n\t\tthis.radius = radius;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPoints( points, optionalCenter ) {\n\n\t\tconst center = this.center;\n\n\t\tif ( optionalCenter !== undefined ) {\n\n\t\t\tcenter.copy( optionalCenter );\n\n\t\t} else {\n\n\t\t\t_box$3.setFromPoints( points ).getCenter( center );\n\n\t\t}\n\n\t\tlet maxRadiusSq = 0;\n\n\t\tfor ( let i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) );\n\n\t\t}\n\n\t\tthis.radius = Math.sqrt( maxRadiusSq );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( sphere ) {\n\n\t\tthis.center.copy( sphere.center );\n\t\tthis.radius = sphere.radius;\n\n\t\treturn this;\n\n\t}\n\n\tisEmpty() {\n\n\t\treturn ( this.radius < 0 );\n\n\t}\n\n\tmakeEmpty() {\n\n\t\tthis.center.set( 0, 0, 0 );\n\t\tthis.radius = - 1;\n\n\t\treturn this;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\treturn ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) );\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn ( point.distanceTo( this.center ) - this.radius );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\tconst radiusSum = this.radius + sphere.radius;\n\n\t\treturn sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsSphere( this );\n\n\t}\n\n\tintersectsPlane( plane ) {\n\n\t\treturn Math.abs( plane.distanceToPoint( this.center ) ) <= this.radius;\n\n\t}\n\n\tclampPoint( point, target ) {\n\n\t\tconst deltaLengthSq = this.center.distanceToSquared( point );\n\n\t\ttarget.copy( point );\n\n\t\tif ( deltaLengthSq > ( this.radius * this.radius ) ) {\n\n\t\t\ttarget.sub( this.center ).normalize();\n\t\t\ttarget.multiplyScalar( this.radius ).add( this.center );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\tgetBoundingBox( target ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\t// Empty sphere produces empty bounding box\n\t\t\ttarget.makeEmpty();\n\t\t\treturn target;\n\n\t\t}\n\n\t\ttarget.set( this.center, this.center );\n\t\ttarget.expandByScalar( this.radius );\n\n\t\treturn target;\n\n\t}\n\n\tapplyMatrix4( matrix ) {\n\n\t\tthis.center.applyMatrix4( matrix );\n\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.center.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\texpandByPoint( point ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\tthis.center.copy( point );\n\n\t\t\tthis.radius = 0;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\t_v1$6.subVectors( point, this.center );\n\n\t\tconst lengthSq = _v1$6.lengthSq();\n\n\t\tif ( lengthSq > ( this.radius * this.radius ) ) {\n\n\t\t\t// calculate the minimal sphere\n\n\t\t\tconst length = Math.sqrt( lengthSq );\n\n\t\t\tconst delta = ( length - this.radius ) * 0.5;\n\n\t\t\tthis.center.addScaledVector( _v1$6, delta / length );\n\n\t\t\tthis.radius += delta;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tunion( sphere ) {\n\n\t\tif ( sphere.isEmpty() ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\tthis.copy( sphere );\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( this.center.equals( sphere.center ) === true ) {\n\n\t\t\t this.radius = Math.max( this.radius, sphere.radius );\n\n\t\t} else {\n\n\t\t\t_v2$3.subVectors( sphere.center, this.center ).setLength( sphere.radius );\n\n\t\t\tthis.expandByPoint( _v1$6.copy( sphere.center ).add( _v2$3 ) );\n\n\t\t\tthis.expandByPoint( _v1$6.copy( sphere.center ).sub( _v2$3 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tequals( sphere ) {\n\n\t\treturn sphere.center.equals( this.center ) && ( sphere.radius === this.radius );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _vector$a = /*@__PURE__*/ new Vector3();\nconst _segCenter = /*@__PURE__*/ new Vector3();\nconst _segDir = /*@__PURE__*/ new Vector3();\nconst _diff = /*@__PURE__*/ new Vector3();\n\nconst _edge1 = /*@__PURE__*/ new Vector3();\nconst _edge2 = /*@__PURE__*/ new Vector3();\nconst _normal$1 = /*@__PURE__*/ new Vector3();\n\nclass Ray {\n\n\tconstructor( origin = new Vector3(), direction = new Vector3( 0, 0, - 1 ) ) {\n\n\t\tthis.origin = origin;\n\t\tthis.direction = direction;\n\n\t}\n\n\tset( origin, direction ) {\n\n\t\tthis.origin.copy( origin );\n\t\tthis.direction.copy( direction );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( ray ) {\n\n\t\tthis.origin.copy( ray.origin );\n\t\tthis.direction.copy( ray.direction );\n\n\t\treturn this;\n\n\t}\n\n\tat( t, target ) {\n\n\t\treturn target.copy( this.origin ).addScaledVector( this.direction, t );\n\n\t}\n\n\tlookAt( v ) {\n\n\t\tthis.direction.copy( v ).sub( this.origin ).normalize();\n\n\t\treturn this;\n\n\t}\n\n\trecast( t ) {\n\n\t\tthis.origin.copy( this.at( t, _vector$a ) );\n\n\t\treturn this;\n\n\t}\n\n\tclosestPointToPoint( point, target ) {\n\n\t\ttarget.subVectors( point, this.origin );\n\n\t\tconst directionDistance = target.dot( this.direction );\n\n\t\tif ( directionDistance < 0 ) {\n\n\t\t\treturn target.copy( this.origin );\n\n\t\t}\n\n\t\treturn target.copy( this.origin ).addScaledVector( this.direction, directionDistance );\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn Math.sqrt( this.distanceSqToPoint( point ) );\n\n\t}\n\n\tdistanceSqToPoint( point ) {\n\n\t\tconst directionDistance = _vector$a.subVectors( point, this.origin ).dot( this.direction );\n\n\t\t// point behind the ray\n\n\t\tif ( directionDistance < 0 ) {\n\n\t\t\treturn this.origin.distanceToSquared( point );\n\n\t\t}\n\n\t\t_vector$a.copy( this.origin ).addScaledVector( this.direction, directionDistance );\n\n\t\treturn _vector$a.distanceToSquared( point );\n\n\t}\n\n\tdistanceSqToSegment( v0, v1, optionalPointOnRay, optionalPointOnSegment ) {\n\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t// It returns the min distance between the ray and the segment\n\t\t// defined by v0 and v1\n\t\t// It can also set two optional targets :\n\t\t// - The closest point on the ray\n\t\t// - The closest point on the segment\n\n\t\t_segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 );\n\t\t_segDir.copy( v1 ).sub( v0 ).normalize();\n\t\t_diff.copy( this.origin ).sub( _segCenter );\n\n\t\tconst segExtent = v0.distanceTo( v1 ) * 0.5;\n\t\tconst a01 = - this.direction.dot( _segDir );\n\t\tconst b0 = _diff.dot( this.direction );\n\t\tconst b1 = - _diff.dot( _segDir );\n\t\tconst c = _diff.lengthSq();\n\t\tconst det = Math.abs( 1 - a01 * a01 );\n\t\tlet s0, s1, sqrDist, extDet;\n\n\t\tif ( det > 0 ) {\n\n\t\t\t// The ray and segment are not parallel.\n\n\t\t\ts0 = a01 * b1 - b0;\n\t\t\ts1 = a01 * b0 - b1;\n\t\t\textDet = segExtent * det;\n\n\t\t\tif ( s0 >= 0 ) {\n\n\t\t\t\tif ( s1 >= - extDet ) {\n\n\t\t\t\t\tif ( s1 <= extDet ) {\n\n\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\n\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\tsqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// region 1\n\n\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// region 5\n\n\t\t\t\t\ts1 = - segExtent;\n\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( s1 <= - extDet ) {\n\n\t\t\t\t\t// region 4\n\n\t\t\t\t\ts0 = Math.max( 0, - ( - a01 * segExtent + b0 ) );\n\t\t\t\t\ts1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t} else if ( s1 <= extDet ) {\n\n\t\t\t\t\t// region 3\n\n\t\t\t\t\ts0 = 0;\n\t\t\t\t\ts1 = Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// region 2\n\n\t\t\t\t\ts0 = Math.max( 0, - ( a01 * segExtent + b0 ) );\n\t\t\t\t\ts1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// Ray and segment are parallel.\n\n\t\t\ts1 = ( a01 > 0 ) ? - segExtent : segExtent;\n\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t}\n\n\t\tif ( optionalPointOnRay ) {\n\n\t\t\toptionalPointOnRay.copy( this.origin ).addScaledVector( this.direction, s0 );\n\n\t\t}\n\n\t\tif ( optionalPointOnSegment ) {\n\n\t\t\toptionalPointOnSegment.copy( _segCenter ).addScaledVector( _segDir, s1 );\n\n\t\t}\n\n\t\treturn sqrDist;\n\n\t}\n\n\tintersectSphere( sphere, target ) {\n\n\t\t_vector$a.subVectors( sphere.center, this.origin );\n\t\tconst tca = _vector$a.dot( this.direction );\n\t\tconst d2 = _vector$a.dot( _vector$a ) - tca * tca;\n\t\tconst radius2 = sphere.radius * sphere.radius;\n\n\t\tif ( d2 > radius2 ) return null;\n\n\t\tconst thc = Math.sqrt( radius2 - d2 );\n\n\t\t// t0 = first intersect point - entrance on front of sphere\n\t\tconst t0 = tca - thc;\n\n\t\t// t1 = second intersect point - exit point on back of sphere\n\t\tconst t1 = tca + thc;\n\n\t\t// test to see if t1 is behind the ray - if so, return null\n\t\tif ( t1 < 0 ) return null;\n\n\t\t// test to see if t0 is behind the ray:\n\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t// in order to always return an intersect point that is in front of the ray.\n\t\tif ( t0 < 0 ) return this.at( t1, target );\n\n\t\t// else t0 is in front of the ray, so return the first collision point scaled by t0\n\t\treturn this.at( t0, target );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\treturn this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius );\n\n\t}\n\n\tdistanceToPlane( plane ) {\n\n\t\tconst denominator = plane.normal.dot( this.direction );\n\n\t\tif ( denominator === 0 ) {\n\n\t\t\t// line is coplanar, return origin\n\t\t\tif ( plane.distanceToPoint( this.origin ) === 0 ) {\n\n\t\t\t\treturn 0;\n\n\t\t\t}\n\n\t\t\t// Null is preferable to undefined since undefined means.... it is undefined\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator;\n\n\t\t// Return if the ray never intersects the plane\n\n\t\treturn t >= 0 ? t : null;\n\n\t}\n\n\tintersectPlane( plane, target ) {\n\n\t\tconst t = this.distanceToPlane( plane );\n\n\t\tif ( t === null ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn this.at( t, target );\n\n\t}\n\n\tintersectsPlane( plane ) {\n\n\t\t// check if the ray lies on the plane first\n\n\t\tconst distToPoint = plane.distanceToPoint( this.origin );\n\n\t\tif ( distToPoint === 0 ) {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\tconst denominator = plane.normal.dot( this.direction );\n\n\t\tif ( denominator * distToPoint < 0 ) {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\t// ray origin is behind the plane (and is pointing behind it)\n\n\t\treturn false;\n\n\t}\n\n\tintersectBox( box, target ) {\n\n\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\n\t\tconst invdirx = 1 / this.direction.x,\n\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\tinvdirz = 1 / this.direction.z;\n\n\t\tconst origin = this.origin;\n\n\t\tif ( invdirx >= 0 ) {\n\n\t\t\ttmin = ( box.min.x - origin.x ) * invdirx;\n\t\t\ttmax = ( box.max.x - origin.x ) * invdirx;\n\n\t\t} else {\n\n\t\t\ttmin = ( box.max.x - origin.x ) * invdirx;\n\t\t\ttmax = ( box.min.x - origin.x ) * invdirx;\n\n\t\t}\n\n\t\tif ( invdiry >= 0 ) {\n\n\t\t\ttymin = ( box.min.y - origin.y ) * invdiry;\n\t\t\ttymax = ( box.max.y - origin.y ) * invdiry;\n\n\t\t} else {\n\n\t\t\ttymin = ( box.max.y - origin.y ) * invdiry;\n\t\t\ttymax = ( box.min.y - origin.y ) * invdiry;\n\n\t\t}\n\n\t\tif ( ( tmin > tymax ) || ( tymin > tmax ) ) return null;\n\n\t\tif ( tymin > tmin || isNaN( tmin ) ) tmin = tymin;\n\n\t\tif ( tymax < tmax || isNaN( tmax ) ) tmax = tymax;\n\n\t\tif ( invdirz >= 0 ) {\n\n\t\t\ttzmin = ( box.min.z - origin.z ) * invdirz;\n\t\t\ttzmax = ( box.max.z - origin.z ) * invdirz;\n\n\t\t} else {\n\n\t\t\ttzmin = ( box.max.z - origin.z ) * invdirz;\n\t\t\ttzmax = ( box.min.z - origin.z ) * invdirz;\n\n\t\t}\n\n\t\tif ( ( tmin > tzmax ) || ( tzmin > tmax ) ) return null;\n\n\t\tif ( tzmin > tmin || tmin !== tmin ) tmin = tzmin;\n\n\t\tif ( tzmax < tmax || tmax !== tmax ) tmax = tzmax;\n\n\t\t//return point closest to the ray (positive side)\n\n\t\tif ( tmax < 0 ) return null;\n\n\t\treturn this.at( tmin >= 0 ? tmin : tmax, target );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn this.intersectBox( box, _vector$a ) !== null;\n\n\t}\n\n\tintersectTriangle( a, b, c, backfaceCulling, target ) {\n\n\t\t// Compute the offset origin, edges, and normal.\n\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\n\t\t_edge1.subVectors( b, a );\n\t\t_edge2.subVectors( c, a );\n\t\t_normal$1.crossVectors( _edge1, _edge2 );\n\n\t\t// Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t// |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t// |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t// |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\t\tlet DdN = this.direction.dot( _normal$1 );\n\t\tlet sign;\n\n\t\tif ( DdN > 0 ) {\n\n\t\t\tif ( backfaceCulling ) return null;\n\t\t\tsign = 1;\n\n\t\t} else if ( DdN < 0 ) {\n\n\t\t\tsign = - 1;\n\t\t\tDdN = - DdN;\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t_diff.subVectors( this.origin, a );\n\t\tconst DdQxE2 = sign * this.direction.dot( _edge2.crossVectors( _diff, _edge2 ) );\n\n\t\t// b1 < 0, no intersection\n\t\tif ( DdQxE2 < 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst DdE1xQ = sign * this.direction.dot( _edge1.cross( _diff ) );\n\n\t\t// b2 < 0, no intersection\n\t\tif ( DdE1xQ < 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// b1+b2 > 1, no intersection\n\t\tif ( DdQxE2 + DdE1xQ > DdN ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// Line intersects triangle, check if ray does.\n\t\tconst QdN = - sign * _diff.dot( _normal$1 );\n\n\t\t// t < 0, no intersection\n\t\tif ( QdN < 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// Ray intersects triangle.\n\t\treturn this.at( QdN / DdN, target );\n\n\t}\n\n\tapplyMatrix4( matrix4 ) {\n\n\t\tthis.origin.applyMatrix4( matrix4 );\n\t\tthis.direction.transformDirection( matrix4 );\n\n\t\treturn this;\n\n\t}\n\n\tequals( ray ) {\n\n\t\treturn ray.origin.equals( this.origin ) && ray.direction.equals( this.direction );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nclass Matrix4 {\n\n\tconstructor( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {\n\n\t\tMatrix4.prototype.isMatrix4 = true;\n\n\t\tthis.elements = [\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t];\n\n\t\tif ( n11 !== undefined ) {\n\n\t\t\tthis.set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 );\n\n\t\t}\n\n\t}\n\n\tset( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14;\n\t\tte[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24;\n\t\tte[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34;\n\t\tte[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44;\n\n\t\treturn this;\n\n\t}\n\n\tidentity() {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new Matrix4().fromArray( this.elements );\n\n\t}\n\n\tcopy( m ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tte[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ];\n\t\tte[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ];\n\t\tte[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ];\n\t\tte[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ];\n\n\t\treturn this;\n\n\t}\n\n\tcopyPosition( m ) {\n\n\t\tconst te = this.elements, me = m.elements;\n\n\t\tte[ 12 ] = me[ 12 ];\n\t\tte[ 13 ] = me[ 13 ];\n\t\tte[ 14 ] = me[ 14 ];\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrix3( m ) {\n\n\t\tconst me = m.elements;\n\n\t\tthis.set(\n\n\t\t\tme[ 0 ], me[ 3 ], me[ 6 ], 0,\n\t\t\tme[ 1 ], me[ 4 ], me[ 7 ], 0,\n\t\t\tme[ 2 ], me[ 5 ], me[ 8 ], 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\textractBasis( xAxis, yAxis, zAxis ) {\n\n\t\txAxis.setFromMatrixColumn( this, 0 );\n\t\tyAxis.setFromMatrixColumn( this, 1 );\n\t\tzAxis.setFromMatrixColumn( this, 2 );\n\n\t\treturn this;\n\n\t}\n\n\tmakeBasis( xAxis, yAxis, zAxis ) {\n\n\t\tthis.set(\n\t\t\txAxis.x, yAxis.x, zAxis.x, 0,\n\t\t\txAxis.y, yAxis.y, zAxis.y, 0,\n\t\t\txAxis.z, yAxis.z, zAxis.z, 0,\n\t\t\t0, 0, 0, 1\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\textractRotation( m ) {\n\n\t\t// this method does not support reflection matrices\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tconst scaleX = 1 / _v1$5.setFromMatrixColumn( m, 0 ).length();\n\t\tconst scaleY = 1 / _v1$5.setFromMatrixColumn( m, 1 ).length();\n\t\tconst scaleZ = 1 / _v1$5.setFromMatrixColumn( m, 2 ).length();\n\n\t\tte[ 0 ] = me[ 0 ] * scaleX;\n\t\tte[ 1 ] = me[ 1 ] * scaleX;\n\t\tte[ 2 ] = me[ 2 ] * scaleX;\n\t\tte[ 3 ] = 0;\n\n\t\tte[ 4 ] = me[ 4 ] * scaleY;\n\t\tte[ 5 ] = me[ 5 ] * scaleY;\n\t\tte[ 6 ] = me[ 6 ] * scaleY;\n\t\tte[ 7 ] = 0;\n\n\t\tte[ 8 ] = me[ 8 ] * scaleZ;\n\t\tte[ 9 ] = me[ 9 ] * scaleZ;\n\t\tte[ 10 ] = me[ 10 ] * scaleZ;\n\t\tte[ 11 ] = 0;\n\n\t\tte[ 12 ] = 0;\n\t\tte[ 13 ] = 0;\n\t\tte[ 14 ] = 0;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationFromEuler( euler ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = euler.x, y = euler.y, z = euler.z;\n\t\tconst a = Math.cos( x ), b = Math.sin( x );\n\t\tconst c = Math.cos( y ), d = Math.sin( y );\n\t\tconst e = Math.cos( z ), f = Math.sin( z );\n\n\t\tif ( euler.order === 'XYZ' ) {\n\n\t\t\tconst ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = - c * f;\n\t\t\tte[ 8 ] = d;\n\n\t\t\tte[ 1 ] = af + be * d;\n\t\t\tte[ 5 ] = ae - bf * d;\n\t\t\tte[ 9 ] = - b * c;\n\n\t\t\tte[ 2 ] = bf - ae * d;\n\t\t\tte[ 6 ] = be + af * d;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'YXZ' ) {\n\n\t\t\tconst ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\tte[ 0 ] = ce + df * b;\n\t\t\tte[ 4 ] = de * b - cf;\n\t\t\tte[ 8 ] = a * d;\n\n\t\t\tte[ 1 ] = a * f;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = - b;\n\n\t\t\tte[ 2 ] = cf * b - de;\n\t\t\tte[ 6 ] = df + ce * b;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'ZXY' ) {\n\n\t\t\tconst ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\tte[ 0 ] = ce - df * b;\n\t\t\tte[ 4 ] = - a * f;\n\t\t\tte[ 8 ] = de + cf * b;\n\n\t\t\tte[ 1 ] = cf + de * b;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = df - ce * b;\n\n\t\t\tte[ 2 ] = - a * d;\n\t\t\tte[ 6 ] = b;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'ZYX' ) {\n\n\t\t\tconst ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = be * d - af;\n\t\t\tte[ 8 ] = ae * d + bf;\n\n\t\t\tte[ 1 ] = c * f;\n\t\t\tte[ 5 ] = bf * d + ae;\n\t\t\tte[ 9 ] = af * d - be;\n\n\t\t\tte[ 2 ] = - d;\n\t\t\tte[ 6 ] = b * c;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'YZX' ) {\n\n\t\t\tconst ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = bd - ac * f;\n\t\t\tte[ 8 ] = bc * f + ad;\n\n\t\t\tte[ 1 ] = f;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = - b * e;\n\n\t\t\tte[ 2 ] = - d * e;\n\t\t\tte[ 6 ] = ad * f + bc;\n\t\t\tte[ 10 ] = ac - bd * f;\n\n\t\t} else if ( euler.order === 'XZY' ) {\n\n\t\t\tconst ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = - f;\n\t\t\tte[ 8 ] = d * e;\n\n\t\t\tte[ 1 ] = ac * f + bd;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = ad * f - bc;\n\n\t\t\tte[ 2 ] = bc * f - ad;\n\t\t\tte[ 6 ] = b * e;\n\t\t\tte[ 10 ] = bd * f + ac;\n\n\t\t}\n\n\t\t// bottom row\n\t\tte[ 3 ] = 0;\n\t\tte[ 7 ] = 0;\n\t\tte[ 11 ] = 0;\n\n\t\t// last column\n\t\tte[ 12 ] = 0;\n\t\tte[ 13 ] = 0;\n\t\tte[ 14 ] = 0;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationFromQuaternion( q ) {\n\n\t\treturn this.compose( _zero, q, _one );\n\n\t}\n\n\tlookAt( eye, target, up ) {\n\n\t\tconst te = this.elements;\n\n\t\t_z.subVectors( eye, target );\n\n\t\tif ( _z.lengthSq() === 0 ) {\n\n\t\t\t// eye and target are in the same position\n\n\t\t\t_z.z = 1;\n\n\t\t}\n\n\t\t_z.normalize();\n\t\t_x.crossVectors( up, _z );\n\n\t\tif ( _x.lengthSq() === 0 ) {\n\n\t\t\t// up and z are parallel\n\n\t\t\tif ( Math.abs( up.z ) === 1 ) {\n\n\t\t\t\t_z.x += 0.0001;\n\n\t\t\t} else {\n\n\t\t\t\t_z.z += 0.0001;\n\n\t\t\t}\n\n\t\t\t_z.normalize();\n\t\t\t_x.crossVectors( up, _z );\n\n\t\t}\n\n\t\t_x.normalize();\n\t\t_y.crossVectors( _z, _x );\n\n\t\tte[ 0 ] = _x.x; te[ 4 ] = _y.x; te[ 8 ] = _z.x;\n\t\tte[ 1 ] = _x.y; te[ 5 ] = _y.y; te[ 9 ] = _z.y;\n\t\tte[ 2 ] = _x.z; te[ 6 ] = _y.z; te[ 10 ] = _z.z;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( m ) {\n\n\t\treturn this.multiplyMatrices( this, m );\n\n\t}\n\n\tpremultiply( m ) {\n\n\t\treturn this.multiplyMatrices( m, this );\n\n\t}\n\n\tmultiplyMatrices( a, b ) {\n\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\n\t\tconst a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ];\n\t\tconst a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ];\n\t\tconst a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ];\n\t\tconst a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ];\n\n\t\tconst b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ];\n\t\tconst b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ];\n\t\tconst b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ];\n\t\tconst b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ];\n\n\t\tte[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\tte[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\tte[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\tte[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\n\t\tte[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\tte[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\tte[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\tte[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\n\t\tte[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\tte[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\tte[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\tte[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\n\t\tte[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\tte[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\tte[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\tte[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( s ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s;\n\t\tte[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s;\n\t\tte[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s;\n\t\tte[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s;\n\n\t\treturn this;\n\n\t}\n\n\tdeterminant() {\n\n\t\tconst te = this.elements;\n\n\t\tconst n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ];\n\t\tconst n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ];\n\t\tconst n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ];\n\t\tconst n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ];\n\n\t\t//TODO: make this more efficient\n\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\treturn (\n\t\t\tn41 * (\n\t\t\t\t+ n14 * n23 * n32\n\t\t\t\t - n13 * n24 * n32\n\t\t\t\t - n14 * n22 * n33\n\t\t\t\t + n12 * n24 * n33\n\t\t\t\t + n13 * n22 * n34\n\t\t\t\t - n12 * n23 * n34\n\t\t\t) +\n\t\t\tn42 * (\n\t\t\t\t+ n11 * n23 * n34\n\t\t\t\t - n11 * n24 * n33\n\t\t\t\t + n14 * n21 * n33\n\t\t\t\t - n13 * n21 * n34\n\t\t\t\t + n13 * n24 * n31\n\t\t\t\t - n14 * n23 * n31\n\t\t\t) +\n\t\t\tn43 * (\n\t\t\t\t+ n11 * n24 * n32\n\t\t\t\t - n11 * n22 * n34\n\t\t\t\t - n14 * n21 * n32\n\t\t\t\t + n12 * n21 * n34\n\t\t\t\t + n14 * n22 * n31\n\t\t\t\t - n12 * n24 * n31\n\t\t\t) +\n\t\t\tn44 * (\n\t\t\t\t- n13 * n22 * n31\n\t\t\t\t - n11 * n23 * n32\n\t\t\t\t + n11 * n22 * n33\n\t\t\t\t + n13 * n21 * n32\n\t\t\t\t - n12 * n21 * n33\n\t\t\t\t + n12 * n23 * n31\n\t\t\t)\n\n\t\t);\n\n\t}\n\n\ttranspose() {\n\n\t\tconst te = this.elements;\n\t\tlet tmp;\n\n\t\ttmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp;\n\t\ttmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp;\n\t\ttmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp;\n\n\t\ttmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp;\n\t\ttmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp;\n\t\ttmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp;\n\n\t\treturn this;\n\n\t}\n\n\tsetPosition( x, y, z ) {\n\n\t\tconst te = this.elements;\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\tte[ 12 ] = x.x;\n\t\t\tte[ 13 ] = x.y;\n\t\t\tte[ 14 ] = x.z;\n\n\t\t} else {\n\n\t\t\tte[ 12 ] = x;\n\t\t\tte[ 13 ] = y;\n\t\t\tte[ 14 ] = z;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tinvert() {\n\n\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\tconst te = this.elements,\n\n\t\t\tn11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ], n41 = te[ 3 ],\n\t\t\tn12 = te[ 4 ], n22 = te[ 5 ], n32 = te[ 6 ], n42 = te[ 7 ],\n\t\t\tn13 = te[ 8 ], n23 = te[ 9 ], n33 = te[ 10 ], n43 = te[ 11 ],\n\t\t\tn14 = te[ 12 ], n24 = te[ 13 ], n34 = te[ 14 ], n44 = te[ 15 ],\n\n\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\n\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\n\t\tif ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );\n\n\t\tconst detInv = 1 / det;\n\n\t\tte[ 0 ] = t11 * detInv;\n\t\tte[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv;\n\t\tte[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv;\n\t\tte[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv;\n\n\t\tte[ 4 ] = t12 * detInv;\n\t\tte[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv;\n\t\tte[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv;\n\t\tte[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv;\n\n\t\tte[ 8 ] = t13 * detInv;\n\t\tte[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv;\n\t\tte[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv;\n\t\tte[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv;\n\n\t\tte[ 12 ] = t14 * detInv;\n\t\tte[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv;\n\t\tte[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv;\n\t\tte[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv;\n\n\t\treturn this;\n\n\t}\n\n\tscale( v ) {\n\n\t\tconst te = this.elements;\n\t\tconst x = v.x, y = v.y, z = v.z;\n\n\t\tte[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z;\n\t\tte[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z;\n\t\tte[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z;\n\t\tte[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z;\n\n\t\treturn this;\n\n\t}\n\n\tgetMaxScaleOnAxis() {\n\n\t\tconst te = this.elements;\n\n\t\tconst scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ];\n\t\tconst scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ];\n\t\tconst scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ];\n\n\t\treturn Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) );\n\n\t}\n\n\tmakeTranslation( x, y, z ) {\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, 0, x.x,\n\t\t\t\t0, 1, 0, x.y,\n\t\t\t\t0, 0, 1, x.z,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t} else {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, 0, x,\n\t\t\t\t0, 1, 0, y,\n\t\t\t\t0, 0, 1, z,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationX( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, c, - s, 0,\n\t\t\t0, s, c, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationY( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\t c, 0, s, 0,\n\t\t\t 0, 1, 0, 0,\n\t\t\t- s, 0, c, 0,\n\t\t\t 0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationZ( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\tc, - s, 0, 0,\n\t\t\ts, c, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeRotationAxis( axis, angle ) {\n\n\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\n\t\tconst c = Math.cos( angle );\n\t\tconst s = Math.sin( angle );\n\t\tconst t = 1 - c;\n\t\tconst x = axis.x, y = axis.y, z = axis.z;\n\t\tconst tx = t * x, ty = t * y;\n\n\t\tthis.set(\n\n\t\t\ttx * x + c, tx * y - s * z, tx * z + s * y, 0,\n\t\t\ttx * y + s * z, ty * y + c, ty * z - s * x, 0,\n\t\t\ttx * z - s * y, ty * z + s * x, t * z * z + c, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeScale( x, y, z ) {\n\n\t\tthis.set(\n\n\t\t\tx, 0, 0, 0,\n\t\t\t0, y, 0, 0,\n\t\t\t0, 0, z, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tmakeShear( xy, xz, yx, yz, zx, zy ) {\n\n\t\tthis.set(\n\n\t\t\t1, yx, zx, 0,\n\t\t\txy, 1, zy, 0,\n\t\t\txz, yz, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tcompose( position, quaternion, scale ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w;\n\t\tconst x2 = x + x,\ty2 = y + y, z2 = z + z;\n\t\tconst xx = x * x2, xy = x * y2, xz = x * z2;\n\t\tconst yy = y * y2, yz = y * z2, zz = z * z2;\n\t\tconst wx = w * x2, wy = w * y2, wz = w * z2;\n\n\t\tconst sx = scale.x, sy = scale.y, sz = scale.z;\n\n\t\tte[ 0 ] = ( 1 - ( yy + zz ) ) * sx;\n\t\tte[ 1 ] = ( xy + wz ) * sx;\n\t\tte[ 2 ] = ( xz - wy ) * sx;\n\t\tte[ 3 ] = 0;\n\n\t\tte[ 4 ] = ( xy - wz ) * sy;\n\t\tte[ 5 ] = ( 1 - ( xx + zz ) ) * sy;\n\t\tte[ 6 ] = ( yz + wx ) * sy;\n\t\tte[ 7 ] = 0;\n\n\t\tte[ 8 ] = ( xz + wy ) * sz;\n\t\tte[ 9 ] = ( yz - wx ) * sz;\n\t\tte[ 10 ] = ( 1 - ( xx + yy ) ) * sz;\n\t\tte[ 11 ] = 0;\n\n\t\tte[ 12 ] = position.x;\n\t\tte[ 13 ] = position.y;\n\t\tte[ 14 ] = position.z;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\tdecompose( position, quaternion, scale ) {\n\n\t\tconst te = this.elements;\n\n\t\tlet sx = _v1$5.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length();\n\t\tconst sy = _v1$5.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length();\n\t\tconst sz = _v1$5.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length();\n\n\t\t// if determine is negative, we need to invert one scale\n\t\tconst det = this.determinant();\n\t\tif ( det < 0 ) sx = - sx;\n\n\t\tposition.x = te[ 12 ];\n\t\tposition.y = te[ 13 ];\n\t\tposition.z = te[ 14 ];\n\n\t\t// scale the rotation part\n\t\t_m1$4.copy( this );\n\n\t\tconst invSX = 1 / sx;\n\t\tconst invSY = 1 / sy;\n\t\tconst invSZ = 1 / sz;\n\n\t\t_m1$4.elements[ 0 ] *= invSX;\n\t\t_m1$4.elements[ 1 ] *= invSX;\n\t\t_m1$4.elements[ 2 ] *= invSX;\n\n\t\t_m1$4.elements[ 4 ] *= invSY;\n\t\t_m1$4.elements[ 5 ] *= invSY;\n\t\t_m1$4.elements[ 6 ] *= invSY;\n\n\t\t_m1$4.elements[ 8 ] *= invSZ;\n\t\t_m1$4.elements[ 9 ] *= invSZ;\n\t\t_m1$4.elements[ 10 ] *= invSZ;\n\n\t\tquaternion.setFromRotationMatrix( _m1$4 );\n\n\t\tscale.x = sx;\n\t\tscale.y = sy;\n\t\tscale.z = sz;\n\n\t\treturn this;\n\n\t}\n\n\tmakePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {\n\n\t\tconst te = this.elements;\n\t\tconst x = 2 * near / ( right - left );\n\t\tconst y = 2 * near / ( top - bottom );\n\n\t\tconst a = ( right + left ) / ( right - left );\n\t\tconst b = ( top + bottom ) / ( top - bottom );\n\n\t\tlet c, d;\n\n\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\tc = - ( far + near ) / ( far - near );\n\t\t\td = ( - 2 * far * near ) / ( far - near );\n\n\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\tc = - far / ( far - near );\n\t\t\td = ( - far * near ) / ( far - near );\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t}\n\n\t\tte[ 0 ] = x;\tte[ 4 ] = 0;\tte[ 8 ] = a; \tte[ 12 ] = 0;\n\t\tte[ 1 ] = 0;\tte[ 5 ] = y;\tte[ 9 ] = b; \tte[ 13 ] = 0;\n\t\tte[ 2 ] = 0;\tte[ 6 ] = 0;\tte[ 10 ] = c; \tte[ 14 ] = d;\n\t\tte[ 3 ] = 0;\tte[ 7 ] = 0;\tte[ 11 ] = - 1;\tte[ 15 ] = 0;\n\n\t\treturn this;\n\n\t}\n\n\tmakeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {\n\n\t\tconst te = this.elements;\n\t\tconst w = 1.0 / ( right - left );\n\t\tconst h = 1.0 / ( top - bottom );\n\t\tconst p = 1.0 / ( far - near );\n\n\t\tconst x = ( right + left ) * w;\n\t\tconst y = ( top + bottom ) * h;\n\n\t\tlet z, zInv;\n\n\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\tz = ( far + near ) * p;\n\t\t\tzInv = - 2 * p;\n\n\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\tz = near * p;\n\t\t\tzInv = - 1 * p;\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t}\n\n\t\tte[ 0 ] = 2 * w;\tte[ 4 ] = 0;\t\tte[ 8 ] = 0; \t\tte[ 12 ] = - x;\n\t\tte[ 1 ] = 0; \t\tte[ 5 ] = 2 * h;\tte[ 9 ] = 0; \t\tte[ 13 ] = - y;\n\t\tte[ 2 ] = 0; \t\tte[ 6 ] = 0;\t\tte[ 10 ] = zInv;\tte[ 14 ] = - z;\n\t\tte[ 3 ] = 0; \t\tte[ 7 ] = 0;\t\tte[ 11 ] = 0;\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\tequals( matrix ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor ( let i = 0; i < 16; i ++ ) {\n\n\t\t\tif ( te[ i ] !== me[ i ] ) return false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i < 16; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst te = this.elements;\n\n\t\tarray[ offset ] = te[ 0 ];\n\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\tarray[ offset + 2 ] = te[ 2 ];\n\t\tarray[ offset + 3 ] = te[ 3 ];\n\n\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\tarray[ offset + 5 ] = te[ 5 ];\n\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\tarray[ offset + 7 ] = te[ 7 ];\n\n\t\tarray[ offset + 8 ] = te[ 8 ];\n\t\tarray[ offset + 9 ] = te[ 9 ];\n\t\tarray[ offset + 10 ] = te[ 10 ];\n\t\tarray[ offset + 11 ] = te[ 11 ];\n\n\t\tarray[ offset + 12 ] = te[ 12 ];\n\t\tarray[ offset + 13 ] = te[ 13 ];\n\t\tarray[ offset + 14 ] = te[ 14 ];\n\t\tarray[ offset + 15 ] = te[ 15 ];\n\n\t\treturn array;\n\n\t}\n\n}\n\nconst _v1$5 = /*@__PURE__*/ new Vector3();\nconst _m1$4 = /*@__PURE__*/ new Matrix4();\nconst _zero = /*@__PURE__*/ new Vector3( 0, 0, 0 );\nconst _one = /*@__PURE__*/ new Vector3( 1, 1, 1 );\nconst _x = /*@__PURE__*/ new Vector3();\nconst _y = /*@__PURE__*/ new Vector3();\nconst _z = /*@__PURE__*/ new Vector3();\n\nconst _matrix$2 = /*@__PURE__*/ new Matrix4();\nconst _quaternion$3 = /*@__PURE__*/ new Quaternion();\n\nclass Euler {\n\n\tconstructor( x = 0, y = 0, z = 0, order = Euler.DEFAULT_ORDER ) {\n\n\t\tthis.isEuler = true;\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t}\n\n\tget x() {\n\n\t\treturn this._x;\n\n\t}\n\n\tset x( value ) {\n\n\t\tthis._x = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget y() {\n\n\t\treturn this._y;\n\n\t}\n\n\tset y( value ) {\n\n\t\tthis._y = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget z() {\n\n\t\treturn this._z;\n\n\t}\n\n\tset z( value ) {\n\n\t\tthis._z = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tget order() {\n\n\t\treturn this._order;\n\n\t}\n\n\tset order( value ) {\n\n\t\tthis._order = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\tset( x, y, z, order = this._order ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this._x, this._y, this._z, this._order );\n\n\t}\n\n\tcopy( euler ) {\n\n\t\tthis._x = euler._x;\n\t\tthis._y = euler._y;\n\t\tthis._z = euler._z;\n\t\tthis._order = euler._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromRotationMatrix( m, order = this._order, update = true ) {\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tconst te = m.elements;\n\t\tconst m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ];\n\t\tconst m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ];\n\t\tconst m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tswitch ( order ) {\n\n\t\t\tcase 'XYZ':\n\n\t\t\t\tthis._y = Math.asin( clamp( m13, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m13 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\t\tthis._z = Math.atan2( - m12, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\t\tthis._z = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\n\t\t\t\tthis._x = Math.asin( - clamp( m23, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m23 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\t\t\t\t\tthis._z = Math.atan2( m21, m22 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\t\t\t\t\tthis._z = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\n\t\t\t\tthis._x = Math.asin( clamp( m32, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m32 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._y = Math.atan2( - m31, m33 );\n\t\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\n\t\t\t\tthis._y = Math.asin( - clamp( m31, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m31 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m33 );\n\t\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\n\t\t\t\tthis._z = Math.asin( clamp( m21, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m21 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m22 );\n\t\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\n\t\t\t\tthis._z = Math.asin( - clamp( m12, - 1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m12 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\t\tthis._y = Math.atan2( m13, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\t\tthis._y = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tconsole.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order );\n\n\t\t}\n\n\t\tthis._order = order;\n\n\t\tif ( update === true ) this._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\tsetFromQuaternion( q, order, update ) {\n\n\t\t_matrix$2.makeRotationFromQuaternion( q );\n\n\t\treturn this.setFromRotationMatrix( _matrix$2, order, update );\n\n\t}\n\n\tsetFromVector3( v, order = this._order ) {\n\n\t\treturn this.set( v.x, v.y, v.z, order );\n\n\t}\n\n\treorder( newOrder ) {\n\n\t\t// WARNING: this discards revolution information -bhouston\n\n\t\t_quaternion$3.setFromEuler( this );\n\n\t\treturn this.setFromQuaternion( _quaternion$3, newOrder );\n\n\t}\n\n\tequals( euler ) {\n\n\t\treturn ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order );\n\n\t}\n\n\tfromArray( array ) {\n\n\t\tthis._x = array[ 0 ];\n\t\tthis._y = array[ 1 ];\n\t\tthis._z = array[ 2 ];\n\t\tif ( array[ 3 ] !== undefined ) this._order = array[ 3 ];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this._x;\n\t\tarray[ offset + 1 ] = this._y;\n\t\tarray[ offset + 2 ] = this._z;\n\t\tarray[ offset + 3 ] = this._order;\n\n\t\treturn array;\n\n\t}\n\n\t_onChange( callback ) {\n\n\t\tthis._onChangeCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._order;\n\n\t}\n\n}\n\nEuler.DEFAULT_ORDER = 'XYZ';\n\nclass Layers {\n\n\tconstructor() {\n\n\t\tthis.mask = 1 | 0;\n\n\t}\n\n\tset( channel ) {\n\n\t\tthis.mask = ( 1 << channel | 0 ) >>> 0;\n\n\t}\n\n\tenable( channel ) {\n\n\t\tthis.mask |= 1 << channel | 0;\n\n\t}\n\n\tenableAll() {\n\n\t\tthis.mask = 0xffffffff | 0;\n\n\t}\n\n\ttoggle( channel ) {\n\n\t\tthis.mask ^= 1 << channel | 0;\n\n\t}\n\n\tdisable( channel ) {\n\n\t\tthis.mask &= ~ ( 1 << channel | 0 );\n\n\t}\n\n\tdisableAll() {\n\n\t\tthis.mask = 0;\n\n\t}\n\n\ttest( layers ) {\n\n\t\treturn ( this.mask & layers.mask ) !== 0;\n\n\t}\n\n\tisEnabled( channel ) {\n\n\t\treturn ( this.mask & ( 1 << channel | 0 ) ) !== 0;\n\n\t}\n\n}\n\nlet _object3DId = 0;\n\nconst _v1$4 = /*@__PURE__*/ new Vector3();\nconst _q1 = /*@__PURE__*/ new Quaternion();\nconst _m1$3 = /*@__PURE__*/ new Matrix4();\nconst _target = /*@__PURE__*/ new Vector3();\n\nconst _position$3 = /*@__PURE__*/ new Vector3();\nconst _scale$2 = /*@__PURE__*/ new Vector3();\nconst _quaternion$2 = /*@__PURE__*/ new Quaternion();\n\nconst _xAxis = /*@__PURE__*/ new Vector3( 1, 0, 0 );\nconst _yAxis = /*@__PURE__*/ new Vector3( 0, 1, 0 );\nconst _zAxis = /*@__PURE__*/ new Vector3( 0, 0, 1 );\n\nconst _addedEvent = { type: 'added' };\nconst _removedEvent = { type: 'removed' };\n\nconst _childaddedEvent = { type: 'childadded', child: null };\nconst _childremovedEvent = { type: 'childremoved', child: null };\n\nclass Object3D extends EventDispatcher {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isObject3D = true;\n\n\t\tObject.defineProperty( this, 'id', { value: _object3DId ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'Object3D';\n\n\t\tthis.parent = null;\n\t\tthis.children = [];\n\n\t\tthis.up = Object3D.DEFAULT_UP.clone();\n\n\t\tconst position = new Vector3();\n\t\tconst rotation = new Euler();\n\t\tconst quaternion = new Quaternion();\n\t\tconst scale = new Vector3( 1, 1, 1 );\n\n\t\tfunction onRotationChange() {\n\n\t\t\tquaternion.setFromEuler( rotation, false );\n\n\t\t}\n\n\t\tfunction onQuaternionChange() {\n\n\t\t\trotation.setFromQuaternion( quaternion, undefined, false );\n\n\t\t}\n\n\t\trotation._onChange( onRotationChange );\n\t\tquaternion._onChange( onQuaternionChange );\n\n\t\tObject.defineProperties( this, {\n\t\t\tposition: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: position\n\t\t\t},\n\t\t\trotation: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: rotation\n\t\t\t},\n\t\t\tquaternion: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: quaternion\n\t\t\t},\n\t\t\tscale: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: scale\n\t\t\t},\n\t\t\tmodelViewMatrix: {\n\t\t\t\tvalue: new Matrix4()\n\t\t\t},\n\t\t\tnormalMatrix: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t}\n\t\t} );\n\n\t\tthis.matrix = new Matrix4();\n\t\tthis.matrixWorld = new Matrix4();\n\n\t\tthis.matrixAutoUpdate = Object3D.DEFAULT_MATRIX_AUTO_UPDATE;\n\n\t\tthis.matrixWorldAutoUpdate = Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE; // checked by the renderer\n\t\tthis.matrixWorldNeedsUpdate = false;\n\n\t\tthis.layers = new Layers();\n\t\tthis.visible = true;\n\n\t\tthis.castShadow = false;\n\t\tthis.receiveShadow = false;\n\n\t\tthis.frustumCulled = true;\n\t\tthis.renderOrder = 0;\n\n\t\tthis.animations = [];\n\n\t\tthis.userData = {};\n\n\t}\n\n\tonBeforeShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}\n\n\tonAfterShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}\n\n\tonBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}\n\n\tonAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}\n\n\tapplyMatrix4( matrix ) {\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tthis.matrix.premultiply( matrix );\n\n\t\tthis.matrix.decompose( this.position, this.quaternion, this.scale );\n\n\t}\n\n\tapplyQuaternion( q ) {\n\n\t\tthis.quaternion.premultiply( q );\n\n\t\treturn this;\n\n\t}\n\n\tsetRotationFromAxisAngle( axis, angle ) {\n\n\t\t// assumes axis is normalized\n\n\t\tthis.quaternion.setFromAxisAngle( axis, angle );\n\n\t}\n\n\tsetRotationFromEuler( euler ) {\n\n\t\tthis.quaternion.setFromEuler( euler, true );\n\n\t}\n\n\tsetRotationFromMatrix( m ) {\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tthis.quaternion.setFromRotationMatrix( m );\n\n\t}\n\n\tsetRotationFromQuaternion( q ) {\n\n\t\t// assumes q is normalized\n\n\t\tthis.quaternion.copy( q );\n\n\t}\n\n\trotateOnAxis( axis, angle ) {\n\n\t\t// rotate object on axis in object space\n\t\t// axis is assumed to be normalized\n\n\t\t_q1.setFromAxisAngle( axis, angle );\n\n\t\tthis.quaternion.multiply( _q1 );\n\n\t\treturn this;\n\n\t}\n\n\trotateOnWorldAxis( axis, angle ) {\n\n\t\t// rotate object on axis in world space\n\t\t// axis is assumed to be normalized\n\t\t// method assumes no rotated parent\n\n\t\t_q1.setFromAxisAngle( axis, angle );\n\n\t\tthis.quaternion.premultiply( _q1 );\n\n\t\treturn this;\n\n\t}\n\n\trotateX( angle ) {\n\n\t\treturn this.rotateOnAxis( _xAxis, angle );\n\n\t}\n\n\trotateY( angle ) {\n\n\t\treturn this.rotateOnAxis( _yAxis, angle );\n\n\t}\n\n\trotateZ( angle ) {\n\n\t\treturn this.rotateOnAxis( _zAxis, angle );\n\n\t}\n\n\ttranslateOnAxis( axis, distance ) {\n\n\t\t// translate object by distance along axis in object space\n\t\t// axis is assumed to be normalized\n\n\t\t_v1$4.copy( axis ).applyQuaternion( this.quaternion );\n\n\t\tthis.position.add( _v1$4.multiplyScalar( distance ) );\n\n\t\treturn this;\n\n\t}\n\n\ttranslateX( distance ) {\n\n\t\treturn this.translateOnAxis( _xAxis, distance );\n\n\t}\n\n\ttranslateY( distance ) {\n\n\t\treturn this.translateOnAxis( _yAxis, distance );\n\n\t}\n\n\ttranslateZ( distance ) {\n\n\t\treturn this.translateOnAxis( _zAxis, distance );\n\n\t}\n\n\tlocalToWorld( vector ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn vector.applyMatrix4( this.matrixWorld );\n\n\t}\n\n\tworldToLocal( vector ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn vector.applyMatrix4( _m1$3.copy( this.matrixWorld ).invert() );\n\n\t}\n\n\tlookAt( x, y, z ) {\n\n\t\t// This method does not support objects having non-uniformly-scaled parent(s)\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\t_target.copy( x );\n\n\t\t} else {\n\n\t\t\t_target.set( x, y, z );\n\n\t\t}\n\n\t\tconst parent = this.parent;\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\t_position$3.setFromMatrixPosition( this.matrixWorld );\n\n\t\tif ( this.isCamera || this.isLight ) {\n\n\t\t\t_m1$3.lookAt( _position$3, _target, this.up );\n\n\t\t} else {\n\n\t\t\t_m1$3.lookAt( _target, _position$3, this.up );\n\n\t\t}\n\n\t\tthis.quaternion.setFromRotationMatrix( _m1$3 );\n\n\t\tif ( parent ) {\n\n\t\t\t_m1$3.extractRotation( parent.matrixWorld );\n\t\t\t_q1.setFromRotationMatrix( _m1$3 );\n\t\t\tthis.quaternion.premultiply( _q1.invert() );\n\n\t\t}\n\n\t}\n\n\tadd( object ) {\n\n\t\tif ( arguments.length > 1 ) {\n\n\t\t\tfor ( let i = 0; i < arguments.length; i ++ ) {\n\n\t\t\t\tthis.add( arguments[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( object === this ) {\n\n\t\t\tconsole.error( 'THREE.Object3D.add: object can\\'t be added as a child of itself.', object );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( object && object.isObject3D ) {\n\n\t\t\tobject.removeFromParent();\n\t\t\tobject.parent = this;\n\t\t\tthis.children.push( object );\n\n\t\t\tobject.dispatchEvent( _addedEvent );\n\n\t\t\t_childaddedEvent.child = object;\n\t\t\tthis.dispatchEvent( _childaddedEvent );\n\t\t\t_childaddedEvent.child = null;\n\n\t\t} else {\n\n\t\t\tconsole.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tremove( object ) {\n\n\t\tif ( arguments.length > 1 ) {\n\n\t\t\tfor ( let i = 0; i < arguments.length; i ++ ) {\n\n\t\t\t\tthis.remove( arguments[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst index = this.children.indexOf( object );\n\n\t\tif ( index !== - 1 ) {\n\n\t\t\tobject.parent = null;\n\t\t\tthis.children.splice( index, 1 );\n\n\t\t\tobject.dispatchEvent( _removedEvent );\n\n\t\t\t_childremovedEvent.child = object;\n\t\t\tthis.dispatchEvent( _childremovedEvent );\n\t\t\t_childremovedEvent.child = null;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tremoveFromParent() {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( parent !== null ) {\n\n\t\t\tparent.remove( this );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclear() {\n\n\t\treturn this.remove( ... this.children );\n\n\t}\n\n\tattach( object ) {\n\n\t\t// adds object as a child of this, while maintaining the object's world transform\n\n\t\t// Note: This method does not support scene graphs having non-uniformly-scaled nodes(s)\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\t_m1$3.copy( this.matrixWorld ).invert();\n\n\t\tif ( object.parent !== null ) {\n\n\t\t\tobject.parent.updateWorldMatrix( true, false );\n\n\t\t\t_m1$3.multiply( object.parent.matrixWorld );\n\n\t\t}\n\n\t\tobject.applyMatrix4( _m1$3 );\n\n\t\tobject.removeFromParent();\n\t\tobject.parent = this;\n\t\tthis.children.push( object );\n\n\t\tobject.updateWorldMatrix( false, true );\n\n\t\tobject.dispatchEvent( _addedEvent );\n\n\t\t_childaddedEvent.child = object;\n\t\tthis.dispatchEvent( _childaddedEvent );\n\t\t_childaddedEvent.child = null;\n\n\t\treturn this;\n\n\t}\n\n\tgetObjectById( id ) {\n\n\t\treturn this.getObjectByProperty( 'id', id );\n\n\t}\n\n\tgetObjectByName( name ) {\n\n\t\treturn this.getObjectByProperty( 'name', name );\n\n\t}\n\n\tgetObjectByProperty( name, value ) {\n\n\t\tif ( this[ name ] === value ) return this;\n\n\t\tfor ( let i = 0, l = this.children.length; i < l; i ++ ) {\n\n\t\t\tconst child = this.children[ i ];\n\t\t\tconst object = child.getObjectByProperty( name, value );\n\n\t\t\tif ( object !== undefined ) {\n\n\t\t\t\treturn object;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn undefined;\n\n\t}\n\n\tgetObjectsByProperty( name, value, result = [] ) {\n\n\t\tif ( this[ name ] === value ) result.push( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tchildren[ i ].getObjectsByProperty( name, value, result );\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\tgetWorldPosition( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn target.setFromMatrixPosition( this.matrixWorld );\n\n\t}\n\n\tgetWorldQuaternion( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tthis.matrixWorld.decompose( _position$3, target, _scale$2 );\n\n\t\treturn target;\n\n\t}\n\n\tgetWorldScale( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tthis.matrixWorld.decompose( _position$3, _quaternion$2, target );\n\n\t\treturn target;\n\n\t}\n\n\tgetWorldDirection( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tconst e = this.matrixWorld.elements;\n\n\t\treturn target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize();\n\n\t}\n\n\traycast( /* raycaster, intersects */ ) {}\n\n\ttraverse( callback ) {\n\n\t\tcallback( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tchildren[ i ].traverse( callback );\n\n\t\t}\n\n\t}\n\n\ttraverseVisible( callback ) {\n\n\t\tif ( this.visible === false ) return;\n\n\t\tcallback( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tchildren[ i ].traverseVisible( callback );\n\n\t\t}\n\n\t}\n\n\ttraverseAncestors( callback ) {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( parent !== null ) {\n\n\t\t\tcallback( parent );\n\n\t\t\tparent.traverseAncestors( callback );\n\n\t\t}\n\n\t}\n\n\tupdateMatrix() {\n\n\t\tthis.matrix.compose( this.position, this.quaternion, this.scale );\n\n\t\tthis.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tif ( this.matrixWorldNeedsUpdate || force ) {\n\n\t\t\tif ( this.matrixWorldAutoUpdate === true ) {\n\n\t\t\t\tif ( this.parent === null ) {\n\n\t\t\t\t\tthis.matrixWorld.copy( this.matrix );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.matrixWorldNeedsUpdate = false;\n\n\t\t\tforce = true;\n\n\t\t}\n\n\t\t// make sure descendants are updated if required\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tconst child = children[ i ];\n\n\t\t\tchild.updateMatrixWorld( force );\n\n\t\t}\n\n\t}\n\n\tupdateWorldMatrix( updateParents, updateChildren ) {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( updateParents === true && parent !== null ) {\n\n\t\t\tparent.updateWorldMatrix( true, false );\n\n\t\t}\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tif ( this.matrixWorldAutoUpdate === true ) {\n\n\t\t\tif ( this.parent === null ) {\n\n\t\t\t\tthis.matrixWorld.copy( this.matrix );\n\n\t\t\t} else {\n\n\t\t\t\tthis.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// make sure descendants are updated\n\n\t\tif ( updateChildren === true ) {\n\n\t\t\tconst children = this.children;\n\n\t\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tconst child = children[ i ];\n\n\t\t\t\tchild.updateWorldMatrix( false, true );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\t// meta is a string when called from JSON.stringify\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tconst output = {};\n\n\t\t// meta is a hash used to collect geometries, materials.\n\t\t// not providing it implies that this is the root object\n\t\t// being serialized.\n\t\tif ( isRootObject ) {\n\n\t\t\t// initialize meta obj\n\t\t\tmeta = {\n\t\t\t\tgeometries: {},\n\t\t\t\tmaterials: {},\n\t\t\t\ttextures: {},\n\t\t\t\timages: {},\n\t\t\t\tshapes: {},\n\t\t\t\tskeletons: {},\n\t\t\t\tanimations: {},\n\t\t\t\tnodes: {}\n\t\t\t};\n\n\t\t\toutput.metadata = {\n\t\t\t\tversion: 4.6,\n\t\t\t\ttype: 'Object',\n\t\t\t\tgenerator: 'Object3D.toJSON'\n\t\t\t};\n\n\t\t}\n\n\t\t// standard Object3D serialization\n\n\t\tconst object = {};\n\n\t\tobject.uuid = this.uuid;\n\t\tobject.type = this.type;\n\n\t\tif ( this.name !== '' ) object.name = this.name;\n\t\tif ( this.castShadow === true ) object.castShadow = true;\n\t\tif ( this.receiveShadow === true ) object.receiveShadow = true;\n\t\tif ( this.visible === false ) object.visible = false;\n\t\tif ( this.frustumCulled === false ) object.frustumCulled = false;\n\t\tif ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder;\n\t\tif ( Object.keys( this.userData ).length > 0 ) object.userData = this.userData;\n\n\t\tobject.layers = this.layers.mask;\n\t\tobject.matrix = this.matrix.toArray();\n\t\tobject.up = this.up.toArray();\n\n\t\tif ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;\n\n\t\t// object specific properties\n\n\t\tif ( this.isInstancedMesh ) {\n\n\t\t\tobject.type = 'InstancedMesh';\n\t\t\tobject.count = this.count;\n\t\t\tobject.instanceMatrix = this.instanceMatrix.toJSON();\n\t\t\tif ( this.instanceColor !== null ) object.instanceColor = this.instanceColor.toJSON();\n\n\t\t}\n\n\t\tif ( this.isBatchedMesh ) {\n\n\t\t\tobject.type = 'BatchedMesh';\n\t\t\tobject.perObjectFrustumCulled = this.perObjectFrustumCulled;\n\t\t\tobject.sortObjects = this.sortObjects;\n\n\t\t\tobject.drawRanges = this._drawRanges;\n\t\t\tobject.reservedRanges = this._reservedRanges;\n\n\t\t\tobject.visibility = this._visibility;\n\t\t\tobject.active = this._active;\n\t\t\tobject.bounds = this._bounds.map( bound => ( {\n\t\t\t\tboxInitialized: bound.boxInitialized,\n\t\t\t\tboxMin: bound.box.min.toArray(),\n\t\t\t\tboxMax: bound.box.max.toArray(),\n\n\t\t\t\tsphereInitialized: bound.sphereInitialized,\n\t\t\t\tsphereRadius: bound.sphere.radius,\n\t\t\t\tsphereCenter: bound.sphere.center.toArray()\n\t\t\t} ) );\n\n\t\t\tobject.maxInstanceCount = this._maxInstanceCount;\n\t\t\tobject.maxVertexCount = this._maxVertexCount;\n\t\t\tobject.maxIndexCount = this._maxIndexCount;\n\n\t\t\tobject.geometryInitialized = this._geometryInitialized;\n\t\t\tobject.geometryCount = this._geometryCount;\n\n\t\t\tobject.matricesTexture = this._matricesTexture.toJSON( meta );\n\n\t\t\tif ( this._colorsTexture !== null ) object.colorsTexture = this._colorsTexture.toJSON( meta );\n\n\t\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\t\tobject.boundingSphere = {\n\t\t\t\t\tcenter: object.boundingSphere.center.toArray(),\n\t\t\t\t\tradius: object.boundingSphere.radius\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\tif ( this.boundingBox !== null ) {\n\n\t\t\t\tobject.boundingBox = {\n\t\t\t\t\tmin: object.boundingBox.min.toArray(),\n\t\t\t\t\tmax: object.boundingBox.max.toArray()\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tfunction serialize( library, element ) {\n\n\t\t\tif ( library[ element.uuid ] === undefined ) {\n\n\t\t\t\tlibrary[ element.uuid ] = element.toJSON( meta );\n\n\t\t\t}\n\n\t\t\treturn element.uuid;\n\n\t\t}\n\n\t\tif ( this.isScene ) {\n\n\t\t\tif ( this.background ) {\n\n\t\t\t\tif ( this.background.isColor ) {\n\n\t\t\t\t\tobject.background = this.background.toJSON();\n\n\t\t\t\t} else if ( this.background.isTexture ) {\n\n\t\t\t\t\tobject.background = this.background.toJSON( meta ).uuid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== true ) {\n\n\t\t\t\tobject.environment = this.environment.toJSON( meta ).uuid;\n\n\t\t\t}\n\n\t\t} else if ( this.isMesh || this.isLine || this.isPoints ) {\n\n\t\t\tobject.geometry = serialize( meta.geometries, this.geometry );\n\n\t\t\tconst parameters = this.geometry.parameters;\n\n\t\t\tif ( parameters !== undefined && parameters.shapes !== undefined ) {\n\n\t\t\t\tconst shapes = parameters.shapes;\n\n\t\t\t\tif ( Array.isArray( shapes ) ) {\n\n\t\t\t\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\t\t\t\tconst shape = shapes[ i ];\n\n\t\t\t\t\t\tserialize( meta.shapes, shape );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tserialize( meta.shapes, shapes );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.isSkinnedMesh ) {\n\n\t\t\tobject.bindMode = this.bindMode;\n\t\t\tobject.bindMatrix = this.bindMatrix.toArray();\n\n\t\t\tif ( this.skeleton !== undefined ) {\n\n\t\t\t\tserialize( meta.skeletons, this.skeleton );\n\n\t\t\t\tobject.skeleton = this.skeleton.uuid;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.material !== undefined ) {\n\n\t\t\tif ( Array.isArray( this.material ) ) {\n\n\t\t\t\tconst uuids = [];\n\n\t\t\t\tfor ( let i = 0, l = this.material.length; i < l; i ++ ) {\n\n\t\t\t\t\tuuids.push( serialize( meta.materials, this.material[ i ] ) );\n\n\t\t\t\t}\n\n\t\t\t\tobject.material = uuids;\n\n\t\t\t} else {\n\n\t\t\t\tobject.material = serialize( meta.materials, this.material );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.children.length > 0 ) {\n\n\t\t\tobject.children = [];\n\n\t\t\tfor ( let i = 0; i < this.children.length; i ++ ) {\n\n\t\t\t\tobject.children.push( this.children[ i ].toJSON( meta ).object );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.animations.length > 0 ) {\n\n\t\t\tobject.animations = [];\n\n\t\t\tfor ( let i = 0; i < this.animations.length; i ++ ) {\n\n\t\t\t\tconst animation = this.animations[ i ];\n\n\t\t\t\tobject.animations.push( serialize( meta.animations, animation ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( isRootObject ) {\n\n\t\t\tconst geometries = extractFromCache( meta.geometries );\n\t\t\tconst materials = extractFromCache( meta.materials );\n\t\t\tconst textures = extractFromCache( meta.textures );\n\t\t\tconst images = extractFromCache( meta.images );\n\t\t\tconst shapes = extractFromCache( meta.shapes );\n\t\t\tconst skeletons = extractFromCache( meta.skeletons );\n\t\t\tconst animations = extractFromCache( meta.animations );\n\t\t\tconst nodes = extractFromCache( meta.nodes );\n\n\t\t\tif ( geometries.length > 0 ) output.geometries = geometries;\n\t\t\tif ( materials.length > 0 ) output.materials = materials;\n\t\t\tif ( textures.length > 0 ) output.textures = textures;\n\t\t\tif ( images.length > 0 ) output.images = images;\n\t\t\tif ( shapes.length > 0 ) output.shapes = shapes;\n\t\t\tif ( skeletons.length > 0 ) output.skeletons = skeletons;\n\t\t\tif ( animations.length > 0 ) output.animations = animations;\n\t\t\tif ( nodes.length > 0 ) output.nodes = nodes;\n\n\t\t}\n\n\t\toutput.object = object;\n\n\t\treturn output;\n\n\t\t// extract data from the cache hash\n\t\t// remove metadata on each item\n\t\t// and return as array\n\t\tfunction extractFromCache( cache ) {\n\n\t\t\tconst values = [];\n\t\t\tfor ( const key in cache ) {\n\n\t\t\t\tconst data = cache[ key ];\n\t\t\t\tdelete data.metadata;\n\t\t\t\tvalues.push( data );\n\n\t\t\t}\n\n\t\t\treturn values;\n\n\t\t}\n\n\t}\n\n\tclone( recursive ) {\n\n\t\treturn new this.constructor().copy( this, recursive );\n\n\t}\n\n\tcopy( source, recursive = true ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.up.copy( source.up );\n\n\t\tthis.position.copy( source.position );\n\t\tthis.rotation.order = source.rotation.order;\n\t\tthis.quaternion.copy( source.quaternion );\n\t\tthis.scale.copy( source.scale );\n\n\t\tthis.matrix.copy( source.matrix );\n\t\tthis.matrixWorld.copy( source.matrixWorld );\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\n\t\tthis.matrixWorldAutoUpdate = source.matrixWorldAutoUpdate;\n\t\tthis.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;\n\n\t\tthis.layers.mask = source.layers.mask;\n\t\tthis.visible = source.visible;\n\n\t\tthis.castShadow = source.castShadow;\n\t\tthis.receiveShadow = source.receiveShadow;\n\n\t\tthis.frustumCulled = source.frustumCulled;\n\t\tthis.renderOrder = source.renderOrder;\n\n\t\tthis.animations = source.animations.slice();\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\tif ( recursive === true ) {\n\n\t\t\tfor ( let i = 0; i < source.children.length; i ++ ) {\n\n\t\t\t\tconst child = source.children[ i ];\n\t\t\t\tthis.add( child.clone() );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nObject3D.DEFAULT_UP = /*@__PURE__*/ new Vector3( 0, 1, 0 );\nObject3D.DEFAULT_MATRIX_AUTO_UPDATE = true;\nObject3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = true;\n\nconst _v0$2 = /*@__PURE__*/ new Vector3();\nconst _v1$3 = /*@__PURE__*/ new Vector3();\nconst _v2$2 = /*@__PURE__*/ new Vector3();\nconst _v3$2 = /*@__PURE__*/ new Vector3();\n\nconst _vab = /*@__PURE__*/ new Vector3();\nconst _vac = /*@__PURE__*/ new Vector3();\nconst _vbc = /*@__PURE__*/ new Vector3();\nconst _vap = /*@__PURE__*/ new Vector3();\nconst _vbp = /*@__PURE__*/ new Vector3();\nconst _vcp = /*@__PURE__*/ new Vector3();\n\nconst _v40 = /*@__PURE__*/ new Vector4();\nconst _v41 = /*@__PURE__*/ new Vector4();\nconst _v42 = /*@__PURE__*/ new Vector4();\n\nclass Triangle {\n\n\tconstructor( a = new Vector3(), b = new Vector3(), c = new Vector3() ) {\n\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t\tthis.c = c;\n\n\t}\n\n\tstatic getNormal( a, b, c, target ) {\n\n\t\ttarget.subVectors( c, b );\n\t\t_v0$2.subVectors( a, b );\n\t\ttarget.cross( _v0$2 );\n\n\t\tconst targetLengthSq = target.lengthSq();\n\t\tif ( targetLengthSq > 0 ) {\n\n\t\t\treturn target.multiplyScalar( 1 / Math.sqrt( targetLengthSq ) );\n\n\t\t}\n\n\t\treturn target.set( 0, 0, 0 );\n\n\t}\n\n\t// static/instance method to calculate barycentric coordinates\n\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\tstatic getBarycoord( point, a, b, c, target ) {\n\n\t\t_v0$2.subVectors( c, a );\n\t\t_v1$3.subVectors( b, a );\n\t\t_v2$2.subVectors( point, a );\n\n\t\tconst dot00 = _v0$2.dot( _v0$2 );\n\t\tconst dot01 = _v0$2.dot( _v1$3 );\n\t\tconst dot02 = _v0$2.dot( _v2$2 );\n\t\tconst dot11 = _v1$3.dot( _v1$3 );\n\t\tconst dot12 = _v1$3.dot( _v2$2 );\n\n\t\tconst denom = ( dot00 * dot11 - dot01 * dot01 );\n\n\t\t// collinear or singular triangle\n\t\tif ( denom === 0 ) {\n\n\t\t\ttarget.set( 0, 0, 0 );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom;\n\t\tconst v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom;\n\n\t\t// barycentric coordinates must always sum to 1\n\t\treturn target.set( 1 - u - v, v, u );\n\n\t}\n\n\tstatic containsPoint( point, a, b, c ) {\n\n\t\t// if the triangle is degenerate then we can't contain a point\n\t\tif ( this.getBarycoord( point, a, b, c, _v3$2 ) === null ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn ( _v3$2.x >= 0 ) && ( _v3$2.y >= 0 ) && ( ( _v3$2.x + _v3$2.y ) <= 1 );\n\n\t}\n\n\tstatic getInterpolation( point, p1, p2, p3, v1, v2, v3, target ) {\n\n\t\tif ( this.getBarycoord( point, p1, p2, p3, _v3$2 ) === null ) {\n\n\t\t\ttarget.x = 0;\n\t\t\ttarget.y = 0;\n\t\t\tif ( 'z' in target ) target.z = 0;\n\t\t\tif ( 'w' in target ) target.w = 0;\n\t\t\treturn null;\n\n\t\t}\n\n\t\ttarget.setScalar( 0 );\n\t\ttarget.addScaledVector( v1, _v3$2.x );\n\t\ttarget.addScaledVector( v2, _v3$2.y );\n\t\ttarget.addScaledVector( v3, _v3$2.z );\n\n\t\treturn target;\n\n\t}\n\n\tstatic getInterpolatedAttribute( attr, i1, i2, i3, barycoord, target ) {\n\n\t\t_v40.setScalar( 0 );\n\t\t_v41.setScalar( 0 );\n\t\t_v42.setScalar( 0 );\n\n\t\t_v40.fromBufferAttribute( attr, i1 );\n\t\t_v41.fromBufferAttribute( attr, i2 );\n\t\t_v42.fromBufferAttribute( attr, i3 );\n\n\t\ttarget.setScalar( 0 );\n\t\ttarget.addScaledVector( _v40, barycoord.x );\n\t\ttarget.addScaledVector( _v41, barycoord.y );\n\t\ttarget.addScaledVector( _v42, barycoord.z );\n\n\t\treturn target;\n\n\t}\n\n\tstatic isFrontFacing( a, b, c, direction ) {\n\n\t\t_v0$2.subVectors( c, b );\n\t\t_v1$3.subVectors( a, b );\n\n\t\t// strictly front facing\n\t\treturn ( _v0$2.cross( _v1$3 ).dot( direction ) < 0 ) ? true : false;\n\n\t}\n\n\tset( a, b, c ) {\n\n\t\tthis.a.copy( a );\n\t\tthis.b.copy( b );\n\t\tthis.c.copy( c );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPointsAndIndices( points, i0, i1, i2 ) {\n\n\t\tthis.a.copy( points[ i0 ] );\n\t\tthis.b.copy( points[ i1 ] );\n\t\tthis.c.copy( points[ i2 ] );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\n\t\tthis.a.fromBufferAttribute( attribute, i0 );\n\t\tthis.b.fromBufferAttribute( attribute, i1 );\n\t\tthis.c.fromBufferAttribute( attribute, i2 );\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( triangle ) {\n\n\t\tthis.a.copy( triangle.a );\n\t\tthis.b.copy( triangle.b );\n\t\tthis.c.copy( triangle.c );\n\n\t\treturn this;\n\n\t}\n\n\tgetArea() {\n\n\t\t_v0$2.subVectors( this.c, this.b );\n\t\t_v1$3.subVectors( this.a, this.b );\n\n\t\treturn _v0$2.cross( _v1$3 ).length() * 0.5;\n\n\t}\n\n\tgetMidpoint( target ) {\n\n\t\treturn target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 );\n\n\t}\n\n\tgetNormal( target ) {\n\n\t\treturn Triangle.getNormal( this.a, this.b, this.c, target );\n\n\t}\n\n\tgetPlane( target ) {\n\n\t\treturn target.setFromCoplanarPoints( this.a, this.b, this.c );\n\n\t}\n\n\tgetBarycoord( point, target ) {\n\n\t\treturn Triangle.getBarycoord( point, this.a, this.b, this.c, target );\n\n\t}\n\n\tgetInterpolation( point, v1, v2, v3, target ) {\n\n\t\treturn Triangle.getInterpolation( point, this.a, this.b, this.c, v1, v2, v3, target );\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\treturn Triangle.containsPoint( point, this.a, this.b, this.c );\n\n\t}\n\n\tisFrontFacing( direction ) {\n\n\t\treturn Triangle.isFrontFacing( this.a, this.b, this.c, direction );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsTriangle( this );\n\n\t}\n\n\tclosestPointToPoint( p, target ) {\n\n\t\tconst a = this.a, b = this.b, c = this.c;\n\t\tlet v, w;\n\n\t\t// algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors( b, a );\n\t\t_vac.subVectors( c, a );\n\t\t_vap.subVectors( p, a );\n\t\tconst d1 = _vab.dot( _vap );\n\t\tconst d2 = _vac.dot( _vap );\n\t\tif ( d1 <= 0 && d2 <= 0 ) {\n\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy( a );\n\n\t\t}\n\n\t\t_vbp.subVectors( p, b );\n\t\tconst d3 = _vab.dot( _vbp );\n\t\tconst d4 = _vac.dot( _vbp );\n\t\tif ( d3 >= 0 && d4 <= d3 ) {\n\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy( b );\n\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\t\tif ( vc <= 0 && d1 >= 0 && d3 <= 0 ) {\n\n\t\t\tv = d1 / ( d1 - d3 );\n\t\t\t// edge region of AB; barycentric coords (1-v, v, 0)\n\t\t\treturn target.copy( a ).addScaledVector( _vab, v );\n\n\t\t}\n\n\t\t_vcp.subVectors( p, c );\n\t\tconst d5 = _vab.dot( _vcp );\n\t\tconst d6 = _vac.dot( _vcp );\n\t\tif ( d6 >= 0 && d5 <= d6 ) {\n\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy( c );\n\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\t\tif ( vb <= 0 && d2 >= 0 && d6 <= 0 ) {\n\n\t\t\tw = d2 / ( d2 - d6 );\n\t\t\t// edge region of AC; barycentric coords (1-w, 0, w)\n\t\t\treturn target.copy( a ).addScaledVector( _vac, w );\n\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\t\tif ( va <= 0 && ( d4 - d3 ) >= 0 && ( d5 - d6 ) >= 0 ) {\n\n\t\t\t_vbc.subVectors( c, b );\n\t\t\tw = ( d4 - d3 ) / ( ( d4 - d3 ) + ( d5 - d6 ) );\n\t\t\t// edge region of BC; barycentric coords (0, 1-w, w)\n\t\t\treturn target.copy( b ).addScaledVector( _vbc, w ); // edge region of BC\n\n\t\t}\n\n\t\t// face region\n\t\tconst denom = 1 / ( va + vb + vc );\n\t\t// u = va * denom\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\n\t\treturn target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w );\n\n\t}\n\n\tequals( triangle ) {\n\n\t\treturn triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c );\n\n\t}\n\n}\n\nconst _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,\n\t'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2,\n\t'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50,\n\t'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B,\n\t'darkgoldenrod': 0xB8860B, 'darkgray': 0xA9A9A9, 'darkgreen': 0x006400, 'darkgrey': 0xA9A9A9, 'darkkhaki': 0xBDB76B, 'darkmagenta': 0x8B008B,\n\t'darkolivegreen': 0x556B2F, 'darkorange': 0xFF8C00, 'darkorchid': 0x9932CC, 'darkred': 0x8B0000, 'darksalmon': 0xE9967A, 'darkseagreen': 0x8FBC8F,\n\t'darkslateblue': 0x483D8B, 'darkslategray': 0x2F4F4F, 'darkslategrey': 0x2F4F4F, 'darkturquoise': 0x00CED1, 'darkviolet': 0x9400D3,\n\t'deeppink': 0xFF1493, 'deepskyblue': 0x00BFFF, 'dimgray': 0x696969, 'dimgrey': 0x696969, 'dodgerblue': 0x1E90FF, 'firebrick': 0xB22222,\n\t'floralwhite': 0xFFFAF0, 'forestgreen': 0x228B22, 'fuchsia': 0xFF00FF, 'gainsboro': 0xDCDCDC, 'ghostwhite': 0xF8F8FF, 'gold': 0xFFD700,\n\t'goldenrod': 0xDAA520, 'gray': 0x808080, 'green': 0x008000, 'greenyellow': 0xADFF2F, 'grey': 0x808080, 'honeydew': 0xF0FFF0, 'hotpink': 0xFF69B4,\n\t'indianred': 0xCD5C5C, 'indigo': 0x4B0082, 'ivory': 0xFFFFF0, 'khaki': 0xF0E68C, 'lavender': 0xE6E6FA, 'lavenderblush': 0xFFF0F5, 'lawngreen': 0x7CFC00,\n\t'lemonchiffon': 0xFFFACD, 'lightblue': 0xADD8E6, 'lightcoral': 0xF08080, 'lightcyan': 0xE0FFFF, 'lightgoldenrodyellow': 0xFAFAD2, 'lightgray': 0xD3D3D3,\n\t'lightgreen': 0x90EE90, 'lightgrey': 0xD3D3D3, 'lightpink': 0xFFB6C1, 'lightsalmon': 0xFFA07A, 'lightseagreen': 0x20B2AA, 'lightskyblue': 0x87CEFA,\n\t'lightslategray': 0x778899, 'lightslategrey': 0x778899, 'lightsteelblue': 0xB0C4DE, 'lightyellow': 0xFFFFE0, 'lime': 0x00FF00, 'limegreen': 0x32CD32,\n\t'linen': 0xFAF0E6, 'magenta': 0xFF00FF, 'maroon': 0x800000, 'mediumaquamarine': 0x66CDAA, 'mediumblue': 0x0000CD, 'mediumorchid': 0xBA55D3,\n\t'mediumpurple': 0x9370DB, 'mediumseagreen': 0x3CB371, 'mediumslateblue': 0x7B68EE, 'mediumspringgreen': 0x00FA9A, 'mediumturquoise': 0x48D1CC,\n\t'mediumvioletred': 0xC71585, 'midnightblue': 0x191970, 'mintcream': 0xF5FFFA, 'mistyrose': 0xFFE4E1, 'moccasin': 0xFFE4B5, 'navajowhite': 0xFFDEAD,\n\t'navy': 0x000080, 'oldlace': 0xFDF5E6, 'olive': 0x808000, 'olivedrab': 0x6B8E23, 'orange': 0xFFA500, 'orangered': 0xFF4500, 'orchid': 0xDA70D6,\n\t'palegoldenrod': 0xEEE8AA, 'palegreen': 0x98FB98, 'paleturquoise': 0xAFEEEE, 'palevioletred': 0xDB7093, 'papayawhip': 0xFFEFD5, 'peachpuff': 0xFFDAB9,\n\t'peru': 0xCD853F, 'pink': 0xFFC0CB, 'plum': 0xDDA0DD, 'powderblue': 0xB0E0E6, 'purple': 0x800080, 'rebeccapurple': 0x663399, 'red': 0xFF0000, 'rosybrown': 0xBC8F8F,\n\t'royalblue': 0x4169E1, 'saddlebrown': 0x8B4513, 'salmon': 0xFA8072, 'sandybrown': 0xF4A460, 'seagreen': 0x2E8B57, 'seashell': 0xFFF5EE,\n\t'sienna': 0xA0522D, 'silver': 0xC0C0C0, 'skyblue': 0x87CEEB, 'slateblue': 0x6A5ACD, 'slategray': 0x708090, 'slategrey': 0x708090, 'snow': 0xFFFAFA,\n\t'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0,\n\t'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 };\n\nconst _hslA = { h: 0, s: 0, l: 0 };\nconst _hslB = { h: 0, s: 0, l: 0 };\n\nfunction hue2rgb( p, q, t ) {\n\n\tif ( t < 0 ) t += 1;\n\tif ( t > 1 ) t -= 1;\n\tif ( t < 1 / 6 ) return p + ( q - p ) * 6 * t;\n\tif ( t < 1 / 2 ) return q;\n\tif ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t );\n\treturn p;\n\n}\n\nclass Color {\n\n\tconstructor( r, g, b ) {\n\n\t\tthis.isColor = true;\n\n\t\tthis.r = 1;\n\t\tthis.g = 1;\n\t\tthis.b = 1;\n\n\t\treturn this.set( r, g, b );\n\n\t}\n\n\tset( r, g, b ) {\n\n\t\tif ( g === undefined && b === undefined ) {\n\n\t\t\t// r is THREE.Color, hex or string\n\n\t\t\tconst value = r;\n\n\t\t\tif ( value && value.isColor ) {\n\n\t\t\t\tthis.copy( value );\n\n\t\t\t} else if ( typeof value === 'number' ) {\n\n\t\t\t\tthis.setHex( value );\n\n\t\t\t} else if ( typeof value === 'string' ) {\n\n\t\t\t\tthis.setStyle( value );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthis.setRGB( r, g, b );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.r = scalar;\n\t\tthis.g = scalar;\n\t\tthis.b = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetHex( hex, colorSpace = SRGBColorSpace ) {\n\n\t\thex = Math.floor( hex );\n\n\t\tthis.r = ( hex >> 16 & 255 ) / 255;\n\t\tthis.g = ( hex >> 8 & 255 ) / 255;\n\t\tthis.b = ( hex & 255 ) / 255;\n\n\t\tColorManagement.toWorkingColorSpace( this, colorSpace );\n\n\t\treturn this;\n\n\t}\n\n\tsetRGB( r, g, b, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\n\t\tColorManagement.toWorkingColorSpace( this, colorSpace );\n\n\t\treturn this;\n\n\t}\n\n\tsetHSL( h, s, l, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\th = euclideanModulo( h, 1 );\n\t\ts = clamp( s, 0, 1 );\n\t\tl = clamp( l, 0, 1 );\n\n\t\tif ( s === 0 ) {\n\n\t\t\tthis.r = this.g = this.b = l;\n\n\t\t} else {\n\n\t\t\tconst p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s );\n\t\t\tconst q = ( 2 * l ) - p;\n\n\t\t\tthis.r = hue2rgb( q, p, h + 1 / 3 );\n\t\t\tthis.g = hue2rgb( q, p, h );\n\t\t\tthis.b = hue2rgb( q, p, h - 1 / 3 );\n\n\t\t}\n\n\t\tColorManagement.toWorkingColorSpace( this, colorSpace );\n\n\t\treturn this;\n\n\t}\n\n\tsetStyle( style, colorSpace = SRGBColorSpace ) {\n\n\t\tfunction handleAlpha( string ) {\n\n\t\t\tif ( string === undefined ) return;\n\n\t\t\tif ( parseFloat( string ) < 1 ) {\n\n\t\t\t\tconsole.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' );\n\n\t\t\t}\n\n\t\t}\n\n\n\t\tlet m;\n\n\t\tif ( m = /^(\\w+)\\(([^\\)]*)\\)/.exec( style ) ) {\n\n\t\t\t// rgb / hsl\n\n\t\t\tlet color;\n\t\t\tconst name = m[ 1 ];\n\t\t\tconst components = m[ 2 ];\n\n\t\t\tswitch ( name ) {\n\n\t\t\t\tcase 'rgb':\n\t\t\t\tcase 'rgba':\n\n\t\t\t\t\tif ( color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setRGB(\n\t\t\t\t\t\t\tMath.min( 255, parseInt( color[ 1 ], 10 ) ) / 255,\n\t\t\t\t\t\t\tMath.min( 255, parseInt( color[ 2 ], 10 ) ) / 255,\n\t\t\t\t\t\t\tMath.min( 255, parseInt( color[ 3 ], 10 ) ) / 255,\n\t\t\t\t\t\t\tcolorSpace\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setRGB(\n\t\t\t\t\t\t\tMath.min( 100, parseInt( color[ 1 ], 10 ) ) / 100,\n\t\t\t\t\t\t\tMath.min( 100, parseInt( color[ 2 ], 10 ) ) / 100,\n\t\t\t\t\t\t\tMath.min( 100, parseInt( color[ 3 ], 10 ) ) / 100,\n\t\t\t\t\t\t\tcolorSpace\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hsl':\n\t\t\t\tcase 'hsla':\n\n\t\t\t\t\tif ( color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setHSL(\n\t\t\t\t\t\t\tparseFloat( color[ 1 ] ) / 360,\n\t\t\t\t\t\t\tparseFloat( color[ 2 ] ) / 100,\n\t\t\t\t\t\t\tparseFloat( color[ 3 ] ) / 100,\n\t\t\t\t\t\t\tcolorSpace\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.warn( 'THREE.Color: Unknown color model ' + style );\n\n\t\t\t}\n\n\t\t} else if ( m = /^\\#([A-Fa-f\\d]+)$/.exec( style ) ) {\n\n\t\t\t// hex color\n\n\t\t\tconst hex = m[ 1 ];\n\t\t\tconst size = hex.length;\n\n\t\t\tif ( size === 3 ) {\n\n\t\t\t\t// #ff0\n\t\t\t\treturn this.setRGB(\n\t\t\t\t\tparseInt( hex.charAt( 0 ), 16 ) / 15,\n\t\t\t\t\tparseInt( hex.charAt( 1 ), 16 ) / 15,\n\t\t\t\t\tparseInt( hex.charAt( 2 ), 16 ) / 15,\n\t\t\t\t\tcolorSpace\n\t\t\t\t);\n\n\t\t\t} else if ( size === 6 ) {\n\n\t\t\t\t// #ff0000\n\t\t\t\treturn this.setHex( parseInt( hex, 16 ), colorSpace );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.Color: Invalid hex color ' + style );\n\n\t\t\t}\n\n\t\t} else if ( style && style.length > 0 ) {\n\n\t\t\treturn this.setColorName( style, colorSpace );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetColorName( style, colorSpace = SRGBColorSpace ) {\n\n\t\t// color keywords\n\t\tconst hex = _colorKeywords[ style.toLowerCase() ];\n\n\t\tif ( hex !== undefined ) {\n\n\t\t\t// red\n\t\t\tthis.setHex( hex, colorSpace );\n\n\t\t} else {\n\n\t\t\t// unknown color\n\t\t\tconsole.warn( 'THREE.Color: Unknown color ' + style );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.r, this.g, this.b );\n\n\t}\n\n\tcopy( color ) {\n\n\t\tthis.r = color.r;\n\t\tthis.g = color.g;\n\t\tthis.b = color.b;\n\n\t\treturn this;\n\n\t}\n\n\tcopySRGBToLinear( color ) {\n\n\t\tthis.r = SRGBToLinear( color.r );\n\t\tthis.g = SRGBToLinear( color.g );\n\t\tthis.b = SRGBToLinear( color.b );\n\n\t\treturn this;\n\n\t}\n\n\tcopyLinearToSRGB( color ) {\n\n\t\tthis.r = LinearToSRGB( color.r );\n\t\tthis.g = LinearToSRGB( color.g );\n\t\tthis.b = LinearToSRGB( color.b );\n\n\t\treturn this;\n\n\t}\n\n\tconvertSRGBToLinear() {\n\n\t\tthis.copySRGBToLinear( this );\n\n\t\treturn this;\n\n\t}\n\n\tconvertLinearToSRGB() {\n\n\t\tthis.copyLinearToSRGB( this );\n\n\t\treturn this;\n\n\t}\n\n\tgetHex( colorSpace = SRGBColorSpace ) {\n\n\t\tColorManagement.fromWorkingColorSpace( _color.copy( this ), colorSpace );\n\n\t\treturn Math.round( clamp( _color.r * 255, 0, 255 ) ) * 65536 + Math.round( clamp( _color.g * 255, 0, 255 ) ) * 256 + Math.round( clamp( _color.b * 255, 0, 255 ) );\n\n\t}\n\n\tgetHexString( colorSpace = SRGBColorSpace ) {\n\n\t\treturn ( '000000' + this.getHex( colorSpace ).toString( 16 ) ).slice( - 6 );\n\n\t}\n\n\tgetHSL( target, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\n\t\tColorManagement.fromWorkingColorSpace( _color.copy( this ), colorSpace );\n\n\t\tconst r = _color.r, g = _color.g, b = _color.b;\n\n\t\tconst max = Math.max( r, g, b );\n\t\tconst min = Math.min( r, g, b );\n\n\t\tlet hue, saturation;\n\t\tconst lightness = ( min + max ) / 2.0;\n\n\t\tif ( min === max ) {\n\n\t\t\thue = 0;\n\t\t\tsaturation = 0;\n\n\t\t} else {\n\n\t\t\tconst delta = max - min;\n\n\t\t\tsaturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min );\n\n\t\t\tswitch ( max ) {\n\n\t\t\t\tcase r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break;\n\t\t\t\tcase g: hue = ( b - r ) / delta + 2; break;\n\t\t\t\tcase b: hue = ( r - g ) / delta + 4; break;\n\n\t\t\t}\n\n\t\t\thue /= 6;\n\n\t\t}\n\n\t\ttarget.h = hue;\n\t\ttarget.s = saturation;\n\t\ttarget.l = lightness;\n\n\t\treturn target;\n\n\t}\n\n\tgetRGB( target, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\tColorManagement.fromWorkingColorSpace( _color.copy( this ), colorSpace );\n\n\t\ttarget.r = _color.r;\n\t\ttarget.g = _color.g;\n\t\ttarget.b = _color.b;\n\n\t\treturn target;\n\n\t}\n\n\tgetStyle( colorSpace = SRGBColorSpace ) {\n\n\t\tColorManagement.fromWorkingColorSpace( _color.copy( this ), colorSpace );\n\n\t\tconst r = _color.r, g = _color.g, b = _color.b;\n\n\t\tif ( colorSpace !== SRGBColorSpace ) {\n\n\t\t\t// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).\n\t\t\treturn `color(${ colorSpace } ${ r.toFixed( 3 ) } ${ g.toFixed( 3 ) } ${ b.toFixed( 3 ) })`;\n\n\t\t}\n\n\t\treturn `rgb(${ Math.round( r * 255 ) },${ Math.round( g * 255 ) },${ Math.round( b * 255 ) })`;\n\n\t}\n\n\toffsetHSL( h, s, l ) {\n\n\t\tthis.getHSL( _hslA );\n\n\t\treturn this.setHSL( _hslA.h + h, _hslA.s + s, _hslA.l + l );\n\n\t}\n\n\tadd( color ) {\n\n\t\tthis.r += color.r;\n\t\tthis.g += color.g;\n\t\tthis.b += color.b;\n\n\t\treturn this;\n\n\t}\n\n\taddColors( color1, color2 ) {\n\n\t\tthis.r = color1.r + color2.r;\n\t\tthis.g = color1.g + color2.g;\n\t\tthis.b = color1.b + color2.b;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.r += s;\n\t\tthis.g += s;\n\t\tthis.b += s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( color ) {\n\n\t\tthis.r = Math.max( 0, this.r - color.r );\n\t\tthis.g = Math.max( 0, this.g - color.g );\n\t\tthis.b = Math.max( 0, this.b - color.b );\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( color ) {\n\n\t\tthis.r *= color.r;\n\t\tthis.g *= color.g;\n\t\tthis.b *= color.b;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( s ) {\n\n\t\tthis.r *= s;\n\t\tthis.g *= s;\n\t\tthis.b *= s;\n\n\t\treturn this;\n\n\t}\n\n\tlerp( color, alpha ) {\n\n\t\tthis.r += ( color.r - this.r ) * alpha;\n\t\tthis.g += ( color.g - this.g ) * alpha;\n\t\tthis.b += ( color.b - this.b ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpColors( color1, color2, alpha ) {\n\n\t\tthis.r = color1.r + ( color2.r - color1.r ) * alpha;\n\t\tthis.g = color1.g + ( color2.g - color1.g ) * alpha;\n\t\tthis.b = color1.b + ( color2.b - color1.b ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpHSL( color, alpha ) {\n\n\t\tthis.getHSL( _hslA );\n\t\tcolor.getHSL( _hslB );\n\n\t\tconst h = lerp( _hslA.h, _hslB.h, alpha );\n\t\tconst s = lerp( _hslA.s, _hslB.s, alpha );\n\t\tconst l = lerp( _hslA.l, _hslB.l, alpha );\n\n\t\tthis.setHSL( h, s, l );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromVector3( v ) {\n\n\t\tthis.r = v.x;\n\t\tthis.g = v.y;\n\t\tthis.b = v.z;\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix3( m ) {\n\n\t\tconst r = this.r, g = this.g, b = this.b;\n\t\tconst e = m.elements;\n\n\t\tthis.r = e[ 0 ] * r + e[ 3 ] * g + e[ 6 ] * b;\n\t\tthis.g = e[ 1 ] * r + e[ 4 ] * g + e[ 7 ] * b;\n\t\tthis.b = e[ 2 ] * r + e[ 5 ] * g + e[ 8 ] * b;\n\n\t\treturn this;\n\n\t}\n\n\tequals( c ) {\n\n\t\treturn ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.r = array[ offset ];\n\t\tthis.g = array[ offset + 1 ];\n\t\tthis.b = array[ offset + 2 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.r;\n\t\tarray[ offset + 1 ] = this.g;\n\t\tarray[ offset + 2 ] = this.b;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.r = attribute.getX( index );\n\t\tthis.g = attribute.getY( index );\n\t\tthis.b = attribute.getZ( index );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\treturn this.getHex();\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.r;\n\t\tyield this.g;\n\t\tyield this.b;\n\n\t}\n\n}\n\nconst _color = /*@__PURE__*/ new Color();\n\nColor.NAMES = _colorKeywords;\n\nlet _materialId = 0;\n\nclass Material extends EventDispatcher {\n\n\tstatic get type() {\n\n\t\treturn 'Material';\n\n\t}\n\n\tget type() {\n\n\t\treturn this.constructor.type;\n\n\t}\n\n\tset type( _value ) { /* */ }\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isMaterial = true;\n\n\t\tObject.defineProperty( this, 'id', { value: _materialId ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.name = '';\n\n\t\tthis.blending = NormalBlending;\n\t\tthis.side = FrontSide;\n\t\tthis.vertexColors = false;\n\n\t\tthis.opacity = 1;\n\t\tthis.transparent = false;\n\t\tthis.alphaHash = false;\n\n\t\tthis.blendSrc = SrcAlphaFactor;\n\t\tthis.blendDst = OneMinusSrcAlphaFactor;\n\t\tthis.blendEquation = AddEquation;\n\t\tthis.blendSrcAlpha = null;\n\t\tthis.blendDstAlpha = null;\n\t\tthis.blendEquationAlpha = null;\n\t\tthis.blendColor = new Color( 0, 0, 0 );\n\t\tthis.blendAlpha = 0;\n\n\t\tthis.depthFunc = LessEqualDepth;\n\t\tthis.depthTest = true;\n\t\tthis.depthWrite = true;\n\n\t\tthis.stencilWriteMask = 0xff;\n\t\tthis.stencilFunc = AlwaysStencilFunc;\n\t\tthis.stencilRef = 0;\n\t\tthis.stencilFuncMask = 0xff;\n\t\tthis.stencilFail = KeepStencilOp;\n\t\tthis.stencilZFail = KeepStencilOp;\n\t\tthis.stencilZPass = KeepStencilOp;\n\t\tthis.stencilWrite = false;\n\n\t\tthis.clippingPlanes = null;\n\t\tthis.clipIntersection = false;\n\t\tthis.clipShadows = false;\n\n\t\tthis.shadowSide = null;\n\n\t\tthis.colorWrite = true;\n\n\t\tthis.precision = null; // override the renderer's default precision for this material\n\n\t\tthis.polygonOffset = false;\n\t\tthis.polygonOffsetFactor = 0;\n\t\tthis.polygonOffsetUnits = 0;\n\n\t\tthis.dithering = false;\n\n\t\tthis.alphaToCoverage = false;\n\t\tthis.premultipliedAlpha = false;\n\t\tthis.forceSinglePass = false;\n\n\t\tthis.visible = true;\n\n\t\tthis.toneMapped = true;\n\n\t\tthis.userData = {};\n\n\t\tthis.version = 0;\n\n\t\tthis._alphaTest = 0;\n\n\t}\n\n\tget alphaTest() {\n\n\t\treturn this._alphaTest;\n\n\t}\n\n\tset alphaTest( value ) {\n\n\t\tif ( this._alphaTest > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._alphaTest = value;\n\n\t}\n\n\t// onBeforeRender and onBeforeCompile only supported in WebGLRenderer\n\n\tonBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {}\n\n\tonBeforeCompile( /* shaderobject, renderer */ ) {}\n\n\tcustomProgramCacheKey() {\n\n\t\treturn this.onBeforeCompile.toString();\n\n\t}\n\n\tsetValues( values ) {\n\n\t\tif ( values === undefined ) return;\n\n\t\tfor ( const key in values ) {\n\n\t\t\tconst newValue = values[ key ];\n\n\t\t\tif ( newValue === undefined ) {\n\n\t\t\t\tconsole.warn( `THREE.Material: parameter '${ key }' has value of undefined.` );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst currentValue = this[ key ];\n\n\t\t\tif ( currentValue === undefined ) {\n\n\t\t\t\tconsole.warn( `THREE.Material: '${ key }' is not a property of THREE.${ this.type }.` );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif ( currentValue && currentValue.isColor ) {\n\n\t\t\t\tcurrentValue.set( newValue );\n\n\t\t\t} else if ( ( currentValue && currentValue.isVector3 ) && ( newValue && newValue.isVector3 ) ) {\n\n\t\t\t\tcurrentValue.copy( newValue );\n\n\t\t\t} else {\n\n\t\t\t\tthis[ key ] = newValue;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( isRootObject ) {\n\n\t\t\tmeta = {\n\t\t\t\ttextures: {},\n\t\t\t\timages: {}\n\t\t\t};\n\n\t\t}\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.6,\n\t\t\t\ttype: 'Material',\n\t\t\t\tgenerator: 'Material.toJSON'\n\t\t\t}\n\t\t};\n\n\t\t// standard Material serialization\n\t\tdata.uuid = this.uuid;\n\t\tdata.type = this.type;\n\n\t\tif ( this.name !== '' ) data.name = this.name;\n\n\t\tif ( this.color && this.color.isColor ) data.color = this.color.getHex();\n\n\t\tif ( this.roughness !== undefined ) data.roughness = this.roughness;\n\t\tif ( this.metalness !== undefined ) data.metalness = this.metalness;\n\n\t\tif ( this.sheen !== undefined ) data.sheen = this.sheen;\n\t\tif ( this.sheenColor && this.sheenColor.isColor ) data.sheenColor = this.sheenColor.getHex();\n\t\tif ( this.sheenRoughness !== undefined ) data.sheenRoughness = this.sheenRoughness;\n\t\tif ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex();\n\t\tif ( this.emissiveIntensity !== undefined && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;\n\n\t\tif ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex();\n\t\tif ( this.specularIntensity !== undefined ) data.specularIntensity = this.specularIntensity;\n\t\tif ( this.specularColor && this.specularColor.isColor ) data.specularColor = this.specularColor.getHex();\n\t\tif ( this.shininess !== undefined ) data.shininess = this.shininess;\n\t\tif ( this.clearcoat !== undefined ) data.clearcoat = this.clearcoat;\n\t\tif ( this.clearcoatRoughness !== undefined ) data.clearcoatRoughness = this.clearcoatRoughness;\n\n\t\tif ( this.clearcoatMap && this.clearcoatMap.isTexture ) {\n\n\t\t\tdata.clearcoatMap = this.clearcoatMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture ) {\n\n\t\t\tdata.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture ) {\n\n\t\t\tdata.clearcoatNormalMap = this.clearcoatNormalMap.toJSON( meta ).uuid;\n\t\t\tdata.clearcoatNormalScale = this.clearcoatNormalScale.toArray();\n\n\t\t}\n\n\t\tif ( this.dispersion !== undefined ) data.dispersion = this.dispersion;\n\n\t\tif ( this.iridescence !== undefined ) data.iridescence = this.iridescence;\n\t\tif ( this.iridescenceIOR !== undefined ) data.iridescenceIOR = this.iridescenceIOR;\n\t\tif ( this.iridescenceThicknessRange !== undefined ) data.iridescenceThicknessRange = this.iridescenceThicknessRange;\n\n\t\tif ( this.iridescenceMap && this.iridescenceMap.isTexture ) {\n\n\t\t\tdata.iridescenceMap = this.iridescenceMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture ) {\n\n\t\t\tdata.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.anisotropy !== undefined ) data.anisotropy = this.anisotropy;\n\t\tif ( this.anisotropyRotation !== undefined ) data.anisotropyRotation = this.anisotropyRotation;\n\n\t\tif ( this.anisotropyMap && this.anisotropyMap.isTexture ) {\n\n\t\t\tdata.anisotropyMap = this.anisotropyMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid;\n\t\tif ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid;\n\t\tif ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;\n\n\t\tif ( this.lightMap && this.lightMap.isTexture ) {\n\n\t\t\tdata.lightMap = this.lightMap.toJSON( meta ).uuid;\n\t\t\tdata.lightMapIntensity = this.lightMapIntensity;\n\n\t\t}\n\n\t\tif ( this.aoMap && this.aoMap.isTexture ) {\n\n\t\t\tdata.aoMap = this.aoMap.toJSON( meta ).uuid;\n\t\t\tdata.aoMapIntensity = this.aoMapIntensity;\n\n\t\t}\n\n\t\tif ( this.bumpMap && this.bumpMap.isTexture ) {\n\n\t\t\tdata.bumpMap = this.bumpMap.toJSON( meta ).uuid;\n\t\t\tdata.bumpScale = this.bumpScale;\n\n\t\t}\n\n\t\tif ( this.normalMap && this.normalMap.isTexture ) {\n\n\t\t\tdata.normalMap = this.normalMap.toJSON( meta ).uuid;\n\t\t\tdata.normalMapType = this.normalMapType;\n\t\t\tdata.normalScale = this.normalScale.toArray();\n\n\t\t}\n\n\t\tif ( this.displacementMap && this.displacementMap.isTexture ) {\n\n\t\t\tdata.displacementMap = this.displacementMap.toJSON( meta ).uuid;\n\t\t\tdata.displacementScale = this.displacementScale;\n\t\t\tdata.displacementBias = this.displacementBias;\n\n\t\t}\n\n\t\tif ( this.roughnessMap && this.roughnessMap.isTexture ) data.roughnessMap = this.roughnessMap.toJSON( meta ).uuid;\n\t\tif ( this.metalnessMap && this.metalnessMap.isTexture ) data.metalnessMap = this.metalnessMap.toJSON( meta ).uuid;\n\n\t\tif ( this.emissiveMap && this.emissiveMap.isTexture ) data.emissiveMap = this.emissiveMap.toJSON( meta ).uuid;\n\t\tif ( this.specularMap && this.specularMap.isTexture ) data.specularMap = this.specularMap.toJSON( meta ).uuid;\n\t\tif ( this.specularIntensityMap && this.specularIntensityMap.isTexture ) data.specularIntensityMap = this.specularIntensityMap.toJSON( meta ).uuid;\n\t\tif ( this.specularColorMap && this.specularColorMap.isTexture ) data.specularColorMap = this.specularColorMap.toJSON( meta ).uuid;\n\n\t\tif ( this.envMap && this.envMap.isTexture ) {\n\n\t\t\tdata.envMap = this.envMap.toJSON( meta ).uuid;\n\n\t\t\tif ( this.combine !== undefined ) data.combine = this.combine;\n\n\t\t}\n\n\t\tif ( this.envMapRotation !== undefined ) data.envMapRotation = this.envMapRotation.toArray();\n\t\tif ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity;\n\t\tif ( this.reflectivity !== undefined ) data.reflectivity = this.reflectivity;\n\t\tif ( this.refractionRatio !== undefined ) data.refractionRatio = this.refractionRatio;\n\n\t\tif ( this.gradientMap && this.gradientMap.isTexture ) {\n\n\t\t\tdata.gradientMap = this.gradientMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.transmission !== undefined ) data.transmission = this.transmission;\n\t\tif ( this.transmissionMap && this.transmissionMap.isTexture ) data.transmissionMap = this.transmissionMap.toJSON( meta ).uuid;\n\t\tif ( this.thickness !== undefined ) data.thickness = this.thickness;\n\t\tif ( this.thicknessMap && this.thicknessMap.isTexture ) data.thicknessMap = this.thicknessMap.toJSON( meta ).uuid;\n\t\tif ( this.attenuationDistance !== undefined && this.attenuationDistance !== Infinity ) data.attenuationDistance = this.attenuationDistance;\n\t\tif ( this.attenuationColor !== undefined ) data.attenuationColor = this.attenuationColor.getHex();\n\n\t\tif ( this.size !== undefined ) data.size = this.size;\n\t\tif ( this.shadowSide !== null ) data.shadowSide = this.shadowSide;\n\t\tif ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation;\n\n\t\tif ( this.blending !== NormalBlending ) data.blending = this.blending;\n\t\tif ( this.side !== FrontSide ) data.side = this.side;\n\t\tif ( this.vertexColors === true ) data.vertexColors = true;\n\n\t\tif ( this.opacity < 1 ) data.opacity = this.opacity;\n\t\tif ( this.transparent === true ) data.transparent = true;\n\n\t\tif ( this.blendSrc !== SrcAlphaFactor ) data.blendSrc = this.blendSrc;\n\t\tif ( this.blendDst !== OneMinusSrcAlphaFactor ) data.blendDst = this.blendDst;\n\t\tif ( this.blendEquation !== AddEquation ) data.blendEquation = this.blendEquation;\n\t\tif ( this.blendSrcAlpha !== null ) data.blendSrcAlpha = this.blendSrcAlpha;\n\t\tif ( this.blendDstAlpha !== null ) data.blendDstAlpha = this.blendDstAlpha;\n\t\tif ( this.blendEquationAlpha !== null ) data.blendEquationAlpha = this.blendEquationAlpha;\n\t\tif ( this.blendColor && this.blendColor.isColor ) data.blendColor = this.blendColor.getHex();\n\t\tif ( this.blendAlpha !== 0 ) data.blendAlpha = this.blendAlpha;\n\n\t\tif ( this.depthFunc !== LessEqualDepth ) data.depthFunc = this.depthFunc;\n\t\tif ( this.depthTest === false ) data.depthTest = this.depthTest;\n\t\tif ( this.depthWrite === false ) data.depthWrite = this.depthWrite;\n\t\tif ( this.colorWrite === false ) data.colorWrite = this.colorWrite;\n\n\t\tif ( this.stencilWriteMask !== 0xff ) data.stencilWriteMask = this.stencilWriteMask;\n\t\tif ( this.stencilFunc !== AlwaysStencilFunc ) data.stencilFunc = this.stencilFunc;\n\t\tif ( this.stencilRef !== 0 ) data.stencilRef = this.stencilRef;\n\t\tif ( this.stencilFuncMask !== 0xff ) data.stencilFuncMask = this.stencilFuncMask;\n\t\tif ( this.stencilFail !== KeepStencilOp ) data.stencilFail = this.stencilFail;\n\t\tif ( this.stencilZFail !== KeepStencilOp ) data.stencilZFail = this.stencilZFail;\n\t\tif ( this.stencilZPass !== KeepStencilOp ) data.stencilZPass = this.stencilZPass;\n\t\tif ( this.stencilWrite === true ) data.stencilWrite = this.stencilWrite;\n\n\t\t// rotation (SpriteMaterial)\n\t\tif ( this.rotation !== undefined && this.rotation !== 0 ) data.rotation = this.rotation;\n\n\t\tif ( this.polygonOffset === true ) data.polygonOffset = true;\n\t\tif ( this.polygonOffsetFactor !== 0 ) data.polygonOffsetFactor = this.polygonOffsetFactor;\n\t\tif ( this.polygonOffsetUnits !== 0 ) data.polygonOffsetUnits = this.polygonOffsetUnits;\n\n\t\tif ( this.linewidth !== undefined && this.linewidth !== 1 ) data.linewidth = this.linewidth;\n\t\tif ( this.dashSize !== undefined ) data.dashSize = this.dashSize;\n\t\tif ( this.gapSize !== undefined ) data.gapSize = this.gapSize;\n\t\tif ( this.scale !== undefined ) data.scale = this.scale;\n\n\t\tif ( this.dithering === true ) data.dithering = true;\n\n\t\tif ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;\n\t\tif ( this.alphaHash === true ) data.alphaHash = true;\n\t\tif ( this.alphaToCoverage === true ) data.alphaToCoverage = true;\n\t\tif ( this.premultipliedAlpha === true ) data.premultipliedAlpha = true;\n\t\tif ( this.forceSinglePass === true ) data.forceSinglePass = true;\n\n\t\tif ( this.wireframe === true ) data.wireframe = true;\n\t\tif ( this.wireframeLinewidth > 1 ) data.wireframeLinewidth = this.wireframeLinewidth;\n\t\tif ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap;\n\t\tif ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin;\n\n\t\tif ( this.flatShading === true ) data.flatShading = true;\n\n\t\tif ( this.visible === false ) data.visible = false;\n\n\t\tif ( this.toneMapped === false ) data.toneMapped = false;\n\n\t\tif ( this.fog === false ) data.fog = false;\n\n\t\tif ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData;\n\n\t\t// TODO: Copied from Object3D.toJSON\n\n\t\tfunction extractFromCache( cache ) {\n\n\t\t\tconst values = [];\n\n\t\t\tfor ( const key in cache ) {\n\n\t\t\t\tconst data = cache[ key ];\n\t\t\t\tdelete data.metadata;\n\t\t\t\tvalues.push( data );\n\n\t\t\t}\n\n\t\t\treturn values;\n\n\t\t}\n\n\t\tif ( isRootObject ) {\n\n\t\t\tconst textures = extractFromCache( meta.textures );\n\t\t\tconst images = extractFromCache( meta.images );\n\n\t\t\tif ( textures.length > 0 ) data.textures = textures;\n\t\t\tif ( images.length > 0 ) data.images = images;\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.blending = source.blending;\n\t\tthis.side = source.side;\n\t\tthis.vertexColors = source.vertexColors;\n\n\t\tthis.opacity = source.opacity;\n\t\tthis.transparent = source.transparent;\n\n\t\tthis.blendSrc = source.blendSrc;\n\t\tthis.blendDst = source.blendDst;\n\t\tthis.blendEquation = source.blendEquation;\n\t\tthis.blendSrcAlpha = source.blendSrcAlpha;\n\t\tthis.blendDstAlpha = source.blendDstAlpha;\n\t\tthis.blendEquationAlpha = source.blendEquationAlpha;\n\t\tthis.blendColor.copy( source.blendColor );\n\t\tthis.blendAlpha = source.blendAlpha;\n\n\t\tthis.depthFunc = source.depthFunc;\n\t\tthis.depthTest = source.depthTest;\n\t\tthis.depthWrite = source.depthWrite;\n\n\t\tthis.stencilWriteMask = source.stencilWriteMask;\n\t\tthis.stencilFunc = source.stencilFunc;\n\t\tthis.stencilRef = source.stencilRef;\n\t\tthis.stencilFuncMask = source.stencilFuncMask;\n\t\tthis.stencilFail = source.stencilFail;\n\t\tthis.stencilZFail = source.stencilZFail;\n\t\tthis.stencilZPass = source.stencilZPass;\n\t\tthis.stencilWrite = source.stencilWrite;\n\n\t\tconst srcPlanes = source.clippingPlanes;\n\t\tlet dstPlanes = null;\n\n\t\tif ( srcPlanes !== null ) {\n\n\t\t\tconst n = srcPlanes.length;\n\t\t\tdstPlanes = new Array( n );\n\n\t\t\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\t\t\tdstPlanes[ i ] = srcPlanes[ i ].clone();\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.clippingPlanes = dstPlanes;\n\t\tthis.clipIntersection = source.clipIntersection;\n\t\tthis.clipShadows = source.clipShadows;\n\n\t\tthis.shadowSide = source.shadowSide;\n\n\t\tthis.colorWrite = source.colorWrite;\n\n\t\tthis.precision = source.precision;\n\n\t\tthis.polygonOffset = source.polygonOffset;\n\t\tthis.polygonOffsetFactor = source.polygonOffsetFactor;\n\t\tthis.polygonOffsetUnits = source.polygonOffsetUnits;\n\n\t\tthis.dithering = source.dithering;\n\n\t\tthis.alphaTest = source.alphaTest;\n\t\tthis.alphaHash = source.alphaHash;\n\t\tthis.alphaToCoverage = source.alphaToCoverage;\n\t\tthis.premultipliedAlpha = source.premultipliedAlpha;\n\t\tthis.forceSinglePass = source.forceSinglePass;\n\n\t\tthis.visible = source.visible;\n\n\t\tthis.toneMapped = source.toneMapped;\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\tonBuild( /* shaderobject, renderer */ ) {\n\n\t\tconsole.warn( 'Material: onBuild() has been removed.' ); // @deprecated, r166\n\n\t}\n\n}\n\nclass MeshBasicMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'MeshBasicMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshBasicMaterial = true;\n\n\t\tthis.color = new Color( 0xffffff ); // emissive\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.specularMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.envMapRotation = new Euler();\n\t\tthis.combine = MultiplyOperation;\n\t\tthis.reflectivity = 1;\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n// Fast Half Float Conversions, http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n\nconst _tables = /*@__PURE__*/ _generateTables();\n\nfunction _generateTables() {\n\n\t// float32 to float16 helpers\n\n\tconst buffer = new ArrayBuffer( 4 );\n\tconst floatView = new Float32Array( buffer );\n\tconst uint32View = new Uint32Array( buffer );\n\n\tconst baseTable = new Uint32Array( 512 );\n\tconst shiftTable = new Uint32Array( 512 );\n\n\tfor ( let i = 0; i < 256; ++ i ) {\n\n\t\tconst e = i - 127;\n\n\t\t// very small number (0, -0)\n\n\t\tif ( e < - 27 ) {\n\n\t\t\tbaseTable[ i ] = 0x0000;\n\t\t\tbaseTable[ i | 0x100 ] = 0x8000;\n\t\t\tshiftTable[ i ] = 24;\n\t\t\tshiftTable[ i | 0x100 ] = 24;\n\n\t\t\t// small number (denorm)\n\n\t\t} else if ( e < - 14 ) {\n\n\t\t\tbaseTable[ i ] = 0x0400 >> ( - e - 14 );\n\t\t\tbaseTable[ i | 0x100 ] = ( 0x0400 >> ( - e - 14 ) ) | 0x8000;\n\t\t\tshiftTable[ i ] = - e - 1;\n\t\t\tshiftTable[ i | 0x100 ] = - e - 1;\n\n\t\t\t// normal number\n\n\t\t} else if ( e <= 15 ) {\n\n\t\t\tbaseTable[ i ] = ( e + 15 ) << 10;\n\t\t\tbaseTable[ i | 0x100 ] = ( ( e + 15 ) << 10 ) | 0x8000;\n\t\t\tshiftTable[ i ] = 13;\n\t\t\tshiftTable[ i | 0x100 ] = 13;\n\n\t\t\t// large number (Infinity, -Infinity)\n\n\t\t} else if ( e < 128 ) {\n\n\t\t\tbaseTable[ i ] = 0x7c00;\n\t\t\tbaseTable[ i | 0x100 ] = 0xfc00;\n\t\t\tshiftTable[ i ] = 24;\n\t\t\tshiftTable[ i | 0x100 ] = 24;\n\n\t\t\t// stay (NaN, Infinity, -Infinity)\n\n\t\t} else {\n\n\t\t\tbaseTable[ i ] = 0x7c00;\n\t\t\tbaseTable[ i | 0x100 ] = 0xfc00;\n\t\t\tshiftTable[ i ] = 13;\n\t\t\tshiftTable[ i | 0x100 ] = 13;\n\n\t\t}\n\n\t}\n\n\t// float16 to float32 helpers\n\n\tconst mantissaTable = new Uint32Array( 2048 );\n\tconst exponentTable = new Uint32Array( 64 );\n\tconst offsetTable = new Uint32Array( 64 );\n\n\tfor ( let i = 1; i < 1024; ++ i ) {\n\n\t\tlet m = i << 13; // zero pad mantissa bits\n\t\tlet e = 0; // zero exponent\n\n\t\t// normalized\n\t\twhile ( ( m & 0x00800000 ) === 0 ) {\n\n\t\t\tm <<= 1;\n\t\t\te -= 0x00800000; // decrement exponent\n\n\t\t}\n\n\t\tm &= ~ 0x00800000; // clear leading 1 bit\n\t\te += 0x38800000; // adjust bias\n\n\t\tmantissaTable[ i ] = m | e;\n\n\t}\n\n\tfor ( let i = 1024; i < 2048; ++ i ) {\n\n\t\tmantissaTable[ i ] = 0x38000000 + ( ( i - 1024 ) << 13 );\n\n\t}\n\n\tfor ( let i = 1; i < 31; ++ i ) {\n\n\t\texponentTable[ i ] = i << 23;\n\n\t}\n\n\texponentTable[ 31 ] = 0x47800000;\n\texponentTable[ 32 ] = 0x80000000;\n\n\tfor ( let i = 33; i < 63; ++ i ) {\n\n\t\texponentTable[ i ] = 0x80000000 + ( ( i - 32 ) << 23 );\n\n\t}\n\n\texponentTable[ 63 ] = 0xc7800000;\n\n\tfor ( let i = 1; i < 64; ++ i ) {\n\n\t\tif ( i !== 32 ) {\n\n\t\t\toffsetTable[ i ] = 1024;\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\tfloatView: floatView,\n\t\tuint32View: uint32View,\n\t\tbaseTable: baseTable,\n\t\tshiftTable: shiftTable,\n\t\tmantissaTable: mantissaTable,\n\t\texponentTable: exponentTable,\n\t\toffsetTable: offsetTable\n\t};\n\n}\n\n// float32 to float16\n\nfunction toHalfFloat( val ) {\n\n\tif ( Math.abs( val ) > 65504 ) console.warn( 'THREE.DataUtils.toHalfFloat(): Value out of range.' );\n\n\tval = clamp( val, - 65504, 65504 );\n\n\t_tables.floatView[ 0 ] = val;\n\tconst f = _tables.uint32View[ 0 ];\n\tconst e = ( f >> 23 ) & 0x1ff;\n\treturn _tables.baseTable[ e ] + ( ( f & 0x007fffff ) >> _tables.shiftTable[ e ] );\n\n}\n\n// float16 to float32\n\nfunction fromHalfFloat( val ) {\n\n\tconst m = val >> 10;\n\t_tables.uint32View[ 0 ] = _tables.mantissaTable[ _tables.offsetTable[ m ] + ( val & 0x3ff ) ] + _tables.exponentTable[ m ];\n\treturn _tables.floatView[ 0 ];\n\n}\n\nconst DataUtils = {\n\ttoHalfFloat: toHalfFloat,\n\tfromHalfFloat: fromHalfFloat,\n};\n\nconst _vector$9 = /*@__PURE__*/ new Vector3();\nconst _vector2$1 = /*@__PURE__*/ new Vector2();\n\nclass BufferAttribute {\n\n\tconstructor( array, itemSize, normalized = false ) {\n\n\t\tif ( Array.isArray( array ) ) {\n\n\t\t\tthrow new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' );\n\n\t\t}\n\n\t\tthis.isBufferAttribute = true;\n\n\t\tthis.name = '';\n\n\t\tthis.array = array;\n\t\tthis.itemSize = itemSize;\n\t\tthis.count = array !== undefined ? array.length / itemSize : 0;\n\t\tthis.normalized = normalized;\n\n\t\tthis.usage = StaticDrawUsage;\n\t\tthis.updateRanges = [];\n\t\tthis.gpuType = FloatType;\n\n\t\tthis.version = 0;\n\n\t}\n\n\tonUploadCallback() {}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\taddUpdateRange( start, count ) {\n\n\t\tthis.updateRanges.push( { start, count } );\n\n\t}\n\n\tclearUpdateRanges() {\n\n\t\tthis.updateRanges.length = 0;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\t\tthis.array = new source.array.constructor( source.array );\n\t\tthis.itemSize = source.itemSize;\n\t\tthis.count = source.count;\n\t\tthis.normalized = source.normalized;\n\n\t\tthis.usage = source.usage;\n\t\tthis.gpuType = source.gpuType;\n\n\t\treturn this;\n\n\t}\n\n\tcopyAt( index1, attribute, index2 ) {\n\n\t\tindex1 *= this.itemSize;\n\t\tindex2 *= attribute.itemSize;\n\n\t\tfor ( let i = 0, l = this.itemSize; i < l; i ++ ) {\n\n\t\t\tthis.array[ index1 + i ] = attribute.array[ index2 + i ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcopyArray( array ) {\n\n\t\tthis.array.set( array );\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix3( m ) {\n\n\t\tif ( this.itemSize === 2 ) {\n\n\t\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t\t_vector2$1.fromBufferAttribute( this, i );\n\t\t\t\t_vector2$1.applyMatrix3( m );\n\n\t\t\t\tthis.setXY( i, _vector2$1.x, _vector2$1.y );\n\n\t\t\t}\n\n\t\t} else if ( this.itemSize === 3 ) {\n\n\t\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t\t_vector$9.fromBufferAttribute( this, i );\n\t\t\t\t_vector$9.applyMatrix3( m );\n\n\t\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$9.fromBufferAttribute( this, i );\n\n\t\t\t_vector$9.applyMatrix4( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyNormalMatrix( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$9.fromBufferAttribute( this, i );\n\n\t\t\t_vector$9.applyNormalMatrix( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttransformDirection( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$9.fromBufferAttribute( this, i );\n\n\t\t\t_vector$9.transformDirection( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tset( value, offset = 0 ) {\n\n\t\t// Matching BufferAttribute constructor, do not normalize the array.\n\t\tthis.array.set( value, offset );\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index, component ) {\n\n\t\tlet value = this.array[ index * this.itemSize + component ];\n\n\t\tif ( this.normalized ) value = denormalize( value, this.array );\n\n\t\treturn value;\n\n\t}\n\n\tsetComponent( index, component, value ) {\n\n\t\tif ( this.normalized ) value = normalize( value, this.array );\n\n\t\tthis.array[ index * this.itemSize + component ] = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetX( index ) {\n\n\t\tlet x = this.array[ index * this.itemSize ];\n\n\t\tif ( this.normalized ) x = denormalize( x, this.array );\n\n\t\treturn x;\n\n\t}\n\n\tsetX( index, x ) {\n\n\t\tif ( this.normalized ) x = normalize( x, this.array );\n\n\t\tthis.array[ index * this.itemSize ] = x;\n\n\t\treturn this;\n\n\t}\n\n\tgetY( index ) {\n\n\t\tlet y = this.array[ index * this.itemSize + 1 ];\n\n\t\tif ( this.normalized ) y = denormalize( y, this.array );\n\n\t\treturn y;\n\n\t}\n\n\tsetY( index, y ) {\n\n\t\tif ( this.normalized ) y = normalize( y, this.array );\n\n\t\tthis.array[ index * this.itemSize + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\tgetZ( index ) {\n\n\t\tlet z = this.array[ index * this.itemSize + 2 ];\n\n\t\tif ( this.normalized ) z = denormalize( z, this.array );\n\n\t\treturn z;\n\n\t}\n\n\tsetZ( index, z ) {\n\n\t\tif ( this.normalized ) z = normalize( z, this.array );\n\n\t\tthis.array[ index * this.itemSize + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\tgetW( index ) {\n\n\t\tlet w = this.array[ index * this.itemSize + 3 ];\n\n\t\tif ( this.normalized ) w = denormalize( w, this.array );\n\n\t\treturn w;\n\n\t}\n\n\tsetW( index, w ) {\n\n\t\tif ( this.normalized ) w = normalize( w, this.array );\n\n\t\tthis.array[ index * this.itemSize + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetXY( index, x, y ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\t\tthis.array[ index + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\t\t\tw = normalize( w, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\t\tthis.array[ index + 2 ] = z;\n\t\tthis.array[ index + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\tonUpload( callback ) {\n\n\t\tthis.onUploadCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.array, this.itemSize ).copy( this );\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\titemSize: this.itemSize,\n\t\t\ttype: this.array.constructor.name,\n\t\t\tarray: Array.from( this.array ),\n\t\t\tnormalized: this.normalized\n\t\t};\n\n\t\tif ( this.name !== '' ) data.name = this.name;\n\t\tif ( this.usage !== StaticDrawUsage ) data.usage = this.usage;\n\n\t\treturn data;\n\n\t}\n\n}\n\n//\n\nclass Int8BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int8Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Uint8BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint8Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Uint8ClampedBufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint8ClampedArray( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Int16BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int16Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Uint16BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint16Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Int32BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Uint32BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nclass Float16BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint16Array( array ), itemSize, normalized );\n\n\t\tthis.isFloat16BufferAttribute = true;\n\n\t}\n\n\tgetX( index ) {\n\n\t\tlet x = fromHalfFloat( this.array[ index * this.itemSize ] );\n\n\t\tif ( this.normalized ) x = denormalize( x, this.array );\n\n\t\treturn x;\n\n\t}\n\n\tsetX( index, x ) {\n\n\t\tif ( this.normalized ) x = normalize( x, this.array );\n\n\t\tthis.array[ index * this.itemSize ] = toHalfFloat( x );\n\n\t\treturn this;\n\n\t}\n\n\tgetY( index ) {\n\n\t\tlet y = fromHalfFloat( this.array[ index * this.itemSize + 1 ] );\n\n\t\tif ( this.normalized ) y = denormalize( y, this.array );\n\n\t\treturn y;\n\n\t}\n\n\tsetY( index, y ) {\n\n\t\tif ( this.normalized ) y = normalize( y, this.array );\n\n\t\tthis.array[ index * this.itemSize + 1 ] = toHalfFloat( y );\n\n\t\treturn this;\n\n\t}\n\n\tgetZ( index ) {\n\n\t\tlet z = fromHalfFloat( this.array[ index * this.itemSize + 2 ] );\n\n\t\tif ( this.normalized ) z = denormalize( z, this.array );\n\n\t\treturn z;\n\n\t}\n\n\tsetZ( index, z ) {\n\n\t\tif ( this.normalized ) z = normalize( z, this.array );\n\n\t\tthis.array[ index * this.itemSize + 2 ] = toHalfFloat( z );\n\n\t\treturn this;\n\n\t}\n\n\tgetW( index ) {\n\n\t\tlet w = fromHalfFloat( this.array[ index * this.itemSize + 3 ] );\n\n\t\tif ( this.normalized ) w = denormalize( w, this.array );\n\n\t\treturn w;\n\n\t}\n\n\tsetW( index, w ) {\n\n\t\tif ( this.normalized ) w = normalize( w, this.array );\n\n\t\tthis.array[ index * this.itemSize + 3 ] = toHalfFloat( w );\n\n\t\treturn this;\n\n\t}\n\n\tsetXY( index, x, y ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = toHalfFloat( x );\n\t\tthis.array[ index + 1 ] = toHalfFloat( y );\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = toHalfFloat( x );\n\t\tthis.array[ index + 1 ] = toHalfFloat( y );\n\t\tthis.array[ index + 2 ] = toHalfFloat( z );\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\t\t\tw = normalize( w, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = toHalfFloat( x );\n\t\tthis.array[ index + 1 ] = toHalfFloat( y );\n\t\tthis.array[ index + 2 ] = toHalfFloat( z );\n\t\tthis.array[ index + 3 ] = toHalfFloat( w );\n\n\t\treturn this;\n\n\t}\n\n}\n\n\nclass Float32BufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Float32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nlet _id$2 = 0;\n\nconst _m1$2 = /*@__PURE__*/ new Matrix4();\nconst _obj = /*@__PURE__*/ new Object3D();\nconst _offset = /*@__PURE__*/ new Vector3();\nconst _box$2 = /*@__PURE__*/ new Box3();\nconst _boxMorphTargets = /*@__PURE__*/ new Box3();\nconst _vector$8 = /*@__PURE__*/ new Vector3();\n\nclass BufferGeometry extends EventDispatcher {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isBufferGeometry = true;\n\n\t\tObject.defineProperty( this, 'id', { value: _id$2 ++ } );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.name = '';\n\t\tthis.type = 'BufferGeometry';\n\n\t\tthis.index = null;\n\t\tthis.indirect = null;\n\t\tthis.attributes = {};\n\n\t\tthis.morphAttributes = {};\n\t\tthis.morphTargetsRelative = false;\n\n\t\tthis.groups = [];\n\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\tthis.drawRange = { start: 0, count: Infinity };\n\n\t\tthis.userData = {};\n\n\t}\n\n\tgetIndex() {\n\n\t\treturn this.index;\n\n\t}\n\n\tsetIndex( index ) {\n\n\t\tif ( Array.isArray( index ) ) {\n\n\t\t\tthis.index = new ( arrayNeedsUint32( index ) ? Uint32BufferAttribute : Uint16BufferAttribute )( index, 1 );\n\n\t\t} else {\n\n\t\t\tthis.index = index;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetIndirect( indirect ) {\n\n\t\tthis.indirect = indirect;\n\n\t\treturn this;\n\n\t}\n\n\tgetIndirect() {\n\n\t\treturn this.indirect;\n\n\t}\n\n\tgetAttribute( name ) {\n\n\t\treturn this.attributes[ name ];\n\n\t}\n\n\tsetAttribute( name, attribute ) {\n\n\t\tthis.attributes[ name ] = attribute;\n\n\t\treturn this;\n\n\t}\n\n\tdeleteAttribute( name ) {\n\n\t\tdelete this.attributes[ name ];\n\n\t\treturn this;\n\n\t}\n\n\thasAttribute( name ) {\n\n\t\treturn this.attributes[ name ] !== undefined;\n\n\t}\n\n\taddGroup( start, count, materialIndex = 0 ) {\n\n\t\tthis.groups.push( {\n\n\t\t\tstart: start,\n\t\t\tcount: count,\n\t\t\tmaterialIndex: materialIndex\n\n\t\t} );\n\n\t}\n\n\tclearGroups() {\n\n\t\tthis.groups = [];\n\n\t}\n\n\tsetDrawRange( start, count ) {\n\n\t\tthis.drawRange.start = start;\n\t\tthis.drawRange.count = count;\n\n\t}\n\n\tapplyMatrix4( matrix ) {\n\n\t\tconst position = this.attributes.position;\n\n\t\tif ( position !== undefined ) {\n\n\t\t\tposition.applyMatrix4( matrix );\n\n\t\t\tposition.needsUpdate = true;\n\n\t\t}\n\n\t\tconst normal = this.attributes.normal;\n\n\t\tif ( normal !== undefined ) {\n\n\t\t\tconst normalMatrix = new Matrix3().getNormalMatrix( matrix );\n\n\t\t\tnormal.applyNormalMatrix( normalMatrix );\n\n\t\t\tnormal.needsUpdate = true;\n\n\t\t}\n\n\t\tconst tangent = this.attributes.tangent;\n\n\t\tif ( tangent !== undefined ) {\n\n\t\t\ttangent.transformDirection( matrix );\n\n\t\t\ttangent.needsUpdate = true;\n\n\t\t}\n\n\t\tif ( this.boundingBox !== null ) {\n\n\t\t\tthis.computeBoundingBox();\n\n\t\t}\n\n\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\tthis.computeBoundingSphere();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyQuaternion( q ) {\n\n\t\t_m1$2.makeRotationFromQuaternion( q );\n\n\t\tthis.applyMatrix4( _m1$2 );\n\n\t\treturn this;\n\n\t}\n\n\trotateX( angle ) {\n\n\t\t// rotate geometry around world x-axis\n\n\t\t_m1$2.makeRotationX( angle );\n\n\t\tthis.applyMatrix4( _m1$2 );\n\n\t\treturn this;\n\n\t}\n\n\trotateY( angle ) {\n\n\t\t// rotate geometry around world y-axis\n\n\t\t_m1$2.makeRotationY( angle );\n\n\t\tthis.applyMatrix4( _m1$2 );\n\n\t\treturn this;\n\n\t}\n\n\trotateZ( angle ) {\n\n\t\t// rotate geometry around world z-axis\n\n\t\t_m1$2.makeRotationZ( angle );\n\n\t\tthis.applyMatrix4( _m1$2 );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( x, y, z ) {\n\n\t\t// translate geometry\n\n\t\t_m1$2.makeTranslation( x, y, z );\n\n\t\tthis.applyMatrix4( _m1$2 );\n\n\t\treturn this;\n\n\t}\n\n\tscale( x, y, z ) {\n\n\t\t// scale geometry\n\n\t\t_m1$2.makeScale( x, y, z );\n\n\t\tthis.applyMatrix4( _m1$2 );\n\n\t\treturn this;\n\n\t}\n\n\tlookAt( vector ) {\n\n\t\t_obj.lookAt( vector );\n\n\t\t_obj.updateMatrix();\n\n\t\tthis.applyMatrix4( _obj.matrix );\n\n\t\treturn this;\n\n\t}\n\n\tcenter() {\n\n\t\tthis.computeBoundingBox();\n\n\t\tthis.boundingBox.getCenter( _offset ).negate();\n\n\t\tthis.translate( _offset.x, _offset.y, _offset.z );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPoints( points ) {\n\n\t\tconst positionAttribute = this.getAttribute( 'position' );\n\n\t\tif ( positionAttribute === undefined ) {\n\n\t\t\tconst position = [];\n\n\t\t\tfor ( let i = 0, l = points.length; i < l; i ++ ) {\n\n\t\t\t\tconst point = points[ i ];\n\t\t\t\tposition.push( point.x, point.y, point.z || 0 );\n\n\t\t\t}\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( position, 3 ) );\n\n\t\t} else {\n\n\t\t\tfor ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {\n\n\t\t\t\tconst point = points[ i ];\n\t\t\t\tpositionAttribute.setXYZ( i, point.x, point.y, point.z || 0 );\n\n\t\t\t}\n\n\t\t\tif ( points.length > positionAttribute.count ) {\n\n\t\t\t\tconsole.warn( 'THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.' );\n\n\t\t\t}\n\n\t\t\tpositionAttribute.needsUpdate = true;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcomputeBoundingBox() {\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tconst position = this.attributes.position;\n\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\tif ( position && position.isGLBufferAttribute ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );\n\n\t\t\tthis.boundingBox.set(\n\t\t\t\tnew Vector3( - Infinity, - Infinity, - Infinity ),\n\t\t\t\tnew Vector3( + Infinity, + Infinity, + Infinity )\n\t\t\t);\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( position !== undefined ) {\n\n\t\t\tthis.boundingBox.setFromBufferAttribute( position );\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\t_box$2.setFromBufferAttribute( morphAttribute );\n\n\t\t\t\t\tif ( this.morphTargetsRelative ) {\n\n\t\t\t\t\t\t_vector$8.addVectors( this.boundingBox.min, _box$2.min );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _vector$8 );\n\n\t\t\t\t\t\t_vector$8.addVectors( this.boundingBox.max, _box$2.max );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _vector$8 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _box$2.min );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _box$2.max );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthis.boundingBox.makeEmpty();\n\n\t\t}\n\n\t\tif ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.', this );\n\n\t\t}\n\n\t}\n\n\tcomputeBoundingSphere() {\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tconst position = this.attributes.position;\n\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\tif ( position && position.isGLBufferAttribute ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );\n\n\t\t\tthis.boundingSphere.set( new Vector3(), Infinity );\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( position ) {\n\n\t\t\t// first, find the center of the bounding sphere\n\n\t\t\tconst center = this.boundingSphere.center;\n\n\t\t\t_box$2.setFromBufferAttribute( position );\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\t_boxMorphTargets.setFromBufferAttribute( morphAttribute );\n\n\t\t\t\t\tif ( this.morphTargetsRelative ) {\n\n\t\t\t\t\t\t_vector$8.addVectors( _box$2.min, _boxMorphTargets.min );\n\t\t\t\t\t\t_box$2.expandByPoint( _vector$8 );\n\n\t\t\t\t\t\t_vector$8.addVectors( _box$2.max, _boxMorphTargets.max );\n\t\t\t\t\t\t_box$2.expandByPoint( _vector$8 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_box$2.expandByPoint( _boxMorphTargets.min );\n\t\t\t\t\t\t_box$2.expandByPoint( _boxMorphTargets.max );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_box$2.getCenter( center );\n\n\t\t\t// second, try to find a boundingSphere with a radius smaller than the\n\t\t\t// boundingSphere of the boundingBox: sqrt(3) smaller in the best case\n\n\t\t\tlet maxRadiusSq = 0;\n\n\t\t\tfor ( let i = 0, il = position.count; i < il; i ++ ) {\n\n\t\t\t\t_vector$8.fromBufferAttribute( position, i );\n\n\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$8 ) );\n\n\t\t\t}\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\tconst morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t\t\t\tfor ( let j = 0, jl = morphAttribute.count; j < jl; j ++ ) {\n\n\t\t\t\t\t\t_vector$8.fromBufferAttribute( morphAttribute, j );\n\n\t\t\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t\t\t_offset.fromBufferAttribute( position, j );\n\t\t\t\t\t\t\t_vector$8.add( _offset );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$8 ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.boundingSphere.radius = Math.sqrt( maxRadiusSq );\n\n\t\t\tif ( isNaN( this.boundingSphere.radius ) ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.', this );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcomputeTangents() {\n\n\t\tconst index = this.index;\n\t\tconst attributes = this.attributes;\n\n\t\t// based on http://www.terathon.com/code/tangent.html\n\t\t// (per vertex tangents)\n\n\t\tif ( index === null ||\n\t\t\t attributes.position === undefined ||\n\t\t\t attributes.normal === undefined ||\n\t\t\t attributes.uv === undefined ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst positionAttribute = attributes.position;\n\t\tconst normalAttribute = attributes.normal;\n\t\tconst uvAttribute = attributes.uv;\n\n\t\tif ( this.hasAttribute( 'tangent' ) === false ) {\n\n\t\t\tthis.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );\n\n\t\t}\n\n\t\tconst tangentAttribute = this.getAttribute( 'tangent' );\n\n\t\tconst tan1 = [], tan2 = [];\n\n\t\tfor ( let i = 0; i < positionAttribute.count; i ++ ) {\n\n\t\t\ttan1[ i ] = new Vector3();\n\t\t\ttan2[ i ] = new Vector3();\n\n\t\t}\n\n\t\tconst vA = new Vector3(),\n\t\t\tvB = new Vector3(),\n\t\t\tvC = new Vector3(),\n\n\t\t\tuvA = new Vector2(),\n\t\t\tuvB = new Vector2(),\n\t\t\tuvC = new Vector2(),\n\n\t\t\tsdir = new Vector3(),\n\t\t\ttdir = new Vector3();\n\n\t\tfunction handleTriangle( a, b, c ) {\n\n\t\t\tvA.fromBufferAttribute( positionAttribute, a );\n\t\t\tvB.fromBufferAttribute( positionAttribute, b );\n\t\t\tvC.fromBufferAttribute( positionAttribute, c );\n\n\t\t\tuvA.fromBufferAttribute( uvAttribute, a );\n\t\t\tuvB.fromBufferAttribute( uvAttribute, b );\n\t\t\tuvC.fromBufferAttribute( uvAttribute, c );\n\n\t\t\tvB.sub( vA );\n\t\t\tvC.sub( vA );\n\n\t\t\tuvB.sub( uvA );\n\t\t\tuvC.sub( uvA );\n\n\t\t\tconst r = 1.0 / ( uvB.x * uvC.y - uvC.x * uvB.y );\n\n\t\t\t// silently ignore degenerate uv triangles having coincident or colinear vertices\n\n\t\t\tif ( ! isFinite( r ) ) return;\n\n\t\t\tsdir.copy( vB ).multiplyScalar( uvC.y ).addScaledVector( vC, - uvB.y ).multiplyScalar( r );\n\t\t\ttdir.copy( vC ).multiplyScalar( uvB.x ).addScaledVector( vB, - uvC.x ).multiplyScalar( r );\n\n\t\t\ttan1[ a ].add( sdir );\n\t\t\ttan1[ b ].add( sdir );\n\t\t\ttan1[ c ].add( sdir );\n\n\t\t\ttan2[ a ].add( tdir );\n\t\t\ttan2[ b ].add( tdir );\n\t\t\ttan2[ c ].add( tdir );\n\n\t\t}\n\n\t\tlet groups = this.groups;\n\n\t\tif ( groups.length === 0 ) {\n\n\t\t\tgroups = [ {\n\t\t\t\tstart: 0,\n\t\t\t\tcount: index.count\n\t\t\t} ];\n\n\t\t}\n\n\t\tfor ( let i = 0, il = groups.length; i < il; ++ i ) {\n\n\t\t\tconst group = groups[ i ];\n\n\t\t\tconst start = group.start;\n\t\t\tconst count = group.count;\n\n\t\t\tfor ( let j = start, jl = start + count; j < jl; j += 3 ) {\n\n\t\t\t\thandleTriangle(\n\t\t\t\t\tindex.getX( j + 0 ),\n\t\t\t\t\tindex.getX( j + 1 ),\n\t\t\t\t\tindex.getX( j + 2 )\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst tmp = new Vector3(), tmp2 = new Vector3();\n\t\tconst n = new Vector3(), n2 = new Vector3();\n\n\t\tfunction handleVertex( v ) {\n\n\t\t\tn.fromBufferAttribute( normalAttribute, v );\n\t\t\tn2.copy( n );\n\n\t\t\tconst t = tan1[ v ];\n\n\t\t\t// Gram-Schmidt orthogonalize\n\n\t\t\ttmp.copy( t );\n\t\t\ttmp.sub( n.multiplyScalar( n.dot( t ) ) ).normalize();\n\n\t\t\t// Calculate handedness\n\n\t\t\ttmp2.crossVectors( n2, t );\n\t\t\tconst test = tmp2.dot( tan2[ v ] );\n\t\t\tconst w = ( test < 0.0 ) ? - 1.0 : 1.0;\n\n\t\t\ttangentAttribute.setXYZW( v, tmp.x, tmp.y, tmp.z, w );\n\n\t\t}\n\n\t\tfor ( let i = 0, il = groups.length; i < il; ++ i ) {\n\n\t\t\tconst group = groups[ i ];\n\n\t\t\tconst start = group.start;\n\t\t\tconst count = group.count;\n\n\t\t\tfor ( let j = start, jl = start + count; j < jl; j += 3 ) {\n\n\t\t\t\thandleVertex( index.getX( j + 0 ) );\n\t\t\t\thandleVertex( index.getX( j + 1 ) );\n\t\t\t\thandleVertex( index.getX( j + 2 ) );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcomputeVertexNormals() {\n\n\t\tconst index = this.index;\n\t\tconst positionAttribute = this.getAttribute( 'position' );\n\n\t\tif ( positionAttribute !== undefined ) {\n\n\t\t\tlet normalAttribute = this.getAttribute( 'normal' );\n\n\t\t\tif ( normalAttribute === undefined ) {\n\n\t\t\t\tnormalAttribute = new BufferAttribute( new Float32Array( positionAttribute.count * 3 ), 3 );\n\t\t\t\tthis.setAttribute( 'normal', normalAttribute );\n\n\t\t\t} else {\n\n\t\t\t\t// reset existing normals to zero\n\n\t\t\t\tfor ( let i = 0, il = normalAttribute.count; i < il; i ++ ) {\n\n\t\t\t\t\tnormalAttribute.setXYZ( i, 0, 0, 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst pA = new Vector3(), pB = new Vector3(), pC = new Vector3();\n\t\t\tconst nA = new Vector3(), nB = new Vector3(), nC = new Vector3();\n\t\t\tconst cb = new Vector3(), ab = new Vector3();\n\n\t\t\t// indexed elements\n\n\t\t\tif ( index ) {\n\n\t\t\t\tfor ( let i = 0, il = index.count; i < il; i += 3 ) {\n\n\t\t\t\t\tconst vA = index.getX( i + 0 );\n\t\t\t\t\tconst vB = index.getX( i + 1 );\n\t\t\t\t\tconst vC = index.getX( i + 2 );\n\n\t\t\t\t\tpA.fromBufferAttribute( positionAttribute, vA );\n\t\t\t\t\tpB.fromBufferAttribute( positionAttribute, vB );\n\t\t\t\t\tpC.fromBufferAttribute( positionAttribute, vC );\n\n\t\t\t\t\tcb.subVectors( pC, pB );\n\t\t\t\t\tab.subVectors( pA, pB );\n\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\tnA.fromBufferAttribute( normalAttribute, vA );\n\t\t\t\t\tnB.fromBufferAttribute( normalAttribute, vB );\n\t\t\t\t\tnC.fromBufferAttribute( normalAttribute, vC );\n\n\t\t\t\t\tnA.add( cb );\n\t\t\t\t\tnB.add( cb );\n\t\t\t\t\tnC.add( cb );\n\n\t\t\t\t\tnormalAttribute.setXYZ( vA, nA.x, nA.y, nA.z );\n\t\t\t\t\tnormalAttribute.setXYZ( vB, nB.x, nB.y, nB.z );\n\t\t\t\t\tnormalAttribute.setXYZ( vC, nC.x, nC.y, nC.z );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// non-indexed elements (unconnected triangle soup)\n\n\t\t\t\tfor ( let i = 0, il = positionAttribute.count; i < il; i += 3 ) {\n\n\t\t\t\t\tpA.fromBufferAttribute( positionAttribute, i + 0 );\n\t\t\t\t\tpB.fromBufferAttribute( positionAttribute, i + 1 );\n\t\t\t\t\tpC.fromBufferAttribute( positionAttribute, i + 2 );\n\n\t\t\t\t\tcb.subVectors( pC, pB );\n\t\t\t\t\tab.subVectors( pA, pB );\n\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\tnormalAttribute.setXYZ( i + 0, cb.x, cb.y, cb.z );\n\t\t\t\t\tnormalAttribute.setXYZ( i + 1, cb.x, cb.y, cb.z );\n\t\t\t\t\tnormalAttribute.setXYZ( i + 2, cb.x, cb.y, cb.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.normalizeNormals();\n\n\t\t\tnormalAttribute.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\tnormalizeNormals() {\n\n\t\tconst normals = this.attributes.normal;\n\n\t\tfor ( let i = 0, il = normals.count; i < il; i ++ ) {\n\n\t\t\t_vector$8.fromBufferAttribute( normals, i );\n\n\t\t\t_vector$8.normalize();\n\n\t\t\tnormals.setXYZ( i, _vector$8.x, _vector$8.y, _vector$8.z );\n\n\t\t}\n\n\t}\n\n\ttoNonIndexed() {\n\n\t\tfunction convertBufferAttribute( attribute, indices ) {\n\n\t\t\tconst array = attribute.array;\n\t\t\tconst itemSize = attribute.itemSize;\n\t\t\tconst normalized = attribute.normalized;\n\n\t\t\tconst array2 = new array.constructor( indices.length * itemSize );\n\n\t\t\tlet index = 0, index2 = 0;\n\n\t\t\tfor ( let i = 0, l = indices.length; i < l; i ++ ) {\n\n\t\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\tindex = indices[ i ] * attribute.data.stride + attribute.offset;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tindex = indices[ i ] * itemSize;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let j = 0; j < itemSize; j ++ ) {\n\n\t\t\t\t\tarray2[ index2 ++ ] = array[ index ++ ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn new BufferAttribute( array2, itemSize, normalized );\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.index === null ) {\n\n\t\t\tconsole.warn( 'THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.' );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst geometry2 = new BufferGeometry();\n\n\t\tconst indices = this.index.array;\n\t\tconst attributes = this.attributes;\n\n\t\t// attributes\n\n\t\tfor ( const name in attributes ) {\n\n\t\t\tconst attribute = attributes[ name ];\n\n\t\t\tconst newAttribute = convertBufferAttribute( attribute, indices );\n\n\t\t\tgeometry2.setAttribute( name, newAttribute );\n\n\t\t}\n\n\t\t// morph attributes\n\n\t\tconst morphAttributes = this.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst morphArray = [];\n\t\t\tconst morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\tfor ( let i = 0, il = morphAttribute.length; i < il; i ++ ) {\n\n\t\t\t\tconst attribute = morphAttribute[ i ];\n\n\t\t\t\tconst newAttribute = convertBufferAttribute( attribute, indices );\n\n\t\t\t\tmorphArray.push( newAttribute );\n\n\t\t\t}\n\n\t\t\tgeometry2.morphAttributes[ name ] = morphArray;\n\n\t\t}\n\n\t\tgeometry2.morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t// groups\n\n\t\tconst groups = this.groups;\n\n\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tgeometry2.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t}\n\n\t\treturn geometry2;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.6,\n\t\t\t\ttype: 'BufferGeometry',\n\t\t\t\tgenerator: 'BufferGeometry.toJSON'\n\t\t\t}\n\t\t};\n\n\t\t// standard BufferGeometry serialization\n\n\t\tdata.uuid = this.uuid;\n\t\tdata.type = this.type;\n\t\tif ( this.name !== '' ) data.name = this.name;\n\t\tif ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData;\n\n\t\tif ( this.parameters !== undefined ) {\n\n\t\t\tconst parameters = this.parameters;\n\n\t\t\tfor ( const key in parameters ) {\n\n\t\t\t\tif ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ];\n\n\t\t\t}\n\n\t\t\treturn data;\n\n\t\t}\n\n\t\t// for simplicity the code assumes attributes are not shared across geometries, see #15811\n\n\t\tdata.data = { attributes: {} };\n\n\t\tconst index = this.index;\n\n\t\tif ( index !== null ) {\n\n\t\t\tdata.data.index = {\n\t\t\t\ttype: index.array.constructor.name,\n\t\t\t\tarray: Array.prototype.slice.call( index.array )\n\t\t\t};\n\n\t\t}\n\n\t\tconst attributes = this.attributes;\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tconst attribute = attributes[ key ];\n\n\t\t\tdata.data.attributes[ key ] = attribute.toJSON( data.data );\n\n\t\t}\n\n\t\tconst morphAttributes = {};\n\t\tlet hasMorphAttributes = false;\n\n\t\tfor ( const key in this.morphAttributes ) {\n\n\t\t\tconst attributeArray = this.morphAttributes[ key ];\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0, il = attributeArray.length; i < il; i ++ ) {\n\n\t\t\t\tconst attribute = attributeArray[ i ];\n\n\t\t\t\tarray.push( attribute.toJSON( data.data ) );\n\n\t\t\t}\n\n\t\t\tif ( array.length > 0 ) {\n\n\t\t\t\tmorphAttributes[ key ] = array;\n\n\t\t\t\thasMorphAttributes = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( hasMorphAttributes ) {\n\n\t\t\tdata.data.morphAttributes = morphAttributes;\n\t\t\tdata.data.morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t}\n\n\t\tconst groups = this.groups;\n\n\t\tif ( groups.length > 0 ) {\n\n\t\t\tdata.data.groups = JSON.parse( JSON.stringify( groups ) );\n\n\t\t}\n\n\t\tconst boundingSphere = this.boundingSphere;\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\tdata.data.boundingSphere = {\n\t\t\t\tcenter: boundingSphere.center.toArray(),\n\t\t\t\tradius: boundingSphere.radius\n\t\t\t};\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\t// reset\n\n\t\tthis.index = null;\n\t\tthis.attributes = {};\n\t\tthis.morphAttributes = {};\n\t\tthis.groups = [];\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\t// used for storing cloned, shared data\n\n\t\tconst data = {};\n\n\t\t// name\n\n\t\tthis.name = source.name;\n\n\t\t// index\n\n\t\tconst index = source.index;\n\n\t\tif ( index !== null ) {\n\n\t\t\tthis.setIndex( index.clone( data ) );\n\n\t\t}\n\n\t\t// attributes\n\n\t\tconst attributes = source.attributes;\n\n\t\tfor ( const name in attributes ) {\n\n\t\t\tconst attribute = attributes[ name ];\n\t\t\tthis.setAttribute( name, attribute.clone( data ) );\n\n\t\t}\n\n\t\t// morph attributes\n\n\t\tconst morphAttributes = source.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst array = [];\n\t\t\tconst morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\tfor ( let i = 0, l = morphAttribute.length; i < l; i ++ ) {\n\n\t\t\t\tarray.push( morphAttribute[ i ].clone( data ) );\n\n\t\t\t}\n\n\t\t\tthis.morphAttributes[ name ] = array;\n\n\t\t}\n\n\t\tthis.morphTargetsRelative = source.morphTargetsRelative;\n\n\t\t// groups\n\n\t\tconst groups = source.groups;\n\n\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tthis.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t}\n\n\t\t// bounding box\n\n\t\tconst boundingBox = source.boundingBox;\n\n\t\tif ( boundingBox !== null ) {\n\n\t\t\tthis.boundingBox = boundingBox.clone();\n\n\t\t}\n\n\t\t// bounding sphere\n\n\t\tconst boundingSphere = source.boundingSphere;\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\tthis.boundingSphere = boundingSphere.clone();\n\n\t\t}\n\n\t\t// draw range\n\n\t\tthis.drawRange.start = source.drawRange.start;\n\t\tthis.drawRange.count = source.drawRange.count;\n\n\t\t// user data\n\n\t\tthis.userData = source.userData;\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n}\n\nconst _inverseMatrix$3 = /*@__PURE__*/ new Matrix4();\nconst _ray$3 = /*@__PURE__*/ new Ray();\nconst _sphere$6 = /*@__PURE__*/ new Sphere();\nconst _sphereHitAt = /*@__PURE__*/ new Vector3();\n\nconst _vA$1 = /*@__PURE__*/ new Vector3();\nconst _vB$1 = /*@__PURE__*/ new Vector3();\nconst _vC$1 = /*@__PURE__*/ new Vector3();\n\nconst _tempA = /*@__PURE__*/ new Vector3();\nconst _morphA = /*@__PURE__*/ new Vector3();\n\nconst _intersectionPoint = /*@__PURE__*/ new Vector3();\nconst _intersectionPointWorld = /*@__PURE__*/ new Vector3();\n\nclass Mesh extends Object3D {\n\n\tconstructor( geometry = new BufferGeometry(), material = new MeshBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\tthis.isMesh = true;\n\n\t\tthis.type = 'Mesh';\n\n\t\tthis.geometry = geometry;\n\t\tthis.material = material;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.morphTargetInfluences !== undefined ) {\n\n\t\t\tthis.morphTargetInfluences = source.morphTargetInfluences.slice();\n\n\t\t}\n\n\t\tif ( source.morphTargetDictionary !== undefined ) {\n\n\t\t\tthis.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary );\n\n\t\t}\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length > 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tgetVertexPosition( index, target ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst position = geometry.attributes.position;\n\t\tconst morphPosition = geometry.morphAttributes.position;\n\t\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\n\t\ttarget.fromBufferAttribute( position, index );\n\n\t\tconst morphInfluences = this.morphTargetInfluences;\n\n\t\tif ( morphPosition && morphInfluences ) {\n\n\t\t\t_morphA.set( 0, 0, 0 );\n\n\t\t\tfor ( let i = 0, il = morphPosition.length; i < il; i ++ ) {\n\n\t\t\t\tconst influence = morphInfluences[ i ];\n\t\t\t\tconst morphAttribute = morphPosition[ i ];\n\n\t\t\t\tif ( influence === 0 ) continue;\n\n\t\t\t\t_tempA.fromBufferAttribute( morphAttribute, index );\n\n\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA, influence );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA.sub( target ), influence );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\ttarget.add( _morphA );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\t\tconst matrixWorld = this.matrixWorld;\n\n\t\tif ( material === undefined ) return;\n\n\t\t// test with bounding sphere in world space\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere$6.copy( geometry.boundingSphere );\n\t\t_sphere$6.applyMatrix4( matrixWorld );\n\n\t\t// check distance from ray origin to bounding sphere\n\n\t\t_ray$3.copy( raycaster.ray ).recast( raycaster.near );\n\n\t\tif ( _sphere$6.containsPoint( _ray$3.origin ) === false ) {\n\n\t\t\tif ( _ray$3.intersectSphere( _sphere$6, _sphereHitAt ) === null ) return;\n\n\t\t\tif ( _ray$3.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;\n\n\t\t}\n\n\t\t// convert ray to local space of mesh\n\n\t\t_inverseMatrix$3.copy( matrixWorld ).invert();\n\t\t_ray$3.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$3 );\n\n\t\t// test with bounding box in local space\n\n\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\tif ( _ray$3.intersectsBox( geometry.boundingBox ) === false ) return;\n\n\t\t}\n\n\t\t// test for intersections with geometry\n\n\t\tthis._computeIntersections( raycaster, intersects, _ray$3 );\n\n\t}\n\n\t_computeIntersections( raycaster, intersects, rayLocalSpace ) {\n\n\t\tlet intersection;\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\n\t\tconst index = geometry.index;\n\t\tconst position = geometry.attributes.position;\n\t\tconst uv = geometry.attributes.uv;\n\t\tconst uv1 = geometry.attributes.uv1;\n\t\tconst normal = geometry.attributes.normal;\n\t\tconst groups = geometry.groups;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\tif ( index !== null ) {\n\n\t\t\t// indexed buffer geometry\n\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( let i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\tconst end = Math.min( index.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\tfor ( let j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\tconst a = index.getX( j );\n\t\t\t\t\t\tconst b = index.getX( j + 1 );\n\t\t\t\t\t\tconst c = index.getX( j + 2 );\n\n\t\t\t\t\t\tintersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\tconst a = index.getX( i );\n\t\t\t\t\tconst b = index.getX( i + 1 );\n\t\t\t\t\tconst c = index.getX( i + 2 );\n\n\t\t\t\t\tintersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( position !== undefined ) {\n\n\t\t\t// non-indexed buffer geometry\n\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( let i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\tconst end = Math.min( position.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\tfor ( let j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\tconst a = j;\n\t\t\t\t\t\tconst b = j + 1;\n\t\t\t\t\t\tconst c = j + 2;\n\n\t\t\t\t\t\tintersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( position.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\tconst a = i;\n\t\t\t\t\tconst b = i + 1;\n\t\t\t\t\tconst c = i + 2;\n\n\t\t\t\t\tintersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction checkIntersection$1( object, material, raycaster, ray, pA, pB, pC, point ) {\n\n\tlet intersect;\n\n\tif ( material.side === BackSide ) {\n\n\t\tintersect = ray.intersectTriangle( pC, pB, pA, true, point );\n\n\t} else {\n\n\t\tintersect = ray.intersectTriangle( pA, pB, pC, ( material.side === FrontSide ), point );\n\n\t}\n\n\tif ( intersect === null ) return null;\n\n\t_intersectionPointWorld.copy( point );\n\t_intersectionPointWorld.applyMatrix4( object.matrixWorld );\n\n\tconst distance = raycaster.ray.origin.distanceTo( _intersectionPointWorld );\n\n\tif ( distance < raycaster.near || distance > raycaster.far ) return null;\n\n\treturn {\n\t\tdistance: distance,\n\t\tpoint: _intersectionPointWorld.clone(),\n\t\tobject: object\n\t};\n\n}\n\nfunction checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, normal, a, b, c ) {\n\n\tobject.getVertexPosition( a, _vA$1 );\n\tobject.getVertexPosition( b, _vB$1 );\n\tobject.getVertexPosition( c, _vC$1 );\n\n\tconst intersection = checkIntersection$1( object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint );\n\n\tif ( intersection ) {\n\n\t\tconst barycoord = new Vector3();\n\t\tTriangle.getBarycoord( _intersectionPoint, _vA$1, _vB$1, _vC$1, barycoord );\n\n\t\tif ( uv ) {\n\n\t\t\tintersection.uv = Triangle.getInterpolatedAttribute( uv, a, b, c, barycoord, new Vector2() );\n\n\t\t}\n\n\t\tif ( uv1 ) {\n\n\t\t\tintersection.uv1 = Triangle.getInterpolatedAttribute( uv1, a, b, c, barycoord, new Vector2() );\n\n\t\t}\n\n\t\tif ( normal ) {\n\n\t\t\tintersection.normal = Triangle.getInterpolatedAttribute( normal, a, b, c, barycoord, new Vector3() );\n\n\t\t\tif ( intersection.normal.dot( ray.direction ) > 0 ) {\n\n\t\t\t\tintersection.normal.multiplyScalar( - 1 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst face = {\n\t\t\ta: a,\n\t\t\tb: b,\n\t\t\tc: c,\n\t\t\tnormal: new Vector3(),\n\t\t\tmaterialIndex: 0\n\t\t};\n\n\t\tTriangle.getNormal( _vA$1, _vB$1, _vC$1, face.normal );\n\n\t\tintersection.face = face;\n\t\tintersection.barycoord = barycoord;\n\n\t}\n\n\treturn intersection;\n\n}\n\nclass BoxGeometry extends BufferGeometry {\n\n\tconstructor( width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'BoxGeometry';\n\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\tdepth: depth,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tdepthSegments: depthSegments\n\t\t};\n\n\t\tconst scope = this;\n\n\t\t// segments\n\n\t\twidthSegments = Math.floor( widthSegments );\n\t\theightSegments = Math.floor( heightSegments );\n\t\tdepthSegments = Math.floor( depthSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet numberOfVertices = 0;\n\t\tlet groupStart = 0;\n\n\t\t// build each side of the box geometry\n\n\t\tbuildPlane( 'z', 'y', 'x', - 1, - 1, depth, height, width, depthSegments, heightSegments, 0 ); // px\n\t\tbuildPlane( 'z', 'y', 'x', 1, - 1, depth, height, - width, depthSegments, heightSegments, 1 ); // nx\n\t\tbuildPlane( 'x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2 ); // py\n\t\tbuildPlane( 'x', 'z', 'y', 1, - 1, width, depth, - height, widthSegments, depthSegments, 3 ); // ny\n\t\tbuildPlane( 'x', 'y', 'z', 1, - 1, width, height, depth, widthSegments, heightSegments, 4 ); // pz\n\t\tbuildPlane( 'x', 'y', 'z', - 1, - 1, width, height, - depth, widthSegments, heightSegments, 5 ); // nz\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\tfunction buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) {\n\n\t\t\tconst segmentWidth = width / gridX;\n\t\t\tconst segmentHeight = height / gridY;\n\n\t\t\tconst widthHalf = width / 2;\n\t\t\tconst heightHalf = height / 2;\n\t\t\tconst depthHalf = depth / 2;\n\n\t\t\tconst gridX1 = gridX + 1;\n\t\t\tconst gridY1 = gridY + 1;\n\n\t\t\tlet vertexCounter = 0;\n\t\t\tlet groupCount = 0;\n\n\t\t\tconst vector = new Vector3();\n\n\t\t\t// generate vertices, normals and uvs\n\n\t\t\tfor ( let iy = 0; iy < gridY1; iy ++ ) {\n\n\t\t\t\tconst y = iy * segmentHeight - heightHalf;\n\n\t\t\t\tfor ( let ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\t\t\tconst x = ix * segmentWidth - widthHalf;\n\n\t\t\t\t\t// set values to correct vector component\n\n\t\t\t\t\tvector[ u ] = x * udir;\n\t\t\t\t\tvector[ v ] = y * vdir;\n\t\t\t\t\tvector[ w ] = depthHalf;\n\n\t\t\t\t\t// now apply vector to vertex buffer\n\n\t\t\t\t\tvertices.push( vector.x, vector.y, vector.z );\n\n\t\t\t\t\t// set values to correct vector component\n\n\t\t\t\t\tvector[ u ] = 0;\n\t\t\t\t\tvector[ v ] = 0;\n\t\t\t\t\tvector[ w ] = depth > 0 ? 1 : - 1;\n\n\t\t\t\t\t// now apply vector to normal buffer\n\n\t\t\t\t\tnormals.push( vector.x, vector.y, vector.z );\n\n\t\t\t\t\t// uvs\n\n\t\t\t\t\tuvs.push( ix / gridX );\n\t\t\t\t\tuvs.push( 1 - ( iy / gridY ) );\n\n\t\t\t\t\t// counters\n\n\t\t\t\t\tvertexCounter += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// indices\n\n\t\t\t// 1. you need three indices to draw a single face\n\t\t\t// 2. a single segment consists of two faces\n\t\t\t// 3. so we need to generate six (2*3) indices per segment\n\n\t\t\tfor ( let iy = 0; iy < gridY; iy ++ ) {\n\n\t\t\t\tfor ( let ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\t\t\tconst a = numberOfVertices + ix + gridX1 * iy;\n\t\t\t\t\tconst b = numberOfVertices + ix + gridX1 * ( iy + 1 );\n\t\t\t\t\tconst c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\t\tconst d = numberOfVertices + ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t\t// increase counter\n\n\t\t\t\t\tgroupCount += 6;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, materialIndex );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t\t// update total number of vertices\n\n\t\t\tnumberOfVertices += vertexCounter;\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new BoxGeometry( data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments );\n\n\t}\n\n}\n\n/**\n * Uniform Utilities\n */\n\nfunction cloneUniforms( src ) {\n\n\tconst dst = {};\n\n\tfor ( const u in src ) {\n\n\t\tdst[ u ] = {};\n\n\t\tfor ( const p in src[ u ] ) {\n\n\t\t\tconst property = src[ u ][ p ];\n\n\t\t\tif ( property && ( property.isColor ||\n\t\t\t\tproperty.isMatrix3 || property.isMatrix4 ||\n\t\t\t\tproperty.isVector2 || property.isVector3 || property.isVector4 ||\n\t\t\t\tproperty.isTexture || property.isQuaternion ) ) {\n\n\t\t\t\tif ( property.isRenderTargetTexture ) {\n\n\t\t\t\t\tconsole.warn( 'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().' );\n\t\t\t\t\tdst[ u ][ p ] = null;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdst[ u ][ p ] = property.clone();\n\n\t\t\t\t}\n\n\t\t\t} else if ( Array.isArray( property ) ) {\n\n\t\t\t\tdst[ u ][ p ] = property.slice();\n\n\t\t\t} else {\n\n\t\t\t\tdst[ u ][ p ] = property;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn dst;\n\n}\n\nfunction mergeUniforms( uniforms ) {\n\n\tconst merged = {};\n\n\tfor ( let u = 0; u < uniforms.length; u ++ ) {\n\n\t\tconst tmp = cloneUniforms( uniforms[ u ] );\n\n\t\tfor ( const p in tmp ) {\n\n\t\t\tmerged[ p ] = tmp[ p ];\n\n\t\t}\n\n\t}\n\n\treturn merged;\n\n}\n\nfunction cloneUniformsGroups( src ) {\n\n\tconst dst = [];\n\n\tfor ( let u = 0; u < src.length; u ++ ) {\n\n\t\tdst.push( src[ u ].clone() );\n\n\t}\n\n\treturn dst;\n\n}\n\nfunction getUnlitUniformColorSpace( renderer ) {\n\n\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\tif ( currentRenderTarget === null ) {\n\n\t\t// https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398\n\t\treturn renderer.outputColorSpace;\n\n\t}\n\n\t// https://github.com/mrdoob/three.js/issues/27868\n\tif ( currentRenderTarget.isXRRenderTarget === true ) {\n\n\t\treturn currentRenderTarget.texture.colorSpace;\n\n\t}\n\n\treturn ColorManagement.workingColorSpace;\n\n}\n\n// Legacy\n\nconst UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms };\n\nvar default_vertex = \"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\";\n\nvar default_fragment = \"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\";\n\nclass ShaderMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'ShaderMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isShaderMaterial = true;\n\n\t\tthis.defines = {};\n\t\tthis.uniforms = {};\n\t\tthis.uniformsGroups = [];\n\n\t\tthis.vertexShader = default_vertex;\n\t\tthis.fragmentShader = default_fragment;\n\n\t\tthis.linewidth = 1;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.fog = false; // set to use scene fog\n\t\tthis.lights = false; // set to use scene lights\n\t\tthis.clipping = false; // set to use user-defined clipping planes\n\n\t\tthis.forceSinglePass = true;\n\n\t\tthis.extensions = {\n\t\t\tclipCullDistance: false, // set to use vertex shader clipping\n\t\t\tmultiDraw: false // set to use vertex shader multi_draw / enable gl_DrawID\n\t\t};\n\n\t\t// When rendered geometry doesn't include these attributes but the material does,\n\t\t// use these default values in WebGL. This avoids errors when buffer data is missing.\n\t\tthis.defaultAttributeValues = {\n\t\t\t'color': [ 1, 1, 1 ],\n\t\t\t'uv': [ 0, 0 ],\n\t\t\t'uv1': [ 0, 0 ]\n\t\t};\n\n\t\tthis.index0AttributeName = undefined;\n\t\tthis.uniformsNeedUpdate = false;\n\n\t\tthis.glslVersion = null;\n\n\t\tif ( parameters !== undefined ) {\n\n\t\t\tthis.setValues( parameters );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.fragmentShader = source.fragmentShader;\n\t\tthis.vertexShader = source.vertexShader;\n\n\t\tthis.uniforms = cloneUniforms( source.uniforms );\n\t\tthis.uniformsGroups = cloneUniformsGroups( source.uniformsGroups );\n\n\t\tthis.defines = Object.assign( {}, source.defines );\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\tthis.fog = source.fog;\n\t\tthis.lights = source.lights;\n\t\tthis.clipping = source.clipping;\n\n\t\tthis.extensions = Object.assign( {}, source.extensions );\n\n\t\tthis.glslVersion = source.glslVersion;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.glslVersion = this.glslVersion;\n\t\tdata.uniforms = {};\n\n\t\tfor ( const name in this.uniforms ) {\n\n\t\t\tconst uniform = this.uniforms[ name ];\n\t\t\tconst value = uniform.value;\n\n\t\t\tif ( value && value.isTexture ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 't',\n\t\t\t\t\tvalue: value.toJSON( meta ).uuid\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isColor ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'c',\n\t\t\t\t\tvalue: value.getHex()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isVector2 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v2',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isVector3 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v3',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isVector4 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v4',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isMatrix3 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'm3',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isMatrix4 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'm4',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\tvalue: value\n\t\t\t\t};\n\n\t\t\t\t// note: the array variants v2v, v3v, v4v, m4v and tv are not supported so far\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( Object.keys( this.defines ).length > 0 ) data.defines = this.defines;\n\n\t\tdata.vertexShader = this.vertexShader;\n\t\tdata.fragmentShader = this.fragmentShader;\n\n\t\tdata.lights = this.lights;\n\t\tdata.clipping = this.clipping;\n\n\t\tconst extensions = {};\n\n\t\tfor ( const key in this.extensions ) {\n\n\t\t\tif ( this.extensions[ key ] === true ) extensions[ key ] = true;\n\n\t\t}\n\n\t\tif ( Object.keys( extensions ).length > 0 ) data.extensions = extensions;\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass Camera extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isCamera = true;\n\n\t\tthis.type = 'Camera';\n\n\t\tthis.matrixWorldInverse = new Matrix4();\n\n\t\tthis.projectionMatrix = new Matrix4();\n\t\tthis.projectionMatrixInverse = new Matrix4();\n\n\t\tthis.coordinateSystem = WebGLCoordinateSystem;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.matrixWorldInverse.copy( source.matrixWorldInverse );\n\n\t\tthis.projectionMatrix.copy( source.projectionMatrix );\n\t\tthis.projectionMatrixInverse.copy( source.projectionMatrixInverse );\n\n\t\tthis.coordinateSystem = source.coordinateSystem;\n\n\t\treturn this;\n\n\t}\n\n\tgetWorldDirection( target ) {\n\n\t\treturn super.getWorldDirection( target ).negate();\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tthis.matrixWorldInverse.copy( this.matrixWorld ).invert();\n\n\t}\n\n\tupdateWorldMatrix( updateParents, updateChildren ) {\n\n\t\tsuper.updateWorldMatrix( updateParents, updateChildren );\n\n\t\tthis.matrixWorldInverse.copy( this.matrixWorld ).invert();\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _v3$1 = /*@__PURE__*/ new Vector3();\nconst _minTarget = /*@__PURE__*/ new Vector2();\nconst _maxTarget = /*@__PURE__*/ new Vector2();\n\n\nclass PerspectiveCamera extends Camera {\n\n\tconstructor( fov = 50, aspect = 1, near = 0.1, far = 2000 ) {\n\n\t\tsuper();\n\n\t\tthis.isPerspectiveCamera = true;\n\n\t\tthis.type = 'PerspectiveCamera';\n\n\t\tthis.fov = fov;\n\t\tthis.zoom = 1;\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\t\tthis.focus = 10;\n\n\t\tthis.aspect = aspect;\n\t\tthis.view = null;\n\n\t\tthis.filmGauge = 35;\t// width of the film (default in millimeters)\n\t\tthis.filmOffset = 0;\t// horizontal film offset (same unit as gauge)\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.fov = source.fov;\n\t\tthis.zoom = source.zoom;\n\n\t\tthis.near = source.near;\n\t\tthis.far = source.far;\n\t\tthis.focus = source.focus;\n\n\t\tthis.aspect = source.aspect;\n\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\tthis.filmGauge = source.filmGauge;\n\t\tthis.filmOffset = source.filmOffset;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the FOV by focal length in respect to the current .filmGauge.\n\t *\n\t * The default film gauge is 35, so that the focal length can be specified for\n\t * a 35mm (full frame) camera.\n\t *\n\t * Values for focal length and film gauge must have the same unit.\n\t */\n\tsetFocalLength( focalLength ) {\n\n\t\t/** see {@link http://www.bobatkins.com/photography/technical/field_of_view.html} */\n\t\tconst vExtentSlope = 0.5 * this.getFilmHeight() / focalLength;\n\n\t\tthis.fov = RAD2DEG * 2 * Math.atan( vExtentSlope );\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Calculates the focal length from the current .fov and .filmGauge.\n\t */\n\tgetFocalLength() {\n\n\t\tconst vExtentSlope = Math.tan( DEG2RAD * 0.5 * this.fov );\n\n\t\treturn 0.5 * this.getFilmHeight() / vExtentSlope;\n\n\t}\n\n\tgetEffectiveFOV() {\n\n\t\treturn RAD2DEG * 2 * Math.atan(\n\t\t\tMath.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom );\n\n\t}\n\n\tgetFilmWidth() {\n\n\t\t// film not completely covered in portrait format (aspect < 1)\n\t\treturn this.filmGauge * Math.min( this.aspect, 1 );\n\n\t}\n\n\tgetFilmHeight() {\n\n\t\t// film not completely covered in landscape format (aspect > 1)\n\t\treturn this.filmGauge / Math.max( this.aspect, 1 );\n\n\t}\n\n\t/**\n\t * Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction.\n\t * Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle.\n\t */\n\tgetViewBounds( distance, minTarget, maxTarget ) {\n\n\t\t_v3$1.set( - 1, - 1, 0.5 ).applyMatrix4( this.projectionMatrixInverse );\n\n\t\tminTarget.set( _v3$1.x, _v3$1.y ).multiplyScalar( - distance / _v3$1.z );\n\n\t\t_v3$1.set( 1, 1, 0.5 ).applyMatrix4( this.projectionMatrixInverse );\n\n\t\tmaxTarget.set( _v3$1.x, _v3$1.y ).multiplyScalar( - distance / _v3$1.z );\n\n\t}\n\n\t/**\n\t * Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.\n\t * Copies the result into the target Vector2, where x is width and y is height.\n\t */\n\tgetViewSize( distance, target ) {\n\n\t\tthis.getViewBounds( distance, _minTarget, _maxTarget );\n\n\t\treturn target.subVectors( _maxTarget, _minTarget );\n\n\t}\n\n\t/**\n\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t * multi-monitor/multi-machine setups.\n\t *\n\t * For example, if you have 3x2 monitors and each monitor is 1920x1080 and\n\t * the monitors are in grid like this\n\t *\n\t * +---+---+---+\n\t * | A | B | C |\n\t * +---+---+---+\n\t * | D | E | F |\n\t * +---+---+---+\n\t *\n\t * then for each monitor you would call it like this\n\t *\n\t * const w = 1920;\n\t * const h = 1080;\n\t * const fullWidth = w * 3;\n\t * const fullHeight = h * 2;\n\t *\n\t * --A--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );\n\t * --B--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );\n\t * --C--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );\n\t * --D--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );\n\t * --E--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );\n\t * --F--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );\n\t *\n\t * Note there is no reason monitors have to be the same size or in a grid.\n\t */\n\tsetViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\tthis.aspect = fullWidth / fullHeight;\n\n\t\tif ( this.view === null ) {\n\n\t\t\tthis.view = {\n\t\t\t\tenabled: true,\n\t\t\t\tfullWidth: 1,\n\t\t\t\tfullHeight: 1,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t\twidth: 1,\n\t\t\t\theight: 1\n\t\t\t};\n\n\t\t}\n\n\t\tthis.view.enabled = true;\n\t\tthis.view.fullWidth = fullWidth;\n\t\tthis.view.fullHeight = fullHeight;\n\t\tthis.view.offsetX = x;\n\t\tthis.view.offsetY = y;\n\t\tthis.view.width = width;\n\t\tthis.view.height = height;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tclearViewOffset() {\n\n\t\tif ( this.view !== null ) {\n\n\t\t\tthis.view.enabled = false;\n\n\t\t}\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tupdateProjectionMatrix() {\n\n\t\tconst near = this.near;\n\t\tlet top = near * Math.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom;\n\t\tlet height = 2 * top;\n\t\tlet width = this.aspect * height;\n\t\tlet left = - 0.5 * width;\n\t\tconst view = this.view;\n\n\t\tif ( this.view !== null && this.view.enabled ) {\n\n\t\t\tconst fullWidth = view.fullWidth,\n\t\t\t\tfullHeight = view.fullHeight;\n\n\t\t\tleft += view.offsetX * width / fullWidth;\n\t\t\ttop -= view.offsetY * height / fullHeight;\n\t\t\twidth *= view.width / fullWidth;\n\t\t\theight *= view.height / fullHeight;\n\n\t\t}\n\n\t\tconst skew = this.filmOffset;\n\t\tif ( skew !== 0 ) left += near * skew / this.getFilmWidth();\n\n\t\tthis.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem );\n\n\t\tthis.projectionMatrixInverse.copy( this.projectionMatrix ).invert();\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.fov = this.fov;\n\t\tdata.object.zoom = this.zoom;\n\n\t\tdata.object.near = this.near;\n\t\tdata.object.far = this.far;\n\t\tdata.object.focus = this.focus;\n\n\t\tdata.object.aspect = this.aspect;\n\n\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\tdata.object.filmGauge = this.filmGauge;\n\t\tdata.object.filmOffset = this.filmOffset;\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst fov = - 90; // negative fov is not an error\nconst aspect = 1;\n\nclass CubeCamera extends Object3D {\n\n\tconstructor( near, far, renderTarget ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CubeCamera';\n\n\t\tthis.renderTarget = renderTarget;\n\t\tthis.coordinateSystem = null;\n\t\tthis.activeMipmapLevel = 0;\n\n\t\tconst cameraPX = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPX.layers = this.layers;\n\t\tthis.add( cameraPX );\n\n\t\tconst cameraNX = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNX.layers = this.layers;\n\t\tthis.add( cameraNX );\n\n\t\tconst cameraPY = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPY.layers = this.layers;\n\t\tthis.add( cameraPY );\n\n\t\tconst cameraNY = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNY.layers = this.layers;\n\t\tthis.add( cameraNY );\n\n\t\tconst cameraPZ = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPZ.layers = this.layers;\n\t\tthis.add( cameraPZ );\n\n\t\tconst cameraNZ = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNZ.layers = this.layers;\n\t\tthis.add( cameraNZ );\n\n\t}\n\n\tupdateCoordinateSystem() {\n\n\t\tconst coordinateSystem = this.coordinateSystem;\n\n\t\tconst cameras = this.children.concat();\n\n\t\tconst [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = cameras;\n\n\t\tfor ( const camera of cameras ) this.remove( camera );\n\n\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\tcameraPX.up.set( 0, 1, 0 );\n\t\t\tcameraPX.lookAt( 1, 0, 0 );\n\n\t\t\tcameraNX.up.set( 0, 1, 0 );\n\t\t\tcameraNX.lookAt( - 1, 0, 0 );\n\n\t\t\tcameraPY.up.set( 0, 0, - 1 );\n\t\t\tcameraPY.lookAt( 0, 1, 0 );\n\n\t\t\tcameraNY.up.set( 0, 0, 1 );\n\t\t\tcameraNY.lookAt( 0, - 1, 0 );\n\n\t\t\tcameraPZ.up.set( 0, 1, 0 );\n\t\t\tcameraPZ.lookAt( 0, 0, 1 );\n\n\t\t\tcameraNZ.up.set( 0, 1, 0 );\n\t\t\tcameraNZ.lookAt( 0, 0, - 1 );\n\n\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\tcameraPX.up.set( 0, - 1, 0 );\n\t\t\tcameraPX.lookAt( - 1, 0, 0 );\n\n\t\t\tcameraNX.up.set( 0, - 1, 0 );\n\t\t\tcameraNX.lookAt( 1, 0, 0 );\n\n\t\t\tcameraPY.up.set( 0, 0, 1 );\n\t\t\tcameraPY.lookAt( 0, 1, 0 );\n\n\t\t\tcameraNY.up.set( 0, 0, - 1 );\n\t\t\tcameraNY.lookAt( 0, - 1, 0 );\n\n\t\t\tcameraPZ.up.set( 0, - 1, 0 );\n\t\t\tcameraPZ.lookAt( 0, 0, 1 );\n\n\t\t\tcameraNZ.up.set( 0, - 1, 0 );\n\t\t\tcameraNZ.lookAt( 0, 0, - 1 );\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t}\n\n\t\tfor ( const camera of cameras ) {\n\n\t\t\tthis.add( camera );\n\n\t\t\tcamera.updateMatrixWorld();\n\n\t\t}\n\n\t}\n\n\tupdate( renderer, scene ) {\n\n\t\tif ( this.parent === null ) this.updateMatrixWorld();\n\n\t\tconst { renderTarget, activeMipmapLevel } = this;\n\n\t\tif ( this.coordinateSystem !== renderer.coordinateSystem ) {\n\n\t\t\tthis.coordinateSystem = renderer.coordinateSystem;\n\n\t\t\tthis.updateCoordinateSystem();\n\n\t\t}\n\n\t\tconst [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children;\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\tconst currentActiveCubeFace = renderer.getActiveCubeFace();\n\t\tconst currentActiveMipmapLevel = renderer.getActiveMipmapLevel();\n\n\t\tconst currentXrEnabled = renderer.xr.enabled;\n\n\t\trenderer.xr.enabled = false;\n\n\t\tconst generateMipmaps = renderTarget.texture.generateMipmaps;\n\n\t\trenderTarget.texture.generateMipmaps = false;\n\n\t\trenderer.setRenderTarget( renderTarget, 0, activeMipmapLevel );\n\t\trenderer.render( scene, cameraPX );\n\n\t\trenderer.setRenderTarget( renderTarget, 1, activeMipmapLevel );\n\t\trenderer.render( scene, cameraNX );\n\n\t\trenderer.setRenderTarget( renderTarget, 2, activeMipmapLevel );\n\t\trenderer.render( scene, cameraPY );\n\n\t\trenderer.setRenderTarget( renderTarget, 3, activeMipmapLevel );\n\t\trenderer.render( scene, cameraNY );\n\n\t\trenderer.setRenderTarget( renderTarget, 4, activeMipmapLevel );\n\t\trenderer.render( scene, cameraPZ );\n\n\t\t// mipmaps are generated during the last call of render()\n\t\t// at this point, all sides of the cube render target are defined\n\n\t\trenderTarget.texture.generateMipmaps = generateMipmaps;\n\n\t\trenderer.setRenderTarget( renderTarget, 5, activeMipmapLevel );\n\t\trenderer.render( scene, cameraNZ );\n\n\t\trenderer.setRenderTarget( currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel );\n\n\t\trenderer.xr.enabled = currentXrEnabled;\n\n\t\trenderTarget.texture.needsPMREMUpdate = true;\n\n\t}\n\n}\n\nclass CubeTexture extends Texture {\n\n\tconstructor( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace ) {\n\n\t\timages = images !== undefined ? images : [];\n\t\tmapping = mapping !== undefined ? mapping : CubeReflectionMapping;\n\n\t\tsuper( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );\n\n\t\tthis.isCubeTexture = true;\n\n\t\tthis.flipY = false;\n\n\t}\n\n\tget images() {\n\n\t\treturn this.image;\n\n\t}\n\n\tset images( value ) {\n\n\t\tthis.image = value;\n\n\t}\n\n}\n\nclass WebGLCubeRenderTarget extends WebGLRenderTarget {\n\n\tconstructor( size = 1, options = {} ) {\n\n\t\tsuper( size, size, options );\n\n\t\tthis.isWebGLCubeRenderTarget = true;\n\n\t\tconst image = { width: size, height: size, depth: 1 };\n\t\tconst images = [ image, image, image, image, image, image ];\n\n\t\tthis.texture = new CubeTexture( images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );\n\n\t\t// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)\n\t\t// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,\n\t\t// in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.\n\n\t\t// three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped\n\t\t// and the flag isRenderTargetTexture controls this conversion. The flip is not required when using WebGLCubeRenderTarget.texture\n\t\t// as a cube texture (this is detected when isRenderTargetTexture is set to true for cube textures).\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t\tthis.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;\n\t\tthis.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;\n\n\t}\n\n\tfromEquirectangularTexture( renderer, texture ) {\n\n\t\tthis.texture.type = texture.type;\n\t\tthis.texture.colorSpace = texture.colorSpace;\n\n\t\tthis.texture.generateMipmaps = texture.generateMipmaps;\n\t\tthis.texture.minFilter = texture.minFilter;\n\t\tthis.texture.magFilter = texture.magFilter;\n\n\t\tconst shader = {\n\n\t\t\tuniforms: {\n\t\t\t\ttEquirect: { value: null },\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t`,\n\n\t\t\tfragmentShader: /* glsl */`\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t`\n\t\t};\n\n\t\tconst geometry = new BoxGeometry( 5, 5, 5 );\n\n\t\tconst material = new ShaderMaterial( {\n\n\t\t\tname: 'CubemapFromEquirect',\n\n\t\t\tuniforms: cloneUniforms( shader.uniforms ),\n\t\t\tvertexShader: shader.vertexShader,\n\t\t\tfragmentShader: shader.fragmentShader,\n\t\t\tside: BackSide,\n\t\t\tblending: NoBlending\n\n\t\t} );\n\n\t\tmaterial.uniforms.tEquirect.value = texture;\n\n\t\tconst mesh = new Mesh( geometry, material );\n\n\t\tconst currentMinFilter = texture.minFilter;\n\n\t\t// Avoid blurred poles\n\t\tif ( texture.minFilter === LinearMipmapLinearFilter ) texture.minFilter = LinearFilter;\n\n\t\tconst camera = new CubeCamera( 1, 10, this );\n\t\tcamera.update( renderer, mesh );\n\n\t\ttexture.minFilter = currentMinFilter;\n\n\t\tmesh.geometry.dispose();\n\t\tmesh.material.dispose();\n\n\t\treturn this;\n\n\t}\n\n\tclear( renderer, color, depth, stencil ) {\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\trenderer.setRenderTarget( this, i );\n\n\t\t\trenderer.clear( color, depth, stencil );\n\n\t\t}\n\n\t\trenderer.setRenderTarget( currentRenderTarget );\n\n\t}\n\n}\n\nconst _vector1 = /*@__PURE__*/ new Vector3();\nconst _vector2 = /*@__PURE__*/ new Vector3();\nconst _normalMatrix = /*@__PURE__*/ new Matrix3();\n\nclass Plane {\n\n\tconstructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) {\n\n\t\tthis.isPlane = true;\n\n\t\t// normal is assumed to be normalized\n\n\t\tthis.normal = normal;\n\t\tthis.constant = constant;\n\n\t}\n\n\tset( normal, constant ) {\n\n\t\tthis.normal.copy( normal );\n\t\tthis.constant = constant;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponents( x, y, z, w ) {\n\n\t\tthis.normal.set( x, y, z );\n\t\tthis.constant = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromNormalAndCoplanarPoint( normal, point ) {\n\n\t\tthis.normal.copy( normal );\n\t\tthis.constant = - point.dot( this.normal );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCoplanarPoints( a, b, c ) {\n\n\t\tconst normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize();\n\n\t\t// Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\t\tthis.setFromNormalAndCoplanarPoint( normal, a );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( plane ) {\n\n\t\tthis.normal.copy( plane.normal );\n\t\tthis.constant = plane.constant;\n\n\t\treturn this;\n\n\t}\n\n\tnormalize() {\n\n\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\n\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\tthis.normal.multiplyScalar( inverseNormalLength );\n\t\tthis.constant *= inverseNormalLength;\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.constant *= - 1;\n\t\tthis.normal.negate();\n\n\t\treturn this;\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn this.normal.dot( point ) + this.constant;\n\n\t}\n\n\tdistanceToSphere( sphere ) {\n\n\t\treturn this.distanceToPoint( sphere.center ) - sphere.radius;\n\n\t}\n\n\tprojectPoint( point, target ) {\n\n\t\treturn target.copy( point ).addScaledVector( this.normal, - this.distanceToPoint( point ) );\n\n\t}\n\n\tintersectLine( line, target ) {\n\n\t\tconst direction = line.delta( _vector1 );\n\n\t\tconst denominator = this.normal.dot( direction );\n\n\t\tif ( denominator === 0 ) {\n\n\t\t\t// line is coplanar, return origin\n\t\t\tif ( this.distanceToPoint( line.start ) === 0 ) {\n\n\t\t\t\treturn target.copy( line.start );\n\n\t\t\t}\n\n\t\t\t// Unsure if this is the correct method to handle this case.\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;\n\n\t\tif ( t < 0 || t > 1 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn target.copy( line.start ).addScaledVector( direction, t );\n\n\t}\n\n\tintersectsLine( line ) {\n\n\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\n\t\tconst startSign = this.distanceToPoint( line.start );\n\t\tconst endSign = this.distanceToPoint( line.end );\n\n\t\treturn ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsPlane( this );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\treturn sphere.intersectsPlane( this );\n\n\t}\n\n\tcoplanarPoint( target ) {\n\n\t\treturn target.copy( this.normal ).multiplyScalar( - this.constant );\n\n\t}\n\n\tapplyMatrix4( matrix, optionalNormalMatrix ) {\n\n\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix );\n\n\t\tconst referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix );\n\n\t\tconst normal = this.normal.applyMatrix3( normalMatrix ).normalize();\n\n\t\tthis.constant = - referencePoint.dot( normal );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.constant -= offset.dot( this.normal );\n\n\t\treturn this;\n\n\t}\n\n\tequals( plane ) {\n\n\t\treturn plane.normal.equals( this.normal ) && ( plane.constant === this.constant );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _sphere$5 = /*@__PURE__*/ new Sphere();\nconst _vector$7 = /*@__PURE__*/ new Vector3();\n\nclass Frustum {\n\n\tconstructor( p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane() ) {\n\n\t\tthis.planes = [ p0, p1, p2, p3, p4, p5 ];\n\n\t}\n\n\tset( p0, p1, p2, p3, p4, p5 ) {\n\n\t\tconst planes = this.planes;\n\n\t\tplanes[ 0 ].copy( p0 );\n\t\tplanes[ 1 ].copy( p1 );\n\t\tplanes[ 2 ].copy( p2 );\n\t\tplanes[ 3 ].copy( p3 );\n\t\tplanes[ 4 ].copy( p4 );\n\t\tplanes[ 5 ].copy( p5 );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( frustum ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tplanes[ i ].copy( frustum.planes[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem ) {\n\n\t\tconst planes = this.planes;\n\t\tconst me = m.elements;\n\t\tconst me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ];\n\t\tconst me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ];\n\t\tconst me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ];\n\t\tconst me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ];\n\n\t\tplanes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize();\n\t\tplanes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize();\n\t\tplanes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize();\n\t\tplanes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize();\n\t\tplanes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize();\n\n\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\tplanes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize();\n\n\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\tplanes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize();\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tintersectsObject( object ) {\n\n\t\tif ( object.boundingSphere !== undefined ) {\n\n\t\t\tif ( object.boundingSphere === null ) object.computeBoundingSphere();\n\n\t\t\t_sphere$5.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );\n\n\t\t} else {\n\n\t\t\tconst geometry = object.geometry;\n\n\t\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t\t_sphere$5.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );\n\n\t\t}\n\n\t\treturn this.intersectsSphere( _sphere$5 );\n\n\t}\n\n\tintersectsSprite( sprite ) {\n\n\t\t_sphere$5.center.set( 0, 0, 0 );\n\t\t_sphere$5.radius = 0.7071067811865476;\n\t\t_sphere$5.applyMatrix4( sprite.matrixWorld );\n\n\t\treturn this.intersectsSphere( _sphere$5 );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\tconst planes = this.planes;\n\t\tconst center = sphere.center;\n\t\tconst negRadius = - sphere.radius;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst distance = planes[ i ].distanceToPoint( center );\n\n\t\t\tif ( distance < negRadius ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst plane = planes[ i ];\n\n\t\t\t// corner at max distance\n\n\t\t\t_vector$7.x = plane.normal.x > 0 ? box.max.x : box.min.x;\n\t\t\t_vector$7.y = plane.normal.y > 0 ? box.max.y : box.min.y;\n\t\t\t_vector$7.z = plane.normal.z > 0 ? box.max.z : box.min.z;\n\n\t\t\tif ( plane.distanceToPoint( _vector$7 ) < 0 ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tif ( planes[ i ].distanceToPoint( point ) < 0 ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nfunction WebGLAnimation() {\n\n\tlet context = null;\n\tlet isAnimating = false;\n\tlet animationLoop = null;\n\tlet requestId = null;\n\n\tfunction onAnimationFrame( time, frame ) {\n\n\t\tanimationLoop( time, frame );\n\n\t\trequestId = context.requestAnimationFrame( onAnimationFrame );\n\n\t}\n\n\treturn {\n\n\t\tstart: function () {\n\n\t\t\tif ( isAnimating === true ) return;\n\t\t\tif ( animationLoop === null ) return;\n\n\t\t\trequestId = context.requestAnimationFrame( onAnimationFrame );\n\n\t\t\tisAnimating = true;\n\n\t\t},\n\n\t\tstop: function () {\n\n\t\t\tcontext.cancelAnimationFrame( requestId );\n\n\t\t\tisAnimating = false;\n\n\t\t},\n\n\t\tsetAnimationLoop: function ( callback ) {\n\n\t\t\tanimationLoop = callback;\n\n\t\t},\n\n\t\tsetContext: function ( value ) {\n\n\t\t\tcontext = value;\n\n\t\t}\n\n\t};\n\n}\n\nfunction WebGLAttributes( gl ) {\n\n\tconst buffers = new WeakMap();\n\n\tfunction createBuffer( attribute, bufferType ) {\n\n\t\tconst array = attribute.array;\n\t\tconst usage = attribute.usage;\n\t\tconst size = array.byteLength;\n\n\t\tconst buffer = gl.createBuffer();\n\n\t\tgl.bindBuffer( bufferType, buffer );\n\t\tgl.bufferData( bufferType, array, usage );\n\n\t\tattribute.onUploadCallback();\n\n\t\tlet type;\n\n\t\tif ( array instanceof Float32Array ) {\n\n\t\t\ttype = gl.FLOAT;\n\n\t\t} else if ( array instanceof Uint16Array ) {\n\n\t\t\tif ( attribute.isFloat16BufferAttribute ) {\n\n\t\t\t\ttype = gl.HALF_FLOAT;\n\n\t\t\t} else {\n\n\t\t\t\ttype = gl.UNSIGNED_SHORT;\n\n\t\t\t}\n\n\t\t} else if ( array instanceof Int16Array ) {\n\n\t\t\ttype = gl.SHORT;\n\n\t\t} else if ( array instanceof Uint32Array ) {\n\n\t\t\ttype = gl.UNSIGNED_INT;\n\n\t\t} else if ( array instanceof Int32Array ) {\n\n\t\t\ttype = gl.INT;\n\n\t\t} else if ( array instanceof Int8Array ) {\n\n\t\t\ttype = gl.BYTE;\n\n\t\t} else if ( array instanceof Uint8Array ) {\n\n\t\t\ttype = gl.UNSIGNED_BYTE;\n\n\t\t} else if ( array instanceof Uint8ClampedArray ) {\n\n\t\t\ttype = gl.UNSIGNED_BYTE;\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.WebGLAttributes: Unsupported buffer data format: ' + array );\n\n\t\t}\n\n\t\treturn {\n\t\t\tbuffer: buffer,\n\t\t\ttype: type,\n\t\t\tbytesPerElement: array.BYTES_PER_ELEMENT,\n\t\t\tversion: attribute.version,\n\t\t\tsize: size\n\t\t};\n\n\t}\n\n\tfunction updateBuffer( buffer, attribute, bufferType ) {\n\n\t\tconst array = attribute.array;\n\t\tconst updateRanges = attribute.updateRanges;\n\n\t\tgl.bindBuffer( bufferType, buffer );\n\n\t\tif ( updateRanges.length === 0 ) {\n\n\t\t\t// Not using update ranges\n\t\t\tgl.bufferSubData( bufferType, 0, array );\n\n\t\t} else {\n\n\t\t\t// Before applying update ranges, we merge any adjacent / overlapping\n\t\t\t// ranges to reduce load on `gl.bufferSubData`. Empirically, this has led\n\t\t\t// to performance improvements for applications which make heavy use of\n\t\t\t// update ranges. Likely due to GPU command overhead.\n\t\t\t//\n\t\t\t// Note that to reduce garbage collection between frames, we merge the\n\t\t\t// update ranges in-place. This is safe because this method will clear the\n\t\t\t// update ranges once updated.\n\n\t\t\tupdateRanges.sort( ( a, b ) => a.start - b.start );\n\n\t\t\t// To merge the update ranges in-place, we work from left to right in the\n\t\t\t// existing updateRanges array, merging ranges. This may result in a final\n\t\t\t// array which is smaller than the original. This index tracks the last\n\t\t\t// index representing a merged range, any data after this index can be\n\t\t\t// trimmed once the merge algorithm is completed.\n\t\t\tlet mergeIndex = 0;\n\n\t\t\tfor ( let i = 1; i < updateRanges.length; i ++ ) {\n\n\t\t\t\tconst previousRange = updateRanges[ mergeIndex ];\n\t\t\t\tconst range = updateRanges[ i ];\n\n\t\t\t\t// We add one here to merge adjacent ranges. This is safe because ranges\n\t\t\t\t// operate over positive integers.\n\t\t\t\tif ( range.start <= previousRange.start + previousRange.count + 1 ) {\n\n\t\t\t\t\tpreviousRange.count = Math.max(\n\t\t\t\t\t\tpreviousRange.count,\n\t\t\t\t\t\trange.start + range.count - previousRange.start\n\t\t\t\t\t);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t++ mergeIndex;\n\t\t\t\t\tupdateRanges[ mergeIndex ] = range;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Trim the array to only contain the merged ranges.\n\t\t\tupdateRanges.length = mergeIndex + 1;\n\n\t\t\tfor ( let i = 0, l = updateRanges.length; i < l; i ++ ) {\n\n\t\t\t\tconst range = updateRanges[ i ];\n\n\t\t\t\tgl.bufferSubData( bufferType, range.start * array.BYTES_PER_ELEMENT,\n\t\t\t\t\tarray, range.start, range.count );\n\n\t\t\t}\n\n\t\t\tattribute.clearUpdateRanges();\n\n\t\t}\n\n\t\tattribute.onUploadCallback();\n\n\t}\n\n\t//\n\n\tfunction get( attribute ) {\n\n\t\tif ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;\n\n\t\treturn buffers.get( attribute );\n\n\t}\n\n\tfunction remove( attribute ) {\n\n\t\tif ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;\n\n\t\tconst data = buffers.get( attribute );\n\n\t\tif ( data ) {\n\n\t\t\tgl.deleteBuffer( data.buffer );\n\n\t\t\tbuffers.delete( attribute );\n\n\t\t}\n\n\t}\n\n\tfunction update( attribute, bufferType ) {\n\n\t\tif ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;\n\n\t\tif ( attribute.isGLBufferAttribute ) {\n\n\t\t\tconst cached = buffers.get( attribute );\n\n\t\t\tif ( ! cached || cached.version < attribute.version ) {\n\n\t\t\t\tbuffers.set( attribute, {\n\t\t\t\t\tbuffer: attribute.buffer,\n\t\t\t\t\ttype: attribute.type,\n\t\t\t\t\tbytesPerElement: attribute.elementSize,\n\t\t\t\t\tversion: attribute.version\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst data = buffers.get( attribute );\n\n\t\tif ( data === undefined ) {\n\n\t\t\tbuffers.set( attribute, createBuffer( attribute, bufferType ) );\n\n\t\t} else if ( data.version < attribute.version ) {\n\n\t\t\tif ( data.size !== attribute.array.byteLength ) {\n\n\t\t\t\tthrow new Error( 'THREE.WebGLAttributes: The size of the buffer attribute\\'s array buffer does not match the original size. Resizing buffer attributes is not supported.' );\n\n\t\t\t}\n\n\t\t\tupdateBuffer( data.buffer, attribute, bufferType );\n\n\t\t\tdata.version = attribute.version;\n\n\t\t}\n\n\t}\n\n\treturn {\n\n\t\tget: get,\n\t\tremove: remove,\n\t\tupdate: update\n\n\t};\n\n}\n\nclass PlaneGeometry extends BufferGeometry {\n\n\tconstructor( width = 1, height = 1, widthSegments = 1, heightSegments = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'PlaneGeometry';\n\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments\n\t\t};\n\n\t\tconst width_half = width / 2;\n\t\tconst height_half = height / 2;\n\n\t\tconst gridX = Math.floor( widthSegments );\n\t\tconst gridY = Math.floor( heightSegments );\n\n\t\tconst gridX1 = gridX + 1;\n\t\tconst gridY1 = gridY + 1;\n\n\t\tconst segment_width = width / gridX;\n\t\tconst segment_height = height / gridY;\n\n\t\t//\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\tfor ( let iy = 0; iy < gridY1; iy ++ ) {\n\n\t\t\tconst y = iy * segment_height - height_half;\n\n\t\t\tfor ( let ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\t\tconst x = ix * segment_width - width_half;\n\n\t\t\t\tvertices.push( x, - y, 0 );\n\n\t\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t\tuvs.push( ix / gridX );\n\t\t\t\tuvs.push( 1 - ( iy / gridY ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( let iy = 0; iy < gridY; iy ++ ) {\n\n\t\t\tfor ( let ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\t\tconst a = ix + gridX1 * iy;\n\t\t\t\tconst b = ix + gridX1 * ( iy + 1 );\n\t\t\t\tconst c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\tconst d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new PlaneGeometry( data.width, data.height, data.widthSegments, data.heightSegments );\n\n\t}\n\n}\n\nvar alphahash_fragment = \"#ifdef USE_ALPHAHASH\\n\\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\\n#endif\";\n\nvar alphahash_pars_fragment = \"#ifdef USE_ALPHAHASH\\n\\tconst float ALPHA_HASH_SCALE = 0.05;\\n\\tfloat hash2D( vec2 value ) {\\n\\t\\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\\n\\t}\\n\\tfloat hash3D( vec3 value ) {\\n\\t\\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\\n\\t}\\n\\tfloat getAlphaHashThreshold( vec3 position ) {\\n\\t\\tfloat maxDeriv = max(\\n\\t\\t\\tlength( dFdx( position.xyz ) ),\\n\\t\\t\\tlength( dFdy( position.xyz ) )\\n\\t\\t);\\n\\t\\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\\n\\t\\tvec2 pixScales = vec2(\\n\\t\\t\\texp2( floor( log2( pixScale ) ) ),\\n\\t\\t\\texp2( ceil( log2( pixScale ) ) )\\n\\t\\t);\\n\\t\\tvec2 alpha = vec2(\\n\\t\\t\\thash3D( floor( pixScales.x * position.xyz ) ),\\n\\t\\t\\thash3D( floor( pixScales.y * position.xyz ) )\\n\\t\\t);\\n\\t\\tfloat lerpFactor = fract( log2( pixScale ) );\\n\\t\\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\\n\\t\\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\\n\\t\\tvec3 cases = vec3(\\n\\t\\t\\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\\n\\t\\t\\t( x - 0.5 * a ) / ( 1.0 - a ),\\n\\t\\t\\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\\n\\t\\t);\\n\\t\\tfloat threshold = ( x < ( 1.0 - a ) )\\n\\t\\t\\t? ( ( x < a ) ? cases.x : cases.y )\\n\\t\\t\\t: cases.z;\\n\\t\\treturn clamp( threshold , 1.0e-6, 1.0 );\\n\\t}\\n#endif\";\n\nvar alphamap_fragment = \"#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\\n#endif\";\n\nvar alphamap_pars_fragment = \"#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";\n\nvar alphatest_fragment = \"#ifdef USE_ALPHATEST\\n\\t#ifdef ALPHA_TO_COVERAGE\\n\\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\\n\\tif ( diffuseColor.a == 0.0 ) discard;\\n\\t#else\\n\\tif ( diffuseColor.a < alphaTest ) discard;\\n\\t#endif\\n#endif\";\n\nvar alphatest_pars_fragment = \"#ifdef USE_ALPHATEST\\n\\tuniform float alphaTest;\\n#endif\";\n\nvar aomap_fragment = \"#ifdef USE_AOMAP\\n\\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\\n\\treflectedLight.indirectDiffuse *= ambientOcclusion;\\n\\t#if defined( USE_CLEARCOAT ) \\n\\t\\tclearcoatSpecularIndirect *= ambientOcclusion;\\n\\t#endif\\n\\t#if defined( USE_SHEEN ) \\n\\t\\tsheenSpecularIndirect *= ambientOcclusion;\\n\\t#endif\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD )\\n\\t\\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\\n\\t\\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\\n\\t#endif\\n#endif\";\n\nvar aomap_pars_fragment = \"#ifdef USE_AOMAP\\n\\tuniform sampler2D aoMap;\\n\\tuniform float aoMapIntensity;\\n#endif\";\n\nvar batching_pars_vertex = \"#ifdef USE_BATCHING\\n\\t#if ! defined( GL_ANGLE_multi_draw )\\n\\t#define gl_DrawID _gl_DrawID\\n\\tuniform int _gl_DrawID;\\n\\t#endif\\n\\tuniform highp sampler2D batchingTexture;\\n\\tuniform highp usampler2D batchingIdTexture;\\n\\tmat4 getBatchingMatrix( const in float i ) {\\n\\t\\tint size = textureSize( batchingTexture, 0 ).x;\\n\\t\\tint j = int( i ) * 4;\\n\\t\\tint x = j % size;\\n\\t\\tint y = j / size;\\n\\t\\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\\n\\t\\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\\n\\t\\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\\n\\t\\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\\n\\t\\treturn mat4( v1, v2, v3, v4 );\\n\\t}\\n\\tfloat getIndirectIndex( const in int i ) {\\n\\t\\tint size = textureSize( batchingIdTexture, 0 ).x;\\n\\t\\tint x = i % size;\\n\\t\\tint y = i / size;\\n\\t\\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\\n\\t}\\n#endif\\n#ifdef USE_BATCHING_COLOR\\n\\tuniform sampler2D batchingColorTexture;\\n\\tvec3 getBatchingColor( const in float i ) {\\n\\t\\tint size = textureSize( batchingColorTexture, 0 ).x;\\n\\t\\tint j = int( i );\\n\\t\\tint x = j % size;\\n\\t\\tint y = j / size;\\n\\t\\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\\n\\t}\\n#endif\";\n\nvar batching_vertex = \"#ifdef USE_BATCHING\\n\\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\\n#endif\";\n\nvar begin_vertex = \"vec3 transformed = vec3( position );\\n#ifdef USE_ALPHAHASH\\n\\tvPosition = vec3( position );\\n#endif\";\n\nvar beginnormal_vertex = \"vec3 objectNormal = vec3( normal );\\n#ifdef USE_TANGENT\\n\\tvec3 objectTangent = vec3( tangent.xyz );\\n#endif\";\n\nvar bsdfs = \"float G_BlinnPhong_Implicit( ) {\\n\\treturn 0.25;\\n}\\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\\n\\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\\n}\\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\\n\\tfloat G = G_BlinnPhong_Implicit( );\\n\\tfloat D = D_BlinnPhong( shininess, dotNH );\\n\\treturn F * ( G * D );\\n} // validated\";\n\nvar iridescence_fragment = \"#ifdef USE_IRIDESCENCE\\n\\tconst mat3 XYZ_TO_REC709 = mat3(\\n\\t\\t 3.2404542, -0.9692660, 0.0556434,\\n\\t\\t-1.5371385, 1.8760108, -0.2040259,\\n\\t\\t-0.4985314, 0.0415560, 1.0572252\\n\\t);\\n\\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\\n\\t\\tvec3 sqrtF0 = sqrt( fresnel0 );\\n\\t\\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\\n\\t}\\n\\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\\n\\t\\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\\n\\t}\\n\\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\\n\\t\\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\\n\\t}\\n\\tvec3 evalSensitivity( float OPD, vec3 shift ) {\\n\\t\\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\\n\\t\\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\\n\\t\\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\\n\\t\\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\\n\\t\\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\\n\\t\\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\\n\\t\\txyz /= 1.0685e-7;\\n\\t\\tvec3 rgb = XYZ_TO_REC709 * xyz;\\n\\t\\treturn rgb;\\n\\t}\\n\\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\\n\\t\\tvec3 I;\\n\\t\\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\\n\\t\\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\\n\\t\\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\\n\\t\\tif ( cosTheta2Sq < 0.0 ) {\\n\\t\\t\\treturn vec3( 1.0 );\\n\\t\\t}\\n\\t\\tfloat cosTheta2 = sqrt( cosTheta2Sq );\\n\\t\\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\\n\\t\\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\\n\\t\\tfloat T121 = 1.0 - R12;\\n\\t\\tfloat phi12 = 0.0;\\n\\t\\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\\n\\t\\tfloat phi21 = PI - phi12;\\n\\t\\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\\t\\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\\n\\t\\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\\n\\t\\tvec3 phi23 = vec3( 0.0 );\\n\\t\\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\\n\\t\\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\\n\\t\\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\\n\\t\\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\\n\\t\\tvec3 phi = vec3( phi21 ) + phi23;\\n\\t\\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\\n\\t\\tvec3 r123 = sqrt( R123 );\\n\\t\\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\\n\\t\\tvec3 C0 = R12 + Rs;\\n\\t\\tI = C0;\\n\\t\\tvec3 Cm = Rs - T121;\\n\\t\\tfor ( int m = 1; m <= 2; ++ m ) {\\n\\t\\t\\tCm *= r123;\\n\\t\\t\\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\\n\\t\\t\\tI += Cm * Sm;\\n\\t\\t}\\n\\t\\treturn max( I, vec3( 0.0 ) );\\n\\t}\\n#endif\";\n\nvar bumpmap_pars_fragment = \"#ifdef USE_BUMPMAP\\n\\tuniform sampler2D bumpMap;\\n\\tuniform float bumpScale;\\n\\tvec2 dHdxy_fwd() {\\n\\t\\tvec2 dSTdx = dFdx( vBumpMapUv );\\n\\t\\tvec2 dSTdy = dFdy( vBumpMapUv );\\n\\t\\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\\n\\t\\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\\n\\t\\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\\n\\t\\treturn vec2( dBx, dBy );\\n\\t}\\n\\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\\n\\t\\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\\n\\t\\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\\n\\t\\tvec3 vN = surf_norm;\\n\\t\\tvec3 R1 = cross( vSigmaY, vN );\\n\\t\\tvec3 R2 = cross( vN, vSigmaX );\\n\\t\\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\\n\\t\\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\\n\\t\\treturn normalize( abs( fDet ) * surf_norm - vGrad );\\n\\t}\\n#endif\";\n\nvar clipping_planes_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvec4 plane;\\n\\t#ifdef ALPHA_TO_COVERAGE\\n\\t\\tfloat distanceToPlane, distanceGradient;\\n\\t\\tfloat clipOpacity = 1.0;\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\\n\\t\\t\\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\\n\\t\\t\\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\\n\\t\\t\\tif ( clipOpacity == 0.0 ) discard;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t\\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\\t\\t\\tfloat unionClipOpacity = 1.0;\\n\\t\\t\\t#pragma unroll_loop_start\\n\\t\\t\\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\t\\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\\n\\t\\t\\t\\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\\n\\t\\t\\t\\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\\n\\t\\t\\t}\\n\\t\\t\\t#pragma unroll_loop_end\\n\\t\\t\\tclipOpacity *= 1.0 - unionClipOpacity;\\n\\t\\t#endif\\n\\t\\tdiffuseColor.a *= clipOpacity;\\n\\t\\tif ( diffuseColor.a == 0.0 ) discard;\\n\\t#else\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t\\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\\t\\t\\tbool clipped = true;\\n\\t\\t\\t#pragma unroll_loop_start\\n\\t\\t\\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\t\\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\\n\\t\\t\\t}\\n\\t\\t\\t#pragma unroll_loop_end\\n\\t\\t\\tif ( clipped ) discard;\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\nvar clipping_planes_pars_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n\\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\";\n\nvar clipping_planes_pars_vertex = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n#endif\";\n\nvar clipping_planes_vertex = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvClipPosition = - mvPosition.xyz;\\n#endif\";\n\nvar color_fragment = \"#if defined( USE_COLOR_ALPHA )\\n\\tdiffuseColor *= vColor;\\n#elif defined( USE_COLOR )\\n\\tdiffuseColor.rgb *= vColor;\\n#endif\";\n\nvar color_pars_fragment = \"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";\n\nvar color_pars_vertex = \"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";\n\nvar color_vertex = \"#if defined( USE_COLOR_ALPHA )\\n\\tvColor = vec4( 1.0 );\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\\n\\tvColor = vec3( 1.0 );\\n#endif\\n#ifdef USE_COLOR\\n\\tvColor *= color;\\n#endif\\n#ifdef USE_INSTANCING_COLOR\\n\\tvColor.xyz *= instanceColor.xyz;\\n#endif\\n#ifdef USE_BATCHING_COLOR\\n\\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\\n\\tvColor.xyz *= batchingColor.xyz;\\n#endif\";\n\nvar common = \"#define PI 3.141592653589793\\n#define PI2 6.283185307179586\\n#define PI_HALF 1.5707963267948966\\n#define RECIPROCAL_PI 0.3183098861837907\\n#define RECIPROCAL_PI2 0.15915494309189535\\n#define EPSILON 1e-6\\n#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\\nfloat pow2( const in float x ) { return x*x; }\\nvec3 pow2( const in vec3 x ) { return x*x; }\\nfloat pow3( const in float x ) { return x*x*x; }\\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\\nhighp float rand( const in vec2 uv ) {\\n\\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\\n\\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\\n\\treturn fract( sin( sn ) * c );\\n}\\n#ifdef HIGH_PRECISION\\n\\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\\n#else\\n\\tfloat precisionSafeLength( vec3 v ) {\\n\\t\\tfloat maxComponent = max3( abs( v ) );\\n\\t\\treturn length( v / maxComponent ) * maxComponent;\\n\\t}\\n#endif\\nstruct IncidentLight {\\n\\tvec3 color;\\n\\tvec3 direction;\\n\\tbool visible;\\n};\\nstruct ReflectedLight {\\n\\tvec3 directDiffuse;\\n\\tvec3 directSpecular;\\n\\tvec3 indirectDiffuse;\\n\\tvec3 indirectSpecular;\\n};\\n#ifdef USE_ALPHAHASH\\n\\tvarying vec3 vPosition;\\n#endif\\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n}\\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\\n}\\nmat3 transposeMat3( const in mat3 m ) {\\n\\tmat3 tmp;\\n\\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\\n\\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\\n\\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\\n\\treturn tmp;\\n}\\nbool isPerspectiveMatrix( mat4 m ) {\\n\\treturn m[ 2 ][ 3 ] == - 1.0;\\n}\\nvec2 equirectUv( in vec3 dir ) {\\n\\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\\n\\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\treturn vec2( u, v );\\n}\\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\\n\\treturn RECIPROCAL_PI * diffuseColor;\\n}\\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\\n\\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n}\\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\\n\\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n} // validated\";\n\nvar cube_uv_reflection_fragment = \"#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t#define cubeUV_minMipLevel 4.0\\n\\t#define cubeUV_minTileSize 16.0\\n\\tfloat getFace( vec3 direction ) {\\n\\t\\tvec3 absDirection = abs( direction );\\n\\t\\tfloat face = - 1.0;\\n\\t\\tif ( absDirection.x > absDirection.z ) {\\n\\t\\t\\tif ( absDirection.x > absDirection.y )\\n\\t\\t\\t\\tface = direction.x > 0.0 ? 0.0 : 3.0;\\n\\t\\t\\telse\\n\\t\\t\\t\\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\\t\\t} else {\\n\\t\\t\\tif ( absDirection.z > absDirection.y )\\n\\t\\t\\t\\tface = direction.z > 0.0 ? 2.0 : 5.0;\\n\\t\\t\\telse\\n\\t\\t\\t\\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\\t\\t}\\n\\t\\treturn face;\\n\\t}\\n\\tvec2 getUV( vec3 direction, float face ) {\\n\\t\\tvec2 uv;\\n\\t\\tif ( face == 0.0 ) {\\n\\t\\t\\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\\n\\t\\t} else if ( face == 1.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\\n\\t\\t} else if ( face == 2.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\\n\\t\\t} else if ( face == 3.0 ) {\\n\\t\\t\\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\\n\\t\\t} else if ( face == 4.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\\n\\t\\t} else {\\n\\t\\t\\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\\n\\t\\t}\\n\\t\\treturn 0.5 * ( uv + 1.0 );\\n\\t}\\n\\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\\n\\t\\tfloat face = getFace( direction );\\n\\t\\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\\n\\t\\tmipInt = max( mipInt, cubeUV_minMipLevel );\\n\\t\\tfloat faceSize = exp2( mipInt );\\n\\t\\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\\n\\t\\tif ( face > 2.0 ) {\\n\\t\\t\\tuv.y += faceSize;\\n\\t\\t\\tface -= 3.0;\\n\\t\\t}\\n\\t\\tuv.x += face * faceSize;\\n\\t\\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\\n\\t\\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\\n\\t\\tuv.x *= CUBEUV_TEXEL_WIDTH;\\n\\t\\tuv.y *= CUBEUV_TEXEL_HEIGHT;\\n\\t\\t#ifdef texture2DGradEXT\\n\\t\\t\\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\\n\\t\\t#else\\n\\t\\t\\treturn texture2D( envMap, uv ).rgb;\\n\\t\\t#endif\\n\\t}\\n\\t#define cubeUV_r0 1.0\\n\\t#define cubeUV_m0 - 2.0\\n\\t#define cubeUV_r1 0.8\\n\\t#define cubeUV_m1 - 1.0\\n\\t#define cubeUV_r4 0.4\\n\\t#define cubeUV_m4 2.0\\n\\t#define cubeUV_r5 0.305\\n\\t#define cubeUV_m5 3.0\\n\\t#define cubeUV_r6 0.21\\n\\t#define cubeUV_m6 4.0\\n\\tfloat roughnessToMip( float roughness ) {\\n\\t\\tfloat mip = 0.0;\\n\\t\\tif ( roughness >= cubeUV_r1 ) {\\n\\t\\t\\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\\n\\t\\t} else if ( roughness >= cubeUV_r4 ) {\\n\\t\\t\\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\\n\\t\\t} else if ( roughness >= cubeUV_r5 ) {\\n\\t\\t\\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\\n\\t\\t} else if ( roughness >= cubeUV_r6 ) {\\n\\t\\t\\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\\n\\t\\t} else {\\n\\t\\t\\tmip = - 2.0 * log2( 1.16 * roughness );\\t\\t}\\n\\t\\treturn mip;\\n\\t}\\n\\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\\n\\t\\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\\n\\t\\tfloat mipF = fract( mip );\\n\\t\\tfloat mipInt = floor( mip );\\n\\t\\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\\n\\t\\tif ( mipF == 0.0 ) {\\n\\t\\t\\treturn vec4( color0, 1.0 );\\n\\t\\t} else {\\n\\t\\t\\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\\n\\t\\t\\treturn vec4( mix( color0, color1, mipF ), 1.0 );\\n\\t\\t}\\n\\t}\\n#endif\";\n\nvar defaultnormal_vertex = \"vec3 transformedNormal = objectNormal;\\n#ifdef USE_TANGENT\\n\\tvec3 transformedTangent = objectTangent;\\n#endif\\n#ifdef USE_BATCHING\\n\\tmat3 bm = mat3( batchingMatrix );\\n\\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\\n\\ttransformedNormal = bm * transformedNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\ttransformedTangent = bm * transformedTangent;\\n\\t#endif\\n#endif\\n#ifdef USE_INSTANCING\\n\\tmat3 im = mat3( instanceMatrix );\\n\\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\\n\\ttransformedNormal = im * transformedNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\ttransformedTangent = im * transformedTangent;\\n\\t#endif\\n#endif\\ntransformedNormal = normalMatrix * transformedNormal;\\n#ifdef FLIP_SIDED\\n\\ttransformedNormal = - transformedNormal;\\n#endif\\n#ifdef USE_TANGENT\\n\\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\\n\\t#ifdef FLIP_SIDED\\n\\t\\ttransformedTangent = - transformedTangent;\\n\\t#endif\\n#endif\";\n\nvar displacementmap_pars_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\tuniform sampler2D displacementMap;\\n\\tuniform float displacementScale;\\n\\tuniform float displacementBias;\\n#endif\";\n\nvar displacementmap_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\\n#endif\";\n\nvar emissivemap_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\\n\\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\\n\\t\\temissiveColor = sRGBTransferEOTF( emissiveColor );\\n\\t#endif\\n\\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\";\n\nvar emissivemap_pars_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tuniform sampler2D emissiveMap;\\n#endif\";\n\nvar colorspace_fragment = \"gl_FragColor = linearToOutputTexel( gl_FragColor );\";\n\nvar colorspace_pars_fragment = \"vec4 LinearTransferOETF( in vec4 value ) {\\n\\treturn value;\\n}\\nvec4 sRGBTransferEOTF( in vec4 value ) {\\n\\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\\n}\\nvec4 sRGBTransferOETF( in vec4 value ) {\\n\\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\\n}\";\n\nvar envmap_fragment = \"#ifdef USE_ENVMAP\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvec3 cameraToFrag;\\n\\t\\tif ( isOrthographic ) {\\n\\t\\t\\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\\t\\t} else {\\n\\t\\t\\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\\n\\t\\t}\\n\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#else\\n\\t\\tvec3 reflectVec = vReflect;\\n\\t#endif\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\t#else\\n\\t\\tvec4 envColor = vec4( 0.0 );\\n\\t#endif\\n\\t#ifdef ENVMAP_BLENDING_MULTIPLY\\n\\t\\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_MIX )\\n\\t\\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_ADD )\\n\\t\\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\\n\\t#endif\\n#endif\";\n\nvar envmap_common_pars_fragment = \"#ifdef USE_ENVMAP\\n\\tuniform float envMapIntensity;\\n\\tuniform float flipEnvMap;\\n\\tuniform mat3 envMapRotation;\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tuniform samplerCube envMap;\\n\\t#else\\n\\t\\tuniform sampler2D envMap;\\n\\t#endif\\n\\t\\n#endif\";\n\nvar envmap_pars_fragment = \"#ifdef USE_ENVMAP\\n\\tuniform float reflectivity;\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\\n\\t\\t#define ENV_WORLDPOS\\n\\t#endif\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t\\tuniform float refractionRatio;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t#endif\\n#endif\";\n\nvar envmap_pars_vertex = \"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\\n\\t\\t#define ENV_WORLDPOS\\n\\t#endif\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\t\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n#endif\";\n\nvar envmap_vertex = \"#ifdef USE_ENVMAP\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvWorldPosition = worldPosition.xyz;\\n\\t#else\\n\\t\\tvec3 cameraToVertex;\\n\\t\\tif ( isOrthographic ) {\\n\\t\\t\\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\\t\\t} else {\\n\\t\\t\\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\\t\\t}\\n\\t\\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvReflect = reflect( cameraToVertex, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\nvar fog_vertex = \"#ifdef USE_FOG\\n\\tvFogDepth = - mvPosition.z;\\n#endif\";\n\nvar fog_pars_vertex = \"#ifdef USE_FOG\\n\\tvarying float vFogDepth;\\n#endif\";\n\nvar fog_fragment = \"#ifdef USE_FOG\\n\\t#ifdef FOG_EXP2\\n\\t\\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\\n\\t#else\\n\\t\\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\\n\\t#endif\\n\\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n#endif\";\n\nvar fog_pars_fragment = \"#ifdef USE_FOG\\n\\tuniform vec3 fogColor;\\n\\tvarying float vFogDepth;\\n\\t#ifdef FOG_EXP2\\n\\t\\tuniform float fogDensity;\\n\\t#else\\n\\t\\tuniform float fogNear;\\n\\t\\tuniform float fogFar;\\n\\t#endif\\n#endif\";\n\nvar gradientmap_pars_fragment = \"#ifdef USE_GRADIENTMAP\\n\\tuniform sampler2D gradientMap;\\n#endif\\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\\n\\tfloat dotNL = dot( normal, lightDirection );\\n\\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\\n\\t#ifdef USE_GRADIENTMAP\\n\\t\\treturn vec3( texture2D( gradientMap, coord ).r );\\n\\t#else\\n\\t\\tvec2 fw = fwidth( coord ) * 0.5;\\n\\t\\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\\n\\t#endif\\n}\";\n\nvar lightmap_pars_fragment = \"#ifdef USE_LIGHTMAP\\n\\tuniform sampler2D lightMap;\\n\\tuniform float lightMapIntensity;\\n#endif\";\n\nvar lights_lambert_fragment = \"LambertMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularStrength = specularStrength;\";\n\nvar lights_lambert_pars_fragment = \"varying vec3 vViewPosition;\\nstruct LambertMaterial {\\n\\tvec3 diffuseColor;\\n\\tfloat specularStrength;\\n};\\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Lambert\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Lambert\";\n\nvar lights_pars_begin = \"uniform bool receiveShadow;\\nuniform vec3 ambientLightColor;\\n#if defined( USE_LIGHT_PROBES )\\n\\tuniform vec3 lightProbe[ 9 ];\\n#endif\\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\\n\\tfloat x = normal.x, y = normal.y, z = normal.z;\\n\\tvec3 result = shCoefficients[ 0 ] * 0.886227;\\n\\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\\n\\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\\n\\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\\n\\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\\n\\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\\n\\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\\n\\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\\n\\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\\n\\treturn result;\\n}\\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\\n\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\\n\\treturn irradiance;\\n}\\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\\n\\tvec3 irradiance = ambientLightColor;\\n\\treturn irradiance;\\n}\\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\\n\\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\\tif ( cutoffDistance > 0.0 ) {\\n\\t\\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\\t}\\n\\treturn distanceFalloff;\\n}\\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\\n\\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\\n}\\n#if NUM_DIR_LIGHTS > 0\\n\\tstruct DirectionalLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t};\\n\\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\\n\\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\\n\\t\\tlight.color = directionalLight.color;\\n\\t\\tlight.direction = directionalLight.direction;\\n\\t\\tlight.visible = true;\\n\\t}\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\tstruct PointLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t};\\n\\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\\n\\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\\n\\t\\tvec3 lVector = pointLight.position - geometryPosition;\\n\\t\\tlight.direction = normalize( lVector );\\n\\t\\tfloat lightDistance = length( lVector );\\n\\t\\tlight.color = pointLight.color;\\n\\t\\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\\n\\t\\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\tstruct SpotLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t\\tfloat coneCos;\\n\\t\\tfloat penumbraCos;\\n\\t};\\n\\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\\n\\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\\n\\t\\tvec3 lVector = spotLight.position - geometryPosition;\\n\\t\\tlight.direction = normalize( lVector );\\n\\t\\tfloat angleCos = dot( light.direction, spotLight.direction );\\n\\t\\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\\n\\t\\tif ( spotAttenuation > 0.0 ) {\\n\\t\\t\\tfloat lightDistance = length( lVector );\\n\\t\\t\\tlight.color = spotLight.color * spotAttenuation;\\n\\t\\t\\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\\n\\t\\t\\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\\t\\t} else {\\n\\t\\t\\tlight.color = vec3( 0.0 );\\n\\t\\t\\tlight.visible = false;\\n\\t\\t}\\n\\t}\\n#endif\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tstruct RectAreaLight {\\n\\t\\tvec3 color;\\n\\t\\tvec3 position;\\n\\t\\tvec3 halfWidth;\\n\\t\\tvec3 halfHeight;\\n\\t};\\n\\tuniform sampler2D ltc_1;\\tuniform sampler2D ltc_2;\\n\\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\tstruct HemisphereLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 skyColor;\\n\\t\\tvec3 groundColor;\\n\\t};\\n\\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\\n\\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\\n\\t\\tfloat dotNL = dot( normal, hemiLight.direction );\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\\n\\t\\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\\n\\t\\treturn irradiance;\\n\\t}\\n#endif\";\n\nvar envmap_physical_pars_fragment = \"#ifdef USE_ENVMAP\\n\\tvec3 getIBLIrradiance( const in vec3 normal ) {\\n\\t\\t#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\\n\\t\\t\\treturn PI * envMapColor.rgb * envMapIntensity;\\n\\t\\t#else\\n\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t#endif\\n\\t}\\n\\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\\n\\t\\t#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t\\t\\tvec3 reflectVec = reflect( - viewDir, normal );\\n\\t\\t\\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\\n\\t\\t\\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\\n\\t\\t\\treturn envMapColor.rgb * envMapIntensity;\\n\\t\\t#else\\n\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t#endif\\n\\t}\\n\\t#ifdef USE_ANISOTROPY\\n\\t\\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\\n\\t\\t\\t#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t\\t\\t\\tvec3 bentNormal = cross( bitangent, viewDir );\\n\\t\\t\\t\\tbentNormal = normalize( cross( bentNormal, bitangent ) );\\n\\t\\t\\t\\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\\n\\t\\t\\t\\treturn getIBLRadiance( viewDir, bentNormal, roughness );\\n\\t\\t\\t#else\\n\\t\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t\\t#endif\\n\\t\\t}\\n\\t#endif\\n#endif\";\n\nvar lights_toon_fragment = \"ToonMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\";\n\nvar lights_toon_pars_fragment = \"varying vec3 vViewPosition;\\nstruct ToonMaterial {\\n\\tvec3 diffuseColor;\\n};\\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Toon\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Toon\";\n\nvar lights_phong_fragment = \"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\";\n\nvar lights_phong_pars_fragment = \"varying vec3 vViewPosition;\\nstruct BlinnPhongMaterial {\\n\\tvec3 diffuseColor;\\n\\tvec3 specularColor;\\n\\tfloat specularShininess;\\n\\tfloat specularStrength;\\n};\\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n\\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\\n}\\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_BlinnPhong\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_BlinnPhong\";\n\nvar lights_physical_fragment = \"PhysicalMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\\nmaterial.roughness = min( material.roughness, 1.0 );\\n#ifdef IOR\\n\\tmaterial.ior = ior;\\n\\t#ifdef USE_SPECULAR\\n\\t\\tfloat specularIntensityFactor = specularIntensity;\\n\\t\\tvec3 specularColorFactor = specularColor;\\n\\t\\t#ifdef USE_SPECULAR_COLORMAP\\n\\t\\t\\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\\n\\t\\t#endif\\n\\t\\t#ifdef USE_SPECULAR_INTENSITYMAP\\n\\t\\t\\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\\n\\t\\t#endif\\n\\t\\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\\n\\t#else\\n\\t\\tfloat specularIntensityFactor = 1.0;\\n\\t\\tvec3 specularColorFactor = vec3( 1.0 );\\n\\t\\tmaterial.specularF90 = 1.0;\\n\\t#endif\\n\\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\\n#else\\n\\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\\n\\tmaterial.specularF90 = 1.0;\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tmaterial.clearcoat = clearcoat;\\n\\tmaterial.clearcoatRoughness = clearcoatRoughness;\\n\\tmaterial.clearcoatF0 = vec3( 0.04 );\\n\\tmaterial.clearcoatF90 = 1.0;\\n\\t#ifdef USE_CLEARCOATMAP\\n\\t\\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\t\\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\\n\\t#endif\\n\\tmaterial.clearcoat = saturate( material.clearcoat );\\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\\n\\tmaterial.clearcoatRoughness += geometryRoughness;\\n\\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\\n#endif\\n#ifdef USE_DISPERSION\\n\\tmaterial.dispersion = dispersion;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\\tmaterial.iridescence = iridescence;\\n\\tmaterial.iridescenceIOR = iridescenceIOR;\\n\\t#ifdef USE_IRIDESCENCEMAP\\n\\t\\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\\n\\t#endif\\n\\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\t\\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\\n\\t#else\\n\\t\\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\\n\\t#endif\\n#endif\\n#ifdef USE_SHEEN\\n\\tmaterial.sheenColor = sheenColor;\\n\\t#ifdef USE_SHEEN_COLORMAP\\n\\t\\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\\n\\t#endif\\n\\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\\n\\t#ifdef USE_SHEEN_ROUGHNESSMAP\\n\\t\\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\\n\\t#endif\\n#endif\\n#ifdef USE_ANISOTROPY\\n\\t#ifdef USE_ANISOTROPYMAP\\n\\t\\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\\n\\t\\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\\n\\t\\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\\n\\t#else\\n\\t\\tvec2 anisotropyV = anisotropyVector;\\n\\t#endif\\n\\tmaterial.anisotropy = length( anisotropyV );\\n\\tif( material.anisotropy == 0.0 ) {\\n\\t\\tanisotropyV = vec2( 1.0, 0.0 );\\n\\t} else {\\n\\t\\tanisotropyV /= material.anisotropy;\\n\\t\\tmaterial.anisotropy = saturate( material.anisotropy );\\n\\t}\\n\\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\\n\\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\\n\\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\\n#endif\";\n\nvar lights_physical_pars_fragment = \"struct PhysicalMaterial {\\n\\tvec3 diffuseColor;\\n\\tfloat roughness;\\n\\tvec3 specularColor;\\n\\tfloat specularF90;\\n\\tfloat dispersion;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat clearcoat;\\n\\t\\tfloat clearcoatRoughness;\\n\\t\\tvec3 clearcoatF0;\\n\\t\\tfloat clearcoatF90;\\n\\t#endif\\n\\t#ifdef USE_IRIDESCENCE\\n\\t\\tfloat iridescence;\\n\\t\\tfloat iridescenceIOR;\\n\\t\\tfloat iridescenceThickness;\\n\\t\\tvec3 iridescenceFresnel;\\n\\t\\tvec3 iridescenceF0;\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tvec3 sheenColor;\\n\\t\\tfloat sheenRoughness;\\n\\t#endif\\n\\t#ifdef IOR\\n\\t\\tfloat ior;\\n\\t#endif\\n\\t#ifdef USE_TRANSMISSION\\n\\t\\tfloat transmission;\\n\\t\\tfloat transmissionAlpha;\\n\\t\\tfloat thickness;\\n\\t\\tfloat attenuationDistance;\\n\\t\\tvec3 attenuationColor;\\n\\t#endif\\n\\t#ifdef USE_ANISOTROPY\\n\\t\\tfloat anisotropy;\\n\\t\\tfloat alphaT;\\n\\t\\tvec3 anisotropyT;\\n\\t\\tvec3 anisotropyB;\\n\\t#endif\\n};\\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\\nvec3 sheenSpecularDirect = vec3( 0.0 );\\nvec3 sheenSpecularIndirect = vec3(0.0 );\\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\\n float x2 = x * x;\\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\\n}\\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\\treturn 0.5 / max( gv + gl, EPSILON );\\n}\\nfloat D_GGX( const in float alpha, const in float dotNH ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\\n\\treturn RECIPROCAL_PI * a2 / pow2( denom );\\n}\\n#ifdef USE_ANISOTROPY\\n\\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\\n\\t\\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\\n\\t\\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\\n\\t\\tfloat v = 0.5 / ( gv + gl );\\n\\t\\treturn saturate(v);\\n\\t}\\n\\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\\n\\t\\tfloat a2 = alphaT * alphaB;\\n\\t\\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\\n\\t\\thighp float v2 = dot( v, v );\\n\\t\\tfloat w2 = a2 / v2;\\n\\t\\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\\n\\t}\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\\n\\t\\tvec3 f0 = material.clearcoatF0;\\n\\t\\tfloat f90 = material.clearcoatF90;\\n\\t\\tfloat roughness = material.clearcoatRoughness;\\n\\t\\tfloat alpha = pow2( roughness );\\n\\t\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\t\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\t\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\t\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\t\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\t\\tvec3 F = F_Schlick( f0, f90, dotVH );\\n\\t\\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\t\\tfloat D = D_GGX( alpha, dotNH );\\n\\t\\treturn F * ( V * D );\\n\\t}\\n#endif\\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\\n\\tvec3 f0 = material.specularColor;\\n\\tfloat f90 = material.specularF90;\\n\\tfloat roughness = material.roughness;\\n\\tfloat alpha = pow2( roughness );\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\tvec3 F = F_Schlick( f0, f90, dotVH );\\n\\t#ifdef USE_IRIDESCENCE\\n\\t\\tF = mix( F, material.iridescenceFresnel, material.iridescence );\\n\\t#endif\\n\\t#ifdef USE_ANISOTROPY\\n\\t\\tfloat dotTL = dot( material.anisotropyT, lightDir );\\n\\t\\tfloat dotTV = dot( material.anisotropyT, viewDir );\\n\\t\\tfloat dotTH = dot( material.anisotropyT, halfDir );\\n\\t\\tfloat dotBL = dot( material.anisotropyB, lightDir );\\n\\t\\tfloat dotBV = dot( material.anisotropyB, viewDir );\\n\\t\\tfloat dotBH = dot( material.anisotropyB, halfDir );\\n\\t\\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\\n\\t\\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\\n\\t#else\\n\\t\\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\t\\tfloat D = D_GGX( alpha, dotNH );\\n\\t#endif\\n\\treturn F * ( V * D );\\n}\\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\\n\\tconst float LUT_SIZE = 64.0;\\n\\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\\n\\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\\n\\tfloat dotNV = saturate( dot( N, V ) );\\n\\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\\n\\tuv = uv * LUT_SCALE + LUT_BIAS;\\n\\treturn uv;\\n}\\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\\n\\tfloat l = length( f );\\n\\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\\n}\\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\\n\\tfloat x = dot( v1, v2 );\\n\\tfloat y = abs( x );\\n\\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\\n\\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\\n\\tfloat v = a / b;\\n\\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\\n\\treturn cross( v1, v2 ) * theta_sintheta;\\n}\\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\\n\\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\\n\\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\\n\\tvec3 lightNormal = cross( v1, v2 );\\n\\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\\n\\tvec3 T1, T2;\\n\\tT1 = normalize( V - N * dot( V, N ) );\\n\\tT2 = - cross( N, T1 );\\n\\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\\n\\tvec3 coords[ 4 ];\\n\\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\\n\\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\\n\\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\\n\\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\\n\\tcoords[ 0 ] = normalize( coords[ 0 ] );\\n\\tcoords[ 1 ] = normalize( coords[ 1 ] );\\n\\tcoords[ 2 ] = normalize( coords[ 2 ] );\\n\\tcoords[ 3 ] = normalize( coords[ 3 ] );\\n\\tvec3 vectorFormFactor = vec3( 0.0 );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\\n\\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\\n\\treturn vec3( result );\\n}\\n#if defined( USE_SHEEN )\\nfloat D_Charlie( float roughness, float dotNH ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tfloat invAlpha = 1.0 / alpha;\\n\\tfloat cos2h = dotNH * dotNH;\\n\\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\\n\\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\\n}\\nfloat V_Neubelt( float dotNV, float dotNL ) {\\n\\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\\n}\\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat D = D_Charlie( sheenRoughness, dotNH );\\n\\tfloat V = V_Neubelt( dotNV, dotNL );\\n\\treturn sheenColor * ( D * V );\\n}\\n#endif\\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat r2 = roughness * roughness;\\n\\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\\n\\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\\n\\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\\n\\treturn saturate( DG * RECIPROCAL_PI );\\n}\\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\\n\\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\\n\\tvec4 r = roughness * c0 + c1;\\n\\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\\n\\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\\n\\treturn fab;\\n}\\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\\n\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\treturn specularColor * fab.x + specularF90 * fab.y;\\n}\\n#ifdef USE_IRIDESCENCE\\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n#else\\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n#endif\\n\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\t#ifdef USE_IRIDESCENCE\\n\\t\\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\\n\\t#else\\n\\t\\tvec3 Fr = specularColor;\\n\\t#endif\\n\\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\\n\\tfloat Ess = fab.x + fab.y;\\n\\tfloat Ems = 1.0 - Ess;\\n\\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\\n\\tsingleScatter += FssEss;\\n\\tmultiScatter += Fms * Ems;\\n}\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t\\tvec3 normal = geometryNormal;\\n\\t\\tvec3 viewDir = geometryViewDir;\\n\\t\\tvec3 position = geometryPosition;\\n\\t\\tvec3 lightPos = rectAreaLight.position;\\n\\t\\tvec3 halfWidth = rectAreaLight.halfWidth;\\n\\t\\tvec3 halfHeight = rectAreaLight.halfHeight;\\n\\t\\tvec3 lightColor = rectAreaLight.color;\\n\\t\\tfloat roughness = material.roughness;\\n\\t\\tvec3 rectCoords[ 4 ];\\n\\t\\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\\t\\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\\n\\t\\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\\n\\t\\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\\n\\t\\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\\n\\t\\tvec4 t1 = texture2D( ltc_1, uv );\\n\\t\\tvec4 t2 = texture2D( ltc_2, uv );\\n\\t\\tmat3 mInv = mat3(\\n\\t\\t\\tvec3( t1.x, 0, t1.y ),\\n\\t\\t\\tvec3( 0, 1, 0 ),\\n\\t\\t\\tvec3( t1.z, 0, t1.w )\\n\\t\\t);\\n\\t\\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\\n\\t\\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\\n\\t\\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\\n\\t}\\n#endif\\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\\n\\t\\tvec3 ccIrradiance = dotNLcc * directLight.color;\\n\\t\\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\\n\\t#endif\\n\\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\\n\\t#endif\\n\\tvec3 singleScattering = vec3( 0.0 );\\n\\tvec3 multiScattering = vec3( 0.0 );\\n\\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\\n\\t#ifdef USE_IRIDESCENCE\\n\\t\\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\\n\\t#else\\n\\t\\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\\n\\t#endif\\n\\tvec3 totalScattering = singleScattering + multiScattering;\\n\\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\\n\\treflectedLight.indirectSpecular += radiance * singleScattering;\\n\\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\\n\\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Physical\\n#define RE_Direct_RectArea\\t\\tRE_Direct_RectArea_Physical\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Physical\\n#define RE_IndirectSpecular\\t\\tRE_IndirectSpecular_Physical\\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\\n\\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\\n}\";\n\nvar lights_fragment_begin = \"\\nvec3 geometryPosition = - vViewPosition;\\nvec3 geometryNormal = normal;\\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\\nvec3 geometryClearcoatNormal = vec3( 0.0 );\\n#ifdef USE_CLEARCOAT\\n\\tgeometryClearcoatNormal = clearcoatNormal;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\\n\\tif ( material.iridescenceThickness == 0.0 ) {\\n\\t\\tmaterial.iridescence = 0.0;\\n\\t} else {\\n\\t\\tmaterial.iridescence = saturate( material.iridescence );\\n\\t}\\n\\tif ( material.iridescence > 0.0 ) {\\n\\t\\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\\n\\t\\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\\n\\t}\\n#endif\\nIncidentLight directLight;\\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tPointLight pointLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\\n\\tPointLightShadow pointLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tpointLight = pointLights[ i ];\\n\\t\\tgetPointLightInfo( pointLight, geometryPosition, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\\n\\t\\tpointLightShadow = pointLightShadows[ i ];\\n\\t\\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tSpotLight spotLight;\\n\\tvec4 spotColor;\\n\\tvec3 spotLightCoord;\\n\\tbool inSpotLightMap;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\\n\\tSpotLightShadow spotLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tspotLight = spotLights[ i ];\\n\\t\\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\\n\\t\\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\\n\\t\\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\\n\\t\\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\\t\\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\\n\\t\\t#else\\n\\t\\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\\n\\t\\t#endif\\n\\t\\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\\n\\t\\t\\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\\n\\t\\t\\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\\n\\t\\t\\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\\n\\t\\t\\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\\n\\t\\t#endif\\n\\t\\t#undef SPOT_LIGHT_MAP_INDEX\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\\t\\tspotLightShadow = spotLightShadows[ i ];\\n\\t\\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tDirectionalLight directionalLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\\n\\tDirectionalLightShadow directionalLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLights[ i ];\\n\\t\\tgetDirectionalLightInfo( directionalLight, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\\n\\t\\tdirectionalLightShadow = directionalLightShadows[ i ];\\n\\t\\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\\n\\tRectAreaLight rectAreaLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\\n\\t\\trectAreaLight = rectAreaLights[ i ];\\n\\t\\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if defined( RE_IndirectDiffuse )\\n\\tvec3 iblIrradiance = vec3( 0.0 );\\n\\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\\n\\t#if defined( USE_LIGHT_PROBES )\\n\\t\\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\\n\\t#endif\\n\\t#if ( NUM_HEMI_LIGHTS > 0 )\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\t\\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tvec3 radiance = vec3( 0.0 );\\n\\tvec3 clearcoatRadiance = vec3( 0.0 );\\n#endif\";\n\nvar lights_fragment_maps = \"#if defined( RE_IndirectDiffuse )\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\\n\\t\\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\\n\\t\\tirradiance += lightMapIrradiance;\\n\\t#endif\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tiblIrradiance += getIBLIrradiance( geometryNormal );\\n\\t#endif\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\\t#ifdef USE_ANISOTROPY\\n\\t\\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\\n\\t#else\\n\\t\\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\\n\\t#endif\\n#endif\";\n\nvar lights_fragment_end = \"#if defined( RE_IndirectDiffuse )\\n\\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\\n#endif\";\n\nvar logdepthbuf_fragment = \"#if defined( USE_LOGDEPTHBUF )\\n\\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\\n#endif\";\n\nvar logdepthbuf_pars_fragment = \"#if defined( USE_LOGDEPTHBUF )\\n\\tuniform float logDepthBufFC;\\n\\tvarying float vFragDepth;\\n\\tvarying float vIsPerspective;\\n#endif\";\n\nvar logdepthbuf_pars_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\tvarying float vFragDepth;\\n\\tvarying float vIsPerspective;\\n#endif\";\n\nvar logdepthbuf_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\tvFragDepth = 1.0 + gl_Position.w;\\n\\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\\n#endif\";\n\nvar map_fragment = \"#ifdef USE_MAP\\n\\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\\n\\t#ifdef DECODE_VIDEO_TEXTURE\\n\\t\\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\\n\\t#endif\\n\\tdiffuseColor *= sampledDiffuseColor;\\n#endif\";\n\nvar map_pars_fragment = \"#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\";\n\nvar map_particle_fragment = \"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\t#if defined( USE_POINTS_UV )\\n\\t\\tvec2 uv = vUv;\\n\\t#else\\n\\t\\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\\n\\t#endif\\n#endif\\n#ifdef USE_MAP\\n\\tdiffuseColor *= texture2D( map, uv );\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\\n#endif\";\n\nvar map_particle_pars_fragment = \"#if defined( USE_POINTS_UV )\\n\\tvarying vec2 vUv;\\n#else\\n\\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\t\\tuniform mat3 uvTransform;\\n\\t#endif\\n#endif\\n#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";\n\nvar metalnessmap_fragment = \"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\\n\\tmetalnessFactor *= texelMetalness.b;\\n#endif\";\n\nvar metalnessmap_pars_fragment = \"#ifdef USE_METALNESSMAP\\n\\tuniform sampler2D metalnessMap;\\n#endif\";\n\nvar morphinstance_vertex = \"#ifdef USE_INSTANCING_MORPH\\n\\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\\n\\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\\n\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\\n\\t}\\n#endif\";\n\nvar morphcolor_vertex = \"#if defined( USE_MORPHCOLORS )\\n\\tvColor *= morphTargetBaseInfluence;\\n\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t#if defined( USE_COLOR_ALPHA )\\n\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\\n\\t\\t#elif defined( USE_COLOR )\\n\\t\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\\n\\t\\t#endif\\n\\t}\\n#endif\";\n\nvar morphnormal_vertex = \"#ifdef USE_MORPHNORMALS\\n\\tobjectNormal *= morphTargetBaseInfluence;\\n\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\\n\\t}\\n#endif\";\n\nvar morphtarget_pars_vertex = \"#ifdef USE_MORPHTARGETS\\n\\t#ifndef USE_INSTANCING_MORPH\\n\\t\\tuniform float morphTargetBaseInfluence;\\n\\t\\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\\n\\t#endif\\n\\tuniform sampler2DArray morphTargetsTexture;\\n\\tuniform ivec2 morphTargetsTextureSize;\\n\\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\\n\\t\\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\\n\\t\\tint y = texelIndex / morphTargetsTextureSize.x;\\n\\t\\tint x = texelIndex - y * morphTargetsTextureSize.x;\\n\\t\\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\\n\\t\\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\\n\\t}\\n#endif\";\n\nvar morphtarget_vertex = \"#ifdef USE_MORPHTARGETS\\n\\ttransformed *= morphTargetBaseInfluence;\\n\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\\n\\t}\\n#endif\";\n\nvar normal_fragment_begin = \"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\\n#ifdef FLAT_SHADED\\n\\tvec3 fdx = dFdx( vViewPosition );\\n\\tvec3 fdy = dFdy( vViewPosition );\\n\\tvec3 normal = normalize( cross( fdx, fdy ) );\\n#else\\n\\tvec3 normal = normalize( vNormal );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal *= faceDirection;\\n\\t#endif\\n#endif\\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\\n\\t#ifdef USE_TANGENT\\n\\t\\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\\n\\t#else\\n\\t\\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\\n\\t\\t#if defined( USE_NORMALMAP )\\n\\t\\t\\tvNormalMapUv\\n\\t\\t#elif defined( USE_CLEARCOAT_NORMALMAP )\\n\\t\\t\\tvClearcoatNormalMapUv\\n\\t\\t#else\\n\\t\\t\\tvUv\\n\\t\\t#endif\\n\\t\\t);\\n\\t#endif\\n\\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\\n\\t\\ttbn[0] *= faceDirection;\\n\\t\\ttbn[1] *= faceDirection;\\n\\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\t#ifdef USE_TANGENT\\n\\t\\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\\n\\t#else\\n\\t\\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\\n\\t#endif\\n\\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\\n\\t\\ttbn2[0] *= faceDirection;\\n\\t\\ttbn2[1] *= faceDirection;\\n\\t#endif\\n#endif\\nvec3 nonPerturbedNormal = normal;\";\n\nvar normal_fragment_maps = \"#ifdef USE_NORMALMAP_OBJECTSPACE\\n\\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\\n\\t#ifdef FLIP_SIDED\\n\\t\\tnormal = - normal;\\n\\t#endif\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * faceDirection;\\n\\t#endif\\n\\tnormal = normalize( normalMatrix * normal );\\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\\n\\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\\n\\tmapN.xy *= normalScale;\\n\\tnormal = normalize( tbn * mapN );\\n#elif defined( USE_BUMPMAP )\\n\\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\\n#endif\";\n\nvar normal_pars_fragment = \"#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\tvarying vec3 vTangent;\\n\\t\\tvarying vec3 vBitangent;\\n\\t#endif\\n#endif\";\n\nvar normal_pars_vertex = \"#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\tvarying vec3 vTangent;\\n\\t\\tvarying vec3 vBitangent;\\n\\t#endif\\n#endif\";\n\nvar normal_vertex = \"#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n\\t#ifdef USE_TANGENT\\n\\t\\tvTangent = normalize( transformedTangent );\\n\\t\\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\\n\\t#endif\\n#endif\";\n\nvar normalmap_pars_fragment = \"#ifdef USE_NORMALMAP\\n\\tuniform sampler2D normalMap;\\n\\tuniform vec2 normalScale;\\n#endif\\n#ifdef USE_NORMALMAP_OBJECTSPACE\\n\\tuniform mat3 normalMatrix;\\n#endif\\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\\n\\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\\n\\t\\tvec3 q0 = dFdx( eye_pos.xyz );\\n\\t\\tvec3 q1 = dFdy( eye_pos.xyz );\\n\\t\\tvec2 st0 = dFdx( uv.st );\\n\\t\\tvec2 st1 = dFdy( uv.st );\\n\\t\\tvec3 N = surf_norm;\\n\\t\\tvec3 q1perp = cross( q1, N );\\n\\t\\tvec3 q0perp = cross( N, q0 );\\n\\t\\tvec3 T = q1perp * st0.x + q0perp * st1.x;\\n\\t\\tvec3 B = q1perp * st0.y + q0perp * st1.y;\\n\\t\\tfloat det = max( dot( T, T ), dot( B, B ) );\\n\\t\\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\\n\\t\\treturn mat3( T * scale, B * scale, N );\\n\\t}\\n#endif\";\n\nvar clearcoat_normal_fragment_begin = \"#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal = nonPerturbedNormal;\\n#endif\";\n\nvar clearcoat_normal_fragment_maps = \"#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\\n\\tclearcoatMapN.xy *= clearcoatNormalScale;\\n\\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\\n#endif\";\n\nvar clearcoat_pars_fragment = \"#ifdef USE_CLEARCOATMAP\\n\\tuniform sampler2D clearcoatMap;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tuniform sampler2D clearcoatNormalMap;\\n\\tuniform vec2 clearcoatNormalScale;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tuniform sampler2D clearcoatRoughnessMap;\\n#endif\";\n\nvar iridescence_pars_fragment = \"#ifdef USE_IRIDESCENCEMAP\\n\\tuniform sampler2D iridescenceMap;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\tuniform sampler2D iridescenceThicknessMap;\\n#endif\";\n\nvar opaque_fragment = \"#ifdef OPAQUE\\ndiffuseColor.a = 1.0;\\n#endif\\n#ifdef USE_TRANSMISSION\\ndiffuseColor.a *= material.transmissionAlpha;\\n#endif\\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\";\n\nvar packing = \"vec3 packNormalToRGB( const in vec3 normal ) {\\n\\treturn normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n\\treturn 2.0 * rgb.xyz - 1.0;\\n}\\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\\nconst float Inv255 = 1. / 255.;\\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\\nvec4 packDepthToRGBA( const in float v ) {\\n\\tif( v <= 0.0 )\\n\\t\\treturn vec4( 0., 0., 0., 0. );\\n\\tif( v >= 1.0 )\\n\\t\\treturn vec4( 1., 1., 1., 1. );\\n\\tfloat vuf;\\n\\tfloat af = modf( v * PackFactors.a, vuf );\\n\\tfloat bf = modf( vuf * ShiftRight8, vuf );\\n\\tfloat gf = modf( vuf * ShiftRight8, vuf );\\n\\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\\n}\\nvec3 packDepthToRGB( const in float v ) {\\n\\tif( v <= 0.0 )\\n\\t\\treturn vec3( 0., 0., 0. );\\n\\tif( v >= 1.0 )\\n\\t\\treturn vec3( 1., 1., 1. );\\n\\tfloat vuf;\\n\\tfloat bf = modf( v * PackFactors.b, vuf );\\n\\tfloat gf = modf( vuf * ShiftRight8, vuf );\\n\\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\\n}\\nvec2 packDepthToRG( const in float v ) {\\n\\tif( v <= 0.0 )\\n\\t\\treturn vec2( 0., 0. );\\n\\tif( v >= 1.0 )\\n\\t\\treturn vec2( 1., 1. );\\n\\tfloat vuf;\\n\\tfloat gf = modf( v * 256., vuf );\\n\\treturn vec2( vuf * Inv255, gf );\\n}\\nfloat unpackRGBAToDepth( const in vec4 v ) {\\n\\treturn dot( v, UnpackFactors4 );\\n}\\nfloat unpackRGBToDepth( const in vec3 v ) {\\n\\treturn dot( v, UnpackFactors3 );\\n}\\nfloat unpackRGToDepth( const in vec2 v ) {\\n\\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\\n}\\nvec4 pack2HalfToRGBA( const in vec2 v ) {\\n\\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\\n\\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\\n}\\nvec2 unpackRGBATo2Half( const in vec4 v ) {\\n\\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\\n}\\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn ( viewZ + near ) / ( near - far );\\n}\\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\\n\\treturn depth * ( near - far ) - near;\\n}\\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\\n}\\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\\n\\treturn ( near * far ) / ( ( far - near ) * depth - far );\\n}\";\n\nvar premultiplied_alpha_fragment = \"#ifdef PREMULTIPLIED_ALPHA\\n\\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\";\n\nvar project_vertex = \"vec4 mvPosition = vec4( transformed, 1.0 );\\n#ifdef USE_BATCHING\\n\\tmvPosition = batchingMatrix * mvPosition;\\n#endif\\n#ifdef USE_INSTANCING\\n\\tmvPosition = instanceMatrix * mvPosition;\\n#endif\\nmvPosition = modelViewMatrix * mvPosition;\\ngl_Position = projectionMatrix * mvPosition;\";\n\nvar dithering_fragment = \"#ifdef DITHERING\\n\\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\";\n\nvar dithering_pars_fragment = \"#ifdef DITHERING\\n\\tvec3 dithering( vec3 color ) {\\n\\t\\tfloat grid_position = rand( gl_FragCoord.xy );\\n\\t\\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\\n\\t\\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\\n\\t\\treturn color + dither_shift_RGB;\\n\\t}\\n#endif\";\n\nvar roughnessmap_fragment = \"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\\n\\troughnessFactor *= texelRoughness.g;\\n#endif\";\n\nvar roughnessmap_pars_fragment = \"#ifdef USE_ROUGHNESSMAP\\n\\tuniform sampler2D roughnessMap;\\n#endif\";\n\nvar shadowmap_pars_fragment = \"#if NUM_SPOT_LIGHT_COORDS > 0\\n\\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\\n#endif\\n#if NUM_SPOT_LIGHT_MAPS > 0\\n\\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\\n#endif\\n#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tstruct DirectionalLightShadow {\\n\\t\\t\\tfloat shadowIntensity;\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tstruct SpotLightShadow {\\n\\t\\t\\tfloat shadowIntensity;\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tstruct PointLightShadow {\\n\\t\\t\\tfloat shadowIntensity;\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t\\tfloat shadowCameraNear;\\n\\t\\t\\tfloat shadowCameraFar;\\n\\t\\t};\\n\\t\\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\\n\\t\\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\\n\\t}\\n\\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\\n\\t\\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\\n\\t}\\n\\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\\n\\t\\tfloat occlusion = 1.0;\\n\\t\\tvec2 distribution = texture2DDistribution( shadow, uv );\\n\\t\\tfloat hard_shadow = step( compare , distribution.x );\\n\\t\\tif (hard_shadow != 1.0 ) {\\n\\t\\t\\tfloat distance = compare - distribution.x ;\\n\\t\\t\\tfloat variance = max( 0.00000, distribution.y * distribution.y );\\n\\t\\t\\tfloat softness_probability = variance / (variance + distance * distance );\\t\\t\\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\\t\\t\\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\\n\\t\\t}\\n\\t\\treturn occlusion;\\n\\t}\\n\\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\\t\\tfloat shadow = 1.0;\\n\\t\\tshadowCoord.xyz /= shadowCoord.w;\\n\\t\\tshadowCoord.z += shadowBias;\\n\\t\\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\\n\\t\\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\\n\\t\\tif ( frustumTest ) {\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx0 = - texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy0 = - texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx1 = + texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy1 = + texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx2 = dx0 / 2.0;\\n\\t\\t\\tfloat dy2 = dy0 / 2.0;\\n\\t\\t\\tfloat dx3 = dx1 / 2.0;\\n\\t\\t\\tfloat dy3 = dy1 / 2.0;\\n\\t\\t\\tshadow = (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\\n\\t\\t\\t) * ( 1.0 / 17.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx = texelSize.x;\\n\\t\\t\\tfloat dy = texelSize.y;\\n\\t\\t\\tvec2 uv = shadowCoord.xy;\\n\\t\\t\\tvec2 f = fract( uv * shadowMapSize + 0.5 );\\n\\t\\t\\tuv -= f * texelSize;\\n\\t\\t\\tshadow = (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.x ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.x ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.y ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.y ) +\\n\\t\\t\\t\\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t f.x ),\\n\\t\\t\\t\\t\\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t f.x ),\\n\\t\\t\\t\\t\\t f.y )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#else\\n\\t\\t\\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#endif\\n\\t\\t}\\n\\t\\treturn mix( 1.0, shadow, shadowIntensity );\\n\\t}\\n\\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\\n\\t\\tvec3 absV = abs( v );\\n\\t\\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\\n\\t\\tabsV *= scaleToCube;\\n\\t\\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\\n\\t\\tvec2 planar = v.xy;\\n\\t\\tfloat almostATexel = 1.5 * texelSizeY;\\n\\t\\tfloat almostOne = 1.0 - almostATexel;\\n\\t\\tif ( absV.z >= almostOne ) {\\n\\t\\t\\tif ( v.z > 0.0 )\\n\\t\\t\\t\\tplanar.x = 4.0 - v.x;\\n\\t\\t} else if ( absV.x >= almostOne ) {\\n\\t\\t\\tfloat signX = sign( v.x );\\n\\t\\t\\tplanar.x = v.z * signX + 2.0 * signX;\\n\\t\\t} else if ( absV.y >= almostOne ) {\\n\\t\\t\\tfloat signY = sign( v.y );\\n\\t\\t\\tplanar.x = v.x + 2.0 * signY + 2.0;\\n\\t\\t\\tplanar.y = v.z * signY - 2.0;\\n\\t\\t}\\n\\t\\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\\n\\t}\\n\\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\\t\\tfloat shadow = 1.0;\\n\\t\\tvec3 lightToPosition = shadowCoord.xyz;\\n\\t\\t\\n\\t\\tfloat lightToPositionLength = length( lightToPosition );\\n\\t\\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\\n\\t\\t\\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\\t\\t\\tdp += shadowBias;\\n\\t\\t\\tvec3 bd3D = normalize( lightToPosition );\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\\n\\t\\t\\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\t\\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\\n\\t\\t\\t\\tshadow = (\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\\n\\t\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\\n\\t\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\\n\\t\\t\\t#endif\\n\\t\\t}\\n\\t\\treturn mix( 1.0, shadow, shadowIntensity );\\n\\t}\\n#endif\";\n\nvar shadowmap_pars_vertex = \"#if NUM_SPOT_LIGHT_COORDS > 0\\n\\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\\n\\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\\n#endif\\n#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tstruct DirectionalLightShadow {\\n\\t\\t\\tfloat shadowIntensity;\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t\\tstruct SpotLightShadow {\\n\\t\\t\\tfloat shadowIntensity;\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tstruct PointLightShadow {\\n\\t\\t\\tfloat shadowIntensity;\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t\\tfloat shadowCameraNear;\\n\\t\\t\\tfloat shadowCameraFar;\\n\\t\\t};\\n\\t\\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t#endif\\n#endif\";\n\nvar shadowmap_vertex = \"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\\n\\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\tvec4 shadowWorldPosition;\\n#endif\\n#if defined( USE_SHADOWMAP )\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\t\\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\t\\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\\n#if NUM_SPOT_LIGHT_COORDS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition;\\n\\t\\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\\t\\t\\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\\n\\t\\t#endif\\n\\t\\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\";\n\nvar shadowmask_pars_fragment = \"float getShadowMask() {\\n\\tfloat shadow = 1.0;\\n\\t#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\tDirectionalLightShadow directionalLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\tSpotLightShadow spotLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tspotLight = spotLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\tPointLightShadow pointLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tpointLight = pointLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#endif\\n\\treturn shadow;\\n}\";\n\nvar skinbase_vertex = \"#ifdef USE_SKINNING\\n\\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\\n\\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\\n\\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\\n\\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\\n#endif\";\n\nvar skinning_pars_vertex = \"#ifdef USE_SKINNING\\n\\tuniform mat4 bindMatrix;\\n\\tuniform mat4 bindMatrixInverse;\\n\\tuniform highp sampler2D boneTexture;\\n\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\tint size = textureSize( boneTexture, 0 ).x;\\n\\t\\tint j = int( i ) * 4;\\n\\t\\tint x = j % size;\\n\\t\\tint y = j / size;\\n\\t\\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\\n\\t\\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\\n\\t\\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\\n\\t\\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\\n\\t\\treturn mat4( v1, v2, v3, v4 );\\n\\t}\\n#endif\";\n\nvar skinning_vertex = \"#ifdef USE_SKINNING\\n\\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\\n\\tvec4 skinned = vec4( 0.0 );\\n\\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\\ttransformed = ( bindMatrixInverse * skinned ).xyz;\\n#endif\";\n\nvar skinnormal_vertex = \"#ifdef USE_SKINNING\\n\\tmat4 skinMatrix = mat4( 0.0 );\\n\\tskinMatrix += skinWeight.x * boneMatX;\\n\\tskinMatrix += skinWeight.y * boneMatY;\\n\\tskinMatrix += skinWeight.z * boneMatZ;\\n\\tskinMatrix += skinWeight.w * boneMatW;\\n\\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\\n\\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\\n\\t#ifdef USE_TANGENT\\n\\t\\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\\t#endif\\n#endif\";\n\nvar specularmap_fragment = \"float specularStrength;\\n#ifdef USE_SPECULARMAP\\n\\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\\n\\tspecularStrength = texelSpecular.r;\\n#else\\n\\tspecularStrength = 1.0;\\n#endif\";\n\nvar specularmap_pars_fragment = \"#ifdef USE_SPECULARMAP\\n\\tuniform sampler2D specularMap;\\n#endif\";\n\nvar tonemapping_fragment = \"#if defined( TONE_MAPPING )\\n\\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\";\n\nvar tonemapping_pars_fragment = \"#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\nuniform float toneMappingExposure;\\nvec3 LinearToneMapping( vec3 color ) {\\n\\treturn saturate( toneMappingExposure * color );\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\treturn saturate( color / ( vec3( 1.0 ) + color ) );\\n}\\nvec3 CineonToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\tcolor = max( vec3( 0.0 ), color - 0.004 );\\n\\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\\n}\\nvec3 RRTAndODTFit( vec3 v ) {\\n\\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\\n\\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\\n\\treturn a / b;\\n}\\nvec3 ACESFilmicToneMapping( vec3 color ) {\\n\\tconst mat3 ACESInputMat = mat3(\\n\\t\\tvec3( 0.59719, 0.07600, 0.02840 ),\\t\\tvec3( 0.35458, 0.90834, 0.13383 ),\\n\\t\\tvec3( 0.04823, 0.01566, 0.83777 )\\n\\t);\\n\\tconst mat3 ACESOutputMat = mat3(\\n\\t\\tvec3( 1.60475, -0.10208, -0.00327 ),\\t\\tvec3( -0.53108, 1.10813, -0.07276 ),\\n\\t\\tvec3( -0.07367, -0.00605, 1.07602 )\\n\\t);\\n\\tcolor *= toneMappingExposure / 0.6;\\n\\tcolor = ACESInputMat * color;\\n\\tcolor = RRTAndODTFit( color );\\n\\tcolor = ACESOutputMat * color;\\n\\treturn saturate( color );\\n}\\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\\n\\tvec3( 1.6605, - 0.1246, - 0.0182 ),\\n\\tvec3( - 0.5876, 1.1329, - 0.1006 ),\\n\\tvec3( - 0.0728, - 0.0083, 1.1187 )\\n);\\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\\n\\tvec3( 0.6274, 0.0691, 0.0164 ),\\n\\tvec3( 0.3293, 0.9195, 0.0880 ),\\n\\tvec3( 0.0433, 0.0113, 0.8956 )\\n);\\nvec3 agxDefaultContrastApprox( vec3 x ) {\\n\\tvec3 x2 = x * x;\\n\\tvec3 x4 = x2 * x2;\\n\\treturn + 15.5 * x4 * x2\\n\\t\\t- 40.14 * x4 * x\\n\\t\\t+ 31.96 * x4\\n\\t\\t- 6.868 * x2 * x\\n\\t\\t+ 0.4298 * x2\\n\\t\\t+ 0.1191 * x\\n\\t\\t- 0.00232;\\n}\\nvec3 AgXToneMapping( vec3 color ) {\\n\\tconst mat3 AgXInsetMatrix = mat3(\\n\\t\\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\\n\\t\\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\\n\\t\\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\\n\\t);\\n\\tconst mat3 AgXOutsetMatrix = mat3(\\n\\t\\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\\n\\t\\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\\n\\t\\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\\n\\t);\\n\\tconst float AgxMinEv = - 12.47393;\\tconst float AgxMaxEv = 4.026069;\\n\\tcolor *= toneMappingExposure;\\n\\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\\n\\tcolor = AgXInsetMatrix * color;\\n\\tcolor = max( color, 1e-10 );\\tcolor = log2( color );\\n\\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\\n\\tcolor = clamp( color, 0.0, 1.0 );\\n\\tcolor = agxDefaultContrastApprox( color );\\n\\tcolor = AgXOutsetMatrix * color;\\n\\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\\n\\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\\n\\tcolor = clamp( color, 0.0, 1.0 );\\n\\treturn color;\\n}\\nvec3 NeutralToneMapping( vec3 color ) {\\n\\tconst float StartCompression = 0.8 - 0.04;\\n\\tconst float Desaturation = 0.15;\\n\\tcolor *= toneMappingExposure;\\n\\tfloat x = min( color.r, min( color.g, color.b ) );\\n\\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\\n\\tcolor -= offset;\\n\\tfloat peak = max( color.r, max( color.g, color.b ) );\\n\\tif ( peak < StartCompression ) return color;\\n\\tfloat d = 1. - StartCompression;\\n\\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\\n\\tcolor *= newPeak / peak;\\n\\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\\n\\treturn mix( color, vec3( newPeak ), g );\\n}\\nvec3 CustomToneMapping( vec3 color ) { return color; }\";\n\nvar transmission_fragment = \"#ifdef USE_TRANSMISSION\\n\\tmaterial.transmission = transmission;\\n\\tmaterial.transmissionAlpha = 1.0;\\n\\tmaterial.thickness = thickness;\\n\\tmaterial.attenuationDistance = attenuationDistance;\\n\\tmaterial.attenuationColor = attenuationColor;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\\n\\t#endif\\n\\tvec3 pos = vWorldPosition;\\n\\tvec3 v = normalize( cameraPosition - pos );\\n\\tvec3 n = inverseTransformDirection( normal, viewMatrix );\\n\\tvec4 transmitted = getIBLVolumeRefraction(\\n\\t\\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\\n\\t\\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\\n\\t\\tmaterial.attenuationColor, material.attenuationDistance );\\n\\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\\n\\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\\n#endif\";\n\nvar transmission_pars_fragment = \"#ifdef USE_TRANSMISSION\\n\\tuniform float transmission;\\n\\tuniform float thickness;\\n\\tuniform float attenuationDistance;\\n\\tuniform vec3 attenuationColor;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\tuniform sampler2D transmissionMap;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tuniform sampler2D thicknessMap;\\n\\t#endif\\n\\tuniform vec2 transmissionSamplerSize;\\n\\tuniform sampler2D transmissionSamplerMap;\\n\\tuniform mat4 modelMatrix;\\n\\tuniform mat4 projectionMatrix;\\n\\tvarying vec3 vWorldPosition;\\n\\tfloat w0( float a ) {\\n\\t\\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\\n\\t}\\n\\tfloat w1( float a ) {\\n\\t\\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\\n\\t}\\n\\tfloat w2( float a ){\\n\\t\\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\\n\\t}\\n\\tfloat w3( float a ) {\\n\\t\\treturn ( 1.0 / 6.0 ) * ( a * a * a );\\n\\t}\\n\\tfloat g0( float a ) {\\n\\t\\treturn w0( a ) + w1( a );\\n\\t}\\n\\tfloat g1( float a ) {\\n\\t\\treturn w2( a ) + w3( a );\\n\\t}\\n\\tfloat h0( float a ) {\\n\\t\\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\\n\\t}\\n\\tfloat h1( float a ) {\\n\\t\\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\\n\\t}\\n\\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\\n\\t\\tuv = uv * texelSize.zw + 0.5;\\n\\t\\tvec2 iuv = floor( uv );\\n\\t\\tvec2 fuv = fract( uv );\\n\\t\\tfloat g0x = g0( fuv.x );\\n\\t\\tfloat g1x = g1( fuv.x );\\n\\t\\tfloat h0x = h0( fuv.x );\\n\\t\\tfloat h1x = h1( fuv.x );\\n\\t\\tfloat h0y = h0( fuv.y );\\n\\t\\tfloat h1y = h1( fuv.y );\\n\\t\\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\\n\\t\\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\\n\\t\\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\\n\\t\\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\\n\\t\\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\\n\\t\\t\\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\\n\\t}\\n\\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\\n\\t\\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\\n\\t\\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\\n\\t\\tvec2 fLodSizeInv = 1.0 / fLodSize;\\n\\t\\tvec2 cLodSizeInv = 1.0 / cLodSize;\\n\\t\\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\\n\\t\\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\\n\\t\\treturn mix( fSample, cSample, fract( lod ) );\\n\\t}\\n\\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\\n\\t\\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\\n\\t\\tvec3 modelScale;\\n\\t\\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\\n\\t\\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\\n\\t\\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\\n\\t\\treturn normalize( refractionVector ) * thickness * modelScale;\\n\\t}\\n\\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\\n\\t\\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\\n\\t}\\n\\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\\n\\t\\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\\n\\t\\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\\n\\t}\\n\\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\\n\\t\\tif ( isinf( attenuationDistance ) ) {\\n\\t\\t\\treturn vec3( 1.0 );\\n\\t\\t} else {\\n\\t\\t\\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\\n\\t\\t\\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\\t\\t\\treturn transmittance;\\n\\t\\t}\\n\\t}\\n\\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\\n\\t\\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\\n\\t\\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\\n\\t\\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\\n\\t\\tvec4 transmittedLight;\\n\\t\\tvec3 transmittance;\\n\\t\\t#ifdef USE_DISPERSION\\n\\t\\t\\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\\n\\t\\t\\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\\n\\t\\t\\tfor ( int i = 0; i < 3; i ++ ) {\\n\\t\\t\\t\\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\\n\\t\\t\\t\\tvec3 refractedRayExit = position + transmissionRay;\\n\\t\\t\\n\\t\\t\\t\\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\\t\\t\\t\\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\\t\\t\\t\\trefractionCoords += 1.0;\\n\\t\\t\\t\\trefractionCoords /= 2.0;\\n\\t\\t\\n\\t\\t\\t\\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\\n\\t\\t\\t\\ttransmittedLight[ i ] = transmissionSample[ i ];\\n\\t\\t\\t\\ttransmittedLight.a += transmissionSample.a;\\n\\t\\t\\t\\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\\n\\t\\t\\t}\\n\\t\\t\\ttransmittedLight.a /= 3.0;\\n\\t\\t\\n\\t\\t#else\\n\\t\\t\\n\\t\\t\\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\\n\\t\\t\\tvec3 refractedRayExit = position + transmissionRay;\\n\\t\\t\\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\\t\\t\\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\\t\\t\\trefractionCoords += 1.0;\\n\\t\\t\\trefractionCoords /= 2.0;\\n\\t\\t\\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\\n\\t\\t\\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\\n\\t\\t\\n\\t\\t#endif\\n\\t\\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\\n\\t\\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\\n\\t\\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\\n\\t\\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\\n\\t}\\n#endif\";\n\nvar uv_pars_fragment = \"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\\n\\tvarying vec2 vUv;\\n#endif\\n#ifdef USE_MAP\\n\\tvarying vec2 vMapUv;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tvarying vec2 vAlphaMapUv;\\n#endif\\n#ifdef USE_LIGHTMAP\\n\\tvarying vec2 vLightMapUv;\\n#endif\\n#ifdef USE_AOMAP\\n\\tvarying vec2 vAoMapUv;\\n#endif\\n#ifdef USE_BUMPMAP\\n\\tvarying vec2 vBumpMapUv;\\n#endif\\n#ifdef USE_NORMALMAP\\n\\tvarying vec2 vNormalMapUv;\\n#endif\\n#ifdef USE_EMISSIVEMAP\\n\\tvarying vec2 vEmissiveMapUv;\\n#endif\\n#ifdef USE_METALNESSMAP\\n\\tvarying vec2 vMetalnessMapUv;\\n#endif\\n#ifdef USE_ROUGHNESSMAP\\n\\tvarying vec2 vRoughnessMapUv;\\n#endif\\n#ifdef USE_ANISOTROPYMAP\\n\\tvarying vec2 vAnisotropyMapUv;\\n#endif\\n#ifdef USE_CLEARCOATMAP\\n\\tvarying vec2 vClearcoatMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tvarying vec2 vClearcoatNormalMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tvarying vec2 vClearcoatRoughnessMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCEMAP\\n\\tvarying vec2 vIridescenceMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\tvarying vec2 vIridescenceThicknessMapUv;\\n#endif\\n#ifdef USE_SHEEN_COLORMAP\\n\\tvarying vec2 vSheenColorMapUv;\\n#endif\\n#ifdef USE_SHEEN_ROUGHNESSMAP\\n\\tvarying vec2 vSheenRoughnessMapUv;\\n#endif\\n#ifdef USE_SPECULARMAP\\n\\tvarying vec2 vSpecularMapUv;\\n#endif\\n#ifdef USE_SPECULAR_COLORMAP\\n\\tvarying vec2 vSpecularColorMapUv;\\n#endif\\n#ifdef USE_SPECULAR_INTENSITYMAP\\n\\tvarying vec2 vSpecularIntensityMapUv;\\n#endif\\n#ifdef USE_TRANSMISSIONMAP\\n\\tuniform mat3 transmissionMapTransform;\\n\\tvarying vec2 vTransmissionMapUv;\\n#endif\\n#ifdef USE_THICKNESSMAP\\n\\tuniform mat3 thicknessMapTransform;\\n\\tvarying vec2 vThicknessMapUv;\\n#endif\";\n\nvar uv_pars_vertex = \"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\\n\\tvarying vec2 vUv;\\n#endif\\n#ifdef USE_MAP\\n\\tuniform mat3 mapTransform;\\n\\tvarying vec2 vMapUv;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tuniform mat3 alphaMapTransform;\\n\\tvarying vec2 vAlphaMapUv;\\n#endif\\n#ifdef USE_LIGHTMAP\\n\\tuniform mat3 lightMapTransform;\\n\\tvarying vec2 vLightMapUv;\\n#endif\\n#ifdef USE_AOMAP\\n\\tuniform mat3 aoMapTransform;\\n\\tvarying vec2 vAoMapUv;\\n#endif\\n#ifdef USE_BUMPMAP\\n\\tuniform mat3 bumpMapTransform;\\n\\tvarying vec2 vBumpMapUv;\\n#endif\\n#ifdef USE_NORMALMAP\\n\\tuniform mat3 normalMapTransform;\\n\\tvarying vec2 vNormalMapUv;\\n#endif\\n#ifdef USE_DISPLACEMENTMAP\\n\\tuniform mat3 displacementMapTransform;\\n\\tvarying vec2 vDisplacementMapUv;\\n#endif\\n#ifdef USE_EMISSIVEMAP\\n\\tuniform mat3 emissiveMapTransform;\\n\\tvarying vec2 vEmissiveMapUv;\\n#endif\\n#ifdef USE_METALNESSMAP\\n\\tuniform mat3 metalnessMapTransform;\\n\\tvarying vec2 vMetalnessMapUv;\\n#endif\\n#ifdef USE_ROUGHNESSMAP\\n\\tuniform mat3 roughnessMapTransform;\\n\\tvarying vec2 vRoughnessMapUv;\\n#endif\\n#ifdef USE_ANISOTROPYMAP\\n\\tuniform mat3 anisotropyMapTransform;\\n\\tvarying vec2 vAnisotropyMapUv;\\n#endif\\n#ifdef USE_CLEARCOATMAP\\n\\tuniform mat3 clearcoatMapTransform;\\n\\tvarying vec2 vClearcoatMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tuniform mat3 clearcoatNormalMapTransform;\\n\\tvarying vec2 vClearcoatNormalMapUv;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tuniform mat3 clearcoatRoughnessMapTransform;\\n\\tvarying vec2 vClearcoatRoughnessMapUv;\\n#endif\\n#ifdef USE_SHEEN_COLORMAP\\n\\tuniform mat3 sheenColorMapTransform;\\n\\tvarying vec2 vSheenColorMapUv;\\n#endif\\n#ifdef USE_SHEEN_ROUGHNESSMAP\\n\\tuniform mat3 sheenRoughnessMapTransform;\\n\\tvarying vec2 vSheenRoughnessMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCEMAP\\n\\tuniform mat3 iridescenceMapTransform;\\n\\tvarying vec2 vIridescenceMapUv;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\tuniform mat3 iridescenceThicknessMapTransform;\\n\\tvarying vec2 vIridescenceThicknessMapUv;\\n#endif\\n#ifdef USE_SPECULARMAP\\n\\tuniform mat3 specularMapTransform;\\n\\tvarying vec2 vSpecularMapUv;\\n#endif\\n#ifdef USE_SPECULAR_COLORMAP\\n\\tuniform mat3 specularColorMapTransform;\\n\\tvarying vec2 vSpecularColorMapUv;\\n#endif\\n#ifdef USE_SPECULAR_INTENSITYMAP\\n\\tuniform mat3 specularIntensityMapTransform;\\n\\tvarying vec2 vSpecularIntensityMapUv;\\n#endif\\n#ifdef USE_TRANSMISSIONMAP\\n\\tuniform mat3 transmissionMapTransform;\\n\\tvarying vec2 vTransmissionMapUv;\\n#endif\\n#ifdef USE_THICKNESSMAP\\n\\tuniform mat3 thicknessMapTransform;\\n\\tvarying vec2 vThicknessMapUv;\\n#endif\";\n\nvar uv_vertex = \"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\\n\\tvUv = vec3( uv, 1 ).xy;\\n#endif\\n#ifdef USE_MAP\\n\\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_LIGHTMAP\\n\\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_AOMAP\\n\\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_BUMPMAP\\n\\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_NORMALMAP\\n\\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_DISPLACEMENTMAP\\n\\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_EMISSIVEMAP\\n\\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_METALNESSMAP\\n\\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_ROUGHNESSMAP\\n\\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_ANISOTROPYMAP\\n\\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_CLEARCOATMAP\\n\\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_IRIDESCENCEMAP\\n\\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SHEEN_COLORMAP\\n\\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SHEEN_ROUGHNESSMAP\\n\\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SPECULARMAP\\n\\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SPECULAR_COLORMAP\\n\\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_SPECULAR_INTENSITYMAP\\n\\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_TRANSMISSIONMAP\\n\\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\\n#endif\\n#ifdef USE_THICKNESSMAP\\n\\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\\n#endif\";\n\nvar worldpos_vertex = \"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\\n\\tvec4 worldPosition = vec4( transformed, 1.0 );\\n\\t#ifdef USE_BATCHING\\n\\t\\tworldPosition = batchingMatrix * worldPosition;\\n\\t#endif\\n\\t#ifdef USE_INSTANCING\\n\\t\\tworldPosition = instanceMatrix * worldPosition;\\n\\t#endif\\n\\tworldPosition = modelMatrix * worldPosition;\\n#endif\";\n\nconst vertex$h = \"varying vec2 vUv;\\nuniform mat3 uvTransform;\\nvoid main() {\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\\tgl_Position = vec4( position.xy, 1.0, 1.0 );\\n}\";\n\nconst fragment$h = \"uniform sampler2D t2D;\\nuniform float backgroundIntensity;\\nvarying vec2 vUv;\\nvoid main() {\\n\\tvec4 texColor = texture2D( t2D, vUv );\\n\\t#ifdef DECODE_VIDEO_TEXTURE\\n\\t\\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\\n\\t#endif\\n\\ttexColor.rgb *= backgroundIntensity;\\n\\tgl_FragColor = texColor;\\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$g = \"varying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include \\n\\t#include \\n\\tgl_Position.z = gl_Position.w;\\n}\";\n\nconst fragment$g = \"#ifdef ENVMAP_TYPE_CUBE\\n\\tuniform samplerCube envMap;\\n#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\tuniform sampler2D envMap;\\n#endif\\nuniform float flipEnvMap;\\nuniform float backgroundBlurriness;\\nuniform float backgroundIntensity;\\nuniform mat3 backgroundRotation;\\nvarying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\\n\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\\n\\t#else\\n\\t\\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\\n\\t#endif\\n\\ttexColor.rgb *= backgroundIntensity;\\n\\tgl_FragColor = texColor;\\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$f = \"varying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include \\n\\t#include \\n\\tgl_Position.z = gl_Position.w;\\n}\";\n\nconst fragment$f = \"uniform samplerCube tCube;\\nuniform float tFlip;\\nuniform float opacity;\\nvarying vec3 vWorldDirection;\\nvoid main() {\\n\\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\\n\\tgl_FragColor = texColor;\\n\\tgl_FragColor.a *= opacity;\\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$e = \"#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvHighPrecisionZW = gl_Position.zw;\\n}\";\n\nconst fragment$e = \"#if DEPTH_PACKING == 3200\\n\\tuniform float opacity;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#include \\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tdiffuseColor.a = opacity;\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\\n\\t#elif DEPTH_PACKING == 3201\\n\\t\\tgl_FragColor = packDepthToRGBA( fragCoordZ );\\n\\t#elif DEPTH_PACKING == 3202\\n\\t\\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\\n\\t#elif DEPTH_PACKING == 3203\\n\\t\\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\\n\\t#endif\\n}\";\n\nconst vertex$d = \"#define DISTANCE\\nvarying vec3 vWorldPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvWorldPosition = worldPosition.xyz;\\n}\";\n\nconst fragment$d = \"#define DISTANCE\\nuniform vec3 referencePosition;\\nuniform float nearDistance;\\nuniform float farDistance;\\nvarying vec3 vWorldPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main () {\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tfloat dist = length( vWorldPosition - referencePosition );\\n\\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\\n\\tdist = saturate( dist );\\n\\tgl_FragColor = packDepthToRGBA( dist );\\n}\";\n\nconst vertex$c = \"varying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$c = \"uniform sampler2D tEquirect;\\nvarying vec3 vWorldDirection;\\n#include \\nvoid main() {\\n\\tvec3 direction = normalize( vWorldDirection );\\n\\tvec2 sampleUV = equirectUv( direction );\\n\\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$b = \"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvLineDistance = scale * lineDistance;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$b = \"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\\t\\tdiscard;\\n\\t}\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$a = \"#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$a = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\\n\\t\\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vec3( 1.0 );\\n\\t#endif\\n\\t#include \\n\\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\\n\\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$9 = \"#define LAMBERT\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$9 = \"#define LAMBERT\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$8 = \"#define MATCAP\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n}\";\n\nconst fragment$8 = \"#define MATCAP\\nuniform vec3 diffuse;\\nuniform float opacity;\\nuniform sampler2D matcap;\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 viewDir = normalize( vViewPosition );\\n\\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\\n\\tvec3 y = cross( viewDir, x );\\n\\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\\n\\t#ifdef USE_MATCAP\\n\\t\\tvec4 matcapColor = texture2D( matcap, uv );\\n\\t#else\\n\\t\\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\\n\\t#endif\\n\\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$7 = \"#define NORMAL\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\\n\\tvViewPosition = - mvPosition.xyz;\\n#endif\\n}\";\n\nconst fragment$7 = \"#define NORMAL\\nuniform float opacity;\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\\n\\t#ifdef OPAQUE\\n\\t\\tgl_FragColor.a = 1.0;\\n\\t#endif\\n}\";\n\nconst vertex$6 = \"#define PHONG\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$6 = \"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$5 = \"#define STANDARD\\nvarying vec3 vViewPosition;\\n#ifdef USE_TRANSMISSION\\n\\tvarying vec3 vWorldPosition;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n#ifdef USE_TRANSMISSION\\n\\tvWorldPosition = worldPosition.xyz;\\n#endif\\n}\";\n\nconst fragment$5 = \"#define STANDARD\\n#ifdef PHYSICAL\\n\\t#define IOR\\n\\t#define USE_SPECULAR\\n#endif\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float roughness;\\nuniform float metalness;\\nuniform float opacity;\\n#ifdef IOR\\n\\tuniform float ior;\\n#endif\\n#ifdef USE_SPECULAR\\n\\tuniform float specularIntensity;\\n\\tuniform vec3 specularColor;\\n\\t#ifdef USE_SPECULAR_COLORMAP\\n\\t\\tuniform sampler2D specularColorMap;\\n\\t#endif\\n\\t#ifdef USE_SPECULAR_INTENSITYMAP\\n\\t\\tuniform sampler2D specularIntensityMap;\\n\\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tuniform float clearcoat;\\n\\tuniform float clearcoatRoughness;\\n#endif\\n#ifdef USE_DISPERSION\\n\\tuniform float dispersion;\\n#endif\\n#ifdef USE_IRIDESCENCE\\n\\tuniform float iridescence;\\n\\tuniform float iridescenceIOR;\\n\\tuniform float iridescenceThicknessMinimum;\\n\\tuniform float iridescenceThicknessMaximum;\\n#endif\\n#ifdef USE_SHEEN\\n\\tuniform vec3 sheenColor;\\n\\tuniform float sheenRoughness;\\n\\t#ifdef USE_SHEEN_COLORMAP\\n\\t\\tuniform sampler2D sheenColorMap;\\n\\t#endif\\n\\t#ifdef USE_SHEEN_ROUGHNESSMAP\\n\\t\\tuniform sampler2D sheenRoughnessMap;\\n\\t#endif\\n#endif\\n#ifdef USE_ANISOTROPY\\n\\tuniform vec2 anisotropyVector;\\n\\t#ifdef USE_ANISOTROPYMAP\\n\\t\\tuniform sampler2D anisotropyMap;\\n\\t#endif\\n#endif\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\\n\\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\\n\\t#include \\n\\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\\n\\t#ifdef USE_SHEEN\\n\\t\\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\\n\\t\\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\\n\\t\\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\\n\\t\\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$4 = \"#define TOON\\nvarying vec3 vViewPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$4 = \"#define TOON\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$3 = \"uniform float size;\\nuniform float scale;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#ifdef USE_POINTS_UV\\n\\tvarying vec2 vUv;\\n\\tuniform mat3 uvTransform;\\n#endif\\nvoid main() {\\n\\t#ifdef USE_POINTS_UV\\n\\t\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tgl_PointSize = size;\\n\\t#ifdef USE_SIZEATTENUATION\\n\\t\\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\\t\\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$3 = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$2 = \"#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$2 = \"uniform vec3 color;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst vertex$1 = \"uniform float rotation;\\nuniform vec2 center;\\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 mvPosition = modelViewMatrix[ 3 ];\\n\\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\\n\\t#ifndef USE_SIZEATTENUATION\\n\\t\\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\\t\\tif ( isPerspective ) scale *= - mvPosition.z;\\n\\t#endif\\n\\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\\n\\tvec2 rotatedPosition;\\n\\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\\n\\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\\n\\tmvPosition.xy += rotatedPosition;\\n\\tgl_Position = projectionMatrix * mvPosition;\\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst fragment$1 = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\";\n\nconst ShaderChunk = {\n\talphahash_fragment: alphahash_fragment,\n\talphahash_pars_fragment: alphahash_pars_fragment,\n\talphamap_fragment: alphamap_fragment,\n\talphamap_pars_fragment: alphamap_pars_fragment,\n\talphatest_fragment: alphatest_fragment,\n\talphatest_pars_fragment: alphatest_pars_fragment,\n\taomap_fragment: aomap_fragment,\n\taomap_pars_fragment: aomap_pars_fragment,\n\tbatching_pars_vertex: batching_pars_vertex,\n\tbatching_vertex: batching_vertex,\n\tbegin_vertex: begin_vertex,\n\tbeginnormal_vertex: beginnormal_vertex,\n\tbsdfs: bsdfs,\n\tiridescence_fragment: iridescence_fragment,\n\tbumpmap_pars_fragment: bumpmap_pars_fragment,\n\tclipping_planes_fragment: clipping_planes_fragment,\n\tclipping_planes_pars_fragment: clipping_planes_pars_fragment,\n\tclipping_planes_pars_vertex: clipping_planes_pars_vertex,\n\tclipping_planes_vertex: clipping_planes_vertex,\n\tcolor_fragment: color_fragment,\n\tcolor_pars_fragment: color_pars_fragment,\n\tcolor_pars_vertex: color_pars_vertex,\n\tcolor_vertex: color_vertex,\n\tcommon: common,\n\tcube_uv_reflection_fragment: cube_uv_reflection_fragment,\n\tdefaultnormal_vertex: defaultnormal_vertex,\n\tdisplacementmap_pars_vertex: displacementmap_pars_vertex,\n\tdisplacementmap_vertex: displacementmap_vertex,\n\temissivemap_fragment: emissivemap_fragment,\n\temissivemap_pars_fragment: emissivemap_pars_fragment,\n\tcolorspace_fragment: colorspace_fragment,\n\tcolorspace_pars_fragment: colorspace_pars_fragment,\n\tenvmap_fragment: envmap_fragment,\n\tenvmap_common_pars_fragment: envmap_common_pars_fragment,\n\tenvmap_pars_fragment: envmap_pars_fragment,\n\tenvmap_pars_vertex: envmap_pars_vertex,\n\tenvmap_physical_pars_fragment: envmap_physical_pars_fragment,\n\tenvmap_vertex: envmap_vertex,\n\tfog_vertex: fog_vertex,\n\tfog_pars_vertex: fog_pars_vertex,\n\tfog_fragment: fog_fragment,\n\tfog_pars_fragment: fog_pars_fragment,\n\tgradientmap_pars_fragment: gradientmap_pars_fragment,\n\tlightmap_pars_fragment: lightmap_pars_fragment,\n\tlights_lambert_fragment: lights_lambert_fragment,\n\tlights_lambert_pars_fragment: lights_lambert_pars_fragment,\n\tlights_pars_begin: lights_pars_begin,\n\tlights_toon_fragment: lights_toon_fragment,\n\tlights_toon_pars_fragment: lights_toon_pars_fragment,\n\tlights_phong_fragment: lights_phong_fragment,\n\tlights_phong_pars_fragment: lights_phong_pars_fragment,\n\tlights_physical_fragment: lights_physical_fragment,\n\tlights_physical_pars_fragment: lights_physical_pars_fragment,\n\tlights_fragment_begin: lights_fragment_begin,\n\tlights_fragment_maps: lights_fragment_maps,\n\tlights_fragment_end: lights_fragment_end,\n\tlogdepthbuf_fragment: logdepthbuf_fragment,\n\tlogdepthbuf_pars_fragment: logdepthbuf_pars_fragment,\n\tlogdepthbuf_pars_vertex: logdepthbuf_pars_vertex,\n\tlogdepthbuf_vertex: logdepthbuf_vertex,\n\tmap_fragment: map_fragment,\n\tmap_pars_fragment: map_pars_fragment,\n\tmap_particle_fragment: map_particle_fragment,\n\tmap_particle_pars_fragment: map_particle_pars_fragment,\n\tmetalnessmap_fragment: metalnessmap_fragment,\n\tmetalnessmap_pars_fragment: metalnessmap_pars_fragment,\n\tmorphinstance_vertex: morphinstance_vertex,\n\tmorphcolor_vertex: morphcolor_vertex,\n\tmorphnormal_vertex: morphnormal_vertex,\n\tmorphtarget_pars_vertex: morphtarget_pars_vertex,\n\tmorphtarget_vertex: morphtarget_vertex,\n\tnormal_fragment_begin: normal_fragment_begin,\n\tnormal_fragment_maps: normal_fragment_maps,\n\tnormal_pars_fragment: normal_pars_fragment,\n\tnormal_pars_vertex: normal_pars_vertex,\n\tnormal_vertex: normal_vertex,\n\tnormalmap_pars_fragment: normalmap_pars_fragment,\n\tclearcoat_normal_fragment_begin: clearcoat_normal_fragment_begin,\n\tclearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps,\n\tclearcoat_pars_fragment: clearcoat_pars_fragment,\n\tiridescence_pars_fragment: iridescence_pars_fragment,\n\topaque_fragment: opaque_fragment,\n\tpacking: packing,\n\tpremultiplied_alpha_fragment: premultiplied_alpha_fragment,\n\tproject_vertex: project_vertex,\n\tdithering_fragment: dithering_fragment,\n\tdithering_pars_fragment: dithering_pars_fragment,\n\troughnessmap_fragment: roughnessmap_fragment,\n\troughnessmap_pars_fragment: roughnessmap_pars_fragment,\n\tshadowmap_pars_fragment: shadowmap_pars_fragment,\n\tshadowmap_pars_vertex: shadowmap_pars_vertex,\n\tshadowmap_vertex: shadowmap_vertex,\n\tshadowmask_pars_fragment: shadowmask_pars_fragment,\n\tskinbase_vertex: skinbase_vertex,\n\tskinning_pars_vertex: skinning_pars_vertex,\n\tskinning_vertex: skinning_vertex,\n\tskinnormal_vertex: skinnormal_vertex,\n\tspecularmap_fragment: specularmap_fragment,\n\tspecularmap_pars_fragment: specularmap_pars_fragment,\n\ttonemapping_fragment: tonemapping_fragment,\n\ttonemapping_pars_fragment: tonemapping_pars_fragment,\n\ttransmission_fragment: transmission_fragment,\n\ttransmission_pars_fragment: transmission_pars_fragment,\n\tuv_pars_fragment: uv_pars_fragment,\n\tuv_pars_vertex: uv_pars_vertex,\n\tuv_vertex: uv_vertex,\n\tworldpos_vertex: worldpos_vertex,\n\n\tbackground_vert: vertex$h,\n\tbackground_frag: fragment$h,\n\tbackgroundCube_vert: vertex$g,\n\tbackgroundCube_frag: fragment$g,\n\tcube_vert: vertex$f,\n\tcube_frag: fragment$f,\n\tdepth_vert: vertex$e,\n\tdepth_frag: fragment$e,\n\tdistanceRGBA_vert: vertex$d,\n\tdistanceRGBA_frag: fragment$d,\n\tequirect_vert: vertex$c,\n\tequirect_frag: fragment$c,\n\tlinedashed_vert: vertex$b,\n\tlinedashed_frag: fragment$b,\n\tmeshbasic_vert: vertex$a,\n\tmeshbasic_frag: fragment$a,\n\tmeshlambert_vert: vertex$9,\n\tmeshlambert_frag: fragment$9,\n\tmeshmatcap_vert: vertex$8,\n\tmeshmatcap_frag: fragment$8,\n\tmeshnormal_vert: vertex$7,\n\tmeshnormal_frag: fragment$7,\n\tmeshphong_vert: vertex$6,\n\tmeshphong_frag: fragment$6,\n\tmeshphysical_vert: vertex$5,\n\tmeshphysical_frag: fragment$5,\n\tmeshtoon_vert: vertex$4,\n\tmeshtoon_frag: fragment$4,\n\tpoints_vert: vertex$3,\n\tpoints_frag: fragment$3,\n\tshadow_vert: vertex$2,\n\tshadow_frag: fragment$2,\n\tsprite_vert: vertex$1,\n\tsprite_frag: fragment$1\n};\n\n/**\n * Uniforms library for shared webgl shaders\n */\n\nconst UniformsLib = {\n\n\tcommon: {\n\n\t\tdiffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) },\n\t\topacity: { value: 1.0 },\n\n\t\tmap: { value: null },\n\t\tmapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\n\t\talphaMap: { value: null },\n\t\talphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\n\t\talphaTest: { value: 0 }\n\n\t},\n\n\tspecularmap: {\n\n\t\tspecularMap: { value: null },\n\t\tspecularMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tenvmap: {\n\n\t\tenvMap: { value: null },\n\t\tenvMapRotation: { value: /*@__PURE__*/ new Matrix3() },\n\t\tflipEnvMap: { value: - 1 },\n\t\treflectivity: { value: 1.0 }, // basic, lambert, phong\n\t\tior: { value: 1.5 }, // physical\n\t\trefractionRatio: { value: 0.98 }, // basic, lambert, phong\n\n\t},\n\n\taomap: {\n\n\t\taoMap: { value: null },\n\t\taoMapIntensity: { value: 1 },\n\t\taoMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tlightmap: {\n\n\t\tlightMap: { value: null },\n\t\tlightMapIntensity: { value: 1 },\n\t\tlightMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tbumpmap: {\n\n\t\tbumpMap: { value: null },\n\t\tbumpMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\tbumpScale: { value: 1 }\n\n\t},\n\n\tnormalmap: {\n\n\t\tnormalMap: { value: null },\n\t\tnormalMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\tnormalScale: { value: /*@__PURE__*/ new Vector2( 1, 1 ) }\n\n\t},\n\n\tdisplacementmap: {\n\n\t\tdisplacementMap: { value: null },\n\t\tdisplacementMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\tdisplacementScale: { value: 1 },\n\t\tdisplacementBias: { value: 0 }\n\n\t},\n\n\temissivemap: {\n\n\t\temissiveMap: { value: null },\n\t\temissiveMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tmetalnessmap: {\n\n\t\tmetalnessMap: { value: null },\n\t\tmetalnessMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\troughnessmap: {\n\n\t\troughnessMap: { value: null },\n\t\troughnessMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tgradientmap: {\n\n\t\tgradientMap: { value: null }\n\n\t},\n\n\tfog: {\n\n\t\tfogDensity: { value: 0.00025 },\n\t\tfogNear: { value: 1 },\n\t\tfogFar: { value: 2000 },\n\t\tfogColor: { value: /*@__PURE__*/ new Color( 0xffffff ) }\n\n\t},\n\n\tlights: {\n\n\t\tambientLightColor: { value: [] },\n\n\t\tlightProbe: { value: [] },\n\n\t\tdirectionalLights: { value: [], properties: {\n\t\t\tdirection: {},\n\t\t\tcolor: {}\n\t\t} },\n\n\t\tdirectionalLightShadows: { value: [], properties: {\n\t\t\tshadowIntensity: 1,\n\t\t\tshadowBias: {},\n\t\t\tshadowNormalBias: {},\n\t\t\tshadowRadius: {},\n\t\t\tshadowMapSize: {}\n\t\t} },\n\n\t\tdirectionalShadowMap: { value: [] },\n\t\tdirectionalShadowMatrix: { value: [] },\n\n\t\tspotLights: { value: [], properties: {\n\t\t\tcolor: {},\n\t\t\tposition: {},\n\t\t\tdirection: {},\n\t\t\tdistance: {},\n\t\t\tconeCos: {},\n\t\t\tpenumbraCos: {},\n\t\t\tdecay: {}\n\t\t} },\n\n\t\tspotLightShadows: { value: [], properties: {\n\t\t\tshadowIntensity: 1,\n\t\t\tshadowBias: {},\n\t\t\tshadowNormalBias: {},\n\t\t\tshadowRadius: {},\n\t\t\tshadowMapSize: {}\n\t\t} },\n\n\t\tspotLightMap: { value: [] },\n\t\tspotShadowMap: { value: [] },\n\t\tspotLightMatrix: { value: [] },\n\n\t\tpointLights: { value: [], properties: {\n\t\t\tcolor: {},\n\t\t\tposition: {},\n\t\t\tdecay: {},\n\t\t\tdistance: {}\n\t\t} },\n\n\t\tpointLightShadows: { value: [], properties: {\n\t\t\tshadowIntensity: 1,\n\t\t\tshadowBias: {},\n\t\t\tshadowNormalBias: {},\n\t\t\tshadowRadius: {},\n\t\t\tshadowMapSize: {},\n\t\t\tshadowCameraNear: {},\n\t\t\tshadowCameraFar: {}\n\t\t} },\n\n\t\tpointShadowMap: { value: [] },\n\t\tpointShadowMatrix: { value: [] },\n\n\t\themisphereLights: { value: [], properties: {\n\t\t\tdirection: {},\n\t\t\tskyColor: {},\n\t\t\tgroundColor: {}\n\t\t} },\n\n\t\t// TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src\n\t\trectAreaLights: { value: [], properties: {\n\t\t\tcolor: {},\n\t\t\tposition: {},\n\t\t\twidth: {},\n\t\t\theight: {}\n\t\t} },\n\n\t\tltc_1: { value: null },\n\t\tltc_2: { value: null }\n\n\t},\n\n\tpoints: {\n\n\t\tdiffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) },\n\t\topacity: { value: 1.0 },\n\t\tsize: { value: 1.0 },\n\t\tscale: { value: 1.0 },\n\t\tmap: { value: null },\n\t\talphaMap: { value: null },\n\t\talphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\talphaTest: { value: 0 },\n\t\tuvTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tsprite: {\n\n\t\tdiffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) },\n\t\topacity: { value: 1.0 },\n\t\tcenter: { value: /*@__PURE__*/ new Vector2( 0.5, 0.5 ) },\n\t\trotation: { value: 0.0 },\n\t\tmap: { value: null },\n\t\tmapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\talphaMap: { value: null },\n\t\talphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\talphaTest: { value: 0 }\n\n\t}\n\n};\n\nconst ShaderLib = {\n\n\tbasic: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.specularmap,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.fog\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshbasic_vert,\n\t\tfragmentShader: ShaderChunk.meshbasic_frag\n\n\t},\n\n\tlambert: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.specularmap,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new Color( 0x000000 ) }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshlambert_vert,\n\t\tfragmentShader: ShaderChunk.meshlambert_frag\n\n\t},\n\n\tphong: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.specularmap,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new Color( 0x000000 ) },\n\t\t\t\tspecular: { value: /*@__PURE__*/ new Color( 0x111111 ) },\n\t\t\t\tshininess: { value: 30 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshphong_vert,\n\t\tfragmentShader: ShaderChunk.meshphong_frag\n\n\t},\n\n\tstandard: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.roughnessmap,\n\t\t\tUniformsLib.metalnessmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new Color( 0x000000 ) },\n\t\t\t\troughness: { value: 1.0 },\n\t\t\t\tmetalness: { value: 0.0 },\n\t\t\t\tenvMapIntensity: { value: 1 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshphysical_vert,\n\t\tfragmentShader: ShaderChunk.meshphysical_frag\n\n\t},\n\n\ttoon: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.gradientmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new Color( 0x000000 ) }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshtoon_vert,\n\t\tfragmentShader: ShaderChunk.meshtoon_frag\n\n\t},\n\n\tmatcap: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.fog,\n\t\t\t{\n\t\t\t\tmatcap: { value: null }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshmatcap_vert,\n\t\tfragmentShader: ShaderChunk.meshmatcap_frag\n\n\t},\n\n\tpoints: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.points,\n\t\t\tUniformsLib.fog\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.points_vert,\n\t\tfragmentShader: ShaderChunk.points_frag\n\n\t},\n\n\tdashed: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.fog,\n\t\t\t{\n\t\t\t\tscale: { value: 1 },\n\t\t\t\tdashSize: { value: 1 },\n\t\t\t\ttotalSize: { value: 2 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.linedashed_vert,\n\t\tfragmentShader: ShaderChunk.linedashed_frag\n\n\t},\n\n\tdepth: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.displacementmap\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.depth_vert,\n\t\tfragmentShader: ShaderChunk.depth_frag\n\n\t},\n\n\tnormal: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\t{\n\t\t\t\topacity: { value: 1.0 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshnormal_vert,\n\t\tfragmentShader: ShaderChunk.meshnormal_frag\n\n\t},\n\n\tsprite: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.sprite,\n\t\t\tUniformsLib.fog\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.sprite_vert,\n\t\tfragmentShader: ShaderChunk.sprite_frag\n\n\t},\n\n\tbackground: {\n\n\t\tuniforms: {\n\t\t\tuvTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tt2D: { value: null },\n\t\t\tbackgroundIntensity: { value: 1 }\n\t\t},\n\n\t\tvertexShader: ShaderChunk.background_vert,\n\t\tfragmentShader: ShaderChunk.background_frag\n\n\t},\n\n\tbackgroundCube: {\n\n\t\tuniforms: {\n\t\t\tenvMap: { value: null },\n\t\t\tflipEnvMap: { value: - 1 },\n\t\t\tbackgroundBlurriness: { value: 0 },\n\t\t\tbackgroundIntensity: { value: 1 },\n\t\t\tbackgroundRotation: { value: /*@__PURE__*/ new Matrix3() }\n\t\t},\n\n\t\tvertexShader: ShaderChunk.backgroundCube_vert,\n\t\tfragmentShader: ShaderChunk.backgroundCube_frag\n\n\t},\n\n\tcube: {\n\n\t\tuniforms: {\n\t\t\ttCube: { value: null },\n\t\t\ttFlip: { value: - 1 },\n\t\t\topacity: { value: 1.0 }\n\t\t},\n\n\t\tvertexShader: ShaderChunk.cube_vert,\n\t\tfragmentShader: ShaderChunk.cube_frag\n\n\t},\n\n\tequirect: {\n\n\t\tuniforms: {\n\t\t\ttEquirect: { value: null },\n\t\t},\n\n\t\tvertexShader: ShaderChunk.equirect_vert,\n\t\tfragmentShader: ShaderChunk.equirect_frag\n\n\t},\n\n\tdistanceRGBA: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.displacementmap,\n\t\t\t{\n\t\t\t\treferencePosition: { value: /*@__PURE__*/ new Vector3() },\n\t\t\t\tnearDistance: { value: 1 },\n\t\t\t\tfarDistance: { value: 1000 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.distanceRGBA_vert,\n\t\tfragmentShader: ShaderChunk.distanceRGBA_frag\n\n\t},\n\n\tshadow: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.lights,\n\t\t\tUniformsLib.fog,\n\t\t\t{\n\t\t\t\tcolor: { value: /*@__PURE__*/ new Color( 0x00000 ) },\n\t\t\t\topacity: { value: 1.0 }\n\t\t\t},\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.shadow_vert,\n\t\tfragmentShader: ShaderChunk.shadow_frag\n\n\t}\n\n};\n\nShaderLib.physical = {\n\n\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\tShaderLib.standard.uniforms,\n\t\t{\n\t\t\tclearcoat: { value: 0 },\n\t\t\tclearcoatMap: { value: null },\n\t\t\tclearcoatMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tclearcoatNormalMap: { value: null },\n\t\t\tclearcoatNormalMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tclearcoatNormalScale: { value: /*@__PURE__*/ new Vector2( 1, 1 ) },\n\t\t\tclearcoatRoughness: { value: 0 },\n\t\t\tclearcoatRoughnessMap: { value: null },\n\t\t\tclearcoatRoughnessMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tdispersion: { value: 0 },\n\t\t\tiridescence: { value: 0 },\n\t\t\tiridescenceMap: { value: null },\n\t\t\tiridescenceMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tiridescenceIOR: { value: 1.3 },\n\t\t\tiridescenceThicknessMinimum: { value: 100 },\n\t\t\tiridescenceThicknessMaximum: { value: 400 },\n\t\t\tiridescenceThicknessMap: { value: null },\n\t\t\tiridescenceThicknessMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tsheen: { value: 0 },\n\t\t\tsheenColor: { value: /*@__PURE__*/ new Color( 0x000000 ) },\n\t\t\tsheenColorMap: { value: null },\n\t\t\tsheenColorMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tsheenRoughness: { value: 1 },\n\t\t\tsheenRoughnessMap: { value: null },\n\t\t\tsheenRoughnessMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\ttransmission: { value: 0 },\n\t\t\ttransmissionMap: { value: null },\n\t\t\ttransmissionMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\ttransmissionSamplerSize: { value: /*@__PURE__*/ new Vector2() },\n\t\t\ttransmissionSamplerMap: { value: null },\n\t\t\tthickness: { value: 0 },\n\t\t\tthicknessMap: { value: null },\n\t\t\tthicknessMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tattenuationDistance: { value: 0 },\n\t\t\tattenuationColor: { value: /*@__PURE__*/ new Color( 0x000000 ) },\n\t\t\tspecularColor: { value: /*@__PURE__*/ new Color( 1, 1, 1 ) },\n\t\t\tspecularColorMap: { value: null },\n\t\t\tspecularColorMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tspecularIntensity: { value: 1 },\n\t\t\tspecularIntensityMap: { value: null },\n\t\t\tspecularIntensityMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tanisotropyVector: { value: /*@__PURE__*/ new Vector2() },\n\t\t\tanisotropyMap: { value: null },\n\t\t\tanisotropyMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t}\n\t] ),\n\n\tvertexShader: ShaderChunk.meshphysical_vert,\n\tfragmentShader: ShaderChunk.meshphysical_frag\n\n};\n\nconst _rgb = { r: 0, b: 0, g: 0 };\nconst _e1$1 = /*@__PURE__*/ new Euler();\nconst _m1$1 = /*@__PURE__*/ new Matrix4();\n\nfunction WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, premultipliedAlpha ) {\n\n\tconst clearColor = new Color( 0x000000 );\n\tlet clearAlpha = alpha === true ? 0 : 1;\n\n\tlet planeMesh;\n\tlet boxMesh;\n\n\tlet currentBackground = null;\n\tlet currentBackgroundVersion = 0;\n\tlet currentTonemapping = null;\n\n\tfunction getBackground( scene ) {\n\n\t\tlet background = scene.isScene === true ? scene.background : null;\n\n\t\tif ( background && background.isTexture ) {\n\n\t\t\tconst usePMREM = scene.backgroundBlurriness > 0; // use PMREM if the user wants to blur the background\n\t\t\tbackground = ( usePMREM ? cubeuvmaps : cubemaps ).get( background );\n\n\t\t}\n\n\t\treturn background;\n\n\t}\n\n\tfunction render( scene ) {\n\n\t\tlet forceClear = false;\n\t\tconst background = getBackground( scene );\n\n\t\tif ( background === null ) {\n\n\t\t\tsetClear( clearColor, clearAlpha );\n\n\t\t} else if ( background && background.isColor ) {\n\n\t\t\tsetClear( background, 1 );\n\t\t\tforceClear = true;\n\n\t\t}\n\n\t\tconst environmentBlendMode = renderer.xr.getEnvironmentBlendMode();\n\n\t\tif ( environmentBlendMode === 'additive' ) {\n\n\t\t\tstate.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha );\n\n\t\t} else if ( environmentBlendMode === 'alpha-blend' ) {\n\n\t\t\tstate.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha );\n\n\t\t}\n\n\t\tif ( renderer.autoClear || forceClear ) {\n\n\t\t\t// buffers might not be writable which is required to ensure a correct clear\n\n\t\t\tstate.buffers.depth.setTest( true );\n\t\t\tstate.buffers.depth.setMask( true );\n\t\t\tstate.buffers.color.setMask( true );\n\n\t\t\trenderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );\n\n\t\t}\n\n\t}\n\n\tfunction addToRenderList( renderList, scene ) {\n\n\t\tconst background = getBackground( scene );\n\n\t\tif ( background && ( background.isCubeTexture || background.mapping === CubeUVReflectionMapping ) ) {\n\n\t\t\tif ( boxMesh === undefined ) {\n\n\t\t\t\tboxMesh = new Mesh(\n\t\t\t\t\tnew BoxGeometry( 1, 1, 1 ),\n\t\t\t\t\tnew ShaderMaterial( {\n\t\t\t\t\t\tname: 'BackgroundCubeMaterial',\n\t\t\t\t\t\tuniforms: cloneUniforms( ShaderLib.backgroundCube.uniforms ),\n\t\t\t\t\t\tvertexShader: ShaderLib.backgroundCube.vertexShader,\n\t\t\t\t\t\tfragmentShader: ShaderLib.backgroundCube.fragmentShader,\n\t\t\t\t\t\tside: BackSide,\n\t\t\t\t\t\tdepthTest: false,\n\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\tfog: false\n\t\t\t\t\t} )\n\t\t\t\t);\n\n\t\t\t\tboxMesh.geometry.deleteAttribute( 'normal' );\n\t\t\t\tboxMesh.geometry.deleteAttribute( 'uv' );\n\n\t\t\t\tboxMesh.onBeforeRender = function ( renderer, scene, camera ) {\n\n\t\t\t\t\tthis.matrixWorld.copyPosition( camera.matrixWorld );\n\n\t\t\t\t};\n\n\t\t\t\t// add \"envMap\" material property so the renderer can evaluate it like for built-in materials\n\t\t\t\tObject.defineProperty( boxMesh.material, 'envMap', {\n\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn this.uniforms.envMap.value;\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\tobjects.update( boxMesh );\n\n\t\t\t}\n\n\t\t\t_e1$1.copy( scene.backgroundRotation );\n\n\t\t\t// accommodate left-handed frame\n\t\t\t_e1$1.x *= - 1; _e1$1.y *= - 1; _e1$1.z *= - 1;\n\n\t\t\tif ( background.isCubeTexture && background.isRenderTargetTexture === false ) {\n\n\t\t\t\t// environment maps which are not cube render targets or PMREMs follow a different convention\n\t\t\t\t_e1$1.y *= - 1;\n\t\t\t\t_e1$1.z *= - 1;\n\n\t\t\t}\n\n\t\t\tboxMesh.material.uniforms.envMap.value = background;\n\t\t\tboxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? - 1 : 1;\n\t\t\tboxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;\n\t\t\tboxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;\n\t\t\tboxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4( _m1$1.makeRotationFromEuler( _e1$1 ) );\n\t\t\tboxMesh.material.toneMapped = ColorManagement.getTransfer( background.colorSpace ) !== SRGBTransfer;\n\n\t\t\tif ( currentBackground !== background ||\n\t\t\t\tcurrentBackgroundVersion !== background.version ||\n\t\t\t\tcurrentTonemapping !== renderer.toneMapping ) {\n\n\t\t\t\tboxMesh.material.needsUpdate = true;\n\n\t\t\t\tcurrentBackground = background;\n\t\t\t\tcurrentBackgroundVersion = background.version;\n\t\t\t\tcurrentTonemapping = renderer.toneMapping;\n\n\t\t\t}\n\n\t\t\tboxMesh.layers.enableAll();\n\n\t\t\t// push to the pre-sorted opaque render list\n\t\t\trenderList.unshift( boxMesh, boxMesh.geometry, boxMesh.material, 0, 0, null );\n\n\t\t} else if ( background && background.isTexture ) {\n\n\t\t\tif ( planeMesh === undefined ) {\n\n\t\t\t\tplaneMesh = new Mesh(\n\t\t\t\t\tnew PlaneGeometry( 2, 2 ),\n\t\t\t\t\tnew ShaderMaterial( {\n\t\t\t\t\t\tname: 'BackgroundMaterial',\n\t\t\t\t\t\tuniforms: cloneUniforms( ShaderLib.background.uniforms ),\n\t\t\t\t\t\tvertexShader: ShaderLib.background.vertexShader,\n\t\t\t\t\t\tfragmentShader: ShaderLib.background.fragmentShader,\n\t\t\t\t\t\tside: FrontSide,\n\t\t\t\t\t\tdepthTest: false,\n\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\tfog: false\n\t\t\t\t\t} )\n\t\t\t\t);\n\n\t\t\t\tplaneMesh.geometry.deleteAttribute( 'normal' );\n\n\t\t\t\t// add \"map\" material property so the renderer can evaluate it like for built-in materials\n\t\t\t\tObject.defineProperty( planeMesh.material, 'map', {\n\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn this.uniforms.t2D.value;\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\tobjects.update( planeMesh );\n\n\t\t\t}\n\n\t\t\tplaneMesh.material.uniforms.t2D.value = background;\n\t\t\tplaneMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;\n\t\t\tplaneMesh.material.toneMapped = ColorManagement.getTransfer( background.colorSpace ) !== SRGBTransfer;\n\n\t\t\tif ( background.matrixAutoUpdate === true ) {\n\n\t\t\t\tbackground.updateMatrix();\n\n\t\t\t}\n\n\t\t\tplaneMesh.material.uniforms.uvTransform.value.copy( background.matrix );\n\n\t\t\tif ( currentBackground !== background ||\n\t\t\t\tcurrentBackgroundVersion !== background.version ||\n\t\t\t\tcurrentTonemapping !== renderer.toneMapping ) {\n\n\t\t\t\tplaneMesh.material.needsUpdate = true;\n\n\t\t\t\tcurrentBackground = background;\n\t\t\t\tcurrentBackgroundVersion = background.version;\n\t\t\t\tcurrentTonemapping = renderer.toneMapping;\n\n\t\t\t}\n\n\t\t\tplaneMesh.layers.enableAll();\n\n\t\t\t// push to the pre-sorted opaque render list\n\t\t\trenderList.unshift( planeMesh, planeMesh.geometry, planeMesh.material, 0, 0, null );\n\n\t\t}\n\n\t}\n\n\tfunction setClear( color, alpha ) {\n\n\t\tcolor.getRGB( _rgb, getUnlitUniformColorSpace( renderer ) );\n\n\t\tstate.buffers.color.setClear( _rgb.r, _rgb.g, _rgb.b, alpha, premultipliedAlpha );\n\n\t}\n\n\treturn {\n\n\t\tgetClearColor: function () {\n\n\t\t\treturn clearColor;\n\n\t\t},\n\t\tsetClearColor: function ( color, alpha = 1 ) {\n\n\t\t\tclearColor.set( color );\n\t\t\tclearAlpha = alpha;\n\t\t\tsetClear( clearColor, clearAlpha );\n\n\t\t},\n\t\tgetClearAlpha: function () {\n\n\t\t\treturn clearAlpha;\n\n\t\t},\n\t\tsetClearAlpha: function ( alpha ) {\n\n\t\t\tclearAlpha = alpha;\n\t\t\tsetClear( clearColor, clearAlpha );\n\n\t\t},\n\t\trender: render,\n\t\taddToRenderList: addToRenderList\n\n\t};\n\n}\n\nfunction WebGLBindingStates( gl, attributes ) {\n\n\tconst maxVertexAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS );\n\n\tconst bindingStates = {};\n\n\tconst defaultState = createBindingState( null );\n\tlet currentState = defaultState;\n\tlet forceUpdate = false;\n\n\tfunction setup( object, material, program, geometry, index ) {\n\n\t\tlet updateBuffers = false;\n\n\t\tconst state = getBindingState( geometry, program, material );\n\n\t\tif ( currentState !== state ) {\n\n\t\t\tcurrentState = state;\n\t\t\tbindVertexArrayObject( currentState.object );\n\n\t\t}\n\n\t\tupdateBuffers = needsUpdate( object, geometry, program, index );\n\n\t\tif ( updateBuffers ) saveCache( object, geometry, program, index );\n\n\t\tif ( index !== null ) {\n\n\t\t\tattributes.update( index, gl.ELEMENT_ARRAY_BUFFER );\n\n\t\t}\n\n\t\tif ( updateBuffers || forceUpdate ) {\n\n\t\t\tforceUpdate = false;\n\n\t\t\tsetupVertexAttributes( object, material, program, geometry );\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tgl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, attributes.get( index ).buffer );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction createVertexArrayObject() {\n\n\t\treturn gl.createVertexArray();\n\n\t}\n\n\tfunction bindVertexArrayObject( vao ) {\n\n\t\treturn gl.bindVertexArray( vao );\n\n\t}\n\n\tfunction deleteVertexArrayObject( vao ) {\n\n\t\treturn gl.deleteVertexArray( vao );\n\n\t}\n\n\tfunction getBindingState( geometry, program, material ) {\n\n\t\tconst wireframe = ( material.wireframe === true );\n\n\t\tlet programMap = bindingStates[ geometry.id ];\n\n\t\tif ( programMap === undefined ) {\n\n\t\t\tprogramMap = {};\n\t\t\tbindingStates[ geometry.id ] = programMap;\n\n\t\t}\n\n\t\tlet stateMap = programMap[ program.id ];\n\n\t\tif ( stateMap === undefined ) {\n\n\t\t\tstateMap = {};\n\t\t\tprogramMap[ program.id ] = stateMap;\n\n\t\t}\n\n\t\tlet state = stateMap[ wireframe ];\n\n\t\tif ( state === undefined ) {\n\n\t\t\tstate = createBindingState( createVertexArrayObject() );\n\t\t\tstateMap[ wireframe ] = state;\n\n\t\t}\n\n\t\treturn state;\n\n\t}\n\n\tfunction createBindingState( vao ) {\n\n\t\tconst newAttributes = [];\n\t\tconst enabledAttributes = [];\n\t\tconst attributeDivisors = [];\n\n\t\tfor ( let i = 0; i < maxVertexAttributes; i ++ ) {\n\n\t\t\tnewAttributes[ i ] = 0;\n\t\t\tenabledAttributes[ i ] = 0;\n\t\t\tattributeDivisors[ i ] = 0;\n\n\t\t}\n\n\t\treturn {\n\n\t\t\t// for backward compatibility on non-VAO support browser\n\t\t\tgeometry: null,\n\t\t\tprogram: null,\n\t\t\twireframe: false,\n\n\t\t\tnewAttributes: newAttributes,\n\t\t\tenabledAttributes: enabledAttributes,\n\t\t\tattributeDivisors: attributeDivisors,\n\t\t\tobject: vao,\n\t\t\tattributes: {},\n\t\t\tindex: null\n\n\t\t};\n\n\t}\n\n\tfunction needsUpdate( object, geometry, program, index ) {\n\n\t\tconst cachedAttributes = currentState.attributes;\n\t\tconst geometryAttributes = geometry.attributes;\n\n\t\tlet attributesNum = 0;\n\n\t\tconst programAttributes = program.getAttributes();\n\n\t\tfor ( const name in programAttributes ) {\n\n\t\t\tconst programAttribute = programAttributes[ name ];\n\n\t\t\tif ( programAttribute.location >= 0 ) {\n\n\t\t\t\tconst cachedAttribute = cachedAttributes[ name ];\n\t\t\t\tlet geometryAttribute = geometryAttributes[ name ];\n\n\t\t\t\tif ( geometryAttribute === undefined ) {\n\n\t\t\t\t\tif ( name === 'instanceMatrix' && object.instanceMatrix ) geometryAttribute = object.instanceMatrix;\n\t\t\t\t\tif ( name === 'instanceColor' && object.instanceColor ) geometryAttribute = object.instanceColor;\n\n\t\t\t\t}\n\n\t\t\t\tif ( cachedAttribute === undefined ) return true;\n\n\t\t\t\tif ( cachedAttribute.attribute !== geometryAttribute ) return true;\n\n\t\t\t\tif ( geometryAttribute && cachedAttribute.data !== geometryAttribute.data ) return true;\n\n\t\t\t\tattributesNum ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( currentState.attributesNum !== attributesNum ) return true;\n\n\t\tif ( currentState.index !== index ) return true;\n\n\t\treturn false;\n\n\t}\n\n\tfunction saveCache( object, geometry, program, index ) {\n\n\t\tconst cache = {};\n\t\tconst attributes = geometry.attributes;\n\t\tlet attributesNum = 0;\n\n\t\tconst programAttributes = program.getAttributes();\n\n\t\tfor ( const name in programAttributes ) {\n\n\t\t\tconst programAttribute = programAttributes[ name ];\n\n\t\t\tif ( programAttribute.location >= 0 ) {\n\n\t\t\t\tlet attribute = attributes[ name ];\n\n\t\t\t\tif ( attribute === undefined ) {\n\n\t\t\t\t\tif ( name === 'instanceMatrix' && object.instanceMatrix ) attribute = object.instanceMatrix;\n\t\t\t\t\tif ( name === 'instanceColor' && object.instanceColor ) attribute = object.instanceColor;\n\n\t\t\t\t}\n\n\t\t\t\tconst data = {};\n\t\t\t\tdata.attribute = attribute;\n\n\t\t\t\tif ( attribute && attribute.data ) {\n\n\t\t\t\t\tdata.data = attribute.data;\n\n\t\t\t\t}\n\n\t\t\t\tcache[ name ] = data;\n\n\t\t\t\tattributesNum ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tcurrentState.attributes = cache;\n\t\tcurrentState.attributesNum = attributesNum;\n\n\t\tcurrentState.index = index;\n\n\t}\n\n\tfunction initAttributes() {\n\n\t\tconst newAttributes = currentState.newAttributes;\n\n\t\tfor ( let i = 0, il = newAttributes.length; i < il; i ++ ) {\n\n\t\t\tnewAttributes[ i ] = 0;\n\n\t\t}\n\n\t}\n\n\tfunction enableAttribute( attribute ) {\n\n\t\tenableAttributeAndDivisor( attribute, 0 );\n\n\t}\n\n\tfunction enableAttributeAndDivisor( attribute, meshPerAttribute ) {\n\n\t\tconst newAttributes = currentState.newAttributes;\n\t\tconst enabledAttributes = currentState.enabledAttributes;\n\t\tconst attributeDivisors = currentState.attributeDivisors;\n\n\t\tnewAttributes[ attribute ] = 1;\n\n\t\tif ( enabledAttributes[ attribute ] === 0 ) {\n\n\t\t\tgl.enableVertexAttribArray( attribute );\n\t\t\tenabledAttributes[ attribute ] = 1;\n\n\t\t}\n\n\t\tif ( attributeDivisors[ attribute ] !== meshPerAttribute ) {\n\n\t\t\tgl.vertexAttribDivisor( attribute, meshPerAttribute );\n\t\t\tattributeDivisors[ attribute ] = meshPerAttribute;\n\n\t\t}\n\n\t}\n\n\tfunction disableUnusedAttributes() {\n\n\t\tconst newAttributes = currentState.newAttributes;\n\t\tconst enabledAttributes = currentState.enabledAttributes;\n\n\t\tfor ( let i = 0, il = enabledAttributes.length; i < il; i ++ ) {\n\n\t\t\tif ( enabledAttributes[ i ] !== newAttributes[ i ] ) {\n\n\t\t\t\tgl.disableVertexAttribArray( i );\n\t\t\t\tenabledAttributes[ i ] = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction vertexAttribPointer( index, size, type, normalized, stride, offset, integer ) {\n\n\t\tif ( integer === true ) {\n\n\t\t\tgl.vertexAttribIPointer( index, size, type, stride, offset );\n\n\t\t} else {\n\n\t\t\tgl.vertexAttribPointer( index, size, type, normalized, stride, offset );\n\n\t\t}\n\n\t}\n\n\tfunction setupVertexAttributes( object, material, program, geometry ) {\n\n\t\tinitAttributes();\n\n\t\tconst geometryAttributes = geometry.attributes;\n\n\t\tconst programAttributes = program.getAttributes();\n\n\t\tconst materialDefaultAttributeValues = material.defaultAttributeValues;\n\n\t\tfor ( const name in programAttributes ) {\n\n\t\t\tconst programAttribute = programAttributes[ name ];\n\n\t\t\tif ( programAttribute.location >= 0 ) {\n\n\t\t\t\tlet geometryAttribute = geometryAttributes[ name ];\n\n\t\t\t\tif ( geometryAttribute === undefined ) {\n\n\t\t\t\t\tif ( name === 'instanceMatrix' && object.instanceMatrix ) geometryAttribute = object.instanceMatrix;\n\t\t\t\t\tif ( name === 'instanceColor' && object.instanceColor ) geometryAttribute = object.instanceColor;\n\n\t\t\t\t}\n\n\t\t\t\tif ( geometryAttribute !== undefined ) {\n\n\t\t\t\t\tconst normalized = geometryAttribute.normalized;\n\t\t\t\t\tconst size = geometryAttribute.itemSize;\n\n\t\t\t\t\tconst attribute = attributes.get( geometryAttribute );\n\n\t\t\t\t\t// TODO Attribute may not be available on context restore\n\n\t\t\t\t\tif ( attribute === undefined ) continue;\n\n\t\t\t\t\tconst buffer = attribute.buffer;\n\t\t\t\t\tconst type = attribute.type;\n\t\t\t\t\tconst bytesPerElement = attribute.bytesPerElement;\n\n\t\t\t\t\t// check for integer attributes\n\n\t\t\t\t\tconst integer = ( type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType );\n\n\t\t\t\t\tif ( geometryAttribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\t\tconst data = geometryAttribute.data;\n\t\t\t\t\t\tconst stride = data.stride;\n\t\t\t\t\t\tconst offset = geometryAttribute.offset;\n\n\t\t\t\t\t\tif ( data.isInstancedInterleavedBuffer ) {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttributeAndDivisor( programAttribute.location + i, data.meshPerAttribute );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined ) {\n\n\t\t\t\t\t\t\t\tgeometry._maxInstanceCount = data.meshPerAttribute * data.count;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttribute( programAttribute.location + i );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer );\n\n\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\tvertexAttribPointer(\n\t\t\t\t\t\t\t\tprogramAttribute.location + i,\n\t\t\t\t\t\t\t\tsize / programAttribute.locationSize,\n\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\tnormalized,\n\t\t\t\t\t\t\t\tstride * bytesPerElement,\n\t\t\t\t\t\t\t\t( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement,\n\t\t\t\t\t\t\t\tinteger\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( geometryAttribute.isInstancedBufferAttribute ) {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttributeAndDivisor( programAttribute.location + i, geometryAttribute.meshPerAttribute );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined ) {\n\n\t\t\t\t\t\t\t\tgeometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttribute( programAttribute.location + i );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer );\n\n\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\tvertexAttribPointer(\n\t\t\t\t\t\t\t\tprogramAttribute.location + i,\n\t\t\t\t\t\t\t\tsize / programAttribute.locationSize,\n\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\tnormalized,\n\t\t\t\t\t\t\t\tsize * bytesPerElement,\n\t\t\t\t\t\t\t\t( size / programAttribute.locationSize ) * i * bytesPerElement,\n\t\t\t\t\t\t\t\tinteger\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( materialDefaultAttributeValues !== undefined ) {\n\n\t\t\t\t\tconst value = materialDefaultAttributeValues[ name ];\n\n\t\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\t\tswitch ( value.length ) {\n\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tgl.vertexAttrib2fv( programAttribute.location, value );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tgl.vertexAttrib3fv( programAttribute.location, value );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tgl.vertexAttrib4fv( programAttribute.location, value );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tgl.vertexAttrib1fv( programAttribute.location, value );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tdisableUnusedAttributes();\n\n\t}\n\n\tfunction dispose() {\n\n\t\treset();\n\n\t\tfor ( const geometryId in bindingStates ) {\n\n\t\t\tconst programMap = bindingStates[ geometryId ];\n\n\t\t\tfor ( const programId in programMap ) {\n\n\t\t\t\tconst stateMap = programMap[ programId ];\n\n\t\t\t\tfor ( const wireframe in stateMap ) {\n\n\t\t\t\t\tdeleteVertexArrayObject( stateMap[ wireframe ].object );\n\n\t\t\t\t\tdelete stateMap[ wireframe ];\n\n\t\t\t\t}\n\n\t\t\t\tdelete programMap[ programId ];\n\n\t\t\t}\n\n\t\t\tdelete bindingStates[ geometryId ];\n\n\t\t}\n\n\t}\n\n\tfunction releaseStatesOfGeometry( geometry ) {\n\n\t\tif ( bindingStates[ geometry.id ] === undefined ) return;\n\n\t\tconst programMap = bindingStates[ geometry.id ];\n\n\t\tfor ( const programId in programMap ) {\n\n\t\t\tconst stateMap = programMap[ programId ];\n\n\t\t\tfor ( const wireframe in stateMap ) {\n\n\t\t\t\tdeleteVertexArrayObject( stateMap[ wireframe ].object );\n\n\t\t\t\tdelete stateMap[ wireframe ];\n\n\t\t\t}\n\n\t\t\tdelete programMap[ programId ];\n\n\t\t}\n\n\t\tdelete bindingStates[ geometry.id ];\n\n\t}\n\n\tfunction releaseStatesOfProgram( program ) {\n\n\t\tfor ( const geometryId in bindingStates ) {\n\n\t\t\tconst programMap = bindingStates[ geometryId ];\n\n\t\t\tif ( programMap[ program.id ] === undefined ) continue;\n\n\t\t\tconst stateMap = programMap[ program.id ];\n\n\t\t\tfor ( const wireframe in stateMap ) {\n\n\t\t\t\tdeleteVertexArrayObject( stateMap[ wireframe ].object );\n\n\t\t\t\tdelete stateMap[ wireframe ];\n\n\t\t\t}\n\n\t\t\tdelete programMap[ program.id ];\n\n\t\t}\n\n\t}\n\n\tfunction reset() {\n\n\t\tresetDefaultState();\n\t\tforceUpdate = true;\n\n\t\tif ( currentState === defaultState ) return;\n\n\t\tcurrentState = defaultState;\n\t\tbindVertexArrayObject( currentState.object );\n\n\t}\n\n\t// for backward-compatibility\n\n\tfunction resetDefaultState() {\n\n\t\tdefaultState.geometry = null;\n\t\tdefaultState.program = null;\n\t\tdefaultState.wireframe = false;\n\n\t}\n\n\treturn {\n\n\t\tsetup: setup,\n\t\treset: reset,\n\t\tresetDefaultState: resetDefaultState,\n\t\tdispose: dispose,\n\t\treleaseStatesOfGeometry: releaseStatesOfGeometry,\n\t\treleaseStatesOfProgram: releaseStatesOfProgram,\n\n\t\tinitAttributes: initAttributes,\n\t\tenableAttribute: enableAttribute,\n\t\tdisableUnusedAttributes: disableUnusedAttributes\n\n\t};\n\n}\n\nfunction WebGLBufferRenderer( gl, extensions, info ) {\n\n\tlet mode;\n\n\tfunction setMode( value ) {\n\n\t\tmode = value;\n\n\t}\n\n\tfunction render( start, count ) {\n\n\t\tgl.drawArrays( mode, start, count );\n\n\t\tinfo.update( count, mode, 1 );\n\n\t}\n\n\tfunction renderInstances( start, count, primcount ) {\n\n\t\tif ( primcount === 0 ) return;\n\n\t\tgl.drawArraysInstanced( mode, start, count, primcount );\n\n\t\tinfo.update( count, mode, primcount );\n\n\t}\n\n\tfunction renderMultiDraw( starts, counts, drawCount ) {\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\tconst extension = extensions.get( 'WEBGL_multi_draw' );\n\t\textension.multiDrawArraysWEBGL( mode, starts, 0, counts, 0, drawCount );\n\n\t\tlet elementCount = 0;\n\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\telementCount += counts[ i ];\n\n\t\t}\n\n\t\tinfo.update( elementCount, mode, 1 );\n\n\t}\n\n\tfunction renderMultiDrawInstances( starts, counts, drawCount, primcount ) {\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\tconst extension = extensions.get( 'WEBGL_multi_draw' );\n\n\t\tif ( extension === null ) {\n\n\t\t\tfor ( let i = 0; i < starts.length; i ++ ) {\n\n\t\t\t\trenderInstances( starts[ i ], counts[ i ], primcount[ i ] );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\textension.multiDrawArraysInstancedWEBGL( mode, starts, 0, counts, 0, primcount, 0, drawCount );\n\n\t\t\tlet elementCount = 0;\n\t\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\t\telementCount += counts[ i ] * primcount[ i ];\n\n\t\t\t}\n\n\t\t\tinfo.update( elementCount, mode, 1 );\n\n\t\t}\n\n\t}\n\n\t//\n\n\tthis.setMode = setMode;\n\tthis.render = render;\n\tthis.renderInstances = renderInstances;\n\tthis.renderMultiDraw = renderMultiDraw;\n\tthis.renderMultiDrawInstances = renderMultiDrawInstances;\n\n}\n\nfunction WebGLCapabilities( gl, extensions, parameters, utils ) {\n\n\tlet maxAnisotropy;\n\n\tfunction getMaxAnisotropy() {\n\n\t\tif ( maxAnisotropy !== undefined ) return maxAnisotropy;\n\n\t\tif ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {\n\n\t\t\tconst extension = extensions.get( 'EXT_texture_filter_anisotropic' );\n\n\t\t\tmaxAnisotropy = gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT );\n\n\t\t} else {\n\n\t\t\tmaxAnisotropy = 0;\n\n\t\t}\n\n\t\treturn maxAnisotropy;\n\n\t}\n\n\tfunction textureFormatReadable( textureFormat ) {\n\n\t\tif ( textureFormat !== RGBAFormat && utils.convert( textureFormat ) !== gl.getParameter( gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tfunction textureTypeReadable( textureType ) {\n\n\t\tconst halfFloatSupportedByExt = ( textureType === HalfFloatType ) && ( extensions.has( 'EXT_color_buffer_half_float' ) || extensions.has( 'EXT_color_buffer_float' ) );\n\n\t\tif ( textureType !== UnsignedByteType && utils.convert( textureType ) !== gl.getParameter( gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // Edge and Chrome Mac < 52 (#9513)\n\t\t\ttextureType !== FloatType && ! halfFloatSupportedByExt ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tfunction getMaxPrecision( precision ) {\n\n\t\tif ( precision === 'highp' ) {\n\n\t\t\tif ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.HIGH_FLOAT ).precision > 0 &&\n\t\t\t\tgl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).precision > 0 ) {\n\n\t\t\t\treturn 'highp';\n\n\t\t\t}\n\n\t\t\tprecision = 'mediump';\n\n\t\t}\n\n\t\tif ( precision === 'mediump' ) {\n\n\t\t\tif ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).precision > 0 &&\n\t\t\t\tgl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).precision > 0 ) {\n\n\t\t\t\treturn 'mediump';\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn 'lowp';\n\n\t}\n\n\tlet precision = parameters.precision !== undefined ? parameters.precision : 'highp';\n\tconst maxPrecision = getMaxPrecision( precision );\n\n\tif ( maxPrecision !== precision ) {\n\n\t\tconsole.warn( 'THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' );\n\t\tprecision = maxPrecision;\n\n\t}\n\n\tconst logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true;\n\tconst reverseDepthBuffer = parameters.reverseDepthBuffer === true && extensions.has( 'EXT_clip_control' );\n\n\tconst maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS );\n\tconst maxVertexTextures = gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS );\n\tconst maxTextureSize = gl.getParameter( gl.MAX_TEXTURE_SIZE );\n\tconst maxCubemapSize = gl.getParameter( gl.MAX_CUBE_MAP_TEXTURE_SIZE );\n\n\tconst maxAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS );\n\tconst maxVertexUniforms = gl.getParameter( gl.MAX_VERTEX_UNIFORM_VECTORS );\n\tconst maxVaryings = gl.getParameter( gl.MAX_VARYING_VECTORS );\n\tconst maxFragmentUniforms = gl.getParameter( gl.MAX_FRAGMENT_UNIFORM_VECTORS );\n\n\tconst vertexTextures = maxVertexTextures > 0;\n\n\tconst maxSamples = gl.getParameter( gl.MAX_SAMPLES );\n\n\treturn {\n\n\t\tisWebGL2: true, // keeping this for backwards compatibility\n\n\t\tgetMaxAnisotropy: getMaxAnisotropy,\n\t\tgetMaxPrecision: getMaxPrecision,\n\n\t\ttextureFormatReadable: textureFormatReadable,\n\t\ttextureTypeReadable: textureTypeReadable,\n\n\t\tprecision: precision,\n\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\t\treverseDepthBuffer: reverseDepthBuffer,\n\n\t\tmaxTextures: maxTextures,\n\t\tmaxVertexTextures: maxVertexTextures,\n\t\tmaxTextureSize: maxTextureSize,\n\t\tmaxCubemapSize: maxCubemapSize,\n\n\t\tmaxAttributes: maxAttributes,\n\t\tmaxVertexUniforms: maxVertexUniforms,\n\t\tmaxVaryings: maxVaryings,\n\t\tmaxFragmentUniforms: maxFragmentUniforms,\n\n\t\tvertexTextures: vertexTextures,\n\n\t\tmaxSamples: maxSamples\n\n\t};\n\n}\n\nfunction WebGLClipping( properties ) {\n\n\tconst scope = this;\n\n\tlet globalState = null,\n\t\tnumGlobalPlanes = 0,\n\t\tlocalClippingEnabled = false,\n\t\trenderingShadows = false;\n\n\tconst plane = new Plane(),\n\t\tviewNormalMatrix = new Matrix3(),\n\n\t\tuniform = { value: null, needsUpdate: false };\n\n\tthis.uniform = uniform;\n\tthis.numPlanes = 0;\n\tthis.numIntersection = 0;\n\n\tthis.init = function ( planes, enableLocalClipping ) {\n\n\t\tconst enabled =\n\t\t\tplanes.length !== 0 ||\n\t\t\tenableLocalClipping ||\n\t\t\t// enable state of previous frame - the clipping code has to\n\t\t\t// run another frame in order to reset the state:\n\t\t\tnumGlobalPlanes !== 0 ||\n\t\t\tlocalClippingEnabled;\n\n\t\tlocalClippingEnabled = enableLocalClipping;\n\n\t\tnumGlobalPlanes = planes.length;\n\n\t\treturn enabled;\n\n\t};\n\n\tthis.beginShadows = function () {\n\n\t\trenderingShadows = true;\n\t\tprojectPlanes( null );\n\n\t};\n\n\tthis.endShadows = function () {\n\n\t\trenderingShadows = false;\n\n\t};\n\n\tthis.setGlobalState = function ( planes, camera ) {\n\n\t\tglobalState = projectPlanes( planes, camera, 0 );\n\n\t};\n\n\tthis.setState = function ( material, camera, useCache ) {\n\n\t\tconst planes = material.clippingPlanes,\n\t\t\tclipIntersection = material.clipIntersection,\n\t\t\tclipShadows = material.clipShadows;\n\n\t\tconst materialProperties = properties.get( material );\n\n\t\tif ( ! localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && ! clipShadows ) {\n\n\t\t\t// there's no local clipping\n\n\t\t\tif ( renderingShadows ) {\n\n\t\t\t\t// there's no global clipping\n\n\t\t\t\tprojectPlanes( null );\n\n\t\t\t} else {\n\n\t\t\t\tresetGlobalState();\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst nGlobal = renderingShadows ? 0 : numGlobalPlanes,\n\t\t\t\tlGlobal = nGlobal * 4;\n\n\t\t\tlet dstArray = materialProperties.clippingState || null;\n\n\t\t\tuniform.value = dstArray; // ensure unique state\n\n\t\t\tdstArray = projectPlanes( planes, camera, lGlobal, useCache );\n\n\t\t\tfor ( let i = 0; i !== lGlobal; ++ i ) {\n\n\t\t\t\tdstArray[ i ] = globalState[ i ];\n\n\t\t\t}\n\n\t\t\tmaterialProperties.clippingState = dstArray;\n\t\t\tthis.numIntersection = clipIntersection ? this.numPlanes : 0;\n\t\t\tthis.numPlanes += nGlobal;\n\n\t\t}\n\n\n\t};\n\n\tfunction resetGlobalState() {\n\n\t\tif ( uniform.value !== globalState ) {\n\n\t\t\tuniform.value = globalState;\n\t\t\tuniform.needsUpdate = numGlobalPlanes > 0;\n\n\t\t}\n\n\t\tscope.numPlanes = numGlobalPlanes;\n\t\tscope.numIntersection = 0;\n\n\t}\n\n\tfunction projectPlanes( planes, camera, dstOffset, skipTransform ) {\n\n\t\tconst nPlanes = planes !== null ? planes.length : 0;\n\t\tlet dstArray = null;\n\n\t\tif ( nPlanes !== 0 ) {\n\n\t\t\tdstArray = uniform.value;\n\n\t\t\tif ( skipTransform !== true || dstArray === null ) {\n\n\t\t\t\tconst flatSize = dstOffset + nPlanes * 4,\n\t\t\t\t\tviewMatrix = camera.matrixWorldInverse;\n\n\t\t\t\tviewNormalMatrix.getNormalMatrix( viewMatrix );\n\n\t\t\t\tif ( dstArray === null || dstArray.length < flatSize ) {\n\n\t\t\t\t\tdstArray = new Float32Array( flatSize );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0, i4 = dstOffset; i !== nPlanes; ++ i, i4 += 4 ) {\n\n\t\t\t\t\tplane.copy( planes[ i ] ).applyMatrix4( viewMatrix, viewNormalMatrix );\n\n\t\t\t\t\tplane.normal.toArray( dstArray, i4 );\n\t\t\t\t\tdstArray[ i4 + 3 ] = plane.constant;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tuniform.value = dstArray;\n\t\t\tuniform.needsUpdate = true;\n\n\t\t}\n\n\t\tscope.numPlanes = nPlanes;\n\t\tscope.numIntersection = 0;\n\n\t\treturn dstArray;\n\n\t}\n\n}\n\nfunction WebGLCubeMaps( renderer ) {\n\n\tlet cubemaps = new WeakMap();\n\n\tfunction mapTextureMapping( texture, mapping ) {\n\n\t\tif ( mapping === EquirectangularReflectionMapping ) {\n\n\t\t\ttexture.mapping = CubeReflectionMapping;\n\n\t\t} else if ( mapping === EquirectangularRefractionMapping ) {\n\n\t\t\ttexture.mapping = CubeRefractionMapping;\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tfunction get( texture ) {\n\n\t\tif ( texture && texture.isTexture ) {\n\n\t\t\tconst mapping = texture.mapping;\n\n\t\t\tif ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping ) {\n\n\t\t\t\tif ( cubemaps.has( texture ) ) {\n\n\t\t\t\t\tconst cubemap = cubemaps.get( texture ).texture;\n\t\t\t\t\treturn mapTextureMapping( cubemap, texture.mapping );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconst image = texture.image;\n\n\t\t\t\t\tif ( image && image.height > 0 ) {\n\n\t\t\t\t\t\tconst renderTarget = new WebGLCubeRenderTarget( image.height );\n\t\t\t\t\t\trenderTarget.fromEquirectangularTexture( renderer, texture );\n\t\t\t\t\t\tcubemaps.set( texture, renderTarget );\n\n\t\t\t\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t\t\t\t\treturn mapTextureMapping( renderTarget.texture, texture.mapping );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// image not yet ready. try the conversion next frame\n\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tfunction onTextureDispose( event ) {\n\n\t\tconst texture = event.target;\n\n\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\tconst cubemap = cubemaps.get( texture );\n\n\t\tif ( cubemap !== undefined ) {\n\n\t\t\tcubemaps.delete( texture );\n\t\t\tcubemap.dispose();\n\n\t\t}\n\n\t}\n\n\tfunction dispose() {\n\n\t\tcubemaps = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nclass OrthographicCamera extends Camera {\n\n\tconstructor( left = - 1, right = 1, top = 1, bottom = - 1, near = 0.1, far = 2000 ) {\n\n\t\tsuper();\n\n\t\tthis.isOrthographicCamera = true;\n\n\t\tthis.type = 'OrthographicCamera';\n\n\t\tthis.zoom = 1;\n\t\tthis.view = null;\n\n\t\tthis.left = left;\n\t\tthis.right = right;\n\t\tthis.top = top;\n\t\tthis.bottom = bottom;\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.left = source.left;\n\t\tthis.right = source.right;\n\t\tthis.top = source.top;\n\t\tthis.bottom = source.bottom;\n\t\tthis.near = source.near;\n\t\tthis.far = source.far;\n\n\t\tthis.zoom = source.zoom;\n\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\treturn this;\n\n\t}\n\n\tsetViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\tif ( this.view === null ) {\n\n\t\t\tthis.view = {\n\t\t\t\tenabled: true,\n\t\t\t\tfullWidth: 1,\n\t\t\t\tfullHeight: 1,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t\twidth: 1,\n\t\t\t\theight: 1\n\t\t\t};\n\n\t\t}\n\n\t\tthis.view.enabled = true;\n\t\tthis.view.fullWidth = fullWidth;\n\t\tthis.view.fullHeight = fullHeight;\n\t\tthis.view.offsetX = x;\n\t\tthis.view.offsetY = y;\n\t\tthis.view.width = width;\n\t\tthis.view.height = height;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tclearViewOffset() {\n\n\t\tif ( this.view !== null ) {\n\n\t\t\tthis.view.enabled = false;\n\n\t\t}\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tupdateProjectionMatrix() {\n\n\t\tconst dx = ( this.right - this.left ) / ( 2 * this.zoom );\n\t\tconst dy = ( this.top - this.bottom ) / ( 2 * this.zoom );\n\t\tconst cx = ( this.right + this.left ) / 2;\n\t\tconst cy = ( this.top + this.bottom ) / 2;\n\n\t\tlet left = cx - dx;\n\t\tlet right = cx + dx;\n\t\tlet top = cy + dy;\n\t\tlet bottom = cy - dy;\n\n\t\tif ( this.view !== null && this.view.enabled ) {\n\n\t\t\tconst scaleW = ( this.right - this.left ) / this.view.fullWidth / this.zoom;\n\t\t\tconst scaleH = ( this.top - this.bottom ) / this.view.fullHeight / this.zoom;\n\n\t\t\tleft += scaleW * this.view.offsetX;\n\t\t\tright = left + scaleW * this.view.width;\n\t\t\ttop -= scaleH * this.view.offsetY;\n\t\t\tbottom = top - scaleH * this.view.height;\n\n\t\t}\n\n\t\tthis.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem );\n\n\t\tthis.projectionMatrixInverse.copy( this.projectionMatrix ).invert();\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.zoom = this.zoom;\n\t\tdata.object.left = this.left;\n\t\tdata.object.right = this.right;\n\t\tdata.object.top = this.top;\n\t\tdata.object.bottom = this.bottom;\n\t\tdata.object.near = this.near;\n\t\tdata.object.far = this.far;\n\n\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst LOD_MIN = 4;\n\n// The standard deviations (radians) associated with the extra mips. These are\n// chosen to approximate a Trowbridge-Reitz distribution function times the\n// geometric shadowing function. These sigma values squared must match the\n// variance #defines in cube_uv_reflection_fragment.glsl.js.\nconst EXTRA_LOD_SIGMA = [ 0.125, 0.215, 0.35, 0.446, 0.526, 0.582 ];\n\n// The maximum length of the blur for loop. Smaller sigmas will use fewer\n// samples and exit early, but not recompile the shader.\nconst MAX_SAMPLES = 20;\n\nconst _flatCamera = /*@__PURE__*/ new OrthographicCamera();\nconst _clearColor = /*@__PURE__*/ new Color();\nlet _oldTarget = null;\nlet _oldActiveCubeFace = 0;\nlet _oldActiveMipmapLevel = 0;\nlet _oldXrEnabled = false;\n\n// Golden Ratio\nconst PHI = ( 1 + Math.sqrt( 5 ) ) / 2;\nconst INV_PHI = 1 / PHI;\n\n// Vertices of a dodecahedron (except the opposites, which represent the\n// same axis), used as axis directions evenly spread on a sphere.\nconst _axisDirections = [\n\t/*@__PURE__*/ new Vector3( - PHI, INV_PHI, 0 ),\n\t/*@__PURE__*/ new Vector3( PHI, INV_PHI, 0 ),\n\t/*@__PURE__*/ new Vector3( - INV_PHI, 0, PHI ),\n\t/*@__PURE__*/ new Vector3( INV_PHI, 0, PHI ),\n\t/*@__PURE__*/ new Vector3( 0, PHI, - INV_PHI ),\n\t/*@__PURE__*/ new Vector3( 0, PHI, INV_PHI ),\n\t/*@__PURE__*/ new Vector3( - 1, 1, - 1 ),\n\t/*@__PURE__*/ new Vector3( 1, 1, - 1 ),\n\t/*@__PURE__*/ new Vector3( - 1, 1, 1 ),\n\t/*@__PURE__*/ new Vector3( 1, 1, 1 ) ];\n\n/**\n * This class generates a Prefiltered, Mipmapped Radiance Environment Map\n * (PMREM) from a cubeMap environment texture. This allows different levels of\n * blur to be quickly accessed based on material roughness. It is packed into a\n * special CubeUV format that allows us to perform custom interpolation so that\n * we can support nonlinear formats such as RGBE. Unlike a traditional mipmap\n * chain, it only goes down to the LOD_MIN level (above), and then creates extra\n * even more filtered 'mips' at the same LOD_MIN resolution, associated with\n * higher roughness levels. In this way we maintain resolution to smoothly\n * interpolate diffuse lighting while limiting sampling computation.\n *\n * Paper: Fast, Accurate Image-Based Lighting\n * https://drive.google.com/file/d/15y8r_UpKlU9SvV4ILb0C3qCPecS8pvLz/view\n*/\n\nclass PMREMGenerator {\n\n\tconstructor( renderer ) {\n\n\t\tthis._renderer = renderer;\n\t\tthis._pingPongRenderTarget = null;\n\n\t\tthis._lodMax = 0;\n\t\tthis._cubeSize = 0;\n\t\tthis._lodPlanes = [];\n\t\tthis._sizeLods = [];\n\t\tthis._sigmas = [];\n\n\t\tthis._blurMaterial = null;\n\t\tthis._cubemapMaterial = null;\n\t\tthis._equirectMaterial = null;\n\n\t\tthis._compileMaterial( this._blurMaterial );\n\n\t}\n\n\t/**\n\t * Generates a PMREM from a supplied Scene, which can be faster than using an\n\t * image if networking bandwidth is low. Optional sigma specifies a blur radius\n\t * in radians to be applied to the scene before PMREM generation. Optional near\n\t * and far planes ensure the scene is rendered in its entirety (the cubeCamera\n\t * is placed at the origin).\n\t */\n\tfromScene( scene, sigma = 0, near = 0.1, far = 100 ) {\n\n\t\t_oldTarget = this._renderer.getRenderTarget();\n\t\t_oldActiveCubeFace = this._renderer.getActiveCubeFace();\n\t\t_oldActiveMipmapLevel = this._renderer.getActiveMipmapLevel();\n\t\t_oldXrEnabled = this._renderer.xr.enabled;\n\n\t\tthis._renderer.xr.enabled = false;\n\n\t\tthis._setSize( 256 );\n\n\t\tconst cubeUVRenderTarget = this._allocateTargets();\n\t\tcubeUVRenderTarget.depthBuffer = true;\n\n\t\tthis._sceneToCubeUV( scene, near, far, cubeUVRenderTarget );\n\n\t\tif ( sigma > 0 ) {\n\n\t\t\tthis._blur( cubeUVRenderTarget, 0, 0, sigma );\n\n\t\t}\n\n\t\tthis._applyPMREM( cubeUVRenderTarget );\n\t\tthis._cleanup( cubeUVRenderTarget );\n\n\t\treturn cubeUVRenderTarget;\n\n\t}\n\n\t/**\n\t * Generates a PMREM from an equirectangular texture, which can be either LDR\n\t * or HDR. The ideal input image size is 1k (1024 x 512),\n\t * as this matches best with the 256 x 256 cubemap output.\n\t * The smallest supported equirectangular image size is 64 x 32.\n\t */\n\tfromEquirectangular( equirectangular, renderTarget = null ) {\n\n\t\treturn this._fromTexture( equirectangular, renderTarget );\n\n\t}\n\n\t/**\n\t * Generates a PMREM from an cubemap texture, which can be either LDR\n\t * or HDR. The ideal input cube size is 256 x 256,\n\t * as this matches best with the 256 x 256 cubemap output.\n\t * The smallest supported cube size is 16 x 16.\n\t */\n\tfromCubemap( cubemap, renderTarget = null ) {\n\n\t\treturn this._fromTexture( cubemap, renderTarget );\n\n\t}\n\n\t/**\n\t * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during\n\t * your texture's network fetch for increased concurrency.\n\t */\n\tcompileCubemapShader() {\n\n\t\tif ( this._cubemapMaterial === null ) {\n\n\t\t\tthis._cubemapMaterial = _getCubemapMaterial();\n\t\t\tthis._compileMaterial( this._cubemapMaterial );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during\n\t * your texture's network fetch for increased concurrency.\n\t */\n\tcompileEquirectangularShader() {\n\n\t\tif ( this._equirectMaterial === null ) {\n\n\t\t\tthis._equirectMaterial = _getEquirectMaterial();\n\t\t\tthis._compileMaterial( this._equirectMaterial );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class,\n\t * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on\n\t * one of them will cause any others to also become unusable.\n\t */\n\tdispose() {\n\n\t\tthis._dispose();\n\n\t\tif ( this._cubemapMaterial !== null ) this._cubemapMaterial.dispose();\n\t\tif ( this._equirectMaterial !== null ) this._equirectMaterial.dispose();\n\n\t}\n\n\t// private interface\n\n\t_setSize( cubeSize ) {\n\n\t\tthis._lodMax = Math.floor( Math.log2( cubeSize ) );\n\t\tthis._cubeSize = Math.pow( 2, this._lodMax );\n\n\t}\n\n\t_dispose() {\n\n\t\tif ( this._blurMaterial !== null ) this._blurMaterial.dispose();\n\n\t\tif ( this._pingPongRenderTarget !== null ) this._pingPongRenderTarget.dispose();\n\n\t\tfor ( let i = 0; i < this._lodPlanes.length; i ++ ) {\n\n\t\t\tthis._lodPlanes[ i ].dispose();\n\n\t\t}\n\n\t}\n\n\t_cleanup( outputTarget ) {\n\n\t\tthis._renderer.setRenderTarget( _oldTarget, _oldActiveCubeFace, _oldActiveMipmapLevel );\n\t\tthis._renderer.xr.enabled = _oldXrEnabled;\n\n\t\toutputTarget.scissorTest = false;\n\t\t_setViewport( outputTarget, 0, 0, outputTarget.width, outputTarget.height );\n\n\t}\n\n\t_fromTexture( texture, renderTarget ) {\n\n\t\tif ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping ) {\n\n\t\t\tthis._setSize( texture.image.length === 0 ? 16 : ( texture.image[ 0 ].width || texture.image[ 0 ].image.width ) );\n\n\t\t} else { // Equirectangular\n\n\t\t\tthis._setSize( texture.image.width / 4 );\n\n\t\t}\n\n\t\t_oldTarget = this._renderer.getRenderTarget();\n\t\t_oldActiveCubeFace = this._renderer.getActiveCubeFace();\n\t\t_oldActiveMipmapLevel = this._renderer.getActiveMipmapLevel();\n\t\t_oldXrEnabled = this._renderer.xr.enabled;\n\n\t\tthis._renderer.xr.enabled = false;\n\n\t\tconst cubeUVRenderTarget = renderTarget || this._allocateTargets();\n\t\tthis._textureToCubeUV( texture, cubeUVRenderTarget );\n\t\tthis._applyPMREM( cubeUVRenderTarget );\n\t\tthis._cleanup( cubeUVRenderTarget );\n\n\t\treturn cubeUVRenderTarget;\n\n\t}\n\n\t_allocateTargets() {\n\n\t\tconst width = 3 * Math.max( this._cubeSize, 16 * 7 );\n\t\tconst height = 4 * this._cubeSize;\n\n\t\tconst params = {\n\t\t\tmagFilter: LinearFilter,\n\t\t\tminFilter: LinearFilter,\n\t\t\tgenerateMipmaps: false,\n\t\t\ttype: HalfFloatType,\n\t\t\tformat: RGBAFormat,\n\t\t\tcolorSpace: LinearSRGBColorSpace,\n\t\t\tdepthBuffer: false\n\t\t};\n\n\t\tconst cubeUVRenderTarget = _createRenderTarget( width, height, params );\n\n\t\tif ( this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== width || this._pingPongRenderTarget.height !== height ) {\n\n\t\t\tif ( this._pingPongRenderTarget !== null ) {\n\n\t\t\t\tthis._dispose();\n\n\t\t\t}\n\n\t\t\tthis._pingPongRenderTarget = _createRenderTarget( width, height, params );\n\n\t\t\tconst { _lodMax } = this;\n\t\t\t( { sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas } = _createPlanes( _lodMax ) );\n\n\t\t\tthis._blurMaterial = _getBlurShader( _lodMax, width, height );\n\n\t\t}\n\n\t\treturn cubeUVRenderTarget;\n\n\t}\n\n\t_compileMaterial( material ) {\n\n\t\tconst tmpMesh = new Mesh( this._lodPlanes[ 0 ], material );\n\t\tthis._renderer.compile( tmpMesh, _flatCamera );\n\n\t}\n\n\t_sceneToCubeUV( scene, near, far, cubeUVRenderTarget ) {\n\n\t\tconst fov = 90;\n\t\tconst aspect = 1;\n\t\tconst cubeCamera = new PerspectiveCamera( fov, aspect, near, far );\n\t\tconst upSign = [ 1, - 1, 1, 1, 1, 1 ];\n\t\tconst forwardSign = [ 1, 1, 1, - 1, - 1, - 1 ];\n\t\tconst renderer = this._renderer;\n\n\t\tconst originalAutoClear = renderer.autoClear;\n\t\tconst toneMapping = renderer.toneMapping;\n\t\trenderer.getClearColor( _clearColor );\n\n\t\trenderer.toneMapping = NoToneMapping;\n\t\trenderer.autoClear = false;\n\n\t\tconst backgroundMaterial = new MeshBasicMaterial( {\n\t\t\tname: 'PMREM.Background',\n\t\t\tside: BackSide,\n\t\t\tdepthWrite: false,\n\t\t\tdepthTest: false,\n\t\t} );\n\n\t\tconst backgroundBox = new Mesh( new BoxGeometry(), backgroundMaterial );\n\n\t\tlet useSolidColor = false;\n\t\tconst background = scene.background;\n\n\t\tif ( background ) {\n\n\t\t\tif ( background.isColor ) {\n\n\t\t\t\tbackgroundMaterial.color.copy( background );\n\t\t\t\tscene.background = null;\n\t\t\t\tuseSolidColor = true;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tbackgroundMaterial.color.copy( _clearColor );\n\t\t\tuseSolidColor = true;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst col = i % 3;\n\n\t\t\tif ( col === 0 ) {\n\n\t\t\t\tcubeCamera.up.set( 0, upSign[ i ], 0 );\n\t\t\t\tcubeCamera.lookAt( forwardSign[ i ], 0, 0 );\n\n\t\t\t} else if ( col === 1 ) {\n\n\t\t\t\tcubeCamera.up.set( 0, 0, upSign[ i ] );\n\t\t\t\tcubeCamera.lookAt( 0, forwardSign[ i ], 0 );\n\n\t\t\t} else {\n\n\t\t\t\tcubeCamera.up.set( 0, upSign[ i ], 0 );\n\t\t\t\tcubeCamera.lookAt( 0, 0, forwardSign[ i ] );\n\n\t\t\t}\n\n\t\t\tconst size = this._cubeSize;\n\n\t\t\t_setViewport( cubeUVRenderTarget, col * size, i > 2 ? size : 0, size, size );\n\n\t\t\trenderer.setRenderTarget( cubeUVRenderTarget );\n\n\t\t\tif ( useSolidColor ) {\n\n\t\t\t\trenderer.render( backgroundBox, cubeCamera );\n\n\t\t\t}\n\n\t\t\trenderer.render( scene, cubeCamera );\n\n\t\t}\n\n\t\tbackgroundBox.geometry.dispose();\n\t\tbackgroundBox.material.dispose();\n\n\t\trenderer.toneMapping = toneMapping;\n\t\trenderer.autoClear = originalAutoClear;\n\t\tscene.background = background;\n\n\t}\n\n\t_textureToCubeUV( texture, cubeUVRenderTarget ) {\n\n\t\tconst renderer = this._renderer;\n\n\t\tconst isCubeTexture = ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping );\n\n\t\tif ( isCubeTexture ) {\n\n\t\t\tif ( this._cubemapMaterial === null ) {\n\n\t\t\t\tthis._cubemapMaterial = _getCubemapMaterial();\n\n\t\t\t}\n\n\t\t\tthis._cubemapMaterial.uniforms.flipEnvMap.value = ( texture.isRenderTargetTexture === false ) ? - 1 : 1;\n\n\t\t} else {\n\n\t\t\tif ( this._equirectMaterial === null ) {\n\n\t\t\t\tthis._equirectMaterial = _getEquirectMaterial();\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst material = isCubeTexture ? this._cubemapMaterial : this._equirectMaterial;\n\t\tconst mesh = new Mesh( this._lodPlanes[ 0 ], material );\n\n\t\tconst uniforms = material.uniforms;\n\n\t\tuniforms[ 'envMap' ].value = texture;\n\n\t\tconst size = this._cubeSize;\n\n\t\t_setViewport( cubeUVRenderTarget, 0, 0, 3 * size, 2 * size );\n\n\t\trenderer.setRenderTarget( cubeUVRenderTarget );\n\t\trenderer.render( mesh, _flatCamera );\n\n\t}\n\n\t_applyPMREM( cubeUVRenderTarget ) {\n\n\t\tconst renderer = this._renderer;\n\t\tconst autoClear = renderer.autoClear;\n\t\trenderer.autoClear = false;\n\t\tconst n = this._lodPlanes.length;\n\n\t\tfor ( let i = 1; i < n; i ++ ) {\n\n\t\t\tconst sigma = Math.sqrt( this._sigmas[ i ] * this._sigmas[ i ] - this._sigmas[ i - 1 ] * this._sigmas[ i - 1 ] );\n\n\t\t\tconst poleAxis = _axisDirections[ ( n - i - 1 ) % _axisDirections.length ];\n\n\t\t\tthis._blur( cubeUVRenderTarget, i - 1, i, sigma, poleAxis );\n\n\t\t}\n\n\t\trenderer.autoClear = autoClear;\n\n\t}\n\n\t/**\n\t * This is a two-pass Gaussian blur for a cubemap. Normally this is done\n\t * vertically and horizontally, but this breaks down on a cube. Here we apply\n\t * the blur latitudinally (around the poles), and then longitudinally (towards\n\t * the poles) to approximate the orthogonally-separable blur. It is least\n\t * accurate at the poles, but still does a decent job.\n\t */\n\t_blur( cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis ) {\n\n\t\tconst pingPongRenderTarget = this._pingPongRenderTarget;\n\n\t\tthis._halfBlur(\n\t\t\tcubeUVRenderTarget,\n\t\t\tpingPongRenderTarget,\n\t\t\tlodIn,\n\t\t\tlodOut,\n\t\t\tsigma,\n\t\t\t'latitudinal',\n\t\t\tpoleAxis );\n\n\t\tthis._halfBlur(\n\t\t\tpingPongRenderTarget,\n\t\t\tcubeUVRenderTarget,\n\t\t\tlodOut,\n\t\t\tlodOut,\n\t\t\tsigma,\n\t\t\t'longitudinal',\n\t\t\tpoleAxis );\n\n\t}\n\n\t_halfBlur( targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis ) {\n\n\t\tconst renderer = this._renderer;\n\t\tconst blurMaterial = this._blurMaterial;\n\n\t\tif ( direction !== 'latitudinal' && direction !== 'longitudinal' ) {\n\n\t\t\tconsole.error(\n\t\t\t\t'blur direction must be either latitudinal or longitudinal!' );\n\n\t\t}\n\n\t\t// Number of standard deviations at which to cut off the discrete approximation.\n\t\tconst STANDARD_DEVIATIONS = 3;\n\n\t\tconst blurMesh = new Mesh( this._lodPlanes[ lodOut ], blurMaterial );\n\t\tconst blurUniforms = blurMaterial.uniforms;\n\n\t\tconst pixels = this._sizeLods[ lodIn ] - 1;\n\t\tconst radiansPerPixel = isFinite( sigmaRadians ) ? Math.PI / ( 2 * pixels ) : 2 * Math.PI / ( 2 * MAX_SAMPLES - 1 );\n\t\tconst sigmaPixels = sigmaRadians / radiansPerPixel;\n\t\tconst samples = isFinite( sigmaRadians ) ? 1 + Math.floor( STANDARD_DEVIATIONS * sigmaPixels ) : MAX_SAMPLES;\n\n\t\tif ( samples > MAX_SAMPLES ) {\n\n\t\t\tconsole.warn( `sigmaRadians, ${\n\t\t\t\tsigmaRadians}, is too large and will clip, as it requested ${\n\t\t\t\tsamples} samples when the maximum is set to ${MAX_SAMPLES}` );\n\n\t\t}\n\n\t\tconst weights = [];\n\t\tlet sum = 0;\n\n\t\tfor ( let i = 0; i < MAX_SAMPLES; ++ i ) {\n\n\t\t\tconst x = i / sigmaPixels;\n\t\t\tconst weight = Math.exp( - x * x / 2 );\n\t\t\tweights.push( weight );\n\n\t\t\tif ( i === 0 ) {\n\n\t\t\t\tsum += weight;\n\n\t\t\t} else if ( i < samples ) {\n\n\t\t\t\tsum += 2 * weight;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( let i = 0; i < weights.length; i ++ ) {\n\n\t\t\tweights[ i ] = weights[ i ] / sum;\n\n\t\t}\n\n\t\tblurUniforms[ 'envMap' ].value = targetIn.texture;\n\t\tblurUniforms[ 'samples' ].value = samples;\n\t\tblurUniforms[ 'weights' ].value = weights;\n\t\tblurUniforms[ 'latitudinal' ].value = direction === 'latitudinal';\n\n\t\tif ( poleAxis ) {\n\n\t\t\tblurUniforms[ 'poleAxis' ].value = poleAxis;\n\n\t\t}\n\n\t\tconst { _lodMax } = this;\n\t\tblurUniforms[ 'dTheta' ].value = radiansPerPixel;\n\t\tblurUniforms[ 'mipInt' ].value = _lodMax - lodIn;\n\n\t\tconst outputSize = this._sizeLods[ lodOut ];\n\t\tconst x = 3 * outputSize * ( lodOut > _lodMax - LOD_MIN ? lodOut - _lodMax + LOD_MIN : 0 );\n\t\tconst y = 4 * ( this._cubeSize - outputSize );\n\n\t\t_setViewport( targetOut, x, y, 3 * outputSize, 2 * outputSize );\n\t\trenderer.setRenderTarget( targetOut );\n\t\trenderer.render( blurMesh, _flatCamera );\n\n\t}\n\n}\n\n\n\nfunction _createPlanes( lodMax ) {\n\n\tconst lodPlanes = [];\n\tconst sizeLods = [];\n\tconst sigmas = [];\n\n\tlet lod = lodMax;\n\n\tconst totalLods = lodMax - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length;\n\n\tfor ( let i = 0; i < totalLods; i ++ ) {\n\n\t\tconst sizeLod = Math.pow( 2, lod );\n\t\tsizeLods.push( sizeLod );\n\t\tlet sigma = 1.0 / sizeLod;\n\n\t\tif ( i > lodMax - LOD_MIN ) {\n\n\t\t\tsigma = EXTRA_LOD_SIGMA[ i - lodMax + LOD_MIN - 1 ];\n\n\t\t} else if ( i === 0 ) {\n\n\t\t\tsigma = 0;\n\n\t\t}\n\n\t\tsigmas.push( sigma );\n\n\t\tconst texelSize = 1.0 / ( sizeLod - 2 );\n\t\tconst min = - texelSize;\n\t\tconst max = 1 + texelSize;\n\t\tconst uv1 = [ min, min, max, min, max, max, min, min, max, max, min, max ];\n\n\t\tconst cubeFaces = 6;\n\t\tconst vertices = 6;\n\t\tconst positionSize = 3;\n\t\tconst uvSize = 2;\n\t\tconst faceIndexSize = 1;\n\n\t\tconst position = new Float32Array( positionSize * vertices * cubeFaces );\n\t\tconst uv = new Float32Array( uvSize * vertices * cubeFaces );\n\t\tconst faceIndex = new Float32Array( faceIndexSize * vertices * cubeFaces );\n\n\t\tfor ( let face = 0; face < cubeFaces; face ++ ) {\n\n\t\t\tconst x = ( face % 3 ) * 2 / 3 - 1;\n\t\t\tconst y = face > 2 ? 0 : - 1;\n\t\t\tconst coordinates = [\n\t\t\t\tx, y, 0,\n\t\t\t\tx + 2 / 3, y, 0,\n\t\t\t\tx + 2 / 3, y + 1, 0,\n\t\t\t\tx, y, 0,\n\t\t\t\tx + 2 / 3, y + 1, 0,\n\t\t\t\tx, y + 1, 0\n\t\t\t];\n\t\t\tposition.set( coordinates, positionSize * vertices * face );\n\t\t\tuv.set( uv1, uvSize * vertices * face );\n\t\t\tconst fill = [ face, face, face, face, face, face ];\n\t\t\tfaceIndex.set( fill, faceIndexSize * vertices * face );\n\n\t\t}\n\n\t\tconst planes = new BufferGeometry();\n\t\tplanes.setAttribute( 'position', new BufferAttribute( position, positionSize ) );\n\t\tplanes.setAttribute( 'uv', new BufferAttribute( uv, uvSize ) );\n\t\tplanes.setAttribute( 'faceIndex', new BufferAttribute( faceIndex, faceIndexSize ) );\n\t\tlodPlanes.push( planes );\n\n\t\tif ( lod > LOD_MIN ) {\n\n\t\t\tlod --;\n\n\t\t}\n\n\t}\n\n\treturn { lodPlanes, sizeLods, sigmas };\n\n}\n\nfunction _createRenderTarget( width, height, params ) {\n\n\tconst cubeUVRenderTarget = new WebGLRenderTarget( width, height, params );\n\tcubeUVRenderTarget.texture.mapping = CubeUVReflectionMapping;\n\tcubeUVRenderTarget.texture.name = 'PMREM.cubeUv';\n\tcubeUVRenderTarget.scissorTest = true;\n\treturn cubeUVRenderTarget;\n\n}\n\nfunction _setViewport( target, x, y, width, height ) {\n\n\ttarget.viewport.set( x, y, width, height );\n\ttarget.scissor.set( x, y, width, height );\n\n}\n\nfunction _getBlurShader( lodMax, width, height ) {\n\n\tconst weights = new Float32Array( MAX_SAMPLES );\n\tconst poleAxis = new Vector3( 0, 1, 0 );\n\tconst shaderMaterial = new ShaderMaterial( {\n\n\t\tname: 'SphericalGaussianBlur',\n\n\t\tdefines: {\n\t\t\t'n': MAX_SAMPLES,\n\t\t\t'CUBEUV_TEXEL_WIDTH': 1.0 / width,\n\t\t\t'CUBEUV_TEXEL_HEIGHT': 1.0 / height,\n\t\t\t'CUBEUV_MAX_MIP': `${lodMax}.0`,\n\t\t},\n\n\t\tuniforms: {\n\t\t\t'envMap': { value: null },\n\t\t\t'samples': { value: 1 },\n\t\t\t'weights': { value: weights },\n\t\t\t'latitudinal': { value: false },\n\t\t\t'dTheta': { value: 0 },\n\t\t\t'mipInt': { value: 0 },\n\t\t\t'poleAxis': { value: poleAxis }\n\t\t},\n\n\t\tvertexShader: _getCommonVertexShader(),\n\n\t\tfragmentShader: /* glsl */`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t`,\n\n\t\tblending: NoBlending,\n\t\tdepthTest: false,\n\t\tdepthWrite: false\n\n\t} );\n\n\treturn shaderMaterial;\n\n}\n\nfunction _getEquirectMaterial() {\n\n\treturn new ShaderMaterial( {\n\n\t\tname: 'EquirectangularToCubeUV',\n\n\t\tuniforms: {\n\t\t\t'envMap': { value: null }\n\t\t},\n\n\t\tvertexShader: _getCommonVertexShader(),\n\n\t\tfragmentShader: /* glsl */`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t`,\n\n\t\tblending: NoBlending,\n\t\tdepthTest: false,\n\t\tdepthWrite: false\n\n\t} );\n\n}\n\nfunction _getCubemapMaterial() {\n\n\treturn new ShaderMaterial( {\n\n\t\tname: 'CubemapToCubeUV',\n\n\t\tuniforms: {\n\t\t\t'envMap': { value: null },\n\t\t\t'flipEnvMap': { value: - 1 }\n\t\t},\n\n\t\tvertexShader: _getCommonVertexShader(),\n\n\t\tfragmentShader: /* glsl */`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t`,\n\n\t\tblending: NoBlending,\n\t\tdepthTest: false,\n\t\tdepthWrite: false\n\n\t} );\n\n}\n\nfunction _getCommonVertexShader() {\n\n\treturn /* glsl */`\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t`;\n\n}\n\nfunction WebGLCubeUVMaps( renderer ) {\n\n\tlet cubeUVmaps = new WeakMap();\n\n\tlet pmremGenerator = null;\n\n\tfunction get( texture ) {\n\n\t\tif ( texture && texture.isTexture ) {\n\n\t\t\tconst mapping = texture.mapping;\n\n\t\t\tconst isEquirectMap = ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping );\n\t\t\tconst isCubeMap = ( mapping === CubeReflectionMapping || mapping === CubeRefractionMapping );\n\n\t\t\t// equirect/cube map to cubeUV conversion\n\n\t\t\tif ( isEquirectMap || isCubeMap ) {\n\n\t\t\t\tlet renderTarget = cubeUVmaps.get( texture );\n\n\t\t\t\tconst currentPMREMVersion = renderTarget !== undefined ? renderTarget.texture.pmremVersion : 0;\n\n\t\t\t\tif ( texture.isRenderTargetTexture && texture.pmremVersion !== currentPMREMVersion ) {\n\n\t\t\t\t\tif ( pmremGenerator === null ) pmremGenerator = new PMREMGenerator( renderer );\n\n\t\t\t\t\trenderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular( texture, renderTarget ) : pmremGenerator.fromCubemap( texture, renderTarget );\n\t\t\t\t\trenderTarget.texture.pmremVersion = texture.pmremVersion;\n\n\t\t\t\t\tcubeUVmaps.set( texture, renderTarget );\n\n\t\t\t\t\treturn renderTarget.texture;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( renderTarget !== undefined ) {\n\n\t\t\t\t\t\treturn renderTarget.texture;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst image = texture.image;\n\n\t\t\t\t\t\tif ( ( isEquirectMap && image && image.height > 0 ) || ( isCubeMap && image && isCubeTextureComplete( image ) ) ) {\n\n\t\t\t\t\t\t\tif ( pmremGenerator === null ) pmremGenerator = new PMREMGenerator( renderer );\n\n\t\t\t\t\t\t\trenderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular( texture ) : pmremGenerator.fromCubemap( texture );\n\t\t\t\t\t\t\trenderTarget.texture.pmremVersion = texture.pmremVersion;\n\n\t\t\t\t\t\t\tcubeUVmaps.set( texture, renderTarget );\n\n\t\t\t\t\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t\t\t\t\t\treturn renderTarget.texture;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// image not yet ready. try the conversion next frame\n\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tfunction isCubeTextureComplete( image ) {\n\n\t\tlet count = 0;\n\t\tconst length = 6;\n\n\t\tfor ( let i = 0; i < length; i ++ ) {\n\n\t\t\tif ( image[ i ] !== undefined ) count ++;\n\n\t\t}\n\n\t\treturn count === length;\n\n\n\t}\n\n\tfunction onTextureDispose( event ) {\n\n\t\tconst texture = event.target;\n\n\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\tconst cubemapUV = cubeUVmaps.get( texture );\n\n\t\tif ( cubemapUV !== undefined ) {\n\n\t\t\tcubeUVmaps.delete( texture );\n\t\t\tcubemapUV.dispose();\n\n\t\t}\n\n\t}\n\n\tfunction dispose() {\n\n\t\tcubeUVmaps = new WeakMap();\n\n\t\tif ( pmremGenerator !== null ) {\n\n\t\t\tpmremGenerator.dispose();\n\t\t\tpmremGenerator = null;\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction WebGLExtensions( gl ) {\n\n\tconst extensions = {};\n\n\tfunction getExtension( name ) {\n\n\t\tif ( extensions[ name ] !== undefined ) {\n\n\t\t\treturn extensions[ name ];\n\n\t\t}\n\n\t\tlet extension;\n\n\t\tswitch ( name ) {\n\n\t\t\tcase 'WEBGL_depth_texture':\n\t\t\t\textension = gl.getExtension( 'WEBGL_depth_texture' ) || gl.getExtension( 'MOZ_WEBGL_depth_texture' ) || gl.getExtension( 'WEBKIT_WEBGL_depth_texture' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'EXT_texture_filter_anisotropic':\n\t\t\t\textension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'WEBGL_compressed_texture_s3tc':\n\t\t\t\textension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'WEBGL_compressed_texture_pvrtc':\n\t\t\t\textension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\textension = gl.getExtension( name );\n\n\t\t}\n\n\t\textensions[ name ] = extension;\n\n\t\treturn extension;\n\n\t}\n\n\treturn {\n\n\t\thas: function ( name ) {\n\n\t\t\treturn getExtension( name ) !== null;\n\n\t\t},\n\n\t\tinit: function () {\n\n\t\t\tgetExtension( 'EXT_color_buffer_float' );\n\t\t\tgetExtension( 'WEBGL_clip_cull_distance' );\n\t\t\tgetExtension( 'OES_texture_float_linear' );\n\t\t\tgetExtension( 'EXT_color_buffer_half_float' );\n\t\t\tgetExtension( 'WEBGL_multisampled_render_to_texture' );\n\t\t\tgetExtension( 'WEBGL_render_shared_exponent' );\n\n\t\t},\n\n\t\tget: function ( name ) {\n\n\t\t\tconst extension = getExtension( name );\n\n\t\t\tif ( extension === null ) {\n\n\t\t\t\twarnOnce( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' );\n\n\t\t\t}\n\n\t\t\treturn extension;\n\n\t\t}\n\n\t};\n\n}\n\nfunction WebGLGeometries( gl, attributes, info, bindingStates ) {\n\n\tconst geometries = {};\n\tconst wireframeAttributes = new WeakMap();\n\n\tfunction onGeometryDispose( event ) {\n\n\t\tconst geometry = event.target;\n\n\t\tif ( geometry.index !== null ) {\n\n\t\t\tattributes.remove( geometry.index );\n\n\t\t}\n\n\t\tfor ( const name in geometry.attributes ) {\n\n\t\t\tattributes.remove( geometry.attributes[ name ] );\n\n\t\t}\n\n\t\tfor ( const name in geometry.morphAttributes ) {\n\n\t\t\tconst array = geometry.morphAttributes[ name ];\n\n\t\t\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\n\n\t\t\t\tattributes.remove( array[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.removeEventListener( 'dispose', onGeometryDispose );\n\n\t\tdelete geometries[ geometry.id ];\n\n\t\tconst attribute = wireframeAttributes.get( geometry );\n\n\t\tif ( attribute ) {\n\n\t\t\tattributes.remove( attribute );\n\t\t\twireframeAttributes.delete( geometry );\n\n\t\t}\n\n\t\tbindingStates.releaseStatesOfGeometry( geometry );\n\n\t\tif ( geometry.isInstancedBufferGeometry === true ) {\n\n\t\t\tdelete geometry._maxInstanceCount;\n\n\t\t}\n\n\t\t//\n\n\t\tinfo.memory.geometries --;\n\n\t}\n\n\tfunction get( object, geometry ) {\n\n\t\tif ( geometries[ geometry.id ] === true ) return geometry;\n\n\t\tgeometry.addEventListener( 'dispose', onGeometryDispose );\n\n\t\tgeometries[ geometry.id ] = true;\n\n\t\tinfo.memory.geometries ++;\n\n\t\treturn geometry;\n\n\t}\n\n\tfunction update( geometry ) {\n\n\t\tconst geometryAttributes = geometry.attributes;\n\n\t\t// Updating index buffer in VAO now. See WebGLBindingStates.\n\n\t\tfor ( const name in geometryAttributes ) {\n\n\t\t\tattributes.update( geometryAttributes[ name ], gl.ARRAY_BUFFER );\n\n\t\t}\n\n\t\t// morph targets\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst array = morphAttributes[ name ];\n\n\t\t\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\n\n\t\t\t\tattributes.update( array[ i ], gl.ARRAY_BUFFER );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction updateWireframeAttribute( geometry ) {\n\n\t\tconst indices = [];\n\n\t\tconst geometryIndex = geometry.index;\n\t\tconst geometryPosition = geometry.attributes.position;\n\t\tlet version = 0;\n\n\t\tif ( geometryIndex !== null ) {\n\n\t\t\tconst array = geometryIndex.array;\n\t\t\tversion = geometryIndex.version;\n\n\t\t\tfor ( let i = 0, l = array.length; i < l; i += 3 ) {\n\n\t\t\t\tconst a = array[ i + 0 ];\n\t\t\t\tconst b = array[ i + 1 ];\n\t\t\t\tconst c = array[ i + 2 ];\n\n\t\t\t\tindices.push( a, b, b, c, c, a );\n\n\t\t\t}\n\n\t\t} else if ( geometryPosition !== undefined ) {\n\n\t\t\tconst array = geometryPosition.array;\n\t\t\tversion = geometryPosition.version;\n\n\t\t\tfor ( let i = 0, l = ( array.length / 3 ) - 1; i < l; i += 3 ) {\n\n\t\t\t\tconst a = i + 0;\n\t\t\t\tconst b = i + 1;\n\t\t\t\tconst c = i + 2;\n\n\t\t\t\tindices.push( a, b, b, c, c, a );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst attribute = new ( arrayNeedsUint32( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 );\n\t\tattribute.version = version;\n\n\t\t// Updating index buffer in VAO now. See WebGLBindingStates\n\n\t\t//\n\n\t\tconst previousAttribute = wireframeAttributes.get( geometry );\n\n\t\tif ( previousAttribute ) attributes.remove( previousAttribute );\n\n\t\t//\n\n\t\twireframeAttributes.set( geometry, attribute );\n\n\t}\n\n\tfunction getWireframeAttribute( geometry ) {\n\n\t\tconst currentAttribute = wireframeAttributes.get( geometry );\n\n\t\tif ( currentAttribute ) {\n\n\t\t\tconst geometryIndex = geometry.index;\n\n\t\t\tif ( geometryIndex !== null ) {\n\n\t\t\t\t// if the attribute is obsolete, create a new one\n\n\t\t\t\tif ( currentAttribute.version < geometryIndex.version ) {\n\n\t\t\t\t\tupdateWireframeAttribute( geometry );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tupdateWireframeAttribute( geometry );\n\n\t\t}\n\n\t\treturn wireframeAttributes.get( geometry );\n\n\t}\n\n\treturn {\n\n\t\tget: get,\n\t\tupdate: update,\n\n\t\tgetWireframeAttribute: getWireframeAttribute\n\n\t};\n\n}\n\nfunction WebGLIndexedBufferRenderer( gl, extensions, info ) {\n\n\tlet mode;\n\n\tfunction setMode( value ) {\n\n\t\tmode = value;\n\n\t}\n\n\tlet type, bytesPerElement;\n\n\tfunction setIndex( value ) {\n\n\t\ttype = value.type;\n\t\tbytesPerElement = value.bytesPerElement;\n\n\t}\n\n\tfunction render( start, count ) {\n\n\t\tgl.drawElements( mode, count, type, start * bytesPerElement );\n\n\t\tinfo.update( count, mode, 1 );\n\n\t}\n\n\tfunction renderInstances( start, count, primcount ) {\n\n\t\tif ( primcount === 0 ) return;\n\n\t\tgl.drawElementsInstanced( mode, count, type, start * bytesPerElement, primcount );\n\n\t\tinfo.update( count, mode, primcount );\n\n\t}\n\n\tfunction renderMultiDraw( starts, counts, drawCount ) {\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\tconst extension = extensions.get( 'WEBGL_multi_draw' );\n\t\textension.multiDrawElementsWEBGL( mode, counts, 0, type, starts, 0, drawCount );\n\n\t\tlet elementCount = 0;\n\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\telementCount += counts[ i ];\n\n\t\t}\n\n\t\tinfo.update( elementCount, mode, 1 );\n\n\n\t}\n\n\tfunction renderMultiDrawInstances( starts, counts, drawCount, primcount ) {\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\tconst extension = extensions.get( 'WEBGL_multi_draw' );\n\n\t\tif ( extension === null ) {\n\n\t\t\tfor ( let i = 0; i < starts.length; i ++ ) {\n\n\t\t\t\trenderInstances( starts[ i ] / bytesPerElement, counts[ i ], primcount[ i ] );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\textension.multiDrawElementsInstancedWEBGL( mode, counts, 0, type, starts, 0, primcount, 0, drawCount );\n\n\t\t\tlet elementCount = 0;\n\t\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\t\telementCount += counts[ i ] * primcount[ i ];\n\n\t\t\t}\n\n\t\t\tinfo.update( elementCount, mode, 1 );\n\n\t\t}\n\n\t}\n\n\t//\n\n\tthis.setMode = setMode;\n\tthis.setIndex = setIndex;\n\tthis.render = render;\n\tthis.renderInstances = renderInstances;\n\tthis.renderMultiDraw = renderMultiDraw;\n\tthis.renderMultiDrawInstances = renderMultiDrawInstances;\n\n}\n\nfunction WebGLInfo( gl ) {\n\n\tconst memory = {\n\t\tgeometries: 0,\n\t\ttextures: 0\n\t};\n\n\tconst render = {\n\t\tframe: 0,\n\t\tcalls: 0,\n\t\ttriangles: 0,\n\t\tpoints: 0,\n\t\tlines: 0\n\t};\n\n\tfunction update( count, mode, instanceCount ) {\n\n\t\trender.calls ++;\n\n\t\tswitch ( mode ) {\n\n\t\t\tcase gl.TRIANGLES:\n\t\t\t\trender.triangles += instanceCount * ( count / 3 );\n\t\t\t\tbreak;\n\n\t\t\tcase gl.LINES:\n\t\t\t\trender.lines += instanceCount * ( count / 2 );\n\t\t\t\tbreak;\n\n\t\t\tcase gl.LINE_STRIP:\n\t\t\t\trender.lines += instanceCount * ( count - 1 );\n\t\t\t\tbreak;\n\n\t\t\tcase gl.LINE_LOOP:\n\t\t\t\trender.lines += instanceCount * count;\n\t\t\t\tbreak;\n\n\t\t\tcase gl.POINTS:\n\t\t\t\trender.points += instanceCount * count;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.error( 'THREE.WebGLInfo: Unknown draw mode:', mode );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\tfunction reset() {\n\n\t\trender.calls = 0;\n\t\trender.triangles = 0;\n\t\trender.points = 0;\n\t\trender.lines = 0;\n\n\t}\n\n\treturn {\n\t\tmemory: memory,\n\t\trender: render,\n\t\tprograms: null,\n\t\tautoReset: true,\n\t\treset: reset,\n\t\tupdate: update\n\t};\n\n}\n\nfunction WebGLMorphtargets( gl, capabilities, textures ) {\n\n\tconst morphTextures = new WeakMap();\n\tconst morph = new Vector4();\n\n\tfunction update( object, geometry, program ) {\n\n\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\t// the following encodes morph targets into an array of data textures. Each layer represents a single morph target.\n\n\t\tconst morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;\n\t\tconst morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;\n\n\t\tlet entry = morphTextures.get( geometry );\n\n\t\tif ( entry === undefined || entry.count !== morphTargetsCount ) {\n\n\t\t\tif ( entry !== undefined ) entry.texture.dispose();\n\n\t\t\tconst hasMorphPosition = geometry.morphAttributes.position !== undefined;\n\t\t\tconst hasMorphNormals = geometry.morphAttributes.normal !== undefined;\n\t\t\tconst hasMorphColors = geometry.morphAttributes.color !== undefined;\n\n\t\t\tconst morphTargets = geometry.morphAttributes.position || [];\n\t\t\tconst morphNormals = geometry.morphAttributes.normal || [];\n\t\t\tconst morphColors = geometry.morphAttributes.color || [];\n\n\t\t\tlet vertexDataCount = 0;\n\n\t\t\tif ( hasMorphPosition === true ) vertexDataCount = 1;\n\t\t\tif ( hasMorphNormals === true ) vertexDataCount = 2;\n\t\t\tif ( hasMorphColors === true ) vertexDataCount = 3;\n\n\t\t\tlet width = geometry.attributes.position.count * vertexDataCount;\n\t\t\tlet height = 1;\n\n\t\t\tif ( width > capabilities.maxTextureSize ) {\n\n\t\t\t\theight = Math.ceil( width / capabilities.maxTextureSize );\n\t\t\t\twidth = capabilities.maxTextureSize;\n\n\t\t\t}\n\n\t\t\tconst buffer = new Float32Array( width * height * 4 * morphTargetsCount );\n\n\t\t\tconst texture = new DataArrayTexture( buffer, width, height, morphTargetsCount );\n\t\t\ttexture.type = FloatType;\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\t// fill buffer\n\n\t\t\tconst vertexDataStride = vertexDataCount * 4;\n\n\t\t\tfor ( let i = 0; i < morphTargetsCount; i ++ ) {\n\n\t\t\t\tconst morphTarget = morphTargets[ i ];\n\t\t\t\tconst morphNormal = morphNormals[ i ];\n\t\t\t\tconst morphColor = morphColors[ i ];\n\n\t\t\t\tconst offset = width * height * 4 * i;\n\n\t\t\t\tfor ( let j = 0; j < morphTarget.count; j ++ ) {\n\n\t\t\t\t\tconst stride = j * vertexDataStride;\n\n\t\t\t\t\tif ( hasMorphPosition === true ) {\n\n\t\t\t\t\t\tmorph.fromBufferAttribute( morphTarget, j );\n\n\t\t\t\t\t\tbuffer[ offset + stride + 0 ] = morph.x;\n\t\t\t\t\t\tbuffer[ offset + stride + 1 ] = morph.y;\n\t\t\t\t\t\tbuffer[ offset + stride + 2 ] = morph.z;\n\t\t\t\t\t\tbuffer[ offset + stride + 3 ] = 0;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( hasMorphNormals === true ) {\n\n\t\t\t\t\t\tmorph.fromBufferAttribute( morphNormal, j );\n\n\t\t\t\t\t\tbuffer[ offset + stride + 4 ] = morph.x;\n\t\t\t\t\t\tbuffer[ offset + stride + 5 ] = morph.y;\n\t\t\t\t\t\tbuffer[ offset + stride + 6 ] = morph.z;\n\t\t\t\t\t\tbuffer[ offset + stride + 7 ] = 0;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( hasMorphColors === true ) {\n\n\t\t\t\t\t\tmorph.fromBufferAttribute( morphColor, j );\n\n\t\t\t\t\t\tbuffer[ offset + stride + 8 ] = morph.x;\n\t\t\t\t\t\tbuffer[ offset + stride + 9 ] = morph.y;\n\t\t\t\t\t\tbuffer[ offset + stride + 10 ] = morph.z;\n\t\t\t\t\t\tbuffer[ offset + stride + 11 ] = ( morphColor.itemSize === 4 ) ? morph.w : 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tentry = {\n\t\t\t\tcount: morphTargetsCount,\n\t\t\t\ttexture: texture,\n\t\t\t\tsize: new Vector2( width, height )\n\t\t\t};\n\n\t\t\tmorphTextures.set( geometry, entry );\n\n\t\t\tfunction disposeTexture() {\n\n\t\t\t\ttexture.dispose();\n\n\t\t\t\tmorphTextures.delete( geometry );\n\n\t\t\t\tgeometry.removeEventListener( 'dispose', disposeTexture );\n\n\t\t\t}\n\n\t\t\tgeometry.addEventListener( 'dispose', disposeTexture );\n\n\t\t}\n\n\t\t//\n\t\tif ( object.isInstancedMesh === true && object.morphTexture !== null ) {\n\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTexture', object.morphTexture, textures );\n\n\t\t} else {\n\n\t\t\tlet morphInfluencesSum = 0;\n\n\t\t\tfor ( let i = 0; i < objectInfluences.length; i ++ ) {\n\n\t\t\t\tmorphInfluencesSum += objectInfluences[ i ];\n\n\t\t\t}\n\n\t\t\tconst morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\n\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence );\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences );\n\n\t\t}\n\n\t\tprogram.getUniforms().setValue( gl, 'morphTargetsTexture', entry.texture, textures );\n\t\tprogram.getUniforms().setValue( gl, 'morphTargetsTextureSize', entry.size );\n\n\t}\n\n\treturn {\n\n\t\tupdate: update\n\n\t};\n\n}\n\nfunction WebGLObjects( gl, geometries, attributes, info ) {\n\n\tlet updateMap = new WeakMap();\n\n\tfunction update( object ) {\n\n\t\tconst frame = info.render.frame;\n\n\t\tconst geometry = object.geometry;\n\t\tconst buffergeometry = geometries.get( object, geometry );\n\n\t\t// Update once per frame\n\n\t\tif ( updateMap.get( buffergeometry ) !== frame ) {\n\n\t\t\tgeometries.update( buffergeometry );\n\n\t\t\tupdateMap.set( buffergeometry, frame );\n\n\t\t}\n\n\t\tif ( object.isInstancedMesh ) {\n\n\t\t\tif ( object.hasEventListener( 'dispose', onInstancedMeshDispose ) === false ) {\n\n\t\t\t\tobject.addEventListener( 'dispose', onInstancedMeshDispose );\n\n\t\t\t}\n\n\t\t\tif ( updateMap.get( object ) !== frame ) {\n\n\t\t\t\tattributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );\n\n\t\t\t\tif ( object.instanceColor !== null ) {\n\n\t\t\t\t\tattributes.update( object.instanceColor, gl.ARRAY_BUFFER );\n\n\t\t\t\t}\n\n\t\t\t\tupdateMap.set( object, frame );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( object.isSkinnedMesh ) {\n\n\t\t\tconst skeleton = object.skeleton;\n\n\t\t\tif ( updateMap.get( skeleton ) !== frame ) {\n\n\t\t\t\tskeleton.update();\n\n\t\t\t\tupdateMap.set( skeleton, frame );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn buffergeometry;\n\n\t}\n\n\tfunction dispose() {\n\n\t\tupdateMap = new WeakMap();\n\n\t}\n\n\tfunction onInstancedMeshDispose( event ) {\n\n\t\tconst instancedMesh = event.target;\n\n\t\tinstancedMesh.removeEventListener( 'dispose', onInstancedMeshDispose );\n\n\t\tattributes.remove( instancedMesh.instanceMatrix );\n\n\t\tif ( instancedMesh.instanceColor !== null ) attributes.remove( instancedMesh.instanceColor );\n\n\t}\n\n\treturn {\n\n\t\tupdate: update,\n\t\tdispose: dispose\n\n\t};\n\n}\n\nclass DepthTexture extends Texture {\n\n\tconstructor( width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format = DepthFormat ) {\n\n\t\tif ( format !== DepthFormat && format !== DepthStencilFormat ) {\n\n\t\t\tthrow new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' );\n\n\t\t}\n\n\t\tif ( type === undefined && format === DepthFormat ) type = UnsignedIntType;\n\t\tif ( type === undefined && format === DepthStencilFormat ) type = UnsignedInt248Type;\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\tthis.isDepthTexture = true;\n\n\t\tthis.image = { width: width, height: height };\n\n\t\tthis.magFilter = magFilter !== undefined ? magFilter : NearestFilter;\n\t\tthis.minFilter = minFilter !== undefined ? minFilter : NearestFilter;\n\n\t\tthis.flipY = false;\n\t\tthis.generateMipmaps = false;\n\n\t\tthis.compareFunction = null;\n\n\t}\n\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.compareFunction = source.compareFunction;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.compareFunction !== null ) data.compareFunction = this.compareFunction;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Uniforms of a program.\n * Those form a tree structure with a special top-level container for the root,\n * which you get by calling 'new WebGLUniforms( gl, program )'.\n *\n *\n * Properties of inner nodes including the top-level container:\n *\n * .seq - array of nested uniforms\n * .map - nested uniforms by name\n *\n *\n * Methods of all nodes except the top-level container:\n *\n * .setValue( gl, value, [textures] )\n *\n * \t\tuploads a uniform value(s)\n * \tthe 'textures' parameter is needed for sampler uniforms\n *\n *\n * Static methods of the top-level container (textures factorizations):\n *\n * .upload( gl, seq, values, textures )\n *\n * \t\tsets uniforms in 'seq' to 'values[id].value'\n *\n * .seqWithValue( seq, values ) : filteredSeq\n *\n * \t\tfilters 'seq' entries with corresponding entry in values\n *\n *\n * Methods of the top-level container (textures factorizations):\n *\n * .setValue( gl, name, value, textures )\n *\n * \t\tsets uniform with name 'name' to 'value'\n *\n * .setOptional( gl, obj, prop )\n *\n * \t\tlike .set for an optional property of the object\n *\n */\n\n\nconst emptyTexture = /*@__PURE__*/ new Texture();\n\nconst emptyShadowTexture = /*@__PURE__*/ new DepthTexture( 1, 1 );\n\nconst emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();\nconst empty3dTexture = /*@__PURE__*/ new Data3DTexture();\nconst emptyCubeTexture = /*@__PURE__*/ new CubeTexture();\n\n// --- Utilities ---\n\n// Array Caches (provide typed arrays for temporary by size)\n\nconst arrayCacheF32 = [];\nconst arrayCacheI32 = [];\n\n// Float32Array caches used for uploading Matrix uniforms\n\nconst mat4array = new Float32Array( 16 );\nconst mat3array = new Float32Array( 9 );\nconst mat2array = new Float32Array( 4 );\n\n// Flattening for arrays of vectors and matrices\n\nfunction flatten( array, nBlocks, blockSize ) {\n\n\tconst firstElem = array[ 0 ];\n\n\tif ( firstElem <= 0 || firstElem > 0 ) return array;\n\t// unoptimized: ! isNaN( firstElem )\n\t// see http://jacksondunstan.com/articles/983\n\n\tconst n = nBlocks * blockSize;\n\tlet r = arrayCacheF32[ n ];\n\n\tif ( r === undefined ) {\n\n\t\tr = new Float32Array( n );\n\t\tarrayCacheF32[ n ] = r;\n\n\t}\n\n\tif ( nBlocks !== 0 ) {\n\n\t\tfirstElem.toArray( r, 0 );\n\n\t\tfor ( let i = 1, offset = 0; i !== nBlocks; ++ i ) {\n\n\t\t\toffset += blockSize;\n\t\t\tarray[ i ].toArray( r, offset );\n\n\t\t}\n\n\t}\n\n\treturn r;\n\n}\n\nfunction arraysEqual( a, b ) {\n\n\tif ( a.length !== b.length ) return false;\n\n\tfor ( let i = 0, l = a.length; i < l; i ++ ) {\n\n\t\tif ( a[ i ] !== b[ i ] ) return false;\n\n\t}\n\n\treturn true;\n\n}\n\nfunction copyArray( a, b ) {\n\n\tfor ( let i = 0, l = b.length; i < l; i ++ ) {\n\n\t\ta[ i ] = b[ i ];\n\n\t}\n\n}\n\n// Texture unit allocation\n\nfunction allocTexUnits( textures, n ) {\n\n\tlet r = arrayCacheI32[ n ];\n\n\tif ( r === undefined ) {\n\n\t\tr = new Int32Array( n );\n\t\tarrayCacheI32[ n ] = r;\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\tr[ i ] = textures.allocateTextureUnit();\n\n\t}\n\n\treturn r;\n\n}\n\n// --- Setters ---\n\n// Note: Defining these methods externally, because they come in a bunch\n// and this way their names minify.\n\n// Single scalar\n\nfunction setValueV1f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( cache[ 0 ] === v ) return;\n\n\tgl.uniform1f( this.addr, v );\n\n\tcache[ 0 ] = v;\n\n}\n\n// Single float vector (from flat array or THREE.VectorN)\n\nfunction setValueV2f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {\n\n\t\t\tgl.uniform2f( this.addr, v.x, v.y );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform2fv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV3f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {\n\n\t\t\tgl.uniform3f( this.addr, v.x, v.y, v.z );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\n\t\t}\n\n\t} else if ( v.r !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.r || cache[ 1 ] !== v.g || cache[ 2 ] !== v.b ) {\n\n\t\t\tgl.uniform3f( this.addr, v.r, v.g, v.b );\n\n\t\t\tcache[ 0 ] = v.r;\n\t\t\tcache[ 1 ] = v.g;\n\t\t\tcache[ 2 ] = v.b;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform3fv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV4f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {\n\n\t\t\tgl.uniform4f( this.addr, v.x, v.y, v.z, v.w );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\t\t\tcache[ 3 ] = v.w;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform4fv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\n// Single matrix (from flat array or THREE.MatrixN)\n\nfunction setValueM2( gl, v ) {\n\n\tconst cache = this.cache;\n\tconst elements = v.elements;\n\n\tif ( elements === undefined ) {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniformMatrix2fv( this.addr, false, v );\n\n\t\tcopyArray( cache, v );\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, elements ) ) return;\n\n\t\tmat2array.set( elements );\n\n\t\tgl.uniformMatrix2fv( this.addr, false, mat2array );\n\n\t\tcopyArray( cache, elements );\n\n\t}\n\n}\n\nfunction setValueM3( gl, v ) {\n\n\tconst cache = this.cache;\n\tconst elements = v.elements;\n\n\tif ( elements === undefined ) {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniformMatrix3fv( this.addr, false, v );\n\n\t\tcopyArray( cache, v );\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, elements ) ) return;\n\n\t\tmat3array.set( elements );\n\n\t\tgl.uniformMatrix3fv( this.addr, false, mat3array );\n\n\t\tcopyArray( cache, elements );\n\n\t}\n\n}\n\nfunction setValueM4( gl, v ) {\n\n\tconst cache = this.cache;\n\tconst elements = v.elements;\n\n\tif ( elements === undefined ) {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniformMatrix4fv( this.addr, false, v );\n\n\t\tcopyArray( cache, v );\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, elements ) ) return;\n\n\t\tmat4array.set( elements );\n\n\t\tgl.uniformMatrix4fv( this.addr, false, mat4array );\n\n\t\tcopyArray( cache, elements );\n\n\t}\n\n}\n\n// Single integer / boolean\n\nfunction setValueV1i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( cache[ 0 ] === v ) return;\n\n\tgl.uniform1i( this.addr, v );\n\n\tcache[ 0 ] = v;\n\n}\n\n// Single integer / boolean vector (from flat array or THREE.VectorN)\n\nfunction setValueV2i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {\n\n\t\t\tgl.uniform2i( this.addr, v.x, v.y );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform2iv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV3i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {\n\n\t\t\tgl.uniform3i( this.addr, v.x, v.y, v.z );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform3iv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV4i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {\n\n\t\t\tgl.uniform4i( this.addr, v.x, v.y, v.z, v.w );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\t\t\tcache[ 3 ] = v.w;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform4iv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\n// Single unsigned integer\n\nfunction setValueV1ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( cache[ 0 ] === v ) return;\n\n\tgl.uniform1ui( this.addr, v );\n\n\tcache[ 0 ] = v;\n\n}\n\n// Single unsigned integer vector (from flat array or THREE.VectorN)\n\nfunction setValueV2ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {\n\n\t\t\tgl.uniform2ui( this.addr, v.x, v.y );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform2uiv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV3ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {\n\n\t\t\tgl.uniform3ui( this.addr, v.x, v.y, v.z );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform3uiv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV4ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {\n\n\t\t\tgl.uniform4ui( this.addr, v.x, v.y, v.z, v.w );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\t\t\tcache[ 3 ] = v.w;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform4uiv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\n\n// Single texture (2D / Cube)\n\nfunction setValueT1( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\tlet emptyTexture2D;\n\n\tif ( this.type === gl.SAMPLER_2D_SHADOW ) {\n\n\t\temptyShadowTexture.compareFunction = LessEqualCompare; // #28670\n\t\temptyTexture2D = emptyShadowTexture;\n\n\t} else {\n\n\t\temptyTexture2D = emptyTexture;\n\n\t}\n\n\ttextures.setTexture2D( v || emptyTexture2D, unit );\n\n}\n\nfunction setValueT3D1( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.setTexture3D( v || empty3dTexture, unit );\n\n}\n\nfunction setValueT6( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.setTextureCube( v || emptyCubeTexture, unit );\n\n}\n\nfunction setValueT2DArray1( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.setTexture2DArray( v || emptyArrayTexture, unit );\n\n}\n\n// Helper to pick the right setter for the singular case\n\nfunction getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1f; // FLOAT\n\t\tcase 0x8b50: return setValueV2f; // _VEC2\n\t\tcase 0x8b51: return setValueV3f; // _VEC3\n\t\tcase 0x8b52: return setValueV4f; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2; // _MAT2\n\t\tcase 0x8b5b: return setValueM3; // _MAT3\n\t\tcase 0x8b5c: return setValueM4; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2i; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3i; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4i; // _VEC4\n\n\t\tcase 0x1405: return setValueV1ui; // UINT\n\t\tcase 0x8dc6: return setValueV2ui; // _VEC2\n\t\tcase 0x8dc7: return setValueV3ui; // _VEC3\n\t\tcase 0x8dc8: return setValueV4ui; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn setValueT3D1;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn setValueT2DArray1;\n\n\t}\n\n}\n\n\n// Array of scalars\n\nfunction setValueV1fArray( gl, v ) {\n\n\tgl.uniform1fv( this.addr, v );\n\n}\n\n// Array of vectors (from flat array or array of THREE.VectorN)\n\nfunction setValueV2fArray( gl, v ) {\n\n\tconst data = flatten( v, this.size, 2 );\n\n\tgl.uniform2fv( this.addr, data );\n\n}\n\nfunction setValueV3fArray( gl, v ) {\n\n\tconst data = flatten( v, this.size, 3 );\n\n\tgl.uniform3fv( this.addr, data );\n\n}\n\nfunction setValueV4fArray( gl, v ) {\n\n\tconst data = flatten( v, this.size, 4 );\n\n\tgl.uniform4fv( this.addr, data );\n\n}\n\n// Array of matrices (from flat array or array of THREE.MatrixN)\n\nfunction setValueM2Array( gl, v ) {\n\n\tconst data = flatten( v, this.size, 4 );\n\n\tgl.uniformMatrix2fv( this.addr, false, data );\n\n}\n\nfunction setValueM3Array( gl, v ) {\n\n\tconst data = flatten( v, this.size, 9 );\n\n\tgl.uniformMatrix3fv( this.addr, false, data );\n\n}\n\nfunction setValueM4Array( gl, v ) {\n\n\tconst data = flatten( v, this.size, 16 );\n\n\tgl.uniformMatrix4fv( this.addr, false, data );\n\n}\n\n// Array of integer / boolean\n\nfunction setValueV1iArray( gl, v ) {\n\n\tgl.uniform1iv( this.addr, v );\n\n}\n\n// Array of integer / boolean vectors (from flat array)\n\nfunction setValueV2iArray( gl, v ) {\n\n\tgl.uniform2iv( this.addr, v );\n\n}\n\nfunction setValueV3iArray( gl, v ) {\n\n\tgl.uniform3iv( this.addr, v );\n\n}\n\nfunction setValueV4iArray( gl, v ) {\n\n\tgl.uniform4iv( this.addr, v );\n\n}\n\n// Array of unsigned integer\n\nfunction setValueV1uiArray( gl, v ) {\n\n\tgl.uniform1uiv( this.addr, v );\n\n}\n\n// Array of unsigned integer vectors (from flat array)\n\nfunction setValueV2uiArray( gl, v ) {\n\n\tgl.uniform2uiv( this.addr, v );\n\n}\n\nfunction setValueV3uiArray( gl, v ) {\n\n\tgl.uniform3uiv( this.addr, v );\n\n}\n\nfunction setValueV4uiArray( gl, v ) {\n\n\tgl.uniform4uiv( this.addr, v );\n\n}\n\n\n// Array of textures (2D / 3D / Cube / 2DArray)\n\nfunction setValueT1Array( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tif ( ! arraysEqual( cache, units ) ) {\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tcopyArray( cache, units );\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTexture2D( v[ i ] || emptyTexture, units[ i ] );\n\n\t}\n\n}\n\nfunction setValueT3DArray( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tif ( ! arraysEqual( cache, units ) ) {\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tcopyArray( cache, units );\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTexture3D( v[ i ] || empty3dTexture, units[ i ] );\n\n\t}\n\n}\n\nfunction setValueT6Array( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tif ( ! arraysEqual( cache, units ) ) {\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tcopyArray( cache, units );\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTextureCube( v[ i ] || emptyCubeTexture, units[ i ] );\n\n\t}\n\n}\n\nfunction setValueT2DArrayArray( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tif ( ! arraysEqual( cache, units ) ) {\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tcopyArray( cache, units );\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTexture2DArray( v[ i ] || emptyArrayTexture, units[ i ] );\n\n\t}\n\n}\n\n\n// Helper to pick the right setter for a pure (bottom-level) array\n\nfunction getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn setValueT3DArray;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn setValueT2DArrayArray;\n\n\t}\n\n}\n\n// --- Uniform Classes ---\n\nclass SingleUniform {\n\n\tconstructor( id, activeInfo, addr ) {\n\n\t\tthis.id = id;\n\t\tthis.addr = addr;\n\t\tthis.cache = [];\n\t\tthis.type = activeInfo.type;\n\t\tthis.setValue = getSingularSetter( activeInfo.type );\n\n\t\t// this.path = activeInfo.name; // DEBUG\n\n\t}\n\n}\n\nclass PureArrayUniform {\n\n\tconstructor( id, activeInfo, addr ) {\n\n\t\tthis.id = id;\n\t\tthis.addr = addr;\n\t\tthis.cache = [];\n\t\tthis.type = activeInfo.type;\n\t\tthis.size = activeInfo.size;\n\t\tthis.setValue = getPureArraySetter( activeInfo.type );\n\n\t\t// this.path = activeInfo.name; // DEBUG\n\n\t}\n\n}\n\nclass StructuredUniform {\n\n\tconstructor( id ) {\n\n\t\tthis.id = id;\n\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\n\t}\n\n\tsetValue( gl, value, textures ) {\n\n\t\tconst seq = this.seq;\n\n\t\tfor ( let i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\t\tconst u = seq[ i ];\n\t\t\tu.setValue( gl, value[ u.id ], textures );\n\n\t\t}\n\n\t}\n\n}\n\n// --- Top-level ---\n\n// Parser - builds up the property tree from the path strings\n\nconst RePathPart = /(\\w+)(\\])?(\\[|\\.)?/g;\n\n// extracts\n// \t- the identifier (member name or array index)\n// - followed by an optional right bracket (found when array index)\n// - followed by an optional left bracket or dot (type of subscript)\n//\n// Note: These portions can be read in a non-overlapping fashion and\n// allow straightforward parsing of the hierarchy that WebGL encodes\n// in the uniform names.\n\nfunction addUniform( container, uniformObject ) {\n\n\tcontainer.seq.push( uniformObject );\n\tcontainer.map[ uniformObject.id ] = uniformObject;\n\n}\n\nfunction parseUniform( activeInfo, addr, container ) {\n\n\tconst path = activeInfo.name,\n\t\tpathLength = path.length;\n\n\t// reset RegExp object, because of the early exit of a previous run\n\tRePathPart.lastIndex = 0;\n\n\twhile ( true ) {\n\n\t\tconst match = RePathPart.exec( path ),\n\t\t\tmatchEnd = RePathPart.lastIndex;\n\n\t\tlet id = match[ 1 ];\n\t\tconst idIsIndex = match[ 2 ] === ']',\n\t\t\tsubscript = match[ 3 ];\n\n\t\tif ( idIsIndex ) id = id | 0; // convert to integer\n\n\t\tif ( subscript === undefined || subscript === '[' && matchEnd + 2 === pathLength ) {\n\n\t\t\t// bare name or \"pure\" bottom-level array \"[0]\" suffix\n\n\t\t\taddUniform( container, subscript === undefined ?\n\t\t\t\tnew SingleUniform( id, activeInfo, addr ) :\n\t\t\t\tnew PureArrayUniform( id, activeInfo, addr ) );\n\n\t\t\tbreak;\n\n\t\t} else {\n\n\t\t\t// step into inner node / create it in case it doesn't exist\n\n\t\t\tconst map = container.map;\n\t\t\tlet next = map[ id ];\n\n\t\t\tif ( next === undefined ) {\n\n\t\t\t\tnext = new StructuredUniform( id );\n\t\t\t\taddUniform( container, next );\n\n\t\t\t}\n\n\t\t\tcontainer = next;\n\n\t\t}\n\n\t}\n\n}\n\n// Root Container\n\nclass WebGLUniforms {\n\n\tconstructor( gl, program ) {\n\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\n\t\tconst n = gl.getProgramParameter( program, gl.ACTIVE_UNIFORMS );\n\n\t\tfor ( let i = 0; i < n; ++ i ) {\n\n\t\t\tconst info = gl.getActiveUniform( program, i ),\n\t\t\t\taddr = gl.getUniformLocation( program, info.name );\n\n\t\t\tparseUniform( info, addr, this );\n\n\t\t}\n\n\t}\n\n\tsetValue( gl, name, value, textures ) {\n\n\t\tconst u = this.map[ name ];\n\n\t\tif ( u !== undefined ) u.setValue( gl, value, textures );\n\n\t}\n\n\tsetOptional( gl, object, name ) {\n\n\t\tconst v = object[ name ];\n\n\t\tif ( v !== undefined ) this.setValue( gl, name, v );\n\n\t}\n\n\tstatic upload( gl, seq, values, textures ) {\n\n\t\tfor ( let i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\t\tconst u = seq[ i ],\n\t\t\t\tv = values[ u.id ];\n\n\t\t\tif ( v.needsUpdate !== false ) {\n\n\t\t\t\t// note: always updating when .needsUpdate is undefined\n\t\t\t\tu.setValue( gl, v.value, textures );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tstatic seqWithValue( seq, values ) {\n\n\t\tconst r = [];\n\n\t\tfor ( let i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\t\tconst u = seq[ i ];\n\t\t\tif ( u.id in values ) r.push( u );\n\n\t\t}\n\n\t\treturn r;\n\n\t}\n\n}\n\nfunction WebGLShader( gl, type, string ) {\n\n\tconst shader = gl.createShader( type );\n\n\tgl.shaderSource( shader, string );\n\tgl.compileShader( shader );\n\n\treturn shader;\n\n}\n\n// From https://www.khronos.org/registry/webgl/extensions/KHR_parallel_shader_compile/\nconst COMPLETION_STATUS_KHR = 0x91B1;\n\nlet programIdCount = 0;\n\nfunction handleSource( string, errorLine ) {\n\n\tconst lines = string.split( '\\n' );\n\tconst lines2 = [];\n\n\tconst from = Math.max( errorLine - 6, 0 );\n\tconst to = Math.min( errorLine + 6, lines.length );\n\n\tfor ( let i = from; i < to; i ++ ) {\n\n\t\tconst line = i + 1;\n\t\tlines2.push( `${line === errorLine ? '>' : ' '} ${line}: ${lines[ i ]}` );\n\n\t}\n\n\treturn lines2.join( '\\n' );\n\n}\n\nconst _m0 = /*@__PURE__*/ new Matrix3();\n\nfunction getEncodingComponents( colorSpace ) {\n\n\tColorManagement._getMatrix( _m0, ColorManagement.workingColorSpace, colorSpace );\n\n\tconst encodingMatrix = `mat3( ${ _m0.elements.map( ( v ) => v.toFixed( 4 ) ) } )`;\n\n\tswitch ( ColorManagement.getTransfer( colorSpace ) ) {\n\n\t\tcase LinearTransfer:\n\t\t\treturn [ encodingMatrix, 'LinearTransferOETF' ];\n\n\t\tcase SRGBTransfer:\n\t\t\treturn [ encodingMatrix, 'sRGBTransferOETF' ];\n\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.WebGLProgram: Unsupported color space: ', colorSpace );\n\t\t\treturn [ encodingMatrix, 'LinearTransferOETF' ];\n\n\t}\n\n}\n\nfunction getShaderErrors( gl, shader, type ) {\n\n\tconst status = gl.getShaderParameter( shader, gl.COMPILE_STATUS );\n\tconst errors = gl.getShaderInfoLog( shader ).trim();\n\n\tif ( status && errors === '' ) return '';\n\n\tconst errorMatches = /ERROR: 0:(\\d+)/.exec( errors );\n\tif ( errorMatches ) {\n\n\t\t// --enable-privileged-webgl-extension\n\t\t// console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) );\n\n\t\tconst errorLine = parseInt( errorMatches[ 1 ] );\n\t\treturn type.toUpperCase() + '\\n\\n' + errors + '\\n\\n' + handleSource( gl.getShaderSource( shader ), errorLine );\n\n\t} else {\n\n\t\treturn errors;\n\n\t}\n\n}\n\nfunction getTexelEncodingFunction( functionName, colorSpace ) {\n\n\tconst components = getEncodingComponents( colorSpace );\n\n\treturn [\n\n\t\t`vec4 ${functionName}( vec4 value ) {`,\n\n\t\t`\treturn ${components[ 1 ]}( vec4( value.rgb * ${components[ 0 ]}, value.a ) );`,\n\n\t\t'}',\n\n\t].join( '\\n' );\n\n}\n\nfunction getToneMappingFunction( functionName, toneMapping ) {\n\n\tlet toneMappingName;\n\n\tswitch ( toneMapping ) {\n\n\t\tcase LinearToneMapping:\n\t\t\ttoneMappingName = 'Linear';\n\t\t\tbreak;\n\n\t\tcase ReinhardToneMapping:\n\t\t\ttoneMappingName = 'Reinhard';\n\t\t\tbreak;\n\n\t\tcase CineonToneMapping:\n\t\t\ttoneMappingName = 'Cineon';\n\t\t\tbreak;\n\n\t\tcase ACESFilmicToneMapping:\n\t\t\ttoneMappingName = 'ACESFilmic';\n\t\t\tbreak;\n\n\t\tcase AgXToneMapping:\n\t\t\ttoneMappingName = 'AgX';\n\t\t\tbreak;\n\n\t\tcase NeutralToneMapping:\n\t\t\ttoneMappingName = 'Neutral';\n\t\t\tbreak;\n\n\t\tcase CustomToneMapping:\n\t\t\ttoneMappingName = 'Custom';\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.WebGLProgram: Unsupported toneMapping:', toneMapping );\n\t\t\ttoneMappingName = 'Linear';\n\n\t}\n\n\treturn 'vec3 ' + functionName + '( vec3 color ) { return ' + toneMappingName + 'ToneMapping( color ); }';\n\n}\n\nconst _v0$1 = /*@__PURE__*/ new Vector3();\n\nfunction getLuminanceFunction() {\n\n\tColorManagement.getLuminanceCoefficients( _v0$1 );\n\n\tconst r = _v0$1.x.toFixed( 4 );\n\tconst g = _v0$1.y.toFixed( 4 );\n\tconst b = _v0$1.z.toFixed( 4 );\n\n\treturn [\n\n\t\t'float luminance( const in vec3 rgb ) {',\n\n\t\t`\tconst vec3 weights = vec3( ${ r }, ${ g }, ${ b } );`,\n\n\t\t'\treturn dot( weights, rgb );',\n\n\t\t'}'\n\n\t].join( '\\n' );\n\n}\n\nfunction generateVertexExtensions( parameters ) {\n\n\tconst chunks = [\n\t\tparameters.extensionClipCullDistance ? '#extension GL_ANGLE_clip_cull_distance : require' : '',\n\t\tparameters.extensionMultiDraw ? '#extension GL_ANGLE_multi_draw : require' : '',\n\t];\n\n\treturn chunks.filter( filterEmptyLine ).join( '\\n' );\n\n}\n\nfunction generateDefines( defines ) {\n\n\tconst chunks = [];\n\n\tfor ( const name in defines ) {\n\n\t\tconst value = defines[ name ];\n\n\t\tif ( value === false ) continue;\n\n\t\tchunks.push( '#define ' + name + ' ' + value );\n\n\t}\n\n\treturn chunks.join( '\\n' );\n\n}\n\nfunction fetchAttributeLocations( gl, program ) {\n\n\tconst attributes = {};\n\n\tconst n = gl.getProgramParameter( program, gl.ACTIVE_ATTRIBUTES );\n\n\tfor ( let i = 0; i < n; i ++ ) {\n\n\t\tconst info = gl.getActiveAttrib( program, i );\n\t\tconst name = info.name;\n\n\t\tlet locationSize = 1;\n\t\tif ( info.type === gl.FLOAT_MAT2 ) locationSize = 2;\n\t\tif ( info.type === gl.FLOAT_MAT3 ) locationSize = 3;\n\t\tif ( info.type === gl.FLOAT_MAT4 ) locationSize = 4;\n\n\t\t// console.log( 'THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i );\n\n\t\tattributes[ name ] = {\n\t\t\ttype: info.type,\n\t\t\tlocation: gl.getAttribLocation( program, name ),\n\t\t\tlocationSize: locationSize\n\t\t};\n\n\t}\n\n\treturn attributes;\n\n}\n\nfunction filterEmptyLine( string ) {\n\n\treturn string !== '';\n\n}\n\nfunction replaceLightNums( string, parameters ) {\n\n\tconst numSpotLightCoords = parameters.numSpotLightShadows + parameters.numSpotLightMaps - parameters.numSpotLightShadowsWithMaps;\n\n\treturn string\n\t\t.replace( /NUM_DIR_LIGHTS/g, parameters.numDirLights )\n\t\t.replace( /NUM_SPOT_LIGHTS/g, parameters.numSpotLights )\n\t\t.replace( /NUM_SPOT_LIGHT_MAPS/g, parameters.numSpotLightMaps )\n\t\t.replace( /NUM_SPOT_LIGHT_COORDS/g, numSpotLightCoords )\n\t\t.replace( /NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights )\n\t\t.replace( /NUM_POINT_LIGHTS/g, parameters.numPointLights )\n\t\t.replace( /NUM_HEMI_LIGHTS/g, parameters.numHemiLights )\n\t\t.replace( /NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows )\n\t\t.replace( /NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, parameters.numSpotLightShadowsWithMaps )\n\t\t.replace( /NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows )\n\t\t.replace( /NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows );\n\n}\n\nfunction replaceClippingPlaneNums( string, parameters ) {\n\n\treturn string\n\t\t.replace( /NUM_CLIPPING_PLANES/g, parameters.numClippingPlanes )\n\t\t.replace( /UNION_CLIPPING_PLANES/g, ( parameters.numClippingPlanes - parameters.numClipIntersection ) );\n\n}\n\n// Resolve Includes\n\nconst includePattern = /^[ \\t]*#include +<([\\w\\d./]+)>/gm;\n\nfunction resolveIncludes( string ) {\n\n\treturn string.replace( includePattern, includeReplacer );\n\n}\n\nconst shaderChunkMap = new Map();\n\nfunction includeReplacer( match, include ) {\n\n\tlet string = ShaderChunk[ include ];\n\n\tif ( string === undefined ) {\n\n\t\tconst newInclude = shaderChunkMap.get( include );\n\n\t\tif ( newInclude !== undefined ) {\n\n\t\t\tstring = ShaderChunk[ newInclude ];\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.', include, newInclude );\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'Can not resolve #include <' + include + '>' );\n\n\t\t}\n\n\t}\n\n\treturn resolveIncludes( string );\n\n}\n\n// Unroll Loops\n\nconst unrollLoopPattern = /#pragma unroll_loop_start\\s+for\\s*\\(\\s*int\\s+i\\s*=\\s*(\\d+)\\s*;\\s*i\\s*<\\s*(\\d+)\\s*;\\s*i\\s*\\+\\+\\s*\\)\\s*{([\\s\\S]+?)}\\s+#pragma unroll_loop_end/g;\n\nfunction unrollLoops( string ) {\n\n\treturn string.replace( unrollLoopPattern, loopReplacer );\n\n}\n\nfunction loopReplacer( match, start, end, snippet ) {\n\n\tlet string = '';\n\n\tfor ( let i = parseInt( start ); i < parseInt( end ); i ++ ) {\n\n\t\tstring += snippet\n\t\t\t.replace( /\\[\\s*i\\s*\\]/g, '[ ' + i + ' ]' )\n\t\t\t.replace( /UNROLLED_LOOP_INDEX/g, i );\n\n\t}\n\n\treturn string;\n\n}\n\n//\n\nfunction generatePrecision( parameters ) {\n\n\tlet precisionstring = `precision ${parameters.precision} float;\n\tprecision ${parameters.precision} int;\n\tprecision ${parameters.precision} sampler2D;\n\tprecision ${parameters.precision} samplerCube;\n\tprecision ${parameters.precision} sampler3D;\n\tprecision ${parameters.precision} sampler2DArray;\n\tprecision ${parameters.precision} sampler2DShadow;\n\tprecision ${parameters.precision} samplerCubeShadow;\n\tprecision ${parameters.precision} sampler2DArrayShadow;\n\tprecision ${parameters.precision} isampler2D;\n\tprecision ${parameters.precision} isampler3D;\n\tprecision ${parameters.precision} isamplerCube;\n\tprecision ${parameters.precision} isampler2DArray;\n\tprecision ${parameters.precision} usampler2D;\n\tprecision ${parameters.precision} usampler3D;\n\tprecision ${parameters.precision} usamplerCube;\n\tprecision ${parameters.precision} usampler2DArray;\n\t`;\n\n\tif ( parameters.precision === 'highp' ) {\n\n\t\tprecisionstring += '\\n#define HIGH_PRECISION';\n\n\t} else if ( parameters.precision === 'mediump' ) {\n\n\t\tprecisionstring += '\\n#define MEDIUM_PRECISION';\n\n\t} else if ( parameters.precision === 'lowp' ) {\n\n\t\tprecisionstring += '\\n#define LOW_PRECISION';\n\n\t}\n\n\treturn precisionstring;\n\n}\n\nfunction generateShadowMapTypeDefine( parameters ) {\n\n\tlet shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC';\n\n\tif ( parameters.shadowMapType === PCFShadowMap ) {\n\n\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF';\n\n\t} else if ( parameters.shadowMapType === PCFSoftShadowMap ) {\n\n\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT';\n\n\t} else if ( parameters.shadowMapType === VSMShadowMap ) {\n\n\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_VSM';\n\n\t}\n\n\treturn shadowMapTypeDefine;\n\n}\n\nfunction generateEnvMapTypeDefine( parameters ) {\n\n\tlet envMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\n\tif ( parameters.envMap ) {\n\n\t\tswitch ( parameters.envMapMode ) {\n\n\t\t\tcase CubeReflectionMapping:\n\t\t\tcase CubeRefractionMapping:\n\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\t\t\t\tbreak;\n\n\t\t\tcase CubeUVReflectionMapping:\n\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV';\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\treturn envMapTypeDefine;\n\n}\n\nfunction generateEnvMapModeDefine( parameters ) {\n\n\tlet envMapModeDefine = 'ENVMAP_MODE_REFLECTION';\n\n\tif ( parameters.envMap ) {\n\n\t\tswitch ( parameters.envMapMode ) {\n\n\t\t\tcase CubeRefractionMapping:\n\n\t\t\t\tenvMapModeDefine = 'ENVMAP_MODE_REFRACTION';\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\treturn envMapModeDefine;\n\n}\n\nfunction generateEnvMapBlendingDefine( parameters ) {\n\n\tlet envMapBlendingDefine = 'ENVMAP_BLENDING_NONE';\n\n\tif ( parameters.envMap ) {\n\n\t\tswitch ( parameters.combine ) {\n\n\t\t\tcase MultiplyOperation:\n\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY';\n\t\t\t\tbreak;\n\n\t\t\tcase MixOperation:\n\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MIX';\n\t\t\t\tbreak;\n\n\t\t\tcase AddOperation:\n\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_ADD';\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\treturn envMapBlendingDefine;\n\n}\n\nfunction generateCubeUVSize( parameters ) {\n\n\tconst imageHeight = parameters.envMapCubeUVHeight;\n\n\tif ( imageHeight === null ) return null;\n\n\tconst maxMip = Math.log2( imageHeight ) - 2;\n\n\tconst texelHeight = 1.0 / imageHeight;\n\n\tconst texelWidth = 1.0 / ( 3 * Math.max( Math.pow( 2, maxMip ), 7 * 16 ) );\n\n\treturn { texelWidth, texelHeight, maxMip };\n\n}\n\nfunction WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {\n\n\t// TODO Send this event to Three.js DevTools\n\t// console.log( 'WebGLProgram', cacheKey );\n\n\tconst gl = renderer.getContext();\n\n\tconst defines = parameters.defines;\n\n\tlet vertexShader = parameters.vertexShader;\n\tlet fragmentShader = parameters.fragmentShader;\n\n\tconst shadowMapTypeDefine = generateShadowMapTypeDefine( parameters );\n\tconst envMapTypeDefine = generateEnvMapTypeDefine( parameters );\n\tconst envMapModeDefine = generateEnvMapModeDefine( parameters );\n\tconst envMapBlendingDefine = generateEnvMapBlendingDefine( parameters );\n\tconst envMapCubeUVSize = generateCubeUVSize( parameters );\n\n\tconst customVertexExtensions = generateVertexExtensions( parameters );\n\n\tconst customDefines = generateDefines( defines );\n\n\tconst program = gl.createProgram();\n\n\tlet prefixVertex, prefixFragment;\n\tlet versionString = parameters.glslVersion ? '#version ' + parameters.glslVersion + '\\n' : '';\n\n\tif ( parameters.isRawShaderMaterial ) {\n\n\t\tprefixVertex = [\n\n\t\t\t'#define SHADER_TYPE ' + parameters.shaderType,\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\tif ( prefixVertex.length > 0 ) {\n\n\t\t\tprefixVertex += '\\n';\n\n\t\t}\n\n\t\tprefixFragment = [\n\n\t\t\t'#define SHADER_TYPE ' + parameters.shaderType,\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\tif ( prefixFragment.length > 0 ) {\n\n\t\t\tprefixFragment += '\\n';\n\n\t\t}\n\n\t} else {\n\n\t\tprefixVertex = [\n\n\t\t\tgeneratePrecision( parameters ),\n\n\t\t\t'#define SHADER_TYPE ' + parameters.shaderType,\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines,\n\n\t\t\tparameters.extensionClipCullDistance ? '#define USE_CLIP_DISTANCE' : '',\n\t\t\tparameters.batching ? '#define USE_BATCHING' : '',\n\t\t\tparameters.batchingColor ? '#define USE_BATCHING_COLOR' : '',\n\t\t\tparameters.instancing ? '#define USE_INSTANCING' : '',\n\t\t\tparameters.instancingColor ? '#define USE_INSTANCING_COLOR' : '',\n\t\t\tparameters.instancingMorph ? '#define USE_INSTANCING_MORPH' : '',\n\n\t\t\tparameters.useFog && parameters.fog ? '#define USE_FOG' : '',\n\t\t\tparameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '',\n\n\t\t\tparameters.map ? '#define USE_MAP' : '',\n\t\t\tparameters.envMap ? '#define USE_ENVMAP' : '',\n\t\t\tparameters.envMap ? '#define ' + envMapModeDefine : '',\n\t\t\tparameters.lightMap ? '#define USE_LIGHTMAP' : '',\n\t\t\tparameters.aoMap ? '#define USE_AOMAP' : '',\n\t\t\tparameters.bumpMap ? '#define USE_BUMPMAP' : '',\n\t\t\tparameters.normalMap ? '#define USE_NORMALMAP' : '',\n\t\t\tparameters.normalMapObjectSpace ? '#define USE_NORMALMAP_OBJECTSPACE' : '',\n\t\t\tparameters.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '',\n\t\t\tparameters.displacementMap ? '#define USE_DISPLACEMENTMAP' : '',\n\t\t\tparameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',\n\n\t\t\tparameters.anisotropy ? '#define USE_ANISOTROPY' : '',\n\t\t\tparameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '',\n\n\t\t\tparameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',\n\t\t\tparameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',\n\t\t\tparameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',\n\n\t\t\tparameters.iridescenceMap ? '#define USE_IRIDESCENCEMAP' : '',\n\t\t\tparameters.iridescenceThicknessMap ? '#define USE_IRIDESCENCE_THICKNESSMAP' : '',\n\n\t\t\tparameters.specularMap ? '#define USE_SPECULARMAP' : '',\n\t\t\tparameters.specularColorMap ? '#define USE_SPECULAR_COLORMAP' : '',\n\t\t\tparameters.specularIntensityMap ? '#define USE_SPECULAR_INTENSITYMAP' : '',\n\n\t\t\tparameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',\n\t\t\tparameters.metalnessMap ? '#define USE_METALNESSMAP' : '',\n\t\t\tparameters.alphaMap ? '#define USE_ALPHAMAP' : '',\n\t\t\tparameters.alphaHash ? '#define USE_ALPHAHASH' : '',\n\n\t\t\tparameters.transmission ? '#define USE_TRANSMISSION' : '',\n\t\t\tparameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',\n\t\t\tparameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',\n\n\t\t\tparameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '',\n\t\t\tparameters.sheenRoughnessMap ? '#define USE_SHEEN_ROUGHNESSMAP' : '',\n\n\t\t\t//\n\n\t\t\tparameters.mapUv ? '#define MAP_UV ' + parameters.mapUv : '',\n\t\t\tparameters.alphaMapUv ? '#define ALPHAMAP_UV ' + parameters.alphaMapUv : '',\n\t\t\tparameters.lightMapUv ? '#define LIGHTMAP_UV ' + parameters.lightMapUv : '',\n\t\t\tparameters.aoMapUv ? '#define AOMAP_UV ' + parameters.aoMapUv : '',\n\t\t\tparameters.emissiveMapUv ? '#define EMISSIVEMAP_UV ' + parameters.emissiveMapUv : '',\n\t\t\tparameters.bumpMapUv ? '#define BUMPMAP_UV ' + parameters.bumpMapUv : '',\n\t\t\tparameters.normalMapUv ? '#define NORMALMAP_UV ' + parameters.normalMapUv : '',\n\t\t\tparameters.displacementMapUv ? '#define DISPLACEMENTMAP_UV ' + parameters.displacementMapUv : '',\n\n\t\t\tparameters.metalnessMapUv ? '#define METALNESSMAP_UV ' + parameters.metalnessMapUv : '',\n\t\t\tparameters.roughnessMapUv ? '#define ROUGHNESSMAP_UV ' + parameters.roughnessMapUv : '',\n\n\t\t\tparameters.anisotropyMapUv ? '#define ANISOTROPYMAP_UV ' + parameters.anisotropyMapUv : '',\n\n\t\t\tparameters.clearcoatMapUv ? '#define CLEARCOATMAP_UV ' + parameters.clearcoatMapUv : '',\n\t\t\tparameters.clearcoatNormalMapUv ? '#define CLEARCOAT_NORMALMAP_UV ' + parameters.clearcoatNormalMapUv : '',\n\t\t\tparameters.clearcoatRoughnessMapUv ? '#define CLEARCOAT_ROUGHNESSMAP_UV ' + parameters.clearcoatRoughnessMapUv : '',\n\n\t\t\tparameters.iridescenceMapUv ? '#define IRIDESCENCEMAP_UV ' + parameters.iridescenceMapUv : '',\n\t\t\tparameters.iridescenceThicknessMapUv ? '#define IRIDESCENCE_THICKNESSMAP_UV ' + parameters.iridescenceThicknessMapUv : '',\n\n\t\t\tparameters.sheenColorMapUv ? '#define SHEEN_COLORMAP_UV ' + parameters.sheenColorMapUv : '',\n\t\t\tparameters.sheenRoughnessMapUv ? '#define SHEEN_ROUGHNESSMAP_UV ' + parameters.sheenRoughnessMapUv : '',\n\n\t\t\tparameters.specularMapUv ? '#define SPECULARMAP_UV ' + parameters.specularMapUv : '',\n\t\t\tparameters.specularColorMapUv ? '#define SPECULAR_COLORMAP_UV ' + parameters.specularColorMapUv : '',\n\t\t\tparameters.specularIntensityMapUv ? '#define SPECULAR_INTENSITYMAP_UV ' + parameters.specularIntensityMapUv : '',\n\n\t\t\tparameters.transmissionMapUv ? '#define TRANSMISSIONMAP_UV ' + parameters.transmissionMapUv : '',\n\t\t\tparameters.thicknessMapUv ? '#define THICKNESSMAP_UV ' + parameters.thicknessMapUv : '',\n\n\t\t\t//\n\n\t\t\tparameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',\n\t\t\tparameters.vertexColors ? '#define USE_COLOR' : '',\n\t\t\tparameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',\n\t\t\tparameters.vertexUv1s ? '#define USE_UV1' : '',\n\t\t\tparameters.vertexUv2s ? '#define USE_UV2' : '',\n\t\t\tparameters.vertexUv3s ? '#define USE_UV3' : '',\n\n\t\t\tparameters.pointsUvs ? '#define USE_POINTS_UV' : '',\n\n\t\t\tparameters.flatShading ? '#define FLAT_SHADED' : '',\n\n\t\t\tparameters.skinning ? '#define USE_SKINNING' : '',\n\n\t\t\tparameters.morphTargets ? '#define USE_MORPHTARGETS' : '',\n\t\t\tparameters.morphNormals && parameters.flatShading === false ? '#define USE_MORPHNORMALS' : '',\n\t\t\t( parameters.morphColors ) ? '#define USE_MORPHCOLORS' : '',\n\t\t\t( parameters.morphTargetsCount > 0 ) ? '#define MORPHTARGETS_TEXTURE_STRIDE ' + parameters.morphTextureStride : '',\n\t\t\t( parameters.morphTargetsCount > 0 ) ? '#define MORPHTARGETS_COUNT ' + parameters.morphTargetsCount : '',\n\t\t\tparameters.doubleSided ? '#define DOUBLE_SIDED' : '',\n\t\t\tparameters.flipSided ? '#define FLIP_SIDED' : '',\n\n\t\t\tparameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',\n\t\t\tparameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '',\n\n\t\t\tparameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',\n\n\t\t\tparameters.numLightProbes > 0 ? '#define USE_LIGHT_PROBES' : '',\n\n\t\t\tparameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',\n\t\t\tparameters.reverseDepthBuffer ? '#define USE_REVERSEDEPTHBUF' : '',\n\n\t\t\t'uniform mat4 modelMatrix;',\n\t\t\t'uniform mat4 modelViewMatrix;',\n\t\t\t'uniform mat4 projectionMatrix;',\n\t\t\t'uniform mat4 viewMatrix;',\n\t\t\t'uniform mat3 normalMatrix;',\n\t\t\t'uniform vec3 cameraPosition;',\n\t\t\t'uniform bool isOrthographic;',\n\n\t\t\t'#ifdef USE_INSTANCING',\n\n\t\t\t'\tattribute mat4 instanceMatrix;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_INSTANCING_COLOR',\n\n\t\t\t'\tattribute vec3 instanceColor;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_INSTANCING_MORPH',\n\n\t\t\t'\tuniform sampler2D morphTexture;',\n\n\t\t\t'#endif',\n\n\t\t\t'attribute vec3 position;',\n\t\t\t'attribute vec3 normal;',\n\t\t\t'attribute vec2 uv;',\n\n\t\t\t'#ifdef USE_UV1',\n\n\t\t\t'\tattribute vec2 uv1;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_UV2',\n\n\t\t\t'\tattribute vec2 uv2;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_UV3',\n\n\t\t\t'\tattribute vec2 uv3;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_TANGENT',\n\n\t\t\t'\tattribute vec4 tangent;',\n\n\t\t\t'#endif',\n\n\t\t\t'#if defined( USE_COLOR_ALPHA )',\n\n\t\t\t'\tattribute vec4 color;',\n\n\t\t\t'#elif defined( USE_COLOR )',\n\n\t\t\t'\tattribute vec3 color;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_SKINNING',\n\n\t\t\t'\tattribute vec4 skinIndex;',\n\t\t\t'\tattribute vec4 skinWeight;',\n\n\t\t\t'#endif',\n\n\t\t\t'\\n'\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\tprefixFragment = [\n\n\t\t\tgeneratePrecision( parameters ),\n\n\t\t\t'#define SHADER_TYPE ' + parameters.shaderType,\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines,\n\n\t\t\tparameters.useFog && parameters.fog ? '#define USE_FOG' : '',\n\t\t\tparameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '',\n\n\t\t\tparameters.alphaToCoverage ? '#define ALPHA_TO_COVERAGE' : '',\n\t\t\tparameters.map ? '#define USE_MAP' : '',\n\t\t\tparameters.matcap ? '#define USE_MATCAP' : '',\n\t\t\tparameters.envMap ? '#define USE_ENVMAP' : '',\n\t\t\tparameters.envMap ? '#define ' + envMapTypeDefine : '',\n\t\t\tparameters.envMap ? '#define ' + envMapModeDefine : '',\n\t\t\tparameters.envMap ? '#define ' + envMapBlendingDefine : '',\n\t\t\tenvMapCubeUVSize ? '#define CUBEUV_TEXEL_WIDTH ' + envMapCubeUVSize.texelWidth : '',\n\t\t\tenvMapCubeUVSize ? '#define CUBEUV_TEXEL_HEIGHT ' + envMapCubeUVSize.texelHeight : '',\n\t\t\tenvMapCubeUVSize ? '#define CUBEUV_MAX_MIP ' + envMapCubeUVSize.maxMip + '.0' : '',\n\t\t\tparameters.lightMap ? '#define USE_LIGHTMAP' : '',\n\t\t\tparameters.aoMap ? '#define USE_AOMAP' : '',\n\t\t\tparameters.bumpMap ? '#define USE_BUMPMAP' : '',\n\t\t\tparameters.normalMap ? '#define USE_NORMALMAP' : '',\n\t\t\tparameters.normalMapObjectSpace ? '#define USE_NORMALMAP_OBJECTSPACE' : '',\n\t\t\tparameters.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '',\n\t\t\tparameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',\n\n\t\t\tparameters.anisotropy ? '#define USE_ANISOTROPY' : '',\n\t\t\tparameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '',\n\n\t\t\tparameters.clearcoat ? '#define USE_CLEARCOAT' : '',\n\t\t\tparameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',\n\t\t\tparameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',\n\t\t\tparameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',\n\n\t\t\tparameters.dispersion ? '#define USE_DISPERSION' : '',\n\n\t\t\tparameters.iridescence ? '#define USE_IRIDESCENCE' : '',\n\t\t\tparameters.iridescenceMap ? '#define USE_IRIDESCENCEMAP' : '',\n\t\t\tparameters.iridescenceThicknessMap ? '#define USE_IRIDESCENCE_THICKNESSMAP' : '',\n\n\t\t\tparameters.specularMap ? '#define USE_SPECULARMAP' : '',\n\t\t\tparameters.specularColorMap ? '#define USE_SPECULAR_COLORMAP' : '',\n\t\t\tparameters.specularIntensityMap ? '#define USE_SPECULAR_INTENSITYMAP' : '',\n\n\t\t\tparameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',\n\t\t\tparameters.metalnessMap ? '#define USE_METALNESSMAP' : '',\n\n\t\t\tparameters.alphaMap ? '#define USE_ALPHAMAP' : '',\n\t\t\tparameters.alphaTest ? '#define USE_ALPHATEST' : '',\n\t\t\tparameters.alphaHash ? '#define USE_ALPHAHASH' : '',\n\n\t\t\tparameters.sheen ? '#define USE_SHEEN' : '',\n\t\t\tparameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '',\n\t\t\tparameters.sheenRoughnessMap ? '#define USE_SHEEN_ROUGHNESSMAP' : '',\n\n\t\t\tparameters.transmission ? '#define USE_TRANSMISSION' : '',\n\t\t\tparameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',\n\t\t\tparameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',\n\n\t\t\tparameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',\n\t\t\tparameters.vertexColors || parameters.instancingColor || parameters.batchingColor ? '#define USE_COLOR' : '',\n\t\t\tparameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',\n\t\t\tparameters.vertexUv1s ? '#define USE_UV1' : '',\n\t\t\tparameters.vertexUv2s ? '#define USE_UV2' : '',\n\t\t\tparameters.vertexUv3s ? '#define USE_UV3' : '',\n\n\t\t\tparameters.pointsUvs ? '#define USE_POINTS_UV' : '',\n\n\t\t\tparameters.gradientMap ? '#define USE_GRADIENTMAP' : '',\n\n\t\t\tparameters.flatShading ? '#define FLAT_SHADED' : '',\n\n\t\t\tparameters.doubleSided ? '#define DOUBLE_SIDED' : '',\n\t\t\tparameters.flipSided ? '#define FLIP_SIDED' : '',\n\n\t\t\tparameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',\n\t\t\tparameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '',\n\n\t\t\tparameters.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',\n\n\t\t\tparameters.numLightProbes > 0 ? '#define USE_LIGHT_PROBES' : '',\n\n\t\t\tparameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',\n\t\t\tparameters.decodeVideoTextureEmissive ? '#define DECODE_VIDEO_TEXTURE_EMISSIVE' : '',\n\n\t\t\tparameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',\n\t\t\tparameters.reverseDepthBuffer ? '#define USE_REVERSEDEPTHBUF' : '',\n\n\t\t\t'uniform mat4 viewMatrix;',\n\t\t\t'uniform vec3 cameraPosition;',\n\t\t\t'uniform bool isOrthographic;',\n\n\t\t\t( parameters.toneMapping !== NoToneMapping ) ? '#define TONE_MAPPING' : '',\n\t\t\t( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below\n\t\t\t( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( 'toneMapping', parameters.toneMapping ) : '',\n\n\t\t\tparameters.dithering ? '#define DITHERING' : '',\n\t\t\tparameters.opaque ? '#define OPAQUE' : '',\n\n\t\t\tShaderChunk[ 'colorspace_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below\n\t\t\tgetTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ),\n\t\t\tgetLuminanceFunction(),\n\n\t\t\tparameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',\n\n\t\t\t'\\n'\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t}\n\n\tvertexShader = resolveIncludes( vertexShader );\n\tvertexShader = replaceLightNums( vertexShader, parameters );\n\tvertexShader = replaceClippingPlaneNums( vertexShader, parameters );\n\n\tfragmentShader = resolveIncludes( fragmentShader );\n\tfragmentShader = replaceLightNums( fragmentShader, parameters );\n\tfragmentShader = replaceClippingPlaneNums( fragmentShader, parameters );\n\n\tvertexShader = unrollLoops( vertexShader );\n\tfragmentShader = unrollLoops( fragmentShader );\n\n\tif ( parameters.isRawShaderMaterial !== true ) {\n\n\t\t// GLSL 3.0 conversion for built-in materials and ShaderMaterial\n\n\t\tversionString = '#version 300 es\\n';\n\n\t\tprefixVertex = [\n\t\t\tcustomVertexExtensions,\n\t\t\t'#define attribute in',\n\t\t\t'#define varying out',\n\t\t\t'#define texture2D texture'\n\t\t].join( '\\n' ) + '\\n' + prefixVertex;\n\n\t\tprefixFragment = [\n\t\t\t'#define varying in',\n\t\t\t( parameters.glslVersion === GLSL3 ) ? '' : 'layout(location = 0) out highp vec4 pc_fragColor;',\n\t\t\t( parameters.glslVersion === GLSL3 ) ? '' : '#define gl_FragColor pc_fragColor',\n\t\t\t'#define gl_FragDepthEXT gl_FragDepth',\n\t\t\t'#define texture2D texture',\n\t\t\t'#define textureCube texture',\n\t\t\t'#define texture2DProj textureProj',\n\t\t\t'#define texture2DLodEXT textureLod',\n\t\t\t'#define texture2DProjLodEXT textureProjLod',\n\t\t\t'#define textureCubeLodEXT textureLod',\n\t\t\t'#define texture2DGradEXT textureGrad',\n\t\t\t'#define texture2DProjGradEXT textureProjGrad',\n\t\t\t'#define textureCubeGradEXT textureGrad'\n\t\t].join( '\\n' ) + '\\n' + prefixFragment;\n\n\t}\n\n\tconst vertexGlsl = versionString + prefixVertex + vertexShader;\n\tconst fragmentGlsl = versionString + prefixFragment + fragmentShader;\n\n\t// console.log( '*VERTEX*', vertexGlsl );\n\t// console.log( '*FRAGMENT*', fragmentGlsl );\n\n\tconst glVertexShader = WebGLShader( gl, gl.VERTEX_SHADER, vertexGlsl );\n\tconst glFragmentShader = WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentGlsl );\n\n\tgl.attachShader( program, glVertexShader );\n\tgl.attachShader( program, glFragmentShader );\n\n\t// Force a particular attribute to index 0.\n\n\tif ( parameters.index0AttributeName !== undefined ) {\n\n\t\tgl.bindAttribLocation( program, 0, parameters.index0AttributeName );\n\n\t} else if ( parameters.morphTargets === true ) {\n\n\t\t// programs with morphTargets displace position out of attribute 0\n\t\tgl.bindAttribLocation( program, 0, 'position' );\n\n\t}\n\n\tgl.linkProgram( program );\n\n\tfunction onFirstUse( self ) {\n\n\t\t// check for link errors\n\t\tif ( renderer.debug.checkShaderErrors ) {\n\n\t\t\tconst programLog = gl.getProgramInfoLog( program ).trim();\n\t\t\tconst vertexLog = gl.getShaderInfoLog( glVertexShader ).trim();\n\t\t\tconst fragmentLog = gl.getShaderInfoLog( glFragmentShader ).trim();\n\n\t\t\tlet runnable = true;\n\t\t\tlet haveDiagnostics = true;\n\n\t\t\tif ( gl.getProgramParameter( program, gl.LINK_STATUS ) === false ) {\n\n\t\t\t\trunnable = false;\n\n\t\t\t\tif ( typeof renderer.debug.onShaderError === 'function' ) {\n\n\t\t\t\t\trenderer.debug.onShaderError( gl, program, glVertexShader, glFragmentShader );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// default error reporting\n\n\t\t\t\t\tconst vertexErrors = getShaderErrors( gl, glVertexShader, 'vertex' );\n\t\t\t\t\tconst fragmentErrors = getShaderErrors( gl, glFragmentShader, 'fragment' );\n\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'THREE.WebGLProgram: Shader Error ' + gl.getError() + ' - ' +\n\t\t\t\t\t\t'VALIDATE_STATUS ' + gl.getProgramParameter( program, gl.VALIDATE_STATUS ) + '\\n\\n' +\n\t\t\t\t\t\t'Material Name: ' + self.name + '\\n' +\n\t\t\t\t\t\t'Material Type: ' + self.type + '\\n\\n' +\n\t\t\t\t\t\t'Program Info Log: ' + programLog + '\\n' +\n\t\t\t\t\t\tvertexErrors + '\\n' +\n\t\t\t\t\t\tfragmentErrors\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t} else if ( programLog !== '' ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLProgram: Program Info Log:', programLog );\n\n\t\t\t} else if ( vertexLog === '' || fragmentLog === '' ) {\n\n\t\t\t\thaveDiagnostics = false;\n\n\t\t\t}\n\n\t\t\tif ( haveDiagnostics ) {\n\n\t\t\t\tself.diagnostics = {\n\n\t\t\t\t\trunnable: runnable,\n\n\t\t\t\t\tprogramLog: programLog,\n\n\t\t\t\t\tvertexShader: {\n\n\t\t\t\t\t\tlog: vertexLog,\n\t\t\t\t\t\tprefix: prefixVertex\n\n\t\t\t\t\t},\n\n\t\t\t\t\tfragmentShader: {\n\n\t\t\t\t\t\tlog: fragmentLog,\n\t\t\t\t\t\tprefix: prefixFragment\n\n\t\t\t\t\t}\n\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Clean up\n\n\t\t// Crashes in iOS9 and iOS10. #18402\n\t\t// gl.detachShader( program, glVertexShader );\n\t\t// gl.detachShader( program, glFragmentShader );\n\n\t\tgl.deleteShader( glVertexShader );\n\t\tgl.deleteShader( glFragmentShader );\n\n\t\tcachedUniforms = new WebGLUniforms( gl, program );\n\t\tcachedAttributes = fetchAttributeLocations( gl, program );\n\n\t}\n\n\t// set up caching for uniform locations\n\n\tlet cachedUniforms;\n\n\tthis.getUniforms = function () {\n\n\t\tif ( cachedUniforms === undefined ) {\n\n\t\t\t// Populates cachedUniforms and cachedAttributes\n\t\t\tonFirstUse( this );\n\n\t\t}\n\n\t\treturn cachedUniforms;\n\n\t};\n\n\t// set up caching for attribute locations\n\n\tlet cachedAttributes;\n\n\tthis.getAttributes = function () {\n\n\t\tif ( cachedAttributes === undefined ) {\n\n\t\t\t// Populates cachedAttributes and cachedUniforms\n\t\t\tonFirstUse( this );\n\n\t\t}\n\n\t\treturn cachedAttributes;\n\n\t};\n\n\t// indicate when the program is ready to be used. if the KHR_parallel_shader_compile extension isn't supported,\n\t// flag the program as ready immediately. It may cause a stall when it's first used.\n\n\tlet programReady = ( parameters.rendererExtensionParallelShaderCompile === false );\n\n\tthis.isReady = function () {\n\n\t\tif ( programReady === false ) {\n\n\t\t\tprogramReady = gl.getProgramParameter( program, COMPLETION_STATUS_KHR );\n\n\t\t}\n\n\t\treturn programReady;\n\n\t};\n\n\t// free resource\n\n\tthis.destroy = function () {\n\n\t\tbindingStates.releaseStatesOfProgram( this );\n\n\t\tgl.deleteProgram( program );\n\t\tthis.program = undefined;\n\n\t};\n\n\t//\n\n\tthis.type = parameters.shaderType;\n\tthis.name = parameters.shaderName;\n\tthis.id = programIdCount ++;\n\tthis.cacheKey = cacheKey;\n\tthis.usedTimes = 1;\n\tthis.program = program;\n\tthis.vertexShader = glVertexShader;\n\tthis.fragmentShader = glFragmentShader;\n\n\treturn this;\n\n}\n\nlet _id$1 = 0;\n\nclass WebGLShaderCache {\n\n\tconstructor() {\n\n\t\tthis.shaderCache = new Map();\n\t\tthis.materialCache = new Map();\n\n\t}\n\n\tupdate( material ) {\n\n\t\tconst vertexShader = material.vertexShader;\n\t\tconst fragmentShader = material.fragmentShader;\n\n\t\tconst vertexShaderStage = this._getShaderStage( vertexShader );\n\t\tconst fragmentShaderStage = this._getShaderStage( fragmentShader );\n\n\t\tconst materialShaders = this._getShaderCacheForMaterial( material );\n\n\t\tif ( materialShaders.has( vertexShaderStage ) === false ) {\n\n\t\t\tmaterialShaders.add( vertexShaderStage );\n\t\t\tvertexShaderStage.usedTimes ++;\n\n\t\t}\n\n\t\tif ( materialShaders.has( fragmentShaderStage ) === false ) {\n\n\t\t\tmaterialShaders.add( fragmentShaderStage );\n\t\t\tfragmentShaderStage.usedTimes ++;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tremove( material ) {\n\n\t\tconst materialShaders = this.materialCache.get( material );\n\n\t\tfor ( const shaderStage of materialShaders ) {\n\n\t\t\tshaderStage.usedTimes --;\n\n\t\t\tif ( shaderStage.usedTimes === 0 ) this.shaderCache.delete( shaderStage.code );\n\n\t\t}\n\n\t\tthis.materialCache.delete( material );\n\n\t\treturn this;\n\n\t}\n\n\tgetVertexShaderID( material ) {\n\n\t\treturn this._getShaderStage( material.vertexShader ).id;\n\n\t}\n\n\tgetFragmentShaderID( material ) {\n\n\t\treturn this._getShaderStage( material.fragmentShader ).id;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shaderCache.clear();\n\t\tthis.materialCache.clear();\n\n\t}\n\n\t_getShaderCacheForMaterial( material ) {\n\n\t\tconst cache = this.materialCache;\n\t\tlet set = cache.get( material );\n\n\t\tif ( set === undefined ) {\n\n\t\t\tset = new Set();\n\t\t\tcache.set( material, set );\n\n\t\t}\n\n\t\treturn set;\n\n\t}\n\n\t_getShaderStage( code ) {\n\n\t\tconst cache = this.shaderCache;\n\t\tlet stage = cache.get( code );\n\n\t\tif ( stage === undefined ) {\n\n\t\t\tstage = new WebGLShaderStage( code );\n\t\t\tcache.set( code, stage );\n\n\t\t}\n\n\t\treturn stage;\n\n\t}\n\n}\n\nclass WebGLShaderStage {\n\n\tconstructor( code ) {\n\n\t\tthis.id = _id$1 ++;\n\n\t\tthis.code = code;\n\t\tthis.usedTimes = 0;\n\n\t}\n\n}\n\nfunction WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping ) {\n\n\tconst _programLayers = new Layers();\n\tconst _customShaders = new WebGLShaderCache();\n\tconst _activeChannels = new Set();\n\tconst programs = [];\n\n\tconst logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer;\n\tconst SUPPORTS_VERTEX_TEXTURES = capabilities.vertexTextures;\n\n\tlet precision = capabilities.precision;\n\n\tconst shaderIDs = {\n\t\tMeshDepthMaterial: 'depth',\n\t\tMeshDistanceMaterial: 'distanceRGBA',\n\t\tMeshNormalMaterial: 'normal',\n\t\tMeshBasicMaterial: 'basic',\n\t\tMeshLambertMaterial: 'lambert',\n\t\tMeshPhongMaterial: 'phong',\n\t\tMeshToonMaterial: 'toon',\n\t\tMeshStandardMaterial: 'physical',\n\t\tMeshPhysicalMaterial: 'physical',\n\t\tMeshMatcapMaterial: 'matcap',\n\t\tLineBasicMaterial: 'basic',\n\t\tLineDashedMaterial: 'dashed',\n\t\tPointsMaterial: 'points',\n\t\tShadowMaterial: 'shadow',\n\t\tSpriteMaterial: 'sprite'\n\t};\n\n\tfunction getChannel( value ) {\n\n\t\t_activeChannels.add( value );\n\n\t\tif ( value === 0 ) return 'uv';\n\n\t\treturn `uv${ value }`;\n\n\t}\n\n\tfunction getParameters( material, lights, shadows, scene, object ) {\n\n\t\tconst fog = scene.fog;\n\t\tconst geometry = object.geometry;\n\t\tconst environment = material.isMeshStandardMaterial ? scene.environment : null;\n\n\t\tconst envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );\n\t\tconst envMapCubeUVHeight = ( !! envMap ) && ( envMap.mapping === CubeUVReflectionMapping ) ? envMap.image.height : null;\n\n\t\tconst shaderID = shaderIDs[ material.type ];\n\n\t\t// heuristics to create shader parameters according to lights in the scene\n\t\t// (not to blow over maxLights budget)\n\n\t\tif ( material.precision !== null ) {\n\n\t\t\tprecision = capabilities.getMaxPrecision( material.precision );\n\n\t\t\tif ( precision !== material.precision ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.' );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tconst morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;\n\t\tconst morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;\n\n\t\tlet morphTextureStride = 0;\n\n\t\tif ( geometry.morphAttributes.position !== undefined ) morphTextureStride = 1;\n\t\tif ( geometry.morphAttributes.normal !== undefined ) morphTextureStride = 2;\n\t\tif ( geometry.morphAttributes.color !== undefined ) morphTextureStride = 3;\n\n\t\t//\n\n\t\tlet vertexShader, fragmentShader;\n\t\tlet customVertexShaderID, customFragmentShaderID;\n\n\t\tif ( shaderID ) {\n\n\t\t\tconst shader = ShaderLib[ shaderID ];\n\n\t\t\tvertexShader = shader.vertexShader;\n\t\t\tfragmentShader = shader.fragmentShader;\n\n\t\t} else {\n\n\t\t\tvertexShader = material.vertexShader;\n\t\t\tfragmentShader = material.fragmentShader;\n\n\t\t\t_customShaders.update( material );\n\n\t\t\tcustomVertexShaderID = _customShaders.getVertexShaderID( material );\n\t\t\tcustomFragmentShaderID = _customShaders.getFragmentShaderID( material );\n\n\t\t}\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\tconst reverseDepthBuffer = renderer.state.buffers.depth.getReversed();\n\n\t\tconst IS_INSTANCEDMESH = object.isInstancedMesh === true;\n\t\tconst IS_BATCHEDMESH = object.isBatchedMesh === true;\n\n\t\tconst HAS_MAP = !! material.map;\n\t\tconst HAS_MATCAP = !! material.matcap;\n\t\tconst HAS_ENVMAP = !! envMap;\n\t\tconst HAS_AOMAP = !! material.aoMap;\n\t\tconst HAS_LIGHTMAP = !! material.lightMap;\n\t\tconst HAS_BUMPMAP = !! material.bumpMap;\n\t\tconst HAS_NORMALMAP = !! material.normalMap;\n\t\tconst HAS_DISPLACEMENTMAP = !! material.displacementMap;\n\t\tconst HAS_EMISSIVEMAP = !! material.emissiveMap;\n\n\t\tconst HAS_METALNESSMAP = !! material.metalnessMap;\n\t\tconst HAS_ROUGHNESSMAP = !! material.roughnessMap;\n\n\t\tconst HAS_ANISOTROPY = material.anisotropy > 0;\n\t\tconst HAS_CLEARCOAT = material.clearcoat > 0;\n\t\tconst HAS_DISPERSION = material.dispersion > 0;\n\t\tconst HAS_IRIDESCENCE = material.iridescence > 0;\n\t\tconst HAS_SHEEN = material.sheen > 0;\n\t\tconst HAS_TRANSMISSION = material.transmission > 0;\n\n\t\tconst HAS_ANISOTROPYMAP = HAS_ANISOTROPY && !! material.anisotropyMap;\n\n\t\tconst HAS_CLEARCOATMAP = HAS_CLEARCOAT && !! material.clearcoatMap;\n\t\tconst HAS_CLEARCOAT_NORMALMAP = HAS_CLEARCOAT && !! material.clearcoatNormalMap;\n\t\tconst HAS_CLEARCOAT_ROUGHNESSMAP = HAS_CLEARCOAT && !! material.clearcoatRoughnessMap;\n\n\t\tconst HAS_IRIDESCENCEMAP = HAS_IRIDESCENCE && !! material.iridescenceMap;\n\t\tconst HAS_IRIDESCENCE_THICKNESSMAP = HAS_IRIDESCENCE && !! material.iridescenceThicknessMap;\n\n\t\tconst HAS_SHEEN_COLORMAP = HAS_SHEEN && !! material.sheenColorMap;\n\t\tconst HAS_SHEEN_ROUGHNESSMAP = HAS_SHEEN && !! material.sheenRoughnessMap;\n\n\t\tconst HAS_SPECULARMAP = !! material.specularMap;\n\t\tconst HAS_SPECULAR_COLORMAP = !! material.specularColorMap;\n\t\tconst HAS_SPECULAR_INTENSITYMAP = !! material.specularIntensityMap;\n\n\t\tconst HAS_TRANSMISSIONMAP = HAS_TRANSMISSION && !! material.transmissionMap;\n\t\tconst HAS_THICKNESSMAP = HAS_TRANSMISSION && !! material.thicknessMap;\n\n\t\tconst HAS_GRADIENTMAP = !! material.gradientMap;\n\n\t\tconst HAS_ALPHAMAP = !! material.alphaMap;\n\n\t\tconst HAS_ALPHATEST = material.alphaTest > 0;\n\n\t\tconst HAS_ALPHAHASH = !! material.alphaHash;\n\n\t\tconst HAS_EXTENSIONS = !! material.extensions;\n\n\t\tlet toneMapping = NoToneMapping;\n\n\t\tif ( material.toneMapped ) {\n\n\t\t\tif ( currentRenderTarget === null || currentRenderTarget.isXRRenderTarget === true ) {\n\n\t\t\t\ttoneMapping = renderer.toneMapping;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst parameters = {\n\n\t\t\tshaderID: shaderID,\n\t\t\tshaderType: material.type,\n\t\t\tshaderName: material.name,\n\n\t\t\tvertexShader: vertexShader,\n\t\t\tfragmentShader: fragmentShader,\n\t\t\tdefines: material.defines,\n\n\t\t\tcustomVertexShaderID: customVertexShaderID,\n\t\t\tcustomFragmentShaderID: customFragmentShaderID,\n\n\t\t\tisRawShaderMaterial: material.isRawShaderMaterial === true,\n\t\t\tglslVersion: material.glslVersion,\n\n\t\t\tprecision: precision,\n\n\t\t\tbatching: IS_BATCHEDMESH,\n\t\t\tbatchingColor: IS_BATCHEDMESH && object._colorsTexture !== null,\n\t\t\tinstancing: IS_INSTANCEDMESH,\n\t\t\tinstancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,\n\t\t\tinstancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null,\n\n\t\t\tsupportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,\n\t\t\toutputColorSpace: ( currentRenderTarget === null ) ? renderer.outputColorSpace : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace ),\n\t\t\talphaToCoverage: !! material.alphaToCoverage,\n\n\t\t\tmap: HAS_MAP,\n\t\t\tmatcap: HAS_MATCAP,\n\t\t\tenvMap: HAS_ENVMAP,\n\t\t\tenvMapMode: HAS_ENVMAP && envMap.mapping,\n\t\t\tenvMapCubeUVHeight: envMapCubeUVHeight,\n\t\t\taoMap: HAS_AOMAP,\n\t\t\tlightMap: HAS_LIGHTMAP,\n\t\t\tbumpMap: HAS_BUMPMAP,\n\t\t\tnormalMap: HAS_NORMALMAP,\n\t\t\tdisplacementMap: SUPPORTS_VERTEX_TEXTURES && HAS_DISPLACEMENTMAP,\n\t\t\temissiveMap: HAS_EMISSIVEMAP,\n\n\t\t\tnormalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap,\n\t\t\tnormalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap,\n\n\t\t\tmetalnessMap: HAS_METALNESSMAP,\n\t\t\troughnessMap: HAS_ROUGHNESSMAP,\n\n\t\t\tanisotropy: HAS_ANISOTROPY,\n\t\t\tanisotropyMap: HAS_ANISOTROPYMAP,\n\n\t\t\tclearcoat: HAS_CLEARCOAT,\n\t\t\tclearcoatMap: HAS_CLEARCOATMAP,\n\t\t\tclearcoatNormalMap: HAS_CLEARCOAT_NORMALMAP,\n\t\t\tclearcoatRoughnessMap: HAS_CLEARCOAT_ROUGHNESSMAP,\n\n\t\t\tdispersion: HAS_DISPERSION,\n\n\t\t\tiridescence: HAS_IRIDESCENCE,\n\t\t\tiridescenceMap: HAS_IRIDESCENCEMAP,\n\t\t\tiridescenceThicknessMap: HAS_IRIDESCENCE_THICKNESSMAP,\n\n\t\t\tsheen: HAS_SHEEN,\n\t\t\tsheenColorMap: HAS_SHEEN_COLORMAP,\n\t\t\tsheenRoughnessMap: HAS_SHEEN_ROUGHNESSMAP,\n\n\t\t\tspecularMap: HAS_SPECULARMAP,\n\t\t\tspecularColorMap: HAS_SPECULAR_COLORMAP,\n\t\t\tspecularIntensityMap: HAS_SPECULAR_INTENSITYMAP,\n\n\t\t\ttransmission: HAS_TRANSMISSION,\n\t\t\ttransmissionMap: HAS_TRANSMISSIONMAP,\n\t\t\tthicknessMap: HAS_THICKNESSMAP,\n\n\t\t\tgradientMap: HAS_GRADIENTMAP,\n\n\t\t\topaque: material.transparent === false && material.blending === NormalBlending && material.alphaToCoverage === false,\n\n\t\t\talphaMap: HAS_ALPHAMAP,\n\t\t\talphaTest: HAS_ALPHATEST,\n\t\t\talphaHash: HAS_ALPHAHASH,\n\n\t\t\tcombine: material.combine,\n\n\t\t\t//\n\n\t\t\tmapUv: HAS_MAP && getChannel( material.map.channel ),\n\t\t\taoMapUv: HAS_AOMAP && getChannel( material.aoMap.channel ),\n\t\t\tlightMapUv: HAS_LIGHTMAP && getChannel( material.lightMap.channel ),\n\t\t\tbumpMapUv: HAS_BUMPMAP && getChannel( material.bumpMap.channel ),\n\t\t\tnormalMapUv: HAS_NORMALMAP && getChannel( material.normalMap.channel ),\n\t\t\tdisplacementMapUv: HAS_DISPLACEMENTMAP && getChannel( material.displacementMap.channel ),\n\t\t\temissiveMapUv: HAS_EMISSIVEMAP && getChannel( material.emissiveMap.channel ),\n\n\t\t\tmetalnessMapUv: HAS_METALNESSMAP && getChannel( material.metalnessMap.channel ),\n\t\t\troughnessMapUv: HAS_ROUGHNESSMAP && getChannel( material.roughnessMap.channel ),\n\n\t\t\tanisotropyMapUv: HAS_ANISOTROPYMAP && getChannel( material.anisotropyMap.channel ),\n\n\t\t\tclearcoatMapUv: HAS_CLEARCOATMAP && getChannel( material.clearcoatMap.channel ),\n\t\t\tclearcoatNormalMapUv: HAS_CLEARCOAT_NORMALMAP && getChannel( material.clearcoatNormalMap.channel ),\n\t\t\tclearcoatRoughnessMapUv: HAS_CLEARCOAT_ROUGHNESSMAP && getChannel( material.clearcoatRoughnessMap.channel ),\n\n\t\t\tiridescenceMapUv: HAS_IRIDESCENCEMAP && getChannel( material.iridescenceMap.channel ),\n\t\t\tiridescenceThicknessMapUv: HAS_IRIDESCENCE_THICKNESSMAP && getChannel( material.iridescenceThicknessMap.channel ),\n\n\t\t\tsheenColorMapUv: HAS_SHEEN_COLORMAP && getChannel( material.sheenColorMap.channel ),\n\t\t\tsheenRoughnessMapUv: HAS_SHEEN_ROUGHNESSMAP && getChannel( material.sheenRoughnessMap.channel ),\n\n\t\t\tspecularMapUv: HAS_SPECULARMAP && getChannel( material.specularMap.channel ),\n\t\t\tspecularColorMapUv: HAS_SPECULAR_COLORMAP && getChannel( material.specularColorMap.channel ),\n\t\t\tspecularIntensityMapUv: HAS_SPECULAR_INTENSITYMAP && getChannel( material.specularIntensityMap.channel ),\n\n\t\t\ttransmissionMapUv: HAS_TRANSMISSIONMAP && getChannel( material.transmissionMap.channel ),\n\t\t\tthicknessMapUv: HAS_THICKNESSMAP && getChannel( material.thicknessMap.channel ),\n\n\t\t\talphaMapUv: HAS_ALPHAMAP && getChannel( material.alphaMap.channel ),\n\n\t\t\t//\n\n\t\t\tvertexTangents: !! geometry.attributes.tangent && ( HAS_NORMALMAP || HAS_ANISOTROPY ),\n\t\t\tvertexColors: material.vertexColors,\n\t\t\tvertexAlphas: material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4,\n\n\t\t\tpointsUvs: object.isPoints === true && !! geometry.attributes.uv && ( HAS_MAP || HAS_ALPHAMAP ),\n\n\t\t\tfog: !! fog,\n\t\t\tuseFog: material.fog === true,\n\t\t\tfogExp2: ( !! fog && fog.isFogExp2 ),\n\n\t\t\tflatShading: material.flatShading === true,\n\n\t\t\tsizeAttenuation: material.sizeAttenuation === true,\n\t\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\t\t\treverseDepthBuffer: reverseDepthBuffer,\n\n\t\t\tskinning: object.isSkinnedMesh === true,\n\n\t\t\tmorphTargets: geometry.morphAttributes.position !== undefined,\n\t\t\tmorphNormals: geometry.morphAttributes.normal !== undefined,\n\t\t\tmorphColors: geometry.morphAttributes.color !== undefined,\n\t\t\tmorphTargetsCount: morphTargetsCount,\n\t\t\tmorphTextureStride: morphTextureStride,\n\n\t\t\tnumDirLights: lights.directional.length,\n\t\t\tnumPointLights: lights.point.length,\n\t\t\tnumSpotLights: lights.spot.length,\n\t\t\tnumSpotLightMaps: lights.spotLightMap.length,\n\t\t\tnumRectAreaLights: lights.rectArea.length,\n\t\t\tnumHemiLights: lights.hemi.length,\n\n\t\t\tnumDirLightShadows: lights.directionalShadowMap.length,\n\t\t\tnumPointLightShadows: lights.pointShadowMap.length,\n\t\t\tnumSpotLightShadows: lights.spotShadowMap.length,\n\t\t\tnumSpotLightShadowsWithMaps: lights.numSpotLightShadowsWithMaps,\n\n\t\t\tnumLightProbes: lights.numLightProbes,\n\n\t\t\tnumClippingPlanes: clipping.numPlanes,\n\t\t\tnumClipIntersection: clipping.numIntersection,\n\n\t\t\tdithering: material.dithering,\n\n\t\t\tshadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0,\n\t\t\tshadowMapType: renderer.shadowMap.type,\n\n\t\t\ttoneMapping: toneMapping,\n\n\t\t\tdecodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( ColorManagement.getTransfer( material.map.colorSpace ) === SRGBTransfer ),\n\t\t\tdecodeVideoTextureEmissive: HAS_EMISSIVEMAP && ( material.emissiveMap.isVideoTexture === true ) && ( ColorManagement.getTransfer( material.emissiveMap.colorSpace ) === SRGBTransfer ),\n\n\t\t\tpremultipliedAlpha: material.premultipliedAlpha,\n\n\t\t\tdoubleSided: material.side === DoubleSide,\n\t\t\tflipSided: material.side === BackSide,\n\n\t\t\tuseDepthPacking: material.depthPacking >= 0,\n\t\t\tdepthPacking: material.depthPacking || 0,\n\n\t\t\tindex0AttributeName: material.index0AttributeName,\n\n\t\t\textensionClipCullDistance: HAS_EXTENSIONS && material.extensions.clipCullDistance === true && extensions.has( 'WEBGL_clip_cull_distance' ),\n\t\t\textensionMultiDraw: ( HAS_EXTENSIONS && material.extensions.multiDraw === true || IS_BATCHEDMESH ) && extensions.has( 'WEBGL_multi_draw' ),\n\n\t\t\trendererExtensionParallelShaderCompile: extensions.has( 'KHR_parallel_shader_compile' ),\n\n\t\t\tcustomProgramCacheKey: material.customProgramCacheKey()\n\n\t\t};\n\n\t\t// the usage of getChannel() determines the active texture channels for this shader\n\n\t\tparameters.vertexUv1s = _activeChannels.has( 1 );\n\t\tparameters.vertexUv2s = _activeChannels.has( 2 );\n\t\tparameters.vertexUv3s = _activeChannels.has( 3 );\n\n\t\t_activeChannels.clear();\n\n\t\treturn parameters;\n\n\t}\n\n\tfunction getProgramCacheKey( parameters ) {\n\n\t\tconst array = [];\n\n\t\tif ( parameters.shaderID ) {\n\n\t\t\tarray.push( parameters.shaderID );\n\n\t\t} else {\n\n\t\t\tarray.push( parameters.customVertexShaderID );\n\t\t\tarray.push( parameters.customFragmentShaderID );\n\n\t\t}\n\n\t\tif ( parameters.defines !== undefined ) {\n\n\t\t\tfor ( const name in parameters.defines ) {\n\n\t\t\t\tarray.push( name );\n\t\t\t\tarray.push( parameters.defines[ name ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( parameters.isRawShaderMaterial === false ) {\n\n\t\t\tgetProgramCacheKeyParameters( array, parameters );\n\t\t\tgetProgramCacheKeyBooleans( array, parameters );\n\t\t\tarray.push( renderer.outputColorSpace );\n\n\t\t}\n\n\t\tarray.push( parameters.customProgramCacheKey );\n\n\t\treturn array.join();\n\n\t}\n\n\tfunction getProgramCacheKeyParameters( array, parameters ) {\n\n\t\tarray.push( parameters.precision );\n\t\tarray.push( parameters.outputColorSpace );\n\t\tarray.push( parameters.envMapMode );\n\t\tarray.push( parameters.envMapCubeUVHeight );\n\t\tarray.push( parameters.mapUv );\n\t\tarray.push( parameters.alphaMapUv );\n\t\tarray.push( parameters.lightMapUv );\n\t\tarray.push( parameters.aoMapUv );\n\t\tarray.push( parameters.bumpMapUv );\n\t\tarray.push( parameters.normalMapUv );\n\t\tarray.push( parameters.displacementMapUv );\n\t\tarray.push( parameters.emissiveMapUv );\n\t\tarray.push( parameters.metalnessMapUv );\n\t\tarray.push( parameters.roughnessMapUv );\n\t\tarray.push( parameters.anisotropyMapUv );\n\t\tarray.push( parameters.clearcoatMapUv );\n\t\tarray.push( parameters.clearcoatNormalMapUv );\n\t\tarray.push( parameters.clearcoatRoughnessMapUv );\n\t\tarray.push( parameters.iridescenceMapUv );\n\t\tarray.push( parameters.iridescenceThicknessMapUv );\n\t\tarray.push( parameters.sheenColorMapUv );\n\t\tarray.push( parameters.sheenRoughnessMapUv );\n\t\tarray.push( parameters.specularMapUv );\n\t\tarray.push( parameters.specularColorMapUv );\n\t\tarray.push( parameters.specularIntensityMapUv );\n\t\tarray.push( parameters.transmissionMapUv );\n\t\tarray.push( parameters.thicknessMapUv );\n\t\tarray.push( parameters.combine );\n\t\tarray.push( parameters.fogExp2 );\n\t\tarray.push( parameters.sizeAttenuation );\n\t\tarray.push( parameters.morphTargetsCount );\n\t\tarray.push( parameters.morphAttributeCount );\n\t\tarray.push( parameters.numDirLights );\n\t\tarray.push( parameters.numPointLights );\n\t\tarray.push( parameters.numSpotLights );\n\t\tarray.push( parameters.numSpotLightMaps );\n\t\tarray.push( parameters.numHemiLights );\n\t\tarray.push( parameters.numRectAreaLights );\n\t\tarray.push( parameters.numDirLightShadows );\n\t\tarray.push( parameters.numPointLightShadows );\n\t\tarray.push( parameters.numSpotLightShadows );\n\t\tarray.push( parameters.numSpotLightShadowsWithMaps );\n\t\tarray.push( parameters.numLightProbes );\n\t\tarray.push( parameters.shadowMapType );\n\t\tarray.push( parameters.toneMapping );\n\t\tarray.push( parameters.numClippingPlanes );\n\t\tarray.push( parameters.numClipIntersection );\n\t\tarray.push( parameters.depthPacking );\n\n\t}\n\n\tfunction getProgramCacheKeyBooleans( array, parameters ) {\n\n\t\t_programLayers.disableAll();\n\n\t\tif ( parameters.supportsVertexTextures )\n\t\t\t_programLayers.enable( 0 );\n\t\tif ( parameters.instancing )\n\t\t\t_programLayers.enable( 1 );\n\t\tif ( parameters.instancingColor )\n\t\t\t_programLayers.enable( 2 );\n\t\tif ( parameters.instancingMorph )\n\t\t\t_programLayers.enable( 3 );\n\t\tif ( parameters.matcap )\n\t\t\t_programLayers.enable( 4 );\n\t\tif ( parameters.envMap )\n\t\t\t_programLayers.enable( 5 );\n\t\tif ( parameters.normalMapObjectSpace )\n\t\t\t_programLayers.enable( 6 );\n\t\tif ( parameters.normalMapTangentSpace )\n\t\t\t_programLayers.enable( 7 );\n\t\tif ( parameters.clearcoat )\n\t\t\t_programLayers.enable( 8 );\n\t\tif ( parameters.iridescence )\n\t\t\t_programLayers.enable( 9 );\n\t\tif ( parameters.alphaTest )\n\t\t\t_programLayers.enable( 10 );\n\t\tif ( parameters.vertexColors )\n\t\t\t_programLayers.enable( 11 );\n\t\tif ( parameters.vertexAlphas )\n\t\t\t_programLayers.enable( 12 );\n\t\tif ( parameters.vertexUv1s )\n\t\t\t_programLayers.enable( 13 );\n\t\tif ( parameters.vertexUv2s )\n\t\t\t_programLayers.enable( 14 );\n\t\tif ( parameters.vertexUv3s )\n\t\t\t_programLayers.enable( 15 );\n\t\tif ( parameters.vertexTangents )\n\t\t\t_programLayers.enable( 16 );\n\t\tif ( parameters.anisotropy )\n\t\t\t_programLayers.enable( 17 );\n\t\tif ( parameters.alphaHash )\n\t\t\t_programLayers.enable( 18 );\n\t\tif ( parameters.batching )\n\t\t\t_programLayers.enable( 19 );\n\t\tif ( parameters.dispersion )\n\t\t\t_programLayers.enable( 20 );\n\t\tif ( parameters.batchingColor )\n\t\t\t_programLayers.enable( 21 );\n\n\t\tarray.push( _programLayers.mask );\n\t\t_programLayers.disableAll();\n\n\t\tif ( parameters.fog )\n\t\t\t_programLayers.enable( 0 );\n\t\tif ( parameters.useFog )\n\t\t\t_programLayers.enable( 1 );\n\t\tif ( parameters.flatShading )\n\t\t\t_programLayers.enable( 2 );\n\t\tif ( parameters.logarithmicDepthBuffer )\n\t\t\t_programLayers.enable( 3 );\n\t\tif ( parameters.reverseDepthBuffer )\n\t\t\t_programLayers.enable( 4 );\n\t\tif ( parameters.skinning )\n\t\t\t_programLayers.enable( 5 );\n\t\tif ( parameters.morphTargets )\n\t\t\t_programLayers.enable( 6 );\n\t\tif ( parameters.morphNormals )\n\t\t\t_programLayers.enable( 7 );\n\t\tif ( parameters.morphColors )\n\t\t\t_programLayers.enable( 8 );\n\t\tif ( parameters.premultipliedAlpha )\n\t\t\t_programLayers.enable( 9 );\n\t\tif ( parameters.shadowMapEnabled )\n\t\t\t_programLayers.enable( 10 );\n\t\tif ( parameters.doubleSided )\n\t\t\t_programLayers.enable( 11 );\n\t\tif ( parameters.flipSided )\n\t\t\t_programLayers.enable( 12 );\n\t\tif ( parameters.useDepthPacking )\n\t\t\t_programLayers.enable( 13 );\n\t\tif ( parameters.dithering )\n\t\t\t_programLayers.enable( 14 );\n\t\tif ( parameters.transmission )\n\t\t\t_programLayers.enable( 15 );\n\t\tif ( parameters.sheen )\n\t\t\t_programLayers.enable( 16 );\n\t\tif ( parameters.opaque )\n\t\t\t_programLayers.enable( 17 );\n\t\tif ( parameters.pointsUvs )\n\t\t\t_programLayers.enable( 18 );\n\t\tif ( parameters.decodeVideoTexture )\n\t\t\t_programLayers.enable( 19 );\n\t\tif ( parameters.decodeVideoTextureEmissive )\n\t\t\t_programLayers.enable( 20 );\n\t\tif ( parameters.alphaToCoverage )\n\t\t\t_programLayers.enable( 21 );\n\n\t\tarray.push( _programLayers.mask );\n\n\t}\n\n\tfunction getUniforms( material ) {\n\n\t\tconst shaderID = shaderIDs[ material.type ];\n\t\tlet uniforms;\n\n\t\tif ( shaderID ) {\n\n\t\t\tconst shader = ShaderLib[ shaderID ];\n\t\t\tuniforms = UniformsUtils.clone( shader.uniforms );\n\n\t\t} else {\n\n\t\t\tuniforms = material.uniforms;\n\n\t\t}\n\n\t\treturn uniforms;\n\n\t}\n\n\tfunction acquireProgram( parameters, cacheKey ) {\n\n\t\tlet program;\n\n\t\t// Check if code has been already compiled\n\t\tfor ( let p = 0, pl = programs.length; p < pl; p ++ ) {\n\n\t\t\tconst preexistingProgram = programs[ p ];\n\n\t\t\tif ( preexistingProgram.cacheKey === cacheKey ) {\n\n\t\t\t\tprogram = preexistingProgram;\n\t\t\t\t++ program.usedTimes;\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( program === undefined ) {\n\n\t\t\tprogram = new WebGLProgram( renderer, cacheKey, parameters, bindingStates );\n\t\t\tprograms.push( program );\n\n\t\t}\n\n\t\treturn program;\n\n\t}\n\n\tfunction releaseProgram( program ) {\n\n\t\tif ( -- program.usedTimes === 0 ) {\n\n\t\t\t// Remove from unordered set\n\t\t\tconst i = programs.indexOf( program );\n\t\t\tprograms[ i ] = programs[ programs.length - 1 ];\n\t\t\tprograms.pop();\n\n\t\t\t// Free WebGL resources\n\t\t\tprogram.destroy();\n\n\t\t}\n\n\t}\n\n\tfunction releaseShaderCache( material ) {\n\n\t\t_customShaders.remove( material );\n\n\t}\n\n\tfunction dispose() {\n\n\t\t_customShaders.dispose();\n\n\t}\n\n\treturn {\n\t\tgetParameters: getParameters,\n\t\tgetProgramCacheKey: getProgramCacheKey,\n\t\tgetUniforms: getUniforms,\n\t\tacquireProgram: acquireProgram,\n\t\treleaseProgram: releaseProgram,\n\t\treleaseShaderCache: releaseShaderCache,\n\t\t// Exposed for resource monitoring & error feedback via renderer.info:\n\t\tprograms: programs,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction WebGLProperties() {\n\n\tlet properties = new WeakMap();\n\n\tfunction has( object ) {\n\n\t\treturn properties.has( object );\n\n\t}\n\n\tfunction get( object ) {\n\n\t\tlet map = properties.get( object );\n\n\t\tif ( map === undefined ) {\n\n\t\t\tmap = {};\n\t\t\tproperties.set( object, map );\n\n\t\t}\n\n\t\treturn map;\n\n\t}\n\n\tfunction remove( object ) {\n\n\t\tproperties.delete( object );\n\n\t}\n\n\tfunction update( object, key, value ) {\n\n\t\tproperties.get( object )[ key ] = value;\n\n\t}\n\n\tfunction dispose() {\n\n\t\tproperties = new WeakMap();\n\n\t}\n\n\treturn {\n\t\thas: has,\n\t\tget: get,\n\t\tremove: remove,\n\t\tupdate: update,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction painterSortStable( a, b ) {\n\n\tif ( a.groupOrder !== b.groupOrder ) {\n\n\t\treturn a.groupOrder - b.groupOrder;\n\n\t} else if ( a.renderOrder !== b.renderOrder ) {\n\n\t\treturn a.renderOrder - b.renderOrder;\n\n\t} else if ( a.material.id !== b.material.id ) {\n\n\t\treturn a.material.id - b.material.id;\n\n\t} else if ( a.z !== b.z ) {\n\n\t\treturn a.z - b.z;\n\n\t} else {\n\n\t\treturn a.id - b.id;\n\n\t}\n\n}\n\nfunction reversePainterSortStable( a, b ) {\n\n\tif ( a.groupOrder !== b.groupOrder ) {\n\n\t\treturn a.groupOrder - b.groupOrder;\n\n\t} else if ( a.renderOrder !== b.renderOrder ) {\n\n\t\treturn a.renderOrder - b.renderOrder;\n\n\t} else if ( a.z !== b.z ) {\n\n\t\treturn b.z - a.z;\n\n\t} else {\n\n\t\treturn a.id - b.id;\n\n\t}\n\n}\n\n\nfunction WebGLRenderList() {\n\n\tconst renderItems = [];\n\tlet renderItemsIndex = 0;\n\n\tconst opaque = [];\n\tconst transmissive = [];\n\tconst transparent = [];\n\n\tfunction init() {\n\n\t\trenderItemsIndex = 0;\n\n\t\topaque.length = 0;\n\t\ttransmissive.length = 0;\n\t\ttransparent.length = 0;\n\n\t}\n\n\tfunction getNextRenderItem( object, geometry, material, groupOrder, z, group ) {\n\n\t\tlet renderItem = renderItems[ renderItemsIndex ];\n\n\t\tif ( renderItem === undefined ) {\n\n\t\t\trenderItem = {\n\t\t\t\tid: object.id,\n\t\t\t\tobject: object,\n\t\t\t\tgeometry: geometry,\n\t\t\t\tmaterial: material,\n\t\t\t\tgroupOrder: groupOrder,\n\t\t\t\trenderOrder: object.renderOrder,\n\t\t\t\tz: z,\n\t\t\t\tgroup: group\n\t\t\t};\n\n\t\t\trenderItems[ renderItemsIndex ] = renderItem;\n\n\t\t} else {\n\n\t\t\trenderItem.id = object.id;\n\t\t\trenderItem.object = object;\n\t\t\trenderItem.geometry = geometry;\n\t\t\trenderItem.material = material;\n\t\t\trenderItem.groupOrder = groupOrder;\n\t\t\trenderItem.renderOrder = object.renderOrder;\n\t\t\trenderItem.z = z;\n\t\t\trenderItem.group = group;\n\n\t\t}\n\n\t\trenderItemsIndex ++;\n\n\t\treturn renderItem;\n\n\t}\n\n\tfunction push( object, geometry, material, groupOrder, z, group ) {\n\n\t\tconst renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group );\n\n\t\tif ( material.transmission > 0.0 ) {\n\n\t\t\ttransmissive.push( renderItem );\n\n\t\t} else if ( material.transparent === true ) {\n\n\t\t\ttransparent.push( renderItem );\n\n\t\t} else {\n\n\t\t\topaque.push( renderItem );\n\n\t\t}\n\n\t}\n\n\tfunction unshift( object, geometry, material, groupOrder, z, group ) {\n\n\t\tconst renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group );\n\n\t\tif ( material.transmission > 0.0 ) {\n\n\t\t\ttransmissive.unshift( renderItem );\n\n\t\t} else if ( material.transparent === true ) {\n\n\t\t\ttransparent.unshift( renderItem );\n\n\t\t} else {\n\n\t\t\topaque.unshift( renderItem );\n\n\t\t}\n\n\t}\n\n\tfunction sort( customOpaqueSort, customTransparentSort ) {\n\n\t\tif ( opaque.length > 1 ) opaque.sort( customOpaqueSort || painterSortStable );\n\t\tif ( transmissive.length > 1 ) transmissive.sort( customTransparentSort || reversePainterSortStable );\n\t\tif ( transparent.length > 1 ) transparent.sort( customTransparentSort || reversePainterSortStable );\n\n\t}\n\n\tfunction finish() {\n\n\t\t// Clear references from inactive renderItems in the list\n\n\t\tfor ( let i = renderItemsIndex, il = renderItems.length; i < il; i ++ ) {\n\n\t\t\tconst renderItem = renderItems[ i ];\n\n\t\t\tif ( renderItem.id === null ) break;\n\n\t\t\trenderItem.id = null;\n\t\t\trenderItem.object = null;\n\t\t\trenderItem.geometry = null;\n\t\t\trenderItem.material = null;\n\t\t\trenderItem.group = null;\n\n\t\t}\n\n\t}\n\n\treturn {\n\n\t\topaque: opaque,\n\t\ttransmissive: transmissive,\n\t\ttransparent: transparent,\n\n\t\tinit: init,\n\t\tpush: push,\n\t\tunshift: unshift,\n\t\tfinish: finish,\n\n\t\tsort: sort\n\t};\n\n}\n\nfunction WebGLRenderLists() {\n\n\tlet lists = new WeakMap();\n\n\tfunction get( scene, renderCallDepth ) {\n\n\t\tconst listArray = lists.get( scene );\n\t\tlet list;\n\n\t\tif ( listArray === undefined ) {\n\n\t\t\tlist = new WebGLRenderList();\n\t\t\tlists.set( scene, [ list ] );\n\n\t\t} else {\n\n\t\t\tif ( renderCallDepth >= listArray.length ) {\n\n\t\t\t\tlist = new WebGLRenderList();\n\t\t\t\tlistArray.push( list );\n\n\t\t\t} else {\n\n\t\t\t\tlist = listArray[ renderCallDepth ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn list;\n\n\t}\n\n\tfunction dispose() {\n\n\t\tlists = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction UniformsCache() {\n\n\tconst lights = {};\n\n\treturn {\n\n\t\tget: function ( light ) {\n\n\t\t\tif ( lights[ light.id ] !== undefined ) {\n\n\t\t\t\treturn lights[ light.id ];\n\n\t\t\t}\n\n\t\t\tlet uniforms;\n\n\t\t\tswitch ( light.type ) {\n\n\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\tcolor: new Color()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SpotLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\tconeCos: 0,\n\t\t\t\t\t\tpenumbraCos: 0,\n\t\t\t\t\t\tdecay: 0\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PointLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\tdecay: 0\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'HemisphereLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\tskyColor: new Color(),\n\t\t\t\t\t\tgroundColor: new Color()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'RectAreaLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\thalfWidth: new Vector3(),\n\t\t\t\t\t\thalfHeight: new Vector3()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tlights[ light.id ] = uniforms;\n\n\t\t\treturn uniforms;\n\n\t\t}\n\n\t};\n\n}\n\nfunction ShadowUniformsCache() {\n\n\tconst lights = {};\n\n\treturn {\n\n\t\tget: function ( light ) {\n\n\t\t\tif ( lights[ light.id ] !== undefined ) {\n\n\t\t\t\treturn lights[ light.id ];\n\n\t\t\t}\n\n\t\t\tlet uniforms;\n\n\t\t\tswitch ( light.type ) {\n\n\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tshadowIntensity: 1,\n\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SpotLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tshadowIntensity: 1,\n\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PointLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tshadowIntensity: 1,\n\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\tshadowMapSize: new Vector2(),\n\t\t\t\t\t\tshadowCameraNear: 1,\n\t\t\t\t\t\tshadowCameraFar: 1000\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\t// TODO (abelnation): set RectAreaLight shadow uniforms\n\n\t\t\t}\n\n\t\t\tlights[ light.id ] = uniforms;\n\n\t\t\treturn uniforms;\n\n\t\t}\n\n\t};\n\n}\n\n\n\nlet nextVersion = 0;\n\nfunction shadowCastingAndTexturingLightsFirst( lightA, lightB ) {\n\n\treturn ( lightB.castShadow ? 2 : 0 ) - ( lightA.castShadow ? 2 : 0 ) + ( lightB.map ? 1 : 0 ) - ( lightA.map ? 1 : 0 );\n\n}\n\nfunction WebGLLights( extensions ) {\n\n\tconst cache = new UniformsCache();\n\n\tconst shadowCache = ShadowUniformsCache();\n\n\tconst state = {\n\n\t\tversion: 0,\n\n\t\thash: {\n\t\t\tdirectionalLength: - 1,\n\t\t\tpointLength: - 1,\n\t\t\tspotLength: - 1,\n\t\t\trectAreaLength: - 1,\n\t\t\themiLength: - 1,\n\n\t\t\tnumDirectionalShadows: - 1,\n\t\t\tnumPointShadows: - 1,\n\t\t\tnumSpotShadows: - 1,\n\t\t\tnumSpotMaps: - 1,\n\n\t\t\tnumLightProbes: - 1\n\t\t},\n\n\t\tambient: [ 0, 0, 0 ],\n\t\tprobe: [],\n\t\tdirectional: [],\n\t\tdirectionalShadow: [],\n\t\tdirectionalShadowMap: [],\n\t\tdirectionalShadowMatrix: [],\n\t\tspot: [],\n\t\tspotLightMap: [],\n\t\tspotShadow: [],\n\t\tspotShadowMap: [],\n\t\tspotLightMatrix: [],\n\t\trectArea: [],\n\t\trectAreaLTC1: null,\n\t\trectAreaLTC2: null,\n\t\tpoint: [],\n\t\tpointShadow: [],\n\t\tpointShadowMap: [],\n\t\tpointShadowMatrix: [],\n\t\themi: [],\n\t\tnumSpotLightShadowsWithMaps: 0,\n\t\tnumLightProbes: 0\n\n\t};\n\n\tfor ( let i = 0; i < 9; i ++ ) state.probe.push( new Vector3() );\n\n\tconst vector3 = new Vector3();\n\tconst matrix4 = new Matrix4();\n\tconst matrix42 = new Matrix4();\n\n\tfunction setup( lights ) {\n\n\t\tlet r = 0, g = 0, b = 0;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) state.probe[ i ].set( 0, 0, 0 );\n\n\t\tlet directionalLength = 0;\n\t\tlet pointLength = 0;\n\t\tlet spotLength = 0;\n\t\tlet rectAreaLength = 0;\n\t\tlet hemiLength = 0;\n\n\t\tlet numDirectionalShadows = 0;\n\t\tlet numPointShadows = 0;\n\t\tlet numSpotShadows = 0;\n\t\tlet numSpotMaps = 0;\n\t\tlet numSpotShadowsWithMaps = 0;\n\n\t\tlet numLightProbes = 0;\n\n\t\t// ordering : [shadow casting + map texturing, map texturing, shadow casting, none ]\n\t\tlights.sort( shadowCastingAndTexturingLightsFirst );\n\n\t\tfor ( let i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\tconst light = lights[ i ];\n\n\t\t\tconst color = light.color;\n\t\t\tconst intensity = light.intensity;\n\t\t\tconst distance = light.distance;\n\n\t\t\tconst shadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : null;\n\n\t\t\tif ( light.isAmbientLight ) {\n\n\t\t\t\tr += color.r * intensity;\n\t\t\t\tg += color.g * intensity;\n\t\t\t\tb += color.b * intensity;\n\n\t\t\t} else if ( light.isLightProbe ) {\n\n\t\t\t\tfor ( let j = 0; j < 9; j ++ ) {\n\n\t\t\t\t\tstate.probe[ j ].addScaledVector( light.sh.coefficients[ j ], intensity );\n\n\t\t\t\t}\n\n\t\t\t\tnumLightProbes ++;\n\n\t\t\t} else if ( light.isDirectionalLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.color.copy( light.color ).multiplyScalar( light.intensity );\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\t\tconst shadowUniforms = shadowCache.get( light );\n\n\t\t\t\t\tshadowUniforms.shadowIntensity = shadow.intensity;\n\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\n\t\t\t\t\tstate.directionalShadow[ directionalLength ] = shadowUniforms;\n\t\t\t\t\tstate.directionalShadowMap[ directionalLength ] = shadowMap;\n\t\t\t\t\tstate.directionalShadowMatrix[ directionalLength ] = light.shadow.matrix;\n\n\t\t\t\t\tnumDirectionalShadows ++;\n\n\t\t\t\t}\n\n\t\t\t\tstate.directional[ directionalLength ] = uniforms;\n\n\t\t\t\tdirectionalLength ++;\n\n\t\t\t} else if ( light.isSpotLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\n\t\t\t\tuniforms.color.copy( color ).multiplyScalar( intensity );\n\t\t\t\tuniforms.distance = distance;\n\n\t\t\t\tuniforms.coneCos = Math.cos( light.angle );\n\t\t\t\tuniforms.penumbraCos = Math.cos( light.angle * ( 1 - light.penumbra ) );\n\t\t\t\tuniforms.decay = light.decay;\n\n\t\t\t\tstate.spot[ spotLength ] = uniforms;\n\n\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\tif ( light.map ) {\n\n\t\t\t\t\tstate.spotLightMap[ numSpotMaps ] = light.map;\n\t\t\t\t\tnumSpotMaps ++;\n\n\t\t\t\t\t// make sure the lightMatrix is up to date\n\t\t\t\t\t// TODO : do it if required only\n\t\t\t\t\tshadow.updateMatrices( light );\n\n\t\t\t\t\tif ( light.castShadow ) numSpotShadowsWithMaps ++;\n\n\t\t\t\t}\n\n\t\t\t\tstate.spotLightMatrix[ spotLength ] = shadow.matrix;\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\tconst shadowUniforms = shadowCache.get( light );\n\n\t\t\t\t\tshadowUniforms.shadowIntensity = shadow.intensity;\n\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\n\t\t\t\t\tstate.spotShadow[ spotLength ] = shadowUniforms;\n\t\t\t\t\tstate.spotShadowMap[ spotLength ] = shadowMap;\n\n\t\t\t\t\tnumSpotShadows ++;\n\n\t\t\t\t}\n\n\t\t\t\tspotLength ++;\n\n\t\t\t} else if ( light.isRectAreaLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.color.copy( color ).multiplyScalar( intensity );\n\n\t\t\t\tuniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 );\n\t\t\t\tuniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 );\n\n\t\t\t\tstate.rectArea[ rectAreaLength ] = uniforms;\n\n\t\t\t\trectAreaLength ++;\n\n\t\t\t} else if ( light.isPointLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.color.copy( light.color ).multiplyScalar( light.intensity );\n\t\t\t\tuniforms.distance = light.distance;\n\t\t\t\tuniforms.decay = light.decay;\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\t\tconst shadowUniforms = shadowCache.get( light );\n\n\t\t\t\t\tshadowUniforms.shadowIntensity = shadow.intensity;\n\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\t\t\t\t\tshadowUniforms.shadowCameraNear = shadow.camera.near;\n\t\t\t\t\tshadowUniforms.shadowCameraFar = shadow.camera.far;\n\n\t\t\t\t\tstate.pointShadow[ pointLength ] = shadowUniforms;\n\t\t\t\t\tstate.pointShadowMap[ pointLength ] = shadowMap;\n\t\t\t\t\tstate.pointShadowMatrix[ pointLength ] = light.shadow.matrix;\n\n\t\t\t\t\tnumPointShadows ++;\n\n\t\t\t\t}\n\n\t\t\t\tstate.point[ pointLength ] = uniforms;\n\n\t\t\t\tpointLength ++;\n\n\t\t\t} else if ( light.isHemisphereLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.skyColor.copy( light.color ).multiplyScalar( intensity );\n\t\t\t\tuniforms.groundColor.copy( light.groundColor ).multiplyScalar( intensity );\n\n\t\t\t\tstate.hemi[ hemiLength ] = uniforms;\n\n\t\t\t\themiLength ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( rectAreaLength > 0 ) {\n\n\t\t\tif ( extensions.has( 'OES_texture_float_linear' ) === true ) {\n\n\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;\n\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;\n\n\t\t\t} else {\n\n\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_HALF_1;\n\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_HALF_2;\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.ambient[ 0 ] = r;\n\t\tstate.ambient[ 1 ] = g;\n\t\tstate.ambient[ 2 ] = b;\n\n\t\tconst hash = state.hash;\n\n\t\tif ( hash.directionalLength !== directionalLength ||\n\t\t\thash.pointLength !== pointLength ||\n\t\t\thash.spotLength !== spotLength ||\n\t\t\thash.rectAreaLength !== rectAreaLength ||\n\t\t\thash.hemiLength !== hemiLength ||\n\t\t\thash.numDirectionalShadows !== numDirectionalShadows ||\n\t\t\thash.numPointShadows !== numPointShadows ||\n\t\t\thash.numSpotShadows !== numSpotShadows ||\n\t\t\thash.numSpotMaps !== numSpotMaps ||\n\t\t\thash.numLightProbes !== numLightProbes ) {\n\n\t\t\tstate.directional.length = directionalLength;\n\t\t\tstate.spot.length = spotLength;\n\t\t\tstate.rectArea.length = rectAreaLength;\n\t\t\tstate.point.length = pointLength;\n\t\t\tstate.hemi.length = hemiLength;\n\n\t\t\tstate.directionalShadow.length = numDirectionalShadows;\n\t\t\tstate.directionalShadowMap.length = numDirectionalShadows;\n\t\t\tstate.pointShadow.length = numPointShadows;\n\t\t\tstate.pointShadowMap.length = numPointShadows;\n\t\t\tstate.spotShadow.length = numSpotShadows;\n\t\t\tstate.spotShadowMap.length = numSpotShadows;\n\t\t\tstate.directionalShadowMatrix.length = numDirectionalShadows;\n\t\t\tstate.pointShadowMatrix.length = numPointShadows;\n\t\t\tstate.spotLightMatrix.length = numSpotShadows + numSpotMaps - numSpotShadowsWithMaps;\n\t\t\tstate.spotLightMap.length = numSpotMaps;\n\t\t\tstate.numSpotLightShadowsWithMaps = numSpotShadowsWithMaps;\n\t\t\tstate.numLightProbes = numLightProbes;\n\n\t\t\thash.directionalLength = directionalLength;\n\t\t\thash.pointLength = pointLength;\n\t\t\thash.spotLength = spotLength;\n\t\t\thash.rectAreaLength = rectAreaLength;\n\t\t\thash.hemiLength = hemiLength;\n\n\t\t\thash.numDirectionalShadows = numDirectionalShadows;\n\t\t\thash.numPointShadows = numPointShadows;\n\t\t\thash.numSpotShadows = numSpotShadows;\n\t\t\thash.numSpotMaps = numSpotMaps;\n\n\t\t\thash.numLightProbes = numLightProbes;\n\n\t\t\tstate.version = nextVersion ++;\n\n\t\t}\n\n\t}\n\n\tfunction setupView( lights, camera ) {\n\n\t\tlet directionalLength = 0;\n\t\tlet pointLength = 0;\n\t\tlet spotLength = 0;\n\t\tlet rectAreaLength = 0;\n\t\tlet hemiLength = 0;\n\n\t\tconst viewMatrix = camera.matrixWorldInverse;\n\n\t\tfor ( let i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\tconst light = lights[ i ];\n\n\t\t\tif ( light.isDirectionalLight ) {\n\n\t\t\t\tconst uniforms = state.directional[ directionalLength ];\n\n\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tvector3.setFromMatrixPosition( light.target.matrixWorld );\n\t\t\t\tuniforms.direction.sub( vector3 );\n\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\tdirectionalLength ++;\n\n\t\t\t} else if ( light.isSpotLight ) {\n\n\t\t\t\tconst uniforms = state.spot[ spotLength ];\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tvector3.setFromMatrixPosition( light.target.matrixWorld );\n\t\t\t\tuniforms.direction.sub( vector3 );\n\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\tspotLength ++;\n\n\t\t\t} else if ( light.isRectAreaLight ) {\n\n\t\t\t\tconst uniforms = state.rectArea[ rectAreaLength ];\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\t// extract local rotation of light to derive width/height half vectors\n\t\t\t\tmatrix42.identity();\n\t\t\t\tmatrix4.copy( light.matrixWorld );\n\t\t\t\tmatrix4.premultiply( viewMatrix );\n\t\t\t\tmatrix42.extractRotation( matrix4 );\n\n\t\t\t\tuniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 );\n\t\t\t\tuniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 );\n\n\t\t\t\tuniforms.halfWidth.applyMatrix4( matrix42 );\n\t\t\t\tuniforms.halfHeight.applyMatrix4( matrix42 );\n\n\t\t\t\trectAreaLength ++;\n\n\t\t\t} else if ( light.isPointLight ) {\n\n\t\t\t\tconst uniforms = state.point[ pointLength ];\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\tpointLength ++;\n\n\t\t\t} else if ( light.isHemisphereLight ) {\n\n\t\t\t\tconst uniforms = state.hemi[ hemiLength ];\n\n\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\themiLength ++;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\tsetup: setup,\n\t\tsetupView: setupView,\n\t\tstate: state\n\t};\n\n}\n\nfunction WebGLRenderState( extensions ) {\n\n\tconst lights = new WebGLLights( extensions );\n\n\tconst lightsArray = [];\n\tconst shadowsArray = [];\n\n\tfunction init( camera ) {\n\n\t\tstate.camera = camera;\n\n\t\tlightsArray.length = 0;\n\t\tshadowsArray.length = 0;\n\n\t}\n\n\tfunction pushLight( light ) {\n\n\t\tlightsArray.push( light );\n\n\t}\n\n\tfunction pushShadow( shadowLight ) {\n\n\t\tshadowsArray.push( shadowLight );\n\n\t}\n\n\tfunction setupLights() {\n\n\t\tlights.setup( lightsArray );\n\n\t}\n\n\tfunction setupLightsView( camera ) {\n\n\t\tlights.setupView( lightsArray, camera );\n\n\t}\n\n\tconst state = {\n\t\tlightsArray: lightsArray,\n\t\tshadowsArray: shadowsArray,\n\n\t\tcamera: null,\n\n\t\tlights: lights,\n\n\t\ttransmissionRenderTarget: {}\n\t};\n\n\treturn {\n\t\tinit: init,\n\t\tstate: state,\n\t\tsetupLights: setupLights,\n\t\tsetupLightsView: setupLightsView,\n\n\t\tpushLight: pushLight,\n\t\tpushShadow: pushShadow\n\t};\n\n}\n\nfunction WebGLRenderStates( extensions ) {\n\n\tlet renderStates = new WeakMap();\n\n\tfunction get( scene, renderCallDepth = 0 ) {\n\n\t\tconst renderStateArray = renderStates.get( scene );\n\t\tlet renderState;\n\n\t\tif ( renderStateArray === undefined ) {\n\n\t\t\trenderState = new WebGLRenderState( extensions );\n\t\t\trenderStates.set( scene, [ renderState ] );\n\n\t\t} else {\n\n\t\t\tif ( renderCallDepth >= renderStateArray.length ) {\n\n\t\t\t\trenderState = new WebGLRenderState( extensions );\n\t\t\t\trenderStateArray.push( renderState );\n\n\t\t\t} else {\n\n\t\t\t\trenderState = renderStateArray[ renderCallDepth ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn renderState;\n\n\t}\n\n\tfunction dispose() {\n\n\t\trenderStates = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nclass MeshDepthMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'MeshDepthMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshDepthMaterial = true;\n\n\t\tthis.depthPacking = BasicDepthPacking;\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.depthPacking = source.depthPacking;\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshDistanceMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'MeshDistanceMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshDistanceMaterial = true;\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst vertex = \"void main() {\\n\\tgl_Position = vec4( position, 1.0 );\\n}\";\n\nconst fragment = \"uniform sampler2D shadow_pass;\\nuniform vec2 resolution;\\nuniform float radius;\\n#include \\nvoid main() {\\n\\tconst float samples = float( VSM_SAMPLES );\\n\\tfloat mean = 0.0;\\n\\tfloat squared_mean = 0.0;\\n\\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\\n\\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\\n\\tfor ( float i = 0.0; i < samples; i ++ ) {\\n\\t\\tfloat uvOffset = uvStart + i * uvStride;\\n\\t\\t#ifdef HORIZONTAL_PASS\\n\\t\\t\\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\\n\\t\\t\\tmean += distribution.x;\\n\\t\\t\\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\\n\\t\\t#else\\n\\t\\t\\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\\n\\t\\t\\tmean += depth;\\n\\t\\t\\tsquared_mean += depth * depth;\\n\\t\\t#endif\\n\\t}\\n\\tmean = mean / samples;\\n\\tsquared_mean = squared_mean / samples;\\n\\tfloat std_dev = sqrt( squared_mean - mean * mean );\\n\\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\\n}\";\n\nfunction WebGLShadowMap( renderer, objects, capabilities ) {\n\n\tlet _frustum = new Frustum();\n\n\tconst _shadowMapSize = new Vector2(),\n\t\t_viewportSize = new Vector2(),\n\n\t\t_viewport = new Vector4(),\n\n\t\t_depthMaterial = new MeshDepthMaterial( { depthPacking: RGBADepthPacking } ),\n\t\t_distanceMaterial = new MeshDistanceMaterial(),\n\n\t\t_materialCache = {},\n\n\t\t_maxTextureSize = capabilities.maxTextureSize;\n\n\tconst shadowSide = { [ FrontSide ]: BackSide, [ BackSide ]: FrontSide, [ DoubleSide ]: DoubleSide };\n\n\tconst shadowMaterialVertical = new ShaderMaterial( {\n\t\tdefines: {\n\t\t\tVSM_SAMPLES: 8\n\t\t},\n\t\tuniforms: {\n\t\t\tshadow_pass: { value: null },\n\t\t\tresolution: { value: new Vector2() },\n\t\t\tradius: { value: 4.0 }\n\t\t},\n\n\t\tvertexShader: vertex,\n\t\tfragmentShader: fragment\n\n\t} );\n\n\tconst shadowMaterialHorizontal = shadowMaterialVertical.clone();\n\tshadowMaterialHorizontal.defines.HORIZONTAL_PASS = 1;\n\n\tconst fullScreenTri = new BufferGeometry();\n\tfullScreenTri.setAttribute(\n\t\t'position',\n\t\tnew BufferAttribute(\n\t\t\tnew Float32Array( [ - 1, - 1, 0.5, 3, - 1, 0.5, - 1, 3, 0.5 ] ),\n\t\t\t3\n\t\t)\n\t);\n\n\tconst fullScreenMesh = new Mesh( fullScreenTri, shadowMaterialVertical );\n\n\tconst scope = this;\n\n\tthis.enabled = false;\n\n\tthis.autoUpdate = true;\n\tthis.needsUpdate = false;\n\n\tthis.type = PCFShadowMap;\n\tlet _previousType = this.type;\n\n\tthis.render = function ( lights, scene, camera ) {\n\n\t\tif ( scope.enabled === false ) return;\n\t\tif ( scope.autoUpdate === false && scope.needsUpdate === false ) return;\n\n\t\tif ( lights.length === 0 ) return;\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\tconst activeCubeFace = renderer.getActiveCubeFace();\n\t\tconst activeMipmapLevel = renderer.getActiveMipmapLevel();\n\n\t\tconst _state = renderer.state;\n\n\t\t// Set GL state for depth map.\n\t\t_state.setBlending( NoBlending );\n\t\t_state.buffers.color.setClear( 1, 1, 1, 1 );\n\t\t_state.buffers.depth.setTest( true );\n\t\t_state.setScissorTest( false );\n\n\t\t// check for shadow map type changes\n\n\t\tconst toVSM = ( _previousType !== VSMShadowMap && this.type === VSMShadowMap );\n\t\tconst fromVSM = ( _previousType === VSMShadowMap && this.type !== VSMShadowMap );\n\n\t\t// render depth map\n\n\t\tfor ( let i = 0, il = lights.length; i < il; i ++ ) {\n\n\t\t\tconst light = lights[ i ];\n\t\t\tconst shadow = light.shadow;\n\n\t\t\tif ( shadow === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif ( shadow.autoUpdate === false && shadow.needsUpdate === false ) continue;\n\n\t\t\t_shadowMapSize.copy( shadow.mapSize );\n\n\t\t\tconst shadowFrameExtents = shadow.getFrameExtents();\n\n\t\t\t_shadowMapSize.multiply( shadowFrameExtents );\n\n\t\t\t_viewportSize.copy( shadow.mapSize );\n\n\t\t\tif ( _shadowMapSize.x > _maxTextureSize || _shadowMapSize.y > _maxTextureSize ) {\n\n\t\t\t\tif ( _shadowMapSize.x > _maxTextureSize ) {\n\n\t\t\t\t\t_viewportSize.x = Math.floor( _maxTextureSize / shadowFrameExtents.x );\n\t\t\t\t\t_shadowMapSize.x = _viewportSize.x * shadowFrameExtents.x;\n\t\t\t\t\tshadow.mapSize.x = _viewportSize.x;\n\n\t\t\t\t}\n\n\t\t\t\tif ( _shadowMapSize.y > _maxTextureSize ) {\n\n\t\t\t\t\t_viewportSize.y = Math.floor( _maxTextureSize / shadowFrameExtents.y );\n\t\t\t\t\t_shadowMapSize.y = _viewportSize.y * shadowFrameExtents.y;\n\t\t\t\t\tshadow.mapSize.y = _viewportSize.y;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( shadow.map === null || toVSM === true || fromVSM === true ) {\n\n\t\t\t\tconst pars = ( this.type !== VSMShadowMap ) ? { minFilter: NearestFilter, magFilter: NearestFilter } : {};\n\n\t\t\t\tif ( shadow.map !== null ) {\n\n\t\t\t\t\tshadow.map.dispose();\n\n\t\t\t\t}\n\n\t\t\t\tshadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );\n\t\t\t\tshadow.map.texture.name = light.name + '.shadowMap';\n\n\t\t\t\tshadow.camera.updateProjectionMatrix();\n\n\t\t\t}\n\n\t\t\trenderer.setRenderTarget( shadow.map );\n\t\t\trenderer.clear();\n\n\t\t\tconst viewportCount = shadow.getViewportCount();\n\n\t\t\tfor ( let vp = 0; vp < viewportCount; vp ++ ) {\n\n\t\t\t\tconst viewport = shadow.getViewport( vp );\n\n\t\t\t\t_viewport.set(\n\t\t\t\t\t_viewportSize.x * viewport.x,\n\t\t\t\t\t_viewportSize.y * viewport.y,\n\t\t\t\t\t_viewportSize.x * viewport.z,\n\t\t\t\t\t_viewportSize.y * viewport.w\n\t\t\t\t);\n\n\t\t\t\t_state.viewport( _viewport );\n\n\t\t\t\tshadow.updateMatrices( light, vp );\n\n\t\t\t\t_frustum = shadow.getFrustum();\n\n\t\t\t\trenderObject( scene, camera, shadow.camera, light, this.type );\n\n\t\t\t}\n\n\t\t\t// do blur pass for VSM\n\n\t\t\tif ( shadow.isPointLightShadow !== true && this.type === VSMShadowMap ) {\n\n\t\t\t\tVSMPass( shadow, camera );\n\n\t\t\t}\n\n\t\t\tshadow.needsUpdate = false;\n\n\t\t}\n\n\t\t_previousType = this.type;\n\n\t\tscope.needsUpdate = false;\n\n\t\trenderer.setRenderTarget( currentRenderTarget, activeCubeFace, activeMipmapLevel );\n\n\t};\n\n\tfunction VSMPass( shadow, camera ) {\n\n\t\tconst geometry = objects.update( fullScreenMesh );\n\n\t\tif ( shadowMaterialVertical.defines.VSM_SAMPLES !== shadow.blurSamples ) {\n\n\t\t\tshadowMaterialVertical.defines.VSM_SAMPLES = shadow.blurSamples;\n\t\t\tshadowMaterialHorizontal.defines.VSM_SAMPLES = shadow.blurSamples;\n\n\t\t\tshadowMaterialVertical.needsUpdate = true;\n\t\t\tshadowMaterialHorizontal.needsUpdate = true;\n\n\t\t}\n\n\t\tif ( shadow.mapPass === null ) {\n\n\t\t\tshadow.mapPass = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y );\n\n\t\t}\n\n\t\t// vertical pass\n\n\t\tshadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;\n\t\tshadowMaterialVertical.uniforms.resolution.value = shadow.mapSize;\n\t\tshadowMaterialVertical.uniforms.radius.value = shadow.radius;\n\t\trenderer.setRenderTarget( shadow.mapPass );\n\t\trenderer.clear();\n\t\trenderer.renderBufferDirect( camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null );\n\n\t\t// horizontal pass\n\n\t\tshadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture;\n\t\tshadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize;\n\t\tshadowMaterialHorizontal.uniforms.radius.value = shadow.radius;\n\t\trenderer.setRenderTarget( shadow.map );\n\t\trenderer.clear();\n\t\trenderer.renderBufferDirect( camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null );\n\n\t}\n\n\tfunction getDepthMaterial( object, material, light, type ) {\n\n\t\tlet result = null;\n\n\t\tconst customMaterial = ( light.isPointLight === true ) ? object.customDistanceMaterial : object.customDepthMaterial;\n\n\t\tif ( customMaterial !== undefined ) {\n\n\t\t\tresult = customMaterial;\n\n\t\t} else {\n\n\t\t\tresult = ( light.isPointLight === true ) ? _distanceMaterial : _depthMaterial;\n\n\t\t\tif ( ( renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) ||\n\t\t\t\t( material.displacementMap && material.displacementScale !== 0 ) ||\n\t\t\t\t( material.alphaMap && material.alphaTest > 0 ) ||\n\t\t\t\t( material.map && material.alphaTest > 0 ) ) {\n\n\t\t\t\t// in this case we need a unique material instance reflecting the\n\t\t\t\t// appropriate state\n\n\t\t\t\tconst keyA = result.uuid, keyB = material.uuid;\n\n\t\t\t\tlet materialsForVariant = _materialCache[ keyA ];\n\n\t\t\t\tif ( materialsForVariant === undefined ) {\n\n\t\t\t\t\tmaterialsForVariant = {};\n\t\t\t\t\t_materialCache[ keyA ] = materialsForVariant;\n\n\t\t\t\t}\n\n\t\t\t\tlet cachedMaterial = materialsForVariant[ keyB ];\n\n\t\t\t\tif ( cachedMaterial === undefined ) {\n\n\t\t\t\t\tcachedMaterial = result.clone();\n\t\t\t\t\tmaterialsForVariant[ keyB ] = cachedMaterial;\n\t\t\t\t\tmaterial.addEventListener( 'dispose', onMaterialDispose );\n\n\t\t\t\t}\n\n\t\t\t\tresult = cachedMaterial;\n\n\t\t\t}\n\n\t\t}\n\n\t\tresult.visible = material.visible;\n\t\tresult.wireframe = material.wireframe;\n\n\t\tif ( type === VSMShadowMap ) {\n\n\t\t\tresult.side = ( material.shadowSide !== null ) ? material.shadowSide : material.side;\n\n\t\t} else {\n\n\t\t\tresult.side = ( material.shadowSide !== null ) ? material.shadowSide : shadowSide[ material.side ];\n\n\t\t}\n\n\t\tresult.alphaMap = material.alphaMap;\n\t\tresult.alphaTest = material.alphaTest;\n\t\tresult.map = material.map;\n\n\t\tresult.clipShadows = material.clipShadows;\n\t\tresult.clippingPlanes = material.clippingPlanes;\n\t\tresult.clipIntersection = material.clipIntersection;\n\n\t\tresult.displacementMap = material.displacementMap;\n\t\tresult.displacementScale = material.displacementScale;\n\t\tresult.displacementBias = material.displacementBias;\n\n\t\tresult.wireframeLinewidth = material.wireframeLinewidth;\n\t\tresult.linewidth = material.linewidth;\n\n\t\tif ( light.isPointLight === true && result.isMeshDistanceMaterial === true ) {\n\n\t\t\tconst materialProperties = renderer.properties.get( result );\n\t\t\tmaterialProperties.light = light;\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\tfunction renderObject( object, camera, shadowCamera, light, type ) {\n\n\t\tif ( object.visible === false ) return;\n\n\t\tconst visible = object.layers.test( camera.layers );\n\n\t\tif ( visible && ( object.isMesh || object.isLine || object.isPoints ) ) {\n\n\t\t\tif ( ( object.castShadow || ( object.receiveShadow && type === VSMShadowMap ) ) && ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) ) {\n\n\t\t\t\tobject.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld );\n\n\t\t\t\tconst geometry = objects.update( object );\n\t\t\t\tconst material = object.material;\n\n\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\tconst groups = geometry.groups;\n\n\t\t\t\t\tfor ( let k = 0, kl = groups.length; k < kl; k ++ ) {\n\n\t\t\t\t\t\tconst group = groups[ k ];\n\t\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\t\tif ( groupMaterial && groupMaterial.visible ) {\n\n\t\t\t\t\t\t\tconst depthMaterial = getDepthMaterial( object, groupMaterial, light, type );\n\n\t\t\t\t\t\t\tobject.onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, group );\n\n\t\t\t\t\t\t\trenderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );\n\n\t\t\t\t\t\t\tobject.onAfterShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, group );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( material.visible ) {\n\n\t\t\t\t\tconst depthMaterial = getDepthMaterial( object, material, light, type );\n\n\t\t\t\t\tobject.onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, null );\n\n\t\t\t\t\trenderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );\n\n\t\t\t\t\tobject.onAfterShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, null );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\trenderObject( children[ i ], camera, shadowCamera, light, type );\n\n\t\t}\n\n\t}\n\n\tfunction onMaterialDispose( event ) {\n\n\t\tconst material = event.target;\n\n\t\tmaterial.removeEventListener( 'dispose', onMaterialDispose );\n\n\t\t// make sure to remove the unique distance/depth materials used for shadow map rendering\n\n\t\tfor ( const id in _materialCache ) {\n\n\t\t\tconst cache = _materialCache[ id ];\n\n\t\t\tconst uuid = event.target.uuid;\n\n\t\t\tif ( uuid in cache ) {\n\n\t\t\t\tconst shadowMaterial = cache[ uuid ];\n\t\t\t\tshadowMaterial.dispose();\n\t\t\t\tdelete cache[ uuid ];\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nconst reversedFuncs = {\n\t[ NeverDepth ]: AlwaysDepth,\n\t[ LessDepth ]: GreaterDepth,\n\t[ EqualDepth ]: NotEqualDepth,\n\t[ LessEqualDepth ]: GreaterEqualDepth,\n\n\t[ AlwaysDepth ]: NeverDepth,\n\t[ GreaterDepth ]: LessDepth,\n\t[ NotEqualDepth ]: EqualDepth,\n\t[ GreaterEqualDepth ]: LessEqualDepth,\n};\n\nfunction WebGLState( gl, extensions ) {\n\n\tfunction ColorBuffer() {\n\n\t\tlet locked = false;\n\n\t\tconst color = new Vector4();\n\t\tlet currentColorMask = null;\n\t\tconst currentColorClear = new Vector4( 0, 0, 0, 0 );\n\n\t\treturn {\n\n\t\t\tsetMask: function ( colorMask ) {\n\n\t\t\t\tif ( currentColorMask !== colorMask && ! locked ) {\n\n\t\t\t\t\tgl.colorMask( colorMask, colorMask, colorMask, colorMask );\n\t\t\t\t\tcurrentColorMask = colorMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\tlocked = lock;\n\n\t\t\t},\n\n\t\t\tsetClear: function ( r, g, b, a, premultipliedAlpha ) {\n\n\t\t\t\tif ( premultipliedAlpha === true ) {\n\n\t\t\t\t\tr *= a; g *= a; b *= a;\n\n\t\t\t\t}\n\n\t\t\t\tcolor.set( r, g, b, a );\n\n\t\t\t\tif ( currentColorClear.equals( color ) === false ) {\n\n\t\t\t\t\tgl.clearColor( r, g, b, a );\n\t\t\t\t\tcurrentColorClear.copy( color );\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\treset: function () {\n\n\t\t\t\tlocked = false;\n\n\t\t\t\tcurrentColorMask = null;\n\t\t\t\tcurrentColorClear.set( - 1, 0, 0, 0 ); // set to invalid state\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tfunction DepthBuffer() {\n\n\t\tlet locked = false;\n\t\tlet reversed = false;\n\n\t\tlet currentDepthMask = null;\n\t\tlet currentDepthFunc = null;\n\t\tlet currentDepthClear = null;\n\n\t\treturn {\n\n\t\t\tsetReversed: function ( value ) {\n\n\t\t\t\tif ( reversed !== value ) {\n\n\t\t\t\t\tconst ext = extensions.get( 'EXT_clip_control' );\n\n\t\t\t\t\tif ( reversed ) {\n\n\t\t\t\t\t\text.clipControlEXT( ext.LOWER_LEFT_EXT, ext.ZERO_TO_ONE_EXT );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\text.clipControlEXT( ext.LOWER_LEFT_EXT, ext.NEGATIVE_ONE_TO_ONE_EXT );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst oldDepth = currentDepthClear;\n\t\t\t\t\tcurrentDepthClear = null;\n\t\t\t\t\tthis.setClear( oldDepth );\n\n\t\t\t\t}\n\n\t\t\t\treversed = value;\n\n\t\t\t},\n\n\t\t\tgetReversed: function () {\n\n\t\t\t\treturn reversed;\n\n\t\t\t},\n\n\t\t\tsetTest: function ( depthTest ) {\n\n\t\t\t\tif ( depthTest ) {\n\n\t\t\t\t\tenable( gl.DEPTH_TEST );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdisable( gl.DEPTH_TEST );\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetMask: function ( depthMask ) {\n\n\t\t\t\tif ( currentDepthMask !== depthMask && ! locked ) {\n\n\t\t\t\t\tgl.depthMask( depthMask );\n\t\t\t\t\tcurrentDepthMask = depthMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetFunc: function ( depthFunc ) {\n\n\t\t\t\tif ( reversed ) depthFunc = reversedFuncs[ depthFunc ];\n\n\t\t\t\tif ( currentDepthFunc !== depthFunc ) {\n\n\t\t\t\t\tswitch ( depthFunc ) {\n\n\t\t\t\t\t\tcase NeverDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.NEVER );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase AlwaysDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.ALWAYS );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase LessDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.LESS );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase LessEqualDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.LEQUAL );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase EqualDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.EQUAL );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase GreaterEqualDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.GEQUAL );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase GreaterDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.GREATER );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase NotEqualDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.NOTEQUAL );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.LEQUAL );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentDepthFunc = depthFunc;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\tlocked = lock;\n\n\t\t\t},\n\n\t\t\tsetClear: function ( depth ) {\n\n\t\t\t\tif ( currentDepthClear !== depth ) {\n\n\t\t\t\t\tif ( reversed ) {\n\n\t\t\t\t\t\tdepth = 1 - depth;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgl.clearDepth( depth );\n\t\t\t\t\tcurrentDepthClear = depth;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\treset: function () {\n\n\t\t\t\tlocked = false;\n\n\t\t\t\tcurrentDepthMask = null;\n\t\t\t\tcurrentDepthFunc = null;\n\t\t\t\tcurrentDepthClear = null;\n\t\t\t\treversed = false;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tfunction StencilBuffer() {\n\n\t\tlet locked = false;\n\n\t\tlet currentStencilMask = null;\n\t\tlet currentStencilFunc = null;\n\t\tlet currentStencilRef = null;\n\t\tlet currentStencilFuncMask = null;\n\t\tlet currentStencilFail = null;\n\t\tlet currentStencilZFail = null;\n\t\tlet currentStencilZPass = null;\n\t\tlet currentStencilClear = null;\n\n\t\treturn {\n\n\t\t\tsetTest: function ( stencilTest ) {\n\n\t\t\t\tif ( ! locked ) {\n\n\t\t\t\t\tif ( stencilTest ) {\n\n\t\t\t\t\t\tenable( gl.STENCIL_TEST );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tdisable( gl.STENCIL_TEST );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetMask: function ( stencilMask ) {\n\n\t\t\t\tif ( currentStencilMask !== stencilMask && ! locked ) {\n\n\t\t\t\t\tgl.stencilMask( stencilMask );\n\t\t\t\t\tcurrentStencilMask = stencilMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetFunc: function ( stencilFunc, stencilRef, stencilMask ) {\n\n\t\t\t\tif ( currentStencilFunc !== stencilFunc ||\n\t\t\t\t currentStencilRef !== stencilRef ||\n\t\t\t\t currentStencilFuncMask !== stencilMask ) {\n\n\t\t\t\t\tgl.stencilFunc( stencilFunc, stencilRef, stencilMask );\n\n\t\t\t\t\tcurrentStencilFunc = stencilFunc;\n\t\t\t\t\tcurrentStencilRef = stencilRef;\n\t\t\t\t\tcurrentStencilFuncMask = stencilMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetOp: function ( stencilFail, stencilZFail, stencilZPass ) {\n\n\t\t\t\tif ( currentStencilFail !== stencilFail ||\n\t\t\t\t currentStencilZFail !== stencilZFail ||\n\t\t\t\t currentStencilZPass !== stencilZPass ) {\n\n\t\t\t\t\tgl.stencilOp( stencilFail, stencilZFail, stencilZPass );\n\n\t\t\t\t\tcurrentStencilFail = stencilFail;\n\t\t\t\t\tcurrentStencilZFail = stencilZFail;\n\t\t\t\t\tcurrentStencilZPass = stencilZPass;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\tlocked = lock;\n\n\t\t\t},\n\n\t\t\tsetClear: function ( stencil ) {\n\n\t\t\t\tif ( currentStencilClear !== stencil ) {\n\n\t\t\t\t\tgl.clearStencil( stencil );\n\t\t\t\t\tcurrentStencilClear = stencil;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\treset: function () {\n\n\t\t\t\tlocked = false;\n\n\t\t\t\tcurrentStencilMask = null;\n\t\t\t\tcurrentStencilFunc = null;\n\t\t\t\tcurrentStencilRef = null;\n\t\t\t\tcurrentStencilFuncMask = null;\n\t\t\t\tcurrentStencilFail = null;\n\t\t\t\tcurrentStencilZFail = null;\n\t\t\t\tcurrentStencilZPass = null;\n\t\t\t\tcurrentStencilClear = null;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t//\n\n\tconst colorBuffer = new ColorBuffer();\n\tconst depthBuffer = new DepthBuffer();\n\tconst stencilBuffer = new StencilBuffer();\n\n\tconst uboBindings = new WeakMap();\n\tconst uboProgramMap = new WeakMap();\n\n\tlet enabledCapabilities = {};\n\n\tlet currentBoundFramebuffers = {};\n\tlet currentDrawbuffers = new WeakMap();\n\tlet defaultDrawbuffers = [];\n\n\tlet currentProgram = null;\n\n\tlet currentBlendingEnabled = false;\n\tlet currentBlending = null;\n\tlet currentBlendEquation = null;\n\tlet currentBlendSrc = null;\n\tlet currentBlendDst = null;\n\tlet currentBlendEquationAlpha = null;\n\tlet currentBlendSrcAlpha = null;\n\tlet currentBlendDstAlpha = null;\n\tlet currentBlendColor = new Color( 0, 0, 0 );\n\tlet currentBlendAlpha = 0;\n\tlet currentPremultipledAlpha = false;\n\n\tlet currentFlipSided = null;\n\tlet currentCullFace = null;\n\n\tlet currentLineWidth = null;\n\n\tlet currentPolygonOffsetFactor = null;\n\tlet currentPolygonOffsetUnits = null;\n\n\tconst maxTextures = gl.getParameter( gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS );\n\n\tlet lineWidthAvailable = false;\n\tlet version = 0;\n\tconst glVersion = gl.getParameter( gl.VERSION );\n\n\tif ( glVersion.indexOf( 'WebGL' ) !== - 1 ) {\n\n\t\tversion = parseFloat( /^WebGL (\\d)/.exec( glVersion )[ 1 ] );\n\t\tlineWidthAvailable = ( version >= 1.0 );\n\n\t} else if ( glVersion.indexOf( 'OpenGL ES' ) !== - 1 ) {\n\n\t\tversion = parseFloat( /^OpenGL ES (\\d)/.exec( glVersion )[ 1 ] );\n\t\tlineWidthAvailable = ( version >= 2.0 );\n\n\t}\n\n\tlet currentTextureSlot = null;\n\tlet currentBoundTextures = {};\n\n\tconst scissorParam = gl.getParameter( gl.SCISSOR_BOX );\n\tconst viewportParam = gl.getParameter( gl.VIEWPORT );\n\n\tconst currentScissor = new Vector4().fromArray( scissorParam );\n\tconst currentViewport = new Vector4().fromArray( viewportParam );\n\n\tfunction createTexture( type, target, count, dimensions ) {\n\n\t\tconst data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4.\n\t\tconst texture = gl.createTexture();\n\n\t\tgl.bindTexture( type, texture );\n\t\tgl.texParameteri( type, gl.TEXTURE_MIN_FILTER, gl.NEAREST );\n\t\tgl.texParameteri( type, gl.TEXTURE_MAG_FILTER, gl.NEAREST );\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tif ( type === gl.TEXTURE_3D || type === gl.TEXTURE_2D_ARRAY ) {\n\n\t\t\t\tgl.texImage3D( target, 0, gl.RGBA, 1, 1, dimensions, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );\n\n\t\t\t} else {\n\n\t\t\t\tgl.texImage2D( target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tconst emptyTextures = {};\n\temptyTextures[ gl.TEXTURE_2D ] = createTexture( gl.TEXTURE_2D, gl.TEXTURE_2D, 1 );\n\temptyTextures[ gl.TEXTURE_CUBE_MAP ] = createTexture( gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6 );\n\temptyTextures[ gl.TEXTURE_2D_ARRAY ] = createTexture( gl.TEXTURE_2D_ARRAY, gl.TEXTURE_2D_ARRAY, 1, 1 );\n\temptyTextures[ gl.TEXTURE_3D ] = createTexture( gl.TEXTURE_3D, gl.TEXTURE_3D, 1, 1 );\n\n\t// init\n\n\tcolorBuffer.setClear( 0, 0, 0, 1 );\n\tdepthBuffer.setClear( 1 );\n\tstencilBuffer.setClear( 0 );\n\n\tenable( gl.DEPTH_TEST );\n\tdepthBuffer.setFunc( LessEqualDepth );\n\n\tsetFlipSided( false );\n\tsetCullFace( CullFaceBack );\n\tenable( gl.CULL_FACE );\n\n\tsetBlending( NoBlending );\n\n\t//\n\n\tfunction enable( id ) {\n\n\t\tif ( enabledCapabilities[ id ] !== true ) {\n\n\t\t\tgl.enable( id );\n\t\t\tenabledCapabilities[ id ] = true;\n\n\t\t}\n\n\t}\n\n\tfunction disable( id ) {\n\n\t\tif ( enabledCapabilities[ id ] !== false ) {\n\n\t\t\tgl.disable( id );\n\t\t\tenabledCapabilities[ id ] = false;\n\n\t\t}\n\n\t}\n\n\tfunction bindFramebuffer( target, framebuffer ) {\n\n\t\tif ( currentBoundFramebuffers[ target ] !== framebuffer ) {\n\n\t\t\tgl.bindFramebuffer( target, framebuffer );\n\n\t\t\tcurrentBoundFramebuffers[ target ] = framebuffer;\n\n\t\t\t// gl.DRAW_FRAMEBUFFER is equivalent to gl.FRAMEBUFFER\n\n\t\t\tif ( target === gl.DRAW_FRAMEBUFFER ) {\n\n\t\t\t\tcurrentBoundFramebuffers[ gl.FRAMEBUFFER ] = framebuffer;\n\n\t\t\t}\n\n\t\t\tif ( target === gl.FRAMEBUFFER ) {\n\n\t\t\t\tcurrentBoundFramebuffers[ gl.DRAW_FRAMEBUFFER ] = framebuffer;\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\tfunction drawBuffers( renderTarget, framebuffer ) {\n\n\t\tlet drawBuffers = defaultDrawbuffers;\n\n\t\tlet needsUpdate = false;\n\n\t\tif ( renderTarget ) {\n\n\t\t\tdrawBuffers = currentDrawbuffers.get( framebuffer );\n\n\t\t\tif ( drawBuffers === undefined ) {\n\n\t\t\t\tdrawBuffers = [];\n\t\t\t\tcurrentDrawbuffers.set( framebuffer, drawBuffers );\n\n\t\t\t}\n\n\t\t\tconst textures = renderTarget.textures;\n\n\t\t\tif ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {\n\n\t\t\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\t\t\tdrawBuffers[ i ] = gl.COLOR_ATTACHMENT0 + i;\n\n\t\t\t\t}\n\n\t\t\t\tdrawBuffers.length = textures.length;\n\n\t\t\t\tneedsUpdate = true;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( drawBuffers[ 0 ] !== gl.BACK ) {\n\n\t\t\t\tdrawBuffers[ 0 ] = gl.BACK;\n\n\t\t\t\tneedsUpdate = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( needsUpdate ) {\n\n\t\t\tgl.drawBuffers( drawBuffers );\n\n\t\t}\n\n\t}\n\n\tfunction useProgram( program ) {\n\n\t\tif ( currentProgram !== program ) {\n\n\t\t\tgl.useProgram( program );\n\n\t\t\tcurrentProgram = program;\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\tconst equationToGL = {\n\t\t[ AddEquation ]: gl.FUNC_ADD,\n\t\t[ SubtractEquation ]: gl.FUNC_SUBTRACT,\n\t\t[ ReverseSubtractEquation ]: gl.FUNC_REVERSE_SUBTRACT\n\t};\n\n\tequationToGL[ MinEquation ] = gl.MIN;\n\tequationToGL[ MaxEquation ] = gl.MAX;\n\n\tconst factorToGL = {\n\t\t[ ZeroFactor ]: gl.ZERO,\n\t\t[ OneFactor ]: gl.ONE,\n\t\t[ SrcColorFactor ]: gl.SRC_COLOR,\n\t\t[ SrcAlphaFactor ]: gl.SRC_ALPHA,\n\t\t[ SrcAlphaSaturateFactor ]: gl.SRC_ALPHA_SATURATE,\n\t\t[ DstColorFactor ]: gl.DST_COLOR,\n\t\t[ DstAlphaFactor ]: gl.DST_ALPHA,\n\t\t[ OneMinusSrcColorFactor ]: gl.ONE_MINUS_SRC_COLOR,\n\t\t[ OneMinusSrcAlphaFactor ]: gl.ONE_MINUS_SRC_ALPHA,\n\t\t[ OneMinusDstColorFactor ]: gl.ONE_MINUS_DST_COLOR,\n\t\t[ OneMinusDstAlphaFactor ]: gl.ONE_MINUS_DST_ALPHA,\n\t\t[ ConstantColorFactor ]: gl.CONSTANT_COLOR,\n\t\t[ OneMinusConstantColorFactor ]: gl.ONE_MINUS_CONSTANT_COLOR,\n\t\t[ ConstantAlphaFactor ]: gl.CONSTANT_ALPHA,\n\t\t[ OneMinusConstantAlphaFactor ]: gl.ONE_MINUS_CONSTANT_ALPHA\n\t};\n\n\tfunction setBlending( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, blendColor, blendAlpha, premultipliedAlpha ) {\n\n\t\tif ( blending === NoBlending ) {\n\n\t\t\tif ( currentBlendingEnabled === true ) {\n\n\t\t\t\tdisable( gl.BLEND );\n\t\t\t\tcurrentBlendingEnabled = false;\n\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( currentBlendingEnabled === false ) {\n\n\t\t\tenable( gl.BLEND );\n\t\t\tcurrentBlendingEnabled = true;\n\n\t\t}\n\n\t\tif ( blending !== CustomBlending ) {\n\n\t\t\tif ( blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha ) {\n\n\t\t\t\tif ( currentBlendEquation !== AddEquation || currentBlendEquationAlpha !== AddEquation ) {\n\n\t\t\t\t\tgl.blendEquation( gl.FUNC_ADD );\n\n\t\t\t\t\tcurrentBlendEquation = AddEquation;\n\t\t\t\t\tcurrentBlendEquationAlpha = AddEquation;\n\n\t\t\t\t}\n\n\t\t\t\tif ( premultipliedAlpha ) {\n\n\t\t\t\t\tswitch ( blending ) {\n\n\t\t\t\t\t\tcase NormalBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase AdditiveBlending:\n\t\t\t\t\t\t\tgl.blendFunc( gl.ONE, gl.ONE );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SubtractiveBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ZERO, gl.ONE );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase MultiplyBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.ZERO, gl.SRC_COLOR, gl.ZERO, gl.SRC_ALPHA );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.error( 'THREE.WebGLState: Invalid blending: ', blending );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tswitch ( blending ) {\n\n\t\t\t\t\t\tcase NormalBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase AdditiveBlending:\n\t\t\t\t\t\t\tgl.blendFunc( gl.SRC_ALPHA, gl.ONE );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SubtractiveBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ZERO, gl.ONE );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase MultiplyBlending:\n\t\t\t\t\t\t\tgl.blendFunc( gl.ZERO, gl.SRC_COLOR );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.error( 'THREE.WebGLState: Invalid blending: ', blending );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcurrentBlendSrc = null;\n\t\t\t\tcurrentBlendDst = null;\n\t\t\t\tcurrentBlendSrcAlpha = null;\n\t\t\t\tcurrentBlendDstAlpha = null;\n\t\t\t\tcurrentBlendColor.set( 0, 0, 0 );\n\t\t\t\tcurrentBlendAlpha = 0;\n\n\t\t\t\tcurrentBlending = blending;\n\t\t\t\tcurrentPremultipledAlpha = premultipliedAlpha;\n\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// custom blending\n\n\t\tblendEquationAlpha = blendEquationAlpha || blendEquation;\n\t\tblendSrcAlpha = blendSrcAlpha || blendSrc;\n\t\tblendDstAlpha = blendDstAlpha || blendDst;\n\n\t\tif ( blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha ) {\n\n\t\t\tgl.blendEquationSeparate( equationToGL[ blendEquation ], equationToGL[ blendEquationAlpha ] );\n\n\t\t\tcurrentBlendEquation = blendEquation;\n\t\t\tcurrentBlendEquationAlpha = blendEquationAlpha;\n\n\t\t}\n\n\t\tif ( blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha ) {\n\n\t\t\tgl.blendFuncSeparate( factorToGL[ blendSrc ], factorToGL[ blendDst ], factorToGL[ blendSrcAlpha ], factorToGL[ blendDstAlpha ] );\n\n\t\t\tcurrentBlendSrc = blendSrc;\n\t\t\tcurrentBlendDst = blendDst;\n\t\t\tcurrentBlendSrcAlpha = blendSrcAlpha;\n\t\t\tcurrentBlendDstAlpha = blendDstAlpha;\n\n\t\t}\n\n\t\tif ( blendColor.equals( currentBlendColor ) === false || blendAlpha !== currentBlendAlpha ) {\n\n\t\t\tgl.blendColor( blendColor.r, blendColor.g, blendColor.b, blendAlpha );\n\n\t\t\tcurrentBlendColor.copy( blendColor );\n\t\t\tcurrentBlendAlpha = blendAlpha;\n\n\t\t}\n\n\t\tcurrentBlending = blending;\n\t\tcurrentPremultipledAlpha = false;\n\n\t}\n\n\tfunction setMaterial( material, frontFaceCW ) {\n\n\t\tmaterial.side === DoubleSide\n\t\t\t? disable( gl.CULL_FACE )\n\t\t\t: enable( gl.CULL_FACE );\n\n\t\tlet flipSided = ( material.side === BackSide );\n\t\tif ( frontFaceCW ) flipSided = ! flipSided;\n\n\t\tsetFlipSided( flipSided );\n\n\t\t( material.blending === NormalBlending && material.transparent === false )\n\t\t\t? setBlending( NoBlending )\n\t\t\t: setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.blendColor, material.blendAlpha, material.premultipliedAlpha );\n\n\t\tdepthBuffer.setFunc( material.depthFunc );\n\t\tdepthBuffer.setTest( material.depthTest );\n\t\tdepthBuffer.setMask( material.depthWrite );\n\t\tcolorBuffer.setMask( material.colorWrite );\n\n\t\tconst stencilWrite = material.stencilWrite;\n\t\tstencilBuffer.setTest( stencilWrite );\n\t\tif ( stencilWrite ) {\n\n\t\t\tstencilBuffer.setMask( material.stencilWriteMask );\n\t\t\tstencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilFuncMask );\n\t\t\tstencilBuffer.setOp( material.stencilFail, material.stencilZFail, material.stencilZPass );\n\n\t\t}\n\n\t\tsetPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits );\n\n\t\tmaterial.alphaToCoverage === true\n\t\t\t? enable( gl.SAMPLE_ALPHA_TO_COVERAGE )\n\t\t\t: disable( gl.SAMPLE_ALPHA_TO_COVERAGE );\n\n\t}\n\n\t//\n\n\tfunction setFlipSided( flipSided ) {\n\n\t\tif ( currentFlipSided !== flipSided ) {\n\n\t\t\tif ( flipSided ) {\n\n\t\t\t\tgl.frontFace( gl.CW );\n\n\t\t\t} else {\n\n\t\t\t\tgl.frontFace( gl.CCW );\n\n\t\t\t}\n\n\t\t\tcurrentFlipSided = flipSided;\n\n\t\t}\n\n\t}\n\n\tfunction setCullFace( cullFace ) {\n\n\t\tif ( cullFace !== CullFaceNone ) {\n\n\t\t\tenable( gl.CULL_FACE );\n\n\t\t\tif ( cullFace !== currentCullFace ) {\n\n\t\t\t\tif ( cullFace === CullFaceBack ) {\n\n\t\t\t\t\tgl.cullFace( gl.BACK );\n\n\t\t\t\t} else if ( cullFace === CullFaceFront ) {\n\n\t\t\t\t\tgl.cullFace( gl.FRONT );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tgl.cullFace( gl.FRONT_AND_BACK );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tdisable( gl.CULL_FACE );\n\n\t\t}\n\n\t\tcurrentCullFace = cullFace;\n\n\t}\n\n\tfunction setLineWidth( width ) {\n\n\t\tif ( width !== currentLineWidth ) {\n\n\t\t\tif ( lineWidthAvailable ) gl.lineWidth( width );\n\n\t\t\tcurrentLineWidth = width;\n\n\t\t}\n\n\t}\n\n\tfunction setPolygonOffset( polygonOffset, factor, units ) {\n\n\t\tif ( polygonOffset ) {\n\n\t\t\tenable( gl.POLYGON_OFFSET_FILL );\n\n\t\t\tif ( currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units ) {\n\n\t\t\t\tgl.polygonOffset( factor, units );\n\n\t\t\t\tcurrentPolygonOffsetFactor = factor;\n\t\t\t\tcurrentPolygonOffsetUnits = units;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tdisable( gl.POLYGON_OFFSET_FILL );\n\n\t\t}\n\n\t}\n\n\tfunction setScissorTest( scissorTest ) {\n\n\t\tif ( scissorTest ) {\n\n\t\t\tenable( gl.SCISSOR_TEST );\n\n\t\t} else {\n\n\t\t\tdisable( gl.SCISSOR_TEST );\n\n\t\t}\n\n\t}\n\n\t// texture\n\n\tfunction activeTexture( webglSlot ) {\n\n\t\tif ( webglSlot === undefined ) webglSlot = gl.TEXTURE0 + maxTextures - 1;\n\n\t\tif ( currentTextureSlot !== webglSlot ) {\n\n\t\t\tgl.activeTexture( webglSlot );\n\t\t\tcurrentTextureSlot = webglSlot;\n\n\t\t}\n\n\t}\n\n\tfunction bindTexture( webglType, webglTexture, webglSlot ) {\n\n\t\tif ( webglSlot === undefined ) {\n\n\t\t\tif ( currentTextureSlot === null ) {\n\n\t\t\t\twebglSlot = gl.TEXTURE0 + maxTextures - 1;\n\n\t\t\t} else {\n\n\t\t\t\twebglSlot = currentTextureSlot;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlet boundTexture = currentBoundTextures[ webglSlot ];\n\n\t\tif ( boundTexture === undefined ) {\n\n\t\t\tboundTexture = { type: undefined, texture: undefined };\n\t\t\tcurrentBoundTextures[ webglSlot ] = boundTexture;\n\n\t\t}\n\n\t\tif ( boundTexture.type !== webglType || boundTexture.texture !== webglTexture ) {\n\n\t\t\tif ( currentTextureSlot !== webglSlot ) {\n\n\t\t\t\tgl.activeTexture( webglSlot );\n\t\t\t\tcurrentTextureSlot = webglSlot;\n\n\t\t\t}\n\n\t\t\tgl.bindTexture( webglType, webglTexture || emptyTextures[ webglType ] );\n\n\t\t\tboundTexture.type = webglType;\n\t\t\tboundTexture.texture = webglTexture;\n\n\t\t}\n\n\t}\n\n\tfunction unbindTexture() {\n\n\t\tconst boundTexture = currentBoundTextures[ currentTextureSlot ];\n\n\t\tif ( boundTexture !== undefined && boundTexture.type !== undefined ) {\n\n\t\t\tgl.bindTexture( boundTexture.type, null );\n\n\t\t\tboundTexture.type = undefined;\n\t\t\tboundTexture.texture = undefined;\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexImage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexImage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texSubImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.texSubImage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texSubImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.texSubImage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexSubImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexSubImage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexSubImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexSubImage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texStorage2D() {\n\n\t\ttry {\n\n\t\t\tgl.texStorage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texStorage3D() {\n\n\t\ttry {\n\n\t\t\tgl.texStorage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.texImage2D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.texImage3D.apply( gl, arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\t//\n\n\tfunction scissor( scissor ) {\n\n\t\tif ( currentScissor.equals( scissor ) === false ) {\n\n\t\t\tgl.scissor( scissor.x, scissor.y, scissor.z, scissor.w );\n\t\t\tcurrentScissor.copy( scissor );\n\n\t\t}\n\n\t}\n\n\tfunction viewport( viewport ) {\n\n\t\tif ( currentViewport.equals( viewport ) === false ) {\n\n\t\t\tgl.viewport( viewport.x, viewport.y, viewport.z, viewport.w );\n\t\t\tcurrentViewport.copy( viewport );\n\n\t\t}\n\n\t}\n\n\tfunction updateUBOMapping( uniformsGroup, program ) {\n\n\t\tlet mapping = uboProgramMap.get( program );\n\n\t\tif ( mapping === undefined ) {\n\n\t\t\tmapping = new WeakMap();\n\n\t\t\tuboProgramMap.set( program, mapping );\n\n\t\t}\n\n\t\tlet blockIndex = mapping.get( uniformsGroup );\n\n\t\tif ( blockIndex === undefined ) {\n\n\t\t\tblockIndex = gl.getUniformBlockIndex( program, uniformsGroup.name );\n\n\t\t\tmapping.set( uniformsGroup, blockIndex );\n\n\t\t}\n\n\t}\n\n\tfunction uniformBlockBinding( uniformsGroup, program ) {\n\n\t\tconst mapping = uboProgramMap.get( program );\n\t\tconst blockIndex = mapping.get( uniformsGroup );\n\n\t\tif ( uboBindings.get( program ) !== blockIndex ) {\n\n\t\t\t// bind shader specific block index to global block point\n\t\t\tgl.uniformBlockBinding( program, blockIndex, uniformsGroup.__bindingPointIndex );\n\n\t\t\tuboBindings.set( program, blockIndex );\n\n\t\t}\n\n\t}\n\n\t//\n\n\tfunction reset() {\n\n\t\t// reset state\n\n\t\tgl.disable( gl.BLEND );\n\t\tgl.disable( gl.CULL_FACE );\n\t\tgl.disable( gl.DEPTH_TEST );\n\t\tgl.disable( gl.POLYGON_OFFSET_FILL );\n\t\tgl.disable( gl.SCISSOR_TEST );\n\t\tgl.disable( gl.STENCIL_TEST );\n\t\tgl.disable( gl.SAMPLE_ALPHA_TO_COVERAGE );\n\n\t\tgl.blendEquation( gl.FUNC_ADD );\n\t\tgl.blendFunc( gl.ONE, gl.ZERO );\n\t\tgl.blendFuncSeparate( gl.ONE, gl.ZERO, gl.ONE, gl.ZERO );\n\t\tgl.blendColor( 0, 0, 0, 0 );\n\n\t\tgl.colorMask( true, true, true, true );\n\t\tgl.clearColor( 0, 0, 0, 0 );\n\n\t\tgl.depthMask( true );\n\t\tgl.depthFunc( gl.LESS );\n\n\t\tdepthBuffer.setReversed( false );\n\n\t\tgl.clearDepth( 1 );\n\n\t\tgl.stencilMask( 0xffffffff );\n\t\tgl.stencilFunc( gl.ALWAYS, 0, 0xffffffff );\n\t\tgl.stencilOp( gl.KEEP, gl.KEEP, gl.KEEP );\n\t\tgl.clearStencil( 0 );\n\n\t\tgl.cullFace( gl.BACK );\n\t\tgl.frontFace( gl.CCW );\n\n\t\tgl.polygonOffset( 0, 0 );\n\n\t\tgl.activeTexture( gl.TEXTURE0 );\n\n\t\tgl.bindFramebuffer( gl.FRAMEBUFFER, null );\n\t\tgl.bindFramebuffer( gl.DRAW_FRAMEBUFFER, null );\n\t\tgl.bindFramebuffer( gl.READ_FRAMEBUFFER, null );\n\n\t\tgl.useProgram( null );\n\n\t\tgl.lineWidth( 1 );\n\n\t\tgl.scissor( 0, 0, gl.canvas.width, gl.canvas.height );\n\t\tgl.viewport( 0, 0, gl.canvas.width, gl.canvas.height );\n\n\t\t// reset internals\n\n\t\tenabledCapabilities = {};\n\n\t\tcurrentTextureSlot = null;\n\t\tcurrentBoundTextures = {};\n\n\t\tcurrentBoundFramebuffers = {};\n\t\tcurrentDrawbuffers = new WeakMap();\n\t\tdefaultDrawbuffers = [];\n\n\t\tcurrentProgram = null;\n\n\t\tcurrentBlendingEnabled = false;\n\t\tcurrentBlending = null;\n\t\tcurrentBlendEquation = null;\n\t\tcurrentBlendSrc = null;\n\t\tcurrentBlendDst = null;\n\t\tcurrentBlendEquationAlpha = null;\n\t\tcurrentBlendSrcAlpha = null;\n\t\tcurrentBlendDstAlpha = null;\n\t\tcurrentBlendColor = new Color( 0, 0, 0 );\n\t\tcurrentBlendAlpha = 0;\n\t\tcurrentPremultipledAlpha = false;\n\n\t\tcurrentFlipSided = null;\n\t\tcurrentCullFace = null;\n\n\t\tcurrentLineWidth = null;\n\n\t\tcurrentPolygonOffsetFactor = null;\n\t\tcurrentPolygonOffsetUnits = null;\n\n\t\tcurrentScissor.set( 0, 0, gl.canvas.width, gl.canvas.height );\n\t\tcurrentViewport.set( 0, 0, gl.canvas.width, gl.canvas.height );\n\n\t\tcolorBuffer.reset();\n\t\tdepthBuffer.reset();\n\t\tstencilBuffer.reset();\n\n\t}\n\n\treturn {\n\n\t\tbuffers: {\n\t\t\tcolor: colorBuffer,\n\t\t\tdepth: depthBuffer,\n\t\t\tstencil: stencilBuffer\n\t\t},\n\n\t\tenable: enable,\n\t\tdisable: disable,\n\n\t\tbindFramebuffer: bindFramebuffer,\n\t\tdrawBuffers: drawBuffers,\n\n\t\tuseProgram: useProgram,\n\n\t\tsetBlending: setBlending,\n\t\tsetMaterial: setMaterial,\n\n\t\tsetFlipSided: setFlipSided,\n\t\tsetCullFace: setCullFace,\n\n\t\tsetLineWidth: setLineWidth,\n\t\tsetPolygonOffset: setPolygonOffset,\n\n\t\tsetScissorTest: setScissorTest,\n\n\t\tactiveTexture: activeTexture,\n\t\tbindTexture: bindTexture,\n\t\tunbindTexture: unbindTexture,\n\t\tcompressedTexImage2D: compressedTexImage2D,\n\t\tcompressedTexImage3D: compressedTexImage3D,\n\t\ttexImage2D: texImage2D,\n\t\ttexImage3D: texImage3D,\n\n\t\tupdateUBOMapping: updateUBOMapping,\n\t\tuniformBlockBinding: uniformBlockBinding,\n\n\t\ttexStorage2D: texStorage2D,\n\t\ttexStorage3D: texStorage3D,\n\t\ttexSubImage2D: texSubImage2D,\n\t\ttexSubImage3D: texSubImage3D,\n\t\tcompressedTexSubImage2D: compressedTexSubImage2D,\n\t\tcompressedTexSubImage3D: compressedTexSubImage3D,\n\n\t\tscissor: scissor,\n\t\tviewport: viewport,\n\n\t\treset: reset\n\n\t};\n\n}\n\nfunction contain( texture, aspect ) {\n\n\tconst imageAspect = ( texture.image && texture.image.width ) ? texture.image.width / texture.image.height : 1;\n\n\tif ( imageAspect > aspect ) {\n\n\t\ttexture.repeat.x = 1;\n\t\ttexture.repeat.y = imageAspect / aspect;\n\n\t\ttexture.offset.x = 0;\n\t\ttexture.offset.y = ( 1 - texture.repeat.y ) / 2;\n\n\t} else {\n\n\t\ttexture.repeat.x = aspect / imageAspect;\n\t\ttexture.repeat.y = 1;\n\n\t\ttexture.offset.x = ( 1 - texture.repeat.x ) / 2;\n\t\ttexture.offset.y = 0;\n\n\t}\n\n\treturn texture;\n\n}\n\nfunction cover( texture, aspect ) {\n\n\tconst imageAspect = ( texture.image && texture.image.width ) ? texture.image.width / texture.image.height : 1;\n\n\tif ( imageAspect > aspect ) {\n\n\t\ttexture.repeat.x = aspect / imageAspect;\n\t\ttexture.repeat.y = 1;\n\n\t\ttexture.offset.x = ( 1 - texture.repeat.x ) / 2;\n\t\ttexture.offset.y = 0;\n\n\t} else {\n\n\t\ttexture.repeat.x = 1;\n\t\ttexture.repeat.y = imageAspect / aspect;\n\n\t\ttexture.offset.x = 0;\n\t\ttexture.offset.y = ( 1 - texture.repeat.y ) / 2;\n\n\t}\n\n\treturn texture;\n\n}\n\nfunction fill( texture ) {\n\n\ttexture.repeat.x = 1;\n\ttexture.repeat.y = 1;\n\n\ttexture.offset.x = 0;\n\ttexture.offset.y = 0;\n\n\treturn texture;\n\n}\n\n\n\n/**\n * Given the width, height, format, and type of a texture. Determines how many\n * bytes must be used to represent the texture.\n */\nfunction getByteLength( width, height, format, type ) {\n\n\tconst typeByteLength = getTextureTypeByteLength( type );\n\n\tswitch ( format ) {\n\n\t\t// https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml\n\t\tcase AlphaFormat:\n\t\t\treturn width * height;\n\t\tcase LuminanceFormat:\n\t\t\treturn width * height;\n\t\tcase LuminanceAlphaFormat:\n\t\t\treturn width * height * 2;\n\t\tcase RedFormat:\n\t\t\treturn ( ( width * height ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RedIntegerFormat:\n\t\t\treturn ( ( width * height ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGFormat:\n\t\t\treturn ( ( width * height * 2 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGIntegerFormat:\n\t\t\treturn ( ( width * height * 2 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGBFormat:\n\t\t\treturn ( ( width * height * 3 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGBAFormat:\n\t\t\treturn ( ( width * height * 4 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGBAIntegerFormat:\n\t\t\treturn ( ( width * height * 4 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\n\t\t// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/\n\t\tcase RGB_S3TC_DXT1_Format:\n\t\tcase RGBA_S3TC_DXT1_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 8;\n\t\tcase RGBA_S3TC_DXT3_Format:\n\t\tcase RGBA_S3TC_DXT5_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 16;\n\n\t\t// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_pvrtc/\n\t\tcase RGB_PVRTC_2BPPV1_Format:\n\t\tcase RGBA_PVRTC_2BPPV1_Format:\n\t\t\treturn ( Math.max( width, 16 ) * Math.max( height, 8 ) ) / 4;\n\t\tcase RGB_PVRTC_4BPPV1_Format:\n\t\tcase RGBA_PVRTC_4BPPV1_Format:\n\t\t\treturn ( Math.max( width, 8 ) * Math.max( height, 8 ) ) / 2;\n\n\t\t// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_etc/\n\t\tcase RGB_ETC1_Format:\n\t\tcase RGB_ETC2_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 8;\n\t\tcase RGBA_ETC2_EAC_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 16;\n\n\t\t// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_astc/\n\t\tcase RGBA_ASTC_4x4_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 16;\n\t\tcase RGBA_ASTC_5x4_Format:\n\t\t\treturn Math.floor( ( width + 4 ) / 5 ) * Math.floor( ( height + 3 ) / 4 ) * 16;\n\t\tcase RGBA_ASTC_5x5_Format:\n\t\t\treturn Math.floor( ( width + 4 ) / 5 ) * Math.floor( ( height + 4 ) / 5 ) * 16;\n\t\tcase RGBA_ASTC_6x5_Format:\n\t\t\treturn Math.floor( ( width + 5 ) / 6 ) * Math.floor( ( height + 4 ) / 5 ) * 16;\n\t\tcase RGBA_ASTC_6x6_Format:\n\t\t\treturn Math.floor( ( width + 5 ) / 6 ) * Math.floor( ( height + 5 ) / 6 ) * 16;\n\t\tcase RGBA_ASTC_8x5_Format:\n\t\t\treturn Math.floor( ( width + 7 ) / 8 ) * Math.floor( ( height + 4 ) / 5 ) * 16;\n\t\tcase RGBA_ASTC_8x6_Format:\n\t\t\treturn Math.floor( ( width + 7 ) / 8 ) * Math.floor( ( height + 5 ) / 6 ) * 16;\n\t\tcase RGBA_ASTC_8x8_Format:\n\t\t\treturn Math.floor( ( width + 7 ) / 8 ) * Math.floor( ( height + 7 ) / 8 ) * 16;\n\t\tcase RGBA_ASTC_10x5_Format:\n\t\t\treturn Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 4 ) / 5 ) * 16;\n\t\tcase RGBA_ASTC_10x6_Format:\n\t\t\treturn Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 5 ) / 6 ) * 16;\n\t\tcase RGBA_ASTC_10x8_Format:\n\t\t\treturn Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 7 ) / 8 ) * 16;\n\t\tcase RGBA_ASTC_10x10_Format:\n\t\t\treturn Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 9 ) / 10 ) * 16;\n\t\tcase RGBA_ASTC_12x10_Format:\n\t\t\treturn Math.floor( ( width + 11 ) / 12 ) * Math.floor( ( height + 9 ) / 10 ) * 16;\n\t\tcase RGBA_ASTC_12x12_Format:\n\t\t\treturn Math.floor( ( width + 11 ) / 12 ) * Math.floor( ( height + 11 ) / 12 ) * 16;\n\n\t\t// https://registry.khronos.org/webgl/extensions/EXT_texture_compression_bptc/\n\t\tcase RGBA_BPTC_Format:\n\t\tcase RGB_BPTC_SIGNED_Format:\n\t\tcase RGB_BPTC_UNSIGNED_Format:\n\t\t\treturn Math.ceil( width / 4 ) * Math.ceil( height / 4 ) * 16;\n\n\t\t// https://registry.khronos.org/webgl/extensions/EXT_texture_compression_rgtc/\n\t\tcase RED_RGTC1_Format:\n\t\tcase SIGNED_RED_RGTC1_Format:\n\t\t\treturn Math.ceil( width / 4 ) * Math.ceil( height / 4 ) * 8;\n\t\tcase RED_GREEN_RGTC2_Format:\n\t\tcase SIGNED_RED_GREEN_RGTC2_Format:\n\t\t\treturn Math.ceil( width / 4 ) * Math.ceil( height / 4 ) * 16;\n\n\t}\n\n\tthrow new Error(\n\t\t`Unable to determine texture byte length for ${format} format.`,\n\t);\n\n}\n\nfunction getTextureTypeByteLength( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase UnsignedByteType:\n\t\tcase ByteType:\n\t\t\treturn { byteLength: 1, components: 1 };\n\t\tcase UnsignedShortType:\n\t\tcase ShortType:\n\t\tcase HalfFloatType:\n\t\t\treturn { byteLength: 2, components: 1 };\n\t\tcase UnsignedShort4444Type:\n\t\tcase UnsignedShort5551Type:\n\t\t\treturn { byteLength: 2, components: 4 };\n\t\tcase UnsignedIntType:\n\t\tcase IntType:\n\t\tcase FloatType:\n\t\t\treturn { byteLength: 4, components: 1 };\n\t\tcase UnsignedInt5999Type:\n\t\t\treturn { byteLength: 4, components: 3 };\n\n\t}\n\n\tthrow new Error( `Unknown texture type ${type}.` );\n\n}\n\nconst TextureUtils = {\n\tcontain,\n\tcover,\n\tfill,\n\tgetByteLength\n};\n\nfunction WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ) {\n\n\tconst multisampledRTTExt = extensions.has( 'WEBGL_multisampled_render_to_texture' ) ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : null;\n\tconst supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent );\n\n\tconst _imageDimensions = new Vector2();\n\tconst _videoTextures = new WeakMap();\n\tlet _canvas;\n\n\tconst _sources = new WeakMap(); // maps WebglTexture objects to instances of Source\n\n\t// cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas,\n\t// also OffscreenCanvas.getContext(\"webgl\"), but not OffscreenCanvas.getContext(\"2d\")!\n\t// Some implementations may only implement OffscreenCanvas partially (e.g. lacking 2d).\n\n\tlet useOffscreenCanvas = false;\n\n\ttry {\n\n\t\tuseOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'\n\t\t\t// eslint-disable-next-line compat/compat\n\t\t\t&& ( new OffscreenCanvas( 1, 1 ).getContext( '2d' ) ) !== null;\n\n\t} catch ( err ) {\n\n\t\t// Ignore any errors\n\n\t}\n\n\tfunction createCanvas( width, height ) {\n\n\t\t// Use OffscreenCanvas when available. Specially needed in web workers\n\n\t\treturn useOffscreenCanvas ?\n\t\t\t// eslint-disable-next-line compat/compat\n\t\t\tnew OffscreenCanvas( width, height ) : createElementNS( 'canvas' );\n\n\t}\n\n\tfunction resizeImage( image, needsNewCanvas, maxSize ) {\n\n\t\tlet scale = 1;\n\n\t\tconst dimensions = getDimensions( image );\n\n\t\t// handle case if texture exceeds max size\n\n\t\tif ( dimensions.width > maxSize || dimensions.height > maxSize ) {\n\n\t\t\tscale = maxSize / Math.max( dimensions.width, dimensions.height );\n\n\t\t}\n\n\t\t// only perform resize if necessary\n\n\t\tif ( scale < 1 ) {\n\n\t\t\t// only perform resize for certain image types\n\n\t\t\tif ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||\n\t\t\t\t( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||\n\t\t\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ||\n\t\t\t\t( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) ) {\n\n\t\t\t\tconst width = Math.floor( scale * dimensions.width );\n\t\t\t\tconst height = Math.floor( scale * dimensions.height );\n\n\t\t\t\tif ( _canvas === undefined ) _canvas = createCanvas( width, height );\n\n\t\t\t\t// cube textures can't reuse the same canvas\n\n\t\t\t\tconst canvas = needsNewCanvas ? createCanvas( width, height ) : _canvas;\n\n\t\t\t\tcanvas.width = width;\n\t\t\t\tcanvas.height = height;\n\n\t\t\t\tconst context = canvas.getContext( '2d' );\n\t\t\t\tcontext.drawImage( image, 0, 0, width, height );\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + dimensions.width + 'x' + dimensions.height + ') to (' + width + 'x' + height + ').' );\n\n\t\t\t\treturn canvas;\n\n\t\t\t} else {\n\n\t\t\t\tif ( 'data' in image ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + dimensions.width + 'x' + dimensions.height + ').' );\n\n\t\t\t\t}\n\n\t\t\t\treturn image;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn image;\n\n\t}\n\n\tfunction textureNeedsGenerateMipmaps( texture ) {\n\n\t\treturn texture.generateMipmaps;\n\n\t}\n\n\tfunction generateMipmap( target ) {\n\n\t\t_gl.generateMipmap( target );\n\n\t}\n\n\tfunction getTargetType( texture ) {\n\n\t\tif ( texture.isWebGLCubeRenderTarget ) return _gl.TEXTURE_CUBE_MAP;\n\t\tif ( texture.isWebGL3DRenderTarget ) return _gl.TEXTURE_3D;\n\t\tif ( texture.isWebGLArrayRenderTarget || texture.isCompressedArrayTexture ) return _gl.TEXTURE_2D_ARRAY;\n\t\treturn _gl.TEXTURE_2D;\n\n\t}\n\n\tfunction getInternalFormat( internalFormatName, glFormat, glType, colorSpace, forceLinearTransfer = false ) {\n\n\t\tif ( internalFormatName !== null ) {\n\n\t\t\tif ( _gl[ internalFormatName ] !== undefined ) return _gl[ internalFormatName ];\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \\'' + internalFormatName + '\\'' );\n\n\t\t}\n\n\t\tlet internalFormat = glFormat;\n\n\t\tif ( glFormat === _gl.RED ) {\n\n\t\t\tif ( glType === _gl.FLOAT ) internalFormat = _gl.R32F;\n\t\t\tif ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.R16F;\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RED_INTEGER ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8UI;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.R16UI;\n\t\t\tif ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.R32UI;\n\t\t\tif ( glType === _gl.BYTE ) internalFormat = _gl.R8I;\n\t\t\tif ( glType === _gl.SHORT ) internalFormat = _gl.R16I;\n\t\t\tif ( glType === _gl.INT ) internalFormat = _gl.R32I;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RG ) {\n\n\t\t\tif ( glType === _gl.FLOAT ) internalFormat = _gl.RG32F;\n\t\t\tif ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.RG16F;\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RG8;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RG_INTEGER ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RG8UI;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.RG16UI;\n\t\t\tif ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.RG32UI;\n\t\t\tif ( glType === _gl.BYTE ) internalFormat = _gl.RG8I;\n\t\t\tif ( glType === _gl.SHORT ) internalFormat = _gl.RG16I;\n\t\t\tif ( glType === _gl.INT ) internalFormat = _gl.RG32I;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RGB_INTEGER ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RGB8UI;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.RGB16UI;\n\t\t\tif ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.RGB32UI;\n\t\t\tif ( glType === _gl.BYTE ) internalFormat = _gl.RGB8I;\n\t\t\tif ( glType === _gl.SHORT ) internalFormat = _gl.RGB16I;\n\t\t\tif ( glType === _gl.INT ) internalFormat = _gl.RGB32I;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RGBA_INTEGER ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RGBA8UI;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.RGBA16UI;\n\t\t\tif ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.RGBA32UI;\n\t\t\tif ( glType === _gl.BYTE ) internalFormat = _gl.RGBA8I;\n\t\t\tif ( glType === _gl.SHORT ) internalFormat = _gl.RGBA16I;\n\t\t\tif ( glType === _gl.INT ) internalFormat = _gl.RGBA32I;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RGB ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_INT_5_9_9_9_REV ) internalFormat = _gl.RGB9_E5;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RGBA ) {\n\n\t\t\tconst transfer = forceLinearTransfer ? LinearTransfer : ColorManagement.getTransfer( colorSpace );\n\n\t\t\tif ( glType === _gl.FLOAT ) internalFormat = _gl.RGBA32F;\n\t\t\tif ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.RGBA16F;\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = ( transfer === SRGBTransfer ) ? _gl.SRGB8_ALPHA8 : _gl.RGBA8;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT_4_4_4_4 ) internalFormat = _gl.RGBA4;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT_5_5_5_1 ) internalFormat = _gl.RGB5_A1;\n\n\t\t}\n\n\t\tif ( internalFormat === _gl.R16F || internalFormat === _gl.R32F ||\n\t\t\tinternalFormat === _gl.RG16F || internalFormat === _gl.RG32F ||\n\t\t\tinternalFormat === _gl.RGBA16F || internalFormat === _gl.RGBA32F ) {\n\n\t\t\textensions.get( 'EXT_color_buffer_float' );\n\n\t\t}\n\n\t\treturn internalFormat;\n\n\t}\n\n\tfunction getInternalDepthFormat( useStencil, depthType ) {\n\n\t\tlet glInternalFormat;\n\t\tif ( useStencil ) {\n\n\t\t\tif ( depthType === null || depthType === UnsignedIntType || depthType === UnsignedInt248Type ) {\n\n\t\t\t\tglInternalFormat = _gl.DEPTH24_STENCIL8;\n\n\t\t\t} else if ( depthType === FloatType ) {\n\n\t\t\t\tglInternalFormat = _gl.DEPTH32F_STENCIL8;\n\n\t\t\t} else if ( depthType === UnsignedShortType ) {\n\n\t\t\t\tglInternalFormat = _gl.DEPTH24_STENCIL8;\n\t\t\t\tconsole.warn( 'DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.' );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( depthType === null || depthType === UnsignedIntType || depthType === UnsignedInt248Type ) {\n\n\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT24;\n\n\t\t\t} else if ( depthType === FloatType ) {\n\n\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT32F;\n\n\t\t\t} else if ( depthType === UnsignedShortType ) {\n\n\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT16;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn glInternalFormat;\n\n\t}\n\n\tfunction getMipLevels( texture, image ) {\n\n\t\tif ( textureNeedsGenerateMipmaps( texture ) === true || ( texture.isFramebufferTexture && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) ) {\n\n\t\t\treturn Math.log2( Math.max( image.width, image.height ) ) + 1;\n\n\t\t} else if ( texture.mipmaps !== undefined && texture.mipmaps.length > 0 ) {\n\n\t\t\t// user-defined mipmaps\n\n\t\t\treturn texture.mipmaps.length;\n\n\t\t} else if ( texture.isCompressedTexture && Array.isArray( texture.image ) ) {\n\n\t\t\treturn image.mipmaps.length;\n\n\t\t} else {\n\n\t\t\t// texture without mipmaps (only base level)\n\n\t\t\treturn 1;\n\n\t\t}\n\n\t}\n\n\t//\n\n\tfunction onTextureDispose( event ) {\n\n\t\tconst texture = event.target;\n\n\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\tdeallocateTexture( texture );\n\n\t\tif ( texture.isVideoTexture ) {\n\n\t\t\t_videoTextures.delete( texture );\n\n\t\t}\n\n\t}\n\n\tfunction onRenderTargetDispose( event ) {\n\n\t\tconst renderTarget = event.target;\n\n\t\trenderTarget.removeEventListener( 'dispose', onRenderTargetDispose );\n\n\t\tdeallocateRenderTarget( renderTarget );\n\n\t}\n\n\t//\n\n\tfunction deallocateTexture( texture ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( textureProperties.__webglInit === undefined ) return;\n\n\t\t// check if it's necessary to remove the WebGLTexture object\n\n\t\tconst source = texture.source;\n\t\tconst webglTextures = _sources.get( source );\n\n\t\tif ( webglTextures ) {\n\n\t\t\tconst webglTexture = webglTextures[ textureProperties.__cacheKey ];\n\t\t\twebglTexture.usedTimes --;\n\n\t\t\t// the WebGLTexture object is not used anymore, remove it\n\n\t\t\tif ( webglTexture.usedTimes === 0 ) {\n\n\t\t\t\tdeleteTexture( texture );\n\n\t\t\t}\n\n\t\t\t// remove the weak map entry if no WebGLTexture uses the source anymore\n\n\t\t\tif ( Object.keys( webglTextures ).length === 0 ) {\n\n\t\t\t\t_sources.delete( source );\n\n\t\t\t}\n\n\t\t}\n\n\t\tproperties.remove( texture );\n\n\t}\n\n\tfunction deleteTexture( texture ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\t\t_gl.deleteTexture( textureProperties.__webglTexture );\n\n\t\tconst source = texture.source;\n\t\tconst webglTextures = _sources.get( source );\n\t\tdelete webglTextures[ textureProperties.__cacheKey ];\n\n\t\tinfo.memory.textures --;\n\n\t}\n\n\tfunction deallocateRenderTarget( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\trenderTarget.depthTexture.dispose();\n\n\t\t\tproperties.remove( renderTarget.depthTexture );\n\n\t\t}\n\n\t\tif ( renderTarget.isWebGLCubeRenderTarget ) {\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( Array.isArray( renderTargetProperties.__webglFramebuffer[ i ] ) ) {\n\n\t\t\t\t\tfor ( let level = 0; level < renderTargetProperties.__webglFramebuffer[ i ].length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ][ level ] );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] );\n\n\t\t\t\t}\n\n\t\t\t\tif ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( Array.isArray( renderTargetProperties.__webglFramebuffer ) ) {\n\n\t\t\t\tfor ( let level = 0; level < renderTargetProperties.__webglFramebuffer.length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ level ] );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer );\n\n\t\t\t}\n\n\t\t\tif ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer );\n\t\t\tif ( renderTargetProperties.__webglMultisampledFramebuffer ) _gl.deleteFramebuffer( renderTargetProperties.__webglMultisampledFramebuffer );\n\n\t\t\tif ( renderTargetProperties.__webglColorRenderbuffer ) {\n\n\t\t\t\tfor ( let i = 0; i < renderTargetProperties.__webglColorRenderbuffer.length; i ++ ) {\n\n\t\t\t\t\tif ( renderTargetProperties.__webglColorRenderbuffer[ i ] ) _gl.deleteRenderbuffer( renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( renderTargetProperties.__webglDepthRenderbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthRenderbuffer );\n\n\t\t}\n\n\t\tconst textures = renderTarget.textures;\n\n\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\tconst attachmentProperties = properties.get( textures[ i ] );\n\n\t\t\tif ( attachmentProperties.__webglTexture ) {\n\n\t\t\t\t_gl.deleteTexture( attachmentProperties.__webglTexture );\n\n\t\t\t\tinfo.memory.textures --;\n\n\t\t\t}\n\n\t\t\tproperties.remove( textures[ i ] );\n\n\t\t}\n\n\t\tproperties.remove( renderTarget );\n\n\t}\n\n\t//\n\n\tlet textureUnits = 0;\n\n\tfunction resetTextureUnits() {\n\n\t\ttextureUnits = 0;\n\n\t}\n\n\tfunction allocateTextureUnit() {\n\n\t\tconst textureUnit = textureUnits;\n\n\t\tif ( textureUnit >= capabilities.maxTextures ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures );\n\n\t\t}\n\n\t\ttextureUnits += 1;\n\n\t\treturn textureUnit;\n\n\t}\n\n\tfunction getTextureCacheKey( texture ) {\n\n\t\tconst array = [];\n\n\t\tarray.push( texture.wrapS );\n\t\tarray.push( texture.wrapT );\n\t\tarray.push( texture.wrapR || 0 );\n\t\tarray.push( texture.magFilter );\n\t\tarray.push( texture.minFilter );\n\t\tarray.push( texture.anisotropy );\n\t\tarray.push( texture.internalFormat );\n\t\tarray.push( texture.format );\n\t\tarray.push( texture.type );\n\t\tarray.push( texture.generateMipmaps );\n\t\tarray.push( texture.premultiplyAlpha );\n\t\tarray.push( texture.flipY );\n\t\tarray.push( texture.unpackAlignment );\n\t\tarray.push( texture.colorSpace );\n\n\t\treturn array.join();\n\n\t}\n\n\t//\n\n\tfunction setTexture2D( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.isVideoTexture ) updateVideoTexture( texture );\n\n\t\tif ( texture.isRenderTargetTexture === false && texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tconst image = texture.image;\n\n\t\t\tif ( image === null ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture marked for update but no image data found.' );\n\n\t\t\t} else if ( image.complete === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete' );\n\n\t\t\t} else {\n\n\t\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t}\n\n\tfunction setTexture2DArray( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\treturn;\n\n\t\t}\n\n\t\tstate.bindTexture( _gl.TEXTURE_2D_ARRAY, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t}\n\n\tfunction setTexture3D( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\treturn;\n\n\t\t}\n\n\t\tstate.bindTexture( _gl.TEXTURE_3D, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t}\n\n\tfunction setTextureCube( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tuploadCubeTexture( textureProperties, texture, slot );\n\t\t\treturn;\n\n\t\t}\n\n\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t}\n\n\tconst wrappingToGL = {\n\t\t[ RepeatWrapping ]: _gl.REPEAT,\n\t\t[ ClampToEdgeWrapping ]: _gl.CLAMP_TO_EDGE,\n\t\t[ MirroredRepeatWrapping ]: _gl.MIRRORED_REPEAT\n\t};\n\n\tconst filterToGL = {\n\t\t[ NearestFilter ]: _gl.NEAREST,\n\t\t[ NearestMipmapNearestFilter ]: _gl.NEAREST_MIPMAP_NEAREST,\n\t\t[ NearestMipmapLinearFilter ]: _gl.NEAREST_MIPMAP_LINEAR,\n\n\t\t[ LinearFilter ]: _gl.LINEAR,\n\t\t[ LinearMipmapNearestFilter ]: _gl.LINEAR_MIPMAP_NEAREST,\n\t\t[ LinearMipmapLinearFilter ]: _gl.LINEAR_MIPMAP_LINEAR\n\t};\n\n\tconst compareToGL = {\n\t\t[ NeverCompare ]: _gl.NEVER,\n\t\t[ AlwaysCompare ]: _gl.ALWAYS,\n\t\t[ LessCompare ]: _gl.LESS,\n\t\t[ LessEqualCompare ]: _gl.LEQUAL,\n\t\t[ EqualCompare ]: _gl.EQUAL,\n\t\t[ GreaterEqualCompare ]: _gl.GEQUAL,\n\t\t[ GreaterCompare ]: _gl.GREATER,\n\t\t[ NotEqualCompare ]: _gl.NOTEQUAL\n\t};\n\n\tfunction setTextureParameters( textureType, texture ) {\n\n\t\tif ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false &&\n\t\t\t( texture.magFilter === LinearFilter || texture.magFilter === LinearMipmapNearestFilter || texture.magFilter === NearestMipmapLinearFilter || texture.magFilter === LinearMipmapLinearFilter ||\n\t\t\ttexture.minFilter === LinearFilter || texture.minFilter === LinearMipmapNearestFilter || texture.minFilter === NearestMipmapLinearFilter || texture.minFilter === LinearMipmapLinearFilter ) ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.' );\n\n\t\t}\n\n\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, wrappingToGL[ texture.wrapS ] );\n\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, wrappingToGL[ texture.wrapT ] );\n\n\t\tif ( textureType === _gl.TEXTURE_3D || textureType === _gl.TEXTURE_2D_ARRAY ) {\n\n\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_R, wrappingToGL[ texture.wrapR ] );\n\n\t\t}\n\n\t\t_gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, filterToGL[ texture.magFilter ] );\n\t\t_gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, filterToGL[ texture.minFilter ] );\n\n\t\tif ( texture.compareFunction ) {\n\n\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_MODE, _gl.COMPARE_REF_TO_TEXTURE );\n\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_FUNC, compareToGL[ texture.compareFunction ] );\n\n\t\t}\n\n\t\tif ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {\n\n\t\t\tif ( texture.magFilter === NearestFilter ) return;\n\t\t\tif ( texture.minFilter !== NearestMipmapLinearFilter && texture.minFilter !== LinearMipmapLinearFilter ) return;\n\t\t\tif ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false ) return; // verify extension\n\n\t\t\tif ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) {\n\n\t\t\t\tconst extension = extensions.get( 'EXT_texture_filter_anisotropic' );\n\t\t\t\t_gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) );\n\t\t\t\tproperties.get( texture ).__currentAnisotropy = texture.anisotropy;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction initTexture( textureProperties, texture ) {\n\n\t\tlet forceUpload = false;\n\n\t\tif ( textureProperties.__webglInit === undefined ) {\n\n\t\t\ttextureProperties.__webglInit = true;\n\n\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t}\n\n\t\t// create Source <-> WebGLTextures mapping if necessary\n\n\t\tconst source = texture.source;\n\t\tlet webglTextures = _sources.get( source );\n\n\t\tif ( webglTextures === undefined ) {\n\n\t\t\twebglTextures = {};\n\t\t\t_sources.set( source, webglTextures );\n\n\t\t}\n\n\t\t// check if there is already a WebGLTexture object for the given texture parameters\n\n\t\tconst textureCacheKey = getTextureCacheKey( texture );\n\n\t\tif ( textureCacheKey !== textureProperties.__cacheKey ) {\n\n\t\t\t// if not, create a new instance of WebGLTexture\n\n\t\t\tif ( webglTextures[ textureCacheKey ] === undefined ) {\n\n\t\t\t\t// create new entry\n\n\t\t\t\twebglTextures[ textureCacheKey ] = {\n\t\t\t\t\ttexture: _gl.createTexture(),\n\t\t\t\t\tusedTimes: 0\n\t\t\t\t};\n\n\t\t\t\tinfo.memory.textures ++;\n\n\t\t\t\t// when a new instance of WebGLTexture was created, a texture upload is required\n\t\t\t\t// even if the image contents are identical\n\n\t\t\t\tforceUpload = true;\n\n\t\t\t}\n\n\t\t\twebglTextures[ textureCacheKey ].usedTimes ++;\n\n\t\t\t// every time the texture cache key changes, it's necessary to check if an instance of\n\t\t\t// WebGLTexture can be deleted in order to avoid a memory leak.\n\n\t\t\tconst webglTexture = webglTextures[ textureProperties.__cacheKey ];\n\n\t\t\tif ( webglTexture !== undefined ) {\n\n\t\t\t\twebglTextures[ textureProperties.__cacheKey ].usedTimes --;\n\n\t\t\t\tif ( webglTexture.usedTimes === 0 ) {\n\n\t\t\t\t\tdeleteTexture( texture );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// store references to cache key and WebGLTexture object\n\n\t\t\ttextureProperties.__cacheKey = textureCacheKey;\n\t\t\ttextureProperties.__webglTexture = webglTextures[ textureCacheKey ].texture;\n\n\t\t}\n\n\t\treturn forceUpload;\n\n\t}\n\n\tfunction uploadTexture( textureProperties, texture, slot ) {\n\n\t\tlet textureType = _gl.TEXTURE_2D;\n\n\t\tif ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) textureType = _gl.TEXTURE_2D_ARRAY;\n\t\tif ( texture.isData3DTexture ) textureType = _gl.TEXTURE_3D;\n\n\t\tconst forceUpload = initTexture( textureProperties, texture );\n\t\tconst source = texture.source;\n\n\t\tstate.bindTexture( textureType, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t\tconst sourceProperties = properties.get( source );\n\n\t\tif ( source.version !== sourceProperties.__version || forceUpload === true ) {\n\n\t\t\tstate.activeTexture( _gl.TEXTURE0 + slot );\n\n\t\t\tconst workingPrimaries = ColorManagement.getPrimaries( ColorManagement.workingColorSpace );\n\t\t\tconst texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries( texture.colorSpace );\n\t\t\tconst unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL;\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion );\n\n\t\t\tlet image = resizeImage( texture.image, false, capabilities.maxTextureSize );\n\t\t\timage = verifyColorSpace( texture, image );\n\n\t\t\tconst glFormat = utils.convert( texture.format, texture.colorSpace );\n\n\t\t\tconst glType = utils.convert( texture.type );\n\t\t\tlet glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture );\n\n\t\t\tsetTextureParameters( textureType, texture );\n\n\t\t\tlet mipmap;\n\t\t\tconst mipmaps = texture.mipmaps;\n\n\t\t\tconst useTexStorage = ( texture.isVideoTexture !== true );\n\t\t\tconst allocateMemory = ( sourceProperties.__version === undefined ) || ( forceUpload === true );\n\t\t\tconst dataReady = source.dataReady;\n\t\t\tconst levels = getMipLevels( texture, image );\n\n\t\t\tif ( texture.isDepthTexture ) {\n\n\t\t\t\tglInternalFormat = getInternalDepthFormat( texture.format === DepthStencilFormat, texture.type );\n\n\t\t\t\t//\n\n\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, 1, glInternalFormat, image.width, image.height );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isDataTexture ) {\n\n\t\t\t\t// use manually created mipmaps if available\n\t\t\t\t// if there are no manual mipmaps\n\t\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\n\t\t\t\tif ( mipmaps.length > 0 ) {\n\n\t\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.generateMipmaps = false;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, image.width, image.height, glFormat, glType, image.data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isCompressedTexture ) {\n\n\t\t\t\tif ( texture.isCompressedArrayTexture ) {\n\n\t\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage3D( _gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height, image.depth );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\t\tif ( texture.format !== RGBAFormat ) {\n\n\t\t\t\t\t\t\tif ( glFormat !== null ) {\n\n\t\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\t\tif ( texture.layerUpdates.size > 0 ) {\n\n\t\t\t\t\t\t\t\t\t\t\tconst layerByteLength = getByteLength( mipmap.width, mipmap.height, texture.format, texture.type );\n\n\t\t\t\t\t\t\t\t\t\t\tfor ( const layerIndex of texture.layerUpdates ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\tconst layerData = mipmap.data.subarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\tlayerIndex * layerByteLength / mipmap.data.BYTES_PER_ELEMENT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t( layerIndex + 1 ) * layerByteLength / mipmap.data.BYTES_PER_ELEMENT\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\tstate.compressedTexSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, layerIndex, mipmap.width, mipmap.height, 1, glFormat, layerData );\n\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\ttexture.clearLayerUpdates();\n\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\tstate.compressedTexSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, mipmap.data );\n\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tstate.compressedTexImage3D( _gl.TEXTURE_2D_ARRAY, i, glInternalFormat, mipmap.width, mipmap.height, image.depth, 0, mipmap.data, 0, 0 );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage3D( _gl.TEXTURE_2D_ARRAY, i, glInternalFormat, mipmap.width, mipmap.height, image.depth, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\t\tif ( texture.format !== RGBAFormat ) {\n\n\t\t\t\t\t\t\tif ( glFormat !== null ) {\n\n\t\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\t\tstate.compressedTexSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tstate.compressedTexImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isDataArrayTexture ) {\n\n\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage3D( _gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, image.width, image.height, image.depth );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\tif ( texture.layerUpdates.size > 0 ) {\n\n\t\t\t\t\t\t\tconst layerByteLength = getByteLength( image.width, image.height, texture.format, texture.type );\n\n\t\t\t\t\t\t\tfor ( const layerIndex of texture.layerUpdates ) {\n\n\t\t\t\t\t\t\t\tconst layerData = image.data.subarray(\n\t\t\t\t\t\t\t\t\tlayerIndex * layerByteLength / image.data.BYTES_PER_ELEMENT,\n\t\t\t\t\t\t\t\t\t( layerIndex + 1 ) * layerByteLength / image.data.BYTES_PER_ELEMENT\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tstate.texSubImage3D( _gl.TEXTURE_2D_ARRAY, 0, 0, 0, layerIndex, image.width, image.height, 1, glFormat, glType, layerData );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttexture.clearLayerUpdates();\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texSubImage3D( _gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.texImage3D( _gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data );\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isData3DTexture ) {\n\n\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage3D( _gl.TEXTURE_3D, levels, glInternalFormat, image.width, image.height, image.depth );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\tstate.texSubImage3D( _gl.TEXTURE_3D, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.texImage3D( _gl.TEXTURE_3D, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data );\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isFramebufferTexture ) {\n\n\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tlet width = image.width, height = image.height;\n\n\t\t\t\t\t\tfor ( let i = 0; i < levels; i ++ ) {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, width, height, 0, glFormat, glType, null );\n\n\t\t\t\t\t\t\twidth >>= 1;\n\t\t\t\t\t\t\theight >>= 1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// regular Texture (image, video, canvas)\n\n\t\t\t\t// use manually created mipmaps if available\n\t\t\t\t// if there are no manual mipmaps\n\t\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\n\t\t\t\tif ( mipmaps.length > 0 ) {\n\n\t\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t\tconst dimensions = getDimensions( mipmaps[ 0 ] );\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, glFormat, glType, mipmap );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, glFormat, glType, mipmap );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.generateMipmaps = false;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\t\tconst dimensions = getDimensions( image );\n\n\t\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, glFormat, glType, image );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, glFormat, glType, image );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\tgenerateMipmap( textureType );\n\n\t\t\t}\n\n\t\t\tsourceProperties.__version = source.version;\n\n\t\t\tif ( texture.onUpdate ) texture.onUpdate( texture );\n\n\t\t}\n\n\t\ttextureProperties.__version = texture.version;\n\n\t}\n\n\tfunction uploadCubeTexture( textureProperties, texture, slot ) {\n\n\t\tif ( texture.image.length !== 6 ) return;\n\n\t\tconst forceUpload = initTexture( textureProperties, texture );\n\t\tconst source = texture.source;\n\n\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t\tconst sourceProperties = properties.get( source );\n\n\t\tif ( source.version !== sourceProperties.__version || forceUpload === true ) {\n\n\t\t\tstate.activeTexture( _gl.TEXTURE0 + slot );\n\n\t\t\tconst workingPrimaries = ColorManagement.getPrimaries( ColorManagement.workingColorSpace );\n\t\t\tconst texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries( texture.colorSpace );\n\t\t\tconst unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL;\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion );\n\n\t\t\tconst isCompressed = ( texture.isCompressedTexture || texture.image[ 0 ].isCompressedTexture );\n\t\t\tconst isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture );\n\n\t\t\tconst cubeImage = [];\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( ! isCompressed && ! isDataTexture ) {\n\n\t\t\t\t\tcubeImage[ i ] = resizeImage( texture.image[ i ], true, capabilities.maxCubemapSize );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tcubeImage[ i ] = isDataTexture ? texture.image[ i ].image : texture.image[ i ];\n\n\t\t\t\t}\n\n\t\t\t\tcubeImage[ i ] = verifyColorSpace( texture, cubeImage[ i ] );\n\n\t\t\t}\n\n\t\t\tconst image = cubeImage[ 0 ],\n\t\t\t\tglFormat = utils.convert( texture.format, texture.colorSpace ),\n\t\t\t\tglType = utils.convert( texture.type ),\n\t\t\t\tglInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );\n\n\t\t\tconst useTexStorage = ( texture.isVideoTexture !== true );\n\t\t\tconst allocateMemory = ( sourceProperties.__version === undefined ) || ( forceUpload === true );\n\t\t\tconst dataReady = source.dataReady;\n\t\t\tlet levels = getMipLevels( texture, image );\n\n\t\t\tsetTextureParameters( _gl.TEXTURE_CUBE_MAP, texture );\n\n\t\t\tlet mipmaps;\n\n\t\t\tif ( isCompressed ) {\n\n\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tmipmaps = cubeImage[ i ].mipmaps;\n\n\t\t\t\t\tfor ( let j = 0; j < mipmaps.length; j ++ ) {\n\n\t\t\t\t\t\tconst mipmap = mipmaps[ j ];\n\n\t\t\t\t\t\tif ( texture.format !== RGBAFormat ) {\n\n\t\t\t\t\t\t\tif ( glFormat !== null ) {\n\n\t\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\t\tstate.compressedTexSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tstate.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()' );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tmipmaps = texture.mipmaps;\n\n\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t// TODO: Uniformly handle mipmap definitions\n\t\t\t\t\t// Normal textures and compressed cube textures define base level + mips with their mipmap array\n\t\t\t\t\t// Uncompressed cube textures use their mipmap array only for mips (no base level)\n\n\t\t\t\t\tif ( mipmaps.length > 0 ) levels ++;\n\n\t\t\t\t\tconst dimensions = getDimensions( cubeImage[ 0 ] );\n\n\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, dimensions.width, dimensions.height );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tif ( isDataTexture ) {\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, cubeImage[ i ].width, cubeImage[ i ].height, glFormat, glType, cubeImage[ i ].data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ( let j = 0; j < mipmaps.length; j ++ ) {\n\n\t\t\t\t\t\t\tconst mipmap = mipmaps[ j ];\n\t\t\t\t\t\t\tconst mipmapImage = mipmap.image[ i ].image;\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, mipmapImage.width, mipmapImage.height, glFormat, glType, mipmapImage.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, mipmapImage.width, mipmapImage.height, 0, glFormat, glType, mipmapImage.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, glFormat, glType, cubeImage[ i ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, glFormat, glType, cubeImage[ i ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ( let j = 0; j < mipmaps.length; j ++ ) {\n\n\t\t\t\t\t\t\tconst mipmap = mipmaps[ j ];\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, glFormat, glType, mipmap.image[ i ] );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, glFormat, glType, mipmap.image[ i ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\t// We assume images for cube map have the same size.\n\t\t\t\tgenerateMipmap( _gl.TEXTURE_CUBE_MAP );\n\n\t\t\t}\n\n\t\t\tsourceProperties.__version = source.version;\n\n\t\t\tif ( texture.onUpdate ) texture.onUpdate( texture );\n\n\t\t}\n\n\t\ttextureProperties.__version = texture.version;\n\n\t}\n\n\t// Render targets\n\n\t// Setup storage for target texture and bind it to correct framebuffer\n\tfunction setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget, level ) {\n\n\t\tconst glFormat = utils.convert( texture.format, texture.colorSpace );\n\t\tconst glType = utils.convert( texture.type );\n\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst textureProperties = properties.get( texture );\n\n\t\ttextureProperties.__renderTarget = renderTarget;\n\n\t\tif ( ! renderTargetProperties.__hasExternalTextures ) {\n\n\t\t\tconst width = Math.max( 1, renderTarget.width >> level );\n\t\t\tconst height = Math.max( 1, renderTarget.height >> level );\n\n\t\t\tif ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) {\n\n\t\t\t\tstate.texImage3D( textureTarget, level, glInternalFormat, width, height, renderTarget.depth, 0, glFormat, glType, null );\n\n\t\t\t} else {\n\n\t\t\t\tstate.texImage2D( textureTarget, level, glInternalFormat, width, height, 0, glFormat, glType, null );\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\tif ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\tmultisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, 0, getRenderTargetSamples( renderTarget ) );\n\n\t\t} else if ( textureTarget === _gl.TEXTURE_2D || ( textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ) ) { // see #24753\n\n\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, level );\n\n\t\t}\n\n\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}\n\n\t// Setup storage for internal depth/stencil buffers and bind to correct framebuffer\n\tfunction setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) {\n\n\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );\n\n\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t// retrieve the depth attachment types\n\t\t\tconst depthTexture = renderTarget.depthTexture;\n\t\t\tconst depthType = depthTexture && depthTexture.isDepthTexture ? depthTexture.type : null;\n\t\t\tconst glInternalFormat = getInternalDepthFormat( renderTarget.stencilBuffer, depthType );\n\t\t\tconst glAttachmentType = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;\n\n\t\t\t// set up the attachment\n\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\t\t\tconst isUseMultisampledRTT = useMultisampledRTT( renderTarget );\n\t\t\tif ( isUseMultisampledRTT ) {\n\n\t\t\t\tmultisampledRTTExt.renderbufferStorageMultisampleEXT( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else if ( isMultisample ) {\n\n\t\t\t\t_gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, glAttachmentType, _gl.RENDERBUFFER, renderbuffer );\n\n\t\t} else {\n\n\t\t\tconst textures = renderTarget.textures;\n\n\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\tconst texture = textures[ i ];\n\n\t\t\t\tconst glFormat = utils.convert( texture.format, texture.colorSpace );\n\t\t\t\tconst glType = utils.convert( texture.type );\n\t\t\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );\n\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\tif ( isMultisample && useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t} else if ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\t\t\tmultisampledRTTExt.renderbufferStorageMultisampleEXT( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, null );\n\n\t}\n\n\t// Setup resources for a Depth Texture for a FBO (needs an extension)\n\tfunction setupDepthTexture( framebuffer, renderTarget ) {\n\n\t\tconst isCube = ( renderTarget && renderTarget.isWebGLCubeRenderTarget );\n\t\tif ( isCube ) throw new Error( 'Depth Texture with cube render targets is not supported' );\n\n\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\tif ( ! ( renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture ) ) {\n\n\t\t\tthrow new Error( 'renderTarget.depthTexture must be an instance of THREE.DepthTexture' );\n\n\t\t}\n\n\t\tconst textureProperties = properties.get( renderTarget.depthTexture );\n\t\ttextureProperties.__renderTarget = renderTarget;\n\n\t\t// upload an empty depth texture with framebuffer size\n\t\tif ( ! textureProperties.__webglTexture ||\n\t\t\t\trenderTarget.depthTexture.image.width !== renderTarget.width ||\n\t\t\t\trenderTarget.depthTexture.image.height !== renderTarget.height ) {\n\n\t\t\trenderTarget.depthTexture.image.width = renderTarget.width;\n\t\t\trenderTarget.depthTexture.image.height = renderTarget.height;\n\t\t\trenderTarget.depthTexture.needsUpdate = true;\n\n\t\t}\n\n\t\tsetTexture2D( renderTarget.depthTexture, 0 );\n\n\t\tconst webglDepthTexture = textureProperties.__webglTexture;\n\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\tif ( renderTarget.depthTexture.format === DepthFormat ) {\n\n\t\t\tif ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\t\tmultisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );\n\n\t\t\t}\n\n\t\t} else if ( renderTarget.depthTexture.format === DepthStencilFormat ) {\n\n\t\t\tif ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\t\tmultisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'Unknown depthTexture format' );\n\n\t\t}\n\n\t}\n\n\t// Setup GL resources for a non-texture depth buffer\n\tfunction setupDepthRenderbuffer( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n\t\t// if the bound depth texture has changed\n\t\tif ( renderTargetProperties.__boundDepthTexture !== renderTarget.depthTexture ) {\n\n\t\t\t// fire the dispose event to get rid of stored state associated with the previously bound depth buffer\n\t\t\tconst depthTexture = renderTarget.depthTexture;\n\t\t\tif ( renderTargetProperties.__depthDisposeCallback ) {\n\n\t\t\t\trenderTargetProperties.__depthDisposeCallback();\n\n\t\t\t}\n\n\t\t\t// set up dispose listeners to track when the currently attached buffer is implicitly unbound\n\t\t\tif ( depthTexture ) {\n\n\t\t\t\tconst disposeEvent = () => {\n\n\t\t\t\t\tdelete renderTargetProperties.__boundDepthTexture;\n\t\t\t\t\tdelete renderTargetProperties.__depthDisposeCallback;\n\t\t\t\t\tdepthTexture.removeEventListener( 'dispose', disposeEvent );\n\n\t\t\t\t};\n\n\t\t\t\tdepthTexture.addEventListener( 'dispose', disposeEvent );\n\t\t\t\trenderTargetProperties.__depthDisposeCallback = disposeEvent;\n\n\t\t\t}\n\n\t\t\trenderTargetProperties.__boundDepthTexture = depthTexture;\n\n\t\t}\n\n\t\tif ( renderTarget.depthTexture && ! renderTargetProperties.__autoAllocateDepthBuffer ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\n\t\t\t\t\tif ( renderTargetProperties.__webglDepthbuffer[ i ] === undefined ) {\n\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// attach buffer if it's been created already\n\t\t\t\t\t\tconst glAttachmentType = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;\n\t\t\t\t\t\tconst renderbuffer = renderTargetProperties.__webglDepthbuffer[ i ];\n\t\t\t\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, glAttachmentType, _gl.RENDERBUFFER, renderbuffer );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\n\t\t\t\tif ( renderTargetProperties.__webglDepthbuffer === undefined ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// attach buffer if it's been created already\n\t\t\t\t\tconst glAttachmentType = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;\n\t\t\t\t\tconst renderbuffer = renderTargetProperties.__webglDepthbuffer;\n\t\t\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );\n\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, glAttachmentType, _gl.RENDERBUFFER, renderbuffer );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}\n\n\t// rebind framebuffer with external textures\n\tfunction rebindTextures( renderTarget, colorTexture, depthTexture ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\tif ( colorTexture !== undefined ) {\n\n\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, 0 );\n\n\t\t}\n\n\t\tif ( depthTexture !== undefined ) {\n\n\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t}\n\n\t}\n\n\t// Set up GL resources for the render target\n\tfunction setupRenderTarget( renderTarget ) {\n\n\t\tconst texture = renderTarget.texture;\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst textureProperties = properties.get( texture );\n\n\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\tconst textures = renderTarget.textures;\n\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\t\tconst isMultipleRenderTargets = ( textures.length > 1 );\n\n\t\tif ( ! isMultipleRenderTargets ) {\n\n\t\t\tif ( textureProperties.__webglTexture === undefined ) {\n\n\t\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t\t}\n\n\t\t\ttextureProperties.__version = texture.version;\n\t\t\tinfo.memory.textures ++;\n\n\t\t}\n\n\t\t// Setup framebuffer\n\n\t\tif ( isCube ) {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( texture.mipmaps && texture.mipmaps.length > 0 ) {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = [];\n\n\t\t\t\t\tfor ( let level = 0; level < texture.mipmaps.length; level ++ ) {\n\n\t\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ][ level ] = _gl.createFramebuffer();\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( texture.mipmaps && texture.mipmaps.length > 0 ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\t\tfor ( let level = 0; level < texture.mipmaps.length; level ++ ) {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ level ] = _gl.createFramebuffer();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t\t}\n\n\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst attachmentProperties = properties.get( textures[ i ] );\n\n\t\t\t\t\tif ( attachmentProperties.__webglTexture === undefined ) {\n\n\t\t\t\t\t\tattachmentProperties.__webglTexture = _gl.createTexture();\n\n\t\t\t\t\t\tinfo.memory.textures ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( ( renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\trenderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();\n\t\t\t\trenderTargetProperties.__webglColorRenderbuffer = [];\n\n\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\n\t\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\t\tconst texture = textures[ i ];\n\t\t\t\t\trenderTargetProperties.__webglColorRenderbuffer[ i ] = _gl.createRenderbuffer();\n\n\t\t\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t\tconst glFormat = utils.convert( texture.format, texture.colorSpace );\n\t\t\t\t\tconst glType = utils.convert( texture.type );\n\t\t\t\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, renderTarget.isXRRenderTarget === true );\n\t\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\t\t\t\t\t_gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t}\n\n\t\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, null );\n\n\t\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true );\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Setup color buffer\n\n\t\tif ( isCube ) {\n\n\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( _gl.TEXTURE_CUBE_MAP, texture );\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( texture.mipmaps && texture.mipmaps.length > 0 ) {\n\n\t\t\t\t\tfor ( let level = 0; level < texture.mipmaps.length; level ++ ) {\n\n\t\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ][ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, level );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\tgenerateMipmap( _gl.TEXTURE_CUBE_MAP );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t} else if ( isMultipleRenderTargets ) {\n\n\t\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\t\tconst attachment = textures[ i ];\n\t\t\t\tconst attachmentProperties = properties.get( attachment );\n\n\t\t\t\tstate.bindTexture( _gl.TEXTURE_2D, attachmentProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( _gl.TEXTURE_2D, attachment );\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, 0 );\n\n\t\t\t\tif ( textureNeedsGenerateMipmaps( attachment ) ) {\n\n\t\t\t\t\tgenerateMipmap( _gl.TEXTURE_2D );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t} else {\n\n\t\t\tlet glTextureType = _gl.TEXTURE_2D;\n\n\t\t\tif ( renderTarget.isWebGL3DRenderTarget || renderTarget.isWebGLArrayRenderTarget ) {\n\n\t\t\t\tglTextureType = renderTarget.isWebGL3DRenderTarget ? _gl.TEXTURE_3D : _gl.TEXTURE_2D_ARRAY;\n\n\t\t\t}\n\n\t\t\tstate.bindTexture( glTextureType, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( glTextureType, texture );\n\n\t\t\tif ( texture.mipmaps && texture.mipmaps.length > 0 ) {\n\n\t\t\t\tfor ( let level = 0; level < texture.mipmaps.length; level ++ ) {\n\n\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, level );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, 0 );\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\tgenerateMipmap( glTextureType );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t}\n\n\t\t// Setup depth and stencil buffers\n\n\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t}\n\n\t}\n\n\tfunction updateRenderTargetMipmap( renderTarget ) {\n\n\t\tconst textures = renderTarget.textures;\n\n\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\tconst texture = textures[ i ];\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\tconst targetType = getTargetType( renderTarget );\n\t\t\t\tconst webglTexture = properties.get( texture ).__webglTexture;\n\n\t\t\t\tstate.bindTexture( targetType, webglTexture );\n\t\t\t\tgenerateMipmap( targetType );\n\t\t\t\tstate.unbindTexture();\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tconst invalidationArrayRead = [];\n\tconst invalidationArrayDraw = [];\n\n\tfunction updateMultisampleRenderTarget( renderTarget ) {\n\n\t\tif ( renderTarget.samples > 0 ) {\n\n\t\t\tif ( useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\tconst textures = renderTarget.textures;\n\t\t\t\tconst width = renderTarget.width;\n\t\t\t\tconst height = renderTarget.height;\n\t\t\t\tlet mask = _gl.COLOR_BUFFER_BIT;\n\t\t\t\tconst depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;\n\t\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\t\t\tconst isMultipleRenderTargets = ( textures.length > 1 );\n\n\t\t\t\t// If MRT we need to remove FBO attachments\n\t\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, null );\n\n\t\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\t\t_gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, null, 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.READ_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\n\t\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\t\tif ( renderTarget.resolveDepthBuffer ) {\n\n\t\t\t\t\t\tif ( renderTarget.depthBuffer ) mask |= _gl.DEPTH_BUFFER_BIT;\n\n\t\t\t\t\t\t// resolving stencil is slow with a D3D backend. disable it for all transmission render targets (see #27799)\n\n\t\t\t\t\t\tif ( renderTarget.stencilBuffer && renderTarget.resolveStencilBuffer ) mask |= _gl.STENCIL_BUFFER_BIT;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.READ_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t\t\tconst webglTexture = properties.get( textures[ i ] ).__webglTexture;\n\t\t\t\t\t\t_gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, webglTexture, 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_gl.blitFramebuffer( 0, 0, width, height, 0, 0, width, height, mask, _gl.NEAREST );\n\n\t\t\t\t\tif ( supportsInvalidateFramebuffer === true ) {\n\n\t\t\t\t\t\tinvalidationArrayRead.length = 0;\n\t\t\t\t\t\tinvalidationArrayDraw.length = 0;\n\n\t\t\t\t\t\tinvalidationArrayRead.push( _gl.COLOR_ATTACHMENT0 + i );\n\n\t\t\t\t\t\tif ( renderTarget.depthBuffer && renderTarget.resolveDepthBuffer === false ) {\n\n\t\t\t\t\t\t\tinvalidationArrayRead.push( depthStyle );\n\t\t\t\t\t\t\tinvalidationArrayDraw.push( depthStyle );\n\n\t\t\t\t\t\t\t_gl.invalidateFramebuffer( _gl.DRAW_FRAMEBUFFER, invalidationArrayDraw );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_gl.invalidateFramebuffer( _gl.READ_FRAMEBUFFER, invalidationArrayRead );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.READ_FRAMEBUFFER, null );\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, null );\n\n\t\t\t\t// If MRT since pre-blit we removed the FBO we need to reconstruct the attachments\n\t\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t\t\tconst webglTexture = properties.get( textures[ i ] ).__webglTexture;\n\n\t\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\t\t_gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, webglTexture, 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\n\t\t\t} else {\n\n\t\t\t\tif ( renderTarget.depthBuffer && renderTarget.resolveDepthBuffer === false && supportsInvalidateFramebuffer ) {\n\n\t\t\t\t\tconst depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;\n\n\t\t\t\t\t_gl.invalidateFramebuffer( _gl.DRAW_FRAMEBUFFER, [ depthStyle ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction getRenderTargetSamples( renderTarget ) {\n\n\t\treturn Math.min( capabilities.maxSamples, renderTarget.samples );\n\n\t}\n\n\tfunction useMultisampledRTT( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\treturn renderTarget.samples > 0 && extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true && renderTargetProperties.__useRenderToTexture !== false;\n\n\t}\n\n\tfunction updateVideoTexture( texture ) {\n\n\t\tconst frame = info.render.frame;\n\n\t\t// Check the last frame we updated the VideoTexture\n\n\t\tif ( _videoTextures.get( texture ) !== frame ) {\n\n\t\t\t_videoTextures.set( texture, frame );\n\t\t\ttexture.update();\n\n\t\t}\n\n\t}\n\n\tfunction verifyColorSpace( texture, image ) {\n\n\t\tconst colorSpace = texture.colorSpace;\n\t\tconst format = texture.format;\n\t\tconst type = texture.type;\n\n\t\tif ( texture.isCompressedTexture === true || texture.isVideoTexture === true ) return image;\n\n\t\tif ( colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace ) {\n\n\t\t\t// sRGB\n\n\t\t\tif ( ColorManagement.getTransfer( colorSpace ) === SRGBTransfer ) {\n\n\t\t\t\t// in WebGL 2 uncompressed textures can only be sRGB encoded if they have the RGBA8 format\n\n\t\t\t\tif ( format !== RGBAFormat || type !== UnsignedByteType ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.' );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( 'THREE.WebGLTextures: Unsupported texture color space:', colorSpace );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn image;\n\n\t}\n\n\tfunction getDimensions( image ) {\n\n\t\tif ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) {\n\n\t\t\t// if intrinsic data are not available, fallback to width/height\n\n\t\t\t_imageDimensions.width = image.naturalWidth || image.width;\n\t\t\t_imageDimensions.height = image.naturalHeight || image.height;\n\n\t\t} else if ( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) {\n\n\t\t\t_imageDimensions.width = image.displayWidth;\n\t\t\t_imageDimensions.height = image.displayHeight;\n\n\t\t} else {\n\n\t\t\t_imageDimensions.width = image.width;\n\t\t\t_imageDimensions.height = image.height;\n\n\t\t}\n\n\t\treturn _imageDimensions;\n\n\t}\n\n\t//\n\n\tthis.allocateTextureUnit = allocateTextureUnit;\n\tthis.resetTextureUnits = resetTextureUnits;\n\n\tthis.setTexture2D = setTexture2D;\n\tthis.setTexture2DArray = setTexture2DArray;\n\tthis.setTexture3D = setTexture3D;\n\tthis.setTextureCube = setTextureCube;\n\tthis.rebindTextures = rebindTextures;\n\tthis.setupRenderTarget = setupRenderTarget;\n\tthis.updateRenderTargetMipmap = updateRenderTargetMipmap;\n\tthis.updateMultisampleRenderTarget = updateMultisampleRenderTarget;\n\tthis.setupDepthRenderbuffer = setupDepthRenderbuffer;\n\tthis.setupFrameBufferTexture = setupFrameBufferTexture;\n\tthis.useMultisampledRTT = useMultisampledRTT;\n\n}\n\nfunction WebGLUtils( gl, extensions ) {\n\n\tfunction convert( p, colorSpace = NoColorSpace ) {\n\n\t\tlet extension;\n\n\t\tconst transfer = ColorManagement.getTransfer( colorSpace );\n\n\t\tif ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE;\n\t\tif ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4;\n\t\tif ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1;\n\t\tif ( p === UnsignedInt5999Type ) return gl.UNSIGNED_INT_5_9_9_9_REV;\n\n\t\tif ( p === ByteType ) return gl.BYTE;\n\t\tif ( p === ShortType ) return gl.SHORT;\n\t\tif ( p === UnsignedShortType ) return gl.UNSIGNED_SHORT;\n\t\tif ( p === IntType ) return gl.INT;\n\t\tif ( p === UnsignedIntType ) return gl.UNSIGNED_INT;\n\t\tif ( p === FloatType ) return gl.FLOAT;\n\t\tif ( p === HalfFloatType ) return gl.HALF_FLOAT;\n\n\t\tif ( p === AlphaFormat ) return gl.ALPHA;\n\t\tif ( p === RGBFormat ) return gl.RGB;\n\t\tif ( p === RGBAFormat ) return gl.RGBA;\n\t\tif ( p === LuminanceFormat ) return gl.LUMINANCE;\n\t\tif ( p === LuminanceAlphaFormat ) return gl.LUMINANCE_ALPHA;\n\t\tif ( p === DepthFormat ) return gl.DEPTH_COMPONENT;\n\t\tif ( p === DepthStencilFormat ) return gl.DEPTH_STENCIL;\n\n\t\t// WebGL2 formats.\n\n\t\tif ( p === RedFormat ) return gl.RED;\n\t\tif ( p === RedIntegerFormat ) return gl.RED_INTEGER;\n\t\tif ( p === RGFormat ) return gl.RG;\n\t\tif ( p === RGIntegerFormat ) return gl.RG_INTEGER;\n\t\tif ( p === RGBAIntegerFormat ) return gl.RGBA_INTEGER;\n\n\t\t// S3TC\n\n\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\tif ( transfer === SRGBTransfer ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_SRGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// PVRTC\n\n\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ETC\n\n\t\tif ( p === RGB_ETC1_Format || p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_ETC1_Format || p === RGB_ETC2_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2;\n\t\t\t\tif ( p === RGBA_ETC2_EAC_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ASTC\n\n\t\tif ( p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format ||\n\t\t\tp === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format ||\n\t\t\tp === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format ||\n\t\t\tp === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format ||\n\t\t\tp === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_astc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGBA_ASTC_4x4_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_5x4_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_5x5_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_6x5_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_6x6_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_8x5_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_8x6_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_8x8_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x5_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x6_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x8_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x10_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_12x10_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_12x12_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// BPTC\n\n\t\tif ( p === RGBA_BPTC_Format || p === RGB_BPTC_SIGNED_Format || p === RGB_BPTC_UNSIGNED_Format ) {\n\n\t\t\textension = extensions.get( 'EXT_texture_compression_bptc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGBA_BPTC_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT;\n\t\t\t\tif ( p === RGB_BPTC_SIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;\n\t\t\t\tif ( p === RGB_BPTC_UNSIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// RGTC\n\n\t\tif ( p === RED_RGTC1_Format || p === SIGNED_RED_RGTC1_Format || p === RED_GREEN_RGTC2_Format || p === SIGNED_RED_GREEN_RGTC2_Format ) {\n\n\t\t\textension = extensions.get( 'EXT_texture_compression_rgtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGBA_BPTC_Format ) return extension.COMPRESSED_RED_RGTC1_EXT;\n\t\t\t\tif ( p === SIGNED_RED_RGTC1_Format ) return extension.COMPRESSED_SIGNED_RED_RGTC1_EXT;\n\t\t\t\tif ( p === RED_GREEN_RGTC2_Format ) return extension.COMPRESSED_RED_GREEN_RGTC2_EXT;\n\t\t\t\tif ( p === SIGNED_RED_GREEN_RGTC2_Format ) return extension.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( p === UnsignedInt248Type ) return gl.UNSIGNED_INT_24_8;\n\n\t\t// if \"p\" can't be resolved, assume the user defines a WebGL constant as a string (fallback/workaround for packed RGB formats)\n\n\t\treturn ( gl[ p ] !== undefined ) ? gl[ p ] : null;\n\n\t}\n\n\treturn { convert: convert };\n\n}\n\nclass ArrayCamera extends PerspectiveCamera {\n\n\tconstructor( array = [] ) {\n\n\t\tsuper();\n\n\t\tthis.isArrayCamera = true;\n\n\t\tthis.cameras = array;\n\n\t}\n\n}\n\nclass Group extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isGroup = true;\n\n\t\tthis.type = 'Group';\n\n\t}\n\n}\n\nconst _moveEvent = { type: 'move' };\n\nclass WebXRController {\n\n\tconstructor() {\n\n\t\tthis._targetRay = null;\n\t\tthis._grip = null;\n\t\tthis._hand = null;\n\n\t}\n\n\tgetHandSpace() {\n\n\t\tif ( this._hand === null ) {\n\n\t\t\tthis._hand = new Group();\n\t\t\tthis._hand.matrixAutoUpdate = false;\n\t\t\tthis._hand.visible = false;\n\n\t\t\tthis._hand.joints = {};\n\t\t\tthis._hand.inputState = { pinching: false };\n\n\t\t}\n\n\t\treturn this._hand;\n\n\t}\n\n\tgetTargetRaySpace() {\n\n\t\tif ( this._targetRay === null ) {\n\n\t\t\tthis._targetRay = new Group();\n\t\t\tthis._targetRay.matrixAutoUpdate = false;\n\t\t\tthis._targetRay.visible = false;\n\t\t\tthis._targetRay.hasLinearVelocity = false;\n\t\t\tthis._targetRay.linearVelocity = new Vector3();\n\t\t\tthis._targetRay.hasAngularVelocity = false;\n\t\t\tthis._targetRay.angularVelocity = new Vector3();\n\n\t\t}\n\n\t\treturn this._targetRay;\n\n\t}\n\n\tgetGripSpace() {\n\n\t\tif ( this._grip === null ) {\n\n\t\t\tthis._grip = new Group();\n\t\t\tthis._grip.matrixAutoUpdate = false;\n\t\t\tthis._grip.visible = false;\n\t\t\tthis._grip.hasLinearVelocity = false;\n\t\t\tthis._grip.linearVelocity = new Vector3();\n\t\t\tthis._grip.hasAngularVelocity = false;\n\t\t\tthis._grip.angularVelocity = new Vector3();\n\n\t\t}\n\n\t\treturn this._grip;\n\n\t}\n\n\tdispatchEvent( event ) {\n\n\t\tif ( this._targetRay !== null ) {\n\n\t\t\tthis._targetRay.dispatchEvent( event );\n\n\t\t}\n\n\t\tif ( this._grip !== null ) {\n\n\t\t\tthis._grip.dispatchEvent( event );\n\n\t\t}\n\n\t\tif ( this._hand !== null ) {\n\n\t\t\tthis._hand.dispatchEvent( event );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tconnect( inputSource ) {\n\n\t\tif ( inputSource && inputSource.hand ) {\n\n\t\t\tconst hand = this._hand;\n\n\t\t\tif ( hand ) {\n\n\t\t\t\tfor ( const inputjoint of inputSource.hand.values() ) {\n\n\t\t\t\t\t// Initialize hand with joints when connected\n\t\t\t\t\tthis._getHandJoint( hand, inputjoint );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.dispatchEvent( { type: 'connected', data: inputSource } );\n\n\t\treturn this;\n\n\t}\n\n\tdisconnect( inputSource ) {\n\n\t\tthis.dispatchEvent( { type: 'disconnected', data: inputSource } );\n\n\t\tif ( this._targetRay !== null ) {\n\n\t\t\tthis._targetRay.visible = false;\n\n\t\t}\n\n\t\tif ( this._grip !== null ) {\n\n\t\t\tthis._grip.visible = false;\n\n\t\t}\n\n\t\tif ( this._hand !== null ) {\n\n\t\t\tthis._hand.visible = false;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tupdate( inputSource, frame, referenceSpace ) {\n\n\t\tlet inputPose = null;\n\t\tlet gripPose = null;\n\t\tlet handPose = null;\n\n\t\tconst targetRay = this._targetRay;\n\t\tconst grip = this._grip;\n\t\tconst hand = this._hand;\n\n\t\tif ( inputSource && frame.session.visibilityState !== 'visible-blurred' ) {\n\n\t\t\tif ( hand && inputSource.hand ) {\n\n\t\t\t\thandPose = true;\n\n\t\t\t\tfor ( const inputjoint of inputSource.hand.values() ) {\n\n\t\t\t\t\t// Update the joints groups with the XRJoint poses\n\t\t\t\t\tconst jointPose = frame.getJointPose( inputjoint, referenceSpace );\n\n\t\t\t\t\t// The transform of this joint will be updated with the joint pose on each frame\n\t\t\t\t\tconst joint = this._getHandJoint( hand, inputjoint );\n\n\t\t\t\t\tif ( jointPose !== null ) {\n\n\t\t\t\t\t\tjoint.matrix.fromArray( jointPose.transform.matrix );\n\t\t\t\t\t\tjoint.matrix.decompose( joint.position, joint.rotation, joint.scale );\n\t\t\t\t\t\tjoint.matrixWorldNeedsUpdate = true;\n\t\t\t\t\t\tjoint.jointRadius = jointPose.radius;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tjoint.visible = jointPose !== null;\n\n\t\t\t\t}\n\n\t\t\t\t// Custom events\n\n\t\t\t\t// Check pinchz\n\t\t\t\tconst indexTip = hand.joints[ 'index-finger-tip' ];\n\t\t\t\tconst thumbTip = hand.joints[ 'thumb-tip' ];\n\t\t\t\tconst distance = indexTip.position.distanceTo( thumbTip.position );\n\n\t\t\t\tconst distanceToPinch = 0.02;\n\t\t\t\tconst threshold = 0.005;\n\n\t\t\t\tif ( hand.inputState.pinching && distance > distanceToPinch + threshold ) {\n\n\t\t\t\t\thand.inputState.pinching = false;\n\t\t\t\t\tthis.dispatchEvent( {\n\t\t\t\t\t\ttype: 'pinchend',\n\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\ttarget: this\n\t\t\t\t\t} );\n\n\t\t\t\t} else if ( ! hand.inputState.pinching && distance <= distanceToPinch - threshold ) {\n\n\t\t\t\t\thand.inputState.pinching = true;\n\t\t\t\t\tthis.dispatchEvent( {\n\t\t\t\t\t\ttype: 'pinchstart',\n\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\ttarget: this\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( grip !== null && inputSource.gripSpace ) {\n\n\t\t\t\t\tgripPose = frame.getPose( inputSource.gripSpace, referenceSpace );\n\n\t\t\t\t\tif ( gripPose !== null ) {\n\n\t\t\t\t\t\tgrip.matrix.fromArray( gripPose.transform.matrix );\n\t\t\t\t\t\tgrip.matrix.decompose( grip.position, grip.rotation, grip.scale );\n\t\t\t\t\t\tgrip.matrixWorldNeedsUpdate = true;\n\n\t\t\t\t\t\tif ( gripPose.linearVelocity ) {\n\n\t\t\t\t\t\t\tgrip.hasLinearVelocity = true;\n\t\t\t\t\t\t\tgrip.linearVelocity.copy( gripPose.linearVelocity );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tgrip.hasLinearVelocity = false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( gripPose.angularVelocity ) {\n\n\t\t\t\t\t\t\tgrip.hasAngularVelocity = true;\n\t\t\t\t\t\t\tgrip.angularVelocity.copy( gripPose.angularVelocity );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tgrip.hasAngularVelocity = false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( targetRay !== null ) {\n\n\t\t\t\tinputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );\n\n\t\t\t\t// Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it\n\t\t\t\tif ( inputPose === null && gripPose !== null ) {\n\n\t\t\t\t\tinputPose = gripPose;\n\n\t\t\t\t}\n\n\t\t\t\tif ( inputPose !== null ) {\n\n\t\t\t\t\ttargetRay.matrix.fromArray( inputPose.transform.matrix );\n\t\t\t\t\ttargetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );\n\t\t\t\t\ttargetRay.matrixWorldNeedsUpdate = true;\n\n\t\t\t\t\tif ( inputPose.linearVelocity ) {\n\n\t\t\t\t\t\ttargetRay.hasLinearVelocity = true;\n\t\t\t\t\t\ttargetRay.linearVelocity.copy( inputPose.linearVelocity );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttargetRay.hasLinearVelocity = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( inputPose.angularVelocity ) {\n\n\t\t\t\t\t\ttargetRay.hasAngularVelocity = true;\n\t\t\t\t\t\ttargetRay.angularVelocity.copy( inputPose.angularVelocity );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttargetRay.hasAngularVelocity = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.dispatchEvent( _moveEvent );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t}\n\n\t\tif ( targetRay !== null ) {\n\n\t\t\ttargetRay.visible = ( inputPose !== null );\n\n\t\t}\n\n\t\tif ( grip !== null ) {\n\n\t\t\tgrip.visible = ( gripPose !== null );\n\n\t\t}\n\n\t\tif ( hand !== null ) {\n\n\t\t\thand.visible = ( handPose !== null );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// private method\n\n\t_getHandJoint( hand, inputjoint ) {\n\n\t\tif ( hand.joints[ inputjoint.jointName ] === undefined ) {\n\n\t\t\tconst joint = new Group();\n\t\t\tjoint.matrixAutoUpdate = false;\n\t\t\tjoint.visible = false;\n\t\t\thand.joints[ inputjoint.jointName ] = joint;\n\n\t\t\thand.add( joint );\n\n\t\t}\n\n\t\treturn hand.joints[ inputjoint.jointName ];\n\n\t}\n\n}\n\nconst _occlusion_vertex = `\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}`;\n\nconst _occlusion_fragment = `\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}`;\n\nclass WebXRDepthSensing {\n\n\tconstructor() {\n\n\t\tthis.texture = null;\n\t\tthis.mesh = null;\n\n\t\tthis.depthNear = 0;\n\t\tthis.depthFar = 0;\n\n\t}\n\n\tinit( renderer, depthData, renderState ) {\n\n\t\tif ( this.texture === null ) {\n\n\t\t\tconst texture = new Texture();\n\n\t\t\tconst texProps = renderer.properties.get( texture );\n\t\t\ttexProps.__webglTexture = depthData.texture;\n\n\t\t\tif ( ( depthData.depthNear != renderState.depthNear ) || ( depthData.depthFar != renderState.depthFar ) ) {\n\n\t\t\t\tthis.depthNear = depthData.depthNear;\n\t\t\t\tthis.depthFar = depthData.depthFar;\n\n\t\t\t}\n\n\t\t\tthis.texture = texture;\n\n\t\t}\n\n\t}\n\n\tgetMesh( cameraXR ) {\n\n\t\tif ( this.texture !== null ) {\n\n\t\t\tif ( this.mesh === null ) {\n\n\t\t\t\tconst viewport = cameraXR.cameras[ 0 ].viewport;\n\t\t\t\tconst material = new ShaderMaterial( {\n\t\t\t\t\tvertexShader: _occlusion_vertex,\n\t\t\t\t\tfragmentShader: _occlusion_fragment,\n\t\t\t\t\tuniforms: {\n\t\t\t\t\t\tdepthColor: { value: this.texture },\n\t\t\t\t\t\tdepthWidth: { value: viewport.z },\n\t\t\t\t\t\tdepthHeight: { value: viewport.w }\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tthis.mesh = new Mesh( new PlaneGeometry( 20, 20 ), material );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this.mesh;\n\n\t}\n\n\treset() {\n\n\t\tthis.texture = null;\n\t\tthis.mesh = null;\n\n\t}\n\n\tgetDepthTexture() {\n\n\t\treturn this.texture;\n\n\t}\n\n}\n\nclass WebXRManager extends EventDispatcher {\n\n\tconstructor( renderer, gl ) {\n\n\t\tsuper();\n\n\t\tconst scope = this;\n\n\t\tlet session = null;\n\n\t\tlet framebufferScaleFactor = 1.0;\n\n\t\tlet referenceSpace = null;\n\t\tlet referenceSpaceType = 'local-floor';\n\t\t// Set default foveation to maximum.\n\t\tlet foveation = 1.0;\n\t\tlet customReferenceSpace = null;\n\n\t\tlet pose = null;\n\t\tlet glBinding = null;\n\t\tlet glProjLayer = null;\n\t\tlet glBaseLayer = null;\n\t\tlet xrFrame = null;\n\n\t\tconst depthSensing = new WebXRDepthSensing();\n\t\tconst attributes = gl.getContextAttributes();\n\n\t\tlet initialRenderTarget = null;\n\t\tlet newRenderTarget = null;\n\n\t\tconst controllers = [];\n\t\tconst controllerInputSources = [];\n\n\t\tconst currentSize = new Vector2();\n\t\tlet currentPixelRatio = null;\n\n\t\t//\n\n\t\tconst cameraL = new PerspectiveCamera();\n\t\tcameraL.viewport = new Vector4();\n\n\t\tconst cameraR = new PerspectiveCamera();\n\t\tcameraR.viewport = new Vector4();\n\n\t\tconst cameras = [ cameraL, cameraR ];\n\n\t\tconst cameraXR = new ArrayCamera();\n\n\t\tlet _currentDepthNear = null;\n\t\tlet _currentDepthFar = null;\n\n\t\t//\n\n\t\tthis.cameraAutoUpdate = true;\n\t\tthis.enabled = false;\n\n\t\tthis.isPresenting = false;\n\n\t\tthis.getController = function ( index ) {\n\n\t\t\tlet controller = controllers[ index ];\n\n\t\t\tif ( controller === undefined ) {\n\n\t\t\t\tcontroller = new WebXRController();\n\t\t\t\tcontrollers[ index ] = controller;\n\n\t\t\t}\n\n\t\t\treturn controller.getTargetRaySpace();\n\n\t\t};\n\n\t\tthis.getControllerGrip = function ( index ) {\n\n\t\t\tlet controller = controllers[ index ];\n\n\t\t\tif ( controller === undefined ) {\n\n\t\t\t\tcontroller = new WebXRController();\n\t\t\t\tcontrollers[ index ] = controller;\n\n\t\t\t}\n\n\t\t\treturn controller.getGripSpace();\n\n\t\t};\n\n\t\tthis.getHand = function ( index ) {\n\n\t\t\tlet controller = controllers[ index ];\n\n\t\t\tif ( controller === undefined ) {\n\n\t\t\t\tcontroller = new WebXRController();\n\t\t\t\tcontrollers[ index ] = controller;\n\n\t\t\t}\n\n\t\t\treturn controller.getHandSpace();\n\n\t\t};\n\n\t\t//\n\n\t\tfunction onSessionEvent( event ) {\n\n\t\t\tconst controllerIndex = controllerInputSources.indexOf( event.inputSource );\n\n\t\t\tif ( controllerIndex === - 1 ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tconst controller = controllers[ controllerIndex ];\n\n\t\t\tif ( controller !== undefined ) {\n\n\t\t\t\tcontroller.update( event.inputSource, event.frame, customReferenceSpace || referenceSpace );\n\t\t\t\tcontroller.dispatchEvent( { type: event.type, data: event.inputSource } );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onSessionEnd() {\n\n\t\t\tsession.removeEventListener( 'select', onSessionEvent );\n\t\t\tsession.removeEventListener( 'selectstart', onSessionEvent );\n\t\t\tsession.removeEventListener( 'selectend', onSessionEvent );\n\t\t\tsession.removeEventListener( 'squeeze', onSessionEvent );\n\t\t\tsession.removeEventListener( 'squeezestart', onSessionEvent );\n\t\t\tsession.removeEventListener( 'squeezeend', onSessionEvent );\n\t\t\tsession.removeEventListener( 'end', onSessionEnd );\n\t\t\tsession.removeEventListener( 'inputsourceschange', onInputSourcesChange );\n\n\t\t\tfor ( let i = 0; i < controllers.length; i ++ ) {\n\n\t\t\t\tconst inputSource = controllerInputSources[ i ];\n\n\t\t\t\tif ( inputSource === null ) continue;\n\n\t\t\t\tcontrollerInputSources[ i ] = null;\n\n\t\t\t\tcontrollers[ i ].disconnect( inputSource );\n\n\t\t\t}\n\n\t\t\t_currentDepthNear = null;\n\t\t\t_currentDepthFar = null;\n\n\t\t\tdepthSensing.reset();\n\n\t\t\t// restore framebuffer/rendering state\n\n\t\t\trenderer.setRenderTarget( initialRenderTarget );\n\n\t\t\tglBaseLayer = null;\n\t\t\tglProjLayer = null;\n\t\t\tglBinding = null;\n\t\t\tsession = null;\n\t\t\tnewRenderTarget = null;\n\n\t\t\t//\n\n\t\t\tanimation.stop();\n\n\t\t\tscope.isPresenting = false;\n\n\t\t\trenderer.setPixelRatio( currentPixelRatio );\n\t\t\trenderer.setSize( currentSize.width, currentSize.height, false );\n\n\t\t\tscope.dispatchEvent( { type: 'sessionend' } );\n\n\t\t}\n\n\t\tthis.setFramebufferScaleFactor = function ( value ) {\n\n\t\t\tframebufferScaleFactor = value;\n\n\t\t\tif ( scope.isPresenting === true ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebXRManager: Cannot change framebuffer scale while presenting.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.setReferenceSpaceType = function ( value ) {\n\n\t\t\treferenceSpaceType = value;\n\n\t\t\tif ( scope.isPresenting === true ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebXRManager: Cannot change reference space type while presenting.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.getReferenceSpace = function () {\n\n\t\t\treturn customReferenceSpace || referenceSpace;\n\n\t\t};\n\n\t\tthis.setReferenceSpace = function ( space ) {\n\n\t\t\tcustomReferenceSpace = space;\n\n\t\t};\n\n\t\tthis.getBaseLayer = function () {\n\n\t\t\treturn glProjLayer !== null ? glProjLayer : glBaseLayer;\n\n\t\t};\n\n\t\tthis.getBinding = function () {\n\n\t\t\treturn glBinding;\n\n\t\t};\n\n\t\tthis.getFrame = function () {\n\n\t\t\treturn xrFrame;\n\n\t\t};\n\n\t\tthis.getSession = function () {\n\n\t\t\treturn session;\n\n\t\t};\n\n\t\tthis.setSession = async function ( value ) {\n\n\t\t\tsession = value;\n\n\t\t\tif ( session !== null ) {\n\n\t\t\t\tinitialRenderTarget = renderer.getRenderTarget();\n\n\t\t\t\tsession.addEventListener( 'select', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'selectstart', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'selectend', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'squeeze', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'squeezestart', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'squeezeend', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'end', onSessionEnd );\n\t\t\t\tsession.addEventListener( 'inputsourceschange', onInputSourcesChange );\n\n\t\t\t\tif ( attributes.xrCompatible !== true ) {\n\n\t\t\t\t\tawait gl.makeXRCompatible();\n\n\t\t\t\t}\n\n\t\t\t\tcurrentPixelRatio = renderer.getPixelRatio();\n\t\t\t\trenderer.getSize( currentSize );\n\n\t\t\t\tif ( session.renderState.layers === undefined ) {\n\n\t\t\t\t\tconst layerInit = {\n\t\t\t\t\t\tantialias: attributes.antialias,\n\t\t\t\t\t\talpha: true,\n\t\t\t\t\t\tdepth: attributes.depth,\n\t\t\t\t\t\tstencil: attributes.stencil,\n\t\t\t\t\t\tframebufferScaleFactor: framebufferScaleFactor\n\t\t\t\t\t};\n\n\t\t\t\t\tglBaseLayer = new XRWebGLLayer( session, gl, layerInit );\n\n\t\t\t\t\tsession.updateRenderState( { baseLayer: glBaseLayer } );\n\n\t\t\t\t\trenderer.setPixelRatio( 1 );\n\t\t\t\t\trenderer.setSize( glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, false );\n\n\t\t\t\t\tnewRenderTarget = new WebGLRenderTarget(\n\t\t\t\t\t\tglBaseLayer.framebufferWidth,\n\t\t\t\t\t\tglBaseLayer.framebufferHeight,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tformat: RGBAFormat,\n\t\t\t\t\t\t\ttype: UnsignedByteType,\n\t\t\t\t\t\t\tcolorSpace: renderer.outputColorSpace,\n\t\t\t\t\t\t\tstencilBuffer: attributes.stencil\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t} else {\n\n\t\t\t\t\tlet depthFormat = null;\n\t\t\t\t\tlet depthType = null;\n\t\t\t\t\tlet glDepthFormat = null;\n\n\t\t\t\t\tif ( attributes.depth ) {\n\n\t\t\t\t\t\tglDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;\n\t\t\t\t\t\tdepthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;\n\t\t\t\t\t\tdepthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst projectionlayerInit = {\n\t\t\t\t\t\tcolorFormat: gl.RGBA8,\n\t\t\t\t\t\tdepthFormat: glDepthFormat,\n\t\t\t\t\t\tscaleFactor: framebufferScaleFactor\n\t\t\t\t\t};\n\n\t\t\t\t\tglBinding = new XRWebGLBinding( session, gl );\n\n\t\t\t\t\tglProjLayer = glBinding.createProjectionLayer( projectionlayerInit );\n\n\t\t\t\t\tsession.updateRenderState( { layers: [ glProjLayer ] } );\n\n\t\t\t\t\trenderer.setPixelRatio( 1 );\n\t\t\t\t\trenderer.setSize( glProjLayer.textureWidth, glProjLayer.textureHeight, false );\n\n\t\t\t\t\tnewRenderTarget = new WebGLRenderTarget(\n\t\t\t\t\t\tglProjLayer.textureWidth,\n\t\t\t\t\t\tglProjLayer.textureHeight,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tformat: RGBAFormat,\n\t\t\t\t\t\t\ttype: UnsignedByteType,\n\t\t\t\t\t\t\tdepthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),\n\t\t\t\t\t\t\tstencilBuffer: attributes.stencil,\n\t\t\t\t\t\t\tcolorSpace: renderer.outputColorSpace,\n\t\t\t\t\t\t\tsamples: attributes.antialias ? 4 : 0,\n\t\t\t\t\t\t\tresolveDepthBuffer: ( glProjLayer.ignoreDepthValues === false )\n\t\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t\tnewRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278\n\n\t\t\t\tthis.setFoveation( foveation );\n\n\t\t\t\tcustomReferenceSpace = null;\n\t\t\t\treferenceSpace = await session.requestReferenceSpace( referenceSpaceType );\n\n\t\t\t\tanimation.setContext( session );\n\t\t\t\tanimation.start();\n\n\t\t\t\tscope.isPresenting = true;\n\n\t\t\t\tscope.dispatchEvent( { type: 'sessionstart' } );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.getEnvironmentBlendMode = function () {\n\n\t\t\tif ( session !== null ) {\n\n\t\t\t\treturn session.environmentBlendMode;\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.getDepthTexture = function () {\n\n\t\t\treturn depthSensing.getDepthTexture();\n\n\t\t};\n\n\t\tfunction onInputSourcesChange( event ) {\n\n\t\t\t// Notify disconnected\n\n\t\t\tfor ( let i = 0; i < event.removed.length; i ++ ) {\n\n\t\t\t\tconst inputSource = event.removed[ i ];\n\t\t\t\tconst index = controllerInputSources.indexOf( inputSource );\n\n\t\t\t\tif ( index >= 0 ) {\n\n\t\t\t\t\tcontrollerInputSources[ index ] = null;\n\t\t\t\t\tcontrollers[ index ].disconnect( inputSource );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Notify connected\n\n\t\t\tfor ( let i = 0; i < event.added.length; i ++ ) {\n\n\t\t\t\tconst inputSource = event.added[ i ];\n\n\t\t\t\tlet controllerIndex = controllerInputSources.indexOf( inputSource );\n\n\t\t\t\tif ( controllerIndex === - 1 ) {\n\n\t\t\t\t\t// Assign input source a controller that currently has no input source\n\n\t\t\t\t\tfor ( let i = 0; i < controllers.length; i ++ ) {\n\n\t\t\t\t\t\tif ( i >= controllerInputSources.length ) {\n\n\t\t\t\t\t\t\tcontrollerInputSources.push( inputSource );\n\t\t\t\t\t\t\tcontrollerIndex = i;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t} else if ( controllerInputSources[ i ] === null ) {\n\n\t\t\t\t\t\t\tcontrollerInputSources[ i ] = inputSource;\n\t\t\t\t\t\t\tcontrollerIndex = i;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// If all controllers do currently receive input we ignore new ones\n\n\t\t\t\t\tif ( controllerIndex === - 1 ) break;\n\n\t\t\t\t}\n\n\t\t\t\tconst controller = controllers[ controllerIndex ];\n\n\t\t\t\tif ( controller ) {\n\n\t\t\t\t\tcontroller.connect( inputSource );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tconst cameraLPos = new Vector3();\n\t\tconst cameraRPos = new Vector3();\n\n\t\t/**\n\t\t * Assumes 2 cameras that are parallel and share an X-axis, and that\n\t\t * the cameras' projection and world matrices have already been set.\n\t\t * And that near and far planes are identical for both cameras.\n\t\t * Visualization of this technique: https://computergraphics.stackexchange.com/a/4765\n\t\t */\n\t\tfunction setProjectionFromUnion( camera, cameraL, cameraR ) {\n\n\t\t\tcameraLPos.setFromMatrixPosition( cameraL.matrixWorld );\n\t\t\tcameraRPos.setFromMatrixPosition( cameraR.matrixWorld );\n\n\t\t\tconst ipd = cameraLPos.distanceTo( cameraRPos );\n\n\t\t\tconst projL = cameraL.projectionMatrix.elements;\n\t\t\tconst projR = cameraR.projectionMatrix.elements;\n\n\t\t\t// VR systems will have identical far and near planes, and\n\t\t\t// most likely identical top and bottom frustum extents.\n\t\t\t// Use the left camera for these values.\n\t\t\tconst near = projL[ 14 ] / ( projL[ 10 ] - 1 );\n\t\t\tconst far = projL[ 14 ] / ( projL[ 10 ] + 1 );\n\t\t\tconst topFov = ( projL[ 9 ] + 1 ) / projL[ 5 ];\n\t\t\tconst bottomFov = ( projL[ 9 ] - 1 ) / projL[ 5 ];\n\n\t\t\tconst leftFov = ( projL[ 8 ] - 1 ) / projL[ 0 ];\n\t\t\tconst rightFov = ( projR[ 8 ] + 1 ) / projR[ 0 ];\n\t\t\tconst left = near * leftFov;\n\t\t\tconst right = near * rightFov;\n\n\t\t\t// Calculate the new camera's position offset from the\n\t\t\t// left camera. xOffset should be roughly half `ipd`.\n\t\t\tconst zOffset = ipd / ( - leftFov + rightFov );\n\t\t\tconst xOffset = zOffset * - leftFov;\n\n\t\t\t// TODO: Better way to apply this offset?\n\t\t\tcameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.translateX( xOffset );\n\t\t\tcamera.translateZ( zOffset );\n\t\t\tcamera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.matrixWorldInverse.copy( camera.matrixWorld ).invert();\n\n\t\t\t// Check if the projection uses an infinite far plane.\n\t\t\tif ( projL[ 10 ] === - 1.0 ) {\n\n\t\t\t\t// Use the projection matrix from the left eye.\n\t\t\t\t// The camera offset is sufficient to include the view volumes\n\t\t\t\t// of both eyes (assuming symmetric projections).\n\t\t\t\tcamera.projectionMatrix.copy( cameraL.projectionMatrix );\n\t\t\t\tcamera.projectionMatrixInverse.copy( cameraL.projectionMatrixInverse );\n\n\t\t\t} else {\n\n\t\t\t\t// Find the union of the frustum values of the cameras and scale\n\t\t\t\t// the values so that the near plane's position does not change in world space,\n\t\t\t\t// although must now be relative to the new union camera.\n\t\t\t\tconst near2 = near + zOffset;\n\t\t\t\tconst far2 = far + zOffset;\n\t\t\t\tconst left2 = left - xOffset;\n\t\t\t\tconst right2 = right + ( ipd - xOffset );\n\t\t\t\tconst top2 = topFov * far / far2 * near2;\n\t\t\t\tconst bottom2 = bottomFov * far / far2 * near2;\n\n\t\t\t\tcamera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );\n\t\t\t\tcamera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction updateCamera( camera, parent ) {\n\n\t\t\tif ( parent === null ) {\n\n\t\t\t\tcamera.matrixWorld.copy( camera.matrix );\n\n\t\t\t} else {\n\n\t\t\t\tcamera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );\n\n\t\t\t}\n\n\t\t\tcamera.matrixWorldInverse.copy( camera.matrixWorld ).invert();\n\n\t\t}\n\n\t\tthis.updateCamera = function ( camera ) {\n\n\t\t\tif ( session === null ) return;\n\n\t\t\tlet depthNear = camera.near;\n\t\t\tlet depthFar = camera.far;\n\n\t\t\tif ( depthSensing.texture !== null ) {\n\n\t\t\t\tif ( depthSensing.depthNear > 0 ) depthNear = depthSensing.depthNear;\n\t\t\t\tif ( depthSensing.depthFar > 0 ) depthFar = depthSensing.depthFar;\n\n\t\t\t}\n\n\t\t\tcameraXR.near = cameraR.near = cameraL.near = depthNear;\n\t\t\tcameraXR.far = cameraR.far = cameraL.far = depthFar;\n\n\t\t\tif ( _currentDepthNear !== cameraXR.near || _currentDepthFar !== cameraXR.far ) {\n\n\t\t\t\t// Note that the new renderState won't apply until the next frame. See #18320\n\n\t\t\t\tsession.updateRenderState( {\n\t\t\t\t\tdepthNear: cameraXR.near,\n\t\t\t\t\tdepthFar: cameraXR.far\n\t\t\t\t} );\n\n\t\t\t\t_currentDepthNear = cameraXR.near;\n\t\t\t\t_currentDepthFar = cameraXR.far;\n\n\t\t\t}\n\n\t\t\tcameraL.layers.mask = camera.layers.mask | 0b010;\n\t\t\tcameraR.layers.mask = camera.layers.mask | 0b100;\n\t\t\tcameraXR.layers.mask = cameraL.layers.mask | cameraR.layers.mask;\n\n\t\t\tconst parent = camera.parent;\n\t\t\tconst cameras = cameraXR.cameras;\n\n\t\t\tupdateCamera( cameraXR, parent );\n\n\t\t\tfor ( let i = 0; i < cameras.length; i ++ ) {\n\n\t\t\t\tupdateCamera( cameras[ i ], parent );\n\n\t\t\t}\n\n\t\t\t// update projection matrix for proper view frustum culling\n\n\t\t\tif ( cameras.length === 2 ) {\n\n\t\t\t\tsetProjectionFromUnion( cameraXR, cameraL, cameraR );\n\n\t\t\t} else {\n\n\t\t\t\t// assume single camera setup (AR)\n\n\t\t\t\tcameraXR.projectionMatrix.copy( cameraL.projectionMatrix );\n\n\t\t\t}\n\n\t\t\t// update user camera and its children\n\n\t\t\tupdateUserCamera( camera, cameraXR, parent );\n\n\t\t};\n\n\t\tfunction updateUserCamera( camera, cameraXR, parent ) {\n\n\t\t\tif ( parent === null ) {\n\n\t\t\t\tcamera.matrix.copy( cameraXR.matrixWorld );\n\n\t\t\t} else {\n\n\t\t\t\tcamera.matrix.copy( parent.matrixWorld );\n\t\t\t\tcamera.matrix.invert();\n\t\t\t\tcamera.matrix.multiply( cameraXR.matrixWorld );\n\n\t\t\t}\n\n\t\t\tcamera.matrix.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.updateMatrixWorld( true );\n\n\t\t\tcamera.projectionMatrix.copy( cameraXR.projectionMatrix );\n\t\t\tcamera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse );\n\n\t\t\tif ( camera.isPerspectiveCamera ) {\n\n\t\t\t\tcamera.fov = RAD2DEG * 2 * Math.atan( 1 / camera.projectionMatrix.elements[ 5 ] );\n\t\t\t\tcamera.zoom = 1;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.getCamera = function () {\n\n\t\t\treturn cameraXR;\n\n\t\t};\n\n\t\tthis.getFoveation = function () {\n\n\t\t\tif ( glProjLayer === null && glBaseLayer === null ) {\n\n\t\t\t\treturn undefined;\n\n\t\t\t}\n\n\t\t\treturn foveation;\n\n\t\t};\n\n\t\tthis.setFoveation = function ( value ) {\n\n\t\t\t// 0 = no foveation = full resolution\n\t\t\t// 1 = maximum foveation = the edges render at lower resolution\n\n\t\t\tfoveation = value;\n\n\t\t\tif ( glProjLayer !== null ) {\n\n\t\t\t\tglProjLayer.fixedFoveation = value;\n\n\t\t\t}\n\n\t\t\tif ( glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined ) {\n\n\t\t\t\tglBaseLayer.fixedFoveation = value;\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.hasDepthSensing = function () {\n\n\t\t\treturn depthSensing.texture !== null;\n\n\t\t};\n\n\t\tthis.getDepthSensingMesh = function () {\n\n\t\t\treturn depthSensing.getMesh( cameraXR );\n\n\t\t};\n\n\t\t// Animation Loop\n\n\t\tlet onAnimationFrameCallback = null;\n\n\t\tfunction onAnimationFrame( time, frame ) {\n\n\t\t\tpose = frame.getViewerPose( customReferenceSpace || referenceSpace );\n\t\t\txrFrame = frame;\n\n\t\t\tif ( pose !== null ) {\n\n\t\t\t\tconst views = pose.views;\n\n\t\t\t\tif ( glBaseLayer !== null ) {\n\n\t\t\t\t\trenderer.setRenderTargetFramebuffer( newRenderTarget, glBaseLayer.framebuffer );\n\t\t\t\t\trenderer.setRenderTarget( newRenderTarget );\n\n\t\t\t\t}\n\n\t\t\t\tlet cameraXRNeedsUpdate = false;\n\n\t\t\t\t// check if it's necessary to rebuild cameraXR's camera list\n\n\t\t\t\tif ( views.length !== cameraXR.cameras.length ) {\n\n\t\t\t\t\tcameraXR.cameras.length = 0;\n\t\t\t\t\tcameraXRNeedsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < views.length; i ++ ) {\n\n\t\t\t\t\tconst view = views[ i ];\n\n\t\t\t\t\tlet viewport = null;\n\n\t\t\t\t\tif ( glBaseLayer !== null ) {\n\n\t\t\t\t\t\tviewport = glBaseLayer.getViewport( view );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst glSubImage = glBinding.getViewSubImage( glProjLayer, view );\n\t\t\t\t\t\tviewport = glSubImage.viewport;\n\n\t\t\t\t\t\t// For side-by-side projection, we only produce a single texture for both eyes.\n\t\t\t\t\t\tif ( i === 0 ) {\n\n\t\t\t\t\t\t\trenderer.setRenderTargetTextures(\n\t\t\t\t\t\t\t\tnewRenderTarget,\n\t\t\t\t\t\t\t\tglSubImage.colorTexture,\n\t\t\t\t\t\t\t\tglProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture );\n\n\t\t\t\t\t\t\trenderer.setRenderTarget( newRenderTarget );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlet camera = cameras[ i ];\n\n\t\t\t\t\tif ( camera === undefined ) {\n\n\t\t\t\t\t\tcamera = new PerspectiveCamera();\n\t\t\t\t\t\tcamera.layers.enable( i );\n\t\t\t\t\t\tcamera.viewport = new Vector4();\n\t\t\t\t\t\tcameras[ i ] = camera;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcamera.matrix.fromArray( view.transform.matrix );\n\t\t\t\t\tcamera.matrix.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\t\t\tcamera.projectionMatrix.fromArray( view.projectionMatrix );\n\t\t\t\t\tcamera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();\n\t\t\t\t\tcamera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );\n\n\t\t\t\t\tif ( i === 0 ) {\n\n\t\t\t\t\t\tcameraXR.matrix.copy( camera.matrix );\n\t\t\t\t\t\tcameraXR.matrix.decompose( cameraXR.position, cameraXR.quaternion, cameraXR.scale );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( cameraXRNeedsUpdate === true ) {\n\n\t\t\t\t\t\tcameraXR.cameras.push( camera );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t//\n\n\t\t\t\tconst enabledFeatures = session.enabledFeatures;\n\n\t\t\t\tif ( enabledFeatures && enabledFeatures.includes( 'depth-sensing' ) ) {\n\n\t\t\t\t\tconst depthData = glBinding.getDepthInformation( views[ 0 ] );\n\n\t\t\t\t\tif ( depthData && depthData.isValid && depthData.texture ) {\n\n\t\t\t\t\t\tdepthSensing.init( renderer, depthData, session.renderState );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tfor ( let i = 0; i < controllers.length; i ++ ) {\n\n\t\t\t\tconst inputSource = controllerInputSources[ i ];\n\t\t\t\tconst controller = controllers[ i ];\n\n\t\t\t\tif ( inputSource !== null && controller !== undefined ) {\n\n\t\t\t\t\tcontroller.update( inputSource, frame, customReferenceSpace || referenceSpace );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame );\n\n\t\t\tif ( frame.detectedPlanes ) {\n\n\t\t\t\tscope.dispatchEvent( { type: 'planesdetected', data: frame } );\n\n\t\t\t}\n\n\t\t\txrFrame = null;\n\n\t\t}\n\n\t\tconst animation = new WebGLAnimation();\n\n\t\tanimation.setAnimationLoop( onAnimationFrame );\n\n\t\tthis.setAnimationLoop = function ( callback ) {\n\n\t\t\tonAnimationFrameCallback = callback;\n\n\t\t};\n\n\t\tthis.dispose = function () {};\n\n\t}\n\n}\n\nconst _e1 = /*@__PURE__*/ new Euler();\nconst _m1 = /*@__PURE__*/ new Matrix4();\n\nfunction WebGLMaterials( renderer, properties ) {\n\n\tfunction refreshTransformUniform( map, uniform ) {\n\n\t\tif ( map.matrixAutoUpdate === true ) {\n\n\t\t\tmap.updateMatrix();\n\n\t\t}\n\n\t\tuniform.value.copy( map.matrix );\n\n\t}\n\n\tfunction refreshFogUniforms( uniforms, fog ) {\n\n\t\tfog.color.getRGB( uniforms.fogColor.value, getUnlitUniformColorSpace( renderer ) );\n\n\t\tif ( fog.isFog ) {\n\n\t\t\tuniforms.fogNear.value = fog.near;\n\t\t\tuniforms.fogFar.value = fog.far;\n\n\t\t} else if ( fog.isFogExp2 ) {\n\n\t\t\tuniforms.fogDensity.value = fog.density;\n\n\t\t}\n\n\t}\n\n\tfunction refreshMaterialUniforms( uniforms, material, pixelRatio, height, transmissionRenderTarget ) {\n\n\t\tif ( material.isMeshBasicMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isMeshLambertMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isMeshToonMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsToon( uniforms, material );\n\n\t\t} else if ( material.isMeshPhongMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsPhong( uniforms, material );\n\n\t\t} else if ( material.isMeshStandardMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsStandard( uniforms, material );\n\n\t\t\tif ( material.isMeshPhysicalMaterial ) {\n\n\t\t\t\trefreshUniformsPhysical( uniforms, material, transmissionRenderTarget );\n\n\t\t\t}\n\n\t\t} else if ( material.isMeshMatcapMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsMatcap( uniforms, material );\n\n\t\t} else if ( material.isMeshDepthMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isMeshDistanceMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsDistance( uniforms, material );\n\n\t\t} else if ( material.isMeshNormalMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isLineBasicMaterial ) {\n\n\t\t\trefreshUniformsLine( uniforms, material );\n\n\t\t\tif ( material.isLineDashedMaterial ) {\n\n\t\t\t\trefreshUniformsDash( uniforms, material );\n\n\t\t\t}\n\n\t\t} else if ( material.isPointsMaterial ) {\n\n\t\t\trefreshUniformsPoints( uniforms, material, pixelRatio, height );\n\n\t\t} else if ( material.isSpriteMaterial ) {\n\n\t\t\trefreshUniformsSprites( uniforms, material );\n\n\t\t} else if ( material.isShadowMaterial ) {\n\n\t\t\tuniforms.color.value.copy( material.color );\n\t\t\tuniforms.opacity.value = material.opacity;\n\n\t\t} else if ( material.isShaderMaterial ) {\n\n\t\t\tmaterial.uniformsNeedUpdate = false; // #15581\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsCommon( uniforms, material ) {\n\n\t\tuniforms.opacity.value = material.opacity;\n\n\t\tif ( material.color ) {\n\n\t\t\tuniforms.diffuse.value.copy( material.color );\n\n\t\t}\n\n\t\tif ( material.emissive ) {\n\n\t\t\tuniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity );\n\n\t\t}\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\trefreshTransformUniform( material.map, uniforms.mapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaMap ) {\n\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t\trefreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );\n\n\t\t}\n\n\t\tif ( material.bumpMap ) {\n\n\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\n\t\t\trefreshTransformUniform( material.bumpMap, uniforms.bumpMapTransform );\n\n\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\n\t\t\tif ( material.side === BackSide ) {\n\n\t\t\t\tuniforms.bumpScale.value *= - 1;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.normalMap ) {\n\n\t\t\tuniforms.normalMap.value = material.normalMap;\n\n\t\t\trefreshTransformUniform( material.normalMap, uniforms.normalMapTransform );\n\n\t\t\tuniforms.normalScale.value.copy( material.normalScale );\n\n\t\t\tif ( material.side === BackSide ) {\n\n\t\t\t\tuniforms.normalScale.value.negate();\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.displacementMap ) {\n\n\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\n\t\t\trefreshTransformUniform( material.displacementMap, uniforms.displacementMapTransform );\n\n\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\n\t\t}\n\n\t\tif ( material.emissiveMap ) {\n\n\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\n\t\t\trefreshTransformUniform( material.emissiveMap, uniforms.emissiveMapTransform );\n\n\t\t}\n\n\t\tif ( material.specularMap ) {\n\n\t\t\tuniforms.specularMap.value = material.specularMap;\n\n\t\t\trefreshTransformUniform( material.specularMap, uniforms.specularMapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaTest > 0 ) {\n\n\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\n\t\t}\n\n\t\tconst materialProperties = properties.get( material );\n\n\t\tconst envMap = materialProperties.envMap;\n\t\tconst envMapRotation = materialProperties.envMapRotation;\n\n\t\tif ( envMap ) {\n\n\t\t\tuniforms.envMap.value = envMap;\n\n\t\t\t_e1.copy( envMapRotation );\n\n\t\t\t// accommodate left-handed frame\n\t\t\t_e1.x *= - 1; _e1.y *= - 1; _e1.z *= - 1;\n\n\t\t\tif ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) {\n\n\t\t\t\t// environment maps which are not cube render targets or PMREMs follow a different convention\n\t\t\t\t_e1.y *= - 1;\n\t\t\t\t_e1.z *= - 1;\n\n\t\t\t}\n\n\t\t\tuniforms.envMapRotation.value.setFromMatrix4( _m1.makeRotationFromEuler( _e1 ) );\n\n\t\t\tuniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1;\n\n\t\t\tuniforms.reflectivity.value = material.reflectivity;\n\t\t\tuniforms.ior.value = material.ior;\n\t\t\tuniforms.refractionRatio.value = material.refractionRatio;\n\n\t\t}\n\n\t\tif ( material.lightMap ) {\n\n\t\t\tuniforms.lightMap.value = material.lightMap;\n\t\t\tuniforms.lightMapIntensity.value = material.lightMapIntensity;\n\n\t\t\trefreshTransformUniform( material.lightMap, uniforms.lightMapTransform );\n\n\t\t}\n\n\t\tif ( material.aoMap ) {\n\n\t\t\tuniforms.aoMap.value = material.aoMap;\n\t\t\tuniforms.aoMapIntensity.value = material.aoMapIntensity;\n\n\t\t\trefreshTransformUniform( material.aoMap, uniforms.aoMapTransform );\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsLine( uniforms, material ) {\n\n\t\tuniforms.diffuse.value.copy( material.color );\n\t\tuniforms.opacity.value = material.opacity;\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\trefreshTransformUniform( material.map, uniforms.mapTransform );\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsDash( uniforms, material ) {\n\n\t\tuniforms.dashSize.value = material.dashSize;\n\t\tuniforms.totalSize.value = material.dashSize + material.gapSize;\n\t\tuniforms.scale.value = material.scale;\n\n\t}\n\n\tfunction refreshUniformsPoints( uniforms, material, pixelRatio, height ) {\n\n\t\tuniforms.diffuse.value.copy( material.color );\n\t\tuniforms.opacity.value = material.opacity;\n\t\tuniforms.size.value = material.size * pixelRatio;\n\t\tuniforms.scale.value = height * 0.5;\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\trefreshTransformUniform( material.map, uniforms.uvTransform );\n\n\t\t}\n\n\t\tif ( material.alphaMap ) {\n\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t\trefreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaTest > 0 ) {\n\n\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsSprites( uniforms, material ) {\n\n\t\tuniforms.diffuse.value.copy( material.color );\n\t\tuniforms.opacity.value = material.opacity;\n\t\tuniforms.rotation.value = material.rotation;\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\trefreshTransformUniform( material.map, uniforms.mapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaMap ) {\n\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t\trefreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaTest > 0 ) {\n\n\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsPhong( uniforms, material ) {\n\n\t\tuniforms.specular.value.copy( material.specular );\n\t\tuniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 )\n\n\t}\n\n\tfunction refreshUniformsToon( uniforms, material ) {\n\n\t\tif ( material.gradientMap ) {\n\n\t\t\tuniforms.gradientMap.value = material.gradientMap;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsStandard( uniforms, material ) {\n\n\t\tuniforms.metalness.value = material.metalness;\n\n\t\tif ( material.metalnessMap ) {\n\n\t\t\tuniforms.metalnessMap.value = material.metalnessMap;\n\n\t\t\trefreshTransformUniform( material.metalnessMap, uniforms.metalnessMapTransform );\n\n\t\t}\n\n\t\tuniforms.roughness.value = material.roughness;\n\n\t\tif ( material.roughnessMap ) {\n\n\t\t\tuniforms.roughnessMap.value = material.roughnessMap;\n\n\t\t\trefreshTransformUniform( material.roughnessMap, uniforms.roughnessMapTransform );\n\n\t\t}\n\n\t\tif ( material.envMap ) {\n\n\t\t\t//uniforms.envMap.value = material.envMap; // part of uniforms common\n\n\t\t\tuniforms.envMapIntensity.value = material.envMapIntensity;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsPhysical( uniforms, material, transmissionRenderTarget ) {\n\n\t\tuniforms.ior.value = material.ior; // also part of uniforms common\n\n\t\tif ( material.sheen > 0 ) {\n\n\t\t\tuniforms.sheenColor.value.copy( material.sheenColor ).multiplyScalar( material.sheen );\n\n\t\t\tuniforms.sheenRoughness.value = material.sheenRoughness;\n\n\t\t\tif ( material.sheenColorMap ) {\n\n\t\t\t\tuniforms.sheenColorMap.value = material.sheenColorMap;\n\n\t\t\t\trefreshTransformUniform( material.sheenColorMap, uniforms.sheenColorMapTransform );\n\n\t\t\t}\n\n\t\t\tif ( material.sheenRoughnessMap ) {\n\n\t\t\t\tuniforms.sheenRoughnessMap.value = material.sheenRoughnessMap;\n\n\t\t\t\trefreshTransformUniform( material.sheenRoughnessMap, uniforms.sheenRoughnessMapTransform );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.clearcoat > 0 ) {\n\n\t\t\tuniforms.clearcoat.value = material.clearcoat;\n\t\t\tuniforms.clearcoatRoughness.value = material.clearcoatRoughness;\n\n\t\t\tif ( material.clearcoatMap ) {\n\n\t\t\t\tuniforms.clearcoatMap.value = material.clearcoatMap;\n\n\t\t\t\trefreshTransformUniform( material.clearcoatMap, uniforms.clearcoatMapTransform );\n\n\t\t\t}\n\n\t\t\tif ( material.clearcoatRoughnessMap ) {\n\n\t\t\t\tuniforms.clearcoatRoughnessMap.value = material.clearcoatRoughnessMap;\n\n\t\t\t\trefreshTransformUniform( material.clearcoatRoughnessMap, uniforms.clearcoatRoughnessMapTransform );\n\n\t\t\t}\n\n\t\t\tif ( material.clearcoatNormalMap ) {\n\n\t\t\t\tuniforms.clearcoatNormalMap.value = material.clearcoatNormalMap;\n\n\t\t\t\trefreshTransformUniform( material.clearcoatNormalMap, uniforms.clearcoatNormalMapTransform );\n\n\t\t\t\tuniforms.clearcoatNormalScale.value.copy( material.clearcoatNormalScale );\n\n\t\t\t\tif ( material.side === BackSide ) {\n\n\t\t\t\t\tuniforms.clearcoatNormalScale.value.negate();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.dispersion > 0 ) {\n\n\t\t\tuniforms.dispersion.value = material.dispersion;\n\n\t\t}\n\n\t\tif ( material.iridescence > 0 ) {\n\n\t\t\tuniforms.iridescence.value = material.iridescence;\n\t\t\tuniforms.iridescenceIOR.value = material.iridescenceIOR;\n\t\t\tuniforms.iridescenceThicknessMinimum.value = material.iridescenceThicknessRange[ 0 ];\n\t\t\tuniforms.iridescenceThicknessMaximum.value = material.iridescenceThicknessRange[ 1 ];\n\n\t\t\tif ( material.iridescenceMap ) {\n\n\t\t\t\tuniforms.iridescenceMap.value = material.iridescenceMap;\n\n\t\t\t\trefreshTransformUniform( material.iridescenceMap, uniforms.iridescenceMapTransform );\n\n\t\t\t}\n\n\t\t\tif ( material.iridescenceThicknessMap ) {\n\n\t\t\t\tuniforms.iridescenceThicknessMap.value = material.iridescenceThicknessMap;\n\n\t\t\t\trefreshTransformUniform( material.iridescenceThicknessMap, uniforms.iridescenceThicknessMapTransform );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.transmission > 0 ) {\n\n\t\t\tuniforms.transmission.value = material.transmission;\n\t\t\tuniforms.transmissionSamplerMap.value = transmissionRenderTarget.texture;\n\t\t\tuniforms.transmissionSamplerSize.value.set( transmissionRenderTarget.width, transmissionRenderTarget.height );\n\n\t\t\tif ( material.transmissionMap ) {\n\n\t\t\t\tuniforms.transmissionMap.value = material.transmissionMap;\n\n\t\t\t\trefreshTransformUniform( material.transmissionMap, uniforms.transmissionMapTransform );\n\n\t\t\t}\n\n\t\t\tuniforms.thickness.value = material.thickness;\n\n\t\t\tif ( material.thicknessMap ) {\n\n\t\t\t\tuniforms.thicknessMap.value = material.thicknessMap;\n\n\t\t\t\trefreshTransformUniform( material.thicknessMap, uniforms.thicknessMapTransform );\n\n\t\t\t}\n\n\t\t\tuniforms.attenuationDistance.value = material.attenuationDistance;\n\t\t\tuniforms.attenuationColor.value.copy( material.attenuationColor );\n\n\t\t}\n\n\t\tif ( material.anisotropy > 0 ) {\n\n\t\t\tuniforms.anisotropyVector.value.set( material.anisotropy * Math.cos( material.anisotropyRotation ), material.anisotropy * Math.sin( material.anisotropyRotation ) );\n\n\t\t\tif ( material.anisotropyMap ) {\n\n\t\t\t\tuniforms.anisotropyMap.value = material.anisotropyMap;\n\n\t\t\t\trefreshTransformUniform( material.anisotropyMap, uniforms.anisotropyMapTransform );\n\n\t\t\t}\n\n\t\t}\n\n\t\tuniforms.specularIntensity.value = material.specularIntensity;\n\t\tuniforms.specularColor.value.copy( material.specularColor );\n\n\t\tif ( material.specularColorMap ) {\n\n\t\t\tuniforms.specularColorMap.value = material.specularColorMap;\n\n\t\t\trefreshTransformUniform( material.specularColorMap, uniforms.specularColorMapTransform );\n\n\t\t}\n\n\t\tif ( material.specularIntensityMap ) {\n\n\t\t\tuniforms.specularIntensityMap.value = material.specularIntensityMap;\n\n\t\t\trefreshTransformUniform( material.specularIntensityMap, uniforms.specularIntensityMapTransform );\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsMatcap( uniforms, material ) {\n\n\t\tif ( material.matcap ) {\n\n\t\t\tuniforms.matcap.value = material.matcap;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsDistance( uniforms, material ) {\n\n\t\tconst light = properties.get( material ).light;\n\n\t\tuniforms.referencePosition.value.setFromMatrixPosition( light.matrixWorld );\n\t\tuniforms.nearDistance.value = light.shadow.camera.near;\n\t\tuniforms.farDistance.value = light.shadow.camera.far;\n\n\t}\n\n\treturn {\n\t\trefreshFogUniforms: refreshFogUniforms,\n\t\trefreshMaterialUniforms: refreshMaterialUniforms\n\t};\n\n}\n\nfunction WebGLUniformsGroups( gl, info, capabilities, state ) {\n\n\tlet buffers = {};\n\tlet updateList = {};\n\tlet allocatedBindingPoints = [];\n\n\tconst maxBindingPoints = gl.getParameter( gl.MAX_UNIFORM_BUFFER_BINDINGS ); // binding points are global whereas block indices are per shader program\n\n\tfunction bind( uniformsGroup, program ) {\n\n\t\tconst webglProgram = program.program;\n\t\tstate.uniformBlockBinding( uniformsGroup, webglProgram );\n\n\t}\n\n\tfunction update( uniformsGroup, program ) {\n\n\t\tlet buffer = buffers[ uniformsGroup.id ];\n\n\t\tif ( buffer === undefined ) {\n\n\t\t\tprepareUniformsGroup( uniformsGroup );\n\n\t\t\tbuffer = createBuffer( uniformsGroup );\n\t\t\tbuffers[ uniformsGroup.id ] = buffer;\n\n\t\t\tuniformsGroup.addEventListener( 'dispose', onUniformsGroupsDispose );\n\n\t\t}\n\n\t\t// ensure to update the binding points/block indices mapping for this program\n\n\t\tconst webglProgram = program.program;\n\t\tstate.updateUBOMapping( uniformsGroup, webglProgram );\n\n\t\t// update UBO once per frame\n\n\t\tconst frame = info.render.frame;\n\n\t\tif ( updateList[ uniformsGroup.id ] !== frame ) {\n\n\t\t\tupdateBufferData( uniformsGroup );\n\n\t\t\tupdateList[ uniformsGroup.id ] = frame;\n\n\t\t}\n\n\t}\n\n\tfunction createBuffer( uniformsGroup ) {\n\n\t\t// the setup of an UBO is independent of a particular shader program but global\n\n\t\tconst bindingPointIndex = allocateBindingPointIndex();\n\t\tuniformsGroup.__bindingPointIndex = bindingPointIndex;\n\n\t\tconst buffer = gl.createBuffer();\n\t\tconst size = uniformsGroup.__size;\n\t\tconst usage = uniformsGroup.usage;\n\n\t\tgl.bindBuffer( gl.UNIFORM_BUFFER, buffer );\n\t\tgl.bufferData( gl.UNIFORM_BUFFER, size, usage );\n\t\tgl.bindBuffer( gl.UNIFORM_BUFFER, null );\n\t\tgl.bindBufferBase( gl.UNIFORM_BUFFER, bindingPointIndex, buffer );\n\n\t\treturn buffer;\n\n\t}\n\n\tfunction allocateBindingPointIndex() {\n\n\t\tfor ( let i = 0; i < maxBindingPoints; i ++ ) {\n\n\t\t\tif ( allocatedBindingPoints.indexOf( i ) === - 1 ) {\n\n\t\t\t\tallocatedBindingPoints.push( i );\n\t\t\t\treturn i;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconsole.error( 'THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.' );\n\n\t\treturn 0;\n\n\t}\n\n\tfunction updateBufferData( uniformsGroup ) {\n\n\t\tconst buffer = buffers[ uniformsGroup.id ];\n\t\tconst uniforms = uniformsGroup.uniforms;\n\t\tconst cache = uniformsGroup.__cache;\n\n\t\tgl.bindBuffer( gl.UNIFORM_BUFFER, buffer );\n\n\t\tfor ( let i = 0, il = uniforms.length; i < il; i ++ ) {\n\n\t\t\tconst uniformArray = Array.isArray( uniforms[ i ] ) ? uniforms[ i ] : [ uniforms[ i ] ];\n\n\t\t\tfor ( let j = 0, jl = uniformArray.length; j < jl; j ++ ) {\n\n\t\t\t\tconst uniform = uniformArray[ j ];\n\n\t\t\t\tif ( hasUniformChanged( uniform, i, j, cache ) === true ) {\n\n\t\t\t\t\tconst offset = uniform.__offset;\n\n\t\t\t\t\tconst values = Array.isArray( uniform.value ) ? uniform.value : [ uniform.value ];\n\n\t\t\t\t\tlet arrayOffset = 0;\n\n\t\t\t\t\tfor ( let k = 0; k < values.length; k ++ ) {\n\n\t\t\t\t\t\tconst value = values[ k ];\n\n\t\t\t\t\t\tconst info = getUniformSize( value );\n\n\t\t\t\t\t\t// TODO add integer and struct support\n\t\t\t\t\t\tif ( typeof value === 'number' || typeof value === 'boolean' ) {\n\n\t\t\t\t\t\t\tuniform.__data[ 0 ] = value;\n\t\t\t\t\t\t\tgl.bufferSubData( gl.UNIFORM_BUFFER, offset + arrayOffset, uniform.__data );\n\n\t\t\t\t\t\t} else if ( value.isMatrix3 ) {\n\n\t\t\t\t\t\t\t// manually converting 3x3 to 3x4\n\n\t\t\t\t\t\t\tuniform.__data[ 0 ] = value.elements[ 0 ];\n\t\t\t\t\t\t\tuniform.__data[ 1 ] = value.elements[ 1 ];\n\t\t\t\t\t\t\tuniform.__data[ 2 ] = value.elements[ 2 ];\n\t\t\t\t\t\t\tuniform.__data[ 3 ] = 0;\n\t\t\t\t\t\t\tuniform.__data[ 4 ] = value.elements[ 3 ];\n\t\t\t\t\t\t\tuniform.__data[ 5 ] = value.elements[ 4 ];\n\t\t\t\t\t\t\tuniform.__data[ 6 ] = value.elements[ 5 ];\n\t\t\t\t\t\t\tuniform.__data[ 7 ] = 0;\n\t\t\t\t\t\t\tuniform.__data[ 8 ] = value.elements[ 6 ];\n\t\t\t\t\t\t\tuniform.__data[ 9 ] = value.elements[ 7 ];\n\t\t\t\t\t\t\tuniform.__data[ 10 ] = value.elements[ 8 ];\n\t\t\t\t\t\t\tuniform.__data[ 11 ] = 0;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tvalue.toArray( uniform.__data, arrayOffset );\n\n\t\t\t\t\t\t\tarrayOffset += info.storage / Float32Array.BYTES_PER_ELEMENT;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgl.bufferSubData( gl.UNIFORM_BUFFER, offset, uniform.__data );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tgl.bindBuffer( gl.UNIFORM_BUFFER, null );\n\n\t}\n\n\tfunction hasUniformChanged( uniform, index, indexArray, cache ) {\n\n\t\tconst value = uniform.value;\n\t\tconst indexString = index + '_' + indexArray;\n\n\t\tif ( cache[ indexString ] === undefined ) {\n\n\t\t\t// cache entry does not exist so far\n\n\t\t\tif ( typeof value === 'number' || typeof value === 'boolean' ) {\n\n\t\t\t\tcache[ indexString ] = value;\n\n\t\t\t} else {\n\n\t\t\t\tcache[ indexString ] = value.clone();\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t} else {\n\n\t\t\tconst cachedObject = cache[ indexString ];\n\n\t\t\t// compare current value with cached entry\n\n\t\t\tif ( typeof value === 'number' || typeof value === 'boolean' ) {\n\n\t\t\t\tif ( cachedObject !== value ) {\n\n\t\t\t\t\tcache[ indexString ] = value;\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( cachedObject.equals( value ) === false ) {\n\n\t\t\t\t\tcachedObject.copy( value );\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\tfunction prepareUniformsGroup( uniformsGroup ) {\n\n\t\t// determine total buffer size according to the STD140 layout\n\t\t// Hint: STD140 is the only supported layout in WebGL 2\n\n\t\tconst uniforms = uniformsGroup.uniforms;\n\n\t\tlet offset = 0; // global buffer offset in bytes\n\t\tconst chunkSize = 16; // size of a chunk in bytes\n\n\t\tfor ( let i = 0, l = uniforms.length; i < l; i ++ ) {\n\n\t\t\tconst uniformArray = Array.isArray( uniforms[ i ] ) ? uniforms[ i ] : [ uniforms[ i ] ];\n\n\t\t\tfor ( let j = 0, jl = uniformArray.length; j < jl; j ++ ) {\n\n\t\t\t\tconst uniform = uniformArray[ j ];\n\n\t\t\t\tconst values = Array.isArray( uniform.value ) ? uniform.value : [ uniform.value ];\n\n\t\t\t\tfor ( let k = 0, kl = values.length; k < kl; k ++ ) {\n\n\t\t\t\t\tconst value = values[ k ];\n\n\t\t\t\t\tconst info = getUniformSize( value );\n\n\t\t\t\t\tconst chunkOffset = offset % chunkSize; // offset in the current chunk\n\t\t\t\t\tconst chunkPadding = chunkOffset % info.boundary; // required padding to match boundary\n\t\t\t\t\tconst chunkStart = chunkOffset + chunkPadding; // the start position in the current chunk for the data\n\n\t\t\t\t\toffset += chunkPadding;\n\n\t\t\t\t\t// Check for chunk overflow\n\t\t\t\t\tif ( chunkStart !== 0 && ( chunkSize - chunkStart ) < info.storage ) {\n\n\t\t\t\t\t\t// Add padding and adjust offset\n\t\t\t\t\t\toffset += ( chunkSize - chunkStart );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// the following two properties will be used for partial buffer updates\n\t\t\t\t\tuniform.__data = new Float32Array( info.storage / Float32Array.BYTES_PER_ELEMENT );\n\t\t\t\t\tuniform.__offset = offset;\n\n\t\t\t\t\t// Update the global offset\n\t\t\t\t\toffset += info.storage;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ensure correct final padding\n\n\t\tconst chunkOffset = offset % chunkSize;\n\n\t\tif ( chunkOffset > 0 ) offset += ( chunkSize - chunkOffset );\n\n\t\t//\n\n\t\tuniformsGroup.__size = offset;\n\t\tuniformsGroup.__cache = {};\n\n\t\treturn this;\n\n\t}\n\n\tfunction getUniformSize( value ) {\n\n\t\tconst info = {\n\t\t\tboundary: 0, // bytes\n\t\t\tstorage: 0 // bytes\n\t\t};\n\n\t\t// determine sizes according to STD140\n\n\t\tif ( typeof value === 'number' || typeof value === 'boolean' ) {\n\n\t\t\t// float/int/bool\n\n\t\t\tinfo.boundary = 4;\n\t\t\tinfo.storage = 4;\n\n\t\t} else if ( value.isVector2 ) {\n\n\t\t\t// vec2\n\n\t\t\tinfo.boundary = 8;\n\t\t\tinfo.storage = 8;\n\n\t\t} else if ( value.isVector3 || value.isColor ) {\n\n\t\t\t// vec3\n\n\t\t\tinfo.boundary = 16;\n\t\t\tinfo.storage = 12; // evil: vec3 must start on a 16-byte boundary but it only consumes 12 bytes\n\n\t\t} else if ( value.isVector4 ) {\n\n\t\t\t// vec4\n\n\t\t\tinfo.boundary = 16;\n\t\t\tinfo.storage = 16;\n\n\t\t} else if ( value.isMatrix3 ) {\n\n\t\t\t// mat3 (in STD140 a 3x3 matrix is represented as 3x4)\n\n\t\t\tinfo.boundary = 48;\n\t\t\tinfo.storage = 48;\n\n\t\t} else if ( value.isMatrix4 ) {\n\n\t\t\t// mat4\n\n\t\t\tinfo.boundary = 64;\n\t\t\tinfo.storage = 64;\n\n\t\t} else if ( value.isTexture ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.' );\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Unsupported uniform value type.', value );\n\n\t\t}\n\n\t\treturn info;\n\n\t}\n\n\tfunction onUniformsGroupsDispose( event ) {\n\n\t\tconst uniformsGroup = event.target;\n\n\t\tuniformsGroup.removeEventListener( 'dispose', onUniformsGroupsDispose );\n\n\t\tconst index = allocatedBindingPoints.indexOf( uniformsGroup.__bindingPointIndex );\n\t\tallocatedBindingPoints.splice( index, 1 );\n\n\t\tgl.deleteBuffer( buffers[ uniformsGroup.id ] );\n\n\t\tdelete buffers[ uniformsGroup.id ];\n\t\tdelete updateList[ uniformsGroup.id ];\n\n\t}\n\n\tfunction dispose() {\n\n\t\tfor ( const id in buffers ) {\n\n\t\t\tgl.deleteBuffer( buffers[ id ] );\n\n\t\t}\n\n\t\tallocatedBindingPoints = [];\n\t\tbuffers = {};\n\t\tupdateList = {};\n\n\t}\n\n\treturn {\n\n\t\tbind: bind,\n\t\tupdate: update,\n\n\t\tdispose: dispose\n\n\t};\n\n}\n\nclass WebGLRenderer {\n\n\tconstructor( parameters = {} ) {\n\n\t\tconst {\n\t\t\tcanvas = createCanvasElement(),\n\t\t\tcontext = null,\n\t\t\tdepth = true,\n\t\t\tstencil = false,\n\t\t\talpha = false,\n\t\t\tantialias = false,\n\t\t\tpremultipliedAlpha = true,\n\t\t\tpreserveDrawingBuffer = false,\n\t\t\tpowerPreference = 'default',\n\t\t\tfailIfMajorPerformanceCaveat = false,\n\t\t\treverseDepthBuffer = false,\n\t\t} = parameters;\n\n\t\tthis.isWebGLRenderer = true;\n\n\t\tlet _alpha;\n\n\t\tif ( context !== null ) {\n\n\t\t\tif ( typeof WebGLRenderingContext !== 'undefined' && context instanceof WebGLRenderingContext ) {\n\n\t\t\t\tthrow new Error( 'THREE.WebGLRenderer: WebGL 1 is not supported since r163.' );\n\n\t\t\t}\n\n\t\t\t_alpha = context.getContextAttributes().alpha;\n\n\t\t} else {\n\n\t\t\t_alpha = alpha;\n\n\t\t}\n\n\t\tconst uintClearColor = new Uint32Array( 4 );\n\t\tconst intClearColor = new Int32Array( 4 );\n\n\t\tlet currentRenderList = null;\n\t\tlet currentRenderState = null;\n\n\t\t// render() can be called from within a callback triggered by another render.\n\t\t// We track this so that the nested render call gets its list and state isolated from the parent render call.\n\n\t\tconst renderListStack = [];\n\t\tconst renderStateStack = [];\n\n\t\t// public properties\n\n\t\tthis.domElement = canvas;\n\n\t\t// Debug configuration container\n\t\tthis.debug = {\n\n\t\t\t/**\n\t\t\t * Enables error checking and reporting when shader programs are being compiled\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tcheckShaderErrors: true,\n\t\t\t/**\n\t\t\t * Callback for custom error reporting.\n\t\t\t * @type {?Function}\n\t\t\t */\n\t\t\tonShaderError: null\n\t\t};\n\n\t\t// clearing\n\n\t\tthis.autoClear = true;\n\t\tthis.autoClearColor = true;\n\t\tthis.autoClearDepth = true;\n\t\tthis.autoClearStencil = true;\n\n\t\t// scene graph\n\n\t\tthis.sortObjects = true;\n\n\t\t// user-defined clipping\n\n\t\tthis.clippingPlanes = [];\n\t\tthis.localClippingEnabled = false;\n\n\t\t// physically based shading\n\n\t\tthis._outputColorSpace = SRGBColorSpace;\n\n\t\t// tone mapping\n\n\t\tthis.toneMapping = NoToneMapping;\n\t\tthis.toneMappingExposure = 1.0;\n\n\t\t// internal properties\n\n\t\tconst _this = this;\n\n\t\tlet _isContextLost = false;\n\n\t\t// internal state cache\n\n\t\tlet _currentActiveCubeFace = 0;\n\t\tlet _currentActiveMipmapLevel = 0;\n\t\tlet _currentRenderTarget = null;\n\t\tlet _currentMaterialId = - 1;\n\n\t\tlet _currentCamera = null;\n\n\t\tconst _currentViewport = new Vector4();\n\t\tconst _currentScissor = new Vector4();\n\t\tlet _currentScissorTest = null;\n\n\t\tconst _currentClearColor = new Color( 0x000000 );\n\t\tlet _currentClearAlpha = 0;\n\n\t\t//\n\n\t\tlet _width = canvas.width;\n\t\tlet _height = canvas.height;\n\n\t\tlet _pixelRatio = 1;\n\t\tlet _opaqueSort = null;\n\t\tlet _transparentSort = null;\n\n\t\tconst _viewport = new Vector4( 0, 0, _width, _height );\n\t\tconst _scissor = new Vector4( 0, 0, _width, _height );\n\t\tlet _scissorTest = false;\n\n\t\t// frustum\n\n\t\tconst _frustum = new Frustum();\n\n\t\t// clipping\n\n\t\tlet _clippingEnabled = false;\n\t\tlet _localClippingEnabled = false;\n\n\t\t// camera matrices cache\n\n\t\tconst _currentProjectionMatrix = new Matrix4();\n\t\tconst _projScreenMatrix = new Matrix4();\n\n\t\tconst _vector3 = new Vector3();\n\n\t\tconst _vector4 = new Vector4();\n\n\t\tconst _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };\n\n\t\tlet _renderBackground = false;\n\n\t\tfunction getTargetPixelRatio() {\n\n\t\t\treturn _currentRenderTarget === null ? _pixelRatio : 1;\n\n\t\t}\n\n\t\t// initialize\n\n\t\tlet _gl = context;\n\n\t\tfunction getContext( contextName, contextAttributes ) {\n\n\t\t\treturn canvas.getContext( contextName, contextAttributes );\n\n\t\t}\n\n\t\ttry {\n\n\t\t\tconst contextAttributes = {\n\t\t\t\talpha: true,\n\t\t\t\tdepth,\n\t\t\t\tstencil,\n\t\t\t\tantialias,\n\t\t\t\tpremultipliedAlpha,\n\t\t\t\tpreserveDrawingBuffer,\n\t\t\t\tpowerPreference,\n\t\t\t\tfailIfMajorPerformanceCaveat,\n\t\t\t};\n\n\t\t\t// OffscreenCanvas does not have setAttribute, see #22811\n\t\t\tif ( 'setAttribute' in canvas ) canvas.setAttribute( 'data-engine', `three.js r${REVISION}` );\n\n\t\t\t// event listeners must be registered before WebGL context is created, see #12753\n\t\t\tcanvas.addEventListener( 'webglcontextlost', onContextLost, false );\n\t\t\tcanvas.addEventListener( 'webglcontextrestored', onContextRestore, false );\n\t\t\tcanvas.addEventListener( 'webglcontextcreationerror', onContextCreationError, false );\n\n\t\t\tif ( _gl === null ) {\n\n\t\t\t\tconst contextName = 'webgl2';\n\n\t\t\t\t_gl = getContext( contextName, contextAttributes );\n\n\t\t\t\tif ( _gl === null ) {\n\n\t\t\t\t\tif ( getContext( contextName ) ) {\n\n\t\t\t\t\t\tthrow new Error( 'Error creating WebGL context with your selected attributes.' );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthrow new Error( 'Error creating WebGL context.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLRenderer: ' + error.message );\n\t\t\tthrow error;\n\n\t\t}\n\n\t\tlet extensions, capabilities, state, info;\n\t\tlet properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects;\n\t\tlet programCache, materials, renderLists, renderStates, clipping, shadowMap;\n\n\t\tlet background, morphtargets, bufferRenderer, indexedBufferRenderer;\n\n\t\tlet utils, bindingStates, uniformsGroups;\n\n\t\tfunction initGLContext() {\n\n\t\t\textensions = new WebGLExtensions( _gl );\n\t\t\textensions.init();\n\n\t\t\tutils = new WebGLUtils( _gl, extensions );\n\n\t\t\tcapabilities = new WebGLCapabilities( _gl, extensions, parameters, utils );\n\n\t\t\tstate = new WebGLState( _gl, extensions );\n\n\t\t\tif ( capabilities.reverseDepthBuffer && reverseDepthBuffer ) {\n\n\t\t\t\tstate.buffers.depth.setReversed( true );\n\n\t\t\t}\n\n\t\t\tinfo = new WebGLInfo( _gl );\n\t\t\tproperties = new WebGLProperties();\n\t\t\ttextures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info );\n\t\t\tcubemaps = new WebGLCubeMaps( _this );\n\t\t\tcubeuvmaps = new WebGLCubeUVMaps( _this );\n\t\t\tattributes = new WebGLAttributes( _gl );\n\t\t\tbindingStates = new WebGLBindingStates( _gl, attributes );\n\t\t\tgeometries = new WebGLGeometries( _gl, attributes, info, bindingStates );\n\t\t\tobjects = new WebGLObjects( _gl, geometries, attributes, info );\n\t\t\tmorphtargets = new WebGLMorphtargets( _gl, capabilities, textures );\n\t\t\tclipping = new WebGLClipping( properties );\n\t\t\tprogramCache = new WebGLPrograms( _this, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping );\n\t\t\tmaterials = new WebGLMaterials( _this, properties );\n\t\t\trenderLists = new WebGLRenderLists();\n\t\t\trenderStates = new WebGLRenderStates( extensions );\n\t\t\tbackground = new WebGLBackground( _this, cubemaps, cubeuvmaps, state, objects, _alpha, premultipliedAlpha );\n\t\t\tshadowMap = new WebGLShadowMap( _this, objects, capabilities );\n\t\t\tuniformsGroups = new WebGLUniformsGroups( _gl, info, capabilities, state );\n\n\t\t\tbufferRenderer = new WebGLBufferRenderer( _gl, extensions, info );\n\t\t\tindexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info );\n\n\t\t\tinfo.programs = programCache.programs;\n\n\t\t\t_this.capabilities = capabilities;\n\t\t\t_this.extensions = extensions;\n\t\t\t_this.properties = properties;\n\t\t\t_this.renderLists = renderLists;\n\t\t\t_this.shadowMap = shadowMap;\n\t\t\t_this.state = state;\n\t\t\t_this.info = info;\n\n\t\t}\n\n\t\tinitGLContext();\n\n\t\t// xr\n\n\t\tconst xr = new WebXRManager( _this, _gl );\n\n\t\tthis.xr = xr;\n\n\t\t// API\n\n\t\tthis.getContext = function () {\n\n\t\t\treturn _gl;\n\n\t\t};\n\n\t\tthis.getContextAttributes = function () {\n\n\t\t\treturn _gl.getContextAttributes();\n\n\t\t};\n\n\t\tthis.forceContextLoss = function () {\n\n\t\t\tconst extension = extensions.get( 'WEBGL_lose_context' );\n\t\t\tif ( extension ) extension.loseContext();\n\n\t\t};\n\n\t\tthis.forceContextRestore = function () {\n\n\t\t\tconst extension = extensions.get( 'WEBGL_lose_context' );\n\t\t\tif ( extension ) extension.restoreContext();\n\n\t\t};\n\n\t\tthis.getPixelRatio = function () {\n\n\t\t\treturn _pixelRatio;\n\n\t\t};\n\n\t\tthis.setPixelRatio = function ( value ) {\n\n\t\t\tif ( value === undefined ) return;\n\n\t\t\t_pixelRatio = value;\n\n\t\t\tthis.setSize( _width, _height, false );\n\n\t\t};\n\n\t\tthis.getSize = function ( target ) {\n\n\t\t\treturn target.set( _width, _height );\n\n\t\t};\n\n\t\tthis.setSize = function ( width, height, updateStyle = true ) {\n\n\t\t\tif ( xr.isPresenting ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Can\\'t change size while VR device is presenting.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\n\t\t\tcanvas.width = Math.floor( width * _pixelRatio );\n\t\t\tcanvas.height = Math.floor( height * _pixelRatio );\n\n\t\t\tif ( updateStyle === true ) {\n\n\t\t\t\tcanvas.style.width = width + 'px';\n\t\t\t\tcanvas.style.height = height + 'px';\n\n\t\t\t}\n\n\t\t\tthis.setViewport( 0, 0, width, height );\n\n\t\t};\n\n\t\tthis.getDrawingBufferSize = function ( target ) {\n\n\t\t\treturn target.set( _width * _pixelRatio, _height * _pixelRatio ).floor();\n\n\t\t};\n\n\t\tthis.setDrawingBufferSize = function ( width, height, pixelRatio ) {\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\n\t\t\t_pixelRatio = pixelRatio;\n\n\t\t\tcanvas.width = Math.floor( width * pixelRatio );\n\t\t\tcanvas.height = Math.floor( height * pixelRatio );\n\n\t\t\tthis.setViewport( 0, 0, width, height );\n\n\t\t};\n\n\t\tthis.getCurrentViewport = function ( target ) {\n\n\t\t\treturn target.copy( _currentViewport );\n\n\t\t};\n\n\t\tthis.getViewport = function ( target ) {\n\n\t\t\treturn target.copy( _viewport );\n\n\t\t};\n\n\t\tthis.setViewport = function ( x, y, width, height ) {\n\n\t\t\tif ( x.isVector4 ) {\n\n\t\t\t\t_viewport.set( x.x, x.y, x.z, x.w );\n\n\t\t\t} else {\n\n\t\t\t\t_viewport.set( x, y, width, height );\n\n\t\t\t}\n\n\t\t\tstate.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).round() );\n\n\t\t};\n\n\t\tthis.getScissor = function ( target ) {\n\n\t\t\treturn target.copy( _scissor );\n\n\t\t};\n\n\t\tthis.setScissor = function ( x, y, width, height ) {\n\n\t\t\tif ( x.isVector4 ) {\n\n\t\t\t\t_scissor.set( x.x, x.y, x.z, x.w );\n\n\t\t\t} else {\n\n\t\t\t\t_scissor.set( x, y, width, height );\n\n\t\t\t}\n\n\t\t\tstate.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).round() );\n\n\t\t};\n\n\t\tthis.getScissorTest = function () {\n\n\t\t\treturn _scissorTest;\n\n\t\t};\n\n\t\tthis.setScissorTest = function ( boolean ) {\n\n\t\t\tstate.setScissorTest( _scissorTest = boolean );\n\n\t\t};\n\n\t\tthis.setOpaqueSort = function ( method ) {\n\n\t\t\t_opaqueSort = method;\n\n\t\t};\n\n\t\tthis.setTransparentSort = function ( method ) {\n\n\t\t\t_transparentSort = method;\n\n\t\t};\n\n\t\t// Clearing\n\n\t\tthis.getClearColor = function ( target ) {\n\n\t\t\treturn target.copy( background.getClearColor() );\n\n\t\t};\n\n\t\tthis.setClearColor = function () {\n\n\t\t\tbackground.setClearColor.apply( background, arguments );\n\n\t\t};\n\n\t\tthis.getClearAlpha = function () {\n\n\t\t\treturn background.getClearAlpha();\n\n\t\t};\n\n\t\tthis.setClearAlpha = function () {\n\n\t\t\tbackground.setClearAlpha.apply( background, arguments );\n\n\t\t};\n\n\t\tthis.clear = function ( color = true, depth = true, stencil = true ) {\n\n\t\t\tlet bits = 0;\n\n\t\t\tif ( color ) {\n\n\t\t\t\t// check if we're trying to clear an integer target\n\t\t\t\tlet isIntegerFormat = false;\n\t\t\t\tif ( _currentRenderTarget !== null ) {\n\n\t\t\t\t\tconst targetFormat = _currentRenderTarget.texture.format;\n\t\t\t\t\tisIntegerFormat = targetFormat === RGBAIntegerFormat ||\n\t\t\t\t\t\ttargetFormat === RGIntegerFormat ||\n\t\t\t\t\t\ttargetFormat === RedIntegerFormat;\n\n\t\t\t\t}\n\n\t\t\t\t// use the appropriate clear functions to clear the target if it's a signed\n\t\t\t\t// or unsigned integer target\n\t\t\t\tif ( isIntegerFormat ) {\n\n\t\t\t\t\tconst targetType = _currentRenderTarget.texture.type;\n\t\t\t\t\tconst isUnsignedType = targetType === UnsignedByteType ||\n\t\t\t\t\t\ttargetType === UnsignedIntType ||\n\t\t\t\t\t\ttargetType === UnsignedShortType ||\n\t\t\t\t\t\ttargetType === UnsignedInt248Type ||\n\t\t\t\t\t\ttargetType === UnsignedShort4444Type ||\n\t\t\t\t\t\ttargetType === UnsignedShort5551Type;\n\n\t\t\t\t\tconst clearColor = background.getClearColor();\n\t\t\t\t\tconst a = background.getClearAlpha();\n\t\t\t\t\tconst r = clearColor.r;\n\t\t\t\t\tconst g = clearColor.g;\n\t\t\t\t\tconst b = clearColor.b;\n\n\t\t\t\t\tif ( isUnsignedType ) {\n\n\t\t\t\t\t\tuintClearColor[ 0 ] = r;\n\t\t\t\t\t\tuintClearColor[ 1 ] = g;\n\t\t\t\t\t\tuintClearColor[ 2 ] = b;\n\t\t\t\t\t\tuintClearColor[ 3 ] = a;\n\t\t\t\t\t\t_gl.clearBufferuiv( _gl.COLOR, 0, uintClearColor );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tintClearColor[ 0 ] = r;\n\t\t\t\t\t\tintClearColor[ 1 ] = g;\n\t\t\t\t\t\tintClearColor[ 2 ] = b;\n\t\t\t\t\t\tintClearColor[ 3 ] = a;\n\t\t\t\t\t\t_gl.clearBufferiv( _gl.COLOR, 0, intClearColor );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbits |= _gl.COLOR_BUFFER_BIT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( depth ) {\n\n\t\t\t\tbits |= _gl.DEPTH_BUFFER_BIT;\n\n\t\t\t}\n\n\t\t\tif ( stencil ) {\n\n\t\t\t\tbits |= _gl.STENCIL_BUFFER_BIT;\n\t\t\t\tthis.state.buffers.stencil.setMask( 0xffffffff );\n\n\t\t\t}\n\n\t\t\t_gl.clear( bits );\n\n\t\t};\n\n\t\tthis.clearColor = function () {\n\n\t\t\tthis.clear( true, false, false );\n\n\t\t};\n\n\t\tthis.clearDepth = function () {\n\n\t\t\tthis.clear( false, true, false );\n\n\t\t};\n\n\t\tthis.clearStencil = function () {\n\n\t\t\tthis.clear( false, false, true );\n\n\t\t};\n\n\t\t//\n\n\t\tthis.dispose = function () {\n\n\t\t\tcanvas.removeEventListener( 'webglcontextlost', onContextLost, false );\n\t\t\tcanvas.removeEventListener( 'webglcontextrestored', onContextRestore, false );\n\t\t\tcanvas.removeEventListener( 'webglcontextcreationerror', onContextCreationError, false );\n\n\t\t\trenderLists.dispose();\n\t\t\trenderStates.dispose();\n\t\t\tproperties.dispose();\n\t\t\tcubemaps.dispose();\n\t\t\tcubeuvmaps.dispose();\n\t\t\tobjects.dispose();\n\t\t\tbindingStates.dispose();\n\t\t\tuniformsGroups.dispose();\n\t\t\tprogramCache.dispose();\n\n\t\t\txr.dispose();\n\n\t\t\txr.removeEventListener( 'sessionstart', onXRSessionStart );\n\t\t\txr.removeEventListener( 'sessionend', onXRSessionEnd );\n\n\t\t\tanimation.stop();\n\n\t\t};\n\n\t\t// Events\n\n\t\tfunction onContextLost( event ) {\n\n\t\t\tevent.preventDefault();\n\n\t\t\tconsole.log( 'THREE.WebGLRenderer: Context Lost.' );\n\n\t\t\t_isContextLost = true;\n\n\t\t}\n\n\t\tfunction onContextRestore( /* event */ ) {\n\n\t\t\tconsole.log( 'THREE.WebGLRenderer: Context Restored.' );\n\n\t\t\t_isContextLost = false;\n\n\t\t\tconst infoAutoReset = info.autoReset;\n\t\t\tconst shadowMapEnabled = shadowMap.enabled;\n\t\t\tconst shadowMapAutoUpdate = shadowMap.autoUpdate;\n\t\t\tconst shadowMapNeedsUpdate = shadowMap.needsUpdate;\n\t\t\tconst shadowMapType = shadowMap.type;\n\n\t\t\tinitGLContext();\n\n\t\t\tinfo.autoReset = infoAutoReset;\n\t\t\tshadowMap.enabled = shadowMapEnabled;\n\t\t\tshadowMap.autoUpdate = shadowMapAutoUpdate;\n\t\t\tshadowMap.needsUpdate = shadowMapNeedsUpdate;\n\t\t\tshadowMap.type = shadowMapType;\n\n\t\t}\n\n\t\tfunction onContextCreationError( event ) {\n\n\t\t\tconsole.error( 'THREE.WebGLRenderer: A WebGL context could not be created. Reason: ', event.statusMessage );\n\n\t\t}\n\n\t\tfunction onMaterialDispose( event ) {\n\n\t\t\tconst material = event.target;\n\n\t\t\tmaterial.removeEventListener( 'dispose', onMaterialDispose );\n\n\t\t\tdeallocateMaterial( material );\n\n\t\t}\n\n\t\t// Buffer deallocation\n\n\t\tfunction deallocateMaterial( material ) {\n\n\t\t\treleaseMaterialProgramReferences( material );\n\n\t\t\tproperties.remove( material );\n\n\t\t}\n\n\n\t\tfunction releaseMaterialProgramReferences( material ) {\n\n\t\t\tconst programs = properties.get( material ).programs;\n\n\t\t\tif ( programs !== undefined ) {\n\n\t\t\t\tprograms.forEach( function ( program ) {\n\n\t\t\t\t\tprogramCache.releaseProgram( program );\n\n\t\t\t\t} );\n\n\t\t\t\tif ( material.isShaderMaterial ) {\n\n\t\t\t\t\tprogramCache.releaseShaderCache( material );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Buffer rendering\n\n\t\tthis.renderBufferDirect = function ( camera, scene, geometry, material, object, group ) {\n\n\t\t\tif ( scene === null ) scene = _emptyScene; // renderBufferDirect second parameter used to be fog (could be null)\n\n\t\t\tconst frontFaceCW = ( object.isMesh && object.matrixWorld.determinant() < 0 );\n\n\t\t\tconst program = setProgram( camera, scene, geometry, material, object );\n\n\t\t\tstate.setMaterial( material, frontFaceCW );\n\n\t\t\t//\n\n\t\t\tlet index = geometry.index;\n\t\t\tlet rangeFactor = 1;\n\n\t\t\tif ( material.wireframe === true ) {\n\n\t\t\t\tindex = geometries.getWireframeAttribute( geometry );\n\n\t\t\t\tif ( index === undefined ) return;\n\n\t\t\t\trangeFactor = 2;\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tconst drawRange = geometry.drawRange;\n\t\t\tconst position = geometry.attributes.position;\n\n\t\t\tlet drawStart = drawRange.start * rangeFactor;\n\t\t\tlet drawEnd = ( drawRange.start + drawRange.count ) * rangeFactor;\n\n\t\t\tif ( group !== null ) {\n\n\t\t\t\tdrawStart = Math.max( drawStart, group.start * rangeFactor );\n\t\t\t\tdrawEnd = Math.min( drawEnd, ( group.start + group.count ) * rangeFactor );\n\n\t\t\t}\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tdrawStart = Math.max( drawStart, 0 );\n\t\t\t\tdrawEnd = Math.min( drawEnd, index.count );\n\n\t\t\t} else if ( position !== undefined && position !== null ) {\n\n\t\t\t\tdrawStart = Math.max( drawStart, 0 );\n\t\t\t\tdrawEnd = Math.min( drawEnd, position.count );\n\n\t\t\t}\n\n\t\t\tconst drawCount = drawEnd - drawStart;\n\n\t\t\tif ( drawCount < 0 || drawCount === Infinity ) return;\n\n\t\t\t//\n\n\t\t\tbindingStates.setup( object, material, program, geometry, index );\n\n\t\t\tlet attribute;\n\t\t\tlet renderer = bufferRenderer;\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tattribute = attributes.get( index );\n\n\t\t\t\trenderer = indexedBufferRenderer;\n\t\t\t\trenderer.setIndex( attribute );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( object.isMesh ) {\n\n\t\t\t\tif ( material.wireframe === true ) {\n\n\t\t\t\t\tstate.setLineWidth( material.wireframeLinewidth * getTargetPixelRatio() );\n\t\t\t\t\trenderer.setMode( _gl.LINES );\n\n\t\t\t\t} else {\n\n\t\t\t\t\trenderer.setMode( _gl.TRIANGLES );\n\n\t\t\t\t}\n\n\t\t\t} else if ( object.isLine ) {\n\n\t\t\t\tlet lineWidth = material.linewidth;\n\n\t\t\t\tif ( lineWidth === undefined ) lineWidth = 1; // Not using Line*Material\n\n\t\t\t\tstate.setLineWidth( lineWidth * getTargetPixelRatio() );\n\n\t\t\t\tif ( object.isLineSegments ) {\n\n\t\t\t\t\trenderer.setMode( _gl.LINES );\n\n\t\t\t\t} else if ( object.isLineLoop ) {\n\n\t\t\t\t\trenderer.setMode( _gl.LINE_LOOP );\n\n\t\t\t\t} else {\n\n\t\t\t\t\trenderer.setMode( _gl.LINE_STRIP );\n\n\t\t\t\t}\n\n\t\t\t} else if ( object.isPoints ) {\n\n\t\t\t\trenderer.setMode( _gl.POINTS );\n\n\t\t\t} else if ( object.isSprite ) {\n\n\t\t\t\trenderer.setMode( _gl.TRIANGLES );\n\n\t\t\t}\n\n\t\t\tif ( object.isBatchedMesh ) {\n\n\t\t\t\tif ( object._multiDrawInstances !== null ) {\n\n\t\t\t\t\trenderer.renderMultiDrawInstances( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( ! extensions.get( 'WEBGL_multi_draw' ) ) {\n\n\t\t\t\t\t\tconst starts = object._multiDrawStarts;\n\t\t\t\t\t\tconst counts = object._multiDrawCounts;\n\t\t\t\t\t\tconst drawCount = object._multiDrawCount;\n\t\t\t\t\t\tconst bytesPerElement = index ? attributes.get( index ).bytesPerElement : 1;\n\t\t\t\t\t\tconst uniforms = properties.get( material ).currentProgram.getUniforms();\n\t\t\t\t\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\t\t\t\t\tuniforms.setValue( _gl, '_gl_DrawID', i );\n\t\t\t\t\t\t\trenderer.render( starts[ i ] / bytesPerElement, counts[ i ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\trenderer.renderMultiDraw( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( object.isInstancedMesh ) {\n\n\t\t\t\trenderer.renderInstances( drawStart, drawCount, object.count );\n\n\t\t\t} else if ( geometry.isInstancedBufferGeometry ) {\n\n\t\t\t\tconst maxInstanceCount = geometry._maxInstanceCount !== undefined ? geometry._maxInstanceCount : Infinity;\n\t\t\t\tconst instanceCount = Math.min( geometry.instanceCount, maxInstanceCount );\n\n\t\t\t\trenderer.renderInstances( drawStart, drawCount, instanceCount );\n\n\t\t\t} else {\n\n\t\t\t\trenderer.render( drawStart, drawCount );\n\n\t\t\t}\n\n\t\t};\n\n\t\t// Compile\n\n\t\tfunction prepareMaterial( material, scene, object ) {\n\n\t\t\tif ( material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false ) {\n\n\t\t\t\tmaterial.side = BackSide;\n\t\t\t\tmaterial.needsUpdate = true;\n\t\t\t\tgetProgram( material, scene, object );\n\n\t\t\t\tmaterial.side = FrontSide;\n\t\t\t\tmaterial.needsUpdate = true;\n\t\t\t\tgetProgram( material, scene, object );\n\n\t\t\t\tmaterial.side = DoubleSide;\n\n\t\t\t} else {\n\n\t\t\t\tgetProgram( material, scene, object );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.compile = function ( scene, camera, targetScene = null ) {\n\n\t\t\tif ( targetScene === null ) targetScene = scene;\n\n\t\t\tcurrentRenderState = renderStates.get( targetScene );\n\t\t\tcurrentRenderState.init( camera );\n\n\t\t\trenderStateStack.push( currentRenderState );\n\n\t\t\t// gather lights from both the target scene and the new object that will be added to the scene.\n\n\t\t\ttargetScene.traverseVisible( function ( object ) {\n\n\t\t\t\tif ( object.isLight && object.layers.test( camera.layers ) ) {\n\n\t\t\t\t\tcurrentRenderState.pushLight( object );\n\n\t\t\t\t\tif ( object.castShadow ) {\n\n\t\t\t\t\t\tcurrentRenderState.pushShadow( object );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\tif ( scene !== targetScene ) {\n\n\t\t\t\tscene.traverseVisible( function ( object ) {\n\n\t\t\t\t\tif ( object.isLight && object.layers.test( camera.layers ) ) {\n\n\t\t\t\t\t\tcurrentRenderState.pushLight( object );\n\n\t\t\t\t\t\tif ( object.castShadow ) {\n\n\t\t\t\t\t\t\tcurrentRenderState.pushShadow( object );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tcurrentRenderState.setupLights();\n\n\t\t\t// Only initialize materials in the new scene, not the targetScene.\n\n\t\t\tconst materials = new Set();\n\n\t\t\tscene.traverse( function ( object ) {\n\n\t\t\t\tif ( ! ( object.isMesh || object.isPoints || object.isLine || object.isSprite ) ) {\n\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tconst material = object.material;\n\n\t\t\t\tif ( material ) {\n\n\t\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\t\tfor ( let i = 0; i < material.length; i ++ ) {\n\n\t\t\t\t\t\t\tconst material2 = material[ i ];\n\n\t\t\t\t\t\t\tprepareMaterial( material2, targetScene, object );\n\t\t\t\t\t\t\tmaterials.add( material2 );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tprepareMaterial( material, targetScene, object );\n\t\t\t\t\t\tmaterials.add( material );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\trenderStateStack.pop();\n\t\t\tcurrentRenderState = null;\n\n\t\t\treturn materials;\n\n\t\t};\n\n\t\t// compileAsync\n\n\t\tthis.compileAsync = function ( scene, camera, targetScene = null ) {\n\n\t\t\tconst materials = this.compile( scene, camera, targetScene );\n\n\t\t\t// Wait for all the materials in the new object to indicate that they're\n\t\t\t// ready to be used before resolving the promise.\n\n\t\t\treturn new Promise( ( resolve ) => {\n\n\t\t\t\tfunction checkMaterialsReady() {\n\n\t\t\t\t\tmaterials.forEach( function ( material ) {\n\n\t\t\t\t\t\tconst materialProperties = properties.get( material );\n\t\t\t\t\t\tconst program = materialProperties.currentProgram;\n\n\t\t\t\t\t\tif ( program.isReady() ) {\n\n\t\t\t\t\t\t\t// remove any programs that report they're ready to use from the list\n\t\t\t\t\t\t\tmaterials.delete( material );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\n\t\t\t\t\t// once the list of compiling materials is empty, call the callback\n\n\t\t\t\t\tif ( materials.size === 0 ) {\n\n\t\t\t\t\t\tresolve( scene );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// if some materials are still not ready, wait a bit and check again\n\n\t\t\t\t\tsetTimeout( checkMaterialsReady, 10 );\n\n\t\t\t\t}\n\n\t\t\t\tif ( extensions.get( 'KHR_parallel_shader_compile' ) !== null ) {\n\n\t\t\t\t\t// If we can check the compilation status of the materials without\n\t\t\t\t\t// blocking then do so right away.\n\n\t\t\t\t\tcheckMaterialsReady();\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Otherwise start by waiting a bit to give the materials we just\n\t\t\t\t\t// initialized a chance to finish.\n\n\t\t\t\t\tsetTimeout( checkMaterialsReady, 10 );\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t};\n\n\t\t// Animation Loop\n\n\t\tlet onAnimationFrameCallback = null;\n\n\t\tfunction onAnimationFrame( time ) {\n\n\t\t\tif ( onAnimationFrameCallback ) onAnimationFrameCallback( time );\n\n\t\t}\n\n\t\tfunction onXRSessionStart() {\n\n\t\t\tanimation.stop();\n\n\t\t}\n\n\t\tfunction onXRSessionEnd() {\n\n\t\t\tanimation.start();\n\n\t\t}\n\n\t\tconst animation = new WebGLAnimation();\n\t\tanimation.setAnimationLoop( onAnimationFrame );\n\n\t\tif ( typeof self !== 'undefined' ) animation.setContext( self );\n\n\t\tthis.setAnimationLoop = function ( callback ) {\n\n\t\t\tonAnimationFrameCallback = callback;\n\t\t\txr.setAnimationLoop( callback );\n\n\t\t\t( callback === null ) ? animation.stop() : animation.start();\n\n\t\t};\n\n\t\txr.addEventListener( 'sessionstart', onXRSessionStart );\n\t\txr.addEventListener( 'sessionend', onXRSessionEnd );\n\n\t\t// Rendering\n\n\t\tthis.render = function ( scene, camera ) {\n\n\t\t\tif ( camera !== undefined && camera.isCamera !== true ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( _isContextLost === true ) return;\n\n\t\t\t// update scene graph\n\n\t\t\tif ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();\n\n\t\t\t// update camera matrices and frustum\n\n\t\t\tif ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();\n\n\t\t\tif ( xr.enabled === true && xr.isPresenting === true ) {\n\n\t\t\t\tif ( xr.cameraAutoUpdate === true ) xr.updateCamera( camera );\n\n\t\t\t\tcamera = xr.getCamera(); // use XR camera for rendering\n\n\t\t\t}\n\n\t\t\t//\n\t\t\tif ( scene.isScene === true ) scene.onBeforeRender( _this, scene, camera, _currentRenderTarget );\n\n\t\t\tcurrentRenderState = renderStates.get( scene, renderStateStack.length );\n\t\t\tcurrentRenderState.init( camera );\n\n\t\t\trenderStateStack.push( currentRenderState );\n\n\t\t\t_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n\t\t\t_frustum.setFromProjectionMatrix( _projScreenMatrix );\n\n\t\t\t_localClippingEnabled = this.localClippingEnabled;\n\t\t\t_clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled );\n\n\t\t\tcurrentRenderList = renderLists.get( scene, renderListStack.length );\n\t\t\tcurrentRenderList.init();\n\n\t\t\trenderListStack.push( currentRenderList );\n\n\t\t\tif ( xr.enabled === true && xr.isPresenting === true ) {\n\n\t\t\t\tconst depthSensingMesh = _this.xr.getDepthSensingMesh();\n\n\t\t\t\tif ( depthSensingMesh !== null ) {\n\n\t\t\t\t\tprojectObject( depthSensingMesh, camera, - Infinity, _this.sortObjects );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tprojectObject( scene, camera, 0, _this.sortObjects );\n\n\t\t\tcurrentRenderList.finish();\n\n\t\t\tif ( _this.sortObjects === true ) {\n\n\t\t\t\tcurrentRenderList.sort( _opaqueSort, _transparentSort );\n\n\t\t\t}\n\n\t\t\t_renderBackground = xr.enabled === false || xr.isPresenting === false || xr.hasDepthSensing() === false;\n\t\t\tif ( _renderBackground ) {\n\n\t\t\t\tbackground.addToRenderList( currentRenderList, scene );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tthis.info.render.frame ++;\n\n\t\t\tif ( _clippingEnabled === true ) clipping.beginShadows();\n\n\t\t\tconst shadowsArray = currentRenderState.state.shadowsArray;\n\n\t\t\tshadowMap.render( shadowsArray, scene, camera );\n\n\t\t\tif ( _clippingEnabled === true ) clipping.endShadows();\n\n\t\t\t//\n\n\t\t\tif ( this.info.autoReset === true ) this.info.reset();\n\n\t\t\t// render scene\n\n\t\t\tconst opaqueObjects = currentRenderList.opaque;\n\t\t\tconst transmissiveObjects = currentRenderList.transmissive;\n\n\t\t\tcurrentRenderState.setupLights();\n\n\t\t\tif ( camera.isArrayCamera ) {\n\n\t\t\t\tconst cameras = camera.cameras;\n\n\t\t\t\tif ( transmissiveObjects.length > 0 ) {\n\n\t\t\t\t\tfor ( let i = 0, l = cameras.length; i < l; i ++ ) {\n\n\t\t\t\t\t\tconst camera2 = cameras[ i ];\n\n\t\t\t\t\t\trenderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( _renderBackground ) background.render( scene );\n\n\t\t\t\tfor ( let i = 0, l = cameras.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst camera2 = cameras[ i ];\n\n\t\t\t\t\trenderScene( currentRenderList, scene, camera2, camera2.viewport );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( transmissiveObjects.length > 0 ) renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera );\n\n\t\t\t\tif ( _renderBackground ) background.render( scene );\n\n\t\t\t\trenderScene( currentRenderList, scene, camera );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( _currentRenderTarget !== null ) {\n\n\t\t\t\t// resolve multisample renderbuffers to a single-sample texture if necessary\n\n\t\t\t\ttextures.updateMultisampleRenderTarget( _currentRenderTarget );\n\n\t\t\t\t// Generate mipmap if we're using any kind of mipmap filtering\n\n\t\t\t\ttextures.updateRenderTargetMipmap( _currentRenderTarget );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( scene.isScene === true ) scene.onAfterRender( _this, scene, camera );\n\n\t\t\t// _gl.finish();\n\n\t\t\tbindingStates.resetDefaultState();\n\t\t\t_currentMaterialId = - 1;\n\t\t\t_currentCamera = null;\n\n\t\t\trenderStateStack.pop();\n\n\t\t\tif ( renderStateStack.length > 0 ) {\n\n\t\t\t\tcurrentRenderState = renderStateStack[ renderStateStack.length - 1 ];\n\n\t\t\t\tif ( _clippingEnabled === true ) clipping.setGlobalState( _this.clippingPlanes, currentRenderState.state.camera );\n\n\t\t\t} else {\n\n\t\t\t\tcurrentRenderState = null;\n\n\t\t\t}\n\n\t\t\trenderListStack.pop();\n\n\t\t\tif ( renderListStack.length > 0 ) {\n\n\t\t\t\tcurrentRenderList = renderListStack[ renderListStack.length - 1 ];\n\n\t\t\t} else {\n\n\t\t\t\tcurrentRenderList = null;\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction projectObject( object, camera, groupOrder, sortObjects ) {\n\n\t\t\tif ( object.visible === false ) return;\n\n\t\t\tconst visible = object.layers.test( camera.layers );\n\n\t\t\tif ( visible ) {\n\n\t\t\t\tif ( object.isGroup ) {\n\n\t\t\t\t\tgroupOrder = object.renderOrder;\n\n\t\t\t\t} else if ( object.isLOD ) {\n\n\t\t\t\t\tif ( object.autoUpdate === true ) object.update( camera );\n\n\t\t\t\t} else if ( object.isLight ) {\n\n\t\t\t\t\tcurrentRenderState.pushLight( object );\n\n\t\t\t\t\tif ( object.castShadow ) {\n\n\t\t\t\t\t\tcurrentRenderState.pushShadow( object );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( object.isSprite ) {\n\n\t\t\t\t\tif ( ! object.frustumCulled || _frustum.intersectsSprite( object ) ) {\n\n\t\t\t\t\t\tif ( sortObjects ) {\n\n\t\t\t\t\t\t\t_vector4.setFromMatrixPosition( object.matrixWorld )\n\t\t\t\t\t\t\t\t.applyMatrix4( _projScreenMatrix );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst geometry = objects.update( object );\n\t\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\t\tif ( material.visible ) {\n\n\t\t\t\t\t\t\tcurrentRenderList.push( object, geometry, material, groupOrder, _vector4.z, null );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( object.isMesh || object.isLine || object.isPoints ) {\n\n\t\t\t\t\tif ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {\n\n\t\t\t\t\t\tconst geometry = objects.update( object );\n\t\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\t\tif ( sortObjects ) {\n\n\t\t\t\t\t\t\tif ( object.boundingSphere !== undefined ) {\n\n\t\t\t\t\t\t\t\tif ( object.boundingSphere === null ) object.computeBoundingSphere();\n\t\t\t\t\t\t\t\t_vector4.copy( object.boundingSphere.center );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\t\t\t\t\t\t\t\t_vector4.copy( geometry.boundingSphere.center );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t_vector4\n\t\t\t\t\t\t\t\t.applyMatrix4( object.matrixWorld )\n\t\t\t\t\t\t\t\t.applyMatrix4( _projScreenMatrix );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\t\t\tconst groups = geometry.groups;\n\n\t\t\t\t\t\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\t\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\t\t\t\tif ( groupMaterial && groupMaterial.visible ) {\n\n\t\t\t\t\t\t\t\t\tcurrentRenderList.push( object, geometry, groupMaterial, groupOrder, _vector4.z, group );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else if ( material.visible ) {\n\n\t\t\t\t\t\t\tcurrentRenderList.push( object, geometry, material, groupOrder, _vector4.z, null );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst children = object.children;\n\n\t\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tprojectObject( children[ i ], camera, groupOrder, sortObjects );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderScene( currentRenderList, scene, camera, viewport ) {\n\n\t\t\tconst opaqueObjects = currentRenderList.opaque;\n\t\t\tconst transmissiveObjects = currentRenderList.transmissive;\n\t\t\tconst transparentObjects = currentRenderList.transparent;\n\n\t\t\tcurrentRenderState.setupLightsView( camera );\n\n\t\t\tif ( _clippingEnabled === true ) clipping.setGlobalState( _this.clippingPlanes, camera );\n\n\t\t\tif ( viewport ) state.viewport( _currentViewport.copy( viewport ) );\n\n\t\t\tif ( opaqueObjects.length > 0 ) renderObjects( opaqueObjects, scene, camera );\n\t\t\tif ( transmissiveObjects.length > 0 ) renderObjects( transmissiveObjects, scene, camera );\n\t\t\tif ( transparentObjects.length > 0 ) renderObjects( transparentObjects, scene, camera );\n\n\t\t\t// Ensure depth buffer writing is enabled so it can be cleared on next render\n\n\t\t\tstate.buffers.depth.setTest( true );\n\t\t\tstate.buffers.depth.setMask( true );\n\t\t\tstate.buffers.color.setMask( true );\n\n\t\t\tstate.setPolygonOffset( false );\n\n\t\t}\n\n\t\tfunction renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ) {\n\n\t\t\tconst overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;\n\n\t\t\tif ( overrideMaterial !== null ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( currentRenderState.state.transmissionRenderTarget[ camera.id ] === undefined ) {\n\n\t\t\t\tcurrentRenderState.state.transmissionRenderTarget[ camera.id ] = new WebGLRenderTarget( 1, 1, {\n\t\t\t\t\tgenerateMipmaps: true,\n\t\t\t\t\ttype: ( extensions.has( 'EXT_color_buffer_half_float' ) || extensions.has( 'EXT_color_buffer_float' ) ) ? HalfFloatType : UnsignedByteType,\n\t\t\t\t\tminFilter: LinearMipmapLinearFilter,\n\t\t\t\t\tsamples: 4,\n\t\t\t\t\tstencilBuffer: stencil,\n\t\t\t\t\tresolveDepthBuffer: false,\n\t\t\t\t\tresolveStencilBuffer: false,\n\t\t\t\t\tcolorSpace: ColorManagement.workingColorSpace,\n\t\t\t\t} );\n\n\t\t\t\t// debug\n\n\t\t\t\t/*\n\t\t\t\tconst geometry = new PlaneGeometry();\n\t\t\t\tconst material = new MeshBasicMaterial( { map: _transmissionRenderTarget.texture } );\n\n\t\t\t\tconst mesh = new Mesh( geometry, material );\n\t\t\t\tscene.add( mesh );\n\t\t\t\t*/\n\n\t\t\t}\n\n\t\t\tconst transmissionRenderTarget = currentRenderState.state.transmissionRenderTarget[ camera.id ];\n\n\t\t\tconst activeViewport = camera.viewport || _currentViewport;\n\t\t\ttransmissionRenderTarget.setSize( activeViewport.z, activeViewport.w );\n\n\t\t\t//\n\n\t\t\tconst currentRenderTarget = _this.getRenderTarget();\n\t\t\t_this.setRenderTarget( transmissionRenderTarget );\n\n\t\t\t_this.getClearColor( _currentClearColor );\n\t\t\t_currentClearAlpha = _this.getClearAlpha();\n\t\t\tif ( _currentClearAlpha < 1 ) _this.setClearColor( 0xffffff, 0.5 );\n\n\t\t\t_this.clear();\n\n\t\t\tif ( _renderBackground ) background.render( scene );\n\n\t\t\t// Turn off the features which can affect the frag color for opaque objects pass.\n\t\t\t// Otherwise they are applied twice in opaque objects pass and transmission objects pass.\n\t\t\tconst currentToneMapping = _this.toneMapping;\n\t\t\t_this.toneMapping = NoToneMapping;\n\n\t\t\t// Remove viewport from camera to avoid nested render calls resetting viewport to it (e.g Reflector).\n\t\t\t// Transmission render pass requires viewport to match the transmissionRenderTarget.\n\t\t\tconst currentCameraViewport = camera.viewport;\n\t\t\tif ( camera.viewport !== undefined ) camera.viewport = undefined;\n\n\t\t\tcurrentRenderState.setupLightsView( camera );\n\n\t\t\tif ( _clippingEnabled === true ) clipping.setGlobalState( _this.clippingPlanes, camera );\n\n\t\t\trenderObjects( opaqueObjects, scene, camera );\n\n\t\t\ttextures.updateMultisampleRenderTarget( transmissionRenderTarget );\n\t\t\ttextures.updateRenderTargetMipmap( transmissionRenderTarget );\n\n\t\t\tif ( extensions.has( 'WEBGL_multisampled_render_to_texture' ) === false ) { // see #28131\n\n\t\t\t\tlet renderTargetNeedsUpdate = false;\n\n\t\t\t\tfor ( let i = 0, l = transmissiveObjects.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst renderItem = transmissiveObjects[ i ];\n\n\t\t\t\t\tconst object = renderItem.object;\n\t\t\t\t\tconst geometry = renderItem.geometry;\n\t\t\t\t\tconst material = renderItem.material;\n\t\t\t\t\tconst group = renderItem.group;\n\n\t\t\t\t\tif ( material.side === DoubleSide && object.layers.test( camera.layers ) ) {\n\n\t\t\t\t\t\tconst currentSide = material.side;\n\n\t\t\t\t\t\tmaterial.side = BackSide;\n\t\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t\t\trenderObject( object, scene, camera, geometry, material, group );\n\n\t\t\t\t\t\tmaterial.side = currentSide;\n\t\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t\t\trenderTargetNeedsUpdate = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( renderTargetNeedsUpdate === true ) {\n\n\t\t\t\t\ttextures.updateMultisampleRenderTarget( transmissionRenderTarget );\n\t\t\t\t\ttextures.updateRenderTargetMipmap( transmissionRenderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_this.setRenderTarget( currentRenderTarget );\n\n\t\t\t_this.setClearColor( _currentClearColor, _currentClearAlpha );\n\n\t\t\tif ( currentCameraViewport !== undefined ) camera.viewport = currentCameraViewport;\n\n\t\t\t_this.toneMapping = currentToneMapping;\n\n\t\t}\n\n\t\tfunction renderObjects( renderList, scene, camera ) {\n\n\t\t\tconst overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;\n\n\t\t\tfor ( let i = 0, l = renderList.length; i < l; i ++ ) {\n\n\t\t\t\tconst renderItem = renderList[ i ];\n\n\t\t\t\tconst object = renderItem.object;\n\t\t\t\tconst geometry = renderItem.geometry;\n\t\t\t\tconst material = overrideMaterial === null ? renderItem.material : overrideMaterial;\n\t\t\t\tconst group = renderItem.group;\n\n\t\t\t\tif ( object.layers.test( camera.layers ) ) {\n\n\t\t\t\t\trenderObject( object, scene, camera, geometry, material, group );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderObject( object, scene, camera, geometry, material, group ) {\n\n\t\t\tobject.onBeforeRender( _this, scene, camera, geometry, material, group );\n\n\t\t\tobject.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );\n\t\t\tobject.normalMatrix.getNormalMatrix( object.modelViewMatrix );\n\n\t\t\tmaterial.onBeforeRender( _this, scene, camera, geometry, object, group );\n\n\t\t\tif ( material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false ) {\n\n\t\t\t\tmaterial.side = BackSide;\n\t\t\t\tmaterial.needsUpdate = true;\n\t\t\t\t_this.renderBufferDirect( camera, scene, geometry, material, object, group );\n\n\t\t\t\tmaterial.side = FrontSide;\n\t\t\t\tmaterial.needsUpdate = true;\n\t\t\t\t_this.renderBufferDirect( camera, scene, geometry, material, object, group );\n\n\t\t\t\tmaterial.side = DoubleSide;\n\n\t\t\t} else {\n\n\t\t\t\t_this.renderBufferDirect( camera, scene, geometry, material, object, group );\n\n\t\t\t}\n\n\t\t\tobject.onAfterRender( _this, scene, camera, geometry, material, group );\n\n\t\t}\n\n\t\tfunction getProgram( material, scene, object ) {\n\n\t\t\tif ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...\n\n\t\t\tconst materialProperties = properties.get( material );\n\n\t\t\tconst lights = currentRenderState.state.lights;\n\t\t\tconst shadowsArray = currentRenderState.state.shadowsArray;\n\n\t\t\tconst lightsStateVersion = lights.state.version;\n\n\t\t\tconst parameters = programCache.getParameters( material, lights.state, shadowsArray, scene, object );\n\t\t\tconst programCacheKey = programCache.getProgramCacheKey( parameters );\n\n\t\t\tlet programs = materialProperties.programs;\n\n\t\t\t// always update environment and fog - changing these trigger an getProgram call, but it's possible that the program doesn't change\n\n\t\t\tmaterialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\t\tmaterialProperties.fog = scene.fog;\n\t\t\tmaterialProperties.envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || materialProperties.environment );\n\t\t\tmaterialProperties.envMapRotation = ( materialProperties.environment !== null && material.envMap === null ) ? scene.environmentRotation : material.envMapRotation;\n\n\t\t\tif ( programs === undefined ) {\n\n\t\t\t\t// new material\n\n\t\t\t\tmaterial.addEventListener( 'dispose', onMaterialDispose );\n\n\t\t\t\tprograms = new Map();\n\t\t\t\tmaterialProperties.programs = programs;\n\n\t\t\t}\n\n\t\t\tlet program = programs.get( programCacheKey );\n\n\t\t\tif ( program !== undefined ) {\n\n\t\t\t\t// early out if program and light state is identical\n\n\t\t\t\tif ( materialProperties.currentProgram === program && materialProperties.lightsStateVersion === lightsStateVersion ) {\n\n\t\t\t\t\tupdateCommonMaterialProperties( material, parameters );\n\n\t\t\t\t\treturn program;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tparameters.uniforms = programCache.getUniforms( material );\n\n\t\t\t\tmaterial.onBeforeCompile( parameters, _this );\n\n\t\t\t\tprogram = programCache.acquireProgram( parameters, programCacheKey );\n\t\t\t\tprograms.set( programCacheKey, program );\n\n\t\t\t\tmaterialProperties.uniforms = parameters.uniforms;\n\n\t\t\t}\n\n\t\t\tconst uniforms = materialProperties.uniforms;\n\n\t\t\tif ( ( ! material.isShaderMaterial && ! material.isRawShaderMaterial ) || material.clipping === true ) {\n\n\t\t\t\tuniforms.clippingPlanes = clipping.uniform;\n\n\t\t\t}\n\n\t\t\tupdateCommonMaterialProperties( material, parameters );\n\n\t\t\t// store the light setup it was created for\n\n\t\t\tmaterialProperties.needsLights = materialNeedsLights( material );\n\t\t\tmaterialProperties.lightsStateVersion = lightsStateVersion;\n\n\t\t\tif ( materialProperties.needsLights ) {\n\n\t\t\t\t// wire up the material to this renderer's lighting state\n\n\t\t\t\tuniforms.ambientLightColor.value = lights.state.ambient;\n\t\t\t\tuniforms.lightProbe.value = lights.state.probe;\n\t\t\t\tuniforms.directionalLights.value = lights.state.directional;\n\t\t\t\tuniforms.directionalLightShadows.value = lights.state.directionalShadow;\n\t\t\t\tuniforms.spotLights.value = lights.state.spot;\n\t\t\t\tuniforms.spotLightShadows.value = lights.state.spotShadow;\n\t\t\t\tuniforms.rectAreaLights.value = lights.state.rectArea;\n\t\t\t\tuniforms.ltc_1.value = lights.state.rectAreaLTC1;\n\t\t\t\tuniforms.ltc_2.value = lights.state.rectAreaLTC2;\n\t\t\t\tuniforms.pointLights.value = lights.state.point;\n\t\t\t\tuniforms.pointLightShadows.value = lights.state.pointShadow;\n\t\t\t\tuniforms.hemisphereLights.value = lights.state.hemi;\n\n\t\t\t\tuniforms.directionalShadowMap.value = lights.state.directionalShadowMap;\n\t\t\t\tuniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix;\n\t\t\t\tuniforms.spotShadowMap.value = lights.state.spotShadowMap;\n\t\t\t\tuniforms.spotLightMatrix.value = lights.state.spotLightMatrix;\n\t\t\t\tuniforms.spotLightMap.value = lights.state.spotLightMap;\n\t\t\t\tuniforms.pointShadowMap.value = lights.state.pointShadowMap;\n\t\t\t\tuniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix;\n\t\t\t\t// TODO (abelnation): add area lights shadow info to uniforms\n\n\t\t\t}\n\n\t\t\tmaterialProperties.currentProgram = program;\n\t\t\tmaterialProperties.uniformsList = null;\n\n\t\t\treturn program;\n\n\t\t}\n\n\t\tfunction getUniformList( materialProperties ) {\n\n\t\t\tif ( materialProperties.uniformsList === null ) {\n\n\t\t\t\tconst progUniforms = materialProperties.currentProgram.getUniforms();\n\t\t\t\tmaterialProperties.uniformsList = WebGLUniforms.seqWithValue( progUniforms.seq, materialProperties.uniforms );\n\n\t\t\t}\n\n\t\t\treturn materialProperties.uniformsList;\n\n\t\t}\n\n\t\tfunction updateCommonMaterialProperties( material, parameters ) {\n\n\t\t\tconst materialProperties = properties.get( material );\n\n\t\t\tmaterialProperties.outputColorSpace = parameters.outputColorSpace;\n\t\t\tmaterialProperties.batching = parameters.batching;\n\t\t\tmaterialProperties.batchingColor = parameters.batchingColor;\n\t\t\tmaterialProperties.instancing = parameters.instancing;\n\t\t\tmaterialProperties.instancingColor = parameters.instancingColor;\n\t\t\tmaterialProperties.instancingMorph = parameters.instancingMorph;\n\t\t\tmaterialProperties.skinning = parameters.skinning;\n\t\t\tmaterialProperties.morphTargets = parameters.morphTargets;\n\t\t\tmaterialProperties.morphNormals = parameters.morphNormals;\n\t\t\tmaterialProperties.morphColors = parameters.morphColors;\n\t\t\tmaterialProperties.morphTargetsCount = parameters.morphTargetsCount;\n\t\t\tmaterialProperties.numClippingPlanes = parameters.numClippingPlanes;\n\t\t\tmaterialProperties.numIntersection = parameters.numClipIntersection;\n\t\t\tmaterialProperties.vertexAlphas = parameters.vertexAlphas;\n\t\t\tmaterialProperties.vertexTangents = parameters.vertexTangents;\n\t\t\tmaterialProperties.toneMapping = parameters.toneMapping;\n\n\t\t}\n\n\t\tfunction setProgram( camera, scene, geometry, material, object ) {\n\n\t\t\tif ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...\n\n\t\t\ttextures.resetTextureUnits();\n\n\t\t\tconst fog = scene.fog;\n\t\t\tconst environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\t\tconst colorSpace = ( _currentRenderTarget === null ) ? _this.outputColorSpace : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace );\n\t\t\tconst envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );\n\t\t\tconst vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;\n\t\t\tconst vertexTangents = !! geometry.attributes.tangent && ( !! material.normalMap || material.anisotropy > 0 );\n\t\t\tconst morphTargets = !! geometry.morphAttributes.position;\n\t\t\tconst morphNormals = !! geometry.morphAttributes.normal;\n\t\t\tconst morphColors = !! geometry.morphAttributes.color;\n\n\t\t\tlet toneMapping = NoToneMapping;\n\n\t\t\tif ( material.toneMapped ) {\n\n\t\t\t\tif ( _currentRenderTarget === null || _currentRenderTarget.isXRRenderTarget === true ) {\n\n\t\t\t\t\ttoneMapping = _this.toneMapping;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;\n\t\t\tconst morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;\n\n\t\t\tconst materialProperties = properties.get( material );\n\t\t\tconst lights = currentRenderState.state.lights;\n\n\t\t\tif ( _clippingEnabled === true ) {\n\n\t\t\t\tif ( _localClippingEnabled === true || camera !== _currentCamera ) {\n\n\t\t\t\t\tconst useCache =\n\t\t\t\t\t\tcamera === _currentCamera &&\n\t\t\t\t\t\tmaterial.id === _currentMaterialId;\n\n\t\t\t\t\t// we might want to call this function with some ClippingGroup\n\t\t\t\t\t// object instead of the material, once it becomes feasible\n\t\t\t\t\t// (#8465, #8379)\n\t\t\t\t\tclipping.setState( material, camera, useCache );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tlet needsProgramChange = false;\n\n\t\t\tif ( material.version === materialProperties.__version ) {\n\n\t\t\t\tif ( materialProperties.needsLights && ( materialProperties.lightsStateVersion !== lights.state.version ) ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.outputColorSpace !== colorSpace ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isBatchedMesh && materialProperties.batching === false ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( ! object.isBatchedMesh && materialProperties.batching === true ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isBatchedMesh && materialProperties.batchingColor === true && object.colorTexture === null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isBatchedMesh && materialProperties.batchingColor === false && object.colorTexture !== null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancing === false ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( ! object.isInstancedMesh && materialProperties.instancing === true ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isSkinnedMesh && materialProperties.skinning === false ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( ! object.isSkinnedMesh && materialProperties.skinning === true ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancingColor === true && object.instanceColor === null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancingColor === false && object.instanceColor !== null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancingMorph === true && object.morphTexture === null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancingMorph === false && object.morphTexture !== null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.envMap !== envMap ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( material.fog === true && materialProperties.fog !== fog ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.numClippingPlanes !== undefined &&\n\t\t\t\t\t( materialProperties.numClippingPlanes !== clipping.numPlanes ||\n\t\t\t\t\tmaterialProperties.numIntersection !== clipping.numIntersection ) ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.vertexAlphas !== vertexAlphas ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.vertexTangents !== vertexTangents ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.morphTargets !== morphTargets ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.morphNormals !== morphNormals ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.morphColors !== morphColors ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.toneMapping !== toneMapping ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.morphTargetsCount !== morphTargetsCount ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tneedsProgramChange = true;\n\t\t\t\tmaterialProperties.__version = material.version;\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tlet program = materialProperties.currentProgram;\n\n\t\t\tif ( needsProgramChange === true ) {\n\n\t\t\t\tprogram = getProgram( material, scene, object );\n\n\t\t\t}\n\n\t\t\tlet refreshProgram = false;\n\t\t\tlet refreshMaterial = false;\n\t\t\tlet refreshLights = false;\n\n\t\t\tconst p_uniforms = program.getUniforms(),\n\t\t\t\tm_uniforms = materialProperties.uniforms;\n\n\t\t\tif ( state.useProgram( program.program ) ) {\n\n\t\t\t\trefreshProgram = true;\n\t\t\t\trefreshMaterial = true;\n\t\t\t\trefreshLights = true;\n\n\t\t\t}\n\n\t\t\tif ( material.id !== _currentMaterialId ) {\n\n\t\t\t\t_currentMaterialId = material.id;\n\n\t\t\t\trefreshMaterial = true;\n\n\t\t\t}\n\n\t\t\tif ( refreshProgram || _currentCamera !== camera ) {\n\n\t\t\t\t// common camera uniforms\n\n\t\t\t\tconst reverseDepthBuffer = state.buffers.depth.getReversed();\n\n\t\t\t\tif ( reverseDepthBuffer ) {\n\n\t\t\t\t\t_currentProjectionMatrix.copy( camera.projectionMatrix );\n\n\t\t\t\t\ttoNormalizedProjectionMatrix( _currentProjectionMatrix );\n\t\t\t\t\ttoReversedProjectionMatrix( _currentProjectionMatrix );\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'projectionMatrix', _currentProjectionMatrix );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );\n\n\t\t\t\t}\n\n\t\t\t\tp_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );\n\n\t\t\t\tconst uCamPos = p_uniforms.map.cameraPosition;\n\n\t\t\t\tif ( uCamPos !== undefined ) {\n\n\t\t\t\t\tuCamPos.setValue( _gl, _vector3.setFromMatrixPosition( camera.matrixWorld ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( capabilities.logarithmicDepthBuffer ) {\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'logDepthBufFC',\n\t\t\t\t\t\t2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );\n\n\t\t\t\t}\n\n\t\t\t\t// consider moving isOrthographic to UniformLib and WebGLMaterials, see https://github.com/mrdoob/three.js/pull/26467#issuecomment-1645185067\n\n\t\t\t\tif ( material.isMeshPhongMaterial ||\n\t\t\t\t\tmaterial.isMeshToonMaterial ||\n\t\t\t\t\tmaterial.isMeshLambertMaterial ||\n\t\t\t\t\tmaterial.isMeshBasicMaterial ||\n\t\t\t\t\tmaterial.isMeshStandardMaterial ||\n\t\t\t\t\tmaterial.isShaderMaterial ) {\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'isOrthographic', camera.isOrthographicCamera === true );\n\n\t\t\t\t}\n\n\t\t\t\tif ( _currentCamera !== camera ) {\n\n\t\t\t\t\t_currentCamera = camera;\n\n\t\t\t\t\t// lighting uniforms depend on the camera so enforce an update\n\t\t\t\t\t// now, in case this material supports lights - or later, when\n\t\t\t\t\t// the next material that does gets activated:\n\n\t\t\t\t\trefreshMaterial = true;\t\t// set to true on material change\n\t\t\t\t\trefreshLights = true;\t\t// remains set until update done\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// skinning and morph target uniforms must be set even if material didn't change\n\t\t\t// auto-setting of texture unit for bone and morph texture must go before other textures\n\t\t\t// otherwise textures used for skinning and morphing can take over texture units reserved for other material textures\n\n\t\t\tif ( object.isSkinnedMesh ) {\n\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'bindMatrix' );\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'bindMatrixInverse' );\n\n\t\t\t\tconst skeleton = object.skeleton;\n\n\t\t\t\tif ( skeleton ) {\n\n\t\t\t\t\tif ( skeleton.boneTexture === null ) skeleton.computeBoneTexture();\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture, textures );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( object.isBatchedMesh ) {\n\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'batchingTexture' );\n\t\t\t\tp_uniforms.setValue( _gl, 'batchingTexture', object._matricesTexture, textures );\n\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'batchingIdTexture' );\n\t\t\t\tp_uniforms.setValue( _gl, 'batchingIdTexture', object._indirectTexture, textures );\n\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'batchingColorTexture' );\n\t\t\t\tif ( object._colorsTexture !== null ) {\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'batchingColorTexture', object._colorsTexture, textures );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst morphAttributes = geometry.morphAttributes;\n\n\t\t\tif ( morphAttributes.position !== undefined || morphAttributes.normal !== undefined || ( morphAttributes.color !== undefined ) ) {\n\n\t\t\t\tmorphtargets.update( object, geometry, program );\n\n\t\t\t}\n\n\t\t\tif ( refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow ) {\n\n\t\t\t\tmaterialProperties.receiveShadow = object.receiveShadow;\n\t\t\t\tp_uniforms.setValue( _gl, 'receiveShadow', object.receiveShadow );\n\n\t\t\t}\n\n\t\t\t// https://github.com/mrdoob/three.js/pull/24467#issuecomment-1209031512\n\n\t\t\tif ( material.isMeshGouraudMaterial && material.envMap !== null ) {\n\n\t\t\t\tm_uniforms.envMap.value = envMap;\n\n\t\t\t\tm_uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1;\n\n\t\t\t}\n\n\t\t\tif ( material.isMeshStandardMaterial && material.envMap === null && scene.environment !== null ) {\n\n\t\t\t\tm_uniforms.envMapIntensity.value = scene.environmentIntensity;\n\n\t\t\t}\n\n\t\t\tif ( refreshMaterial ) {\n\n\t\t\t\tp_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );\n\n\t\t\t\tif ( materialProperties.needsLights ) {\n\n\t\t\t\t\t// the current material requires lighting info\n\n\t\t\t\t\t// note: all lighting uniforms are always set correctly\n\t\t\t\t\t// they simply reference the renderer's state for their\n\t\t\t\t\t// values\n\t\t\t\t\t//\n\t\t\t\t\t// use the current material's .needsUpdate flags to set\n\t\t\t\t\t// the GL state when required\n\n\t\t\t\t\tmarkUniformsLightsNeedsUpdate( m_uniforms, refreshLights );\n\n\t\t\t\t}\n\n\t\t\t\t// refresh uniforms common to several materials\n\n\t\t\t\tif ( fog && material.fog === true ) {\n\n\t\t\t\t\tmaterials.refreshFogUniforms( m_uniforms, fog );\n\n\t\t\t\t}\n\n\t\t\t\tmaterials.refreshMaterialUniforms( m_uniforms, material, _pixelRatio, _height, currentRenderState.state.transmissionRenderTarget[ camera.id ] );\n\n\t\t\t\tWebGLUniforms.upload( _gl, getUniformList( materialProperties ), m_uniforms, textures );\n\n\t\t\t}\n\n\t\t\tif ( material.isShaderMaterial && material.uniformsNeedUpdate === true ) {\n\n\t\t\t\tWebGLUniforms.upload( _gl, getUniformList( materialProperties ), m_uniforms, textures );\n\t\t\t\tmaterial.uniformsNeedUpdate = false;\n\n\t\t\t}\n\n\t\t\tif ( material.isSpriteMaterial ) {\n\n\t\t\t\tp_uniforms.setValue( _gl, 'center', object.center );\n\n\t\t\t}\n\n\t\t\t// common matrices\n\n\t\t\tp_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix );\n\t\t\tp_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix );\n\t\t\tp_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld );\n\n\t\t\t// UBOs\n\n\t\t\tif ( material.isShaderMaterial || material.isRawShaderMaterial ) {\n\n\t\t\t\tconst groups = material.uniformsGroups;\n\n\t\t\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\n\t\t\t\t\tuniformsGroups.update( group, program );\n\t\t\t\t\tuniformsGroups.bind( group, program );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn program;\n\n\t\t}\n\n\t\t// If uniforms are marked as clean, they don't need to be loaded to the GPU.\n\n\t\tfunction markUniformsLightsNeedsUpdate( uniforms, value ) {\n\n\t\t\tuniforms.ambientLightColor.needsUpdate = value;\n\t\t\tuniforms.lightProbe.needsUpdate = value;\n\n\t\t\tuniforms.directionalLights.needsUpdate = value;\n\t\t\tuniforms.directionalLightShadows.needsUpdate = value;\n\t\t\tuniforms.pointLights.needsUpdate = value;\n\t\t\tuniforms.pointLightShadows.needsUpdate = value;\n\t\t\tuniforms.spotLights.needsUpdate = value;\n\t\t\tuniforms.spotLightShadows.needsUpdate = value;\n\t\t\tuniforms.rectAreaLights.needsUpdate = value;\n\t\t\tuniforms.hemisphereLights.needsUpdate = value;\n\n\t\t}\n\n\t\tfunction materialNeedsLights( material ) {\n\n\t\t\treturn material.isMeshLambertMaterial || material.isMeshToonMaterial || material.isMeshPhongMaterial ||\n\t\t\t\tmaterial.isMeshStandardMaterial || material.isShadowMaterial ||\n\t\t\t\t( material.isShaderMaterial && material.lights === true );\n\n\t\t}\n\n\t\tthis.getActiveCubeFace = function () {\n\n\t\t\treturn _currentActiveCubeFace;\n\n\t\t};\n\n\t\tthis.getActiveMipmapLevel = function () {\n\n\t\t\treturn _currentActiveMipmapLevel;\n\n\t\t};\n\n\t\tthis.getRenderTarget = function () {\n\n\t\t\treturn _currentRenderTarget;\n\n\t\t};\n\n\t\tthis.setRenderTargetTextures = function ( renderTarget, colorTexture, depthTexture ) {\n\n\t\t\tproperties.get( renderTarget.texture ).__webglTexture = colorTexture;\n\t\t\tproperties.get( renderTarget.depthTexture ).__webglTexture = depthTexture;\n\n\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\t\trenderTargetProperties.__hasExternalTextures = true;\n\n\t\t\trenderTargetProperties.__autoAllocateDepthBuffer = depthTexture === undefined;\n\n\t\t\tif ( ! renderTargetProperties.__autoAllocateDepthBuffer ) {\n\n\t\t\t\t// The multisample_render_to_texture extension doesn't work properly if there\n\t\t\t\t// are midframe flushes and an external depth buffer. Disable use of the extension.\n\t\t\t\tif ( extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided' );\n\t\t\t\t\trenderTargetProperties.__useRenderToTexture = false;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.setRenderTargetFramebuffer = function ( renderTarget, defaultFramebuffer ) {\n\n\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\t\trenderTargetProperties.__webglFramebuffer = defaultFramebuffer;\n\t\t\trenderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined;\n\n\t\t};\n\n\t\tthis.setRenderTarget = function ( renderTarget, activeCubeFace = 0, activeMipmapLevel = 0 ) {\n\n\t\t\t_currentRenderTarget = renderTarget;\n\t\t\t_currentActiveCubeFace = activeCubeFace;\n\t\t\t_currentActiveMipmapLevel = activeMipmapLevel;\n\n\t\t\tlet useDefaultFramebuffer = true;\n\t\t\tlet framebuffer = null;\n\t\t\tlet isCube = false;\n\t\t\tlet isRenderTarget3D = false;\n\n\t\t\tif ( renderTarget ) {\n\n\t\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\t\t\tif ( renderTargetProperties.__useDefaultFramebuffer !== undefined ) {\n\n\t\t\t\t\t// We need to make sure to rebind the framebuffer.\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\t\t\t\t\tuseDefaultFramebuffer = false;\n\n\t\t\t\t} else if ( renderTargetProperties.__webglFramebuffer === undefined ) {\n\n\t\t\t\t\ttextures.setupRenderTarget( renderTarget );\n\n\t\t\t\t} else if ( renderTargetProperties.__hasExternalTextures ) {\n\n\t\t\t\t\t// Color and depth texture must be rebound in order for the swapchain to update.\n\t\t\t\t\ttextures.rebindTextures( renderTarget, properties.get( renderTarget.texture ).__webglTexture, properties.get( renderTarget.depthTexture ).__webglTexture );\n\n\t\t\t\t} else if ( renderTarget.depthBuffer ) {\n\n\t\t\t\t\t// check if the depth texture is already bound to the frame buffer and that it's been initialized\n\t\t\t\t\tconst depthTexture = renderTarget.depthTexture;\n\t\t\t\t\tif ( renderTargetProperties.__boundDepthTexture !== depthTexture ) {\n\n\t\t\t\t\t\t// check if the depth texture is compatible\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tdepthTexture !== null &&\n\t\t\t\t\t\t\tproperties.has( depthTexture ) &&\n\t\t\t\t\t\t\t( renderTarget.width !== depthTexture.image.width || renderTarget.height !== depthTexture.image.height )\n\t\t\t\t\t\t) {\n\n\t\t\t\t\t\t\tthrow new Error( 'WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.' );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Swap the depth buffer to the currently attached one\n\t\t\t\t\t\ttextures.setupDepthRenderbuffer( renderTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tconst texture = renderTarget.texture;\n\n\t\t\t\tif ( texture.isData3DTexture || texture.isDataArrayTexture || texture.isCompressedArrayTexture ) {\n\n\t\t\t\t\tisRenderTarget3D = true;\n\n\t\t\t\t}\n\n\t\t\t\tconst __webglFramebuffer = properties.get( renderTarget ).__webglFramebuffer;\n\n\t\t\t\tif ( renderTarget.isWebGLCubeRenderTarget ) {\n\n\t\t\t\t\tif ( Array.isArray( __webglFramebuffer[ activeCubeFace ] ) ) {\n\n\t\t\t\t\t\tframebuffer = __webglFramebuffer[ activeCubeFace ][ activeMipmapLevel ];\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tframebuffer = __webglFramebuffer[ activeCubeFace ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\tisCube = true;\n\n\t\t\t\t} else if ( ( renderTarget.samples > 0 ) && textures.useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\t\tframebuffer = properties.get( renderTarget ).__webglMultisampledFramebuffer;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( Array.isArray( __webglFramebuffer ) ) {\n\n\t\t\t\t\t\tframebuffer = __webglFramebuffer[ activeMipmapLevel ];\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tframebuffer = __webglFramebuffer;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t_currentViewport.copy( renderTarget.viewport );\n\t\t\t\t_currentScissor.copy( renderTarget.scissor );\n\t\t\t\t_currentScissorTest = renderTarget.scissorTest;\n\n\t\t\t} else {\n\n\t\t\t\t_currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor();\n\t\t\t\t_currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor();\n\t\t\t\t_currentScissorTest = _scissorTest;\n\n\t\t\t}\n\n\t\t\tconst framebufferBound = state.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\tif ( framebufferBound && useDefaultFramebuffer ) {\n\n\t\t\t\tstate.drawBuffers( renderTarget, framebuffer );\n\n\t\t\t}\n\n\t\t\tstate.viewport( _currentViewport );\n\t\t\tstate.scissor( _currentScissor );\n\t\t\tstate.setScissorTest( _currentScissorTest );\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\tconst textureProperties = properties.get( renderTarget.texture );\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + activeCubeFace, textureProperties.__webglTexture, activeMipmapLevel );\n\n\t\t\t} else if ( isRenderTarget3D ) {\n\n\t\t\t\tconst textureProperties = properties.get( renderTarget.texture );\n\t\t\t\tconst layer = activeCubeFace || 0;\n\t\t\t\t_gl.framebufferTextureLayer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureProperties.__webglTexture, activeMipmapLevel || 0, layer );\n\n\t\t\t}\n\n\t\t\t_currentMaterialId = - 1; // reset current material to ensure correct uniform bindings\n\n\t\t};\n\n\t\tthis.readRenderTargetPixels = function ( renderTarget, x, y, width, height, buffer, activeCubeFaceIndex ) {\n\n\t\t\tif ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tlet framebuffer = properties.get( renderTarget ).__webglFramebuffer;\n\n\t\t\tif ( renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== undefined ) {\n\n\t\t\t\tframebuffer = framebuffer[ activeCubeFaceIndex ];\n\n\t\t\t}\n\n\t\t\tif ( framebuffer ) {\n\n\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\t\ttry {\n\n\t\t\t\t\tconst texture = renderTarget.texture;\n\t\t\t\t\tconst textureFormat = texture.format;\n\t\t\t\t\tconst textureType = texture.type;\n\n\t\t\t\t\tif ( ! capabilities.textureFormatReadable( textureFormat ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! capabilities.textureTypeReadable( textureType ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)\n\n\t\t\t\t\tif ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {\n\n\t\t\t\t\t\t_gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), buffer );\n\n\t\t\t\t\t}\n\n\t\t\t\t} finally {\n\n\t\t\t\t\t// restore framebuffer of current render target if necessary\n\n\t\t\t\t\tconst framebuffer = ( _currentRenderTarget !== null ) ? properties.get( _currentRenderTarget ).__webglFramebuffer : null;\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.readRenderTargetPixelsAsync = async function ( renderTarget, x, y, width, height, buffer, activeCubeFaceIndex ) {\n\n\t\t\tif ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) {\n\n\t\t\t\tthrow new Error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' );\n\n\t\t\t}\n\n\t\t\tlet framebuffer = properties.get( renderTarget ).__webglFramebuffer;\n\t\t\tif ( renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== undefined ) {\n\n\t\t\t\tframebuffer = framebuffer[ activeCubeFaceIndex ];\n\n\t\t\t}\n\n\t\t\tif ( framebuffer ) {\n\n\t\t\t\tconst texture = renderTarget.texture;\n\t\t\t\tconst textureFormat = texture.format;\n\t\t\t\tconst textureType = texture.type;\n\n\t\t\t\tif ( ! capabilities.textureFormatReadable( textureFormat ) ) {\n\n\t\t\t\t\tthrow new Error( 'THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.' );\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! capabilities.textureTypeReadable( textureType ) ) {\n\n\t\t\t\t\tthrow new Error( 'THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.' );\n\n\t\t\t\t}\n\n\t\t\t\t// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)\n\t\t\t\tif ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {\n\n\t\t\t\t\t// set the active frame buffer to the one we want to read\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\t\t\tconst glBuffer = _gl.createBuffer();\n\t\t\t\t\t_gl.bindBuffer( _gl.PIXEL_PACK_BUFFER, glBuffer );\n\t\t\t\t\t_gl.bufferData( _gl.PIXEL_PACK_BUFFER, buffer.byteLength, _gl.STREAM_READ );\n\t\t\t\t\t_gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), 0 );\n\n\t\t\t\t\t// reset the frame buffer to the currently set buffer before waiting\n\t\t\t\t\tconst currFramebuffer = _currentRenderTarget !== null ? properties.get( _currentRenderTarget ).__webglFramebuffer : null;\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, currFramebuffer );\n\n\t\t\t\t\t// check if the commands have finished every 8 ms\n\t\t\t\t\tconst sync = _gl.fenceSync( _gl.SYNC_GPU_COMMANDS_COMPLETE, 0 );\n\n\t\t\t\t\t_gl.flush();\n\n\t\t\t\t\tawait probeAsync( _gl, sync, 4 );\n\n\t\t\t\t\t// read the data and delete the buffer\n\t\t\t\t\t_gl.bindBuffer( _gl.PIXEL_PACK_BUFFER, glBuffer );\n\t\t\t\t\t_gl.getBufferSubData( _gl.PIXEL_PACK_BUFFER, 0, buffer );\n\t\t\t\t\t_gl.deleteBuffer( glBuffer );\n\t\t\t\t\t_gl.deleteSync( sync );\n\n\t\t\t\t\treturn buffer;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new Error( 'THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.copyFramebufferToTexture = function ( texture, position = null, level = 0 ) {\n\n\t\t\t// support previous signature with position first\n\t\t\tif ( texture.isTexture !== true ) {\n\n\t\t\t\t// @deprecated, r165\n\t\t\t\twarnOnce( 'WebGLRenderer: copyFramebufferToTexture function signature has changed.' );\n\n\t\t\t\tposition = arguments[ 0 ] || null;\n\t\t\t\ttexture = arguments[ 1 ];\n\n\t\t\t}\n\n\t\t\tconst levelScale = Math.pow( 2, - level );\n\t\t\tconst width = Math.floor( texture.image.width * levelScale );\n\t\t\tconst height = Math.floor( texture.image.height * levelScale );\n\n\t\t\tconst x = position !== null ? position.x : 0;\n\t\t\tconst y = position !== null ? position.y : 0;\n\n\t\t\ttextures.setTexture2D( texture, 0 );\n\n\t\t\t_gl.copyTexSubImage2D( _gl.TEXTURE_2D, level, 0, 0, x, y, width, height );\n\n\t\t\tstate.unbindTexture();\n\n\t\t};\n\n\t\tthis.copyTextureToTexture = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) {\n\n\t\t\t// support previous signature with dstPosition first\n\t\t\tif ( srcTexture.isTexture !== true ) {\n\n\t\t\t\t// @deprecated, r165\n\t\t\t\twarnOnce( 'WebGLRenderer: copyTextureToTexture function signature has changed.' );\n\n\t\t\t\tdstPosition = arguments[ 0 ] || null;\n\t\t\t\tsrcTexture = arguments[ 1 ];\n\t\t\t\tdstTexture = arguments[ 2 ];\n\t\t\t\tlevel = arguments[ 3 ] || 0;\n\t\t\t\tsrcRegion = null;\n\n\t\t\t}\n\n\t\t\t// gather the necessary dimensions to copy\n\t\t\tlet width, height, depth, minX, minY, minZ;\n\t\t\tlet dstX, dstY, dstZ;\n\t\t\tconst image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ level ] : srcTexture.image;\n\t\t\tif ( srcRegion !== null ) {\n\n\t\t\t\twidth = srcRegion.max.x - srcRegion.min.x;\n\t\t\t\theight = srcRegion.max.y - srcRegion.min.y;\n\t\t\t\tdepth = srcRegion.isBox3 ? srcRegion.max.z - srcRegion.min.z : 1;\n\t\t\t\tminX = srcRegion.min.x;\n\t\t\t\tminY = srcRegion.min.y;\n\t\t\t\tminZ = srcRegion.isBox3 ? srcRegion.min.z : 0;\n\n\t\t\t} else {\n\n\t\t\t\twidth = image.width;\n\t\t\t\theight = image.height;\n\t\t\t\tdepth = image.depth || 1;\n\t\t\t\tminX = 0;\n\t\t\t\tminY = 0;\n\t\t\t\tminZ = 0;\n\n\t\t\t}\n\n\t\t\tif ( dstPosition !== null ) {\n\n\t\t\t\tdstX = dstPosition.x;\n\t\t\t\tdstY = dstPosition.y;\n\t\t\t\tdstZ = dstPosition.z;\n\n\t\t\t} else {\n\n\t\t\t\tdstX = 0;\n\t\t\t\tdstY = 0;\n\t\t\t\tdstZ = 0;\n\n\t\t\t}\n\n\t\t\t// Set up the destination target\n\t\t\tconst glFormat = utils.convert( dstTexture.format );\n\t\t\tconst glType = utils.convert( dstTexture.type );\n\t\t\tlet glTarget;\n\n\t\t\tif ( dstTexture.isData3DTexture ) {\n\n\t\t\t\ttextures.setTexture3D( dstTexture, 0 );\n\t\t\t\tglTarget = _gl.TEXTURE_3D;\n\n\t\t\t} else if ( dstTexture.isDataArrayTexture || dstTexture.isCompressedArrayTexture ) {\n\n\t\t\t\ttextures.setTexture2DArray( dstTexture, 0 );\n\t\t\t\tglTarget = _gl.TEXTURE_2D_ARRAY;\n\n\t\t\t} else {\n\n\t\t\t\ttextures.setTexture2D( dstTexture, 0 );\n\t\t\t\tglTarget = _gl.TEXTURE_2D;\n\n\t\t\t}\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment );\n\n\t\t\t// used for copying data from cpu\n\t\t\tconst currentUnpackRowLen = _gl.getParameter( _gl.UNPACK_ROW_LENGTH );\n\t\t\tconst currentUnpackImageHeight = _gl.getParameter( _gl.UNPACK_IMAGE_HEIGHT );\n\t\t\tconst currentUnpackSkipPixels = _gl.getParameter( _gl.UNPACK_SKIP_PIXELS );\n\t\t\tconst currentUnpackSkipRows = _gl.getParameter( _gl.UNPACK_SKIP_ROWS );\n\t\t\tconst currentUnpackSkipImages = _gl.getParameter( _gl.UNPACK_SKIP_IMAGES );\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, image.width );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, image.height );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, minX );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, minY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_IMAGES, minZ );\n\n\t\t\t// set up the src texture\n\t\t\tconst isSrc3D = srcTexture.isDataArrayTexture || srcTexture.isData3DTexture;\n\t\t\tconst isDst3D = dstTexture.isDataArrayTexture || dstTexture.isData3DTexture;\n\t\t\tif ( srcTexture.isRenderTargetTexture || srcTexture.isDepthTexture ) {\n\n\t\t\t\tconst srcTextureProperties = properties.get( srcTexture );\n\t\t\t\tconst dstTextureProperties = properties.get( dstTexture );\n\t\t\t\tconst srcRenderTargetProperties = properties.get( srcTextureProperties.__renderTarget );\n\t\t\t\tconst dstRenderTargetProperties = properties.get( dstTextureProperties.__renderTarget );\n\n\t\t\t\tstate.bindFramebuffer( _gl.READ_FRAMEBUFFER, srcRenderTargetProperties.__webglFramebuffer );\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, dstRenderTargetProperties.__webglFramebuffer );\n\n\t\t\t\tfor ( let i = 0; i < depth; i ++ ) {\n\n\t\t\t\t\t// if the source or destination are a 3d target then a layer needs to be bound\n\t\t\t\t\tif ( isSrc3D ) {\n\n\t\t\t\t\t\t_gl.framebufferTextureLayer( _gl.READ_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, properties.get( srcTexture ).__webglTexture, level, minZ + i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( srcTexture.isDepthTexture ) {\n\n\t\t\t\t\t\tif ( isDst3D ) {\n\n\t\t\t\t\t\t\t_gl.framebufferTextureLayer( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, properties.get( dstTexture ).__webglTexture, level, dstZ + i );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_gl.blitFramebuffer( minX, minY, width, height, dstX, dstY, width, height, _gl.DEPTH_BUFFER_BIT, _gl.NEAREST );\n\n\t\t\t\t\t} else if ( isDst3D ) {\n\n\t\t\t\t\t\t_gl.copyTexSubImage3D( glTarget, level, dstX, dstY, dstZ + i, minX, minY, width, height );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_gl.copyTexSubImage2D( glTarget, level, dstX, dstY, dstZ + i, minX, minY, width, height );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.READ_FRAMEBUFFER, null );\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, null );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isDst3D ) {\n\n\t\t\t\t\t// copy data into the 3d texture\n\t\t\t\t\tif ( srcTexture.isDataTexture || srcTexture.isData3DTexture ) {\n\n\t\t\t\t\t\t_gl.texSubImage3D( glTarget, level, dstX, dstY, dstZ, width, height, depth, glFormat, glType, image.data );\n\n\t\t\t\t\t} else if ( dstTexture.isCompressedArrayTexture ) {\n\n\t\t\t\t\t\t_gl.compressedTexSubImage3D( glTarget, level, dstX, dstY, dstZ, width, height, depth, glFormat, image.data );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_gl.texSubImage3D( glTarget, level, dstX, dstY, dstZ, width, height, depth, glFormat, glType, image );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// copy data into the 2d texture\n\t\t\t\t\tif ( srcTexture.isDataTexture ) {\n\n\t\t\t\t\t\t_gl.texSubImage2D( _gl.TEXTURE_2D, level, dstX, dstY, width, height, glFormat, glType, image.data );\n\n\t\t\t\t\t} else if ( srcTexture.isCompressedTexture ) {\n\n\t\t\t\t\t\t_gl.compressedTexSubImage2D( _gl.TEXTURE_2D, level, dstX, dstY, image.width, image.height, glFormat, image.data );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_gl.texSubImage2D( _gl.TEXTURE_2D, level, dstX, dstY, width, height, glFormat, glType, image );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// reset values\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, currentUnpackRowLen );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, currentUnpackImageHeight );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_IMAGES, currentUnpackSkipImages );\n\n\t\t\t// Generate mipmaps only when copying level 0\n\t\t\tif ( level === 0 && dstTexture.generateMipmaps ) {\n\n\t\t\t\t_gl.generateMipmap( glTarget );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t};\n\n\t\tthis.copyTextureToTexture3D = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) {\n\n\t\t\t// support previous signature with source box first\n\t\t\tif ( srcTexture.isTexture !== true ) {\n\n\t\t\t\t// @deprecated, r165\n\t\t\t\twarnOnce( 'WebGLRenderer: copyTextureToTexture3D function signature has changed.' );\n\n\t\t\t\tsrcRegion = arguments[ 0 ] || null;\n\t\t\t\tdstPosition = arguments[ 1 ] || null;\n\t\t\t\tsrcTexture = arguments[ 2 ];\n\t\t\t\tdstTexture = arguments[ 3 ];\n\t\t\t\tlevel = arguments[ 4 ] || 0;\n\n\t\t\t}\n\n\t\t\t// @deprecated, r170\n\t\t\twarnOnce( 'WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use \"copyTextureToTexture\" instead.' );\n\n\t\t\treturn this.copyTextureToTexture( srcTexture, dstTexture, srcRegion, dstPosition, level );\n\n\t\t};\n\n\t\tthis.initRenderTarget = function ( target ) {\n\n\t\t\tif ( properties.get( target ).__webglFramebuffer === undefined ) {\n\n\t\t\t\ttextures.setupRenderTarget( target );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.initTexture = function ( texture ) {\n\n\t\t\tif ( texture.isCubeTexture ) {\n\n\t\t\t\ttextures.setTextureCube( texture, 0 );\n\n\t\t\t} else if ( texture.isData3DTexture ) {\n\n\t\t\t\ttextures.setTexture3D( texture, 0 );\n\n\t\t\t} else if ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) {\n\n\t\t\t\ttextures.setTexture2DArray( texture, 0 );\n\n\t\t\t} else {\n\n\t\t\t\ttextures.setTexture2D( texture, 0 );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t};\n\n\t\tthis.resetState = function () {\n\n\t\t\t_currentActiveCubeFace = 0;\n\t\t\t_currentActiveMipmapLevel = 0;\n\t\t\t_currentRenderTarget = null;\n\n\t\t\tstate.reset();\n\t\t\tbindingStates.reset();\n\n\t\t};\n\n\t\tif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t\t\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );\n\n\t\t}\n\n\t}\n\n\tget coordinateSystem() {\n\n\t\treturn WebGLCoordinateSystem;\n\n\t}\n\n\tget outputColorSpace() {\n\n\t\treturn this._outputColorSpace;\n\n\t}\n\n\tset outputColorSpace( colorSpace ) {\n\n\t\tthis._outputColorSpace = colorSpace;\n\n\t\tconst gl = this.getContext();\n\t\tgl.drawingBufferColorspace = ColorManagement._getDrawingBufferColorSpace( colorSpace );\n\t\tgl.unpackColorSpace = ColorManagement._getUnpackColorSpace();\n\n\t}\n\n}\n\nclass FogExp2 {\n\n\tconstructor( color, density = 0.00025 ) {\n\n\t\tthis.isFogExp2 = true;\n\n\t\tthis.name = '';\n\n\t\tthis.color = new Color( color );\n\t\tthis.density = density;\n\n\t}\n\n\tclone() {\n\n\t\treturn new FogExp2( this.color, this.density );\n\n\t}\n\n\ttoJSON( /* meta */ ) {\n\n\t\treturn {\n\t\t\ttype: 'FogExp2',\n\t\t\tname: this.name,\n\t\t\tcolor: this.color.getHex(),\n\t\t\tdensity: this.density\n\t\t};\n\n\t}\n\n}\n\nclass Fog {\n\n\tconstructor( color, near = 1, far = 1000 ) {\n\n\t\tthis.isFog = true;\n\n\t\tthis.name = '';\n\n\t\tthis.color = new Color( color );\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\n\t}\n\n\tclone() {\n\n\t\treturn new Fog( this.color, this.near, this.far );\n\n\t}\n\n\ttoJSON( /* meta */ ) {\n\n\t\treturn {\n\t\t\ttype: 'Fog',\n\t\t\tname: this.name,\n\t\t\tcolor: this.color.getHex(),\n\t\t\tnear: this.near,\n\t\t\tfar: this.far\n\t\t};\n\n\t}\n\n}\n\nclass Scene extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isScene = true;\n\n\t\tthis.type = 'Scene';\n\n\t\tthis.background = null;\n\t\tthis.environment = null;\n\t\tthis.fog = null;\n\n\t\tthis.backgroundBlurriness = 0;\n\t\tthis.backgroundIntensity = 1;\n\t\tthis.backgroundRotation = new Euler();\n\n\t\tthis.environmentIntensity = 1;\n\t\tthis.environmentRotation = new Euler();\n\n\t\tthis.overrideMaterial = null;\n\n\t\tif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t\t\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.background !== null ) this.background = source.background.clone();\n\t\tif ( source.environment !== null ) this.environment = source.environment.clone();\n\t\tif ( source.fog !== null ) this.fog = source.fog.clone();\n\n\t\tthis.backgroundBlurriness = source.backgroundBlurriness;\n\t\tthis.backgroundIntensity = source.backgroundIntensity;\n\t\tthis.backgroundRotation.copy( source.backgroundRotation );\n\n\t\tthis.environmentIntensity = source.environmentIntensity;\n\t\tthis.environmentRotation.copy( source.environmentRotation );\n\n\t\tif ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.fog !== null ) data.object.fog = this.fog.toJSON();\n\n\t\tif ( this.backgroundBlurriness > 0 ) data.object.backgroundBlurriness = this.backgroundBlurriness;\n\t\tif ( this.backgroundIntensity !== 1 ) data.object.backgroundIntensity = this.backgroundIntensity;\n\t\tdata.object.backgroundRotation = this.backgroundRotation.toArray();\n\n\t\tif ( this.environmentIntensity !== 1 ) data.object.environmentIntensity = this.environmentIntensity;\n\t\tdata.object.environmentRotation = this.environmentRotation.toArray();\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass InterleavedBuffer {\n\n\tconstructor( array, stride ) {\n\n\t\tthis.isInterleavedBuffer = true;\n\n\t\tthis.array = array;\n\t\tthis.stride = stride;\n\t\tthis.count = array !== undefined ? array.length / stride : 0;\n\n\t\tthis.usage = StaticDrawUsage;\n\t\tthis.updateRanges = [];\n\n\t\tthis.version = 0;\n\n\t\tthis.uuid = generateUUID();\n\n\t}\n\n\tonUploadCallback() {}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\taddUpdateRange( start, count ) {\n\n\t\tthis.updateRanges.push( { start, count } );\n\n\t}\n\n\tclearUpdateRanges() {\n\n\t\tthis.updateRanges.length = 0;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.array = new source.array.constructor( source.array );\n\t\tthis.count = source.count;\n\t\tthis.stride = source.stride;\n\t\tthis.usage = source.usage;\n\n\t\treturn this;\n\n\t}\n\n\tcopyAt( index1, attribute, index2 ) {\n\n\t\tindex1 *= this.stride;\n\t\tindex2 *= attribute.stride;\n\n\t\tfor ( let i = 0, l = this.stride; i < l; i ++ ) {\n\n\t\t\tthis.array[ index1 + i ] = attribute.array[ index2 + i ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tset( value, offset = 0 ) {\n\n\t\tthis.array.set( value, offset );\n\n\t\treturn this;\n\n\t}\n\n\tclone( data ) {\n\n\t\tif ( data.arrayBuffers === undefined ) {\n\n\t\t\tdata.arrayBuffers = {};\n\n\t\t}\n\n\t\tif ( this.array.buffer._uuid === undefined ) {\n\n\t\t\tthis.array.buffer._uuid = generateUUID();\n\n\t\t}\n\n\t\tif ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {\n\n\t\t\tdata.arrayBuffers[ this.array.buffer._uuid ] = this.array.slice( 0 ).buffer;\n\n\t\t}\n\n\t\tconst array = new this.array.constructor( data.arrayBuffers[ this.array.buffer._uuid ] );\n\n\t\tconst ib = new this.constructor( array, this.stride );\n\t\tib.setUsage( this.usage );\n\n\t\treturn ib;\n\n\t}\n\n\tonUpload( callback ) {\n\n\t\tthis.onUploadCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( data ) {\n\n\t\tif ( data.arrayBuffers === undefined ) {\n\n\t\t\tdata.arrayBuffers = {};\n\n\t\t}\n\n\t\t// generate UUID for array buffer if necessary\n\n\t\tif ( this.array.buffer._uuid === undefined ) {\n\n\t\t\tthis.array.buffer._uuid = generateUUID();\n\n\t\t}\n\n\t\tif ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {\n\n\t\t\tdata.arrayBuffers[ this.array.buffer._uuid ] = Array.from( new Uint32Array( this.array.buffer ) );\n\n\t\t}\n\n\t\t//\n\n\t\treturn {\n\t\t\tuuid: this.uuid,\n\t\t\tbuffer: this.array.buffer._uuid,\n\t\t\ttype: this.array.constructor.name,\n\t\t\tstride: this.stride\n\t\t};\n\n\t}\n\n}\n\nconst _vector$6 = /*@__PURE__*/ new Vector3();\n\nclass InterleavedBufferAttribute {\n\n\tconstructor( interleavedBuffer, itemSize, offset, normalized = false ) {\n\n\t\tthis.isInterleavedBufferAttribute = true;\n\n\t\tthis.name = '';\n\n\t\tthis.data = interleavedBuffer;\n\t\tthis.itemSize = itemSize;\n\t\tthis.offset = offset;\n\n\t\tthis.normalized = normalized;\n\n\t}\n\n\tget count() {\n\n\t\treturn this.data.count;\n\n\t}\n\n\tget array() {\n\n\t\treturn this.data.array;\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tthis.data.needsUpdate = value;\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tfor ( let i = 0, l = this.data.count; i < l; i ++ ) {\n\n\t\t\t_vector$6.fromBufferAttribute( this, i );\n\n\t\t\t_vector$6.applyMatrix4( m );\n\n\t\t\tthis.setXYZ( i, _vector$6.x, _vector$6.y, _vector$6.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tapplyNormalMatrix( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$6.fromBufferAttribute( this, i );\n\n\t\t\t_vector$6.applyNormalMatrix( m );\n\n\t\t\tthis.setXYZ( i, _vector$6.x, _vector$6.y, _vector$6.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttransformDirection( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$6.fromBufferAttribute( this, i );\n\n\t\t\t_vector$6.transformDirection( m );\n\n\t\t\tthis.setXYZ( i, _vector$6.x, _vector$6.y, _vector$6.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index, component ) {\n\n\t\tlet value = this.array[ index * this.data.stride + this.offset + component ];\n\n\t\tif ( this.normalized ) value = denormalize( value, this.array );\n\n\t\treturn value;\n\n\t}\n\n\tsetComponent( index, component, value ) {\n\n\t\tif ( this.normalized ) value = normalize( value, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + component ] = value;\n\n\t\treturn this;\n\n\t}\n\n\tsetX( index, x ) {\n\n\t\tif ( this.normalized ) x = normalize( x, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset ] = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( index, y ) {\n\n\t\tif ( this.normalized ) y = normalize( y, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetZ( index, z ) {\n\n\t\tif ( this.normalized ) z = normalize( z, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetW( index, w ) {\n\n\t\tif ( this.normalized ) w = normalize( w, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\tgetX( index ) {\n\n\t\tlet x = this.data.array[ index * this.data.stride + this.offset ];\n\n\t\tif ( this.normalized ) x = denormalize( x, this.array );\n\n\t\treturn x;\n\n\t}\n\n\tgetY( index ) {\n\n\t\tlet y = this.data.array[ index * this.data.stride + this.offset + 1 ];\n\n\t\tif ( this.normalized ) y = denormalize( y, this.array );\n\n\t\treturn y;\n\n\t}\n\n\tgetZ( index ) {\n\n\t\tlet z = this.data.array[ index * this.data.stride + this.offset + 2 ];\n\n\t\tif ( this.normalized ) z = denormalize( z, this.array );\n\n\t\treturn z;\n\n\t}\n\n\tgetW( index ) {\n\n\t\tlet w = this.data.array[ index * this.data.stride + this.offset + 3 ];\n\n\t\tif ( this.normalized ) w = denormalize( w, this.array );\n\n\t\treturn w;\n\n\t}\n\n\tsetXY( index, x, y ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\n\t\t}\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\n\t\t}\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\t\tthis.data.array[ index + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\t\t\tw = normalize( w, this.array );\n\n\t\t}\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\t\tthis.data.array[ index + 2 ] = z;\n\t\tthis.data.array[ index + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\tclone( data ) {\n\n\t\tif ( data === undefined ) {\n\n\t\t\tconsole.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' );\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0; i < this.count; i ++ ) {\n\n\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\tfor ( let j = 0; j < this.itemSize; j ++ ) {\n\n\t\t\t\t\tarray.push( this.data.array[ index + j ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn new BufferAttribute( new this.array.constructor( array ), this.itemSize, this.normalized );\n\n\t\t} else {\n\n\t\t\tif ( data.interleavedBuffers === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers = {};\n\n\t\t\t}\n\n\t\t\tif ( data.interleavedBuffers[ this.data.uuid ] === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers[ this.data.uuid ] = this.data.clone( data );\n\n\t\t\t}\n\n\t\t\treturn new InterleavedBufferAttribute( data.interleavedBuffers[ this.data.uuid ], this.itemSize, this.offset, this.normalized );\n\n\t\t}\n\n\t}\n\n\ttoJSON( data ) {\n\n\t\tif ( data === undefined ) {\n\n\t\t\tconsole.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' );\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0; i < this.count; i ++ ) {\n\n\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\tfor ( let j = 0; j < this.itemSize; j ++ ) {\n\n\t\t\t\t\tarray.push( this.data.array[ index + j ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// de-interleave data and save it as an ordinary buffer attribute for now\n\n\t\t\treturn {\n\t\t\t\titemSize: this.itemSize,\n\t\t\t\ttype: this.array.constructor.name,\n\t\t\t\tarray: array,\n\t\t\t\tnormalized: this.normalized\n\t\t\t};\n\n\t\t} else {\n\n\t\t\t// save as true interleaved attribute\n\n\t\t\tif ( data.interleavedBuffers === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers = {};\n\n\t\t\t}\n\n\t\t\tif ( data.interleavedBuffers[ this.data.uuid ] === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers[ this.data.uuid ] = this.data.toJSON( data );\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tisInterleavedBufferAttribute: true,\n\t\t\t\titemSize: this.itemSize,\n\t\t\t\tdata: this.data.uuid,\n\t\t\t\toffset: this.offset,\n\t\t\t\tnormalized: this.normalized\n\t\t\t};\n\n\t\t}\n\n\t}\n\n}\n\nclass SpriteMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'SpriteMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isSpriteMaterial = true;\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.rotation = 0;\n\n\t\tthis.sizeAttenuation = true;\n\n\t\tthis.transparent = true;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.rotation = source.rotation;\n\n\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nlet _geometry;\n\nconst _intersectPoint = /*@__PURE__*/ new Vector3();\nconst _worldScale = /*@__PURE__*/ new Vector3();\nconst _mvPosition = /*@__PURE__*/ new Vector3();\n\nconst _alignedPosition = /*@__PURE__*/ new Vector2();\nconst _rotatedPosition = /*@__PURE__*/ new Vector2();\nconst _viewWorldMatrix = /*@__PURE__*/ new Matrix4();\n\nconst _vA = /*@__PURE__*/ new Vector3();\nconst _vB = /*@__PURE__*/ new Vector3();\nconst _vC = /*@__PURE__*/ new Vector3();\n\nconst _uvA = /*@__PURE__*/ new Vector2();\nconst _uvB = /*@__PURE__*/ new Vector2();\nconst _uvC = /*@__PURE__*/ new Vector2();\n\nclass Sprite extends Object3D {\n\n\tconstructor( material = new SpriteMaterial() ) {\n\n\t\tsuper();\n\n\t\tthis.isSprite = true;\n\n\t\tthis.type = 'Sprite';\n\n\t\tif ( _geometry === undefined ) {\n\n\t\t\t_geometry = new BufferGeometry();\n\n\t\t\tconst float32Array = new Float32Array( [\n\t\t\t\t- 0.5, - 0.5, 0, 0, 0,\n\t\t\t\t0.5, - 0.5, 0, 1, 0,\n\t\t\t\t0.5, 0.5, 0, 1, 1,\n\t\t\t\t- 0.5, 0.5, 0, 0, 1\n\t\t\t] );\n\n\t\t\tconst interleavedBuffer = new InterleavedBuffer( float32Array, 5 );\n\n\t\t\t_geometry.setIndex( [ 0, 1, 2,\t0, 2, 3 ] );\n\t\t\t_geometry.setAttribute( 'position', new InterleavedBufferAttribute( interleavedBuffer, 3, 0, false ) );\n\t\t\t_geometry.setAttribute( 'uv', new InterleavedBufferAttribute( interleavedBuffer, 2, 3, false ) );\n\n\t\t}\n\n\t\tthis.geometry = _geometry;\n\t\tthis.material = material;\n\n\t\tthis.center = new Vector2( 0.5, 0.5 );\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tif ( raycaster.camera === null ) {\n\n\t\t\tconsole.error( 'THREE.Sprite: \"Raycaster.camera\" needs to be set in order to raycast against sprites.' );\n\n\t\t}\n\n\t\t_worldScale.setFromMatrixScale( this.matrixWorld );\n\n\t\t_viewWorldMatrix.copy( raycaster.camera.matrixWorld );\n\t\tthis.modelViewMatrix.multiplyMatrices( raycaster.camera.matrixWorldInverse, this.matrixWorld );\n\n\t\t_mvPosition.setFromMatrixPosition( this.modelViewMatrix );\n\n\t\tif ( raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false ) {\n\n\t\t\t_worldScale.multiplyScalar( - _mvPosition.z );\n\n\t\t}\n\n\t\tconst rotation = this.material.rotation;\n\t\tlet sin, cos;\n\n\t\tif ( rotation !== 0 ) {\n\n\t\t\tcos = Math.cos( rotation );\n\t\t\tsin = Math.sin( rotation );\n\n\t\t}\n\n\t\tconst center = this.center;\n\n\t\ttransformVertex( _vA.set( - 0.5, - 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\ttransformVertex( _vB.set( 0.5, - 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\ttransformVertex( _vC.set( 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\n\t\t_uvA.set( 0, 0 );\n\t\t_uvB.set( 1, 0 );\n\t\t_uvC.set( 1, 1 );\n\n\t\t// check first triangle\n\t\tlet intersect = raycaster.ray.intersectTriangle( _vA, _vB, _vC, false, _intersectPoint );\n\n\t\tif ( intersect === null ) {\n\n\t\t\t// check second triangle\n\t\t\ttransformVertex( _vB.set( - 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\t\t_uvB.set( 0, 1 );\n\n\t\t\tintersect = raycaster.ray.intersectTriangle( _vA, _vC, _vB, false, _intersectPoint );\n\t\t\tif ( intersect === null ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst distance = raycaster.ray.origin.distanceTo( _intersectPoint );\n\n\t\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\t\tintersects.push( {\n\n\t\t\tdistance: distance,\n\t\t\tpoint: _intersectPoint.clone(),\n\t\t\tuv: Triangle.getInterpolation( _intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() ),\n\t\t\tface: null,\n\t\t\tobject: this\n\n\t\t} );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.center !== undefined ) this.center.copy( source.center );\n\n\t\tthis.material = source.material;\n\n\t\treturn this;\n\n\t}\n\n}\n\nfunction transformVertex( vertexPosition, mvPosition, center, scale, sin, cos ) {\n\n\t// compute position in camera space\n\t_alignedPosition.subVectors( vertexPosition, center ).addScalar( 0.5 ).multiply( scale );\n\n\t// to check if rotation is not zero\n\tif ( sin !== undefined ) {\n\n\t\t_rotatedPosition.x = ( cos * _alignedPosition.x ) - ( sin * _alignedPosition.y );\n\t\t_rotatedPosition.y = ( sin * _alignedPosition.x ) + ( cos * _alignedPosition.y );\n\n\t} else {\n\n\t\t_rotatedPosition.copy( _alignedPosition );\n\n\t}\n\n\n\tvertexPosition.copy( mvPosition );\n\tvertexPosition.x += _rotatedPosition.x;\n\tvertexPosition.y += _rotatedPosition.y;\n\n\t// transform to world space\n\tvertexPosition.applyMatrix4( _viewWorldMatrix );\n\n}\n\nconst _v1$2 = /*@__PURE__*/ new Vector3();\nconst _v2$1 = /*@__PURE__*/ new Vector3();\n\nclass LOD extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis._currentLevel = 0;\n\n\t\tthis.type = 'LOD';\n\n\t\tObject.defineProperties( this, {\n\t\t\tlevels: {\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tisLOD: {\n\t\t\t\tvalue: true,\n\t\t\t}\n\t\t} );\n\n\t\tthis.autoUpdate = true;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source, false );\n\n\t\tconst levels = source.levels;\n\n\t\tfor ( let i = 0, l = levels.length; i < l; i ++ ) {\n\n\t\t\tconst level = levels[ i ];\n\n\t\t\tthis.addLevel( level.object.clone(), level.distance, level.hysteresis );\n\n\t\t}\n\n\t\tthis.autoUpdate = source.autoUpdate;\n\n\t\treturn this;\n\n\t}\n\n\taddLevel( object, distance = 0, hysteresis = 0 ) {\n\n\t\tdistance = Math.abs( distance );\n\n\t\tconst levels = this.levels;\n\n\t\tlet l;\n\n\t\tfor ( l = 0; l < levels.length; l ++ ) {\n\n\t\t\tif ( distance < levels[ l ].distance ) {\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlevels.splice( l, 0, { distance: distance, hysteresis: hysteresis, object: object } );\n\n\t\tthis.add( object );\n\n\t\treturn this;\n\n\t}\n\n\tremoveLevel( distance ) {\n\n\t\tconst levels = this.levels;\n\n\t\tfor ( let i = 0; i < levels.length; i ++ ) {\n\n\t\t\tif ( levels[ i ].distance === distance ) {\n\n\t\t\t\tconst removedElements = levels.splice( i, 1 );\n\t\t\t\tthis.remove( removedElements[ 0 ].object );\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\tgetCurrentLevel() {\n\n\t\treturn this._currentLevel;\n\n\t}\n\n\n\n\tgetObjectForDistance( distance ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length > 0 ) {\n\n\t\t\tlet i, l;\n\n\t\t\tfor ( i = 1, l = levels.length; i < l; i ++ ) {\n\n\t\t\t\tlet levelDistance = levels[ i ].distance;\n\n\t\t\t\tif ( levels[ i ].object.visible ) {\n\n\t\t\t\t\tlevelDistance -= levelDistance * levels[ i ].hysteresis;\n\n\t\t\t\t}\n\n\t\t\t\tif ( distance < levelDistance ) {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn levels[ i - 1 ].object;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length > 0 ) {\n\n\t\t\t_v1$2.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\tconst distance = raycaster.ray.origin.distanceTo( _v1$2 );\n\n\t\t\tthis.getObjectForDistance( distance ).raycast( raycaster, intersects );\n\n\t\t}\n\n\t}\n\n\tupdate( camera ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length > 1 ) {\n\n\t\t\t_v1$2.setFromMatrixPosition( camera.matrixWorld );\n\t\t\t_v2$1.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\tconst distance = _v1$2.distanceTo( _v2$1 ) / camera.zoom;\n\n\t\t\tlevels[ 0 ].object.visible = true;\n\n\t\t\tlet i, l;\n\n\t\t\tfor ( i = 1, l = levels.length; i < l; i ++ ) {\n\n\t\t\t\tlet levelDistance = levels[ i ].distance;\n\n\t\t\t\tif ( levels[ i ].object.visible ) {\n\n\t\t\t\t\tlevelDistance -= levelDistance * levels[ i ].hysteresis;\n\n\t\t\t\t}\n\n\t\t\t\tif ( distance >= levelDistance ) {\n\n\t\t\t\t\tlevels[ i - 1 ].object.visible = false;\n\t\t\t\t\tlevels[ i ].object.visible = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._currentLevel = i - 1;\n\n\t\t\tfor ( ; i < l; i ++ ) {\n\n\t\t\t\tlevels[ i ].object.visible = false;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.autoUpdate === false ) data.object.autoUpdate = false;\n\n\t\tdata.object.levels = [];\n\n\t\tconst levels = this.levels;\n\n\t\tfor ( let i = 0, l = levels.length; i < l; i ++ ) {\n\n\t\t\tconst level = levels[ i ];\n\n\t\t\tdata.object.levels.push( {\n\t\t\t\tobject: level.object.uuid,\n\t\t\t\tdistance: level.distance,\n\t\t\t\thysteresis: level.hysteresis\n\t\t\t} );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst _basePosition = /*@__PURE__*/ new Vector3();\n\nconst _skinIndex = /*@__PURE__*/ new Vector4();\nconst _skinWeight = /*@__PURE__*/ new Vector4();\n\nconst _vector3 = /*@__PURE__*/ new Vector3();\nconst _matrix4 = /*@__PURE__*/ new Matrix4();\nconst _vertex = /*@__PURE__*/ new Vector3();\n\nconst _sphere$4 = /*@__PURE__*/ new Sphere();\nconst _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();\nconst _ray$2 = /*@__PURE__*/ new Ray();\n\nclass SkinnedMesh extends Mesh {\n\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\tthis.isSkinnedMesh = true;\n\n\t\tthis.type = 'SkinnedMesh';\n\n\t\tthis.bindMode = AttachedBindMode;\n\t\tthis.bindMatrix = new Matrix4();\n\t\tthis.bindMatrixInverse = new Matrix4();\n\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t}\n\n\tcomputeBoundingBox() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tthis.boundingBox.makeEmpty();\n\n\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0; i < positionAttribute.count; i ++ ) {\n\n\t\t\tthis.getVertexPosition( i, _vertex );\n\t\t\tthis.boundingBox.expandByPoint( _vertex );\n\n\t\t}\n\n\t}\n\n\tcomputeBoundingSphere() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tthis.boundingSphere.makeEmpty();\n\n\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0; i < positionAttribute.count; i ++ ) {\n\n\t\t\tthis.getVertexPosition( i, _vertex );\n\t\t\tthis.boundingSphere.expandByPoint( _vertex );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.bindMode = source.bindMode;\n\t\tthis.bindMatrix.copy( source.bindMatrix );\n\t\tthis.bindMatrixInverse.copy( source.bindMatrixInverse );\n\n\t\tthis.skeleton = source.skeleton;\n\n\t\tif ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();\n\t\tif ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();\n\n\t\treturn this;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst material = this.material;\n\t\tconst matrixWorld = this.matrixWorld;\n\n\t\tif ( material === undefined ) return;\n\n\t\t// test with bounding sphere in world space\n\n\t\tif ( this.boundingSphere === null ) this.computeBoundingSphere();\n\n\t\t_sphere$4.copy( this.boundingSphere );\n\t\t_sphere$4.applyMatrix4( matrixWorld );\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$4 ) === false ) return;\n\n\t\t// convert ray to local space of skinned mesh\n\n\t\t_inverseMatrix$2.copy( matrixWorld ).invert();\n\t\t_ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );\n\n\t\t// test with bounding box in local space\n\n\t\tif ( this.boundingBox !== null ) {\n\n\t\t\tif ( _ray$2.intersectsBox( this.boundingBox ) === false ) return;\n\n\t\t}\n\n\t\t// test for intersections with geometry\n\n\t\tthis._computeIntersections( raycaster, intersects, _ray$2 );\n\n\t}\n\n\tgetVertexPosition( index, target ) {\n\n\t\tsuper.getVertexPosition( index, target );\n\n\t\tthis.applyBoneTransform( index, target );\n\n\t\treturn target;\n\n\t}\n\n\tbind( skeleton, bindMatrix ) {\n\n\t\tthis.skeleton = skeleton;\n\n\t\tif ( bindMatrix === undefined ) {\n\n\t\t\tthis.updateMatrixWorld( true );\n\n\t\t\tthis.skeleton.calculateInverses();\n\n\t\t\tbindMatrix = this.matrixWorld;\n\n\t\t}\n\n\t\tthis.bindMatrix.copy( bindMatrix );\n\t\tthis.bindMatrixInverse.copy( bindMatrix ).invert();\n\n\t}\n\n\tpose() {\n\n\t\tthis.skeleton.pose();\n\n\t}\n\n\tnormalizeSkinWeights() {\n\n\t\tconst vector = new Vector4();\n\n\t\tconst skinWeight = this.geometry.attributes.skinWeight;\n\n\t\tfor ( let i = 0, l = skinWeight.count; i < l; i ++ ) {\n\n\t\t\tvector.fromBufferAttribute( skinWeight, i );\n\n\t\t\tconst scale = 1.0 / vector.manhattanLength();\n\n\t\t\tif ( scale !== Infinity ) {\n\n\t\t\t\tvector.multiplyScalar( scale );\n\n\t\t\t} else {\n\n\t\t\t\tvector.set( 1, 0, 0, 0 ); // do something reasonable\n\n\t\t\t}\n\n\t\t\tskinWeight.setXYZW( i, vector.x, vector.y, vector.z, vector.w );\n\n\t\t}\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tif ( this.bindMode === AttachedBindMode ) {\n\n\t\t\tthis.bindMatrixInverse.copy( this.matrixWorld ).invert();\n\n\t\t} else if ( this.bindMode === DetachedBindMode ) {\n\n\t\t\tthis.bindMatrixInverse.copy( this.bindMatrix ).invert();\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode );\n\n\t\t}\n\n\t}\n\n\tapplyBoneTransform( index, vector ) {\n\n\t\tconst skeleton = this.skeleton;\n\t\tconst geometry = this.geometry;\n\n\t\t_skinIndex.fromBufferAttribute( geometry.attributes.skinIndex, index );\n\t\t_skinWeight.fromBufferAttribute( geometry.attributes.skinWeight, index );\n\n\t\t_basePosition.copy( vector ).applyMatrix4( this.bindMatrix );\n\n\t\tvector.set( 0, 0, 0 );\n\n\t\tfor ( let i = 0; i < 4; i ++ ) {\n\n\t\t\tconst weight = _skinWeight.getComponent( i );\n\n\t\t\tif ( weight !== 0 ) {\n\n\t\t\t\tconst boneIndex = _skinIndex.getComponent( i );\n\n\t\t\t\t_matrix4.multiplyMatrices( skeleton.bones[ boneIndex ].matrixWorld, skeleton.boneInverses[ boneIndex ] );\n\n\t\t\t\tvector.addScaledVector( _vector3.copy( _basePosition ).applyMatrix4( _matrix4 ), weight );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn vector.applyMatrix4( this.bindMatrixInverse );\n\n\t}\n\n}\n\nclass Bone extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isBone = true;\n\n\t\tthis.type = 'Bone';\n\n\t}\n\n}\n\nclass DataTexture extends Texture {\n\n\tconstructor( data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, colorSpace ) {\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );\n\n\t\tthis.isDataTexture = true;\n\n\t\tthis.image = { data: data, width: width, height: height };\n\n\t\tthis.generateMipmaps = false;\n\t\tthis.flipY = false;\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n}\n\nconst _offsetMatrix = /*@__PURE__*/ new Matrix4();\nconst _identityMatrix = /*@__PURE__*/ new Matrix4();\n\nclass Skeleton {\n\n\tconstructor( bones = [], boneInverses = [] ) {\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.bones = bones.slice( 0 );\n\t\tthis.boneInverses = boneInverses;\n\t\tthis.boneMatrices = null;\n\n\t\tthis.boneTexture = null;\n\n\t\tthis.init();\n\n\t}\n\n\tinit() {\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\n\t\tthis.boneMatrices = new Float32Array( bones.length * 16 );\n\n\t\t// calculate inverse bone matrices if necessary\n\n\t\tif ( boneInverses.length === 0 ) {\n\n\t\t\tthis.calculateInverses();\n\n\t\t} else {\n\n\t\t\t// handle special case\n\n\t\t\tif ( bones.length !== boneInverses.length ) {\n\n\t\t\t\tconsole.warn( 'THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.' );\n\n\t\t\t\tthis.boneInverses = [];\n\n\t\t\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\t\t\tthis.boneInverses.push( new Matrix4() );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcalculateInverses() {\n\n\t\tthis.boneInverses.length = 0;\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst inverse = new Matrix4();\n\n\t\t\tif ( this.bones[ i ] ) {\n\n\t\t\t\tinverse.copy( this.bones[ i ].matrixWorld ).invert();\n\n\t\t\t}\n\n\t\t\tthis.boneInverses.push( inverse );\n\n\t\t}\n\n\t}\n\n\tpose() {\n\n\t\t// recover the bind-time world matrices\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone ) {\n\n\t\t\t\tbone.matrixWorld.copy( this.boneInverses[ i ] ).invert();\n\n\t\t\t}\n\n\t\t}\n\n\t\t// compute the local matrices, positions, rotations and scales\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone ) {\n\n\t\t\t\tif ( bone.parent && bone.parent.isBone ) {\n\n\t\t\t\t\tbone.matrix.copy( bone.parent.matrixWorld ).invert();\n\t\t\t\t\tbone.matrix.multiply( bone.matrixWorld );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbone.matrix.copy( bone.matrixWorld );\n\n\t\t\t\t}\n\n\t\t\t\tbone.matrix.decompose( bone.position, bone.quaternion, bone.scale );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tupdate() {\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\t\tconst boneMatrices = this.boneMatrices;\n\t\tconst boneTexture = this.boneTexture;\n\n\t\t// flatten bone matrices to array\n\n\t\tfor ( let i = 0, il = bones.length; i < il; i ++ ) {\n\n\t\t\t// compute the offset between the current and the original transform\n\n\t\t\tconst matrix = bones[ i ] ? bones[ i ].matrixWorld : _identityMatrix;\n\n\t\t\t_offsetMatrix.multiplyMatrices( matrix, boneInverses[ i ] );\n\t\t\t_offsetMatrix.toArray( boneMatrices, i * 16 );\n\n\t\t}\n\n\t\tif ( boneTexture !== null ) {\n\n\t\t\tboneTexture.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new Skeleton( this.bones, this.boneInverses );\n\n\t}\n\n\tcomputeBoneTexture() {\n\n\t\t// layout (1 matrix = 4 pixels)\n\t\t// RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)\n\t\t// with 8x8 pixel texture max 16 bones * 4 pixels = (8 * 8)\n\t\t// 16x16 pixel texture max 64 bones * 4 pixels = (16 * 16)\n\t\t// 32x32 pixel texture max 256 bones * 4 pixels = (32 * 32)\n\t\t// 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)\n\n\t\tlet size = Math.sqrt( this.bones.length * 4 ); // 4 pixels needed for 1 matrix\n\t\tsize = Math.ceil( size / 4 ) * 4;\n\t\tsize = Math.max( size, 4 );\n\n\t\tconst boneMatrices = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel\n\t\tboneMatrices.set( this.boneMatrices ); // copy current values\n\n\t\tconst boneTexture = new DataTexture( boneMatrices, size, size, RGBAFormat, FloatType );\n\t\tboneTexture.needsUpdate = true;\n\n\t\tthis.boneMatrices = boneMatrices;\n\t\tthis.boneTexture = boneTexture;\n\n\t\treturn this;\n\n\t}\n\n\tgetBoneByName( name ) {\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone.name === name ) {\n\n\t\t\t\treturn bone;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn undefined;\n\n\t}\n\n\tdispose( ) {\n\n\t\tif ( this.boneTexture !== null ) {\n\n\t\t\tthis.boneTexture.dispose();\n\n\t\t\tthis.boneTexture = null;\n\n\t\t}\n\n\t}\n\n\tfromJSON( json, bones ) {\n\n\t\tthis.uuid = json.uuid;\n\n\t\tfor ( let i = 0, l = json.bones.length; i < l; i ++ ) {\n\n\t\t\tconst uuid = json.bones[ i ];\n\t\t\tlet bone = bones[ uuid ];\n\n\t\t\tif ( bone === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Skeleton: No bone found with UUID:', uuid );\n\t\t\t\tbone = new Bone();\n\n\t\t\t}\n\n\t\t\tthis.bones.push( bone );\n\t\t\tthis.boneInverses.push( new Matrix4().fromArray( json.boneInverses[ i ] ) );\n\n\t\t}\n\n\t\tthis.init();\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.6,\n\t\t\t\ttype: 'Skeleton',\n\t\t\t\tgenerator: 'Skeleton.toJSON'\n\t\t\t},\n\t\t\tbones: [],\n\t\t\tboneInverses: []\n\t\t};\n\n\t\tdata.uuid = this.uuid;\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\n\t\tfor ( let i = 0, l = bones.length; i < l; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\t\t\tdata.bones.push( bone.uuid );\n\n\t\t\tconst boneInverse = boneInverses[ i ];\n\t\t\tdata.boneInverses.push( boneInverse.toArray() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass InstancedBufferAttribute extends BufferAttribute {\n\n\tconstructor( array, itemSize, normalized, meshPerAttribute = 1 ) {\n\n\t\tsuper( array, itemSize, normalized );\n\n\t\tthis.isInstancedBufferAttribute = true;\n\n\t\tthis.meshPerAttribute = meshPerAttribute;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.meshPerAttribute = this.meshPerAttribute;\n\n\t\tdata.isInstancedBufferAttribute = true;\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst _instanceLocalMatrix = /*@__PURE__*/ new Matrix4();\nconst _instanceWorldMatrix = /*@__PURE__*/ new Matrix4();\n\nconst _instanceIntersects = [];\n\nconst _box3 = /*@__PURE__*/ new Box3();\nconst _identity = /*@__PURE__*/ new Matrix4();\nconst _mesh$1 = /*@__PURE__*/ new Mesh();\nconst _sphere$3 = /*@__PURE__*/ new Sphere();\n\nclass InstancedMesh extends Mesh {\n\n\tconstructor( geometry, material, count ) {\n\n\t\tsuper( geometry, material );\n\n\t\tthis.isInstancedMesh = true;\n\n\t\tthis.instanceMatrix = new InstancedBufferAttribute( new Float32Array( count * 16 ), 16 );\n\t\tthis.instanceColor = null;\n\t\tthis.morphTexture = null;\n\n\t\tthis.count = count;\n\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.setMatrixAt( i, _identity );\n\n\t\t}\n\n\t}\n\n\tcomputeBoundingBox() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst count = this.count;\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tif ( geometry.boundingBox === null ) {\n\n\t\t\tgeometry.computeBoundingBox();\n\n\t\t}\n\n\t\tthis.boundingBox.makeEmpty();\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.getMatrixAt( i, _instanceLocalMatrix );\n\n\t\t\t_box3.copy( geometry.boundingBox ).applyMatrix4( _instanceLocalMatrix );\n\n\t\t\tthis.boundingBox.union( _box3 );\n\n\t\t}\n\n\t}\n\n\tcomputeBoundingSphere() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst count = this.count;\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tif ( geometry.boundingSphere === null ) {\n\n\t\t\tgeometry.computeBoundingSphere();\n\n\t\t}\n\n\t\tthis.boundingSphere.makeEmpty();\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.getMatrixAt( i, _instanceLocalMatrix );\n\n\t\t\t_sphere$3.copy( geometry.boundingSphere ).applyMatrix4( _instanceLocalMatrix );\n\n\t\t\tthis.boundingSphere.union( _sphere$3 );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.instanceMatrix.copy( source.instanceMatrix );\n\n\t\tif ( source.morphTexture !== null ) this.morphTexture = source.morphTexture.clone();\n\t\tif ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone();\n\n\t\tthis.count = source.count;\n\n\t\tif ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();\n\t\tif ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();\n\n\t\treturn this;\n\n\t}\n\n\tgetColorAt( index, color ) {\n\n\t\tcolor.fromArray( this.instanceColor.array, index * 3 );\n\n\t}\n\n\tgetMatrixAt( index, matrix ) {\n\n\t\tmatrix.fromArray( this.instanceMatrix.array, index * 16 );\n\n\t}\n\n\tgetMorphAt( index, object ) {\n\n\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\tconst array = this.morphTexture.source.data.data;\n\n\t\tconst len = objectInfluences.length + 1; // All influences + the baseInfluenceSum\n\n\t\tconst dataIndex = index * len + 1; // Skip the baseInfluenceSum at the beginning\n\n\t\tfor ( let i = 0; i < objectInfluences.length; i ++ ) {\n\n\t\t\tobjectInfluences[ i ] = array[ dataIndex + i ];\n\n\t\t}\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst raycastTimes = this.count;\n\n\t\t_mesh$1.geometry = this.geometry;\n\t\t_mesh$1.material = this.material;\n\n\t\tif ( _mesh$1.material === undefined ) return;\n\n\t\t// test with bounding sphere first\n\n\t\tif ( this.boundingSphere === null ) this.computeBoundingSphere();\n\n\t\t_sphere$3.copy( this.boundingSphere );\n\t\t_sphere$3.applyMatrix4( matrixWorld );\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$3 ) === false ) return;\n\n\t\t// now test each instance\n\n\t\tfor ( let instanceId = 0; instanceId < raycastTimes; instanceId ++ ) {\n\n\t\t\t// calculate the world matrix for each instance\n\n\t\t\tthis.getMatrixAt( instanceId, _instanceLocalMatrix );\n\n\t\t\t_instanceWorldMatrix.multiplyMatrices( matrixWorld, _instanceLocalMatrix );\n\n\t\t\t// the mesh represents this single instance\n\n\t\t\t_mesh$1.matrixWorld = _instanceWorldMatrix;\n\n\t\t\t_mesh$1.raycast( raycaster, _instanceIntersects );\n\n\t\t\t// process the result of raycast\n\n\t\t\tfor ( let i = 0, l = _instanceIntersects.length; i < l; i ++ ) {\n\n\t\t\t\tconst intersect = _instanceIntersects[ i ];\n\t\t\t\tintersect.instanceId = instanceId;\n\t\t\t\tintersect.object = this;\n\t\t\t\tintersects.push( intersect );\n\n\t\t\t}\n\n\t\t\t_instanceIntersects.length = 0;\n\n\t\t}\n\n\t}\n\n\tsetColorAt( index, color ) {\n\n\t\tif ( this.instanceColor === null ) {\n\n\t\t\tthis.instanceColor = new InstancedBufferAttribute( new Float32Array( this.instanceMatrix.count * 3 ).fill( 1 ), 3 );\n\n\t\t}\n\n\t\tcolor.toArray( this.instanceColor.array, index * 3 );\n\n\t}\n\n\tsetMatrixAt( index, matrix ) {\n\n\t\tmatrix.toArray( this.instanceMatrix.array, index * 16 );\n\n\t}\n\n\tsetMorphAt( index, object ) {\n\n\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\tconst len = objectInfluences.length + 1; // morphBaseInfluence + all influences\n\n\t\tif ( this.morphTexture === null ) {\n\n\t\t\tthis.morphTexture = new DataTexture( new Float32Array( len * this.count ), len, this.count, RedFormat, FloatType );\n\n\t\t}\n\n\t\tconst array = this.morphTexture.source.data.data;\n\n\t\tlet morphInfluencesSum = 0;\n\n\t\tfor ( let i = 0; i < objectInfluences.length; i ++ ) {\n\n\t\t\tmorphInfluencesSum += objectInfluences[ i ];\n\n\t\t}\n\n\t\tconst morphBaseInfluence = this.geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\n\t\tconst dataIndex = len * index;\n\n\t\tarray[ dataIndex ] = morphBaseInfluence;\n\n\t\tarray.set( objectInfluences, dataIndex + 1 );\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t\tif ( this.morphTexture !== null ) {\n\n\t\t\tthis.morphTexture.dispose();\n\t\t\tthis.morphTexture = null;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nfunction ascIdSort( a, b ) {\n\n\treturn a - b;\n\n}\n\nfunction sortOpaque( a, b ) {\n\n\treturn a.z - b.z;\n\n}\n\nfunction sortTransparent( a, b ) {\n\n\treturn b.z - a.z;\n\n}\n\nclass MultiDrawRenderList {\n\n\tconstructor() {\n\n\t\tthis.index = 0;\n\t\tthis.pool = [];\n\t\tthis.list = [];\n\n\t}\n\n\tpush( start, count, z, index ) {\n\n\t\tconst pool = this.pool;\n\t\tconst list = this.list;\n\t\tif ( this.index >= pool.length ) {\n\n\t\t\tpool.push( {\n\n\t\t\t\tstart: - 1,\n\t\t\t\tcount: - 1,\n\t\t\t\tz: - 1,\n\t\t\t\tindex: - 1,\n\n\t\t\t} );\n\n\t\t}\n\n\t\tconst item = pool[ this.index ];\n\t\tlist.push( item );\n\t\tthis.index ++;\n\n\t\titem.start = start;\n\t\titem.count = count;\n\t\titem.z = z;\n\t\titem.index = index;\n\n\t}\n\n\treset() {\n\n\t\tthis.list.length = 0;\n\t\tthis.index = 0;\n\n\t}\n\n}\n\nconst _matrix$1 = /*@__PURE__*/ new Matrix4();\nconst _whiteColor = /*@__PURE__*/ new Color( 1, 1, 1 );\nconst _frustum = /*@__PURE__*/ new Frustum();\nconst _box$1 = /*@__PURE__*/ new Box3();\nconst _sphere$2 = /*@__PURE__*/ new Sphere();\nconst _vector$5 = /*@__PURE__*/ new Vector3();\nconst _forward = /*@__PURE__*/ new Vector3();\nconst _temp = /*@__PURE__*/ new Vector3();\nconst _renderList = /*@__PURE__*/ new MultiDrawRenderList();\nconst _mesh = /*@__PURE__*/ new Mesh();\nconst _batchIntersects = [];\n\n// copies data from attribute \"src\" into \"target\" starting at \"targetOffset\"\nfunction copyAttributeData( src, target, targetOffset = 0 ) {\n\n\tconst itemSize = target.itemSize;\n\tif ( src.isInterleavedBufferAttribute || src.array.constructor !== target.array.constructor ) {\n\n\t\t// use the component getters and setters if the array data cannot\n\t\t// be copied directly\n\t\tconst vertexCount = src.count;\n\t\tfor ( let i = 0; i < vertexCount; i ++ ) {\n\n\t\t\tfor ( let c = 0; c < itemSize; c ++ ) {\n\n\t\t\t\ttarget.setComponent( i + targetOffset, c, src.getComponent( i, c ) );\n\n\t\t\t}\n\n\t\t}\n\n\t} else {\n\n\t\t// faster copy approach using typed array set function\n\t\ttarget.array.set( src.array, targetOffset * itemSize );\n\n\t}\n\n\ttarget.needsUpdate = true;\n\n}\n\n// safely copies array contents to a potentially smaller array\nfunction copyArrayContents( src, target ) {\n\n\tif ( src.constructor !== target.constructor ) {\n\n\t\t// if arrays are of a different type (eg due to index size increasing) then data must be per-element copied\n\t\tconst len = Math.min( src.length, target.length );\n\t\tfor ( let i = 0; i < len; i ++ ) {\n\n\t\t\ttarget[ i ] = src[ i ];\n\n\t\t}\n\n\t} else {\n\n\t\t// if the arrays use the same data layout we can use a fast block copy\n\t\tconst len = Math.min( src.length, target.length );\n\t\ttarget.set( new src.constructor( src.buffer, 0, len ) );\n\n\t}\n\n}\n\nclass BatchedMesh extends Mesh {\n\n\tget maxInstanceCount() {\n\n\t\treturn this._maxInstanceCount;\n\n\t}\n\n\tget instanceCount() {\n\n\t\treturn this._instanceInfo.length - this._availableInstanceIds.length;\n\n\t}\n\n\tget unusedVertexCount() {\n\n\t\treturn this._maxVertexCount - this._nextVertexStart;\n\n\t}\n\n\tget unusedIndexCount() {\n\n\t\treturn this._maxIndexCount - this._nextIndexStart;\n\n\t}\n\n\tconstructor( maxInstanceCount, maxVertexCount, maxIndexCount = maxVertexCount * 2, material ) {\n\n\t\tsuper( new BufferGeometry(), material );\n\n\t\tthis.isBatchedMesh = true;\n\t\tthis.perObjectFrustumCulled = true;\n\t\tthis.sortObjects = true;\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\t\tthis.customSort = null;\n\n\t\t// stores visible, active, and geometry id per instance and reserved buffer ranges for geometries\n\t\tthis._instanceInfo = [];\n\t\tthis._geometryInfo = [];\n\n\t\t// instance, geometry ids that have been set as inactive, and are available to be overwritten\n\t\tthis._availableInstanceIds = [];\n\t\tthis._availableGeometryIds = [];\n\n\t\t// used to track where the next point is that geometry should be inserted\n\t\tthis._nextIndexStart = 0;\n\t\tthis._nextVertexStart = 0;\n\t\tthis._geometryCount = 0;\n\n\t\t// flags\n\t\tthis._visibilityChanged = true;\n\t\tthis._geometryInitialized = false;\n\n\t\t// cached user options\n\t\tthis._maxInstanceCount = maxInstanceCount;\n\t\tthis._maxVertexCount = maxVertexCount;\n\t\tthis._maxIndexCount = maxIndexCount;\n\n\t\t// buffers for multi draw\n\t\tthis._multiDrawCounts = new Int32Array( maxInstanceCount );\n\t\tthis._multiDrawStarts = new Int32Array( maxInstanceCount );\n\t\tthis._multiDrawCount = 0;\n\t\tthis._multiDrawInstances = null;\n\n\t\t// Local matrix per geometry by using data texture\n\t\tthis._matricesTexture = null;\n\t\tthis._indirectTexture = null;\n\t\tthis._colorsTexture = null;\n\n\t\tthis._initMatricesTexture();\n\t\tthis._initIndirectTexture();\n\n\t}\n\n\t_initMatricesTexture() {\n\n\t\t// layout (1 matrix = 4 pixels)\n\t\t// RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)\n\t\t// with 8x8 pixel texture max 16 matrices * 4 pixels = (8 * 8)\n\t\t// 16x16 pixel texture max 64 matrices * 4 pixels = (16 * 16)\n\t\t// 32x32 pixel texture max 256 matrices * 4 pixels = (32 * 32)\n\t\t// 64x64 pixel texture max 1024 matrices * 4 pixels = (64 * 64)\n\n\t\tlet size = Math.sqrt( this._maxInstanceCount * 4 ); // 4 pixels needed for 1 matrix\n\t\tsize = Math.ceil( size / 4 ) * 4;\n\t\tsize = Math.max( size, 4 );\n\n\t\tconst matricesArray = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel\n\t\tconst matricesTexture = new DataTexture( matricesArray, size, size, RGBAFormat, FloatType );\n\n\t\tthis._matricesTexture = matricesTexture;\n\n\t}\n\n\t_initIndirectTexture() {\n\n\t\tlet size = Math.sqrt( this._maxInstanceCount );\n\t\tsize = Math.ceil( size );\n\n\t\tconst indirectArray = new Uint32Array( size * size );\n\t\tconst indirectTexture = new DataTexture( indirectArray, size, size, RedIntegerFormat, UnsignedIntType );\n\n\t\tthis._indirectTexture = indirectTexture;\n\n\t}\n\n\t_initColorsTexture() {\n\n\t\tlet size = Math.sqrt( this._maxInstanceCount );\n\t\tsize = Math.ceil( size );\n\n\t\t// 4 floats per RGBA pixel initialized to white\n\t\tconst colorsArray = new Float32Array( size * size * 4 ).fill( 1 );\n\t\tconst colorsTexture = new DataTexture( colorsArray, size, size, RGBAFormat, FloatType );\n\t\tcolorsTexture.colorSpace = ColorManagement.workingColorSpace;\n\n\t\tthis._colorsTexture = colorsTexture;\n\n\t}\n\n\t_initializeGeometry( reference ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst maxVertexCount = this._maxVertexCount;\n\t\tconst maxIndexCount = this._maxIndexCount;\n\t\tif ( this._geometryInitialized === false ) {\n\n\t\t\tfor ( const attributeName in reference.attributes ) {\n\n\t\t\t\tconst srcAttribute = reference.getAttribute( attributeName );\n\t\t\t\tconst { array, itemSize, normalized } = srcAttribute;\n\n\t\t\t\tconst dstArray = new array.constructor( maxVertexCount * itemSize );\n\t\t\t\tconst dstAttribute = new BufferAttribute( dstArray, itemSize, normalized );\n\n\t\t\t\tgeometry.setAttribute( attributeName, dstAttribute );\n\n\t\t\t}\n\n\t\t\tif ( reference.getIndex() !== null ) {\n\n\t\t\t\t// Reserve last u16 index for primitive restart.\n\t\t\t\tconst indexArray = maxVertexCount > 65535\n\t\t\t\t\t? new Uint32Array( maxIndexCount )\n\t\t\t\t\t: new Uint16Array( maxIndexCount );\n\n\t\t\t\tgeometry.setIndex( new BufferAttribute( indexArray, 1 ) );\n\n\t\t\t}\n\n\t\t\tthis._geometryInitialized = true;\n\n\t\t}\n\n\t}\n\n\t// Make sure the geometry is compatible with the existing combined geometry attributes\n\t_validateGeometry( geometry ) {\n\n\t\t// check to ensure the geometries are using consistent attributes and indices\n\t\tconst batchGeometry = this.geometry;\n\t\tif ( Boolean( geometry.getIndex() ) !== Boolean( batchGeometry.getIndex() ) ) {\n\n\t\t\tthrow new Error( 'BatchedMesh: All geometries must consistently have \"index\".' );\n\n\t\t}\n\n\t\tfor ( const attributeName in batchGeometry.attributes ) {\n\n\t\t\tif ( ! geometry.hasAttribute( attributeName ) ) {\n\n\t\t\t\tthrow new Error( `BatchedMesh: Added geometry missing \"${ attributeName }\". All geometries must have consistent attributes.` );\n\n\t\t\t}\n\n\t\t\tconst srcAttribute = geometry.getAttribute( attributeName );\n\t\t\tconst dstAttribute = batchGeometry.getAttribute( attributeName );\n\t\t\tif ( srcAttribute.itemSize !== dstAttribute.itemSize || srcAttribute.normalized !== dstAttribute.normalized ) {\n\n\t\t\t\tthrow new Error( 'BatchedMesh: All attributes must have a consistent itemSize and normalized value.' );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tsetCustomSort( func ) {\n\n\t\tthis.customSort = func;\n\t\treturn this;\n\n\t}\n\n\tcomputeBoundingBox() {\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tconst boundingBox = this.boundingBox;\n\t\tconst instanceInfo = this._instanceInfo;\n\n\t\tboundingBox.makeEmpty();\n\t\tfor ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {\n\n\t\t\tif ( instanceInfo[ i ].active === false ) continue;\n\n\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\tthis.getBoundingBoxAt( geometryId, _box$1 ).applyMatrix4( _matrix$1 );\n\t\t\tboundingBox.union( _box$1 );\n\n\t\t}\n\n\t}\n\n\tcomputeBoundingSphere() {\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tconst boundingSphere = this.boundingSphere;\n\t\tconst instanceInfo = this._instanceInfo;\n\n\t\tboundingSphere.makeEmpty();\n\t\tfor ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {\n\n\t\t\tif ( instanceInfo[ i ].active === false ) continue;\n\n\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\tthis.getBoundingSphereAt( geometryId, _sphere$2 ).applyMatrix4( _matrix$1 );\n\t\t\tboundingSphere.union( _sphere$2 );\n\n\t\t}\n\n\t}\n\n\taddInstance( geometryId ) {\n\n\t\tconst atCapacity = this._instanceInfo.length >= this.maxInstanceCount;\n\n\t\t// ensure we're not over geometry\n\t\tif ( atCapacity && this._availableInstanceIds.length === 0 ) {\n\n\t\t\tthrow new Error( 'BatchedMesh: Maximum item count reached.' );\n\n\t\t}\n\n\t\tconst instanceInfo = {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tgeometryIndex: geometryId,\n\t\t};\n\n\t\tlet drawId = null;\n\n\t\t// Prioritize using previously freed instance ids\n\t\tif ( this._availableInstanceIds.length > 0 ) {\n\n\t\t\tthis._availableInstanceIds.sort( ascIdSort );\n\n\t\t\tdrawId = this._availableInstanceIds.shift();\n\t\t\tthis._instanceInfo[ drawId ] = instanceInfo;\n\n\t\t} else {\n\n\t\t\tdrawId = this._instanceInfo.length;\n\t\t\tthis._instanceInfo.push( instanceInfo );\n\n\t\t}\n\n\t\tconst matricesTexture = this._matricesTexture;\n\t\t_matrix$1.identity().toArray( matricesTexture.image.data, drawId * 16 );\n\t\tmatricesTexture.needsUpdate = true;\n\n\t\tconst colorsTexture = this._colorsTexture;\n\t\tif ( colorsTexture ) {\n\n\t\t\t_whiteColor.toArray( colorsTexture.image.data, drawId * 4 );\n\t\t\tcolorsTexture.needsUpdate = true;\n\n\t\t}\n\n\t\tthis._visibilityChanged = true;\n\t\treturn drawId;\n\n\t}\n\n\taddGeometry( geometry, reservedVertexCount = - 1, reservedIndexCount = - 1 ) {\n\n\t\tthis._initializeGeometry( geometry );\n\n\t\tthis._validateGeometry( geometry );\n\n\t\tconst geometryInfo = {\n\t\t\t// geometry information\n\t\t\tvertexStart: - 1,\n\t\t\tvertexCount: - 1,\n\t\t\treservedVertexCount: - 1,\n\n\t\t\tindexStart: - 1,\n\t\t\tindexCount: - 1,\n\t\t\treservedIndexCount: - 1,\n\n\t\t\t// draw range information\n\t\t\tstart: - 1,\n\t\t\tcount: - 1,\n\n\t\t\t// state\n\t\t\tboundingBox: null,\n\t\t\tboundingSphere: null,\n\t\t\tactive: true,\n\t\t};\n\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tgeometryInfo.vertexStart = this._nextVertexStart;\n\t\tgeometryInfo.reservedVertexCount = reservedVertexCount === - 1 ? geometry.getAttribute( 'position' ).count : reservedVertexCount;\n\n\t\tconst index = geometry.getIndex();\n\t\tconst hasIndex = index !== null;\n\t\tif ( hasIndex ) {\n\n\t\t\tgeometryInfo.indexStart = this._nextIndexStart;\n\t\t\tgeometryInfo.reservedIndexCount = reservedIndexCount === - 1 ? index.count : reservedIndexCount;\n\n\t\t}\n\n\t\tif (\n\t\t\tgeometryInfo.indexStart !== - 1 &&\n\t\t\tgeometryInfo.indexStart + geometryInfo.reservedIndexCount > this._maxIndexCount ||\n\t\t\tgeometryInfo.vertexStart + geometryInfo.reservedVertexCount > this._maxVertexCount\n\t\t) {\n\n\t\t\tthrow new Error( 'BatchedMesh: Reserved space request exceeds the maximum buffer size.' );\n\n\t\t}\n\n\t\t// update id\n\t\tlet geometryId;\n\t\tif ( this._availableGeometryIds.length > 0 ) {\n\n\t\t\tthis._availableGeometryIds.sort( ascIdSort );\n\n\t\t\tgeometryId = this._availableGeometryIds.shift();\n\t\t\tgeometryInfoList[ geometryId ] = geometryInfo;\n\n\n\t\t} else {\n\n\t\t\tgeometryId = this._geometryCount;\n\t\t\tthis._geometryCount ++;\n\t\t\tgeometryInfoList.push( geometryInfo );\n\n\t\t}\n\n\t\t// update the geometry\n\t\tthis.setGeometryAt( geometryId, geometry );\n\n\t\t// increment the next geometry position\n\t\tthis._nextIndexStart = geometryInfo.indexStart + geometryInfo.reservedIndexCount;\n\t\tthis._nextVertexStart = geometryInfo.vertexStart + geometryInfo.reservedVertexCount;\n\n\t\treturn geometryId;\n\n\t}\n\n\tsetGeometryAt( geometryId, geometry ) {\n\n\t\tif ( geometryId >= this._geometryCount ) {\n\n\t\t\tthrow new Error( 'BatchedMesh: Maximum geometry count reached.' );\n\n\t\t}\n\n\t\tthis._validateGeometry( geometry );\n\n\t\tconst batchGeometry = this.geometry;\n\t\tconst hasIndex = batchGeometry.getIndex() !== null;\n\t\tconst dstIndex = batchGeometry.getIndex();\n\t\tconst srcIndex = geometry.getIndex();\n\t\tconst geometryInfo = this._geometryInfo[ geometryId ];\n\t\tif (\n\t\t\thasIndex &&\n\t\t\tsrcIndex.count > geometryInfo.reservedIndexCount ||\n\t\t\tgeometry.attributes.position.count > geometryInfo.reservedVertexCount\n\t\t) {\n\n\t\t\tthrow new Error( 'BatchedMesh: Reserved space not large enough for provided geometry.' );\n\n\t\t}\n\n\t\t// copy geometry buffer data over\n\t\tconst vertexStart = geometryInfo.vertexStart;\n\t\tconst reservedVertexCount = geometryInfo.reservedVertexCount;\n\t\tgeometryInfo.vertexCount = geometry.getAttribute( 'position' ).count;\n\n\t\tfor ( const attributeName in batchGeometry.attributes ) {\n\n\t\t\t// copy attribute data\n\t\t\tconst srcAttribute = geometry.getAttribute( attributeName );\n\t\t\tconst dstAttribute = batchGeometry.getAttribute( attributeName );\n\t\t\tcopyAttributeData( srcAttribute, dstAttribute, vertexStart );\n\n\t\t\t// fill the rest in with zeroes\n\t\t\tconst itemSize = srcAttribute.itemSize;\n\t\t\tfor ( let i = srcAttribute.count, l = reservedVertexCount; i < l; i ++ ) {\n\n\t\t\t\tconst index = vertexStart + i;\n\t\t\t\tfor ( let c = 0; c < itemSize; c ++ ) {\n\n\t\t\t\t\tdstAttribute.setComponent( index, c, 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tdstAttribute.needsUpdate = true;\n\t\t\tdstAttribute.addUpdateRange( vertexStart * itemSize, reservedVertexCount * itemSize );\n\n\t\t}\n\n\t\t// copy index\n\t\tif ( hasIndex ) {\n\n\t\t\tconst indexStart = geometryInfo.indexStart;\n\t\t\tconst reservedIndexCount = geometryInfo.reservedIndexCount;\n\t\t\tgeometryInfo.indexCount = geometry.getIndex().count;\n\n\t\t\t// copy index data over\n\t\t\tfor ( let i = 0; i < srcIndex.count; i ++ ) {\n\n\t\t\t\tdstIndex.setX( indexStart + i, vertexStart + srcIndex.getX( i ) );\n\n\t\t\t}\n\n\t\t\t// fill the rest in with zeroes\n\t\t\tfor ( let i = srcIndex.count, l = reservedIndexCount; i < l; i ++ ) {\n\n\t\t\t\tdstIndex.setX( indexStart + i, vertexStart );\n\n\t\t\t}\n\n\t\t\tdstIndex.needsUpdate = true;\n\t\t\tdstIndex.addUpdateRange( indexStart, geometryInfo.reservedIndexCount );\n\n\t\t}\n\n\t\t// update the draw range\n\t\tgeometryInfo.start = hasIndex ? geometryInfo.indexStart : geometryInfo.vertexStart;\n\t\tgeometryInfo.count = hasIndex ? geometryInfo.indexCount : geometryInfo.vertexCount;\n\n\t\t// store the bounding boxes\n\t\tgeometryInfo.boundingBox = null;\n\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\tgeometryInfo.boundingBox = geometry.boundingBox.clone();\n\n\t\t}\n\n\t\tgeometryInfo.boundingSphere = null;\n\t\tif ( geometry.boundingSphere !== null ) {\n\n\t\t\tgeometryInfo.boundingSphere = geometry.boundingSphere.clone();\n\n\t\t}\n\n\t\tthis._visibilityChanged = true;\n\t\treturn geometryId;\n\n\t}\n\n\tdeleteGeometry( geometryId ) {\n\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tif ( geometryId >= geometryInfoList.length || geometryInfoList[ geometryId ].active === false ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\t// delete any instances associated with this geometry\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tfor ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {\n\n\t\t\tif ( instanceInfo[ i ].geometryIndex === geometryId ) {\n\n\t\t\t\tthis.deleteInstance( i );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometryInfoList[ geometryId ].active = false;\n\t\tthis._availableGeometryIds.push( geometryId );\n\t\tthis._visibilityChanged = true;\n\n\t\treturn this;\n\n\t}\n\n\tdeleteInstance( instanceId ) {\n\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tif ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tinstanceInfo[ instanceId ].active = false;\n\t\tthis._availableInstanceIds.push( instanceId );\n\t\tthis._visibilityChanged = true;\n\n\t\treturn this;\n\n\t}\n\n\toptimize() {\n\n\t\t// track the next indices to copy data to\n\t\tlet nextVertexStart = 0;\n\t\tlet nextIndexStart = 0;\n\n\t\t// Iterate over all geometry ranges in order sorted from earliest in the geometry buffer to latest\n\t\t// in the geometry buffer. Because draw range objects can be reused there is no guarantee of their order.\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tconst indices = geometryInfoList\n\t\t\t.map( ( e, i ) => i )\n\t\t\t.sort( ( a, b ) => {\n\n\t\t\t\treturn geometryInfoList[ a ].vertexStart - geometryInfoList[ b ].vertexStart;\n\n\t\t\t} );\n\n\t\tconst geometry = this.geometry;\n\t\tfor ( let i = 0, l = geometryInfoList.length; i < l; i ++ ) {\n\n\t\t\t// if a geometry range is inactive then don't copy anything\n\t\t\tconst index = indices[ i ];\n\t\t\tconst geometryInfo = geometryInfoList[ index ];\n\t\t\tif ( geometryInfo.active === false ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\t// if a geometry contains an index buffer then shift it, as well\n\t\t\tif ( geometry.index !== null ) {\n\n\t\t\t\tif ( geometryInfo.indexStart !== nextIndexStart ) {\n\n\t\t\t\t\tconst { indexStart, vertexStart, reservedIndexCount } = geometryInfo;\n\t\t\t\t\tconst index = geometry.index;\n\t\t\t\t\tconst array = index.array;\n\n\t\t\t\t\t// shift the index pointers based on how the vertex data will shift\n\t\t\t\t\t// adjusting the index must happen first so the original vertex start value is available\n\t\t\t\t\tconst elementDelta = nextVertexStart - vertexStart;\n\t\t\t\t\tfor ( let j = indexStart; j < indexStart + reservedIndexCount; j ++ ) {\n\n\t\t\t\t\t\tarray[ j ] = array[ j ] + elementDelta;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tindex.array.copyWithin( nextIndexStart, indexStart, indexStart + reservedIndexCount );\n\t\t\t\t\tindex.addUpdateRange( nextIndexStart, reservedIndexCount );\n\n\t\t\t\t\tgeometryInfo.indexStart = nextIndexStart;\n\n\t\t\t\t}\n\n\t\t\t\tnextIndexStart += geometryInfo.reservedIndexCount;\n\n\t\t\t}\n\n\t\t\t// if a geometry needs to be moved then copy attribute data to overwrite unused space\n\t\t\tif ( geometryInfo.vertexStart !== nextVertexStart ) {\n\n\t\t\t\tconst { vertexStart, reservedVertexCount } = geometryInfo;\n\t\t\t\tconst attributes = geometry.attributes;\n\t\t\t\tfor ( const key in attributes ) {\n\n\t\t\t\t\tconst attribute = attributes[ key ];\n\t\t\t\t\tconst { array, itemSize } = attribute;\n\t\t\t\t\tarray.copyWithin( nextVertexStart * itemSize, vertexStart * itemSize, ( vertexStart + reservedVertexCount ) * itemSize );\n\t\t\t\t\tattribute.addUpdateRange( nextVertexStart * itemSize, reservedVertexCount * itemSize );\n\n\t\t\t\t}\n\n\t\t\t\tgeometryInfo.vertexStart = nextVertexStart;\n\n\t\t\t}\n\n\t\t\tnextVertexStart += geometryInfo.reservedVertexCount;\n\t\t\tgeometryInfo.start = geometry.index ? geometryInfo.indexStart : geometryInfo.vertexStart;\n\n\t\t\t// step the next geometry points to the shifted position\n\t\t\tthis._nextIndexStart = geometry.index ? geometryInfo.indexStart + geometryInfo.reservedIndexCount : 0;\n\t\t\tthis._nextVertexStart = geometryInfo.vertexStart + geometryInfo.reservedVertexCount;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// get bounding box and compute it if it doesn't exist\n\tgetBoundingBoxAt( geometryId, target ) {\n\n\t\tif ( geometryId >= this._geometryCount ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// compute bounding box\n\t\tconst geometry = this.geometry;\n\t\tconst geometryInfo = this._geometryInfo[ geometryId ];\n\t\tif ( geometryInfo.boundingBox === null ) {\n\n\t\t\tconst box = new Box3();\n\t\t\tconst index = geometry.index;\n\t\t\tconst position = geometry.attributes.position;\n\t\t\tfor ( let i = geometryInfo.start, l = geometryInfo.start + geometryInfo.count; i < l; i ++ ) {\n\n\t\t\t\tlet iv = i;\n\t\t\t\tif ( index ) {\n\n\t\t\t\t\tiv = index.getX( iv );\n\n\t\t\t\t}\n\n\t\t\t\tbox.expandByPoint( _vector$5.fromBufferAttribute( position, iv ) );\n\n\t\t\t}\n\n\t\t\tgeometryInfo.boundingBox = box;\n\n\t\t}\n\n\t\ttarget.copy( geometryInfo.boundingBox );\n\t\treturn target;\n\n\t}\n\n\t// get bounding sphere and compute it if it doesn't exist\n\tgetBoundingSphereAt( geometryId, target ) {\n\n\t\tif ( geometryId >= this._geometryCount ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// compute bounding sphere\n\t\tconst geometry = this.geometry;\n\t\tconst geometryInfo = this._geometryInfo[ geometryId ];\n\t\tif ( geometryInfo.boundingSphere === null ) {\n\n\t\t\tconst sphere = new Sphere();\n\t\t\tthis.getBoundingBoxAt( geometryId, _box$1 );\n\t\t\t_box$1.getCenter( sphere.center );\n\n\t\t\tconst index = geometry.index;\n\t\t\tconst position = geometry.attributes.position;\n\n\t\t\tlet maxRadiusSq = 0;\n\t\t\tfor ( let i = geometryInfo.start, l = geometryInfo.start + geometryInfo.count; i < l; i ++ ) {\n\n\t\t\t\tlet iv = i;\n\t\t\t\tif ( index ) {\n\n\t\t\t\t\tiv = index.getX( iv );\n\n\t\t\t\t}\n\n\t\t\t\t_vector$5.fromBufferAttribute( position, iv );\n\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, sphere.center.distanceToSquared( _vector$5 ) );\n\n\t\t\t}\n\n\t\t\tsphere.radius = Math.sqrt( maxRadiusSq );\n\t\t\tgeometryInfo.boundingSphere = sphere;\n\n\t\t}\n\n\t\ttarget.copy( geometryInfo.boundingSphere );\n\t\treturn target;\n\n\t}\n\n\tsetMatrixAt( instanceId, matrix ) {\n\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tconst matricesTexture = this._matricesTexture;\n\t\tconst matricesArray = this._matricesTexture.image.data;\n\t\tif ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tmatrix.toArray( matricesArray, instanceId * 16 );\n\t\tmatricesTexture.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\tgetMatrixAt( instanceId, matrix ) {\n\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tconst matricesArray = this._matricesTexture.image.data;\n\t\tif ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn matrix.fromArray( matricesArray, instanceId * 16 );\n\n\t}\n\n\tsetColorAt( instanceId, color ) {\n\n\t\tif ( this._colorsTexture === null ) {\n\n\t\t\tthis._initColorsTexture();\n\n\t\t}\n\n\t\tconst colorsTexture = this._colorsTexture;\n\t\tconst colorsArray = this._colorsTexture.image.data;\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tif ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tcolor.toArray( colorsArray, instanceId * 4 );\n\t\tcolorsTexture.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\tgetColorAt( instanceId, color ) {\n\n\t\tconst colorsArray = this._colorsTexture.image.data;\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tif ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn color.fromArray( colorsArray, instanceId * 4 );\n\n\t}\n\n\tsetVisibleAt( instanceId, value ) {\n\n\t\t// if the geometry is out of range, not active, or visibility state\n\t\t// does not change then return early\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tif (\n\t\t\tinstanceId >= instanceInfo.length ||\n\t\t\tinstanceInfo[ instanceId ].active === false ||\n\t\t\tinstanceInfo[ instanceId ].visible === value\n\t\t) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tinstanceInfo[ instanceId ].visible = value;\n\t\tthis._visibilityChanged = true;\n\n\t\treturn this;\n\n\t}\n\n\tgetVisibleAt( instanceId ) {\n\n\t\t// return early if the geometry is out of range or not active\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tif ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn instanceInfo[ instanceId ].visible;\n\n\t}\n\n\tsetGeometryIdAt( instanceId, geometryId ) {\n\n\t\t// return early if the geometry is out of range or not active\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tif ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// check if the provided geometryId is within the valid range\n\t\tif ( geometryId >= geometryInfoList.length || geometryInfoList[ geometryId ].active === false ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tinstanceInfo[ instanceId ].geometryIndex = geometryId;\n\n\t\treturn this;\n\n\t}\n\n\tgetGeometryIdAt( instanceId ) {\n\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tif ( instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {\n\n\t\t\treturn - 1;\n\n\t\t}\n\n\t\treturn instanceInfo[ instanceId ].geometryIndex;\n\n\t}\n\n\tgetGeometryRangeAt( geometryId, target = {} ) {\n\n\t\tif ( geometryId < 0 || geometryId >= this._geometryCount ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst geometryInfo = this._geometryInfo[ geometryId ];\n\t\ttarget.vertexStart = geometryInfo.vertexStart;\n\t\ttarget.vertexCount = geometryInfo.vertexCount;\n\t\ttarget.reservedVertexCount = geometryInfo.reservedVertexCount;\n\n\t\ttarget.indexStart = geometryInfo.indexStart;\n\t\ttarget.indexCount = geometryInfo.indexCount;\n\t\ttarget.reservedIndexCount = geometryInfo.reservedIndexCount;\n\n\t\ttarget.start = geometryInfo.start;\n\t\ttarget.count = geometryInfo.count;\n\n\t\treturn target;\n\n\t}\n\n\tsetInstanceCount( maxInstanceCount ) {\n\n\t\t// shrink the available instances as much as possible\n\t\tconst availableInstanceIds = this._availableInstanceIds;\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tavailableInstanceIds.sort( ascIdSort );\n\t\twhile ( availableInstanceIds[ availableInstanceIds.length - 1 ] === instanceInfo.length ) {\n\n\t\t\tinstanceInfo.pop();\n\t\t\tavailableInstanceIds.pop();\n\n\t\t}\n\n\t\t// throw an error if it can't be shrunk to the desired size\n\t\tif ( maxInstanceCount < instanceInfo.length ) {\n\n\t\t\tthrow new Error( `BatchedMesh: Instance ids outside the range ${ maxInstanceCount } are being used. Cannot shrink instance count.` );\n\n\t\t}\n\n\t\t// copy the multi draw counts\n\t\tconst multiDrawCounts = new Int32Array( maxInstanceCount );\n\t\tconst multiDrawStarts = new Int32Array( maxInstanceCount );\n\t\tcopyArrayContents( this._multiDrawCounts, multiDrawCounts );\n\t\tcopyArrayContents( this._multiDrawStarts, multiDrawStarts );\n\n\t\tthis._multiDrawCounts = multiDrawCounts;\n\t\tthis._multiDrawStarts = multiDrawStarts;\n\t\tthis._maxInstanceCount = maxInstanceCount;\n\n\t\t// update texture data for instance sampling\n\t\tconst indirectTexture = this._indirectTexture;\n\t\tconst matricesTexture = this._matricesTexture;\n\t\tconst colorsTexture = this._colorsTexture;\n\n\t\tindirectTexture.dispose();\n\t\tthis._initIndirectTexture();\n\t\tcopyArrayContents( indirectTexture.image.data, this._indirectTexture.image.data );\n\n\t\tmatricesTexture.dispose();\n\t\tthis._initMatricesTexture();\n\t\tcopyArrayContents( matricesTexture.image.data, this._matricesTexture.image.data );\n\n\t\tif ( colorsTexture ) {\n\n\t\t\tcolorsTexture.dispose();\n\t\t\tthis._initColorsTexture();\n\t\t\tcopyArrayContents( colorsTexture.image.data, this._colorsTexture.image.data );\n\n\t\t}\n\n\t}\n\n\tsetGeometrySize( maxVertexCount, maxIndexCount ) {\n\n\t\t// Check if we can shrink to the requested vertex attribute size\n\t\tconst validRanges = [ ...this._geometryInfo ].filter( info => info.active );\n\t\tconst requiredVertexLength = Math.max( ...validRanges.map( range => range.vertexStart + range.reservedVertexCount ) );\n\t\tif ( requiredVertexLength > maxVertexCount ) {\n\n\t\t\tthrow new Error( `BatchedMesh: Geometry vertex values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );\n\n\t\t}\n\n\t\t// Check if we can shrink to the requested index attribute size\n\t\tif ( this.geometry.index ) {\n\n\t\t\tconst requiredIndexLength = Math.max( ...validRanges.map( range => range.indexStart + range.reservedIndexCount ) );\n\t\t\tif ( requiredIndexLength > maxIndexCount ) {\n\n\t\t\t\tthrow new Error( `BatchedMesh: Geometry index values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\t// dispose of the previous geometry\n\t\tconst oldGeometry = this.geometry;\n\t\toldGeometry.dispose();\n\n\t\t// recreate the geometry needed based on the previous variant\n\t\tthis._maxVertexCount = maxVertexCount;\n\t\tthis._maxIndexCount = maxIndexCount;\n\n\t\tif ( this._geometryInitialized ) {\n\n\t\t\tthis._geometryInitialized = false;\n\t\t\tthis.geometry = new BufferGeometry();\n\t\t\tthis._initializeGeometry( oldGeometry );\n\n\t\t}\n\n\t\t// copy data from the previous geometry\n\t\tconst geometry = this.geometry;\n\t\tif ( oldGeometry.index ) {\n\n\t\t\tcopyArrayContents( oldGeometry.index.array, geometry.index.array );\n\n\t\t}\n\n\t\tfor ( const key in oldGeometry.attributes ) {\n\n\t\t\tcopyArrayContents( oldGeometry.attributes[ key ].array, geometry.attributes[ key ].array );\n\n\t\t}\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst batchGeometry = this.geometry;\n\n\t\t// iterate over each geometry\n\t\t_mesh.material = this.material;\n\t\t_mesh.geometry.index = batchGeometry.index;\n\t\t_mesh.geometry.attributes = batchGeometry.attributes;\n\t\tif ( _mesh.geometry.boundingBox === null ) {\n\n\t\t\t_mesh.geometry.boundingBox = new Box3();\n\n\t\t}\n\n\t\tif ( _mesh.geometry.boundingSphere === null ) {\n\n\t\t\t_mesh.geometry.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tfor ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {\n\n\t\t\tif ( ! instanceInfo[ i ].visible || ! instanceInfo[ i ].active ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\t\t\tconst geometryInfo = geometryInfoList[ geometryId ];\n\t\t\t_mesh.geometry.setDrawRange( geometryInfo.start, geometryInfo.count );\n\n\t\t\t// get the intersects\n\t\t\tthis.getMatrixAt( i, _mesh.matrixWorld ).premultiply( matrixWorld );\n\t\t\tthis.getBoundingBoxAt( geometryId, _mesh.geometry.boundingBox );\n\t\t\tthis.getBoundingSphereAt( geometryId, _mesh.geometry.boundingSphere );\n\t\t\t_mesh.raycast( raycaster, _batchIntersects );\n\n\t\t\t// add batch id to the intersects\n\t\t\tfor ( let j = 0, l = _batchIntersects.length; j < l; j ++ ) {\n\n\t\t\t\tconst intersect = _batchIntersects[ j ];\n\t\t\t\tintersect.object = this;\n\t\t\t\tintersect.batchId = i;\n\t\t\t\tintersects.push( intersect );\n\n\t\t\t}\n\n\t\t\t_batchIntersects.length = 0;\n\n\t\t}\n\n\t\t_mesh.material = null;\n\t\t_mesh.geometry.index = null;\n\t\t_mesh.geometry.attributes = {};\n\t\t_mesh.geometry.setDrawRange( 0, Infinity );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.geometry = source.geometry.clone();\n\t\tthis.perObjectFrustumCulled = source.perObjectFrustumCulled;\n\t\tthis.sortObjects = source.sortObjects;\n\t\tthis.boundingBox = source.boundingBox !== null ? source.boundingBox.clone() : null;\n\t\tthis.boundingSphere = source.boundingSphere !== null ? source.boundingSphere.clone() : null;\n\n\t\tthis._geometryInfo = source._geometryInfo.map( info => ( {\n\t\t\t...info,\n\n\t\t\tboundingBox: info.boundingBox !== null ? info.boundingBox.clone() : null,\n\t\t\tboundingSphere: info.boundingSphere !== null ? info.boundingSphere.clone() : null,\n\t\t} ) );\n\t\tthis._instanceInfo = source._instanceInfo.map( info => ( { ...info } ) );\n\n\t\tthis._maxInstanceCount = source._maxInstanceCount;\n\t\tthis._maxVertexCount = source._maxVertexCount;\n\t\tthis._maxIndexCount = source._maxIndexCount;\n\n\t\tthis._geometryInitialized = source._geometryInitialized;\n\t\tthis._geometryCount = source._geometryCount;\n\t\tthis._multiDrawCounts = source._multiDrawCounts.slice();\n\t\tthis._multiDrawStarts = source._multiDrawStarts.slice();\n\n\t\tthis._matricesTexture = source._matricesTexture.clone();\n\t\tthis._matricesTexture.image.data = this._matricesTexture.image.data.slice();\n\n\t\tif ( this._colorsTexture !== null ) {\n\n\t\t\tthis._colorsTexture = source._colorsTexture.clone();\n\t\t\tthis._colorsTexture.image.data = this._colorsTexture.image.data.slice();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\t// Assuming the geometry is not shared with other meshes\n\t\tthis.geometry.dispose();\n\n\t\tthis._matricesTexture.dispose();\n\t\tthis._matricesTexture = null;\n\n\t\tthis._indirectTexture.dispose();\n\t\tthis._indirectTexture = null;\n\n\t\tif ( this._colorsTexture !== null ) {\n\n\t\t\tthis._colorsTexture.dispose();\n\t\t\tthis._colorsTexture = null;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tonBeforeRender( renderer, scene, camera, geometry, material/*, _group*/ ) {\n\n\t\t// if visibility has not changed and frustum culling and object sorting is not required\n\t\t// then skip iterating over all items\n\t\tif ( ! this._visibilityChanged && ! this.perObjectFrustumCulled && ! this.sortObjects ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// the indexed version of the multi draw function requires specifying the start\n\t\t// offset in bytes.\n\t\tconst index = geometry.getIndex();\n\t\tconst bytesPerElement = index === null ? 1 : index.array.BYTES_PER_ELEMENT;\n\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tconst multiDrawStarts = this._multiDrawStarts;\n\t\tconst multiDrawCounts = this._multiDrawCounts;\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tconst perObjectFrustumCulled = this.perObjectFrustumCulled;\n\t\tconst indirectTexture = this._indirectTexture;\n\t\tconst indirectArray = indirectTexture.image.data;\n\n\t\t// prepare the frustum in the local frame\n\t\tif ( perObjectFrustumCulled ) {\n\n\t\t\t_matrix$1\n\t\t\t\t.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse )\n\t\t\t\t.multiply( this.matrixWorld );\n\t\t\t_frustum.setFromProjectionMatrix(\n\t\t\t\t_matrix$1,\n\t\t\t\trenderer.coordinateSystem\n\t\t\t);\n\n\t\t}\n\n\t\tlet multiDrawCount = 0;\n\t\tif ( this.sortObjects ) {\n\n\t\t\t// get the camera position in the local frame\n\t\t\t_matrix$1.copy( this.matrixWorld ).invert();\n\t\t\t_vector$5.setFromMatrixPosition( camera.matrixWorld ).applyMatrix4( _matrix$1 );\n\t\t\t_forward.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld ).transformDirection( _matrix$1 );\n\n\t\t\tfor ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {\n\n\t\t\t\tif ( instanceInfo[ i ].visible && instanceInfo[ i ].active ) {\n\n\t\t\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\n\t\t\t\t\t// get the bounds in world space\n\t\t\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\t\t\tthis.getBoundingSphereAt( geometryId, _sphere$2 ).applyMatrix4( _matrix$1 );\n\n\t\t\t\t\t// determine whether the batched geometry is within the frustum\n\t\t\t\t\tlet culled = false;\n\t\t\t\t\tif ( perObjectFrustumCulled ) {\n\n\t\t\t\t\t\tculled = ! _frustum.intersectsSphere( _sphere$2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! culled ) {\n\n\t\t\t\t\t\t// get the distance from camera used for sorting\n\t\t\t\t\t\tconst geometryInfo = geometryInfoList[ geometryId ];\n\t\t\t\t\t\tconst z = _temp.subVectors( _sphere$2.center, _vector$5 ).dot( _forward );\n\t\t\t\t\t\t_renderList.push( geometryInfo.start, geometryInfo.count, z, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Sort the draw ranges and prep for rendering\n\t\t\tconst list = _renderList.list;\n\t\t\tconst customSort = this.customSort;\n\t\t\tif ( customSort === null ) {\n\n\t\t\t\tlist.sort( material.transparent ? sortTransparent : sortOpaque );\n\n\t\t\t} else {\n\n\t\t\t\tcustomSort.call( this, list, camera );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = list.length; i < l; i ++ ) {\n\n\t\t\t\tconst item = list[ i ];\n\t\t\t\tmultiDrawStarts[ multiDrawCount ] = item.start * bytesPerElement;\n\t\t\t\tmultiDrawCounts[ multiDrawCount ] = item.count;\n\t\t\t\tindirectArray[ multiDrawCount ] = item.index;\n\t\t\t\tmultiDrawCount ++;\n\n\t\t\t}\n\n\t\t\t_renderList.reset();\n\n\t\t} else {\n\n\t\t\tfor ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {\n\n\t\t\t\tif ( instanceInfo[ i ].visible && instanceInfo[ i ].active ) {\n\n\t\t\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\n\t\t\t\t\t// determine whether the batched geometry is within the frustum\n\t\t\t\t\tlet culled = false;\n\t\t\t\t\tif ( perObjectFrustumCulled ) {\n\n\t\t\t\t\t\t// get the bounds in world space\n\t\t\t\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\t\t\t\tthis.getBoundingSphereAt( geometryId, _sphere$2 ).applyMatrix4( _matrix$1 );\n\t\t\t\t\t\tculled = ! _frustum.intersectsSphere( _sphere$2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! culled ) {\n\n\t\t\t\t\t\tconst geometryInfo = geometryInfoList[ geometryId ];\n\t\t\t\t\t\tmultiDrawStarts[ multiDrawCount ] = geometryInfo.start * bytesPerElement;\n\t\t\t\t\t\tmultiDrawCounts[ multiDrawCount ] = geometryInfo.count;\n\t\t\t\t\t\tindirectArray[ multiDrawCount ] = i;\n\t\t\t\t\t\tmultiDrawCount ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tindirectTexture.needsUpdate = true;\n\t\tthis._multiDrawCount = multiDrawCount;\n\t\tthis._visibilityChanged = false;\n\n\t}\n\n\tonBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial/* , group */ ) {\n\n\t\tthis.onBeforeRender( renderer, null, shadowCamera, geometry, depthMaterial );\n\n\t}\n\n}\n\nclass LineBasicMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'LineBasicMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isLineBasicMaterial = true;\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.map = null;\n\n\t\tthis.linewidth = 1;\n\t\tthis.linecap = 'round';\n\t\tthis.linejoin = 'round';\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.linewidth = source.linewidth;\n\t\tthis.linecap = source.linecap;\n\t\tthis.linejoin = source.linejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _vStart = /*@__PURE__*/ new Vector3();\nconst _vEnd = /*@__PURE__*/ new Vector3();\n\nconst _inverseMatrix$1 = /*@__PURE__*/ new Matrix4();\nconst _ray$1 = /*@__PURE__*/ new Ray();\nconst _sphere$1 = /*@__PURE__*/ new Sphere();\n\nconst _intersectPointOnRay = /*@__PURE__*/ new Vector3();\nconst _intersectPointOnSegment = /*@__PURE__*/ new Vector3();\n\nclass Line extends Object3D {\n\n\tconstructor( geometry = new BufferGeometry(), material = new LineBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\tthis.isLine = true;\n\n\t\tthis.type = 'Line';\n\n\t\tthis.geometry = geometry;\n\t\tthis.material = material;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\tcomputeLineDistances() {\n\n\t\tconst geometry = this.geometry;\n\n\t\t// we assume non-indexed geometry\n\n\t\tif ( geometry.index === null ) {\n\n\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\tconst lineDistances = [ 0 ];\n\n\t\t\tfor ( let i = 1, l = positionAttribute.count; i < l; i ++ ) {\n\n\t\t\t\t_vStart.fromBufferAttribute( positionAttribute, i - 1 );\n\t\t\t\t_vEnd.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\tlineDistances[ i ] = lineDistances[ i - 1 ];\n\t\t\t\tlineDistances[ i ] += _vStart.distanceTo( _vEnd );\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst threshold = raycaster.params.Line.threshold;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\t// Checking boundingSphere distance to ray\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere$1.copy( geometry.boundingSphere );\n\t\t_sphere$1.applyMatrix4( matrixWorld );\n\t\t_sphere$1.radius += threshold;\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$1 ) === false ) return;\n\n\t\t//\n\n\t\t_inverseMatrix$1.copy( matrixWorld ).invert();\n\t\t_ray$1.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$1 );\n\n\t\tconst localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );\n\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\tconst step = this.isLineSegments ? 2 : 1;\n\n\t\tconst index = geometry.index;\n\t\tconst attributes = geometry.attributes;\n\t\tconst positionAttribute = attributes.position;\n\n\t\tif ( index !== null ) {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end - 1; i < l; i += step ) {\n\n\t\t\t\tconst a = index.getX( i );\n\t\t\t\tconst b = index.getX( i + 1 );\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, a, b );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.isLineLoop ) {\n\n\t\t\t\tconst a = index.getX( end - 1 );\n\t\t\t\tconst b = index.getX( start );\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, a, b );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end - 1; i < l; i += step ) {\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, i, i + 1 );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.isLineLoop ) {\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, end - 1, start );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length > 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction checkIntersection( object, raycaster, ray, thresholdSq, a, b ) {\n\n\tconst positionAttribute = object.geometry.attributes.position;\n\n\t_vStart.fromBufferAttribute( positionAttribute, a );\n\t_vEnd.fromBufferAttribute( positionAttribute, b );\n\n\tconst distSq = ray.distanceSqToSegment( _vStart, _vEnd, _intersectPointOnRay, _intersectPointOnSegment );\n\n\tif ( distSq > thresholdSq ) return;\n\n\t_intersectPointOnRay.applyMatrix4( object.matrixWorld ); // Move back to world space for distance calculation\n\n\tconst distance = raycaster.ray.origin.distanceTo( _intersectPointOnRay );\n\n\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\treturn {\n\n\t\tdistance: distance,\n\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t// point: raycaster.ray.at( distance ),\n\t\tpoint: _intersectPointOnSegment.clone().applyMatrix4( object.matrixWorld ),\n\t\tindex: a,\n\t\tface: null,\n\t\tfaceIndex: null,\n\t\tbarycoord: null,\n\t\tobject: object\n\n\t};\n\n}\n\nconst _start = /*@__PURE__*/ new Vector3();\nconst _end = /*@__PURE__*/ new Vector3();\n\nclass LineSegments extends Line {\n\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\tthis.isLineSegments = true;\n\n\t\tthis.type = 'LineSegments';\n\n\t}\n\n\tcomputeLineDistances() {\n\n\t\tconst geometry = this.geometry;\n\n\t\t// we assume non-indexed geometry\n\n\t\tif ( geometry.index === null ) {\n\n\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\tconst lineDistances = [];\n\n\t\t\tfor ( let i = 0, l = positionAttribute.count; i < l; i += 2 ) {\n\n\t\t\t\t_start.fromBufferAttribute( positionAttribute, i );\n\t\t\t\t_end.fromBufferAttribute( positionAttribute, i + 1 );\n\n\t\t\t\tlineDistances[ i ] = ( i === 0 ) ? 0 : lineDistances[ i - 1 ];\n\t\t\t\tlineDistances[ i + 1 ] = lineDistances[ i ] + _start.distanceTo( _end );\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass LineLoop extends Line {\n\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\tthis.isLineLoop = true;\n\n\t\tthis.type = 'LineLoop';\n\n\t}\n\n}\n\nclass PointsMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'PointsMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isPointsMaterial = true;\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.map = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.size = 1;\n\t\tthis.sizeAttenuation = true;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.size = source.size;\n\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _inverseMatrix = /*@__PURE__*/ new Matrix4();\nconst _ray = /*@__PURE__*/ new Ray();\nconst _sphere = /*@__PURE__*/ new Sphere();\nconst _position$2 = /*@__PURE__*/ new Vector3();\n\nclass Points extends Object3D {\n\n\tconstructor( geometry = new BufferGeometry(), material = new PointsMaterial() ) {\n\n\t\tsuper();\n\n\t\tthis.isPoints = true;\n\n\t\tthis.type = 'Points';\n\n\t\tthis.geometry = geometry;\n\t\tthis.material = material;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst threshold = raycaster.params.Points.threshold;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\t// Checking boundingSphere distance to ray\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere.copy( geometry.boundingSphere );\n\t\t_sphere.applyMatrix4( matrixWorld );\n\t\t_sphere.radius += threshold;\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere ) === false ) return;\n\n\t\t//\n\n\t\t_inverseMatrix.copy( matrixWorld ).invert();\n\t\t_ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix );\n\n\t\tconst localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );\n\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\tconst index = geometry.index;\n\t\tconst attributes = geometry.attributes;\n\t\tconst positionAttribute = attributes.position;\n\n\t\tif ( index !== null ) {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, il = end; i < il; i ++ ) {\n\n\t\t\t\tconst a = index.getX( i );\n\n\t\t\t\t_position$2.fromBufferAttribute( positionAttribute, a );\n\n\t\t\t\ttestPoint( _position$2, a, localThresholdSq, matrixWorld, raycaster, intersects, this );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end; i < l; i ++ ) {\n\n\t\t\t\t_position$2.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\ttestPoint( _position$2, i, localThresholdSq, matrixWorld, raycaster, intersects, this );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length > 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction testPoint( point, index, localThresholdSq, matrixWorld, raycaster, intersects, object ) {\n\n\tconst rayPointDistanceSq = _ray.distanceSqToPoint( point );\n\n\tif ( rayPointDistanceSq < localThresholdSq ) {\n\n\t\tconst intersectPoint = new Vector3();\n\n\t\t_ray.closestPointToPoint( point, intersectPoint );\n\t\tintersectPoint.applyMatrix4( matrixWorld );\n\n\t\tconst distance = raycaster.ray.origin.distanceTo( intersectPoint );\n\n\t\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\t\tintersects.push( {\n\n\t\t\tdistance: distance,\n\t\t\tdistanceToRay: Math.sqrt( rayPointDistanceSq ),\n\t\t\tpoint: intersectPoint,\n\t\t\tindex: index,\n\t\t\tface: null,\n\t\t\tfaceIndex: null,\n\t\t\tbarycoord: null,\n\t\t\tobject: object\n\n\t\t} );\n\n\t}\n\n}\n\nclass VideoTexture extends Texture {\n\n\tconstructor( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {\n\n\t\tsuper( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\tthis.isVideoTexture = true;\n\n\t\tthis.minFilter = minFilter !== undefined ? minFilter : LinearFilter;\n\t\tthis.magFilter = magFilter !== undefined ? magFilter : LinearFilter;\n\n\t\tthis.generateMipmaps = false;\n\n\t\tconst scope = this;\n\n\t\tfunction updateVideo() {\n\n\t\t\tscope.needsUpdate = true;\n\t\t\tvideo.requestVideoFrameCallback( updateVideo );\n\n\t\t}\n\n\t\tif ( 'requestVideoFrameCallback' in video ) {\n\n\t\t\tvideo.requestVideoFrameCallback( updateVideo );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.image ).copy( this );\n\n\t}\n\n\tupdate() {\n\n\t\tconst video = this.image;\n\t\tconst hasVideoFrameCallback = 'requestVideoFrameCallback' in video;\n\n\t\tif ( hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA ) {\n\n\t\t\tthis.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n}\n\nclass FramebufferTexture extends Texture {\n\n\tconstructor( width, height ) {\n\n\t\tsuper( { width, height } );\n\n\t\tthis.isFramebufferTexture = true;\n\n\t\tthis.magFilter = NearestFilter;\n\t\tthis.minFilter = NearestFilter;\n\n\t\tthis.generateMipmaps = false;\n\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n\nclass CompressedTexture extends Texture {\n\n\tconstructor( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, colorSpace ) {\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );\n\n\t\tthis.isCompressedTexture = true;\n\n\t\tthis.image = { width: width, height: height };\n\t\tthis.mipmaps = mipmaps;\n\n\t\t// no flipping for cube textures\n\t\t// (also flipping doesn't work for compressed textures )\n\n\t\tthis.flipY = false;\n\n\t\t// can't generate mipmaps for compressed textures\n\t\t// mips must be embedded in DDS files\n\n\t\tthis.generateMipmaps = false;\n\n\t}\n\n}\n\nclass CompressedArrayTexture extends CompressedTexture {\n\n\tconstructor( mipmaps, width, height, depth, format, type ) {\n\n\t\tsuper( mipmaps, width, height, format, type );\n\n\t\tthis.isCompressedArrayTexture = true;\n\t\tthis.image.depth = depth;\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\tthis.layerUpdates = new Set();\n\n\t}\n\n\taddLayerUpdate( layerIndex ) {\n\n\t\tthis.layerUpdates.add( layerIndex );\n\n\t}\n\n\tclearLayerUpdates() {\n\n\t\tthis.layerUpdates.clear();\n\n\t}\n\n}\n\nclass CompressedCubeTexture extends CompressedTexture {\n\n\tconstructor( images, format, type ) {\n\n\t\tsuper( undefined, images[ 0 ].width, images[ 0 ].height, format, type, CubeReflectionMapping );\n\n\t\tthis.isCompressedCubeTexture = true;\n\t\tthis.isCubeTexture = true;\n\n\t\tthis.image = images;\n\n\t}\n\n}\n\nclass CanvasTexture extends Texture {\n\n\tconstructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {\n\n\t\tsuper( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\tthis.isCanvasTexture = true;\n\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n\n/**\n * Extensible curve object.\n *\n * Some common of curve methods:\n * .getPoint( t, optionalTarget ), .getTangent( t, optionalTarget )\n * .getPointAt( u, optionalTarget ), .getTangentAt( u, optionalTarget )\n * .getPoints(), .getSpacedPoints()\n * .getLength()\n * .updateArcLengths()\n *\n * This following curves inherit from THREE.Curve:\n *\n * -- 2D curves --\n * THREE.ArcCurve\n * THREE.CubicBezierCurve\n * THREE.EllipseCurve\n * THREE.LineCurve\n * THREE.QuadraticBezierCurve\n * THREE.SplineCurve\n *\n * -- 3D curves --\n * THREE.CatmullRomCurve3\n * THREE.CubicBezierCurve3\n * THREE.LineCurve3\n * THREE.QuadraticBezierCurve3\n *\n * A series of curves can be represented as a THREE.CurvePath.\n *\n **/\n\nclass Curve {\n\n\tconstructor() {\n\n\t\tthis.type = 'Curve';\n\n\t\tthis.arcLengthDivisions = 200;\n\n\t}\n\n\t// Virtual base class method to overwrite and implement in subclasses\n\t//\t- t [0 .. 1]\n\n\tgetPoint( /* t, optionalTarget */ ) {\n\n\t\tconsole.warn( 'THREE.Curve: .getPoint() not implemented.' );\n\t\treturn null;\n\n\t}\n\n\t// Get point at relative position in curve according to arc length\n\t// - u [0 .. 1]\n\n\tgetPointAt( u, optionalTarget ) {\n\n\t\tconst t = this.getUtoTmapping( u );\n\t\treturn this.getPoint( t, optionalTarget );\n\n\t}\n\n\t// Get sequence of points using getPoint( t )\n\n\tgetPoints( divisions = 5 ) {\n\n\t\tconst points = [];\n\n\t\tfor ( let d = 0; d <= divisions; d ++ ) {\n\n\t\t\tpoints.push( this.getPoint( d / divisions ) );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\t// Get sequence of points using getPointAt( u )\n\n\tgetSpacedPoints( divisions = 5 ) {\n\n\t\tconst points = [];\n\n\t\tfor ( let d = 0; d <= divisions; d ++ ) {\n\n\t\t\tpoints.push( this.getPointAt( d / divisions ) );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\t// Get total curve arc length\n\n\tgetLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}\n\n\t// Get list of cumulative segment lengths\n\n\tgetLengths( divisions = this.arcLengthDivisions ) {\n\n\t\tif ( this.cacheArcLengths &&\n\t\t\t( this.cacheArcLengths.length === divisions + 1 ) &&\n\t\t\t! this.needsUpdate ) {\n\n\t\t\treturn this.cacheArcLengths;\n\n\t\t}\n\n\t\tthis.needsUpdate = false;\n\n\t\tconst cache = [];\n\t\tlet current, last = this.getPoint( 0 );\n\t\tlet sum = 0;\n\n\t\tcache.push( 0 );\n\n\t\tfor ( let p = 1; p <= divisions; p ++ ) {\n\n\t\t\tcurrent = this.getPoint( p / divisions );\n\t\t\tsum += current.distanceTo( last );\n\t\t\tcache.push( sum );\n\t\t\tlast = current;\n\n\t\t}\n\n\t\tthis.cacheArcLengths = cache;\n\n\t\treturn cache; // { sums: cache, sum: sum }; Sum is in the last element.\n\n\t}\n\n\tupdateArcLengths() {\n\n\t\tthis.needsUpdate = true;\n\t\tthis.getLengths();\n\n\t}\n\n\t// Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant\n\n\tgetUtoTmapping( u, distance ) {\n\n\t\tconst arcLengths = this.getLengths();\n\n\t\tlet i = 0;\n\t\tconst il = arcLengths.length;\n\n\t\tlet targetArcLength; // The targeted u distance value to get\n\n\t\tif ( distance ) {\n\n\t\t\ttargetArcLength = distance;\n\n\t\t} else {\n\n\t\t\ttargetArcLength = u * arcLengths[ il - 1 ];\n\n\t\t}\n\n\t\t// binary search for the index with largest value smaller than target u distance\n\n\t\tlet low = 0, high = il - 1, comparison;\n\n\t\twhile ( low <= high ) {\n\n\t\t\ti = Math.floor( low + ( high - low ) / 2 ); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats\n\n\t\t\tcomparison = arcLengths[ i ] - targetArcLength;\n\n\t\t\tif ( comparison < 0 ) {\n\n\t\t\t\tlow = i + 1;\n\n\t\t\t} else if ( comparison > 0 ) {\n\n\t\t\t\thigh = i - 1;\n\n\t\t\t} else {\n\n\t\t\t\thigh = i;\n\t\t\t\tbreak;\n\n\t\t\t\t// DONE\n\n\t\t\t}\n\n\t\t}\n\n\t\ti = high;\n\n\t\tif ( arcLengths[ i ] === targetArcLength ) {\n\n\t\t\treturn i / ( il - 1 );\n\n\t\t}\n\n\t\t// we could get finer grain at lengths, or use simple interpolation between two points\n\n\t\tconst lengthBefore = arcLengths[ i ];\n\t\tconst lengthAfter = arcLengths[ i + 1 ];\n\n\t\tconst segmentLength = lengthAfter - lengthBefore;\n\n\t\t// determine where we are between the 'before' and 'after' points\n\n\t\tconst segmentFraction = ( targetArcLength - lengthBefore ) / segmentLength;\n\n\t\t// add that fractional amount to t\n\n\t\tconst t = ( i + segmentFraction ) / ( il - 1 );\n\n\t\treturn t;\n\n\t}\n\n\t// Returns a unit vector tangent at t\n\t// In case any sub curve does not implement its tangent derivation,\n\t// 2 points a small delta apart will be used to find its gradient\n\t// which seems to give a reasonable approximation\n\n\tgetTangent( t, optionalTarget ) {\n\n\t\tconst delta = 0.0001;\n\t\tlet t1 = t - delta;\n\t\tlet t2 = t + delta;\n\n\t\t// Capping in case of danger\n\n\t\tif ( t1 < 0 ) t1 = 0;\n\t\tif ( t2 > 1 ) t2 = 1;\n\n\t\tconst pt1 = this.getPoint( t1 );\n\t\tconst pt2 = this.getPoint( t2 );\n\n\t\tconst tangent = optionalTarget || ( ( pt1.isVector2 ) ? new Vector2() : new Vector3() );\n\n\t\ttangent.copy( pt2 ).sub( pt1 ).normalize();\n\n\t\treturn tangent;\n\n\t}\n\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\tconst t = this.getUtoTmapping( u );\n\t\treturn this.getTangent( t, optionalTarget );\n\n\t}\n\n\tcomputeFrenetFrames( segments, closed ) {\n\n\t\t// see http://www.cs.indiana.edu/pub/techreports/TR425.pdf\n\n\t\tconst normal = new Vector3();\n\n\t\tconst tangents = [];\n\t\tconst normals = [];\n\t\tconst binormals = [];\n\n\t\tconst vec = new Vector3();\n\t\tconst mat = new Matrix4();\n\n\t\t// compute the tangent vectors for each segment on the curve\n\n\t\tfor ( let i = 0; i <= segments; i ++ ) {\n\n\t\t\tconst u = i / segments;\n\n\t\t\ttangents[ i ] = this.getTangentAt( u, new Vector3() );\n\n\t\t}\n\n\t\t// select an initial normal vector perpendicular to the first tangent vector,\n\t\t// and in the direction of the minimum tangent xyz component\n\n\t\tnormals[ 0 ] = new Vector3();\n\t\tbinormals[ 0 ] = new Vector3();\n\t\tlet min = Number.MAX_VALUE;\n\t\tconst tx = Math.abs( tangents[ 0 ].x );\n\t\tconst ty = Math.abs( tangents[ 0 ].y );\n\t\tconst tz = Math.abs( tangents[ 0 ].z );\n\n\t\tif ( tx <= min ) {\n\n\t\t\tmin = tx;\n\t\t\tnormal.set( 1, 0, 0 );\n\n\t\t}\n\n\t\tif ( ty <= min ) {\n\n\t\t\tmin = ty;\n\t\t\tnormal.set( 0, 1, 0 );\n\n\t\t}\n\n\t\tif ( tz <= min ) {\n\n\t\t\tnormal.set( 0, 0, 1 );\n\n\t\t}\n\n\t\tvec.crossVectors( tangents[ 0 ], normal ).normalize();\n\n\t\tnormals[ 0 ].crossVectors( tangents[ 0 ], vec );\n\t\tbinormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] );\n\n\n\t\t// compute the slowly-varying normal and binormal vectors for each segment on the curve\n\n\t\tfor ( let i = 1; i <= segments; i ++ ) {\n\n\t\t\tnormals[ i ] = normals[ i - 1 ].clone();\n\n\t\t\tbinormals[ i ] = binormals[ i - 1 ].clone();\n\n\t\t\tvec.crossVectors( tangents[ i - 1 ], tangents[ i ] );\n\n\t\t\tif ( vec.length() > Number.EPSILON ) {\n\n\t\t\t\tvec.normalize();\n\n\t\t\t\tconst theta = Math.acos( clamp( tangents[ i - 1 ].dot( tangents[ i ] ), - 1, 1 ) ); // clamp for floating pt errors\n\n\t\t\t\tnormals[ i ].applyMatrix4( mat.makeRotationAxis( vec, theta ) );\n\n\t\t\t}\n\n\t\t\tbinormals[ i ].crossVectors( tangents[ i ], normals[ i ] );\n\n\t\t}\n\n\t\t// if the curve is closed, postprocess the vectors so the first and last normal vectors are the same\n\n\t\tif ( closed === true ) {\n\n\t\t\tlet theta = Math.acos( clamp( normals[ 0 ].dot( normals[ segments ] ), - 1, 1 ) );\n\t\t\ttheta /= segments;\n\n\t\t\tif ( tangents[ 0 ].dot( vec.crossVectors( normals[ 0 ], normals[ segments ] ) ) > 0 ) {\n\n\t\t\t\ttheta = - theta;\n\n\t\t\t}\n\n\t\t\tfor ( let i = 1; i <= segments; i ++ ) {\n\n\t\t\t\t// twist a little...\n\t\t\t\tnormals[ i ].applyMatrix4( mat.makeRotationAxis( tangents[ i ], theta * i ) );\n\t\t\t\tbinormals[ i ].crossVectors( tangents[ i ], normals[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\ttangents: tangents,\n\t\t\tnormals: normals,\n\t\t\tbinormals: binormals\n\t\t};\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.arcLengthDivisions = source.arcLengthDivisions;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.6,\n\t\t\t\ttype: 'Curve',\n\t\t\t\tgenerator: 'Curve.toJSON'\n\t\t\t}\n\t\t};\n\n\t\tdata.arcLengthDivisions = this.arcLengthDivisions;\n\t\tdata.type = this.type;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tthis.arcLengthDivisions = json.arcLengthDivisions;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass EllipseCurve extends Curve {\n\n\tconstructor( aX = 0, aY = 0, xRadius = 1, yRadius = 1, aStartAngle = 0, aEndAngle = Math.PI * 2, aClockwise = false, aRotation = 0 ) {\n\n\t\tsuper();\n\n\t\tthis.isEllipseCurve = true;\n\n\t\tthis.type = 'EllipseCurve';\n\n\t\tthis.aX = aX;\n\t\tthis.aY = aY;\n\n\t\tthis.xRadius = xRadius;\n\t\tthis.yRadius = yRadius;\n\n\t\tthis.aStartAngle = aStartAngle;\n\t\tthis.aEndAngle = aEndAngle;\n\n\t\tthis.aClockwise = aClockwise;\n\n\t\tthis.aRotation = aRotation;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst twoPi = Math.PI * 2;\n\t\tlet deltaAngle = this.aEndAngle - this.aStartAngle;\n\t\tconst samePoints = Math.abs( deltaAngle ) < Number.EPSILON;\n\n\t\t// ensures that deltaAngle is 0 .. 2 PI\n\t\twhile ( deltaAngle < 0 ) deltaAngle += twoPi;\n\t\twhile ( deltaAngle > twoPi ) deltaAngle -= twoPi;\n\n\t\tif ( deltaAngle < Number.EPSILON ) {\n\n\t\t\tif ( samePoints ) {\n\n\t\t\t\tdeltaAngle = 0;\n\n\t\t\t} else {\n\n\t\t\t\tdeltaAngle = twoPi;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.aClockwise === true && ! samePoints ) {\n\n\t\t\tif ( deltaAngle === twoPi ) {\n\n\t\t\t\tdeltaAngle = - twoPi;\n\n\t\t\t} else {\n\n\t\t\t\tdeltaAngle = deltaAngle - twoPi;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst angle = this.aStartAngle + t * deltaAngle;\n\t\tlet x = this.aX + this.xRadius * Math.cos( angle );\n\t\tlet y = this.aY + this.yRadius * Math.sin( angle );\n\n\t\tif ( this.aRotation !== 0 ) {\n\n\t\t\tconst cos = Math.cos( this.aRotation );\n\t\t\tconst sin = Math.sin( this.aRotation );\n\n\t\t\tconst tx = x - this.aX;\n\t\t\tconst ty = y - this.aY;\n\n\t\t\t// Rotate the point about the center of the ellipse.\n\t\t\tx = tx * cos - ty * sin + this.aX;\n\t\t\ty = tx * sin + ty * cos + this.aY;\n\n\t\t}\n\n\t\treturn point.set( x, y );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.aX = source.aX;\n\t\tthis.aY = source.aY;\n\n\t\tthis.xRadius = source.xRadius;\n\t\tthis.yRadius = source.yRadius;\n\n\t\tthis.aStartAngle = source.aStartAngle;\n\t\tthis.aEndAngle = source.aEndAngle;\n\n\t\tthis.aClockwise = source.aClockwise;\n\n\t\tthis.aRotation = source.aRotation;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.aX = this.aX;\n\t\tdata.aY = this.aY;\n\n\t\tdata.xRadius = this.xRadius;\n\t\tdata.yRadius = this.yRadius;\n\n\t\tdata.aStartAngle = this.aStartAngle;\n\t\tdata.aEndAngle = this.aEndAngle;\n\n\t\tdata.aClockwise = this.aClockwise;\n\n\t\tdata.aRotation = this.aRotation;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.aX = json.aX;\n\t\tthis.aY = json.aY;\n\n\t\tthis.xRadius = json.xRadius;\n\t\tthis.yRadius = json.yRadius;\n\n\t\tthis.aStartAngle = json.aStartAngle;\n\t\tthis.aEndAngle = json.aEndAngle;\n\n\t\tthis.aClockwise = json.aClockwise;\n\n\t\tthis.aRotation = json.aRotation;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass ArcCurve extends EllipseCurve {\n\n\tconstructor( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tsuper( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );\n\n\t\tthis.isArcCurve = true;\n\n\t\tthis.type = 'ArcCurve';\n\n\t}\n\n}\n\n/**\n * Centripetal CatmullRom Curve - which is useful for avoiding\n * cusps and self-intersections in non-uniform catmull rom curves.\n * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf\n *\n * curve.type accepts centripetal(default), chordal and catmullrom\n * curve.tension is used for catmullrom which defaults to 0.5\n */\n\n\n/*\nBased on an optimized c++ solution in\n - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/\n - http://ideone.com/NoEbVM\n\nThis CubicPoly class could be used for reusing some variables and calculations,\nbut for three.js curve use, it could be possible inlined and flatten into a single function call\nwhich can be placed in CurveUtils.\n*/\n\nfunction CubicPoly() {\n\n\tlet c0 = 0, c1 = 0, c2 = 0, c3 = 0;\n\n\t/*\n\t * Compute coefficients for a cubic polynomial\n\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t * p(0) = x0, p(1) = x1\n\t * and\n\t * p'(0) = t0, p'(1) = t1.\n\t */\n\tfunction init( x0, x1, t0, t1 ) {\n\n\t\tc0 = x0;\n\t\tc1 = t0;\n\t\tc2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1;\n\t\tc3 = 2 * x0 - 2 * x1 + t0 + t1;\n\n\t}\n\n\treturn {\n\n\t\tinitCatmullRom: function ( x0, x1, x2, x3, tension ) {\n\n\t\t\tinit( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) );\n\n\t\t},\n\n\t\tinitNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) {\n\n\t\t\t// compute tangents when parameterized in [t1,t2]\n\t\t\tlet t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1;\n\t\t\tlet t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2;\n\n\t\t\t// rescale tangents for parametrization in [0,1]\n\t\t\tt1 *= dt1;\n\t\t\tt2 *= dt1;\n\n\t\t\tinit( x1, x2, t1, t2 );\n\n\t\t},\n\n\t\tcalc: function ( t ) {\n\n\t\t\tconst t2 = t * t;\n\t\t\tconst t3 = t2 * t;\n\t\t\treturn c0 + c1 * t + c2 * t2 + c3 * t3;\n\n\t\t}\n\n\t};\n\n}\n\n//\n\nconst tmp = /*@__PURE__*/ new Vector3();\nconst px = /*@__PURE__*/ new CubicPoly();\nconst py = /*@__PURE__*/ new CubicPoly();\nconst pz = /*@__PURE__*/ new CubicPoly();\n\nclass CatmullRomCurve3 extends Curve {\n\n\tconstructor( points = [], closed = false, curveType = 'centripetal', tension = 0.5 ) {\n\n\t\tsuper();\n\n\t\tthis.isCatmullRomCurve3 = true;\n\n\t\tthis.type = 'CatmullRomCurve3';\n\n\t\tthis.points = points;\n\t\tthis.closed = closed;\n\t\tthis.curveType = curveType;\n\t\tthis.tension = tension;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst points = this.points;\n\t\tconst l = points.length;\n\n\t\tconst p = ( l - ( this.closed ? 0 : 1 ) ) * t;\n\t\tlet intPoint = Math.floor( p );\n\t\tlet weight = p - intPoint;\n\n\t\tif ( this.closed ) {\n\n\t\t\tintPoint += intPoint > 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / l ) + 1 ) * l;\n\n\t\t} else if ( weight === 0 && intPoint === l - 1 ) {\n\n\t\t\tintPoint = l - 2;\n\t\t\tweight = 1;\n\n\t\t}\n\n\t\tlet p0, p3; // 4 points (p1 & p2 defined below)\n\n\t\tif ( this.closed || intPoint > 0 ) {\n\n\t\t\tp0 = points[ ( intPoint - 1 ) % l ];\n\n\t\t} else {\n\n\t\t\t// extrapolate first point\n\t\t\ttmp.subVectors( points[ 0 ], points[ 1 ] ).add( points[ 0 ] );\n\t\t\tp0 = tmp;\n\n\t\t}\n\n\t\tconst p1 = points[ intPoint % l ];\n\t\tconst p2 = points[ ( intPoint + 1 ) % l ];\n\n\t\tif ( this.closed || intPoint + 2 < l ) {\n\n\t\t\tp3 = points[ ( intPoint + 2 ) % l ];\n\n\t\t} else {\n\n\t\t\t// extrapolate last point\n\t\t\ttmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 1 ] );\n\t\t\tp3 = tmp;\n\n\t\t}\n\n\t\tif ( this.curveType === 'centripetal' || this.curveType === 'chordal' ) {\n\n\t\t\t// init Centripetal / Chordal Catmull-Rom\n\t\t\tconst pow = this.curveType === 'chordal' ? 0.5 : 0.25;\n\t\t\tlet dt0 = Math.pow( p0.distanceToSquared( p1 ), pow );\n\t\t\tlet dt1 = Math.pow( p1.distanceToSquared( p2 ), pow );\n\t\t\tlet dt2 = Math.pow( p2.distanceToSquared( p3 ), pow );\n\n\t\t\t// safety check for repeated points\n\t\t\tif ( dt1 < 1e-4 ) dt1 = 1.0;\n\t\t\tif ( dt0 < 1e-4 ) dt0 = dt1;\n\t\t\tif ( dt2 < 1e-4 ) dt2 = dt1;\n\n\t\t\tpx.initNonuniformCatmullRom( p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2 );\n\t\t\tpy.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 );\n\t\t\tpz.initNonuniformCatmullRom( p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2 );\n\n\t\t} else if ( this.curveType === 'catmullrom' ) {\n\n\t\t\tpx.initCatmullRom( p0.x, p1.x, p2.x, p3.x, this.tension );\n\t\t\tpy.initCatmullRom( p0.y, p1.y, p2.y, p3.y, this.tension );\n\t\t\tpz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, this.tension );\n\n\t\t}\n\n\t\tpoint.set(\n\t\t\tpx.calc( weight ),\n\t\t\tpy.calc( weight ),\n\t\t\tpz.calc( weight )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = source.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = source.points[ i ];\n\n\t\t\tthis.points.push( point.clone() );\n\n\t\t}\n\n\t\tthis.closed = source.closed;\n\t\tthis.curveType = source.curveType;\n\t\tthis.tension = source.tension;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.points = [];\n\n\t\tfor ( let i = 0, l = this.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = this.points[ i ];\n\t\t\tdata.points.push( point.toArray() );\n\n\t\t}\n\n\t\tdata.closed = this.closed;\n\t\tdata.curveType = this.curveType;\n\t\tdata.tension = this.tension;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = json.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = json.points[ i ];\n\t\t\tthis.points.push( new Vector3().fromArray( point ) );\n\n\t\t}\n\n\t\tthis.closed = json.closed;\n\t\tthis.curveType = json.curveType;\n\t\tthis.tension = json.tension;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Bezier Curves formulas obtained from\n * https://en.wikipedia.org/wiki/B%C3%A9zier_curve\n */\n\nfunction CatmullRom( t, p0, p1, p2, p3 ) {\n\n\tconst v0 = ( p2 - p0 ) * 0.5;\n\tconst v1 = ( p3 - p1 ) * 0.5;\n\tconst t2 = t * t;\n\tconst t3 = t * t2;\n\treturn ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( - 3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1;\n\n}\n\n//\n\nfunction QuadraticBezierP0( t, p ) {\n\n\tconst k = 1 - t;\n\treturn k * k * p;\n\n}\n\nfunction QuadraticBezierP1( t, p ) {\n\n\treturn 2 * ( 1 - t ) * t * p;\n\n}\n\nfunction QuadraticBezierP2( t, p ) {\n\n\treturn t * t * p;\n\n}\n\nfunction QuadraticBezier( t, p0, p1, p2 ) {\n\n\treturn QuadraticBezierP0( t, p0 ) + QuadraticBezierP1( t, p1 ) +\n\t\tQuadraticBezierP2( t, p2 );\n\n}\n\n//\n\nfunction CubicBezierP0( t, p ) {\n\n\tconst k = 1 - t;\n\treturn k * k * k * p;\n\n}\n\nfunction CubicBezierP1( t, p ) {\n\n\tconst k = 1 - t;\n\treturn 3 * k * k * t * p;\n\n}\n\nfunction CubicBezierP2( t, p ) {\n\n\treturn 3 * ( 1 - t ) * t * t * p;\n\n}\n\nfunction CubicBezierP3( t, p ) {\n\n\treturn t * t * t * p;\n\n}\n\nfunction CubicBezier( t, p0, p1, p2, p3 ) {\n\n\treturn CubicBezierP0( t, p0 ) + CubicBezierP1( t, p1 ) + CubicBezierP2( t, p2 ) +\n\t\tCubicBezierP3( t, p3 );\n\n}\n\nclass CubicBezierCurve extends Curve {\n\n\tconstructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\tthis.isCubicBezierCurve = true;\n\n\t\tthis.type = 'CubicBezierCurve';\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\t\tthis.v3 = v3;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;\n\n\t\tpoint.set(\n\t\t\tCubicBezier( t, v0.x, v1.x, v2.x, v3.x ),\n\t\t\tCubicBezier( t, v0.y, v1.y, v2.y, v3.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\t\tthis.v3.copy( source.v3 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\t\tdata.v3 = this.v3.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\t\tthis.v3.fromArray( json.v3 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass CubicBezierCurve3 extends Curve {\n\n\tconstructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3(), v3 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\tthis.isCubicBezierCurve3 = true;\n\n\t\tthis.type = 'CubicBezierCurve3';\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\t\tthis.v3 = v3;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;\n\n\t\tpoint.set(\n\t\t\tCubicBezier( t, v0.x, v1.x, v2.x, v3.x ),\n\t\t\tCubicBezier( t, v0.y, v1.y, v2.y, v3.y ),\n\t\t\tCubicBezier( t, v0.z, v1.z, v2.z, v3.z )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\t\tthis.v3.copy( source.v3 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\t\tdata.v3 = this.v3.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\t\tthis.v3.fromArray( json.v3 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass LineCurve extends Curve {\n\n\tconstructor( v1 = new Vector2(), v2 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\tthis.isLineCurve = true;\n\n\t\tthis.type = 'LineCurve';\n\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tif ( t === 1 ) {\n\n\t\t\tpoint.copy( this.v2 );\n\n\t\t} else {\n\n\t\t\tpoint.copy( this.v2 ).sub( this.v1 );\n\t\t\tpoint.multiplyScalar( t ).add( this.v1 );\n\n\t\t}\n\n\t\treturn point;\n\n\t}\n\n\t// Line curve is linear, so we can overwrite default getPointAt\n\tgetPointAt( u, optionalTarget ) {\n\n\t\treturn this.getPoint( u, optionalTarget );\n\n\t}\n\n\tgetTangent( t, optionalTarget = new Vector2() ) {\n\n\t\treturn optionalTarget.subVectors( this.v2, this.v1 ).normalize();\n\n\t}\n\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\treturn this.getTangent( u, optionalTarget );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass LineCurve3 extends Curve {\n\n\tconstructor( v1 = new Vector3(), v2 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\tthis.isLineCurve3 = true;\n\n\t\tthis.type = 'LineCurve3';\n\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tif ( t === 1 ) {\n\n\t\t\tpoint.copy( this.v2 );\n\n\t\t} else {\n\n\t\t\tpoint.copy( this.v2 ).sub( this.v1 );\n\t\t\tpoint.multiplyScalar( t ).add( this.v1 );\n\n\t\t}\n\n\t\treturn point;\n\n\t}\n\n\t// Line curve is linear, so we can overwrite default getPointAt\n\tgetPointAt( u, optionalTarget ) {\n\n\t\treturn this.getPoint( u, optionalTarget );\n\n\t}\n\n\tgetTangent( t, optionalTarget = new Vector3() ) {\n\n\t\treturn optionalTarget.subVectors( this.v2, this.v1 ).normalize();\n\n\t}\n\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\treturn this.getTangent( u, optionalTarget );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass QuadraticBezierCurve extends Curve {\n\n\tconstructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\tthis.isQuadraticBezierCurve = true;\n\n\t\tthis.type = 'QuadraticBezierCurve';\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2;\n\n\t\tpoint.set(\n\t\t\tQuadraticBezier( t, v0.x, v1.x, v2.x ),\n\t\t\tQuadraticBezier( t, v0.y, v1.y, v2.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass QuadraticBezierCurve3 extends Curve {\n\n\tconstructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\tthis.isQuadraticBezierCurve3 = true;\n\n\t\tthis.type = 'QuadraticBezierCurve3';\n\n\t\tthis.v0 = v0;\n\t\tthis.v1 = v1;\n\t\tthis.v2 = v2;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2;\n\n\t\tpoint.set(\n\t\t\tQuadraticBezier( t, v0.x, v1.x, v2.x ),\n\t\t\tQuadraticBezier( t, v0.y, v1.y, v2.y ),\n\t\t\tQuadraticBezier( t, v0.z, v1.z, v2.z )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass SplineCurve extends Curve {\n\n\tconstructor( points = [] ) {\n\n\t\tsuper();\n\n\t\tthis.isSplineCurve = true;\n\n\t\tthis.type = 'SplineCurve';\n\n\t\tthis.points = points;\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst points = this.points;\n\t\tconst p = ( points.length - 1 ) * t;\n\n\t\tconst intPoint = Math.floor( p );\n\t\tconst weight = p - intPoint;\n\n\t\tconst p0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ];\n\t\tconst p1 = points[ intPoint ];\n\t\tconst p2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ];\n\t\tconst p3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ];\n\n\t\tpoint.set(\n\t\t\tCatmullRom( weight, p0.x, p1.x, p2.x, p3.x ),\n\t\t\tCatmullRom( weight, p0.y, p1.y, p2.y, p3.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = source.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = source.points[ i ];\n\n\t\t\tthis.points.push( point.clone() );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.points = [];\n\n\t\tfor ( let i = 0, l = this.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = this.points[ i ];\n\t\t\tdata.points.push( point.toArray() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = json.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = json.points[ i ];\n\t\t\tthis.points.push( new Vector2().fromArray( point ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nvar Curves = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tArcCurve: ArcCurve,\n\tCatmullRomCurve3: CatmullRomCurve3,\n\tCubicBezierCurve: CubicBezierCurve,\n\tCubicBezierCurve3: CubicBezierCurve3,\n\tEllipseCurve: EllipseCurve,\n\tLineCurve: LineCurve,\n\tLineCurve3: LineCurve3,\n\tQuadraticBezierCurve: QuadraticBezierCurve,\n\tQuadraticBezierCurve3: QuadraticBezierCurve3,\n\tSplineCurve: SplineCurve\n});\n\n/**************************************************************\n *\tCurved Path - a curve path is simply a array of connected\n * curves, but retains the api of a curve\n **************************************************************/\n\nclass CurvePath extends Curve {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'CurvePath';\n\n\t\tthis.curves = [];\n\t\tthis.autoClose = false; // Automatically closes the path\n\n\t}\n\n\tadd( curve ) {\n\n\t\tthis.curves.push( curve );\n\n\t}\n\n\tclosePath() {\n\n\t\t// Add a line curve if start and end of lines are not connected\n\t\tconst startPoint = this.curves[ 0 ].getPoint( 0 );\n\t\tconst endPoint = this.curves[ this.curves.length - 1 ].getPoint( 1 );\n\n\t\tif ( ! startPoint.equals( endPoint ) ) {\n\n\t\t\tconst lineType = ( startPoint.isVector2 === true ) ? 'LineCurve' : 'LineCurve3';\n\t\t\tthis.curves.push( new Curves[ lineType ]( endPoint, startPoint ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// To get accurate point with reference to\n\t// entire path distance at time t,\n\t// following has to be done:\n\n\t// 1. Length of each sub path have to be known\n\t// 2. Locate and identify type of curve\n\t// 3. Get t for the curve\n\t// 4. Return curve.getPointAt(t')\n\n\tgetPoint( t, optionalTarget ) {\n\n\t\tconst d = t * this.getLength();\n\t\tconst curveLengths = this.getCurveLengths();\n\t\tlet i = 0;\n\n\t\t// To think about boundaries points.\n\n\t\twhile ( i < curveLengths.length ) {\n\n\t\t\tif ( curveLengths[ i ] >= d ) {\n\n\t\t\t\tconst diff = curveLengths[ i ] - d;\n\t\t\t\tconst curve = this.curves[ i ];\n\n\t\t\t\tconst segmentLength = curve.getLength();\n\t\t\t\tconst u = segmentLength === 0 ? 0 : 1 - diff / segmentLength;\n\n\t\t\t\treturn curve.getPointAt( u, optionalTarget );\n\n\t\t\t}\n\n\t\t\ti ++;\n\n\t\t}\n\n\t\treturn null;\n\n\t\t// loop where sum != 0, sum > d , sum+1 1 && ! points[ points.length - 1 ].equals( points[ 0 ] ) ) {\n\n\t\t\tpoints.push( points[ 0 ] );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.curves = [];\n\n\t\tfor ( let i = 0, l = source.curves.length; i < l; i ++ ) {\n\n\t\t\tconst curve = source.curves[ i ];\n\n\t\t\tthis.curves.push( curve.clone() );\n\n\t\t}\n\n\t\tthis.autoClose = source.autoClose;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.autoClose = this.autoClose;\n\t\tdata.curves = [];\n\n\t\tfor ( let i = 0, l = this.curves.length; i < l; i ++ ) {\n\n\t\t\tconst curve = this.curves[ i ];\n\t\t\tdata.curves.push( curve.toJSON() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.autoClose = json.autoClose;\n\t\tthis.curves = [];\n\n\t\tfor ( let i = 0, l = json.curves.length; i < l; i ++ ) {\n\n\t\t\tconst curve = json.curves[ i ];\n\t\t\tthis.curves.push( new Curves[ curve.type ]().fromJSON( curve ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass Path extends CurvePath {\n\n\tconstructor( points ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Path';\n\n\t\tthis.currentPoint = new Vector2();\n\n\t\tif ( points ) {\n\n\t\t\tthis.setFromPoints( points );\n\n\t\t}\n\n\t}\n\n\tsetFromPoints( points ) {\n\n\t\tthis.moveTo( points[ 0 ].x, points[ 0 ].y );\n\n\t\tfor ( let i = 1, l = points.length; i < l; i ++ ) {\n\n\t\t\tthis.lineTo( points[ i ].x, points[ i ].y );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tmoveTo( x, y ) {\n\n\t\tthis.currentPoint.set( x, y ); // TODO consider referencing vectors instead of copying?\n\n\t\treturn this;\n\n\t}\n\n\tlineTo( x, y ) {\n\n\t\tconst curve = new LineCurve( this.currentPoint.clone(), new Vector2( x, y ) );\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( x, y );\n\n\t\treturn this;\n\n\t}\n\n\tquadraticCurveTo( aCPx, aCPy, aX, aY ) {\n\n\t\tconst curve = new QuadraticBezierCurve(\n\t\t\tthis.currentPoint.clone(),\n\t\t\tnew Vector2( aCPx, aCPy ),\n\t\t\tnew Vector2( aX, aY )\n\t\t);\n\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\tbezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {\n\n\t\tconst curve = new CubicBezierCurve(\n\t\t\tthis.currentPoint.clone(),\n\t\t\tnew Vector2( aCP1x, aCP1y ),\n\t\t\tnew Vector2( aCP2x, aCP2y ),\n\t\t\tnew Vector2( aX, aY )\n\t\t);\n\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\tsplineThru( pts /*Array of Vector*/ ) {\n\n\t\tconst npts = [ this.currentPoint.clone() ].concat( pts );\n\n\t\tconst curve = new SplineCurve( npts );\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.copy( pts[ pts.length - 1 ] );\n\n\t\treturn this;\n\n\t}\n\n\tarc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tconst x0 = this.currentPoint.x;\n\t\tconst y0 = this.currentPoint.y;\n\n\t\tthis.absarc( aX + x0, aY + y0, aRadius,\n\t\t\taStartAngle, aEndAngle, aClockwise );\n\n\t\treturn this;\n\n\t}\n\n\tabsarc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tthis.absellipse( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );\n\n\t\treturn this;\n\n\t}\n\n\tellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\tconst x0 = this.currentPoint.x;\n\t\tconst y0 = this.currentPoint.y;\n\n\t\tthis.absellipse( aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation );\n\n\t\treturn this;\n\n\t}\n\n\tabsellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\tconst curve = new EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation );\n\n\t\tif ( this.curves.length > 0 ) {\n\n\t\t\t// if a previous curve is present, attempt to join\n\t\t\tconst firstPoint = curve.getPoint( 0 );\n\n\t\t\tif ( ! firstPoint.equals( this.currentPoint ) ) {\n\n\t\t\t\tthis.lineTo( firstPoint.x, firstPoint.y );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.curves.push( curve );\n\n\t\tconst lastPoint = curve.getPoint( 1 );\n\t\tthis.currentPoint.copy( lastPoint );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.currentPoint.copy( source.currentPoint );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.currentPoint = this.currentPoint.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.currentPoint.fromArray( json.currentPoint );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass LatheGeometry extends BufferGeometry {\n\n\tconstructor( points = [ new Vector2( 0, - 0.5 ), new Vector2( 0.5, 0 ), new Vector2( 0, 0.5 ) ], segments = 12, phiStart = 0, phiLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'LatheGeometry';\n\n\t\tthis.parameters = {\n\t\t\tpoints: points,\n\t\t\tsegments: segments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength\n\t\t};\n\n\t\tsegments = Math.floor( segments );\n\n\t\t// clamp phiLength so it's in range of [ 0, 2PI ]\n\n\t\tphiLength = clamp( phiLength, 0, Math.PI * 2 );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst uvs = [];\n\t\tconst initNormals = [];\n\t\tconst normals = [];\n\n\t\t// helper variables\n\n\t\tconst inverseSegments = 1.0 / segments;\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\t\tconst normal = new Vector3();\n\t\tconst curNormal = new Vector3();\n\t\tconst prevNormal = new Vector3();\n\t\tlet dx = 0;\n\t\tlet dy = 0;\n\n\t\t// pre-compute normals for initial \"meridian\"\n\n\t\tfor ( let j = 0; j <= ( points.length - 1 ); j ++ ) {\n\n\t\t\tswitch ( j ) {\n\n\t\t\t\tcase 0:\t\t\t\t// special handling for 1st vertex on path\n\n\t\t\t\t\tdx = points[ j + 1 ].x - points[ j ].x;\n\t\t\t\t\tdy = points[ j + 1 ].y - points[ j ].y;\n\n\t\t\t\t\tnormal.x = dy * 1.0;\n\t\t\t\t\tnormal.y = - dx;\n\t\t\t\t\tnormal.z = dy * 0.0;\n\n\t\t\t\t\tprevNormal.copy( normal );\n\n\t\t\t\t\tnormal.normalize();\n\n\t\t\t\t\tinitNormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ( points.length - 1 ):\t// special handling for last Vertex on path\n\n\t\t\t\t\tinitNormals.push( prevNormal.x, prevNormal.y, prevNormal.z );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\t\t\t// default handling for all vertices in between\n\n\t\t\t\t\tdx = points[ j + 1 ].x - points[ j ].x;\n\t\t\t\t\tdy = points[ j + 1 ].y - points[ j ].y;\n\n\t\t\t\t\tnormal.x = dy * 1.0;\n\t\t\t\t\tnormal.y = - dx;\n\t\t\t\t\tnormal.z = dy * 0.0;\n\n\t\t\t\t\tcurNormal.copy( normal );\n\n\t\t\t\t\tnormal.x += prevNormal.x;\n\t\t\t\t\tnormal.y += prevNormal.y;\n\t\t\t\t\tnormal.z += prevNormal.z;\n\n\t\t\t\t\tnormal.normalize();\n\n\t\t\t\t\tinitNormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\tprevNormal.copy( curNormal );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate vertices, uvs and normals\n\n\t\tfor ( let i = 0; i <= segments; i ++ ) {\n\n\t\t\tconst phi = phiStart + i * inverseSegments * phiLength;\n\n\t\t\tconst sin = Math.sin( phi );\n\t\t\tconst cos = Math.cos( phi );\n\n\t\t\tfor ( let j = 0; j <= ( points.length - 1 ); j ++ ) {\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = points[ j ].x * sin;\n\t\t\t\tvertex.y = points[ j ].y;\n\t\t\t\tvertex.z = points[ j ].x * cos;\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = i / segments;\n\t\t\t\tuv.y = j / ( points.length - 1 );\n\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t// normal\n\n\t\t\t\tconst x = initNormals[ 3 * j + 0 ] * sin;\n\t\t\t\tconst y = initNormals[ 3 * j + 1 ];\n\t\t\t\tconst z = initNormals[ 3 * j + 0 ] * cos;\n\n\t\t\t\tnormals.push( x, y, z );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let i = 0; i < segments; i ++ ) {\n\n\t\t\tfor ( let j = 0; j < ( points.length - 1 ); j ++ ) {\n\n\t\t\t\tconst base = j + i * points.length;\n\n\t\t\t\tconst a = base;\n\t\t\t\tconst b = base + points.length;\n\t\t\t\tconst c = base + points.length + 1;\n\t\t\t\tconst d = base + 1;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( c, d, b );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new LatheGeometry( data.points, data.segments, data.phiStart, data.phiLength );\n\n\t}\n\n}\n\nclass CapsuleGeometry extends LatheGeometry {\n\n\tconstructor( radius = 1, length = 1, capSegments = 4, radialSegments = 8 ) {\n\n\t\tconst path = new Path();\n\t\tpath.absarc( 0, - length / 2, radius, Math.PI * 1.5, 0 );\n\t\tpath.absarc( 0, length / 2, radius, 0, Math.PI * 0.5 );\n\n\t\tsuper( path.getPoints( capSegments ), radialSegments );\n\n\t\tthis.type = 'CapsuleGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tlength: length,\n\t\t\tcapSegments: capSegments,\n\t\t\tradialSegments: radialSegments,\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new CapsuleGeometry( data.radius, data.length, data.capSegments, data.radialSegments );\n\n\t}\n\n}\n\nclass CircleGeometry extends BufferGeometry {\n\n\tconstructor( radius = 1, segments = 32, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CircleGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tsegments: segments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tsegments = Math.max( 3, segments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\n\t\t// center point\n\n\t\tvertices.push( 0, 0, 0 );\n\t\tnormals.push( 0, 0, 1 );\n\t\tuvs.push( 0.5, 0.5 );\n\n\t\tfor ( let s = 0, i = 3; s <= segments; s ++, i += 3 ) {\n\n\t\t\tconst segment = thetaStart + s / segments * thetaLength;\n\n\t\t\t// vertex\n\n\t\t\tvertex.x = radius * Math.cos( segment );\n\t\t\tvertex.y = radius * Math.sin( segment );\n\n\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t// normal\n\n\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t// uvs\n\n\t\t\tuv.x = ( vertices[ i ] / radius + 1 ) / 2;\n\t\t\tuv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2;\n\n\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let i = 1; i <= segments; i ++ ) {\n\n\t\t\tindices.push( i, i + 1, 0 );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new CircleGeometry( data.radius, data.segments, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass CylinderGeometry extends BufferGeometry {\n\n\tconstructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CylinderGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradiusTop: radiusTop,\n\t\t\tradiusBottom: radiusBottom,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tconst scope = this;\n\n\t\tradialSegments = Math.floor( radialSegments );\n\t\theightSegments = Math.floor( heightSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet index = 0;\n\t\tconst indexArray = [];\n\t\tconst halfHeight = height / 2;\n\t\tlet groupStart = 0;\n\n\t\t// generate geometry\n\n\t\tgenerateTorso();\n\n\t\tif ( openEnded === false ) {\n\n\t\t\tif ( radiusTop > 0 ) generateCap( true );\n\t\t\tif ( radiusBottom > 0 ) generateCap( false );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\tfunction generateTorso() {\n\n\t\t\tconst normal = new Vector3();\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tlet groupCount = 0;\n\n\t\t\t// this will be used to calculate the normal\n\t\t\tconst slope = ( radiusBottom - radiusTop ) / height;\n\n\t\t\t// generate vertices, normals and uvs\n\n\t\t\tfor ( let y = 0; y <= heightSegments; y ++ ) {\n\n\t\t\t\tconst indexRow = [];\n\n\t\t\t\tconst v = y / heightSegments;\n\n\t\t\t\t// calculate the radius of the current row\n\n\t\t\t\tconst radius = v * ( radiusBottom - radiusTop ) + radiusTop;\n\n\t\t\t\tfor ( let x = 0; x <= radialSegments; x ++ ) {\n\n\t\t\t\t\tconst u = x / radialSegments;\n\n\t\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\n\t\t\t\t\tconst sinTheta = Math.sin( theta );\n\t\t\t\t\tconst cosTheta = Math.cos( theta );\n\n\t\t\t\t\t// vertex\n\n\t\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\t\tvertex.y = - v * height + halfHeight;\n\t\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t\t// normal\n\n\t\t\t\t\tnormal.set( sinTheta, slope, cosTheta ).normalize();\n\t\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\t// uv\n\n\t\t\t\t\tuvs.push( u, 1 - v );\n\n\t\t\t\t\t// save index of vertex in respective row\n\n\t\t\t\t\tindexRow.push( index ++ );\n\n\t\t\t\t}\n\n\t\t\t\t// now save vertices of the row in our index array\n\n\t\t\t\tindexArray.push( indexRow );\n\n\t\t\t}\n\n\t\t\t// generate indices\n\n\t\t\tfor ( let x = 0; x < radialSegments; x ++ ) {\n\n\t\t\t\tfor ( let y = 0; y < heightSegments; y ++ ) {\n\n\t\t\t\t\t// we use the index array to access the correct indices\n\n\t\t\t\t\tconst a = indexArray[ y ][ x ];\n\t\t\t\t\tconst b = indexArray[ y + 1 ][ x ];\n\t\t\t\t\tconst c = indexArray[ y + 1 ][ x + 1 ];\n\t\t\t\t\tconst d = indexArray[ y ][ x + 1 ];\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tif ( radiusTop > 0 || y !== 0 ) {\n\n\t\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\t\tgroupCount += 3;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( radiusBottom > 0 || y !== heightSegments - 1 ) {\n\n\t\t\t\t\t\tindices.push( b, c, d );\n\t\t\t\t\t\tgroupCount += 3;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, 0 );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t}\n\n\t\tfunction generateCap( top ) {\n\n\t\t\t// save the index of the first center vertex\n\t\t\tconst centerIndexStart = index;\n\n\t\t\tconst uv = new Vector2();\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tlet groupCount = 0;\n\n\t\t\tconst radius = ( top === true ) ? radiusTop : radiusBottom;\n\t\t\tconst sign = ( top === true ) ? 1 : - 1;\n\n\t\t\t// first we generate the center vertex data of the cap.\n\t\t\t// because the geometry needs one set of uvs per face,\n\t\t\t// we must generate a center vertex per face/segment\n\n\t\t\tfor ( let x = 1; x <= radialSegments; x ++ ) {\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertices.push( 0, halfHeight * sign, 0 );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, sign, 0 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( 0.5, 0.5 );\n\n\t\t\t\t// increase index\n\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\t// save the index of the last center vertex\n\t\t\tconst centerIndexEnd = index;\n\n\t\t\t// now we generate the surrounding vertices, normals and uvs\n\n\t\t\tfor ( let x = 0; x <= radialSegments; x ++ ) {\n\n\t\t\t\tconst u = x / radialSegments;\n\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\n\t\t\t\tconst cosTheta = Math.cos( theta );\n\t\t\t\tconst sinTheta = Math.sin( theta );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\tvertex.y = halfHeight * sign;\n\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, sign, 0 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = ( cosTheta * 0.5 ) + 0.5;\n\t\t\t\tuv.y = ( sinTheta * 0.5 * sign ) + 0.5;\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t// increase index\n\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\t// generate indices\n\n\t\t\tfor ( let x = 0; x < radialSegments; x ++ ) {\n\n\t\t\t\tconst c = centerIndexStart + x;\n\t\t\t\tconst i = centerIndexEnd + x;\n\n\t\t\t\tif ( top === true ) {\n\n\t\t\t\t\t// face top\n\n\t\t\t\t\tindices.push( i, i + 1, c );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// face bottom\n\n\t\t\t\t\tindices.push( i + 1, i, c );\n\n\t\t\t\t}\n\n\t\t\t\tgroupCount += 3;\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, top === true ? 1 : 2 );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new CylinderGeometry( data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass ConeGeometry extends CylinderGeometry {\n\n\tconstructor( radius = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper( 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );\n\n\t\tthis.type = 'ConeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new ConeGeometry( data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass PolyhedronGeometry extends BufferGeometry {\n\n\tconstructor( vertices = [], indices = [], radius = 1, detail = 0 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'PolyhedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tvertices: vertices,\n\t\t\tindices: indices,\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t\t// default buffer data\n\n\t\tconst vertexBuffer = [];\n\t\tconst uvBuffer = [];\n\n\t\t// the subdivision creates the vertex buffer data\n\n\t\tsubdivide( detail );\n\n\t\t// all vertices should lie on a conceptual sphere with a given radius\n\n\t\tapplyRadius( radius );\n\n\t\t// finally, create the uv data\n\n\t\tgenerateUVs();\n\n\t\t// build non-indexed geometry\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) );\n\n\t\tif ( detail === 0 ) {\n\n\t\t\tthis.computeVertexNormals(); // flat normals\n\n\t\t} else {\n\n\t\t\tthis.normalizeNormals(); // smooth normals\n\n\t\t}\n\n\t\t// helper functions\n\n\t\tfunction subdivide( detail ) {\n\n\t\t\tconst a = new Vector3();\n\t\t\tconst b = new Vector3();\n\t\t\tconst c = new Vector3();\n\n\t\t\t// iterate over all faces and apply a subdivision with the given detail value\n\n\t\t\tfor ( let i = 0; i < indices.length; i += 3 ) {\n\n\t\t\t\t// get the vertices of the face\n\n\t\t\t\tgetVertexByIndex( indices[ i + 0 ], a );\n\t\t\t\tgetVertexByIndex( indices[ i + 1 ], b );\n\t\t\t\tgetVertexByIndex( indices[ i + 2 ], c );\n\n\t\t\t\t// perform subdivision\n\n\t\t\t\tsubdivideFace( a, b, c, detail );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction subdivideFace( a, b, c, detail ) {\n\n\t\t\tconst cols = detail + 1;\n\n\t\t\t// we use this multidimensional array as a data structure for creating the subdivision\n\n\t\t\tconst v = [];\n\n\t\t\t// construct all of the vertices for this subdivision\n\n\t\t\tfor ( let i = 0; i <= cols; i ++ ) {\n\n\t\t\t\tv[ i ] = [];\n\n\t\t\t\tconst aj = a.clone().lerp( c, i / cols );\n\t\t\t\tconst bj = b.clone().lerp( c, i / cols );\n\n\t\t\t\tconst rows = cols - i;\n\n\t\t\t\tfor ( let j = 0; j <= rows; j ++ ) {\n\n\t\t\t\t\tif ( j === 0 && i === cols ) {\n\n\t\t\t\t\t\tv[ i ][ j ] = aj;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tv[ i ][ j ] = aj.clone().lerp( bj, j / rows );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// construct all of the faces\n\n\t\t\tfor ( let i = 0; i < cols; i ++ ) {\n\n\t\t\t\tfor ( let j = 0; j < 2 * ( cols - i ) - 1; j ++ ) {\n\n\t\t\t\t\tconst k = Math.floor( j / 2 );\n\n\t\t\t\t\tif ( j % 2 === 0 ) {\n\n\t\t\t\t\t\tpushVertex( v[ i ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k ] );\n\t\t\t\t\t\tpushVertex( v[ i ][ k ] );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tpushVertex( v[ i ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction applyRadius( radius ) {\n\n\t\t\tconst vertex = new Vector3();\n\n\t\t\t// iterate over the entire buffer and apply the radius to each vertex\n\n\t\t\tfor ( let i = 0; i < vertexBuffer.length; i += 3 ) {\n\n\t\t\t\tvertex.x = vertexBuffer[ i + 0 ];\n\t\t\t\tvertex.y = vertexBuffer[ i + 1 ];\n\t\t\t\tvertex.z = vertexBuffer[ i + 2 ];\n\n\t\t\t\tvertex.normalize().multiplyScalar( radius );\n\n\t\t\t\tvertexBuffer[ i + 0 ] = vertex.x;\n\t\t\t\tvertexBuffer[ i + 1 ] = vertex.y;\n\t\t\t\tvertexBuffer[ i + 2 ] = vertex.z;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateUVs() {\n\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tfor ( let i = 0; i < vertexBuffer.length; i += 3 ) {\n\n\t\t\t\tvertex.x = vertexBuffer[ i + 0 ];\n\t\t\t\tvertex.y = vertexBuffer[ i + 1 ];\n\t\t\t\tvertex.z = vertexBuffer[ i + 2 ];\n\n\t\t\t\tconst u = azimuth( vertex ) / 2 / Math.PI + 0.5;\n\t\t\t\tconst v = inclination( vertex ) / Math.PI + 0.5;\n\t\t\t\tuvBuffer.push( u, 1 - v );\n\n\t\t\t}\n\n\t\t\tcorrectUVs();\n\n\t\t\tcorrectSeam();\n\n\t\t}\n\n\t\tfunction correctSeam() {\n\n\t\t\t// handle case when face straddles the seam, see #3269\n\n\t\t\tfor ( let i = 0; i < uvBuffer.length; i += 6 ) {\n\n\t\t\t\t// uv data of a single face\n\n\t\t\t\tconst x0 = uvBuffer[ i + 0 ];\n\t\t\t\tconst x1 = uvBuffer[ i + 2 ];\n\t\t\t\tconst x2 = uvBuffer[ i + 4 ];\n\n\t\t\t\tconst max = Math.max( x0, x1, x2 );\n\t\t\t\tconst min = Math.min( x0, x1, x2 );\n\n\t\t\t\t// 0.9 is somewhat arbitrary\n\n\t\t\t\tif ( max > 0.9 && min < 0.1 ) {\n\n\t\t\t\t\tif ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1;\n\t\t\t\t\tif ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1;\n\t\t\t\t\tif ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction pushVertex( vertex ) {\n\n\t\t\tvertexBuffer.push( vertex.x, vertex.y, vertex.z );\n\n\t\t}\n\n\t\tfunction getVertexByIndex( index, vertex ) {\n\n\t\t\tconst stride = index * 3;\n\n\t\t\tvertex.x = vertices[ stride + 0 ];\n\t\t\tvertex.y = vertices[ stride + 1 ];\n\t\t\tvertex.z = vertices[ stride + 2 ];\n\n\t\t}\n\n\t\tfunction correctUVs() {\n\n\t\t\tconst a = new Vector3();\n\t\t\tconst b = new Vector3();\n\t\t\tconst c = new Vector3();\n\n\t\t\tconst centroid = new Vector3();\n\n\t\t\tconst uvA = new Vector2();\n\t\t\tconst uvB = new Vector2();\n\t\t\tconst uvC = new Vector2();\n\n\t\t\tfor ( let i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) {\n\n\t\t\t\ta.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] );\n\t\t\t\tb.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] );\n\t\t\t\tc.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] );\n\n\t\t\t\tuvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] );\n\t\t\t\tuvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] );\n\t\t\t\tuvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] );\n\n\t\t\t\tcentroid.copy( a ).add( b ).add( c ).divideScalar( 3 );\n\n\t\t\t\tconst azi = azimuth( centroid );\n\n\t\t\t\tcorrectUV( uvA, j + 0, a, azi );\n\t\t\t\tcorrectUV( uvB, j + 2, b, azi );\n\t\t\t\tcorrectUV( uvC, j + 4, c, azi );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction correctUV( uv, stride, vector, azimuth ) {\n\n\t\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) {\n\n\t\t\t\tuvBuffer[ stride ] = uv.x - 1;\n\n\t\t\t}\n\n\t\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) {\n\n\t\t\t\tuvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Angle around the Y axis, counter-clockwise when looking from above.\n\n\t\tfunction azimuth( vector ) {\n\n\t\t\treturn Math.atan2( vector.z, - vector.x );\n\n\t\t}\n\n\n\t\t// Angle above the XZ plane.\n\n\t\tfunction inclination( vector ) {\n\n\t\t\treturn Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new PolyhedronGeometry( data.vertices, data.indices, data.radius, data.details );\n\n\t}\n\n}\n\nclass DodecahedronGeometry extends PolyhedronGeometry {\n\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst t = ( 1 + Math.sqrt( 5 ) ) / 2;\n\t\tconst r = 1 / t;\n\n\t\tconst vertices = [\n\n\t\t\t// (±1, ±1, ±1)\n\t\t\t- 1, - 1, - 1,\t- 1, - 1, 1,\n\t\t\t- 1, 1, - 1, - 1, 1, 1,\n\t\t\t1, - 1, - 1, 1, - 1, 1,\n\t\t\t1, 1, - 1, 1, 1, 1,\n\n\t\t\t// (0, ±1/φ, ±φ)\n\t\t\t0, - r, - t, 0, - r, t,\n\t\t\t0, r, - t, 0, r, t,\n\n\t\t\t// (±1/φ, ±φ, 0)\n\t\t\t- r, - t, 0, - r, t, 0,\n\t\t\tr, - t, 0, r, t, 0,\n\n\t\t\t// (±φ, 0, ±1/φ)\n\t\t\t- t, 0, - r, t, 0, - r,\n\t\t\t- t, 0, r, t, 0, r\n\t\t];\n\n\t\tconst indices = [\n\t\t\t3, 11, 7, \t3, 7, 15, \t3, 15, 13,\n\t\t\t7, 19, 17, \t7, 17, 6, \t7, 6, 15,\n\t\t\t17, 4, 8, \t17, 8, 10, \t17, 10, 6,\n\t\t\t8, 0, 16, \t8, 16, 2, \t8, 2, 10,\n\t\t\t0, 12, 1, \t0, 1, 18, \t0, 18, 16,\n\t\t\t6, 10, 2, \t6, 2, 13, \t6, 13, 15,\n\t\t\t2, 16, 18, \t2, 18, 3, \t2, 3, 13,\n\t\t\t18, 1, 9, \t18, 9, 11, \t18, 11, 3,\n\t\t\t4, 14, 12, \t4, 12, 0, \t4, 0, 8,\n\t\t\t11, 9, 5, \t11, 5, 19, \t11, 19, 7,\n\t\t\t19, 5, 14, \t19, 14, 4, \t19, 4, 17,\n\t\t\t1, 12, 14, \t1, 14, 5, \t1, 5, 9\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'DodecahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new DodecahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nconst _v0 = /*@__PURE__*/ new Vector3();\nconst _v1$1 = /*@__PURE__*/ new Vector3();\nconst _normal = /*@__PURE__*/ new Vector3();\nconst _triangle = /*@__PURE__*/ new Triangle();\n\nclass EdgesGeometry extends BufferGeometry {\n\n\tconstructor( geometry = null, thresholdAngle = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'EdgesGeometry';\n\n\t\tthis.parameters = {\n\t\t\tgeometry: geometry,\n\t\t\tthresholdAngle: thresholdAngle\n\t\t};\n\n\t\tif ( geometry !== null ) {\n\n\t\t\tconst precisionPoints = 4;\n\t\t\tconst precision = Math.pow( 10, precisionPoints );\n\t\t\tconst thresholdDot = Math.cos( DEG2RAD * thresholdAngle );\n\n\t\t\tconst indexAttr = geometry.getIndex();\n\t\t\tconst positionAttr = geometry.getAttribute( 'position' );\n\t\t\tconst indexCount = indexAttr ? indexAttr.count : positionAttr.count;\n\n\t\t\tconst indexArr = [ 0, 0, 0 ];\n\t\t\tconst vertKeys = [ 'a', 'b', 'c' ];\n\t\t\tconst hashes = new Array( 3 );\n\n\t\t\tconst edgeData = {};\n\t\t\tconst vertices = [];\n\t\t\tfor ( let i = 0; i < indexCount; i += 3 ) {\n\n\t\t\t\tif ( indexAttr ) {\n\n\t\t\t\t\tindexArr[ 0 ] = indexAttr.getX( i );\n\t\t\t\t\tindexArr[ 1 ] = indexAttr.getX( i + 1 );\n\t\t\t\t\tindexArr[ 2 ] = indexAttr.getX( i + 2 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tindexArr[ 0 ] = i;\n\t\t\t\t\tindexArr[ 1 ] = i + 1;\n\t\t\t\t\tindexArr[ 2 ] = i + 2;\n\n\t\t\t\t}\n\n\t\t\t\tconst { a, b, c } = _triangle;\n\t\t\t\ta.fromBufferAttribute( positionAttr, indexArr[ 0 ] );\n\t\t\t\tb.fromBufferAttribute( positionAttr, indexArr[ 1 ] );\n\t\t\t\tc.fromBufferAttribute( positionAttr, indexArr[ 2 ] );\n\t\t\t\t_triangle.getNormal( _normal );\n\n\t\t\t\t// create hashes for the edge from the vertices\n\t\t\t\thashes[ 0 ] = `${ Math.round( a.x * precision ) },${ Math.round( a.y * precision ) },${ Math.round( a.z * precision ) }`;\n\t\t\t\thashes[ 1 ] = `${ Math.round( b.x * precision ) },${ Math.round( b.y * precision ) },${ Math.round( b.z * precision ) }`;\n\t\t\t\thashes[ 2 ] = `${ Math.round( c.x * precision ) },${ Math.round( c.y * precision ) },${ Math.round( c.z * precision ) }`;\n\n\t\t\t\t// skip degenerate triangles\n\t\t\t\tif ( hashes[ 0 ] === hashes[ 1 ] || hashes[ 1 ] === hashes[ 2 ] || hashes[ 2 ] === hashes[ 0 ] ) {\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\t// iterate over every edge\n\t\t\t\tfor ( let j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t// get the first and next vertex making up the edge\n\t\t\t\t\tconst jNext = ( j + 1 ) % 3;\n\t\t\t\t\tconst vecHash0 = hashes[ j ];\n\t\t\t\t\tconst vecHash1 = hashes[ jNext ];\n\t\t\t\t\tconst v0 = _triangle[ vertKeys[ j ] ];\n\t\t\t\t\tconst v1 = _triangle[ vertKeys[ jNext ] ];\n\n\t\t\t\t\tconst hash = `${ vecHash0 }_${ vecHash1 }`;\n\t\t\t\t\tconst reverseHash = `${ vecHash1 }_${ vecHash0 }`;\n\n\t\t\t\t\tif ( reverseHash in edgeData && edgeData[ reverseHash ] ) {\n\n\t\t\t\t\t\t// if we found a sibling edge add it into the vertex array if\n\t\t\t\t\t\t// it meets the angle threshold and delete the edge from the map.\n\t\t\t\t\t\tif ( _normal.dot( edgeData[ reverseHash ].normal ) <= thresholdDot ) {\n\n\t\t\t\t\t\t\tvertices.push( v0.x, v0.y, v0.z );\n\t\t\t\t\t\t\tvertices.push( v1.x, v1.y, v1.z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tedgeData[ reverseHash ] = null;\n\n\t\t\t\t\t} else if ( ! ( hash in edgeData ) ) {\n\n\t\t\t\t\t\t// if we've already got an edge here then skip adding a new one\n\t\t\t\t\t\tedgeData[ hash ] = {\n\n\t\t\t\t\t\t\tindex0: indexArr[ j ],\n\t\t\t\t\t\t\tindex1: indexArr[ jNext ],\n\t\t\t\t\t\t\tnormal: _normal.clone(),\n\n\t\t\t\t\t\t};\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// iterate over all remaining, unmatched edges and add them to the vertex array\n\t\t\tfor ( const key in edgeData ) {\n\n\t\t\t\tif ( edgeData[ key ] ) {\n\n\t\t\t\t\tconst { index0, index1 } = edgeData[ key ];\n\t\t\t\t\t_v0.fromBufferAttribute( positionAttr, index0 );\n\t\t\t\t\t_v1$1.fromBufferAttribute( positionAttr, index1 );\n\n\t\t\t\t\tvertices.push( _v0.x, _v0.y, _v0.z );\n\t\t\t\t\tvertices.push( _v1$1.x, _v1$1.y, _v1$1.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass Shape extends Path {\n\n\tconstructor( points ) {\n\n\t\tsuper( points );\n\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.type = 'Shape';\n\n\t\tthis.holes = [];\n\n\t}\n\n\tgetPointsHoles( divisions ) {\n\n\t\tconst holesPts = [];\n\n\t\tfor ( let i = 0, l = this.holes.length; i < l; i ++ ) {\n\n\t\t\tholesPts[ i ] = this.holes[ i ].getPoints( divisions );\n\n\t\t}\n\n\t\treturn holesPts;\n\n\t}\n\n\t// get points of shape and holes (keypoints based on segments parameter)\n\n\textractPoints( divisions ) {\n\n\t\treturn {\n\n\t\t\tshape: this.getPoints( divisions ),\n\t\t\tholes: this.getPointsHoles( divisions )\n\n\t\t};\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.holes = [];\n\n\t\tfor ( let i = 0, l = source.holes.length; i < l; i ++ ) {\n\n\t\t\tconst hole = source.holes[ i ];\n\n\t\t\tthis.holes.push( hole.clone() );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.uuid = this.uuid;\n\t\tdata.holes = [];\n\n\t\tfor ( let i = 0, l = this.holes.length; i < l; i ++ ) {\n\n\t\t\tconst hole = this.holes[ i ];\n\t\t\tdata.holes.push( hole.toJSON() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.uuid = json.uuid;\n\t\tthis.holes = [];\n\n\t\tfor ( let i = 0, l = json.holes.length; i < l; i ++ ) {\n\n\t\t\tconst hole = json.holes[ i ];\n\t\t\tthis.holes.push( new Path().fromJSON( hole ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Port from https://github.com/mapbox/earcut (v2.2.4)\n */\n\nconst Earcut = {\n\n\ttriangulate: function ( data, holeIndices, dim = 2 ) {\n\n\t\tconst hasHoles = holeIndices && holeIndices.length;\n\t\tconst outerLen = hasHoles ? holeIndices[ 0 ] * dim : data.length;\n\t\tlet outerNode = linkedList( data, 0, outerLen, dim, true );\n\t\tconst triangles = [];\n\n\t\tif ( ! outerNode || outerNode.next === outerNode.prev ) return triangles;\n\n\t\tlet minX, minY, maxX, maxY, x, y, invSize;\n\n\t\tif ( hasHoles ) outerNode = eliminateHoles( data, holeIndices, outerNode, dim );\n\n\t\t// if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n\t\tif ( data.length > 80 * dim ) {\n\n\t\t\tminX = maxX = data[ 0 ];\n\t\t\tminY = maxY = data[ 1 ];\n\n\t\t\tfor ( let i = dim; i < outerLen; i += dim ) {\n\n\t\t\t\tx = data[ i ];\n\t\t\t\ty = data[ i + 1 ];\n\t\t\t\tif ( x < minX ) minX = x;\n\t\t\t\tif ( y < minY ) minY = y;\n\t\t\t\tif ( x > maxX ) maxX = x;\n\t\t\t\tif ( y > maxY ) maxY = y;\n\n\t\t\t}\n\n\t\t\t// minX, minY and invSize are later used to transform coords into integers for z-order calculation\n\t\t\tinvSize = Math.max( maxX - minX, maxY - minY );\n\t\t\tinvSize = invSize !== 0 ? 32767 / invSize : 0;\n\n\t\t}\n\n\t\tearcutLinked( outerNode, triangles, dim, minX, minY, invSize, 0 );\n\n\t\treturn triangles;\n\n\t}\n\n};\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList( data, start, end, dim, clockwise ) {\n\n\tlet i, last;\n\n\tif ( clockwise === ( signedArea( data, start, end, dim ) > 0 ) ) {\n\n\t\tfor ( i = start; i < end; i += dim ) last = insertNode( i, data[ i ], data[ i + 1 ], last );\n\n\t} else {\n\n\t\tfor ( i = end - dim; i >= start; i -= dim ) last = insertNode( i, data[ i ], data[ i + 1 ], last );\n\n\t}\n\n\tif ( last && equals( last, last.next ) ) {\n\n\t\tremoveNode( last );\n\t\tlast = last.next;\n\n\t}\n\n\treturn last;\n\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints( start, end ) {\n\n\tif ( ! start ) return start;\n\tif ( ! end ) end = start;\n\n\tlet p = start,\n\t\tagain;\n\tdo {\n\n\t\tagain = false;\n\n\t\tif ( ! p.steiner && ( equals( p, p.next ) || area( p.prev, p, p.next ) === 0 ) ) {\n\n\t\t\tremoveNode( p );\n\t\t\tp = end = p.prev;\n\t\t\tif ( p === p.next ) break;\n\t\t\tagain = true;\n\n\t\t} else {\n\n\t\t\tp = p.next;\n\n\t\t}\n\n\t} while ( again || p !== end );\n\n\treturn end;\n\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked( ear, triangles, dim, minX, minY, invSize, pass ) {\n\n\tif ( ! ear ) return;\n\n\t// interlink polygon nodes in z-order\n\tif ( ! pass && invSize ) indexCurve( ear, minX, minY, invSize );\n\n\tlet stop = ear,\n\t\tprev, next;\n\n\t// iterate through ears, slicing them one by one\n\twhile ( ear.prev !== ear.next ) {\n\n\t\tprev = ear.prev;\n\t\tnext = ear.next;\n\n\t\tif ( invSize ? isEarHashed( ear, minX, minY, invSize ) : isEar( ear ) ) {\n\n\t\t\t// cut off the triangle\n\t\t\ttriangles.push( prev.i / dim | 0 );\n\t\t\ttriangles.push( ear.i / dim | 0 );\n\t\t\ttriangles.push( next.i / dim | 0 );\n\n\t\t\tremoveNode( ear );\n\n\t\t\t// skipping the next vertex leads to less sliver triangles\n\t\t\tear = next.next;\n\t\t\tstop = next.next;\n\n\t\t\tcontinue;\n\n\t\t}\n\n\t\tear = next;\n\n\t\t// if we looped through the whole remaining polygon and can't find any more ears\n\t\tif ( ear === stop ) {\n\n\t\t\t// try filtering points and slicing again\n\t\t\tif ( ! pass ) {\n\n\t\t\t\tearcutLinked( filterPoints( ear ), triangles, dim, minX, minY, invSize, 1 );\n\n\t\t\t\t// if this didn't work, try curing all small self-intersections locally\n\n\t\t\t} else if ( pass === 1 ) {\n\n\t\t\t\tear = cureLocalIntersections( filterPoints( ear ), triangles, dim );\n\t\t\t\tearcutLinked( ear, triangles, dim, minX, minY, invSize, 2 );\n\n\t\t\t\t// as a last resort, try splitting the remaining polygon into two\n\n\t\t\t} else if ( pass === 2 ) {\n\n\t\t\t\tsplitEarcut( ear, triangles, dim, minX, minY, invSize );\n\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar( ear ) {\n\n\tconst a = ear.prev,\n\t\tb = ear,\n\t\tc = ear.next;\n\n\tif ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear\n\n\t// now make sure we don't have other points inside the potential ear\n\tconst ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n\t// triangle bbox; min & max are calculated like this for speed\n\tconst x0 = ax < bx ? ( ax < cx ? ax : cx ) : ( bx < cx ? bx : cx ),\n\t\ty0 = ay < by ? ( ay < cy ? ay : cy ) : ( by < cy ? by : cy ),\n\t\tx1 = ax > bx ? ( ax > cx ? ax : cx ) : ( bx > cx ? bx : cx ),\n\t\ty1 = ay > by ? ( ay > cy ? ay : cy ) : ( by > cy ? by : cy );\n\n\tlet p = c.next;\n\twhile ( p !== a ) {\n\n\t\tif ( p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n\t\t\tpointInTriangle( ax, ay, bx, by, cx, cy, p.x, p.y ) &&\n\t\t\tarea( p.prev, p, p.next ) >= 0 ) return false;\n\t\tp = p.next;\n\n\t}\n\n\treturn true;\n\n}\n\nfunction isEarHashed( ear, minX, minY, invSize ) {\n\n\tconst a = ear.prev,\n\t\tb = ear,\n\t\tc = ear.next;\n\n\tif ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear\n\n\tconst ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n\t// triangle bbox; min & max are calculated like this for speed\n\tconst x0 = ax < bx ? ( ax < cx ? ax : cx ) : ( bx < cx ? bx : cx ),\n\t\ty0 = ay < by ? ( ay < cy ? ay : cy ) : ( by < cy ? by : cy ),\n\t\tx1 = ax > bx ? ( ax > cx ? ax : cx ) : ( bx > cx ? bx : cx ),\n\t\ty1 = ay > by ? ( ay > cy ? ay : cy ) : ( by > cy ? by : cy );\n\n\t// z-order range for the current triangle bbox;\n\tconst minZ = zOrder( x0, y0, minX, minY, invSize ),\n\t\tmaxZ = zOrder( x1, y1, minX, minY, invSize );\n\n\tlet p = ear.prevZ,\n\t\tn = ear.nextZ;\n\n\t// look for points inside the triangle in both directions\n\twhile ( p && p.z >= minZ && n && n.z <= maxZ ) {\n\n\t\tif ( p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n\t\t\tpointInTriangle( ax, ay, bx, by, cx, cy, p.x, p.y ) && area( p.prev, p, p.next ) >= 0 ) return false;\n\t\tp = p.prevZ;\n\n\t\tif ( n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n\t\t\tpointInTriangle( ax, ay, bx, by, cx, cy, n.x, n.y ) && area( n.prev, n, n.next ) >= 0 ) return false;\n\t\tn = n.nextZ;\n\n\t}\n\n\t// look for remaining points in decreasing z-order\n\twhile ( p && p.z >= minZ ) {\n\n\t\tif ( p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n\t\t\tpointInTriangle( ax, ay, bx, by, cx, cy, p.x, p.y ) && area( p.prev, p, p.next ) >= 0 ) return false;\n\t\tp = p.prevZ;\n\n\t}\n\n\t// look for remaining points in increasing z-order\n\twhile ( n && n.z <= maxZ ) {\n\n\t\tif ( n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n\t\t\tpointInTriangle( ax, ay, bx, by, cx, cy, n.x, n.y ) && area( n.prev, n, n.next ) >= 0 ) return false;\n\t\tn = n.nextZ;\n\n\t}\n\n\treturn true;\n\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections( start, triangles, dim ) {\n\n\tlet p = start;\n\tdo {\n\n\t\tconst a = p.prev,\n\t\t\tb = p.next.next;\n\n\t\tif ( ! equals( a, b ) && intersects( a, p, p.next, b ) && locallyInside( a, b ) && locallyInside( b, a ) ) {\n\n\t\t\ttriangles.push( a.i / dim | 0 );\n\t\t\ttriangles.push( p.i / dim | 0 );\n\t\t\ttriangles.push( b.i / dim | 0 );\n\n\t\t\t// remove two nodes involved\n\t\t\tremoveNode( p );\n\t\t\tremoveNode( p.next );\n\n\t\t\tp = start = b;\n\n\t\t}\n\n\t\tp = p.next;\n\n\t} while ( p !== start );\n\n\treturn filterPoints( p );\n\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut( start, triangles, dim, minX, minY, invSize ) {\n\n\t// look for a valid diagonal that divides the polygon into two\n\tlet a = start;\n\tdo {\n\n\t\tlet b = a.next.next;\n\t\twhile ( b !== a.prev ) {\n\n\t\t\tif ( a.i !== b.i && isValidDiagonal( a, b ) ) {\n\n\t\t\t\t// split the polygon in two by the diagonal\n\t\t\t\tlet c = splitPolygon( a, b );\n\n\t\t\t\t// filter colinear points around the cuts\n\t\t\t\ta = filterPoints( a, a.next );\n\t\t\t\tc = filterPoints( c, c.next );\n\n\t\t\t\t// run earcut on each half\n\t\t\t\tearcutLinked( a, triangles, dim, minX, minY, invSize, 0 );\n\t\t\t\tearcutLinked( c, triangles, dim, minX, minY, invSize, 0 );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tb = b.next;\n\n\t\t}\n\n\t\ta = a.next;\n\n\t} while ( a !== start );\n\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles( data, holeIndices, outerNode, dim ) {\n\n\tconst queue = [];\n\tlet i, len, start, end, list;\n\n\tfor ( i = 0, len = holeIndices.length; i < len; i ++ ) {\n\n\t\tstart = holeIndices[ i ] * dim;\n\t\tend = i < len - 1 ? holeIndices[ i + 1 ] * dim : data.length;\n\t\tlist = linkedList( data, start, end, dim, false );\n\t\tif ( list === list.next ) list.steiner = true;\n\t\tqueue.push( getLeftmost( list ) );\n\n\t}\n\n\tqueue.sort( compareX );\n\n\t// process holes from left to right\n\tfor ( i = 0; i < queue.length; i ++ ) {\n\n\t\touterNode = eliminateHole( queue[ i ], outerNode );\n\n\t}\n\n\treturn outerNode;\n\n}\n\nfunction compareX( a, b ) {\n\n\treturn a.x - b.x;\n\n}\n\n// find a bridge between vertices that connects hole with an outer ring and link it\nfunction eliminateHole( hole, outerNode ) {\n\n\tconst bridge = findHoleBridge( hole, outerNode );\n\tif ( ! bridge ) {\n\n\t\treturn outerNode;\n\n\t}\n\n\tconst bridgeReverse = splitPolygon( bridge, hole );\n\n\t// filter collinear points around the cuts\n\tfilterPoints( bridgeReverse, bridgeReverse.next );\n\treturn filterPoints( bridge, bridge.next );\n\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge( hole, outerNode ) {\n\n\tlet p = outerNode,\n\t\tqx = - Infinity,\n\t\tm;\n\n\tconst hx = hole.x, hy = hole.y;\n\n\t// find a segment intersected by a ray from the hole's leftmost point to the left;\n\t// segment's endpoint with lesser x will be potential connection point\n\tdo {\n\n\t\tif ( hy <= p.y && hy >= p.next.y && p.next.y !== p.y ) {\n\n\t\t\tconst x = p.x + ( hy - p.y ) * ( p.next.x - p.x ) / ( p.next.y - p.y );\n\t\t\tif ( x <= hx && x > qx ) {\n\n\t\t\t\tqx = x;\n\t\t\t\tm = p.x < p.next.x ? p : p.next;\n\t\t\t\tif ( x === hx ) return m; // hole touches outer segment; pick leftmost endpoint\n\n\t\t\t}\n\n\t\t}\n\n\t\tp = p.next;\n\n\t} while ( p !== outerNode );\n\n\tif ( ! m ) return null;\n\n\t// look for points inside the triangle of hole point, segment intersection and endpoint;\n\t// if there are no points found, we have a valid connection;\n\t// otherwise choose the point of the minimum angle with the ray as connection point\n\n\tconst stop = m,\n\t\tmx = m.x,\n\t\tmy = m.y;\n\tlet tanMin = Infinity, tan;\n\n\tp = m;\n\n\tdo {\n\n\t\tif ( hx >= p.x && p.x >= mx && hx !== p.x &&\n\t\t\t\tpointInTriangle( hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y ) ) {\n\n\t\t\ttan = Math.abs( hy - p.y ) / ( hx - p.x ); // tangential\n\n\t\t\tif ( locallyInside( p, hole ) && ( tan < tanMin || ( tan === tanMin && ( p.x > m.x || ( p.x === m.x && sectorContainsSector( m, p ) ) ) ) ) ) {\n\n\t\t\t\tm = p;\n\t\t\t\ttanMin = tan;\n\n\t\t\t}\n\n\t\t}\n\n\t\tp = p.next;\n\n\t} while ( p !== stop );\n\n\treturn m;\n\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector( m, p ) {\n\n\treturn area( m.prev, m, p.prev ) < 0 && area( p.next, m, m.next ) < 0;\n\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve( start, minX, minY, invSize ) {\n\n\tlet p = start;\n\tdo {\n\n\t\tif ( p.z === 0 ) p.z = zOrder( p.x, p.y, minX, minY, invSize );\n\t\tp.prevZ = p.prev;\n\t\tp.nextZ = p.next;\n\t\tp = p.next;\n\n\t} while ( p !== start );\n\n\tp.prevZ.nextZ = null;\n\tp.prevZ = null;\n\n\tsortLinked( p );\n\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked( list ) {\n\n\tlet i, p, q, e, tail, numMerges, pSize, qSize,\n\t\tinSize = 1;\n\n\tdo {\n\n\t\tp = list;\n\t\tlist = null;\n\t\ttail = null;\n\t\tnumMerges = 0;\n\n\t\twhile ( p ) {\n\n\t\t\tnumMerges ++;\n\t\t\tq = p;\n\t\t\tpSize = 0;\n\t\t\tfor ( i = 0; i < inSize; i ++ ) {\n\n\t\t\t\tpSize ++;\n\t\t\t\tq = q.nextZ;\n\t\t\t\tif ( ! q ) break;\n\n\t\t\t}\n\n\t\t\tqSize = inSize;\n\n\t\t\twhile ( pSize > 0 || ( qSize > 0 && q ) ) {\n\n\t\t\t\tif ( pSize !== 0 && ( qSize === 0 || ! q || p.z <= q.z ) ) {\n\n\t\t\t\t\te = p;\n\t\t\t\t\tp = p.nextZ;\n\t\t\t\t\tpSize --;\n\n\t\t\t\t} else {\n\n\t\t\t\t\te = q;\n\t\t\t\t\tq = q.nextZ;\n\t\t\t\t\tqSize --;\n\n\t\t\t\t}\n\n\t\t\t\tif ( tail ) tail.nextZ = e;\n\t\t\t\telse list = e;\n\n\t\t\t\te.prevZ = tail;\n\t\t\t\ttail = e;\n\n\t\t\t}\n\n\t\t\tp = q;\n\n\t\t}\n\n\t\ttail.nextZ = null;\n\t\tinSize *= 2;\n\n\t} while ( numMerges > 1 );\n\n\treturn list;\n\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder( x, y, minX, minY, invSize ) {\n\n\t// coords are transformed into non-negative 15-bit integer range\n\tx = ( x - minX ) * invSize | 0;\n\ty = ( y - minY ) * invSize | 0;\n\n\tx = ( x | ( x << 8 ) ) & 0x00FF00FF;\n\tx = ( x | ( x << 4 ) ) & 0x0F0F0F0F;\n\tx = ( x | ( x << 2 ) ) & 0x33333333;\n\tx = ( x | ( x << 1 ) ) & 0x55555555;\n\n\ty = ( y | ( y << 8 ) ) & 0x00FF00FF;\n\ty = ( y | ( y << 4 ) ) & 0x0F0F0F0F;\n\ty = ( y | ( y << 2 ) ) & 0x33333333;\n\ty = ( y | ( y << 1 ) ) & 0x55555555;\n\n\treturn x | ( y << 1 );\n\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost( start ) {\n\n\tlet p = start,\n\t\tleftmost = start;\n\tdo {\n\n\t\tif ( p.x < leftmost.x || ( p.x === leftmost.x && p.y < leftmost.y ) ) leftmost = p;\n\t\tp = p.next;\n\n\t} while ( p !== start );\n\n\treturn leftmost;\n\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) >= ( ax - px ) * ( cy - py ) &&\n ( ax - px ) * ( by - py ) >= ( bx - px ) * ( ay - py ) &&\n ( bx - px ) * ( cy - py ) >= ( cx - px ) * ( by - py );\n\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal( a, b ) {\n\n\treturn a.next.i !== b.i && a.prev.i !== b.i && ! intersectsPolygon( a, b ) && // dones't intersect other edges\n ( locallyInside( a, b ) && locallyInside( b, a ) && middleInside( a, b ) && // locally visible\n ( area( a.prev, a, b.prev ) || area( a, b.prev, b ) ) || // does not create opposite-facing sectors\n equals( a, b ) && area( a.prev, a, a.next ) > 0 && area( b.prev, b, b.next ) > 0 ); // special zero-length case\n\n}\n\n// signed area of a triangle\nfunction area( p, q, r ) {\n\n\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n}\n\n// check if two points are equal\nfunction equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}\n\n// check if two segments intersect\nfunction intersects( p1, q1, p2, q2 ) {\n\n\tconst o1 = sign( area( p1, q1, p2 ) );\n\tconst o2 = sign( area( p1, q1, q2 ) );\n\tconst o3 = sign( area( p2, q2, p1 ) );\n\tconst o4 = sign( area( p2, q2, q1 ) );\n\n\tif ( o1 !== o2 && o3 !== o4 ) return true; // general case\n\n\tif ( o1 === 0 && onSegment( p1, p2, q1 ) ) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n\tif ( o2 === 0 && onSegment( p1, q2, q1 ) ) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n\tif ( o3 === 0 && onSegment( p2, p1, q2 ) ) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n\tif ( o4 === 0 && onSegment( p2, q1, q2 ) ) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n\treturn false;\n\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment( p, q, r ) {\n\n\treturn q.x <= Math.max( p.x, r.x ) && q.x >= Math.min( p.x, r.x ) && q.y <= Math.max( p.y, r.y ) && q.y >= Math.min( p.y, r.y );\n\n}\n\nfunction sign( num ) {\n\n\treturn num > 0 ? 1 : num < 0 ? - 1 : 0;\n\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon( a, b ) {\n\n\tlet p = a;\n\tdo {\n\n\t\tif ( p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n\t\t\tintersects( p, p.next, a, b ) ) return true;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn false;\n\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside( a, b ) {\n\n\treturn area( a.prev, a, a.next ) < 0 ?\n\t\tarea( a, b, a.next ) >= 0 && area( a, a.prev, b ) >= 0 :\n\t\tarea( a, b, a.prev ) < 0 || area( a, a.next, b ) < 0;\n\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside( a, b ) {\n\n\tlet p = a,\n\t\tinside = false;\n\tconst px = ( a.x + b.x ) / 2,\n\t\tpy = ( a.y + b.y ) / 2;\n\tdo {\n\n\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n\t\t\tinside = ! inside;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn inside;\n\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon( a, b ) {\n\n\tconst a2 = new Node( a.i, a.x, a.y ),\n\t\tb2 = new Node( b.i, b.x, b.y ),\n\t\tan = a.next,\n\t\tbp = b.prev;\n\n\ta.next = b;\n\tb.prev = a;\n\n\ta2.next = an;\n\tan.prev = a2;\n\n\tb2.next = a2;\n\ta2.prev = b2;\n\n\tbp.next = b2;\n\tb2.prev = bp;\n\n\treturn b2;\n\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode( i, x, y, last ) {\n\n\tconst p = new Node( i, x, y );\n\n\tif ( ! last ) {\n\n\t\tp.prev = p;\n\t\tp.next = p;\n\n\t} else {\n\n\t\tp.next = last.next;\n\t\tp.prev = last;\n\t\tlast.next.prev = p;\n\t\tlast.next = p;\n\n\t}\n\n\treturn p;\n\n}\n\nfunction removeNode( p ) {\n\n\tp.next.prev = p.prev;\n\tp.prev.next = p.next;\n\n\tif ( p.prevZ ) p.prevZ.nextZ = p.nextZ;\n\tif ( p.nextZ ) p.nextZ.prevZ = p.prevZ;\n\n}\n\nfunction Node( i, x, y ) {\n\n\t// vertex index in coordinates array\n\tthis.i = i;\n\n\t// vertex coordinates\n\tthis.x = x;\n\tthis.y = y;\n\n\t// previous and next vertex nodes in a polygon ring\n\tthis.prev = null;\n\tthis.next = null;\n\n\t// z-order curve value\n\tthis.z = 0;\n\n\t// previous and next nodes in z-order\n\tthis.prevZ = null;\n\tthis.nextZ = null;\n\n\t// indicates whether this is a steiner point\n\tthis.steiner = false;\n\n}\n\nfunction signedArea( data, start, end, dim ) {\n\n\tlet sum = 0;\n\tfor ( let i = start, j = end - dim; i < end; i += dim ) {\n\n\t\tsum += ( data[ j ] - data[ i ] ) * ( data[ i + 1 ] + data[ j + 1 ] );\n\t\tj = i;\n\n\t}\n\n\treturn sum;\n\n}\n\nclass ShapeUtils {\n\n\t// calculate area of the contour polygon\n\n\tstatic area( contour ) {\n\n\t\tconst n = contour.length;\n\t\tlet a = 0.0;\n\n\t\tfor ( let p = n - 1, q = 0; q < n; p = q ++ ) {\n\n\t\t\ta += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y;\n\n\t\t}\n\n\t\treturn a * 0.5;\n\n\t}\n\n\tstatic isClockWise( pts ) {\n\n\t\treturn ShapeUtils.area( pts ) < 0;\n\n\t}\n\n\tstatic triangulateShape( contour, holes ) {\n\n\t\tconst vertices = []; // flat array of vertices like [ x0,y0, x1,y1, x2,y2, ... ]\n\t\tconst holeIndices = []; // array of hole indices\n\t\tconst faces = []; // final array of vertex indices like [ [ a,b,d ], [ b,c,d ] ]\n\n\t\tremoveDupEndPts( contour );\n\t\taddContour( vertices, contour );\n\n\t\t//\n\n\t\tlet holeIndex = contour.length;\n\n\t\tholes.forEach( removeDupEndPts );\n\n\t\tfor ( let i = 0; i < holes.length; i ++ ) {\n\n\t\t\tholeIndices.push( holeIndex );\n\t\t\tholeIndex += holes[ i ].length;\n\t\t\taddContour( vertices, holes[ i ] );\n\n\t\t}\n\n\t\t//\n\n\t\tconst triangles = Earcut.triangulate( vertices, holeIndices );\n\n\t\t//\n\n\t\tfor ( let i = 0; i < triangles.length; i += 3 ) {\n\n\t\t\tfaces.push( triangles.slice( i, i + 3 ) );\n\n\t\t}\n\n\t\treturn faces;\n\n\t}\n\n}\n\nfunction removeDupEndPts( points ) {\n\n\tconst l = points.length;\n\n\tif ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) {\n\n\t\tpoints.pop();\n\n\t}\n\n}\n\nfunction addContour( vertices, contour ) {\n\n\tfor ( let i = 0; i < contour.length; i ++ ) {\n\n\t\tvertices.push( contour[ i ].x );\n\t\tvertices.push( contour[ i ].y );\n\n\t}\n\n}\n\n/**\n * Creates extruded geometry from a path shape.\n *\n * parameters = {\n *\n * curveSegments: , // number of points on the curves\n * steps: , // number of points for z-side extrusions / used for subdividing segments of extrude spline too\n * depth: , // Depth to extrude the shape\n *\n * bevelEnabled: , // turn on bevel\n * bevelThickness: , // how deep into the original shape bevel goes\n * bevelSize: , // how far from shape outline (including bevelOffset) is bevel\n * bevelOffset: , // how far from shape outline does bevel start\n * bevelSegments: , // number of bevel layers\n *\n * extrudePath: // curve to extrude shape along\n *\n * UVGenerator: // object that provides UV generator functions\n *\n * }\n */\n\n\nclass ExtrudeGeometry extends BufferGeometry {\n\n\tconstructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( - 0.5, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), options = {} ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ExtrudeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tshapes: shapes,\n\t\t\toptions: options\n\t\t};\n\n\t\tshapes = Array.isArray( shapes ) ? shapes : [ shapes ];\n\n\t\tconst scope = this;\n\n\t\tconst verticesArray = [];\n\t\tconst uvArray = [];\n\n\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\t\t\taddShape( shape );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) );\n\n\t\tthis.computeVertexNormals();\n\n\t\t// functions\n\n\t\tfunction addShape( shape ) {\n\n\t\t\tconst placeholder = [];\n\n\t\t\t// options\n\n\t\t\tconst curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;\n\t\t\tconst steps = options.steps !== undefined ? options.steps : 1;\n\t\t\tconst depth = options.depth !== undefined ? options.depth : 1;\n\n\t\t\tlet bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true;\n\t\t\tlet bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 0.2;\n\t\t\tlet bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 0.1;\n\t\t\tlet bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0;\n\t\t\tlet bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3;\n\n\t\t\tconst extrudePath = options.extrudePath;\n\n\t\t\tconst uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator;\n\n\t\t\t//\n\n\t\t\tlet extrudePts, extrudeByPath = false;\n\t\t\tlet splineTube, binormal, normal, position2;\n\n\t\t\tif ( extrudePath ) {\n\n\t\t\t\textrudePts = extrudePath.getSpacedPoints( steps );\n\n\t\t\t\textrudeByPath = true;\n\t\t\t\tbevelEnabled = false; // bevels not supported for path extrusion\n\n\t\t\t\t// SETUP TNB variables\n\n\t\t\t\t// TODO1 - have a .isClosed in spline?\n\n\t\t\t\tsplineTube = extrudePath.computeFrenetFrames( steps, false );\n\n\t\t\t\t// console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);\n\n\t\t\t\tbinormal = new Vector3();\n\t\t\t\tnormal = new Vector3();\n\t\t\t\tposition2 = new Vector3();\n\n\t\t\t}\n\n\t\t\t// Safeguards if bevels are not enabled\n\n\t\t\tif ( ! bevelEnabled ) {\n\n\t\t\t\tbevelSegments = 0;\n\t\t\t\tbevelThickness = 0;\n\t\t\t\tbevelSize = 0;\n\t\t\t\tbevelOffset = 0;\n\n\t\t\t}\n\n\t\t\t// Variables initialization\n\n\t\t\tconst shapePoints = shape.extractPoints( curveSegments );\n\n\t\t\tlet vertices = shapePoints.shape;\n\t\t\tconst holes = shapePoints.holes;\n\n\t\t\tconst reverse = ! ShapeUtils.isClockWise( vertices );\n\n\t\t\tif ( reverse ) {\n\n\t\t\t\tvertices = vertices.reverse();\n\n\t\t\t\t// Maybe we should also check if holes are in the opposite direction, just to be safe ...\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\t\tif ( ShapeUtils.isClockWise( ahole ) ) {\n\n\t\t\t\t\t\tholes[ h ] = ahole.reverse();\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\tconst faces = ShapeUtils.triangulateShape( vertices, holes );\n\n\t\t\t/* Vertices */\n\n\t\t\tconst contour = vertices; // vertices has all points but contour has only points of circumference\n\n\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\tvertices = vertices.concat( ahole );\n\n\t\t\t}\n\n\n\t\t\tfunction scalePt2( pt, vec, size ) {\n\n\t\t\t\tif ( ! vec ) console.error( 'THREE.ExtrudeGeometry: vec does not exist' );\n\n\t\t\t\treturn pt.clone().addScaledVector( vec, size );\n\n\t\t\t}\n\n\t\t\tconst vlen = vertices.length, flen = faces.length;\n\n\n\t\t\t// Find directions for point movement\n\n\n\t\t\tfunction getBevelVec( inPt, inPrev, inNext ) {\n\n\t\t\t\t// computes for inPt the corresponding point inPt' on a new contour\n\t\t\t\t// shifted by 1 unit (length of normalized vector) to the left\n\t\t\t\t// if we walk along contour clockwise, this new contour is outside the old one\n\t\t\t\t//\n\t\t\t\t// inPt' is the intersection of the two lines parallel to the two\n\t\t\t\t// adjacent edges of inPt at a distance of 1 unit on the left side.\n\n\t\t\t\tlet v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt\n\n\t\t\t\t// good reading for geometry algorithms (here: line-line intersection)\n\t\t\t\t// http://geomalgorithms.com/a05-_intersect-1.html\n\n\t\t\t\tconst v_prev_x = inPt.x - inPrev.x,\n\t\t\t\t\tv_prev_y = inPt.y - inPrev.y;\n\t\t\t\tconst v_next_x = inNext.x - inPt.x,\n\t\t\t\t\tv_next_y = inNext.y - inPt.y;\n\n\t\t\t\tconst v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y );\n\n\t\t\t\t// check for collinear edges\n\t\t\t\tconst collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x );\n\n\t\t\t\tif ( Math.abs( collinear0 ) > Number.EPSILON ) {\n\n\t\t\t\t\t// not collinear\n\n\t\t\t\t\t// length of vectors for normalizing\n\n\t\t\t\t\tconst v_prev_len = Math.sqrt( v_prev_lensq );\n\t\t\t\t\tconst v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y );\n\n\t\t\t\t\t// shift adjacent points by unit vectors to the left\n\n\t\t\t\t\tconst ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len );\n\t\t\t\t\tconst ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len );\n\n\t\t\t\t\tconst ptNextShift_x = ( inNext.x - v_next_y / v_next_len );\n\t\t\t\t\tconst ptNextShift_y = ( inNext.y + v_next_x / v_next_len );\n\n\t\t\t\t\t// scaling factor for v_prev to intersection point\n\n\t\t\t\t\tconst sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y -\n\t\t\t\t\t\t\t( ptNextShift_y - ptPrevShift_y ) * v_next_x ) /\n\t\t\t\t\t\t( v_prev_x * v_next_y - v_prev_y * v_next_x );\n\n\t\t\t\t\t// vector from inPt to intersection point\n\n\t\t\t\t\tv_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x );\n\t\t\t\t\tv_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y );\n\n\t\t\t\t\t// Don't normalize!, otherwise sharp corners become ugly\n\t\t\t\t\t// but prevent crazy spikes\n\t\t\t\t\tconst v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y );\n\t\t\t\t\tif ( v_trans_lensq <= 2 ) {\n\n\t\t\t\t\t\treturn new Vector2( v_trans_x, v_trans_y );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_trans_lensq / 2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// handle special case of collinear edges\n\n\t\t\t\t\tlet direction_eq = false; // assumes: opposite\n\n\t\t\t\t\tif ( v_prev_x > Number.EPSILON ) {\n\n\t\t\t\t\t\tif ( v_next_x > Number.EPSILON ) {\n\n\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( v_prev_x < - Number.EPSILON ) {\n\n\t\t\t\t\t\t\tif ( v_next_x < - Number.EPSILON ) {\n\n\t\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) {\n\n\t\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( direction_eq ) {\n\n\t\t\t\t\t\t// console.log(\"Warning: lines are a straight sequence\");\n\t\t\t\t\t\tv_trans_x = - v_prev_y;\n\t\t\t\t\t\tv_trans_y = v_prev_x;\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_prev_lensq );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// console.log(\"Warning: lines are a straight spike\");\n\t\t\t\t\t\tv_trans_x = v_prev_x;\n\t\t\t\t\t\tv_trans_y = v_prev_y;\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_prev_lensq / 2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by );\n\n\t\t\t}\n\n\n\t\t\tconst contourMovements = [];\n\n\t\t\tfor ( let i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) {\n\n\t\t\t\tif ( j === il ) j = 0;\n\t\t\t\tif ( k === il ) k = 0;\n\n\t\t\t\t// (j)---(i)---(k)\n\t\t\t\t// console.log('i,j,k', i, j , k)\n\n\t\t\t\tcontourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] );\n\n\t\t\t}\n\n\t\t\tconst holesMovements = [];\n\t\t\tlet oneHoleMovements, verticesMovements = contourMovements.concat();\n\n\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\toneHoleMovements = [];\n\n\t\t\t\tfor ( let i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) {\n\n\t\t\t\t\tif ( j === il ) j = 0;\n\t\t\t\t\tif ( k === il ) k = 0;\n\n\t\t\t\t\t// (j)---(i)---(k)\n\t\t\t\t\toneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] );\n\n\t\t\t\t}\n\n\t\t\t\tholesMovements.push( oneHoleMovements );\n\t\t\t\tverticesMovements = verticesMovements.concat( oneHoleMovements );\n\n\t\t\t}\n\n\n\t\t\t// Loop bevelSegments, 1 for the front, 1 for the back\n\n\t\t\tfor ( let b = 0; b < bevelSegments; b ++ ) {\n\n\t\t\t\t//for ( b = bevelSegments; b > 0; b -- ) {\n\n\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\tconst z = bevelThickness * Math.cos( t * Math.PI / 2 );\n\t\t\t\tconst bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset;\n\n\t\t\t\t// contract shape\n\n\t\t\t\tfor ( let i = 0, il = contour.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst vert = scalePt2( contour[ i ], contourMovements[ i ], bs );\n\n\t\t\t\t\tv( vert.x, vert.y, - z );\n\n\t\t\t\t}\n\n\t\t\t\t// expand holes\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\toneHoleMovements = holesMovements[ h ];\n\n\t\t\t\t\tfor ( let i = 0, il = ahole.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );\n\n\t\t\t\t\t\tv( vert.x, vert.y, - z );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst bs = bevelSize + bevelOffset;\n\n\t\t\t// Back facing vertices\n\n\t\t\tfor ( let i = 0; i < vlen; i ++ ) {\n\n\t\t\t\tconst vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];\n\n\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\tv( vert.x, vert.y, 0 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x );\n\n\t\t\t\t\tnormal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x );\n\t\t\t\t\tbinormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y );\n\n\t\t\t\t\tposition2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal );\n\n\t\t\t\t\tv( position2.x, position2.y, position2.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Add stepped vertices...\n\t\t\t// Including front facing vertices\n\n\t\t\tfor ( let s = 1; s <= steps; s ++ ) {\n\n\t\t\t\tfor ( let i = 0; i < vlen; i ++ ) {\n\n\t\t\t\t\tconst vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];\n\n\t\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\t\tv( vert.x, vert.y, depth / steps * s );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x );\n\n\t\t\t\t\t\tnormal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x );\n\t\t\t\t\t\tbinormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y );\n\n\t\t\t\t\t\tposition2.copy( extrudePts[ s ] ).add( normal ).add( binormal );\n\n\t\t\t\t\t\tv( position2.x, position2.y, position2.z );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\t// Add bevel segments planes\n\n\t\t\t//for ( b = 1; b <= bevelSegments; b ++ ) {\n\t\t\tfor ( let b = bevelSegments - 1; b >= 0; b -- ) {\n\n\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\tconst z = bevelThickness * Math.cos( t * Math.PI / 2 );\n\t\t\t\tconst bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset;\n\n\t\t\t\t// contract shape\n\n\t\t\t\tfor ( let i = 0, il = contour.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst vert = scalePt2( contour[ i ], contourMovements[ i ], bs );\n\t\t\t\t\tv( vert.x, vert.y, depth + z );\n\n\t\t\t\t}\n\n\t\t\t\t// expand holes\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\toneHoleMovements = holesMovements[ h ];\n\n\t\t\t\t\tfor ( let i = 0, il = ahole.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );\n\n\t\t\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\t\t\tv( vert.x, vert.y, depth + z );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tv( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t/* Faces */\n\n\t\t\t// Top and bottom faces\n\n\t\t\tbuildLidFaces();\n\n\t\t\t// Sides faces\n\n\t\t\tbuildSideFaces();\n\n\n\t\t\t///// Internal functions\n\n\t\t\tfunction buildLidFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\n\t\t\t\tif ( bevelEnabled ) {\n\n\t\t\t\t\tlet layer = 0; // steps + 1\n\t\t\t\t\tlet offset = vlen * layer;\n\n\t\t\t\t\t// Bottom faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlayer = steps + bevelSegments * 2;\n\t\t\t\t\toffset = vlen * layer;\n\n\t\t\t\t\t// Top faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Bottom faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 2 ], face[ 1 ], face[ 0 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Top faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 0 );\n\n\t\t\t}\n\n\t\t\t// Create faces for the z-sides of the shape\n\n\t\t\tfunction buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}\n\n\t\t\tfunction sidewalls( contour, layeroffset ) {\n\n\t\t\t\tlet i = contour.length;\n\n\t\t\t\twhile ( -- i >= 0 ) {\n\n\t\t\t\t\tconst j = i;\n\t\t\t\t\tlet k = i - 1;\n\t\t\t\t\tif ( k < 0 ) k = contour.length - 1;\n\n\t\t\t\t\t//console.log('b', i,j, i-1, k,vertices.length);\n\n\t\t\t\t\tfor ( let s = 0, sl = ( steps + bevelSegments * 2 ); s < sl; s ++ ) {\n\n\t\t\t\t\t\tconst slen1 = vlen * s;\n\t\t\t\t\t\tconst slen2 = vlen * ( s + 1 );\n\n\t\t\t\t\t\tconst a = layeroffset + j + slen1,\n\t\t\t\t\t\t\tb = layeroffset + k + slen1,\n\t\t\t\t\t\t\tc = layeroffset + k + slen2,\n\t\t\t\t\t\t\td = layeroffset + j + slen2;\n\n\t\t\t\t\t\tf4( a, b, c, d );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfunction v( x, y, z ) {\n\n\t\t\t\tplaceholder.push( x );\n\t\t\t\tplaceholder.push( y );\n\t\t\t\tplaceholder.push( z );\n\n\t\t\t}\n\n\n\t\t\tfunction f3( a, b, c ) {\n\n\t\t\t\taddVertex( a );\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( c );\n\n\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\tconst uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 );\n\n\t\t\t\taddUV( uvs[ 0 ] );\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 2 ] );\n\n\t\t\t}\n\n\t\t\tfunction f4( a, b, c, d ) {\n\n\t\t\t\taddVertex( a );\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( d );\n\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( c );\n\t\t\t\taddVertex( d );\n\n\n\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\tconst uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 );\n\n\t\t\t\taddUV( uvs[ 0 ] );\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 3 ] );\n\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 2 ] );\n\t\t\t\taddUV( uvs[ 3 ] );\n\n\t\t\t}\n\n\t\t\tfunction addVertex( index ) {\n\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 0 ] );\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 1 ] );\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 2 ] );\n\n\t\t\t}\n\n\n\t\t\tfunction addUV( vector2 ) {\n\n\t\t\t\tuvArray.push( vector2.x );\n\t\t\t\tuvArray.push( vector2.y );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tconst shapes = this.parameters.shapes;\n\t\tconst options = this.parameters.options;\n\n\t\treturn toJSON$1( shapes, options, data );\n\n\t}\n\n\tstatic fromJSON( data, shapes ) {\n\n\t\tconst geometryShapes = [];\n\n\t\tfor ( let j = 0, jl = data.shapes.length; j < jl; j ++ ) {\n\n\t\t\tconst shape = shapes[ data.shapes[ j ] ];\n\n\t\t\tgeometryShapes.push( shape );\n\n\t\t}\n\n\t\tconst extrudePath = data.options.extrudePath;\n\n\t\tif ( extrudePath !== undefined ) {\n\n\t\t\tdata.options.extrudePath = new Curves[ extrudePath.type ]().fromJSON( extrudePath );\n\n\t\t}\n\n\t\treturn new ExtrudeGeometry( geometryShapes, data.options );\n\n\t}\n\n}\n\nconst WorldUVGenerator = {\n\n\tgenerateTopUV: function ( geometry, vertices, indexA, indexB, indexC ) {\n\n\t\tconst a_x = vertices[ indexA * 3 ];\n\t\tconst a_y = vertices[ indexA * 3 + 1 ];\n\t\tconst b_x = vertices[ indexB * 3 ];\n\t\tconst b_y = vertices[ indexB * 3 + 1 ];\n\t\tconst c_x = vertices[ indexC * 3 ];\n\t\tconst c_y = vertices[ indexC * 3 + 1 ];\n\n\t\treturn [\n\t\t\tnew Vector2( a_x, a_y ),\n\t\t\tnew Vector2( b_x, b_y ),\n\t\t\tnew Vector2( c_x, c_y )\n\t\t];\n\n\t},\n\n\tgenerateSideWallUV: function ( geometry, vertices, indexA, indexB, indexC, indexD ) {\n\n\t\tconst a_x = vertices[ indexA * 3 ];\n\t\tconst a_y = vertices[ indexA * 3 + 1 ];\n\t\tconst a_z = vertices[ indexA * 3 + 2 ];\n\t\tconst b_x = vertices[ indexB * 3 ];\n\t\tconst b_y = vertices[ indexB * 3 + 1 ];\n\t\tconst b_z = vertices[ indexB * 3 + 2 ];\n\t\tconst c_x = vertices[ indexC * 3 ];\n\t\tconst c_y = vertices[ indexC * 3 + 1 ];\n\t\tconst c_z = vertices[ indexC * 3 + 2 ];\n\t\tconst d_x = vertices[ indexD * 3 ];\n\t\tconst d_y = vertices[ indexD * 3 + 1 ];\n\t\tconst d_z = vertices[ indexD * 3 + 2 ];\n\n\t\tif ( Math.abs( a_y - b_y ) < Math.abs( a_x - b_x ) ) {\n\n\t\t\treturn [\n\t\t\t\tnew Vector2( a_x, 1 - a_z ),\n\t\t\t\tnew Vector2( b_x, 1 - b_z ),\n\t\t\t\tnew Vector2( c_x, 1 - c_z ),\n\t\t\t\tnew Vector2( d_x, 1 - d_z )\n\t\t\t];\n\n\t\t} else {\n\n\t\t\treturn [\n\t\t\t\tnew Vector2( a_y, 1 - a_z ),\n\t\t\t\tnew Vector2( b_y, 1 - b_z ),\n\t\t\t\tnew Vector2( c_y, 1 - c_z ),\n\t\t\t\tnew Vector2( d_y, 1 - d_z )\n\t\t\t];\n\n\t\t}\n\n\t}\n\n};\n\nfunction toJSON$1( shapes, options, data ) {\n\n\tdata.shapes = [];\n\n\tif ( Array.isArray( shapes ) ) {\n\n\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\n\t\t\tdata.shapes.push( shape.uuid );\n\n\t\t}\n\n\t} else {\n\n\t\tdata.shapes.push( shapes.uuid );\n\n\t}\n\n\tdata.options = Object.assign( {}, options );\n\n\tif ( options.extrudePath !== undefined ) data.options.extrudePath = options.extrudePath.toJSON();\n\n\treturn data;\n\n}\n\nclass IcosahedronGeometry extends PolyhedronGeometry {\n\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst t = ( 1 + Math.sqrt( 5 ) ) / 2;\n\n\t\tconst vertices = [\n\t\t\t- 1, t, 0, \t1, t, 0, \t- 1, - t, 0, \t1, - t, 0,\n\t\t\t0, - 1, t, \t0, 1, t,\t0, - 1, - t, \t0, 1, - t,\n\t\t\tt, 0, - 1, \tt, 0, 1, \t- t, 0, - 1, \t- t, 0, 1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t0, 11, 5, \t0, 5, 1, \t0, 1, 7, \t0, 7, 10, \t0, 10, 11,\n\t\t\t1, 5, 9, \t5, 11, 4,\t11, 10, 2,\t10, 7, 6,\t7, 1, 8,\n\t\t\t3, 9, 4, \t3, 4, 2,\t3, 2, 6,\t3, 6, 8,\t3, 8, 9,\n\t\t\t4, 9, 5, \t2, 4, 11,\t6, 2, 10,\t8, 6, 7,\t9, 8, 1\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'IcosahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new IcosahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nclass OctahedronGeometry extends PolyhedronGeometry {\n\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst vertices = [\n\t\t\t1, 0, 0, \t- 1, 0, 0,\t0, 1, 0,\n\t\t\t0, - 1, 0, \t0, 0, 1,\t0, 0, - 1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t0, 2, 4,\t0, 4, 3,\t0, 3, 5,\n\t\t\t0, 5, 2,\t1, 2, 5,\t1, 5, 3,\n\t\t\t1, 3, 4,\t1, 4, 2\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'OctahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new OctahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nclass RingGeometry extends BufferGeometry {\n\n\tconstructor( innerRadius = 0.5, outerRadius = 1, thetaSegments = 32, phiSegments = 1, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'RingGeometry';\n\n\t\tthis.parameters = {\n\t\t\tinnerRadius: innerRadius,\n\t\t\touterRadius: outerRadius,\n\t\t\tthetaSegments: thetaSegments,\n\t\t\tphiSegments: phiSegments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tthetaSegments = Math.max( 3, thetaSegments );\n\t\tphiSegments = Math.max( 1, phiSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// some helper variables\n\n\t\tlet radius = innerRadius;\n\t\tconst radiusStep = ( ( outerRadius - innerRadius ) / phiSegments );\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let j = 0; j <= phiSegments; j ++ ) {\n\n\t\t\tfor ( let i = 0; i <= thetaSegments; i ++ ) {\n\n\t\t\t\t// values are generate from the inside of the ring to the outside\n\n\t\t\t\tconst segment = thetaStart + i / thetaSegments * thetaLength;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = radius * Math.cos( segment );\n\t\t\t\tvertex.y = radius * Math.sin( segment );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = ( vertex.x / outerRadius + 1 ) / 2;\n\t\t\t\tuv.y = ( vertex.y / outerRadius + 1 ) / 2;\n\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t}\n\n\t\t\t// increase the radius for next row of vertices\n\n\t\t\tradius += radiusStep;\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let j = 0; j < phiSegments; j ++ ) {\n\n\t\t\tconst thetaSegmentLevel = j * ( thetaSegments + 1 );\n\n\t\t\tfor ( let i = 0; i < thetaSegments; i ++ ) {\n\n\t\t\t\tconst segment = i + thetaSegmentLevel;\n\n\t\t\t\tconst a = segment;\n\t\t\t\tconst b = segment + thetaSegments + 1;\n\t\t\t\tconst c = segment + thetaSegments + 2;\n\t\t\t\tconst d = segment + 1;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new RingGeometry( data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass ShapeGeometry extends BufferGeometry {\n\n\tconstructor( shapes = new Shape( [ new Vector2( 0, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), curveSegments = 12 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ShapeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tshapes: shapes,\n\t\t\tcurveSegments: curveSegments\n\t\t};\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet groupStart = 0;\n\t\tlet groupCount = 0;\n\n\t\t// allow single and array values for \"shapes\" parameter\n\n\t\tif ( Array.isArray( shapes ) === false ) {\n\n\t\t\taddShape( shapes );\n\n\t\t} else {\n\n\t\t\tfor ( let i = 0; i < shapes.length; i ++ ) {\n\n\t\t\t\taddShape( shapes[ i ] );\n\n\t\t\t\tthis.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support\n\n\t\t\t\tgroupStart += groupCount;\n\t\t\t\tgroupCount = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\n\t\t// helper functions\n\n\t\tfunction addShape( shape ) {\n\n\t\t\tconst indexOffset = vertices.length / 3;\n\t\t\tconst points = shape.extractPoints( curveSegments );\n\n\t\t\tlet shapeVertices = points.shape;\n\t\t\tconst shapeHoles = points.holes;\n\n\t\t\t// check direction of vertices\n\n\t\t\tif ( ShapeUtils.isClockWise( shapeVertices ) === false ) {\n\n\t\t\t\tshapeVertices = shapeVertices.reverse();\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = shapeHoles.length; i < l; i ++ ) {\n\n\t\t\t\tconst shapeHole = shapeHoles[ i ];\n\n\t\t\t\tif ( ShapeUtils.isClockWise( shapeHole ) === true ) {\n\n\t\t\t\t\tshapeHoles[ i ] = shapeHole.reverse();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles );\n\n\t\t\t// join vertices of inner and outer paths to a single array\n\n\t\t\tfor ( let i = 0, l = shapeHoles.length; i < l; i ++ ) {\n\n\t\t\t\tconst shapeHole = shapeHoles[ i ];\n\t\t\t\tshapeVertices = shapeVertices.concat( shapeHole );\n\n\t\t\t}\n\n\t\t\t// vertices, normals, uvs\n\n\t\t\tfor ( let i = 0, l = shapeVertices.length; i < l; i ++ ) {\n\n\t\t\t\tconst vertex = shapeVertices[ i ];\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, 0 );\n\t\t\t\tnormals.push( 0, 0, 1 );\n\t\t\t\tuvs.push( vertex.x, vertex.y ); // world uvs\n\n\t\t\t}\n\n\t\t\t// indices\n\n\t\t\tfor ( let i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\tconst face = faces[ i ];\n\n\t\t\t\tconst a = face[ 0 ] + indexOffset;\n\t\t\t\tconst b = face[ 1 ] + indexOffset;\n\t\t\t\tconst c = face[ 2 ] + indexOffset;\n\n\t\t\t\tindices.push( a, b, c );\n\t\t\t\tgroupCount += 3;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tconst shapes = this.parameters.shapes;\n\n\t\treturn toJSON( shapes, data );\n\n\t}\n\n\tstatic fromJSON( data, shapes ) {\n\n\t\tconst geometryShapes = [];\n\n\t\tfor ( let j = 0, jl = data.shapes.length; j < jl; j ++ ) {\n\n\t\t\tconst shape = shapes[ data.shapes[ j ] ];\n\n\t\t\tgeometryShapes.push( shape );\n\n\t\t}\n\n\t\treturn new ShapeGeometry( geometryShapes, data.curveSegments );\n\n\t}\n\n}\n\nfunction toJSON( shapes, data ) {\n\n\tdata.shapes = [];\n\n\tif ( Array.isArray( shapes ) ) {\n\n\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\n\t\t\tdata.shapes.push( shape.uuid );\n\n\t\t}\n\n\t} else {\n\n\t\tdata.shapes.push( shapes.uuid );\n\n\t}\n\n\treturn data;\n\n}\n\nclass SphereGeometry extends BufferGeometry {\n\n\tconstructor( radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'SphereGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\twidthSegments = Math.max( 3, Math.floor( widthSegments ) );\n\t\theightSegments = Math.max( 2, Math.floor( heightSegments ) );\n\n\t\tconst thetaEnd = Math.min( thetaStart + thetaLength, Math.PI );\n\n\t\tlet index = 0;\n\t\tconst grid = [];\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let iy = 0; iy <= heightSegments; iy ++ ) {\n\n\t\t\tconst verticesRow = [];\n\n\t\t\tconst v = iy / heightSegments;\n\n\t\t\t// special case for the poles\n\n\t\t\tlet uOffset = 0;\n\n\t\t\tif ( iy === 0 && thetaStart === 0 ) {\n\n\t\t\t\tuOffset = 0.5 / widthSegments;\n\n\t\t\t} else if ( iy === heightSegments && thetaEnd === Math.PI ) {\n\n\t\t\t\tuOffset = - 0.5 / widthSegments;\n\n\t\t\t}\n\n\t\t\tfor ( let ix = 0; ix <= widthSegments; ix ++ ) {\n\n\t\t\t\tconst u = ix / widthSegments;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\t\t\t\tvertex.y = radius * Math.cos( thetaStart + v * thetaLength );\n\t\t\t\tvertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.copy( vertex ).normalize();\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( u + uOffset, 1 - v );\n\n\t\t\t\tverticesRow.push( index ++ );\n\n\t\t\t}\n\n\t\t\tgrid.push( verticesRow );\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let iy = 0; iy < heightSegments; iy ++ ) {\n\n\t\t\tfor ( let ix = 0; ix < widthSegments; ix ++ ) {\n\n\t\t\t\tconst a = grid[ iy ][ ix + 1 ];\n\t\t\t\tconst b = grid[ iy ][ ix ];\n\t\t\t\tconst c = grid[ iy + 1 ][ ix ];\n\t\t\t\tconst d = grid[ iy + 1 ][ ix + 1 ];\n\n\t\t\t\tif ( iy !== 0 || thetaStart > 0 ) indices.push( a, b, d );\n\t\t\t\tif ( iy !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new SphereGeometry( data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nclass TetrahedronGeometry extends PolyhedronGeometry {\n\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst vertices = [\n\t\t\t1, 1, 1, \t- 1, - 1, 1, \t- 1, 1, - 1, \t1, - 1, - 1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t2, 1, 0, \t0, 3, 2,\t1, 3, 0,\t2, 3, 1\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'TetrahedronGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new TetrahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nclass TorusGeometry extends BufferGeometry {\n\n\tconstructor( radius = 1, tube = 0.4, radialSegments = 12, tubularSegments = 48, arc = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'TorusGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\tradialSegments: radialSegments,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tarc: arc\n\t\t};\n\n\t\tradialSegments = Math.floor( radialSegments );\n\t\ttubularSegments = Math.floor( tubularSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst center = new Vector3();\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\tfor ( let i = 0; i <= tubularSegments; i ++ ) {\n\n\t\t\t\tconst u = i / tubularSegments * arc;\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u );\n\t\t\t\tvertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u );\n\t\t\t\tvertex.z = tube * Math.sin( v );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tcenter.x = radius * Math.cos( u );\n\t\t\t\tcenter.y = radius * Math.sin( u );\n\t\t\t\tnormal.subVectors( vertex, center ).normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( i / tubularSegments );\n\t\t\t\tuvs.push( j / radialSegments );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( let j = 1; j <= radialSegments; j ++ ) {\n\n\t\t\tfor ( let i = 1; i <= tubularSegments; i ++ ) {\n\n\t\t\t\t// indices\n\n\t\t\t\tconst a = ( tubularSegments + 1 ) * j + i - 1;\n\t\t\t\tconst b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1;\n\t\t\t\tconst c = ( tubularSegments + 1 ) * ( j - 1 ) + i;\n\t\t\t\tconst d = ( tubularSegments + 1 ) * j + i;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new TorusGeometry( data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc );\n\n\t}\n\n}\n\nclass TorusKnotGeometry extends BufferGeometry {\n\n\tconstructor( radius = 1, tube = 0.4, tubularSegments = 64, radialSegments = 8, p = 2, q = 3 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'TorusKnotGeometry';\n\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradialSegments: radialSegments,\n\t\t\tp: p,\n\t\t\tq: q\n\t\t};\n\n\t\ttubularSegments = Math.floor( tubularSegments );\n\t\tradialSegments = Math.floor( radialSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\tconst P1 = new Vector3();\n\t\tconst P2 = new Vector3();\n\n\t\tconst B = new Vector3();\n\t\tconst T = new Vector3();\n\t\tconst N = new Vector3();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let i = 0; i <= tubularSegments; ++ i ) {\n\n\t\t\t// the radian \"u\" is used to calculate the position on the torus curve of the current tubular segment\n\n\t\t\tconst u = i / tubularSegments * p * Math.PI * 2;\n\n\t\t\t// now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead.\n\t\t\t// these points are used to create a special \"coordinate space\", which is necessary to calculate the correct vertex positions\n\n\t\t\tcalculatePositionOnCurve( u, p, q, radius, P1 );\n\t\t\tcalculatePositionOnCurve( u + 0.01, p, q, radius, P2 );\n\n\t\t\t// calculate orthonormal basis\n\n\t\t\tT.subVectors( P2, P1 );\n\t\t\tN.addVectors( P2, P1 );\n\t\t\tB.crossVectors( T, N );\n\t\t\tN.crossVectors( B, T );\n\n\t\t\t// normalize B, N. T can be ignored, we don't use it\n\n\t\t\tB.normalize();\n\t\t\tN.normalize();\n\n\t\t\tfor ( let j = 0; j <= radialSegments; ++ j ) {\n\n\t\t\t\t// now calculate the vertices. they are nothing more than an extrusion of the torus curve.\n\t\t\t\t// because we extrude a shape in the xy-plane, there is no need to calculate a z-value.\n\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\t\t\t\tconst cx = - tube * Math.cos( v );\n\t\t\t\tconst cy = tube * Math.sin( v );\n\n\t\t\t\t// now calculate the final vertex position.\n\t\t\t\t// first we orient the extrusion with our basis vectors, then we add it to the current position on the curve\n\n\t\t\t\tvertex.x = P1.x + ( cx * N.x + cy * B.x );\n\t\t\t\tvertex.y = P1.y + ( cx * N.y + cy * B.y );\n\t\t\t\tvertex.z = P1.z + ( cx * N.z + cy * B.z );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal)\n\n\t\t\t\tnormal.subVectors( vertex, P1 ).normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( i / tubularSegments );\n\t\t\t\tuvs.push( j / radialSegments );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( let j = 1; j <= tubularSegments; j ++ ) {\n\n\t\t\tfor ( let i = 1; i <= radialSegments; i ++ ) {\n\n\t\t\t\t// indices\n\n\t\t\t\tconst a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 );\n\t\t\t\tconst b = ( radialSegments + 1 ) * j + ( i - 1 );\n\t\t\t\tconst c = ( radialSegments + 1 ) * j + i;\n\t\t\t\tconst d = ( radialSegments + 1 ) * ( j - 1 ) + i;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\t// this function calculates the current position on the torus curve\n\n\t\tfunction calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tconst cu = Math.cos( u );\n\t\t\tconst su = Math.sin( u );\n\t\t\tconst quOverP = q / p * u;\n\t\t\tconst cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\treturn new TorusKnotGeometry( data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q );\n\n\t}\n\n}\n\nclass TubeGeometry extends BufferGeometry {\n\n\tconstructor( path = new QuadraticBezierCurve3( new Vector3( - 1, - 1, 0 ), new Vector3( - 1, 1, 0 ), new Vector3( 1, 1, 0 ) ), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'TubeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tpath: path,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradius: radius,\n\t\t\tradialSegments: radialSegments,\n\t\t\tclosed: closed\n\t\t};\n\n\t\tconst frames = path.computeFrenetFrames( tubularSegments, closed );\n\n\t\t// expose internals\n\n\t\tthis.tangents = frames.tangents;\n\t\tthis.normals = frames.normals;\n\t\tthis.binormals = frames.binormals;\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\t\tconst uv = new Vector2();\n\t\tlet P = new Vector3();\n\n\t\t// buffer\n\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\t\tconst indices = [];\n\n\t\t// create buffer data\n\n\t\tgenerateBufferData();\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\t// functions\n\n\t\tfunction generateBufferData() {\n\n\t\t\tfor ( let i = 0; i < tubularSegments; i ++ ) {\n\n\t\t\t\tgenerateSegment( i );\n\n\t\t\t}\n\n\t\t\t// if the geometry is not closed, generate the last row of vertices and normals\n\t\t\t// at the regular position on the given path\n\t\t\t//\n\t\t\t// if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ)\n\n\t\t\tgenerateSegment( ( closed === false ) ? tubularSegments : 0 );\n\n\t\t\t// uvs are generated in a separate function.\n\t\t\t// this makes it easy compute correct values for closed geometries\n\n\t\t\tgenerateUVs();\n\n\t\t\t// finally create faces\n\n\t\t\tgenerateIndices();\n\n\t\t}\n\n\t\tfunction generateSegment( i ) {\n\n\t\t\t// we use getPointAt to sample evenly distributed points from the given path\n\n\t\t\tP = path.getPointAt( i / tubularSegments, P );\n\n\t\t\t// retrieve corresponding normal and binormal\n\n\t\t\tconst N = frames.normals[ i ];\n\t\t\tconst B = frames.binormals[ i ];\n\n\t\t\t// generate normals and vertices for the current segment\n\n\t\t\tfor ( let j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\n\t\t\t\tconst sin = Math.sin( v );\n\t\t\t\tconst cos = - Math.cos( v );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.x = ( cos * N.x + sin * B.x );\n\t\t\t\tnormal.y = ( cos * N.y + sin * B.y );\n\t\t\t\tnormal.z = ( cos * N.z + sin * B.z );\n\t\t\t\tnormal.normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = P.x + radius * normal.x;\n\t\t\t\tvertex.y = P.y + radius * normal.y;\n\t\t\t\tvertex.z = P.z + radius * normal.z;\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateIndices() {\n\n\t\t\tfor ( let j = 1; j <= tubularSegments; j ++ ) {\n\n\t\t\t\tfor ( let i = 1; i <= radialSegments; i ++ ) {\n\n\t\t\t\t\tconst a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 );\n\t\t\t\t\tconst b = ( radialSegments + 1 ) * j + ( i - 1 );\n\t\t\t\t\tconst c = ( radialSegments + 1 ) * j + i;\n\t\t\t\t\tconst d = ( radialSegments + 1 ) * ( j - 1 ) + i;\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateUVs() {\n\n\t\t\tfor ( let i = 0; i <= tubularSegments; i ++ ) {\n\n\t\t\t\tfor ( let j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\t\t\tuv.x = i / tubularSegments;\n\t\t\t\t\tuv.y = j / radialSegments;\n\n\t\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.path = this.parameters.path.toJSON();\n\n\t\treturn data;\n\n\t}\n\n\tstatic fromJSON( data ) {\n\n\t\t// This only works for built-in curves (e.g. CatmullRomCurve3).\n\t\t// User defined curves or instances of CurvePath will not be deserialized.\n\t\treturn new TubeGeometry(\n\t\t\tnew Curves[ data.path.type ]().fromJSON( data.path ),\n\t\t\tdata.tubularSegments,\n\t\t\tdata.radius,\n\t\t\tdata.radialSegments,\n\t\t\tdata.closed\n\t\t);\n\n\t}\n\n}\n\nclass WireframeGeometry extends BufferGeometry {\n\n\tconstructor( geometry = null ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'WireframeGeometry';\n\n\t\tthis.parameters = {\n\t\t\tgeometry: geometry\n\t\t};\n\n\t\tif ( geometry !== null ) {\n\n\t\t\t// buffer\n\n\t\t\tconst vertices = [];\n\t\t\tconst edges = new Set();\n\n\t\t\t// helper variables\n\n\t\t\tconst start = new Vector3();\n\t\t\tconst end = new Vector3();\n\n\t\t\tif ( geometry.index !== null ) {\n\n\t\t\t\t// indexed BufferGeometry\n\n\t\t\t\tconst position = geometry.attributes.position;\n\t\t\t\tconst indices = geometry.index;\n\t\t\t\tlet groups = geometry.groups;\n\n\t\t\t\tif ( groups.length === 0 ) {\n\n\t\t\t\t\tgroups = [ { start: 0, count: indices.count, materialIndex: 0 } ];\n\n\t\t\t\t}\n\n\t\t\t\t// create a data structure that contains all edges without duplicates\n\n\t\t\t\tfor ( let o = 0, ol = groups.length; o < ol; ++ o ) {\n\n\t\t\t\t\tconst group = groups[ o ];\n\n\t\t\t\t\tconst groupStart = group.start;\n\t\t\t\t\tconst groupCount = group.count;\n\n\t\t\t\t\tfor ( let i = groupStart, l = ( groupStart + groupCount ); i < l; i += 3 ) {\n\n\t\t\t\t\t\tfor ( let j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\t\tconst index1 = indices.getX( i + j );\n\t\t\t\t\t\t\tconst index2 = indices.getX( i + ( j + 1 ) % 3 );\n\n\t\t\t\t\t\t\tstart.fromBufferAttribute( position, index1 );\n\t\t\t\t\t\t\tend.fromBufferAttribute( position, index2 );\n\n\t\t\t\t\t\t\tif ( isUniqueEdge( start, end, edges ) === true ) {\n\n\t\t\t\t\t\t\t\tvertices.push( start.x, start.y, start.z );\n\t\t\t\t\t\t\t\tvertices.push( end.x, end.y, end.z );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// non-indexed BufferGeometry\n\n\t\t\t\tconst position = geometry.attributes.position;\n\n\t\t\t\tfor ( let i = 0, l = ( position.count / 3 ); i < l; i ++ ) {\n\n\t\t\t\t\tfor ( let j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\t// three edges per triangle, an edge is represented as (index1, index2)\n\t\t\t\t\t\t// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)\n\n\t\t\t\t\t\tconst index1 = 3 * i + j;\n\t\t\t\t\t\tconst index2 = 3 * i + ( ( j + 1 ) % 3 );\n\n\t\t\t\t\t\tstart.fromBufferAttribute( position, index1 );\n\t\t\t\t\t\tend.fromBufferAttribute( position, index2 );\n\n\t\t\t\t\t\tif ( isUniqueEdge( start, end, edges ) === true ) {\n\n\t\t\t\t\t\t\tvertices.push( start.x, start.y, start.z );\n\t\t\t\t\t\t\tvertices.push( end.x, end.y, end.z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// build geometry\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n}\n\nfunction isUniqueEdge( start, end, edges ) {\n\n\tconst hash1 = `${start.x},${start.y},${start.z}-${end.x},${end.y},${end.z}`;\n\tconst hash2 = `${end.x},${end.y},${end.z}-${start.x},${start.y},${start.z}`; // coincident edge\n\n\tif ( edges.has( hash1 ) === true || edges.has( hash2 ) === true ) {\n\n\t\treturn false;\n\n\t} else {\n\n\t\tedges.add( hash1 );\n\t\tedges.add( hash2 );\n\t\treturn true;\n\n\t}\n\n}\n\nvar Geometries = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tBoxGeometry: BoxGeometry,\n\tCapsuleGeometry: CapsuleGeometry,\n\tCircleGeometry: CircleGeometry,\n\tConeGeometry: ConeGeometry,\n\tCylinderGeometry: CylinderGeometry,\n\tDodecahedronGeometry: DodecahedronGeometry,\n\tEdgesGeometry: EdgesGeometry,\n\tExtrudeGeometry: ExtrudeGeometry,\n\tIcosahedronGeometry: IcosahedronGeometry,\n\tLatheGeometry: LatheGeometry,\n\tOctahedronGeometry: OctahedronGeometry,\n\tPlaneGeometry: PlaneGeometry,\n\tPolyhedronGeometry: PolyhedronGeometry,\n\tRingGeometry: RingGeometry,\n\tShapeGeometry: ShapeGeometry,\n\tSphereGeometry: SphereGeometry,\n\tTetrahedronGeometry: TetrahedronGeometry,\n\tTorusGeometry: TorusGeometry,\n\tTorusKnotGeometry: TorusKnotGeometry,\n\tTubeGeometry: TubeGeometry,\n\tWireframeGeometry: WireframeGeometry\n});\n\nclass ShadowMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'ShadowMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isShadowMaterial = true;\n\n\t\tthis.color = new Color( 0x000000 );\n\t\tthis.transparent = true;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass RawShaderMaterial extends ShaderMaterial {\n\n\tstatic get type() {\n\n\t\treturn 'RawShaderMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper( parameters );\n\n\t\tthis.isRawShaderMaterial = true;\n\n\t}\n\n}\n\nclass MeshStandardMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'MeshStandardMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshStandardMaterial = true;\n\n\t\tthis.defines = { 'STANDARD': '' };\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\t\tthis.roughness = 1.0;\n\t\tthis.metalness = 0.0;\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.roughnessMap = null;\n\n\t\tthis.metalnessMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.envMapRotation = new Euler();\n\t\tthis.envMapIntensity = 1.0;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.flatShading = false;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = { 'STANDARD': '' };\n\n\t\tthis.color.copy( source.color );\n\t\tthis.roughness = source.roughness;\n\t\tthis.metalness = source.metalness;\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.roughnessMap = source.roughnessMap;\n\n\t\tthis.metalnessMap = source.metalnessMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.envMapIntensity = source.envMapIntensity;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshPhysicalMaterial extends MeshStandardMaterial {\n\n\tstatic get type() {\n\n\t\treturn 'MeshPhysicalMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshPhysicalMaterial = true;\n\n\t\tthis.defines = {\n\n\t\t\t'STANDARD': '',\n\t\t\t'PHYSICAL': ''\n\n\t\t};\n\n\t\tthis.anisotropyRotation = 0;\n\t\tthis.anisotropyMap = null;\n\n\t\tthis.clearcoatMap = null;\n\t\tthis.clearcoatRoughness = 0.0;\n\t\tthis.clearcoatRoughnessMap = null;\n\t\tthis.clearcoatNormalScale = new Vector2( 1, 1 );\n\t\tthis.clearcoatNormalMap = null;\n\n\t\tthis.ior = 1.5;\n\n\t\tObject.defineProperty( this, 'reflectivity', {\n\t\t\tget: function () {\n\n\t\t\t\treturn ( clamp( 2.5 * ( this.ior - 1 ) / ( this.ior + 1 ), 0, 1 ) );\n\n\t\t\t},\n\t\t\tset: function ( reflectivity ) {\n\n\t\t\t\tthis.ior = ( 1 + 0.4 * reflectivity ) / ( 1 - 0.4 * reflectivity );\n\n\t\t\t}\n\t\t} );\n\n\t\tthis.iridescenceMap = null;\n\t\tthis.iridescenceIOR = 1.3;\n\t\tthis.iridescenceThicknessRange = [ 100, 400 ];\n\t\tthis.iridescenceThicknessMap = null;\n\n\t\tthis.sheenColor = new Color( 0x000000 );\n\t\tthis.sheenColorMap = null;\n\t\tthis.sheenRoughness = 1.0;\n\t\tthis.sheenRoughnessMap = null;\n\n\t\tthis.transmissionMap = null;\n\n\t\tthis.thickness = 0;\n\t\tthis.thicknessMap = null;\n\t\tthis.attenuationDistance = Infinity;\n\t\tthis.attenuationColor = new Color( 1, 1, 1 );\n\n\t\tthis.specularIntensity = 1.0;\n\t\tthis.specularIntensityMap = null;\n\t\tthis.specularColor = new Color( 1, 1, 1 );\n\t\tthis.specularColorMap = null;\n\n\t\tthis._anisotropy = 0;\n\t\tthis._clearcoat = 0;\n\t\tthis._dispersion = 0;\n\t\tthis._iridescence = 0;\n\t\tthis._sheen = 0.0;\n\t\tthis._transmission = 0;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tget anisotropy() {\n\n\t\treturn this._anisotropy;\n\n\t}\n\n\tset anisotropy( value ) {\n\n\t\tif ( this._anisotropy > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._anisotropy = value;\n\n\t}\n\n\tget clearcoat() {\n\n\t\treturn this._clearcoat;\n\n\t}\n\n\tset clearcoat( value ) {\n\n\t\tif ( this._clearcoat > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._clearcoat = value;\n\n\t}\n\n\tget iridescence() {\n\n\t\treturn this._iridescence;\n\n\t}\n\n\tset iridescence( value ) {\n\n\t\tif ( this._iridescence > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._iridescence = value;\n\n\t}\n\n\tget dispersion() {\n\n\t\treturn this._dispersion;\n\n\t}\n\n\tset dispersion( value ) {\n\n\t\tif ( this._dispersion > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._dispersion = value;\n\n\t}\n\n\tget sheen() {\n\n\t\treturn this._sheen;\n\n\t}\n\n\tset sheen( value ) {\n\n\t\tif ( this._sheen > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._sheen = value;\n\n\t}\n\n\tget transmission() {\n\n\t\treturn this._transmission;\n\n\t}\n\n\tset transmission( value ) {\n\n\t\tif ( this._transmission > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._transmission = value;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = {\n\n\t\t\t'STANDARD': '',\n\t\t\t'PHYSICAL': ''\n\n\t\t};\n\n\t\tthis.anisotropy = source.anisotropy;\n\t\tthis.anisotropyRotation = source.anisotropyRotation;\n\t\tthis.anisotropyMap = source.anisotropyMap;\n\n\t\tthis.clearcoat = source.clearcoat;\n\t\tthis.clearcoatMap = source.clearcoatMap;\n\t\tthis.clearcoatRoughness = source.clearcoatRoughness;\n\t\tthis.clearcoatRoughnessMap = source.clearcoatRoughnessMap;\n\t\tthis.clearcoatNormalMap = source.clearcoatNormalMap;\n\t\tthis.clearcoatNormalScale.copy( source.clearcoatNormalScale );\n\n\t\tthis.dispersion = source.dispersion;\n\t\tthis.ior = source.ior;\n\n\t\tthis.iridescence = source.iridescence;\n\t\tthis.iridescenceMap = source.iridescenceMap;\n\t\tthis.iridescenceIOR = source.iridescenceIOR;\n\t\tthis.iridescenceThicknessRange = [ ...source.iridescenceThicknessRange ];\n\t\tthis.iridescenceThicknessMap = source.iridescenceThicknessMap;\n\n\t\tthis.sheen = source.sheen;\n\t\tthis.sheenColor.copy( source.sheenColor );\n\t\tthis.sheenColorMap = source.sheenColorMap;\n\t\tthis.sheenRoughness = source.sheenRoughness;\n\t\tthis.sheenRoughnessMap = source.sheenRoughnessMap;\n\n\t\tthis.transmission = source.transmission;\n\t\tthis.transmissionMap = source.transmissionMap;\n\n\t\tthis.thickness = source.thickness;\n\t\tthis.thicknessMap = source.thicknessMap;\n\t\tthis.attenuationDistance = source.attenuationDistance;\n\t\tthis.attenuationColor.copy( source.attenuationColor );\n\n\t\tthis.specularIntensity = source.specularIntensity;\n\t\tthis.specularIntensityMap = source.specularIntensityMap;\n\t\tthis.specularColor.copy( source.specularColor );\n\t\tthis.specularColorMap = source.specularColorMap;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshPhongMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'MeshPhongMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshPhongMaterial = true;\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\t\tthis.specular = new Color( 0x111111 );\n\t\tthis.shininess = 30;\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.specularMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.envMapRotation = new Euler();\n\t\tthis.combine = MultiplyOperation;\n\t\tthis.reflectivity = 1;\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.flatShading = false;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\t\tthis.specular.copy( source.specular );\n\t\tthis.shininess = source.shininess;\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshToonMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'MeshToonMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshToonMaterial = true;\n\n\t\tthis.defines = { 'TOON': '' };\n\n\t\tthis.color = new Color( 0xffffff );\n\n\t\tthis.map = null;\n\t\tthis.gradientMap = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\t\tthis.gradientMap = source.gradientMap;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshNormalMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'MeshNormalMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshNormalMaterial = true;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.flatShading = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshLambertMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'MeshLambertMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshLambertMaterial = true;\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\tthis.map = null;\n\n\t\tthis.lightMap = null;\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\tthis.aoMap = null;\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\tthis.emissive = new Color( 0x000000 );\n\t\tthis.emissiveIntensity = 1.0;\n\t\tthis.emissiveMap = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.specularMap = null;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.envMap = null;\n\t\tthis.envMapRotation = new Euler();\n\t\tthis.combine = MultiplyOperation;\n\t\tthis.reflectivity = 1;\n\t\tthis.refractionRatio = 0.98;\n\n\t\tthis.wireframe = false;\n\t\tthis.wireframeLinewidth = 1;\n\t\tthis.wireframeLinecap = 'round';\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\tthis.flatShading = false;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass MeshMatcapMaterial extends Material {\n\n\tstatic get type() {\n\n\t\treturn 'MeshMatcapMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isMeshMatcapMaterial = true;\n\n\t\tthis.defines = { 'MATCAP': '' };\n\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\tthis.matcap = null;\n\n\t\tthis.map = null;\n\n\t\tthis.bumpMap = null;\n\t\tthis.bumpScale = 1;\n\n\t\tthis.normalMap = null;\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\tthis.displacementMap = null;\n\t\tthis.displacementScale = 1;\n\t\tthis.displacementBias = 0;\n\n\t\tthis.alphaMap = null;\n\n\t\tthis.flatShading = false;\n\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = { 'MATCAP': '' };\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.matcap = source.matcap;\n\n\t\tthis.map = source.map;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass LineDashedMaterial extends LineBasicMaterial {\n\n\tstatic get type() {\n\n\t\treturn 'LineDashedMaterial';\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\tthis.isLineDashedMaterial = true;\n\n\t\tthis.scale = 1;\n\t\tthis.dashSize = 3;\n\t\tthis.gapSize = 1;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.scale = source.scale;\n\t\tthis.dashSize = source.dashSize;\n\t\tthis.gapSize = source.gapSize;\n\n\t\treturn this;\n\n\t}\n\n}\n\n// converts an array to a specific type\nfunction convertArray( array, type, forceClone ) {\n\n\tif ( ! array || // let 'undefined' and 'null' pass\n\t\t! forceClone && array.constructor === type ) return array;\n\n\tif ( typeof type.BYTES_PER_ELEMENT === 'number' ) {\n\n\t\treturn new type( array ); // create typed array\n\n\t}\n\n\treturn Array.prototype.slice.call( array ); // create Array\n\n}\n\nfunction isTypedArray( object ) {\n\n\treturn ArrayBuffer.isView( object ) &&\n\t\t! ( object instanceof DataView );\n\n}\n\n// returns an array by which times and values can be sorted\nfunction getKeyframeOrder( times ) {\n\n\tfunction compareTime( i, j ) {\n\n\t\treturn times[ i ] - times[ j ];\n\n\t}\n\n\tconst n = times.length;\n\tconst result = new Array( n );\n\tfor ( let i = 0; i !== n; ++ i ) result[ i ] = i;\n\n\tresult.sort( compareTime );\n\n\treturn result;\n\n}\n\n// uses the array previously returned by 'getKeyframeOrder' to sort data\nfunction sortedArray( values, stride, order ) {\n\n\tconst nValues = values.length;\n\tconst result = new values.constructor( nValues );\n\n\tfor ( let i = 0, dstOffset = 0; dstOffset !== nValues; ++ i ) {\n\n\t\tconst srcOffset = order[ i ] * stride;\n\n\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\tresult[ dstOffset ++ ] = values[ srcOffset + j ];\n\n\t\t}\n\n\t}\n\n\treturn result;\n\n}\n\n// function for parsing AOS keyframe formats\nfunction flattenJSON( jsonKeys, times, values, valuePropertyName ) {\n\n\tlet i = 1, key = jsonKeys[ 0 ];\n\n\twhile ( key !== undefined && key[ valuePropertyName ] === undefined ) {\n\n\t\tkey = jsonKeys[ i ++ ];\n\n\t}\n\n\tif ( key === undefined ) return; // no data\n\n\tlet value = key[ valuePropertyName ];\n\tif ( value === undefined ) return; // no data\n\n\tif ( Array.isArray( value ) ) {\n\n\t\tdo {\n\n\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\tif ( value !== undefined ) {\n\n\t\t\t\ttimes.push( key.time );\n\t\t\t\tvalues.push.apply( values, value ); // push all elements\n\n\t\t\t}\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t} while ( key !== undefined );\n\n\t} else if ( value.toArray !== undefined ) {\n\n\t\t// ...assume THREE.Math-ish\n\n\t\tdo {\n\n\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\tif ( value !== undefined ) {\n\n\t\t\t\ttimes.push( key.time );\n\t\t\t\tvalue.toArray( values, values.length );\n\n\t\t\t}\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t} while ( key !== undefined );\n\n\t} else {\n\n\t\t// otherwise push as-is\n\n\t\tdo {\n\n\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\tif ( value !== undefined ) {\n\n\t\t\t\ttimes.push( key.time );\n\t\t\t\tvalues.push( value );\n\n\t\t\t}\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t} while ( key !== undefined );\n\n\t}\n\n}\n\nfunction subclip( sourceClip, name, startFrame, endFrame, fps = 30 ) {\n\n\tconst clip = sourceClip.clone();\n\n\tclip.name = name;\n\n\tconst tracks = [];\n\n\tfor ( let i = 0; i < clip.tracks.length; ++ i ) {\n\n\t\tconst track = clip.tracks[ i ];\n\t\tconst valueSize = track.getValueSize();\n\n\t\tconst times = [];\n\t\tconst values = [];\n\n\t\tfor ( let j = 0; j < track.times.length; ++ j ) {\n\n\t\t\tconst frame = track.times[ j ] * fps;\n\n\t\t\tif ( frame < startFrame || frame >= endFrame ) continue;\n\n\t\t\ttimes.push( track.times[ j ] );\n\n\t\t\tfor ( let k = 0; k < valueSize; ++ k ) {\n\n\t\t\t\tvalues.push( track.values[ j * valueSize + k ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( times.length === 0 ) continue;\n\n\t\ttrack.times = convertArray( times, track.times.constructor );\n\t\ttrack.values = convertArray( values, track.values.constructor );\n\n\t\ttracks.push( track );\n\n\t}\n\n\tclip.tracks = tracks;\n\n\t// find minimum .times value across all tracks in the trimmed clip\n\n\tlet minStartTime = Infinity;\n\n\tfor ( let i = 0; i < clip.tracks.length; ++ i ) {\n\n\t\tif ( minStartTime > clip.tracks[ i ].times[ 0 ] ) {\n\n\t\t\tminStartTime = clip.tracks[ i ].times[ 0 ];\n\n\t\t}\n\n\t}\n\n\t// shift all tracks such that clip begins at t=0\n\n\tfor ( let i = 0; i < clip.tracks.length; ++ i ) {\n\n\t\tclip.tracks[ i ].shift( - 1 * minStartTime );\n\n\t}\n\n\tclip.resetDuration();\n\n\treturn clip;\n\n}\n\nfunction makeClipAdditive( targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30 ) {\n\n\tif ( fps <= 0 ) fps = 30;\n\n\tconst numTracks = referenceClip.tracks.length;\n\tconst referenceTime = referenceFrame / fps;\n\n\t// Make each track's values relative to the values at the reference frame\n\tfor ( let i = 0; i < numTracks; ++ i ) {\n\n\t\tconst referenceTrack = referenceClip.tracks[ i ];\n\t\tconst referenceTrackType = referenceTrack.ValueTypeName;\n\n\t\t// Skip this track if it's non-numeric\n\t\tif ( referenceTrackType === 'bool' || referenceTrackType === 'string' ) continue;\n\n\t\t// Find the track in the target clip whose name and type matches the reference track\n\t\tconst targetTrack = targetClip.tracks.find( function ( track ) {\n\n\t\t\treturn track.name === referenceTrack.name\n\t\t\t\t&& track.ValueTypeName === referenceTrackType;\n\n\t\t} );\n\n\t\tif ( targetTrack === undefined ) continue;\n\n\t\tlet referenceOffset = 0;\n\t\tconst referenceValueSize = referenceTrack.getValueSize();\n\n\t\tif ( referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) {\n\n\t\t\treferenceOffset = referenceValueSize / 3;\n\n\t\t}\n\n\t\tlet targetOffset = 0;\n\t\tconst targetValueSize = targetTrack.getValueSize();\n\n\t\tif ( targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) {\n\n\t\t\ttargetOffset = targetValueSize / 3;\n\n\t\t}\n\n\t\tconst lastIndex = referenceTrack.times.length - 1;\n\t\tlet referenceValue;\n\n\t\t// Find the value to subtract out of the track\n\t\tif ( referenceTime <= referenceTrack.times[ 0 ] ) {\n\n\t\t\t// Reference frame is earlier than the first keyframe, so just use the first keyframe\n\t\t\tconst startIndex = referenceOffset;\n\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\treferenceValue = referenceTrack.values.slice( startIndex, endIndex );\n\n\t\t} else if ( referenceTime >= referenceTrack.times[ lastIndex ] ) {\n\n\t\t\t// Reference frame is after the last keyframe, so just use the last keyframe\n\t\t\tconst startIndex = lastIndex * referenceValueSize + referenceOffset;\n\t\t\tconst endIndex = startIndex + referenceValueSize - referenceOffset;\n\t\t\treferenceValue = referenceTrack.values.slice( startIndex, endIndex );\n\n\t\t} else {\n\n\t\t\t// Interpolate to the reference value\n\t\t\tconst interpolant = referenceTrack.createInterpolant();\n\t\t\tconst startIndex = referenceOffset;\n\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\tinterpolant.evaluate( referenceTime );\n\t\t\treferenceValue = interpolant.resultBuffer.slice( startIndex, endIndex );\n\n\t\t}\n\n\t\t// Conjugate the quaternion\n\t\tif ( referenceTrackType === 'quaternion' ) {\n\n\t\t\tconst referenceQuat = new Quaternion().fromArray( referenceValue ).normalize().conjugate();\n\t\t\treferenceQuat.toArray( referenceValue );\n\n\t\t}\n\n\t\t// Subtract the reference value from all of the track values\n\n\t\tconst numTimes = targetTrack.times.length;\n\t\tfor ( let j = 0; j < numTimes; ++ j ) {\n\n\t\t\tconst valueStart = j * targetValueSize + targetOffset;\n\n\t\t\tif ( referenceTrackType === 'quaternion' ) {\n\n\t\t\t\t// Multiply the conjugate for quaternion track types\n\t\t\t\tQuaternion.multiplyQuaternionsFlat(\n\t\t\t\t\ttargetTrack.values,\n\t\t\t\t\tvalueStart,\n\t\t\t\t\treferenceValue,\n\t\t\t\t\t0,\n\t\t\t\t\ttargetTrack.values,\n\t\t\t\t\tvalueStart\n\t\t\t\t);\n\n\t\t\t} else {\n\n\t\t\t\tconst valueEnd = targetValueSize - targetOffset * 2;\n\n\t\t\t\t// Subtract each value for all other numeric track types\n\t\t\t\tfor ( let k = 0; k < valueEnd; ++ k ) {\n\n\t\t\t\t\ttargetTrack.values[ valueStart + k ] -= referenceValue[ k ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttargetClip.blendMode = AdditiveAnimationBlendMode;\n\n\treturn targetClip;\n\n}\n\nconst AnimationUtils = {\n\tconvertArray: convertArray,\n\tisTypedArray: isTypedArray,\n\tgetKeyframeOrder: getKeyframeOrder,\n\tsortedArray: sortedArray,\n\tflattenJSON: flattenJSON,\n\tsubclip: subclip,\n\tmakeClipAdditive: makeClipAdditive\n};\n\n/**\n * Abstract base class of interpolants over parametric samples.\n *\n * The parameter domain is one dimensional, typically the time or a path\n * along a curve defined by the data.\n *\n * The sample values can have any dimensionality and derived classes may\n * apply special interpretations to the data.\n *\n * This class provides the interval seek in a Template Method, deferring\n * the actual interpolation to derived classes.\n *\n * Time complexity is O(1) for linear access crossing at most two points\n * and O(log N) for random access, where N is the number of positions.\n *\n * References:\n *\n * \t\thttp://www.oodesign.com/template-method-pattern.html\n *\n */\n\nclass Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tthis.parameterPositions = parameterPositions;\n\t\tthis._cachedIndex = 0;\n\n\t\tthis.resultBuffer = resultBuffer !== undefined ?\n\t\t\tresultBuffer : new sampleValues.constructor( sampleSize );\n\t\tthis.sampleValues = sampleValues;\n\t\tthis.valueSize = sampleSize;\n\n\t\tthis.settings = null;\n\t\tthis.DefaultSettings_ = {};\n\n\t}\n\n\tevaluate( t ) {\n\n\t\tconst pp = this.parameterPositions;\n\t\tlet i1 = this._cachedIndex,\n\t\t\tt1 = pp[ i1 ],\n\t\t\tt0 = pp[ i1 - 1 ];\n\n\t\tvalidate_interval: {\n\n\t\t\tseek: {\n\n\t\t\t\tlet right;\n\n\t\t\t\tlinear_scan: {\n\n\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\n\t\t\t\t\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\tforward_scan: if ( ! ( t < t1 ) ) {\n\n\t\t\t\t\t\tfor ( let giveUpAt = i1 + 2; ; ) {\n\n\t\t\t\t\t\t\tif ( t1 === undefined ) {\n\n\t\t\t\t\t\t\t\tif ( t < t0 ) break forward_scan;\n\n\t\t\t\t\t\t\t\t// after end\n\n\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( i1 === giveUpAt ) break; // this loop\n\n\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\tt1 = pp[ ++ i1 ];\n\n\t\t\t\t\t\t\tif ( t < t1 ) {\n\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// prepare binary search on the right side of the index\n\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\tbreak linear_scan;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\t\t\t\t\tif ( ! ( t >= t0 ) ) {\n\n\t\t\t\t\t\t// looping?\n\n\t\t\t\t\t\tconst t1global = pp[ 1 ];\n\n\t\t\t\t\t\tif ( t < t1global ) {\n\n\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\t\t\t\t\t\t\tt0 = t1global;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// linear reverse scan\n\n\t\t\t\t\t\tfor ( let giveUpAt = i1 - 2; ; ) {\n\n\t\t\t\t\t\t\tif ( t0 === undefined ) {\n\n\t\t\t\t\t\t\t\t// before start\n\n\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_( 0 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( i1 === giveUpAt ) break; // this loop\n\n\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\tt0 = pp[ -- i1 - 1 ];\n\n\t\t\t\t\t\t\tif ( t >= t0 ) {\n\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// prepare binary search on the left side of the index\n\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\tbreak linear_scan;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// the interval is valid\n\n\t\t\t\t\tbreak validate_interval;\n\n\t\t\t\t} // linear scan\n\n\t\t\t\t// binary search\n\n\t\t\t\twhile ( i1 < right ) {\n\n\t\t\t\t\tconst mid = ( i1 + right ) >>> 1;\n\n\t\t\t\t\tif ( t < pp[ mid ] ) {\n\n\t\t\t\t\t\tright = mid;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ti1 = mid + 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tt1 = pp[ i1 ];\n\t\t\t\tt0 = pp[ i1 - 1 ];\n\n\t\t\t\t// check boundary cases, again\n\n\t\t\t\tif ( t0 === undefined ) {\n\n\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\treturn this.copySampleValue_( 0 );\n\n\t\t\t\t}\n\n\t\t\t\tif ( t1 === undefined ) {\n\n\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t\t\t\t}\n\n\t\t\t} // seek\n\n\t\t\tthis._cachedIndex = i1;\n\n\t\t\tthis.intervalChanged_( i1, t0, t1 );\n\n\t\t} // validate_interval\n\n\t\treturn this.interpolate_( i1, t0, t, t1 );\n\n\t}\n\n\tgetSettings_() {\n\n\t\treturn this.settings || this.DefaultSettings_;\n\n\t}\n\n\tcopySampleValue_( index ) {\n\n\t\t// copies a sample value to the result buffer\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = index * stride;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] = values[ offset + i ];\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\t// Template methods for derived classes:\n\n\tinterpolate_( /* i1, t0, t, t1 */ ) {\n\n\t\tthrow new Error( 'call to abstract method' );\n\t\t// implementations shall return this.resultBuffer\n\n\t}\n\n\tintervalChanged_( /* i1, t0, t1 */ ) {\n\n\t\t// empty\n\n\t}\n\n}\n\n/**\n * Fast and simple cubic spline interpolant.\n *\n * It was derived from a Hermitian construction setting the first derivative\n * at each sample position to the linear slope between neighboring positions\n * over their parameter interval.\n */\n\nclass CubicInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t\tthis._weightPrev = - 0;\n\t\tthis._offsetPrev = - 0;\n\t\tthis._weightNext = - 0;\n\t\tthis._offsetNext = - 0;\n\n\t\tthis.DefaultSettings_ = {\n\n\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\tendingEnd: ZeroCurvatureEnding\n\n\t\t};\n\n\t}\n\n\tintervalChanged_( i1, t0, t1 ) {\n\n\t\tconst pp = this.parameterPositions;\n\t\tlet iPrev = i1 - 2,\n\t\t\tiNext = i1 + 1,\n\n\t\t\ttPrev = pp[ iPrev ],\n\t\t\ttNext = pp[ iNext ];\n\n\t\tif ( tPrev === undefined ) {\n\n\t\t\tswitch ( this.getSettings_().endingStart ) {\n\n\t\t\t\tcase ZeroSlopeEnding:\n\n\t\t\t\t\t// f'(t0) = 0\n\t\t\t\t\tiPrev = i1;\n\t\t\t\t\ttPrev = 2 * t0 - t1;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase WrapAroundEnding:\n\n\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\tiPrev = pp.length - 2;\n\t\t\t\t\ttPrev = t0 + pp[ iPrev ] - pp[ iPrev + 1 ];\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: // ZeroCurvatureEnding\n\n\t\t\t\t\t// f''(t0) = 0 a.k.a. Natural Spline\n\t\t\t\t\tiPrev = i1;\n\t\t\t\t\ttPrev = t1;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( tNext === undefined ) {\n\n\t\t\tswitch ( this.getSettings_().endingEnd ) {\n\n\t\t\t\tcase ZeroSlopeEnding:\n\n\t\t\t\t\t// f'(tN) = 0\n\t\t\t\t\tiNext = i1;\n\t\t\t\t\ttNext = 2 * t1 - t0;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase WrapAroundEnding:\n\n\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\tiNext = 1;\n\t\t\t\t\ttNext = t1 + pp[ 1 ] - pp[ 0 ];\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: // ZeroCurvatureEnding\n\n\t\t\t\t\t// f''(tN) = 0, a.k.a. Natural Spline\n\t\t\t\t\tiNext = i1 - 1;\n\t\t\t\t\ttNext = t0;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst halfDt = ( t1 - t0 ) * 0.5,\n\t\t\tstride = this.valueSize;\n\n\t\tthis._weightPrev = halfDt / ( t0 - tPrev );\n\t\tthis._weightNext = halfDt / ( tNext - t1 );\n\t\tthis._offsetPrev = iPrev * stride;\n\t\tthis._offsetNext = iNext * stride;\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\to1 = i1 * stride,\t\to0 = o1 - stride,\n\t\t\toP = this._offsetPrev, \toN = this._offsetNext,\n\t\t\twP = this._weightPrev,\twN = this._weightNext,\n\n\t\t\tp = ( t - t0 ) / ( t1 - t0 ),\n\t\t\tpp = p * p,\n\t\t\tppp = pp * p;\n\n\t\t// evaluate polynomials\n\n\t\tconst sP = - wP * ppp + 2 * wP * pp - wP * p;\n\t\tconst s0 = ( 1 + wP ) * ppp + ( - 1.5 - 2 * wP ) * pp + ( - 0.5 + wP ) * p + 1;\n\t\tconst s1 = ( - 1 - wN ) * ppp + ( 1.5 + wN ) * pp + 0.5 * p;\n\t\tconst sN = wN * ppp - wN * pp;\n\n\t\t// combine data linearly\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] =\n\t\t\t\t\tsP * values[ oP + i ] +\n\t\t\t\t\ts0 * values[ o0 + i ] +\n\t\t\t\t\ts1 * values[ o1 + i ] +\n\t\t\t\t\tsN * values[ oN + i ];\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\nclass LinearInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\toffset1 = i1 * stride,\n\t\t\toffset0 = offset1 - stride,\n\n\t\t\tweight1 = ( t - t0 ) / ( t1 - t0 ),\n\t\t\tweight0 = 1 - weight1;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] =\n\t\t\t\t\tvalues[ offset0 + i ] * weight0 +\n\t\t\t\t\tvalues[ offset1 + i ] * weight1;\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\n/**\n *\n * Interpolant that evaluates to the sample value at the position preceding\n * the parameter.\n */\n\nclass DiscreteInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1 /*, t0, t, t1 */ ) {\n\n\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t}\n\n}\n\nclass KeyframeTrack {\n\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tif ( name === undefined ) throw new Error( 'THREE.KeyframeTrack: track name is undefined' );\n\t\tif ( times === undefined || times.length === 0 ) throw new Error( 'THREE.KeyframeTrack: no keyframes in track named ' + name );\n\n\t\tthis.name = name;\n\n\t\tthis.times = convertArray( times, this.TimeBufferType );\n\t\tthis.values = convertArray( values, this.ValueBufferType );\n\n\t\tthis.setInterpolation( interpolation || this.DefaultInterpolation );\n\n\t}\n\n\t// Serialization (in static context, because of constructor invocation\n\t// and automatic invocation of .toJSON):\n\n\tstatic toJSON( track ) {\n\n\t\tconst trackType = track.constructor;\n\n\t\tlet json;\n\n\t\t// derived classes can define a static toJSON method\n\t\tif ( trackType.toJSON !== this.toJSON ) {\n\n\t\t\tjson = trackType.toJSON( track );\n\n\t\t} else {\n\n\t\t\t// by default, we assume the data can be serialized as-is\n\t\t\tjson = {\n\n\t\t\t\t'name': track.name,\n\t\t\t\t'times': convertArray( track.times, Array ),\n\t\t\t\t'values': convertArray( track.values, Array )\n\n\t\t\t};\n\n\t\t\tconst interpolation = track.getInterpolation();\n\n\t\t\tif ( interpolation !== track.DefaultInterpolation ) {\n\n\t\t\t\tjson.interpolation = interpolation;\n\n\t\t\t}\n\n\t\t}\n\n\t\tjson.type = track.ValueTypeName; // mandatory\n\n\t\treturn json;\n\n\t}\n\n\tInterpolantFactoryMethodDiscrete( result ) {\n\n\t\treturn new DiscreteInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\tInterpolantFactoryMethodLinear( result ) {\n\n\t\treturn new LinearInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\tInterpolantFactoryMethodSmooth( result ) {\n\n\t\treturn new CubicInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\tsetInterpolation( interpolation ) {\n\n\t\tlet factoryMethod;\n\n\t\tswitch ( interpolation ) {\n\n\t\t\tcase InterpolateDiscrete:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodDiscrete;\n\n\t\t\t\tbreak;\n\n\t\t\tcase InterpolateLinear:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodLinear;\n\n\t\t\t\tbreak;\n\n\t\t\tcase InterpolateSmooth:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodSmooth;\n\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tif ( factoryMethod === undefined ) {\n\n\t\t\tconst message = 'unsupported interpolation for ' +\n\t\t\t\tthis.ValueTypeName + ' keyframe track named ' + this.name;\n\n\t\t\tif ( this.createInterpolant === undefined ) {\n\n\t\t\t\t// fall back to default, unless the default itself is messed up\n\t\t\t\tif ( interpolation !== this.DefaultInterpolation ) {\n\n\t\t\t\t\tthis.setInterpolation( this.DefaultInterpolation );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new Error( message ); // fatal, in this case\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconsole.warn( 'THREE.KeyframeTrack:', message );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tthis.createInterpolant = factoryMethod;\n\n\t\treturn this;\n\n\t}\n\n\tgetInterpolation() {\n\n\t\tswitch ( this.createInterpolant ) {\n\n\t\t\tcase this.InterpolantFactoryMethodDiscrete:\n\n\t\t\t\treturn InterpolateDiscrete;\n\n\t\t\tcase this.InterpolantFactoryMethodLinear:\n\n\t\t\t\treturn InterpolateLinear;\n\n\t\t\tcase this.InterpolantFactoryMethodSmooth:\n\n\t\t\t\treturn InterpolateSmooth;\n\n\t\t}\n\n\t}\n\n\tgetValueSize() {\n\n\t\treturn this.values.length / this.times.length;\n\n\t}\n\n\t// move all keyframes either forwards or backwards in time\n\tshift( timeOffset ) {\n\n\t\tif ( timeOffset !== 0.0 ) {\n\n\t\t\tconst times = this.times;\n\n\t\t\tfor ( let i = 0, n = times.length; i !== n; ++ i ) {\n\n\t\t\t\ttimes[ i ] += timeOffset;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// scale all keyframe times by a factor (useful for frame <-> seconds conversions)\n\tscale( timeScale ) {\n\n\t\tif ( timeScale !== 1.0 ) {\n\n\t\t\tconst times = this.times;\n\n\t\t\tfor ( let i = 0, n = times.length; i !== n; ++ i ) {\n\n\t\t\t\ttimes[ i ] *= timeScale;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// removes keyframes before and after animation without changing any values within the range [startTime, endTime].\n\t// IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values\n\ttrim( startTime, endTime ) {\n\n\t\tconst times = this.times,\n\t\t\tnKeys = times.length;\n\n\t\tlet from = 0,\n\t\t\tto = nKeys - 1;\n\n\t\twhile ( from !== nKeys && times[ from ] < startTime ) {\n\n\t\t\t++ from;\n\n\t\t}\n\n\t\twhile ( to !== - 1 && times[ to ] > endTime ) {\n\n\t\t\t-- to;\n\n\t\t}\n\n\t\t++ to; // inclusive -> exclusive bound\n\n\t\tif ( from !== 0 || to !== nKeys ) {\n\n\t\t\t// empty tracks are forbidden, so keep at least one keyframe\n\t\t\tif ( from >= to ) {\n\n\t\t\t\tto = Math.max( to, 1 );\n\t\t\t\tfrom = to - 1;\n\n\t\t\t}\n\n\t\t\tconst stride = this.getValueSize();\n\t\t\tthis.times = times.slice( from, to );\n\t\t\tthis.values = this.values.slice( from * stride, to * stride );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable\n\tvalidate() {\n\n\t\tlet valid = true;\n\n\t\tconst valueSize = this.getValueSize();\n\t\tif ( valueSize - Math.floor( valueSize ) !== 0 ) {\n\n\t\t\tconsole.error( 'THREE.KeyframeTrack: Invalid value size in track.', this );\n\t\t\tvalid = false;\n\n\t\t}\n\n\t\tconst times = this.times,\n\t\t\tvalues = this.values,\n\n\t\t\tnKeys = times.length;\n\n\t\tif ( nKeys === 0 ) {\n\n\t\t\tconsole.error( 'THREE.KeyframeTrack: Track is empty.', this );\n\t\t\tvalid = false;\n\n\t\t}\n\n\t\tlet prevTime = null;\n\n\t\tfor ( let i = 0; i !== nKeys; i ++ ) {\n\n\t\t\tconst currTime = times[ i ];\n\n\t\t\tif ( typeof currTime === 'number' && isNaN( currTime ) ) {\n\n\t\t\t\tconsole.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime );\n\t\t\t\tvalid = false;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tif ( prevTime !== null && prevTime > currTime ) {\n\n\t\t\t\tconsole.error( 'THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime );\n\t\t\t\tvalid = false;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tprevTime = currTime;\n\n\t\t}\n\n\t\tif ( values !== undefined ) {\n\n\t\t\tif ( isTypedArray( values ) ) {\n\n\t\t\t\tfor ( let i = 0, n = values.length; i !== n; ++ i ) {\n\n\t\t\t\t\tconst value = values[ i ];\n\n\t\t\t\t\tif ( isNaN( value ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, i, value );\n\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn valid;\n\n\t}\n\n\t// removes equivalent sequential keys as common in morph target sequences\n\t// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)\n\toptimize() {\n\n\t\t// times or values may be shared with other tracks, so overwriting is unsafe\n\t\tconst times = this.times.slice(),\n\t\t\tvalues = this.values.slice(),\n\t\t\tstride = this.getValueSize(),\n\n\t\t\tsmoothInterpolation = this.getInterpolation() === InterpolateSmooth,\n\n\t\t\tlastIndex = times.length - 1;\n\n\t\tlet writeIndex = 1;\n\n\t\tfor ( let i = 1; i < lastIndex; ++ i ) {\n\n\t\t\tlet keep = false;\n\n\t\t\tconst time = times[ i ];\n\t\t\tconst timeNext = times[ i + 1 ];\n\n\t\t\t// remove adjacent keyframes scheduled at the same time\n\n\t\t\tif ( time !== timeNext && ( i !== 1 || time !== times[ 0 ] ) ) {\n\n\t\t\t\tif ( ! smoothInterpolation ) {\n\n\t\t\t\t\t// remove unnecessary keyframes same as their neighbors\n\n\t\t\t\t\tconst offset = i * stride,\n\t\t\t\t\t\toffsetP = offset - stride,\n\t\t\t\t\t\toffsetN = offset + stride;\n\n\t\t\t\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\t\t\t\tconst value = values[ offset + j ];\n\n\t\t\t\t\t\tif ( value !== values[ offsetP + j ] ||\n\t\t\t\t\t\t\tvalue !== values[ offsetN + j ] ) {\n\n\t\t\t\t\t\t\tkeep = true;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tkeep = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// in-place compaction\n\n\t\t\tif ( keep ) {\n\n\t\t\t\tif ( i !== writeIndex ) {\n\n\t\t\t\t\ttimes[ writeIndex ] = times[ i ];\n\n\t\t\t\t\tconst readOffset = i * stride,\n\t\t\t\t\t\twriteOffset = writeIndex * stride;\n\n\t\t\t\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\t\t\t\tvalues[ writeOffset + j ] = values[ readOffset + j ];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t++ writeIndex;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// flush last keyframe (compaction looks ahead)\n\n\t\tif ( lastIndex > 0 ) {\n\n\t\t\ttimes[ writeIndex ] = times[ lastIndex ];\n\n\t\t\tfor ( let readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j ) {\n\n\t\t\t\tvalues[ writeOffset + j ] = values[ readOffset + j ];\n\n\t\t\t}\n\n\t\t\t++ writeIndex;\n\n\t\t}\n\n\t\tif ( writeIndex !== times.length ) {\n\n\t\t\tthis.times = times.slice( 0, writeIndex );\n\t\t\tthis.values = values.slice( 0, writeIndex * stride );\n\n\t\t} else {\n\n\t\t\tthis.times = times;\n\t\t\tthis.values = values;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\tconst times = this.times.slice();\n\t\tconst values = this.values.slice();\n\n\t\tconst TypedKeyframeTrack = this.constructor;\n\t\tconst track = new TypedKeyframeTrack( this.name, times, values );\n\n\t\t// Interpolant argument to constructor is not saved, so copy the factory method directly.\n\t\ttrack.createInterpolant = this.createInterpolant;\n\n\t\treturn track;\n\n\t}\n\n}\n\nKeyframeTrack.prototype.TimeBufferType = Float32Array;\nKeyframeTrack.prototype.ValueBufferType = Float32Array;\nKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;\n\n/**\n * A Track of Boolean keyframe values.\n */\nclass BooleanKeyframeTrack extends KeyframeTrack {\n\n\t// No interpolation parameter because only InterpolateDiscrete is valid.\n\tconstructor( name, times, values ) {\n\n\t\tsuper( name, times, values );\n\n\t}\n\n}\n\nBooleanKeyframeTrack.prototype.ValueTypeName = 'bool';\nBooleanKeyframeTrack.prototype.ValueBufferType = Array;\nBooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\nBooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\nBooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A Track of keyframe values that represent color.\n */\nclass ColorKeyframeTrack extends KeyframeTrack {}\n\nColorKeyframeTrack.prototype.ValueTypeName = 'color';\n\n/**\n * A Track of numeric keyframe values.\n */\nclass NumberKeyframeTrack extends KeyframeTrack {}\n\nNumberKeyframeTrack.prototype.ValueTypeName = 'number';\n\n/**\n * Spherical linear unit quaternion interpolant.\n */\n\nclass QuaternionLinearInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\talpha = ( t - t0 ) / ( t1 - t0 );\n\n\t\tlet offset = i1 * stride;\n\n\t\tfor ( let end = offset + stride; offset !== end; offset += 4 ) {\n\n\t\t\tQuaternion.slerpFlat( result, 0, values, offset - stride, values, offset, alpha );\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\n/**\n * A Track of quaternion keyframe values.\n */\nclass QuaternionKeyframeTrack extends KeyframeTrack {\n\n\tInterpolantFactoryMethodLinear( result ) {\n\n\t\treturn new QuaternionLinearInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n}\n\nQuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion';\n// ValueBufferType is inherited\n// DefaultInterpolation is inherited;\nQuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A Track that interpolates Strings\n */\nclass StringKeyframeTrack extends KeyframeTrack {\n\n\t// No interpolation parameter because only InterpolateDiscrete is valid.\n\tconstructor( name, times, values ) {\n\n\t\tsuper( name, times, values );\n\n\t}\n\n}\n\nStringKeyframeTrack.prototype.ValueTypeName = 'string';\nStringKeyframeTrack.prototype.ValueBufferType = Array;\nStringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\nStringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\nStringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A Track of vectored keyframe values.\n */\nclass VectorKeyframeTrack extends KeyframeTrack {}\n\nVectorKeyframeTrack.prototype.ValueTypeName = 'vector';\n\nclass AnimationClip {\n\n\tconstructor( name = '', duration = - 1, tracks = [], blendMode = NormalAnimationBlendMode ) {\n\n\t\tthis.name = name;\n\t\tthis.tracks = tracks;\n\t\tthis.duration = duration;\n\t\tthis.blendMode = blendMode;\n\n\t\tthis.uuid = generateUUID();\n\n\t\t// this means it should figure out its duration by scanning the tracks\n\t\tif ( this.duration < 0 ) {\n\n\t\t\tthis.resetDuration();\n\n\t\t}\n\n\t}\n\n\n\tstatic parse( json ) {\n\n\t\tconst tracks = [],\n\t\t\tjsonTracks = json.tracks,\n\t\t\tframeTime = 1.0 / ( json.fps || 1.0 );\n\n\t\tfor ( let i = 0, n = jsonTracks.length; i !== n; ++ i ) {\n\n\t\t\ttracks.push( parseKeyframeTrack( jsonTracks[ i ] ).scale( frameTime ) );\n\n\t\t}\n\n\t\tconst clip = new this( json.name, json.duration, tracks, json.blendMode );\n\t\tclip.uuid = json.uuid;\n\n\t\treturn clip;\n\n\t}\n\n\tstatic toJSON( clip ) {\n\n\t\tconst tracks = [],\n\t\t\tclipTracks = clip.tracks;\n\n\t\tconst json = {\n\n\t\t\t'name': clip.name,\n\t\t\t'duration': clip.duration,\n\t\t\t'tracks': tracks,\n\t\t\t'uuid': clip.uuid,\n\t\t\t'blendMode': clip.blendMode\n\n\t\t};\n\n\t\tfor ( let i = 0, n = clipTracks.length; i !== n; ++ i ) {\n\n\t\t\ttracks.push( KeyframeTrack.toJSON( clipTracks[ i ] ) );\n\n\t\t}\n\n\t\treturn json;\n\n\t}\n\n\tstatic CreateFromMorphTargetSequence( name, morphTargetSequence, fps, noLoop ) {\n\n\t\tconst numMorphTargets = morphTargetSequence.length;\n\t\tconst tracks = [];\n\n\t\tfor ( let i = 0; i < numMorphTargets; i ++ ) {\n\n\t\t\tlet times = [];\n\t\t\tlet values = [];\n\n\t\t\ttimes.push(\n\t\t\t\t( i + numMorphTargets - 1 ) % numMorphTargets,\n\t\t\t\ti,\n\t\t\t\t( i + 1 ) % numMorphTargets );\n\n\t\t\tvalues.push( 0, 1, 0 );\n\n\t\t\tconst order = getKeyframeOrder( times );\n\t\t\ttimes = sortedArray( times, 1, order );\n\t\t\tvalues = sortedArray( values, 1, order );\n\n\t\t\t// if there is a key at the first frame, duplicate it as the\n\t\t\t// last frame as well for perfect loop.\n\t\t\tif ( ! noLoop && times[ 0 ] === 0 ) {\n\n\t\t\t\ttimes.push( numMorphTargets );\n\t\t\t\tvalues.push( values[ 0 ] );\n\n\t\t\t}\n\n\t\t\ttracks.push(\n\t\t\t\tnew NumberKeyframeTrack(\n\t\t\t\t\t'.morphTargetInfluences[' + morphTargetSequence[ i ].name + ']',\n\t\t\t\t\ttimes, values\n\t\t\t\t).scale( 1.0 / fps ) );\n\n\t\t}\n\n\t\treturn new this( name, - 1, tracks );\n\n\t}\n\n\tstatic findByName( objectOrClipArray, name ) {\n\n\t\tlet clipArray = objectOrClipArray;\n\n\t\tif ( ! Array.isArray( objectOrClipArray ) ) {\n\n\t\t\tconst o = objectOrClipArray;\n\t\t\tclipArray = o.geometry && o.geometry.animations || o.animations;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < clipArray.length; i ++ ) {\n\n\t\t\tif ( clipArray[ i ].name === name ) {\n\n\t\t\t\treturn clipArray[ i ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\tstatic CreateClipsFromMorphTargetSequences( morphTargets, fps, noLoop ) {\n\n\t\tconst animationToMorphTargets = {};\n\n\t\t// tested with https://regex101.com/ on trick sequences\n\t\t// such flamingo_flyA_003, flamingo_run1_003, crdeath0059\n\t\tconst pattern = /^([\\w-]*?)([\\d]+)$/;\n\n\t\t// sort morph target names into animation groups based\n\t\t// patterns like Walk_001, Walk_002, Run_001, Run_002\n\t\tfor ( let i = 0, il = morphTargets.length; i < il; i ++ ) {\n\n\t\t\tconst morphTarget = morphTargets[ i ];\n\t\t\tconst parts = morphTarget.name.match( pattern );\n\n\t\t\tif ( parts && parts.length > 1 ) {\n\n\t\t\t\tconst name = parts[ 1 ];\n\n\t\t\t\tlet animationMorphTargets = animationToMorphTargets[ name ];\n\n\t\t\t\tif ( ! animationMorphTargets ) {\n\n\t\t\t\t\tanimationToMorphTargets[ name ] = animationMorphTargets = [];\n\n\t\t\t\t}\n\n\t\t\t\tanimationMorphTargets.push( morphTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst clips = [];\n\n\t\tfor ( const name in animationToMorphTargets ) {\n\n\t\t\tclips.push( this.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps, noLoop ) );\n\n\t\t}\n\n\t\treturn clips;\n\n\t}\n\n\t// parse the animation.hierarchy format\n\tstatic parseAnimation( animation, bones ) {\n\n\t\tif ( ! animation ) {\n\n\t\t\tconsole.error( 'THREE.AnimationClip: No animation in JSONLoader data.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst addNonemptyTrack = function ( trackType, trackName, animationKeys, propertyName, destTracks ) {\n\n\t\t\t// only return track if there are actually keys.\n\t\t\tif ( animationKeys.length !== 0 ) {\n\n\t\t\t\tconst times = [];\n\t\t\t\tconst values = [];\n\n\t\t\t\tflattenJSON( animationKeys, times, values, propertyName );\n\n\t\t\t\t// empty keys are filtered out, so check again\n\t\t\t\tif ( times.length !== 0 ) {\n\n\t\t\t\t\tdestTracks.push( new trackType( trackName, times, values ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tconst tracks = [];\n\n\t\tconst clipName = animation.name || 'default';\n\t\tconst fps = animation.fps || 30;\n\t\tconst blendMode = animation.blendMode;\n\n\t\t// automatic length determination in AnimationClip.\n\t\tlet duration = animation.length || - 1;\n\n\t\tconst hierarchyTracks = animation.hierarchy || [];\n\n\t\tfor ( let h = 0; h < hierarchyTracks.length; h ++ ) {\n\n\t\t\tconst animationKeys = hierarchyTracks[ h ].keys;\n\n\t\t\t// skip empty tracks\n\t\t\tif ( ! animationKeys || animationKeys.length === 0 ) continue;\n\n\t\t\t// process morph targets\n\t\t\tif ( animationKeys[ 0 ].morphTargets ) {\n\n\t\t\t\t// figure out all morph targets used in this track\n\t\t\t\tconst morphTargetNames = {};\n\n\t\t\t\tlet k;\n\n\t\t\t\tfor ( k = 0; k < animationKeys.length; k ++ ) {\n\n\t\t\t\t\tif ( animationKeys[ k ].morphTargets ) {\n\n\t\t\t\t\t\tfor ( let m = 0; m < animationKeys[ k ].morphTargets.length; m ++ ) {\n\n\t\t\t\t\t\t\tmorphTargetNames[ animationKeys[ k ].morphTargets[ m ] ] = - 1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// create a track for each morph target with all zero\n\t\t\t\t// morphTargetInfluences except for the keys in which\n\t\t\t\t// the morphTarget is named.\n\t\t\t\tfor ( const morphTargetName in morphTargetNames ) {\n\n\t\t\t\t\tconst times = [];\n\t\t\t\t\tconst values = [];\n\n\t\t\t\t\tfor ( let m = 0; m !== animationKeys[ k ].morphTargets.length; ++ m ) {\n\n\t\t\t\t\t\tconst animationKey = animationKeys[ k ];\n\n\t\t\t\t\t\ttimes.push( animationKey.time );\n\t\t\t\t\t\tvalues.push( ( animationKey.morphTarget === morphTargetName ) ? 1 : 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttracks.push( new NumberKeyframeTrack( '.morphTargetInfluence[' + morphTargetName + ']', times, values ) );\n\n\t\t\t\t}\n\n\t\t\t\tduration = morphTargetNames.length * fps;\n\n\t\t\t} else {\n\n\t\t\t\t// ...assume skeletal animation\n\n\t\t\t\tconst boneName = '.bones[' + bones[ h ].name + ']';\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tVectorKeyframeTrack, boneName + '.position',\n\t\t\t\t\tanimationKeys, 'pos', tracks );\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tQuaternionKeyframeTrack, boneName + '.quaternion',\n\t\t\t\t\tanimationKeys, 'rot', tracks );\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tVectorKeyframeTrack, boneName + '.scale',\n\t\t\t\t\tanimationKeys, 'scl', tracks );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( tracks.length === 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst clip = new this( clipName, duration, tracks, blendMode );\n\n\t\treturn clip;\n\n\t}\n\n\tresetDuration() {\n\n\t\tconst tracks = this.tracks;\n\t\tlet duration = 0;\n\n\t\tfor ( let i = 0, n = tracks.length; i !== n; ++ i ) {\n\n\t\t\tconst track = this.tracks[ i ];\n\n\t\t\tduration = Math.max( duration, track.times[ track.times.length - 1 ] );\n\n\t\t}\n\n\t\tthis.duration = duration;\n\n\t\treturn this;\n\n\t}\n\n\ttrim() {\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\tthis.tracks[ i ].trim( 0, this.duration );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tvalidate() {\n\n\t\tlet valid = true;\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\tvalid = valid && this.tracks[ i ].validate();\n\n\t\t}\n\n\t\treturn valid;\n\n\t}\n\n\toptimize() {\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\tthis.tracks[ i ].optimize();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\tconst tracks = [];\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\ttracks.push( this.tracks[ i ].clone() );\n\n\t\t}\n\n\t\treturn new this.constructor( this.name, this.duration, tracks, this.blendMode );\n\n\t}\n\n\ttoJSON() {\n\n\t\treturn this.constructor.toJSON( this );\n\n\t}\n\n}\n\nfunction getTrackTypeForValueTypeName( typeName ) {\n\n\tswitch ( typeName.toLowerCase() ) {\n\n\t\tcase 'scalar':\n\t\tcase 'double':\n\t\tcase 'float':\n\t\tcase 'number':\n\t\tcase 'integer':\n\n\t\t\treturn NumberKeyframeTrack;\n\n\t\tcase 'vector':\n\t\tcase 'vector2':\n\t\tcase 'vector3':\n\t\tcase 'vector4':\n\n\t\t\treturn VectorKeyframeTrack;\n\n\t\tcase 'color':\n\n\t\t\treturn ColorKeyframeTrack;\n\n\t\tcase 'quaternion':\n\n\t\t\treturn QuaternionKeyframeTrack;\n\n\t\tcase 'bool':\n\t\tcase 'boolean':\n\n\t\t\treturn BooleanKeyframeTrack;\n\n\t\tcase 'string':\n\n\t\t\treturn StringKeyframeTrack;\n\n\t}\n\n\tthrow new Error( 'THREE.KeyframeTrack: Unsupported typeName: ' + typeName );\n\n}\n\nfunction parseKeyframeTrack( json ) {\n\n\tif ( json.type === undefined ) {\n\n\t\tthrow new Error( 'THREE.KeyframeTrack: track type undefined, can not parse' );\n\n\t}\n\n\tconst trackType = getTrackTypeForValueTypeName( json.type );\n\n\tif ( json.times === undefined ) {\n\n\t\tconst times = [], values = [];\n\n\t\tflattenJSON( json.keys, times, values, 'value' );\n\n\t\tjson.times = times;\n\t\tjson.values = values;\n\n\t}\n\n\t// derived classes can define a static parse method\n\tif ( trackType.parse !== undefined ) {\n\n\t\treturn trackType.parse( json );\n\n\t} else {\n\n\t\t// by default, we assume a constructor compatible with the base\n\t\treturn new trackType( json.name, json.times, json.values, json.interpolation );\n\n\t}\n\n}\n\nconst Cache = {\n\n\tenabled: false,\n\n\tfiles: {},\n\n\tadd: function ( key, file ) {\n\n\t\tif ( this.enabled === false ) return;\n\n\t\t// console.log( 'THREE.Cache', 'Adding key:', key );\n\n\t\tthis.files[ key ] = file;\n\n\t},\n\n\tget: function ( key ) {\n\n\t\tif ( this.enabled === false ) return;\n\n\t\t// console.log( 'THREE.Cache', 'Checking key:', key );\n\n\t\treturn this.files[ key ];\n\n\t},\n\n\tremove: function ( key ) {\n\n\t\tdelete this.files[ key ];\n\n\t},\n\n\tclear: function () {\n\n\t\tthis.files = {};\n\n\t}\n\n};\n\nclass LoadingManager {\n\n\tconstructor( onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tlet isLoading = false;\n\t\tlet itemsLoaded = 0;\n\t\tlet itemsTotal = 0;\n\t\tlet urlModifier = undefined;\n\t\tconst handlers = [];\n\n\t\t// Refer to #5689 for the reason why we don't set .onStart\n\t\t// in the constructor\n\n\t\tthis.onStart = undefined;\n\t\tthis.onLoad = onLoad;\n\t\tthis.onProgress = onProgress;\n\t\tthis.onError = onError;\n\n\t\tthis.itemStart = function ( url ) {\n\n\t\t\titemsTotal ++;\n\n\t\t\tif ( isLoading === false ) {\n\n\t\t\t\tif ( scope.onStart !== undefined ) {\n\n\t\t\t\t\tscope.onStart( url, itemsLoaded, itemsTotal );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tisLoading = true;\n\n\t\t};\n\n\t\tthis.itemEnd = function ( url ) {\n\n\t\t\titemsLoaded ++;\n\n\t\t\tif ( scope.onProgress !== undefined ) {\n\n\t\t\t\tscope.onProgress( url, itemsLoaded, itemsTotal );\n\n\t\t\t}\n\n\t\t\tif ( itemsLoaded === itemsTotal ) {\n\n\t\t\t\tisLoading = false;\n\n\t\t\t\tif ( scope.onLoad !== undefined ) {\n\n\t\t\t\t\tscope.onLoad();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.itemError = function ( url ) {\n\n\t\t\tif ( scope.onError !== undefined ) {\n\n\t\t\t\tscope.onError( url );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.resolveURL = function ( url ) {\n\n\t\t\tif ( urlModifier ) {\n\n\t\t\t\treturn urlModifier( url );\n\n\t\t\t}\n\n\t\t\treturn url;\n\n\t\t};\n\n\t\tthis.setURLModifier = function ( transform ) {\n\n\t\t\turlModifier = transform;\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\tthis.addHandler = function ( regex, loader ) {\n\n\t\t\thandlers.push( regex, loader );\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\tthis.removeHandler = function ( regex ) {\n\n\t\t\tconst index = handlers.indexOf( regex );\n\n\t\t\tif ( index !== - 1 ) {\n\n\t\t\t\thandlers.splice( index, 2 );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\tthis.getHandler = function ( file ) {\n\n\t\t\tfor ( let i = 0, l = handlers.length; i < l; i += 2 ) {\n\n\t\t\t\tconst regex = handlers[ i ];\n\t\t\t\tconst loader = handlers[ i + 1 ];\n\n\t\t\t\tif ( regex.global ) regex.lastIndex = 0; // see #17920\n\n\t\t\t\tif ( regex.test( file ) ) {\n\n\t\t\t\t\treturn loader;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn null;\n\n\t\t};\n\n\t}\n\n}\n\nconst DefaultLoadingManager = /*@__PURE__*/ new LoadingManager();\n\nclass Loader {\n\n\tconstructor( manager ) {\n\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t\tthis.crossOrigin = 'anonymous';\n\t\tthis.withCredentials = false;\n\t\tthis.path = '';\n\t\tthis.resourcePath = '';\n\t\tthis.requestHeader = {};\n\n\t}\n\n\tload( /* url, onLoad, onProgress, onError */ ) {}\n\n\tloadAsync( url, onProgress ) {\n\n\t\tconst scope = this;\n\n\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\tscope.load( url, resolve, onProgress, reject );\n\n\t\t} );\n\n\t}\n\n\tparse( /* data */ ) {}\n\n\tsetCrossOrigin( crossOrigin ) {\n\n\t\tthis.crossOrigin = crossOrigin;\n\t\treturn this;\n\n\t}\n\n\tsetWithCredentials( value ) {\n\n\t\tthis.withCredentials = value;\n\t\treturn this;\n\n\t}\n\n\tsetPath( path ) {\n\n\t\tthis.path = path;\n\t\treturn this;\n\n\t}\n\n\tsetResourcePath( resourcePath ) {\n\n\t\tthis.resourcePath = resourcePath;\n\t\treturn this;\n\n\t}\n\n\tsetRequestHeader( requestHeader ) {\n\n\t\tthis.requestHeader = requestHeader;\n\t\treturn this;\n\n\t}\n\n}\n\nLoader.DEFAULT_MATERIAL_NAME = '__DEFAULT';\n\nconst loading = {};\n\nclass HttpError extends Error {\n\n\tconstructor( message, response ) {\n\n\t\tsuper( message );\n\t\tthis.response = response;\n\n\t}\n\n}\n\nclass FileLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( url === undefined ) url = '';\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst cached = Cache.get( url );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tthis.manager.itemStart( url );\n\n\t\t\tsetTimeout( () => {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tthis.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\t// Check if request is duplicate\n\n\t\tif ( loading[ url ] !== undefined ) {\n\n\t\t\tloading[ url ].push( {\n\n\t\t\t\tonLoad: onLoad,\n\t\t\t\tonProgress: onProgress,\n\t\t\t\tonError: onError\n\n\t\t\t} );\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// Initialise array for duplicate requests\n\t\tloading[ url ] = [];\n\n\t\tloading[ url ].push( {\n\t\t\tonLoad: onLoad,\n\t\t\tonProgress: onProgress,\n\t\t\tonError: onError,\n\t\t} );\n\n\t\t// create request\n\t\tconst req = new Request( url, {\n\t\t\theaders: new Headers( this.requestHeader ),\n\t\t\tcredentials: this.withCredentials ? 'include' : 'same-origin',\n\t\t\t// An abort controller could be added within a future PR\n\t\t} );\n\n\t\t// record states ( avoid data race )\n\t\tconst mimeType = this.mimeType;\n\t\tconst responseType = this.responseType;\n\n\t\t// start the fetch\n\t\tfetch( req )\n\t\t\t.then( response => {\n\n\t\t\t\tif ( response.status === 200 || response.status === 0 ) {\n\n\t\t\t\t\t// Some browsers return HTTP Status 0 when using non-http protocol\n\t\t\t\t\t// e.g. 'file://' or 'data://'. Handle as success.\n\n\t\t\t\t\tif ( response.status === 0 ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.FileLoader: HTTP Status 0 received.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Workaround: Checking if response.body === undefined for Alipay browser #23548\n\n\t\t\t\t\tif ( typeof ReadableStream === 'undefined' || response.body === undefined || response.body.getReader === undefined ) {\n\n\t\t\t\t\t\treturn response;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst callbacks = loading[ url ];\n\t\t\t\t\tconst reader = response.body.getReader();\n\n\t\t\t\t\t// Nginx needs X-File-Size check\n\t\t\t\t\t// https://serverfault.com/questions/482875/why-does-nginx-remove-content-length-header-for-chunked-content\n\t\t\t\t\tconst contentLength = response.headers.get( 'X-File-Size' ) || response.headers.get( 'Content-Length' );\n\t\t\t\t\tconst total = contentLength ? parseInt( contentLength ) : 0;\n\t\t\t\t\tconst lengthComputable = total !== 0;\n\t\t\t\t\tlet loaded = 0;\n\n\t\t\t\t\t// periodically read data into the new stream tracking while download progress\n\t\t\t\t\tconst stream = new ReadableStream( {\n\t\t\t\t\t\tstart( controller ) {\n\n\t\t\t\t\t\t\treadData();\n\n\t\t\t\t\t\t\tfunction readData() {\n\n\t\t\t\t\t\t\t\treader.read().then( ( { done, value } ) => {\n\n\t\t\t\t\t\t\t\t\tif ( done ) {\n\n\t\t\t\t\t\t\t\t\t\tcontroller.close();\n\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\tloaded += value.byteLength;\n\n\t\t\t\t\t\t\t\t\t\tconst event = new ProgressEvent( 'progress', { lengthComputable, loaded, total } );\n\t\t\t\t\t\t\t\t\t\tfor ( let i = 0, il = callbacks.length; i < il; i ++ ) {\n\n\t\t\t\t\t\t\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\t\t\t\t\t\t\tif ( callback.onProgress ) callback.onProgress( event );\n\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tcontroller.enqueue( value );\n\t\t\t\t\t\t\t\t\t\treadData();\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}, ( e ) => {\n\n\t\t\t\t\t\t\t\t\tcontroller.error( e );\n\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn new Response( stream );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new HttpError( `fetch for \"${response.url}\" responded with ${response.status}: ${response.statusText}`, response );\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.then( response => {\n\n\t\t\t\tswitch ( responseType ) {\n\n\t\t\t\t\tcase 'arraybuffer':\n\n\t\t\t\t\t\treturn response.arrayBuffer();\n\n\t\t\t\t\tcase 'blob':\n\n\t\t\t\t\t\treturn response.blob();\n\n\t\t\t\t\tcase 'document':\n\n\t\t\t\t\t\treturn response.text()\n\t\t\t\t\t\t\t.then( text => {\n\n\t\t\t\t\t\t\t\tconst parser = new DOMParser();\n\t\t\t\t\t\t\t\treturn parser.parseFromString( text, mimeType );\n\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\tcase 'json':\n\n\t\t\t\t\t\treturn response.json();\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tif ( mimeType === undefined ) {\n\n\t\t\t\t\t\t\treturn response.text();\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// sniff encoding\n\t\t\t\t\t\t\tconst re = /charset=\"?([^;\"\\s]*)\"?/i;\n\t\t\t\t\t\t\tconst exec = re.exec( mimeType );\n\t\t\t\t\t\t\tconst label = exec && exec[ 1 ] ? exec[ 1 ].toLowerCase() : undefined;\n\t\t\t\t\t\t\tconst decoder = new TextDecoder( label );\n\t\t\t\t\t\t\treturn response.arrayBuffer().then( ab => decoder.decode( ab ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.then( data => {\n\n\t\t\t\t// Add to cache only on HTTP success, so that we do not cache\n\t\t\t\t// error response bodies as proper responses to requests.\n\t\t\t\tCache.add( url, data );\n\n\t\t\t\tconst callbacks = loading[ url ];\n\t\t\t\tdelete loading[ url ];\n\n\t\t\t\tfor ( let i = 0, il = callbacks.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\tif ( callback.onLoad ) callback.onLoad( data );\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.catch( err => {\n\n\t\t\t\t// Abort errors and other errors are handled the same\n\n\t\t\t\tconst callbacks = loading[ url ];\n\n\t\t\t\tif ( callbacks === undefined ) {\n\n\t\t\t\t\t// When onLoad was called and url was deleted in `loading`\n\t\t\t\t\tthis.manager.itemError( url );\n\t\t\t\t\tthrow err;\n\n\t\t\t\t}\n\n\t\t\t\tdelete loading[ url ];\n\n\t\t\t\tfor ( let i = 0, il = callbacks.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\tif ( callback.onError ) callback.onError( err );\n\n\t\t\t\t}\n\n\t\t\t\tthis.manager.itemError( url );\n\n\t\t\t} )\n\t\t\t.finally( () => {\n\n\t\t\t\tthis.manager.itemEnd( url );\n\n\t\t\t} );\n\n\t\tthis.manager.itemStart( url );\n\n\t}\n\n\tsetResponseType( value ) {\n\n\t\tthis.responseType = value;\n\t\treturn this;\n\n\t}\n\n\tsetMimeType( value ) {\n\n\t\tthis.mimeType = value;\n\t\treturn this;\n\n\t}\n\n}\n\nclass AnimationLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tparse( json ) {\n\n\t\tconst animations = [];\n\n\t\tfor ( let i = 0; i < json.length; i ++ ) {\n\n\t\t\tconst clip = AnimationClip.parse( json[ i ] );\n\n\t\t\tanimations.push( clip );\n\n\t\t}\n\n\t\treturn animations;\n\n\t}\n\n}\n\n/**\n * Abstract Base class to block based textures loader (dds, pvr, ...)\n *\n * Sub classes have to implement the parse() method which will be used in load().\n */\n\nclass CompressedTextureLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst images = [];\n\n\t\tconst texture = new CompressedTexture();\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\n\t\tlet loaded = 0;\n\n\t\tfunction loadTexture( i ) {\n\n\t\t\tloader.load( url[ i ], function ( buffer ) {\n\n\t\t\t\tconst texDatas = scope.parse( buffer, true );\n\n\t\t\t\timages[ i ] = {\n\t\t\t\t\twidth: texDatas.width,\n\t\t\t\t\theight: texDatas.height,\n\t\t\t\t\tformat: texDatas.format,\n\t\t\t\t\tmipmaps: texDatas.mipmaps\n\t\t\t\t};\n\n\t\t\t\tloaded += 1;\n\n\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\tif ( texDatas.mipmapCount === 1 ) texture.minFilter = LinearFilter;\n\n\t\t\t\t\ttexture.image = images;\n\t\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t}\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\tif ( Array.isArray( url ) ) {\n\n\t\t\tfor ( let i = 0, il = url.length; i < il; ++ i ) {\n\n\t\t\t\tloadTexture( i );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// compressed cubemap texture stored in a single DDS file\n\n\t\t\tloader.load( url, function ( buffer ) {\n\n\t\t\t\tconst texDatas = scope.parse( buffer, true );\n\n\t\t\t\tif ( texDatas.isCubemap ) {\n\n\t\t\t\t\tconst faces = texDatas.mipmaps.length / texDatas.mipmapCount;\n\n\t\t\t\t\tfor ( let f = 0; f < faces; f ++ ) {\n\n\t\t\t\t\t\timages[ f ] = { mipmaps: [] };\n\n\t\t\t\t\t\tfor ( let i = 0; i < texDatas.mipmapCount; i ++ ) {\n\n\t\t\t\t\t\t\timages[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] );\n\t\t\t\t\t\t\timages[ f ].format = texDatas.format;\n\t\t\t\t\t\t\timages[ f ].width = texDatas.width;\n\t\t\t\t\t\t\timages[ f ].height = texDatas.height;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.image = images;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture.image.width = texDatas.width;\n\t\t\t\t\ttexture.image.height = texDatas.height;\n\t\t\t\t\ttexture.mipmaps = texDatas.mipmaps;\n\n\t\t\t\t}\n\n\t\t\t\tif ( texDatas.mipmapCount === 1 ) {\n\n\t\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t\t}\n\n\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n}\n\nclass ImageLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst scope = this;\n\n\t\tconst cached = Cache.get( url );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\tsetTimeout( function () {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\tconst image = createElementNS( 'img' );\n\n\t\tfunction onImageLoad() {\n\n\t\t\tremoveEventListeners();\n\n\t\t\tCache.add( url, this );\n\n\t\t\tif ( onLoad ) onLoad( this );\n\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t}\n\n\t\tfunction onImageError( event ) {\n\n\t\t\tremoveEventListeners();\n\n\t\t\tif ( onError ) onError( event );\n\n\t\t\tscope.manager.itemError( url );\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t}\n\n\t\tfunction removeEventListeners() {\n\n\t\t\timage.removeEventListener( 'load', onImageLoad, false );\n\t\t\timage.removeEventListener( 'error', onImageError, false );\n\n\t\t}\n\n\t\timage.addEventListener( 'load', onImageLoad, false );\n\t\timage.addEventListener( 'error', onImageError, false );\n\n\t\tif ( url.slice( 0, 5 ) !== 'data:' ) {\n\n\t\t\tif ( this.crossOrigin !== undefined ) image.crossOrigin = this.crossOrigin;\n\n\t\t}\n\n\t\tscope.manager.itemStart( url );\n\n\t\timage.src = url;\n\n\t\treturn image;\n\n\t}\n\n}\n\nclass CubeTextureLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( urls, onLoad, onProgress, onError ) {\n\n\t\tconst texture = new CubeTexture();\n\t\ttexture.colorSpace = SRGBColorSpace;\n\n\t\tconst loader = new ImageLoader( this.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.setPath( this.path );\n\n\t\tlet loaded = 0;\n\n\t\tfunction loadTexture( i ) {\n\n\t\t\tloader.load( urls[ i ], function ( image ) {\n\n\t\t\t\ttexture.images[ i ] = image;\n\n\t\t\t\tloaded ++;\n\n\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t}\n\n\t\t\t}, undefined, onError );\n\n\t\t}\n\n\t\tfor ( let i = 0; i < urls.length; ++ i ) {\n\n\t\t\tloadTexture( i );\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n}\n\n/**\n * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...)\n *\n * Sub classes have to implement the parse() method which will be used in load().\n */\n\nclass DataTextureLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst texture = new DataTexture();\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setPath( this.path );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( buffer ) {\n\n\t\t\tlet texData;\n\n\t\t\ttry {\n\n\t\t\t\ttexData = scope.parse( buffer );\n\n\t\t\t} catch ( error ) {\n\n\t\t\t\tif ( onError !== undefined ) {\n\n\t\t\t\t\tonError( error );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( error );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( texData.image !== undefined ) {\n\n\t\t\t\ttexture.image = texData.image;\n\n\t\t\t} else if ( texData.data !== undefined ) {\n\n\t\t\t\ttexture.image.width = texData.width;\n\t\t\t\ttexture.image.height = texData.height;\n\t\t\t\ttexture.image.data = texData.data;\n\n\t\t\t}\n\n\t\t\ttexture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping;\n\t\t\ttexture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping;\n\n\t\t\ttexture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter;\n\t\t\ttexture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter;\n\n\t\t\ttexture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1;\n\n\t\t\tif ( texData.colorSpace !== undefined ) {\n\n\t\t\t\ttexture.colorSpace = texData.colorSpace;\n\n\t\t\t}\n\n\t\t\tif ( texData.flipY !== undefined ) {\n\n\t\t\t\ttexture.flipY = texData.flipY;\n\n\t\t\t}\n\n\t\t\tif ( texData.format !== undefined ) {\n\n\t\t\t\ttexture.format = texData.format;\n\n\t\t\t}\n\n\t\t\tif ( texData.type !== undefined ) {\n\n\t\t\t\ttexture.type = texData.type;\n\n\t\t\t}\n\n\t\t\tif ( texData.mipmaps !== undefined ) {\n\n\t\t\t\ttexture.mipmaps = texData.mipmaps;\n\t\t\t\ttexture.minFilter = LinearMipmapLinearFilter; // presumably...\n\n\t\t\t}\n\n\t\t\tif ( texData.mipmapCount === 1 ) {\n\n\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t}\n\n\t\t\tif ( texData.generateMipmaps !== undefined ) {\n\n\t\t\t\ttexture.generateMipmaps = texData.generateMipmaps;\n\n\t\t\t}\n\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\tif ( onLoad ) onLoad( texture, texData );\n\n\t\t}, onProgress, onError );\n\n\n\t\treturn texture;\n\n\t}\n\n}\n\nclass TextureLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst texture = new Texture();\n\n\t\tconst loader = new ImageLoader( this.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.setPath( this.path );\n\n\t\tloader.load( url, function ( image ) {\n\n\t\t\ttexture.image = image;\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\tif ( onLoad !== undefined ) {\n\n\t\t\t\tonLoad( texture );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t\treturn texture;\n\n\t}\n\n}\n\nclass Light extends Object3D {\n\n\tconstructor( color, intensity = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.isLight = true;\n\n\t\tthis.type = 'Light';\n\n\t\tthis.color = new Color( color );\n\t\tthis.intensity = intensity;\n\n\t}\n\n\tdispose() {\n\n\t\t// Empty here in base class; some subclasses override.\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.color.copy( source.color );\n\t\tthis.intensity = source.intensity;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.color = this.color.getHex();\n\t\tdata.object.intensity = this.intensity;\n\n\t\tif ( this.groundColor !== undefined ) data.object.groundColor = this.groundColor.getHex();\n\n\t\tif ( this.distance !== undefined ) data.object.distance = this.distance;\n\t\tif ( this.angle !== undefined ) data.object.angle = this.angle;\n\t\tif ( this.decay !== undefined ) data.object.decay = this.decay;\n\t\tif ( this.penumbra !== undefined ) data.object.penumbra = this.penumbra;\n\n\t\tif ( this.shadow !== undefined ) data.object.shadow = this.shadow.toJSON();\n\t\tif ( this.target !== undefined ) data.object.target = this.target.uuid;\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass HemisphereLight extends Light {\n\n\tconstructor( skyColor, groundColor, intensity ) {\n\n\t\tsuper( skyColor, intensity );\n\n\t\tthis.isHemisphereLight = true;\n\n\t\tthis.type = 'HemisphereLight';\n\n\t\tthis.position.copy( Object3D.DEFAULT_UP );\n\t\tthis.updateMatrix();\n\n\t\tthis.groundColor = new Color( groundColor );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.groundColor.copy( source.groundColor );\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _projScreenMatrix$1 = /*@__PURE__*/ new Matrix4();\nconst _lightPositionWorld$1 = /*@__PURE__*/ new Vector3();\nconst _lookTarget$1 = /*@__PURE__*/ new Vector3();\n\nclass LightShadow {\n\n\tconstructor( camera ) {\n\n\t\tthis.camera = camera;\n\n\t\tthis.intensity = 1;\n\n\t\tthis.bias = 0;\n\t\tthis.normalBias = 0;\n\t\tthis.radius = 1;\n\t\tthis.blurSamples = 8;\n\n\t\tthis.mapSize = new Vector2( 512, 512 );\n\n\t\tthis.map = null;\n\t\tthis.mapPass = null;\n\t\tthis.matrix = new Matrix4();\n\n\t\tthis.autoUpdate = true;\n\t\tthis.needsUpdate = false;\n\n\t\tthis._frustum = new Frustum();\n\t\tthis._frameExtents = new Vector2( 1, 1 );\n\n\t\tthis._viewportCount = 1;\n\n\t\tthis._viewports = [\n\n\t\t\tnew Vector4( 0, 0, 1, 1 )\n\n\t\t];\n\n\t}\n\n\tgetViewportCount() {\n\n\t\treturn this._viewportCount;\n\n\t}\n\n\tgetFrustum() {\n\n\t\treturn this._frustum;\n\n\t}\n\n\tupdateMatrices( light ) {\n\n\t\tconst shadowCamera = this.camera;\n\t\tconst shadowMatrix = this.matrix;\n\n\t\t_lightPositionWorld$1.setFromMatrixPosition( light.matrixWorld );\n\t\tshadowCamera.position.copy( _lightPositionWorld$1 );\n\n\t\t_lookTarget$1.setFromMatrixPosition( light.target.matrixWorld );\n\t\tshadowCamera.lookAt( _lookTarget$1 );\n\t\tshadowCamera.updateMatrixWorld();\n\n\t\t_projScreenMatrix$1.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );\n\t\tthis._frustum.setFromProjectionMatrix( _projScreenMatrix$1 );\n\n\t\tshadowMatrix.set(\n\t\t\t0.5, 0.0, 0.0, 0.5,\n\t\t\t0.0, 0.5, 0.0, 0.5,\n\t\t\t0.0, 0.0, 0.5, 0.5,\n\t\t\t0.0, 0.0, 0.0, 1.0\n\t\t);\n\n\t\tshadowMatrix.multiply( _projScreenMatrix$1 );\n\n\t}\n\n\tgetViewport( viewportIndex ) {\n\n\t\treturn this._viewports[ viewportIndex ];\n\n\t}\n\n\tgetFrameExtents() {\n\n\t\treturn this._frameExtents;\n\n\t}\n\n\tdispose() {\n\n\t\tif ( this.map ) {\n\n\t\t\tthis.map.dispose();\n\n\t\t}\n\n\t\tif ( this.mapPass ) {\n\n\t\t\tthis.mapPass.dispose();\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.camera = source.camera.clone();\n\n\t\tthis.intensity = source.intensity;\n\n\t\tthis.bias = source.bias;\n\t\tthis.radius = source.radius;\n\n\t\tthis.mapSize.copy( source.mapSize );\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst object = {};\n\n\t\tif ( this.intensity !== 1 ) object.intensity = this.intensity;\n\t\tif ( this.bias !== 0 ) object.bias = this.bias;\n\t\tif ( this.normalBias !== 0 ) object.normalBias = this.normalBias;\n\t\tif ( this.radius !== 1 ) object.radius = this.radius;\n\t\tif ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray();\n\n\t\tobject.camera = this.camera.toJSON( false ).object;\n\t\tdelete object.camera.matrix;\n\n\t\treturn object;\n\n\t}\n\n}\n\nclass SpotLightShadow extends LightShadow {\n\n\tconstructor() {\n\n\t\tsuper( new PerspectiveCamera( 50, 1, 0.5, 500 ) );\n\n\t\tthis.isSpotLightShadow = true;\n\n\t\tthis.focus = 1;\n\n\t}\n\n\tupdateMatrices( light ) {\n\n\t\tconst camera = this.camera;\n\n\t\tconst fov = RAD2DEG * 2 * light.angle * this.focus;\n\t\tconst aspect = this.mapSize.width / this.mapSize.height;\n\t\tconst far = light.distance || camera.far;\n\n\t\tif ( fov !== camera.fov || aspect !== camera.aspect || far !== camera.far ) {\n\n\t\t\tcamera.fov = fov;\n\t\t\tcamera.aspect = aspect;\n\t\t\tcamera.far = far;\n\t\t\tcamera.updateProjectionMatrix();\n\n\t\t}\n\n\t\tsuper.updateMatrices( light );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.focus = source.focus;\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass SpotLight extends Light {\n\n\tconstructor( color, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 2 ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.isSpotLight = true;\n\n\t\tthis.type = 'SpotLight';\n\n\t\tthis.position.copy( Object3D.DEFAULT_UP );\n\t\tthis.updateMatrix();\n\n\t\tthis.target = new Object3D();\n\n\t\tthis.distance = distance;\n\t\tthis.angle = angle;\n\t\tthis.penumbra = penumbra;\n\t\tthis.decay = decay;\n\n\t\tthis.map = null;\n\n\t\tthis.shadow = new SpotLightShadow();\n\n\t}\n\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t// by convention for a spotlight, luminous power (lm) = π * luminous intensity (cd)\n\t\treturn this.intensity * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / Math.PI;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.distance = source.distance;\n\t\tthis.angle = source.angle;\n\t\tthis.penumbra = source.penumbra;\n\t\tthis.decay = source.decay;\n\n\t\tthis.target = source.target.clone();\n\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _projScreenMatrix = /*@__PURE__*/ new Matrix4();\nconst _lightPositionWorld = /*@__PURE__*/ new Vector3();\nconst _lookTarget = /*@__PURE__*/ new Vector3();\n\nclass PointLightShadow extends LightShadow {\n\n\tconstructor() {\n\n\t\tsuper( new PerspectiveCamera( 90, 1, 0.5, 500 ) );\n\n\t\tthis.isPointLightShadow = true;\n\n\t\tthis._frameExtents = new Vector2( 4, 2 );\n\n\t\tthis._viewportCount = 6;\n\n\t\tthis._viewports = [\n\t\t\t// These viewports map a cube-map onto a 2D texture with the\n\t\t\t// following orientation:\n\t\t\t//\n\t\t\t// xzXZ\n\t\t\t// y Y\n\t\t\t//\n\t\t\t// X - Positive x direction\n\t\t\t// x - Negative x direction\n\t\t\t// Y - Positive y direction\n\t\t\t// y - Negative y direction\n\t\t\t// Z - Positive z direction\n\t\t\t// z - Negative z direction\n\n\t\t\t// positive X\n\t\t\tnew Vector4( 2, 1, 1, 1 ),\n\t\t\t// negative X\n\t\t\tnew Vector4( 0, 1, 1, 1 ),\n\t\t\t// positive Z\n\t\t\tnew Vector4( 3, 1, 1, 1 ),\n\t\t\t// negative Z\n\t\t\tnew Vector4( 1, 1, 1, 1 ),\n\t\t\t// positive Y\n\t\t\tnew Vector4( 3, 0, 1, 1 ),\n\t\t\t// negative Y\n\t\t\tnew Vector4( 1, 0, 1, 1 )\n\t\t];\n\n\t\tthis._cubeDirections = [\n\t\t\tnew Vector3( 1, 0, 0 ), new Vector3( - 1, 0, 0 ), new Vector3( 0, 0, 1 ),\n\t\t\tnew Vector3( 0, 0, - 1 ), new Vector3( 0, 1, 0 ), new Vector3( 0, - 1, 0 )\n\t\t];\n\n\t\tthis._cubeUps = [\n\t\t\tnew Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ),\n\t\t\tnew Vector3( 0, 1, 0 ), new Vector3( 0, 0, 1 ),\tnew Vector3( 0, 0, - 1 )\n\t\t];\n\n\t}\n\n\tupdateMatrices( light, viewportIndex = 0 ) {\n\n\t\tconst camera = this.camera;\n\t\tconst shadowMatrix = this.matrix;\n\n\t\tconst far = light.distance || camera.far;\n\n\t\tif ( far !== camera.far ) {\n\n\t\t\tcamera.far = far;\n\t\t\tcamera.updateProjectionMatrix();\n\n\t\t}\n\n\t\t_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );\n\t\tcamera.position.copy( _lightPositionWorld );\n\n\t\t_lookTarget.copy( camera.position );\n\t\t_lookTarget.add( this._cubeDirections[ viewportIndex ] );\n\t\tcamera.up.copy( this._cubeUps[ viewportIndex ] );\n\t\tcamera.lookAt( _lookTarget );\n\t\tcamera.updateMatrixWorld();\n\n\t\tshadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z );\n\n\t\t_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n\t\tthis._frustum.setFromProjectionMatrix( _projScreenMatrix );\n\n\t}\n\n}\n\nclass PointLight extends Light {\n\n\tconstructor( color, intensity, distance = 0, decay = 2 ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.isPointLight = true;\n\n\t\tthis.type = 'PointLight';\n\n\t\tthis.distance = distance;\n\t\tthis.decay = decay;\n\n\t\tthis.shadow = new PointLightShadow();\n\n\t}\n\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t// for an isotropic light source, luminous power (lm) = 4 π luminous intensity (cd)\n\t\treturn this.intensity * 4 * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / ( 4 * Math.PI );\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.distance = source.distance;\n\t\tthis.decay = source.decay;\n\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass DirectionalLightShadow extends LightShadow {\n\n\tconstructor() {\n\n\t\tsuper( new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) );\n\n\t\tthis.isDirectionalLightShadow = true;\n\n\t}\n\n}\n\nclass DirectionalLight extends Light {\n\n\tconstructor( color, intensity ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.isDirectionalLight = true;\n\n\t\tthis.type = 'DirectionalLight';\n\n\t\tthis.position.copy( Object3D.DEFAULT_UP );\n\t\tthis.updateMatrix();\n\n\t\tthis.target = new Object3D();\n\n\t\tthis.shadow = new DirectionalLightShadow();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.target = source.target.clone();\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n}\n\nclass AmbientLight extends Light {\n\n\tconstructor( color, intensity ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.isAmbientLight = true;\n\n\t\tthis.type = 'AmbientLight';\n\n\t}\n\n}\n\nclass RectAreaLight extends Light {\n\n\tconstructor( color, intensity, width = 10, height = 10 ) {\n\n\t\tsuper( color, intensity );\n\n\t\tthis.isRectAreaLight = true;\n\n\t\tthis.type = 'RectAreaLight';\n\n\t\tthis.width = width;\n\t\tthis.height = height;\n\n\t}\n\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in nits)\n\t\treturn this.intensity * this.width * this.height * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in nits) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / ( this.width * this.height * Math.PI );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.width = source.width;\n\t\tthis.height = source.height;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.width = this.width;\n\t\tdata.object.height = this.height;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Primary reference:\n * https://graphics.stanford.edu/papers/envmap/envmap.pdf\n *\n * Secondary reference:\n * https://www.ppsloan.org/publications/StupidSH36.pdf\n */\n\n// 3-band SH defined by 9 coefficients\n\nclass SphericalHarmonics3 {\n\n\tconstructor() {\n\n\t\tthis.isSphericalHarmonics3 = true;\n\n\t\tthis.coefficients = [];\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients.push( new Vector3() );\n\n\t\t}\n\n\t}\n\n\tset( coefficients ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].copy( coefficients[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tzero() {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].set( 0, 0, 0 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// get the radiance in the direction of the normal\n\t// target is a Vector3\n\tgetAt( normal, target ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\tconst coeff = this.coefficients;\n\n\t\t// band 0\n\t\ttarget.copy( coeff[ 0 ] ).multiplyScalar( 0.282095 );\n\n\t\t// band 1\n\t\ttarget.addScaledVector( coeff[ 1 ], 0.488603 * y );\n\t\ttarget.addScaledVector( coeff[ 2 ], 0.488603 * z );\n\t\ttarget.addScaledVector( coeff[ 3 ], 0.488603 * x );\n\n\t\t// band 2\n\t\ttarget.addScaledVector( coeff[ 4 ], 1.092548 * ( x * y ) );\n\t\ttarget.addScaledVector( coeff[ 5 ], 1.092548 * ( y * z ) );\n\t\ttarget.addScaledVector( coeff[ 6 ], 0.315392 * ( 3.0 * z * z - 1.0 ) );\n\t\ttarget.addScaledVector( coeff[ 7 ], 1.092548 * ( x * z ) );\n\t\ttarget.addScaledVector( coeff[ 8 ], 0.546274 * ( x * x - y * y ) );\n\n\t\treturn target;\n\n\t}\n\n\t// get the irradiance (radiance convolved with cosine lobe) in the direction of the normal\n\t// target is a Vector3\n\t// https://graphics.stanford.edu/papers/envmap/envmap.pdf\n\tgetIrradianceAt( normal, target ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\tconst coeff = this.coefficients;\n\n\t\t// band 0\n\t\ttarget.copy( coeff[ 0 ] ).multiplyScalar( 0.886227 ); // π * 0.282095\n\n\t\t// band 1\n\t\ttarget.addScaledVector( coeff[ 1 ], 2.0 * 0.511664 * y ); // ( 2 * π / 3 ) * 0.488603\n\t\ttarget.addScaledVector( coeff[ 2 ], 2.0 * 0.511664 * z );\n\t\ttarget.addScaledVector( coeff[ 3 ], 2.0 * 0.511664 * x );\n\n\t\t// band 2\n\t\ttarget.addScaledVector( coeff[ 4 ], 2.0 * 0.429043 * x * y ); // ( π / 4 ) * 1.092548\n\t\ttarget.addScaledVector( coeff[ 5 ], 2.0 * 0.429043 * y * z );\n\t\ttarget.addScaledVector( coeff[ 6 ], 0.743125 * z * z - 0.247708 ); // ( π / 4 ) * 0.315392 * 3\n\t\ttarget.addScaledVector( coeff[ 7 ], 2.0 * 0.429043 * x * z );\n\t\ttarget.addScaledVector( coeff[ 8 ], 0.429043 * ( x * x - y * y ) ); // ( π / 4 ) * 0.546274\n\n\t\treturn target;\n\n\t}\n\n\tadd( sh ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].add( sh.coefficients[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\taddScaledSH( sh, s ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].addScaledVector( sh.coefficients[ i ], s );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tscale( s ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].multiplyScalar( s );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tlerp( sh, alpha ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].lerp( sh.coefficients[ i ], alpha );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tequals( sh ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tif ( ! this.coefficients[ i ].equals( sh.coefficients[ i ] ) ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tcopy( sh ) {\n\n\t\treturn this.set( sh.coefficients );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tconst coefficients = this.coefficients;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tcoefficients[ i ].fromArray( array, offset + ( i * 3 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst coefficients = this.coefficients;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tcoefficients[ i ].toArray( array, offset + ( i * 3 ) );\n\n\t\t}\n\n\t\treturn array;\n\n\t}\n\n\t// evaluate the basis functions\n\t// shBasis is an Array[ 9 ]\n\tstatic getBasisAt( normal, shBasis ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\t// band 0\n\t\tshBasis[ 0 ] = 0.282095;\n\n\t\t// band 1\n\t\tshBasis[ 1 ] = 0.488603 * y;\n\t\tshBasis[ 2 ] = 0.488603 * z;\n\t\tshBasis[ 3 ] = 0.488603 * x;\n\n\t\t// band 2\n\t\tshBasis[ 4 ] = 1.092548 * x * y;\n\t\tshBasis[ 5 ] = 1.092548 * y * z;\n\t\tshBasis[ 6 ] = 0.315392 * ( 3 * z * z - 1 );\n\t\tshBasis[ 7 ] = 1.092548 * x * z;\n\t\tshBasis[ 8 ] = 0.546274 * ( x * x - y * y );\n\n\t}\n\n}\n\nclass LightProbe extends Light {\n\n\tconstructor( sh = new SphericalHarmonics3(), intensity = 1 ) {\n\n\t\tsuper( undefined, intensity );\n\n\t\tthis.isLightProbe = true;\n\n\t\tthis.sh = sh;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.sh.copy( source.sh );\n\n\t\treturn this;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tthis.intensity = json.intensity; // TODO: Move this bit to Light.fromJSON();\n\t\tthis.sh.fromArray( json.sh );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.sh = this.sh.toArray();\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass MaterialLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\t\tthis.textures = {};\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( scope.manager );\n\t\tloader.setPath( scope.path );\n\t\tloader.setRequestHeader( scope.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tparse( json ) {\n\n\t\tconst textures = this.textures;\n\n\t\tfunction getTexture( name ) {\n\n\t\t\tif ( textures[ name ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.MaterialLoader: Undefined texture', name );\n\n\t\t\t}\n\n\t\t\treturn textures[ name ];\n\n\t\t}\n\n\t\tconst material = this.createMaterialFromType( json.type );\n\n\t\tif ( json.uuid !== undefined ) material.uuid = json.uuid;\n\t\tif ( json.name !== undefined ) material.name = json.name;\n\t\tif ( json.color !== undefined && material.color !== undefined ) material.color.setHex( json.color );\n\t\tif ( json.roughness !== undefined ) material.roughness = json.roughness;\n\t\tif ( json.metalness !== undefined ) material.metalness = json.metalness;\n\t\tif ( json.sheen !== undefined ) material.sheen = json.sheen;\n\t\tif ( json.sheenColor !== undefined ) material.sheenColor = new Color().setHex( json.sheenColor );\n\t\tif ( json.sheenRoughness !== undefined ) material.sheenRoughness = json.sheenRoughness;\n\t\tif ( json.emissive !== undefined && material.emissive !== undefined ) material.emissive.setHex( json.emissive );\n\t\tif ( json.specular !== undefined && material.specular !== undefined ) material.specular.setHex( json.specular );\n\t\tif ( json.specularIntensity !== undefined ) material.specularIntensity = json.specularIntensity;\n\t\tif ( json.specularColor !== undefined && material.specularColor !== undefined ) material.specularColor.setHex( json.specularColor );\n\t\tif ( json.shininess !== undefined ) material.shininess = json.shininess;\n\t\tif ( json.clearcoat !== undefined ) material.clearcoat = json.clearcoat;\n\t\tif ( json.clearcoatRoughness !== undefined ) material.clearcoatRoughness = json.clearcoatRoughness;\n\t\tif ( json.dispersion !== undefined ) material.dispersion = json.dispersion;\n\t\tif ( json.iridescence !== undefined ) material.iridescence = json.iridescence;\n\t\tif ( json.iridescenceIOR !== undefined ) material.iridescenceIOR = json.iridescenceIOR;\n\t\tif ( json.iridescenceThicknessRange !== undefined ) material.iridescenceThicknessRange = json.iridescenceThicknessRange;\n\t\tif ( json.transmission !== undefined ) material.transmission = json.transmission;\n\t\tif ( json.thickness !== undefined ) material.thickness = json.thickness;\n\t\tif ( json.attenuationDistance !== undefined ) material.attenuationDistance = json.attenuationDistance;\n\t\tif ( json.attenuationColor !== undefined && material.attenuationColor !== undefined ) material.attenuationColor.setHex( json.attenuationColor );\n\t\tif ( json.anisotropy !== undefined ) material.anisotropy = json.anisotropy;\n\t\tif ( json.anisotropyRotation !== undefined ) material.anisotropyRotation = json.anisotropyRotation;\n\t\tif ( json.fog !== undefined ) material.fog = json.fog;\n\t\tif ( json.flatShading !== undefined ) material.flatShading = json.flatShading;\n\t\tif ( json.blending !== undefined ) material.blending = json.blending;\n\t\tif ( json.combine !== undefined ) material.combine = json.combine;\n\t\tif ( json.side !== undefined ) material.side = json.side;\n\t\tif ( json.shadowSide !== undefined ) material.shadowSide = json.shadowSide;\n\t\tif ( json.opacity !== undefined ) material.opacity = json.opacity;\n\t\tif ( json.transparent !== undefined ) material.transparent = json.transparent;\n\t\tif ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest;\n\t\tif ( json.alphaHash !== undefined ) material.alphaHash = json.alphaHash;\n\t\tif ( json.depthFunc !== undefined ) material.depthFunc = json.depthFunc;\n\t\tif ( json.depthTest !== undefined ) material.depthTest = json.depthTest;\n\t\tif ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite;\n\t\tif ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite;\n\t\tif ( json.blendSrc !== undefined ) material.blendSrc = json.blendSrc;\n\t\tif ( json.blendDst !== undefined ) material.blendDst = json.blendDst;\n\t\tif ( json.blendEquation !== undefined ) material.blendEquation = json.blendEquation;\n\t\tif ( json.blendSrcAlpha !== undefined ) material.blendSrcAlpha = json.blendSrcAlpha;\n\t\tif ( json.blendDstAlpha !== undefined ) material.blendDstAlpha = json.blendDstAlpha;\n\t\tif ( json.blendEquationAlpha !== undefined ) material.blendEquationAlpha = json.blendEquationAlpha;\n\t\tif ( json.blendColor !== undefined && material.blendColor !== undefined ) material.blendColor.setHex( json.blendColor );\n\t\tif ( json.blendAlpha !== undefined ) material.blendAlpha = json.blendAlpha;\n\t\tif ( json.stencilWriteMask !== undefined ) material.stencilWriteMask = json.stencilWriteMask;\n\t\tif ( json.stencilFunc !== undefined ) material.stencilFunc = json.stencilFunc;\n\t\tif ( json.stencilRef !== undefined ) material.stencilRef = json.stencilRef;\n\t\tif ( json.stencilFuncMask !== undefined ) material.stencilFuncMask = json.stencilFuncMask;\n\t\tif ( json.stencilFail !== undefined ) material.stencilFail = json.stencilFail;\n\t\tif ( json.stencilZFail !== undefined ) material.stencilZFail = json.stencilZFail;\n\t\tif ( json.stencilZPass !== undefined ) material.stencilZPass = json.stencilZPass;\n\t\tif ( json.stencilWrite !== undefined ) material.stencilWrite = json.stencilWrite;\n\n\t\tif ( json.wireframe !== undefined ) material.wireframe = json.wireframe;\n\t\tif ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth;\n\t\tif ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap;\n\t\tif ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin;\n\n\t\tif ( json.rotation !== undefined ) material.rotation = json.rotation;\n\n\t\tif ( json.linewidth !== undefined ) material.linewidth = json.linewidth;\n\t\tif ( json.dashSize !== undefined ) material.dashSize = json.dashSize;\n\t\tif ( json.gapSize !== undefined ) material.gapSize = json.gapSize;\n\t\tif ( json.scale !== undefined ) material.scale = json.scale;\n\n\t\tif ( json.polygonOffset !== undefined ) material.polygonOffset = json.polygonOffset;\n\t\tif ( json.polygonOffsetFactor !== undefined ) material.polygonOffsetFactor = json.polygonOffsetFactor;\n\t\tif ( json.polygonOffsetUnits !== undefined ) material.polygonOffsetUnits = json.polygonOffsetUnits;\n\n\t\tif ( json.dithering !== undefined ) material.dithering = json.dithering;\n\n\t\tif ( json.alphaToCoverage !== undefined ) material.alphaToCoverage = json.alphaToCoverage;\n\t\tif ( json.premultipliedAlpha !== undefined ) material.premultipliedAlpha = json.premultipliedAlpha;\n\t\tif ( json.forceSinglePass !== undefined ) material.forceSinglePass = json.forceSinglePass;\n\n\t\tif ( json.visible !== undefined ) material.visible = json.visible;\n\n\t\tif ( json.toneMapped !== undefined ) material.toneMapped = json.toneMapped;\n\n\t\tif ( json.userData !== undefined ) material.userData = json.userData;\n\n\t\tif ( json.vertexColors !== undefined ) {\n\n\t\t\tif ( typeof json.vertexColors === 'number' ) {\n\n\t\t\t\tmaterial.vertexColors = ( json.vertexColors > 0 ) ? true : false;\n\n\t\t\t} else {\n\n\t\t\t\tmaterial.vertexColors = json.vertexColors;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Shader Material\n\n\t\tif ( json.uniforms !== undefined ) {\n\n\t\t\tfor ( const name in json.uniforms ) {\n\n\t\t\t\tconst uniform = json.uniforms[ name ];\n\n\t\t\t\tmaterial.uniforms[ name ] = {};\n\n\t\t\t\tswitch ( uniform.type ) {\n\n\t\t\t\t\tcase 't':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = getTexture( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'c':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Color().setHex( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v2':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector2().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v3':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector3().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v4':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector4().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'm3':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Matrix3().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'm4':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Matrix4().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = uniform.value;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json.defines !== undefined ) material.defines = json.defines;\n\t\tif ( json.vertexShader !== undefined ) material.vertexShader = json.vertexShader;\n\t\tif ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader;\n\t\tif ( json.glslVersion !== undefined ) material.glslVersion = json.glslVersion;\n\n\t\tif ( json.extensions !== undefined ) {\n\n\t\t\tfor ( const key in json.extensions ) {\n\n\t\t\t\tmaterial.extensions[ key ] = json.extensions[ key ];\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json.lights !== undefined ) material.lights = json.lights;\n\t\tif ( json.clipping !== undefined ) material.clipping = json.clipping;\n\n\t\t// for PointsMaterial\n\n\t\tif ( json.size !== undefined ) material.size = json.size;\n\t\tif ( json.sizeAttenuation !== undefined ) material.sizeAttenuation = json.sizeAttenuation;\n\n\t\t// maps\n\n\t\tif ( json.map !== undefined ) material.map = getTexture( json.map );\n\t\tif ( json.matcap !== undefined ) material.matcap = getTexture( json.matcap );\n\n\t\tif ( json.alphaMap !== undefined ) material.alphaMap = getTexture( json.alphaMap );\n\n\t\tif ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap );\n\t\tif ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale;\n\n\t\tif ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap );\n\t\tif ( json.normalMapType !== undefined ) material.normalMapType = json.normalMapType;\n\t\tif ( json.normalScale !== undefined ) {\n\n\t\t\tlet normalScale = json.normalScale;\n\n\t\t\tif ( Array.isArray( normalScale ) === false ) {\n\n\t\t\t\t// Blender exporter used to export a scalar. See #7459\n\n\t\t\t\tnormalScale = [ normalScale, normalScale ];\n\n\t\t\t}\n\n\t\t\tmaterial.normalScale = new Vector2().fromArray( normalScale );\n\n\t\t}\n\n\t\tif ( json.displacementMap !== undefined ) material.displacementMap = getTexture( json.displacementMap );\n\t\tif ( json.displacementScale !== undefined ) material.displacementScale = json.displacementScale;\n\t\tif ( json.displacementBias !== undefined ) material.displacementBias = json.displacementBias;\n\n\t\tif ( json.roughnessMap !== undefined ) material.roughnessMap = getTexture( json.roughnessMap );\n\t\tif ( json.metalnessMap !== undefined ) material.metalnessMap = getTexture( json.metalnessMap );\n\n\t\tif ( json.emissiveMap !== undefined ) material.emissiveMap = getTexture( json.emissiveMap );\n\t\tif ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity;\n\n\t\tif ( json.specularMap !== undefined ) material.specularMap = getTexture( json.specularMap );\n\t\tif ( json.specularIntensityMap !== undefined ) material.specularIntensityMap = getTexture( json.specularIntensityMap );\n\t\tif ( json.specularColorMap !== undefined ) material.specularColorMap = getTexture( json.specularColorMap );\n\n\t\tif ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap );\n\t\tif ( json.envMapRotation !== undefined ) material.envMapRotation.fromArray( json.envMapRotation );\n\t\tif ( json.envMapIntensity !== undefined ) material.envMapIntensity = json.envMapIntensity;\n\n\t\tif ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity;\n\t\tif ( json.refractionRatio !== undefined ) material.refractionRatio = json.refractionRatio;\n\n\t\tif ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap );\n\t\tif ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity;\n\n\t\tif ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap );\n\t\tif ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity;\n\n\t\tif ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap );\n\n\t\tif ( json.clearcoatMap !== undefined ) material.clearcoatMap = getTexture( json.clearcoatMap );\n\t\tif ( json.clearcoatRoughnessMap !== undefined ) material.clearcoatRoughnessMap = getTexture( json.clearcoatRoughnessMap );\n\t\tif ( json.clearcoatNormalMap !== undefined ) material.clearcoatNormalMap = getTexture( json.clearcoatNormalMap );\n\t\tif ( json.clearcoatNormalScale !== undefined ) material.clearcoatNormalScale = new Vector2().fromArray( json.clearcoatNormalScale );\n\n\t\tif ( json.iridescenceMap !== undefined ) material.iridescenceMap = getTexture( json.iridescenceMap );\n\t\tif ( json.iridescenceThicknessMap !== undefined ) material.iridescenceThicknessMap = getTexture( json.iridescenceThicknessMap );\n\n\t\tif ( json.transmissionMap !== undefined ) material.transmissionMap = getTexture( json.transmissionMap );\n\t\tif ( json.thicknessMap !== undefined ) material.thicknessMap = getTexture( json.thicknessMap );\n\n\t\tif ( json.anisotropyMap !== undefined ) material.anisotropyMap = getTexture( json.anisotropyMap );\n\n\t\tif ( json.sheenColorMap !== undefined ) material.sheenColorMap = getTexture( json.sheenColorMap );\n\t\tif ( json.sheenRoughnessMap !== undefined ) material.sheenRoughnessMap = getTexture( json.sheenRoughnessMap );\n\n\t\treturn material;\n\n\t}\n\n\tsetTextures( value ) {\n\n\t\tthis.textures = value;\n\t\treturn this;\n\n\t}\n\n\tcreateMaterialFromType( type ) {\n\n\t\treturn MaterialLoader.createMaterialFromType( type );\n\n\t}\n\n\tstatic createMaterialFromType( type ) {\n\n\t\tconst materialLib = {\n\t\t\tShadowMaterial,\n\t\t\tSpriteMaterial,\n\t\t\tRawShaderMaterial,\n\t\t\tShaderMaterial,\n\t\t\tPointsMaterial,\n\t\t\tMeshPhysicalMaterial,\n\t\t\tMeshStandardMaterial,\n\t\t\tMeshPhongMaterial,\n\t\t\tMeshToonMaterial,\n\t\t\tMeshNormalMaterial,\n\t\t\tMeshLambertMaterial,\n\t\t\tMeshDepthMaterial,\n\t\t\tMeshDistanceMaterial,\n\t\t\tMeshBasicMaterial,\n\t\t\tMeshMatcapMaterial,\n\t\t\tLineDashedMaterial,\n\t\t\tLineBasicMaterial,\n\t\t\tMaterial\n\t\t};\n\n\t\treturn new materialLib[ type ]();\n\n\t}\n\n}\n\nclass LoaderUtils {\n\n\tstatic decodeText( array ) { // @deprecated, r165\n\n\t\tconsole.warn( 'THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead.' );\n\n\t\tif ( typeof TextDecoder !== 'undefined' ) {\n\n\t\t\treturn new TextDecoder().decode( array );\n\n\t\t}\n\n\t\t// Avoid the String.fromCharCode.apply(null, array) shortcut, which\n\t\t// throws a \"maximum call stack size exceeded\" error for large arrays.\n\n\t\tlet s = '';\n\n\t\tfor ( let i = 0, il = array.length; i < il; i ++ ) {\n\n\t\t\t// Implicitly assumes little-endian.\n\t\t\ts += String.fromCharCode( array[ i ] );\n\n\t\t}\n\n\t\ttry {\n\n\t\t\t// merges multi-byte utf-8 characters.\n\n\t\t\treturn decodeURIComponent( escape( s ) );\n\n\t\t} catch ( e ) { // see #16358\n\n\t\t\treturn s;\n\n\t\t}\n\n\t}\n\n\tstatic extractUrlBase( url ) {\n\n\t\tconst index = url.lastIndexOf( '/' );\n\n\t\tif ( index === - 1 ) return './';\n\n\t\treturn url.slice( 0, index + 1 );\n\n\t}\n\n\tstatic resolveURL( url, path ) {\n\n\t\t// Invalid URL\n\t\tif ( typeof url !== 'string' || url === '' ) return '';\n\n\t\t// Host Relative URL\n\t\tif ( /^https?:\\/\\//i.test( path ) && /^\\//.test( url ) ) {\n\n\t\t\tpath = path.replace( /(^https?:\\/\\/[^\\/]+).*/i, '$1' );\n\n\t\t}\n\n\t\t// Absolute URL http://,https://,//\n\t\tif ( /^(https?:)?\\/\\//i.test( url ) ) return url;\n\n\t\t// Data URI\n\t\tif ( /^data:.*,.*$/i.test( url ) ) return url;\n\n\t\t// Blob URL\n\t\tif ( /^blob:.*$/i.test( url ) ) return url;\n\n\t\t// Relative URL\n\t\treturn path + url;\n\n\t}\n\n}\n\nclass InstancedBufferGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isInstancedBufferGeometry = true;\n\n\t\tthis.type = 'InstancedBufferGeometry';\n\t\tthis.instanceCount = Infinity;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.instanceCount = source.instanceCount;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.instanceCount = this.instanceCount;\n\n\t\tdata.isInstancedBufferGeometry = true;\n\n\t\treturn data;\n\n\t}\n\n}\n\nclass BufferGeometryLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( scope.manager );\n\t\tloader.setPath( scope.path );\n\t\tloader.setRequestHeader( scope.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tparse( json ) {\n\n\t\tconst interleavedBufferMap = {};\n\t\tconst arrayBufferMap = {};\n\n\t\tfunction getInterleavedBuffer( json, uuid ) {\n\n\t\t\tif ( interleavedBufferMap[ uuid ] !== undefined ) return interleavedBufferMap[ uuid ];\n\n\t\t\tconst interleavedBuffers = json.interleavedBuffers;\n\t\t\tconst interleavedBuffer = interleavedBuffers[ uuid ];\n\n\t\t\tconst buffer = getArrayBuffer( json, interleavedBuffer.buffer );\n\n\t\t\tconst array = getTypedArray( interleavedBuffer.type, buffer );\n\t\t\tconst ib = new InterleavedBuffer( array, interleavedBuffer.stride );\n\t\t\tib.uuid = interleavedBuffer.uuid;\n\n\t\t\tinterleavedBufferMap[ uuid ] = ib;\n\n\t\t\treturn ib;\n\n\t\t}\n\n\t\tfunction getArrayBuffer( json, uuid ) {\n\n\t\t\tif ( arrayBufferMap[ uuid ] !== undefined ) return arrayBufferMap[ uuid ];\n\n\t\t\tconst arrayBuffers = json.arrayBuffers;\n\t\t\tconst arrayBuffer = arrayBuffers[ uuid ];\n\n\t\t\tconst ab = new Uint32Array( arrayBuffer ).buffer;\n\n\t\t\tarrayBufferMap[ uuid ] = ab;\n\n\t\t\treturn ab;\n\n\t\t}\n\n\t\tconst geometry = json.isInstancedBufferGeometry ? new InstancedBufferGeometry() : new BufferGeometry();\n\n\t\tconst index = json.data.index;\n\n\t\tif ( index !== undefined ) {\n\n\t\t\tconst typedArray = getTypedArray( index.type, index.array );\n\t\t\tgeometry.setIndex( new BufferAttribute( typedArray, 1 ) );\n\n\t\t}\n\n\t\tconst attributes = json.data.attributes;\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tconst attribute = attributes[ key ];\n\t\t\tlet bufferAttribute;\n\n\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\tconst interleavedBuffer = getInterleavedBuffer( json.data, attribute.data );\n\t\t\t\tbufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized );\n\n\t\t\t} else {\n\n\t\t\t\tconst typedArray = getTypedArray( attribute.type, attribute.array );\n\t\t\t\tconst bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute;\n\t\t\t\tbufferAttribute = new bufferAttributeConstr( typedArray, attribute.itemSize, attribute.normalized );\n\n\t\t\t}\n\n\t\t\tif ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;\n\t\t\tif ( attribute.usage !== undefined ) bufferAttribute.setUsage( attribute.usage );\n\n\t\t\tgeometry.setAttribute( key, bufferAttribute );\n\n\t\t}\n\n\t\tconst morphAttributes = json.data.morphAttributes;\n\n\t\tif ( morphAttributes ) {\n\n\t\t\tfor ( const key in morphAttributes ) {\n\n\t\t\t\tconst attributeArray = morphAttributes[ key ];\n\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor ( let i = 0, il = attributeArray.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst attribute = attributeArray[ i ];\n\t\t\t\t\tlet bufferAttribute;\n\n\t\t\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\t\tconst interleavedBuffer = getInterleavedBuffer( json.data, attribute.data );\n\t\t\t\t\t\tbufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst typedArray = getTypedArray( attribute.type, attribute.array );\n\t\t\t\t\t\tbufferAttribute = new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;\n\t\t\t\t\tarray.push( bufferAttribute );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.morphAttributes[ key ] = array;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst morphTargetsRelative = json.data.morphTargetsRelative;\n\n\t\tif ( morphTargetsRelative ) {\n\n\t\t\tgeometry.morphTargetsRelative = true;\n\n\t\t}\n\n\t\tconst groups = json.data.groups || json.data.drawcalls || json.data.offsets;\n\n\t\tif ( groups !== undefined ) {\n\n\t\t\tfor ( let i = 0, n = groups.length; i !== n; ++ i ) {\n\n\t\t\t\tconst group = groups[ i ];\n\n\t\t\t\tgeometry.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst boundingSphere = json.data.boundingSphere;\n\n\t\tif ( boundingSphere !== undefined ) {\n\n\t\t\tconst center = new Vector3();\n\n\t\t\tif ( boundingSphere.center !== undefined ) {\n\n\t\t\t\tcenter.fromArray( boundingSphere.center );\n\n\t\t\t}\n\n\t\t\tgeometry.boundingSphere = new Sphere( center, boundingSphere.radius );\n\n\t\t}\n\n\t\tif ( json.name ) geometry.name = json.name;\n\t\tif ( json.userData ) geometry.userData = json.userData;\n\n\t\treturn geometry;\n\n\t}\n\n}\n\nclass ObjectLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;\n\t\tthis.resourcePath = this.resourcePath || path;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tlet json = null;\n\n\t\t\ttry {\n\n\t\t\t\tjson = JSON.parse( text );\n\n\t\t\t} catch ( error ) {\n\n\t\t\t\tif ( onError !== undefined ) onError( error );\n\n\t\t\t\tconsole.error( 'THREE:ObjectLoader: Can\\'t parse ' + url + '.', error.message );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tconst metadata = json.metadata;\n\n\t\t\tif ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {\n\n\t\t\t\tif ( onError !== undefined ) onError( new Error( 'THREE.ObjectLoader: Can\\'t load ' + url ) );\n\n\t\t\t\tconsole.error( 'THREE.ObjectLoader: Can\\'t load ' + url );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tscope.parse( json, onLoad );\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tasync loadAsync( url, onProgress ) {\n\n\t\tconst scope = this;\n\n\t\tconst path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;\n\t\tthis.resourcePath = this.resourcePath || path;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\n\t\tconst text = await loader.loadAsync( url, onProgress );\n\n\t\tconst json = JSON.parse( text );\n\n\t\tconst metadata = json.metadata;\n\n\t\tif ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {\n\n\t\t\tthrow new Error( 'THREE.ObjectLoader: Can\\'t load ' + url );\n\n\t\t}\n\n\t\treturn await scope.parseAsync( json );\n\n\t}\n\n\tparse( json, onLoad ) {\n\n\t\tconst animations = this.parseAnimations( json.animations );\n\t\tconst shapes = this.parseShapes( json.shapes );\n\t\tconst geometries = this.parseGeometries( json.geometries, shapes );\n\n\t\tconst images = this.parseImages( json.images, function () {\n\n\t\t\tif ( onLoad !== undefined ) onLoad( object );\n\n\t\t} );\n\n\t\tconst textures = this.parseTextures( json.textures, images );\n\t\tconst materials = this.parseMaterials( json.materials, textures );\n\n\t\tconst object = this.parseObject( json.object, geometries, materials, textures, animations );\n\t\tconst skeletons = this.parseSkeletons( json.skeletons, object );\n\n\t\tthis.bindSkeletons( object, skeletons );\n\t\tthis.bindLightTargets( object );\n\n\t\t//\n\n\t\tif ( onLoad !== undefined ) {\n\n\t\t\tlet hasImages = false;\n\n\t\t\tfor ( const uuid in images ) {\n\n\t\t\t\tif ( images[ uuid ].data instanceof HTMLImageElement ) {\n\n\t\t\t\t\thasImages = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( hasImages === false ) onLoad( object );\n\n\t\t}\n\n\t\treturn object;\n\n\t}\n\n\tasync parseAsync( json ) {\n\n\t\tconst animations = this.parseAnimations( json.animations );\n\t\tconst shapes = this.parseShapes( json.shapes );\n\t\tconst geometries = this.parseGeometries( json.geometries, shapes );\n\n\t\tconst images = await this.parseImagesAsync( json.images );\n\n\t\tconst textures = this.parseTextures( json.textures, images );\n\t\tconst materials = this.parseMaterials( json.materials, textures );\n\n\t\tconst object = this.parseObject( json.object, geometries, materials, textures, animations );\n\t\tconst skeletons = this.parseSkeletons( json.skeletons, object );\n\n\t\tthis.bindSkeletons( object, skeletons );\n\t\tthis.bindLightTargets( object );\n\n\t\treturn object;\n\n\t}\n\n\tparseShapes( json ) {\n\n\t\tconst shapes = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst shape = new Shape().fromJSON( json[ i ] );\n\n\t\t\t\tshapes[ shape.uuid ] = shape;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn shapes;\n\n\t}\n\n\tparseSkeletons( json, object ) {\n\n\t\tconst skeletons = {};\n\t\tconst bones = {};\n\n\t\t// generate bone lookup table\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isBone ) bones[ child.uuid ] = child;\n\n\t\t} );\n\n\t\t// create skeletons\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst skeleton = new Skeleton().fromJSON( json[ i ], bones );\n\n\t\t\t\tskeletons[ skeleton.uuid ] = skeleton;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn skeletons;\n\n\t}\n\n\tparseGeometries( json, shapes ) {\n\n\t\tconst geometries = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tconst bufferGeometryLoader = new BufferGeometryLoader();\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tlet geometry;\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tswitch ( data.type ) {\n\n\t\t\t\t\tcase 'BufferGeometry':\n\t\t\t\t\tcase 'InstancedBufferGeometry':\n\n\t\t\t\t\t\tgeometry = bufferGeometryLoader.parse( data );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tif ( data.type in Geometries ) {\n\n\t\t\t\t\t\t\tgeometry = Geometries[ data.type ].fromJSON( data, shapes );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tconsole.warn( `THREE.ObjectLoader: Unsupported geometry type \"${ data.type }\"` );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.uuid = data.uuid;\n\n\t\t\t\tif ( data.name !== undefined ) geometry.name = data.name;\n\t\t\t\tif ( data.userData !== undefined ) geometry.userData = data.userData;\n\n\t\t\t\tgeometries[ data.uuid ] = geometry;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn geometries;\n\n\t}\n\n\tparseMaterials( json, textures ) {\n\n\t\tconst cache = {}; // MultiMaterial\n\t\tconst materials = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tconst loader = new MaterialLoader();\n\t\t\tloader.setTextures( textures );\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tif ( cache[ data.uuid ] === undefined ) {\n\n\t\t\t\t\tcache[ data.uuid ] = loader.parse( data );\n\n\t\t\t\t}\n\n\t\t\t\tmaterials[ data.uuid ] = cache[ data.uuid ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn materials;\n\n\t}\n\n\tparseAnimations( json ) {\n\n\t\tconst animations = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0; i < json.length; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tconst clip = AnimationClip.parse( data );\n\n\t\t\t\tanimations[ clip.uuid ] = clip;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn animations;\n\n\t}\n\n\tparseImages( json, onLoad ) {\n\n\t\tconst scope = this;\n\t\tconst images = {};\n\n\t\tlet loader;\n\n\t\tfunction loadImage( url ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\treturn loader.load( url, function () {\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, undefined, function () {\n\n\t\t\t\tscope.manager.itemError( url );\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tfunction deserializeImage( image ) {\n\n\t\t\tif ( typeof image === 'string' ) {\n\n\t\t\t\tconst url = image;\n\n\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test( url ) ? url : scope.resourcePath + url;\n\n\t\t\t\treturn loadImage( path );\n\n\t\t\t} else {\n\n\t\t\t\tif ( image.data ) {\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: getTypedArray( image.type, image.data ),\n\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\theight: image.height\n\t\t\t\t\t};\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json !== undefined && json.length > 0 ) {\n\n\t\t\tconst manager = new LoadingManager( onLoad );\n\n\t\t\tloader = new ImageLoader( manager );\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\tfor ( let i = 0, il = json.length; i < il; i ++ ) {\n\n\t\t\t\tconst image = json[ i ];\n\t\t\t\tconst url = image.url;\n\n\t\t\t\tif ( Array.isArray( url ) ) {\n\n\t\t\t\t\t// load array of images e.g CubeTexture\n\n\t\t\t\t\tconst imageArray = [];\n\n\t\t\t\t\tfor ( let j = 0, jl = url.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst currentUrl = url[ j ];\n\n\t\t\t\t\t\tconst deserializedImage = deserializeImage( currentUrl );\n\n\t\t\t\t\t\tif ( deserializedImage !== null ) {\n\n\t\t\t\t\t\t\tif ( deserializedImage instanceof HTMLImageElement ) {\n\n\t\t\t\t\t\t\t\timageArray.push( deserializedImage );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\n\t\t\t\t\t\t\t\timageArray.push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\timages[ image.uuid ] = new Source( imageArray );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// load single image\n\n\t\t\t\t\tconst deserializedImage = deserializeImage( image.url );\n\t\t\t\t\timages[ image.uuid ] = new Source( deserializedImage );\n\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn images;\n\n\t}\n\n\tasync parseImagesAsync( json ) {\n\n\t\tconst scope = this;\n\t\tconst images = {};\n\n\t\tlet loader;\n\n\t\tasync function deserializeImage( image ) {\n\n\t\t\tif ( typeof image === 'string' ) {\n\n\t\t\t\tconst url = image;\n\n\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test( url ) ? url : scope.resourcePath + url;\n\n\t\t\t\treturn await loader.loadAsync( path );\n\n\t\t\t} else {\n\n\t\t\t\tif ( image.data ) {\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: getTypedArray( image.type, image.data ),\n\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\theight: image.height\n\t\t\t\t\t};\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json !== undefined && json.length > 0 ) {\n\n\t\t\tloader = new ImageLoader( this.manager );\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\tfor ( let i = 0, il = json.length; i < il; i ++ ) {\n\n\t\t\t\tconst image = json[ i ];\n\t\t\t\tconst url = image.url;\n\n\t\t\t\tif ( Array.isArray( url ) ) {\n\n\t\t\t\t\t// load array of images e.g CubeTexture\n\n\t\t\t\t\tconst imageArray = [];\n\n\t\t\t\t\tfor ( let j = 0, jl = url.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst currentUrl = url[ j ];\n\n\t\t\t\t\t\tconst deserializedImage = await deserializeImage( currentUrl );\n\n\t\t\t\t\t\tif ( deserializedImage !== null ) {\n\n\t\t\t\t\t\t\tif ( deserializedImage instanceof HTMLImageElement ) {\n\n\t\t\t\t\t\t\t\timageArray.push( deserializedImage );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\n\t\t\t\t\t\t\t\timageArray.push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\timages[ image.uuid ] = new Source( imageArray );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// load single image\n\n\t\t\t\t\tconst deserializedImage = await deserializeImage( image.url );\n\t\t\t\t\timages[ image.uuid ] = new Source( deserializedImage );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn images;\n\n\t}\n\n\tparseTextures( json, images ) {\n\n\t\tfunction parseConstant( value, type ) {\n\n\t\t\tif ( typeof value === 'number' ) return value;\n\n\t\t\tconsole.warn( 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value );\n\n\t\t\treturn type[ value ];\n\n\t\t}\n\n\t\tconst textures = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tif ( data.image === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: No \"image\" specified for', data.uuid );\n\n\t\t\t\t}\n\n\t\t\t\tif ( images[ data.image ] === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined image', data.image );\n\n\t\t\t\t}\n\n\t\t\t\tconst source = images[ data.image ];\n\t\t\t\tconst image = source.data;\n\n\t\t\t\tlet texture;\n\n\t\t\t\tif ( Array.isArray( image ) ) {\n\n\t\t\t\t\ttexture = new CubeTexture();\n\n\t\t\t\t\tif ( image.length === 6 ) texture.needsUpdate = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( image && image.data ) {\n\n\t\t\t\t\t\ttexture = new DataTexture();\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttexture = new Texture();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( image ) texture.needsUpdate = true; // textures can have undefined image data\n\n\t\t\t\t}\n\n\t\t\t\ttexture.source = source;\n\n\t\t\t\ttexture.uuid = data.uuid;\n\n\t\t\t\tif ( data.name !== undefined ) texture.name = data.name;\n\n\t\t\t\tif ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TEXTURE_MAPPING );\n\t\t\t\tif ( data.channel !== undefined ) texture.channel = data.channel;\n\n\t\t\t\tif ( data.offset !== undefined ) texture.offset.fromArray( data.offset );\n\t\t\t\tif ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat );\n\t\t\t\tif ( data.center !== undefined ) texture.center.fromArray( data.center );\n\t\t\t\tif ( data.rotation !== undefined ) texture.rotation = data.rotation;\n\n\t\t\t\tif ( data.wrap !== undefined ) {\n\n\t\t\t\t\ttexture.wrapS = parseConstant( data.wrap[ 0 ], TEXTURE_WRAPPING );\n\t\t\t\t\ttexture.wrapT = parseConstant( data.wrap[ 1 ], TEXTURE_WRAPPING );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.format !== undefined ) texture.format = data.format;\n\t\t\t\tif ( data.internalFormat !== undefined ) texture.internalFormat = data.internalFormat;\n\t\t\t\tif ( data.type !== undefined ) texture.type = data.type;\n\t\t\t\tif ( data.colorSpace !== undefined ) texture.colorSpace = data.colorSpace;\n\n\t\t\t\tif ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER );\n\t\t\t\tif ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER );\n\t\t\t\tif ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy;\n\n\t\t\t\tif ( data.flipY !== undefined ) texture.flipY = data.flipY;\n\n\t\t\t\tif ( data.generateMipmaps !== undefined ) texture.generateMipmaps = data.generateMipmaps;\n\t\t\t\tif ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha;\n\t\t\t\tif ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment;\n\t\t\t\tif ( data.compareFunction !== undefined ) texture.compareFunction = data.compareFunction;\n\n\t\t\t\tif ( data.userData !== undefined ) texture.userData = data.userData;\n\n\t\t\t\ttextures[ data.uuid ] = texture;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn textures;\n\n\t}\n\n\tparseObject( data, geometries, materials, textures, animations ) {\n\n\t\tlet object;\n\n\t\tfunction getGeometry( name ) {\n\n\t\t\tif ( geometries[ name ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined geometry', name );\n\n\t\t\t}\n\n\t\t\treturn geometries[ name ];\n\n\t\t}\n\n\t\tfunction getMaterial( name ) {\n\n\t\t\tif ( name === undefined ) return undefined;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor ( let i = 0, l = name.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst uuid = name[ i ];\n\n\t\t\t\t\tif ( materials[ uuid ] === undefined ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined material', uuid );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tarray.push( materials[ uuid ] );\n\n\t\t\t\t}\n\n\t\t\t\treturn array;\n\n\t\t\t}\n\n\t\t\tif ( materials[ name ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined material', name );\n\n\t\t\t}\n\n\t\t\treturn materials[ name ];\n\n\t\t}\n\n\t\tfunction getTexture( uuid ) {\n\n\t\t\tif ( textures[ uuid ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined texture', uuid );\n\n\t\t\t}\n\n\t\t\treturn textures[ uuid ];\n\n\t\t}\n\n\t\tlet geometry, material;\n\n\t\tswitch ( data.type ) {\n\n\t\t\tcase 'Scene':\n\n\t\t\t\tobject = new Scene();\n\n\t\t\t\tif ( data.background !== undefined ) {\n\n\t\t\t\t\tif ( Number.isInteger( data.background ) ) {\n\n\t\t\t\t\t\tobject.background = new Color( data.background );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tobject.background = getTexture( data.background );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.environment !== undefined ) {\n\n\t\t\t\t\tobject.environment = getTexture( data.environment );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.fog !== undefined ) {\n\n\t\t\t\t\tif ( data.fog.type === 'Fog' ) {\n\n\t\t\t\t\t\tobject.fog = new Fog( data.fog.color, data.fog.near, data.fog.far );\n\n\t\t\t\t\t} else if ( data.fog.type === 'FogExp2' ) {\n\n\t\t\t\t\t\tobject.fog = new FogExp2( data.fog.color, data.fog.density );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( data.fog.name !== '' ) {\n\n\t\t\t\t\t\tobject.fog.name = data.fog.name;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.backgroundBlurriness !== undefined ) object.backgroundBlurriness = data.backgroundBlurriness;\n\t\t\t\tif ( data.backgroundIntensity !== undefined ) object.backgroundIntensity = data.backgroundIntensity;\n\t\t\t\tif ( data.backgroundRotation !== undefined ) object.backgroundRotation.fromArray( data.backgroundRotation );\n\n\t\t\t\tif ( data.environmentIntensity !== undefined ) object.environmentIntensity = data.environmentIntensity;\n\t\t\t\tif ( data.environmentRotation !== undefined ) object.environmentRotation.fromArray( data.environmentRotation );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PerspectiveCamera':\n\n\t\t\t\tobject = new PerspectiveCamera( data.fov, data.aspect, data.near, data.far );\n\n\t\t\t\tif ( data.focus !== undefined ) object.focus = data.focus;\n\t\t\t\tif ( data.zoom !== undefined ) object.zoom = data.zoom;\n\t\t\t\tif ( data.filmGauge !== undefined ) object.filmGauge = data.filmGauge;\n\t\t\t\tif ( data.filmOffset !== undefined ) object.filmOffset = data.filmOffset;\n\t\t\t\tif ( data.view !== undefined ) object.view = Object.assign( {}, data.view );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'OrthographicCamera':\n\n\t\t\t\tobject = new OrthographicCamera( data.left, data.right, data.top, data.bottom, data.near, data.far );\n\n\t\t\t\tif ( data.zoom !== undefined ) object.zoom = data.zoom;\n\t\t\t\tif ( data.view !== undefined ) object.view = Object.assign( {}, data.view );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'AmbientLight':\n\n\t\t\t\tobject = new AmbientLight( data.color, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'DirectionalLight':\n\n\t\t\t\tobject = new DirectionalLight( data.color, data.intensity );\n\t\t\t\tobject.target = data.target || '';\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PointLight':\n\n\t\t\t\tobject = new PointLight( data.color, data.intensity, data.distance, data.decay );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'RectAreaLight':\n\n\t\t\t\tobject = new RectAreaLight( data.color, data.intensity, data.width, data.height );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'SpotLight':\n\n\t\t\t\tobject = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay );\n\t\t\t\tobject.target = data.target || '';\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'HemisphereLight':\n\n\t\t\t\tobject = new HemisphereLight( data.color, data.groundColor, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LightProbe':\n\n\t\t\t\tobject = new LightProbe().fromJSON( data );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'SkinnedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t \tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new SkinnedMesh( geometry, material );\n\n\t\t\t\tif ( data.bindMode !== undefined ) object.bindMode = data.bindMode;\n\t\t\t\tif ( data.bindMatrix !== undefined ) object.bindMatrix.fromArray( data.bindMatrix );\n\t\t\t\tif ( data.skeleton !== undefined ) object.skeleton = data.skeleton;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Mesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new Mesh( geometry, material );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'InstancedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\t\t\t\tconst count = data.count;\n\t\t\t\tconst instanceMatrix = data.instanceMatrix;\n\t\t\t\tconst instanceColor = data.instanceColor;\n\n\t\t\t\tobject = new InstancedMesh( geometry, material, count );\n\t\t\t\tobject.instanceMatrix = new InstancedBufferAttribute( new Float32Array( instanceMatrix.array ), 16 );\n\t\t\t\tif ( instanceColor !== undefined ) object.instanceColor = new InstancedBufferAttribute( new Float32Array( instanceColor.array ), instanceColor.itemSize );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'BatchedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new BatchedMesh( data.maxInstanceCount, data.maxVertexCount, data.maxIndexCount, material );\n\t\t\t\tobject.geometry = geometry;\n\t\t\t\tobject.perObjectFrustumCulled = data.perObjectFrustumCulled;\n\t\t\t\tobject.sortObjects = data.sortObjects;\n\n\t\t\t\tobject._drawRanges = data.drawRanges;\n\t\t\t\tobject._reservedRanges = data.reservedRanges;\n\n\t\t\t\tobject._visibility = data.visibility;\n\t\t\t\tobject._active = data.active;\n\t\t\t\tobject._bounds = data.bounds.map( bound => {\n\n\t\t\t\t\tconst box = new Box3();\n\t\t\t\t\tbox.min.fromArray( bound.boxMin );\n\t\t\t\t\tbox.max.fromArray( bound.boxMax );\n\n\t\t\t\t\tconst sphere = new Sphere();\n\t\t\t\t\tsphere.radius = bound.sphereRadius;\n\t\t\t\t\tsphere.center.fromArray( bound.sphereCenter );\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tboxInitialized: bound.boxInitialized,\n\t\t\t\t\t\tbox: box,\n\n\t\t\t\t\t\tsphereInitialized: bound.sphereInitialized,\n\t\t\t\t\t\tsphere: sphere\n\t\t\t\t\t};\n\n\t\t\t\t} );\n\n\t\t\t\tobject._maxInstanceCount = data.maxInstanceCount;\n\t\t\t\tobject._maxVertexCount = data.maxVertexCount;\n\t\t\t\tobject._maxIndexCount = data.maxIndexCount;\n\n\t\t\t\tobject._geometryInitialized = data.geometryInitialized;\n\t\t\t\tobject._geometryCount = data.geometryCount;\n\n\t\t\t\tobject._matricesTexture = getTexture( data.matricesTexture.uuid );\n\t\t\t\tif ( data.colorsTexture !== undefined ) object._colorsTexture = getTexture( data.colorsTexture.uuid );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LOD':\n\n\t\t\t\tobject = new LOD();\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Line':\n\n\t\t\t\tobject = new Line( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LineLoop':\n\n\t\t\t\tobject = new LineLoop( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LineSegments':\n\n\t\t\t\tobject = new LineSegments( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PointCloud':\n\t\t\tcase 'Points':\n\n\t\t\t\tobject = new Points( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Sprite':\n\n\t\t\t\tobject = new Sprite( getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Group':\n\n\t\t\t\tobject = new Group();\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Bone':\n\n\t\t\t\tobject = new Bone();\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tobject = new Object3D();\n\n\t\t}\n\n\t\tobject.uuid = data.uuid;\n\n\t\tif ( data.name !== undefined ) object.name = data.name;\n\n\t\tif ( data.matrix !== undefined ) {\n\n\t\t\tobject.matrix.fromArray( data.matrix );\n\n\t\t\tif ( data.matrixAutoUpdate !== undefined ) object.matrixAutoUpdate = data.matrixAutoUpdate;\n\t\t\tif ( object.matrixAutoUpdate ) object.matrix.decompose( object.position, object.quaternion, object.scale );\n\n\t\t} else {\n\n\t\t\tif ( data.position !== undefined ) object.position.fromArray( data.position );\n\t\t\tif ( data.rotation !== undefined ) object.rotation.fromArray( data.rotation );\n\t\t\tif ( data.quaternion !== undefined ) object.quaternion.fromArray( data.quaternion );\n\t\t\tif ( data.scale !== undefined ) object.scale.fromArray( data.scale );\n\n\t\t}\n\n\t\tif ( data.up !== undefined ) object.up.fromArray( data.up );\n\n\t\tif ( data.castShadow !== undefined ) object.castShadow = data.castShadow;\n\t\tif ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow;\n\n\t\tif ( data.shadow ) {\n\n\t\t\tif ( data.shadow.intensity !== undefined ) object.shadow.intensity = data.shadow.intensity;\n\t\t\tif ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias;\n\t\t\tif ( data.shadow.normalBias !== undefined ) object.shadow.normalBias = data.shadow.normalBias;\n\t\t\tif ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius;\n\t\t\tif ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize );\n\t\t\tif ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera );\n\n\t\t}\n\n\t\tif ( data.visible !== undefined ) object.visible = data.visible;\n\t\tif ( data.frustumCulled !== undefined ) object.frustumCulled = data.frustumCulled;\n\t\tif ( data.renderOrder !== undefined ) object.renderOrder = data.renderOrder;\n\t\tif ( data.userData !== undefined ) object.userData = data.userData;\n\t\tif ( data.layers !== undefined ) object.layers.mask = data.layers;\n\n\t\tif ( data.children !== undefined ) {\n\n\t\t\tconst children = data.children;\n\n\t\t\tfor ( let i = 0; i < children.length; i ++ ) {\n\n\t\t\t\tobject.add( this.parseObject( children[ i ], geometries, materials, textures, animations ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( data.animations !== undefined ) {\n\n\t\t\tconst objectAnimations = data.animations;\n\n\t\t\tfor ( let i = 0; i < objectAnimations.length; i ++ ) {\n\n\t\t\t\tconst uuid = objectAnimations[ i ];\n\n\t\t\t\tobject.animations.push( animations[ uuid ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( data.type === 'LOD' ) {\n\n\t\t\tif ( data.autoUpdate !== undefined ) object.autoUpdate = data.autoUpdate;\n\n\t\t\tconst levels = data.levels;\n\n\t\t\tfor ( let l = 0; l < levels.length; l ++ ) {\n\n\t\t\t\tconst level = levels[ l ];\n\t\t\t\tconst child = object.getObjectByProperty( 'uuid', level.object );\n\n\t\t\t\tif ( child !== undefined ) {\n\n\t\t\t\t\tobject.addLevel( child, level.distance, level.hysteresis );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn object;\n\n\t}\n\n\tbindSkeletons( object, skeletons ) {\n\n\t\tif ( Object.keys( skeletons ).length === 0 ) return;\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isSkinnedMesh === true && child.skeleton !== undefined ) {\n\n\t\t\t\tconst skeleton = skeletons[ child.skeleton ];\n\n\t\t\t\tif ( skeleton === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: No skeleton found with UUID:', child.skeleton );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tchild.bind( skeleton, child.bindMatrix );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} );\n\n\t}\n\n\tbindLightTargets( object ) {\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isDirectionalLight || child.isSpotLight ) {\n\n\t\t\t\tconst uuid = child.target;\n\n\t\t\t\tconst target = object.getObjectByProperty( 'uuid', uuid );\n\n\t\t\t\tif ( target !== undefined ) {\n\n\t\t\t\t\tchild.target = target;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tchild.target = new Object3D();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} );\n\n\t}\n\n}\n\nconst TEXTURE_MAPPING = {\n\tUVMapping: UVMapping,\n\tCubeReflectionMapping: CubeReflectionMapping,\n\tCubeRefractionMapping: CubeRefractionMapping,\n\tEquirectangularReflectionMapping: EquirectangularReflectionMapping,\n\tEquirectangularRefractionMapping: EquirectangularRefractionMapping,\n\tCubeUVReflectionMapping: CubeUVReflectionMapping\n};\n\nconst TEXTURE_WRAPPING = {\n\tRepeatWrapping: RepeatWrapping,\n\tClampToEdgeWrapping: ClampToEdgeWrapping,\n\tMirroredRepeatWrapping: MirroredRepeatWrapping\n};\n\nconst TEXTURE_FILTER = {\n\tNearestFilter: NearestFilter,\n\tNearestMipmapNearestFilter: NearestMipmapNearestFilter,\n\tNearestMipmapLinearFilter: NearestMipmapLinearFilter,\n\tLinearFilter: LinearFilter,\n\tLinearMipmapNearestFilter: LinearMipmapNearestFilter,\n\tLinearMipmapLinearFilter: LinearMipmapLinearFilter\n};\n\nclass ImageBitmapLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t\tthis.isImageBitmapLoader = true;\n\n\t\tif ( typeof createImageBitmap === 'undefined' ) {\n\n\t\t\tconsole.warn( 'THREE.ImageBitmapLoader: createImageBitmap() not supported.' );\n\n\t\t}\n\n\t\tif ( typeof fetch === 'undefined' ) {\n\n\t\t\tconsole.warn( 'THREE.ImageBitmapLoader: fetch() not supported.' );\n\n\t\t}\n\n\t\tthis.options = { premultiplyAlpha: 'none' };\n\n\t}\n\n\tsetOptions( options ) {\n\n\t\tthis.options = options;\n\n\t\treturn this;\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( url === undefined ) url = '';\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst scope = this;\n\n\t\tconst cached = Cache.get( url );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\t// If cached is a promise, wait for it to resolve\n\t\t\tif ( cached.then ) {\n\n\t\t\t\tcached.then( imageBitmap => {\n\n\t\t\t\t\tif ( onLoad ) onLoad( imageBitmap );\n\n\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t} ).catch( e => {\n\n\t\t\t\t\tif ( onError ) onError( e );\n\n\t\t\t\t} );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t// If cached is not a promise (i.e., it's already an imageBitmap)\n\t\t\tsetTimeout( function () {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\tconst fetchOptions = {};\n\t\tfetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include';\n\t\tfetchOptions.headers = this.requestHeader;\n\n\t\tconst promise = fetch( url, fetchOptions ).then( function ( res ) {\n\n\t\t\treturn res.blob();\n\n\t\t} ).then( function ( blob ) {\n\n\t\t\treturn createImageBitmap( blob, Object.assign( scope.options, { colorSpaceConversion: 'none' } ) );\n\n\t\t} ).then( function ( imageBitmap ) {\n\n\t\t\tCache.add( url, imageBitmap );\n\n\t\t\tif ( onLoad ) onLoad( imageBitmap );\n\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t\treturn imageBitmap;\n\n\t\t} ).catch( function ( e ) {\n\n\t\t\tif ( onError ) onError( e );\n\n\t\t\tCache.remove( url );\n\n\t\t\tscope.manager.itemError( url );\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t} );\n\n\t\tCache.add( url, promise );\n\t\tscope.manager.itemStart( url );\n\n\t}\n\n}\n\nlet _context;\n\nclass AudioContext {\n\n\tstatic getContext() {\n\n\t\tif ( _context === undefined ) {\n\n\t\t\t_context = new ( window.AudioContext || window.webkitAudioContext )();\n\n\t\t}\n\n\t\treturn _context;\n\n\t}\n\n\tstatic setContext( value ) {\n\n\t\t_context = value;\n\n\t}\n\n}\n\nclass AudioLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( buffer ) {\n\n\t\t\ttry {\n\n\t\t\t\t// Create a copy of the buffer. The `decodeAudioData` method\n\t\t\t\t// detaches the buffer when complete, preventing reuse.\n\t\t\t\tconst bufferCopy = buffer.slice( 0 );\n\n\t\t\t\tconst context = AudioContext.getContext();\n\t\t\t\tcontext.decodeAudioData( bufferCopy, function ( audioBuffer ) {\n\n\t\t\t\t\tonLoad( audioBuffer );\n\n\t\t\t\t} ).catch( handleError );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\thandleError( e );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t\tfunction handleError( e ) {\n\n\t\t\tif ( onError ) {\n\n\t\t\t\tonError( e );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( e );\n\n\t\t\t}\n\n\t\t\tscope.manager.itemError( url );\n\n\t\t}\n\n\t}\n\n}\n\nconst _eyeRight = /*@__PURE__*/ new Matrix4();\nconst _eyeLeft = /*@__PURE__*/ new Matrix4();\nconst _projectionMatrix = /*@__PURE__*/ new Matrix4();\n\nclass StereoCamera {\n\n\tconstructor() {\n\n\t\tthis.type = 'StereoCamera';\n\n\t\tthis.aspect = 1;\n\n\t\tthis.eyeSep = 0.064;\n\n\t\tthis.cameraL = new PerspectiveCamera();\n\t\tthis.cameraL.layers.enable( 1 );\n\t\tthis.cameraL.matrixAutoUpdate = false;\n\n\t\tthis.cameraR = new PerspectiveCamera();\n\t\tthis.cameraR.layers.enable( 2 );\n\t\tthis.cameraR.matrixAutoUpdate = false;\n\n\t\tthis._cache = {\n\t\t\tfocus: null,\n\t\t\tfov: null,\n\t\t\taspect: null,\n\t\t\tnear: null,\n\t\t\tfar: null,\n\t\t\tzoom: null,\n\t\t\teyeSep: null\n\t\t};\n\n\t}\n\n\tupdate( camera ) {\n\n\t\tconst cache = this._cache;\n\n\t\tconst needsUpdate = cache.focus !== camera.focus || cache.fov !== camera.fov ||\n\t\t\tcache.aspect !== camera.aspect * this.aspect || cache.near !== camera.near ||\n\t\t\tcache.far !== camera.far || cache.zoom !== camera.zoom || cache.eyeSep !== this.eyeSep;\n\n\t\tif ( needsUpdate ) {\n\n\t\t\tcache.focus = camera.focus;\n\t\t\tcache.fov = camera.fov;\n\t\t\tcache.aspect = camera.aspect * this.aspect;\n\t\t\tcache.near = camera.near;\n\t\t\tcache.far = camera.far;\n\t\t\tcache.zoom = camera.zoom;\n\t\t\tcache.eyeSep = this.eyeSep;\n\n\t\t\t// Off-axis stereoscopic effect based on\n\t\t\t// http://paulbourke.net/stereographics/stereorender/\n\n\t\t\t_projectionMatrix.copy( camera.projectionMatrix );\n\t\t\tconst eyeSepHalf = cache.eyeSep / 2;\n\t\t\tconst eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus;\n\t\t\tconst ymax = ( cache.near * Math.tan( DEG2RAD * cache.fov * 0.5 ) ) / cache.zoom;\n\t\t\tlet xmin, xmax;\n\n\t\t\t// translate xOffset\n\n\t\t\t_eyeLeft.elements[ 12 ] = - eyeSepHalf;\n\t\t\t_eyeRight.elements[ 12 ] = eyeSepHalf;\n\n\t\t\t// for left eye\n\n\t\t\txmin = - ymax * cache.aspect + eyeSepOnProjection;\n\t\t\txmax = ymax * cache.aspect + eyeSepOnProjection;\n\n\t\t\t_projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );\n\t\t\t_projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\tthis.cameraL.projectionMatrix.copy( _projectionMatrix );\n\n\t\t\t// for right eye\n\n\t\t\txmin = - ymax * cache.aspect - eyeSepOnProjection;\n\t\t\txmax = ymax * cache.aspect - eyeSepOnProjection;\n\n\t\t\t_projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );\n\t\t\t_projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\tthis.cameraR.projectionMatrix.copy( _projectionMatrix );\n\n\t\t}\n\n\t\tthis.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeLeft );\n\t\tthis.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeRight );\n\n\t}\n\n}\n\nclass Clock {\n\n\tconstructor( autoStart = true ) {\n\n\t\tthis.autoStart = autoStart;\n\n\t\tthis.startTime = 0;\n\t\tthis.oldTime = 0;\n\t\tthis.elapsedTime = 0;\n\n\t\tthis.running = false;\n\n\t}\n\n\tstart() {\n\n\t\tthis.startTime = now();\n\n\t\tthis.oldTime = this.startTime;\n\t\tthis.elapsedTime = 0;\n\t\tthis.running = true;\n\n\t}\n\n\tstop() {\n\n\t\tthis.getElapsedTime();\n\t\tthis.running = false;\n\t\tthis.autoStart = false;\n\n\t}\n\n\tgetElapsedTime() {\n\n\t\tthis.getDelta();\n\t\treturn this.elapsedTime;\n\n\t}\n\n\tgetDelta() {\n\n\t\tlet diff = 0;\n\n\t\tif ( this.autoStart && ! this.running ) {\n\n\t\t\tthis.start();\n\t\t\treturn 0;\n\n\t\t}\n\n\t\tif ( this.running ) {\n\n\t\t\tconst newTime = now();\n\n\t\t\tdiff = ( newTime - this.oldTime ) / 1000;\n\t\t\tthis.oldTime = newTime;\n\n\t\t\tthis.elapsedTime += diff;\n\n\t\t}\n\n\t\treturn diff;\n\n\t}\n\n}\n\nfunction now() {\n\n\treturn performance.now();\n\n}\n\nconst _position$1 = /*@__PURE__*/ new Vector3();\nconst _quaternion$1 = /*@__PURE__*/ new Quaternion();\nconst _scale$1 = /*@__PURE__*/ new Vector3();\nconst _orientation$1 = /*@__PURE__*/ new Vector3();\n\nclass AudioListener extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'AudioListener';\n\n\t\tthis.context = AudioContext.getContext();\n\n\t\tthis.gain = this.context.createGain();\n\t\tthis.gain.connect( this.context.destination );\n\n\t\tthis.filter = null;\n\n\t\tthis.timeDelta = 0;\n\n\t\t// private\n\n\t\tthis._clock = new Clock();\n\n\t}\n\n\tgetInput() {\n\n\t\treturn this.gain;\n\n\t}\n\n\tremoveFilter() {\n\n\t\tif ( this.filter !== null ) {\n\n\t\t\tthis.gain.disconnect( this.filter );\n\t\t\tthis.filter.disconnect( this.context.destination );\n\t\t\tthis.gain.connect( this.context.destination );\n\t\t\tthis.filter = null;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetFilter() {\n\n\t\treturn this.filter;\n\n\t}\n\n\tsetFilter( value ) {\n\n\t\tif ( this.filter !== null ) {\n\n\t\t\tthis.gain.disconnect( this.filter );\n\t\t\tthis.filter.disconnect( this.context.destination );\n\n\t\t} else {\n\n\t\t\tthis.gain.disconnect( this.context.destination );\n\n\t\t}\n\n\t\tthis.filter = value;\n\t\tthis.gain.connect( this.filter );\n\t\tthis.filter.connect( this.context.destination );\n\n\t\treturn this;\n\n\t}\n\n\tgetMasterVolume() {\n\n\t\treturn this.gain.gain.value;\n\n\t}\n\n\tsetMasterVolume( value ) {\n\n\t\tthis.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 );\n\n\t\treturn this;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tconst listener = this.context.listener;\n\t\tconst up = this.up;\n\n\t\tthis.timeDelta = this._clock.getDelta();\n\n\t\tthis.matrixWorld.decompose( _position$1, _quaternion$1, _scale$1 );\n\n\t\t_orientation$1.set( 0, 0, - 1 ).applyQuaternion( _quaternion$1 );\n\n\t\tif ( listener.positionX ) {\n\n\t\t\t// code path for Chrome (see #14393)\n\n\t\t\tconst endTime = this.context.currentTime + this.timeDelta;\n\n\t\t\tlistener.positionX.linearRampToValueAtTime( _position$1.x, endTime );\n\t\t\tlistener.positionY.linearRampToValueAtTime( _position$1.y, endTime );\n\t\t\tlistener.positionZ.linearRampToValueAtTime( _position$1.z, endTime );\n\t\t\tlistener.forwardX.linearRampToValueAtTime( _orientation$1.x, endTime );\n\t\t\tlistener.forwardY.linearRampToValueAtTime( _orientation$1.y, endTime );\n\t\t\tlistener.forwardZ.linearRampToValueAtTime( _orientation$1.z, endTime );\n\t\t\tlistener.upX.linearRampToValueAtTime( up.x, endTime );\n\t\t\tlistener.upY.linearRampToValueAtTime( up.y, endTime );\n\t\t\tlistener.upZ.linearRampToValueAtTime( up.z, endTime );\n\n\t\t} else {\n\n\t\t\tlistener.setPosition( _position$1.x, _position$1.y, _position$1.z );\n\t\t\tlistener.setOrientation( _orientation$1.x, _orientation$1.y, _orientation$1.z, up.x, up.y, up.z );\n\n\t\t}\n\n\t}\n\n}\n\nclass Audio extends Object3D {\n\n\tconstructor( listener ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Audio';\n\n\t\tthis.listener = listener;\n\t\tthis.context = listener.context;\n\n\t\tthis.gain = this.context.createGain();\n\t\tthis.gain.connect( listener.getInput() );\n\n\t\tthis.autoplay = false;\n\n\t\tthis.buffer = null;\n\t\tthis.detune = 0;\n\t\tthis.loop = false;\n\t\tthis.loopStart = 0;\n\t\tthis.loopEnd = 0;\n\t\tthis.offset = 0;\n\t\tthis.duration = undefined;\n\t\tthis.playbackRate = 1;\n\t\tthis.isPlaying = false;\n\t\tthis.hasPlaybackControl = true;\n\t\tthis.source = null;\n\t\tthis.sourceType = 'empty';\n\n\t\tthis._startedAt = 0;\n\t\tthis._progress = 0;\n\t\tthis._connected = false;\n\n\t\tthis.filters = [];\n\n\t}\n\n\tgetOutput() {\n\n\t\treturn this.gain;\n\n\t}\n\n\tsetNodeSource( audioNode ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'audioNode';\n\t\tthis.source = audioNode;\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\tsetMediaElementSource( mediaElement ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'mediaNode';\n\t\tthis.source = this.context.createMediaElementSource( mediaElement );\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\tsetMediaStreamSource( mediaStream ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'mediaStreamNode';\n\t\tthis.source = this.context.createMediaStreamSource( mediaStream );\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\tsetBuffer( audioBuffer ) {\n\n\t\tthis.buffer = audioBuffer;\n\t\tthis.sourceType = 'buffer';\n\n\t\tif ( this.autoplay ) this.play();\n\n\t\treturn this;\n\n\t}\n\n\tplay( delay = 0 ) {\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: Audio is already playing.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._startedAt = this.context.currentTime + delay;\n\n\t\tconst source = this.context.createBufferSource();\n\t\tsource.buffer = this.buffer;\n\t\tsource.loop = this.loop;\n\t\tsource.loopStart = this.loopStart;\n\t\tsource.loopEnd = this.loopEnd;\n\t\tsource.onended = this.onEnded.bind( this );\n\t\tsource.start( this._startedAt, this._progress + this.offset, this.duration );\n\n\t\tthis.isPlaying = true;\n\n\t\tthis.source = source;\n\n\t\tthis.setDetune( this.detune );\n\t\tthis.setPlaybackRate( this.playbackRate );\n\n\t\treturn this.connect();\n\n\t}\n\n\tpause() {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\t// update current progress\n\n\t\t\tthis._progress += Math.max( this.context.currentTime - this._startedAt, 0 ) * this.playbackRate;\n\n\t\t\tif ( this.loop === true ) {\n\n\t\t\t\t// ensure _progress does not exceed duration with looped audios\n\n\t\t\t\tthis._progress = this._progress % ( this.duration || this.buffer.duration );\n\n\t\t\t}\n\n\t\t\tthis.source.stop();\n\t\t\tthis.source.onended = null;\n\n\t\t\tthis.isPlaying = false;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tstop( delay = 0 ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._progress = 0;\n\n\t\tif ( this.source !== null ) {\n\n\t\t\tthis.source.stop( this.context.currentTime + delay );\n\t\t\tthis.source.onended = null;\n\n\t\t}\n\n\t\tthis.isPlaying = false;\n\n\t\treturn this;\n\n\t}\n\n\tconnect() {\n\n\t\tif ( this.filters.length > 0 ) {\n\n\t\t\tthis.source.connect( this.filters[ 0 ] );\n\n\t\t\tfor ( let i = 1, l = this.filters.length; i < l; i ++ ) {\n\n\t\t\t\tthis.filters[ i - 1 ].connect( this.filters[ i ] );\n\n\t\t\t}\n\n\t\t\tthis.filters[ this.filters.length - 1 ].connect( this.getOutput() );\n\n\t\t} else {\n\n\t\t\tthis.source.connect( this.getOutput() );\n\n\t\t}\n\n\t\tthis._connected = true;\n\n\t\treturn this;\n\n\t}\n\n\tdisconnect() {\n\n\t\tif ( this._connected === false ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.filters.length > 0 ) {\n\n\t\t\tthis.source.disconnect( this.filters[ 0 ] );\n\n\t\t\tfor ( let i = 1, l = this.filters.length; i < l; i ++ ) {\n\n\t\t\t\tthis.filters[ i - 1 ].disconnect( this.filters[ i ] );\n\n\t\t\t}\n\n\t\t\tthis.filters[ this.filters.length - 1 ].disconnect( this.getOutput() );\n\n\t\t} else {\n\n\t\t\tthis.source.disconnect( this.getOutput() );\n\n\t\t}\n\n\t\tthis._connected = false;\n\n\t\treturn this;\n\n\t}\n\n\tgetFilters() {\n\n\t\treturn this.filters;\n\n\t}\n\n\tsetFilters( value ) {\n\n\t\tif ( ! value ) value = [];\n\n\t\tif ( this._connected === true ) {\n\n\t\t\tthis.disconnect();\n\t\t\tthis.filters = value.slice();\n\t\t\tthis.connect();\n\n\t\t} else {\n\n\t\t\tthis.filters = value.slice();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetDetune( value ) {\n\n\t\tthis.detune = value;\n\n\t\tif ( this.isPlaying === true && this.source.detune !== undefined ) {\n\n\t\t\tthis.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetDetune() {\n\n\t\treturn this.detune;\n\n\t}\n\n\tgetFilter() {\n\n\t\treturn this.getFilters()[ 0 ];\n\n\t}\n\n\tsetFilter( filter ) {\n\n\t\treturn this.setFilters( filter ? [ filter ] : [] );\n\n\t}\n\n\tsetPlaybackRate( value ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis.playbackRate = value;\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tthis.source.playbackRate.setTargetAtTime( this.playbackRate, this.context.currentTime, 0.01 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetPlaybackRate() {\n\n\t\treturn this.playbackRate;\n\n\t}\n\n\tonEnded() {\n\n\t\tthis.isPlaying = false;\n\n\t}\n\n\tgetLoop() {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn this.loop;\n\n\t}\n\n\tsetLoop( value ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis.loop = value;\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tthis.source.loop = this.loop;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetLoopStart( value ) {\n\n\t\tthis.loopStart = value;\n\n\t\treturn this;\n\n\t}\n\n\tsetLoopEnd( value ) {\n\n\t\tthis.loopEnd = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetVolume() {\n\n\t\treturn this.gain.gain.value;\n\n\t}\n\n\tsetVolume( value ) {\n\n\t\tthis.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 );\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _position = /*@__PURE__*/ new Vector3();\nconst _quaternion = /*@__PURE__*/ new Quaternion();\nconst _scale = /*@__PURE__*/ new Vector3();\nconst _orientation = /*@__PURE__*/ new Vector3();\n\nclass PositionalAudio extends Audio {\n\n\tconstructor( listener ) {\n\n\t\tsuper( listener );\n\n\t\tthis.panner = this.context.createPanner();\n\t\tthis.panner.panningModel = 'HRTF';\n\t\tthis.panner.connect( this.gain );\n\n\t}\n\n\tconnect() {\n\n\t\tsuper.connect();\n\n\t\tthis.panner.connect( this.gain );\n\n\t}\n\n\tdisconnect() {\n\n\t\tsuper.disconnect();\n\n\t\tthis.panner.disconnect( this.gain );\n\n\t}\n\n\tgetOutput() {\n\n\t\treturn this.panner;\n\n\t}\n\n\tgetRefDistance() {\n\n\t\treturn this.panner.refDistance;\n\n\t}\n\n\tsetRefDistance( value ) {\n\n\t\tthis.panner.refDistance = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetRolloffFactor() {\n\n\t\treturn this.panner.rolloffFactor;\n\n\t}\n\n\tsetRolloffFactor( value ) {\n\n\t\tthis.panner.rolloffFactor = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetDistanceModel() {\n\n\t\treturn this.panner.distanceModel;\n\n\t}\n\n\tsetDistanceModel( value ) {\n\n\t\tthis.panner.distanceModel = value;\n\n\t\treturn this;\n\n\t}\n\n\tgetMaxDistance() {\n\n\t\treturn this.panner.maxDistance;\n\n\t}\n\n\tsetMaxDistance( value ) {\n\n\t\tthis.panner.maxDistance = value;\n\n\t\treturn this;\n\n\t}\n\n\tsetDirectionalCone( coneInnerAngle, coneOuterAngle, coneOuterGain ) {\n\n\t\tthis.panner.coneInnerAngle = coneInnerAngle;\n\t\tthis.panner.coneOuterAngle = coneOuterAngle;\n\t\tthis.panner.coneOuterGain = coneOuterGain;\n\n\t\treturn this;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tif ( this.hasPlaybackControl === true && this.isPlaying === false ) return;\n\n\t\tthis.matrixWorld.decompose( _position, _quaternion, _scale );\n\n\t\t_orientation.set( 0, 0, 1 ).applyQuaternion( _quaternion );\n\n\t\tconst panner = this.panner;\n\n\t\tif ( panner.positionX ) {\n\n\t\t\t// code path for Chrome and Firefox (see #14393)\n\n\t\t\tconst endTime = this.context.currentTime + this.listener.timeDelta;\n\n\t\t\tpanner.positionX.linearRampToValueAtTime( _position.x, endTime );\n\t\t\tpanner.positionY.linearRampToValueAtTime( _position.y, endTime );\n\t\t\tpanner.positionZ.linearRampToValueAtTime( _position.z, endTime );\n\t\t\tpanner.orientationX.linearRampToValueAtTime( _orientation.x, endTime );\n\t\t\tpanner.orientationY.linearRampToValueAtTime( _orientation.y, endTime );\n\t\t\tpanner.orientationZ.linearRampToValueAtTime( _orientation.z, endTime );\n\n\t\t} else {\n\n\t\t\tpanner.setPosition( _position.x, _position.y, _position.z );\n\t\t\tpanner.setOrientation( _orientation.x, _orientation.y, _orientation.z );\n\n\t\t}\n\n\t}\n\n}\n\nclass AudioAnalyser {\n\n\tconstructor( audio, fftSize = 2048 ) {\n\n\t\tthis.analyser = audio.context.createAnalyser();\n\t\tthis.analyser.fftSize = fftSize;\n\n\t\tthis.data = new Uint8Array( this.analyser.frequencyBinCount );\n\n\t\taudio.getOutput().connect( this.analyser );\n\n\t}\n\n\n\tgetFrequencyData() {\n\n\t\tthis.analyser.getByteFrequencyData( this.data );\n\n\t\treturn this.data;\n\n\t}\n\n\tgetAverageFrequency() {\n\n\t\tlet value = 0;\n\t\tconst data = this.getFrequencyData();\n\n\t\tfor ( let i = 0; i < data.length; i ++ ) {\n\n\t\t\tvalue += data[ i ];\n\n\t\t}\n\n\t\treturn value / data.length;\n\n\t}\n\n}\n\nclass PropertyMixer {\n\n\tconstructor( binding, typeName, valueSize ) {\n\n\t\tthis.binding = binding;\n\t\tthis.valueSize = valueSize;\n\n\t\tlet mixFunction,\n\t\t\tmixFunctionAdditive,\n\t\t\tsetIdentity;\n\n\t\t// buffer layout: [ incoming | accu0 | accu1 | orig | addAccu | (optional work) ]\n\t\t//\n\t\t// interpolators can use .buffer as their .result\n\t\t// the data then goes to 'incoming'\n\t\t//\n\t\t// 'accu0' and 'accu1' are used frame-interleaved for\n\t\t// the cumulative result and are compared to detect\n\t\t// changes\n\t\t//\n\t\t// 'orig' stores the original state of the property\n\t\t//\n\t\t// 'add' is used for additive cumulative results\n\t\t//\n\t\t// 'work' is optional and is only present for quaternion types. It is used\n\t\t// to store intermediate quaternion multiplication results\n\n\t\tswitch ( typeName ) {\n\n\t\t\tcase 'quaternion':\n\t\t\t\tmixFunction = this._slerp;\n\t\t\t\tmixFunctionAdditive = this._slerpAdditive;\n\t\t\t\tsetIdentity = this._setAdditiveIdentityQuaternion;\n\n\t\t\t\tthis.buffer = new Float64Array( valueSize * 6 );\n\t\t\t\tthis._workIndex = 5;\n\t\t\t\tbreak;\n\n\t\t\tcase 'string':\n\t\t\tcase 'bool':\n\t\t\t\tmixFunction = this._select;\n\n\t\t\t\t// Use the regular mix function and for additive on these types,\n\t\t\t\t// additive is not relevant for non-numeric types\n\t\t\t\tmixFunctionAdditive = this._select;\n\n\t\t\t\tsetIdentity = this._setAdditiveIdentityOther;\n\n\t\t\t\tthis.buffer = new Array( valueSize * 5 );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tmixFunction = this._lerp;\n\t\t\t\tmixFunctionAdditive = this._lerpAdditive;\n\t\t\t\tsetIdentity = this._setAdditiveIdentityNumeric;\n\n\t\t\t\tthis.buffer = new Float64Array( valueSize * 5 );\n\n\t\t}\n\n\t\tthis._mixBufferRegion = mixFunction;\n\t\tthis._mixBufferRegionAdditive = mixFunctionAdditive;\n\t\tthis._setIdentity = setIdentity;\n\t\tthis._origIndex = 3;\n\t\tthis._addIndex = 4;\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t\tthis.useCount = 0;\n\t\tthis.referenceCount = 0;\n\n\t}\n\n\t// accumulate data in the 'incoming' region into 'accu'\n\taccumulate( accuIndex, weight ) {\n\n\t\t// note: happily accumulating nothing when weight = 0, the caller knows\n\t\t// the weight and shouldn't have made the call in the first place\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = accuIndex * stride + stride;\n\n\t\tlet currentWeight = this.cumulativeWeight;\n\n\t\tif ( currentWeight === 0 ) {\n\n\t\t\t// accuN := incoming * weight\n\n\t\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tbuffer[ offset + i ] = buffer[ i ];\n\n\t\t\t}\n\n\t\t\tcurrentWeight = weight;\n\n\t\t} else {\n\n\t\t\t// accuN := accuN + incoming * weight\n\n\t\t\tcurrentWeight += weight;\n\t\t\tconst mix = weight / currentWeight;\n\t\t\tthis._mixBufferRegion( buffer, offset, 0, mix, stride );\n\n\t\t}\n\n\t\tthis.cumulativeWeight = currentWeight;\n\n\t}\n\n\t// accumulate data in the 'incoming' region into 'add'\n\taccumulateAdditive( weight ) {\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = stride * this._addIndex;\n\n\t\tif ( this.cumulativeWeightAdditive === 0 ) {\n\n\t\t\t// add = identity\n\n\t\t\tthis._setIdentity();\n\n\t\t}\n\n\t\t// add := add + incoming * weight\n\n\t\tthis._mixBufferRegionAdditive( buffer, offset, 0, weight, stride );\n\t\tthis.cumulativeWeightAdditive += weight;\n\n\t}\n\n\t// apply the state of 'accu' to the binding when accus differ\n\tapply( accuIndex ) {\n\n\t\tconst stride = this.valueSize,\n\t\t\tbuffer = this.buffer,\n\t\t\toffset = accuIndex * stride + stride,\n\n\t\t\tweight = this.cumulativeWeight,\n\t\t\tweightAdditive = this.cumulativeWeightAdditive,\n\n\t\t\tbinding = this.binding;\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t\tif ( weight < 1 ) {\n\n\t\t\t// accuN := accuN + original * ( 1 - cumulativeWeight )\n\n\t\t\tconst originalValueOffset = stride * this._origIndex;\n\n\t\t\tthis._mixBufferRegion(\n\t\t\t\tbuffer, offset, originalValueOffset, 1 - weight, stride );\n\n\t\t}\n\n\t\tif ( weightAdditive > 0 ) {\n\n\t\t\t// accuN := accuN + additive accuN\n\n\t\t\tthis._mixBufferRegionAdditive( buffer, offset, this._addIndex * stride, 1, stride );\n\n\t\t}\n\n\t\tfor ( let i = stride, e = stride + stride; i !== e; ++ i ) {\n\n\t\t\tif ( buffer[ i ] !== buffer[ i + stride ] ) {\n\n\t\t\t\t// value has changed -> update scene graph\n\n\t\t\t\tbinding.setValue( buffer, offset );\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// remember the state of the bound property and copy it to both accus\n\tsaveOriginalState() {\n\n\t\tconst binding = this.binding;\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\n\t\t\toriginalValueOffset = stride * this._origIndex;\n\n\t\tbinding.getValue( buffer, originalValueOffset );\n\n\t\t// accu[0..1] := orig -- initially detect changes against the original\n\t\tfor ( let i = stride, e = originalValueOffset; i !== e; ++ i ) {\n\n\t\t\tbuffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ];\n\n\t\t}\n\n\t\t// Add to identity for additive\n\t\tthis._setIdentity();\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t}\n\n\t// apply the state previously taken via 'saveOriginalState' to the binding\n\trestoreOriginalState() {\n\n\t\tconst originalValueOffset = this.valueSize * 3;\n\t\tthis.binding.setValue( this.buffer, originalValueOffset );\n\n\t}\n\n\t_setAdditiveIdentityNumeric() {\n\n\t\tconst startIndex = this._addIndex * this.valueSize;\n\t\tconst endIndex = startIndex + this.valueSize;\n\n\t\tfor ( let i = startIndex; i < endIndex; i ++ ) {\n\n\t\t\tthis.buffer[ i ] = 0;\n\n\t\t}\n\n\t}\n\n\t_setAdditiveIdentityQuaternion() {\n\n\t\tthis._setAdditiveIdentityNumeric();\n\t\tthis.buffer[ this._addIndex * this.valueSize + 3 ] = 1;\n\n\t}\n\n\t_setAdditiveIdentityOther() {\n\n\t\tconst startIndex = this._origIndex * this.valueSize;\n\t\tconst targetIndex = this._addIndex * this.valueSize;\n\n\t\tfor ( let i = 0; i < this.valueSize; i ++ ) {\n\n\t\t\tthis.buffer[ targetIndex + i ] = this.buffer[ startIndex + i ];\n\n\t\t}\n\n\t}\n\n\n\t// mix functions\n\n\t_select( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tif ( t >= 0.5 ) {\n\n\t\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tbuffer[ dstOffset + i ] = buffer[ srcOffset + i ];\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_slerp( buffer, dstOffset, srcOffset, t ) {\n\n\t\tQuaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t );\n\n\t}\n\n\t_slerpAdditive( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tconst workOffset = this._workIndex * stride;\n\n\t\t// Store result in intermediate buffer offset\n\t\tQuaternion.multiplyQuaternionsFlat( buffer, workOffset, buffer, dstOffset, buffer, srcOffset );\n\n\t\t// Slerp to the intermediate result\n\t\tQuaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, workOffset, t );\n\n\t}\n\n\t_lerp( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tconst s = 1 - t;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tconst j = dstOffset + i;\n\n\t\t\tbuffer[ j ] = buffer[ j ] * s + buffer[ srcOffset + i ] * t;\n\n\t\t}\n\n\t}\n\n\t_lerpAdditive( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tconst j = dstOffset + i;\n\n\t\t\tbuffer[ j ] = buffer[ j ] + buffer[ srcOffset + i ] * t;\n\n\t\t}\n\n\t}\n\n}\n\n// Characters [].:/ are reserved for track binding syntax.\nconst _RESERVED_CHARS_RE = '\\\\[\\\\]\\\\.:\\\\/';\nconst _reservedRe = new RegExp( '[' + _RESERVED_CHARS_RE + ']', 'g' );\n\n// Attempts to allow node names from any language. ES5's `\\w` regexp matches\n// only latin characters, and the unicode \\p{L} is not yet supported. So\n// instead, we exclude reserved characters and match everything else.\nconst _wordChar = '[^' + _RESERVED_CHARS_RE + ']';\nconst _wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace( '\\\\.', '' ) + ']';\n\n// Parent directories, delimited by '/' or ':'. Currently unused, but must\n// be matched to parse the rest of the track name.\nconst _directoryRe = /*@__PURE__*/ /((?:WC+[\\/:])*)/.source.replace( 'WC', _wordChar );\n\n// Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'.\nconst _nodeRe = /*@__PURE__*/ /(WCOD+)?/.source.replace( 'WCOD', _wordCharOrDot );\n\n// Object on target node, and accessor. May not contain reserved\n// characters. Accessor may contain any character except closing bracket.\nconst _objectRe = /*@__PURE__*/ /(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace( 'WC', _wordChar );\n\n// Property and accessor. May not contain reserved characters. Accessor may\n// contain any non-bracket characters.\nconst _propertyRe = /*@__PURE__*/ /\\.(WC+)(?:\\[(.+)\\])?/.source.replace( 'WC', _wordChar );\n\nconst _trackRe = new RegExp( ''\n\t+ '^'\n\t+ _directoryRe\n\t+ _nodeRe\n\t+ _objectRe\n\t+ _propertyRe\n\t+ '$'\n);\n\nconst _supportedObjectNames = [ 'material', 'materials', 'bones', 'map' ];\n\nclass Composite {\n\n\tconstructor( targetGroup, path, optionalParsedPath ) {\n\n\t\tconst parsedPath = optionalParsedPath || PropertyBinding.parseTrackName( path );\n\n\t\tthis._targetGroup = targetGroup;\n\t\tthis._bindings = targetGroup.subscribe_( path, parsedPath );\n\n\t}\n\n\tgetValue( array, offset ) {\n\n\t\tthis.bind(); // bind all binding\n\n\t\tconst firstValidIndex = this._targetGroup.nCachedObjects_,\n\t\t\tbinding = this._bindings[ firstValidIndex ];\n\n\t\t// and only call .getValue on the first\n\t\tif ( binding !== undefined ) binding.getValue( array, offset );\n\n\t}\n\n\tsetValue( array, offset ) {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].setValue( array, offset );\n\n\t\t}\n\n\t}\n\n\tbind() {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].bind();\n\n\t\t}\n\n\t}\n\n\tunbind() {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].unbind();\n\n\t\t}\n\n\t}\n\n}\n\n// Note: This class uses a State pattern on a per-method basis:\n// 'bind' sets 'this.getValue' / 'setValue' and shadows the\n// prototype version of these methods with one that represents\n// the bound state. When the property is not found, the methods\n// become no-ops.\nclass PropertyBinding {\n\n\tconstructor( rootNode, path, parsedPath ) {\n\n\t\tthis.path = path;\n\t\tthis.parsedPath = parsedPath || PropertyBinding.parseTrackName( path );\n\n\t\tthis.node = PropertyBinding.findNode( rootNode, this.parsedPath.nodeName );\n\n\t\tthis.rootNode = rootNode;\n\n\t\t// initial state of these methods that calls 'bind'\n\t\tthis.getValue = this._getValue_unbound;\n\t\tthis.setValue = this._setValue_unbound;\n\n\t}\n\n\n\tstatic create( root, path, parsedPath ) {\n\n\t\tif ( ! ( root && root.isAnimationObjectGroup ) ) {\n\n\t\t\treturn new PropertyBinding( root, path, parsedPath );\n\n\t\t} else {\n\n\t\t\treturn new PropertyBinding.Composite( root, path, parsedPath );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Replaces spaces with underscores and removes unsupported characters from\n\t * node names, to ensure compatibility with parseTrackName().\n\t *\n\t * @param {string} name Node name to be sanitized.\n\t * @return {string}\n\t */\n\tstatic sanitizeNodeName( name ) {\n\n\t\treturn name.replace( /\\s/g, '_' ).replace( _reservedRe, '' );\n\n\t}\n\n\tstatic parseTrackName( trackName ) {\n\n\t\tconst matches = _trackRe.exec( trackName );\n\n\t\tif ( matches === null ) {\n\n\t\t\tthrow new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName );\n\n\t\t}\n\n\t\tconst results = {\n\t\t\t// directoryName: matches[ 1 ], // (tschw) currently unused\n\t\t\tnodeName: matches[ 2 ],\n\t\t\tobjectName: matches[ 3 ],\n\t\t\tobjectIndex: matches[ 4 ],\n\t\t\tpropertyName: matches[ 5 ], // required\n\t\t\tpropertyIndex: matches[ 6 ]\n\t\t};\n\n\t\tconst lastDot = results.nodeName && results.nodeName.lastIndexOf( '.' );\n\n\t\tif ( lastDot !== undefined && lastDot !== - 1 ) {\n\n\t\t\tconst objectName = results.nodeName.substring( lastDot + 1 );\n\n\t\t\t// Object names must be checked against an allowlist. Otherwise, there\n\t\t\t// is no way to parse 'foo.bar.baz': 'baz' must be a property, but\n\t\t\t// 'bar' could be the objectName, or part of a nodeName (which can\n\t\t\t// include '.' characters).\n\t\t\tif ( _supportedObjectNames.indexOf( objectName ) !== - 1 ) {\n\n\t\t\t\tresults.nodeName = results.nodeName.substring( 0, lastDot );\n\t\t\t\tresults.objectName = objectName;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( results.propertyName === null || results.propertyName.length === 0 ) {\n\n\t\t\tthrow new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName );\n\n\t\t}\n\n\t\treturn results;\n\n\t}\n\n\tstatic findNode( root, nodeName ) {\n\n\t\tif ( nodeName === undefined || nodeName === '' || nodeName === '.' || nodeName === - 1 || nodeName === root.name || nodeName === root.uuid ) {\n\n\t\t\treturn root;\n\n\t\t}\n\n\t\t// search into skeleton bones.\n\t\tif ( root.skeleton ) {\n\n\t\t\tconst bone = root.skeleton.getBoneByName( nodeName );\n\n\t\t\tif ( bone !== undefined ) {\n\n\t\t\t\treturn bone;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// search into node subtree.\n\t\tif ( root.children ) {\n\n\t\t\tconst searchNodeSubtree = function ( children ) {\n\n\t\t\t\tfor ( let i = 0; i < children.length; i ++ ) {\n\n\t\t\t\t\tconst childNode = children[ i ];\n\n\t\t\t\t\tif ( childNode.name === nodeName || childNode.uuid === nodeName ) {\n\n\t\t\t\t\t\treturn childNode;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result = searchNodeSubtree( childNode.children );\n\n\t\t\t\t\tif ( result ) return result;\n\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\n\t\t\t};\n\n\t\t\tconst subTreeNode = searchNodeSubtree( root.children );\n\n\t\t\tif ( subTreeNode ) {\n\n\t\t\t\treturn subTreeNode;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t// these are used to \"bind\" a nonexistent property\n\t_getValue_unavailable() {}\n\t_setValue_unavailable() {}\n\n\t// Getters\n\n\t_getValue_direct( buffer, offset ) {\n\n\t\tbuffer[ offset ] = this.targetObject[ this.propertyName ];\n\n\t}\n\n\t_getValue_array( buffer, offset ) {\n\n\t\tconst source = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = source.length; i !== n; ++ i ) {\n\n\t\t\tbuffer[ offset ++ ] = source[ i ];\n\n\t\t}\n\n\t}\n\n\t_getValue_arrayElement( buffer, offset ) {\n\n\t\tbuffer[ offset ] = this.resolvedProperty[ this.propertyIndex ];\n\n\t}\n\n\t_getValue_toArray( buffer, offset ) {\n\n\t\tthis.resolvedProperty.toArray( buffer, offset );\n\n\t}\n\n\t// Direct\n\n\t_setValue_direct( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\n\t}\n\n\t_setValue_direct_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_direct_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// EntireArray\n\n\t_setValue_array( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t}\n\n\t_setValue_array_setNeedsUpdate( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_array_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// ArrayElement\n\n\t_setValue_arrayElement( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\n\t}\n\n\t_setValue_arrayElement_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_arrayElement_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// HasToFromArray\n\n\t_setValue_fromArray( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\n\t}\n\n\t_setValue_fromArray_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_fromArray_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t_getValue_unbound( targetArray, offset ) {\n\n\t\tthis.bind();\n\t\tthis.getValue( targetArray, offset );\n\n\t}\n\n\t_setValue_unbound( sourceArray, offset ) {\n\n\t\tthis.bind();\n\t\tthis.setValue( sourceArray, offset );\n\n\t}\n\n\t// create getter / setter pair for a property in the scene graph\n\tbind() {\n\n\t\tlet targetObject = this.node;\n\t\tconst parsedPath = this.parsedPath;\n\n\t\tconst objectName = parsedPath.objectName;\n\t\tconst propertyName = parsedPath.propertyName;\n\t\tlet propertyIndex = parsedPath.propertyIndex;\n\n\t\tif ( ! targetObject ) {\n\n\t\t\ttargetObject = PropertyBinding.findNode( this.rootNode, parsedPath.nodeName );\n\n\t\t\tthis.node = targetObject;\n\n\t\t}\n\n\t\t// set fail state so we can just 'return' on error\n\t\tthis.getValue = this._getValue_unavailable;\n\t\tthis.setValue = this._setValue_unavailable;\n\n\t\t// ensure there is a value node\n\t\tif ( ! targetObject ) {\n\n\t\t\tconsole.warn( 'THREE.PropertyBinding: No target node found for track: ' + this.path + '.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( objectName ) {\n\n\t\t\tlet objectIndex = parsedPath.objectIndex;\n\n\t\t\t// special cases were we need to reach deeper into the hierarchy to get the face materials....\n\t\t\tswitch ( objectName ) {\n\n\t\t\t\tcase 'materials':\n\n\t\t\t\t\tif ( ! targetObject.material ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material.materials ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject.material.materials;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'bones':\n\n\t\t\t\t\tif ( ! targetObject.skeleton ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// potential future optimization: skip this if propertyIndex is already an integer\n\t\t\t\t\t// and convert the integer string to a true integer.\n\n\t\t\t\t\ttargetObject = targetObject.skeleton.bones;\n\n\t\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\t\tfor ( let i = 0; i < targetObject.length; i ++ ) {\n\n\t\t\t\t\t\tif ( targetObject[ i ].name === objectIndex ) {\n\n\t\t\t\t\t\t\tobjectIndex = i;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'map':\n\n\t\t\t\t\tif ( 'map' in targetObject ) {\n\n\t\t\t\t\t\ttargetObject = targetObject.map;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material.map ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject.material.map;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tif ( targetObject[ objectName ] === undefined ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to objectName of node undefined.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject[ objectName ];\n\n\t\t\t}\n\n\n\t\t\tif ( objectIndex !== undefined ) {\n\n\t\t\t\tif ( targetObject[ objectIndex ] === undefined ) {\n\n\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\ttargetObject = targetObject[ objectIndex ];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// resolve property\n\t\tconst nodeProperty = targetObject[ propertyName ];\n\n\t\tif ( nodeProperty === undefined ) {\n\n\t\t\tconst nodeName = parsedPath.nodeName;\n\n\t\t\tconsole.error( 'THREE.PropertyBinding: Trying to update property for track: ' + nodeName +\n\t\t\t\t'.' + propertyName + ' but it wasn\\'t found.', targetObject );\n\t\t\treturn;\n\n\t\t}\n\n\t\t// determine versioning scheme\n\t\tlet versioning = this.Versioning.None;\n\n\t\tthis.targetObject = targetObject;\n\n\t\tif ( targetObject.needsUpdate !== undefined ) { // material\n\n\t\t\tversioning = this.Versioning.NeedsUpdate;\n\n\t\t} else if ( targetObject.matrixWorldNeedsUpdate !== undefined ) { // node transform\n\n\t\t\tversioning = this.Versioning.MatrixWorldNeedsUpdate;\n\n\t\t}\n\n\t\t// determine how the property gets bound\n\t\tlet bindingType = this.BindingType.Direct;\n\n\t\tif ( propertyIndex !== undefined ) {\n\n\t\t\t// access a sub element of the property array (only primitives are supported right now)\n\n\t\t\tif ( propertyName === 'morphTargetInfluences' ) {\n\n\t\t\t\t// potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer.\n\n\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\tif ( ! targetObject.geometry ) {\n\n\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! targetObject.geometry.morphAttributes ) {\n\n\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tif ( targetObject.morphTargetDictionary[ propertyIndex ] !== undefined ) {\n\n\t\t\t\t\tpropertyIndex = targetObject.morphTargetDictionary[ propertyIndex ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbindingType = this.BindingType.ArrayElement;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\t\t\tthis.propertyIndex = propertyIndex;\n\n\t\t} else if ( nodeProperty.fromArray !== undefined && nodeProperty.toArray !== undefined ) {\n\n\t\t\t// must use copy for Object3D.Euler/Quaternion\n\n\t\t\tbindingType = this.BindingType.HasFromToArray;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\n\t\t} else if ( Array.isArray( nodeProperty ) ) {\n\n\t\t\tbindingType = this.BindingType.EntireArray;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\n\t\t} else {\n\n\t\t\tthis.propertyName = propertyName;\n\n\t\t}\n\n\t\t// select getter / setter\n\t\tthis.getValue = this.GetterByBindingType[ bindingType ];\n\t\tthis.setValue = this.SetterByBindingTypeAndVersioning[ bindingType ][ versioning ];\n\n\t}\n\n\tunbind() {\n\n\t\tthis.node = null;\n\n\t\t// back to the prototype version of getValue / setValue\n\t\t// note: avoiding to mutate the shape of 'this' via 'delete'\n\t\tthis.getValue = this._getValue_unbound;\n\t\tthis.setValue = this._setValue_unbound;\n\n\t}\n\n}\n\nPropertyBinding.Composite = Composite;\n\nPropertyBinding.prototype.BindingType = {\n\tDirect: 0,\n\tEntireArray: 1,\n\tArrayElement: 2,\n\tHasFromToArray: 3\n};\n\nPropertyBinding.prototype.Versioning = {\n\tNone: 0,\n\tNeedsUpdate: 1,\n\tMatrixWorldNeedsUpdate: 2\n};\n\nPropertyBinding.prototype.GetterByBindingType = [\n\n\tPropertyBinding.prototype._getValue_direct,\n\tPropertyBinding.prototype._getValue_array,\n\tPropertyBinding.prototype._getValue_arrayElement,\n\tPropertyBinding.prototype._getValue_toArray,\n\n];\n\nPropertyBinding.prototype.SetterByBindingTypeAndVersioning = [\n\n\t[\n\t\t// Direct\n\t\tPropertyBinding.prototype._setValue_direct,\n\t\tPropertyBinding.prototype._setValue_direct_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// EntireArray\n\n\t\tPropertyBinding.prototype._setValue_array,\n\t\tPropertyBinding.prototype._setValue_array_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// ArrayElement\n\t\tPropertyBinding.prototype._setValue_arrayElement,\n\t\tPropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// HasToFromArray\n\t\tPropertyBinding.prototype._setValue_fromArray,\n\t\tPropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate,\n\n\t]\n\n];\n\n/**\n *\n * A group of objects that receives a shared animation state.\n *\n * Usage:\n *\n * - Add objects you would otherwise pass as 'root' to the\n * constructor or the .clipAction method of AnimationMixer.\n *\n * - Instead pass this object as 'root'.\n *\n * - You can also add and remove objects later when the mixer\n * is running.\n *\n * Note:\n *\n * Objects of this class appear as one object to the mixer,\n * so cache control of the individual objects must be done\n * on the group.\n *\n * Limitation:\n *\n * - The animated properties must be compatible among the\n * all objects in the group.\n *\n * - A single property can either be controlled through a\n * target group or directly, but not both.\n */\n\nclass AnimationObjectGroup {\n\n\tconstructor() {\n\n\t\tthis.isAnimationObjectGroup = true;\n\n\t\tthis.uuid = generateUUID();\n\n\t\t// cached objects followed by the active ones\n\t\tthis._objects = Array.prototype.slice.call( arguments );\n\n\t\tthis.nCachedObjects_ = 0; // threshold\n\t\t// note: read by PropertyBinding.Composite\n\n\t\tconst indices = {};\n\t\tthis._indicesByUUID = indices; // for bookkeeping\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tindices[ arguments[ i ].uuid ] = i;\n\n\t\t}\n\n\t\tthis._paths = []; // inside: string\n\t\tthis._parsedPaths = []; // inside: { we don't care, here }\n\t\tthis._bindings = []; // inside: Array< PropertyBinding >\n\t\tthis._bindingsIndicesByPath = {}; // inside: indices in these arrays\n\n\t\tconst scope = this;\n\n\t\tthis.stats = {\n\n\t\t\tobjects: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._objects.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn this.total - scope.nCachedObjects_;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tget bindingsPerObject() {\n\n\t\t\t\treturn scope._bindings.length;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tadd() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tpaths = this._paths,\n\t\t\tparsedPaths = this._parsedPaths,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet knownObject = undefined,\n\t\t\tnObjects = objects.length,\n\t\t\tnCachedObjects = this.nCachedObjects_;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid;\n\t\t\tlet index = indicesByUUID[ uuid ];\n\n\t\t\tif ( index === undefined ) {\n\n\t\t\t\t// unknown object -> add it to the ACTIVE region\n\n\t\t\t\tindex = nObjects ++;\n\t\t\t\tindicesByUUID[ uuid ] = index;\n\t\t\t\tobjects.push( object );\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tbindings[ j ].push( new PropertyBinding( object, paths[ j ], parsedPaths[ j ] ) );\n\n\t\t\t\t}\n\n\t\t\t} else if ( index < nCachedObjects ) {\n\n\t\t\t\tknownObject = objects[ index ];\n\n\t\t\t\t// move existing object to the ACTIVE region\n\n\t\t\t\tconst firstActiveIndex = -- nCachedObjects,\n\t\t\t\t\tlastCachedObject = objects[ firstActiveIndex ];\n\n\t\t\t\tindicesByUUID[ lastCachedObject.uuid ] = index;\n\t\t\t\tobjects[ index ] = lastCachedObject;\n\n\t\t\t\tindicesByUUID[ uuid ] = firstActiveIndex;\n\t\t\t\tobjects[ firstActiveIndex ] = object;\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\tlastCached = bindingsForPath[ firstActiveIndex ];\n\n\t\t\t\t\tlet binding = bindingsForPath[ index ];\n\n\t\t\t\t\tbindingsForPath[ index ] = lastCached;\n\n\t\t\t\t\tif ( binding === undefined ) {\n\n\t\t\t\t\t\t// since we do not bother to create new bindings\n\t\t\t\t\t\t// for objects that are cached, the binding may\n\t\t\t\t\t\t// or may not exist\n\n\t\t\t\t\t\tbinding = new PropertyBinding( object, paths[ j ], parsedPaths[ j ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbindingsForPath[ firstActiveIndex ] = binding;\n\n\t\t\t\t}\n\n\t\t\t} else if ( objects[ index ] !== knownObject ) {\n\n\t\t\t\tconsole.error( 'THREE.AnimationObjectGroup: Different objects with the same UUID ' +\n\t\t\t\t\t'detected. Clean the caches or recreate your infrastructure when reloading scenes.' );\n\n\t\t\t} // else the object is already where we want it to be\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\tremove() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet nCachedObjects = this.nCachedObjects_;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid,\n\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\tif ( index !== undefined && index >= nCachedObjects ) {\n\n\t\t\t\t// move existing object into the CACHED region\n\n\t\t\t\tconst lastCachedIndex = nCachedObjects ++,\n\t\t\t\t\tfirstActiveObject = objects[ lastCachedIndex ];\n\n\t\t\t\tindicesByUUID[ firstActiveObject.uuid ] = index;\n\t\t\t\tobjects[ index ] = firstActiveObject;\n\n\t\t\t\tindicesByUUID[ uuid ] = lastCachedIndex;\n\t\t\t\tobjects[ lastCachedIndex ] = object;\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\tfirstActive = bindingsForPath[ lastCachedIndex ],\n\t\t\t\t\t\tbinding = bindingsForPath[ index ];\n\n\t\t\t\t\tbindingsForPath[ index ] = firstActive;\n\t\t\t\t\tbindingsForPath[ lastCachedIndex ] = binding;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\t// remove & forget\n\tuncache() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet nCachedObjects = this.nCachedObjects_,\n\t\t\tnObjects = objects.length;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid,\n\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\tif ( index !== undefined ) {\n\n\t\t\t\tdelete indicesByUUID[ uuid ];\n\n\t\t\t\tif ( index < nCachedObjects ) {\n\n\t\t\t\t\t// object is cached, shrink the CACHED region\n\n\t\t\t\t\tconst firstActiveIndex = -- nCachedObjects,\n\t\t\t\t\t\tlastCachedObject = objects[ firstActiveIndex ],\n\t\t\t\t\t\tlastIndex = -- nObjects,\n\t\t\t\t\t\tlastObject = objects[ lastIndex ];\n\n\t\t\t\t\t// last cached object takes this object's place\n\t\t\t\t\tindicesByUUID[ lastCachedObject.uuid ] = index;\n\t\t\t\t\tobjects[ index ] = lastCachedObject;\n\n\t\t\t\t\t// last object goes to the activated slot and pop\n\t\t\t\t\tindicesByUUID[ lastObject.uuid ] = firstActiveIndex;\n\t\t\t\t\tobjects[ firstActiveIndex ] = lastObject;\n\t\t\t\t\tobjects.pop();\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\t\tlastCached = bindingsForPath[ firstActiveIndex ],\n\t\t\t\t\t\t\tlast = bindingsForPath[ lastIndex ];\n\n\t\t\t\t\t\tbindingsForPath[ index ] = lastCached;\n\t\t\t\t\t\tbindingsForPath[ firstActiveIndex ] = last;\n\t\t\t\t\t\tbindingsForPath.pop();\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// object is active, just swap with the last and pop\n\n\t\t\t\t\tconst lastIndex = -- nObjects,\n\t\t\t\t\t\tlastObject = objects[ lastIndex ];\n\n\t\t\t\t\tif ( lastIndex > 0 ) {\n\n\t\t\t\t\t\tindicesByUUID[ lastObject.uuid ] = index;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tobjects[ index ] = lastObject;\n\t\t\t\t\tobjects.pop();\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tconst bindingsForPath = bindings[ j ];\n\n\t\t\t\t\t\tbindingsForPath[ index ] = bindingsForPath[ lastIndex ];\n\t\t\t\t\t\tbindingsForPath.pop();\n\n\t\t\t\t\t}\n\n\t\t\t\t} // cached or active\n\n\t\t\t} // if object is known\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\t// Internal interface used by befriended PropertyBinding.Composite:\n\n\tsubscribe_( path, parsedPath ) {\n\n\t\t// returns an array of bindings for the given path that is changed\n\t\t// according to the contained objects in the group\n\n\t\tconst indicesByPath = this._bindingsIndicesByPath;\n\t\tlet index = indicesByPath[ path ];\n\t\tconst bindings = this._bindings;\n\n\t\tif ( index !== undefined ) return bindings[ index ];\n\n\t\tconst paths = this._paths,\n\t\t\tparsedPaths = this._parsedPaths,\n\t\t\tobjects = this._objects,\n\t\t\tnObjects = objects.length,\n\t\t\tnCachedObjects = this.nCachedObjects_,\n\t\t\tbindingsForPath = new Array( nObjects );\n\n\t\tindex = bindings.length;\n\n\t\tindicesByPath[ path ] = index;\n\n\t\tpaths.push( path );\n\t\tparsedPaths.push( parsedPath );\n\t\tbindings.push( bindingsForPath );\n\n\t\tfor ( let i = nCachedObjects, n = objects.length; i !== n; ++ i ) {\n\n\t\t\tconst object = objects[ i ];\n\t\t\tbindingsForPath[ i ] = new PropertyBinding( object, path, parsedPath );\n\n\t\t}\n\n\t\treturn bindingsForPath;\n\n\t}\n\n\tunsubscribe_( path ) {\n\n\t\t// tells the group to forget about a property path and no longer\n\t\t// update the array previously obtained with 'subscribe_'\n\n\t\tconst indicesByPath = this._bindingsIndicesByPath,\n\t\t\tindex = indicesByPath[ path ];\n\n\t\tif ( index !== undefined ) {\n\n\t\t\tconst paths = this._paths,\n\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\tbindings = this._bindings,\n\t\t\t\tlastBindingsIndex = bindings.length - 1,\n\t\t\t\tlastBindings = bindings[ lastBindingsIndex ],\n\t\t\t\tlastBindingsPath = path[ lastBindingsIndex ];\n\n\t\t\tindicesByPath[ lastBindingsPath ] = index;\n\n\t\t\tbindings[ index ] = lastBindings;\n\t\t\tbindings.pop();\n\n\t\t\tparsedPaths[ index ] = parsedPaths[ lastBindingsIndex ];\n\t\t\tparsedPaths.pop();\n\n\t\t\tpaths[ index ] = paths[ lastBindingsIndex ];\n\t\t\tpaths.pop();\n\n\t\t}\n\n\t}\n\n}\n\nclass AnimationAction {\n\n\tconstructor( mixer, clip, localRoot = null, blendMode = clip.blendMode ) {\n\n\t\tthis._mixer = mixer;\n\t\tthis._clip = clip;\n\t\tthis._localRoot = localRoot;\n\t\tthis.blendMode = blendMode;\n\n\t\tconst tracks = clip.tracks,\n\t\t\tnTracks = tracks.length,\n\t\t\tinterpolants = new Array( nTracks );\n\n\t\tconst interpolantSettings = {\n\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\tendingEnd: ZeroCurvatureEnding\n\t\t};\n\n\t\tfor ( let i = 0; i !== nTracks; ++ i ) {\n\n\t\t\tconst interpolant = tracks[ i ].createInterpolant( null );\n\t\t\tinterpolants[ i ] = interpolant;\n\t\t\tinterpolant.settings = interpolantSettings;\n\n\t\t}\n\n\t\tthis._interpolantSettings = interpolantSettings;\n\n\t\tthis._interpolants = interpolants; // bound by the mixer\n\n\t\t// inside: PropertyMixer (managed by the mixer)\n\t\tthis._propertyBindings = new Array( nTracks );\n\n\t\tthis._cacheIndex = null; // for the memory manager\n\t\tthis._byClipCacheIndex = null; // for the memory manager\n\n\t\tthis._timeScaleInterpolant = null;\n\t\tthis._weightInterpolant = null;\n\n\t\tthis.loop = LoopRepeat;\n\t\tthis._loopCount = - 1;\n\n\t\t// global mixer time when the action is to be started\n\t\t// it's set back to 'null' upon start of the action\n\t\tthis._startTime = null;\n\n\t\t// scaled local time of the action\n\t\t// gets clamped or wrapped to 0..clip.duration according to loop\n\t\tthis.time = 0;\n\n\t\tthis.timeScale = 1;\n\t\tthis._effectiveTimeScale = 1;\n\n\t\tthis.weight = 1;\n\t\tthis._effectiveWeight = 1;\n\n\t\tthis.repetitions = Infinity; // no. of repetitions when looping\n\n\t\tthis.paused = false; // true -> zero effective time scale\n\t\tthis.enabled = true; // false -> zero effective weight\n\n\t\tthis.clampWhenFinished = false;// keep feeding the last frame?\n\n\t\tthis.zeroSlopeAtStart = true;// for smooth interpolation w/o separate\n\t\tthis.zeroSlopeAtEnd = true;// clips for start, loop and end\n\n\t}\n\n\t// State & Scheduling\n\n\tplay() {\n\n\t\tthis._mixer._activateAction( this );\n\n\t\treturn this;\n\n\t}\n\n\tstop() {\n\n\t\tthis._mixer._deactivateAction( this );\n\n\t\treturn this.reset();\n\n\t}\n\n\treset() {\n\n\t\tthis.paused = false;\n\t\tthis.enabled = true;\n\n\t\tthis.time = 0; // restart clip\n\t\tthis._loopCount = - 1;// forget previous loops\n\t\tthis._startTime = null;// forget scheduling\n\n\t\treturn this.stopFading().stopWarping();\n\n\t}\n\n\tisRunning() {\n\n\t\treturn this.enabled && ! this.paused && this.timeScale !== 0 &&\n\t\t\tthis._startTime === null && this._mixer._isActiveAction( this );\n\n\t}\n\n\t// return true when play has been called\n\tisScheduled() {\n\n\t\treturn this._mixer._isActiveAction( this );\n\n\t}\n\n\tstartAt( time ) {\n\n\t\tthis._startTime = time;\n\n\t\treturn this;\n\n\t}\n\n\tsetLoop( mode, repetitions ) {\n\n\t\tthis.loop = mode;\n\t\tthis.repetitions = repetitions;\n\n\t\treturn this;\n\n\t}\n\n\t// Weight\n\n\t// set the weight stopping any scheduled fading\n\t// although .enabled = false yields an effective weight of zero, this\n\t// method does *not* change .enabled, because it would be confusing\n\tsetEffectiveWeight( weight ) {\n\n\t\tthis.weight = weight;\n\n\t\t// note: same logic as when updated at runtime\n\t\tthis._effectiveWeight = this.enabled ? weight : 0;\n\n\t\treturn this.stopFading();\n\n\t}\n\n\t// return the weight considering fading and .enabled\n\tgetEffectiveWeight() {\n\n\t\treturn this._effectiveWeight;\n\n\t}\n\n\tfadeIn( duration ) {\n\n\t\treturn this._scheduleFading( duration, 0, 1 );\n\n\t}\n\n\tfadeOut( duration ) {\n\n\t\treturn this._scheduleFading( duration, 1, 0 );\n\n\t}\n\n\tcrossFadeFrom( fadeOutAction, duration, warp ) {\n\n\t\tfadeOutAction.fadeOut( duration );\n\t\tthis.fadeIn( duration );\n\n\t\tif ( warp ) {\n\n\t\t\tconst fadeInDuration = this._clip.duration,\n\t\t\t\tfadeOutDuration = fadeOutAction._clip.duration,\n\n\t\t\t\tstartEndRatio = fadeOutDuration / fadeInDuration,\n\t\t\t\tendStartRatio = fadeInDuration / fadeOutDuration;\n\n\t\t\tfadeOutAction.warp( 1.0, startEndRatio, duration );\n\t\t\tthis.warp( endStartRatio, 1.0, duration );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tcrossFadeTo( fadeInAction, duration, warp ) {\n\n\t\treturn fadeInAction.crossFadeFrom( this, duration, warp );\n\n\t}\n\n\tstopFading() {\n\n\t\tconst weightInterpolant = this._weightInterpolant;\n\n\t\tif ( weightInterpolant !== null ) {\n\n\t\t\tthis._weightInterpolant = null;\n\t\t\tthis._mixer._takeBackControlInterpolant( weightInterpolant );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// Time Scale Control\n\n\t// set the time scale stopping any scheduled warping\n\t// although .paused = true yields an effective time scale of zero, this\n\t// method does *not* change .paused, because it would be confusing\n\tsetEffectiveTimeScale( timeScale ) {\n\n\t\tthis.timeScale = timeScale;\n\t\tthis._effectiveTimeScale = this.paused ? 0 : timeScale;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\t// return the time scale considering warping and .paused\n\tgetEffectiveTimeScale() {\n\n\t\treturn this._effectiveTimeScale;\n\n\t}\n\n\tsetDuration( duration ) {\n\n\t\tthis.timeScale = this._clip.duration / duration;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\tsyncWith( action ) {\n\n\t\tthis.time = action.time;\n\t\tthis.timeScale = action.timeScale;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\thalt( duration ) {\n\n\t\treturn this.warp( this._effectiveTimeScale, 0, duration );\n\n\t}\n\n\twarp( startTimeScale, endTimeScale, duration ) {\n\n\t\tconst mixer = this._mixer,\n\t\t\tnow = mixer.time,\n\t\t\ttimeScale = this.timeScale;\n\n\t\tlet interpolant = this._timeScaleInterpolant;\n\n\t\tif ( interpolant === null ) {\n\n\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\tthis._timeScaleInterpolant = interpolant;\n\n\t\t}\n\n\t\tconst times = interpolant.parameterPositions,\n\t\t\tvalues = interpolant.sampleValues;\n\n\t\ttimes[ 0 ] = now;\n\t\ttimes[ 1 ] = now + duration;\n\n\t\tvalues[ 0 ] = startTimeScale / timeScale;\n\t\tvalues[ 1 ] = endTimeScale / timeScale;\n\n\t\treturn this;\n\n\t}\n\n\tstopWarping() {\n\n\t\tconst timeScaleInterpolant = this._timeScaleInterpolant;\n\n\t\tif ( timeScaleInterpolant !== null ) {\n\n\t\t\tthis._timeScaleInterpolant = null;\n\t\t\tthis._mixer._takeBackControlInterpolant( timeScaleInterpolant );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// Object Accessors\n\n\tgetMixer() {\n\n\t\treturn this._mixer;\n\n\t}\n\n\tgetClip() {\n\n\t\treturn this._clip;\n\n\t}\n\n\tgetRoot() {\n\n\t\treturn this._localRoot || this._mixer._root;\n\n\t}\n\n\t// Interna\n\n\t_update( time, deltaTime, timeDirection, accuIndex ) {\n\n\t\t// called by the mixer\n\n\t\tif ( ! this.enabled ) {\n\n\t\t\t// call ._updateWeight() to update ._effectiveWeight\n\n\t\t\tthis._updateWeight( time );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst startTime = this._startTime;\n\n\t\tif ( startTime !== null ) {\n\n\t\t\t// check for scheduled start of action\n\n\t\t\tconst timeRunning = ( time - startTime ) * timeDirection;\n\t\t\tif ( timeRunning < 0 || timeDirection === 0 ) {\n\n\t\t\t\tdeltaTime = 0;\n\n\t\t\t} else {\n\n\n\t\t\t\tthis._startTime = null; // unschedule\n\t\t\t\tdeltaTime = timeDirection * timeRunning;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// apply time scale and advance time\n\n\t\tdeltaTime *= this._updateTimeScale( time );\n\t\tconst clipTime = this._updateTime( deltaTime );\n\n\t\t// note: _updateTime may disable the action resulting in\n\t\t// an effective weight of 0\n\n\t\tconst weight = this._updateWeight( time );\n\n\t\tif ( weight > 0 ) {\n\n\t\t\tconst interpolants = this._interpolants;\n\t\t\tconst propertyMixers = this._propertyBindings;\n\n\t\t\tswitch ( this.blendMode ) {\n\n\t\t\t\tcase AdditiveAnimationBlendMode:\n\n\t\t\t\t\tfor ( let j = 0, m = interpolants.length; j !== m; ++ j ) {\n\n\t\t\t\t\t\tinterpolants[ j ].evaluate( clipTime );\n\t\t\t\t\t\tpropertyMixers[ j ].accumulateAdditive( weight );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase NormalAnimationBlendMode:\n\t\t\t\tdefault:\n\n\t\t\t\t\tfor ( let j = 0, m = interpolants.length; j !== m; ++ j ) {\n\n\t\t\t\t\t\tinterpolants[ j ].evaluate( clipTime );\n\t\t\t\t\t\tpropertyMixers[ j ].accumulate( accuIndex, weight );\n\n\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_updateWeight( time ) {\n\n\t\tlet weight = 0;\n\n\t\tif ( this.enabled ) {\n\n\t\t\tweight = this.weight;\n\t\t\tconst interpolant = this._weightInterpolant;\n\n\t\t\tif ( interpolant !== null ) {\n\n\t\t\t\tconst interpolantValue = interpolant.evaluate( time )[ 0 ];\n\n\t\t\t\tweight *= interpolantValue;\n\n\t\t\t\tif ( time > interpolant.parameterPositions[ 1 ] ) {\n\n\t\t\t\t\tthis.stopFading();\n\n\t\t\t\t\tif ( interpolantValue === 0 ) {\n\n\t\t\t\t\t\t// faded out, disable\n\t\t\t\t\t\tthis.enabled = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._effectiveWeight = weight;\n\t\treturn weight;\n\n\t}\n\n\t_updateTimeScale( time ) {\n\n\t\tlet timeScale = 0;\n\n\t\tif ( ! this.paused ) {\n\n\t\t\ttimeScale = this.timeScale;\n\n\t\t\tconst interpolant = this._timeScaleInterpolant;\n\n\t\t\tif ( interpolant !== null ) {\n\n\t\t\t\tconst interpolantValue = interpolant.evaluate( time )[ 0 ];\n\n\t\t\t\ttimeScale *= interpolantValue;\n\n\t\t\t\tif ( time > interpolant.parameterPositions[ 1 ] ) {\n\n\t\t\t\t\tthis.stopWarping();\n\n\t\t\t\t\tif ( timeScale === 0 ) {\n\n\t\t\t\t\t\t// motion has halted, pause\n\t\t\t\t\t\tthis.paused = true;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// warp done - apply final time scale\n\t\t\t\t\t\tthis.timeScale = timeScale;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._effectiveTimeScale = timeScale;\n\t\treturn timeScale;\n\n\t}\n\n\t_updateTime( deltaTime ) {\n\n\t\tconst duration = this._clip.duration;\n\t\tconst loop = this.loop;\n\n\t\tlet time = this.time + deltaTime;\n\t\tlet loopCount = this._loopCount;\n\n\t\tconst pingPong = ( loop === LoopPingPong );\n\n\t\tif ( deltaTime === 0 ) {\n\n\t\t\tif ( loopCount === - 1 ) return time;\n\n\t\t\treturn ( pingPong && ( loopCount & 1 ) === 1 ) ? duration - time : time;\n\n\t\t}\n\n\t\tif ( loop === LoopOnce ) {\n\n\t\t\tif ( loopCount === - 1 ) {\n\n\t\t\t\t// just started\n\n\t\t\t\tthis._loopCount = 0;\n\t\t\t\tthis._setEndings( true, true, false );\n\n\t\t\t}\n\n\t\t\thandle_stop: {\n\n\t\t\t\tif ( time >= duration ) {\n\n\t\t\t\t\ttime = duration;\n\n\t\t\t\t} else if ( time < 0 ) {\n\n\t\t\t\t\ttime = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tbreak handle_stop;\n\n\t\t\t\t}\n\n\t\t\t\tif ( this.clampWhenFinished ) this.paused = true;\n\t\t\t\telse this.enabled = false;\n\n\t\t\t\tthis.time = time;\n\n\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\ttype: 'finished', action: this,\n\t\t\t\t\tdirection: deltaTime < 0 ? - 1 : 1\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t} else { // repetitive Repeat or PingPong\n\n\t\t\tif ( loopCount === - 1 ) {\n\n\t\t\t\t// just started\n\n\t\t\t\tif ( deltaTime >= 0 ) {\n\n\t\t\t\t\tloopCount = 0;\n\n\t\t\t\t\tthis._setEndings( true, this.repetitions === 0, pingPong );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// when looping in reverse direction, the initial\n\t\t\t\t\t// transition through zero counts as a repetition,\n\t\t\t\t\t// so leave loopCount at -1\n\n\t\t\t\t\tthis._setEndings( this.repetitions === 0, true, pingPong );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( time >= duration || time < 0 ) {\n\n\t\t\t\t// wrap around\n\n\t\t\t\tconst loopDelta = Math.floor( time / duration ); // signed\n\t\t\t\ttime -= duration * loopDelta;\n\n\t\t\t\tloopCount += Math.abs( loopDelta );\n\n\t\t\t\tconst pending = this.repetitions - loopCount;\n\n\t\t\t\tif ( pending <= 0 ) {\n\n\t\t\t\t\t// have to stop (switch state, clamp time, fire event)\n\n\t\t\t\t\tif ( this.clampWhenFinished ) this.paused = true;\n\t\t\t\t\telse this.enabled = false;\n\n\t\t\t\t\ttime = deltaTime > 0 ? duration : 0;\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\ttype: 'finished', action: this,\n\t\t\t\t\t\tdirection: deltaTime > 0 ? 1 : - 1\n\t\t\t\t\t} );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// keep running\n\n\t\t\t\t\tif ( pending === 1 ) {\n\n\t\t\t\t\t\t// entering the last round\n\n\t\t\t\t\t\tconst atStart = deltaTime < 0;\n\t\t\t\t\t\tthis._setEndings( atStart, ! atStart, pingPong );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis._setEndings( false, false, pingPong );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._loopCount = loopCount;\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\ttype: 'loop', action: this, loopDelta: loopDelta\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tthis.time = time;\n\n\t\t\t}\n\n\t\t\tif ( pingPong && ( loopCount & 1 ) === 1 ) {\n\n\t\t\t\t// invert time for the \"pong round\"\n\n\t\t\t\treturn duration - time;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn time;\n\n\t}\n\n\t_setEndings( atStart, atEnd, pingPong ) {\n\n\t\tconst settings = this._interpolantSettings;\n\n\t\tif ( pingPong ) {\n\n\t\t\tsettings.endingStart = ZeroSlopeEnding;\n\t\t\tsettings.endingEnd = ZeroSlopeEnding;\n\n\t\t} else {\n\n\t\t\t// assuming for LoopOnce atStart == atEnd == true\n\n\t\t\tif ( atStart ) {\n\n\t\t\t\tsettings.endingStart = this.zeroSlopeAtStart ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\n\t\t\t} else {\n\n\t\t\t\tsettings.endingStart = WrapAroundEnding;\n\n\t\t\t}\n\n\t\t\tif ( atEnd ) {\n\n\t\t\t\tsettings.endingEnd = this.zeroSlopeAtEnd ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\n\t\t\t} else {\n\n\t\t\t\tsettings.endingEnd \t = WrapAroundEnding;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_scheduleFading( duration, weightNow, weightThen ) {\n\n\t\tconst mixer = this._mixer, now = mixer.time;\n\t\tlet interpolant = this._weightInterpolant;\n\n\t\tif ( interpolant === null ) {\n\n\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\tthis._weightInterpolant = interpolant;\n\n\t\t}\n\n\t\tconst times = interpolant.parameterPositions,\n\t\t\tvalues = interpolant.sampleValues;\n\n\t\ttimes[ 0 ] = now;\n\t\tvalues[ 0 ] = weightNow;\n\t\ttimes[ 1 ] = now + duration;\n\t\tvalues[ 1 ] = weightThen;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _controlInterpolantsResultBuffer = new Float32Array( 1 );\n\n\nclass AnimationMixer extends EventDispatcher {\n\n\tconstructor( root ) {\n\n\t\tsuper();\n\n\t\tthis._root = root;\n\t\tthis._initMemoryManager();\n\t\tthis._accuIndex = 0;\n\t\tthis.time = 0;\n\t\tthis.timeScale = 1.0;\n\n\t}\n\n\t_bindAction( action, prototypeAction ) {\n\n\t\tconst root = action._localRoot || this._root,\n\t\t\ttracks = action._clip.tracks,\n\t\t\tnTracks = tracks.length,\n\t\t\tbindings = action._propertyBindings,\n\t\t\tinterpolants = action._interpolants,\n\t\t\trootUuid = root.uuid,\n\t\t\tbindingsByRoot = this._bindingsByRootAndName;\n\n\t\tlet bindingsByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingsByName === undefined ) {\n\n\t\t\tbindingsByName = {};\n\t\t\tbindingsByRoot[ rootUuid ] = bindingsByName;\n\n\t\t}\n\n\t\tfor ( let i = 0; i !== nTracks; ++ i ) {\n\n\t\t\tconst track = tracks[ i ],\n\t\t\t\ttrackName = track.name;\n\n\t\t\tlet binding = bindingsByName[ trackName ];\n\n\t\t\tif ( binding !== undefined ) {\n\n\t\t\t\t++ binding.referenceCount;\n\t\t\t\tbindings[ i ] = binding;\n\n\t\t\t} else {\n\n\t\t\t\tbinding = bindings[ i ];\n\n\t\t\t\tif ( binding !== undefined ) {\n\n\t\t\t\t\t// existing binding, make sure the cache knows\n\n\t\t\t\t\tif ( binding._cacheIndex === null ) {\n\n\t\t\t\t\t\t++ binding.referenceCount;\n\t\t\t\t\t\tthis._addInactiveBinding( binding, rootUuid, trackName );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\tconst path = prototypeAction && prototypeAction.\n\t\t\t\t\t_propertyBindings[ i ].binding.parsedPath;\n\n\t\t\t\tbinding = new PropertyMixer(\n\t\t\t\t\tPropertyBinding.create( root, trackName, path ),\n\t\t\t\t\ttrack.ValueTypeName, track.getValueSize() );\n\n\t\t\t\t++ binding.referenceCount;\n\t\t\t\tthis._addInactiveBinding( binding, rootUuid, trackName );\n\n\t\t\t\tbindings[ i ] = binding;\n\n\t\t\t}\n\n\t\t\tinterpolants[ i ].resultBuffer = binding.buffer;\n\n\t\t}\n\n\t}\n\n\t_activateAction( action ) {\n\n\t\tif ( ! this._isActiveAction( action ) ) {\n\n\t\t\tif ( action._cacheIndex === null ) {\n\n\t\t\t\t// this action has been forgotten by the cache, but the user\n\t\t\t\t// appears to be still using it -> rebind\n\n\t\t\t\tconst rootUuid = ( action._localRoot || this._root ).uuid,\n\t\t\t\t\tclipUuid = action._clip.uuid,\n\t\t\t\t\tactionsForClip = this._actionsByClip[ clipUuid ];\n\n\t\t\t\tthis._bindAction( action,\n\t\t\t\t\tactionsForClip && actionsForClip.knownActions[ 0 ] );\n\n\t\t\t\tthis._addInactiveAction( action, clipUuid, rootUuid );\n\n\t\t\t}\n\n\t\t\tconst bindings = action._propertyBindings;\n\n\t\t\t// increment reference counts / sort out state\n\t\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tconst binding = bindings[ i ];\n\n\t\t\t\tif ( binding.useCount ++ === 0 ) {\n\n\t\t\t\t\tthis._lendBinding( binding );\n\t\t\t\t\tbinding.saveOriginalState();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._lendAction( action );\n\n\t\t}\n\n\t}\n\n\t_deactivateAction( action ) {\n\n\t\tif ( this._isActiveAction( action ) ) {\n\n\t\t\tconst bindings = action._propertyBindings;\n\n\t\t\t// decrement reference counts / sort out state\n\t\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tconst binding = bindings[ i ];\n\n\t\t\t\tif ( -- binding.useCount === 0 ) {\n\n\t\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\t\tthis._takeBackBinding( binding );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._takeBackAction( action );\n\n\t\t}\n\n\t}\n\n\t// Memory manager\n\n\t_initMemoryManager() {\n\n\t\tthis._actions = []; // 'nActiveActions' followed by inactive ones\n\t\tthis._nActiveActions = 0;\n\n\t\tthis._actionsByClip = {};\n\t\t// inside:\n\t\t// {\n\t\t// \tknownActions: Array< AnimationAction > - used as prototypes\n\t\t// \tactionByRoot: AnimationAction - lookup\n\t\t// }\n\n\n\t\tthis._bindings = []; // 'nActiveBindings' followed by inactive ones\n\t\tthis._nActiveBindings = 0;\n\n\t\tthis._bindingsByRootAndName = {}; // inside: Map< name, PropertyMixer >\n\n\n\t\tthis._controlInterpolants = []; // same game as above\n\t\tthis._nActiveControlInterpolants = 0;\n\n\t\tconst scope = this;\n\n\t\tthis.stats = {\n\n\t\t\tactions: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._actions.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveActions;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tbindings: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._bindings.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveBindings;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tcontrolInterpolants: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._controlInterpolants.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveControlInterpolants;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t// Memory management for AnimationAction objects\n\n\t_isActiveAction( action ) {\n\n\t\tconst index = action._cacheIndex;\n\t\treturn index !== null && index < this._nActiveActions;\n\n\t}\n\n\t_addInactiveAction( action, clipUuid, rootUuid ) {\n\n\t\tconst actions = this._actions,\n\t\t\tactionsByClip = this._actionsByClip;\n\n\t\tlet actionsForClip = actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip === undefined ) {\n\n\t\t\tactionsForClip = {\n\n\t\t\t\tknownActions: [ action ],\n\t\t\t\tactionByRoot: {}\n\n\t\t\t};\n\n\t\t\taction._byClipCacheIndex = 0;\n\n\t\t\tactionsByClip[ clipUuid ] = actionsForClip;\n\n\t\t} else {\n\n\t\t\tconst knownActions = actionsForClip.knownActions;\n\n\t\t\taction._byClipCacheIndex = knownActions.length;\n\t\t\tknownActions.push( action );\n\n\t\t}\n\n\t\taction._cacheIndex = actions.length;\n\t\tactions.push( action );\n\n\t\tactionsForClip.actionByRoot[ rootUuid ] = action;\n\n\t}\n\n\t_removeInactiveAction( action ) {\n\n\t\tconst actions = this._actions,\n\t\t\tlastInactiveAction = actions[ actions.length - 1 ],\n\t\t\tcacheIndex = action._cacheIndex;\n\n\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\tactions[ cacheIndex ] = lastInactiveAction;\n\t\tactions.pop();\n\n\t\taction._cacheIndex = null;\n\n\n\t\tconst clipUuid = action._clip.uuid,\n\t\t\tactionsByClip = this._actionsByClip,\n\t\t\tactionsForClip = actionsByClip[ clipUuid ],\n\t\t\tknownActionsForClip = actionsForClip.knownActions,\n\n\t\t\tlastKnownAction =\n\t\t\t\tknownActionsForClip[ knownActionsForClip.length - 1 ],\n\n\t\t\tbyClipCacheIndex = action._byClipCacheIndex;\n\n\t\tlastKnownAction._byClipCacheIndex = byClipCacheIndex;\n\t\tknownActionsForClip[ byClipCacheIndex ] = lastKnownAction;\n\t\tknownActionsForClip.pop();\n\n\t\taction._byClipCacheIndex = null;\n\n\n\t\tconst actionByRoot = actionsForClip.actionByRoot,\n\t\t\trootUuid = ( action._localRoot || this._root ).uuid;\n\n\t\tdelete actionByRoot[ rootUuid ];\n\n\t\tif ( knownActionsForClip.length === 0 ) {\n\n\t\t\tdelete actionsByClip[ clipUuid ];\n\n\t\t}\n\n\t\tthis._removeInactiveBindingsForAction( action );\n\n\t}\n\n\t_removeInactiveBindingsForAction( action ) {\n\n\t\tconst bindings = action._propertyBindings;\n\n\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tconst binding = bindings[ i ];\n\n\t\t\tif ( -- binding.referenceCount === 0 ) {\n\n\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_lendAction( action ) {\n\n\t\t// [ active actions | inactive actions ]\n\t\t// [ active actions >| inactive actions ]\n\t\t// s a\n\t\t// <-swap->\n\t\t// a s\n\n\t\tconst actions = this._actions,\n\t\t\tprevIndex = action._cacheIndex,\n\n\t\t\tlastActiveIndex = this._nActiveActions ++,\n\n\t\t\tfirstInactiveAction = actions[ lastActiveIndex ];\n\n\t\taction._cacheIndex = lastActiveIndex;\n\t\tactions[ lastActiveIndex ] = action;\n\n\t\tfirstInactiveAction._cacheIndex = prevIndex;\n\t\tactions[ prevIndex ] = firstInactiveAction;\n\n\t}\n\n\t_takeBackAction( action ) {\n\n\t\t// [ active actions | inactive actions ]\n\t\t// [ active actions |< inactive actions ]\n\t\t// a s\n\t\t// <-swap->\n\t\t// s a\n\n\t\tconst actions = this._actions,\n\t\t\tprevIndex = action._cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveActions,\n\n\t\t\tlastActiveAction = actions[ firstInactiveIndex ];\n\n\t\taction._cacheIndex = firstInactiveIndex;\n\t\tactions[ firstInactiveIndex ] = action;\n\n\t\tlastActiveAction._cacheIndex = prevIndex;\n\t\tactions[ prevIndex ] = lastActiveAction;\n\n\t}\n\n\t// Memory management for PropertyMixer objects\n\n\t_addInactiveBinding( binding, rootUuid, trackName ) {\n\n\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindings = this._bindings;\n\n\t\tlet bindingByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingByName === undefined ) {\n\n\t\t\tbindingByName = {};\n\t\t\tbindingsByRoot[ rootUuid ] = bindingByName;\n\n\t\t}\n\n\t\tbindingByName[ trackName ] = binding;\n\n\t\tbinding._cacheIndex = bindings.length;\n\t\tbindings.push( binding );\n\n\t}\n\n\t_removeInactiveBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tpropBinding = binding.binding,\n\t\t\trootUuid = propBinding.rootNode.uuid,\n\t\t\ttrackName = propBinding.path,\n\t\t\tbindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindingByName = bindingsByRoot[ rootUuid ],\n\n\t\t\tlastInactiveBinding = bindings[ bindings.length - 1 ],\n\t\t\tcacheIndex = binding._cacheIndex;\n\n\t\tlastInactiveBinding._cacheIndex = cacheIndex;\n\t\tbindings[ cacheIndex ] = lastInactiveBinding;\n\t\tbindings.pop();\n\n\t\tdelete bindingByName[ trackName ];\n\n\t\tif ( Object.keys( bindingByName ).length === 0 ) {\n\n\t\t\tdelete bindingsByRoot[ rootUuid ];\n\n\t\t}\n\n\t}\n\n\t_lendBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tprevIndex = binding._cacheIndex,\n\n\t\t\tlastActiveIndex = this._nActiveBindings ++,\n\n\t\t\tfirstInactiveBinding = bindings[ lastActiveIndex ];\n\n\t\tbinding._cacheIndex = lastActiveIndex;\n\t\tbindings[ lastActiveIndex ] = binding;\n\n\t\tfirstInactiveBinding._cacheIndex = prevIndex;\n\t\tbindings[ prevIndex ] = firstInactiveBinding;\n\n\t}\n\n\t_takeBackBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tprevIndex = binding._cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveBindings,\n\n\t\t\tlastActiveBinding = bindings[ firstInactiveIndex ];\n\n\t\tbinding._cacheIndex = firstInactiveIndex;\n\t\tbindings[ firstInactiveIndex ] = binding;\n\n\t\tlastActiveBinding._cacheIndex = prevIndex;\n\t\tbindings[ prevIndex ] = lastActiveBinding;\n\n\t}\n\n\n\t// Memory management of Interpolants for weight and time scale\n\n\t_lendControlInterpolant() {\n\n\t\tconst interpolants = this._controlInterpolants,\n\t\t\tlastActiveIndex = this._nActiveControlInterpolants ++;\n\n\t\tlet interpolant = interpolants[ lastActiveIndex ];\n\n\t\tif ( interpolant === undefined ) {\n\n\t\t\tinterpolant = new LinearInterpolant(\n\t\t\t\tnew Float32Array( 2 ), new Float32Array( 2 ),\n\t\t\t\t1, _controlInterpolantsResultBuffer );\n\n\t\t\tinterpolant.__cacheIndex = lastActiveIndex;\n\t\t\tinterpolants[ lastActiveIndex ] = interpolant;\n\n\t\t}\n\n\t\treturn interpolant;\n\n\t}\n\n\t_takeBackControlInterpolant( interpolant ) {\n\n\t\tconst interpolants = this._controlInterpolants,\n\t\t\tprevIndex = interpolant.__cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveControlInterpolants,\n\n\t\t\tlastActiveInterpolant = interpolants[ firstInactiveIndex ];\n\n\t\tinterpolant.__cacheIndex = firstInactiveIndex;\n\t\tinterpolants[ firstInactiveIndex ] = interpolant;\n\n\t\tlastActiveInterpolant.__cacheIndex = prevIndex;\n\t\tinterpolants[ prevIndex ] = lastActiveInterpolant;\n\n\t}\n\n\t// return an action for a clip optionally using a custom root target\n\t// object (this method allocates a lot of dynamic memory in case a\n\t// previously unknown clip/root combination is specified)\n\tclipAction( clip, optionalRoot, blendMode ) {\n\n\t\tconst root = optionalRoot || this._root,\n\t\t\trootUuid = root.uuid;\n\n\t\tlet clipObject = typeof clip === 'string' ? AnimationClip.findByName( root, clip ) : clip;\n\n\t\tconst clipUuid = clipObject !== null ? clipObject.uuid : clip;\n\n\t\tconst actionsForClip = this._actionsByClip[ clipUuid ];\n\t\tlet prototypeAction = null;\n\n\t\tif ( blendMode === undefined ) {\n\n\t\t\tif ( clipObject !== null ) {\n\n\t\t\t\tblendMode = clipObject.blendMode;\n\n\t\t\t} else {\n\n\t\t\t\tblendMode = NormalAnimationBlendMode;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\tconst existingAction = actionsForClip.actionByRoot[ rootUuid ];\n\n\t\t\tif ( existingAction !== undefined && existingAction.blendMode === blendMode ) {\n\n\t\t\t\treturn existingAction;\n\n\t\t\t}\n\n\t\t\t// we know the clip, so we don't have to parse all\n\t\t\t// the bindings again but can just copy\n\t\t\tprototypeAction = actionsForClip.knownActions[ 0 ];\n\n\t\t\t// also, take the clip from the prototype action\n\t\t\tif ( clipObject === null )\n\t\t\t\tclipObject = prototypeAction._clip;\n\n\t\t}\n\n\t\t// clip must be known when specified via string\n\t\tif ( clipObject === null ) return null;\n\n\t\t// allocate all resources required to run it\n\t\tconst newAction = new AnimationAction( this, clipObject, optionalRoot, blendMode );\n\n\t\tthis._bindAction( newAction, prototypeAction );\n\n\t\t// and make the action known to the memory manager\n\t\tthis._addInactiveAction( newAction, clipUuid, rootUuid );\n\n\t\treturn newAction;\n\n\t}\n\n\t// get an existing action\n\texistingAction( clip, optionalRoot ) {\n\n\t\tconst root = optionalRoot || this._root,\n\t\t\trootUuid = root.uuid,\n\n\t\t\tclipObject = typeof clip === 'string' ?\n\t\t\t\tAnimationClip.findByName( root, clip ) : clip,\n\n\t\t\tclipUuid = clipObject ? clipObject.uuid : clip,\n\n\t\t\tactionsForClip = this._actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\treturn actionsForClip.actionByRoot[ rootUuid ] || null;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t// deactivates all previously scheduled actions\n\tstopAllAction() {\n\n\t\tconst actions = this._actions,\n\t\t\tnActions = this._nActiveActions;\n\n\t\tfor ( let i = nActions - 1; i >= 0; -- i ) {\n\n\t\t\tactions[ i ].stop();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// advance the time and update apply the animation\n\tupdate( deltaTime ) {\n\n\t\tdeltaTime *= this.timeScale;\n\n\t\tconst actions = this._actions,\n\t\t\tnActions = this._nActiveActions,\n\n\t\t\ttime = this.time += deltaTime,\n\t\t\ttimeDirection = Math.sign( deltaTime ),\n\n\t\t\taccuIndex = this._accuIndex ^= 1;\n\n\t\t// run active actions\n\n\t\tfor ( let i = 0; i !== nActions; ++ i ) {\n\n\t\t\tconst action = actions[ i ];\n\n\t\t\taction._update( time, deltaTime, timeDirection, accuIndex );\n\n\t\t}\n\n\t\t// update scene graph\n\n\t\tconst bindings = this._bindings,\n\t\t\tnBindings = this._nActiveBindings;\n\n\t\tfor ( let i = 0; i !== nBindings; ++ i ) {\n\n\t\t\tbindings[ i ].apply( accuIndex );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t// Allows you to seek to a specific time in an animation.\n\tsetTime( timeInSeconds ) {\n\n\t\tthis.time = 0; // Zero out time attribute for AnimationMixer object;\n\t\tfor ( let i = 0; i < this._actions.length; i ++ ) {\n\n\t\t\tthis._actions[ i ].time = 0; // Zero out time attribute for all associated AnimationAction objects.\n\n\t\t}\n\n\t\treturn this.update( timeInSeconds ); // Update used to set exact time. Returns \"this\" AnimationMixer object.\n\n\t}\n\n\t// return this mixer's root target object\n\tgetRoot() {\n\n\t\treturn this._root;\n\n\t}\n\n\t// free all resources specific to a particular clip\n\tuncacheClip( clip ) {\n\n\t\tconst actions = this._actions,\n\t\t\tclipUuid = clip.uuid,\n\t\t\tactionsByClip = this._actionsByClip,\n\t\t\tactionsForClip = actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\t// note: just calling _removeInactiveAction would mess up the\n\t\t\t// iteration state and also require updating the state we can\n\t\t\t// just throw away\n\n\t\t\tconst actionsToRemove = actionsForClip.knownActions;\n\n\t\t\tfor ( let i = 0, n = actionsToRemove.length; i !== n; ++ i ) {\n\n\t\t\t\tconst action = actionsToRemove[ i ];\n\n\t\t\t\tthis._deactivateAction( action );\n\n\t\t\t\tconst cacheIndex = action._cacheIndex,\n\t\t\t\t\tlastInactiveAction = actions[ actions.length - 1 ];\n\n\t\t\t\taction._cacheIndex = null;\n\t\t\t\taction._byClipCacheIndex = null;\n\n\t\t\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\t\t\tactions[ cacheIndex ] = lastInactiveAction;\n\t\t\t\tactions.pop();\n\n\t\t\t\tthis._removeInactiveBindingsForAction( action );\n\n\t\t\t}\n\n\t\t\tdelete actionsByClip[ clipUuid ];\n\n\t\t}\n\n\t}\n\n\t// free all resources specific to a particular root target object\n\tuncacheRoot( root ) {\n\n\t\tconst rootUuid = root.uuid,\n\t\t\tactionsByClip = this._actionsByClip;\n\n\t\tfor ( const clipUuid in actionsByClip ) {\n\n\t\t\tconst actionByRoot = actionsByClip[ clipUuid ].actionByRoot,\n\t\t\t\taction = actionByRoot[ rootUuid ];\n\n\t\t\tif ( action !== undefined ) {\n\n\t\t\t\tthis._deactivateAction( action );\n\t\t\t\tthis._removeInactiveAction( action );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindingByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingByName !== undefined ) {\n\n\t\t\tfor ( const trackName in bindingByName ) {\n\n\t\t\t\tconst binding = bindingByName[ trackName ];\n\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// remove a targeted clip from the cache\n\tuncacheAction( clip, optionalRoot ) {\n\n\t\tconst action = this.existingAction( clip, optionalRoot );\n\n\t\tif ( action !== null ) {\n\n\t\t\tthis._deactivateAction( action );\n\t\t\tthis._removeInactiveAction( action );\n\n\t\t}\n\n\t}\n\n}\n\nclass Uniform {\n\n\tconstructor( value ) {\n\n\t\tthis.value = value;\n\n\t}\n\n\tclone() {\n\n\t\treturn new Uniform( this.value.clone === undefined ? this.value : this.value.clone() );\n\n\t}\n\n}\n\nlet _id = 0;\n\nclass UniformsGroup extends EventDispatcher {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isUniformsGroup = true;\n\n\t\tObject.defineProperty( this, 'id', { value: _id ++ } );\n\n\t\tthis.name = '';\n\n\t\tthis.usage = StaticDrawUsage;\n\t\tthis.uniforms = [];\n\n\t}\n\n\tadd( uniform ) {\n\n\t\tthis.uniforms.push( uniform );\n\n\t\treturn this;\n\n\t}\n\n\tremove( uniform ) {\n\n\t\tconst index = this.uniforms.indexOf( uniform );\n\n\t\tif ( index !== - 1 ) this.uniforms.splice( index, 1 );\n\n\t\treturn this;\n\n\t}\n\n\tsetName( name ) {\n\n\t\tthis.name = name;\n\n\t\treturn this;\n\n\t}\n\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\t\tthis.usage = source.usage;\n\n\t\tconst uniformsSource = source.uniforms;\n\n\t\tthis.uniforms.length = 0;\n\n\t\tfor ( let i = 0, l = uniformsSource.length; i < l; i ++ ) {\n\n\t\t\tconst uniforms = Array.isArray( uniformsSource[ i ] ) ? uniformsSource[ i ] : [ uniformsSource[ i ] ];\n\n\t\t\tfor ( let j = 0; j < uniforms.length; j ++ ) {\n\n\t\t\t\tthis.uniforms.push( uniforms[ j ].clone() );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nclass InstancedInterleavedBuffer extends InterleavedBuffer {\n\n\tconstructor( array, stride, meshPerAttribute = 1 ) {\n\n\t\tsuper( array, stride );\n\n\t\tthis.isInstancedInterleavedBuffer = true;\n\n\t\tthis.meshPerAttribute = meshPerAttribute;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\n\t\treturn this;\n\n\t}\n\n\tclone( data ) {\n\n\t\tconst ib = super.clone( data );\n\n\t\tib.meshPerAttribute = this.meshPerAttribute;\n\n\t\treturn ib;\n\n\t}\n\n\ttoJSON( data ) {\n\n\t\tconst json = super.toJSON( data );\n\n\t\tjson.isInstancedInterleavedBuffer = true;\n\t\tjson.meshPerAttribute = this.meshPerAttribute;\n\n\t\treturn json;\n\n\t}\n\n}\n\nclass GLBufferAttribute {\n\n\tconstructor( buffer, type, itemSize, elementSize, count ) {\n\n\t\tthis.isGLBufferAttribute = true;\n\n\t\tthis.name = '';\n\n\t\tthis.buffer = buffer;\n\t\tthis.type = type;\n\t\tthis.itemSize = itemSize;\n\t\tthis.elementSize = elementSize;\n\t\tthis.count = count;\n\n\t\tthis.version = 0;\n\n\t}\n\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\tsetBuffer( buffer ) {\n\n\t\tthis.buffer = buffer;\n\n\t\treturn this;\n\n\t}\n\n\tsetType( type, elementSize ) {\n\n\t\tthis.type = type;\n\t\tthis.elementSize = elementSize;\n\n\t\treturn this;\n\n\t}\n\n\tsetItemSize( itemSize ) {\n\n\t\tthis.itemSize = itemSize;\n\n\t\treturn this;\n\n\t}\n\n\tsetCount( count ) {\n\n\t\tthis.count = count;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _matrix = /*@__PURE__*/ new Matrix4();\n\nclass Raycaster {\n\n\tconstructor( origin, direction, near = 0, far = Infinity ) {\n\n\t\tthis.ray = new Ray( origin, direction );\n\t\t// direction is assumed to be normalized (for accurate distance calculations)\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\t\tthis.camera = null;\n\t\tthis.layers = new Layers();\n\n\t\tthis.params = {\n\t\t\tMesh: {},\n\t\t\tLine: { threshold: 1 },\n\t\t\tLOD: {},\n\t\t\tPoints: { threshold: 1 },\n\t\t\tSprite: {}\n\t\t};\n\n\t}\n\n\tset( origin, direction ) {\n\n\t\t// direction is assumed to be normalized (for accurate distance calculations)\n\n\t\tthis.ray.set( origin, direction );\n\n\t}\n\n\tsetFromCamera( coords, camera ) {\n\n\t\tif ( camera.isPerspectiveCamera ) {\n\n\t\t\tthis.ray.origin.setFromMatrixPosition( camera.matrixWorld );\n\t\t\tthis.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize();\n\t\t\tthis.camera = camera;\n\n\t\t} else if ( camera.isOrthographicCamera ) {\n\n\t\t\tthis.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera\n\t\t\tthis.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld );\n\t\t\tthis.camera = camera;\n\n\t\t} else {\n\n\t\t\tconsole.error( 'THREE.Raycaster: Unsupported camera type: ' + camera.type );\n\n\t\t}\n\n\t}\n\n\tsetFromXRController( controller ) {\n\n\t\t_matrix.identity().extractRotation( controller.matrixWorld );\n\n\t\tthis.ray.origin.setFromMatrixPosition( controller.matrixWorld );\n\t\tthis.ray.direction.set( 0, 0, - 1 ).applyMatrix4( _matrix );\n\n\t\treturn this;\n\n\t}\n\n\tintersectObject( object, recursive = true, intersects = [] ) {\n\n\t\tintersect( object, this, intersects, recursive );\n\n\t\tintersects.sort( ascSort );\n\n\t\treturn intersects;\n\n\t}\n\n\tintersectObjects( objects, recursive = true, intersects = [] ) {\n\n\t\tfor ( let i = 0, l = objects.length; i < l; i ++ ) {\n\n\t\t\tintersect( objects[ i ], this, intersects, recursive );\n\n\t\t}\n\n\t\tintersects.sort( ascSort );\n\n\t\treturn intersects;\n\n\t}\n\n}\n\nfunction ascSort( a, b ) {\n\n\treturn a.distance - b.distance;\n\n}\n\nfunction intersect( object, raycaster, intersects, recursive ) {\n\n\tlet propagate = true;\n\n\tif ( object.layers.test( raycaster.layers ) ) {\n\n\t\tconst result = object.raycast( raycaster, intersects );\n\n\t\tif ( result === false ) propagate = false;\n\n\t}\n\n\tif ( propagate === true && recursive === true ) {\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tintersect( children[ i ], raycaster, intersects, true );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\n *\n * phi (the polar angle) is measured from the positive y-axis. The positive y-axis is up.\n * theta (the azimuthal angle) is measured from the positive z-axis.\n */\nclass Spherical {\n\n\tconstructor( radius = 1, phi = 0, theta = 0 ) {\n\n\t\tthis.radius = radius;\n\t\tthis.phi = phi; // polar angle\n\t\tthis.theta = theta; // azimuthal angle\n\n\t\treturn this;\n\n\t}\n\n\tset( radius, phi, theta ) {\n\n\t\tthis.radius = radius;\n\t\tthis.phi = phi;\n\t\tthis.theta = theta;\n\n\t\treturn this;\n\n\t}\n\n\tcopy( other ) {\n\n\t\tthis.radius = other.radius;\n\t\tthis.phi = other.phi;\n\t\tthis.theta = other.theta;\n\n\t\treturn this;\n\n\t}\n\n\t// restrict phi to be between EPS and PI-EPS\n\tmakeSafe() {\n\n\t\tconst EPS = 0.000001;\n\t\tthis.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromVector3( v ) {\n\n\t\treturn this.setFromCartesianCoords( v.x, v.y, v.z );\n\n\t}\n\n\tsetFromCartesianCoords( x, y, z ) {\n\n\t\tthis.radius = Math.sqrt( x * x + y * y + z * z );\n\n\t\tif ( this.radius === 0 ) {\n\n\t\t\tthis.theta = 0;\n\t\t\tthis.phi = 0;\n\n\t\t} else {\n\n\t\t\tthis.theta = Math.atan2( x, z );\n\t\t\tthis.phi = Math.acos( clamp( y / this.radius, - 1, 1 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\n/**\n * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system\n */\n\nclass Cylindrical {\n\n\tconstructor( radius = 1, theta = 0, y = 0 ) {\n\n\t\tthis.radius = radius; // distance from the origin to a point in the x-z plane\n\t\tthis.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis\n\t\tthis.y = y; // height above the x-z plane\n\n\t\treturn this;\n\n\t}\n\n\tset( radius, theta, y ) {\n\n\t\tthis.radius = radius;\n\t\tthis.theta = theta;\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tcopy( other ) {\n\n\t\tthis.radius = other.radius;\n\t\tthis.theta = other.theta;\n\t\tthis.y = other.y;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromVector3( v ) {\n\n\t\treturn this.setFromCartesianCoords( v.x, v.y, v.z );\n\n\t}\n\n\tsetFromCartesianCoords( x, y, z ) {\n\n\t\tthis.radius = Math.sqrt( x * x + z * z );\n\t\tthis.theta = Math.atan2( x, z );\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nclass Matrix2 {\n\n\tconstructor( n11, n12, n21, n22 ) {\n\n\t\tMatrix2.prototype.isMatrix2 = true;\n\n\t\tthis.elements = [\n\t\t\t1, 0,\n\t\t\t0, 1,\n\t\t];\n\n\t\tif ( n11 !== undefined ) {\n\n\t\t\tthis.set( n11, n12, n21, n22 );\n\n\t\t}\n\n\t}\n\n\tidentity() {\n\n\t\tthis.set(\n\t\t\t1, 0,\n\t\t\t0, 1,\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i < 4; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tset( n11, n12, n21, n22 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 2 ] = n12;\n\t\tte[ 1 ] = n21; te[ 3 ] = n22;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _vector$4 = /*@__PURE__*/ new Vector2();\n\nclass Box2 {\n\n\tconstructor( min = new Vector2( + Infinity, + Infinity ), max = new Vector2( - Infinity, - Infinity ) ) {\n\n\t\tthis.isBox2 = true;\n\n\t\tthis.min = min;\n\t\tthis.max = max;\n\n\t}\n\n\tset( min, max ) {\n\n\t\tthis.min.copy( min );\n\t\tthis.max.copy( max );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromPoints( points ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\tthis.expandByPoint( points[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCenterAndSize( center, size ) {\n\n\t\tconst halfSize = _vector$4.copy( size ).multiplyScalar( 0.5 );\n\t\tthis.min.copy( center ).sub( halfSize );\n\t\tthis.max.copy( center ).add( halfSize );\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\tcopy( box ) {\n\n\t\tthis.min.copy( box.min );\n\t\tthis.max.copy( box.max );\n\n\t\treturn this;\n\n\t}\n\n\tmakeEmpty() {\n\n\t\tthis.min.x = this.min.y = + Infinity;\n\t\tthis.max.x = this.max.y = - Infinity;\n\n\t\treturn this;\n\n\t}\n\n\tisEmpty() {\n\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\n\t\treturn ( this.max.x < this.min.x ) || ( this.max.y < this.min.y );\n\n\t}\n\n\tgetCenter( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );\n\n\t}\n\n\tgetSize( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0 ) : target.subVectors( this.max, this.min );\n\n\t}\n\n\texpandByPoint( point ) {\n\n\t\tthis.min.min( point );\n\t\tthis.max.max( point );\n\n\t\treturn this;\n\n\t}\n\n\texpandByVector( vector ) {\n\n\t\tthis.min.sub( vector );\n\t\tthis.max.add( vector );\n\n\t\treturn this;\n\n\t}\n\n\texpandByScalar( scalar ) {\n\n\t\tthis.min.addScalar( - scalar );\n\t\tthis.max.addScalar( scalar );\n\n\t\treturn this;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\treturn point.x >= this.min.x && point.x <= this.max.x &&\n\t\t\tpoint.y >= this.min.y && point.y <= this.max.y;\n\n\t}\n\n\tcontainsBox( box ) {\n\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x &&\n\t\t\tthis.min.y <= box.min.y && box.max.y <= this.max.y;\n\n\t}\n\n\tgetParameter( point, target ) {\n\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\n\t\treturn target.set(\n\t\t\t( point.x - this.min.x ) / ( this.max.x - this.min.x ),\n\t\t\t( point.y - this.min.y ) / ( this.max.y - this.min.y )\n\t\t);\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\t// using 4 splitting planes to rule out intersections\n\n\t\treturn box.max.x >= this.min.x && box.min.x <= this.max.x &&\n\t\t\tbox.max.y >= this.min.y && box.min.y <= this.max.y;\n\n\t}\n\n\tclampPoint( point, target ) {\n\n\t\treturn target.copy( point ).clamp( this.min, this.max );\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn this.clampPoint( point, _vector$4 ).distanceTo( point );\n\n\t}\n\n\tintersect( box ) {\n\n\t\tthis.min.max( box.min );\n\t\tthis.max.min( box.max );\n\n\t\tif ( this.isEmpty() ) this.makeEmpty();\n\n\t\treturn this;\n\n\t}\n\n\tunion( box ) {\n\n\t\tthis.min.min( box.min );\n\t\tthis.max.max( box.max );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.min.add( offset );\n\t\tthis.max.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\tequals( box ) {\n\n\t\treturn box.min.equals( this.min ) && box.max.equals( this.max );\n\n\t}\n\n}\n\nconst _startP = /*@__PURE__*/ new Vector3();\nconst _startEnd = /*@__PURE__*/ new Vector3();\n\nclass Line3 {\n\n\tconstructor( start = new Vector3(), end = new Vector3() ) {\n\n\t\tthis.start = start;\n\t\tthis.end = end;\n\n\t}\n\n\tset( start, end ) {\n\n\t\tthis.start.copy( start );\n\t\tthis.end.copy( end );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( line ) {\n\n\t\tthis.start.copy( line.start );\n\t\tthis.end.copy( line.end );\n\n\t\treturn this;\n\n\t}\n\n\tgetCenter( target ) {\n\n\t\treturn target.addVectors( this.start, this.end ).multiplyScalar( 0.5 );\n\n\t}\n\n\tdelta( target ) {\n\n\t\treturn target.subVectors( this.end, this.start );\n\n\t}\n\n\tdistanceSq() {\n\n\t\treturn this.start.distanceToSquared( this.end );\n\n\t}\n\n\tdistance() {\n\n\t\treturn this.start.distanceTo( this.end );\n\n\t}\n\n\tat( t, target ) {\n\n\t\treturn this.delta( target ).multiplyScalar( t ).add( this.start );\n\n\t}\n\n\tclosestPointToPointParameter( point, clampToLine ) {\n\n\t\t_startP.subVectors( point, this.start );\n\t\t_startEnd.subVectors( this.end, this.start );\n\n\t\tconst startEnd2 = _startEnd.dot( _startEnd );\n\t\tconst startEnd_startP = _startEnd.dot( _startP );\n\n\t\tlet t = startEnd_startP / startEnd2;\n\n\t\tif ( clampToLine ) {\n\n\t\t\tt = clamp( t, 0, 1 );\n\n\t\t}\n\n\t\treturn t;\n\n\t}\n\n\tclosestPointToPoint( point, clampToLine, target ) {\n\n\t\tconst t = this.closestPointToPointParameter( point, clampToLine );\n\n\t\treturn this.delta( target ).multiplyScalar( t ).add( this.start );\n\n\t}\n\n\tapplyMatrix4( matrix ) {\n\n\t\tthis.start.applyMatrix4( matrix );\n\t\tthis.end.applyMatrix4( matrix );\n\n\t\treturn this;\n\n\t}\n\n\tequals( line ) {\n\n\t\treturn line.start.equals( this.start ) && line.end.equals( this.end );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _vector$3 = /*@__PURE__*/ new Vector3();\n\nclass SpotLightHelper extends Object3D {\n\n\tconstructor( light, color ) {\n\n\t\tsuper();\n\n\t\tthis.light = light;\n\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.color = color;\n\n\t\tthis.type = 'SpotLightHelper';\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tconst positions = [\n\t\t\t0, 0, 0, \t0, 0, 1,\n\t\t\t0, 0, 0, \t1, 0, 1,\n\t\t\t0, 0, 0,\t- 1, 0, 1,\n\t\t\t0, 0, 0, \t0, 1, 1,\n\t\t\t0, 0, 0, \t0, - 1, 1\n\t\t];\n\n\t\tfor ( let i = 0, j = 1, l = 32; i < l; i ++, j ++ ) {\n\n\t\t\tconst p1 = ( i / l ) * Math.PI * 2;\n\t\t\tconst p2 = ( j / l ) * Math.PI * 2;\n\n\t\t\tpositions.push(\n\t\t\t\tMath.cos( p1 ), Math.sin( p1 ), 1,\n\t\t\t\tMath.cos( p2 ), Math.sin( p2 ), 1\n\t\t\t);\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { fog: false, toneMapped: false } );\n\n\t\tthis.cone = new LineSegments( geometry, material );\n\t\tthis.add( this.cone );\n\n\t\tthis.update();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.cone.geometry.dispose();\n\t\tthis.cone.material.dispose();\n\n\t}\n\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\t\tthis.light.target.updateWorldMatrix( true, false );\n\n\t\t// update the local matrix based on the parent and light target transforms\n\t\tif ( this.parent ) {\n\n\t\t\tthis.parent.updateWorldMatrix( true );\n\n\t\t\tthis.matrix\n\t\t\t\t.copy( this.parent.matrixWorld )\n\t\t\t\t.invert()\n\t\t\t\t.multiply( this.light.matrixWorld );\n\n\t\t} else {\n\n\t\t\tthis.matrix.copy( this.light.matrixWorld );\n\n\t\t}\n\n\t\tthis.matrixWorld.copy( this.light.matrixWorld );\n\n\t\tconst coneLength = this.light.distance ? this.light.distance : 1000;\n\t\tconst coneWidth = coneLength * Math.tan( this.light.angle );\n\n\t\tthis.cone.scale.set( coneWidth, coneWidth, coneLength );\n\n\t\t_vector$3.setFromMatrixPosition( this.light.target.matrixWorld );\n\n\t\tthis.cone.lookAt( _vector$3 );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.cone.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.cone.material.color.copy( this.light.color );\n\n\t\t}\n\n\t}\n\n}\n\nconst _vector$2 = /*@__PURE__*/ new Vector3();\nconst _boneMatrix = /*@__PURE__*/ new Matrix4();\nconst _matrixWorldInv = /*@__PURE__*/ new Matrix4();\n\n\nclass SkeletonHelper extends LineSegments {\n\n\tconstructor( object ) {\n\n\t\tconst bones = getBoneList( object );\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\tconst color1 = new Color( 0, 0, 1 );\n\t\tconst color2 = new Color( 0, 1, 0 );\n\n\t\tfor ( let i = 0; i < bones.length; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\n\t\t\tif ( bone.parent && bone.parent.isBone ) {\n\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tcolors.push( color1.r, color1.g, color1.b );\n\t\t\t\tcolors.push( color2.r, color2.g, color2.b );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.isSkeletonHelper = true;\n\n\t\tthis.type = 'SkeletonHelper';\n\n\t\tthis.root = object;\n\t\tthis.bones = bones;\n\n\t\tthis.matrix = object.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tconst bones = this.bones;\n\n\t\tconst geometry = this.geometry;\n\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\t_matrixWorldInv.copy( this.root.matrixWorld ).invert();\n\n\t\tfor ( let i = 0, j = 0; i < bones.length; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\n\t\t\tif ( bone.parent && bone.parent.isBone ) {\n\n\t\t\t\t_boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld );\n\t\t\t\t_vector$2.setFromMatrixPosition( _boneMatrix );\n\t\t\t\tposition.setXYZ( j, _vector$2.x, _vector$2.y, _vector$2.z );\n\n\t\t\t\t_boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld );\n\t\t\t\t_vector$2.setFromMatrixPosition( _boneMatrix );\n\t\t\t\tposition.setXYZ( j + 1, _vector$2.x, _vector$2.y, _vector$2.z );\n\n\t\t\t\tj += 2;\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.getAttribute( 'position' ).needsUpdate = true;\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n\nfunction getBoneList( object ) {\n\n\tconst boneList = [];\n\n\tif ( object.isBone === true ) {\n\n\t\tboneList.push( object );\n\n\t}\n\n\tfor ( let i = 0; i < object.children.length; i ++ ) {\n\n\t\tboneList.push.apply( boneList, getBoneList( object.children[ i ] ) );\n\n\t}\n\n\treturn boneList;\n\n}\n\nclass PointLightHelper extends Mesh {\n\n\tconstructor( light, sphereSize, color ) {\n\n\t\tconst geometry = new SphereGeometry( sphereSize, 4, 2 );\n\t\tconst material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.light = light;\n\n\t\tthis.color = color;\n\n\t\tthis.type = 'PointLightHelper';\n\n\t\tthis.matrix = this.light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\n\t\t/*\n\t// TODO: delete this comment?\n\tconst distanceGeometry = new THREE.IcosahedronGeometry( 1, 2 );\n\tconst distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );\n\n\tthis.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );\n\tthis.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );\n\n\tconst d = light.distance;\n\n\tif ( d === 0.0 ) {\n\n\t\tthis.lightDistance.visible = false;\n\n\t} else {\n\n\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t}\n\n\tthis.add( this.lightDistance );\n\t*/\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.material.color.copy( this.light.color );\n\n\t\t}\n\n\t\t/*\n\t\tconst d = this.light.distance;\n\n\t\tif ( d === 0.0 ) {\n\n\t\t\tthis.lightDistance.visible = false;\n\n\t\t} else {\n\n\t\t\tthis.lightDistance.visible = true;\n\t\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t\t}\n\t\t*/\n\n\t}\n\n}\n\nconst _vector$1 = /*@__PURE__*/ new Vector3();\nconst _color1 = /*@__PURE__*/ new Color();\nconst _color2 = /*@__PURE__*/ new Color();\n\nclass HemisphereLightHelper extends Object3D {\n\n\tconstructor( light, size, color ) {\n\n\t\tsuper();\n\n\t\tthis.light = light;\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.color = color;\n\n\t\tthis.type = 'HemisphereLightHelper';\n\n\t\tconst geometry = new OctahedronGeometry( size );\n\t\tgeometry.rotateY( Math.PI * 0.5 );\n\n\t\tthis.material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } );\n\t\tif ( this.color === undefined ) this.material.vertexColors = true;\n\n\t\tconst position = geometry.getAttribute( 'position' );\n\t\tconst colors = new Float32Array( position.count * 3 );\n\n\t\tgeometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) );\n\n\t\tthis.add( new Mesh( geometry, this.material ) );\n\n\t\tthis.update();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.children[ 0 ].geometry.dispose();\n\t\tthis.children[ 0 ].material.dispose();\n\n\t}\n\n\tupdate() {\n\n\t\tconst mesh = this.children[ 0 ];\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tconst colors = mesh.geometry.getAttribute( 'color' );\n\n\t\t\t_color1.copy( this.light.color );\n\t\t\t_color2.copy( this.light.groundColor );\n\n\t\t\tfor ( let i = 0, l = colors.count; i < l; i ++ ) {\n\n\t\t\t\tconst color = ( i < ( l / 2 ) ) ? _color1 : _color2;\n\n\t\t\t\tcolors.setXYZ( i, color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t\tcolors.needsUpdate = true;\n\n\t\t}\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\n\t\tmesh.lookAt( _vector$1.setFromMatrixPosition( this.light.matrixWorld ).negate() );\n\n\t}\n\n}\n\nclass GridHelper extends LineSegments {\n\n\tconstructor( size = 10, divisions = 10, color1 = 0x444444, color2 = 0x888888 ) {\n\n\t\tcolor1 = new Color( color1 );\n\t\tcolor2 = new Color( color2 );\n\n\t\tconst center = divisions / 2;\n\t\tconst step = size / divisions;\n\t\tconst halfSize = size / 2;\n\n\t\tconst vertices = [], colors = [];\n\n\t\tfor ( let i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) {\n\n\t\t\tvertices.push( - halfSize, 0, k, halfSize, 0, k );\n\t\t\tvertices.push( k, 0, - halfSize, k, 0, halfSize );\n\n\t\t\tconst color = i === center ? color1 : color2;\n\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\n\t\t}\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'GridHelper';\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nclass PolarGridHelper extends LineSegments {\n\n\tconstructor( radius = 10, sectors = 16, rings = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888 ) {\n\n\t\tcolor1 = new Color( color1 );\n\t\tcolor2 = new Color( color2 );\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\t// create the sectors\n\n\t\tif ( sectors > 1 ) {\n\n\t\t\tfor ( let i = 0; i < sectors; i ++ ) {\n\n\t\t\t\tconst v = ( i / sectors ) * ( Math.PI * 2 );\n\n\t\t\t\tconst x = Math.sin( v ) * radius;\n\t\t\t\tconst z = Math.cos( v ) * radius;\n\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tvertices.push( x, 0, z );\n\n\t\t\t\tconst color = ( i & 1 ) ? color1 : color2;\n\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// create the rings\n\n\t\tfor ( let i = 0; i < rings; i ++ ) {\n\n\t\t\tconst color = ( i & 1 ) ? color1 : color2;\n\n\t\t\tconst r = radius - ( radius / rings * i );\n\n\t\t\tfor ( let j = 0; j < divisions; j ++ ) {\n\n\t\t\t\t// first vertex\n\n\t\t\t\tlet v = ( j / divisions ) * ( Math.PI * 2 );\n\n\t\t\t\tlet x = Math.sin( v ) * r;\n\t\t\t\tlet z = Math.cos( v ) * r;\n\n\t\t\t\tvertices.push( x, 0, z );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t\t// second vertex\n\n\t\t\t\tv = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 );\n\n\t\t\t\tx = Math.sin( v ) * r;\n\t\t\t\tz = Math.cos( v ) * r;\n\n\t\t\t\tvertices.push( x, 0, z );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'PolarGridHelper';\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nconst _v1 = /*@__PURE__*/ new Vector3();\nconst _v2 = /*@__PURE__*/ new Vector3();\nconst _v3 = /*@__PURE__*/ new Vector3();\n\nclass DirectionalLightHelper extends Object3D {\n\n\tconstructor( light, size, color ) {\n\n\t\tsuper();\n\n\t\tthis.light = light;\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.color = color;\n\n\t\tthis.type = 'DirectionalLightHelper';\n\n\t\tif ( size === undefined ) size = 1;\n\n\t\tlet geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( [\n\t\t\t- size, size, 0,\n\t\t\tsize, size, 0,\n\t\t\tsize, - size, 0,\n\t\t\t- size, - size, 0,\n\t\t\t- size, size, 0\n\t\t], 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { fog: false, toneMapped: false } );\n\n\t\tthis.lightPlane = new Line( geometry, material );\n\t\tthis.add( this.lightPlane );\n\n\t\tgeometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) );\n\n\t\tthis.targetLine = new Line( geometry, material );\n\t\tthis.add( this.targetLine );\n\n\t\tthis.update();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.lightPlane.geometry.dispose();\n\t\tthis.lightPlane.material.dispose();\n\t\tthis.targetLine.geometry.dispose();\n\t\tthis.targetLine.material.dispose();\n\n\t}\n\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\t\tthis.light.target.updateWorldMatrix( true, false );\n\n\t\t_v1.setFromMatrixPosition( this.light.matrixWorld );\n\t\t_v2.setFromMatrixPosition( this.light.target.matrixWorld );\n\t\t_v3.subVectors( _v2, _v1 );\n\n\t\tthis.lightPlane.lookAt( _v2 );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.lightPlane.material.color.set( this.color );\n\t\t\tthis.targetLine.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.lightPlane.material.color.copy( this.light.color );\n\t\t\tthis.targetLine.material.color.copy( this.light.color );\n\n\t\t}\n\n\t\tthis.targetLine.lookAt( _v2 );\n\t\tthis.targetLine.scale.z = _v3.length();\n\n\t}\n\n}\n\nconst _vector = /*@__PURE__*/ new Vector3();\nconst _camera = /*@__PURE__*/ new Camera();\n\n/**\n *\t- shows frustum, line of sight and up of the camera\n *\t- suitable for fast updates\n * \t- based on frustum visualization in lightgl.js shadowmap example\n *\t\thttps://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html\n */\n\nclass CameraHelper extends LineSegments {\n\n\tconstructor( camera ) {\n\n\t\tconst geometry = new BufferGeometry();\n\t\tconst material = new LineBasicMaterial( { color: 0xffffff, vertexColors: true, toneMapped: false } );\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\tconst pointMap = {};\n\n\t\t// near\n\n\t\taddLine( 'n1', 'n2' );\n\t\taddLine( 'n2', 'n4' );\n\t\taddLine( 'n4', 'n3' );\n\t\taddLine( 'n3', 'n1' );\n\n\t\t// far\n\n\t\taddLine( 'f1', 'f2' );\n\t\taddLine( 'f2', 'f4' );\n\t\taddLine( 'f4', 'f3' );\n\t\taddLine( 'f3', 'f1' );\n\n\t\t// sides\n\n\t\taddLine( 'n1', 'f1' );\n\t\taddLine( 'n2', 'f2' );\n\t\taddLine( 'n3', 'f3' );\n\t\taddLine( 'n4', 'f4' );\n\n\t\t// cone\n\n\t\taddLine( 'p', 'n1' );\n\t\taddLine( 'p', 'n2' );\n\t\taddLine( 'p', 'n3' );\n\t\taddLine( 'p', 'n4' );\n\n\t\t// up\n\n\t\taddLine( 'u1', 'u2' );\n\t\taddLine( 'u2', 'u3' );\n\t\taddLine( 'u3', 'u1' );\n\n\t\t// target\n\n\t\taddLine( 'c', 't' );\n\t\taddLine( 'p', 'c' );\n\n\t\t// cross\n\n\t\taddLine( 'cn1', 'cn2' );\n\t\taddLine( 'cn3', 'cn4' );\n\n\t\taddLine( 'cf1', 'cf2' );\n\t\taddLine( 'cf3', 'cf4' );\n\n\t\tfunction addLine( a, b ) {\n\n\t\t\taddPoint( a );\n\t\t\taddPoint( b );\n\n\t\t}\n\n\t\tfunction addPoint( id ) {\n\n\t\t\tvertices.push( 0, 0, 0 );\n\t\t\tcolors.push( 0, 0, 0 );\n\n\t\t\tif ( pointMap[ id ] === undefined ) {\n\n\t\t\t\tpointMap[ id ] = [];\n\n\t\t\t}\n\n\t\t\tpointMap[ id ].push( ( vertices.length / 3 ) - 1 );\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'CameraHelper';\n\n\t\tthis.camera = camera;\n\t\tif ( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix();\n\n\t\tthis.matrix = camera.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.pointMap = pointMap;\n\n\t\tthis.update();\n\n\t\t// colors\n\n\t\tconst colorFrustum = new Color( 0xffaa00 );\n\t\tconst colorCone = new Color( 0xff0000 );\n\t\tconst colorUp = new Color( 0x00aaff );\n\t\tconst colorTarget = new Color( 0xffffff );\n\t\tconst colorCross = new Color( 0x333333 );\n\n\t\tthis.setColors( colorFrustum, colorCone, colorUp, colorTarget, colorCross );\n\n\t}\n\n\tsetColors( frustum, cone, up, target, cross ) {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst colorAttribute = geometry.getAttribute( 'color' );\n\n\t\t// near\n\n\t\tcolorAttribute.setXYZ( 0, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 1, frustum.r, frustum.g, frustum.b ); // n1, n2\n\t\tcolorAttribute.setXYZ( 2, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 3, frustum.r, frustum.g, frustum.b ); // n2, n4\n\t\tcolorAttribute.setXYZ( 4, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 5, frustum.r, frustum.g, frustum.b ); // n4, n3\n\t\tcolorAttribute.setXYZ( 6, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 7, frustum.r, frustum.g, frustum.b ); // n3, n1\n\n\t\t// far\n\n\t\tcolorAttribute.setXYZ( 8, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 9, frustum.r, frustum.g, frustum.b ); // f1, f2\n\t\tcolorAttribute.setXYZ( 10, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 11, frustum.r, frustum.g, frustum.b ); // f2, f4\n\t\tcolorAttribute.setXYZ( 12, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 13, frustum.r, frustum.g, frustum.b ); // f4, f3\n\t\tcolorAttribute.setXYZ( 14, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 15, frustum.r, frustum.g, frustum.b ); // f3, f1\n\n\t\t// sides\n\n\t\tcolorAttribute.setXYZ( 16, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 17, frustum.r, frustum.g, frustum.b ); // n1, f1\n\t\tcolorAttribute.setXYZ( 18, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 19, frustum.r, frustum.g, frustum.b ); // n2, f2\n\t\tcolorAttribute.setXYZ( 20, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 21, frustum.r, frustum.g, frustum.b ); // n3, f3\n\t\tcolorAttribute.setXYZ( 22, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 23, frustum.r, frustum.g, frustum.b ); // n4, f4\n\n\t\t// cone\n\n\t\tcolorAttribute.setXYZ( 24, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 25, cone.r, cone.g, cone.b ); // p, n1\n\t\tcolorAttribute.setXYZ( 26, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 27, cone.r, cone.g, cone.b ); // p, n2\n\t\tcolorAttribute.setXYZ( 28, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 29, cone.r, cone.g, cone.b ); // p, n3\n\t\tcolorAttribute.setXYZ( 30, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 31, cone.r, cone.g, cone.b ); // p, n4\n\n\t\t// up\n\n\t\tcolorAttribute.setXYZ( 32, up.r, up.g, up.b ); colorAttribute.setXYZ( 33, up.r, up.g, up.b ); // u1, u2\n\t\tcolorAttribute.setXYZ( 34, up.r, up.g, up.b ); colorAttribute.setXYZ( 35, up.r, up.g, up.b ); // u2, u3\n\t\tcolorAttribute.setXYZ( 36, up.r, up.g, up.b ); colorAttribute.setXYZ( 37, up.r, up.g, up.b ); // u3, u1\n\n\t\t// target\n\n\t\tcolorAttribute.setXYZ( 38, target.r, target.g, target.b ); colorAttribute.setXYZ( 39, target.r, target.g, target.b ); // c, t\n\t\tcolorAttribute.setXYZ( 40, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 41, cross.r, cross.g, cross.b ); // p, c\n\n\t\t// cross\n\n\t\tcolorAttribute.setXYZ( 42, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 43, cross.r, cross.g, cross.b ); // cn1, cn2\n\t\tcolorAttribute.setXYZ( 44, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 45, cross.r, cross.g, cross.b ); // cn3, cn4\n\n\t\tcolorAttribute.setXYZ( 46, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 47, cross.r, cross.g, cross.b ); // cf1, cf2\n\t\tcolorAttribute.setXYZ( 48, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 49, cross.r, cross.g, cross.b ); // cf3, cf4\n\n\t\tcolorAttribute.needsUpdate = true;\n\n\t}\n\n\tupdate() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst pointMap = this.pointMap;\n\n\t\tconst w = 1, h = 1;\n\n\t\t// we need just camera projection matrix inverse\n\t\t// world matrix must be identity\n\n\t\t_camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse );\n\n\t\t// center / target\n\n\t\tsetPoint( 'c', pointMap, geometry, _camera, 0, 0, - 1 );\n\t\tsetPoint( 't', pointMap, geometry, _camera, 0, 0, 1 );\n\n\t\t// near\n\n\t\tsetPoint( 'n1', pointMap, geometry, _camera, - w, - h, - 1 );\n\t\tsetPoint( 'n2', pointMap, geometry, _camera, w, - h, - 1 );\n\t\tsetPoint( 'n3', pointMap, geometry, _camera, - w, h, - 1 );\n\t\tsetPoint( 'n4', pointMap, geometry, _camera, w, h, - 1 );\n\n\t\t// far\n\n\t\tsetPoint( 'f1', pointMap, geometry, _camera, - w, - h, 1 );\n\t\tsetPoint( 'f2', pointMap, geometry, _camera, w, - h, 1 );\n\t\tsetPoint( 'f3', pointMap, geometry, _camera, - w, h, 1 );\n\t\tsetPoint( 'f4', pointMap, geometry, _camera, w, h, 1 );\n\n\t\t// up\n\n\t\tsetPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, - 1 );\n\t\tsetPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, - 1 );\n\t\tsetPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, - 1 );\n\n\t\t// cross\n\n\t\tsetPoint( 'cf1', pointMap, geometry, _camera, - w, 0, 1 );\n\t\tsetPoint( 'cf2', pointMap, geometry, _camera, w, 0, 1 );\n\t\tsetPoint( 'cf3', pointMap, geometry, _camera, 0, - h, 1 );\n\t\tsetPoint( 'cf4', pointMap, geometry, _camera, 0, h, 1 );\n\n\t\tsetPoint( 'cn1', pointMap, geometry, _camera, - w, 0, - 1 );\n\t\tsetPoint( 'cn2', pointMap, geometry, _camera, w, 0, - 1 );\n\t\tsetPoint( 'cn3', pointMap, geometry, _camera, 0, - h, - 1 );\n\t\tsetPoint( 'cn4', pointMap, geometry, _camera, 0, h, - 1 );\n\n\t\tgeometry.getAttribute( 'position' ).needsUpdate = true;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n\nfunction setPoint( point, pointMap, geometry, camera, x, y, z ) {\n\n\t_vector.set( x, y, z ).unproject( camera );\n\n\tconst points = pointMap[ point ];\n\n\tif ( points !== undefined ) {\n\n\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0, l = points.length; i < l; i ++ ) {\n\n\t\t\tposition.setXYZ( points[ i ], _vector.x, _vector.y, _vector.z );\n\n\t\t}\n\n\t}\n\n}\n\nconst _box = /*@__PURE__*/ new Box3();\n\nclass BoxHelper extends LineSegments {\n\n\tconstructor( object, color = 0xffff00 ) {\n\n\t\tconst indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );\n\t\tconst positions = new Float32Array( 8 * 3 );\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setIndex( new BufferAttribute( indices, 1 ) );\n\t\tgeometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) );\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\tthis.object = object;\n\t\tthis.type = 'BoxHelper';\n\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\t}\n\n\tupdate( object ) {\n\n\t\tif ( object !== undefined ) {\n\n\t\t\tconsole.warn( 'THREE.BoxHelper: .update() has no longer arguments.' );\n\n\t\t}\n\n\t\tif ( this.object !== undefined ) {\n\n\t\t\t_box.setFromObject( this.object );\n\n\t\t}\n\n\t\tif ( _box.isEmpty() ) return;\n\n\t\tconst min = _box.min;\n\t\tconst max = _box.max;\n\n\t\t/*\n\t\t\t5____4\n\t\t1/___0/|\n\t\t| 6__|_7\n\t\t2/___3/\n\n\t\t0: max.x, max.y, max.z\n\t\t1: min.x, max.y, max.z\n\t\t2: min.x, min.y, max.z\n\t\t3: max.x, min.y, max.z\n\t\t4: max.x, max.y, min.z\n\t\t5: min.x, max.y, min.z\n\t\t6: min.x, min.y, min.z\n\t\t7: max.x, min.y, min.z\n\t\t*/\n\n\t\tconst position = this.geometry.attributes.position;\n\t\tconst array = position.array;\n\n\t\tarray[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z;\n\t\tarray[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z;\n\t\tarray[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z;\n\t\tarray[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z;\n\t\tarray[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z;\n\t\tarray[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z;\n\t\tarray[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z;\n\t\tarray[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z;\n\n\t\tposition.needsUpdate = true;\n\n\t\tthis.geometry.computeBoundingSphere();\n\n\t}\n\n\tsetFromObject( object ) {\n\n\t\tthis.object = object;\n\t\tthis.update();\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.object = source.object;\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nclass Box3Helper extends LineSegments {\n\n\tconstructor( box, color = 0xffff00 ) {\n\n\t\tconst indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );\n\n\t\tconst positions = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 1, - 1, 1, - 1, - 1 ];\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tgeometry.setIndex( new BufferAttribute( indices, 1 ) );\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\tthis.box = box;\n\n\t\tthis.type = 'Box3Helper';\n\n\t\tthis.geometry.computeBoundingSphere();\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tconst box = this.box;\n\n\t\tif ( box.isEmpty() ) return;\n\n\t\tbox.getCenter( this.position );\n\n\t\tbox.getSize( this.scale );\n\n\t\tthis.scale.multiplyScalar( 0.5 );\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nclass PlaneHelper extends Line {\n\n\tconstructor( plane, size = 1, hex = 0xffff00 ) {\n\n\t\tconst color = hex;\n\n\t\tconst positions = [ 1, - 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, - 1, 0, 1, 1, 0 ];\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\t\tgeometry.computeBoundingSphere();\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\tthis.type = 'PlaneHelper';\n\n\t\tthis.plane = plane;\n\n\t\tthis.size = size;\n\n\t\tconst positions2 = [ 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, 1, 0, - 1, - 1, 0, 1, - 1, 0 ];\n\n\t\tconst geometry2 = new BufferGeometry();\n\t\tgeometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) );\n\t\tgeometry2.computeBoundingSphere();\n\n\t\tthis.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false } ) ) );\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tthis.position.set( 0, 0, 0 );\n\n\t\tthis.scale.set( 0.5 * this.size, 0.5 * this.size, 1 );\n\n\t\tthis.lookAt( this.plane.normal );\n\n\t\tthis.translateZ( - this.plane.constant );\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\t\tthis.children[ 0 ].geometry.dispose();\n\t\tthis.children[ 0 ].material.dispose();\n\n\t}\n\n}\n\nconst _axis = /*@__PURE__*/ new Vector3();\nlet _lineGeometry, _coneGeometry;\n\nclass ArrowHelper extends Object3D {\n\n\t// dir is assumed to be normalized\n\n\tconstructor( dir = new Vector3( 0, 0, 1 ), origin = new Vector3( 0, 0, 0 ), length = 1, color = 0xffff00, headLength = length * 0.2, headWidth = headLength * 0.2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ArrowHelper';\n\n\t\tif ( _lineGeometry === undefined ) {\n\n\t\t\t_lineGeometry = new BufferGeometry();\n\t\t\t_lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );\n\n\t\t\t_coneGeometry = new CylinderGeometry( 0, 0.5, 1, 5, 1 );\n\t\t\t_coneGeometry.translate( 0, - 0.5, 0 );\n\n\t\t}\n\n\t\tthis.position.copy( origin );\n\n\t\tthis.line = new Line( _lineGeometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\t\tthis.line.matrixAutoUpdate = false;\n\t\tthis.add( this.line );\n\n\t\tthis.cone = new Mesh( _coneGeometry, new MeshBasicMaterial( { color: color, toneMapped: false } ) );\n\t\tthis.cone.matrixAutoUpdate = false;\n\t\tthis.add( this.cone );\n\n\t\tthis.setDirection( dir );\n\t\tthis.setLength( length, headLength, headWidth );\n\n\t}\n\n\tsetDirection( dir ) {\n\n\t\t// dir is assumed to be normalized\n\n\t\tif ( dir.y > 0.99999 ) {\n\n\t\t\tthis.quaternion.set( 0, 0, 0, 1 );\n\n\t\t} else if ( dir.y < - 0.99999 ) {\n\n\t\t\tthis.quaternion.set( 1, 0, 0, 0 );\n\n\t\t} else {\n\n\t\t\t_axis.set( dir.z, 0, - dir.x ).normalize();\n\n\t\t\tconst radians = Math.acos( dir.y );\n\n\t\t\tthis.quaternion.setFromAxisAngle( _axis, radians );\n\n\t\t}\n\n\t}\n\n\tsetLength( length, headLength = length * 0.2, headWidth = headLength * 0.2 ) {\n\n\t\tthis.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458\n\t\tthis.line.updateMatrix();\n\n\t\tthis.cone.scale.set( headWidth, headLength, headWidth );\n\t\tthis.cone.position.y = length;\n\t\tthis.cone.updateMatrix();\n\n\t}\n\n\tsetColor( color ) {\n\n\t\tthis.line.material.color.set( color );\n\t\tthis.cone.material.color.set( color );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source, false );\n\n\t\tthis.line.copy( source.line );\n\t\tthis.cone.copy( source.cone );\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.line.geometry.dispose();\n\t\tthis.line.material.dispose();\n\t\tthis.cone.geometry.dispose();\n\t\tthis.cone.material.dispose();\n\n\t}\n\n}\n\nclass AxesHelper extends LineSegments {\n\n\tconstructor( size = 1 ) {\n\n\t\tconst vertices = [\n\t\t\t0, 0, 0,\tsize, 0, 0,\n\t\t\t0, 0, 0,\t0, size, 0,\n\t\t\t0, 0, 0,\t0, 0, size\n\t\t];\n\n\t\tconst colors = [\n\t\t\t1, 0, 0,\t1, 0.6, 0,\n\t\t\t0, 1, 0,\t0.6, 1, 0,\n\t\t\t0, 0, 1,\t0, 0.6, 1\n\t\t];\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'AxesHelper';\n\n\t}\n\n\tsetColors( xAxisColor, yAxisColor, zAxisColor ) {\n\n\t\tconst color = new Color();\n\t\tconst array = this.geometry.attributes.color.array;\n\n\t\tcolor.set( xAxisColor );\n\t\tcolor.toArray( array, 0 );\n\t\tcolor.toArray( array, 3 );\n\n\t\tcolor.set( yAxisColor );\n\t\tcolor.toArray( array, 6 );\n\t\tcolor.toArray( array, 9 );\n\n\t\tcolor.set( zAxisColor );\n\t\tcolor.toArray( array, 12 );\n\t\tcolor.toArray( array, 15 );\n\n\t\tthis.geometry.attributes.color.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nclass ShapePath {\n\n\tconstructor() {\n\n\t\tthis.type = 'ShapePath';\n\n\t\tthis.color = new Color();\n\n\t\tthis.subPaths = [];\n\t\tthis.currentPath = null;\n\n\t}\n\n\tmoveTo( x, y ) {\n\n\t\tthis.currentPath = new Path();\n\t\tthis.subPaths.push( this.currentPath );\n\t\tthis.currentPath.moveTo( x, y );\n\n\t\treturn this;\n\n\t}\n\n\tlineTo( x, y ) {\n\n\t\tthis.currentPath.lineTo( x, y );\n\n\t\treturn this;\n\n\t}\n\n\tquadraticCurveTo( aCPx, aCPy, aX, aY ) {\n\n\t\tthis.currentPath.quadraticCurveTo( aCPx, aCPy, aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\tbezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {\n\n\t\tthis.currentPath.bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\tsplineThru( pts ) {\n\n\t\tthis.currentPath.splineThru( pts );\n\n\t\treturn this;\n\n\t}\n\n\ttoShapes( isCCW ) {\n\n\t\tfunction toShapesNoHoles( inSubpaths ) {\n\n\t\t\tconst shapes = [];\n\n\t\t\tfor ( let i = 0, l = inSubpaths.length; i < l; i ++ ) {\n\n\t\t\t\tconst tmpPath = inSubpaths[ i ];\n\n\t\t\t\tconst tmpShape = new Shape();\n\t\t\t\ttmpShape.curves = tmpPath.curves;\n\n\t\t\t\tshapes.push( tmpShape );\n\n\t\t\t}\n\n\t\t\treturn shapes;\n\n\t\t}\n\n\t\tfunction isPointInsidePolygon( inPt, inPolygon ) {\n\n\t\t\tconst polyLen = inPolygon.length;\n\n\t\t\t// inPt on polygon contour => immediate success or\n\t\t\t// toggling of inside/outside at every single! intersection point of an edge\n\t\t\t// with the horizontal line through inPt, left of inPt\n\t\t\t// not counting lowerY endpoints of edges and whole edges on that line\n\t\t\tlet inside = false;\n\t\t\tfor ( let p = polyLen - 1, q = 0; q < polyLen; p = q ++ ) {\n\n\t\t\t\tlet edgeLowPt = inPolygon[ p ];\n\t\t\t\tlet edgeHighPt = inPolygon[ q ];\n\n\t\t\t\tlet edgeDx = edgeHighPt.x - edgeLowPt.x;\n\t\t\t\tlet edgeDy = edgeHighPt.y - edgeLowPt.y;\n\n\t\t\t\tif ( Math.abs( edgeDy ) > Number.EPSILON ) {\n\n\t\t\t\t\t// not parallel\n\t\t\t\t\tif ( edgeDy < 0 ) {\n\n\t\t\t\t\t\tedgeLowPt = inPolygon[ q ]; edgeDx = - edgeDx;\n\t\t\t\t\t\tedgeHighPt = inPolygon[ p ]; edgeDy = - edgeDy;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( inPt.y < edgeLowPt.y ) || ( inPt.y > edgeHighPt.y ) ) \t\tcontinue;\n\n\t\t\t\t\tif ( inPt.y === edgeLowPt.y ) {\n\n\t\t\t\t\t\tif ( inPt.x === edgeLowPt.x )\t\treturn\ttrue;\t\t// inPt is on contour ?\n\t\t\t\t\t\t// continue;\t\t\t\t// no intersection or edgeLowPt => doesn't count !!!\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst perpEdge = edgeDy * ( inPt.x - edgeLowPt.x ) - edgeDx * ( inPt.y - edgeLowPt.y );\n\t\t\t\t\t\tif ( perpEdge === 0 )\t\t\t\treturn\ttrue;\t\t// inPt is on contour ?\n\t\t\t\t\t\tif ( perpEdge < 0 ) \t\t\t\tcontinue;\n\t\t\t\t\t\tinside = ! inside;\t\t// true intersection left of inPt\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// parallel or collinear\n\t\t\t\t\tif ( inPt.y !== edgeLowPt.y ) \t\tcontinue;\t\t\t// parallel\n\t\t\t\t\t// edge lies on the same horizontal line as inPt\n\t\t\t\t\tif ( ( ( edgeHighPt.x <= inPt.x ) && ( inPt.x <= edgeLowPt.x ) ) ||\n\t\t\t\t\t\t ( ( edgeLowPt.x <= inPt.x ) && ( inPt.x <= edgeHighPt.x ) ) )\t\treturn\ttrue;\t// inPt: Point on contour !\n\t\t\t\t\t// continue;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn\tinside;\n\n\t\t}\n\n\t\tconst isClockWise = ShapeUtils.isClockWise;\n\n\t\tconst subPaths = this.subPaths;\n\t\tif ( subPaths.length === 0 ) return [];\n\n\t\tlet solid, tmpPath, tmpShape;\n\t\tconst shapes = [];\n\n\t\tif ( subPaths.length === 1 ) {\n\n\t\t\ttmpPath = subPaths[ 0 ];\n\t\t\ttmpShape = new Shape();\n\t\t\ttmpShape.curves = tmpPath.curves;\n\t\t\tshapes.push( tmpShape );\n\t\t\treturn shapes;\n\n\t\t}\n\n\t\tlet holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() );\n\t\tholesFirst = isCCW ? ! holesFirst : holesFirst;\n\n\t\t// console.log(\"Holes first\", holesFirst);\n\n\t\tconst betterShapeHoles = [];\n\t\tconst newShapes = [];\n\t\tlet newShapeHoles = [];\n\t\tlet mainIdx = 0;\n\t\tlet tmpPoints;\n\n\t\tnewShapes[ mainIdx ] = undefined;\n\t\tnewShapeHoles[ mainIdx ] = [];\n\n\t\tfor ( let i = 0, l = subPaths.length; i < l; i ++ ) {\n\n\t\t\ttmpPath = subPaths[ i ];\n\t\t\ttmpPoints = tmpPath.getPoints();\n\t\t\tsolid = isClockWise( tmpPoints );\n\t\t\tsolid = isCCW ? ! solid : solid;\n\n\t\t\tif ( solid ) {\n\n\t\t\t\tif ( ( ! holesFirst ) && ( newShapes[ mainIdx ] ) )\tmainIdx ++;\n\n\t\t\t\tnewShapes[ mainIdx ] = { s: new Shape(), p: tmpPoints };\n\t\t\t\tnewShapes[ mainIdx ].s.curves = tmpPath.curves;\n\n\t\t\t\tif ( holesFirst )\tmainIdx ++;\n\t\t\t\tnewShapeHoles[ mainIdx ] = [];\n\n\t\t\t\t//console.log('cw', i);\n\n\t\t\t} else {\n\n\t\t\t\tnewShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } );\n\n\t\t\t\t//console.log('ccw', i);\n\n\t\t\t}\n\n\t\t}\n\n\t\t// only Holes? -> probably all Shapes with wrong orientation\n\t\tif ( ! newShapes[ 0 ] )\treturn\ttoShapesNoHoles( subPaths );\n\n\n\t\tif ( newShapes.length > 1 ) {\n\n\t\t\tlet ambiguous = false;\n\t\t\tlet toChange = 0;\n\n\t\t\tfor ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) {\n\n\t\t\t\tbetterShapeHoles[ sIdx ] = [];\n\n\t\t\t}\n\n\t\t\tfor ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) {\n\n\t\t\t\tconst sho = newShapeHoles[ sIdx ];\n\n\t\t\t\tfor ( let hIdx = 0; hIdx < sho.length; hIdx ++ ) {\n\n\t\t\t\t\tconst ho = sho[ hIdx ];\n\t\t\t\t\tlet hole_unassigned = true;\n\n\t\t\t\t\tfor ( let s2Idx = 0; s2Idx < newShapes.length; s2Idx ++ ) {\n\n\t\t\t\t\t\tif ( isPointInsidePolygon( ho.p, newShapes[ s2Idx ].p ) ) {\n\n\t\t\t\t\t\t\tif ( sIdx !== s2Idx )\ttoChange ++;\n\n\t\t\t\t\t\t\tif ( hole_unassigned ) {\n\n\t\t\t\t\t\t\t\thole_unassigned = false;\n\t\t\t\t\t\t\t\tbetterShapeHoles[ s2Idx ].push( ho );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tambiguous = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( hole_unassigned ) {\n\n\t\t\t\t\t\tbetterShapeHoles[ sIdx ].push( ho );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( toChange > 0 && ambiguous === false ) {\n\n\t\t\t\tnewShapeHoles = betterShapeHoles;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlet tmpHoles;\n\n\t\tfor ( let i = 0, il = newShapes.length; i < il; i ++ ) {\n\n\t\t\ttmpShape = newShapes[ i ].s;\n\t\t\tshapes.push( tmpShape );\n\t\t\ttmpHoles = newShapeHoles[ i ];\n\n\t\t\tfor ( let j = 0, jl = tmpHoles.length; j < jl; j ++ ) {\n\n\t\t\t\ttmpShape.holes.push( tmpHoles[ j ].h );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//console.log(\"shape\", shapes);\n\n\t\treturn shapes;\n\n\t}\n\n}\n\nclass Controls extends EventDispatcher {\n\n\tconstructor( object, domElement = null ) {\n\n\t\tsuper();\n\n\t\tthis.object = object;\n\t\tthis.domElement = domElement;\n\n\t\tthis.enabled = true;\n\n\t\tthis.state = - 1;\n\n\t\tthis.keys = {};\n\t\tthis.mouseButtons = { LEFT: null, MIDDLE: null, RIGHT: null };\n\t\tthis.touches = { ONE: null, TWO: null };\n\n\t}\n\n\tconnect() {}\n\n\tdisconnect() {}\n\n\tdispose() {}\n\n\tupdate( /* delta */ ) {}\n\n}\n\nclass WebGLMultipleRenderTargets extends WebGLRenderTarget { // @deprecated, r162\n\n\tconstructor( width = 1, height = 1, count = 1, options = {} ) {\n\n\t\tconsole.warn( 'THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the \"count\" parameter to enable MRT.' );\n\n\t\tsuper( width, height, { ...options, count } );\n\n\t\tthis.isWebGLMultipleRenderTargets = true;\n\n\t}\n\n\tget texture() {\n\n\t\treturn this.textures;\n\n\t}\n\n}\n\nif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {\n\t\trevision: REVISION,\n\t} } ) );\n\n}\n\nif ( typeof window !== 'undefined' ) {\n\n\tif ( window.__THREE__ ) {\n\n\t\tconsole.warn( 'WARNING: Multiple instances of Three.js being imported.' );\n\n\t} else {\n\n\t\twindow.__THREE__ = REVISION;\n\n\t}\n\n}\n\nexport { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, Controls, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, MOUSE, Material, MaterialLoader, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderTarget, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingGeometry, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TextureUtils, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsLib, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLMultipleRenderTargets, WebGLRenderTarget, WebGLRenderer, WebGLUtils, WebGPUCoordinateSystem, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, createCanvasElement };\n","import * as THREE from 'three'\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'\n\nimport {\n CameraManagerInterface,\n CameraState,\n CameraType,\n EventManagerInterface,\n NodeStorageInterface\n} from './interfaces'\n\nexport class CameraManager implements CameraManagerInterface {\n perspectiveCamera: THREE.PerspectiveCamera\n orthographicCamera: THREE.OrthographicCamera\n activeCamera: THREE.Camera\n\n private renderer: THREE.WebGLRenderer\n private eventManager: EventManagerInterface\n private nodeStorage: NodeStorageInterface\n\n private controls: OrbitControls | null = null\n\n DEFAULT_DISTANCE = 10\n DEFAULT_LOOK_AT = 0\n\n DEFAULT_CAMERA = {\n near: 0.01,\n far: 10000\n }\n\n DEFAULT_PERSPECTIVE_CAMERA = {\n fov: 35,\n aspect: 1\n }\n\n DEFAULT_FRUSTUM_SIZE = 10\n\n DEFAULT_ORTHOGRAPHIC_CAMERA = {\n left: -this.DEFAULT_FRUSTUM_SIZE / 2,\n right: this.DEFAULT_FRUSTUM_SIZE / 2,\n top: this.DEFAULT_FRUSTUM_SIZE / 2,\n bottom: -this.DEFAULT_FRUSTUM_SIZE / 2\n }\n\n constructor(\n renderer: THREE.WebGLRenderer,\n eventManager: EventManagerInterface,\n nodeStorage: NodeStorageInterface\n ) {\n this.renderer = renderer\n this.eventManager = eventManager\n this.nodeStorage = nodeStorage\n\n this.perspectiveCamera = new THREE.PerspectiveCamera(\n this.DEFAULT_PERSPECTIVE_CAMERA.fov,\n this.DEFAULT_PERSPECTIVE_CAMERA.aspect,\n this.DEFAULT_CAMERA.near,\n this.DEFAULT_CAMERA.far\n )\n\n this.orthographicCamera = new THREE.OrthographicCamera(\n this.DEFAULT_ORTHOGRAPHIC_CAMERA.left,\n this.DEFAULT_ORTHOGRAPHIC_CAMERA.right,\n this.DEFAULT_ORTHOGRAPHIC_CAMERA.top,\n this.DEFAULT_ORTHOGRAPHIC_CAMERA.bottom,\n this.DEFAULT_CAMERA.near,\n this.DEFAULT_CAMERA.far\n )\n\n this.reset()\n\n this.activeCamera = this.perspectiveCamera\n }\n\n init(): void {}\n\n dispose(): void {}\n\n setControls(controls: OrbitControls): void {\n this.controls = controls\n\n if (this.controls) {\n this.controls.addEventListener('end', () => {\n this.nodeStorage.storeNodeProperty('Camera Info', this.getCameraState())\n })\n }\n }\n\n getCurrentCameraType(): CameraType {\n return this.activeCamera === this.perspectiveCamera\n ? 'perspective'\n : 'orthographic'\n }\n\n toggleCamera(cameraType?: CameraType): void {\n const oldCamera = this.activeCamera\n\n const position = oldCamera.position.clone()\n const rotation = oldCamera.rotation.clone()\n const target = this.controls?.target.clone() || new THREE.Vector3()\n\n const oldZoom =\n oldCamera instanceof THREE.OrthographicCamera\n ? oldCamera.zoom\n : (oldCamera as THREE.PerspectiveCamera).zoom\n\n if (!cameraType) {\n this.activeCamera =\n oldCamera === this.perspectiveCamera\n ? this.orthographicCamera\n : this.perspectiveCamera\n } else {\n this.activeCamera =\n cameraType === 'perspective'\n ? this.perspectiveCamera\n : this.orthographicCamera\n\n if (oldCamera === this.activeCamera) {\n return\n }\n }\n\n this.activeCamera.position.copy(position)\n this.activeCamera.rotation.copy(rotation)\n\n if (this.activeCamera instanceof THREE.OrthographicCamera) {\n this.activeCamera.zoom = oldZoom\n this.activeCamera.updateProjectionMatrix()\n } else if (this.activeCamera instanceof THREE.PerspectiveCamera) {\n this.activeCamera.zoom = oldZoom\n this.activeCamera.updateProjectionMatrix()\n }\n\n if (this.controls) {\n this.controls.object = this.activeCamera\n this.controls.target.copy(target)\n this.controls.update()\n }\n\n this.eventManager.emitEvent('cameraTypeChange', cameraType)\n }\n\n setFOV(fov: number): void {\n if (this.activeCamera === this.perspectiveCamera) {\n this.perspectiveCamera.fov = fov\n this.perspectiveCamera.updateProjectionMatrix()\n }\n\n this.eventManager.emitEvent('fovChange', fov)\n }\n\n getCameraState(): CameraState {\n return {\n position: this.activeCamera.position.clone(),\n target: this.controls?.target.clone() || new THREE.Vector3(),\n zoom:\n this.activeCamera instanceof THREE.OrthographicCamera\n ? this.activeCamera.zoom\n : (this.activeCamera as THREE.PerspectiveCamera).zoom,\n cameraType: this.getCurrentCameraType()\n }\n }\n\n setCameraState(state: CameraState): void {\n this.activeCamera.position.copy(state.position)\n\n this.controls?.target.copy(state.target)\n\n if (this.activeCamera instanceof THREE.OrthographicCamera) {\n this.activeCamera.zoom = state.zoom\n this.activeCamera.updateProjectionMatrix()\n } else if (this.activeCamera instanceof THREE.PerspectiveCamera) {\n this.activeCamera.zoom = state.zoom\n this.activeCamera.updateProjectionMatrix()\n }\n\n this.controls?.update()\n }\n\n handleResize(width: number, height: number): void {\n if (this.activeCamera === this.perspectiveCamera) {\n this.perspectiveCamera.aspect = width / height\n this.perspectiveCamera.updateProjectionMatrix()\n } else {\n const frustumSize = 10\n const aspect = width / height\n this.orthographicCamera.left = (-frustumSize * aspect) / 2\n this.orthographicCamera.right = (frustumSize * aspect) / 2\n this.orthographicCamera.top = frustumSize / 2\n this.orthographicCamera.bottom = -frustumSize / 2\n this.orthographicCamera.updateProjectionMatrix()\n }\n }\n\n setupForModel(size: THREE.Vector3): void {\n const distance = Math.max(size.x, size.z) * 2\n const height = size.y * 2\n\n this.perspectiveCamera.position.set(distance, height, distance)\n this.orthographicCamera.position.set(distance, height, distance)\n\n if (this.activeCamera === this.perspectiveCamera) {\n this.perspectiveCamera.lookAt(0, size.y / 2, 0)\n this.perspectiveCamera.updateProjectionMatrix()\n } else {\n const frustumSize = Math.max(size.x, size.y, size.z) * 2\n const aspect = this.perspectiveCamera.aspect\n this.orthographicCamera.left = (-frustumSize * aspect) / 2\n this.orthographicCamera.right = (frustumSize * aspect) / 2\n this.orthographicCamera.top = frustumSize / 2\n this.orthographicCamera.bottom = -frustumSize / 2\n this.orthographicCamera.lookAt(0, size.y / 2, 0)\n this.orthographicCamera.updateProjectionMatrix()\n }\n\n this.controls?.target.set(0, size.y / 2, 0)\n this.controls?.update()\n }\n\n reset(): void {\n this.perspectiveCamera.position.set(\n this.DEFAULT_DISTANCE,\n this.DEFAULT_DISTANCE,\n this.DEFAULT_DISTANCE\n )\n\n this.orthographicCamera.position.set(\n this.DEFAULT_DISTANCE,\n this.DEFAULT_DISTANCE,\n this.DEFAULT_DISTANCE\n )\n\n this.perspectiveCamera.lookAt(\n this.DEFAULT_LOOK_AT,\n this.DEFAULT_LOOK_AT,\n this.DEFAULT_LOOK_AT\n )\n this.orthographicCamera.lookAt(\n this.DEFAULT_LOOK_AT,\n this.DEFAULT_LOOK_AT,\n this.DEFAULT_LOOK_AT\n )\n\n this.perspectiveCamera.updateProjectionMatrix()\n this.orthographicCamera.updateProjectionMatrix()\n }\n}\n","import {\n\tControls,\n\tMOUSE,\n\tQuaternion,\n\tSpherical,\n\tTOUCH,\n\tVector2,\n\tVector3,\n\tPlane,\n\tRay,\n\tMathUtils\n} from 'three';\n\n// OrbitControls performs orbiting, dollying (zooming), and panning.\n// Unlike TrackballControls, it maintains the \"up\" direction object.up (+Y by default).\n//\n// Orbit - left mouse / touch: one-finger move\n// Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish\n// Pan - right mouse, or left mouse + ctrl/meta/shiftKey, or arrow keys / touch: two-finger move\n\nconst _changeEvent = { type: 'change' };\nconst _startEvent = { type: 'start' };\nconst _endEvent = { type: 'end' };\nconst _ray = new Ray();\nconst _plane = new Plane();\nconst _TILT_LIMIT = Math.cos( 70 * MathUtils.DEG2RAD );\n\nconst _v = new Vector3();\nconst _twoPI = 2 * Math.PI;\n\nconst _STATE = {\n\tNONE: - 1,\n\tROTATE: 0,\n\tDOLLY: 1,\n\tPAN: 2,\n\tTOUCH_ROTATE: 3,\n\tTOUCH_PAN: 4,\n\tTOUCH_DOLLY_PAN: 5,\n\tTOUCH_DOLLY_ROTATE: 6\n};\nconst _EPS = 0.000001;\n\nclass OrbitControls extends Controls {\n\n\tconstructor( object, domElement = null ) {\n\n\t\tsuper( object, domElement );\n\n\t\tthis.state = _STATE.NONE;\n\n\t\t// Set to false to disable this control\n\t\tthis.enabled = true;\n\n\t\t// \"target\" sets the location of focus, where the object orbits around\n\t\tthis.target = new Vector3();\n\n\t\t// Sets the 3D cursor (similar to Blender), from which the maxTargetRadius takes effect\n\t\tthis.cursor = new Vector3();\n\n\t\t// How far you can dolly in and out ( PerspectiveCamera only )\n\t\tthis.minDistance = 0;\n\t\tthis.maxDistance = Infinity;\n\n\t\t// How far you can zoom in and out ( OrthographicCamera only )\n\t\tthis.minZoom = 0;\n\t\tthis.maxZoom = Infinity;\n\n\t\t// Limit camera target within a spherical area around the cursor\n\t\tthis.minTargetRadius = 0;\n\t\tthis.maxTargetRadius = Infinity;\n\n\t\t// How far you can orbit vertically, upper and lower limits.\n\t\t// Range is 0 to Math.PI radians.\n\t\tthis.minPolarAngle = 0; // radians\n\t\tthis.maxPolarAngle = Math.PI; // radians\n\n\t\t// How far you can orbit horizontally, upper and lower limits.\n\t\t// If set, the interval [ min, max ] must be a sub-interval of [ - 2 PI, 2 PI ], with ( max - min < 2 PI )\n\t\tthis.minAzimuthAngle = - Infinity; // radians\n\t\tthis.maxAzimuthAngle = Infinity; // radians\n\n\t\t// Set to true to enable damping (inertia)\n\t\t// If damping is enabled, you must call controls.update() in your animation loop\n\t\tthis.enableDamping = false;\n\t\tthis.dampingFactor = 0.05;\n\n\t\t// This option actually enables dollying in and out; left as \"zoom\" for backwards compatibility.\n\t\t// Set to false to disable zooming\n\t\tthis.enableZoom = true;\n\t\tthis.zoomSpeed = 1.0;\n\n\t\t// Set to false to disable rotating\n\t\tthis.enableRotate = true;\n\t\tthis.rotateSpeed = 1.0;\n\n\t\t// Set to false to disable panning\n\t\tthis.enablePan = true;\n\t\tthis.panSpeed = 1.0;\n\t\tthis.screenSpacePanning = true; // if false, pan orthogonal to world-space direction camera.up\n\t\tthis.keyPanSpeed = 7.0;\t// pixels moved per arrow key push\n\t\tthis.zoomToCursor = false;\n\n\t\t// Set to true to automatically rotate around the target\n\t\t// If auto-rotate is enabled, you must call controls.update() in your animation loop\n\t\tthis.autoRotate = false;\n\t\tthis.autoRotateSpeed = 2.0; // 30 seconds per orbit when fps is 60\n\n\t\t// The four arrow keys\n\t\tthis.keys = { LEFT: 'ArrowLeft', UP: 'ArrowUp', RIGHT: 'ArrowRight', BOTTOM: 'ArrowDown' };\n\n\t\t// Mouse buttons\n\t\tthis.mouseButtons = { LEFT: MOUSE.ROTATE, MIDDLE: MOUSE.DOLLY, RIGHT: MOUSE.PAN };\n\n\t\t// Touch fingers\n\t\tthis.touches = { ONE: TOUCH.ROTATE, TWO: TOUCH.DOLLY_PAN };\n\n\t\t// for reset\n\t\tthis.target0 = this.target.clone();\n\t\tthis.position0 = this.object.position.clone();\n\t\tthis.zoom0 = this.object.zoom;\n\n\t\t// the target DOM element for key events\n\t\tthis._domElementKeyEvents = null;\n\n\t\t// internals\n\n\t\tthis._lastPosition = new Vector3();\n\t\tthis._lastQuaternion = new Quaternion();\n\t\tthis._lastTargetPosition = new Vector3();\n\n\t\t// so camera.up is the orbit axis\n\t\tthis._quat = new Quaternion().setFromUnitVectors( object.up, new Vector3( 0, 1, 0 ) );\n\t\tthis._quatInverse = this._quat.clone().invert();\n\n\t\t// current position in spherical coordinates\n\t\tthis._spherical = new Spherical();\n\t\tthis._sphericalDelta = new Spherical();\n\n\t\tthis._scale = 1;\n\t\tthis._panOffset = new Vector3();\n\n\t\tthis._rotateStart = new Vector2();\n\t\tthis._rotateEnd = new Vector2();\n\t\tthis._rotateDelta = new Vector2();\n\n\t\tthis._panStart = new Vector2();\n\t\tthis._panEnd = new Vector2();\n\t\tthis._panDelta = new Vector2();\n\n\t\tthis._dollyStart = new Vector2();\n\t\tthis._dollyEnd = new Vector2();\n\t\tthis._dollyDelta = new Vector2();\n\n\t\tthis._dollyDirection = new Vector3();\n\t\tthis._mouse = new Vector2();\n\t\tthis._performCursorZoom = false;\n\n\t\tthis._pointers = [];\n\t\tthis._pointerPositions = {};\n\n\t\tthis._controlActive = false;\n\n\t\t// event listeners\n\n\t\tthis._onPointerMove = onPointerMove.bind( this );\n\t\tthis._onPointerDown = onPointerDown.bind( this );\n\t\tthis._onPointerUp = onPointerUp.bind( this );\n\t\tthis._onContextMenu = onContextMenu.bind( this );\n\t\tthis._onMouseWheel = onMouseWheel.bind( this );\n\t\tthis._onKeyDown = onKeyDown.bind( this );\n\n\t\tthis._onTouchStart = onTouchStart.bind( this );\n\t\tthis._onTouchMove = onTouchMove.bind( this );\n\n\t\tthis._onMouseDown = onMouseDown.bind( this );\n\t\tthis._onMouseMove = onMouseMove.bind( this );\n\n\t\tthis._interceptControlDown = interceptControlDown.bind( this );\n\t\tthis._interceptControlUp = interceptControlUp.bind( this );\n\n\t\t//\n\n\t\tif ( this.domElement !== null ) {\n\n\t\t\tthis.connect();\n\n\t\t}\n\n\t\tthis.update();\n\n\t}\n\n\tconnect() {\n\n\t\tthis.domElement.addEventListener( 'pointerdown', this._onPointerDown );\n\t\tthis.domElement.addEventListener( 'pointercancel', this._onPointerUp );\n\n\t\tthis.domElement.addEventListener( 'contextmenu', this._onContextMenu );\n\t\tthis.domElement.addEventListener( 'wheel', this._onMouseWheel, { passive: false } );\n\n\t\tconst document = this.domElement.getRootNode(); // offscreen canvas compatibility\n\t\tdocument.addEventListener( 'keydown', this._interceptControlDown, { passive: true, capture: true } );\n\n\t\tthis.domElement.style.touchAction = 'none'; // disable touch scroll\n\n\t}\n\n\tdisconnect() {\n\n\t\tthis.domElement.removeEventListener( 'pointerdown', this._onPointerDown );\n\t\tthis.domElement.removeEventListener( 'pointermove', this._onPointerMove );\n\t\tthis.domElement.removeEventListener( 'pointerup', this._onPointerUp );\n\t\tthis.domElement.removeEventListener( 'pointercancel', this._onPointerUp );\n\n\t\tthis.domElement.removeEventListener( 'wheel', this._onMouseWheel );\n\t\tthis.domElement.removeEventListener( 'contextmenu', this._onContextMenu );\n\n\t\tthis.stopListenToKeyEvents();\n\n\t\tconst document = this.domElement.getRootNode(); // offscreen canvas compatibility\n\t\tdocument.removeEventListener( 'keydown', this._interceptControlDown, { capture: true } );\n\n\t\tthis.domElement.style.touchAction = 'auto';\n\n\t}\n\n\tdispose() {\n\n\t\tthis.disconnect();\n\n\t}\n\n\tgetPolarAngle() {\n\n\t\treturn this._spherical.phi;\n\n\t}\n\n\tgetAzimuthalAngle() {\n\n\t\treturn this._spherical.theta;\n\n\t}\n\n\tgetDistance() {\n\n\t\treturn this.object.position.distanceTo( this.target );\n\n\t}\n\n\tlistenToKeyEvents( domElement ) {\n\n\t\tdomElement.addEventListener( 'keydown', this._onKeyDown );\n\t\tthis._domElementKeyEvents = domElement;\n\n\t}\n\n\tstopListenToKeyEvents() {\n\n\t\tif ( this._domElementKeyEvents !== null ) {\n\n\t\t\tthis._domElementKeyEvents.removeEventListener( 'keydown', this._onKeyDown );\n\t\t\tthis._domElementKeyEvents = null;\n\n\t\t}\n\n\t}\n\n\tsaveState() {\n\n\t\tthis.target0.copy( this.target );\n\t\tthis.position0.copy( this.object.position );\n\t\tthis.zoom0 = this.object.zoom;\n\n\t}\n\n\treset() {\n\n\t\tthis.target.copy( this.target0 );\n\t\tthis.object.position.copy( this.position0 );\n\t\tthis.object.zoom = this.zoom0;\n\n\t\tthis.object.updateProjectionMatrix();\n\t\tthis.dispatchEvent( _changeEvent );\n\n\t\tthis.update();\n\n\t\tthis.state = _STATE.NONE;\n\n\t}\n\n\tupdate( deltaTime = null ) {\n\n\t\tconst position = this.object.position;\n\n\t\t_v.copy( position ).sub( this.target );\n\n\t\t// rotate offset to \"y-axis-is-up\" space\n\t\t_v.applyQuaternion( this._quat );\n\n\t\t// angle from z-axis around y-axis\n\t\tthis._spherical.setFromVector3( _v );\n\n\t\tif ( this.autoRotate && this.state === _STATE.NONE ) {\n\n\t\t\tthis._rotateLeft( this._getAutoRotationAngle( deltaTime ) );\n\n\t\t}\n\n\t\tif ( this.enableDamping ) {\n\n\t\t\tthis._spherical.theta += this._sphericalDelta.theta * this.dampingFactor;\n\t\t\tthis._spherical.phi += this._sphericalDelta.phi * this.dampingFactor;\n\n\t\t} else {\n\n\t\t\tthis._spherical.theta += this._sphericalDelta.theta;\n\t\t\tthis._spherical.phi += this._sphericalDelta.phi;\n\n\t\t}\n\n\t\t// restrict theta to be between desired limits\n\n\t\tlet min = this.minAzimuthAngle;\n\t\tlet max = this.maxAzimuthAngle;\n\n\t\tif ( isFinite( min ) && isFinite( max ) ) {\n\n\t\t\tif ( min < - Math.PI ) min += _twoPI; else if ( min > Math.PI ) min -= _twoPI;\n\n\t\t\tif ( max < - Math.PI ) max += _twoPI; else if ( max > Math.PI ) max -= _twoPI;\n\n\t\t\tif ( min <= max ) {\n\n\t\t\t\tthis._spherical.theta = Math.max( min, Math.min( max, this._spherical.theta ) );\n\n\t\t\t} else {\n\n\t\t\t\tthis._spherical.theta = ( this._spherical.theta > ( min + max ) / 2 ) ?\n\t\t\t\t\tMath.max( min, this._spherical.theta ) :\n\t\t\t\t\tMath.min( max, this._spherical.theta );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// restrict phi to be between desired limits\n\t\tthis._spherical.phi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, this._spherical.phi ) );\n\n\t\tthis._spherical.makeSafe();\n\n\n\t\t// move target to panned location\n\n\t\tif ( this.enableDamping === true ) {\n\n\t\t\tthis.target.addScaledVector( this._panOffset, this.dampingFactor );\n\n\t\t} else {\n\n\t\t\tthis.target.add( this._panOffset );\n\n\t\t}\n\n\t\t// Limit the target distance from the cursor to create a sphere around the center of interest\n\t\tthis.target.sub( this.cursor );\n\t\tthis.target.clampLength( this.minTargetRadius, this.maxTargetRadius );\n\t\tthis.target.add( this.cursor );\n\n\t\tlet zoomChanged = false;\n\t\t// adjust the camera position based on zoom only if we're not zooming to the cursor or if it's an ortho camera\n\t\t// we adjust zoom later in these cases\n\t\tif ( this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera ) {\n\n\t\t\tthis._spherical.radius = this._clampDistance( this._spherical.radius );\n\n\t\t} else {\n\n\t\t\tconst prevRadius = this._spherical.radius;\n\t\t\tthis._spherical.radius = this._clampDistance( this._spherical.radius * this._scale );\n\t\t\tzoomChanged = prevRadius != this._spherical.radius;\n\n\t\t}\n\n\t\t_v.setFromSpherical( this._spherical );\n\n\t\t// rotate offset back to \"camera-up-vector-is-up\" space\n\t\t_v.applyQuaternion( this._quatInverse );\n\n\t\tposition.copy( this.target ).add( _v );\n\n\t\tthis.object.lookAt( this.target );\n\n\t\tif ( this.enableDamping === true ) {\n\n\t\t\tthis._sphericalDelta.theta *= ( 1 - this.dampingFactor );\n\t\t\tthis._sphericalDelta.phi *= ( 1 - this.dampingFactor );\n\n\t\t\tthis._panOffset.multiplyScalar( 1 - this.dampingFactor );\n\n\t\t} else {\n\n\t\t\tthis._sphericalDelta.set( 0, 0, 0 );\n\n\t\t\tthis._panOffset.set( 0, 0, 0 );\n\n\t\t}\n\n\t\t// adjust camera position\n\t\tif ( this.zoomToCursor && this._performCursorZoom ) {\n\n\t\t\tlet newRadius = null;\n\t\t\tif ( this.object.isPerspectiveCamera ) {\n\n\t\t\t\t// move the camera down the pointer ray\n\t\t\t\t// this method avoids floating point error\n\t\t\t\tconst prevRadius = _v.length();\n\t\t\t\tnewRadius = this._clampDistance( prevRadius * this._scale );\n\n\t\t\t\tconst radiusDelta = prevRadius - newRadius;\n\t\t\t\tthis.object.position.addScaledVector( this._dollyDirection, radiusDelta );\n\t\t\t\tthis.object.updateMatrixWorld();\n\n\t\t\t\tzoomChanged = !! radiusDelta;\n\n\t\t\t} else if ( this.object.isOrthographicCamera ) {\n\n\t\t\t\t// adjust the ortho camera position based on zoom changes\n\t\t\t\tconst mouseBefore = new Vector3( this._mouse.x, this._mouse.y, 0 );\n\t\t\t\tmouseBefore.unproject( this.object );\n\n\t\t\t\tconst prevZoom = this.object.zoom;\n\t\t\t\tthis.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom / this._scale ) );\n\t\t\t\tthis.object.updateProjectionMatrix();\n\n\t\t\t\tzoomChanged = prevZoom !== this.object.zoom;\n\n\t\t\t\tconst mouseAfter = new Vector3( this._mouse.x, this._mouse.y, 0 );\n\t\t\t\tmouseAfter.unproject( this.object );\n\n\t\t\t\tthis.object.position.sub( mouseAfter ).add( mouseBefore );\n\t\t\t\tthis.object.updateMatrixWorld();\n\n\t\t\t\tnewRadius = _v.length();\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.' );\n\t\t\t\tthis.zoomToCursor = false;\n\n\t\t\t}\n\n\t\t\t// handle the placement of the target\n\t\t\tif ( newRadius !== null ) {\n\n\t\t\t\tif ( this.screenSpacePanning ) {\n\n\t\t\t\t\t// position the orbit target in front of the new camera position\n\t\t\t\t\tthis.target.set( 0, 0, - 1 )\n\t\t\t\t\t\t.transformDirection( this.object.matrix )\n\t\t\t\t\t\t.multiplyScalar( newRadius )\n\t\t\t\t\t\t.add( this.object.position );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// get the ray and translation plane to compute target\n\t\t\t\t\t_ray.origin.copy( this.object.position );\n\t\t\t\t\t_ray.direction.set( 0, 0, - 1 ).transformDirection( this.object.matrix );\n\n\t\t\t\t\t// if the camera is 20 degrees above the horizon then don't adjust the focus target to avoid\n\t\t\t\t\t// extremely large values\n\t\t\t\t\tif ( Math.abs( this.object.up.dot( _ray.direction ) ) < _TILT_LIMIT ) {\n\n\t\t\t\t\t\tthis.object.lookAt( this.target );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_plane.setFromNormalAndCoplanarPoint( this.object.up, this.target );\n\t\t\t\t\t\t_ray.intersectPlane( _plane, this.target );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( this.object.isOrthographicCamera ) {\n\n\t\t\tconst prevZoom = this.object.zoom;\n\t\t\tthis.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom / this._scale ) );\n\n\t\t\tif ( prevZoom !== this.object.zoom ) {\n\n\t\t\t\tthis.object.updateProjectionMatrix();\n\t\t\t\tzoomChanged = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._scale = 1;\n\t\tthis._performCursorZoom = false;\n\n\t\t// update condition is:\n\t\t// min(camera displacement, camera rotation in radians)^2 > EPS\n\t\t// using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\n\t\tif ( zoomChanged ||\n\t\t\tthis._lastPosition.distanceToSquared( this.object.position ) > _EPS ||\n\t\t\t8 * ( 1 - this._lastQuaternion.dot( this.object.quaternion ) ) > _EPS ||\n\t\t\tthis._lastTargetPosition.distanceToSquared( this.target ) > _EPS ) {\n\n\t\t\tthis.dispatchEvent( _changeEvent );\n\n\t\t\tthis._lastPosition.copy( this.object.position );\n\t\t\tthis._lastQuaternion.copy( this.object.quaternion );\n\t\t\tthis._lastTargetPosition.copy( this.target );\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\t_getAutoRotationAngle( deltaTime ) {\n\n\t\tif ( deltaTime !== null ) {\n\n\t\t\treturn ( _twoPI / 60 * this.autoRotateSpeed ) * deltaTime;\n\n\t\t} else {\n\n\t\t\treturn _twoPI / 60 / 60 * this.autoRotateSpeed;\n\n\t\t}\n\n\t}\n\n\t_getZoomScale( delta ) {\n\n\t\tconst normalizedDelta = Math.abs( delta * 0.01 );\n\t\treturn Math.pow( 0.95, this.zoomSpeed * normalizedDelta );\n\n\t}\n\n\t_rotateLeft( angle ) {\n\n\t\tthis._sphericalDelta.theta -= angle;\n\n\t}\n\n\t_rotateUp( angle ) {\n\n\t\tthis._sphericalDelta.phi -= angle;\n\n\t}\n\n\t_panLeft( distance, objectMatrix ) {\n\n\t\t_v.setFromMatrixColumn( objectMatrix, 0 ); // get X column of objectMatrix\n\t\t_v.multiplyScalar( - distance );\n\n\t\tthis._panOffset.add( _v );\n\n\t}\n\n\t_panUp( distance, objectMatrix ) {\n\n\t\tif ( this.screenSpacePanning === true ) {\n\n\t\t\t_v.setFromMatrixColumn( objectMatrix, 1 );\n\n\t\t} else {\n\n\t\t\t_v.setFromMatrixColumn( objectMatrix, 0 );\n\t\t\t_v.crossVectors( this.object.up, _v );\n\n\t\t}\n\n\t\t_v.multiplyScalar( distance );\n\n\t\tthis._panOffset.add( _v );\n\n\t}\n\n\t// deltaX and deltaY are in pixels; right and down are positive\n\t_pan( deltaX, deltaY ) {\n\n\t\tconst element = this.domElement;\n\n\t\tif ( this.object.isPerspectiveCamera ) {\n\n\t\t\t// perspective\n\t\t\tconst position = this.object.position;\n\t\t\t_v.copy( position ).sub( this.target );\n\t\t\tlet targetDistance = _v.length();\n\n\t\t\t// half of the fov is center to top of screen\n\t\t\ttargetDistance *= Math.tan( ( this.object.fov / 2 ) * Math.PI / 180.0 );\n\n\t\t\t// we use only clientHeight here so aspect ratio does not distort speed\n\t\t\tthis._panLeft( 2 * deltaX * targetDistance / element.clientHeight, this.object.matrix );\n\t\t\tthis._panUp( 2 * deltaY * targetDistance / element.clientHeight, this.object.matrix );\n\n\t\t} else if ( this.object.isOrthographicCamera ) {\n\n\t\t\t// orthographic\n\t\t\tthis._panLeft( deltaX * ( this.object.right - this.object.left ) / this.object.zoom / element.clientWidth, this.object.matrix );\n\t\t\tthis._panUp( deltaY * ( this.object.top - this.object.bottom ) / this.object.zoom / element.clientHeight, this.object.matrix );\n\n\t\t} else {\n\n\t\t\t// camera neither orthographic nor perspective\n\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );\n\t\t\tthis.enablePan = false;\n\n\t\t}\n\n\t}\n\n\t_dollyOut( dollyScale ) {\n\n\t\tif ( this.object.isPerspectiveCamera || this.object.isOrthographicCamera ) {\n\n\t\t\tthis._scale /= dollyScale;\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\t\t\tthis.enableZoom = false;\n\n\t\t}\n\n\t}\n\n\t_dollyIn( dollyScale ) {\n\n\t\tif ( this.object.isPerspectiveCamera || this.object.isOrthographicCamera ) {\n\n\t\t\tthis._scale *= dollyScale;\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\t\t\tthis.enableZoom = false;\n\n\t\t}\n\n\t}\n\n\t_updateZoomParameters( x, y ) {\n\n\t\tif ( ! this.zoomToCursor ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._performCursorZoom = true;\n\n\t\tconst rect = this.domElement.getBoundingClientRect();\n\t\tconst dx = x - rect.left;\n\t\tconst dy = y - rect.top;\n\t\tconst w = rect.width;\n\t\tconst h = rect.height;\n\n\t\tthis._mouse.x = ( dx / w ) * 2 - 1;\n\t\tthis._mouse.y = - ( dy / h ) * 2 + 1;\n\n\t\tthis._dollyDirection.set( this._mouse.x, this._mouse.y, 1 ).unproject( this.object ).sub( this.object.position ).normalize();\n\n\t}\n\n\t_clampDistance( dist ) {\n\n\t\treturn Math.max( this.minDistance, Math.min( this.maxDistance, dist ) );\n\n\t}\n\n\t//\n\t// event callbacks - update the object state\n\t//\n\n\t_handleMouseDownRotate( event ) {\n\n\t\tthis._rotateStart.set( event.clientX, event.clientY );\n\n\t}\n\n\t_handleMouseDownDolly( event ) {\n\n\t\tthis._updateZoomParameters( event.clientX, event.clientX );\n\t\tthis._dollyStart.set( event.clientX, event.clientY );\n\n\t}\n\n\t_handleMouseDownPan( event ) {\n\n\t\tthis._panStart.set( event.clientX, event.clientY );\n\n\t}\n\n\t_handleMouseMoveRotate( event ) {\n\n\t\tthis._rotateEnd.set( event.clientX, event.clientY );\n\n\t\tthis._rotateDelta.subVectors( this._rotateEnd, this._rotateStart ).multiplyScalar( this.rotateSpeed );\n\n\t\tconst element = this.domElement;\n\n\t\tthis._rotateLeft( _twoPI * this._rotateDelta.x / element.clientHeight ); // yes, height\n\n\t\tthis._rotateUp( _twoPI * this._rotateDelta.y / element.clientHeight );\n\n\t\tthis._rotateStart.copy( this._rotateEnd );\n\n\t\tthis.update();\n\n\t}\n\n\t_handleMouseMoveDolly( event ) {\n\n\t\tthis._dollyEnd.set( event.clientX, event.clientY );\n\n\t\tthis._dollyDelta.subVectors( this._dollyEnd, this._dollyStart );\n\n\t\tif ( this._dollyDelta.y > 0 ) {\n\n\t\t\tthis._dollyOut( this._getZoomScale( this._dollyDelta.y ) );\n\n\t\t} else if ( this._dollyDelta.y < 0 ) {\n\n\t\t\tthis._dollyIn( this._getZoomScale( this._dollyDelta.y ) );\n\n\t\t}\n\n\t\tthis._dollyStart.copy( this._dollyEnd );\n\n\t\tthis.update();\n\n\t}\n\n\t_handleMouseMovePan( event ) {\n\n\t\tthis._panEnd.set( event.clientX, event.clientY );\n\n\t\tthis._panDelta.subVectors( this._panEnd, this._panStart ).multiplyScalar( this.panSpeed );\n\n\t\tthis._pan( this._panDelta.x, this._panDelta.y );\n\n\t\tthis._panStart.copy( this._panEnd );\n\n\t\tthis.update();\n\n\t}\n\n\t_handleMouseWheel( event ) {\n\n\t\tthis._updateZoomParameters( event.clientX, event.clientY );\n\n\t\tif ( event.deltaY < 0 ) {\n\n\t\t\tthis._dollyIn( this._getZoomScale( event.deltaY ) );\n\n\t\t} else if ( event.deltaY > 0 ) {\n\n\t\t\tthis._dollyOut( this._getZoomScale( event.deltaY ) );\n\n\t\t}\n\n\t\tthis.update();\n\n\t}\n\n\t_handleKeyDown( event ) {\n\n\t\tlet needsUpdate = false;\n\n\t\tswitch ( event.code ) {\n\n\t\t\tcase this.keys.UP:\n\n\t\t\t\tif ( event.ctrlKey || event.metaKey || event.shiftKey ) {\n\n\t\t\t\t\tthis._rotateUp( _twoPI * this.rotateSpeed / this.domElement.clientHeight );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._pan( 0, this.keyPanSpeed );\n\n\t\t\t\t}\n\n\t\t\t\tneedsUpdate = true;\n\t\t\t\tbreak;\n\n\t\t\tcase this.keys.BOTTOM:\n\n\t\t\t\tif ( event.ctrlKey || event.metaKey || event.shiftKey ) {\n\n\t\t\t\t\tthis._rotateUp( - _twoPI * this.rotateSpeed / this.domElement.clientHeight );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._pan( 0, - this.keyPanSpeed );\n\n\t\t\t\t}\n\n\t\t\t\tneedsUpdate = true;\n\t\t\t\tbreak;\n\n\t\t\tcase this.keys.LEFT:\n\n\t\t\t\tif ( event.ctrlKey || event.metaKey || event.shiftKey ) {\n\n\t\t\t\t\tthis._rotateLeft( _twoPI * this.rotateSpeed / this.domElement.clientHeight );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._pan( this.keyPanSpeed, 0 );\n\n\t\t\t\t}\n\n\t\t\t\tneedsUpdate = true;\n\t\t\t\tbreak;\n\n\t\t\tcase this.keys.RIGHT:\n\n\t\t\t\tif ( event.ctrlKey || event.metaKey || event.shiftKey ) {\n\n\t\t\t\t\tthis._rotateLeft( - _twoPI * this.rotateSpeed / this.domElement.clientHeight );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._pan( - this.keyPanSpeed, 0 );\n\n\t\t\t\t}\n\n\t\t\t\tneedsUpdate = true;\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tif ( needsUpdate ) {\n\n\t\t\t// prevent the browser from scrolling on cursor keys\n\t\t\tevent.preventDefault();\n\n\t\t\tthis.update();\n\n\t\t}\n\n\n\t}\n\n\t_handleTouchStartRotate( event ) {\n\n\t\tif ( this._pointers.length === 1 ) {\n\n\t\t\tthis._rotateStart.set( event.pageX, event.pageY );\n\n\t\t} else {\n\n\t\t\tconst position = this._getSecondPointerPosition( event );\n\n\t\t\tconst x = 0.5 * ( event.pageX + position.x );\n\t\t\tconst y = 0.5 * ( event.pageY + position.y );\n\n\t\t\tthis._rotateStart.set( x, y );\n\n\t\t}\n\n\t}\n\n\t_handleTouchStartPan( event ) {\n\n\t\tif ( this._pointers.length === 1 ) {\n\n\t\t\tthis._panStart.set( event.pageX, event.pageY );\n\n\t\t} else {\n\n\t\t\tconst position = this._getSecondPointerPosition( event );\n\n\t\t\tconst x = 0.5 * ( event.pageX + position.x );\n\t\t\tconst y = 0.5 * ( event.pageY + position.y );\n\n\t\t\tthis._panStart.set( x, y );\n\n\t\t}\n\n\t}\n\n\t_handleTouchStartDolly( event ) {\n\n\t\tconst position = this._getSecondPointerPosition( event );\n\n\t\tconst dx = event.pageX - position.x;\n\t\tconst dy = event.pageY - position.y;\n\n\t\tconst distance = Math.sqrt( dx * dx + dy * dy );\n\n\t\tthis._dollyStart.set( 0, distance );\n\n\t}\n\n\t_handleTouchStartDollyPan( event ) {\n\n\t\tif ( this.enableZoom ) this._handleTouchStartDolly( event );\n\n\t\tif ( this.enablePan ) this._handleTouchStartPan( event );\n\n\t}\n\n\t_handleTouchStartDollyRotate( event ) {\n\n\t\tif ( this.enableZoom ) this._handleTouchStartDolly( event );\n\n\t\tif ( this.enableRotate ) this._handleTouchStartRotate( event );\n\n\t}\n\n\t_handleTouchMoveRotate( event ) {\n\n\t\tif ( this._pointers.length == 1 ) {\n\n\t\t\tthis._rotateEnd.set( event.pageX, event.pageY );\n\n\t\t} else {\n\n\t\t\tconst position = this._getSecondPointerPosition( event );\n\n\t\t\tconst x = 0.5 * ( event.pageX + position.x );\n\t\t\tconst y = 0.5 * ( event.pageY + position.y );\n\n\t\t\tthis._rotateEnd.set( x, y );\n\n\t\t}\n\n\t\tthis._rotateDelta.subVectors( this._rotateEnd, this._rotateStart ).multiplyScalar( this.rotateSpeed );\n\n\t\tconst element = this.domElement;\n\n\t\tthis._rotateLeft( _twoPI * this._rotateDelta.x / element.clientHeight ); // yes, height\n\n\t\tthis._rotateUp( _twoPI * this._rotateDelta.y / element.clientHeight );\n\n\t\tthis._rotateStart.copy( this._rotateEnd );\n\n\t}\n\n\t_handleTouchMovePan( event ) {\n\n\t\tif ( this._pointers.length === 1 ) {\n\n\t\t\tthis._panEnd.set( event.pageX, event.pageY );\n\n\t\t} else {\n\n\t\t\tconst position = this._getSecondPointerPosition( event );\n\n\t\t\tconst x = 0.5 * ( event.pageX + position.x );\n\t\t\tconst y = 0.5 * ( event.pageY + position.y );\n\n\t\t\tthis._panEnd.set( x, y );\n\n\t\t}\n\n\t\tthis._panDelta.subVectors( this._panEnd, this._panStart ).multiplyScalar( this.panSpeed );\n\n\t\tthis._pan( this._panDelta.x, this._panDelta.y );\n\n\t\tthis._panStart.copy( this._panEnd );\n\n\t}\n\n\t_handleTouchMoveDolly( event ) {\n\n\t\tconst position = this._getSecondPointerPosition( event );\n\n\t\tconst dx = event.pageX - position.x;\n\t\tconst dy = event.pageY - position.y;\n\n\t\tconst distance = Math.sqrt( dx * dx + dy * dy );\n\n\t\tthis._dollyEnd.set( 0, distance );\n\n\t\tthis._dollyDelta.set( 0, Math.pow( this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed ) );\n\n\t\tthis._dollyOut( this._dollyDelta.y );\n\n\t\tthis._dollyStart.copy( this._dollyEnd );\n\n\t\tconst centerX = ( event.pageX + position.x ) * 0.5;\n\t\tconst centerY = ( event.pageY + position.y ) * 0.5;\n\n\t\tthis._updateZoomParameters( centerX, centerY );\n\n\t}\n\n\t_handleTouchMoveDollyPan( event ) {\n\n\t\tif ( this.enableZoom ) this._handleTouchMoveDolly( event );\n\n\t\tif ( this.enablePan ) this._handleTouchMovePan( event );\n\n\t}\n\n\t_handleTouchMoveDollyRotate( event ) {\n\n\t\tif ( this.enableZoom ) this._handleTouchMoveDolly( event );\n\n\t\tif ( this.enableRotate ) this._handleTouchMoveRotate( event );\n\n\t}\n\n\t// pointers\n\n\t_addPointer( event ) {\n\n\t\tthis._pointers.push( event.pointerId );\n\n\t}\n\n\t_removePointer( event ) {\n\n\t\tdelete this._pointerPositions[ event.pointerId ];\n\n\t\tfor ( let i = 0; i < this._pointers.length; i ++ ) {\n\n\t\t\tif ( this._pointers[ i ] == event.pointerId ) {\n\n\t\t\t\tthis._pointers.splice( i, 1 );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_isTrackingPointer( event ) {\n\n\t\tfor ( let i = 0; i < this._pointers.length; i ++ ) {\n\n\t\t\tif ( this._pointers[ i ] == event.pointerId ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\t_trackPointer( event ) {\n\n\t\tlet position = this._pointerPositions[ event.pointerId ];\n\n\t\tif ( position === undefined ) {\n\n\t\t\tposition = new Vector2();\n\t\t\tthis._pointerPositions[ event.pointerId ] = position;\n\n\t\t}\n\n\t\tposition.set( event.pageX, event.pageY );\n\n\t}\n\n\t_getSecondPointerPosition( event ) {\n\n\t\tconst pointerId = ( event.pointerId === this._pointers[ 0 ] ) ? this._pointers[ 1 ] : this._pointers[ 0 ];\n\n\t\treturn this._pointerPositions[ pointerId ];\n\n\t}\n\n\t//\n\n\t_customWheelEvent( event ) {\n\n\t\tconst mode = event.deltaMode;\n\n\t\t// minimal wheel event altered to meet delta-zoom demand\n\t\tconst newEvent = {\n\t\t\tclientX: event.clientX,\n\t\t\tclientY: event.clientY,\n\t\t\tdeltaY: event.deltaY,\n\t\t};\n\n\t\tswitch ( mode ) {\n\n\t\t\tcase 1: // LINE_MODE\n\t\t\t\tnewEvent.deltaY *= 16;\n\t\t\t\tbreak;\n\n\t\t\tcase 2: // PAGE_MODE\n\t\t\t\tnewEvent.deltaY *= 100;\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\t// detect if event was triggered by pinching\n\t\tif ( event.ctrlKey && ! this._controlActive ) {\n\n\t\t\tnewEvent.deltaY *= 10;\n\n\t\t}\n\n\t\treturn newEvent;\n\n\t}\n\n}\n\nfunction onPointerDown( event ) {\n\n\tif ( this.enabled === false ) return;\n\n\tif ( this._pointers.length === 0 ) {\n\n\t\tthis.domElement.setPointerCapture( event.pointerId );\n\n\t\tthis.domElement.addEventListener( 'pointermove', this._onPointerMove );\n\t\tthis.domElement.addEventListener( 'pointerup', this._onPointerUp );\n\n\t}\n\n\t//\n\n\tif ( this._isTrackingPointer( event ) ) return;\n\n\t//\n\n\tthis._addPointer( event );\n\n\tif ( event.pointerType === 'touch' ) {\n\n\t\tthis._onTouchStart( event );\n\n\t} else {\n\n\t\tthis._onMouseDown( event );\n\n\t}\n\n}\n\nfunction onPointerMove( event ) {\n\n\tif ( this.enabled === false ) return;\n\n\tif ( event.pointerType === 'touch' ) {\n\n\t\tthis._onTouchMove( event );\n\n\t} else {\n\n\t\tthis._onMouseMove( event );\n\n\t}\n\n}\n\nfunction onPointerUp( event ) {\n\n\tthis._removePointer( event );\n\n\tswitch ( this._pointers.length ) {\n\n\t\tcase 0:\n\n\t\t\tthis.domElement.releasePointerCapture( event.pointerId );\n\n\t\t\tthis.domElement.removeEventListener( 'pointermove', this._onPointerMove );\n\t\t\tthis.domElement.removeEventListener( 'pointerup', this._onPointerUp );\n\n\t\t\tthis.dispatchEvent( _endEvent );\n\n\t\t\tthis.state = _STATE.NONE;\n\n\t\t\tbreak;\n\n\t\tcase 1:\n\n\t\t\tconst pointerId = this._pointers[ 0 ];\n\t\t\tconst position = this._pointerPositions[ pointerId ];\n\n\t\t\t// minimal placeholder event - allows state correction on pointer-up\n\t\t\tthis._onTouchStart( { pointerId: pointerId, pageX: position.x, pageY: position.y } );\n\n\t\t\tbreak;\n\n\t}\n\n}\n\nfunction onMouseDown( event ) {\n\n\tlet mouseAction;\n\n\tswitch ( event.button ) {\n\n\t\tcase 0:\n\n\t\t\tmouseAction = this.mouseButtons.LEFT;\n\t\t\tbreak;\n\n\t\tcase 1:\n\n\t\t\tmouseAction = this.mouseButtons.MIDDLE;\n\t\t\tbreak;\n\n\t\tcase 2:\n\n\t\t\tmouseAction = this.mouseButtons.RIGHT;\n\t\t\tbreak;\n\n\t\tdefault:\n\n\t\t\tmouseAction = - 1;\n\n\t}\n\n\tswitch ( mouseAction ) {\n\n\t\tcase MOUSE.DOLLY:\n\n\t\t\tif ( this.enableZoom === false ) return;\n\n\t\t\tthis._handleMouseDownDolly( event );\n\n\t\t\tthis.state = _STATE.DOLLY;\n\n\t\t\tbreak;\n\n\t\tcase MOUSE.ROTATE:\n\n\t\t\tif ( event.ctrlKey || event.metaKey || event.shiftKey ) {\n\n\t\t\t\tif ( this.enablePan === false ) return;\n\n\t\t\t\tthis._handleMouseDownPan( event );\n\n\t\t\t\tthis.state = _STATE.PAN;\n\n\t\t\t} else {\n\n\t\t\t\tif ( this.enableRotate === false ) return;\n\n\t\t\t\tthis._handleMouseDownRotate( event );\n\n\t\t\t\tthis.state = _STATE.ROTATE;\n\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase MOUSE.PAN:\n\n\t\t\tif ( event.ctrlKey || event.metaKey || event.shiftKey ) {\n\n\t\t\t\tif ( this.enableRotate === false ) return;\n\n\t\t\t\tthis._handleMouseDownRotate( event );\n\n\t\t\t\tthis.state = _STATE.ROTATE;\n\n\t\t\t} else {\n\n\t\t\t\tif ( this.enablePan === false ) return;\n\n\t\t\t\tthis._handleMouseDownPan( event );\n\n\t\t\t\tthis.state = _STATE.PAN;\n\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tdefault:\n\n\t\t\tthis.state = _STATE.NONE;\n\n\t}\n\n\tif ( this.state !== _STATE.NONE ) {\n\n\t\tthis.dispatchEvent( _startEvent );\n\n\t}\n\n}\n\nfunction onMouseMove( event ) {\n\n\tswitch ( this.state ) {\n\n\t\tcase _STATE.ROTATE:\n\n\t\t\tif ( this.enableRotate === false ) return;\n\n\t\t\tthis._handleMouseMoveRotate( event );\n\n\t\t\tbreak;\n\n\t\tcase _STATE.DOLLY:\n\n\t\t\tif ( this.enableZoom === false ) return;\n\n\t\t\tthis._handleMouseMoveDolly( event );\n\n\t\t\tbreak;\n\n\t\tcase _STATE.PAN:\n\n\t\t\tif ( this.enablePan === false ) return;\n\n\t\t\tthis._handleMouseMovePan( event );\n\n\t\t\tbreak;\n\n\t}\n\n}\n\nfunction onMouseWheel( event ) {\n\n\tif ( this.enabled === false || this.enableZoom === false || this.state !== _STATE.NONE ) return;\n\n\tevent.preventDefault();\n\n\tthis.dispatchEvent( _startEvent );\n\n\tthis._handleMouseWheel( this._customWheelEvent( event ) );\n\n\tthis.dispatchEvent( _endEvent );\n\n}\n\nfunction onKeyDown( event ) {\n\n\tif ( this.enabled === false || this.enablePan === false ) return;\n\n\tthis._handleKeyDown( event );\n\n}\n\nfunction onTouchStart( event ) {\n\n\tthis._trackPointer( event );\n\n\tswitch ( this._pointers.length ) {\n\n\t\tcase 1:\n\n\t\t\tswitch ( this.touches.ONE ) {\n\n\t\t\t\tcase TOUCH.ROTATE:\n\n\t\t\t\t\tif ( this.enableRotate === false ) return;\n\n\t\t\t\t\tthis._handleTouchStartRotate( event );\n\n\t\t\t\t\tthis.state = _STATE.TOUCH_ROTATE;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TOUCH.PAN:\n\n\t\t\t\t\tif ( this.enablePan === false ) return;\n\n\t\t\t\t\tthis._handleTouchStartPan( event );\n\n\t\t\t\t\tthis.state = _STATE.TOUCH_PAN;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tthis.state = _STATE.NONE;\n\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase 2:\n\n\t\t\tswitch ( this.touches.TWO ) {\n\n\t\t\t\tcase TOUCH.DOLLY_PAN:\n\n\t\t\t\t\tif ( this.enableZoom === false && this.enablePan === false ) return;\n\n\t\t\t\t\tthis._handleTouchStartDollyPan( event );\n\n\t\t\t\t\tthis.state = _STATE.TOUCH_DOLLY_PAN;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TOUCH.DOLLY_ROTATE:\n\n\t\t\t\t\tif ( this.enableZoom === false && this.enableRotate === false ) return;\n\n\t\t\t\t\tthis._handleTouchStartDollyRotate( event );\n\n\t\t\t\t\tthis.state = _STATE.TOUCH_DOLLY_ROTATE;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tthis.state = _STATE.NONE;\n\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tdefault:\n\n\t\t\tthis.state = _STATE.NONE;\n\n\t}\n\n\tif ( this.state !== _STATE.NONE ) {\n\n\t\tthis.dispatchEvent( _startEvent );\n\n\t}\n\n}\n\nfunction onTouchMove( event ) {\n\n\tthis._trackPointer( event );\n\n\tswitch ( this.state ) {\n\n\t\tcase _STATE.TOUCH_ROTATE:\n\n\t\t\tif ( this.enableRotate === false ) return;\n\n\t\t\tthis._handleTouchMoveRotate( event );\n\n\t\t\tthis.update();\n\n\t\t\tbreak;\n\n\t\tcase _STATE.TOUCH_PAN:\n\n\t\t\tif ( this.enablePan === false ) return;\n\n\t\t\tthis._handleTouchMovePan( event );\n\n\t\t\tthis.update();\n\n\t\t\tbreak;\n\n\t\tcase _STATE.TOUCH_DOLLY_PAN:\n\n\t\t\tif ( this.enableZoom === false && this.enablePan === false ) return;\n\n\t\t\tthis._handleTouchMoveDollyPan( event );\n\n\t\t\tthis.update();\n\n\t\t\tbreak;\n\n\t\tcase _STATE.TOUCH_DOLLY_ROTATE:\n\n\t\t\tif ( this.enableZoom === false && this.enableRotate === false ) return;\n\n\t\t\tthis._handleTouchMoveDollyRotate( event );\n\n\t\t\tthis.update();\n\n\t\t\tbreak;\n\n\t\tdefault:\n\n\t\t\tthis.state = _STATE.NONE;\n\n\t}\n\n}\n\nfunction onContextMenu( event ) {\n\n\tif ( this.enabled === false ) return;\n\n\tevent.preventDefault();\n\n}\n\nfunction interceptControlDown( event ) {\n\n\tif ( event.key === 'Control' ) {\n\n\t\tthis._controlActive = true;\n\n\t\tconst document = this.domElement.getRootNode(); // offscreen canvas compatibility\n\n\t\tdocument.addEventListener( 'keyup', this._interceptControlUp, { passive: true, capture: true } );\n\n\t}\n\n}\n\nfunction interceptControlUp( event ) {\n\n\tif ( event.key === 'Control' ) {\n\n\t\tthis._controlActive = false;\n\n\t\tconst document = this.domElement.getRootNode(); // offscreen canvas compatibility\n\n\t\tdocument.removeEventListener( 'keyup', this._interceptControlUp, { passive: true, capture: true } );\n\n\t}\n\n}\n\nexport { OrbitControls };\n","import * as THREE from 'three'\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'\n\nimport {\n ControlsManagerInterface,\n EventManagerInterface,\n NodeStorageInterface\n} from './interfaces'\n\nexport class ControlsManager implements ControlsManagerInterface {\n controls: OrbitControls\n\n private eventManager: EventManagerInterface\n private nodeStorage: NodeStorageInterface\n private camera: THREE.Camera\n\n constructor(\n renderer: THREE.WebGLRenderer,\n camera: THREE.Camera,\n eventManager: EventManagerInterface,\n nodeStorage: NodeStorageInterface\n ) {\n this.eventManager = eventManager\n this.nodeStorage = nodeStorage\n this.camera = camera\n\n this.controls = new OrbitControls(camera, renderer.domElement)\n this.controls.enableDamping = true\n }\n\n init(): void {\n this.controls.addEventListener('end', () => {\n this.nodeStorage.storeNodeProperty('Camera Info', {\n position: this.camera.position.clone(),\n target: this.controls.target.clone(),\n zoom:\n this.camera instanceof THREE.OrthographicCamera\n ? (this.camera as THREE.OrthographicCamera).zoom\n : (this.camera as THREE.PerspectiveCamera).zoom,\n cameraType:\n this.camera instanceof THREE.PerspectiveCamera\n ? 'perspective'\n : 'orthographic'\n })\n })\n }\n\n dispose(): void {\n this.controls.dispose()\n }\n\n handleResize(): void {}\n\n update(): void {\n this.controls.update()\n }\n\n updateCamera(camera: THREE.Camera): void {\n const position = this.controls.object.position.clone()\n const target = this.controls.target.clone()\n\n this.camera = camera\n this.controls.object = camera\n this.controls.target = target\n camera.position.copy(position)\n this.controls.update()\n }\n reset(): void {\n this.controls.target.set(0, 0, 0)\n this.controls.update()\n }\n}\n","import { EventCallback, EventManagerInterface } from './interfaces'\n\nexport class EventManager implements EventManagerInterface {\n private listeners: { [key: string]: EventCallback[] } = {}\n\n addEventListener(event: string, callback: EventCallback): void {\n if (!this.listeners[event]) {\n this.listeners[event] = []\n }\n this.listeners[event].push(callback)\n }\n\n removeEventListener(event: string, callback: EventCallback): void {\n if (this.listeners[event]) {\n this.listeners[event] = this.listeners[event].filter(\n (cb) => cb !== callback\n )\n }\n }\n\n emitEvent(event: string, data?: any): void {\n if (this.listeners[event]) {\n this.listeners[event].forEach((callback) => callback(data))\n }\n }\n}\n","import * as THREE from 'three'\n\nimport { EventManagerInterface, LightingManagerInterface } from './interfaces'\n\nexport class LightingManager implements LightingManagerInterface {\n lights: THREE.Light[] = []\n private scene: THREE.Scene\n private eventManager: EventManagerInterface\n\n constructor(scene: THREE.Scene, eventManager: EventManagerInterface) {\n this.scene = scene\n this.eventManager = eventManager\n }\n\n init(): void {\n this.setupLights()\n }\n\n dispose(): void {\n this.lights.forEach((light) => {\n this.scene.remove(light)\n })\n this.lights = []\n }\n\n setupLights(): void {\n const ambientLight = new THREE.AmbientLight(0xffffff, 0.5)\n this.scene.add(ambientLight)\n this.lights.push(ambientLight)\n\n const mainLight = new THREE.DirectionalLight(0xffffff, 0.8)\n mainLight.position.set(0, 10, 10)\n this.scene.add(mainLight)\n this.lights.push(mainLight)\n\n const backLight = new THREE.DirectionalLight(0xffffff, 0.5)\n backLight.position.set(0, 10, -10)\n this.scene.add(backLight)\n this.lights.push(backLight)\n\n const leftFillLight = new THREE.DirectionalLight(0xffffff, 0.3)\n leftFillLight.position.set(-10, 0, 0)\n this.scene.add(leftFillLight)\n this.lights.push(leftFillLight)\n\n const rightFillLight = new THREE.DirectionalLight(0xffffff, 0.3)\n rightFillLight.position.set(10, 0, 0)\n this.scene.add(rightFillLight)\n this.lights.push(rightFillLight)\n\n const bottomLight = new THREE.DirectionalLight(0xffffff, 0.2)\n bottomLight.position.set(0, -10, 0)\n this.scene.add(bottomLight)\n this.lights.push(bottomLight)\n }\n\n setLightIntensity(intensity: number): void {\n this.lights.forEach((light) => {\n if (light instanceof THREE.DirectionalLight) {\n if (light === this.lights[1]) {\n light.intensity = intensity * 0.8\n } else if (light === this.lights[2]) {\n light.intensity = intensity * 0.5\n } else if (light === this.lights[5]) {\n light.intensity = intensity * 0.2\n } else {\n light.intensity = intensity * 0.3\n }\n } else if (light instanceof THREE.AmbientLight) {\n light.intensity = intensity * 0.5\n }\n })\n\n this.eventManager.emitEvent('lightIntensityChange', intensity)\n }\n\n reset(): void {}\n}\n","/*!\nfflate - fast JavaScript compression/decompression\n\nLicensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE\nversion 0.8.2\n*/\n\n// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n ], { type: 'text/javascript' }))));\n w.onmessage = function (e) {\n var d = e.data, ed = d.$e$;\n if (ed) {\n var err = new Error(ed[0]);\n err['code'] = ed[1];\n err.stack = ed[2];\n cb(err, null);\n }\n else\n cb(null, d);\n };\n w.postMessage(msg, transfer);\n return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n var b = new u16(31);\n for (var i = 0; i < 31; ++i) {\n b[i] = start += 1 << eb[i - 1];\n }\n // numbers here are at max 18 bits\n var r = new i32(b[30]);\n for (var i = 1; i < 30; ++i) {\n for (var j = b[i]; j < b[i + 1]; ++j) {\n r[j] = ((j - b[i]) << 5) | i;\n }\n }\n return { b: b, r: r };\n};\nvar _a = freb(fleb, 2), fl = _a.b, revfl = _a.r;\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r;\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n // reverse table algorithm from SO\n var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1);\n x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2);\n x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4);\n rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n var s = cd.length;\n // index\n var i = 0;\n // u16 \"map\": index -> # of codes with bit length = index\n var l = new u16(mb);\n // length of cd must be 288 (total # of codes)\n for (; i < s; ++i) {\n if (cd[i])\n ++l[cd[i] - 1];\n }\n // u16 \"map\": index -> minimum code for bit length = index\n var le = new u16(mb);\n for (i = 1; i < mb; ++i) {\n le[i] = (le[i - 1] + l[i - 1]) << 1;\n }\n var co;\n if (r) {\n // u16 \"map\": index -> number of actual bits, symbol for code\n co = new u16(1 << mb);\n // bits to remove for reverser\n var rvb = 15 - mb;\n for (i = 0; i < s; ++i) {\n // ignore 0 lengths\n if (cd[i]) {\n // num encoding both symbol and bits read\n var sv = (i << 4) | cd[i];\n // free bits\n var r_1 = mb - cd[i];\n // start value\n var v = le[cd[i] - 1]++ << r_1;\n // m is end value\n for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n // every 16 bit value starting with the code yields the same result\n co[rev[v] >> rvb] = sv;\n }\n }\n }\n }\n else {\n co = new u16(s);\n for (i = 0; i < s; ++i) {\n if (cd[i]) {\n co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]);\n }\n }\n }\n return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n var m = a[0];\n for (var i = 1; i < a.length; ++i) {\n if (a[i] > m)\n m = a[i];\n }\n return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n var o = (p / 8) | 0;\n return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n if (s == null || s < 0)\n s = 0;\n if (e == null || e > v.length)\n e = v.length;\n // can't use .constructor in case user-supplied\n return new u8(v.subarray(s, e));\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n UnexpectedEOF: 0,\n InvalidBlockType: 1,\n InvalidLengthLiteral: 2,\n InvalidDistance: 3,\n StreamFinished: 4,\n NoStreamHandler: 5,\n InvalidHeader: 6,\n NoCallback: 7,\n InvalidUTF8: 8,\n ExtraFieldTooLong: 9,\n InvalidDate: 10,\n FilenameTooLong: 11,\n StreamFinishing: 12,\n InvalidZipData: 13,\n UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n 'unexpected EOF',\n 'invalid block type',\n 'invalid length/literal',\n 'invalid distance',\n 'stream finished',\n 'no stream handler',\n ,\n 'no callback',\n 'invalid UTF-8 data',\n 'extra field too long',\n 'date not in range 1980-2099',\n 'filename too long',\n 'stream finishing',\n 'invalid zip data'\n // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n var e = new Error(msg || ec[ind]);\n e.code = ind;\n if (Error.captureStackTrace)\n Error.captureStackTrace(e, err);\n if (!nt)\n throw e;\n return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, st, buf, dict) {\n // source length dict length\n var sl = dat.length, dl = dict ? dict.length : 0;\n if (!sl || st.f && !st.l)\n return buf || new u8(0);\n var noBuf = !buf;\n // have to estimate size\n var resize = noBuf || st.i != 2;\n // no state\n var noSt = st.i;\n // Assumes roughly 33% compression ratio average\n if (noBuf)\n buf = new u8(sl * 3);\n // ensure buffer can fit at least l elements\n var cbuf = function (l) {\n var bl = buf.length;\n // need to increase size to fit\n if (l > bl) {\n // Double or set to necessary, whichever is greater\n var nbuf = new u8(Math.max(bl * 2, l));\n nbuf.set(buf);\n buf = nbuf;\n }\n };\n // last chunk bitpos bytes\n var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n // total bits\n var tbts = sl * 8;\n do {\n if (!lm) {\n // BFINAL - this is only 1 when last chunk is next\n final = bits(dat, pos, 1);\n // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n var type = bits(dat, pos + 1, 3);\n pos += 3;\n if (!type) {\n // go to end of byte boundary\n var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n if (t > sl) {\n if (noSt)\n err(0);\n break;\n }\n // ensure size\n if (resize)\n cbuf(bt + l);\n // Copy over uncompressed data\n buf.set(dat.subarray(s, t), bt);\n // Get new bitpos, update byte count\n st.b = bt += l, st.p = pos = t * 8, st.f = final;\n continue;\n }\n else if (type == 1)\n lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n else if (type == 2) {\n // literal lengths\n var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n var tl = hLit + bits(dat, pos + 5, 31) + 1;\n pos += 14;\n // length+distance tree\n var ldt = new u8(tl);\n // code length tree\n var clt = new u8(19);\n for (var i = 0; i < hcLen; ++i) {\n // use index map to get real code\n clt[clim[i]] = bits(dat, pos + i * 3, 7);\n }\n pos += hcLen * 3;\n // code lengths bits\n var clb = max(clt), clbmsk = (1 << clb) - 1;\n // code lengths map\n var clm = hMap(clt, clb, 1);\n for (var i = 0; i < tl;) {\n var r = clm[bits(dat, pos, clbmsk)];\n // bits read\n pos += r & 15;\n // symbol\n var s = r >> 4;\n // code length to copy\n if (s < 16) {\n ldt[i++] = s;\n }\n else {\n // copy count\n var c = 0, n = 0;\n if (s == 16)\n n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n else if (s == 17)\n n = 3 + bits(dat, pos, 7), pos += 3;\n else if (s == 18)\n n = 11 + bits(dat, pos, 127), pos += 7;\n while (n--)\n ldt[i++] = c;\n }\n }\n // length tree distance tree\n var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n // max length bits\n lbt = max(lt);\n // max dist bits\n dbt = max(dt);\n lm = hMap(lt, lbt, 1);\n dm = hMap(dt, dbt, 1);\n }\n else\n err(1);\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n }\n // Make sure the buffer can hold this + the largest possible addition\n // Maximum chunk size (practically, theoretically infinite) is 2^17\n if (resize)\n cbuf(bt + 131072);\n var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n var lpos = pos;\n for (;; lpos = pos) {\n // bits read, code\n var c = lm[bits16(dat, pos) & lms], sym = c >> 4;\n pos += c & 15;\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (!c)\n err(2);\n if (sym < 256)\n buf[bt++] = sym;\n else if (sym == 256) {\n lpos = pos, lm = null;\n break;\n }\n else {\n var add = sym - 254;\n // no extra bits needed if less\n if (sym > 264) {\n // index\n var i = sym - 257, b = fleb[i];\n add = bits(dat, pos, (1 << b) - 1) + fl[i];\n pos += b;\n }\n // dist\n var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;\n if (!d)\n err(3);\n pos += d & 15;\n var dt = fd[dsym];\n if (dsym > 3) {\n var b = fdeb[dsym];\n dt += bits16(dat, pos) & (1 << b) - 1, pos += b;\n }\n if (pos > tbts) {\n if (noSt)\n err(0);\n break;\n }\n if (resize)\n cbuf(bt + 131072);\n var end = bt + add;\n if (bt < dt) {\n var shift = dl - dt, dend = Math.min(dt, end);\n if (shift + bt < 0)\n err(3);\n for (; bt < dend; ++bt)\n buf[bt] = dict[shift + bt];\n }\n for (; bt < end; ++bt)\n buf[bt] = buf[bt - dt];\n }\n }\n st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n if (lm)\n final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n } while (!final);\n // don't reallocate for streams or user buffers\n return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n v <<= p & 7;\n var o = (p / 8) | 0;\n d[o] |= v;\n d[o + 1] |= v >> 8;\n d[o + 2] |= v >> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n // Need extra info to make a tree\n var t = [];\n for (var i = 0; i < d.length; ++i) {\n if (d[i])\n t.push({ s: i, f: d[i] });\n }\n var s = t.length;\n var t2 = t.slice();\n if (!s)\n return { t: et, l: 0 };\n if (s == 1) {\n var v = new u8(t[0].s + 1);\n v[t[0].s] = 1;\n return { t: v, l: 1 };\n }\n t.sort(function (a, b) { return a.f - b.f; });\n // after i2 reaches last ind, will be stopped\n // freq must be greater than largest possible number of symbols\n t.push({ s: -1, f: 25001 });\n var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n // efficient algorithm from UZIP.js\n // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n // symbols that combined have high freq, will start processing i2 (high-freq,\n // non-composite) symbols instead\n // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n while (i1 != s - 1) {\n l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n }\n var maxSym = t2[0].s;\n for (var i = 1; i < s; ++i) {\n if (t2[i].s > maxSym)\n maxSym = t2[i].s;\n }\n // code lengths\n var tr = new u16(maxSym + 1);\n // max bits in tree\n var mbt = ln(t[i1 - 1], tr, 0);\n if (mbt > mb) {\n // more algorithms from UZIP.js\n // TODO: find out how this code works (debt)\n // ind debt\n var i = 0, dt = 0;\n // left cost\n var lft = mbt - mb, cst = 1 << lft;\n t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n for (; i < s; ++i) {\n var i2_1 = t2[i].s;\n if (tr[i2_1] > mb) {\n dt += cst - (1 << (mbt - tr[i2_1]));\n tr[i2_1] = mb;\n }\n else\n break;\n }\n dt >>= lft;\n while (dt > 0) {\n var i2_2 = t2[i].s;\n if (tr[i2_2] < mb)\n dt -= 1 << (mb - tr[i2_2]++ - 1);\n else\n ++i;\n }\n for (; i >= 0 && dt; --i) {\n var i2_3 = t2[i].s;\n if (tr[i2_3] == mb) {\n --tr[i2_3];\n ++dt;\n }\n }\n mbt = mb;\n }\n return { t: new u8(tr), l: mbt };\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n return n.s == -1\n ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n var s = c.length;\n // Note that the semicolon was intentional\n while (s && !c[--s])\n ;\n var cl = new u16(++s);\n // ind num streak\n var cli = 0, cln = c[0], cls = 1;\n var w = function (v) { cl[cli++] = v; };\n for (var i = 1; i <= s; ++i) {\n if (c[i] == cln && i != s)\n ++cls;\n else {\n if (!cln && cls > 2) {\n for (; cls > 138; cls -= 138)\n w(32754);\n if (cls > 2) {\n w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n cls = 0;\n }\n }\n else if (cls > 3) {\n w(cln), --cls;\n for (; cls > 6; cls -= 6)\n w(8304);\n if (cls > 2)\n w(((cls - 3) << 5) | 8208), cls = 0;\n }\n while (cls--)\n w(cln);\n cls = 1;\n cln = c[i];\n }\n }\n return { c: cl.subarray(0, cli), n: s };\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n var l = 0;\n for (var i = 0; i < cl.length; ++i)\n l += cf[i] * cl[i];\n return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n // no need to write 00 as type: TypedArray defaults to 0\n var s = dat.length;\n var o = shft(pos + 2);\n out[o] = s & 255;\n out[o + 1] = s >> 8;\n out[o + 2] = out[o] ^ 255;\n out[o + 3] = out[o + 1] ^ 255;\n for (var i = 0; i < s; ++i)\n out[o + i + 4] = dat[i];\n return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n wbits(out, p++, final);\n ++lf[256];\n var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l;\n var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l;\n var _c = lc(dlt), lclt = _c.c, nlc = _c.n;\n var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;\n var lcfreq = new u16(19);\n for (var i = 0; i < lclt.length; ++i)\n ++lcfreq[lclt[i] & 31];\n for (var i = 0; i < lcdt.length; ++i)\n ++lcfreq[lcdt[i] & 31];\n var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;\n var nlcc = 19;\n for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n ;\n var flen = (bl + 5) << 3;\n var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];\n if (bs >= 0 && flen <= ftlen && flen <= dtlen)\n return wfblk(out, p, dat.subarray(bs, bs + bl));\n var lm, ll, dm, dl;\n wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n if (dtlen < ftlen) {\n lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n var llm = hMap(lct, mlcb, 0);\n wbits(out, p, nlc - 257);\n wbits(out, p + 5, ndc - 1);\n wbits(out, p + 10, nlcc - 4);\n p += 14;\n for (var i = 0; i < nlcc; ++i)\n wbits(out, p + 3 * i, lct[clim[i]]);\n p += 3 * nlcc;\n var lcts = [lclt, lcdt];\n for (var it = 0; it < 2; ++it) {\n var clct = lcts[it];\n for (var i = 0; i < clct.length; ++i) {\n var len = clct[i] & 31;\n wbits(out, p, llm[len]), p += lct[len];\n if (len > 15)\n wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12;\n }\n }\n }\n else {\n lm = flm, ll = flt, dm = fdm, dl = fdt;\n }\n for (var i = 0; i < li; ++i) {\n var sym = syms[i];\n if (sym > 255) {\n var len = (sym >> 18) & 31;\n wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n if (len > 7)\n wbits(out, p, (sym >> 23) & 31), p += fleb[len];\n var dst = sym & 31;\n wbits16(out, p, dm[dst]), p += dl[dst];\n if (dst > 3)\n wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst];\n }\n else {\n wbits16(out, p, lm[sym]), p += ll[sym];\n }\n }\n wbits16(out, p, lm[256]);\n return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, st) {\n var s = st.z || dat.length;\n var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n // writing to this writes to the output buffer\n var w = o.subarray(pre, o.length - post);\n var lst = st.l;\n var pos = (st.r || 0) & 7;\n if (lvl) {\n if (pos)\n w[0] = st.r >> 3;\n var opt = deo[lvl - 1];\n var n = opt >> 13, c = opt & 8191;\n var msk_1 = (1 << plvl) - 1;\n // prev 2-byte val map curr 2-byte val map\n var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);\n var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n // 24576 is an arbitrary number of maximum symbols per block\n // 424 buffer for last block\n var syms = new i32(25000);\n // length/literal freq distance freq\n var lf = new u16(288), df = new u16(32);\n // l/lcnt exbits index l/lind waitdx blkpos\n var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0;\n for (; i + 2 < s; ++i) {\n // hash value\n var hv = hsh(i);\n // index mod 32768 previous index mod\n var imod = i & 32767, pimod = head[hv];\n prev[imod] = pimod;\n head[hv] = imod;\n // We always should modify head and prev, but only add symbols if\n // this data is not yet processed (\"wait\" for wait index)\n if (wi <= i) {\n // bytes remaining\n var rem = s - i;\n if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {\n pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n li = lc_1 = eb = 0, bs = i;\n for (var j = 0; j < 286; ++j)\n lf[j] = 0;\n for (var j = 0; j < 30; ++j)\n df[j] = 0;\n }\n // len dist chain\n var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;\n if (rem > 2 && hv == hsh(i - dif)) {\n var maxn = Math.min(n, rem) - 1;\n var maxd = Math.min(32767, i);\n // max possible length\n // not capped at dif because decompressors implement \"rolling\" index population\n var ml = Math.min(258, rem);\n while (dif <= maxd && --ch_1 && imod != pimod) {\n if (dat[i + l] == dat[i + l - dif]) {\n var nl = 0;\n for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n ;\n if (nl > l) {\n l = nl, d = dif;\n // break out early when we reach \"nice\" (we are satisfied enough)\n if (nl > maxn)\n break;\n // now, find the rarest 2-byte sequence within this\n // length of literals and search for that instead.\n // Much faster than just using the start\n var mmd = Math.min(dif, nl - 2);\n var md = 0;\n for (var j = 0; j < mmd; ++j) {\n var ti = i - dif + j & 32767;\n var pti = prev[ti];\n var cd = ti - pti & 32767;\n if (cd > md)\n md = cd, pimod = ti;\n }\n }\n }\n // check the previous match\n imod = pimod, pimod = prev[imod];\n dif += imod - pimod & 32767;\n }\n }\n // d will be nonzero only when a match was found\n if (d) {\n // store both dist and len data in one int32\n // Make sure this is recognized as a len/dist with 28th bit (2^28)\n syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n var lin = revfl[l] & 31, din = revfd[d] & 31;\n eb += fleb[lin] + fdeb[din];\n ++lf[257 + lin];\n ++df[din];\n wi = i + l;\n ++lc_1;\n }\n else {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n }\n }\n for (i = Math.max(i, wi); i < s; ++i) {\n syms[li++] = dat[i];\n ++lf[dat[i]];\n }\n pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n if (!lst) {\n st.r = (pos & 7) | w[(pos / 8) | 0] << 3;\n // shft(pos) now 1 less if pos & 7 != 0\n pos -= 7;\n st.h = head, st.p = prev, st.i = i, st.w = wi;\n }\n }\n else {\n for (var i = st.w || 0; i < s + lst; i += 65535) {\n // end\n var e = i + 65535;\n if (e >= s) {\n // write final block\n w[(pos / 8) | 0] = lst;\n e = s;\n }\n pos = wfblk(w, pos + 1, dat.subarray(i, e));\n }\n st.i = s;\n }\n return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n var t = new Int32Array(256);\n for (var i = 0; i < 256; ++i) {\n var c = i, k = 9;\n while (--k)\n c = ((c & 1) && -306674912) ^ (c >>> 1);\n t[i] = c;\n }\n return t;\n})();\n// CRC32\nvar crc = function () {\n var c = -1;\n return {\n p: function (d) {\n // closures have awful performance\n var cr = c;\n for (var i = 0; i < d.length; ++i)\n cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n c = cr;\n },\n d: function () { return ~c; }\n };\n};\n// Adler32\nvar adler = function () {\n var a = 1, b = 0;\n return {\n p: function (d) {\n // closures have awful performance\n var n = a, m = b;\n var l = d.length | 0;\n for (var i = 0; i != l;) {\n var e = Math.min(i + 2655, l);\n for (; i < e; ++i)\n m += n += d[i];\n n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n }\n a = n, b = m;\n },\n d: function () {\n a %= 65521, b %= 65521;\n return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8);\n }\n };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n if (!st) {\n st = { l: 1 };\n if (opt.dictionary) {\n var dict = opt.dictionary.subarray(-32768);\n var newDat = new u8(dict.length + dat.length);\n newDat.set(dict);\n newDat.set(dat, dict.length);\n dat = newDat;\n st.w = dict.length;\n }\n }\n return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? (st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20) : (12 + opt.mem), pre, post, st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n var o = {};\n for (var k in a)\n o[k] = a[k];\n for (var k in b)\n o[k] = b[k];\n return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n var dt = fn();\n var st = fn.toString();\n var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n for (var i = 0; i < dt.length; ++i) {\n var v = dt[i], k = ks[i];\n if (typeof v == 'function') {\n fnStr += ';' + k + '=';\n var st_1 = v.toString();\n if (v.prototype) {\n // for global objects\n if (st_1.indexOf('[native code]') != -1) {\n var spInd = st_1.indexOf(' ', 8) + 1;\n fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n }\n else {\n fnStr += st_1;\n for (var t in v.prototype)\n fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n }\n }\n else\n fnStr += st_1;\n }\n else\n td[k] = v;\n }\n return fnStr;\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n var tl = [];\n for (var k in v) {\n if (v[k].buffer) {\n tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n }\n }\n return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n if (!ch[id]) {\n var fnStr = '', td_1 = {}, m = fns.length - 1;\n for (var i = 0; i < m; ++i)\n fnStr = wcln(fns[i], fnStr, td_1);\n ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 };\n }\n var td = mrg({}, ch[id].e);\n return wk(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; };\nvar bDflt = function () { return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zls]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get opts\nvar gopt = function (o) { return o && {\n out: o.size && new u8(o.size),\n dictionary: o.dictionary\n}; };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n var w = wrkr(fns, init, id, function (err, dat) {\n w.terminate();\n cb(err, dat);\n });\n w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n return function (ev) {\n if (ev.data.length) {\n strm.push(ev.data[0], ev.data[1]);\n postMessage([ev.data[0].length]);\n }\n else\n strm.flush();\n };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id, flush, ext) {\n var t;\n var w = wrkr(fns, init, id, function (err, dat) {\n if (err)\n w.terminate(), strm.ondata.call(strm, err);\n else if (!Array.isArray(dat))\n ext(dat);\n else if (dat.length == 1) {\n strm.queuedSize -= dat[0];\n if (strm.ondrain)\n strm.ondrain(dat[0]);\n }\n else {\n if (dat[1])\n w.terminate();\n strm.ondata.call(strm, err, dat[0], dat[1]);\n }\n });\n w.postMessage(opts);\n strm.queuedSize = 0;\n strm.push = function (d, f) {\n if (!strm.ondata)\n err(5);\n if (t)\n strm.ondata(err(4, 0, 1), null, !!f);\n strm.queuedSize += d.length;\n w.postMessage([d, t = f], [d.buffer]);\n };\n strm.terminate = function () { w.terminate(); };\n if (flush) {\n strm.flush = function () { w.postMessage([]); };\n }\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n for (; v; ++b)\n d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n var fn = o.filename;\n c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n if (o.mtime != 0)\n wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n if (fn) {\n c[3] = 8;\n for (var i = 0; i <= fn.length; ++i)\n c[i + 10] = fn.charCodeAt(i);\n }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n err(6, 'invalid gzip data');\n var flg = d[3];\n var st = 10;\n if (flg & 4)\n st += (d[10] | d[11] << 8) + 2;\n for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n ;\n return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n var l = d.length;\n return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); };\n// zlib header\nvar zlh = function (c, o) {\n var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32);\n c[1] |= 31 - ((c[0] << 8) | c[1]) % 31;\n if (o.dictionary) {\n var h = adler();\n h.p(o.dictionary);\n wbytes(c, 2, h.d());\n }\n};\n// zlib start\nvar zls = function (d, dict) {\n if ((d[0] & 15) != 8 || (d[0] >> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n err(6, 'invalid zlib data');\n if ((d[1] >> 5 & 1) == +!dict)\n err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary');\n return (d[1] >> 3 & 4) + 2;\n};\nfunction StrmOpt(opts, cb) {\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n return opts;\n}\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n function Deflate(opts, cb) {\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n this.o = opts || {};\n this.s = { l: 0, i: 32768, w: 32768, z: 32768 };\n // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev\n // 98304 = 32768 (lookback) + 65536 (common chunk size)\n this.b = new u8(98304);\n if (this.o.dictionary) {\n var dict = this.o.dictionary.subarray(-32768);\n this.b.set(dict, 32768 - dict.length);\n this.s.i = 32768 - dict.length;\n }\n }\n Deflate.prototype.p = function (c, f) {\n this.ondata(dopt(c, this.o, 0, 0, this.s), f);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Deflate.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.s.l)\n err(4);\n var endLen = chunk.length + this.s.z;\n if (endLen > this.b.length) {\n if (endLen > 2 * this.b.length - 32768) {\n var newBuf = new u8(endLen & -32768);\n newBuf.set(this.b.subarray(0, this.s.z));\n this.b = newBuf;\n }\n var split = this.b.length - this.s.z;\n this.b.set(chunk.subarray(0, split), this.s.z);\n this.s.z = this.b.length;\n this.p(this.b, false);\n this.b.set(this.b.subarray(-32768));\n this.b.set(chunk.subarray(split), 32768);\n this.s.z = chunk.length - split + 32768;\n this.s.i = 32766, this.s.w = 32768;\n }\n else {\n this.b.set(chunk, this.s.z);\n this.s.z += chunk.length;\n }\n this.s.l = final & 1;\n if (this.s.z > this.s.w + 8191 || final) {\n this.p(this.b, final || false);\n this.s.w = this.s.i, this.s.i -= 2;\n }\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * deflated output for small inputs.\n */\n Deflate.prototype.flush = function () {\n if (!this.ondata)\n err(5);\n if (this.s.l)\n err(4);\n this.p(this.b, false);\n this.s.w = this.s.i, this.s.i -= 2;\n };\n return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n function AsyncDeflate(opts, cb) {\n astrmify([\n bDflt,\n function () { return [astrm, Deflate]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Deflate(ev.data);\n onmessage = astrm(strm);\n }, 6, 1);\n }\n return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n function Inflate(opts, cb) {\n // no StrmOpt here to avoid adding to workerizer\n if (typeof opts == 'function')\n cb = opts, opts = {};\n this.ondata = cb;\n var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768);\n this.s = { i: 0, b: dict ? dict.length : 0 };\n this.o = new u8(32768);\n this.p = new u8(0);\n if (dict)\n this.o.set(dict);\n }\n Inflate.prototype.e = function (c) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n if (!this.p.length)\n this.p = c;\n else if (c.length) {\n var n = new u8(this.p.length + c.length);\n n.set(this.p), n.set(c, this.p.length), this.p = n;\n }\n };\n Inflate.prototype.c = function (final) {\n this.s.i = +(this.d = final || false);\n var bts = this.s.b;\n var dt = inflt(this.p, this.s, this.o);\n this.ondata(slc(dt, bts, this.s.b), this.d);\n this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n };\n /**\n * Pushes a chunk to be inflated\n * @param chunk The chunk to push\n * @param final Whether this is the final chunk\n */\n Inflate.prototype.push = function (chunk, final) {\n this.e(chunk), this.c(final);\n };\n return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n function AsyncInflate(opts, cb) {\n astrmify([\n bInflt,\n function () { return [astrm, Inflate]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Inflate(ev.data);\n onmessage = astrm(strm);\n }, 7, 0);\n }\n return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt\n ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, opts) {\n return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n function Gzip(opts, cb) {\n this.c = crc();\n this.l = 0;\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gzip.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n this.l += chunk.length;\n Deflate.prototype.push.call(this, chunk, final);\n };\n Gzip.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s);\n if (this.v)\n gzh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * GZIPped output for small inputs.\n */\n Gzip.prototype.flush = function () {\n Deflate.prototype.flush.call(this);\n };\n return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n function AsyncGzip(opts, cb) {\n astrmify([\n bDflt,\n gze,\n function () { return [astrm, Deflate, Gzip]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gzip(ev.data);\n onmessage = astrm(strm);\n }, 8, 1);\n }\n return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n gze,\n function () { return [gzipSync]; }\n ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n if (!opts)\n opts = {};\n var c = crc(), l = data.length;\n c.p(data);\n var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming single or multi-member GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n function Gunzip(opts, cb) {\n this.v = 1;\n this.r = 0;\n Inflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be GUNZIPped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Gunzip.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n this.r += chunk.length;\n if (this.v) {\n var p = this.p.subarray(this.v - 1);\n var s = p.length > 3 ? gzs(p) : 4;\n if (s > p.length) {\n if (!final)\n return;\n }\n else if (this.v > 1 && this.onmember) {\n this.onmember(this.r - p.length);\n }\n this.p = p.subarray(s), this.v = 0;\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n // process concatenated GZIP\n if (this.s.f && !this.s.l && !final) {\n this.v = shft(this.s.p) + 9;\n this.s = { i: 0 };\n this.o = new u8(0);\n this.push(new u8(0), final);\n }\n };\n return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming single or multi-member GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n function AsyncGunzip(opts, cb) {\n var _this = this;\n astrmify([\n bInflt,\n guze,\n function () { return [astrm, Inflate, Gunzip]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Gunzip(ev.data);\n strm.onmember = function (offset) { return postMessage(offset); };\n onmessage = astrm(strm);\n }, 9, 0, function (offset) { return _this.onmember && _this.onmember(offset); });\n }\n return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n guze,\n function () { return [gunzipSync]; }\n ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, opts) {\n var st = gzs(data);\n if (st + 8 > data.length)\n err(6, 'invalid gzip data');\n return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n function Zlib(opts, cb) {\n this.c = adler();\n this.v = 1;\n Deflate.call(this, opts, cb);\n }\n /**\n * Pushes a chunk to be zlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Zlib.prototype.push = function (chunk, final) {\n this.c.p(chunk);\n Deflate.prototype.push.call(this, chunk, final);\n };\n Zlib.prototype.p = function (c, f) {\n var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s);\n if (this.v)\n zlh(raw, this.o), this.v = 0;\n if (f)\n wbytes(raw, raw.length - 4, this.c.d());\n this.ondata(raw, f);\n };\n /**\n * Flushes buffered uncompressed data. Useful to immediately retrieve the\n * zlibbed output for small inputs.\n */\n Zlib.prototype.flush = function () {\n Deflate.prototype.flush.call(this);\n };\n return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n function AsyncZlib(opts, cb) {\n astrmify([\n bDflt,\n zle,\n function () { return [astrm, Deflate, Zlib]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Zlib(ev.data);\n onmessage = astrm(strm);\n }, 10, 1);\n }\n return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bDflt,\n zle,\n function () { return [zlibSync]; }\n ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n if (!opts)\n opts = {};\n var a = adler();\n a.p(data);\n var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4);\n return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n function Unzlib(opts, cb) {\n Inflate.call(this, opts, cb);\n this.v = opts && opts.dictionary ? 2 : 1;\n }\n /**\n * Pushes a chunk to be unzlibbed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzlib.prototype.push = function (chunk, final) {\n Inflate.prototype.e.call(this, chunk);\n if (this.v) {\n if (this.p.length < 6 && !final)\n return;\n this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0;\n }\n if (final) {\n if (this.p.length < 4)\n err(6, 'invalid zlib data');\n this.p = this.p.subarray(0, -4);\n }\n // necessary to prevent TS from using the closure value\n // This allows for workerization to function correctly\n Inflate.prototype.c.call(this, final);\n };\n return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n function AsyncUnzlib(opts, cb) {\n astrmify([\n bInflt,\n zule,\n function () { return [astrm, Inflate, Unzlib]; }\n ], this, StrmOpt.call(this, opts, cb), function (ev) {\n var strm = new Unzlib(ev.data);\n onmessage = astrm(strm);\n }, 11, 0);\n }\n return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return cbify(data, opts, [\n bInflt,\n zule,\n function () { return [unzlibSync]; }\n ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, opts) {\n return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n function Decompress(opts, cb) {\n this.o = StrmOpt.call(this, opts, cb) || {};\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n }\n // init substream\n // overriden by AsyncDecompress\n Decompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (dat, final) {\n _this.ondata(dat, final);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Decompress.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (!this.s) {\n if (this.p && this.p.length) {\n var n = new u8(this.p.length + chunk.length);\n n.set(this.p), n.set(chunk, this.p.length);\n }\n else\n this.p = chunk;\n if (this.p.length > 2) {\n this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n ? new this.G(this.o)\n : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n ? new this.I(this.o)\n : new this.Z(this.o);\n this.i();\n this.s.push(this.p, final);\n this.p = null;\n }\n }\n else\n this.s.push(chunk, final);\n };\n return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n function AsyncDecompress(opts, cb) {\n Decompress.call(this, opts, cb);\n this.queuedSize = 0;\n this.G = AsyncGunzip;\n this.I = AsyncInflate;\n this.Z = AsyncUnzlib;\n }\n AsyncDecompress.prototype.i = function () {\n var _this = this;\n this.s.ondata = function (err, dat, final) {\n _this.ondata(err, dat, final);\n };\n this.s.ondrain = function (size) {\n _this.queuedSize -= size;\n if (_this.ondrain)\n _this.ondrain(size);\n };\n };\n /**\n * Pushes a chunk to be decompressed\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncDecompress.prototype.push = function (chunk, final) {\n this.queuedSize += chunk.length;\n Decompress.prototype.push.call(this, chunk, final);\n };\n return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzip(data, opts, cb)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflate(data, opts, cb)\n : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, opts) {\n return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n ? gunzipSync(data, opts)\n : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n ? inflateSync(data, opts)\n : unzlibSync(data, opts);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n for (var k in d) {\n var val = d[k], n = p + k, op = o;\n if (Array.isArray(val))\n op = mrg(o, val[1]), val = val[0];\n if (val instanceof u8)\n t[n] = [val, op];\n else {\n t[n += '/'] = [new u8(0), op];\n fltn(val, n, t, o);\n }\n }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n td.decode(et, { stream: true });\n tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n for (var r = '', i = 0;;) {\n var c = d[i++];\n var eb = (c > 127) + (c > 223) + (c > 239);\n if (i + eb > d.length)\n return { s: r, r: slc(d, i - 1) };\n if (!eb)\n r += String.fromCharCode(c);\n else if (eb == 3) {\n c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n }\n else if (eb & 1)\n r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n else\n r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is decoded\n */\n function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }\n /**\n * Pushes a chunk to be decoded from UTF-8 binary\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n DecodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n final = !!final;\n if (this.t) {\n this.ondata(this.t.decode(chunk, { stream: true }), final);\n if (final) {\n if (this.t.decode().length)\n err(8);\n this.t = null;\n }\n return;\n }\n if (!this.p)\n err(4);\n var dat = new u8(this.p.length + chunk.length);\n dat.set(this.p);\n dat.set(chunk, this.p.length);\n var _a = dutf8(dat), s = _a.s, r = _a.r;\n if (final) {\n if (r.length)\n err(8);\n this.p = null;\n }\n else\n this.p = r;\n this.ondata(s, final);\n };\n return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n /**\n * Creates a UTF-8 decoding stream\n * @param cb The callback to call whenever data is encoded\n */\n function EncodeUTF8(cb) {\n this.ondata = cb;\n }\n /**\n * Pushes a chunk to be encoded to UTF-8\n * @param chunk The string data to push\n * @param final Whether this is the last chunk\n */\n EncodeUTF8.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n if (this.d)\n err(4);\n this.ondata(strToU8(chunk), this.d = final || false);\n };\n return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n if (latin1) {\n var ar_1 = new u8(str.length);\n for (var i = 0; i < str.length; ++i)\n ar_1[i] = str.charCodeAt(i);\n return ar_1;\n }\n if (te)\n return te.encode(str);\n var l = str.length;\n var ar = new u8(str.length + (str.length >> 1));\n var ai = 0;\n var w = function (v) { ar[ai++] = v; };\n for (var i = 0; i < l; ++i) {\n if (ai + 5 > ar.length) {\n var n = new u8(ai + 8 + ((l - i) << 1));\n n.set(ar);\n ar = n;\n }\n var c = str.charCodeAt(i);\n if (c < 128 || latin1)\n w(c);\n else if (c < 2048)\n w(192 | (c >> 6)), w(128 | (c & 63));\n else if (c > 55295 && c < 57344)\n c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n else\n w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n }\n return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n * not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n if (latin1) {\n var r = '';\n for (var i = 0; i < dat.length; i += 16384)\n r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n return r;\n }\n else if (td) {\n return td.decode(dat);\n }\n else {\n var _a = dutf8(dat), s = _a.s, r = _a.r;\n if (r.length)\n err(8);\n return s;\n }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n ;\n return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n var le = 0;\n if (ex) {\n for (var k in ex) {\n var l = ex[k].length;\n if (l > 65535)\n err(9);\n le += l + 4;\n }\n }\n return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n var fl = fn.length, ex = f.extra, col = co && co.length;\n var exl = exfl(ex);\n wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n if (ce != null)\n d[b++] = 20, d[b++] = f.os;\n d[b] = 20, b += 2; // spec compliance? what's that?\n d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n if (y < 0 || y > 119)\n err(10);\n wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >> 1)), b += 4;\n if (c != -1) {\n wbytes(d, b, f.crc);\n wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n wbytes(d, b + 8, f.size);\n }\n wbytes(d, b + 12, fl);\n wbytes(d, b + 14, exl), b += 16;\n if (ce != null) {\n wbytes(d, b, col);\n wbytes(d, b + 6, f.attrs);\n wbytes(d, b + 10, ce), b += 14;\n }\n d.set(fn, b);\n b += fl;\n if (exl) {\n for (var k in ex) {\n var exf = ex[k], l = exf.length;\n wbytes(d, b, +k);\n wbytes(d, b + 2, l);\n d.set(exf, b + 4), b += 4 + l;\n }\n }\n if (col)\n d.set(co, b), b += col;\n return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n wbytes(o, b, 0x6054B50); // skip disk\n wbytes(o, b + 8, c);\n wbytes(o, b + 10, c);\n wbytes(o, b + 12, d);\n wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n /**\n * Creates a pass-through stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n */\n function ZipPassThrough(filename) {\n this.filename = filename;\n this.c = crc();\n this.size = 0;\n this.compression = 0;\n }\n /**\n * Processes a chunk and pushes to the output stream. You can override this\n * method in a subclass for custom behavior, but by default this passes\n * the data through. You must call this.ondata(err, chunk, final) at some\n * point in this method.\n * @param chunk The chunk to process\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.process = function (chunk, final) {\n this.ondata(null, chunk, final);\n };\n /**\n * Pushes a chunk to be added. If you are subclassing this with a custom\n * compression algorithm, note that you must push data from the source\n * file only, pre-compression.\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipPassThrough.prototype.push = function (chunk, final) {\n if (!this.ondata)\n err(5);\n this.c.p(chunk);\n this.size += chunk.length;\n if (final)\n this.crc = this.c.d();\n this.process(chunk, final || false);\n };\n return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function ZipDeflate(filename, opts) {\n var _this = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }\n ZipDeflate.prototype.process = function (chunk, final) {\n try {\n this.d.push(chunk, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n ZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n /**\n * Creates an asynchronous DEFLATE stream that can be added to ZIP archives\n * @param filename The filename to associate with this data stream\n * @param opts The compression options\n */\n function AsyncZipDeflate(filename, opts) {\n var _this = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }\n AsyncZipDeflate.prototype.process = function (chunk, final) {\n this.d.push(chunk, final);\n };\n /**\n * Pushes a chunk to be deflated\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n AsyncZipDeflate.prototype.push = function (chunk, final) {\n ZipPassThrough.prototype.push.call(this, chunk, final);\n };\n return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n /**\n * Creates an empty ZIP archive to which files can be added\n * @param cb The callback to call whenever data for the generated ZIP archive\n * is available\n */\n function Zip(cb) {\n this.ondata = cb;\n this.u = [];\n this.d = 1;\n }\n /**\n * Adds a file to the ZIP archive\n * @param file The file stream to add\n */\n Zip.prototype.add = function (file) {\n var _this = this;\n if (!this.ondata)\n err(5);\n // finishing or finished\n if (this.d & 2)\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n else {\n var f = strToU8(file.filename), fl_1 = f.length;\n var com = file.comment, o = com && strToU8(com);\n var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n var hl_1 = fl_1 + exfl(file.extra) + 30;\n if (fl_1 > 65535)\n this.ondata(err(11, 0, 1), null, false);\n var header = new u8(hl_1);\n wzh(header, 0, file, f, u, -1);\n var chks_1 = [header];\n var pAll_1 = function () {\n for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n var chk = chks_2[_i];\n _this.ondata(null, chk, false);\n }\n chks_1 = [];\n };\n var tr_1 = this.d;\n this.d = 0;\n var ind_1 = this.u.length;\n var uf_1 = mrg(file, {\n f: f,\n u: u,\n o: o,\n t: function () {\n if (file.terminate)\n file.terminate();\n },\n r: function () {\n pAll_1();\n if (tr_1) {\n var nxt = _this.u[ind_1 + 1];\n if (nxt)\n nxt.r();\n else\n _this.d = 1;\n }\n tr_1 = 1;\n }\n });\n var cl_1 = 0;\n file.ondata = function (err, dat, final) {\n if (err) {\n _this.ondata(err, dat, final);\n _this.terminate();\n }\n else {\n cl_1 += dat.length;\n chks_1.push(dat);\n if (final) {\n var dd = new u8(16);\n wbytes(dd, 0, 0x8074B50);\n wbytes(dd, 4, file.crc);\n wbytes(dd, 8, cl_1);\n wbytes(dd, 12, file.size);\n chks_1.push(dd);\n uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n if (tr_1)\n uf_1.r();\n tr_1 = 1;\n }\n else if (tr_1)\n pAll_1();\n }\n };\n this.u.push(uf_1);\n }\n };\n /**\n * Ends the process of adding files and prepares to emit the final chunks.\n * This *must* be called after adding all desired files for the resulting\n * ZIP file to work properly.\n */\n Zip.prototype.end = function () {\n var _this = this;\n if (this.d & 2) {\n this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n return;\n }\n if (this.d)\n this.e();\n else\n this.u.push({\n r: function () {\n if (!(_this.d & 1))\n return;\n _this.u.splice(-1, 1);\n _this.e();\n },\n t: function () { }\n });\n this.d = 3;\n };\n Zip.prototype.e = function () {\n var bt = 0, l = 0, tl = 0;\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n }\n var out = new u8(tl + 22);\n for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n var f = _c[_b];\n wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n }\n wzf(out, bt, this.u.length, tl, l);\n this.ondata(null, out, true);\n this.d = 2;\n };\n /**\n * A method to terminate any internal workers used by the stream. Subsequent\n * calls to add() will fail.\n */\n Zip.prototype.terminate = function () {\n for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n var f = _a[_i];\n f.t();\n }\n this.d = 2;\n };\n return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var r = {};\n fltn(data, '', r, opts);\n var k = Object.keys(r);\n var lft = k.length, o = 0, tot = 0;\n var slft = lft, files = new Array(lft);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var cbf = function () {\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n tot = 0;\n for (var i = 0; i < slft; ++i) {\n var f = files[i];\n try {\n var l = f.c.length;\n wzh(out, tot, f, f.f, f.u, l);\n var badd = 30 + f.f.length + exfl(f.extra);\n var loc = tot + badd;\n out.set(f.c, loc);\n wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n }\n catch (e) {\n return cbd(e, null);\n }\n }\n wzf(out, o, files.length, cdl, oe);\n cbd(null, out);\n };\n if (!lft)\n cbf();\n var _loop_1 = function (i) {\n var fn = k[i];\n var _a = r[fn], file = _a[0], p = _a[1];\n var c = crc(), size = file.length;\n c.p(file);\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n var compression = p.level == 0 ? 0 : 8;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n var l = d.length;\n files[i] = mrg(p, {\n size: size,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n compression: compression\n });\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n if (!--lft)\n cbf();\n }\n };\n if (s > 65535)\n cbl(err(11, 0, 1), null);\n if (!compression)\n cbl(null, file);\n else if (size < 160000) {\n try {\n cbl(null, deflateSync(file, p));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(deflate(file, p, cbl));\n };\n // Cannot use lft because it can decrease\n for (var i = 0; i < slft; ++i) {\n _loop_1(i);\n }\n return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n if (!opts)\n opts = {};\n var r = {};\n var files = [];\n fltn(data, '', r, opts);\n var o = 0;\n var tot = 0;\n for (var fn in r) {\n var _a = r[fn], file = _a[0], p = _a[1];\n var compression = p.level == 0 ? 0 : 8;\n var f = strToU8(fn), s = f.length;\n var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n var exl = exfl(p.extra);\n if (s > 65535)\n err(11);\n var d = compression ? deflateSync(file, p) : file, l = d.length;\n var c = crc();\n c.p(file);\n files.push(mrg(p, {\n size: file.length,\n crc: c.d(),\n c: d,\n f: f,\n m: m,\n u: s != fn.length || (m && (com.length != ms)),\n o: o,\n compression: compression\n }));\n o += 30 + s + exl + l;\n tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n }\n var out = new u8(tot + 22), oe = o, cdl = tot - o;\n for (var i = 0; i < files.length; ++i) {\n var f = files[i];\n wzh(out, f.o, f, f.f, f.u, f.c.length);\n var badd = 30 + f.f.length + exfl(f.extra);\n out.set(f.c, f.o + badd);\n wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n }\n wzf(out, o, files.length, cdl, oe);\n return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n function UnzipPassThrough() {\n }\n UnzipPassThrough.prototype.push = function (data, final) {\n this.ondata(null, data, final);\n };\n UnzipPassThrough.compression = 0;\n return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function UnzipInflate() {\n var _this = this;\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n }\n UnzipInflate.prototype.push = function (data, final) {\n try {\n this.i.push(data, final);\n }\n catch (e) {\n this.ondata(e, null, final);\n }\n };\n UnzipInflate.compression = 8;\n return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n /**\n * Creates a DEFLATE decompression that can be used in ZIP archives\n */\n function AsyncUnzipInflate(_, sz) {\n var _this = this;\n if (sz < 320000) {\n this.i = new Inflate(function (dat, final) {\n _this.ondata(null, dat, final);\n });\n }\n else {\n this.i = new AsyncInflate(function (err, dat, final) {\n _this.ondata(err, dat, final);\n });\n this.terminate = this.i.terminate;\n }\n }\n AsyncUnzipInflate.prototype.push = function (data, final) {\n if (this.i.terminate)\n data = slc(data, 0);\n this.i.push(data, final);\n };\n AsyncUnzipInflate.compression = 8;\n return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n /**\n * Creates a ZIP decompression stream\n * @param cb The callback to call whenever a file in the ZIP archive is found\n */\n function Unzip(cb) {\n this.onfile = cb;\n this.k = [];\n this.o = {\n 0: UnzipPassThrough\n };\n this.p = et;\n }\n /**\n * Pushes a chunk to be unzipped\n * @param chunk The chunk to push\n * @param final Whether this is the last chunk\n */\n Unzip.prototype.push = function (chunk, final) {\n var _this = this;\n if (!this.onfile)\n err(5);\n if (!this.p)\n err(4);\n if (this.c > 0) {\n var len = Math.min(this.c, chunk.length);\n var toAdd = chunk.subarray(0, len);\n this.c -= len;\n if (this.d)\n this.d.push(toAdd, !this.c);\n else\n this.k[0].push(toAdd);\n chunk = chunk.subarray(len);\n if (chunk.length)\n return this.push(chunk, final);\n }\n else {\n var f = 0, i = 0, is = void 0, buf = void 0;\n if (!this.p.length)\n buf = chunk;\n else if (!chunk.length)\n buf = this.p;\n else {\n buf = new u8(this.p.length + chunk.length);\n buf.set(this.p), buf.set(chunk, this.p.length);\n }\n var l = buf.length, oc = this.c, add = oc && this.d;\n var _loop_2 = function () {\n var _a;\n var sig = b4(buf, i);\n if (sig == 0x4034B50) {\n f = 1, is = i;\n this_1.d = null;\n this_1.c = 0;\n var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n if (l > i + 30 + fnl + es) {\n var chks_3 = [];\n this_1.k.unshift(chks_3);\n f = 2;\n var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n if (sc_1 == 4294967295) {\n _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n }\n else if (dd)\n sc_1 = -1;\n i += es;\n this_1.c = sc_1;\n var d_1;\n var file_1 = {\n name: fn_1,\n compression: cmp_1,\n start: function () {\n if (!file_1.ondata)\n err(5);\n if (!sc_1)\n file_1.ondata(null, et, true);\n else {\n var ctr = _this.o[cmp_1];\n if (!ctr)\n file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n var dat = chks_4[_i];\n d_1.push(dat, false);\n }\n if (_this.k[0] == chks_3 && _this.c)\n _this.d = d_1;\n else\n d_1.push(et, true);\n }\n },\n terminate: function () {\n if (d_1 && d_1.terminate)\n d_1.terminate();\n }\n };\n if (sc_1 >= 0)\n file_1.size = sc_1, file_1.originalSize = su_1;\n this_1.onfile(file_1);\n }\n return \"break\";\n }\n else if (oc) {\n if (sig == 0x8074B50) {\n is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n return \"break\";\n }\n else if (sig == 0x2014B50) {\n is = i -= 4, f = 3, this_1.c = 0;\n return \"break\";\n }\n }\n };\n var this_1 = this;\n for (; i < l - 4; ++i) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n this.p = et;\n if (oc < 0) {\n var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n if (add)\n add.push(dat, !!f);\n else\n this.k[+(f == 2)].push(dat);\n }\n if (f & 2)\n return this.push(buf.subarray(i), final);\n this.p = buf.subarray(i);\n }\n if (final) {\n if (this.c)\n err(13);\n this.p = null;\n }\n };\n /**\n * Registers a decoder with the stream, allowing for files compressed with\n * the compression type provided to be expanded correctly\n * @param decoder The decoder constructor\n */\n Unzip.prototype.register = function (decoder) {\n this.o[decoder.compression] = decoder;\n };\n return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n if (!cb)\n cb = opts, opts = {};\n if (typeof cb != 'function')\n err(7);\n var term = [];\n var tAll = function () {\n for (var i = 0; i < term.length; ++i)\n term[i]();\n };\n var files = {};\n var cbd = function (a, b) {\n mt(function () { cb(a, b); });\n };\n mt(function () { cbd = cb; });\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558) {\n cbd(err(13, 0, 1), null);\n return tAll;\n }\n }\n ;\n var lft = b2(data, e + 8);\n if (lft) {\n var c = lft;\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = lft = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n var _loop_3 = function (i) {\n var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n var cbl = function (e, d) {\n if (e) {\n tAll();\n cbd(e, null);\n }\n else {\n if (d)\n files[fn] = d;\n if (!--lft)\n cbd(null, files);\n }\n };\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_1\n })) {\n if (!c_1)\n cbl(null, slc(data, b, b + sc));\n else if (c_1 == 8) {\n var infl = data.subarray(b, b + sc);\n // Synchronously decompress under 512KB, or barely-compressed data\n if (su < 524288 || sc > 0.8 * su) {\n try {\n cbl(null, inflateSync(infl, { out: new u8(su) }));\n }\n catch (e) {\n cbl(e, null);\n }\n }\n else\n term.push(inflate(infl, { size: su }, cbl));\n }\n else\n cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n }\n else\n cbl(null, null);\n };\n for (var i = 0; i < c; ++i) {\n _loop_3(i);\n }\n }\n else\n cbd(null, {});\n return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n var files = {};\n var e = data.length - 22;\n for (; b4(data, e) != 0x6054B50; --e) {\n if (!e || data.length - e > 65558)\n err(13);\n }\n ;\n var c = b2(data, e + 8);\n if (!c)\n return {};\n var o = b4(data, e + 16);\n var z = o == 4294967295 || c == 65535;\n if (z) {\n var ze = b4(data, e - 12);\n z = b4(data, ze) == 0x6064B50;\n if (z) {\n c = b4(data, ze + 32);\n o = b4(data, ze + 48);\n }\n }\n var fltr = opts && opts.filter;\n for (var i = 0; i < c; ++i) {\n var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n o = no;\n if (!fltr || fltr({\n name: fn,\n size: sc,\n originalSize: su,\n compression: c_2\n })) {\n if (!c_2)\n files[fn] = slc(data, b, b + sc);\n else if (c_2 == 8)\n files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });\n else\n err(14, 'unknown compression type ' + c_2);\n }\n }\n return files;\n}\n","import {\n\tVector3,\n\tVector4\n} from 'three';\n\n/**\n * NURBS utils\n *\n * See NURBSCurve and NURBSSurface.\n **/\n\n\n/**************************************************************\n *\tNURBS Utils\n **************************************************************/\n\n/*\nFinds knot vector span.\n\np : degree\nu : parametric value\nU : knot vector\n\nreturns the span\n*/\nfunction findSpan( p, u, U ) {\n\n\tconst n = U.length - p - 1;\n\n\tif ( u >= U[ n ] ) {\n\n\t\treturn n - 1;\n\n\t}\n\n\tif ( u <= U[ p ] ) {\n\n\t\treturn p;\n\n\t}\n\n\tlet low = p;\n\tlet high = n;\n\tlet mid = Math.floor( ( low + high ) / 2 );\n\n\twhile ( u < U[ mid ] || u >= U[ mid + 1 ] ) {\n\n\t\tif ( u < U[ mid ] ) {\n\n\t\t\thigh = mid;\n\n\t\t} else {\n\n\t\t\tlow = mid;\n\n\t\t}\n\n\t\tmid = Math.floor( ( low + high ) / 2 );\n\n\t}\n\n\treturn mid;\n\n}\n\n\n/*\nCalculate basis functions. See The NURBS Book, page 70, algorithm A2.2\n\nspan : span in which u lies\nu : parametric point\np : degree\nU : knot vector\n\nreturns array[p+1] with basis functions values.\n*/\nfunction calcBasisFunctions( span, u, p, U ) {\n\n\tconst N = [];\n\tconst left = [];\n\tconst right = [];\n\tN[ 0 ] = 1.0;\n\n\tfor ( let j = 1; j <= p; ++ j ) {\n\n\t\tleft[ j ] = u - U[ span + 1 - j ];\n\t\tright[ j ] = U[ span + j ] - u;\n\n\t\tlet saved = 0.0;\n\n\t\tfor ( let r = 0; r < j; ++ r ) {\n\n\t\t\tconst rv = right[ r + 1 ];\n\t\t\tconst lv = left[ j - r ];\n\t\t\tconst temp = N[ r ] / ( rv + lv );\n\t\t\tN[ r ] = saved + rv * temp;\n\t\t\tsaved = lv * temp;\n\n\t\t}\n\n\t\tN[ j ] = saved;\n\n\t}\n\n\treturn N;\n\n}\n\n\n/*\nCalculate B-Spline curve points. See The NURBS Book, page 82, algorithm A3.1.\n\np : degree of B-Spline\nU : knot vector\nP : control points (x, y, z, w)\nu : parametric point\n\nreturns point for given u\n*/\nfunction calcBSplinePoint( p, U, P, u ) {\n\n\tconst span = findSpan( p, u, U );\n\tconst N = calcBasisFunctions( span, u, p, U );\n\tconst C = new Vector4( 0, 0, 0, 0 );\n\n\tfor ( let j = 0; j <= p; ++ j ) {\n\n\t\tconst point = P[ span - p + j ];\n\t\tconst Nj = N[ j ];\n\t\tconst wNj = point.w * Nj;\n\t\tC.x += point.x * wNj;\n\t\tC.y += point.y * wNj;\n\t\tC.z += point.z * wNj;\n\t\tC.w += point.w * Nj;\n\n\t}\n\n\treturn C;\n\n}\n\n\n/*\nCalculate basis functions derivatives. See The NURBS Book, page 72, algorithm A2.3.\n\nspan : span in which u lies\nu : parametric point\np : degree\nn : number of derivatives to calculate\nU : knot vector\n\nreturns array[n+1][p+1] with basis functions derivatives\n*/\nfunction calcBasisFunctionDerivatives( span, u, p, n, U ) {\n\n\tconst zeroArr = [];\n\tfor ( let i = 0; i <= p; ++ i )\n\t\tzeroArr[ i ] = 0.0;\n\n\tconst ders = [];\n\n\tfor ( let i = 0; i <= n; ++ i )\n\t\tders[ i ] = zeroArr.slice( 0 );\n\n\tconst ndu = [];\n\n\tfor ( let i = 0; i <= p; ++ i )\n\t\tndu[ i ] = zeroArr.slice( 0 );\n\n\tndu[ 0 ][ 0 ] = 1.0;\n\n\tconst left = zeroArr.slice( 0 );\n\tconst right = zeroArr.slice( 0 );\n\n\tfor ( let j = 1; j <= p; ++ j ) {\n\n\t\tleft[ j ] = u - U[ span + 1 - j ];\n\t\tright[ j ] = U[ span + j ] - u;\n\n\t\tlet saved = 0.0;\n\n\t\tfor ( let r = 0; r < j; ++ r ) {\n\n\t\t\tconst rv = right[ r + 1 ];\n\t\t\tconst lv = left[ j - r ];\n\t\t\tndu[ j ][ r ] = rv + lv;\n\n\t\t\tconst temp = ndu[ r ][ j - 1 ] / ndu[ j ][ r ];\n\t\t\tndu[ r ][ j ] = saved + rv * temp;\n\t\t\tsaved = lv * temp;\n\n\t\t}\n\n\t\tndu[ j ][ j ] = saved;\n\n\t}\n\n\tfor ( let j = 0; j <= p; ++ j ) {\n\n\t\tders[ 0 ][ j ] = ndu[ j ][ p ];\n\n\t}\n\n\tfor ( let r = 0; r <= p; ++ r ) {\n\n\t\tlet s1 = 0;\n\t\tlet s2 = 1;\n\n\t\tconst a = [];\n\t\tfor ( let i = 0; i <= p; ++ i ) {\n\n\t\t\ta[ i ] = zeroArr.slice( 0 );\n\n\t\t}\n\n\t\ta[ 0 ][ 0 ] = 1.0;\n\n\t\tfor ( let k = 1; k <= n; ++ k ) {\n\n\t\t\tlet d = 0.0;\n\t\t\tconst rk = r - k;\n\t\t\tconst pk = p - k;\n\n\t\t\tif ( r >= k ) {\n\n\t\t\t\ta[ s2 ][ 0 ] = a[ s1 ][ 0 ] / ndu[ pk + 1 ][ rk ];\n\t\t\t\td = a[ s2 ][ 0 ] * ndu[ rk ][ pk ];\n\n\t\t\t}\n\n\t\t\tconst j1 = ( rk >= - 1 ) ? 1 : - rk;\n\t\t\tconst j2 = ( r - 1 <= pk ) ? k - 1 : p - r;\n\n\t\t\tfor ( let j = j1; j <= j2; ++ j ) {\n\n\t\t\t\ta[ s2 ][ j ] = ( a[ s1 ][ j ] - a[ s1 ][ j - 1 ] ) / ndu[ pk + 1 ][ rk + j ];\n\t\t\t\td += a[ s2 ][ j ] * ndu[ rk + j ][ pk ];\n\n\t\t\t}\n\n\t\t\tif ( r <= pk ) {\n\n\t\t\t\ta[ s2 ][ k ] = - a[ s1 ][ k - 1 ] / ndu[ pk + 1 ][ r ];\n\t\t\t\td += a[ s2 ][ k ] * ndu[ r ][ pk ];\n\n\t\t\t}\n\n\t\t\tders[ k ][ r ] = d;\n\n\t\t\tconst j = s1;\n\t\t\ts1 = s2;\n\t\t\ts2 = j;\n\n\t\t}\n\n\t}\n\n\tlet r = p;\n\n\tfor ( let k = 1; k <= n; ++ k ) {\n\n\t\tfor ( let j = 0; j <= p; ++ j ) {\n\n\t\t\tders[ k ][ j ] *= r;\n\n\t\t}\n\n\t\tr *= p - k;\n\n\t}\n\n\treturn ders;\n\n}\n\n\n/*\n\tCalculate derivatives of a B-Spline. See The NURBS Book, page 93, algorithm A3.2.\n\n\tp : degree\n\tU : knot vector\n\tP : control points\n\tu : Parametric points\n\tnd : number of derivatives\n\n\treturns array[d+1] with derivatives\n\t*/\nfunction calcBSplineDerivatives( p, U, P, u, nd ) {\n\n\tconst du = nd < p ? nd : p;\n\tconst CK = [];\n\tconst span = findSpan( p, u, U );\n\tconst nders = calcBasisFunctionDerivatives( span, u, p, du, U );\n\tconst Pw = [];\n\n\tfor ( let i = 0; i < P.length; ++ i ) {\n\n\t\tconst point = P[ i ].clone();\n\t\tconst w = point.w;\n\n\t\tpoint.x *= w;\n\t\tpoint.y *= w;\n\t\tpoint.z *= w;\n\n\t\tPw[ i ] = point;\n\n\t}\n\n\tfor ( let k = 0; k <= du; ++ k ) {\n\n\t\tconst point = Pw[ span - p ].clone().multiplyScalar( nders[ k ][ 0 ] );\n\n\t\tfor ( let j = 1; j <= p; ++ j ) {\n\n\t\t\tpoint.add( Pw[ span - p + j ].clone().multiplyScalar( nders[ k ][ j ] ) );\n\n\t\t}\n\n\t\tCK[ k ] = point;\n\n\t}\n\n\tfor ( let k = du + 1; k <= nd + 1; ++ k ) {\n\n\t\tCK[ k ] = new Vector4( 0, 0, 0 );\n\n\t}\n\n\treturn CK;\n\n}\n\n\n/*\nCalculate \"K over I\"\n\nreturns k!/(i!(k-i)!)\n*/\nfunction calcKoverI( k, i ) {\n\n\tlet nom = 1;\n\n\tfor ( let j = 2; j <= k; ++ j ) {\n\n\t\tnom *= j;\n\n\t}\n\n\tlet denom = 1;\n\n\tfor ( let j = 2; j <= i; ++ j ) {\n\n\t\tdenom *= j;\n\n\t}\n\n\tfor ( let j = 2; j <= k - i; ++ j ) {\n\n\t\tdenom *= j;\n\n\t}\n\n\treturn nom / denom;\n\n}\n\n\n/*\nCalculate derivatives (0-nd) of rational curve. See The NURBS Book, page 127, algorithm A4.2.\n\nPders : result of function calcBSplineDerivatives\n\nreturns array with derivatives for rational curve.\n*/\nfunction calcRationalCurveDerivatives( Pders ) {\n\n\tconst nd = Pders.length;\n\tconst Aders = [];\n\tconst wders = [];\n\n\tfor ( let i = 0; i < nd; ++ i ) {\n\n\t\tconst point = Pders[ i ];\n\t\tAders[ i ] = new Vector3( point.x, point.y, point.z );\n\t\twders[ i ] = point.w;\n\n\t}\n\n\tconst CK = [];\n\n\tfor ( let k = 0; k < nd; ++ k ) {\n\n\t\tconst v = Aders[ k ].clone();\n\n\t\tfor ( let i = 1; i <= k; ++ i ) {\n\n\t\t\tv.sub( CK[ k - i ].clone().multiplyScalar( calcKoverI( k, i ) * wders[ i ] ) );\n\n\t\t}\n\n\t\tCK[ k ] = v.divideScalar( wders[ 0 ] );\n\n\t}\n\n\treturn CK;\n\n}\n\n\n/*\nCalculate NURBS curve derivatives. See The NURBS Book, page 127, algorithm A4.2.\n\np : degree\nU : knot vector\nP : control points in homogeneous space\nu : parametric points\nnd : number of derivatives\n\nreturns array with derivatives.\n*/\nfunction calcNURBSDerivatives( p, U, P, u, nd ) {\n\n\tconst Pders = calcBSplineDerivatives( p, U, P, u, nd );\n\treturn calcRationalCurveDerivatives( Pders );\n\n}\n\n\n/*\nCalculate rational B-Spline surface point. See The NURBS Book, page 134, algorithm A4.3.\n\np, q : degrees of B-Spline surface\nU, V : knot vectors\nP : control points (x, y, z, w)\nu, v : parametric values\n\nreturns point for given (u, v)\n*/\nfunction calcSurfacePoint( p, q, U, V, P, u, v, target ) {\n\n\tconst uspan = findSpan( p, u, U );\n\tconst vspan = findSpan( q, v, V );\n\tconst Nu = calcBasisFunctions( uspan, u, p, U );\n\tconst Nv = calcBasisFunctions( vspan, v, q, V );\n\tconst temp = [];\n\n\tfor ( let l = 0; l <= q; ++ l ) {\n\n\t\ttemp[ l ] = new Vector4( 0, 0, 0, 0 );\n\t\tfor ( let k = 0; k <= p; ++ k ) {\n\n\t\t\tconst point = P[ uspan - p + k ][ vspan - q + l ].clone();\n\t\t\tconst w = point.w;\n\t\t\tpoint.x *= w;\n\t\t\tpoint.y *= w;\n\t\t\tpoint.z *= w;\n\t\t\ttemp[ l ].add( point.multiplyScalar( Nu[ k ] ) );\n\n\t\t}\n\n\t}\n\n\tconst Sw = new Vector4( 0, 0, 0, 0 );\n\tfor ( let l = 0; l <= q; ++ l ) {\n\n\t\tSw.add( temp[ l ].multiplyScalar( Nv[ l ] ) );\n\n\t}\n\n\tSw.divideScalar( Sw.w );\n\ttarget.set( Sw.x, Sw.y, Sw.z );\n\n}\n\n/*\nCalculate rational B-Spline volume point. See The NURBS Book, page 134, algorithm A4.3.\n\np, q, r : degrees of B-Splinevolume\nU, V, W : knot vectors\nP : control points (x, y, z, w)\nu, v, w : parametric values\n\nreturns point for given (u, v, w)\n*/\nfunction calcVolumePoint( p, q, r, U, V, W, P, u, v, w, target ) {\n\n\tconst uspan = findSpan( p, u, U );\n\tconst vspan = findSpan( q, v, V );\n\tconst wspan = findSpan( r, w, W );\n\tconst Nu = calcBasisFunctions( uspan, u, p, U );\n\tconst Nv = calcBasisFunctions( vspan, v, q, V );\n\tconst Nw = calcBasisFunctions( wspan, w, r, W );\n\tconst temp = [];\n\n\tfor ( let m = 0; m <= r; ++ m ) {\n\n\t\ttemp[ m ] = [];\n\n\t\tfor ( let l = 0; l <= q; ++ l ) {\n\n\t\t\ttemp[ m ][ l ] = new Vector4( 0, 0, 0, 0 );\n\t\t\tfor ( let k = 0; k <= p; ++ k ) {\n\n\t\t\t\tconst point = P[ uspan - p + k ][ vspan - q + l ][ wspan - r + m ].clone();\n\t\t\t\tconst w = point.w;\n\t\t\t\tpoint.x *= w;\n\t\t\t\tpoint.y *= w;\n\t\t\t\tpoint.z *= w;\n\t\t\t\ttemp[ m ][ l ].add( point.multiplyScalar( Nu[ k ] ) );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\tconst Sw = new Vector4( 0, 0, 0, 0 );\n\tfor ( let m = 0; m <= r; ++ m ) {\n\t\tfor ( let l = 0; l <= q; ++ l ) {\n\n\t\t\tSw.add( temp[ m ][ l ].multiplyScalar( Nw[ m ] ).multiplyScalar( Nv[ l ] ) );\n\n\t\t}\n\t}\n\n\tSw.divideScalar( Sw.w );\n\ttarget.set( Sw.x, Sw.y, Sw.z );\n\n}\n\n\nexport {\n\tfindSpan,\n\tcalcBasisFunctions,\n\tcalcBSplinePoint,\n\tcalcBasisFunctionDerivatives,\n\tcalcBSplineDerivatives,\n\tcalcKoverI,\n\tcalcRationalCurveDerivatives,\n\tcalcNURBSDerivatives,\n\tcalcSurfacePoint,\n\tcalcVolumePoint,\n};\n","import {\n\tCurve,\n\tVector3,\n\tVector4\n} from 'three';\nimport * as NURBSUtils from '../curves/NURBSUtils.js';\n\n/**\n * NURBS curve object\n *\n * Derives from Curve, overriding getPoint and getTangent.\n *\n * Implementation is based on (x, y [, z=0 [, w=1]]) control points with w=weight.\n *\n **/\n\nclass NURBSCurve extends Curve {\n\n\tconstructor(\n\t\tdegree,\n\t\tknots /* array of reals */,\n\t\tcontrolPoints /* array of Vector(2|3|4) */,\n\t\tstartKnot /* index in knots */,\n\t\tendKnot /* index in knots */\n\t) {\n\n\t\tsuper();\n\n\t\tconst knotsLength = knots ? knots.length - 1 : 0;\n\t\tconst pointsLength = controlPoints ? controlPoints.length : 0;\n\n\t\tthis.degree = degree;\n\t\tthis.knots = knots;\n\t\tthis.controlPoints = [];\n\t\t// Used by periodic NURBS to remove hidden spans\n\t\tthis.startKnot = startKnot || 0;\n\t\tthis.endKnot = endKnot || knotsLength;\n\n\t\tfor ( let i = 0; i < pointsLength; ++ i ) {\n\n\t\t\t// ensure Vector4 for control points\n\t\t\tconst point = controlPoints[ i ];\n\t\t\tthis.controlPoints[ i ] = new Vector4( point.x, point.y, point.z, point.w );\n\n\t\t}\n\n\t}\n\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst u = this.knots[ this.startKnot ] + t * ( this.knots[ this.endKnot ] - this.knots[ this.startKnot ] ); // linear mapping t->u\n\n\t\t// following results in (wx, wy, wz, w) homogeneous point\n\t\tconst hpoint = NURBSUtils.calcBSplinePoint( this.degree, this.knots, this.controlPoints, u );\n\n\t\tif ( hpoint.w !== 1.0 ) {\n\n\t\t\t// project to 3D space: (wx, wy, wz, w) -> (x, y, z, 1)\n\t\t\thpoint.divideScalar( hpoint.w );\n\n\t\t}\n\n\t\treturn point.set( hpoint.x, hpoint.y, hpoint.z );\n\n\t}\n\n\tgetTangent( t, optionalTarget = new Vector3() ) {\n\n\t\tconst tangent = optionalTarget;\n\n\t\tconst u = this.knots[ 0 ] + t * ( this.knots[ this.knots.length - 1 ] - this.knots[ 0 ] );\n\t\tconst ders = NURBSUtils.calcNURBSDerivatives( this.degree, this.knots, this.controlPoints, u, 1 );\n\t\ttangent.copy( ders[ 1 ] ).normalize();\n\n\t\treturn tangent;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.degree = this.degree;\n\t\tdata.knots = [ ...this.knots ];\n\t\tdata.controlPoints = this.controlPoints.map( p => p.toArray() );\n\t\tdata.startKnot = this.startKnot;\n\t\tdata.endKnot = this.endKnot;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.degree = json.degree;\n\t\tthis.knots = [ ...json.knots ];\n\t\tthis.controlPoints = json.controlPoints.map( p => new Vector4( p[ 0 ], p[ 1 ], p[ 2 ], p[ 3 ] ) );\n\t\tthis.startKnot = json.startKnot;\n\t\tthis.endKnot = json.endKnot;\n\n\t\treturn this;\n\n\t}\n\n}\n\nexport { NURBSCurve };","import {\n\tAmbientLight,\n\tAnimationClip,\n\tBone,\n\tBufferGeometry,\n\tClampToEdgeWrapping,\n\tColor,\n\tColorManagement,\n\tDirectionalLight,\n\tEquirectangularReflectionMapping,\n\tEuler,\n\tFileLoader,\n\tFloat32BufferAttribute,\n\tGroup,\n\tLine,\n\tLineBasicMaterial,\n\tLoader,\n\tLoaderUtils,\n\tMathUtils,\n\tMatrix3,\n\tMatrix4,\n\tMesh,\n\tMeshLambertMaterial,\n\tMeshPhongMaterial,\n\tNumberKeyframeTrack,\n\tObject3D,\n\tPerspectiveCamera,\n\tPointLight,\n\tPropertyBinding,\n\tQuaternion,\n\tQuaternionKeyframeTrack,\n\tRepeatWrapping,\n\tSRGBColorSpace,\n\tShapeUtils,\n\tSkeleton,\n\tSkinnedMesh,\n\tSpotLight,\n\tTexture,\n\tTextureLoader,\n\tUint16BufferAttribute,\n\tVector2,\n\tVector3,\n\tVector4,\n\tVectorKeyframeTrack\n} from 'three';\n\nimport * as fflate from '../libs/fflate.module.js';\nimport { NURBSCurve } from '../curves/NURBSCurve.js';\n\n/**\n * Loader loads FBX file and generates Group representing FBX scene.\n * Requires FBX file to be >= 7.0 and in ASCII or >= 6400 in Binary format\n * Versions lower than this may load but will probably have errors\n *\n * Needs Support:\n * Morph normals / blend shape normals\n *\n * FBX format references:\n * \thttps://help.autodesk.com/view/FBX/2017/ENU/?guid=__cpp_ref_index_html (C++ SDK reference)\n *\n * Binary format specification:\n *\thttps://code.blender.org/2013/08/fbx-binary-file-format-specification/\n */\n\n\nlet fbxTree;\nlet connections;\nlet sceneGraph;\n\nclass FBXLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst path = ( scope.path === '' ) ? LoaderUtils.extractUrlBase( url ) : scope.path;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( scope.path );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( scope.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\n\t\tloader.load( url, function ( buffer ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( buffer, path ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tparse( FBXBuffer, path ) {\n\n\t\tif ( isFbxFormatBinary( FBXBuffer ) ) {\n\n\t\t\tfbxTree = new BinaryParser().parse( FBXBuffer );\n\n\t\t} else {\n\n\t\t\tconst FBXText = convertArrayBufferToString( FBXBuffer );\n\n\t\t\tif ( ! isFbxFormatASCII( FBXText ) ) {\n\n\t\t\t\tthrow new Error( 'THREE.FBXLoader: Unknown format.' );\n\n\t\t\t}\n\n\t\t\tif ( getFbxVersion( FBXText ) < 7000 ) {\n\n\t\t\t\tthrow new Error( 'THREE.FBXLoader: FBX version not supported, FileVersion: ' + getFbxVersion( FBXText ) );\n\n\t\t\t}\n\n\t\t\tfbxTree = new TextParser().parse( FBXText );\n\n\t\t}\n\n\t\t// console.log( fbxTree );\n\n\t\tconst textureLoader = new TextureLoader( this.manager ).setPath( this.resourcePath || path ).setCrossOrigin( this.crossOrigin );\n\n\t\treturn new FBXTreeParser( textureLoader, this.manager ).parse( fbxTree );\n\n\t}\n\n}\n\n// Parse the FBXTree object returned by the BinaryParser or TextParser and return a Group\nclass FBXTreeParser {\n\n\tconstructor( textureLoader, manager ) {\n\n\t\tthis.textureLoader = textureLoader;\n\t\tthis.manager = manager;\n\n\t}\n\n\tparse() {\n\n\t\tconnections = this.parseConnections();\n\n\t\tconst images = this.parseImages();\n\t\tconst textures = this.parseTextures( images );\n\t\tconst materials = this.parseMaterials( textures );\n\t\tconst deformers = this.parseDeformers();\n\t\tconst geometryMap = new GeometryParser().parse( deformers );\n\n\t\tthis.parseScene( deformers, geometryMap, materials );\n\n\t\treturn sceneGraph;\n\n\t}\n\n\t// Parses FBXTree.Connections which holds parent-child connections between objects (e.g. material -> texture, model->geometry )\n\t// and details the connection type\n\tparseConnections() {\n\n\t\tconst connectionMap = new Map();\n\n\t\tif ( 'Connections' in fbxTree ) {\n\n\t\t\tconst rawConnections = fbxTree.Connections.connections;\n\n\t\t\trawConnections.forEach( function ( rawConnection ) {\n\n\t\t\t\tconst fromID = rawConnection[ 0 ];\n\t\t\t\tconst toID = rawConnection[ 1 ];\n\t\t\t\tconst relationship = rawConnection[ 2 ];\n\n\t\t\t\tif ( ! connectionMap.has( fromID ) ) {\n\n\t\t\t\t\tconnectionMap.set( fromID, {\n\t\t\t\t\t\tparents: [],\n\t\t\t\t\t\tchildren: []\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t\tconst parentRelationship = { ID: toID, relationship: relationship };\n\t\t\t\tconnectionMap.get( fromID ).parents.push( parentRelationship );\n\n\t\t\t\tif ( ! connectionMap.has( toID ) ) {\n\n\t\t\t\t\tconnectionMap.set( toID, {\n\t\t\t\t\t\tparents: [],\n\t\t\t\t\t\tchildren: []\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t\tconst childRelationship = { ID: fromID, relationship: relationship };\n\t\t\t\tconnectionMap.get( toID ).children.push( childRelationship );\n\n\t\t\t} );\n\n\t\t}\n\n\t\treturn connectionMap;\n\n\t}\n\n\t// Parse FBXTree.Objects.Video for embedded image data\n\t// These images are connected to textures in FBXTree.Objects.Textures\n\t// via FBXTree.Connections.\n\tparseImages() {\n\n\t\tconst images = {};\n\t\tconst blobs = {};\n\n\t\tif ( 'Video' in fbxTree.Objects ) {\n\n\t\t\tconst videoNodes = fbxTree.Objects.Video;\n\n\t\t\tfor ( const nodeID in videoNodes ) {\n\n\t\t\t\tconst videoNode = videoNodes[ nodeID ];\n\n\t\t\t\tconst id = parseInt( nodeID );\n\n\t\t\t\timages[ id ] = videoNode.RelativeFilename || videoNode.Filename;\n\n\t\t\t\t// raw image data is in videoNode.Content\n\t\t\t\tif ( 'Content' in videoNode ) {\n\n\t\t\t\t\tconst arrayBufferContent = ( videoNode.Content instanceof ArrayBuffer ) && ( videoNode.Content.byteLength > 0 );\n\t\t\t\t\tconst base64Content = ( typeof videoNode.Content === 'string' ) && ( videoNode.Content !== '' );\n\n\t\t\t\t\tif ( arrayBufferContent || base64Content ) {\n\n\t\t\t\t\t\tconst image = this.parseImage( videoNodes[ nodeID ] );\n\n\t\t\t\t\t\tblobs[ videoNode.RelativeFilename || videoNode.Filename ] = image;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( const id in images ) {\n\n\t\t\tconst filename = images[ id ];\n\n\t\t\tif ( blobs[ filename ] !== undefined ) images[ id ] = blobs[ filename ];\n\t\t\telse images[ id ] = images[ id ].split( '\\\\' ).pop();\n\n\t\t}\n\n\t\treturn images;\n\n\t}\n\n\t// Parse embedded image data in FBXTree.Video.Content\n\tparseImage( videoNode ) {\n\n\t\tconst content = videoNode.Content;\n\t\tconst fileName = videoNode.RelativeFilename || videoNode.Filename;\n\t\tconst extension = fileName.slice( fileName.lastIndexOf( '.' ) + 1 ).toLowerCase();\n\n\t\tlet type;\n\n\t\tswitch ( extension ) {\n\n\t\t\tcase 'bmp':\n\n\t\t\t\ttype = 'image/bmp';\n\t\t\t\tbreak;\n\n\t\t\tcase 'jpg':\n\t\t\tcase 'jpeg':\n\n\t\t\t\ttype = 'image/jpeg';\n\t\t\t\tbreak;\n\n\t\t\tcase 'png':\n\n\t\t\t\ttype = 'image/png';\n\t\t\t\tbreak;\n\n\t\t\tcase 'tif':\n\n\t\t\t\ttype = 'image/tiff';\n\t\t\t\tbreak;\n\n\t\t\tcase 'tga':\n\n\t\t\t\tif ( this.manager.getHandler( '.tga' ) === null ) {\n\n\t\t\t\t\tconsole.warn( 'FBXLoader: TGA loader not found, skipping ', fileName );\n\n\t\t\t\t}\n\n\t\t\t\ttype = 'image/tga';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tconsole.warn( 'FBXLoader: Image type \"' + extension + '\" is not supported.' );\n\t\t\t\treturn;\n\n\t\t}\n\n\t\tif ( typeof content === 'string' ) { // ASCII format\n\n\t\t\treturn 'data:' + type + ';base64,' + content;\n\n\t\t} else { // Binary Format\n\n\t\t\tconst array = new Uint8Array( content );\n\t\t\treturn window.URL.createObjectURL( new Blob( [ array ], { type: type } ) );\n\n\t\t}\n\n\t}\n\n\t// Parse nodes in FBXTree.Objects.Texture\n\t// These contain details such as UV scaling, cropping, rotation etc and are connected\n\t// to images in FBXTree.Objects.Video\n\tparseTextures( images ) {\n\n\t\tconst textureMap = new Map();\n\n\t\tif ( 'Texture' in fbxTree.Objects ) {\n\n\t\t\tconst textureNodes = fbxTree.Objects.Texture;\n\t\t\tfor ( const nodeID in textureNodes ) {\n\n\t\t\t\tconst texture = this.parseTexture( textureNodes[ nodeID ], images );\n\t\t\t\ttextureMap.set( parseInt( nodeID ), texture );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn textureMap;\n\n\t}\n\n\t// Parse individual node in FBXTree.Objects.Texture\n\tparseTexture( textureNode, images ) {\n\n\t\tconst texture = this.loadTexture( textureNode, images );\n\n\t\ttexture.ID = textureNode.id;\n\n\t\ttexture.name = textureNode.attrName;\n\n\t\tconst wrapModeU = textureNode.WrapModeU;\n\t\tconst wrapModeV = textureNode.WrapModeV;\n\n\t\tconst valueU = wrapModeU !== undefined ? wrapModeU.value : 0;\n\t\tconst valueV = wrapModeV !== undefined ? wrapModeV.value : 0;\n\n\t\t// http://download.autodesk.com/us/fbx/SDKdocs/FBX_SDK_Help/files/fbxsdkref/class_k_fbx_texture.html#889640e63e2e681259ea81061b85143a\n\t\t// 0: repeat(default), 1: clamp\n\n\t\ttexture.wrapS = valueU === 0 ? RepeatWrapping : ClampToEdgeWrapping;\n\t\ttexture.wrapT = valueV === 0 ? RepeatWrapping : ClampToEdgeWrapping;\n\n\t\tif ( 'Scaling' in textureNode ) {\n\n\t\t\tconst values = textureNode.Scaling.value;\n\n\t\t\ttexture.repeat.x = values[ 0 ];\n\t\t\ttexture.repeat.y = values[ 1 ];\n\n\t\t}\n\n\t\tif ( 'Translation' in textureNode ) {\n\n\t\t\tconst values = textureNode.Translation.value;\n\n\t\t\ttexture.offset.x = values[ 0 ];\n\t\t\ttexture.offset.y = values[ 1 ];\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\t// load a texture specified as a blob or data URI, or via an external URL using TextureLoader\n\tloadTexture( textureNode, images ) {\n\n\t\tconst nonNativeExtensions = new Set( [ 'tga', 'tif', 'tiff', 'exr', 'dds', 'hdr', 'ktx2' ] );\n\n\t\tconst extension = textureNode.FileName.split( '.' ).pop().toLowerCase();\n\n\t\tconst loader = nonNativeExtensions.has( extension ) ? this.manager.getHandler( `.${extension}` ) : this.textureLoader;\n\n\t\tif ( ! loader ) {\n\n\t\t\tconsole.warn(\n\t\t\t\t`FBXLoader: ${extension.toUpperCase()} loader not found, creating placeholder texture for`,\n\t\t\t\ttextureNode.RelativeFilename\n\t\t\t);\n\t\t\treturn new Texture();\n\n\t\t}\n\n\t\tconst loaderPath = loader.path;\n\n\t\tif ( ! loaderPath ) {\n\n\t\t\tloader.setPath( this.textureLoader.path );\n\n\t\t}\n\n\t\tconst children = connections.get( textureNode.id ).children;\n\n\t\tlet fileName;\n\n\t\tif ( children !== undefined && children.length > 0 && images[ children[ 0 ].ID ] !== undefined ) {\n\n\t\t\tfileName = images[ children[ 0 ].ID ];\n\n\t\t\tif ( fileName.indexOf( 'blob:' ) === 0 || fileName.indexOf( 'data:' ) === 0 ) {\n\n\t\t\t\tloader.setPath( undefined );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst texture = loader.load( fileName );\n\n\t\t// revert to initial path\n\t\tloader.setPath( loaderPath );\n\n\t\treturn texture;\n\n\t}\n\n\t// Parse nodes in FBXTree.Objects.Material\n\tparseMaterials( textureMap ) {\n\n\t\tconst materialMap = new Map();\n\n\t\tif ( 'Material' in fbxTree.Objects ) {\n\n\t\t\tconst materialNodes = fbxTree.Objects.Material;\n\n\t\t\tfor ( const nodeID in materialNodes ) {\n\n\t\t\t\tconst material = this.parseMaterial( materialNodes[ nodeID ], textureMap );\n\n\t\t\t\tif ( material !== null ) materialMap.set( parseInt( nodeID ), material );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn materialMap;\n\n\t}\n\n\t// Parse single node in FBXTree.Objects.Material\n\t// Materials are connected to texture maps in FBXTree.Objects.Textures\n\t// FBX format currently only supports Lambert and Phong shading models\n\tparseMaterial( materialNode, textureMap ) {\n\n\t\tconst ID = materialNode.id;\n\t\tconst name = materialNode.attrName;\n\t\tlet type = materialNode.ShadingModel;\n\n\t\t// Case where FBX wraps shading model in property object.\n\t\tif ( typeof type === 'object' ) {\n\n\t\t\ttype = type.value;\n\n\t\t}\n\n\t\t// Ignore unused materials which don't have any connections.\n\t\tif ( ! connections.has( ID ) ) return null;\n\n\t\tconst parameters = this.parseParameters( materialNode, textureMap, ID );\n\n\t\tlet material;\n\n\t\tswitch ( type.toLowerCase() ) {\n\n\t\t\tcase 'phong':\n\t\t\t\tmaterial = new MeshPhongMaterial();\n\t\t\t\tbreak;\n\t\t\tcase 'lambert':\n\t\t\t\tmaterial = new MeshLambertMaterial();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.warn( 'THREE.FBXLoader: unknown material type \"%s\". Defaulting to MeshPhongMaterial.', type );\n\t\t\t\tmaterial = new MeshPhongMaterial();\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tmaterial.setValues( parameters );\n\t\tmaterial.name = name;\n\n\t\treturn material;\n\n\t}\n\n\t// Parse FBX material and return parameters suitable for a three.js material\n\t// Also parse the texture map and return any textures associated with the material\n\tparseParameters( materialNode, textureMap, ID ) {\n\n\t\tconst parameters = {};\n\n\t\tif ( materialNode.BumpFactor ) {\n\n\t\t\tparameters.bumpScale = materialNode.BumpFactor.value;\n\n\t\t}\n\n\t\tif ( materialNode.Diffuse ) {\n\n\t\t\tparameters.color = ColorManagement.toWorkingColorSpace( new Color().fromArray( materialNode.Diffuse.value ), SRGBColorSpace );\n\n\t\t} else if ( materialNode.DiffuseColor && ( materialNode.DiffuseColor.type === 'Color' || materialNode.DiffuseColor.type === 'ColorRGB' ) ) {\n\n\t\t\t// The blender exporter exports diffuse here instead of in materialNode.Diffuse\n\t\t\tparameters.color = ColorManagement.toWorkingColorSpace( new Color().fromArray( materialNode.DiffuseColor.value ), SRGBColorSpace );\n\n\t\t}\n\n\t\tif ( materialNode.DisplacementFactor ) {\n\n\t\t\tparameters.displacementScale = materialNode.DisplacementFactor.value;\n\n\t\t}\n\n\t\tif ( materialNode.Emissive ) {\n\n\t\t\tparameters.emissive = ColorManagement.toWorkingColorSpace( new Color().fromArray( materialNode.Emissive.value ), SRGBColorSpace );\n\n\t\t} else if ( materialNode.EmissiveColor && ( materialNode.EmissiveColor.type === 'Color' || materialNode.EmissiveColor.type === 'ColorRGB' ) ) {\n\n\t\t\t// The blender exporter exports emissive color here instead of in materialNode.Emissive\n\t\t\tparameters.emissive = ColorManagement.toWorkingColorSpace( new Color().fromArray( materialNode.EmissiveColor.value ), SRGBColorSpace );\n\n\t\t}\n\n\t\tif ( materialNode.EmissiveFactor ) {\n\n\t\t\tparameters.emissiveIntensity = parseFloat( materialNode.EmissiveFactor.value );\n\n\t\t}\n\n\t\t// the transparency handling is implemented based on Blender/Unity's approach: https://github.com/sobotka/blender-addons/blob/7d80f2f97161fc8e353a657b179b9aa1f8e5280b/io_scene_fbx/import_fbx.py#L1444-L1459\n\n\t\tparameters.opacity = 1 - ( materialNode.TransparencyFactor ? parseFloat( materialNode.TransparencyFactor.value ) : 0 );\n\n\t\tif ( parameters.opacity === 1 || parameters.opacity === 0 ) {\n\n\t\t\tparameters.opacity = ( materialNode.Opacity ? parseFloat( materialNode.Opacity.value ) : null );\n\n\t\t\tif ( parameters.opacity === null ) {\n\n\t\t\t\tparameters.opacity = 1 - ( materialNode.TransparentColor ? parseFloat( materialNode.TransparentColor.value[ 0 ] ) : 0 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( parameters.opacity < 1.0 ) {\n\n\t\t\tparameters.transparent = true;\n\n\t\t}\n\n\t\tif ( materialNode.ReflectionFactor ) {\n\n\t\t\tparameters.reflectivity = materialNode.ReflectionFactor.value;\n\n\t\t}\n\n\t\tif ( materialNode.Shininess ) {\n\n\t\t\tparameters.shininess = materialNode.Shininess.value;\n\n\t\t}\n\n\t\tif ( materialNode.Specular ) {\n\n\t\t\tparameters.specular = ColorManagement.toWorkingColorSpace( new Color().fromArray( materialNode.Specular.value ), SRGBColorSpace );\n\n\t\t} else if ( materialNode.SpecularColor && materialNode.SpecularColor.type === 'Color' ) {\n\n\t\t\t// The blender exporter exports specular color here instead of in materialNode.Specular\n\t\t\tparameters.specular = ColorManagement.toWorkingColorSpace( new Color().fromArray( materialNode.SpecularColor.value ), SRGBColorSpace );\n\n\t\t}\n\n\t\tconst scope = this;\n\t\tconnections.get( ID ).children.forEach( function ( child ) {\n\n\t\t\tconst type = child.relationship;\n\n\t\t\tswitch ( type ) {\n\n\t\t\t\tcase 'Bump':\n\t\t\t\t\tparameters.bumpMap = scope.getTexture( textureMap, child.ID );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Maya|TEX_ao_map':\n\t\t\t\t\tparameters.aoMap = scope.getTexture( textureMap, child.ID );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'DiffuseColor':\n\t\t\t\tcase 'Maya|TEX_color_map':\n\t\t\t\t\tparameters.map = scope.getTexture( textureMap, child.ID );\n\t\t\t\t\tif ( parameters.map !== undefined ) {\n\n\t\t\t\t\t\tparameters.map.colorSpace = SRGBColorSpace;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'DisplacementColor':\n\t\t\t\t\tparameters.displacementMap = scope.getTexture( textureMap, child.ID );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'EmissiveColor':\n\t\t\t\t\tparameters.emissiveMap = scope.getTexture( textureMap, child.ID );\n\t\t\t\t\tif ( parameters.emissiveMap !== undefined ) {\n\n\t\t\t\t\t\tparameters.emissiveMap.colorSpace = SRGBColorSpace;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'NormalMap':\n\t\t\t\tcase 'Maya|TEX_normal_map':\n\t\t\t\t\tparameters.normalMap = scope.getTexture( textureMap, child.ID );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ReflectionColor':\n\t\t\t\t\tparameters.envMap = scope.getTexture( textureMap, child.ID );\n\t\t\t\t\tif ( parameters.envMap !== undefined ) {\n\n\t\t\t\t\t\tparameters.envMap.mapping = EquirectangularReflectionMapping;\n\t\t\t\t\t\tparameters.envMap.colorSpace = SRGBColorSpace;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SpecularColor':\n\t\t\t\t\tparameters.specularMap = scope.getTexture( textureMap, child.ID );\n\t\t\t\t\tif ( parameters.specularMap !== undefined ) {\n\n\t\t\t\t\t\tparameters.specularMap.colorSpace = SRGBColorSpace;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'TransparentColor':\n\t\t\t\tcase 'TransparencyFactor':\n\t\t\t\t\tparameters.alphaMap = scope.getTexture( textureMap, child.ID );\n\t\t\t\t\tparameters.transparent = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'AmbientColor':\n\t\t\t\tcase 'ShininessExponent': // AKA glossiness map\n\t\t\t\tcase 'SpecularFactor': // AKA specularLevel\n\t\t\t\tcase 'VectorDisplacementColor': // NOTE: Seems to be a copy of DisplacementColor\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.warn( 'THREE.FBXLoader: %s map is not supported in three.js, skipping texture.', type );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t} );\n\n\t\treturn parameters;\n\n\t}\n\n\t// get a texture from the textureMap for use by a material.\n\tgetTexture( textureMap, id ) {\n\n\t\t// if the texture is a layered texture, just use the first layer and issue a warning\n\t\tif ( 'LayeredTexture' in fbxTree.Objects && id in fbxTree.Objects.LayeredTexture ) {\n\n\t\t\tconsole.warn( 'THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer.' );\n\t\t\tid = connections.get( id ).children[ 0 ].ID;\n\n\t\t}\n\n\t\treturn textureMap.get( id );\n\n\t}\n\n\t// Parse nodes in FBXTree.Objects.Deformer\n\t// Deformer node can contain skinning or Vertex Cache animation data, however only skinning is supported here\n\t// Generates map of Skeleton-like objects for use later when generating and binding skeletons.\n\tparseDeformers() {\n\n\t\tconst skeletons = {};\n\t\tconst morphTargets = {};\n\n\t\tif ( 'Deformer' in fbxTree.Objects ) {\n\n\t\t\tconst DeformerNodes = fbxTree.Objects.Deformer;\n\n\t\t\tfor ( const nodeID in DeformerNodes ) {\n\n\t\t\t\tconst deformerNode = DeformerNodes[ nodeID ];\n\n\t\t\t\tconst relationships = connections.get( parseInt( nodeID ) );\n\n\t\t\t\tif ( deformerNode.attrType === 'Skin' ) {\n\n\t\t\t\t\tconst skeleton = this.parseSkeleton( relationships, DeformerNodes );\n\t\t\t\t\tskeleton.ID = nodeID;\n\n\t\t\t\t\tif ( relationships.parents.length > 1 ) console.warn( 'THREE.FBXLoader: skeleton attached to more than one geometry is not supported.' );\n\t\t\t\t\tskeleton.geometryID = relationships.parents[ 0 ].ID;\n\n\t\t\t\t\tskeletons[ nodeID ] = skeleton;\n\n\t\t\t\t} else if ( deformerNode.attrType === 'BlendShape' ) {\n\n\t\t\t\t\tconst morphTarget = {\n\t\t\t\t\t\tid: nodeID,\n\t\t\t\t\t};\n\n\t\t\t\t\tmorphTarget.rawTargets = this.parseMorphTargets( relationships, DeformerNodes );\n\t\t\t\t\tmorphTarget.id = nodeID;\n\n\t\t\t\t\tif ( relationships.parents.length > 1 ) console.warn( 'THREE.FBXLoader: morph target attached to more than one geometry is not supported.' );\n\n\t\t\t\t\tmorphTargets[ nodeID ] = morphTarget;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\n\t\t\tskeletons: skeletons,\n\t\t\tmorphTargets: morphTargets,\n\n\t\t};\n\n\t}\n\n\t// Parse single nodes in FBXTree.Objects.Deformer\n\t// The top level skeleton node has type 'Skin' and sub nodes have type 'Cluster'\n\t// Each skin node represents a skeleton and each cluster node represents a bone\n\tparseSkeleton( relationships, deformerNodes ) {\n\n\t\tconst rawBones = [];\n\n\t\trelationships.children.forEach( function ( child ) {\n\n\t\t\tconst boneNode = deformerNodes[ child.ID ];\n\n\t\t\tif ( boneNode.attrType !== 'Cluster' ) return;\n\n\t\t\tconst rawBone = {\n\n\t\t\t\tID: child.ID,\n\t\t\t\tindices: [],\n\t\t\t\tweights: [],\n\t\t\t\ttransformLink: new Matrix4().fromArray( boneNode.TransformLink.a ),\n\t\t\t\t// transform: new Matrix4().fromArray( boneNode.Transform.a ),\n\t\t\t\t// linkMode: boneNode.Mode,\n\n\t\t\t};\n\n\t\t\tif ( 'Indexes' in boneNode ) {\n\n\t\t\t\trawBone.indices = boneNode.Indexes.a;\n\t\t\t\trawBone.weights = boneNode.Weights.a;\n\n\t\t\t}\n\n\t\t\trawBones.push( rawBone );\n\n\t\t} );\n\n\t\treturn {\n\n\t\t\trawBones: rawBones,\n\t\t\tbones: []\n\n\t\t};\n\n\t}\n\n\t// The top level morph deformer node has type \"BlendShape\" and sub nodes have type \"BlendShapeChannel\"\n\tparseMorphTargets( relationships, deformerNodes ) {\n\n\t\tconst rawMorphTargets = [];\n\n\t\tfor ( let i = 0; i < relationships.children.length; i ++ ) {\n\n\t\t\tconst child = relationships.children[ i ];\n\n\t\t\tconst morphTargetNode = deformerNodes[ child.ID ];\n\n\t\t\tconst rawMorphTarget = {\n\n\t\t\t\tname: morphTargetNode.attrName,\n\t\t\t\tinitialWeight: morphTargetNode.DeformPercent,\n\t\t\t\tid: morphTargetNode.id,\n\t\t\t\tfullWeights: morphTargetNode.FullWeights.a\n\n\t\t\t};\n\n\t\t\tif ( morphTargetNode.attrType !== 'BlendShapeChannel' ) return;\n\n\t\t\trawMorphTarget.geoID = connections.get( parseInt( child.ID ) ).children.filter( function ( child ) {\n\n\t\t\t\treturn child.relationship === undefined;\n\n\t\t\t} )[ 0 ].ID;\n\n\t\t\trawMorphTargets.push( rawMorphTarget );\n\n\t\t}\n\n\t\treturn rawMorphTargets;\n\n\t}\n\n\t// create the main Group() to be returned by the loader\n\tparseScene( deformers, geometryMap, materialMap ) {\n\n\t\tsceneGraph = new Group();\n\n\t\tconst modelMap = this.parseModels( deformers.skeletons, geometryMap, materialMap );\n\n\t\tconst modelNodes = fbxTree.Objects.Model;\n\n\t\tconst scope = this;\n\t\tmodelMap.forEach( function ( model ) {\n\n\t\t\tconst modelNode = modelNodes[ model.ID ];\n\t\t\tscope.setLookAtProperties( model, modelNode );\n\n\t\t\tconst parentConnections = connections.get( model.ID ).parents;\n\n\t\t\tparentConnections.forEach( function ( connection ) {\n\n\t\t\t\tconst parent = modelMap.get( connection.ID );\n\t\t\t\tif ( parent !== undefined ) parent.add( model );\n\n\t\t\t} );\n\n\t\t\tif ( model.parent === null ) {\n\n\t\t\t\tsceneGraph.add( model );\n\n\t\t\t}\n\n\n\t\t} );\n\n\t\tthis.bindSkeleton( deformers.skeletons, geometryMap, modelMap );\n\n\t\tthis.addGlobalSceneSettings();\n\n\t\tsceneGraph.traverse( function ( node ) {\n\n\t\t\tif ( node.userData.transformData ) {\n\n\t\t\t\tif ( node.parent ) {\n\n\t\t\t\t\tnode.userData.transformData.parentMatrix = node.parent.matrix;\n\t\t\t\t\tnode.userData.transformData.parentMatrixWorld = node.parent.matrixWorld;\n\n\t\t\t\t}\n\n\t\t\t\tconst transform = generateTransform( node.userData.transformData );\n\n\t\t\t\tnode.applyMatrix4( transform );\n\t\t\t\tnode.updateWorldMatrix();\n\n\t\t\t}\n\n\t\t} );\n\n\t\tconst animations = new AnimationParser().parse();\n\n\t\t// if all the models where already combined in a single group, just return that\n\t\tif ( sceneGraph.children.length === 1 && sceneGraph.children[ 0 ].isGroup ) {\n\n\t\t\tsceneGraph.children[ 0 ].animations = animations;\n\t\t\tsceneGraph = sceneGraph.children[ 0 ];\n\n\t\t}\n\n\t\tsceneGraph.animations = animations;\n\n\t}\n\n\t// parse nodes in FBXTree.Objects.Model\n\tparseModels( skeletons, geometryMap, materialMap ) {\n\n\t\tconst modelMap = new Map();\n\t\tconst modelNodes = fbxTree.Objects.Model;\n\n\t\tfor ( const nodeID in modelNodes ) {\n\n\t\t\tconst id = parseInt( nodeID );\n\t\t\tconst node = modelNodes[ nodeID ];\n\t\t\tconst relationships = connections.get( id );\n\n\t\t\tlet model = this.buildSkeleton( relationships, skeletons, id, node.attrName );\n\n\t\t\tif ( ! model ) {\n\n\t\t\t\tswitch ( node.attrType ) {\n\n\t\t\t\t\tcase 'Camera':\n\t\t\t\t\t\tmodel = this.createCamera( relationships );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Light':\n\t\t\t\t\t\tmodel = this.createLight( relationships );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Mesh':\n\t\t\t\t\t\tmodel = this.createMesh( relationships, geometryMap, materialMap );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'NurbsCurve':\n\t\t\t\t\t\tmodel = this.createCurve( relationships, geometryMap );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'LimbNode':\n\t\t\t\t\tcase 'Root':\n\t\t\t\t\t\tmodel = new Bone();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Null':\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tmodel = new Group();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tmodel.name = node.attrName ? PropertyBinding.sanitizeNodeName( node.attrName ) : '';\n\t\t\t\tmodel.userData.originalName = node.attrName;\n\n\t\t\t\tmodel.ID = id;\n\n\t\t\t}\n\n\t\t\tthis.getTransformData( model, node );\n\t\t\tmodelMap.set( id, model );\n\n\t\t}\n\n\t\treturn modelMap;\n\n\t}\n\n\tbuildSkeleton( relationships, skeletons, id, name ) {\n\n\t\tlet bone = null;\n\n\t\trelationships.parents.forEach( function ( parent ) {\n\n\t\t\tfor ( const ID in skeletons ) {\n\n\t\t\t\tconst skeleton = skeletons[ ID ];\n\n\t\t\t\tskeleton.rawBones.forEach( function ( rawBone, i ) {\n\n\t\t\t\t\tif ( rawBone.ID === parent.ID ) {\n\n\t\t\t\t\t\tconst subBone = bone;\n\t\t\t\t\t\tbone = new Bone();\n\n\t\t\t\t\t\tbone.matrixWorld.copy( rawBone.transformLink );\n\n\t\t\t\t\t\t// set name and id here - otherwise in cases where \"subBone\" is created it will not have a name / id\n\n\t\t\t\t\t\tbone.name = name ? PropertyBinding.sanitizeNodeName( name ) : '';\n\t\t\t\t\t\tbone.userData.originalName = name;\n\t\t\t\t\t\tbone.ID = id;\n\n\t\t\t\t\t\tskeleton.bones[ i ] = bone;\n\n\t\t\t\t\t\t// In cases where a bone is shared between multiple meshes\n\t\t\t\t\t\t// duplicate the bone here and and it as a child of the first bone\n\t\t\t\t\t\tif ( subBone !== null ) {\n\n\t\t\t\t\t\t\tbone.add( subBone );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t} );\n\n\t\treturn bone;\n\n\t}\n\n\t// create a PerspectiveCamera or OrthographicCamera\n\tcreateCamera( relationships ) {\n\n\t\tlet model;\n\t\tlet cameraAttribute;\n\n\t\trelationships.children.forEach( function ( child ) {\n\n\t\t\tconst attr = fbxTree.Objects.NodeAttribute[ child.ID ];\n\n\t\t\tif ( attr !== undefined ) {\n\n\t\t\t\tcameraAttribute = attr;\n\n\t\t\t}\n\n\t\t} );\n\n\t\tif ( cameraAttribute === undefined ) {\n\n\t\t\tmodel = new Object3D();\n\n\t\t} else {\n\n\t\t\tlet type = 0;\n\t\t\tif ( cameraAttribute.CameraProjectionType !== undefined && cameraAttribute.CameraProjectionType.value === 1 ) {\n\n\t\t\t\ttype = 1;\n\n\t\t\t}\n\n\t\t\tlet nearClippingPlane = 1;\n\t\t\tif ( cameraAttribute.NearPlane !== undefined ) {\n\n\t\t\t\tnearClippingPlane = cameraAttribute.NearPlane.value / 1000;\n\n\t\t\t}\n\n\t\t\tlet farClippingPlane = 1000;\n\t\t\tif ( cameraAttribute.FarPlane !== undefined ) {\n\n\t\t\t\tfarClippingPlane = cameraAttribute.FarPlane.value / 1000;\n\n\t\t\t}\n\n\n\t\t\tlet width = window.innerWidth;\n\t\t\tlet height = window.innerHeight;\n\n\t\t\tif ( cameraAttribute.AspectWidth !== undefined && cameraAttribute.AspectHeight !== undefined ) {\n\n\t\t\t\twidth = cameraAttribute.AspectWidth.value;\n\t\t\t\theight = cameraAttribute.AspectHeight.value;\n\n\t\t\t}\n\n\t\t\tconst aspect = width / height;\n\n\t\t\tlet fov = 45;\n\t\t\tif ( cameraAttribute.FieldOfView !== undefined ) {\n\n\t\t\t\tfov = cameraAttribute.FieldOfView.value;\n\n\t\t\t}\n\n\t\t\tconst focalLength = cameraAttribute.FocalLength ? cameraAttribute.FocalLength.value : null;\n\n\t\t\tswitch ( type ) {\n\n\t\t\t\tcase 0: // Perspective\n\t\t\t\t\tmodel = new PerspectiveCamera( fov, aspect, nearClippingPlane, farClippingPlane );\n\t\t\t\t\tif ( focalLength !== null ) model.setFocalLength( focalLength );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1: // Orthographic\n\t\t\t\t\tconsole.warn( 'THREE.FBXLoader: Orthographic cameras not supported yet.' );\n\t\t\t\t\tmodel = new Object3D();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.warn( 'THREE.FBXLoader: Unknown camera type ' + type + '.' );\n\t\t\t\t\tmodel = new Object3D();\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn model;\n\n\t}\n\n\t// Create a DirectionalLight, PointLight or SpotLight\n\tcreateLight( relationships ) {\n\n\t\tlet model;\n\t\tlet lightAttribute;\n\n\t\trelationships.children.forEach( function ( child ) {\n\n\t\t\tconst attr = fbxTree.Objects.NodeAttribute[ child.ID ];\n\n\t\t\tif ( attr !== undefined ) {\n\n\t\t\t\tlightAttribute = attr;\n\n\t\t\t}\n\n\t\t} );\n\n\t\tif ( lightAttribute === undefined ) {\n\n\t\t\tmodel = new Object3D();\n\n\t\t} else {\n\n\t\t\tlet type;\n\n\t\t\t// LightType can be undefined for Point lights\n\t\t\tif ( lightAttribute.LightType === undefined ) {\n\n\t\t\t\ttype = 0;\n\n\t\t\t} else {\n\n\t\t\t\ttype = lightAttribute.LightType.value;\n\n\t\t\t}\n\n\t\t\tlet color = 0xffffff;\n\n\t\t\tif ( lightAttribute.Color !== undefined ) {\n\n\t\t\t\tcolor = ColorManagement.toWorkingColorSpace( new Color().fromArray( lightAttribute.Color.value ), SRGBColorSpace );\n\n\t\t\t}\n\n\t\t\tlet intensity = ( lightAttribute.Intensity === undefined ) ? 1 : lightAttribute.Intensity.value / 100;\n\n\t\t\t// light disabled\n\t\t\tif ( lightAttribute.CastLightOnObject !== undefined && lightAttribute.CastLightOnObject.value === 0 ) {\n\n\t\t\t\tintensity = 0;\n\n\t\t\t}\n\n\t\t\tlet distance = 0;\n\t\t\tif ( lightAttribute.FarAttenuationEnd !== undefined ) {\n\n\t\t\t\tif ( lightAttribute.EnableFarAttenuation !== undefined && lightAttribute.EnableFarAttenuation.value === 0 ) {\n\n\t\t\t\t\tdistance = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdistance = lightAttribute.FarAttenuationEnd.value;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// TODO: could this be calculated linearly from FarAttenuationStart to FarAttenuationEnd?\n\t\t\tconst decay = 1;\n\n\t\t\tswitch ( type ) {\n\n\t\t\t\tcase 0: // Point\n\t\t\t\t\tmodel = new PointLight( color, intensity, distance, decay );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1: // Directional\n\t\t\t\t\tmodel = new DirectionalLight( color, intensity );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2: // Spot\n\t\t\t\t\tlet angle = Math.PI / 3;\n\n\t\t\t\t\tif ( lightAttribute.InnerAngle !== undefined ) {\n\n\t\t\t\t\t\tangle = MathUtils.degToRad( lightAttribute.InnerAngle.value );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlet penumbra = 0;\n\t\t\t\t\tif ( lightAttribute.OuterAngle !== undefined ) {\n\n\t\t\t\t\t\t// TODO: this is not correct - FBX calculates outer and inner angle in degrees\n\t\t\t\t\t\t// with OuterAngle > InnerAngle && OuterAngle <= Math.PI\n\t\t\t\t\t\t// while three.js uses a penumbra between (0, 1) to attenuate the inner angle\n\t\t\t\t\t\tpenumbra = MathUtils.degToRad( lightAttribute.OuterAngle.value );\n\t\t\t\t\t\tpenumbra = Math.max( penumbra, 1 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tmodel = new SpotLight( color, intensity, distance, angle, penumbra, decay );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.warn( 'THREE.FBXLoader: Unknown light type ' + lightAttribute.LightType.value + ', defaulting to a PointLight.' );\n\t\t\t\t\tmodel = new PointLight( color, intensity );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tif ( lightAttribute.CastShadows !== undefined && lightAttribute.CastShadows.value === 1 ) {\n\n\t\t\t\tmodel.castShadow = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn model;\n\n\t}\n\n\tcreateMesh( relationships, geometryMap, materialMap ) {\n\n\t\tlet model;\n\t\tlet geometry = null;\n\t\tlet material = null;\n\t\tconst materials = [];\n\n\t\t// get geometry and materials(s) from connections\n\t\trelationships.children.forEach( function ( child ) {\n\n\t\t\tif ( geometryMap.has( child.ID ) ) {\n\n\t\t\t\tgeometry = geometryMap.get( child.ID );\n\n\t\t\t}\n\n\t\t\tif ( materialMap.has( child.ID ) ) {\n\n\t\t\t\tmaterials.push( materialMap.get( child.ID ) );\n\n\t\t\t}\n\n\t\t} );\n\n\t\tif ( materials.length > 1 ) {\n\n\t\t\tmaterial = materials;\n\n\t\t} else if ( materials.length > 0 ) {\n\n\t\t\tmaterial = materials[ 0 ];\n\n\t\t} else {\n\n\t\t\tmaterial = new MeshPhongMaterial( {\n\t\t\t\tname: Loader.DEFAULT_MATERIAL_NAME,\n\t\t\t\tcolor: 0xcccccc\n\t\t\t} );\n\t\t\tmaterials.push( material );\n\n\t\t}\n\n\t\tif ( 'color' in geometry.attributes ) {\n\n\t\t\tmaterials.forEach( function ( material ) {\n\n\t\t\t\tmaterial.vertexColors = true;\n\n\t\t\t} );\n\n\t\t}\n\n\t\tif ( geometry.FBX_Deformer ) {\n\n\t\t\tmodel = new SkinnedMesh( geometry, material );\n\t\t\tmodel.normalizeSkinWeights();\n\n\t\t} else {\n\n\t\t\tmodel = new Mesh( geometry, material );\n\n\t\t}\n\n\t\treturn model;\n\n\t}\n\n\tcreateCurve( relationships, geometryMap ) {\n\n\t\tconst geometry = relationships.children.reduce( function ( geo, child ) {\n\n\t\t\tif ( geometryMap.has( child.ID ) ) geo = geometryMap.get( child.ID );\n\n\t\t\treturn geo;\n\n\t\t}, null );\n\n\t\t// FBX does not list materials for Nurbs lines, so we'll just put our own in here.\n\t\tconst material = new LineBasicMaterial( {\n\t\t\tname: Loader.DEFAULT_MATERIAL_NAME,\n\t\t\tcolor: 0x3300ff,\n\t\t\tlinewidth: 1\n\t\t} );\n\t\treturn new Line( geometry, material );\n\n\t}\n\n\t// parse the model node for transform data\n\tgetTransformData( model, modelNode ) {\n\n\t\tconst transformData = {};\n\n\t\tif ( 'InheritType' in modelNode ) transformData.inheritType = parseInt( modelNode.InheritType.value );\n\n\t\tif ( 'RotationOrder' in modelNode ) transformData.eulerOrder = getEulerOrder( modelNode.RotationOrder.value );\n\t\telse transformData.eulerOrder = getEulerOrder( 0 );\n\n\t\tif ( 'Lcl_Translation' in modelNode ) transformData.translation = modelNode.Lcl_Translation.value;\n\n\t\tif ( 'PreRotation' in modelNode ) transformData.preRotation = modelNode.PreRotation.value;\n\t\tif ( 'Lcl_Rotation' in modelNode ) transformData.rotation = modelNode.Lcl_Rotation.value;\n\t\tif ( 'PostRotation' in modelNode ) transformData.postRotation = modelNode.PostRotation.value;\n\n\t\tif ( 'Lcl_Scaling' in modelNode ) transformData.scale = modelNode.Lcl_Scaling.value;\n\n\t\tif ( 'ScalingOffset' in modelNode ) transformData.scalingOffset = modelNode.ScalingOffset.value;\n\t\tif ( 'ScalingPivot' in modelNode ) transformData.scalingPivot = modelNode.ScalingPivot.value;\n\n\t\tif ( 'RotationOffset' in modelNode ) transformData.rotationOffset = modelNode.RotationOffset.value;\n\t\tif ( 'RotationPivot' in modelNode ) transformData.rotationPivot = modelNode.RotationPivot.value;\n\n\t\tmodel.userData.transformData = transformData;\n\n\t}\n\n\tsetLookAtProperties( model, modelNode ) {\n\n\t\tif ( 'LookAtProperty' in modelNode ) {\n\n\t\t\tconst children = connections.get( model.ID ).children;\n\n\t\t\tchildren.forEach( function ( child ) {\n\n\t\t\t\tif ( child.relationship === 'LookAtProperty' ) {\n\n\t\t\t\t\tconst lookAtTarget = fbxTree.Objects.Model[ child.ID ];\n\n\t\t\t\t\tif ( 'Lcl_Translation' in lookAtTarget ) {\n\n\t\t\t\t\t\tconst pos = lookAtTarget.Lcl_Translation.value;\n\n\t\t\t\t\t\t// DirectionalLight, SpotLight\n\t\t\t\t\t\tif ( model.target !== undefined ) {\n\n\t\t\t\t\t\t\tmodel.target.position.fromArray( pos );\n\t\t\t\t\t\t\tsceneGraph.add( model.target );\n\n\t\t\t\t\t\t} else { // Cameras and other Object3Ds\n\n\t\t\t\t\t\t\tmodel.lookAt( new Vector3().fromArray( pos ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t}\n\n\t}\n\n\tbindSkeleton( skeletons, geometryMap, modelMap ) {\n\n\t\tconst bindMatrices = this.parsePoseNodes();\n\n\t\tfor ( const ID in skeletons ) {\n\n\t\t\tconst skeleton = skeletons[ ID ];\n\n\t\t\tconst parents = connections.get( parseInt( skeleton.ID ) ).parents;\n\n\t\t\tparents.forEach( function ( parent ) {\n\n\t\t\t\tif ( geometryMap.has( parent.ID ) ) {\n\n\t\t\t\t\tconst geoID = parent.ID;\n\t\t\t\t\tconst geoRelationships = connections.get( geoID );\n\n\t\t\t\t\tgeoRelationships.parents.forEach( function ( geoConnParent ) {\n\n\t\t\t\t\t\tif ( modelMap.has( geoConnParent.ID ) ) {\n\n\t\t\t\t\t\t\tconst model = modelMap.get( geoConnParent.ID );\n\n\t\t\t\t\t\t\tmodel.bind( new Skeleton( skeleton.bones ), bindMatrices[ geoConnParent.ID ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t}\n\n\t}\n\n\tparsePoseNodes() {\n\n\t\tconst bindMatrices = {};\n\n\t\tif ( 'Pose' in fbxTree.Objects ) {\n\n\t\t\tconst BindPoseNode = fbxTree.Objects.Pose;\n\n\t\t\tfor ( const nodeID in BindPoseNode ) {\n\n\t\t\t\tif ( BindPoseNode[ nodeID ].attrType === 'BindPose' && BindPoseNode[ nodeID ].NbPoseNodes > 0 ) {\n\n\t\t\t\t\tconst poseNodes = BindPoseNode[ nodeID ].PoseNode;\n\n\t\t\t\t\tif ( Array.isArray( poseNodes ) ) {\n\n\t\t\t\t\t\tposeNodes.forEach( function ( poseNode ) {\n\n\t\t\t\t\t\t\tbindMatrices[ poseNode.Node ] = new Matrix4().fromArray( poseNode.Matrix.a );\n\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tbindMatrices[ poseNodes.Node ] = new Matrix4().fromArray( poseNodes.Matrix.a );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn bindMatrices;\n\n\t}\n\n\taddGlobalSceneSettings() {\n\n\t\tif ( 'GlobalSettings' in fbxTree ) {\n\n\t\t\tif ( 'AmbientColor' in fbxTree.GlobalSettings ) {\n\n\t\t\t\t// Parse ambient color - if it's not set to black (default), create an ambient light\n\n\t\t\t\tconst ambientColor = fbxTree.GlobalSettings.AmbientColor.value;\n\t\t\t\tconst r = ambientColor[ 0 ];\n\t\t\t\tconst g = ambientColor[ 1 ];\n\t\t\t\tconst b = ambientColor[ 2 ];\n\n\t\t\t\tif ( r !== 0 || g !== 0 || b !== 0 ) {\n\n\t\t\t\t\tconst color = new Color().setRGB( r, g, b, SRGBColorSpace );\n\t\t\t\t\tsceneGraph.add( new AmbientLight( color, 1 ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( 'UnitScaleFactor' in fbxTree.GlobalSettings ) {\n\n\t\t\t\tsceneGraph.userData.unitScaleFactor = fbxTree.GlobalSettings.UnitScaleFactor.value;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\n// parse Geometry data from FBXTree and return map of BufferGeometries\nclass GeometryParser {\n\n\tconstructor() {\n\n\t\tthis.negativeMaterialIndices = false;\n\n\t}\n\n\t// Parse nodes in FBXTree.Objects.Geometry\n\tparse( deformers ) {\n\n\t\tconst geometryMap = new Map();\n\n\t\tif ( 'Geometry' in fbxTree.Objects ) {\n\n\t\t\tconst geoNodes = fbxTree.Objects.Geometry;\n\n\t\t\tfor ( const nodeID in geoNodes ) {\n\n\t\t\t\tconst relationships = connections.get( parseInt( nodeID ) );\n\t\t\t\tconst geo = this.parseGeometry( relationships, geoNodes[ nodeID ], deformers );\n\n\t\t\t\tgeometryMap.set( parseInt( nodeID ), geo );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// report warnings\n\n\t\tif ( this.negativeMaterialIndices === true ) {\n\n\t\t\tconsole.warn( 'THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected.' );\n\n\t\t}\n\n\t\treturn geometryMap;\n\n\t}\n\n\t// Parse single node in FBXTree.Objects.Geometry\n\tparseGeometry( relationships, geoNode, deformers ) {\n\n\t\tswitch ( geoNode.attrType ) {\n\n\t\t\tcase 'Mesh':\n\t\t\t\treturn this.parseMeshGeometry( relationships, geoNode, deformers );\n\t\t\t\tbreak;\n\n\t\t\tcase 'NurbsCurve':\n\t\t\t\treturn this.parseNurbsGeometry( geoNode );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\t// Parse single node mesh geometry in FBXTree.Objects.Geometry\n\tparseMeshGeometry( relationships, geoNode, deformers ) {\n\n\t\tconst skeletons = deformers.skeletons;\n\t\tconst morphTargets = [];\n\n\t\tconst modelNodes = relationships.parents.map( function ( parent ) {\n\n\t\t\treturn fbxTree.Objects.Model[ parent.ID ];\n\n\t\t} );\n\n\t\t// don't create geometry if it is not associated with any models\n\t\tif ( modelNodes.length === 0 ) return;\n\n\t\tconst skeleton = relationships.children.reduce( function ( skeleton, child ) {\n\n\t\t\tif ( skeletons[ child.ID ] !== undefined ) skeleton = skeletons[ child.ID ];\n\n\t\t\treturn skeleton;\n\n\t\t}, null );\n\n\t\trelationships.children.forEach( function ( child ) {\n\n\t\t\tif ( deformers.morphTargets[ child.ID ] !== undefined ) {\n\n\t\t\t\tmorphTargets.push( deformers.morphTargets[ child.ID ] );\n\n\t\t\t}\n\n\t\t} );\n\n\t\t// Assume one model and get the preRotation from that\n\t\t// if there is more than one model associated with the geometry this may cause problems\n\t\tconst modelNode = modelNodes[ 0 ];\n\n\t\tconst transformData = {};\n\n\t\tif ( 'RotationOrder' in modelNode ) transformData.eulerOrder = getEulerOrder( modelNode.RotationOrder.value );\n\t\tif ( 'InheritType' in modelNode ) transformData.inheritType = parseInt( modelNode.InheritType.value );\n\n\t\tif ( 'GeometricTranslation' in modelNode ) transformData.translation = modelNode.GeometricTranslation.value;\n\t\tif ( 'GeometricRotation' in modelNode ) transformData.rotation = modelNode.GeometricRotation.value;\n\t\tif ( 'GeometricScaling' in modelNode ) transformData.scale = modelNode.GeometricScaling.value;\n\n\t\tconst transform = generateTransform( transformData );\n\n\t\treturn this.genGeometry( geoNode, skeleton, morphTargets, transform );\n\n\t}\n\n\t// Generate a BufferGeometry from a node in FBXTree.Objects.Geometry\n\tgenGeometry( geoNode, skeleton, morphTargets, preTransform ) {\n\n\t\tconst geo = new BufferGeometry();\n\t\tif ( geoNode.attrName ) geo.name = geoNode.attrName;\n\n\t\tconst geoInfo = this.parseGeoNode( geoNode, skeleton );\n\t\tconst buffers = this.genBuffers( geoInfo );\n\n\t\tconst positionAttribute = new Float32BufferAttribute( buffers.vertex, 3 );\n\n\t\tpositionAttribute.applyMatrix4( preTransform );\n\n\t\tgeo.setAttribute( 'position', positionAttribute );\n\n\t\tif ( buffers.colors.length > 0 ) {\n\n\t\t\tgeo.setAttribute( 'color', new Float32BufferAttribute( buffers.colors, 3 ) );\n\n\t\t}\n\n\t\tif ( skeleton ) {\n\n\t\t\tgeo.setAttribute( 'skinIndex', new Uint16BufferAttribute( buffers.weightsIndices, 4 ) );\n\n\t\t\tgeo.setAttribute( 'skinWeight', new Float32BufferAttribute( buffers.vertexWeights, 4 ) );\n\n\t\t\t// used later to bind the skeleton to the model\n\t\t\tgeo.FBX_Deformer = skeleton;\n\n\t\t}\n\n\t\tif ( buffers.normal.length > 0 ) {\n\n\t\t\tconst normalMatrix = new Matrix3().getNormalMatrix( preTransform );\n\n\t\t\tconst normalAttribute = new Float32BufferAttribute( buffers.normal, 3 );\n\t\t\tnormalAttribute.applyNormalMatrix( normalMatrix );\n\n\t\t\tgeo.setAttribute( 'normal', normalAttribute );\n\n\t\t}\n\n\t\tbuffers.uvs.forEach( function ( uvBuffer, i ) {\n\n\t\t\tconst name = i === 0 ? 'uv' : `uv${ i }`;\n\n\t\t\tgeo.setAttribute( name, new Float32BufferAttribute( buffers.uvs[ i ], 2 ) );\n\n\t\t} );\n\n\t\tif ( geoInfo.material && geoInfo.material.mappingType !== 'AllSame' ) {\n\n\t\t\t// Convert the material indices of each vertex into rendering groups on the geometry.\n\t\t\tlet prevMaterialIndex = buffers.materialIndex[ 0 ];\n\t\t\tlet startIndex = 0;\n\n\t\t\tbuffers.materialIndex.forEach( function ( currentIndex, i ) {\n\n\t\t\t\tif ( currentIndex !== prevMaterialIndex ) {\n\n\t\t\t\t\tgeo.addGroup( startIndex, i - startIndex, prevMaterialIndex );\n\n\t\t\t\t\tprevMaterialIndex = currentIndex;\n\t\t\t\t\tstartIndex = i;\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\t// the loop above doesn't add the last group, do that here.\n\t\t\tif ( geo.groups.length > 0 ) {\n\n\t\t\t\tconst lastGroup = geo.groups[ geo.groups.length - 1 ];\n\t\t\t\tconst lastIndex = lastGroup.start + lastGroup.count;\n\n\t\t\t\tif ( lastIndex !== buffers.materialIndex.length ) {\n\n\t\t\t\t\tgeo.addGroup( lastIndex, buffers.materialIndex.length - lastIndex, prevMaterialIndex );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// case where there are multiple materials but the whole geometry is only\n\t\t\t// using one of them\n\t\t\tif ( geo.groups.length === 0 ) {\n\n\t\t\t\tgeo.addGroup( 0, buffers.materialIndex.length, buffers.materialIndex[ 0 ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.addMorphTargets( geo, geoNode, morphTargets, preTransform );\n\n\t\treturn geo;\n\n\t}\n\n\tparseGeoNode( geoNode, skeleton ) {\n\n\t\tconst geoInfo = {};\n\n\t\tgeoInfo.vertexPositions = ( geoNode.Vertices !== undefined ) ? geoNode.Vertices.a : [];\n\t\tgeoInfo.vertexIndices = ( geoNode.PolygonVertexIndex !== undefined ) ? geoNode.PolygonVertexIndex.a : [];\n\n\t\tif ( geoNode.LayerElementColor ) {\n\n\t\t\tgeoInfo.color = this.parseVertexColors( geoNode.LayerElementColor[ 0 ] );\n\n\t\t}\n\n\t\tif ( geoNode.LayerElementMaterial ) {\n\n\t\t\tgeoInfo.material = this.parseMaterialIndices( geoNode.LayerElementMaterial[ 0 ] );\n\n\t\t}\n\n\t\tif ( geoNode.LayerElementNormal ) {\n\n\t\t\tgeoInfo.normal = this.parseNormals( geoNode.LayerElementNormal[ 0 ] );\n\n\t\t}\n\n\t\tif ( geoNode.LayerElementUV ) {\n\n\t\t\tgeoInfo.uv = [];\n\n\t\t\tlet i = 0;\n\t\t\twhile ( geoNode.LayerElementUV[ i ] ) {\n\n\t\t\t\tif ( geoNode.LayerElementUV[ i ].UV ) {\n\n\t\t\t\t\tgeoInfo.uv.push( this.parseUVs( geoNode.LayerElementUV[ i ] ) );\n\n\t\t\t\t}\n\n\t\t\t\ti ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeoInfo.weightTable = {};\n\n\t\tif ( skeleton !== null ) {\n\n\t\t\tgeoInfo.skeleton = skeleton;\n\n\t\t\tskeleton.rawBones.forEach( function ( rawBone, i ) {\n\n\t\t\t\t// loop over the bone's vertex indices and weights\n\t\t\t\trawBone.indices.forEach( function ( index, j ) {\n\n\t\t\t\t\tif ( geoInfo.weightTable[ index ] === undefined ) geoInfo.weightTable[ index ] = [];\n\n\t\t\t\t\tgeoInfo.weightTable[ index ].push( {\n\n\t\t\t\t\t\tid: i,\n\t\t\t\t\t\tweight: rawBone.weights[ j ],\n\n\t\t\t\t\t} );\n\n\t\t\t\t} );\n\n\t\t\t} );\n\n\t\t}\n\n\t\treturn geoInfo;\n\n\t}\n\n\tgenBuffers( geoInfo ) {\n\n\t\tconst buffers = {\n\t\t\tvertex: [],\n\t\t\tnormal: [],\n\t\t\tcolors: [],\n\t\t\tuvs: [],\n\t\t\tmaterialIndex: [],\n\t\t\tvertexWeights: [],\n\t\t\tweightsIndices: [],\n\t\t};\n\n\t\tlet polygonIndex = 0;\n\t\tlet faceLength = 0;\n\t\tlet displayedWeightsWarning = false;\n\n\t\t// these will hold data for a single face\n\t\tlet facePositionIndexes = [];\n\t\tlet faceNormals = [];\n\t\tlet faceColors = [];\n\t\tlet faceUVs = [];\n\t\tlet faceWeights = [];\n\t\tlet faceWeightIndices = [];\n\n\t\tconst scope = this;\n\t\tgeoInfo.vertexIndices.forEach( function ( vertexIndex, polygonVertexIndex ) {\n\n\t\t\tlet materialIndex;\n\t\t\tlet endOfFace = false;\n\n\t\t\t// Face index and vertex index arrays are combined in a single array\n\t\t\t// A cube with quad faces looks like this:\n\t\t\t// PolygonVertexIndex: *24 {\n\t\t\t// a: 0, 1, 3, -3, 2, 3, 5, -5, 4, 5, 7, -7, 6, 7, 1, -1, 1, 7, 5, -4, 6, 0, 2, -5\n\t\t\t// }\n\t\t\t// Negative numbers mark the end of a face - first face here is 0, 1, 3, -3\n\t\t\t// to find index of last vertex bit shift the index: ^ - 1\n\t\t\tif ( vertexIndex < 0 ) {\n\n\t\t\t\tvertexIndex = vertexIndex ^ - 1; // equivalent to ( x * -1 ) - 1\n\t\t\t\tendOfFace = true;\n\n\t\t\t}\n\n\t\t\tlet weightIndices = [];\n\t\t\tlet weights = [];\n\n\t\t\tfacePositionIndexes.push( vertexIndex * 3, vertexIndex * 3 + 1, vertexIndex * 3 + 2 );\n\n\t\t\tif ( geoInfo.color ) {\n\n\t\t\t\tconst data = getData( polygonVertexIndex, polygonIndex, vertexIndex, geoInfo.color );\n\n\t\t\t\tfaceColors.push( data[ 0 ], data[ 1 ], data[ 2 ] );\n\n\t\t\t}\n\n\t\t\tif ( geoInfo.skeleton ) {\n\n\t\t\t\tif ( geoInfo.weightTable[ vertexIndex ] !== undefined ) {\n\n\t\t\t\t\tgeoInfo.weightTable[ vertexIndex ].forEach( function ( wt ) {\n\n\t\t\t\t\t\tweights.push( wt.weight );\n\t\t\t\t\t\tweightIndices.push( wt.id );\n\n\t\t\t\t\t} );\n\n\n\t\t\t\t}\n\n\t\t\t\tif ( weights.length > 4 ) {\n\n\t\t\t\t\tif ( ! displayedWeightsWarning ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights.' );\n\t\t\t\t\t\tdisplayedWeightsWarning = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst wIndex = [ 0, 0, 0, 0 ];\n\t\t\t\t\tconst Weight = [ 0, 0, 0, 0 ];\n\n\t\t\t\t\tweights.forEach( function ( weight, weightIndex ) {\n\n\t\t\t\t\t\tlet currentWeight = weight;\n\t\t\t\t\t\tlet currentIndex = weightIndices[ weightIndex ];\n\n\t\t\t\t\t\tWeight.forEach( function ( comparedWeight, comparedWeightIndex, comparedWeightArray ) {\n\n\t\t\t\t\t\t\tif ( currentWeight > comparedWeight ) {\n\n\t\t\t\t\t\t\t\tcomparedWeightArray[ comparedWeightIndex ] = currentWeight;\n\t\t\t\t\t\t\t\tcurrentWeight = comparedWeight;\n\n\t\t\t\t\t\t\t\tconst tmp = wIndex[ comparedWeightIndex ];\n\t\t\t\t\t\t\t\twIndex[ comparedWeightIndex ] = currentIndex;\n\t\t\t\t\t\t\t\tcurrentIndex = tmp;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t} );\n\n\t\t\t\t\tweightIndices = wIndex;\n\t\t\t\t\tweights = Weight;\n\n\t\t\t\t}\n\n\t\t\t\t// if the weight array is shorter than 4 pad with 0s\n\t\t\t\twhile ( weights.length < 4 ) {\n\n\t\t\t\t\tweights.push( 0 );\n\t\t\t\t\tweightIndices.push( 0 );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < 4; ++ i ) {\n\n\t\t\t\t\tfaceWeights.push( weights[ i ] );\n\t\t\t\t\tfaceWeightIndices.push( weightIndices[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( geoInfo.normal ) {\n\n\t\t\t\tconst data = getData( polygonVertexIndex, polygonIndex, vertexIndex, geoInfo.normal );\n\n\t\t\t\tfaceNormals.push( data[ 0 ], data[ 1 ], data[ 2 ] );\n\n\t\t\t}\n\n\t\t\tif ( geoInfo.material && geoInfo.material.mappingType !== 'AllSame' ) {\n\n\t\t\t\tmaterialIndex = getData( polygonVertexIndex, polygonIndex, vertexIndex, geoInfo.material )[ 0 ];\n\n\t\t\t\tif ( materialIndex < 0 ) {\n\n\t\t\t\t\tscope.negativeMaterialIndices = true;\n\t\t\t\t\tmaterialIndex = 0; // fallback\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( geoInfo.uv ) {\n\n\t\t\t\tgeoInfo.uv.forEach( function ( uv, i ) {\n\n\t\t\t\t\tconst data = getData( polygonVertexIndex, polygonIndex, vertexIndex, uv );\n\n\t\t\t\t\tif ( faceUVs[ i ] === undefined ) {\n\n\t\t\t\t\t\tfaceUVs[ i ] = [];\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfaceUVs[ i ].push( data[ 0 ] );\n\t\t\t\t\tfaceUVs[ i ].push( data[ 1 ] );\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tfaceLength ++;\n\n\t\t\tif ( endOfFace ) {\n\n\t\t\t\tscope.genFace( buffers, geoInfo, facePositionIndexes, materialIndex, faceNormals, faceColors, faceUVs, faceWeights, faceWeightIndices, faceLength );\n\n\t\t\t\tpolygonIndex ++;\n\t\t\t\tfaceLength = 0;\n\n\t\t\t\t// reset arrays for the next face\n\t\t\t\tfacePositionIndexes = [];\n\t\t\t\tfaceNormals = [];\n\t\t\t\tfaceColors = [];\n\t\t\t\tfaceUVs = [];\n\t\t\t\tfaceWeights = [];\n\t\t\t\tfaceWeightIndices = [];\n\n\t\t\t}\n\n\t\t} );\n\n\t\treturn buffers;\n\n\t}\n\n\t// See https://www.khronos.org/opengl/wiki/Calculating_a_Surface_Normal\n\tgetNormalNewell( vertices ) {\n\n\t\tconst normal = new Vector3( 0.0, 0.0, 0.0 );\n\n\t\tfor ( let i = 0; i < vertices.length; i ++ ) {\n\n\t\t\tconst current = vertices[ i ];\n\t\t\tconst next = vertices[ ( i + 1 ) % vertices.length ];\n\n\t\t\tnormal.x += ( current.y - next.y ) * ( current.z + next.z );\n\t\t\tnormal.y += ( current.z - next.z ) * ( current.x + next.x );\n\t\t\tnormal.z += ( current.x - next.x ) * ( current.y + next.y );\n\n\t\t}\n\n\t\tnormal.normalize();\n\n\t\treturn normal;\n\n\t}\n\n\tgetNormalTangentAndBitangent( vertices ) {\n\n\t\tconst normalVector = this.getNormalNewell( vertices );\n\t\t// Avoid up being equal or almost equal to normalVector\n\t\tconst up = Math.abs( normalVector.z ) > 0.5 ? new Vector3( 0.0, 1.0, 0.0 ) : new Vector3( 0.0, 0.0, 1.0 );\n\t\tconst tangent = up.cross( normalVector ).normalize();\n\t\tconst bitangent = normalVector.clone().cross( tangent ).normalize();\n\n\t\treturn {\n\t\t\tnormal: normalVector,\n\t\t\ttangent: tangent,\n\t\t\tbitangent: bitangent\n\t\t};\n\n\t}\n\n\tflattenVertex( vertex, normalTangent, normalBitangent ) {\n\n\t\treturn new Vector2(\n\t\t\tvertex.dot( normalTangent ),\n\t\t\tvertex.dot( normalBitangent )\n\t\t);\n\n\t}\n\n\t// Generate data for a single face in a geometry. If the face is a quad then split it into 2 tris\n\tgenFace( buffers, geoInfo, facePositionIndexes, materialIndex, faceNormals, faceColors, faceUVs, faceWeights, faceWeightIndices, faceLength ) {\n\n\t\tlet triangles;\n\n\t\tif ( faceLength > 3 ) {\n\n\t\t\t// Triangulate n-gon using earcut\n\n\t\t\tconst vertices = [];\n\t\t\t// in morphing scenario vertexPositions represent morphPositions\n\t\t\t// while baseVertexPositions represent the original geometry's positions\n\t\t\tconst positions = geoInfo.baseVertexPositions || geoInfo.vertexPositions;\n\t\t\tfor ( let i = 0; i < facePositionIndexes.length; i += 3 ) {\n\n\t\t\t\tvertices.push(\n\t\t\t\t\tnew Vector3(\n\t\t\t\t\t\tpositions[ facePositionIndexes[ i ] ],\n\t\t\t\t\t\tpositions[ facePositionIndexes[ i + 1 ] ],\n\t\t\t\t\t\tpositions[ facePositionIndexes[ i + 2 ] ]\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\tconst { tangent, bitangent } = this.getNormalTangentAndBitangent( vertices );\n\t\t\tconst triangulationInput = [];\n\n\t\t\tfor ( const vertex of vertices ) {\n\n\t\t\t\ttriangulationInput.push( this.flattenVertex( vertex, tangent, bitangent ) );\n\n\t\t\t}\n\n\t\t\t// When vertices is an array of [0,0,0] elements (which is the case for vertices not participating in morph)\n\t\t\t// the triangulationInput will be an array of [0,0] elements\n\t\t\t// resulting in an array of 0 triangles being returned from ShapeUtils.triangulateShape\n\t\t\t// leading to not pushing into buffers.vertex the redundant vertices (the vertices that are not morphed).\n\t\t\t// That's why, in order to support morphing scenario, \"positions\" is looking first for baseVertexPositions,\n\t\t\t// so that we don't end up with an array of 0 triangles for the faces not participating in morph.\n\t\t\ttriangles = ShapeUtils.triangulateShape( triangulationInput, [] );\n\n\t\t} else {\n\n\t\t\t// Regular triangle, skip earcut triangulation step\n\t\t\ttriangles = [[ 0, 1, 2 ]];\n\n\t\t}\n\n\t\tfor ( const [ i0, i1, i2 ] of triangles ) {\n\n\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i0 * 3 ] ] );\n\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i0 * 3 + 1 ] ] );\n\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i0 * 3 + 2 ] ] );\n\n\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i1 * 3 ] ] );\n\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i1 * 3 + 1 ] ] );\n\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i1 * 3 + 2 ] ] );\n\n\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i2 * 3 ] ] );\n\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i2 * 3 + 1 ] ] );\n\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i2 * 3 + 2 ] ] );\n\n\t\t\tif ( geoInfo.skeleton ) {\n\n\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i0 * 4 ] );\n\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i0 * 4 + 1 ] );\n\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i0 * 4 + 2 ] );\n\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i0 * 4 + 3 ] );\n\n\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i1 * 4 ] );\n\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i1 * 4 + 1 ] );\n\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i1 * 4 + 2 ] );\n\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i1 * 4 + 3 ] );\n\n\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i2 * 4 ] );\n\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i2 * 4 + 1 ] );\n\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i2 * 4 + 2 ] );\n\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i2 * 4 + 3 ] );\n\n\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i0 * 4 ] );\n\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i0 * 4 + 1 ] );\n\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i0 * 4 + 2 ] );\n\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i0 * 4 + 3 ] );\n\n\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i1 * 4 ] );\n\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i1 * 4 + 1 ] );\n\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i1 * 4 + 2 ] );\n\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i1 * 4 + 3 ] );\n\n\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i2 * 4 ] );\n\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i2 * 4 + 1 ] );\n\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i2 * 4 + 2 ] );\n\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i2 * 4 + 3 ] );\n\n\t\t\t}\n\n\t\t\tif ( geoInfo.color ) {\n\n\t\t\t\tbuffers.colors.push( faceColors[ i0 * 3 ] );\n\t\t\t\tbuffers.colors.push( faceColors[ i0 * 3 + 1 ] );\n\t\t\t\tbuffers.colors.push( faceColors[ i0 * 3 + 2 ] );\n\n\t\t\t\tbuffers.colors.push( faceColors[ i1 * 3 ] );\n\t\t\t\tbuffers.colors.push( faceColors[ i1 * 3 + 1 ] );\n\t\t\t\tbuffers.colors.push( faceColors[ i1 * 3 + 2 ] );\n\n\t\t\t\tbuffers.colors.push( faceColors[ i2 * 3 ] );\n\t\t\t\tbuffers.colors.push( faceColors[ i2 * 3 + 1 ] );\n\t\t\t\tbuffers.colors.push( faceColors[ i2 * 3 + 2 ] );\n\n\t\t\t}\n\n\t\t\tif ( geoInfo.material && geoInfo.material.mappingType !== 'AllSame' ) {\n\n\t\t\t\tbuffers.materialIndex.push( materialIndex );\n\t\t\t\tbuffers.materialIndex.push( materialIndex );\n\t\t\t\tbuffers.materialIndex.push( materialIndex );\n\n\t\t\t}\n\n\t\t\tif ( geoInfo.normal ) {\n\n\t\t\t\tbuffers.normal.push( faceNormals[ i0 * 3 ] );\n\t\t\t\tbuffers.normal.push( faceNormals[ i0 * 3 + 1 ] );\n\t\t\t\tbuffers.normal.push( faceNormals[ i0 * 3 + 2 ] );\n\n\t\t\t\tbuffers.normal.push( faceNormals[ i1 * 3 ] );\n\t\t\t\tbuffers.normal.push( faceNormals[ i1 * 3 + 1 ] );\n\t\t\t\tbuffers.normal.push( faceNormals[ i1 * 3 + 2 ] );\n\n\t\t\t\tbuffers.normal.push( faceNormals[ i2 * 3 ] );\n\t\t\t\tbuffers.normal.push( faceNormals[ i2 * 3 + 1 ] );\n\t\t\t\tbuffers.normal.push( faceNormals[ i2 * 3 + 2 ] );\n\n\t\t\t}\n\n\t\t\tif ( geoInfo.uv ) {\n\n\t\t\t\tgeoInfo.uv.forEach( function ( uv, j ) {\n\n\t\t\t\t\tif ( buffers.uvs[ j ] === undefined ) buffers.uvs[ j ] = [];\n\n\t\t\t\t\tbuffers.uvs[ j ].push( faceUVs[ j ][ i0 * 2 ] );\n\t\t\t\t\tbuffers.uvs[ j ].push( faceUVs[ j ][ i0 * 2 + 1 ] );\n\n\t\t\t\t\tbuffers.uvs[ j ].push( faceUVs[ j ][ i1 * 2 ] );\n\t\t\t\t\tbuffers.uvs[ j ].push( faceUVs[ j ][ i1 * 2 + 1 ] );\n\n\t\t\t\t\tbuffers.uvs[ j ].push( faceUVs[ j ][ i2 * 2 ] );\n\t\t\t\t\tbuffers.uvs[ j ].push( faceUVs[ j ][ i2 * 2 + 1 ] );\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\taddMorphTargets( parentGeo, parentGeoNode, morphTargets, preTransform ) {\n\n\t\tif ( morphTargets.length === 0 ) return;\n\n\t\tparentGeo.morphTargetsRelative = true;\n\n\t\tparentGeo.morphAttributes.position = [];\n\t\t// parentGeo.morphAttributes.normal = []; // not implemented\n\n\t\tconst scope = this;\n\t\tmorphTargets.forEach( function ( morphTarget ) {\n\n\t\t\tmorphTarget.rawTargets.forEach( function ( rawTarget ) {\n\n\t\t\t\tconst morphGeoNode = fbxTree.Objects.Geometry[ rawTarget.geoID ];\n\n\t\t\t\tif ( morphGeoNode !== undefined ) {\n\n\t\t\t\t\tscope.genMorphGeometry( parentGeo, parentGeoNode, morphGeoNode, preTransform, rawTarget.name );\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t} );\n\n\t}\n\n\t// a morph geometry node is similar to a standard node, and the node is also contained\n\t// in FBXTree.Objects.Geometry, however it can only have attributes for position, normal\n\t// and a special attribute Index defining which vertices of the original geometry are affected\n\t// Normal and position attributes only have data for the vertices that are affected by the morph\n\tgenMorphGeometry( parentGeo, parentGeoNode, morphGeoNode, preTransform, name ) {\n\n\t\tconst basePositions = parentGeoNode.Vertices !== undefined ? parentGeoNode.Vertices.a : [];\n\t\tconst baseIndices = parentGeoNode.PolygonVertexIndex !== undefined ? parentGeoNode.PolygonVertexIndex.a : [];\n\n\t\tconst morphPositionsSparse = morphGeoNode.Vertices !== undefined ? morphGeoNode.Vertices.a : [];\n\t\tconst morphIndices = morphGeoNode.Indexes !== undefined ? morphGeoNode.Indexes.a : [];\n\n\t\tconst length = parentGeo.attributes.position.count * 3;\n\t\tconst morphPositions = new Float32Array( length );\n\n\t\tfor ( let i = 0; i < morphIndices.length; i ++ ) {\n\n\t\t\tconst morphIndex = morphIndices[ i ] * 3;\n\n\t\t\tmorphPositions[ morphIndex ] = morphPositionsSparse[ i * 3 ];\n\t\t\tmorphPositions[ morphIndex + 1 ] = morphPositionsSparse[ i * 3 + 1 ];\n\t\t\tmorphPositions[ morphIndex + 2 ] = morphPositionsSparse[ i * 3 + 2 ];\n\n\t\t}\n\n\t\t// TODO: add morph normal support\n\t\tconst morphGeoInfo = {\n\t\t\tvertexIndices: baseIndices,\n\t\t\tvertexPositions: morphPositions,\n\t\t\tbaseVertexPositions: basePositions\n\t\t};\n\n\t\tconst morphBuffers = this.genBuffers( morphGeoInfo );\n\n\t\tconst positionAttribute = new Float32BufferAttribute( morphBuffers.vertex, 3 );\n\t\tpositionAttribute.name = name || morphGeoNode.attrName;\n\n\t\tpositionAttribute.applyMatrix4( preTransform );\n\n\t\tparentGeo.morphAttributes.position.push( positionAttribute );\n\n\t}\n\n\t// Parse normal from FBXTree.Objects.Geometry.LayerElementNormal if it exists\n\tparseNormals( NormalNode ) {\n\n\t\tconst mappingType = NormalNode.MappingInformationType;\n\t\tconst referenceType = NormalNode.ReferenceInformationType;\n\t\tconst buffer = NormalNode.Normals.a;\n\t\tlet indexBuffer = [];\n\t\tif ( referenceType === 'IndexToDirect' ) {\n\n\t\t\tif ( 'NormalIndex' in NormalNode ) {\n\n\t\t\t\tindexBuffer = NormalNode.NormalIndex.a;\n\n\t\t\t} else if ( 'NormalsIndex' in NormalNode ) {\n\n\t\t\t\tindexBuffer = NormalNode.NormalsIndex.a;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\tdataSize: 3,\n\t\t\tbuffer: buffer,\n\t\t\tindices: indexBuffer,\n\t\t\tmappingType: mappingType,\n\t\t\treferenceType: referenceType\n\t\t};\n\n\t}\n\n\t// Parse UVs from FBXTree.Objects.Geometry.LayerElementUV if it exists\n\tparseUVs( UVNode ) {\n\n\t\tconst mappingType = UVNode.MappingInformationType;\n\t\tconst referenceType = UVNode.ReferenceInformationType;\n\t\tconst buffer = UVNode.UV.a;\n\t\tlet indexBuffer = [];\n\t\tif ( referenceType === 'IndexToDirect' ) {\n\n\t\t\tindexBuffer = UVNode.UVIndex.a;\n\n\t\t}\n\n\t\treturn {\n\t\t\tdataSize: 2,\n\t\t\tbuffer: buffer,\n\t\t\tindices: indexBuffer,\n\t\t\tmappingType: mappingType,\n\t\t\treferenceType: referenceType\n\t\t};\n\n\t}\n\n\t// Parse Vertex Colors from FBXTree.Objects.Geometry.LayerElementColor if it exists\n\tparseVertexColors( ColorNode ) {\n\n\t\tconst mappingType = ColorNode.MappingInformationType;\n\t\tconst referenceType = ColorNode.ReferenceInformationType;\n\t\tconst buffer = ColorNode.Colors.a;\n\t\tlet indexBuffer = [];\n\t\tif ( referenceType === 'IndexToDirect' ) {\n\n\t\t\tindexBuffer = ColorNode.ColorIndex.a;\n\n\t\t}\n\n\t\tfor ( let i = 0, c = new Color(); i < buffer.length; i += 4 ) {\n\n\t\t\tc.fromArray( buffer, i );\n\t\t\tColorManagement.toWorkingColorSpace( c, SRGBColorSpace );\n\t\t\tc.toArray( buffer, i );\n\n\t\t}\n\n\t\treturn {\n\t\t\tdataSize: 4,\n\t\t\tbuffer: buffer,\n\t\t\tindices: indexBuffer,\n\t\t\tmappingType: mappingType,\n\t\t\treferenceType: referenceType\n\t\t};\n\n\t}\n\n\t// Parse mapping and material data in FBXTree.Objects.Geometry.LayerElementMaterial if it exists\n\tparseMaterialIndices( MaterialNode ) {\n\n\t\tconst mappingType = MaterialNode.MappingInformationType;\n\t\tconst referenceType = MaterialNode.ReferenceInformationType;\n\n\t\tif ( mappingType === 'NoMappingInformation' ) {\n\n\t\t\treturn {\n\t\t\t\tdataSize: 1,\n\t\t\t\tbuffer: [ 0 ],\n\t\t\t\tindices: [ 0 ],\n\t\t\t\tmappingType: 'AllSame',\n\t\t\t\treferenceType: referenceType\n\t\t\t};\n\n\t\t}\n\n\t\tconst materialIndexBuffer = MaterialNode.Materials.a;\n\n\t\t// Since materials are stored as indices, there's a bit of a mismatch between FBX and what\n\t\t// we expect.So we create an intermediate buffer that points to the index in the buffer,\n\t\t// for conforming with the other functions we've written for other data.\n\t\tconst materialIndices = [];\n\n\t\tfor ( let i = 0; i < materialIndexBuffer.length; ++ i ) {\n\n\t\t\tmaterialIndices.push( i );\n\n\t\t}\n\n\t\treturn {\n\t\t\tdataSize: 1,\n\t\t\tbuffer: materialIndexBuffer,\n\t\t\tindices: materialIndices,\n\t\t\tmappingType: mappingType,\n\t\t\treferenceType: referenceType\n\t\t};\n\n\t}\n\n\t// Generate a NurbGeometry from a node in FBXTree.Objects.Geometry\n\tparseNurbsGeometry( geoNode ) {\n\n\t\tconst order = parseInt( geoNode.Order );\n\n\t\tif ( isNaN( order ) ) {\n\n\t\t\tconsole.error( 'THREE.FBXLoader: Invalid Order %s given for geometry ID: %s', geoNode.Order, geoNode.id );\n\t\t\treturn new BufferGeometry();\n\n\t\t}\n\n\t\tconst degree = order - 1;\n\n\t\tconst knots = geoNode.KnotVector.a;\n\t\tconst controlPoints = [];\n\t\tconst pointsValues = geoNode.Points.a;\n\n\t\tfor ( let i = 0, l = pointsValues.length; i < l; i += 4 ) {\n\n\t\t\tcontrolPoints.push( new Vector4().fromArray( pointsValues, i ) );\n\n\t\t}\n\n\t\tlet startKnot, endKnot;\n\n\t\tif ( geoNode.Form === 'Closed' ) {\n\n\t\t\tcontrolPoints.push( controlPoints[ 0 ] );\n\n\t\t} else if ( geoNode.Form === 'Periodic' ) {\n\n\t\t\tstartKnot = degree;\n\t\t\tendKnot = knots.length - 1 - startKnot;\n\n\t\t\tfor ( let i = 0; i < degree; ++ i ) {\n\n\t\t\t\tcontrolPoints.push( controlPoints[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst curve = new NURBSCurve( degree, knots, controlPoints, startKnot, endKnot );\n\t\tconst points = curve.getPoints( controlPoints.length * 12 );\n\n\t\treturn new BufferGeometry().setFromPoints( points );\n\n\t}\n\n}\n\n// parse animation data from FBXTree\nclass AnimationParser {\n\n\t// take raw animation clips and turn them into three.js animation clips\n\tparse() {\n\n\t\tconst animationClips = [];\n\n\t\tconst rawClips = this.parseClips();\n\n\t\tif ( rawClips !== undefined ) {\n\n\t\t\tfor ( const key in rawClips ) {\n\n\t\t\t\tconst rawClip = rawClips[ key ];\n\n\t\t\t\tconst clip = this.addClip( rawClip );\n\n\t\t\t\tanimationClips.push( clip );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn animationClips;\n\n\t}\n\n\tparseClips() {\n\n\t\t// since the actual transformation data is stored in FBXTree.Objects.AnimationCurve,\n\t\t// if this is undefined we can safely assume there are no animations\n\t\tif ( fbxTree.Objects.AnimationCurve === undefined ) return undefined;\n\n\t\tconst curveNodesMap = this.parseAnimationCurveNodes();\n\n\t\tthis.parseAnimationCurves( curveNodesMap );\n\n\t\tconst layersMap = this.parseAnimationLayers( curveNodesMap );\n\t\tconst rawClips = this.parseAnimStacks( layersMap );\n\n\t\treturn rawClips;\n\n\t}\n\n\t// parse nodes in FBXTree.Objects.AnimationCurveNode\n\t// each AnimationCurveNode holds data for an animation transform for a model (e.g. left arm rotation )\n\t// and is referenced by an AnimationLayer\n\tparseAnimationCurveNodes() {\n\n\t\tconst rawCurveNodes = fbxTree.Objects.AnimationCurveNode;\n\n\t\tconst curveNodesMap = new Map();\n\n\t\tfor ( const nodeID in rawCurveNodes ) {\n\n\t\t\tconst rawCurveNode = rawCurveNodes[ nodeID ];\n\n\t\t\tif ( rawCurveNode.attrName.match( /S|R|T|DeformPercent/ ) !== null ) {\n\n\t\t\t\tconst curveNode = {\n\n\t\t\t\t\tid: rawCurveNode.id,\n\t\t\t\t\tattr: rawCurveNode.attrName,\n\t\t\t\t\tcurves: {},\n\n\t\t\t\t};\n\n\t\t\t\tcurveNodesMap.set( curveNode.id, curveNode );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn curveNodesMap;\n\n\t}\n\n\t// parse nodes in FBXTree.Objects.AnimationCurve and connect them up to\n\t// previously parsed AnimationCurveNodes. Each AnimationCurve holds data for a single animated\n\t// axis ( e.g. times and values of x rotation)\n\tparseAnimationCurves( curveNodesMap ) {\n\n\t\tconst rawCurves = fbxTree.Objects.AnimationCurve;\n\n\t\t// TODO: Many values are identical up to roundoff error, but won't be optimised\n\t\t// e.g. position times: [0, 0.4, 0. 8]\n\t\t// position values: [7.23538335023477e-7, 93.67518615722656, -0.9982695579528809, 7.23538335023477e-7, 93.67518615722656, -0.9982695579528809, 7.235384487103147e-7, 93.67520904541016, -0.9982695579528809]\n\t\t// clearly, this should be optimised to\n\t\t// times: [0], positions [7.23538335023477e-7, 93.67518615722656, -0.9982695579528809]\n\t\t// this shows up in nearly every FBX file, and generally time array is length > 100\n\n\t\tfor ( const nodeID in rawCurves ) {\n\n\t\t\tconst animationCurve = {\n\n\t\t\t\tid: rawCurves[ nodeID ].id,\n\t\t\t\ttimes: rawCurves[ nodeID ].KeyTime.a.map( convertFBXTimeToSeconds ),\n\t\t\t\tvalues: rawCurves[ nodeID ].KeyValueFloat.a,\n\n\t\t\t};\n\n\t\t\tconst relationships = connections.get( animationCurve.id );\n\n\t\t\tif ( relationships !== undefined ) {\n\n\t\t\t\tconst animationCurveID = relationships.parents[ 0 ].ID;\n\t\t\t\tconst animationCurveRelationship = relationships.parents[ 0 ].relationship;\n\n\t\t\t\tif ( animationCurveRelationship.match( /X/ ) ) {\n\n\t\t\t\t\tcurveNodesMap.get( animationCurveID ).curves[ 'x' ] = animationCurve;\n\n\t\t\t\t} else if ( animationCurveRelationship.match( /Y/ ) ) {\n\n\t\t\t\t\tcurveNodesMap.get( animationCurveID ).curves[ 'y' ] = animationCurve;\n\n\t\t\t\t} else if ( animationCurveRelationship.match( /Z/ ) ) {\n\n\t\t\t\t\tcurveNodesMap.get( animationCurveID ).curves[ 'z' ] = animationCurve;\n\n\t\t\t\t} else if ( animationCurveRelationship.match( /DeformPercent/ ) && curveNodesMap.has( animationCurveID ) ) {\n\n\t\t\t\t\tcurveNodesMap.get( animationCurveID ).curves[ 'morph' ] = animationCurve;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// parse nodes in FBXTree.Objects.AnimationLayer. Each layers holds references\n\t// to various AnimationCurveNodes and is referenced by an AnimationStack node\n\t// note: theoretically a stack can have multiple layers, however in practice there always seems to be one per stack\n\tparseAnimationLayers( curveNodesMap ) {\n\n\t\tconst rawLayers = fbxTree.Objects.AnimationLayer;\n\n\t\tconst layersMap = new Map();\n\n\t\tfor ( const nodeID in rawLayers ) {\n\n\t\t\tconst layerCurveNodes = [];\n\n\t\t\tconst connection = connections.get( parseInt( nodeID ) );\n\n\t\t\tif ( connection !== undefined ) {\n\n\t\t\t\t// all the animationCurveNodes used in the layer\n\t\t\t\tconst children = connection.children;\n\n\t\t\t\tchildren.forEach( function ( child, i ) {\n\n\t\t\t\t\tif ( curveNodesMap.has( child.ID ) ) {\n\n\t\t\t\t\t\tconst curveNode = curveNodesMap.get( child.ID );\n\n\t\t\t\t\t\t// check that the curves are defined for at least one axis, otherwise ignore the curveNode\n\t\t\t\t\t\tif ( curveNode.curves.x !== undefined || curveNode.curves.y !== undefined || curveNode.curves.z !== undefined ) {\n\n\t\t\t\t\t\t\tif ( layerCurveNodes[ i ] === undefined ) {\n\n\t\t\t\t\t\t\t\tconst modelID = connections.get( child.ID ).parents.filter( function ( parent ) {\n\n\t\t\t\t\t\t\t\t\treturn parent.relationship !== undefined;\n\n\t\t\t\t\t\t\t\t} )[ 0 ].ID;\n\n\t\t\t\t\t\t\t\tif ( modelID !== undefined ) {\n\n\t\t\t\t\t\t\t\t\tconst rawModel = fbxTree.Objects.Model[ modelID.toString() ];\n\n\t\t\t\t\t\t\t\t\tif ( rawModel === undefined ) {\n\n\t\t\t\t\t\t\t\t\t\tconsole.warn( 'THREE.FBXLoader: Encountered a unused curve.', child );\n\t\t\t\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tconst node = {\n\n\t\t\t\t\t\t\t\t\t\tmodelName: rawModel.attrName ? PropertyBinding.sanitizeNodeName( rawModel.attrName ) : '',\n\t\t\t\t\t\t\t\t\t\tID: rawModel.id,\n\t\t\t\t\t\t\t\t\t\tinitialPosition: [ 0, 0, 0 ],\n\t\t\t\t\t\t\t\t\t\tinitialRotation: [ 0, 0, 0 ],\n\t\t\t\t\t\t\t\t\t\tinitialScale: [ 1, 1, 1 ],\n\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\tsceneGraph.traverse( function ( child ) {\n\n\t\t\t\t\t\t\t\t\t\tif ( child.ID === rawModel.id ) {\n\n\t\t\t\t\t\t\t\t\t\t\tnode.transform = child.matrix;\n\n\t\t\t\t\t\t\t\t\t\t\tif ( child.userData.transformData ) node.eulerOrder = child.userData.transformData.eulerOrder;\n\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\t\tif ( ! node.transform ) node.transform = new Matrix4();\n\n\t\t\t\t\t\t\t\t\t// if the animated model is pre rotated, we'll have to apply the pre rotations to every\n\t\t\t\t\t\t\t\t\t// animation value as well\n\t\t\t\t\t\t\t\t\tif ( 'PreRotation' in rawModel ) node.preRotation = rawModel.PreRotation.value;\n\t\t\t\t\t\t\t\t\tif ( 'PostRotation' in rawModel ) node.postRotation = rawModel.PostRotation.value;\n\n\t\t\t\t\t\t\t\t\tlayerCurveNodes[ i ] = node;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( layerCurveNodes[ i ] ) layerCurveNodes[ i ][ curveNode.attr ] = curveNode;\n\n\t\t\t\t\t\t} else if ( curveNode.curves.morph !== undefined ) {\n\n\t\t\t\t\t\t\tif ( layerCurveNodes[ i ] === undefined ) {\n\n\t\t\t\t\t\t\t\tconst deformerID = connections.get( child.ID ).parents.filter( function ( parent ) {\n\n\t\t\t\t\t\t\t\t\treturn parent.relationship !== undefined;\n\n\t\t\t\t\t\t\t\t} )[ 0 ].ID;\n\n\t\t\t\t\t\t\t\tconst morpherID = connections.get( deformerID ).parents[ 0 ].ID;\n\t\t\t\t\t\t\t\tconst geoID = connections.get( morpherID ).parents[ 0 ].ID;\n\n\t\t\t\t\t\t\t\t// assuming geometry is not used in more than one model\n\t\t\t\t\t\t\t\tconst modelID = connections.get( geoID ).parents[ 0 ].ID;\n\n\t\t\t\t\t\t\t\tconst rawModel = fbxTree.Objects.Model[ modelID ];\n\n\t\t\t\t\t\t\t\tconst node = {\n\n\t\t\t\t\t\t\t\t\tmodelName: rawModel.attrName ? PropertyBinding.sanitizeNodeName( rawModel.attrName ) : '',\n\t\t\t\t\t\t\t\t\tmorphName: fbxTree.Objects.Deformer[ deformerID ].attrName,\n\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tlayerCurveNodes[ i ] = node;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlayerCurveNodes[ i ][ curveNode.attr ] = curveNode;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\tlayersMap.set( parseInt( nodeID ), layerCurveNodes );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn layersMap;\n\n\t}\n\n\t// parse nodes in FBXTree.Objects.AnimationStack. These are the top level node in the animation\n\t// hierarchy. Each Stack node will be used to create a AnimationClip\n\tparseAnimStacks( layersMap ) {\n\n\t\tconst rawStacks = fbxTree.Objects.AnimationStack;\n\n\t\t// connect the stacks (clips) up to the layers\n\t\tconst rawClips = {};\n\n\t\tfor ( const nodeID in rawStacks ) {\n\n\t\t\tconst children = connections.get( parseInt( nodeID ) ).children;\n\n\t\t\tif ( children.length > 1 ) {\n\n\t\t\t\t// it seems like stacks will always be associated with a single layer. But just in case there are files\n\t\t\t\t// where there are multiple layers per stack, we'll display a warning\n\t\t\t\tconsole.warn( 'THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.' );\n\n\t\t\t}\n\n\t\t\tconst layer = layersMap.get( children[ 0 ].ID );\n\n\t\t\trawClips[ nodeID ] = {\n\n\t\t\t\tname: rawStacks[ nodeID ].attrName,\n\t\t\t\tlayer: layer,\n\n\t\t\t};\n\n\t\t}\n\n\t\treturn rawClips;\n\n\t}\n\n\taddClip( rawClip ) {\n\n\t\tlet tracks = [];\n\n\t\tconst scope = this;\n\t\trawClip.layer.forEach( function ( rawTracks ) {\n\n\t\t\ttracks = tracks.concat( scope.generateTracks( rawTracks ) );\n\n\t\t} );\n\n\t\treturn new AnimationClip( rawClip.name, - 1, tracks );\n\n\t}\n\n\tgenerateTracks( rawTracks ) {\n\n\t\tconst tracks = [];\n\n\t\tlet initialPosition = new Vector3();\n\t\tlet initialScale = new Vector3();\n\n\t\tif ( rawTracks.transform ) rawTracks.transform.decompose( initialPosition, new Quaternion(), initialScale );\n\n\t\tinitialPosition = initialPosition.toArray();\n\t\tinitialScale = initialScale.toArray();\n\n\t\tif ( rawTracks.T !== undefined && Object.keys( rawTracks.T.curves ).length > 0 ) {\n\n\t\t\tconst positionTrack = this.generateVectorTrack( rawTracks.modelName, rawTracks.T.curves, initialPosition, 'position' );\n\t\t\tif ( positionTrack !== undefined ) tracks.push( positionTrack );\n\n\t\t}\n\n\t\tif ( rawTracks.R !== undefined && Object.keys( rawTracks.R.curves ).length > 0 ) {\n\n\t\t\tconst rotationTrack = this.generateRotationTrack( rawTracks.modelName, rawTracks.R.curves, rawTracks.preRotation, rawTracks.postRotation, rawTracks.eulerOrder );\n\t\t\tif ( rotationTrack !== undefined ) tracks.push( rotationTrack );\n\n\t\t}\n\n\t\tif ( rawTracks.S !== undefined && Object.keys( rawTracks.S.curves ).length > 0 ) {\n\n\t\t\tconst scaleTrack = this.generateVectorTrack( rawTracks.modelName, rawTracks.S.curves, initialScale, 'scale' );\n\t\t\tif ( scaleTrack !== undefined ) tracks.push( scaleTrack );\n\n\t\t}\n\n\t\tif ( rawTracks.DeformPercent !== undefined ) {\n\n\t\t\tconst morphTrack = this.generateMorphTrack( rawTracks );\n\t\t\tif ( morphTrack !== undefined ) tracks.push( morphTrack );\n\n\t\t}\n\n\t\treturn tracks;\n\n\t}\n\n\tgenerateVectorTrack( modelName, curves, initialValue, type ) {\n\n\t\tconst times = this.getTimesForAllAxes( curves );\n\t\tconst values = this.getKeyframeTrackValues( times, curves, initialValue );\n\n\t\treturn new VectorKeyframeTrack( modelName + '.' + type, times, values );\n\n\t}\n\n\tgenerateRotationTrack( modelName, curves, preRotation, postRotation, eulerOrder ) {\n\n\t\tlet times;\n\t\tlet values;\n\n\t\tif ( curves.x !== undefined && curves.y !== undefined && curves.z !== undefined ) {\n\n\t\t\tconst result = this.interpolateRotations( curves.x, curves.y, curves.z, eulerOrder );\n\n\t\t\ttimes = result[ 0 ];\n\t\t\tvalues = result[ 1 ];\n\n\t\t}\n\n\t\t// For Maya models using \"Joint Orient\", Euler order only applies to rotation, not pre/post-rotations\n\t\tconst defaultEulerOrder = getEulerOrder( 0 );\n\n\t\tif ( preRotation !== undefined ) {\n\n\t\t\tpreRotation = preRotation.map( MathUtils.degToRad );\n\t\t\tpreRotation.push( defaultEulerOrder );\n\n\t\t\tpreRotation = new Euler().fromArray( preRotation );\n\t\t\tpreRotation = new Quaternion().setFromEuler( preRotation );\n\n\t\t}\n\n\t\tif ( postRotation !== undefined ) {\n\n\t\t\tpostRotation = postRotation.map( MathUtils.degToRad );\n\t\t\tpostRotation.push( defaultEulerOrder );\n\n\t\t\tpostRotation = new Euler().fromArray( postRotation );\n\t\t\tpostRotation = new Quaternion().setFromEuler( postRotation ).invert();\n\n\t\t}\n\n\t\tconst quaternion = new Quaternion();\n\t\tconst euler = new Euler();\n\n\t\tconst quaternionValues = [];\n\n\t\tif ( ! values || ! times ) return new QuaternionKeyframeTrack( modelName + '.quaternion', [ 0 ], [ 0 ] );\n\n\t\tfor ( let i = 0; i < values.length; i += 3 ) {\n\n\t\t\teuler.set( values[ i ], values[ i + 1 ], values[ i + 2 ], eulerOrder );\n\t\t\tquaternion.setFromEuler( euler );\n\n\t\t\tif ( preRotation !== undefined ) quaternion.premultiply( preRotation );\n\t\t\tif ( postRotation !== undefined ) quaternion.multiply( postRotation );\n\n\t\t\t// Check unroll\n\t\t\tif ( i > 2 ) {\n\n\t\t\t\tconst prevQuat = new Quaternion().fromArray(\n\t\t\t\t\tquaternionValues,\n\t\t\t\t\t( ( i - 3 ) / 3 ) * 4\n\t\t\t\t);\n\n\t\t\t\tif ( prevQuat.dot( quaternion ) < 0 ) {\n\n\t\t\t\t\tquaternion.set( - quaternion.x, - quaternion.y, - quaternion.z, - quaternion.w );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tquaternion.toArray( quaternionValues, ( i / 3 ) * 4 );\n\n\t\t}\n\n\t\treturn new QuaternionKeyframeTrack( modelName + '.quaternion', times, quaternionValues );\n\n\t}\n\n\tgenerateMorphTrack( rawTracks ) {\n\n\t\tconst curves = rawTracks.DeformPercent.curves.morph;\n\t\tconst values = curves.values.map( function ( val ) {\n\n\t\t\treturn val / 100;\n\n\t\t} );\n\n\t\tconst morphNum = sceneGraph.getObjectByName( rawTracks.modelName ).morphTargetDictionary[ rawTracks.morphName ];\n\n\t\treturn new NumberKeyframeTrack( rawTracks.modelName + '.morphTargetInfluences[' + morphNum + ']', curves.times, values );\n\n\t}\n\n\t// For all animated objects, times are defined separately for each axis\n\t// Here we'll combine the times into one sorted array without duplicates\n\tgetTimesForAllAxes( curves ) {\n\n\t\tlet times = [];\n\n\t\t// first join together the times for each axis, if defined\n\t\tif ( curves.x !== undefined ) times = times.concat( curves.x.times );\n\t\tif ( curves.y !== undefined ) times = times.concat( curves.y.times );\n\t\tif ( curves.z !== undefined ) times = times.concat( curves.z.times );\n\n\t\t// then sort them\n\t\ttimes = times.sort( function ( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t} );\n\n\t\t// and remove duplicates\n\t\tif ( times.length > 1 ) {\n\n\t\t\tlet targetIndex = 1;\n\t\t\tlet lastValue = times[ 0 ];\n\t\t\tfor ( let i = 1; i < times.length; i ++ ) {\n\n\t\t\t\tconst currentValue = times[ i ];\n\t\t\t\tif ( currentValue !== lastValue ) {\n\n\t\t\t\t\ttimes[ targetIndex ] = currentValue;\n\t\t\t\t\tlastValue = currentValue;\n\t\t\t\t\ttargetIndex ++;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\ttimes = times.slice( 0, targetIndex );\n\n\t\t}\n\n\t\treturn times;\n\n\t}\n\n\tgetKeyframeTrackValues( times, curves, initialValue ) {\n\n\t\tconst prevValue = initialValue;\n\n\t\tconst values = [];\n\n\t\tlet xIndex = - 1;\n\t\tlet yIndex = - 1;\n\t\tlet zIndex = - 1;\n\n\t\ttimes.forEach( function ( time ) {\n\n\t\t\tif ( curves.x ) xIndex = curves.x.times.indexOf( time );\n\t\t\tif ( curves.y ) yIndex = curves.y.times.indexOf( time );\n\t\t\tif ( curves.z ) zIndex = curves.z.times.indexOf( time );\n\n\t\t\t// if there is an x value defined for this frame, use that\n\t\t\tif ( xIndex !== - 1 ) {\n\n\t\t\t\tconst xValue = curves.x.values[ xIndex ];\n\t\t\t\tvalues.push( xValue );\n\t\t\t\tprevValue[ 0 ] = xValue;\n\n\t\t\t} else {\n\n\t\t\t\t// otherwise use the x value from the previous frame\n\t\t\t\tvalues.push( prevValue[ 0 ] );\n\n\t\t\t}\n\n\t\t\tif ( yIndex !== - 1 ) {\n\n\t\t\t\tconst yValue = curves.y.values[ yIndex ];\n\t\t\t\tvalues.push( yValue );\n\t\t\t\tprevValue[ 1 ] = yValue;\n\n\t\t\t} else {\n\n\t\t\t\tvalues.push( prevValue[ 1 ] );\n\n\t\t\t}\n\n\t\t\tif ( zIndex !== - 1 ) {\n\n\t\t\t\tconst zValue = curves.z.values[ zIndex ];\n\t\t\t\tvalues.push( zValue );\n\t\t\t\tprevValue[ 2 ] = zValue;\n\n\t\t\t} else {\n\n\t\t\t\tvalues.push( prevValue[ 2 ] );\n\n\t\t\t}\n\n\t\t} );\n\n\t\treturn values;\n\n\t}\n\n\t// Rotations are defined as Euler angles which can have values of any size\n\t// These will be converted to quaternions which don't support values greater than\n\t// PI, so we'll interpolate large rotations\n\tinterpolateRotations( curvex, curvey, curvez, eulerOrder ) {\n\n\t\tconst times = [];\n\t\tconst values = [];\n\n\t\t// Add first frame\n\t\ttimes.push( curvex.times[ 0 ] );\n\t\tvalues.push( MathUtils.degToRad( curvex.values[ 0 ] ) );\n\t\tvalues.push( MathUtils.degToRad( curvey.values[ 0 ] ) );\n\t\tvalues.push( MathUtils.degToRad( curvez.values[ 0 ] ) );\n\n\t\tfor ( let i = 1; i < curvex.values.length; i ++ ) {\n\n\t\t\tconst initialValue = [\n\t\t\t\tcurvex.values[ i - 1 ],\n\t\t\t\tcurvey.values[ i - 1 ],\n\t\t\t\tcurvez.values[ i - 1 ],\n\t\t\t];\n\n\t\t\tif ( isNaN( initialValue[ 0 ] ) || isNaN( initialValue[ 1 ] ) || isNaN( initialValue[ 2 ] ) ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst initialValueRad = initialValue.map( MathUtils.degToRad );\n\n\t\t\tconst currentValue = [\n\t\t\t\tcurvex.values[ i ],\n\t\t\t\tcurvey.values[ i ],\n\t\t\t\tcurvez.values[ i ],\n\t\t\t];\n\n\t\t\tif ( isNaN( currentValue[ 0 ] ) || isNaN( currentValue[ 1 ] ) || isNaN( currentValue[ 2 ] ) ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst currentValueRad = currentValue.map( MathUtils.degToRad );\n\n\t\t\tconst valuesSpan = [\n\t\t\t\tcurrentValue[ 0 ] - initialValue[ 0 ],\n\t\t\t\tcurrentValue[ 1 ] - initialValue[ 1 ],\n\t\t\t\tcurrentValue[ 2 ] - initialValue[ 2 ],\n\t\t\t];\n\n\t\t\tconst absoluteSpan = [\n\t\t\t\tMath.abs( valuesSpan[ 0 ] ),\n\t\t\t\tMath.abs( valuesSpan[ 1 ] ),\n\t\t\t\tMath.abs( valuesSpan[ 2 ] ),\n\t\t\t];\n\n\t\t\tif ( absoluteSpan[ 0 ] >= 180 || absoluteSpan[ 1 ] >= 180 || absoluteSpan[ 2 ] >= 180 ) {\n\n\t\t\t\tconst maxAbsSpan = Math.max( ...absoluteSpan );\n\n\t\t\t\tconst numSubIntervals = maxAbsSpan / 180;\n\n\t\t\t\tconst E1 = new Euler( ...initialValueRad, eulerOrder );\n\t\t\t\tconst E2 = new Euler( ...currentValueRad, eulerOrder );\n\n\t\t\t\tconst Q1 = new Quaternion().setFromEuler( E1 );\n\t\t\t\tconst Q2 = new Quaternion().setFromEuler( E2 );\n\n\t\t\t\t// Check unroll\n\t\t\t\tif ( Q1.dot( Q2 ) ) {\n\n\t\t\t\t\tQ2.set( - Q2.x, - Q2.y, - Q2.z, - Q2.w );\n\n\t\t\t\t}\n\n\t\t\t\t// Interpolate\n\t\t\t\tconst initialTime = curvex.times[ i - 1 ];\n\t\t\t\tconst timeSpan = curvex.times[ i ] - initialTime;\n\n\t\t\t\tconst Q = new Quaternion();\n\t\t\t\tconst E = new Euler();\n\t\t\t\tfor ( let t = 0; t < 1; t += 1 / numSubIntervals ) {\n\n\t\t\t\t\tQ.copy( Q1.clone().slerp( Q2.clone(), t ) );\n\n\t\t\t\t\ttimes.push( initialTime + t * timeSpan );\n\t\t\t\t\tE.setFromQuaternion( Q, eulerOrder );\n\n\t\t\t\t\tvalues.push( E.x );\n\t\t\t\t\tvalues.push( E.y );\n\t\t\t\t\tvalues.push( E.z );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\ttimes.push( curvex.times[ i ] );\n\t\t\t\tvalues.push( MathUtils.degToRad( curvex.values[ i ] ) );\n\t\t\t\tvalues.push( MathUtils.degToRad( curvey.values[ i ] ) );\n\t\t\t\tvalues.push( MathUtils.degToRad( curvez.values[ i ] ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn [ times, values ];\n\n\t}\n\n}\n\n// parse an FBX file in ASCII format\nclass TextParser {\n\n\tgetPrevNode() {\n\n\t\treturn this.nodeStack[ this.currentIndent - 2 ];\n\n\t}\n\n\tgetCurrentNode() {\n\n\t\treturn this.nodeStack[ this.currentIndent - 1 ];\n\n\t}\n\n\tgetCurrentProp() {\n\n\t\treturn this.currentProp;\n\n\t}\n\n\tpushStack( node ) {\n\n\t\tthis.nodeStack.push( node );\n\t\tthis.currentIndent += 1;\n\n\t}\n\n\tpopStack() {\n\n\t\tthis.nodeStack.pop();\n\t\tthis.currentIndent -= 1;\n\n\t}\n\n\tsetCurrentProp( val, name ) {\n\n\t\tthis.currentProp = val;\n\t\tthis.currentPropName = name;\n\n\t}\n\n\tparse( text ) {\n\n\t\tthis.currentIndent = 0;\n\n\t\tthis.allNodes = new FBXTree();\n\t\tthis.nodeStack = [];\n\t\tthis.currentProp = [];\n\t\tthis.currentPropName = '';\n\n\t\tconst scope = this;\n\n\t\tconst split = text.split( /[\\r\\n]+/ );\n\n\t\tsplit.forEach( function ( line, i ) {\n\n\t\t\tconst matchComment = line.match( /^[\\s\\t]*;/ );\n\t\t\tconst matchEmpty = line.match( /^[\\s\\t]*$/ );\n\n\t\t\tif ( matchComment || matchEmpty ) return;\n\n\t\t\tconst matchBeginning = line.match( '^\\\\t{' + scope.currentIndent + '}(\\\\w+):(.*){', '' );\n\t\t\tconst matchProperty = line.match( '^\\\\t{' + ( scope.currentIndent ) + '}(\\\\w+):[\\\\s\\\\t\\\\r\\\\n](.*)' );\n\t\t\tconst matchEnd = line.match( '^\\\\t{' + ( scope.currentIndent - 1 ) + '}}' );\n\n\t\t\tif ( matchBeginning ) {\n\n\t\t\t\tscope.parseNodeBegin( line, matchBeginning );\n\n\t\t\t} else if ( matchProperty ) {\n\n\t\t\t\tscope.parseNodeProperty( line, matchProperty, split[ ++ i ] );\n\n\t\t\t} else if ( matchEnd ) {\n\n\t\t\t\tscope.popStack();\n\n\t\t\t} else if ( line.match( /^[^\\s\\t}]/ ) ) {\n\n\t\t\t\t// large arrays are split over multiple lines terminated with a ',' character\n\t\t\t\t// if this is encountered the line needs to be joined to the previous line\n\t\t\t\tscope.parseNodePropertyContinued( line );\n\n\t\t\t}\n\n\t\t} );\n\n\t\treturn this.allNodes;\n\n\t}\n\n\tparseNodeBegin( line, property ) {\n\n\t\tconst nodeName = property[ 1 ].trim().replace( /^\"/, '' ).replace( /\"$/, '' );\n\n\t\tconst nodeAttrs = property[ 2 ].split( ',' ).map( function ( attr ) {\n\n\t\t\treturn attr.trim().replace( /^\"/, '' ).replace( /\"$/, '' );\n\n\t\t} );\n\n\t\tconst node = { name: nodeName };\n\t\tconst attrs = this.parseNodeAttr( nodeAttrs );\n\n\t\tconst currentNode = this.getCurrentNode();\n\n\t\t// a top node\n\t\tif ( this.currentIndent === 0 ) {\n\n\t\t\tthis.allNodes.add( nodeName, node );\n\n\t\t} else { // a subnode\n\n\t\t\t// if the subnode already exists, append it\n\t\t\tif ( nodeName in currentNode ) {\n\n\t\t\t\t// special case Pose needs PoseNodes as an array\n\t\t\t\tif ( nodeName === 'PoseNode' ) {\n\n\t\t\t\t\tcurrentNode.PoseNode.push( node );\n\n\t\t\t\t} else if ( currentNode[ nodeName ].id !== undefined ) {\n\n\t\t\t\t\tcurrentNode[ nodeName ] = {};\n\t\t\t\t\tcurrentNode[ nodeName ][ currentNode[ nodeName ].id ] = currentNode[ nodeName ];\n\n\t\t\t\t}\n\n\t\t\t\tif ( attrs.id !== '' ) currentNode[ nodeName ][ attrs.id ] = node;\n\n\t\t\t} else if ( typeof attrs.id === 'number' ) {\n\n\t\t\t\tcurrentNode[ nodeName ] = {};\n\t\t\t\tcurrentNode[ nodeName ][ attrs.id ] = node;\n\n\t\t\t} else if ( nodeName !== 'Properties70' ) {\n\n\t\t\t\tif ( nodeName === 'PoseNode' )\tcurrentNode[ nodeName ] = [ node ];\n\t\t\t\telse currentNode[ nodeName ] = node;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( typeof attrs.id === 'number' ) node.id = attrs.id;\n\t\tif ( attrs.name !== '' ) node.attrName = attrs.name;\n\t\tif ( attrs.type !== '' ) node.attrType = attrs.type;\n\n\t\tthis.pushStack( node );\n\n\t}\n\n\tparseNodeAttr( attrs ) {\n\n\t\tlet id = attrs[ 0 ];\n\n\t\tif ( attrs[ 0 ] !== '' ) {\n\n\t\t\tid = parseInt( attrs[ 0 ] );\n\n\t\t\tif ( isNaN( id ) ) {\n\n\t\t\t\tid = attrs[ 0 ];\n\n\t\t\t}\n\n\t\t}\n\n\t\tlet name = '', type = '';\n\n\t\tif ( attrs.length > 1 ) {\n\n\t\t\tname = attrs[ 1 ].replace( /^(\\w+)::/, '' );\n\t\t\ttype = attrs[ 2 ];\n\n\t\t}\n\n\t\treturn { id: id, name: name, type: type };\n\n\t}\n\n\tparseNodeProperty( line, property, contentLine ) {\n\n\t\tlet propName = property[ 1 ].replace( /^\"/, '' ).replace( /\"$/, '' ).trim();\n\t\tlet propValue = property[ 2 ].replace( /^\"/, '' ).replace( /\"$/, '' ).trim();\n\n\t\t// for special case: base64 image data follows \"Content: ,\" line\n\t\t//\tContent: ,\n\t\t//\t \"/9j/4RDaRXhpZgAATU0A...\"\n\t\tif ( propName === 'Content' && propValue === ',' ) {\n\n\t\t\tpropValue = contentLine.replace( /\"/g, '' ).replace( /,$/, '' ).trim();\n\n\t\t}\n\n\t\tconst currentNode = this.getCurrentNode();\n\t\tconst parentName = currentNode.name;\n\n\t\tif ( parentName === 'Properties70' ) {\n\n\t\t\tthis.parseNodeSpecialProperty( line, propName, propValue );\n\t\t\treturn;\n\n\t\t}\n\n\t\t// Connections\n\t\tif ( propName === 'C' ) {\n\n\t\t\tconst connProps = propValue.split( ',' ).slice( 1 );\n\t\t\tconst from = parseInt( connProps[ 0 ] );\n\t\t\tconst to = parseInt( connProps[ 1 ] );\n\n\t\t\tlet rest = propValue.split( ',' ).slice( 3 );\n\n\t\t\trest = rest.map( function ( elem ) {\n\n\t\t\t\treturn elem.trim().replace( /^\"/, '' );\n\n\t\t\t} );\n\n\t\t\tpropName = 'connections';\n\t\t\tpropValue = [ from, to ];\n\t\t\tappend( propValue, rest );\n\n\t\t\tif ( currentNode[ propName ] === undefined ) {\n\n\t\t\t\tcurrentNode[ propName ] = [];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Node\n\t\tif ( propName === 'Node' ) currentNode.id = propValue;\n\n\t\t// connections\n\t\tif ( propName in currentNode && Array.isArray( currentNode[ propName ] ) ) {\n\n\t\t\tcurrentNode[ propName ].push( propValue );\n\n\t\t} else {\n\n\t\t\tif ( propName !== 'a' ) currentNode[ propName ] = propValue;\n\t\t\telse currentNode.a = propValue;\n\n\t\t}\n\n\t\tthis.setCurrentProp( currentNode, propName );\n\n\t\t// convert string to array, unless it ends in ',' in which case more will be added to it\n\t\tif ( propName === 'a' && propValue.slice( - 1 ) !== ',' ) {\n\n\t\t\tcurrentNode.a = parseNumberArray( propValue );\n\n\t\t}\n\n\t}\n\n\tparseNodePropertyContinued( line ) {\n\n\t\tconst currentNode = this.getCurrentNode();\n\n\t\tcurrentNode.a += line;\n\n\t\t// if the line doesn't end in ',' we have reached the end of the property value\n\t\t// so convert the string to an array\n\t\tif ( line.slice( - 1 ) !== ',' ) {\n\n\t\t\tcurrentNode.a = parseNumberArray( currentNode.a );\n\n\t\t}\n\n\t}\n\n\t// parse \"Property70\"\n\tparseNodeSpecialProperty( line, propName, propValue ) {\n\n\t\t// split this\n\t\t// P: \"Lcl Scaling\", \"Lcl Scaling\", \"\", \"A\",1,1,1\n\t\t// into array like below\n\t\t// [\"Lcl Scaling\", \"Lcl Scaling\", \"\", \"A\", \"1,1,1\" ]\n\t\tconst props = propValue.split( '\",' ).map( function ( prop ) {\n\n\t\t\treturn prop.trim().replace( /^\\\"/, '' ).replace( /\\s/, '_' );\n\n\t\t} );\n\n\t\tconst innerPropName = props[ 0 ];\n\t\tconst innerPropType1 = props[ 1 ];\n\t\tconst innerPropType2 = props[ 2 ];\n\t\tconst innerPropFlag = props[ 3 ];\n\t\tlet innerPropValue = props[ 4 ];\n\n\t\t// cast values where needed, otherwise leave as strings\n\t\tswitch ( innerPropType1 ) {\n\n\t\t\tcase 'int':\n\t\t\tcase 'enum':\n\t\t\tcase 'bool':\n\t\t\tcase 'ULongLong':\n\t\t\tcase 'double':\n\t\t\tcase 'Number':\n\t\t\tcase 'FieldOfView':\n\t\t\t\tinnerPropValue = parseFloat( innerPropValue );\n\t\t\t\tbreak;\n\n\t\t\tcase 'Color':\n\t\t\tcase 'ColorRGB':\n\t\t\tcase 'Vector3D':\n\t\t\tcase 'Lcl_Translation':\n\t\t\tcase 'Lcl_Rotation':\n\t\t\tcase 'Lcl_Scaling':\n\t\t\t\tinnerPropValue = parseNumberArray( innerPropValue );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\t// CAUTION: these props must append to parent's parent\n\t\tthis.getPrevNode()[ innerPropName ] = {\n\n\t\t\t'type': innerPropType1,\n\t\t\t'type2': innerPropType2,\n\t\t\t'flag': innerPropFlag,\n\t\t\t'value': innerPropValue\n\n\t\t};\n\n\t\tthis.setCurrentProp( this.getPrevNode(), innerPropName );\n\n\t}\n\n}\n\n// Parse an FBX file in Binary format\nclass BinaryParser {\n\n\tparse( buffer ) {\n\n\t\tconst reader = new BinaryReader( buffer );\n\t\treader.skip( 23 ); // skip magic 23 bytes\n\n\t\tconst version = reader.getUint32();\n\n\t\tif ( version < 6400 ) {\n\n\t\t\tthrow new Error( 'THREE.FBXLoader: FBX version not supported, FileVersion: ' + version );\n\n\t\t}\n\n\t\tconst allNodes = new FBXTree();\n\n\t\twhile ( ! this.endOfContent( reader ) ) {\n\n\t\t\tconst node = this.parseNode( reader, version );\n\t\t\tif ( node !== null ) allNodes.add( node.name, node );\n\n\t\t}\n\n\t\treturn allNodes;\n\n\t}\n\n\t// Check if reader has reached the end of content.\n\tendOfContent( reader ) {\n\n\t\t// footer size: 160bytes + 16-byte alignment padding\n\t\t// - 16bytes: magic\n\t\t// - padding til 16-byte alignment (at least 1byte?)\n\t\t//\t(seems like some exporters embed fixed 15 or 16bytes?)\n\t\t// - 4bytes: magic\n\t\t// - 4bytes: version\n\t\t// - 120bytes: zero\n\t\t// - 16bytes: magic\n\t\tif ( reader.size() % 16 === 0 ) {\n\n\t\t\treturn ( ( reader.getOffset() + 160 + 16 ) & ~ 0xf ) >= reader.size();\n\n\t\t} else {\n\n\t\t\treturn reader.getOffset() + 160 + 16 >= reader.size();\n\n\t\t}\n\n\t}\n\n\t// recursively parse nodes until the end of the file is reached\n\tparseNode( reader, version ) {\n\n\t\tconst node = {};\n\n\t\t// The first three data sizes depends on version.\n\t\tconst endOffset = ( version >= 7500 ) ? reader.getUint64() : reader.getUint32();\n\t\tconst numProperties = ( version >= 7500 ) ? reader.getUint64() : reader.getUint32();\n\n\t\t( version >= 7500 ) ? reader.getUint64() : reader.getUint32(); // the returned propertyListLen is not used\n\n\t\tconst nameLen = reader.getUint8();\n\t\tconst name = reader.getString( nameLen );\n\n\t\t// Regards this node as NULL-record if endOffset is zero\n\t\tif ( endOffset === 0 ) return null;\n\n\t\tconst propertyList = [];\n\n\t\tfor ( let i = 0; i < numProperties; i ++ ) {\n\n\t\t\tpropertyList.push( this.parseProperty( reader ) );\n\n\t\t}\n\n\t\t// Regards the first three elements in propertyList as id, attrName, and attrType\n\t\tconst id = propertyList.length > 0 ? propertyList[ 0 ] : '';\n\t\tconst attrName = propertyList.length > 1 ? propertyList[ 1 ] : '';\n\t\tconst attrType = propertyList.length > 2 ? propertyList[ 2 ] : '';\n\n\t\t// check if this node represents just a single property\n\t\t// like (name, 0) set or (name2, [0, 1, 2]) set of {name: 0, name2: [0, 1, 2]}\n\t\tnode.singleProperty = ( numProperties === 1 && reader.getOffset() === endOffset ) ? true : false;\n\n\t\twhile ( endOffset > reader.getOffset() ) {\n\n\t\t\tconst subNode = this.parseNode( reader, version );\n\n\t\t\tif ( subNode !== null ) this.parseSubNode( name, node, subNode );\n\n\t\t}\n\n\t\tnode.propertyList = propertyList; // raw property list used by parent\n\n\t\tif ( typeof id === 'number' ) node.id = id;\n\t\tif ( attrName !== '' ) node.attrName = attrName;\n\t\tif ( attrType !== '' ) node.attrType = attrType;\n\t\tif ( name !== '' ) node.name = name;\n\n\t\treturn node;\n\n\t}\n\n\tparseSubNode( name, node, subNode ) {\n\n\t\t// special case: child node is single property\n\t\tif ( subNode.singleProperty === true ) {\n\n\t\t\tconst value = subNode.propertyList[ 0 ];\n\n\t\t\tif ( Array.isArray( value ) ) {\n\n\t\t\t\tnode[ subNode.name ] = subNode;\n\n\t\t\t\tsubNode.a = value;\n\n\t\t\t} else {\n\n\t\t\t\tnode[ subNode.name ] = value;\n\n\t\t\t}\n\n\t\t} else if ( name === 'Connections' && subNode.name === 'C' ) {\n\n\t\t\tconst array = [];\n\n\t\t\tsubNode.propertyList.forEach( function ( property, i ) {\n\n\t\t\t\t// first Connection is FBX type (OO, OP, etc.). We'll discard these\n\t\t\t\tif ( i !== 0 ) array.push( property );\n\n\t\t\t} );\n\n\t\t\tif ( node.connections === undefined ) {\n\n\t\t\t\tnode.connections = [];\n\n\t\t\t}\n\n\t\t\tnode.connections.push( array );\n\n\t\t} else if ( subNode.name === 'Properties70' ) {\n\n\t\t\tconst keys = Object.keys( subNode );\n\n\t\t\tkeys.forEach( function ( key ) {\n\n\t\t\t\tnode[ key ] = subNode[ key ];\n\n\t\t\t} );\n\n\t\t} else if ( name === 'Properties70' && subNode.name === 'P' ) {\n\n\t\t\tlet innerPropName = subNode.propertyList[ 0 ];\n\t\t\tlet innerPropType1 = subNode.propertyList[ 1 ];\n\t\t\tconst innerPropType2 = subNode.propertyList[ 2 ];\n\t\t\tconst innerPropFlag = subNode.propertyList[ 3 ];\n\t\t\tlet innerPropValue;\n\n\t\t\tif ( innerPropName.indexOf( 'Lcl ' ) === 0 ) innerPropName = innerPropName.replace( 'Lcl ', 'Lcl_' );\n\t\t\tif ( innerPropType1.indexOf( 'Lcl ' ) === 0 ) innerPropType1 = innerPropType1.replace( 'Lcl ', 'Lcl_' );\n\n\t\t\tif ( innerPropType1 === 'Color' || innerPropType1 === 'ColorRGB' || innerPropType1 === 'Vector' || innerPropType1 === 'Vector3D' || innerPropType1.indexOf( 'Lcl_' ) === 0 ) {\n\n\t\t\t\tinnerPropValue = [\n\t\t\t\t\tsubNode.propertyList[ 4 ],\n\t\t\t\t\tsubNode.propertyList[ 5 ],\n\t\t\t\t\tsubNode.propertyList[ 6 ]\n\t\t\t\t];\n\n\t\t\t} else {\n\n\t\t\t\tinnerPropValue = subNode.propertyList[ 4 ];\n\n\t\t\t}\n\n\t\t\t// this will be copied to parent, see above\n\t\t\tnode[ innerPropName ] = {\n\n\t\t\t\t'type': innerPropType1,\n\t\t\t\t'type2': innerPropType2,\n\t\t\t\t'flag': innerPropFlag,\n\t\t\t\t'value': innerPropValue\n\n\t\t\t};\n\n\t\t} else if ( node[ subNode.name ] === undefined ) {\n\n\t\t\tif ( typeof subNode.id === 'number' ) {\n\n\t\t\t\tnode[ subNode.name ] = {};\n\t\t\t\tnode[ subNode.name ][ subNode.id ] = subNode;\n\n\t\t\t} else {\n\n\t\t\t\tnode[ subNode.name ] = subNode;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( subNode.name === 'PoseNode' ) {\n\n\t\t\t\tif ( ! Array.isArray( node[ subNode.name ] ) ) {\n\n\t\t\t\t\tnode[ subNode.name ] = [ node[ subNode.name ] ];\n\n\t\t\t\t}\n\n\t\t\t\tnode[ subNode.name ].push( subNode );\n\n\t\t\t} else if ( node[ subNode.name ][ subNode.id ] === undefined ) {\n\n\t\t\t\tnode[ subNode.name ][ subNode.id ] = subNode;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tparseProperty( reader ) {\n\n\t\tconst type = reader.getString( 1 );\n\t\tlet length;\n\n\t\tswitch ( type ) {\n\n\t\t\tcase 'C':\n\t\t\t\treturn reader.getBoolean();\n\n\t\t\tcase 'D':\n\t\t\t\treturn reader.getFloat64();\n\n\t\t\tcase 'F':\n\t\t\t\treturn reader.getFloat32();\n\n\t\t\tcase 'I':\n\t\t\t\treturn reader.getInt32();\n\n\t\t\tcase 'L':\n\t\t\t\treturn reader.getInt64();\n\n\t\t\tcase 'R':\n\t\t\t\tlength = reader.getUint32();\n\t\t\t\treturn reader.getArrayBuffer( length );\n\n\t\t\tcase 'S':\n\t\t\t\tlength = reader.getUint32();\n\t\t\t\treturn reader.getString( length );\n\n\t\t\tcase 'Y':\n\t\t\t\treturn reader.getInt16();\n\n\t\t\tcase 'b':\n\t\t\tcase 'c':\n\t\t\tcase 'd':\n\t\t\tcase 'f':\n\t\t\tcase 'i':\n\t\t\tcase 'l':\n\n\t\t\t\tconst arrayLength = reader.getUint32();\n\t\t\t\tconst encoding = reader.getUint32(); // 0: non-compressed, 1: compressed\n\t\t\t\tconst compressedLength = reader.getUint32();\n\n\t\t\t\tif ( encoding === 0 ) {\n\n\t\t\t\t\tswitch ( type ) {\n\n\t\t\t\t\t\tcase 'b':\n\t\t\t\t\t\tcase 'c':\n\t\t\t\t\t\t\treturn reader.getBooleanArray( arrayLength );\n\n\t\t\t\t\t\tcase 'd':\n\t\t\t\t\t\t\treturn reader.getFloat64Array( arrayLength );\n\n\t\t\t\t\t\tcase 'f':\n\t\t\t\t\t\t\treturn reader.getFloat32Array( arrayLength );\n\n\t\t\t\t\t\tcase 'i':\n\t\t\t\t\t\t\treturn reader.getInt32Array( arrayLength );\n\n\t\t\t\t\t\tcase 'l':\n\t\t\t\t\t\t\treturn reader.getInt64Array( arrayLength );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tconst data = fflate.unzlibSync( new Uint8Array( reader.getArrayBuffer( compressedLength ) ) );\n\t\t\t\tconst reader2 = new BinaryReader( data.buffer );\n\n\t\t\t\tswitch ( type ) {\n\n\t\t\t\t\tcase 'b':\n\t\t\t\t\tcase 'c':\n\t\t\t\t\t\treturn reader2.getBooleanArray( arrayLength );\n\n\t\t\t\t\tcase 'd':\n\t\t\t\t\t\treturn reader2.getFloat64Array( arrayLength );\n\n\t\t\t\t\tcase 'f':\n\t\t\t\t\t\treturn reader2.getFloat32Array( arrayLength );\n\n\t\t\t\t\tcase 'i':\n\t\t\t\t\t\treturn reader2.getInt32Array( arrayLength );\n\n\t\t\t\t\tcase 'l':\n\t\t\t\t\t\treturn reader2.getInt64Array( arrayLength );\n\n\t\t\t\t}\n\n\t\t\t\tbreak; // cannot happen but is required by the DeepScan\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'THREE.FBXLoader: Unknown property type ' + type );\n\n\t\t}\n\n\t}\n\n}\n\nclass BinaryReader {\n\n\tconstructor( buffer, littleEndian ) {\n\n\t\tthis.dv = new DataView( buffer );\n\t\tthis.offset = 0;\n\t\tthis.littleEndian = ( littleEndian !== undefined ) ? littleEndian : true;\n\t\tthis._textDecoder = new TextDecoder();\n\n\t}\n\n\tgetOffset() {\n\n\t\treturn this.offset;\n\n\t}\n\n\tsize() {\n\n\t\treturn this.dv.buffer.byteLength;\n\n\t}\n\n\tskip( length ) {\n\n\t\tthis.offset += length;\n\n\t}\n\n\t// seems like true/false representation depends on exporter.\n\t// true: 1 or 'Y'(=0x59), false: 0 or 'T'(=0x54)\n\t// then sees LSB.\n\tgetBoolean() {\n\n\t\treturn ( this.getUint8() & 1 ) === 1;\n\n\t}\n\n\tgetBooleanArray( size ) {\n\n\t\tconst a = [];\n\n\t\tfor ( let i = 0; i < size; i ++ ) {\n\n\t\t\ta.push( this.getBoolean() );\n\n\t\t}\n\n\t\treturn a;\n\n\t}\n\n\tgetUint8() {\n\n\t\tconst value = this.dv.getUint8( this.offset );\n\t\tthis.offset += 1;\n\t\treturn value;\n\n\t}\n\n\tgetInt16() {\n\n\t\tconst value = this.dv.getInt16( this.offset, this.littleEndian );\n\t\tthis.offset += 2;\n\t\treturn value;\n\n\t}\n\n\tgetInt32() {\n\n\t\tconst value = this.dv.getInt32( this.offset, this.littleEndian );\n\t\tthis.offset += 4;\n\t\treturn value;\n\n\t}\n\n\tgetInt32Array( size ) {\n\n\t\tconst a = [];\n\n\t\tfor ( let i = 0; i < size; i ++ ) {\n\n\t\t\ta.push( this.getInt32() );\n\n\t\t}\n\n\t\treturn a;\n\n\t}\n\n\tgetUint32() {\n\n\t\tconst value = this.dv.getUint32( this.offset, this.littleEndian );\n\t\tthis.offset += 4;\n\t\treturn value;\n\n\t}\n\n\t// JavaScript doesn't support 64-bit integer so calculate this here\n\t// 1 << 32 will return 1 so using multiply operation instead here.\n\t// There's a possibility that this method returns wrong value if the value\n\t// is out of the range between Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER.\n\t// TODO: safely handle 64-bit integer\n\tgetInt64() {\n\n\t\tlet low, high;\n\n\t\tif ( this.littleEndian ) {\n\n\t\t\tlow = this.getUint32();\n\t\t\thigh = this.getUint32();\n\n\t\t} else {\n\n\t\t\thigh = this.getUint32();\n\t\t\tlow = this.getUint32();\n\n\t\t}\n\n\t\t// calculate negative value\n\t\tif ( high & 0x80000000 ) {\n\n\t\t\thigh = ~ high & 0xFFFFFFFF;\n\t\t\tlow = ~ low & 0xFFFFFFFF;\n\n\t\t\tif ( low === 0xFFFFFFFF ) high = ( high + 1 ) & 0xFFFFFFFF;\n\n\t\t\tlow = ( low + 1 ) & 0xFFFFFFFF;\n\n\t\t\treturn - ( high * 0x100000000 + low );\n\n\t\t}\n\n\t\treturn high * 0x100000000 + low;\n\n\t}\n\n\tgetInt64Array( size ) {\n\n\t\tconst a = [];\n\n\t\tfor ( let i = 0; i < size; i ++ ) {\n\n\t\t\ta.push( this.getInt64() );\n\n\t\t}\n\n\t\treturn a;\n\n\t}\n\n\t// Note: see getInt64() comment\n\tgetUint64() {\n\n\t\tlet low, high;\n\n\t\tif ( this.littleEndian ) {\n\n\t\t\tlow = this.getUint32();\n\t\t\thigh = this.getUint32();\n\n\t\t} else {\n\n\t\t\thigh = this.getUint32();\n\t\t\tlow = this.getUint32();\n\n\t\t}\n\n\t\treturn high * 0x100000000 + low;\n\n\t}\n\n\tgetFloat32() {\n\n\t\tconst value = this.dv.getFloat32( this.offset, this.littleEndian );\n\t\tthis.offset += 4;\n\t\treturn value;\n\n\t}\n\n\tgetFloat32Array( size ) {\n\n\t\tconst a = [];\n\n\t\tfor ( let i = 0; i < size; i ++ ) {\n\n\t\t\ta.push( this.getFloat32() );\n\n\t\t}\n\n\t\treturn a;\n\n\t}\n\n\tgetFloat64() {\n\n\t\tconst value = this.dv.getFloat64( this.offset, this.littleEndian );\n\t\tthis.offset += 8;\n\t\treturn value;\n\n\t}\n\n\tgetFloat64Array( size ) {\n\n\t\tconst a = [];\n\n\t\tfor ( let i = 0; i < size; i ++ ) {\n\n\t\t\ta.push( this.getFloat64() );\n\n\t\t}\n\n\t\treturn a;\n\n\t}\n\n\tgetArrayBuffer( size ) {\n\n\t\tconst value = this.dv.buffer.slice( this.offset, this.offset + size );\n\t\tthis.offset += size;\n\t\treturn value;\n\n\t}\n\n\tgetString( size ) {\n\n\t\tconst start = this.offset;\n\t\tlet a = new Uint8Array( this.dv.buffer, start, size );\n\n\t\tthis.skip( size );\n\n\t\tconst nullByte = a.indexOf( 0 );\n\t\tif ( nullByte >= 0 ) a = new Uint8Array( this.dv.buffer, start, nullByte );\n\n\t\treturn this._textDecoder.decode( a );\n\n\t}\n\n}\n\n// FBXTree holds a representation of the FBX data, returned by the TextParser ( FBX ASCII format)\n// and BinaryParser( FBX Binary format)\nclass FBXTree {\n\n\tadd( key, val ) {\n\n\t\tthis[ key ] = val;\n\n\t}\n\n}\n\n// ************** UTILITY FUNCTIONS **************\n\nfunction isFbxFormatBinary( buffer ) {\n\n\tconst CORRECT = 'Kaydara\\u0020FBX\\u0020Binary\\u0020\\u0020\\0';\n\n\treturn buffer.byteLength >= CORRECT.length && CORRECT === convertArrayBufferToString( buffer, 0, CORRECT.length );\n\n}\n\nfunction isFbxFormatASCII( text ) {\n\n\tconst CORRECT = [ 'K', 'a', 'y', 'd', 'a', 'r', 'a', '\\\\', 'F', 'B', 'X', '\\\\', 'B', 'i', 'n', 'a', 'r', 'y', '\\\\', '\\\\' ];\n\n\tlet cursor = 0;\n\n\tfunction read( offset ) {\n\n\t\tconst result = text[ offset - 1 ];\n\t\ttext = text.slice( cursor + offset );\n\t\tcursor ++;\n\t\treturn result;\n\n\t}\n\n\tfor ( let i = 0; i < CORRECT.length; ++ i ) {\n\n\t\tconst num = read( 1 );\n\t\tif ( num === CORRECT[ i ] ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t}\n\n\treturn true;\n\n}\n\nfunction getFbxVersion( text ) {\n\n\tconst versionRegExp = /FBXVersion: (\\d+)/;\n\tconst match = text.match( versionRegExp );\n\n\tif ( match ) {\n\n\t\tconst version = parseInt( match[ 1 ] );\n\t\treturn version;\n\n\t}\n\n\tthrow new Error( 'THREE.FBXLoader: Cannot find the version number for the file given.' );\n\n}\n\n// Converts FBX ticks into real time seconds.\nfunction convertFBXTimeToSeconds( time ) {\n\n\treturn time / 46186158000;\n\n}\n\nconst dataArray = [];\n\n// extracts the data from the correct position in the FBX array based on indexing type\nfunction getData( polygonVertexIndex, polygonIndex, vertexIndex, infoObject ) {\n\n\tlet index;\n\n\tswitch ( infoObject.mappingType ) {\n\n\t\tcase 'ByPolygonVertex' :\n\t\t\tindex = polygonVertexIndex;\n\t\t\tbreak;\n\t\tcase 'ByPolygon' :\n\t\t\tindex = polygonIndex;\n\t\t\tbreak;\n\t\tcase 'ByVertice' :\n\t\t\tindex = vertexIndex;\n\t\t\tbreak;\n\t\tcase 'AllSame' :\n\t\t\tindex = infoObject.indices[ 0 ];\n\t\t\tbreak;\n\t\tdefault :\n\t\t\tconsole.warn( 'THREE.FBXLoader: unknown attribute mapping type ' + infoObject.mappingType );\n\n\t}\n\n\tif ( infoObject.referenceType === 'IndexToDirect' ) index = infoObject.indices[ index ];\n\n\tconst from = index * infoObject.dataSize;\n\tconst to = from + infoObject.dataSize;\n\n\treturn slice( dataArray, infoObject.buffer, from, to );\n\n}\n\nconst tempEuler = new Euler();\nconst tempVec = new Vector3();\n\n// generate transformation from FBX transform data\n// ref: https://help.autodesk.com/view/FBX/2017/ENU/?guid=__files_GUID_10CDD63C_79C1_4F2D_BB28_AD2BE65A02ED_htm\n// ref: http://docs.autodesk.com/FBX/2014/ENU/FBX-SDK-Documentation/index.html?url=cpp_ref/_transformations_2main_8cxx-example.html,topicNumber=cpp_ref__transformations_2main_8cxx_example_htmlfc10a1e1-b18d-4e72-9dc0-70d0f1959f5e\nfunction generateTransform( transformData ) {\n\n\tconst lTranslationM = new Matrix4();\n\tconst lPreRotationM = new Matrix4();\n\tconst lRotationM = new Matrix4();\n\tconst lPostRotationM = new Matrix4();\n\n\tconst lScalingM = new Matrix4();\n\tconst lScalingPivotM = new Matrix4();\n\tconst lScalingOffsetM = new Matrix4();\n\tconst lRotationOffsetM = new Matrix4();\n\tconst lRotationPivotM = new Matrix4();\n\n\tconst lParentGX = new Matrix4();\n\tconst lParentLX = new Matrix4();\n\tconst lGlobalT = new Matrix4();\n\n\tconst inheritType = ( transformData.inheritType ) ? transformData.inheritType : 0;\n\n\tif ( transformData.translation ) lTranslationM.setPosition( tempVec.fromArray( transformData.translation ) );\n\n\t// For Maya models using \"Joint Orient\", Euler order only applies to rotation, not pre/post-rotations\n\tconst defaultEulerOrder = getEulerOrder( 0 );\n\n\tif ( transformData.preRotation ) {\n\n\t\tconst array = transformData.preRotation.map( MathUtils.degToRad );\n\t\tarray.push( defaultEulerOrder );\n\t\tlPreRotationM.makeRotationFromEuler( tempEuler.fromArray( array ) );\n\n\t}\n\n\tif ( transformData.rotation ) {\n\n\t\tconst array = transformData.rotation.map( MathUtils.degToRad );\n\t\tarray.push( transformData.eulerOrder || defaultEulerOrder );\n\t\tlRotationM.makeRotationFromEuler( tempEuler.fromArray( array ) );\n\n\t}\n\n\tif ( transformData.postRotation ) {\n\n\t\tconst array = transformData.postRotation.map( MathUtils.degToRad );\n\t\tarray.push( defaultEulerOrder );\n\t\tlPostRotationM.makeRotationFromEuler( tempEuler.fromArray( array ) );\n\t\tlPostRotationM.invert();\n\n\t}\n\n\tif ( transformData.scale ) lScalingM.scale( tempVec.fromArray( transformData.scale ) );\n\n\t// Pivots and offsets\n\tif ( transformData.scalingOffset ) lScalingOffsetM.setPosition( tempVec.fromArray( transformData.scalingOffset ) );\n\tif ( transformData.scalingPivot ) lScalingPivotM.setPosition( tempVec.fromArray( transformData.scalingPivot ) );\n\tif ( transformData.rotationOffset ) lRotationOffsetM.setPosition( tempVec.fromArray( transformData.rotationOffset ) );\n\tif ( transformData.rotationPivot ) lRotationPivotM.setPosition( tempVec.fromArray( transformData.rotationPivot ) );\n\n\t// parent transform\n\tif ( transformData.parentMatrixWorld ) {\n\n\t\tlParentLX.copy( transformData.parentMatrix );\n\t\tlParentGX.copy( transformData.parentMatrixWorld );\n\n\t}\n\n\tconst lLRM = lPreRotationM.clone().multiply( lRotationM ).multiply( lPostRotationM );\n\t// Global Rotation\n\tconst lParentGRM = new Matrix4();\n\tlParentGRM.extractRotation( lParentGX );\n\n\t// Global Shear*Scaling\n\tconst lParentTM = new Matrix4();\n\tlParentTM.copyPosition( lParentGX );\n\n\tconst lParentGRSM = lParentTM.clone().invert().multiply( lParentGX );\n\tconst lParentGSM = lParentGRM.clone().invert().multiply( lParentGRSM );\n\tconst lLSM = lScalingM;\n\n\tconst lGlobalRS = new Matrix4();\n\n\tif ( inheritType === 0 ) {\n\n\t\tlGlobalRS.copy( lParentGRM ).multiply( lLRM ).multiply( lParentGSM ).multiply( lLSM );\n\n\t} else if ( inheritType === 1 ) {\n\n\t\tlGlobalRS.copy( lParentGRM ).multiply( lParentGSM ).multiply( lLRM ).multiply( lLSM );\n\n\t} else {\n\n\t\tconst lParentLSM = new Matrix4().scale( new Vector3().setFromMatrixScale( lParentLX ) );\n\t\tconst lParentLSM_inv = lParentLSM.clone().invert();\n\t\tconst lParentGSM_noLocal = lParentGSM.clone().multiply( lParentLSM_inv );\n\n\t\tlGlobalRS.copy( lParentGRM ).multiply( lLRM ).multiply( lParentGSM_noLocal ).multiply( lLSM );\n\n\t}\n\n\tconst lRotationPivotM_inv = lRotationPivotM.clone().invert();\n\tconst lScalingPivotM_inv = lScalingPivotM.clone().invert();\n\t// Calculate the local transform matrix\n\tlet lTransform = lTranslationM.clone().multiply( lRotationOffsetM ).multiply( lRotationPivotM ).multiply( lPreRotationM ).multiply( lRotationM ).multiply( lPostRotationM ).multiply( lRotationPivotM_inv ).multiply( lScalingOffsetM ).multiply( lScalingPivotM ).multiply( lScalingM ).multiply( lScalingPivotM_inv );\n\n\tconst lLocalTWithAllPivotAndOffsetInfo = new Matrix4().copyPosition( lTransform );\n\n\tconst lGlobalTranslation = lParentGX.clone().multiply( lLocalTWithAllPivotAndOffsetInfo );\n\tlGlobalT.copyPosition( lGlobalTranslation );\n\n\tlTransform = lGlobalT.clone().multiply( lGlobalRS );\n\n\t// from global to local\n\tlTransform.premultiply( lParentGX.invert() );\n\n\treturn lTransform;\n\n}\n\n// Returns the three.js intrinsic Euler order corresponding to FBX extrinsic Euler order\n// ref: http://help.autodesk.com/view/FBX/2017/ENU/?guid=__cpp_ref_class_fbx_euler_html\nfunction getEulerOrder( order ) {\n\n\torder = order || 0;\n\n\tconst enums = [\n\t\t'ZYX', // -> XYZ extrinsic\n\t\t'YZX', // -> XZY extrinsic\n\t\t'XZY', // -> YZX extrinsic\n\t\t'ZXY', // -> YXZ extrinsic\n\t\t'YXZ', // -> ZXY extrinsic\n\t\t'XYZ', // -> ZYX extrinsic\n\t\t//'SphericXYZ', // not possible to support\n\t];\n\n\tif ( order === 6 ) {\n\n\t\tconsole.warn( 'THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.' );\n\t\treturn enums[ 0 ];\n\n\t}\n\n\treturn enums[ order ];\n\n}\n\n// Parses comma separated list of numbers and returns them an array.\n// Used internally by the TextParser\nfunction parseNumberArray( value ) {\n\n\tconst array = value.split( ',' ).map( function ( val ) {\n\n\t\treturn parseFloat( val );\n\n\t} );\n\n\treturn array;\n\n}\n\nfunction convertArrayBufferToString( buffer, from, to ) {\n\n\tif ( from === undefined ) from = 0;\n\tif ( to === undefined ) to = buffer.byteLength;\n\n\treturn new TextDecoder().decode( new Uint8Array( buffer, from, to ) );\n\n}\n\nfunction append( a, b ) {\n\n\tfor ( let i = 0, j = a.length, l = b.length; i < l; i ++, j ++ ) {\n\n\t\ta[ j ] = b[ i ];\n\n\t}\n\n}\n\nfunction slice( a, b, from, to ) {\n\n\tfor ( let i = from, j = 0; i < to; i ++, j ++ ) {\n\n\t\ta[ j ] = b[ i ];\n\n\t}\n\n\treturn a;\n\n}\n\n\nexport { FBXLoader };\n","import {\n\tBufferAttribute,\n\tBufferGeometry,\n\tFloat32BufferAttribute,\n\tInstancedBufferAttribute,\n\tInterleavedBuffer,\n\tInterleavedBufferAttribute,\n\tTriangleFanDrawMode,\n\tTriangleStripDrawMode,\n\tTrianglesDrawMode,\n\tVector3,\n} from 'three';\n\nfunction computeMikkTSpaceTangents( geometry, MikkTSpace, negateSign = true ) {\n\n\tif ( ! MikkTSpace || ! MikkTSpace.isReady ) {\n\n\t\tthrow new Error( 'BufferGeometryUtils: Initialized MikkTSpace library required.' );\n\n\t}\n\n\tif ( ! geometry.hasAttribute( 'position' ) || ! geometry.hasAttribute( 'normal' ) || ! geometry.hasAttribute( 'uv' ) ) {\n\n\t\tthrow new Error( 'BufferGeometryUtils: Tangents require \"position\", \"normal\", and \"uv\" attributes.' );\n\n\t}\n\n\tfunction getAttributeArray( attribute ) {\n\n\t\tif ( attribute.normalized || attribute.isInterleavedBufferAttribute ) {\n\n\t\t\tconst dstArray = new Float32Array( attribute.count * attribute.itemSize );\n\n\t\t\tfor ( let i = 0, j = 0; i < attribute.count; i ++ ) {\n\n\t\t\t\tdstArray[ j ++ ] = attribute.getX( i );\n\t\t\t\tdstArray[ j ++ ] = attribute.getY( i );\n\n\t\t\t\tif ( attribute.itemSize > 2 ) {\n\n\t\t\t\t\tdstArray[ j ++ ] = attribute.getZ( i );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn dstArray;\n\n\t\t}\n\n\t\tif ( attribute.array instanceof Float32Array ) {\n\n\t\t\treturn attribute.array;\n\n\t\t}\n\n\t\treturn new Float32Array( attribute.array );\n\n\t}\n\n\t// MikkTSpace algorithm requires non-indexed input.\n\n\tconst _geometry = geometry.index ? geometry.toNonIndexed() : geometry;\n\n\t// Compute vertex tangents.\n\n\tconst tangents = MikkTSpace.generateTangents(\n\n\t\tgetAttributeArray( _geometry.attributes.position ),\n\t\tgetAttributeArray( _geometry.attributes.normal ),\n\t\tgetAttributeArray( _geometry.attributes.uv )\n\n\t);\n\n\t// Texture coordinate convention of glTF differs from the apparent\n\t// default of the MikkTSpace library; .w component must be flipped.\n\n\tif ( negateSign ) {\n\n\t\tfor ( let i = 3; i < tangents.length; i += 4 ) {\n\n\t\t\ttangents[ i ] *= - 1;\n\n\t\t}\n\n\t}\n\n\t//\n\n\t_geometry.setAttribute( 'tangent', new BufferAttribute( tangents, 4 ) );\n\n\tif ( geometry !== _geometry ) {\n\n\t\tgeometry.copy( _geometry );\n\n\t}\n\n\treturn geometry;\n\n}\n\n/**\n * @param {Array} geometries\n * @param {Boolean} useGroups\n * @return {BufferGeometry}\n */\nfunction mergeGeometries( geometries, useGroups = false ) {\n\n\tconst isIndexed = geometries[ 0 ].index !== null;\n\n\tconst attributesUsed = new Set( Object.keys( geometries[ 0 ].attributes ) );\n\tconst morphAttributesUsed = new Set( Object.keys( geometries[ 0 ].morphAttributes ) );\n\n\tconst attributes = {};\n\tconst morphAttributes = {};\n\n\tconst morphTargetsRelative = geometries[ 0 ].morphTargetsRelative;\n\n\tconst mergedGeometry = new BufferGeometry();\n\n\tlet offset = 0;\n\n\tfor ( let i = 0; i < geometries.length; ++ i ) {\n\n\t\tconst geometry = geometries[ i ];\n\t\tlet attributesCount = 0;\n\n\t\t// ensure that all geometries are indexed, or none\n\n\t\tif ( isIndexed !== ( geometry.index !== null ) ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index ' + i + '. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// gather attributes, exit early if they're different\n\n\t\tfor ( const name in geometry.attributes ) {\n\n\t\t\tif ( ! attributesUsed.has( name ) ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index ' + i + '. All geometries must have compatible attributes; make sure \"' + name + '\" attribute exists among all geometries, or in none of them.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tif ( attributes[ name ] === undefined ) attributes[ name ] = [];\n\n\t\t\tattributes[ name ].push( geometry.attributes[ name ] );\n\n\t\t\tattributesCount ++;\n\n\t\t}\n\n\t\t// ensure geometries have the same number of attributes\n\n\t\tif ( attributesCount !== attributesUsed.size ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index ' + i + '. Make sure all geometries have the same number of attributes.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// gather morph attributes, exit early if they're different\n\n\t\tif ( morphTargetsRelative !== geometry.morphTargetsRelative ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index ' + i + '. .morphTargetsRelative must be consistent throughout all geometries.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tfor ( const name in geometry.morphAttributes ) {\n\n\t\t\tif ( ! morphAttributesUsed.has( name ) ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index ' + i + '. .morphAttributes must be consistent throughout all geometries.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tif ( morphAttributes[ name ] === undefined ) morphAttributes[ name ] = [];\n\n\t\t\tmorphAttributes[ name ].push( geometry.morphAttributes[ name ] );\n\n\t\t}\n\n\t\tif ( useGroups ) {\n\n\t\t\tlet count;\n\n\t\t\tif ( isIndexed ) {\n\n\t\t\t\tcount = geometry.index.count;\n\n\t\t\t} else if ( geometry.attributes.position !== undefined ) {\n\n\t\t\t\tcount = geometry.attributes.position.count;\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index ' + i + '. The geometry must have either an index or a position attribute' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tmergedGeometry.addGroup( offset, count, i );\n\n\t\t\toffset += count;\n\n\t\t}\n\n\t}\n\n\t// merge indices\n\n\tif ( isIndexed ) {\n\n\t\tlet indexOffset = 0;\n\t\tconst mergedIndex = [];\n\n\t\tfor ( let i = 0; i < geometries.length; ++ i ) {\n\n\t\t\tconst index = geometries[ i ].index;\n\n\t\t\tfor ( let j = 0; j < index.count; ++ j ) {\n\n\t\t\t\tmergedIndex.push( index.getX( j ) + indexOffset );\n\n\t\t\t}\n\n\t\t\tindexOffset += geometries[ i ].attributes.position.count;\n\n\t\t}\n\n\t\tmergedGeometry.setIndex( mergedIndex );\n\n\t}\n\n\t// merge attributes\n\n\tfor ( const name in attributes ) {\n\n\t\tconst mergedAttribute = mergeAttributes( attributes[ name ] );\n\n\t\tif ( ! mergedAttribute ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the ' + name + ' attribute.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tmergedGeometry.setAttribute( name, mergedAttribute );\n\n\t}\n\n\t// merge morph attributes\n\n\tfor ( const name in morphAttributes ) {\n\n\t\tconst numMorphTargets = morphAttributes[ name ][ 0 ].length;\n\n\t\tif ( numMorphTargets === 0 ) break;\n\n\t\tmergedGeometry.morphAttributes = mergedGeometry.morphAttributes || {};\n\t\tmergedGeometry.morphAttributes[ name ] = [];\n\n\t\tfor ( let i = 0; i < numMorphTargets; ++ i ) {\n\n\t\t\tconst morphAttributesToMerge = [];\n\n\t\t\tfor ( let j = 0; j < morphAttributes[ name ].length; ++ j ) {\n\n\t\t\t\tmorphAttributesToMerge.push( morphAttributes[ name ][ j ][ i ] );\n\n\t\t\t}\n\n\t\t\tconst mergedMorphAttribute = mergeAttributes( morphAttributesToMerge );\n\n\t\t\tif ( ! mergedMorphAttribute ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the ' + name + ' morphAttribute.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tmergedGeometry.morphAttributes[ name ].push( mergedMorphAttribute );\n\n\t\t}\n\n\t}\n\n\treturn mergedGeometry;\n\n}\n\n/**\n * @param {Array} attributes\n * @return {BufferAttribute}\n */\nfunction mergeAttributes( attributes ) {\n\n\tlet TypedArray;\n\tlet itemSize;\n\tlet normalized;\n\tlet gpuType = - 1;\n\tlet arrayLength = 0;\n\n\tfor ( let i = 0; i < attributes.length; ++ i ) {\n\n\t\tconst attribute = attributes[ i ];\n\n\t\tif ( TypedArray === undefined ) TypedArray = attribute.array.constructor;\n\t\tif ( TypedArray !== attribute.array.constructor ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tif ( itemSize === undefined ) itemSize = attribute.itemSize;\n\t\tif ( itemSize !== attribute.itemSize ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tif ( normalized === undefined ) normalized = attribute.normalized;\n\t\tif ( normalized !== attribute.normalized ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tif ( gpuType === - 1 ) gpuType = attribute.gpuType;\n\t\tif ( gpuType !== attribute.gpuType ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tarrayLength += attribute.count * itemSize;\n\n\t}\n\n\tconst array = new TypedArray( arrayLength );\n\tconst result = new BufferAttribute( array, itemSize, normalized );\n\tlet offset = 0;\n\n\tfor ( let i = 0; i < attributes.length; ++ i ) {\n\n\t\tconst attribute = attributes[ i ];\n\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\tconst tupleOffset = offset / itemSize;\n\t\t\tfor ( let j = 0, l = attribute.count; j < l; j ++ ) {\n\n\t\t\t\tfor ( let c = 0; c < itemSize; c ++ ) {\n\n\t\t\t\t\tconst value = attribute.getComponent( j, c );\n\t\t\t\t\tresult.setComponent( j + tupleOffset, c, value );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tarray.set( attribute.array, offset );\n\n\t\t}\n\n\t\toffset += attribute.count * itemSize;\n\n\t}\n\n\tif ( gpuType !== undefined ) {\n\n\t\tresult.gpuType = gpuType;\n\n\t}\n\n\treturn result;\n\n}\n\n/**\n * @param {BufferAttribute}\n * @return {BufferAttribute}\n */\nexport function deepCloneAttribute( attribute ) {\n\n\tif ( attribute.isInstancedInterleavedBufferAttribute || attribute.isInterleavedBufferAttribute ) {\n\n\t\treturn deinterleaveAttribute( attribute );\n\n\t}\n\n\tif ( attribute.isInstancedBufferAttribute ) {\n\n\t\treturn new InstancedBufferAttribute().copy( attribute );\n\n\t}\n\n\treturn new BufferAttribute().copy( attribute );\n\n}\n\n/**\n * @param {Array} attributes\n * @return {Array}\n */\nfunction interleaveAttributes( attributes ) {\n\n\t// Interleaves the provided attributes into an InterleavedBuffer and returns\n\t// a set of InterleavedBufferAttributes for each attribute\n\tlet TypedArray;\n\tlet arrayLength = 0;\n\tlet stride = 0;\n\n\t// calculate the length and type of the interleavedBuffer\n\tfor ( let i = 0, l = attributes.length; i < l; ++ i ) {\n\n\t\tconst attribute = attributes[ i ];\n\n\t\tif ( TypedArray === undefined ) TypedArray = attribute.array.constructor;\n\t\tif ( TypedArray !== attribute.array.constructor ) {\n\n\t\t\tconsole.error( 'AttributeBuffers of different types cannot be interleaved' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tarrayLength += attribute.array.length;\n\t\tstride += attribute.itemSize;\n\n\t}\n\n\t// Create the set of buffer attributes\n\tconst interleavedBuffer = new InterleavedBuffer( new TypedArray( arrayLength ), stride );\n\tlet offset = 0;\n\tconst res = [];\n\tconst getters = [ 'getX', 'getY', 'getZ', 'getW' ];\n\tconst setters = [ 'setX', 'setY', 'setZ', 'setW' ];\n\n\tfor ( let j = 0, l = attributes.length; j < l; j ++ ) {\n\n\t\tconst attribute = attributes[ j ];\n\t\tconst itemSize = attribute.itemSize;\n\t\tconst count = attribute.count;\n\t\tconst iba = new InterleavedBufferAttribute( interleavedBuffer, itemSize, offset, attribute.normalized );\n\t\tres.push( iba );\n\n\t\toffset += itemSize;\n\n\t\t// Move the data for each attribute into the new interleavedBuffer\n\t\t// at the appropriate offset\n\t\tfor ( let c = 0; c < count; c ++ ) {\n\n\t\t\tfor ( let k = 0; k < itemSize; k ++ ) {\n\n\t\t\t\tiba[ setters[ k ] ]( c, attribute[ getters[ k ] ]( c ) );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn res;\n\n}\n\n// returns a new, non-interleaved version of the provided attribute\nexport function deinterleaveAttribute( attribute ) {\n\n\tconst cons = attribute.data.array.constructor;\n\tconst count = attribute.count;\n\tconst itemSize = attribute.itemSize;\n\tconst normalized = attribute.normalized;\n\n\tconst array = new cons( count * itemSize );\n\tlet newAttribute;\n\tif ( attribute.isInstancedInterleavedBufferAttribute ) {\n\n\t\tnewAttribute = new InstancedBufferAttribute( array, itemSize, normalized, attribute.meshPerAttribute );\n\n\t} else {\n\n\t\tnewAttribute = new BufferAttribute( array, itemSize, normalized );\n\n\t}\n\n\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\tnewAttribute.setX( i, attribute.getX( i ) );\n\n\t\tif ( itemSize >= 2 ) {\n\n\t\t\tnewAttribute.setY( i, attribute.getY( i ) );\n\n\t\t}\n\n\t\tif ( itemSize >= 3 ) {\n\n\t\t\tnewAttribute.setZ( i, attribute.getZ( i ) );\n\n\t\t}\n\n\t\tif ( itemSize >= 4 ) {\n\n\t\t\tnewAttribute.setW( i, attribute.getW( i ) );\n\n\t\t}\n\n\t}\n\n\treturn newAttribute;\n\n}\n\n// deinterleaves all attributes on the geometry\nexport function deinterleaveGeometry( geometry ) {\n\n\tconst attributes = geometry.attributes;\n\tconst morphTargets = geometry.morphTargets;\n\tconst attrMap = new Map();\n\n\tfor ( const key in attributes ) {\n\n\t\tconst attr = attributes[ key ];\n\t\tif ( attr.isInterleavedBufferAttribute ) {\n\n\t\t\tif ( ! attrMap.has( attr ) ) {\n\n\t\t\t\tattrMap.set( attr, deinterleaveAttribute( attr ) );\n\n\t\t\t}\n\n\t\t\tattributes[ key ] = attrMap.get( attr );\n\n\t\t}\n\n\t}\n\n\tfor ( const key in morphTargets ) {\n\n\t\tconst attr = morphTargets[ key ];\n\t\tif ( attr.isInterleavedBufferAttribute ) {\n\n\t\t\tif ( ! attrMap.has( attr ) ) {\n\n\t\t\t\tattrMap.set( attr, deinterleaveAttribute( attr ) );\n\n\t\t\t}\n\n\t\t\tmorphTargets[ key ] = attrMap.get( attr );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * @param {BufferGeometry} geometry\n * @return {number}\n */\nfunction estimateBytesUsed( geometry ) {\n\n\t// Return the estimated memory used by this geometry in bytes\n\t// Calculate using itemSize, count, and BYTES_PER_ELEMENT to account\n\t// for InterleavedBufferAttributes.\n\tlet mem = 0;\n\tfor ( const name in geometry.attributes ) {\n\n\t\tconst attr = geometry.getAttribute( name );\n\t\tmem += attr.count * attr.itemSize * attr.array.BYTES_PER_ELEMENT;\n\n\t}\n\n\tconst indices = geometry.getIndex();\n\tmem += indices ? indices.count * indices.itemSize * indices.array.BYTES_PER_ELEMENT : 0;\n\treturn mem;\n\n}\n\n/**\n * @param {BufferGeometry} geometry\n * @param {number} tolerance\n * @return {BufferGeometry}\n */\nfunction mergeVertices( geometry, tolerance = 1e-4 ) {\n\n\ttolerance = Math.max( tolerance, Number.EPSILON );\n\n\t// Generate an index buffer if the geometry doesn't have one, or optimize it\n\t// if it's already available.\n\tconst hashToIndex = {};\n\tconst indices = geometry.getIndex();\n\tconst positions = geometry.getAttribute( 'position' );\n\tconst vertexCount = indices ? indices.count : positions.count;\n\n\t// next value for triangle indices\n\tlet nextIndex = 0;\n\n\t// attributes and new attribute arrays\n\tconst attributeNames = Object.keys( geometry.attributes );\n\tconst tmpAttributes = {};\n\tconst tmpMorphAttributes = {};\n\tconst newIndices = [];\n\tconst getters = [ 'getX', 'getY', 'getZ', 'getW' ];\n\tconst setters = [ 'setX', 'setY', 'setZ', 'setW' ];\n\n\t// Initialize the arrays, allocating space conservatively. Extra\n\t// space will be trimmed in the last step.\n\tfor ( let i = 0, l = attributeNames.length; i < l; i ++ ) {\n\n\t\tconst name = attributeNames[ i ];\n\t\tconst attr = geometry.attributes[ name ];\n\n\t\ttmpAttributes[ name ] = new attr.constructor(\n\t\t\tnew attr.array.constructor( attr.count * attr.itemSize ),\n\t\t\tattr.itemSize,\n\t\t\tattr.normalized\n\t\t);\n\n\t\tconst morphAttributes = geometry.morphAttributes[ name ];\n\t\tif ( morphAttributes ) {\n\n\t\t\tif ( ! tmpMorphAttributes[ name ] ) tmpMorphAttributes[ name ] = [];\n\t\t\tmorphAttributes.forEach( ( morphAttr, i ) => {\n\n\t\t\t\tconst array = new morphAttr.array.constructor( morphAttr.count * morphAttr.itemSize );\n\t\t\t\ttmpMorphAttributes[ name ][ i ] = new morphAttr.constructor( array, morphAttr.itemSize, morphAttr.normalized );\n\n\t\t\t} );\n\n\t\t}\n\n\t}\n\n\t// convert the error tolerance to an amount of decimal places to truncate to\n\tconst halfTolerance = tolerance * 0.5;\n\tconst exponent = Math.log10( 1 / tolerance );\n\tconst hashMultiplier = Math.pow( 10, exponent );\n\tconst hashAdditive = halfTolerance * hashMultiplier;\n\tfor ( let i = 0; i < vertexCount; i ++ ) {\n\n\t\tconst index = indices ? indices.getX( i ) : i;\n\n\t\t// Generate a hash for the vertex attributes at the current index 'i'\n\t\tlet hash = '';\n\t\tfor ( let j = 0, l = attributeNames.length; j < l; j ++ ) {\n\n\t\t\tconst name = attributeNames[ j ];\n\t\t\tconst attribute = geometry.getAttribute( name );\n\t\t\tconst itemSize = attribute.itemSize;\n\n\t\t\tfor ( let k = 0; k < itemSize; k ++ ) {\n\n\t\t\t\t// double tilde truncates the decimal value\n\t\t\t\thash += `${ ~ ~ ( attribute[ getters[ k ] ]( index ) * hashMultiplier + hashAdditive ) },`;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Add another reference to the vertex if it's already\n\t\t// used by another index\n\t\tif ( hash in hashToIndex ) {\n\n\t\t\tnewIndices.push( hashToIndex[ hash ] );\n\n\t\t} else {\n\n\t\t\t// copy data to the new index in the temporary attributes\n\t\t\tfor ( let j = 0, l = attributeNames.length; j < l; j ++ ) {\n\n\t\t\t\tconst name = attributeNames[ j ];\n\t\t\t\tconst attribute = geometry.getAttribute( name );\n\t\t\t\tconst morphAttributes = geometry.morphAttributes[ name ];\n\t\t\t\tconst itemSize = attribute.itemSize;\n\t\t\t\tconst newArray = tmpAttributes[ name ];\n\t\t\t\tconst newMorphArrays = tmpMorphAttributes[ name ];\n\n\t\t\t\tfor ( let k = 0; k < itemSize; k ++ ) {\n\n\t\t\t\t\tconst getterFunc = getters[ k ];\n\t\t\t\t\tconst setterFunc = setters[ k ];\n\t\t\t\t\tnewArray[ setterFunc ]( nextIndex, attribute[ getterFunc ]( index ) );\n\n\t\t\t\t\tif ( morphAttributes ) {\n\n\t\t\t\t\t\tfor ( let m = 0, ml = morphAttributes.length; m < ml; m ++ ) {\n\n\t\t\t\t\t\t\tnewMorphArrays[ m ][ setterFunc ]( nextIndex, morphAttributes[ m ][ getterFunc ]( index ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\thashToIndex[ hash ] = nextIndex;\n\t\t\tnewIndices.push( nextIndex );\n\t\t\tnextIndex ++;\n\n\t\t}\n\n\t}\n\n\t// generate result BufferGeometry\n\tconst result = geometry.clone();\n\tfor ( const name in geometry.attributes ) {\n\n\t\tconst tmpAttribute = tmpAttributes[ name ];\n\n\t\tresult.setAttribute( name, new tmpAttribute.constructor(\n\t\t\ttmpAttribute.array.slice( 0, nextIndex * tmpAttribute.itemSize ),\n\t\t\ttmpAttribute.itemSize,\n\t\t\ttmpAttribute.normalized,\n\t\t) );\n\n\t\tif ( ! ( name in tmpMorphAttributes ) ) continue;\n\n\t\tfor ( let j = 0; j < tmpMorphAttributes[ name ].length; j ++ ) {\n\n\t\t\tconst tmpMorphAttribute = tmpMorphAttributes[ name ][ j ];\n\n\t\t\tresult.morphAttributes[ name ][ j ] = new tmpMorphAttribute.constructor(\n\t\t\t\ttmpMorphAttribute.array.slice( 0, nextIndex * tmpMorphAttribute.itemSize ),\n\t\t\t\ttmpMorphAttribute.itemSize,\n\t\t\t\ttmpMorphAttribute.normalized,\n\t\t\t);\n\n\t\t}\n\n\t}\n\n\t// indices\n\n\tresult.setIndex( newIndices );\n\n\treturn result;\n\n}\n\n/**\n * @param {BufferGeometry} geometry\n * @param {number} drawMode\n * @return {BufferGeometry}\n */\nfunction toTrianglesDrawMode( geometry, drawMode ) {\n\n\tif ( drawMode === TrianglesDrawMode ) {\n\n\t\tconsole.warn( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.' );\n\t\treturn geometry;\n\n\t}\n\n\tif ( drawMode === TriangleFanDrawMode || drawMode === TriangleStripDrawMode ) {\n\n\t\tlet index = geometry.getIndex();\n\n\t\t// generate index if not present\n\n\t\tif ( index === null ) {\n\n\t\t\tconst indices = [];\n\n\t\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\t\tif ( position !== undefined ) {\n\n\t\t\t\tfor ( let i = 0; i < position.count; i ++ ) {\n\n\t\t\t\t\tindices.push( i );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.setIndex( indices );\n\t\t\t\tindex = geometry.getIndex();\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.' );\n\t\t\t\treturn geometry;\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tconst numberOfTriangles = index.count - 2;\n\t\tconst newIndices = [];\n\n\t\tif ( drawMode === TriangleFanDrawMode ) {\n\n\t\t\t// gl.TRIANGLE_FAN\n\n\t\t\tfor ( let i = 1; i <= numberOfTriangles; i ++ ) {\n\n\t\t\t\tnewIndices.push( index.getX( 0 ) );\n\t\t\t\tnewIndices.push( index.getX( i ) );\n\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// gl.TRIANGLE_STRIP\n\n\t\t\tfor ( let i = 0; i < numberOfTriangles; i ++ ) {\n\n\t\t\t\tif ( i % 2 === 0 ) {\n\n\t\t\t\t\tnewIndices.push( index.getX( i ) );\n\t\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\t\t\t\t\tnewIndices.push( index.getX( i + 2 ) );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tnewIndices.push( index.getX( i + 2 ) );\n\t\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\t\t\t\t\tnewIndices.push( index.getX( i ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( ( newIndices.length / 3 ) !== numberOfTriangles ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.' );\n\n\t\t}\n\n\t\t// build final geometry\n\n\t\tconst newGeometry = geometry.clone();\n\t\tnewGeometry.setIndex( newIndices );\n\t\tnewGeometry.clearGroups();\n\n\t\treturn newGeometry;\n\n\t} else {\n\n\t\tconsole.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:', drawMode );\n\t\treturn geometry;\n\n\t}\n\n}\n\n/**\n * Calculates the morphed attributes of a morphed/skinned BufferGeometry.\n * Helpful for Raytracing or Decals.\n * @param {Mesh | Line | Points} object An instance of Mesh, Line or Points.\n * @return {Object} An Object with original position/normal attributes and morphed ones.\n */\nfunction computeMorphedAttributes( object ) {\n\n\tconst _vA = new Vector3();\n\tconst _vB = new Vector3();\n\tconst _vC = new Vector3();\n\n\tconst _tempA = new Vector3();\n\tconst _tempB = new Vector3();\n\tconst _tempC = new Vector3();\n\n\tconst _morphA = new Vector3();\n\tconst _morphB = new Vector3();\n\tconst _morphC = new Vector3();\n\n\tfunction _calculateMorphedAttributeData(\n\t\tobject,\n\t\tattribute,\n\t\tmorphAttribute,\n\t\tmorphTargetsRelative,\n\t\ta,\n\t\tb,\n\t\tc,\n\t\tmodifiedAttributeArray\n\t) {\n\n\t\t_vA.fromBufferAttribute( attribute, a );\n\t\t_vB.fromBufferAttribute( attribute, b );\n\t\t_vC.fromBufferAttribute( attribute, c );\n\n\t\tconst morphInfluences = object.morphTargetInfluences;\n\n\t\tif ( morphAttribute && morphInfluences ) {\n\n\t\t\t_morphA.set( 0, 0, 0 );\n\t\t\t_morphB.set( 0, 0, 0 );\n\t\t\t_morphC.set( 0, 0, 0 );\n\n\t\t\tfor ( let i = 0, il = morphAttribute.length; i < il; i ++ ) {\n\n\t\t\t\tconst influence = morphInfluences[ i ];\n\t\t\t\tconst morph = morphAttribute[ i ];\n\n\t\t\t\tif ( influence === 0 ) continue;\n\n\t\t\t\t_tempA.fromBufferAttribute( morph, a );\n\t\t\t\t_tempB.fromBufferAttribute( morph, b );\n\t\t\t\t_tempC.fromBufferAttribute( morph, c );\n\n\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA, influence );\n\t\t\t\t\t_morphB.addScaledVector( _tempB, influence );\n\t\t\t\t\t_morphC.addScaledVector( _tempC, influence );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA.sub( _vA ), influence );\n\t\t\t\t\t_morphB.addScaledVector( _tempB.sub( _vB ), influence );\n\t\t\t\t\t_morphC.addScaledVector( _tempC.sub( _vC ), influence );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_vA.add( _morphA );\n\t\t\t_vB.add( _morphB );\n\t\t\t_vC.add( _morphC );\n\n\t\t}\n\n\t\tif ( object.isSkinnedMesh ) {\n\n\t\t\tobject.applyBoneTransform( a, _vA );\n\t\t\tobject.applyBoneTransform( b, _vB );\n\t\t\tobject.applyBoneTransform( c, _vC );\n\n\t\t}\n\n\t\tmodifiedAttributeArray[ a * 3 + 0 ] = _vA.x;\n\t\tmodifiedAttributeArray[ a * 3 + 1 ] = _vA.y;\n\t\tmodifiedAttributeArray[ a * 3 + 2 ] = _vA.z;\n\t\tmodifiedAttributeArray[ b * 3 + 0 ] = _vB.x;\n\t\tmodifiedAttributeArray[ b * 3 + 1 ] = _vB.y;\n\t\tmodifiedAttributeArray[ b * 3 + 2 ] = _vB.z;\n\t\tmodifiedAttributeArray[ c * 3 + 0 ] = _vC.x;\n\t\tmodifiedAttributeArray[ c * 3 + 1 ] = _vC.y;\n\t\tmodifiedAttributeArray[ c * 3 + 2 ] = _vC.z;\n\n\t}\n\n\tconst geometry = object.geometry;\n\tconst material = object.material;\n\n\tlet a, b, c;\n\tconst index = geometry.index;\n\tconst positionAttribute = geometry.attributes.position;\n\tconst morphPosition = geometry.morphAttributes.position;\n\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\tconst normalAttribute = geometry.attributes.normal;\n\tconst morphNormal = geometry.morphAttributes.position;\n\n\tconst groups = geometry.groups;\n\tconst drawRange = geometry.drawRange;\n\tlet i, j, il, jl;\n\tlet group;\n\tlet start, end;\n\n\tconst modifiedPosition = new Float32Array( positionAttribute.count * positionAttribute.itemSize );\n\tconst modifiedNormal = new Float32Array( normalAttribute.count * normalAttribute.itemSize );\n\n\tif ( index !== null ) {\n\n\t\t// indexed buffer geometry\n\n\t\tif ( Array.isArray( material ) ) {\n\n\t\t\tfor ( i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\tgroup = groups[ i ];\n\n\t\t\t\tstart = Math.max( group.start, drawRange.start );\n\t\t\t\tend = Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\ta = index.getX( j );\n\t\t\t\t\tb = index.getX( j + 1 );\n\t\t\t\t\tc = index.getX( j + 2 );\n\n\t\t\t\t\t_calculateMorphedAttributeData(\n\t\t\t\t\t\tobject,\n\t\t\t\t\t\tpositionAttribute,\n\t\t\t\t\t\tmorphPosition,\n\t\t\t\t\t\tmorphTargetsRelative,\n\t\t\t\t\t\ta, b, c,\n\t\t\t\t\t\tmodifiedPosition\n\t\t\t\t\t);\n\n\t\t\t\t\t_calculateMorphedAttributeData(\n\t\t\t\t\t\tobject,\n\t\t\t\t\t\tnormalAttribute,\n\t\t\t\t\t\tmorphNormal,\n\t\t\t\t\t\tmorphTargetsRelative,\n\t\t\t\t\t\ta, b, c,\n\t\t\t\t\t\tmodifiedNormal\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tstart = Math.max( 0, drawRange.start );\n\t\t\tend = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\ta = index.getX( i );\n\t\t\t\tb = index.getX( i + 1 );\n\t\t\t\tc = index.getX( i + 2 );\n\n\t\t\t\t_calculateMorphedAttributeData(\n\t\t\t\t\tobject,\n\t\t\t\t\tpositionAttribute,\n\t\t\t\t\tmorphPosition,\n\t\t\t\t\tmorphTargetsRelative,\n\t\t\t\t\ta, b, c,\n\t\t\t\t\tmodifiedPosition\n\t\t\t\t);\n\n\t\t\t\t_calculateMorphedAttributeData(\n\t\t\t\t\tobject,\n\t\t\t\t\tnormalAttribute,\n\t\t\t\t\tmorphNormal,\n\t\t\t\t\tmorphTargetsRelative,\n\t\t\t\t\ta, b, c,\n\t\t\t\t\tmodifiedNormal\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t} else {\n\n\t\t// non-indexed buffer geometry\n\n\t\tif ( Array.isArray( material ) ) {\n\n\t\t\tfor ( i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\tgroup = groups[ i ];\n\n\t\t\t\tstart = Math.max( group.start, drawRange.start );\n\t\t\t\tend = Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\ta = j;\n\t\t\t\t\tb = j + 1;\n\t\t\t\t\tc = j + 2;\n\n\t\t\t\t\t_calculateMorphedAttributeData(\n\t\t\t\t\t\tobject,\n\t\t\t\t\t\tpositionAttribute,\n\t\t\t\t\t\tmorphPosition,\n\t\t\t\t\t\tmorphTargetsRelative,\n\t\t\t\t\t\ta, b, c,\n\t\t\t\t\t\tmodifiedPosition\n\t\t\t\t\t);\n\n\t\t\t\t\t_calculateMorphedAttributeData(\n\t\t\t\t\t\tobject,\n\t\t\t\t\t\tnormalAttribute,\n\t\t\t\t\t\tmorphNormal,\n\t\t\t\t\t\tmorphTargetsRelative,\n\t\t\t\t\t\ta, b, c,\n\t\t\t\t\t\tmodifiedNormal\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tstart = Math.max( 0, drawRange.start );\n\t\t\tend = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\ta = i;\n\t\t\t\tb = i + 1;\n\t\t\t\tc = i + 2;\n\n\t\t\t\t_calculateMorphedAttributeData(\n\t\t\t\t\tobject,\n\t\t\t\t\tpositionAttribute,\n\t\t\t\t\tmorphPosition,\n\t\t\t\t\tmorphTargetsRelative,\n\t\t\t\t\ta, b, c,\n\t\t\t\t\tmodifiedPosition\n\t\t\t\t);\n\n\t\t\t\t_calculateMorphedAttributeData(\n\t\t\t\t\tobject,\n\t\t\t\t\tnormalAttribute,\n\t\t\t\t\tmorphNormal,\n\t\t\t\t\tmorphTargetsRelative,\n\t\t\t\t\ta, b, c,\n\t\t\t\t\tmodifiedNormal\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tconst morphedPositionAttribute = new Float32BufferAttribute( modifiedPosition, 3 );\n\tconst morphedNormalAttribute = new Float32BufferAttribute( modifiedNormal, 3 );\n\n\treturn {\n\n\t\tpositionAttribute: positionAttribute,\n\t\tnormalAttribute: normalAttribute,\n\t\tmorphedPositionAttribute: morphedPositionAttribute,\n\t\tmorphedNormalAttribute: morphedNormalAttribute\n\n\t};\n\n}\n\nfunction mergeGroups( geometry ) {\n\n\tif ( geometry.groups.length === 0 ) {\n\n\t\tconsole.warn( 'THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge.' );\n\t\treturn geometry;\n\n\t}\n\n\tlet groups = geometry.groups;\n\n\t// sort groups by material index\n\n\tgroups = groups.sort( ( a, b ) => {\n\n\t\tif ( a.materialIndex !== b.materialIndex ) return a.materialIndex - b.materialIndex;\n\n\t\treturn a.start - b.start;\n\n\t} );\n\n\t// create index for non-indexed geometries\n\n\tif ( geometry.getIndex() === null ) {\n\n\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\t\tconst indices = [];\n\n\t\tfor ( let i = 0; i < positionAttribute.count; i += 3 ) {\n\n\t\t\tindices.push( i, i + 1, i + 2 );\n\n\t\t}\n\n\t\tgeometry.setIndex( indices );\n\n\t}\n\n\t// sort index\n\n\tconst index = geometry.getIndex();\n\n\tconst newIndices = [];\n\n\tfor ( let i = 0; i < groups.length; i ++ ) {\n\n\t\tconst group = groups[ i ];\n\n\t\tconst groupStart = group.start;\n\t\tconst groupLength = groupStart + group.count;\n\n\t\tfor ( let j = groupStart; j < groupLength; j ++ ) {\n\n\t\t\tnewIndices.push( index.getX( j ) );\n\n\t\t}\n\n\t}\n\n\tgeometry.dispose(); // Required to force buffer recreation\n\tgeometry.setIndex( newIndices );\n\n\t// update groups indices\n\n\tlet start = 0;\n\n\tfor ( let i = 0; i < groups.length; i ++ ) {\n\n\t\tconst group = groups[ i ];\n\n\t\tgroup.start = start;\n\t\tstart += group.count;\n\n\t}\n\n\t// merge groups\n\n\tlet currentGroup = groups[ 0 ];\n\n\tgeometry.groups = [ currentGroup ];\n\n\tfor ( let i = 1; i < groups.length; i ++ ) {\n\n\t\tconst group = groups[ i ];\n\n\t\tif ( currentGroup.materialIndex === group.materialIndex ) {\n\n\t\t\tcurrentGroup.count += group.count;\n\n\t\t} else {\n\n\t\t\tcurrentGroup = group;\n\t\t\tgeometry.groups.push( currentGroup );\n\n\t\t}\n\n\t}\n\n\treturn geometry;\n\n}\n\n\n/**\n * Modifies the supplied geometry if it is non-indexed, otherwise creates a new,\n * non-indexed geometry. Returns the geometry with smooth normals everywhere except\n * faces that meet at an angle greater than the crease angle.\n *\n * @param {BufferGeometry} geometry\n * @param {number} [creaseAngle]\n * @return {BufferGeometry}\n */\nfunction toCreasedNormals( geometry, creaseAngle = Math.PI / 3 /* 60 degrees */ ) {\n\n\tconst creaseDot = Math.cos( creaseAngle );\n\tconst hashMultiplier = ( 1 + 1e-10 ) * 1e2;\n\n\t// reusable vectors\n\tconst verts = [ new Vector3(), new Vector3(), new Vector3() ];\n\tconst tempVec1 = new Vector3();\n\tconst tempVec2 = new Vector3();\n\tconst tempNorm = new Vector3();\n\tconst tempNorm2 = new Vector3();\n\n\t// hashes a vector\n\tfunction hashVertex( v ) {\n\n\t\tconst x = ~ ~ ( v.x * hashMultiplier );\n\t\tconst y = ~ ~ ( v.y * hashMultiplier );\n\t\tconst z = ~ ~ ( v.z * hashMultiplier );\n\t\treturn `${x},${y},${z}`;\n\n\t}\n\n\t// BufferGeometry.toNonIndexed() warns if the geometry is non-indexed\n\t// and returns the original geometry\n\tconst resultGeometry = geometry.index ? geometry.toNonIndexed() : geometry;\n\tconst posAttr = resultGeometry.attributes.position;\n\tconst vertexMap = {};\n\n\t// find all the normals shared by commonly located vertices\n\tfor ( let i = 0, l = posAttr.count / 3; i < l; i ++ ) {\n\n\t\tconst i3 = 3 * i;\n\t\tconst a = verts[ 0 ].fromBufferAttribute( posAttr, i3 + 0 );\n\t\tconst b = verts[ 1 ].fromBufferAttribute( posAttr, i3 + 1 );\n\t\tconst c = verts[ 2 ].fromBufferAttribute( posAttr, i3 + 2 );\n\n\t\ttempVec1.subVectors( c, b );\n\t\ttempVec2.subVectors( a, b );\n\n\t\t// add the normal to the map for all vertices\n\t\tconst normal = new Vector3().crossVectors( tempVec1, tempVec2 ).normalize();\n\t\tfor ( let n = 0; n < 3; n ++ ) {\n\n\t\t\tconst vert = verts[ n ];\n\t\t\tconst hash = hashVertex( vert );\n\t\t\tif ( ! ( hash in vertexMap ) ) {\n\n\t\t\t\tvertexMap[ hash ] = [];\n\n\t\t\t}\n\n\t\t\tvertexMap[ hash ].push( normal );\n\n\t\t}\n\n\t}\n\n\t// average normals from all vertices that share a common location if they are within the\n\t// provided crease threshold\n\tconst normalArray = new Float32Array( posAttr.count * 3 );\n\tconst normAttr = new BufferAttribute( normalArray, 3, false );\n\tfor ( let i = 0, l = posAttr.count / 3; i < l; i ++ ) {\n\n\t\t// get the face normal for this vertex\n\t\tconst i3 = 3 * i;\n\t\tconst a = verts[ 0 ].fromBufferAttribute( posAttr, i3 + 0 );\n\t\tconst b = verts[ 1 ].fromBufferAttribute( posAttr, i3 + 1 );\n\t\tconst c = verts[ 2 ].fromBufferAttribute( posAttr, i3 + 2 );\n\n\t\ttempVec1.subVectors( c, b );\n\t\ttempVec2.subVectors( a, b );\n\n\t\ttempNorm.crossVectors( tempVec1, tempVec2 ).normalize();\n\n\t\t// average all normals that meet the threshold and set the normal value\n\t\tfor ( let n = 0; n < 3; n ++ ) {\n\n\t\t\tconst vert = verts[ n ];\n\t\t\tconst hash = hashVertex( vert );\n\t\t\tconst otherNormals = vertexMap[ hash ];\n\t\t\ttempNorm2.set( 0, 0, 0 );\n\n\t\t\tfor ( let k = 0, lk = otherNormals.length; k < lk; k ++ ) {\n\n\t\t\t\tconst otherNorm = otherNormals[ k ];\n\t\t\t\tif ( tempNorm.dot( otherNorm ) > creaseDot ) {\n\n\t\t\t\t\ttempNorm2.add( otherNorm );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\ttempNorm2.normalize();\n\t\t\tnormAttr.setXYZ( i3 + n, tempNorm2.x, tempNorm2.y, tempNorm2.z );\n\n\t\t}\n\n\t}\n\n\tresultGeometry.setAttribute( 'normal', normAttr );\n\treturn resultGeometry;\n\n}\n\nexport {\n\tcomputeMikkTSpaceTangents,\n\tmergeGeometries,\n\tmergeAttributes,\n\tinterleaveAttributes,\n\testimateBytesUsed,\n\tmergeVertices,\n\ttoTrianglesDrawMode,\n\tcomputeMorphedAttributes,\n\tmergeGroups,\n\ttoCreasedNormals\n};\n","import {\n\tAnimationClip,\n\tBone,\n\tBox3,\n\tBufferAttribute,\n\tBufferGeometry,\n\tClampToEdgeWrapping,\n\tColor,\n\tColorManagement,\n\tDirectionalLight,\n\tDoubleSide,\n\tFileLoader,\n\tFrontSide,\n\tGroup,\n\tImageBitmapLoader,\n\tInstancedMesh,\n\tInterleavedBuffer,\n\tInterleavedBufferAttribute,\n\tInterpolant,\n\tInterpolateDiscrete,\n\tInterpolateLinear,\n\tLine,\n\tLineBasicMaterial,\n\tLineLoop,\n\tLineSegments,\n\tLinearFilter,\n\tLinearMipmapLinearFilter,\n\tLinearMipmapNearestFilter,\n\tLinearSRGBColorSpace,\n\tLoader,\n\tLoaderUtils,\n\tMaterial,\n\tMathUtils,\n\tMatrix4,\n\tMesh,\n\tMeshBasicMaterial,\n\tMeshPhysicalMaterial,\n\tMeshStandardMaterial,\n\tMirroredRepeatWrapping,\n\tNearestFilter,\n\tNearestMipmapLinearFilter,\n\tNearestMipmapNearestFilter,\n\tNumberKeyframeTrack,\n\tObject3D,\n\tOrthographicCamera,\n\tPerspectiveCamera,\n\tPointLight,\n\tPoints,\n\tPointsMaterial,\n\tPropertyBinding,\n\tQuaternion,\n\tQuaternionKeyframeTrack,\n\tRepeatWrapping,\n\tSkeleton,\n\tSkinnedMesh,\n\tSphere,\n\tSpotLight,\n\tTexture,\n\tTextureLoader,\n\tTriangleFanDrawMode,\n\tTriangleStripDrawMode,\n\tVector2,\n\tVector3,\n\tVectorKeyframeTrack,\n\tSRGBColorSpace,\n\tInstancedBufferAttribute\n} from 'three';\nimport { toTrianglesDrawMode } from '../utils/BufferGeometryUtils.js';\n\nclass GLTFLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t\tthis.dracoLoader = null;\n\t\tthis.ktx2Loader = null;\n\t\tthis.meshoptDecoder = null;\n\n\t\tthis.pluginCallbacks = [];\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMaterialsClearcoatExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMaterialsDispersionExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFTextureBasisUExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFTextureWebPExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFTextureAVIFExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMaterialsSheenExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMaterialsTransmissionExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMaterialsVolumeExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMaterialsIorExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMaterialsEmissiveStrengthExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMaterialsSpecularExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMaterialsIridescenceExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMaterialsAnisotropyExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMaterialsBumpExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFLightsExtension( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMeshoptCompression( parser );\n\n\t\t} );\n\n\t\tthis.register( function ( parser ) {\n\n\t\t\treturn new GLTFMeshGpuInstancing( parser );\n\n\t\t} );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tlet resourcePath;\n\n\t\tif ( this.resourcePath !== '' ) {\n\n\t\t\tresourcePath = this.resourcePath;\n\n\t\t} else if ( this.path !== '' ) {\n\n\t\t\t// If a base path is set, resources will be relative paths from that plus the relative path of the gltf file\n\t\t\t// Example path = 'https://my-cnd-server.com/', url = 'assets/models/model.gltf'\n\t\t\t// resourcePath = 'https://my-cnd-server.com/assets/models/'\n\t\t\t// referenced resource 'model.bin' will be loaded from 'https://my-cnd-server.com/assets/models/model.bin'\n\t\t\t// referenced resource '../textures/texture.png' will be loaded from 'https://my-cnd-server.com/assets/textures/texture.png'\n\t\t\tconst relativeUrl = LoaderUtils.extractUrlBase( url );\n\t\t\tresourcePath = LoaderUtils.resolveURL( relativeUrl, this.path );\n\n\t\t} else {\n\n\t\t\tresourcePath = LoaderUtils.extractUrlBase( url );\n\n\t\t}\n\n\t\t// Tells the LoadingManager to track an extra item, which resolves after\n\t\t// the model is fully loaded. This means the count of items loaded will\n\t\t// be incorrect, but ensures manager.onLoad() does not fire early.\n\t\tthis.manager.itemStart( url );\n\n\t\tconst _onError = function ( e ) {\n\n\t\t\tif ( onError ) {\n\n\t\t\t\tonError( e );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( e );\n\n\t\t\t}\n\n\t\t\tscope.manager.itemError( url );\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t};\n\n\t\tconst loader = new FileLoader( this.manager );\n\n\t\tloader.setPath( this.path );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\n\t\tloader.load( url, function ( data ) {\n\n\t\t\ttry {\n\n\t\t\t\tscope.parse( data, resourcePath, function ( gltf ) {\n\n\t\t\t\t\tonLoad( gltf );\n\n\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t}, _onError );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\t_onError( e );\n\n\t\t\t}\n\n\t\t}, onProgress, _onError );\n\n\t}\n\n\tsetDRACOLoader( dracoLoader ) {\n\n\t\tthis.dracoLoader = dracoLoader;\n\t\treturn this;\n\n\t}\n\n\tsetKTX2Loader( ktx2Loader ) {\n\n\t\tthis.ktx2Loader = ktx2Loader;\n\t\treturn this;\n\n\t}\n\n\tsetMeshoptDecoder( meshoptDecoder ) {\n\n\t\tthis.meshoptDecoder = meshoptDecoder;\n\t\treturn this;\n\n\t}\n\n\tregister( callback ) {\n\n\t\tif ( this.pluginCallbacks.indexOf( callback ) === - 1 ) {\n\n\t\t\tthis.pluginCallbacks.push( callback );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tunregister( callback ) {\n\n\t\tif ( this.pluginCallbacks.indexOf( callback ) !== - 1 ) {\n\n\t\t\tthis.pluginCallbacks.splice( this.pluginCallbacks.indexOf( callback ), 1 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tparse( data, path, onLoad, onError ) {\n\n\t\tlet json;\n\t\tconst extensions = {};\n\t\tconst plugins = {};\n\t\tconst textDecoder = new TextDecoder();\n\n\t\tif ( typeof data === 'string' ) {\n\n\t\t\tjson = JSON.parse( data );\n\n\t\t} else if ( data instanceof ArrayBuffer ) {\n\n\t\t\tconst magic = textDecoder.decode( new Uint8Array( data, 0, 4 ) );\n\n\t\t\tif ( magic === BINARY_EXTENSION_HEADER_MAGIC ) {\n\n\t\t\t\ttry {\n\n\t\t\t\t\textensions[ EXTENSIONS.KHR_BINARY_GLTF ] = new GLTFBinaryExtension( data );\n\n\t\t\t\t} catch ( error ) {\n\n\t\t\t\t\tif ( onError ) onError( error );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tjson = JSON.parse( extensions[ EXTENSIONS.KHR_BINARY_GLTF ].content );\n\n\t\t\t} else {\n\n\t\t\t\tjson = JSON.parse( textDecoder.decode( data ) );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tjson = data;\n\n\t\t}\n\n\t\tif ( json.asset === undefined || json.asset.version[ 0 ] < 2 ) {\n\n\t\t\tif ( onError ) onError( new Error( 'THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.' ) );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst parser = new GLTFParser( json, {\n\n\t\t\tpath: path || this.resourcePath || '',\n\t\t\tcrossOrigin: this.crossOrigin,\n\t\t\trequestHeader: this.requestHeader,\n\t\t\tmanager: this.manager,\n\t\t\tktx2Loader: this.ktx2Loader,\n\t\t\tmeshoptDecoder: this.meshoptDecoder\n\n\t\t} );\n\n\t\tparser.fileLoader.setRequestHeader( this.requestHeader );\n\n\t\tfor ( let i = 0; i < this.pluginCallbacks.length; i ++ ) {\n\n\t\t\tconst plugin = this.pluginCallbacks[ i ]( parser );\n\n\t\t\tif ( ! plugin.name ) console.error( 'THREE.GLTFLoader: Invalid plugin found: missing name' );\n\n\t\t\tplugins[ plugin.name ] = plugin;\n\n\t\t\t// Workaround to avoid determining as unknown extension\n\t\t\t// in addUnknownExtensionsToUserData().\n\t\t\t// Remove this workaround if we move all the existing\n\t\t\t// extension handlers to plugin system\n\t\t\textensions[ plugin.name ] = true;\n\n\t\t}\n\n\t\tif ( json.extensionsUsed ) {\n\n\t\t\tfor ( let i = 0; i < json.extensionsUsed.length; ++ i ) {\n\n\t\t\t\tconst extensionName = json.extensionsUsed[ i ];\n\t\t\t\tconst extensionsRequired = json.extensionsRequired || [];\n\n\t\t\t\tswitch ( extensionName ) {\n\n\t\t\t\t\tcase EXTENSIONS.KHR_MATERIALS_UNLIT:\n\t\t\t\t\t\textensions[ extensionName ] = new GLTFMaterialsUnlitExtension();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase EXTENSIONS.KHR_DRACO_MESH_COMPRESSION:\n\t\t\t\t\t\textensions[ extensionName ] = new GLTFDracoMeshCompressionExtension( json, this.dracoLoader );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase EXTENSIONS.KHR_TEXTURE_TRANSFORM:\n\t\t\t\t\t\textensions[ extensionName ] = new GLTFTextureTransformExtension();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase EXTENSIONS.KHR_MESH_QUANTIZATION:\n\t\t\t\t\t\textensions[ extensionName ] = new GLTFMeshQuantizationExtension();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tif ( extensionsRequired.indexOf( extensionName ) >= 0 && plugins[ extensionName ] === undefined ) {\n\n\t\t\t\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Unknown extension \"' + extensionName + '\".' );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tparser.setExtensions( extensions );\n\t\tparser.setPlugins( plugins );\n\t\tparser.parse( onLoad, onError );\n\n\t}\n\n\tparseAsync( data, path ) {\n\n\t\tconst scope = this;\n\n\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\tscope.parse( data, path, resolve, reject );\n\n\t\t} );\n\n\t}\n\n}\n\n/* GLTFREGISTRY */\n\nfunction GLTFRegistry() {\n\n\tlet objects = {};\n\n\treturn\t{\n\n\t\tget: function ( key ) {\n\n\t\t\treturn objects[ key ];\n\n\t\t},\n\n\t\tadd: function ( key, object ) {\n\n\t\t\tobjects[ key ] = object;\n\n\t\t},\n\n\t\tremove: function ( key ) {\n\n\t\t\tdelete objects[ key ];\n\n\t\t},\n\n\t\tremoveAll: function () {\n\n\t\t\tobjects = {};\n\n\t\t}\n\n\t};\n\n}\n\n/*********************************/\n/********** EXTENSIONS ***********/\n/*********************************/\n\nconst EXTENSIONS = {\n\tKHR_BINARY_GLTF: 'KHR_binary_glTF',\n\tKHR_DRACO_MESH_COMPRESSION: 'KHR_draco_mesh_compression',\n\tKHR_LIGHTS_PUNCTUAL: 'KHR_lights_punctual',\n\tKHR_MATERIALS_CLEARCOAT: 'KHR_materials_clearcoat',\n\tKHR_MATERIALS_DISPERSION: 'KHR_materials_dispersion',\n\tKHR_MATERIALS_IOR: 'KHR_materials_ior',\n\tKHR_MATERIALS_SHEEN: 'KHR_materials_sheen',\n\tKHR_MATERIALS_SPECULAR: 'KHR_materials_specular',\n\tKHR_MATERIALS_TRANSMISSION: 'KHR_materials_transmission',\n\tKHR_MATERIALS_IRIDESCENCE: 'KHR_materials_iridescence',\n\tKHR_MATERIALS_ANISOTROPY: 'KHR_materials_anisotropy',\n\tKHR_MATERIALS_UNLIT: 'KHR_materials_unlit',\n\tKHR_MATERIALS_VOLUME: 'KHR_materials_volume',\n\tKHR_TEXTURE_BASISU: 'KHR_texture_basisu',\n\tKHR_TEXTURE_TRANSFORM: 'KHR_texture_transform',\n\tKHR_MESH_QUANTIZATION: 'KHR_mesh_quantization',\n\tKHR_MATERIALS_EMISSIVE_STRENGTH: 'KHR_materials_emissive_strength',\n\tEXT_MATERIALS_BUMP: 'EXT_materials_bump',\n\tEXT_TEXTURE_WEBP: 'EXT_texture_webp',\n\tEXT_TEXTURE_AVIF: 'EXT_texture_avif',\n\tEXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression',\n\tEXT_MESH_GPU_INSTANCING: 'EXT_mesh_gpu_instancing'\n};\n\n/**\n * Punctual Lights Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual\n */\nclass GLTFLightsExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.KHR_LIGHTS_PUNCTUAL;\n\n\t\t// Object3D instance caches\n\t\tthis.cache = { refs: {}, uses: {} };\n\n\t}\n\n\t_markDefs() {\n\n\t\tconst parser = this.parser;\n\t\tconst nodeDefs = this.parser.json.nodes || [];\n\n\t\tfor ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) {\n\n\t\t\tconst nodeDef = nodeDefs[ nodeIndex ];\n\n\t\t\tif ( nodeDef.extensions\n\t\t\t\t\t&& nodeDef.extensions[ this.name ]\n\t\t\t\t\t&& nodeDef.extensions[ this.name ].light !== undefined ) {\n\n\t\t\t\tparser._addNodeRef( this.cache, nodeDef.extensions[ this.name ].light );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_loadLight( lightIndex ) {\n\n\t\tconst parser = this.parser;\n\t\tconst cacheKey = 'light:' + lightIndex;\n\t\tlet dependency = parser.cache.get( cacheKey );\n\n\t\tif ( dependency ) return dependency;\n\n\t\tconst json = parser.json;\n\t\tconst extensions = ( json.extensions && json.extensions[ this.name ] ) || {};\n\t\tconst lightDefs = extensions.lights || [];\n\t\tconst lightDef = lightDefs[ lightIndex ];\n\t\tlet lightNode;\n\n\t\tconst color = new Color( 0xffffff );\n\n\t\tif ( lightDef.color !== undefined ) color.setRGB( lightDef.color[ 0 ], lightDef.color[ 1 ], lightDef.color[ 2 ], LinearSRGBColorSpace );\n\n\t\tconst range = lightDef.range !== undefined ? lightDef.range : 0;\n\n\t\tswitch ( lightDef.type ) {\n\n\t\t\tcase 'directional':\n\t\t\t\tlightNode = new DirectionalLight( color );\n\t\t\t\tlightNode.target.position.set( 0, 0, - 1 );\n\t\t\t\tlightNode.add( lightNode.target );\n\t\t\t\tbreak;\n\n\t\t\tcase 'point':\n\t\t\t\tlightNode = new PointLight( color );\n\t\t\t\tlightNode.distance = range;\n\t\t\t\tbreak;\n\n\t\t\tcase 'spot':\n\t\t\t\tlightNode = new SpotLight( color );\n\t\t\t\tlightNode.distance = range;\n\t\t\t\t// Handle spotlight properties.\n\t\t\t\tlightDef.spot = lightDef.spot || {};\n\t\t\t\tlightDef.spot.innerConeAngle = lightDef.spot.innerConeAngle !== undefined ? lightDef.spot.innerConeAngle : 0;\n\t\t\t\tlightDef.spot.outerConeAngle = lightDef.spot.outerConeAngle !== undefined ? lightDef.spot.outerConeAngle : Math.PI / 4.0;\n\t\t\t\tlightNode.angle = lightDef.spot.outerConeAngle;\n\t\t\t\tlightNode.penumbra = 1.0 - lightDef.spot.innerConeAngle / lightDef.spot.outerConeAngle;\n\t\t\t\tlightNode.target.position.set( 0, 0, - 1 );\n\t\t\t\tlightNode.add( lightNode.target );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Unexpected light type: ' + lightDef.type );\n\n\t\t}\n\n\t\t// Some lights (e.g. spot) default to a position other than the origin. Reset the position\n\t\t// here, because node-level parsing will only override position if explicitly specified.\n\t\tlightNode.position.set( 0, 0, 0 );\n\n\t\tlightNode.decay = 2;\n\n\t\tassignExtrasToUserData( lightNode, lightDef );\n\n\t\tif ( lightDef.intensity !== undefined ) lightNode.intensity = lightDef.intensity;\n\n\t\tlightNode.name = parser.createUniqueName( lightDef.name || ( 'light_' + lightIndex ) );\n\n\t\tdependency = Promise.resolve( lightNode );\n\n\t\tparser.cache.add( cacheKey, dependency );\n\n\t\treturn dependency;\n\n\t}\n\n\tgetDependency( type, index ) {\n\n\t\tif ( type !== 'light' ) return;\n\n\t\treturn this._loadLight( index );\n\n\t}\n\n\tcreateNodeAttachment( nodeIndex ) {\n\n\t\tconst self = this;\n\t\tconst parser = this.parser;\n\t\tconst json = parser.json;\n\t\tconst nodeDef = json.nodes[ nodeIndex ];\n\t\tconst lightDef = ( nodeDef.extensions && nodeDef.extensions[ this.name ] ) || {};\n\t\tconst lightIndex = lightDef.light;\n\n\t\tif ( lightIndex === undefined ) return null;\n\n\t\treturn this._loadLight( lightIndex ).then( function ( light ) {\n\n\t\t\treturn parser._getNodeRef( self.cache, lightIndex, light );\n\n\t\t} );\n\n\t}\n\n}\n\n/**\n * Unlit Materials Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit\n */\nclass GLTFMaterialsUnlitExtension {\n\n\tconstructor() {\n\n\t\tthis.name = EXTENSIONS.KHR_MATERIALS_UNLIT;\n\n\t}\n\n\tgetMaterialType() {\n\n\t\treturn MeshBasicMaterial;\n\n\t}\n\n\textendParams( materialParams, materialDef, parser ) {\n\n\t\tconst pending = [];\n\n\t\tmaterialParams.color = new Color( 1.0, 1.0, 1.0 );\n\t\tmaterialParams.opacity = 1.0;\n\n\t\tconst metallicRoughness = materialDef.pbrMetallicRoughness;\n\n\t\tif ( metallicRoughness ) {\n\n\t\t\tif ( Array.isArray( metallicRoughness.baseColorFactor ) ) {\n\n\t\t\t\tconst array = metallicRoughness.baseColorFactor;\n\n\t\t\t\tmaterialParams.color.setRGB( array[ 0 ], array[ 1 ], array[ 2 ], LinearSRGBColorSpace );\n\t\t\t\tmaterialParams.opacity = array[ 3 ];\n\n\t\t\t}\n\n\t\t\tif ( metallicRoughness.baseColorTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture, SRGBColorSpace ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn Promise.all( pending );\n\n\t}\n\n}\n\n/**\n * Materials Emissive Strength Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/blob/5768b3ce0ef32bc39cdf1bef10b948586635ead3/extensions/2.0/Khronos/KHR_materials_emissive_strength/README.md\n */\nclass GLTFMaterialsEmissiveStrengthExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.KHR_MATERIALS_EMISSIVE_STRENGTH;\n\n\t}\n\n\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t\tconst emissiveStrength = materialDef.extensions[ this.name ].emissiveStrength;\n\n\t\tif ( emissiveStrength !== undefined ) {\n\n\t\t\tmaterialParams.emissiveIntensity = emissiveStrength;\n\n\t\t}\n\n\t\treturn Promise.resolve();\n\n\t}\n\n}\n\n/**\n * Clearcoat Materials Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat\n */\nclass GLTFMaterialsClearcoatExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.KHR_MATERIALS_CLEARCOAT;\n\n\t}\n\n\tgetMaterialType( materialIndex ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\n\t\treturn MeshPhysicalMaterial;\n\n\t}\n\n\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t\tconst pending = [];\n\n\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\tif ( extension.clearcoatFactor !== undefined ) {\n\n\t\t\tmaterialParams.clearcoat = extension.clearcoatFactor;\n\n\t\t}\n\n\t\tif ( extension.clearcoatTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'clearcoatMap', extension.clearcoatTexture ) );\n\n\t\t}\n\n\t\tif ( extension.clearcoatRoughnessFactor !== undefined ) {\n\n\t\t\tmaterialParams.clearcoatRoughness = extension.clearcoatRoughnessFactor;\n\n\t\t}\n\n\t\tif ( extension.clearcoatRoughnessTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'clearcoatRoughnessMap', extension.clearcoatRoughnessTexture ) );\n\n\t\t}\n\n\t\tif ( extension.clearcoatNormalTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'clearcoatNormalMap', extension.clearcoatNormalTexture ) );\n\n\t\t\tif ( extension.clearcoatNormalTexture.scale !== undefined ) {\n\n\t\t\t\tconst scale = extension.clearcoatNormalTexture.scale;\n\n\t\t\t\tmaterialParams.clearcoatNormalScale = new Vector2( scale, scale );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn Promise.all( pending );\n\n\t}\n\n}\n\n/**\n * Materials dispersion Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_dispersion\n */\nclass GLTFMaterialsDispersionExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.KHR_MATERIALS_DISPERSION;\n\n\t}\n\n\tgetMaterialType( materialIndex ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\n\t\treturn MeshPhysicalMaterial;\n\n\t}\n\n\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\tmaterialParams.dispersion = extension.dispersion !== undefined ? extension.dispersion : 0;\n\n\t\treturn Promise.resolve();\n\n\t}\n\n}\n\n/**\n * Iridescence Materials Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_iridescence\n */\nclass GLTFMaterialsIridescenceExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.KHR_MATERIALS_IRIDESCENCE;\n\n\t}\n\n\tgetMaterialType( materialIndex ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\n\t\treturn MeshPhysicalMaterial;\n\n\t}\n\n\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t\tconst pending = [];\n\n\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\tif ( extension.iridescenceFactor !== undefined ) {\n\n\t\t\tmaterialParams.iridescence = extension.iridescenceFactor;\n\n\t\t}\n\n\t\tif ( extension.iridescenceTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'iridescenceMap', extension.iridescenceTexture ) );\n\n\t\t}\n\n\t\tif ( extension.iridescenceIor !== undefined ) {\n\n\t\t\tmaterialParams.iridescenceIOR = extension.iridescenceIor;\n\n\t\t}\n\n\t\tif ( materialParams.iridescenceThicknessRange === undefined ) {\n\n\t\t\tmaterialParams.iridescenceThicknessRange = [ 100, 400 ];\n\n\t\t}\n\n\t\tif ( extension.iridescenceThicknessMinimum !== undefined ) {\n\n\t\t\tmaterialParams.iridescenceThicknessRange[ 0 ] = extension.iridescenceThicknessMinimum;\n\n\t\t}\n\n\t\tif ( extension.iridescenceThicknessMaximum !== undefined ) {\n\n\t\t\tmaterialParams.iridescenceThicknessRange[ 1 ] = extension.iridescenceThicknessMaximum;\n\n\t\t}\n\n\t\tif ( extension.iridescenceThicknessTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'iridescenceThicknessMap', extension.iridescenceThicknessTexture ) );\n\n\t\t}\n\n\t\treturn Promise.all( pending );\n\n\t}\n\n}\n\n/**\n * Sheen Materials Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen\n */\nclass GLTFMaterialsSheenExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.KHR_MATERIALS_SHEEN;\n\n\t}\n\n\tgetMaterialType( materialIndex ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\n\t\treturn MeshPhysicalMaterial;\n\n\t}\n\n\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t\tconst pending = [];\n\n\t\tmaterialParams.sheenColor = new Color( 0, 0, 0 );\n\t\tmaterialParams.sheenRoughness = 0;\n\t\tmaterialParams.sheen = 1;\n\n\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\tif ( extension.sheenColorFactor !== undefined ) {\n\n\t\t\tconst colorFactor = extension.sheenColorFactor;\n\t\t\tmaterialParams.sheenColor.setRGB( colorFactor[ 0 ], colorFactor[ 1 ], colorFactor[ 2 ], LinearSRGBColorSpace );\n\n\t\t}\n\n\t\tif ( extension.sheenRoughnessFactor !== undefined ) {\n\n\t\t\tmaterialParams.sheenRoughness = extension.sheenRoughnessFactor;\n\n\t\t}\n\n\t\tif ( extension.sheenColorTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'sheenColorMap', extension.sheenColorTexture, SRGBColorSpace ) );\n\n\t\t}\n\n\t\tif ( extension.sheenRoughnessTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'sheenRoughnessMap', extension.sheenRoughnessTexture ) );\n\n\t\t}\n\n\t\treturn Promise.all( pending );\n\n\t}\n\n}\n\n/**\n * Transmission Materials Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission\n * Draft: https://github.com/KhronosGroup/glTF/pull/1698\n */\nclass GLTFMaterialsTransmissionExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.KHR_MATERIALS_TRANSMISSION;\n\n\t}\n\n\tgetMaterialType( materialIndex ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\n\t\treturn MeshPhysicalMaterial;\n\n\t}\n\n\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t\tconst pending = [];\n\n\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\tif ( extension.transmissionFactor !== undefined ) {\n\n\t\t\tmaterialParams.transmission = extension.transmissionFactor;\n\n\t\t}\n\n\t\tif ( extension.transmissionTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'transmissionMap', extension.transmissionTexture ) );\n\n\t\t}\n\n\t\treturn Promise.all( pending );\n\n\t}\n\n}\n\n/**\n * Materials Volume Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume\n */\nclass GLTFMaterialsVolumeExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.KHR_MATERIALS_VOLUME;\n\n\t}\n\n\tgetMaterialType( materialIndex ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\n\t\treturn MeshPhysicalMaterial;\n\n\t}\n\n\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t\tconst pending = [];\n\n\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\tmaterialParams.thickness = extension.thicknessFactor !== undefined ? extension.thicknessFactor : 0;\n\n\t\tif ( extension.thicknessTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'thicknessMap', extension.thicknessTexture ) );\n\n\t\t}\n\n\t\tmaterialParams.attenuationDistance = extension.attenuationDistance || Infinity;\n\n\t\tconst colorArray = extension.attenuationColor || [ 1, 1, 1 ];\n\t\tmaterialParams.attenuationColor = new Color().setRGB( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ], LinearSRGBColorSpace );\n\n\t\treturn Promise.all( pending );\n\n\t}\n\n}\n\n/**\n * Materials ior Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_ior\n */\nclass GLTFMaterialsIorExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.KHR_MATERIALS_IOR;\n\n\t}\n\n\tgetMaterialType( materialIndex ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\n\t\treturn MeshPhysicalMaterial;\n\n\t}\n\n\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\tmaterialParams.ior = extension.ior !== undefined ? extension.ior : 1.5;\n\n\t\treturn Promise.resolve();\n\n\t}\n\n}\n\n/**\n * Materials specular Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_specular\n */\nclass GLTFMaterialsSpecularExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.KHR_MATERIALS_SPECULAR;\n\n\t}\n\n\tgetMaterialType( materialIndex ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\n\t\treturn MeshPhysicalMaterial;\n\n\t}\n\n\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t\tconst pending = [];\n\n\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\tmaterialParams.specularIntensity = extension.specularFactor !== undefined ? extension.specularFactor : 1.0;\n\n\t\tif ( extension.specularTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'specularIntensityMap', extension.specularTexture ) );\n\n\t\t}\n\n\t\tconst colorArray = extension.specularColorFactor || [ 1, 1, 1 ];\n\t\tmaterialParams.specularColor = new Color().setRGB( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ], LinearSRGBColorSpace );\n\n\t\tif ( extension.specularColorTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'specularColorMap', extension.specularColorTexture, SRGBColorSpace ) );\n\n\t\t}\n\n\t\treturn Promise.all( pending );\n\n\t}\n\n}\n\n\n/**\n * Materials bump Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/EXT_materials_bump\n */\nclass GLTFMaterialsBumpExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.EXT_MATERIALS_BUMP;\n\n\t}\n\n\tgetMaterialType( materialIndex ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\n\t\treturn MeshPhysicalMaterial;\n\n\t}\n\n\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t\tconst pending = [];\n\n\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\tmaterialParams.bumpScale = extension.bumpFactor !== undefined ? extension.bumpFactor : 1.0;\n\n\t\tif ( extension.bumpTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'bumpMap', extension.bumpTexture ) );\n\n\t\t}\n\n\t\treturn Promise.all( pending );\n\n\t}\n\n}\n\n/**\n * Materials anisotropy Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_anisotropy\n */\nclass GLTFMaterialsAnisotropyExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.KHR_MATERIALS_ANISOTROPY;\n\n\t}\n\n\tgetMaterialType( materialIndex ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\n\t\treturn MeshPhysicalMaterial;\n\n\t}\n\n\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\tconst parser = this.parser;\n\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t\tconst pending = [];\n\n\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\tif ( extension.anisotropyStrength !== undefined ) {\n\n\t\t\tmaterialParams.anisotropy = extension.anisotropyStrength;\n\n\t\t}\n\n\t\tif ( extension.anisotropyRotation !== undefined ) {\n\n\t\t\tmaterialParams.anisotropyRotation = extension.anisotropyRotation;\n\n\t\t}\n\n\t\tif ( extension.anisotropyTexture !== undefined ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'anisotropyMap', extension.anisotropyTexture ) );\n\n\t\t}\n\n\t\treturn Promise.all( pending );\n\n\t}\n\n}\n\n/**\n * BasisU Texture Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu\n */\nclass GLTFTextureBasisUExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.KHR_TEXTURE_BASISU;\n\n\t}\n\n\tloadTexture( textureIndex ) {\n\n\t\tconst parser = this.parser;\n\t\tconst json = parser.json;\n\n\t\tconst textureDef = json.textures[ textureIndex ];\n\n\t\tif ( ! textureDef.extensions || ! textureDef.extensions[ this.name ] ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst extension = textureDef.extensions[ this.name ];\n\t\tconst loader = parser.options.ktx2Loader;\n\n\t\tif ( ! loader ) {\n\n\t\t\tif ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures' );\n\n\t\t\t} else {\n\n\t\t\t\t// Assumes that the extension is optional and that a fallback texture is present\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn parser.loadTextureImage( textureIndex, extension.source, loader );\n\n\t}\n\n}\n\n/**\n * WebP Texture Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp\n */\nclass GLTFTextureWebPExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.EXT_TEXTURE_WEBP;\n\t\tthis.isSupported = null;\n\n\t}\n\n\tloadTexture( textureIndex ) {\n\n\t\tconst name = this.name;\n\t\tconst parser = this.parser;\n\t\tconst json = parser.json;\n\n\t\tconst textureDef = json.textures[ textureIndex ];\n\n\t\tif ( ! textureDef.extensions || ! textureDef.extensions[ name ] ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst extension = textureDef.extensions[ name ];\n\t\tconst source = json.images[ extension.source ];\n\n\t\tlet loader = parser.textureLoader;\n\t\tif ( source.uri ) {\n\n\t\t\tconst handler = parser.options.manager.getHandler( source.uri );\n\t\t\tif ( handler !== null ) loader = handler;\n\n\t\t}\n\n\t\treturn this.detectSupport().then( function ( isSupported ) {\n\n\t\t\tif ( isSupported ) return parser.loadTextureImage( textureIndex, extension.source, loader );\n\n\t\t\tif ( json.extensionsRequired && json.extensionsRequired.indexOf( name ) >= 0 ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: WebP required by asset but unsupported.' );\n\n\t\t\t}\n\n\t\t\t// Fall back to PNG or JPEG.\n\t\t\treturn parser.loadTexture( textureIndex );\n\n\t\t} );\n\n\t}\n\n\tdetectSupport() {\n\n\t\tif ( ! this.isSupported ) {\n\n\t\t\tthis.isSupported = new Promise( function ( resolve ) {\n\n\t\t\t\tconst image = new Image();\n\n\t\t\t\t// Lossy test image. Support for lossy images doesn't guarantee support for all\n\t\t\t\t// WebP images, unfortunately.\n\t\t\t\timage.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA';\n\n\t\t\t\timage.onload = image.onerror = function () {\n\n\t\t\t\t\tresolve( image.height === 1 );\n\n\t\t\t\t};\n\n\t\t\t} );\n\n\t\t}\n\n\t\treturn this.isSupported;\n\n\t}\n\n}\n\n/**\n * AVIF Texture Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_avif\n */\nclass GLTFTextureAVIFExtension {\n\n\tconstructor( parser ) {\n\n\t\tthis.parser = parser;\n\t\tthis.name = EXTENSIONS.EXT_TEXTURE_AVIF;\n\t\tthis.isSupported = null;\n\n\t}\n\n\tloadTexture( textureIndex ) {\n\n\t\tconst name = this.name;\n\t\tconst parser = this.parser;\n\t\tconst json = parser.json;\n\n\t\tconst textureDef = json.textures[ textureIndex ];\n\n\t\tif ( ! textureDef.extensions || ! textureDef.extensions[ name ] ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst extension = textureDef.extensions[ name ];\n\t\tconst source = json.images[ extension.source ];\n\n\t\tlet loader = parser.textureLoader;\n\t\tif ( source.uri ) {\n\n\t\t\tconst handler = parser.options.manager.getHandler( source.uri );\n\t\t\tif ( handler !== null ) loader = handler;\n\n\t\t}\n\n\t\treturn this.detectSupport().then( function ( isSupported ) {\n\n\t\t\tif ( isSupported ) return parser.loadTextureImage( textureIndex, extension.source, loader );\n\n\t\t\tif ( json.extensionsRequired && json.extensionsRequired.indexOf( name ) >= 0 ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: AVIF required by asset but unsupported.' );\n\n\t\t\t}\n\n\t\t\t// Fall back to PNG or JPEG.\n\t\t\treturn parser.loadTexture( textureIndex );\n\n\t\t} );\n\n\t}\n\n\tdetectSupport() {\n\n\t\tif ( ! this.isSupported ) {\n\n\t\t\tthis.isSupported = new Promise( function ( resolve ) {\n\n\t\t\t\tconst image = new Image();\n\n\t\t\t\t// Lossy test image.\n\t\t\t\timage.src = 'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=';\n\t\t\t\timage.onload = image.onerror = function () {\n\n\t\t\t\t\tresolve( image.height === 1 );\n\n\t\t\t\t};\n\n\t\t\t} );\n\n\t\t}\n\n\t\treturn this.isSupported;\n\n\t}\n\n}\n\n/**\n * meshopt BufferView Compression Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression\n */\nclass GLTFMeshoptCompression {\n\n\tconstructor( parser ) {\n\n\t\tthis.name = EXTENSIONS.EXT_MESHOPT_COMPRESSION;\n\t\tthis.parser = parser;\n\n\t}\n\n\tloadBufferView( index ) {\n\n\t\tconst json = this.parser.json;\n\t\tconst bufferView = json.bufferViews[ index ];\n\n\t\tif ( bufferView.extensions && bufferView.extensions[ this.name ] ) {\n\n\t\t\tconst extensionDef = bufferView.extensions[ this.name ];\n\n\t\t\tconst buffer = this.parser.getDependency( 'buffer', extensionDef.buffer );\n\t\t\tconst decoder = this.parser.options.meshoptDecoder;\n\n\t\t\tif ( ! decoder || ! decoder.supported ) {\n\n\t\t\t\tif ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) {\n\n\t\t\t\t\tthrow new Error( 'THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files' );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Assumes that the extension is optional and that fallback buffer data is present\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn buffer.then( function ( res ) {\n\n\t\t\t\tconst byteOffset = extensionDef.byteOffset || 0;\n\t\t\t\tconst byteLength = extensionDef.byteLength || 0;\n\n\t\t\t\tconst count = extensionDef.count;\n\t\t\t\tconst stride = extensionDef.byteStride;\n\n\t\t\t\tconst source = new Uint8Array( res, byteOffset, byteLength );\n\n\t\t\t\tif ( decoder.decodeGltfBufferAsync ) {\n\n\t\t\t\t\treturn decoder.decodeGltfBufferAsync( count, stride, source, extensionDef.mode, extensionDef.filter ).then( function ( res ) {\n\n\t\t\t\t\t\treturn res.buffer;\n\n\t\t\t\t\t} );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Support for MeshoptDecoder 0.18 or earlier, without decodeGltfBufferAsync\n\t\t\t\t\treturn decoder.ready.then( function () {\n\n\t\t\t\t\t\tconst result = new ArrayBuffer( count * stride );\n\t\t\t\t\t\tdecoder.decodeGltfBuffer( new Uint8Array( result ), count, stride, source, extensionDef.mode, extensionDef.filter );\n\t\t\t\t\t\treturn result;\n\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * GPU Instancing Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_mesh_gpu_instancing\n *\n */\nclass GLTFMeshGpuInstancing {\n\n\tconstructor( parser ) {\n\n\t\tthis.name = EXTENSIONS.EXT_MESH_GPU_INSTANCING;\n\t\tthis.parser = parser;\n\n\t}\n\n\tcreateNodeMesh( nodeIndex ) {\n\n\t\tconst json = this.parser.json;\n\t\tconst nodeDef = json.nodes[ nodeIndex ];\n\n\t\tif ( ! nodeDef.extensions || ! nodeDef.extensions[ this.name ] ||\n\t\t\tnodeDef.mesh === undefined ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst meshDef = json.meshes[ nodeDef.mesh ];\n\n\t\t// No Points or Lines + Instancing support yet\n\n\t\tfor ( const primitive of meshDef.primitives ) {\n\n\t\t\tif ( primitive.mode !== WEBGL_CONSTANTS.TRIANGLES &&\n\t\t\t\t primitive.mode !== WEBGL_CONSTANTS.TRIANGLE_STRIP &&\n\t\t\t\t primitive.mode !== WEBGL_CONSTANTS.TRIANGLE_FAN &&\n\t\t\t\t primitive.mode !== undefined ) {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst extensionDef = nodeDef.extensions[ this.name ];\n\t\tconst attributesDef = extensionDef.attributes;\n\n\t\t// @TODO: Can we support InstancedMesh + SkinnedMesh?\n\n\t\tconst pending = [];\n\t\tconst attributes = {};\n\n\t\tfor ( const key in attributesDef ) {\n\n\t\t\tpending.push( this.parser.getDependency( 'accessor', attributesDef[ key ] ).then( accessor => {\n\n\t\t\t\tattributes[ key ] = accessor;\n\t\t\t\treturn attributes[ key ];\n\n\t\t\t} ) );\n\n\t\t}\n\n\t\tif ( pending.length < 1 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tpending.push( this.parser.createNodeMesh( nodeIndex ) );\n\n\t\treturn Promise.all( pending ).then( results => {\n\n\t\t\tconst nodeObject = results.pop();\n\t\t\tconst meshes = nodeObject.isGroup ? nodeObject.children : [ nodeObject ];\n\t\t\tconst count = results[ 0 ].count; // All attribute counts should be same\n\t\t\tconst instancedMeshes = [];\n\n\t\t\tfor ( const mesh of meshes ) {\n\n\t\t\t\t// Temporal variables\n\t\t\t\tconst m = new Matrix4();\n\t\t\t\tconst p = new Vector3();\n\t\t\t\tconst q = new Quaternion();\n\t\t\t\tconst s = new Vector3( 1, 1, 1 );\n\n\t\t\t\tconst instancedMesh = new InstancedMesh( mesh.geometry, mesh.material, count );\n\n\t\t\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\t\t\tif ( attributes.TRANSLATION ) {\n\n\t\t\t\t\t\tp.fromBufferAttribute( attributes.TRANSLATION, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( attributes.ROTATION ) {\n\n\t\t\t\t\t\tq.fromBufferAttribute( attributes.ROTATION, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( attributes.SCALE ) {\n\n\t\t\t\t\t\ts.fromBufferAttribute( attributes.SCALE, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tinstancedMesh.setMatrixAt( i, m.compose( p, q, s ) );\n\n\t\t\t\t}\n\n\t\t\t\t// Add instance attributes to the geometry, excluding TRS.\n\t\t\t\tfor ( const attributeName in attributes ) {\n\n\t\t\t\t\tif ( attributeName === '_COLOR_0' ) {\n\n\t\t\t\t\t\tconst attr = attributes[ attributeName ];\n\t\t\t\t\t\tinstancedMesh.instanceColor = new InstancedBufferAttribute( attr.array, attr.itemSize, attr.normalized );\n\n\t\t\t\t\t} else if ( attributeName !== 'TRANSLATION' &&\n\t\t\t\t\t\t attributeName !== 'ROTATION' &&\n\t\t\t\t\t\t attributeName !== 'SCALE' ) {\n\n\t\t\t\t\t\tmesh.geometry.setAttribute( attributeName, attributes[ attributeName ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// Just in case\n\t\t\t\tObject3D.prototype.copy.call( instancedMesh, mesh );\n\n\t\t\t\tthis.parser.assignFinalMaterial( instancedMesh );\n\n\t\t\t\tinstancedMeshes.push( instancedMesh );\n\n\t\t\t}\n\n\t\t\tif ( nodeObject.isGroup ) {\n\n\t\t\t\tnodeObject.clear();\n\n\t\t\t\tnodeObject.add( ... instancedMeshes );\n\n\t\t\t\treturn nodeObject;\n\n\t\t\t}\n\n\t\t\treturn instancedMeshes[ 0 ];\n\n\t\t} );\n\n\t}\n\n}\n\n/* BINARY EXTENSION */\nconst BINARY_EXTENSION_HEADER_MAGIC = 'glTF';\nconst BINARY_EXTENSION_HEADER_LENGTH = 12;\nconst BINARY_EXTENSION_CHUNK_TYPES = { JSON: 0x4E4F534A, BIN: 0x004E4942 };\n\nclass GLTFBinaryExtension {\n\n\tconstructor( data ) {\n\n\t\tthis.name = EXTENSIONS.KHR_BINARY_GLTF;\n\t\tthis.content = null;\n\t\tthis.body = null;\n\n\t\tconst headerView = new DataView( data, 0, BINARY_EXTENSION_HEADER_LENGTH );\n\t\tconst textDecoder = new TextDecoder();\n\n\t\tthis.header = {\n\t\t\tmagic: textDecoder.decode( new Uint8Array( data.slice( 0, 4 ) ) ),\n\t\t\tversion: headerView.getUint32( 4, true ),\n\t\t\tlength: headerView.getUint32( 8, true )\n\t\t};\n\n\t\tif ( this.header.magic !== BINARY_EXTENSION_HEADER_MAGIC ) {\n\n\t\t\tthrow new Error( 'THREE.GLTFLoader: Unsupported glTF-Binary header.' );\n\n\t\t} else if ( this.header.version < 2.0 ) {\n\n\t\t\tthrow new Error( 'THREE.GLTFLoader: Legacy binary file detected.' );\n\n\t\t}\n\n\t\tconst chunkContentsLength = this.header.length - BINARY_EXTENSION_HEADER_LENGTH;\n\t\tconst chunkView = new DataView( data, BINARY_EXTENSION_HEADER_LENGTH );\n\t\tlet chunkIndex = 0;\n\n\t\twhile ( chunkIndex < chunkContentsLength ) {\n\n\t\t\tconst chunkLength = chunkView.getUint32( chunkIndex, true );\n\t\t\tchunkIndex += 4;\n\n\t\t\tconst chunkType = chunkView.getUint32( chunkIndex, true );\n\t\t\tchunkIndex += 4;\n\n\t\t\tif ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.JSON ) {\n\n\t\t\t\tconst contentArray = new Uint8Array( data, BINARY_EXTENSION_HEADER_LENGTH + chunkIndex, chunkLength );\n\t\t\t\tthis.content = textDecoder.decode( contentArray );\n\n\t\t\t} else if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.BIN ) {\n\n\t\t\t\tconst byteOffset = BINARY_EXTENSION_HEADER_LENGTH + chunkIndex;\n\t\t\t\tthis.body = data.slice( byteOffset, byteOffset + chunkLength );\n\n\t\t\t}\n\n\t\t\t// Clients must ignore chunks with unknown types.\n\n\t\t\tchunkIndex += chunkLength;\n\n\t\t}\n\n\t\tif ( this.content === null ) {\n\n\t\t\tthrow new Error( 'THREE.GLTFLoader: JSON content not found.' );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * DRACO Mesh Compression Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression\n */\nclass GLTFDracoMeshCompressionExtension {\n\n\tconstructor( json, dracoLoader ) {\n\n\t\tif ( ! dracoLoader ) {\n\n\t\t\tthrow new Error( 'THREE.GLTFLoader: No DRACOLoader instance provided.' );\n\n\t\t}\n\n\t\tthis.name = EXTENSIONS.KHR_DRACO_MESH_COMPRESSION;\n\t\tthis.json = json;\n\t\tthis.dracoLoader = dracoLoader;\n\t\tthis.dracoLoader.preload();\n\n\t}\n\n\tdecodePrimitive( primitive, parser ) {\n\n\t\tconst json = this.json;\n\t\tconst dracoLoader = this.dracoLoader;\n\t\tconst bufferViewIndex = primitive.extensions[ this.name ].bufferView;\n\t\tconst gltfAttributeMap = primitive.extensions[ this.name ].attributes;\n\t\tconst threeAttributeMap = {};\n\t\tconst attributeNormalizedMap = {};\n\t\tconst attributeTypeMap = {};\n\n\t\tfor ( const attributeName in gltfAttributeMap ) {\n\n\t\t\tconst threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase();\n\n\t\t\tthreeAttributeMap[ threeAttributeName ] = gltfAttributeMap[ attributeName ];\n\n\t\t}\n\n\t\tfor ( const attributeName in primitive.attributes ) {\n\n\t\t\tconst threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase();\n\n\t\t\tif ( gltfAttributeMap[ attributeName ] !== undefined ) {\n\n\t\t\t\tconst accessorDef = json.accessors[ primitive.attributes[ attributeName ] ];\n\t\t\t\tconst componentType = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ];\n\n\t\t\t\tattributeTypeMap[ threeAttributeName ] = componentType.name;\n\t\t\t\tattributeNormalizedMap[ threeAttributeName ] = accessorDef.normalized === true;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn parser.getDependency( 'bufferView', bufferViewIndex ).then( function ( bufferView ) {\n\n\t\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\t\tdracoLoader.decodeDracoFile( bufferView, function ( geometry ) {\n\n\t\t\t\t\tfor ( const attributeName in geometry.attributes ) {\n\n\t\t\t\t\t\tconst attribute = geometry.attributes[ attributeName ];\n\t\t\t\t\t\tconst normalized = attributeNormalizedMap[ attributeName ];\n\n\t\t\t\t\t\tif ( normalized !== undefined ) attribute.normalized = normalized;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve( geometry );\n\n\t\t\t\t}, threeAttributeMap, attributeTypeMap, LinearSRGBColorSpace, reject );\n\n\t\t\t} );\n\n\t\t} );\n\n\t}\n\n}\n\n/**\n * Texture Transform Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform\n */\nclass GLTFTextureTransformExtension {\n\n\tconstructor() {\n\n\t\tthis.name = EXTENSIONS.KHR_TEXTURE_TRANSFORM;\n\n\t}\n\n\textendTexture( texture, transform ) {\n\n\t\tif ( ( transform.texCoord === undefined || transform.texCoord === texture.channel )\n\t\t\t&& transform.offset === undefined\n\t\t\t&& transform.rotation === undefined\n\t\t\t&& transform.scale === undefined ) {\n\n\t\t\t// See https://github.com/mrdoob/three.js/issues/21819.\n\t\t\treturn texture;\n\n\t\t}\n\n\t\ttexture = texture.clone();\n\n\t\tif ( transform.texCoord !== undefined ) {\n\n\t\t\ttexture.channel = transform.texCoord;\n\n\t\t}\n\n\t\tif ( transform.offset !== undefined ) {\n\n\t\t\ttexture.offset.fromArray( transform.offset );\n\n\t\t}\n\n\t\tif ( transform.rotation !== undefined ) {\n\n\t\t\ttexture.rotation = transform.rotation;\n\n\t\t}\n\n\t\tif ( transform.scale !== undefined ) {\n\n\t\t\ttexture.repeat.fromArray( transform.scale );\n\n\t\t}\n\n\t\ttexture.needsUpdate = true;\n\n\t\treturn texture;\n\n\t}\n\n}\n\n/**\n * Mesh Quantization Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization\n */\nclass GLTFMeshQuantizationExtension {\n\n\tconstructor() {\n\n\t\tthis.name = EXTENSIONS.KHR_MESH_QUANTIZATION;\n\n\t}\n\n}\n\n/*********************************/\n/********** INTERPOLATION ********/\n/*********************************/\n\n// Spline Interpolation\n// Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#appendix-c-spline-interpolation\nclass GLTFCubicSplineInterpolant extends Interpolant {\n\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tcopySampleValue_( index ) {\n\n\t\t// Copies a sample value to the result buffer. See description of glTF\n\t\t// CUBICSPLINE values layout in interpolate_() function below.\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tvalueSize = this.valueSize,\n\t\t\toffset = index * valueSize * 3 + valueSize;\n\n\t\tfor ( let i = 0; i !== valueSize; i ++ ) {\n\n\t\t\tresult[ i ] = values[ offset + i ];\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer;\n\t\tconst values = this.sampleValues;\n\t\tconst stride = this.valueSize;\n\n\t\tconst stride2 = stride * 2;\n\t\tconst stride3 = stride * 3;\n\n\t\tconst td = t1 - t0;\n\n\t\tconst p = ( t - t0 ) / td;\n\t\tconst pp = p * p;\n\t\tconst ppp = pp * p;\n\n\t\tconst offset1 = i1 * stride3;\n\t\tconst offset0 = offset1 - stride3;\n\n\t\tconst s2 = - 2 * ppp + 3 * pp;\n\t\tconst s3 = ppp - pp;\n\t\tconst s0 = 1 - s2;\n\t\tconst s1 = s3 - pp + p;\n\n\t\t// Layout of keyframe output values for CUBICSPLINE animations:\n\t\t// [ inTangent_1, splineVertex_1, outTangent_1, inTangent_2, splineVertex_2, ... ]\n\t\tfor ( let i = 0; i !== stride; i ++ ) {\n\n\t\t\tconst p0 = values[ offset0 + i + stride ]; // splineVertex_k\n\t\t\tconst m0 = values[ offset0 + i + stride2 ] * td; // outTangent_k * (t_k+1 - t_k)\n\t\t\tconst p1 = values[ offset1 + i + stride ]; // splineVertex_k+1\n\t\t\tconst m1 = values[ offset1 + i ] * td; // inTangent_k+1 * (t_k+1 - t_k)\n\n\t\t\tresult[ i ] = s0 * p0 + s1 * m0 + s2 * p1 + s3 * m1;\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\nconst _q = new Quaternion();\n\nclass GLTFCubicSplineQuaternionInterpolant extends GLTFCubicSplineInterpolant {\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = super.interpolate_( i1, t0, t, t1 );\n\n\t\t_q.fromArray( result ).normalize().toArray( result );\n\n\t\treturn result;\n\n\t}\n\n}\n\n\n/*********************************/\n/********** INTERNALS ************/\n/*********************************/\n\n/* CONSTANTS */\n\nconst WEBGL_CONSTANTS = {\n\tFLOAT: 5126,\n\t//FLOAT_MAT2: 35674,\n\tFLOAT_MAT3: 35675,\n\tFLOAT_MAT4: 35676,\n\tFLOAT_VEC2: 35664,\n\tFLOAT_VEC3: 35665,\n\tFLOAT_VEC4: 35666,\n\tLINEAR: 9729,\n\tREPEAT: 10497,\n\tSAMPLER_2D: 35678,\n\tPOINTS: 0,\n\tLINES: 1,\n\tLINE_LOOP: 2,\n\tLINE_STRIP: 3,\n\tTRIANGLES: 4,\n\tTRIANGLE_STRIP: 5,\n\tTRIANGLE_FAN: 6,\n\tUNSIGNED_BYTE: 5121,\n\tUNSIGNED_SHORT: 5123\n};\n\nconst WEBGL_COMPONENT_TYPES = {\n\t5120: Int8Array,\n\t5121: Uint8Array,\n\t5122: Int16Array,\n\t5123: Uint16Array,\n\t5125: Uint32Array,\n\t5126: Float32Array\n};\n\nconst WEBGL_FILTERS = {\n\t9728: NearestFilter,\n\t9729: LinearFilter,\n\t9984: NearestMipmapNearestFilter,\n\t9985: LinearMipmapNearestFilter,\n\t9986: NearestMipmapLinearFilter,\n\t9987: LinearMipmapLinearFilter\n};\n\nconst WEBGL_WRAPPINGS = {\n\t33071: ClampToEdgeWrapping,\n\t33648: MirroredRepeatWrapping,\n\t10497: RepeatWrapping\n};\n\nconst WEBGL_TYPE_SIZES = {\n\t'SCALAR': 1,\n\t'VEC2': 2,\n\t'VEC3': 3,\n\t'VEC4': 4,\n\t'MAT2': 4,\n\t'MAT3': 9,\n\t'MAT4': 16\n};\n\nconst ATTRIBUTES = {\n\tPOSITION: 'position',\n\tNORMAL: 'normal',\n\tTANGENT: 'tangent',\n\tTEXCOORD_0: 'uv',\n\tTEXCOORD_1: 'uv1',\n\tTEXCOORD_2: 'uv2',\n\tTEXCOORD_3: 'uv3',\n\tCOLOR_0: 'color',\n\tWEIGHTS_0: 'skinWeight',\n\tJOINTS_0: 'skinIndex',\n};\n\nconst PATH_PROPERTIES = {\n\tscale: 'scale',\n\ttranslation: 'position',\n\trotation: 'quaternion',\n\tweights: 'morphTargetInfluences'\n};\n\nconst INTERPOLATION = {\n\tCUBICSPLINE: undefined, // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each\n\t\t // keyframe track will be initialized with a default interpolation type, then modified.\n\tLINEAR: InterpolateLinear,\n\tSTEP: InterpolateDiscrete\n};\n\nconst ALPHA_MODES = {\n\tOPAQUE: 'OPAQUE',\n\tMASK: 'MASK',\n\tBLEND: 'BLEND'\n};\n\n/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material\n */\nfunction createDefaultMaterial( cache ) {\n\n\tif ( cache[ 'DefaultMaterial' ] === undefined ) {\n\n\t\tcache[ 'DefaultMaterial' ] = new MeshStandardMaterial( {\n\t\t\tcolor: 0xFFFFFF,\n\t\t\temissive: 0x000000,\n\t\t\tmetalness: 1,\n\t\t\troughness: 1,\n\t\t\ttransparent: false,\n\t\t\tdepthTest: true,\n\t\t\tside: FrontSide\n\t\t} );\n\n\t}\n\n\treturn cache[ 'DefaultMaterial' ];\n\n}\n\nfunction addUnknownExtensionsToUserData( knownExtensions, object, objectDef ) {\n\n\t// Add unknown glTF extensions to an object's userData.\n\n\tfor ( const name in objectDef.extensions ) {\n\n\t\tif ( knownExtensions[ name ] === undefined ) {\n\n\t\t\tobject.userData.gltfExtensions = object.userData.gltfExtensions || {};\n\t\t\tobject.userData.gltfExtensions[ name ] = objectDef.extensions[ name ];\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * @param {Object3D|Material|BufferGeometry} object\n * @param {GLTF.definition} gltfDef\n */\nfunction assignExtrasToUserData( object, gltfDef ) {\n\n\tif ( gltfDef.extras !== undefined ) {\n\n\t\tif ( typeof gltfDef.extras === 'object' ) {\n\n\t\t\tObject.assign( object.userData, gltfDef.extras );\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.GLTFLoader: Ignoring primitive type .extras, ' + gltfDef.extras );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets\n *\n * @param {BufferGeometry} geometry\n * @param {Array} targets\n * @param {GLTFParser} parser\n * @return {Promise}\n */\nfunction addMorphTargets( geometry, targets, parser ) {\n\n\tlet hasMorphPosition = false;\n\tlet hasMorphNormal = false;\n\tlet hasMorphColor = false;\n\n\tfor ( let i = 0, il = targets.length; i < il; i ++ ) {\n\n\t\tconst target = targets[ i ];\n\n\t\tif ( target.POSITION !== undefined ) hasMorphPosition = true;\n\t\tif ( target.NORMAL !== undefined ) hasMorphNormal = true;\n\t\tif ( target.COLOR_0 !== undefined ) hasMorphColor = true;\n\n\t\tif ( hasMorphPosition && hasMorphNormal && hasMorphColor ) break;\n\n\t}\n\n\tif ( ! hasMorphPosition && ! hasMorphNormal && ! hasMorphColor ) return Promise.resolve( geometry );\n\n\tconst pendingPositionAccessors = [];\n\tconst pendingNormalAccessors = [];\n\tconst pendingColorAccessors = [];\n\n\tfor ( let i = 0, il = targets.length; i < il; i ++ ) {\n\n\t\tconst target = targets[ i ];\n\n\t\tif ( hasMorphPosition ) {\n\n\t\t\tconst pendingAccessor = target.POSITION !== undefined\n\t\t\t\t? parser.getDependency( 'accessor', target.POSITION )\n\t\t\t\t: geometry.attributes.position;\n\n\t\t\tpendingPositionAccessors.push( pendingAccessor );\n\n\t\t}\n\n\t\tif ( hasMorphNormal ) {\n\n\t\t\tconst pendingAccessor = target.NORMAL !== undefined\n\t\t\t\t? parser.getDependency( 'accessor', target.NORMAL )\n\t\t\t\t: geometry.attributes.normal;\n\n\t\t\tpendingNormalAccessors.push( pendingAccessor );\n\n\t\t}\n\n\t\tif ( hasMorphColor ) {\n\n\t\t\tconst pendingAccessor = target.COLOR_0 !== undefined\n\t\t\t\t? parser.getDependency( 'accessor', target.COLOR_0 )\n\t\t\t\t: geometry.attributes.color;\n\n\t\t\tpendingColorAccessors.push( pendingAccessor );\n\n\t\t}\n\n\t}\n\n\treturn Promise.all( [\n\t\tPromise.all( pendingPositionAccessors ),\n\t\tPromise.all( pendingNormalAccessors ),\n\t\tPromise.all( pendingColorAccessors )\n\t] ).then( function ( accessors ) {\n\n\t\tconst morphPositions = accessors[ 0 ];\n\t\tconst morphNormals = accessors[ 1 ];\n\t\tconst morphColors = accessors[ 2 ];\n\n\t\tif ( hasMorphPosition ) geometry.morphAttributes.position = morphPositions;\n\t\tif ( hasMorphNormal ) geometry.morphAttributes.normal = morphNormals;\n\t\tif ( hasMorphColor ) geometry.morphAttributes.color = morphColors;\n\t\tgeometry.morphTargetsRelative = true;\n\n\t\treturn geometry;\n\n\t} );\n\n}\n\n/**\n * @param {Mesh} mesh\n * @param {GLTF.Mesh} meshDef\n */\nfunction updateMorphTargets( mesh, meshDef ) {\n\n\tmesh.updateMorphTargets();\n\n\tif ( meshDef.weights !== undefined ) {\n\n\t\tfor ( let i = 0, il = meshDef.weights.length; i < il; i ++ ) {\n\n\t\t\tmesh.morphTargetInfluences[ i ] = meshDef.weights[ i ];\n\n\t\t}\n\n\t}\n\n\t// .extras has user-defined data, so check that .extras.targetNames is an array.\n\tif ( meshDef.extras && Array.isArray( meshDef.extras.targetNames ) ) {\n\n\t\tconst targetNames = meshDef.extras.targetNames;\n\n\t\tif ( mesh.morphTargetInfluences.length === targetNames.length ) {\n\n\t\t\tmesh.morphTargetDictionary = {};\n\n\t\t\tfor ( let i = 0, il = targetNames.length; i < il; i ++ ) {\n\n\t\t\t\tmesh.morphTargetDictionary[ targetNames[ i ] ] = i;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.' );\n\n\t\t}\n\n\t}\n\n}\n\nfunction createPrimitiveKey( primitiveDef ) {\n\n\tlet geometryKey;\n\n\tconst dracoExtension = primitiveDef.extensions && primitiveDef.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ];\n\n\tif ( dracoExtension ) {\n\n\t\tgeometryKey = 'draco:' + dracoExtension.bufferView\n\t\t\t\t+ ':' + dracoExtension.indices\n\t\t\t\t+ ':' + createAttributesKey( dracoExtension.attributes );\n\n\t} else {\n\n\t\tgeometryKey = primitiveDef.indices + ':' + createAttributesKey( primitiveDef.attributes ) + ':' + primitiveDef.mode;\n\n\t}\n\n\tif ( primitiveDef.targets !== undefined ) {\n\n\t\tfor ( let i = 0, il = primitiveDef.targets.length; i < il; i ++ ) {\n\n\t\t\tgeometryKey += ':' + createAttributesKey( primitiveDef.targets[ i ] );\n\n\t\t}\n\n\t}\n\n\treturn geometryKey;\n\n}\n\nfunction createAttributesKey( attributes ) {\n\n\tlet attributesKey = '';\n\n\tconst keys = Object.keys( attributes ).sort();\n\n\tfor ( let i = 0, il = keys.length; i < il; i ++ ) {\n\n\t\tattributesKey += keys[ i ] + ':' + attributes[ keys[ i ] ] + ';';\n\n\t}\n\n\treturn attributesKey;\n\n}\n\nfunction getNormalizedComponentScale( constructor ) {\n\n\t// Reference:\n\t// https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization#encoding-quantized-data\n\n\tswitch ( constructor ) {\n\n\t\tcase Int8Array:\n\t\t\treturn 1 / 127;\n\n\t\tcase Uint8Array:\n\t\t\treturn 1 / 255;\n\n\t\tcase Int16Array:\n\t\t\treturn 1 / 32767;\n\n\t\tcase Uint16Array:\n\t\t\treturn 1 / 65535;\n\n\t\tdefault:\n\t\t\tthrow new Error( 'THREE.GLTFLoader: Unsupported normalized accessor component type.' );\n\n\t}\n\n}\n\nfunction getImageURIMimeType( uri ) {\n\n\tif ( uri.search( /\\.jpe?g($|\\?)/i ) > 0 || uri.search( /^data\\:image\\/jpeg/ ) === 0 ) return 'image/jpeg';\n\tif ( uri.search( /\\.webp($|\\?)/i ) > 0 || uri.search( /^data\\:image\\/webp/ ) === 0 ) return 'image/webp';\n\tif ( uri.search( /\\.ktx2($|\\?)/i ) > 0 || uri.search( /^data\\:image\\/ktx2/ ) === 0 ) return 'image/ktx2';\n\n\treturn 'image/png';\n\n}\n\nconst _identityMatrix = new Matrix4();\n\n/* GLTF PARSER */\n\nclass GLTFParser {\n\n\tconstructor( json = {}, options = {} ) {\n\n\t\tthis.json = json;\n\t\tthis.extensions = {};\n\t\tthis.plugins = {};\n\t\tthis.options = options;\n\n\t\t// loader object cache\n\t\tthis.cache = new GLTFRegistry();\n\n\t\t// associations between Three.js objects and glTF elements\n\t\tthis.associations = new Map();\n\n\t\t// BufferGeometry caching\n\t\tthis.primitiveCache = {};\n\n\t\t// Node cache\n\t\tthis.nodeCache = {};\n\n\t\t// Object3D instance caches\n\t\tthis.meshCache = { refs: {}, uses: {} };\n\t\tthis.cameraCache = { refs: {}, uses: {} };\n\t\tthis.lightCache = { refs: {}, uses: {} };\n\n\t\tthis.sourceCache = {};\n\t\tthis.textureCache = {};\n\n\t\t// Track node names, to ensure no duplicates\n\t\tthis.nodeNamesUsed = {};\n\n\t\t// Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the\n\t\t// expensive work of uploading a texture to the GPU off the main thread.\n\n\t\tlet isSafari = false;\n\t\tlet safariVersion = - 1;\n\t\tlet isFirefox = false;\n\t\tlet firefoxVersion = - 1;\n\n\t\tif ( typeof navigator !== 'undefined' ) {\n\n\t\t\tconst userAgent = navigator.userAgent;\n\n\t\t\tisSafari = /^((?!chrome|android).)*safari/i.test( userAgent ) === true;\n\t\t\tconst safariMatch = userAgent.match( /Version\\/(\\d+)/ );\n\t\t\tsafariVersion = isSafari && safariMatch ? parseInt( safariMatch[ 1 ], 10 ) : - 1;\n\n\t\t\tisFirefox = userAgent.indexOf( 'Firefox' ) > - 1;\n\t\t\tfirefoxVersion = isFirefox ? userAgent.match( /Firefox\\/([0-9]+)\\./ )[ 1 ] : - 1;\n\n\t\t}\n\n\t\tif ( typeof createImageBitmap === 'undefined' || ( isSafari && safariVersion < 17 ) || ( isFirefox && firefoxVersion < 98 ) ) {\n\n\t\t\tthis.textureLoader = new TextureLoader( this.options.manager );\n\n\t\t} else {\n\n\t\t\tthis.textureLoader = new ImageBitmapLoader( this.options.manager );\n\n\t\t}\n\n\t\tthis.textureLoader.setCrossOrigin( this.options.crossOrigin );\n\t\tthis.textureLoader.setRequestHeader( this.options.requestHeader );\n\n\t\tthis.fileLoader = new FileLoader( this.options.manager );\n\t\tthis.fileLoader.setResponseType( 'arraybuffer' );\n\n\t\tif ( this.options.crossOrigin === 'use-credentials' ) {\n\n\t\t\tthis.fileLoader.setWithCredentials( true );\n\n\t\t}\n\n\t}\n\n\tsetExtensions( extensions ) {\n\n\t\tthis.extensions = extensions;\n\n\t}\n\n\tsetPlugins( plugins ) {\n\n\t\tthis.plugins = plugins;\n\n\t}\n\n\tparse( onLoad, onError ) {\n\n\t\tconst parser = this;\n\t\tconst json = this.json;\n\t\tconst extensions = this.extensions;\n\n\t\t// Clear the loader cache\n\t\tthis.cache.removeAll();\n\t\tthis.nodeCache = {};\n\n\t\t// Mark the special nodes/meshes in json for efficient parse\n\t\tthis._invokeAll( function ( ext ) {\n\n\t\t\treturn ext._markDefs && ext._markDefs();\n\n\t\t} );\n\n\t\tPromise.all( this._invokeAll( function ( ext ) {\n\n\t\t\treturn ext.beforeRoot && ext.beforeRoot();\n\n\t\t} ) ).then( function () {\n\n\t\t\treturn Promise.all( [\n\n\t\t\t\tparser.getDependencies( 'scene' ),\n\t\t\t\tparser.getDependencies( 'animation' ),\n\t\t\t\tparser.getDependencies( 'camera' ),\n\n\t\t\t] );\n\n\t\t} ).then( function ( dependencies ) {\n\n\t\t\tconst result = {\n\t\t\t\tscene: dependencies[ 0 ][ json.scene || 0 ],\n\t\t\t\tscenes: dependencies[ 0 ],\n\t\t\t\tanimations: dependencies[ 1 ],\n\t\t\t\tcameras: dependencies[ 2 ],\n\t\t\t\tasset: json.asset,\n\t\t\t\tparser: parser,\n\t\t\t\tuserData: {}\n\t\t\t};\n\n\t\t\taddUnknownExtensionsToUserData( extensions, result, json );\n\n\t\t\tassignExtrasToUserData( result, json );\n\n\t\t\treturn Promise.all( parser._invokeAll( function ( ext ) {\n\n\t\t\t\treturn ext.afterRoot && ext.afterRoot( result );\n\n\t\t\t} ) ).then( function () {\n\n\t\t\t\tfor ( const scene of result.scenes ) {\n\n\t\t\t\t\tscene.updateMatrixWorld();\n\n\t\t\t\t}\n\n\t\t\t\tonLoad( result );\n\n\t\t\t} );\n\n\t\t} ).catch( onError );\n\n\t}\n\n\t/**\n\t * Marks the special nodes/meshes in json for efficient parse.\n\t */\n\t_markDefs() {\n\n\t\tconst nodeDefs = this.json.nodes || [];\n\t\tconst skinDefs = this.json.skins || [];\n\t\tconst meshDefs = this.json.meshes || [];\n\n\t\t// Nothing in the node definition indicates whether it is a Bone or an\n\t\t// Object3D. Use the skins' joint references to mark bones.\n\t\tfor ( let skinIndex = 0, skinLength = skinDefs.length; skinIndex < skinLength; skinIndex ++ ) {\n\n\t\t\tconst joints = skinDefs[ skinIndex ].joints;\n\n\t\t\tfor ( let i = 0, il = joints.length; i < il; i ++ ) {\n\n\t\t\t\tnodeDefs[ joints[ i ] ].isBone = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Iterate over all nodes, marking references to shared resources,\n\t\t// as well as skeleton joints.\n\t\tfor ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) {\n\n\t\t\tconst nodeDef = nodeDefs[ nodeIndex ];\n\n\t\t\tif ( nodeDef.mesh !== undefined ) {\n\n\t\t\t\tthis._addNodeRef( this.meshCache, nodeDef.mesh );\n\n\t\t\t\t// Nothing in the mesh definition indicates whether it is\n\t\t\t\t// a SkinnedMesh or Mesh. Use the node's mesh reference\n\t\t\t\t// to mark SkinnedMesh if node has skin.\n\t\t\t\tif ( nodeDef.skin !== undefined ) {\n\n\t\t\t\t\tmeshDefs[ nodeDef.mesh ].isSkinnedMesh = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( nodeDef.camera !== undefined ) {\n\n\t\t\t\tthis._addNodeRef( this.cameraCache, nodeDef.camera );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Counts references to shared node / Object3D resources. These resources\n\t * can be reused, or \"instantiated\", at multiple nodes in the scene\n\t * hierarchy. Mesh, Camera, and Light instances are instantiated and must\n\t * be marked. Non-scenegraph resources (like Materials, Geometries, and\n\t * Textures) can be reused directly and are not marked here.\n\t *\n\t * Example: CesiumMilkTruck sample model reuses \"Wheel\" meshes.\n\t */\n\t_addNodeRef( cache, index ) {\n\n\t\tif ( index === undefined ) return;\n\n\t\tif ( cache.refs[ index ] === undefined ) {\n\n\t\t\tcache.refs[ index ] = cache.uses[ index ] = 0;\n\n\t\t}\n\n\t\tcache.refs[ index ] ++;\n\n\t}\n\n\t/** Returns a reference to a shared resource, cloning it if necessary. */\n\t_getNodeRef( cache, index, object ) {\n\n\t\tif ( cache.refs[ index ] <= 1 ) return object;\n\n\t\tconst ref = object.clone();\n\n\t\t// Propagates mappings to the cloned object, prevents mappings on the\n\t\t// original object from being lost.\n\t\tconst updateMappings = ( original, clone ) => {\n\n\t\t\tconst mappings = this.associations.get( original );\n\t\t\tif ( mappings != null ) {\n\n\t\t\t\tthis.associations.set( clone, mappings );\n\n\t\t\t}\n\n\t\t\tfor ( const [ i, child ] of original.children.entries() ) {\n\n\t\t\t\tupdateMappings( child, clone.children[ i ] );\n\n\t\t\t}\n\n\t\t};\n\n\t\tupdateMappings( object, ref );\n\n\t\tref.name += '_instance_' + ( cache.uses[ index ] ++ );\n\n\t\treturn ref;\n\n\t}\n\n\t_invokeOne( func ) {\n\n\t\tconst extensions = Object.values( this.plugins );\n\t\textensions.push( this );\n\n\t\tfor ( let i = 0; i < extensions.length; i ++ ) {\n\n\t\t\tconst result = func( extensions[ i ] );\n\n\t\t\tif ( result ) return result;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t_invokeAll( func ) {\n\n\t\tconst extensions = Object.values( this.plugins );\n\t\textensions.unshift( this );\n\n\t\tconst pending = [];\n\n\t\tfor ( let i = 0; i < extensions.length; i ++ ) {\n\n\t\t\tconst result = func( extensions[ i ] );\n\n\t\t\tif ( result ) pending.push( result );\n\n\t\t}\n\n\t\treturn pending;\n\n\t}\n\n\t/**\n\t * Requests the specified dependency asynchronously, with caching.\n\t * @param {string} type\n\t * @param {number} index\n\t * @return {Promise}\n\t */\n\tgetDependency( type, index ) {\n\n\t\tconst cacheKey = type + ':' + index;\n\t\tlet dependency = this.cache.get( cacheKey );\n\n\t\tif ( ! dependency ) {\n\n\t\t\tswitch ( type ) {\n\n\t\t\t\tcase 'scene':\n\t\t\t\t\tdependency = this.loadScene( index );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'node':\n\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\treturn ext.loadNode && ext.loadNode( index );\n\n\t\t\t\t\t} );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'mesh':\n\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\treturn ext.loadMesh && ext.loadMesh( index );\n\n\t\t\t\t\t} );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'accessor':\n\t\t\t\t\tdependency = this.loadAccessor( index );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'bufferView':\n\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\treturn ext.loadBufferView && ext.loadBufferView( index );\n\n\t\t\t\t\t} );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'buffer':\n\t\t\t\t\tdependency = this.loadBuffer( index );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'material':\n\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\treturn ext.loadMaterial && ext.loadMaterial( index );\n\n\t\t\t\t\t} );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'texture':\n\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\treturn ext.loadTexture && ext.loadTexture( index );\n\n\t\t\t\t\t} );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'skin':\n\t\t\t\t\tdependency = this.loadSkin( index );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'animation':\n\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\treturn ext.loadAnimation && ext.loadAnimation( index );\n\n\t\t\t\t\t} );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'camera':\n\t\t\t\t\tdependency = this.loadCamera( index );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\treturn ext != this && ext.getDependency && ext.getDependency( type, index );\n\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( ! dependency ) {\n\n\t\t\t\t\t\tthrow new Error( 'Unknown type: ' + type );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tthis.cache.add( cacheKey, dependency );\n\n\t\t}\n\n\t\treturn dependency;\n\n\t}\n\n\t/**\n\t * Requests all dependencies of the specified type asynchronously, with caching.\n\t * @param {string} type\n\t * @return {Promise>}\n\t */\n\tgetDependencies( type ) {\n\n\t\tlet dependencies = this.cache.get( type );\n\n\t\tif ( ! dependencies ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst defs = this.json[ type + ( type === 'mesh' ? 'es' : 's' ) ] || [];\n\n\t\t\tdependencies = Promise.all( defs.map( function ( def, index ) {\n\n\t\t\t\treturn parser.getDependency( type, index );\n\n\t\t\t} ) );\n\n\t\t\tthis.cache.add( type, dependencies );\n\n\t\t}\n\n\t\treturn dependencies;\n\n\t}\n\n\t/**\n\t * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views\n\t * @param {number} bufferIndex\n\t * @return {Promise}\n\t */\n\tloadBuffer( bufferIndex ) {\n\n\t\tconst bufferDef = this.json.buffers[ bufferIndex ];\n\t\tconst loader = this.fileLoader;\n\n\t\tif ( bufferDef.type && bufferDef.type !== 'arraybuffer' ) {\n\n\t\t\tthrow new Error( 'THREE.GLTFLoader: ' + bufferDef.type + ' buffer type is not supported.' );\n\n\t\t}\n\n\t\t// If present, GLB container is required to be the first buffer.\n\t\tif ( bufferDef.uri === undefined && bufferIndex === 0 ) {\n\n\t\t\treturn Promise.resolve( this.extensions[ EXTENSIONS.KHR_BINARY_GLTF ].body );\n\n\t\t}\n\n\t\tconst options = this.options;\n\n\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\tloader.load( LoaderUtils.resolveURL( bufferDef.uri, options.path ), resolve, undefined, function () {\n\n\t\t\t\treject( new Error( 'THREE.GLTFLoader: Failed to load buffer \"' + bufferDef.uri + '\".' ) );\n\n\t\t\t} );\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views\n\t * @param {number} bufferViewIndex\n\t * @return {Promise}\n\t */\n\tloadBufferView( bufferViewIndex ) {\n\n\t\tconst bufferViewDef = this.json.bufferViews[ bufferViewIndex ];\n\n\t\treturn this.getDependency( 'buffer', bufferViewDef.buffer ).then( function ( buffer ) {\n\n\t\t\tconst byteLength = bufferViewDef.byteLength || 0;\n\t\t\tconst byteOffset = bufferViewDef.byteOffset || 0;\n\t\t\treturn buffer.slice( byteOffset, byteOffset + byteLength );\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors\n\t * @param {number} accessorIndex\n\t * @return {Promise}\n\t */\n\tloadAccessor( accessorIndex ) {\n\n\t\tconst parser = this;\n\t\tconst json = this.json;\n\n\t\tconst accessorDef = this.json.accessors[ accessorIndex ];\n\n\t\tif ( accessorDef.bufferView === undefined && accessorDef.sparse === undefined ) {\n\n\t\t\tconst itemSize = WEBGL_TYPE_SIZES[ accessorDef.type ];\n\t\t\tconst TypedArray = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ];\n\t\t\tconst normalized = accessorDef.normalized === true;\n\n\t\t\tconst array = new TypedArray( accessorDef.count * itemSize );\n\t\t\treturn Promise.resolve( new BufferAttribute( array, itemSize, normalized ) );\n\n\t\t}\n\n\t\tconst pendingBufferViews = [];\n\n\t\tif ( accessorDef.bufferView !== undefined ) {\n\n\t\t\tpendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.bufferView ) );\n\n\t\t} else {\n\n\t\t\tpendingBufferViews.push( null );\n\n\t\t}\n\n\t\tif ( accessorDef.sparse !== undefined ) {\n\n\t\t\tpendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.indices.bufferView ) );\n\t\t\tpendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.values.bufferView ) );\n\n\t\t}\n\n\t\treturn Promise.all( pendingBufferViews ).then( function ( bufferViews ) {\n\n\t\t\tconst bufferView = bufferViews[ 0 ];\n\n\t\t\tconst itemSize = WEBGL_TYPE_SIZES[ accessorDef.type ];\n\t\t\tconst TypedArray = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ];\n\n\t\t\t// For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12.\n\t\t\tconst elementBytes = TypedArray.BYTES_PER_ELEMENT;\n\t\t\tconst itemBytes = elementBytes * itemSize;\n\t\t\tconst byteOffset = accessorDef.byteOffset || 0;\n\t\t\tconst byteStride = accessorDef.bufferView !== undefined ? json.bufferViews[ accessorDef.bufferView ].byteStride : undefined;\n\t\t\tconst normalized = accessorDef.normalized === true;\n\t\t\tlet array, bufferAttribute;\n\n\t\t\t// The buffer is not interleaved if the stride is the item size in bytes.\n\t\t\tif ( byteStride && byteStride !== itemBytes ) {\n\n\t\t\t\t// Each \"slice\" of the buffer, as defined by 'count' elements of 'byteStride' bytes, gets its own InterleavedBuffer\n\t\t\t\t// This makes sure that IBA.count reflects accessor.count properly\n\t\t\t\tconst ibSlice = Math.floor( byteOffset / byteStride );\n\t\t\t\tconst ibCacheKey = 'InterleavedBuffer:' + accessorDef.bufferView + ':' + accessorDef.componentType + ':' + ibSlice + ':' + accessorDef.count;\n\t\t\t\tlet ib = parser.cache.get( ibCacheKey );\n\n\t\t\t\tif ( ! ib ) {\n\n\t\t\t\t\tarray = new TypedArray( bufferView, ibSlice * byteStride, accessorDef.count * byteStride / elementBytes );\n\n\t\t\t\t\t// Integer parameters to IB/IBA are in array elements, not bytes.\n\t\t\t\t\tib = new InterleavedBuffer( array, byteStride / elementBytes );\n\n\t\t\t\t\tparser.cache.add( ibCacheKey, ib );\n\n\t\t\t\t}\n\n\t\t\t\tbufferAttribute = new InterleavedBufferAttribute( ib, itemSize, ( byteOffset % byteStride ) / elementBytes, normalized );\n\n\t\t\t} else {\n\n\t\t\t\tif ( bufferView === null ) {\n\n\t\t\t\t\tarray = new TypedArray( accessorDef.count * itemSize );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tarray = new TypedArray( bufferView, byteOffset, accessorDef.count * itemSize );\n\n\t\t\t\t}\n\n\t\t\t\tbufferAttribute = new BufferAttribute( array, itemSize, normalized );\n\n\t\t\t}\n\n\t\t\t// https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#sparse-accessors\n\t\t\tif ( accessorDef.sparse !== undefined ) {\n\n\t\t\t\tconst itemSizeIndices = WEBGL_TYPE_SIZES.SCALAR;\n\t\t\t\tconst TypedArrayIndices = WEBGL_COMPONENT_TYPES[ accessorDef.sparse.indices.componentType ];\n\n\t\t\t\tconst byteOffsetIndices = accessorDef.sparse.indices.byteOffset || 0;\n\t\t\t\tconst byteOffsetValues = accessorDef.sparse.values.byteOffset || 0;\n\n\t\t\t\tconst sparseIndices = new TypedArrayIndices( bufferViews[ 1 ], byteOffsetIndices, accessorDef.sparse.count * itemSizeIndices );\n\t\t\t\tconst sparseValues = new TypedArray( bufferViews[ 2 ], byteOffsetValues, accessorDef.sparse.count * itemSize );\n\n\t\t\t\tif ( bufferView !== null ) {\n\n\t\t\t\t\t// Avoid modifying the original ArrayBuffer, if the bufferView wasn't initialized with zeroes.\n\t\t\t\t\tbufferAttribute = new BufferAttribute( bufferAttribute.array.slice(), bufferAttribute.itemSize, bufferAttribute.normalized );\n\n\t\t\t\t}\n\n\t\t\t\t// Ignore normalized since we copy from sparse\n\t\t\t\tbufferAttribute.normalized = false;\n\n\t\t\t\tfor ( let i = 0, il = sparseIndices.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst index = sparseIndices[ i ];\n\n\t\t\t\t\tbufferAttribute.setX( index, sparseValues[ i * itemSize ] );\n\t\t\t\t\tif ( itemSize >= 2 ) bufferAttribute.setY( index, sparseValues[ i * itemSize + 1 ] );\n\t\t\t\t\tif ( itemSize >= 3 ) bufferAttribute.setZ( index, sparseValues[ i * itemSize + 2 ] );\n\t\t\t\t\tif ( itemSize >= 4 ) bufferAttribute.setW( index, sparseValues[ i * itemSize + 3 ] );\n\t\t\t\t\tif ( itemSize >= 5 ) throw new Error( 'THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.' );\n\n\t\t\t\t}\n\n\t\t\t\tbufferAttribute.normalized = normalized;\n\n\t\t\t}\n\n\t\t\treturn bufferAttribute;\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures\n\t * @param {number} textureIndex\n\t * @return {Promise}\n\t */\n\tloadTexture( textureIndex ) {\n\n\t\tconst json = this.json;\n\t\tconst options = this.options;\n\t\tconst textureDef = json.textures[ textureIndex ];\n\t\tconst sourceIndex = textureDef.source;\n\t\tconst sourceDef = json.images[ sourceIndex ];\n\n\t\tlet loader = this.textureLoader;\n\n\t\tif ( sourceDef.uri ) {\n\n\t\t\tconst handler = options.manager.getHandler( sourceDef.uri );\n\t\t\tif ( handler !== null ) loader = handler;\n\n\t\t}\n\n\t\treturn this.loadTextureImage( textureIndex, sourceIndex, loader );\n\n\t}\n\n\tloadTextureImage( textureIndex, sourceIndex, loader ) {\n\n\t\tconst parser = this;\n\t\tconst json = this.json;\n\n\t\tconst textureDef = json.textures[ textureIndex ];\n\t\tconst sourceDef = json.images[ sourceIndex ];\n\n\t\tconst cacheKey = ( sourceDef.uri || sourceDef.bufferView ) + ':' + textureDef.sampler;\n\n\t\tif ( this.textureCache[ cacheKey ] ) {\n\n\t\t\t// See https://github.com/mrdoob/three.js/issues/21559.\n\t\t\treturn this.textureCache[ cacheKey ];\n\n\t\t}\n\n\t\tconst promise = this.loadImageSource( sourceIndex, loader ).then( function ( texture ) {\n\n\t\t\ttexture.flipY = false;\n\n\t\t\ttexture.name = textureDef.name || sourceDef.name || '';\n\n\t\t\tif ( texture.name === '' && typeof sourceDef.uri === 'string' && sourceDef.uri.startsWith( 'data:image/' ) === false ) {\n\n\t\t\t\ttexture.name = sourceDef.uri;\n\n\t\t\t}\n\n\t\t\tconst samplers = json.samplers || {};\n\t\t\tconst sampler = samplers[ textureDef.sampler ] || {};\n\n\t\t\ttexture.magFilter = WEBGL_FILTERS[ sampler.magFilter ] || LinearFilter;\n\t\t\ttexture.minFilter = WEBGL_FILTERS[ sampler.minFilter ] || LinearMipmapLinearFilter;\n\t\t\ttexture.wrapS = WEBGL_WRAPPINGS[ sampler.wrapS ] || RepeatWrapping;\n\t\t\ttexture.wrapT = WEBGL_WRAPPINGS[ sampler.wrapT ] || RepeatWrapping;\n\t\t\ttexture.generateMipmaps = ! texture.isCompressedTexture && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter;\n\n\t\t\tparser.associations.set( texture, { textures: textureIndex } );\n\n\t\t\treturn texture;\n\n\t\t} ).catch( function () {\n\n\t\t\treturn null;\n\n\t\t} );\n\n\t\tthis.textureCache[ cacheKey ] = promise;\n\n\t\treturn promise;\n\n\t}\n\n\tloadImageSource( sourceIndex, loader ) {\n\n\t\tconst parser = this;\n\t\tconst json = this.json;\n\t\tconst options = this.options;\n\n\t\tif ( this.sourceCache[ sourceIndex ] !== undefined ) {\n\n\t\t\treturn this.sourceCache[ sourceIndex ].then( ( texture ) => texture.clone() );\n\n\t\t}\n\n\t\tconst sourceDef = json.images[ sourceIndex ];\n\n\t\tconst URL = self.URL || self.webkitURL;\n\n\t\tlet sourceURI = sourceDef.uri || '';\n\t\tlet isObjectURL = false;\n\n\t\tif ( sourceDef.bufferView !== undefined ) {\n\n\t\t\t// Load binary image data from bufferView, if provided.\n\n\t\t\tsourceURI = parser.getDependency( 'bufferView', sourceDef.bufferView ).then( function ( bufferView ) {\n\n\t\t\t\tisObjectURL = true;\n\t\t\t\tconst blob = new Blob( [ bufferView ], { type: sourceDef.mimeType } );\n\t\t\t\tsourceURI = URL.createObjectURL( blob );\n\t\t\t\treturn sourceURI;\n\n\t\t\t} );\n\n\t\t} else if ( sourceDef.uri === undefined ) {\n\n\t\t\tthrow new Error( 'THREE.GLTFLoader: Image ' + sourceIndex + ' is missing URI and bufferView' );\n\n\t\t}\n\n\t\tconst promise = Promise.resolve( sourceURI ).then( function ( sourceURI ) {\n\n\t\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\t\tlet onLoad = resolve;\n\n\t\t\t\tif ( loader.isImageBitmapLoader === true ) {\n\n\t\t\t\t\tonLoad = function ( imageBitmap ) {\n\n\t\t\t\t\t\tconst texture = new Texture( imageBitmap );\n\t\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\t\tresolve( texture );\n\n\t\t\t\t\t};\n\n\t\t\t\t}\n\n\t\t\t\tloader.load( LoaderUtils.resolveURL( sourceURI, options.path ), onLoad, undefined, reject );\n\n\t\t\t} );\n\n\t\t} ).then( function ( texture ) {\n\n\t\t\t// Clean up resources and configure Texture.\n\n\t\t\tif ( isObjectURL === true ) {\n\n\t\t\t\tURL.revokeObjectURL( sourceURI );\n\n\t\t\t}\n\n\t\t\tassignExtrasToUserData( texture, sourceDef );\n\n\t\t\ttexture.userData.mimeType = sourceDef.mimeType || getImageURIMimeType( sourceDef.uri );\n\n\t\t\treturn texture;\n\n\t\t} ).catch( function ( error ) {\n\n\t\t\tconsole.error( 'THREE.GLTFLoader: Couldn\\'t load texture', sourceURI );\n\t\t\tthrow error;\n\n\t\t} );\n\n\t\tthis.sourceCache[ sourceIndex ] = promise;\n\t\treturn promise;\n\n\t}\n\n\t/**\n\t * Asynchronously assigns a texture to the given material parameters.\n\t * @param {Object} materialParams\n\t * @param {string} mapName\n\t * @param {Object} mapDef\n\t * @return {Promise}\n\t */\n\tassignTexture( materialParams, mapName, mapDef, colorSpace ) {\n\n\t\tconst parser = this;\n\n\t\treturn this.getDependency( 'texture', mapDef.index ).then( function ( texture ) {\n\n\t\t\tif ( ! texture ) return null;\n\n\t\t\tif ( mapDef.texCoord !== undefined && mapDef.texCoord > 0 ) {\n\n\t\t\t\ttexture = texture.clone();\n\t\t\t\ttexture.channel = mapDef.texCoord;\n\n\t\t\t}\n\n\t\t\tif ( parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] ) {\n\n\t\t\t\tconst transform = mapDef.extensions !== undefined ? mapDef.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] : undefined;\n\n\t\t\t\tif ( transform ) {\n\n\t\t\t\t\tconst gltfReference = parser.associations.get( texture );\n\t\t\t\t\ttexture = parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ].extendTexture( texture, transform );\n\t\t\t\t\tparser.associations.set( texture, gltfReference );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( colorSpace !== undefined ) {\n\n\t\t\t\ttexture.colorSpace = colorSpace;\n\n\t\t\t}\n\n\t\t\tmaterialParams[ mapName ] = texture;\n\n\t\t\treturn texture;\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Assigns final material to a Mesh, Line, or Points instance. The instance\n\t * already has a material (generated from the glTF material options alone)\n\t * but reuse of the same glTF material may require multiple threejs materials\n\t * to accommodate different primitive types, defines, etc. New materials will\n\t * be created if necessary, and reused from a cache.\n\t * @param {Object3D} mesh Mesh, Line, or Points instance.\n\t */\n\tassignFinalMaterial( mesh ) {\n\n\t\tconst geometry = mesh.geometry;\n\t\tlet material = mesh.material;\n\n\t\tconst useDerivativeTangents = geometry.attributes.tangent === undefined;\n\t\tconst useVertexColors = geometry.attributes.color !== undefined;\n\t\tconst useFlatShading = geometry.attributes.normal === undefined;\n\n\t\tif ( mesh.isPoints ) {\n\n\t\t\tconst cacheKey = 'PointsMaterial:' + material.uuid;\n\n\t\t\tlet pointsMaterial = this.cache.get( cacheKey );\n\n\t\t\tif ( ! pointsMaterial ) {\n\n\t\t\t\tpointsMaterial = new PointsMaterial();\n\t\t\t\tMaterial.prototype.copy.call( pointsMaterial, material );\n\t\t\t\tpointsMaterial.color.copy( material.color );\n\t\t\t\tpointsMaterial.map = material.map;\n\t\t\t\tpointsMaterial.sizeAttenuation = false; // glTF spec says points should be 1px\n\n\t\t\t\tthis.cache.add( cacheKey, pointsMaterial );\n\n\t\t\t}\n\n\t\t\tmaterial = pointsMaterial;\n\n\t\t} else if ( mesh.isLine ) {\n\n\t\t\tconst cacheKey = 'LineBasicMaterial:' + material.uuid;\n\n\t\t\tlet lineMaterial = this.cache.get( cacheKey );\n\n\t\t\tif ( ! lineMaterial ) {\n\n\t\t\t\tlineMaterial = new LineBasicMaterial();\n\t\t\t\tMaterial.prototype.copy.call( lineMaterial, material );\n\t\t\t\tlineMaterial.color.copy( material.color );\n\t\t\t\tlineMaterial.map = material.map;\n\n\t\t\t\tthis.cache.add( cacheKey, lineMaterial );\n\n\t\t\t}\n\n\t\t\tmaterial = lineMaterial;\n\n\t\t}\n\n\t\t// Clone the material if it will be modified\n\t\tif ( useDerivativeTangents || useVertexColors || useFlatShading ) {\n\n\t\t\tlet cacheKey = 'ClonedMaterial:' + material.uuid + ':';\n\n\t\t\tif ( useDerivativeTangents ) cacheKey += 'derivative-tangents:';\n\t\t\tif ( useVertexColors ) cacheKey += 'vertex-colors:';\n\t\t\tif ( useFlatShading ) cacheKey += 'flat-shading:';\n\n\t\t\tlet cachedMaterial = this.cache.get( cacheKey );\n\n\t\t\tif ( ! cachedMaterial ) {\n\n\t\t\t\tcachedMaterial = material.clone();\n\n\t\t\t\tif ( useVertexColors ) cachedMaterial.vertexColors = true;\n\t\t\t\tif ( useFlatShading ) cachedMaterial.flatShading = true;\n\n\t\t\t\tif ( useDerivativeTangents ) {\n\n\t\t\t\t\t// https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995\n\t\t\t\t\tif ( cachedMaterial.normalScale ) cachedMaterial.normalScale.y *= - 1;\n\t\t\t\t\tif ( cachedMaterial.clearcoatNormalScale ) cachedMaterial.clearcoatNormalScale.y *= - 1;\n\n\t\t\t\t}\n\n\t\t\t\tthis.cache.add( cacheKey, cachedMaterial );\n\n\t\t\t\tthis.associations.set( cachedMaterial, this.associations.get( material ) );\n\n\t\t\t}\n\n\t\t\tmaterial = cachedMaterial;\n\n\t\t}\n\n\t\tmesh.material = material;\n\n\t}\n\n\tgetMaterialType( /* materialIndex */ ) {\n\n\t\treturn MeshStandardMaterial;\n\n\t}\n\n\t/**\n\t * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials\n\t * @param {number} materialIndex\n\t * @return {Promise}\n\t */\n\tloadMaterial( materialIndex ) {\n\n\t\tconst parser = this;\n\t\tconst json = this.json;\n\t\tconst extensions = this.extensions;\n\t\tconst materialDef = json.materials[ materialIndex ];\n\n\t\tlet materialType;\n\t\tconst materialParams = {};\n\t\tconst materialExtensions = materialDef.extensions || {};\n\n\t\tconst pending = [];\n\n\t\tif ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ] ) {\n\n\t\t\tconst kmuExtension = extensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ];\n\t\t\tmaterialType = kmuExtension.getMaterialType();\n\t\t\tpending.push( kmuExtension.extendParams( materialParams, materialDef, parser ) );\n\n\t\t} else {\n\n\t\t\t// Specification:\n\t\t\t// https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#metallic-roughness-material\n\n\t\t\tconst metallicRoughness = materialDef.pbrMetallicRoughness || {};\n\n\t\t\tmaterialParams.color = new Color( 1.0, 1.0, 1.0 );\n\t\t\tmaterialParams.opacity = 1.0;\n\n\t\t\tif ( Array.isArray( metallicRoughness.baseColorFactor ) ) {\n\n\t\t\t\tconst array = metallicRoughness.baseColorFactor;\n\n\t\t\t\tmaterialParams.color.setRGB( array[ 0 ], array[ 1 ], array[ 2 ], LinearSRGBColorSpace );\n\t\t\t\tmaterialParams.opacity = array[ 3 ];\n\n\t\t\t}\n\n\t\t\tif ( metallicRoughness.baseColorTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture, SRGBColorSpace ) );\n\n\t\t\t}\n\n\t\t\tmaterialParams.metalness = metallicRoughness.metallicFactor !== undefined ? metallicRoughness.metallicFactor : 1.0;\n\t\t\tmaterialParams.roughness = metallicRoughness.roughnessFactor !== undefined ? metallicRoughness.roughnessFactor : 1.0;\n\n\t\t\tif ( metallicRoughness.metallicRoughnessTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'metalnessMap', metallicRoughness.metallicRoughnessTexture ) );\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'roughnessMap', metallicRoughness.metallicRoughnessTexture ) );\n\n\t\t\t}\n\n\t\t\tmaterialType = this._invokeOne( function ( ext ) {\n\n\t\t\t\treturn ext.getMaterialType && ext.getMaterialType( materialIndex );\n\n\t\t\t} );\n\n\t\t\tpending.push( Promise.all( this._invokeAll( function ( ext ) {\n\n\t\t\t\treturn ext.extendMaterialParams && ext.extendMaterialParams( materialIndex, materialParams );\n\n\t\t\t} ) ) );\n\n\t\t}\n\n\t\tif ( materialDef.doubleSided === true ) {\n\n\t\t\tmaterialParams.side = DoubleSide;\n\n\t\t}\n\n\t\tconst alphaMode = materialDef.alphaMode || ALPHA_MODES.OPAQUE;\n\n\t\tif ( alphaMode === ALPHA_MODES.BLEND ) {\n\n\t\t\tmaterialParams.transparent = true;\n\n\t\t\t// See: https://github.com/mrdoob/three.js/issues/17706\n\t\t\tmaterialParams.depthWrite = false;\n\n\t\t} else {\n\n\t\t\tmaterialParams.transparent = false;\n\n\t\t\tif ( alphaMode === ALPHA_MODES.MASK ) {\n\n\t\t\t\tmaterialParams.alphaTest = materialDef.alphaCutoff !== undefined ? materialDef.alphaCutoff : 0.5;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( materialDef.normalTexture !== undefined && materialType !== MeshBasicMaterial ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'normalMap', materialDef.normalTexture ) );\n\n\t\t\tmaterialParams.normalScale = new Vector2( 1, 1 );\n\n\t\t\tif ( materialDef.normalTexture.scale !== undefined ) {\n\n\t\t\t\tconst scale = materialDef.normalTexture.scale;\n\n\t\t\t\tmaterialParams.normalScale.set( scale, scale );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( materialDef.occlusionTexture !== undefined && materialType !== MeshBasicMaterial ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'aoMap', materialDef.occlusionTexture ) );\n\n\t\t\tif ( materialDef.occlusionTexture.strength !== undefined ) {\n\n\t\t\t\tmaterialParams.aoMapIntensity = materialDef.occlusionTexture.strength;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( materialDef.emissiveFactor !== undefined && materialType !== MeshBasicMaterial ) {\n\n\t\t\tconst emissiveFactor = materialDef.emissiveFactor;\n\t\t\tmaterialParams.emissive = new Color().setRGB( emissiveFactor[ 0 ], emissiveFactor[ 1 ], emissiveFactor[ 2 ], LinearSRGBColorSpace );\n\n\t\t}\n\n\t\tif ( materialDef.emissiveTexture !== undefined && materialType !== MeshBasicMaterial ) {\n\n\t\t\tpending.push( parser.assignTexture( materialParams, 'emissiveMap', materialDef.emissiveTexture, SRGBColorSpace ) );\n\n\t\t}\n\n\t\treturn Promise.all( pending ).then( function () {\n\n\t\t\tconst material = new materialType( materialParams );\n\n\t\t\tif ( materialDef.name ) material.name = materialDef.name;\n\n\t\t\tassignExtrasToUserData( material, materialDef );\n\n\t\t\tparser.associations.set( material, { materials: materialIndex } );\n\n\t\t\tif ( materialDef.extensions ) addUnknownExtensionsToUserData( extensions, material, materialDef );\n\n\t\t\treturn material;\n\n\t\t} );\n\n\t}\n\n\t/** When Object3D instances are targeted by animation, they need unique names. */\n\tcreateUniqueName( originalName ) {\n\n\t\tconst sanitizedName = PropertyBinding.sanitizeNodeName( originalName || '' );\n\n\t\tif ( sanitizedName in this.nodeNamesUsed ) {\n\n\t\t\treturn sanitizedName + '_' + ( ++ this.nodeNamesUsed[ sanitizedName ] );\n\n\t\t} else {\n\n\t\t\tthis.nodeNamesUsed[ sanitizedName ] = 0;\n\n\t\t\treturn sanitizedName;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry\n\t *\n\t * Creates BufferGeometries from primitives.\n\t *\n\t * @param {Array} primitives\n\t * @return {Promise>}\n\t */\n\tloadGeometries( primitives ) {\n\n\t\tconst parser = this;\n\t\tconst extensions = this.extensions;\n\t\tconst cache = this.primitiveCache;\n\n\t\tfunction createDracoPrimitive( primitive ) {\n\n\t\t\treturn extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ]\n\t\t\t\t.decodePrimitive( primitive, parser )\n\t\t\t\t.then( function ( geometry ) {\n\n\t\t\t\t\treturn addPrimitiveAttributes( geometry, primitive, parser );\n\n\t\t\t\t} );\n\n\t\t}\n\n\t\tconst pending = [];\n\n\t\tfor ( let i = 0, il = primitives.length; i < il; i ++ ) {\n\n\t\t\tconst primitive = primitives[ i ];\n\t\t\tconst cacheKey = createPrimitiveKey( primitive );\n\n\t\t\t// See if we've already created this geometry\n\t\t\tconst cached = cache[ cacheKey ];\n\n\t\t\tif ( cached ) {\n\n\t\t\t\t// Use the cached geometry if it exists\n\t\t\t\tpending.push( cached.promise );\n\n\t\t\t} else {\n\n\t\t\t\tlet geometryPromise;\n\n\t\t\t\tif ( primitive.extensions && primitive.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] ) {\n\n\t\t\t\t\t// Use DRACO geometry if available\n\t\t\t\t\tgeometryPromise = createDracoPrimitive( primitive );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Otherwise create a new geometry\n\t\t\t\t\tgeometryPromise = addPrimitiveAttributes( new BufferGeometry(), primitive, parser );\n\n\t\t\t\t}\n\n\t\t\t\t// Cache this geometry\n\t\t\t\tcache[ cacheKey ] = { primitive: primitive, promise: geometryPromise };\n\n\t\t\t\tpending.push( geometryPromise );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn Promise.all( pending );\n\n\t}\n\n\t/**\n\t * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes\n\t * @param {number} meshIndex\n\t * @return {Promise}\n\t */\n\tloadMesh( meshIndex ) {\n\n\t\tconst parser = this;\n\t\tconst json = this.json;\n\t\tconst extensions = this.extensions;\n\n\t\tconst meshDef = json.meshes[ meshIndex ];\n\t\tconst primitives = meshDef.primitives;\n\n\t\tconst pending = [];\n\n\t\tfor ( let i = 0, il = primitives.length; i < il; i ++ ) {\n\n\t\t\tconst material = primitives[ i ].material === undefined\n\t\t\t\t? createDefaultMaterial( this.cache )\n\t\t\t\t: this.getDependency( 'material', primitives[ i ].material );\n\n\t\t\tpending.push( material );\n\n\t\t}\n\n\t\tpending.push( parser.loadGeometries( primitives ) );\n\n\t\treturn Promise.all( pending ).then( function ( results ) {\n\n\t\t\tconst materials = results.slice( 0, results.length - 1 );\n\t\t\tconst geometries = results[ results.length - 1 ];\n\n\t\t\tconst meshes = [];\n\n\t\t\tfor ( let i = 0, il = geometries.length; i < il; i ++ ) {\n\n\t\t\t\tconst geometry = geometries[ i ];\n\t\t\t\tconst primitive = primitives[ i ];\n\n\t\t\t\t// 1. create Mesh\n\n\t\t\t\tlet mesh;\n\n\t\t\t\tconst material = materials[ i ];\n\n\t\t\t\tif ( primitive.mode === WEBGL_CONSTANTS.TRIANGLES ||\n\t\t\t\t\t\tprimitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP ||\n\t\t\t\t\t\tprimitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN ||\n\t\t\t\t\t\tprimitive.mode === undefined ) {\n\n\t\t\t\t\t// .isSkinnedMesh isn't in glTF spec. See ._markDefs()\n\t\t\t\t\tmesh = meshDef.isSkinnedMesh === true\n\t\t\t\t\t\t? new SkinnedMesh( geometry, material )\n\t\t\t\t\t\t: new Mesh( geometry, material );\n\n\t\t\t\t\tif ( mesh.isSkinnedMesh === true ) {\n\n\t\t\t\t\t\t// normalize skin weights to fix malformed assets (see #15319)\n\t\t\t\t\t\tmesh.normalizeSkinWeights();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP ) {\n\n\t\t\t\t\t\tmesh.geometry = toTrianglesDrawMode( mesh.geometry, TriangleStripDrawMode );\n\n\t\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN ) {\n\n\t\t\t\t\t\tmesh.geometry = toTrianglesDrawMode( mesh.geometry, TriangleFanDrawMode );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.LINES ) {\n\n\t\t\t\t\tmesh = new LineSegments( geometry, material );\n\n\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.LINE_STRIP ) {\n\n\t\t\t\t\tmesh = new Line( geometry, material );\n\n\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.LINE_LOOP ) {\n\n\t\t\t\t\tmesh = new LineLoop( geometry, material );\n\n\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.POINTS ) {\n\n\t\t\t\t\tmesh = new Points( geometry, material );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Primitive mode unsupported: ' + primitive.mode );\n\n\t\t\t\t}\n\n\t\t\t\tif ( Object.keys( mesh.geometry.morphAttributes ).length > 0 ) {\n\n\t\t\t\t\tupdateMorphTargets( mesh, meshDef );\n\n\t\t\t\t}\n\n\t\t\t\tmesh.name = parser.createUniqueName( meshDef.name || ( 'mesh_' + meshIndex ) );\n\n\t\t\t\tassignExtrasToUserData( mesh, meshDef );\n\n\t\t\t\tif ( primitive.extensions ) addUnknownExtensionsToUserData( extensions, mesh, primitive );\n\n\t\t\t\tparser.assignFinalMaterial( mesh );\n\n\t\t\t\tmeshes.push( mesh );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, il = meshes.length; i < il; i ++ ) {\n\n\t\t\t\tparser.associations.set( meshes[ i ], {\n\t\t\t\t\tmeshes: meshIndex,\n\t\t\t\t\tprimitives: i\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tif ( meshes.length === 1 ) {\n\n\t\t\t\tif ( meshDef.extensions ) addUnknownExtensionsToUserData( extensions, meshes[ 0 ], meshDef );\n\n\t\t\t\treturn meshes[ 0 ];\n\n\t\t\t}\n\n\t\t\tconst group = new Group();\n\n\t\t\tif ( meshDef.extensions ) addUnknownExtensionsToUserData( extensions, group, meshDef );\n\n\t\t\tparser.associations.set( group, { meshes: meshIndex } );\n\n\t\t\tfor ( let i = 0, il = meshes.length; i < il; i ++ ) {\n\n\t\t\t\tgroup.add( meshes[ i ] );\n\n\t\t\t}\n\n\t\t\treturn group;\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras\n\t * @param {number} cameraIndex\n\t * @return {Promise}\n\t */\n\tloadCamera( cameraIndex ) {\n\n\t\tlet camera;\n\t\tconst cameraDef = this.json.cameras[ cameraIndex ];\n\t\tconst params = cameraDef[ cameraDef.type ];\n\n\t\tif ( ! params ) {\n\n\t\t\tconsole.warn( 'THREE.GLTFLoader: Missing camera parameters.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( cameraDef.type === 'perspective' ) {\n\n\t\t\tcamera = new PerspectiveCamera( MathUtils.radToDeg( params.yfov ), params.aspectRatio || 1, params.znear || 1, params.zfar || 2e6 );\n\n\t\t} else if ( cameraDef.type === 'orthographic' ) {\n\n\t\t\tcamera = new OrthographicCamera( - params.xmag, params.xmag, params.ymag, - params.ymag, params.znear, params.zfar );\n\n\t\t}\n\n\t\tif ( cameraDef.name ) camera.name = this.createUniqueName( cameraDef.name );\n\n\t\tassignExtrasToUserData( camera, cameraDef );\n\n\t\treturn Promise.resolve( camera );\n\n\t}\n\n\t/**\n\t * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins\n\t * @param {number} skinIndex\n\t * @return {Promise}\n\t */\n\tloadSkin( skinIndex ) {\n\n\t\tconst skinDef = this.json.skins[ skinIndex ];\n\n\t\tconst pending = [];\n\n\t\tfor ( let i = 0, il = skinDef.joints.length; i < il; i ++ ) {\n\n\t\t\tpending.push( this._loadNodeShallow( skinDef.joints[ i ] ) );\n\n\t\t}\n\n\t\tif ( skinDef.inverseBindMatrices !== undefined ) {\n\n\t\t\tpending.push( this.getDependency( 'accessor', skinDef.inverseBindMatrices ) );\n\n\t\t} else {\n\n\t\t\tpending.push( null );\n\n\t\t}\n\n\t\treturn Promise.all( pending ).then( function ( results ) {\n\n\t\t\tconst inverseBindMatrices = results.pop();\n\t\t\tconst jointNodes = results;\n\n\t\t\t// Note that bones (joint nodes) may or may not be in the\n\t\t\t// scene graph at this time.\n\n\t\t\tconst bones = [];\n\t\t\tconst boneInverses = [];\n\n\t\t\tfor ( let i = 0, il = jointNodes.length; i < il; i ++ ) {\n\n\t\t\t\tconst jointNode = jointNodes[ i ];\n\n\t\t\t\tif ( jointNode ) {\n\n\t\t\t\t\tbones.push( jointNode );\n\n\t\t\t\t\tconst mat = new Matrix4();\n\n\t\t\t\t\tif ( inverseBindMatrices !== null ) {\n\n\t\t\t\t\t\tmat.fromArray( inverseBindMatrices.array, i * 16 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tboneInverses.push( mat );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Joint \"%s\" could not be found.', skinDef.joints[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn new Skeleton( bones, boneInverses );\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations\n\t * @param {number} animationIndex\n\t * @return {Promise}\n\t */\n\tloadAnimation( animationIndex ) {\n\n\t\tconst json = this.json;\n\t\tconst parser = this;\n\n\t\tconst animationDef = json.animations[ animationIndex ];\n\t\tconst animationName = animationDef.name ? animationDef.name : 'animation_' + animationIndex;\n\n\t\tconst pendingNodes = [];\n\t\tconst pendingInputAccessors = [];\n\t\tconst pendingOutputAccessors = [];\n\t\tconst pendingSamplers = [];\n\t\tconst pendingTargets = [];\n\n\t\tfor ( let i = 0, il = animationDef.channels.length; i < il; i ++ ) {\n\n\t\t\tconst channel = animationDef.channels[ i ];\n\t\t\tconst sampler = animationDef.samplers[ channel.sampler ];\n\t\t\tconst target = channel.target;\n\t\t\tconst name = target.node;\n\t\t\tconst input = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.input ] : sampler.input;\n\t\t\tconst output = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.output ] : sampler.output;\n\n\t\t\tif ( target.node === undefined ) continue;\n\n\t\t\tpendingNodes.push( this.getDependency( 'node', name ) );\n\t\t\tpendingInputAccessors.push( this.getDependency( 'accessor', input ) );\n\t\t\tpendingOutputAccessors.push( this.getDependency( 'accessor', output ) );\n\t\t\tpendingSamplers.push( sampler );\n\t\t\tpendingTargets.push( target );\n\n\t\t}\n\n\t\treturn Promise.all( [\n\n\t\t\tPromise.all( pendingNodes ),\n\t\t\tPromise.all( pendingInputAccessors ),\n\t\t\tPromise.all( pendingOutputAccessors ),\n\t\t\tPromise.all( pendingSamplers ),\n\t\t\tPromise.all( pendingTargets )\n\n\t\t] ).then( function ( dependencies ) {\n\n\t\t\tconst nodes = dependencies[ 0 ];\n\t\t\tconst inputAccessors = dependencies[ 1 ];\n\t\t\tconst outputAccessors = dependencies[ 2 ];\n\t\t\tconst samplers = dependencies[ 3 ];\n\t\t\tconst targets = dependencies[ 4 ];\n\n\t\t\tconst tracks = [];\n\n\t\t\tfor ( let i = 0, il = nodes.length; i < il; i ++ ) {\n\n\t\t\t\tconst node = nodes[ i ];\n\t\t\t\tconst inputAccessor = inputAccessors[ i ];\n\t\t\t\tconst outputAccessor = outputAccessors[ i ];\n\t\t\t\tconst sampler = samplers[ i ];\n\t\t\t\tconst target = targets[ i ];\n\n\t\t\t\tif ( node === undefined ) continue;\n\n\t\t\t\tif ( node.updateMatrix ) {\n\n\t\t\t\t\tnode.updateMatrix();\n\n\t\t\t\t}\n\n\t\t\t\tconst createdTracks = parser._createAnimationTracks( node, inputAccessor, outputAccessor, sampler, target );\n\n\t\t\t\tif ( createdTracks ) {\n\n\t\t\t\t\tfor ( let k = 0; k < createdTracks.length; k ++ ) {\n\n\t\t\t\t\t\ttracks.push( createdTracks[ k ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn new AnimationClip( animationName, undefined, tracks );\n\n\t\t} );\n\n\t}\n\n\tcreateNodeMesh( nodeIndex ) {\n\n\t\tconst json = this.json;\n\t\tconst parser = this;\n\t\tconst nodeDef = json.nodes[ nodeIndex ];\n\n\t\tif ( nodeDef.mesh === undefined ) return null;\n\n\t\treturn parser.getDependency( 'mesh', nodeDef.mesh ).then( function ( mesh ) {\n\n\t\t\tconst node = parser._getNodeRef( parser.meshCache, nodeDef.mesh, mesh );\n\n\t\t\t// if weights are provided on the node, override weights on the mesh.\n\t\t\tif ( nodeDef.weights !== undefined ) {\n\n\t\t\t\tnode.traverse( function ( o ) {\n\n\t\t\t\t\tif ( ! o.isMesh ) return;\n\n\t\t\t\t\tfor ( let i = 0, il = nodeDef.weights.length; i < il; i ++ ) {\n\n\t\t\t\t\t\to.morphTargetInfluences[ i ] = nodeDef.weights[ i ];\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\treturn node;\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy\n\t * @param {number} nodeIndex\n\t * @return {Promise}\n\t */\n\tloadNode( nodeIndex ) {\n\n\t\tconst json = this.json;\n\t\tconst parser = this;\n\n\t\tconst nodeDef = json.nodes[ nodeIndex ];\n\n\t\tconst nodePending = parser._loadNodeShallow( nodeIndex );\n\n\t\tconst childPending = [];\n\t\tconst childrenDef = nodeDef.children || [];\n\n\t\tfor ( let i = 0, il = childrenDef.length; i < il; i ++ ) {\n\n\t\t\tchildPending.push( parser.getDependency( 'node', childrenDef[ i ] ) );\n\n\t\t}\n\n\t\tconst skeletonPending = nodeDef.skin === undefined\n\t\t\t? Promise.resolve( null )\n\t\t\t: parser.getDependency( 'skin', nodeDef.skin );\n\n\t\treturn Promise.all( [\n\t\t\tnodePending,\n\t\t\tPromise.all( childPending ),\n\t\t\tskeletonPending\n\t\t] ).then( function ( results ) {\n\n\t\t\tconst node = results[ 0 ];\n\t\t\tconst children = results[ 1 ];\n\t\t\tconst skeleton = results[ 2 ];\n\n\t\t\tif ( skeleton !== null ) {\n\n\t\t\t\t// This full traverse should be fine because\n\t\t\t\t// child glTF nodes have not been added to this node yet.\n\t\t\t\tnode.traverse( function ( mesh ) {\n\n\t\t\t\t\tif ( ! mesh.isSkinnedMesh ) return;\n\n\t\t\t\t\tmesh.bind( skeleton, _identityMatrix );\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, il = children.length; i < il; i ++ ) {\n\n\t\t\t\tnode.add( children[ i ] );\n\n\t\t\t}\n\n\t\t\treturn node;\n\n\t\t} );\n\n\t}\n\n\t// ._loadNodeShallow() parses a single node.\n\t// skin and child nodes are created and added in .loadNode() (no '_' prefix).\n\t_loadNodeShallow( nodeIndex ) {\n\n\t\tconst json = this.json;\n\t\tconst extensions = this.extensions;\n\t\tconst parser = this;\n\n\t\t// This method is called from .loadNode() and .loadSkin().\n\t\t// Cache a node to avoid duplication.\n\n\t\tif ( this.nodeCache[ nodeIndex ] !== undefined ) {\n\n\t\t\treturn this.nodeCache[ nodeIndex ];\n\n\t\t}\n\n\t\tconst nodeDef = json.nodes[ nodeIndex ];\n\n\t\t// reserve node's name before its dependencies, so the root has the intended name.\n\t\tconst nodeName = nodeDef.name ? parser.createUniqueName( nodeDef.name ) : '';\n\n\t\tconst pending = [];\n\n\t\tconst meshPromise = parser._invokeOne( function ( ext ) {\n\n\t\t\treturn ext.createNodeMesh && ext.createNodeMesh( nodeIndex );\n\n\t\t} );\n\n\t\tif ( meshPromise ) {\n\n\t\t\tpending.push( meshPromise );\n\n\t\t}\n\n\t\tif ( nodeDef.camera !== undefined ) {\n\n\t\t\tpending.push( parser.getDependency( 'camera', nodeDef.camera ).then( function ( camera ) {\n\n\t\t\t\treturn parser._getNodeRef( parser.cameraCache, nodeDef.camera, camera );\n\n\t\t\t} ) );\n\n\t\t}\n\n\t\tparser._invokeAll( function ( ext ) {\n\n\t\t\treturn ext.createNodeAttachment && ext.createNodeAttachment( nodeIndex );\n\n\t\t} ).forEach( function ( promise ) {\n\n\t\t\tpending.push( promise );\n\n\t\t} );\n\n\t\tthis.nodeCache[ nodeIndex ] = Promise.all( pending ).then( function ( objects ) {\n\n\t\t\tlet node;\n\n\t\t\t// .isBone isn't in glTF spec. See ._markDefs\n\t\t\tif ( nodeDef.isBone === true ) {\n\n\t\t\t\tnode = new Bone();\n\n\t\t\t} else if ( objects.length > 1 ) {\n\n\t\t\t\tnode = new Group();\n\n\t\t\t} else if ( objects.length === 1 ) {\n\n\t\t\t\tnode = objects[ 0 ];\n\n\t\t\t} else {\n\n\t\t\t\tnode = new Object3D();\n\n\t\t\t}\n\n\t\t\tif ( node !== objects[ 0 ] ) {\n\n\t\t\t\tfor ( let i = 0, il = objects.length; i < il; i ++ ) {\n\n\t\t\t\t\tnode.add( objects[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( nodeDef.name ) {\n\n\t\t\t\tnode.userData.name = nodeDef.name;\n\t\t\t\tnode.name = nodeName;\n\n\t\t\t}\n\n\t\t\tassignExtrasToUserData( node, nodeDef );\n\n\t\t\tif ( nodeDef.extensions ) addUnknownExtensionsToUserData( extensions, node, nodeDef );\n\n\t\t\tif ( nodeDef.matrix !== undefined ) {\n\n\t\t\t\tconst matrix = new Matrix4();\n\t\t\t\tmatrix.fromArray( nodeDef.matrix );\n\t\t\t\tnode.applyMatrix4( matrix );\n\n\t\t\t} else {\n\n\t\t\t\tif ( nodeDef.translation !== undefined ) {\n\n\t\t\t\t\tnode.position.fromArray( nodeDef.translation );\n\n\t\t\t\t}\n\n\t\t\t\tif ( nodeDef.rotation !== undefined ) {\n\n\t\t\t\t\tnode.quaternion.fromArray( nodeDef.rotation );\n\n\t\t\t\t}\n\n\t\t\t\tif ( nodeDef.scale !== undefined ) {\n\n\t\t\t\t\tnode.scale.fromArray( nodeDef.scale );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( ! parser.associations.has( node ) ) {\n\n\t\t\t\tparser.associations.set( node, {} );\n\n\t\t\t}\n\n\t\t\tparser.associations.get( node ).nodes = nodeIndex;\n\n\t\t\treturn node;\n\n\t\t} );\n\n\t\treturn this.nodeCache[ nodeIndex ];\n\n\t}\n\n\t/**\n\t * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes\n\t * @param {number} sceneIndex\n\t * @return {Promise}\n\t */\n\tloadScene( sceneIndex ) {\n\n\t\tconst extensions = this.extensions;\n\t\tconst sceneDef = this.json.scenes[ sceneIndex ];\n\t\tconst parser = this;\n\n\t\t// Loader returns Group, not Scene.\n\t\t// See: https://github.com/mrdoob/three.js/issues/18342#issuecomment-578981172\n\t\tconst scene = new Group();\n\t\tif ( sceneDef.name ) scene.name = parser.createUniqueName( sceneDef.name );\n\n\t\tassignExtrasToUserData( scene, sceneDef );\n\n\t\tif ( sceneDef.extensions ) addUnknownExtensionsToUserData( extensions, scene, sceneDef );\n\n\t\tconst nodeIds = sceneDef.nodes || [];\n\n\t\tconst pending = [];\n\n\t\tfor ( let i = 0, il = nodeIds.length; i < il; i ++ ) {\n\n\t\t\tpending.push( parser.getDependency( 'node', nodeIds[ i ] ) );\n\n\t\t}\n\n\t\treturn Promise.all( pending ).then( function ( nodes ) {\n\n\t\t\tfor ( let i = 0, il = nodes.length; i < il; i ++ ) {\n\n\t\t\t\tscene.add( nodes[ i ] );\n\n\t\t\t}\n\n\t\t\t// Removes dangling associations, associations that reference a node that\n\t\t\t// didn't make it into the scene.\n\t\t\tconst reduceAssociations = ( node ) => {\n\n\t\t\t\tconst reducedAssociations = new Map();\n\n\t\t\t\tfor ( const [ key, value ] of parser.associations ) {\n\n\t\t\t\t\tif ( key instanceof Material || key instanceof Texture ) {\n\n\t\t\t\t\t\treducedAssociations.set( key, value );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tnode.traverse( ( node ) => {\n\n\t\t\t\t\tconst mappings = parser.associations.get( node );\n\n\t\t\t\t\tif ( mappings != null ) {\n\n\t\t\t\t\t\treducedAssociations.set( node, mappings );\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\treturn reducedAssociations;\n\n\t\t\t};\n\n\t\t\tparser.associations = reduceAssociations( scene );\n\n\t\t\treturn scene;\n\n\t\t} );\n\n\t}\n\n\t_createAnimationTracks( node, inputAccessor, outputAccessor, sampler, target ) {\n\n\t\tconst tracks = [];\n\n\t\tconst targetName = node.name ? node.name : node.uuid;\n\t\tconst targetNames = [];\n\n\t\tif ( PATH_PROPERTIES[ target.path ] === PATH_PROPERTIES.weights ) {\n\n\t\t\tnode.traverse( function ( object ) {\n\n\t\t\t\tif ( object.morphTargetInfluences ) {\n\n\t\t\t\t\ttargetNames.push( object.name ? object.name : object.uuid );\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t} else {\n\n\t\t\ttargetNames.push( targetName );\n\n\t\t}\n\n\t\tlet TypedKeyframeTrack;\n\n\t\tswitch ( PATH_PROPERTIES[ target.path ] ) {\n\n\t\t\tcase PATH_PROPERTIES.weights:\n\n\t\t\t\tTypedKeyframeTrack = NumberKeyframeTrack;\n\t\t\t\tbreak;\n\n\t\t\tcase PATH_PROPERTIES.rotation:\n\n\t\t\t\tTypedKeyframeTrack = QuaternionKeyframeTrack;\n\t\t\t\tbreak;\n\n\t\t\tcase PATH_PROPERTIES.position:\n\t\t\tcase PATH_PROPERTIES.scale:\n\n\t\t\t\tTypedKeyframeTrack = VectorKeyframeTrack;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tswitch ( outputAccessor.itemSize ) {\n\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tTypedKeyframeTrack = NumberKeyframeTrack;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\tcase 3:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tTypedKeyframeTrack = VectorKeyframeTrack;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tconst interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : InterpolateLinear;\n\n\n\t\tconst outputArray = this._getArrayFromAccessor( outputAccessor );\n\n\t\tfor ( let j = 0, jl = targetNames.length; j < jl; j ++ ) {\n\n\t\t\tconst track = new TypedKeyframeTrack(\n\t\t\t\ttargetNames[ j ] + '.' + PATH_PROPERTIES[ target.path ],\n\t\t\t\tinputAccessor.array,\n\t\t\t\toutputArray,\n\t\t\t\tinterpolation\n\t\t\t);\n\n\t\t\t// Override interpolation with custom factory method.\n\t\t\tif ( sampler.interpolation === 'CUBICSPLINE' ) {\n\n\t\t\t\tthis._createCubicSplineTrackInterpolant( track );\n\n\t\t\t}\n\n\t\t\ttracks.push( track );\n\n\t\t}\n\n\t\treturn tracks;\n\n\t}\n\n\t_getArrayFromAccessor( accessor ) {\n\n\t\tlet outputArray = accessor.array;\n\n\t\tif ( accessor.normalized ) {\n\n\t\t\tconst scale = getNormalizedComponentScale( outputArray.constructor );\n\t\t\tconst scaled = new Float32Array( outputArray.length );\n\n\t\t\tfor ( let j = 0, jl = outputArray.length; j < jl; j ++ ) {\n\n\t\t\t\tscaled[ j ] = outputArray[ j ] * scale;\n\n\t\t\t}\n\n\t\t\toutputArray = scaled;\n\n\t\t}\n\n\t\treturn outputArray;\n\n\t}\n\n\t_createCubicSplineTrackInterpolant( track ) {\n\n\t\ttrack.createInterpolant = function InterpolantFactoryMethodGLTFCubicSpline( result ) {\n\n\t\t\t// A CUBICSPLINE keyframe in glTF has three output values for each input value,\n\t\t\t// representing inTangent, splineVertex, and outTangent. As a result, track.getValueSize()\n\t\t\t// must be divided by three to get the interpolant's sampleSize argument.\n\n\t\t\tconst interpolantType = ( this instanceof QuaternionKeyframeTrack ) ? GLTFCubicSplineQuaternionInterpolant : GLTFCubicSplineInterpolant;\n\n\t\t\treturn new interpolantType( this.times, this.values, this.getValueSize() / 3, result );\n\n\t\t};\n\n\t\t// Mark as CUBICSPLINE. `track.getInterpolation()` doesn't support custom interpolants.\n\t\ttrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = true;\n\n\t}\n\n}\n\n/**\n * @param {BufferGeometry} geometry\n * @param {GLTF.Primitive} primitiveDef\n * @param {GLTFParser} parser\n */\nfunction computeBounds( geometry, primitiveDef, parser ) {\n\n\tconst attributes = primitiveDef.attributes;\n\n\tconst box = new Box3();\n\n\tif ( attributes.POSITION !== undefined ) {\n\n\t\tconst accessor = parser.json.accessors[ attributes.POSITION ];\n\n\t\tconst min = accessor.min;\n\t\tconst max = accessor.max;\n\n\t\t// glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement.\n\n\t\tif ( min !== undefined && max !== undefined ) {\n\n\t\t\tbox.set(\n\t\t\t\tnew Vector3( min[ 0 ], min[ 1 ], min[ 2 ] ),\n\t\t\t\tnew Vector3( max[ 0 ], max[ 1 ], max[ 2 ] )\n\t\t\t);\n\n\t\t\tif ( accessor.normalized ) {\n\n\t\t\t\tconst boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] );\n\t\t\t\tbox.min.multiplyScalar( boxScale );\n\t\t\t\tbox.max.multiplyScalar( boxScale );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' );\n\n\t\t\treturn;\n\n\t\t}\n\n\t} else {\n\n\t\treturn;\n\n\t}\n\n\tconst targets = primitiveDef.targets;\n\n\tif ( targets !== undefined ) {\n\n\t\tconst maxDisplacement = new Vector3();\n\t\tconst vector = new Vector3();\n\n\t\tfor ( let i = 0, il = targets.length; i < il; i ++ ) {\n\n\t\t\tconst target = targets[ i ];\n\n\t\t\tif ( target.POSITION !== undefined ) {\n\n\t\t\t\tconst accessor = parser.json.accessors[ target.POSITION ];\n\t\t\t\tconst min = accessor.min;\n\t\t\t\tconst max = accessor.max;\n\n\t\t\t\t// glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement.\n\n\t\t\t\tif ( min !== undefined && max !== undefined ) {\n\n\t\t\t\t\t// we need to get max of absolute components because target weight is [-1,1]\n\t\t\t\t\tvector.setX( Math.max( Math.abs( min[ 0 ] ), Math.abs( max[ 0 ] ) ) );\n\t\t\t\t\tvector.setY( Math.max( Math.abs( min[ 1 ] ), Math.abs( max[ 1 ] ) ) );\n\t\t\t\t\tvector.setZ( Math.max( Math.abs( min[ 2 ] ), Math.abs( max[ 2 ] ) ) );\n\n\n\t\t\t\t\tif ( accessor.normalized ) {\n\n\t\t\t\t\t\tconst boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] );\n\t\t\t\t\t\tvector.multiplyScalar( boxScale );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Note: this assumes that the sum of all weights is at most 1. This isn't quite correct - it's more conservative\n\t\t\t\t\t// to assume that each target can have a max weight of 1. However, for some use cases - notably, when morph targets\n\t\t\t\t\t// are used to implement key-frame animations and as such only two are active at a time - this results in very large\n\t\t\t\t\t// boxes. So for now we make a box that's sometimes a touch too small but is hopefully mostly of reasonable size.\n\t\t\t\t\tmaxDisplacement.max( vector );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// As per comment above this box isn't conservative, but has a reasonable size for a very large number of morph targets.\n\t\tbox.expandByVector( maxDisplacement );\n\n\t}\n\n\tgeometry.boundingBox = box;\n\n\tconst sphere = new Sphere();\n\n\tbox.getCenter( sphere.center );\n\tsphere.radius = box.min.distanceTo( box.max ) / 2;\n\n\tgeometry.boundingSphere = sphere;\n\n}\n\n/**\n * @param {BufferGeometry} geometry\n * @param {GLTF.Primitive} primitiveDef\n * @param {GLTFParser} parser\n * @return {Promise}\n */\nfunction addPrimitiveAttributes( geometry, primitiveDef, parser ) {\n\n\tconst attributes = primitiveDef.attributes;\n\n\tconst pending = [];\n\n\tfunction assignAttributeAccessor( accessorIndex, attributeName ) {\n\n\t\treturn parser.getDependency( 'accessor', accessorIndex )\n\t\t\t.then( function ( accessor ) {\n\n\t\t\t\tgeometry.setAttribute( attributeName, accessor );\n\n\t\t\t} );\n\n\t}\n\n\tfor ( const gltfAttributeName in attributes ) {\n\n\t\tconst threeAttributeName = ATTRIBUTES[ gltfAttributeName ] || gltfAttributeName.toLowerCase();\n\n\t\t// Skip attributes already provided by e.g. Draco extension.\n\t\tif ( threeAttributeName in geometry.attributes ) continue;\n\n\t\tpending.push( assignAttributeAccessor( attributes[ gltfAttributeName ], threeAttributeName ) );\n\n\t}\n\n\tif ( primitiveDef.indices !== undefined && ! geometry.index ) {\n\n\t\tconst accessor = parser.getDependency( 'accessor', primitiveDef.indices ).then( function ( accessor ) {\n\n\t\t\tgeometry.setIndex( accessor );\n\n\t\t} );\n\n\t\tpending.push( accessor );\n\n\t}\n\n\tif ( ColorManagement.workingColorSpace !== LinearSRGBColorSpace && 'COLOR_0' in attributes ) {\n\n\t\tconsole.warn( `THREE.GLTFLoader: Converting vertex colors from \"srgb-linear\" to \"${ColorManagement.workingColorSpace}\" not supported.` );\n\n\t}\n\n\tassignExtrasToUserData( geometry, primitiveDef );\n\n\tcomputeBounds( geometry, primitiveDef, parser );\n\n\treturn Promise.all( pending ).then( function () {\n\n\t\treturn primitiveDef.targets !== undefined\n\t\t\t? addMorphTargets( geometry, primitiveDef.targets, parser )\n\t\t\t: geometry;\n\n\t} );\n\n}\n\nexport { GLTFLoader };\n","import {\n\tColor,\n\tColorManagement,\n\tDefaultLoadingManager,\n\tFileLoader,\n\tFrontSide,\n\tLoader,\n\tLoaderUtils,\n\tMeshPhongMaterial,\n\tRepeatWrapping,\n\tTextureLoader,\n\tVector2,\n\tSRGBColorSpace\n} from 'three';\n\n/**\n * Loads a Wavefront .mtl file specifying materials\n */\n\nclass MTLLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Loads and parses a MTL asset from a URL.\n\t *\n\t * @param {String} url - URL to the MTL file.\n\t * @param {Function} [onLoad] - Callback invoked with the loaded object.\n\t * @param {Function} [onProgress] - Callback for download progress.\n\t * @param {Function} [onError] - Callback for download errors.\n\t *\n\t * @see setPath setResourcePath\n\t *\n\t * @note In order for relative texture references to resolve correctly\n\t * you must call setResourcePath() explicitly prior to load.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( text, path ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tsetMaterialOptions( value ) {\n\n\t\tthis.materialOptions = value;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Parses a MTL file.\n\t *\n\t * @param {String} text - Content of MTL file\n\t * @return {MaterialCreator}\n\t *\n\t * @see setPath setResourcePath\n\t *\n\t * @note In order for relative texture references to resolve correctly\n\t * you must call setResourcePath() explicitly prior to parse.\n\t */\n\tparse( text, path ) {\n\n\t\tconst lines = text.split( '\\n' );\n\t\tlet info = {};\n\t\tconst delimiter_pattern = /\\s+/;\n\t\tconst materialsInfo = {};\n\n\t\tfor ( let i = 0; i < lines.length; i ++ ) {\n\n\t\t\tlet line = lines[ i ];\n\t\t\tline = line.trim();\n\n\t\t\tif ( line.length === 0 || line.charAt( 0 ) === '#' ) {\n\n\t\t\t\t// Blank line or comment ignore\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst pos = line.indexOf( ' ' );\n\n\t\t\tlet key = ( pos >= 0 ) ? line.substring( 0, pos ) : line;\n\t\t\tkey = key.toLowerCase();\n\n\t\t\tlet value = ( pos >= 0 ) ? line.substring( pos + 1 ) : '';\n\t\t\tvalue = value.trim();\n\n\t\t\tif ( key === 'newmtl' ) {\n\n\t\t\t\t// New material\n\n\t\t\t\tinfo = { name: value };\n\t\t\t\tmaterialsInfo[ value ] = info;\n\n\t\t\t} else {\n\n\t\t\t\tif ( key === 'ka' || key === 'kd' || key === 'ks' || key === 'ke' ) {\n\n\t\t\t\t\tconst ss = value.split( delimiter_pattern, 3 );\n\t\t\t\t\tinfo[ key ] = [ parseFloat( ss[ 0 ] ), parseFloat( ss[ 1 ] ), parseFloat( ss[ 2 ] ) ];\n\n\t\t\t\t} else {\n\n\t\t\t\t\tinfo[ key ] = value;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst materialCreator = new MaterialCreator( this.resourcePath || path, this.materialOptions );\n\t\tmaterialCreator.setCrossOrigin( this.crossOrigin );\n\t\tmaterialCreator.setManager( this.manager );\n\t\tmaterialCreator.setMaterials( materialsInfo );\n\t\treturn materialCreator;\n\n\t}\n\n}\n\n/**\n * Create a new MTLLoader.MaterialCreator\n * @param baseUrl - Url relative to which textures are loaded\n * @param options - Set of options on how to construct the materials\n * side: Which side to apply the material\n * FrontSide (default), THREE.BackSide, THREE.DoubleSide\n * wrap: What type of wrapping to apply for textures\n * RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping\n * normalizeRGB: RGBs need to be normalized to 0-1 from 0-255\n * Default: false, assumed to be already normalized\n * ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's\n * Default: false\n * @constructor\n */\n\nclass MaterialCreator {\n\n\tconstructor( baseUrl = '', options = {} ) {\n\n\t\tthis.baseUrl = baseUrl;\n\t\tthis.options = options;\n\t\tthis.materialsInfo = {};\n\t\tthis.materials = {};\n\t\tthis.materialsArray = [];\n\t\tthis.nameLookup = {};\n\n\t\tthis.crossOrigin = 'anonymous';\n\n\t\tthis.side = ( this.options.side !== undefined ) ? this.options.side : FrontSide;\n\t\tthis.wrap = ( this.options.wrap !== undefined ) ? this.options.wrap : RepeatWrapping;\n\n\t}\n\n\tsetCrossOrigin( value ) {\n\n\t\tthis.crossOrigin = value;\n\t\treturn this;\n\n\t}\n\n\tsetManager( value ) {\n\n\t\tthis.manager = value;\n\n\t}\n\n\tsetMaterials( materialsInfo ) {\n\n\t\tthis.materialsInfo = this.convert( materialsInfo );\n\t\tthis.materials = {};\n\t\tthis.materialsArray = [];\n\t\tthis.nameLookup = {};\n\n\t}\n\n\tconvert( materialsInfo ) {\n\n\t\tif ( ! this.options ) return materialsInfo;\n\n\t\tconst converted = {};\n\n\t\tfor ( const mn in materialsInfo ) {\n\n\t\t\t// Convert materials info into normalized form based on options\n\n\t\t\tconst mat = materialsInfo[ mn ];\n\n\t\t\tconst covmat = {};\n\n\t\t\tconverted[ mn ] = covmat;\n\n\t\t\tfor ( const prop in mat ) {\n\n\t\t\t\tlet save = true;\n\t\t\t\tlet value = mat[ prop ];\n\t\t\t\tconst lprop = prop.toLowerCase();\n\n\t\t\t\tswitch ( lprop ) {\n\n\t\t\t\t\tcase 'kd':\n\t\t\t\t\tcase 'ka':\n\t\t\t\t\tcase 'ks':\n\n\t\t\t\t\t\t// Diffuse color (color under white light) using RGB values\n\n\t\t\t\t\t\tif ( this.options && this.options.normalizeRGB ) {\n\n\t\t\t\t\t\t\tvalue = [ value[ 0 ] / 255, value[ 1 ] / 255, value[ 2 ] / 255 ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( this.options && this.options.ignoreZeroRGBs ) {\n\n\t\t\t\t\t\t\tif ( value[ 0 ] === 0 && value[ 1 ] === 0 && value[ 2 ] === 0 ) {\n\n\t\t\t\t\t\t\t\t// ignore\n\n\t\t\t\t\t\t\t\tsave = false;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tif ( save ) {\n\n\t\t\t\t\tcovmat[ lprop ] = value;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn converted;\n\n\t}\n\n\tpreload() {\n\n\t\tfor ( const mn in this.materialsInfo ) {\n\n\t\t\tthis.create( mn );\n\n\t\t}\n\n\t}\n\n\tgetIndex( materialName ) {\n\n\t\treturn this.nameLookup[ materialName ];\n\n\t}\n\n\tgetAsArray() {\n\n\t\tlet index = 0;\n\n\t\tfor ( const mn in this.materialsInfo ) {\n\n\t\t\tthis.materialsArray[ index ] = this.create( mn );\n\t\t\tthis.nameLookup[ mn ] = index;\n\t\t\tindex ++;\n\n\t\t}\n\n\t\treturn this.materialsArray;\n\n\t}\n\n\tcreate( materialName ) {\n\n\t\tif ( this.materials[ materialName ] === undefined ) {\n\n\t\t\tthis.createMaterial_( materialName );\n\n\t\t}\n\n\t\treturn this.materials[ materialName ];\n\n\t}\n\n\tcreateMaterial_( materialName ) {\n\n\t\t// Create material\n\n\t\tconst scope = this;\n\t\tconst mat = this.materialsInfo[ materialName ];\n\t\tconst params = {\n\n\t\t\tname: materialName,\n\t\t\tside: this.side\n\n\t\t};\n\n\t\tfunction resolveURL( baseUrl, url ) {\n\n\t\t\tif ( typeof url !== 'string' || url === '' )\n\t\t\t\treturn '';\n\n\t\t\t// Absolute URL\n\t\t\tif ( /^https?:\\/\\//i.test( url ) ) return url;\n\n\t\t\treturn baseUrl + url;\n\n\t\t}\n\n\t\tfunction setMapForType( mapType, value ) {\n\n\t\t\tif ( params[ mapType ] ) return; // Keep the first encountered texture\n\n\t\t\tconst texParams = scope.getTextureParams( value, params );\n\t\t\tconst map = scope.loadTexture( resolveURL( scope.baseUrl, texParams.url ) );\n\n\t\t\tmap.repeat.copy( texParams.scale );\n\t\t\tmap.offset.copy( texParams.offset );\n\n\t\t\tmap.wrapS = scope.wrap;\n\t\t\tmap.wrapT = scope.wrap;\n\n\t\t\tif ( mapType === 'map' || mapType === 'emissiveMap' ) {\n\n\t\t\t\tmap.colorSpace = SRGBColorSpace;\n\n\t\t\t}\n\n\t\t\tparams[ mapType ] = map;\n\n\t\t}\n\n\t\tfor ( const prop in mat ) {\n\n\t\t\tconst value = mat[ prop ];\n\t\t\tlet n;\n\n\t\t\tif ( value === '' ) continue;\n\n\t\t\tswitch ( prop.toLowerCase() ) {\n\n\t\t\t\t// Ns is material specular exponent\n\n\t\t\t\tcase 'kd':\n\n\t\t\t\t\t// Diffuse color (color under white light) using RGB values\n\n\t\t\t\t\tparams.color = ColorManagement.toWorkingColorSpace( new Color().fromArray( value ), SRGBColorSpace );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ks':\n\n\t\t\t\t\t// Specular color (color when light is reflected from shiny surface) using RGB values\n\t\t\t\t\tparams.specular = ColorManagement.toWorkingColorSpace( new Color().fromArray( value ), SRGBColorSpace );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ke':\n\n\t\t\t\t\t// Emissive using RGB values\n\t\t\t\t\tparams.emissive = ColorManagement.toWorkingColorSpace( new Color().fromArray( value ), SRGBColorSpace );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'map_kd':\n\n\t\t\t\t\t// Diffuse texture map\n\n\t\t\t\t\tsetMapForType( 'map', value );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'map_ks':\n\n\t\t\t\t\t// Specular map\n\n\t\t\t\t\tsetMapForType( 'specularMap', value );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'map_ke':\n\n\t\t\t\t\t// Emissive map\n\n\t\t\t\t\tsetMapForType( 'emissiveMap', value );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'norm':\n\n\t\t\t\t\tsetMapForType( 'normalMap', value );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'map_bump':\n\t\t\t\tcase 'bump':\n\n\t\t\t\t\t// Bump texture map\n\n\t\t\t\t\tsetMapForType( 'bumpMap', value );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'map_d':\n\n\t\t\t\t\t// Alpha map\n\n\t\t\t\t\tsetMapForType( 'alphaMap', value );\n\t\t\t\t\tparams.transparent = true;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ns':\n\n\t\t\t\t\t// The specular exponent (defines the focus of the specular highlight)\n\t\t\t\t\t// A high exponent results in a tight, concentrated highlight. Ns values normally range from 0 to 1000.\n\n\t\t\t\t\tparams.shininess = parseFloat( value );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'd':\n\t\t\t\t\tn = parseFloat( value );\n\n\t\t\t\t\tif ( n < 1 ) {\n\n\t\t\t\t\t\tparams.opacity = n;\n\t\t\t\t\t\tparams.transparent = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'tr':\n\t\t\t\t\tn = parseFloat( value );\n\n\t\t\t\t\tif ( this.options && this.options.invertTrProperty ) n = 1 - n;\n\n\t\t\t\t\tif ( n > 0 ) {\n\n\t\t\t\t\t\tparams.opacity = 1 - n;\n\t\t\t\t\t\tparams.transparent = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.materials[ materialName ] = new MeshPhongMaterial( params );\n\t\treturn this.materials[ materialName ];\n\n\t}\n\n\tgetTextureParams( value, matParams ) {\n\n\t\tconst texParams = {\n\n\t\t\tscale: new Vector2( 1, 1 ),\n\t\t\toffset: new Vector2( 0, 0 )\n\n\t\t };\n\n\t\tconst items = value.split( /\\s+/ );\n\t\tlet pos;\n\n\t\tpos = items.indexOf( '-bm' );\n\n\t\tif ( pos >= 0 ) {\n\n\t\t\tmatParams.bumpScale = parseFloat( items[ pos + 1 ] );\n\t\t\titems.splice( pos, 2 );\n\n\t\t}\n\n\t\tpos = items.indexOf( '-s' );\n\n\t\tif ( pos >= 0 ) {\n\n\t\t\ttexParams.scale.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );\n\t\t\titems.splice( pos, 4 ); // we expect 3 parameters here!\n\n\t\t}\n\n\t\tpos = items.indexOf( '-o' );\n\n\t\tif ( pos >= 0 ) {\n\n\t\t\ttexParams.offset.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );\n\t\t\titems.splice( pos, 4 ); // we expect 3 parameters here!\n\n\t\t}\n\n\t\ttexParams.url = items.join( ' ' ).trim();\n\t\treturn texParams;\n\n\t}\n\n\tloadTexture( url, mapping, onLoad, onProgress, onError ) {\n\n\t\tconst manager = ( this.manager !== undefined ) ? this.manager : DefaultLoadingManager;\n\t\tlet loader = manager.getHandler( url );\n\n\t\tif ( loader === null ) {\n\n\t\t\tloader = new TextureLoader( manager );\n\n\t\t}\n\n\t\tif ( loader.setCrossOrigin ) loader.setCrossOrigin( this.crossOrigin );\n\n\t\tconst texture = loader.load( url, onLoad, onProgress, onError );\n\n\t\tif ( mapping !== undefined ) texture.mapping = mapping;\n\n\t\treturn texture;\n\n\t}\n\n}\n\nexport { MTLLoader };\n","import {\n\tBufferGeometry,\n\tFileLoader,\n\tFloat32BufferAttribute,\n\tGroup,\n\tLineBasicMaterial,\n\tLineSegments,\n\tLoader,\n\tMaterial,\n\tMesh,\n\tMeshPhongMaterial,\n\tPoints,\n\tPointsMaterial,\n\tVector3,\n\tColor,\n\tSRGBColorSpace\n} from 'three';\n\n// o object_name | g group_name\nconst _object_pattern = /^[og]\\s*(.+)?/;\n// mtllib file_reference\nconst _material_library_pattern = /^mtllib /;\n// usemtl material_name\nconst _material_use_pattern = /^usemtl /;\n// usemap map_name\nconst _map_use_pattern = /^usemap /;\nconst _face_vertex_data_separator_pattern = /\\s+/;\n\nconst _vA = new Vector3();\nconst _vB = new Vector3();\nconst _vC = new Vector3();\n\nconst _ab = new Vector3();\nconst _cb = new Vector3();\n\nconst _color = new Color();\n\nfunction ParserState() {\n\n\tconst state = {\n\t\tobjects: [],\n\t\tobject: {},\n\n\t\tvertices: [],\n\t\tnormals: [],\n\t\tcolors: [],\n\t\tuvs: [],\n\n\t\tmaterials: {},\n\t\tmaterialLibraries: [],\n\n\t\tstartObject: function ( name, fromDeclaration ) {\n\n\t\t\t// If the current object (initial from reset) is not from a g/o declaration in the parsed\n\t\t\t// file. We need to use it for the first parsed g/o to keep things in sync.\n\t\t\tif ( this.object && this.object.fromDeclaration === false ) {\n\n\t\t\t\tthis.object.name = name;\n\t\t\t\tthis.object.fromDeclaration = ( fromDeclaration !== false );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tconst previousMaterial = ( this.object && typeof this.object.currentMaterial === 'function' ? this.object.currentMaterial() : undefined );\n\n\t\t\tif ( this.object && typeof this.object._finalize === 'function' ) {\n\n\t\t\t\tthis.object._finalize( true );\n\n\t\t\t}\n\n\t\t\tthis.object = {\n\t\t\t\tname: name || '',\n\t\t\t\tfromDeclaration: ( fromDeclaration !== false ),\n\n\t\t\t\tgeometry: {\n\t\t\t\t\tvertices: [],\n\t\t\t\t\tnormals: [],\n\t\t\t\t\tcolors: [],\n\t\t\t\t\tuvs: [],\n\t\t\t\t\thasUVIndices: false\n\t\t\t\t},\n\t\t\t\tmaterials: [],\n\t\t\t\tsmooth: true,\n\n\t\t\t\tstartMaterial: function ( name, libraries ) {\n\n\t\t\t\t\tconst previous = this._finalize( false );\n\n\t\t\t\t\t// New usemtl declaration overwrites an inherited material, except if faces were declared\n\t\t\t\t\t// after the material, then it must be preserved for proper MultiMaterial continuation.\n\t\t\t\t\tif ( previous && ( previous.inherited || previous.groupCount <= 0 ) ) {\n\n\t\t\t\t\t\tthis.materials.splice( previous.index, 1 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst material = {\n\t\t\t\t\t\tindex: this.materials.length,\n\t\t\t\t\t\tname: name || '',\n\t\t\t\t\t\tmtllib: ( Array.isArray( libraries ) && libraries.length > 0 ? libraries[ libraries.length - 1 ] : '' ),\n\t\t\t\t\t\tsmooth: ( previous !== undefined ? previous.smooth : this.smooth ),\n\t\t\t\t\t\tgroupStart: ( previous !== undefined ? previous.groupEnd : 0 ),\n\t\t\t\t\t\tgroupEnd: - 1,\n\t\t\t\t\t\tgroupCount: - 1,\n\t\t\t\t\t\tinherited: false,\n\n\t\t\t\t\t\tclone: function ( index ) {\n\n\t\t\t\t\t\t\tconst cloned = {\n\t\t\t\t\t\t\t\tindex: ( typeof index === 'number' ? index : this.index ),\n\t\t\t\t\t\t\t\tname: this.name,\n\t\t\t\t\t\t\t\tmtllib: this.mtllib,\n\t\t\t\t\t\t\t\tsmooth: this.smooth,\n\t\t\t\t\t\t\t\tgroupStart: 0,\n\t\t\t\t\t\t\t\tgroupEnd: - 1,\n\t\t\t\t\t\t\t\tgroupCount: - 1,\n\t\t\t\t\t\t\t\tinherited: false\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tcloned.clone = this.clone.bind( cloned );\n\t\t\t\t\t\t\treturn cloned;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.materials.push( material );\n\n\t\t\t\t\treturn material;\n\n\t\t\t\t},\n\n\t\t\t\tcurrentMaterial: function () {\n\n\t\t\t\t\tif ( this.materials.length > 0 ) {\n\n\t\t\t\t\t\treturn this.materials[ this.materials.length - 1 ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn undefined;\n\n\t\t\t\t},\n\n\t\t\t\t_finalize: function ( end ) {\n\n\t\t\t\t\tconst lastMultiMaterial = this.currentMaterial();\n\t\t\t\t\tif ( lastMultiMaterial && lastMultiMaterial.groupEnd === - 1 ) {\n\n\t\t\t\t\t\tlastMultiMaterial.groupEnd = this.geometry.vertices.length / 3;\n\t\t\t\t\t\tlastMultiMaterial.groupCount = lastMultiMaterial.groupEnd - lastMultiMaterial.groupStart;\n\t\t\t\t\t\tlastMultiMaterial.inherited = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Ignore objects tail materials if no face declarations followed them before a new o/g started.\n\t\t\t\t\tif ( end && this.materials.length > 1 ) {\n\n\t\t\t\t\t\tfor ( let mi = this.materials.length - 1; mi >= 0; mi -- ) {\n\n\t\t\t\t\t\t\tif ( this.materials[ mi ].groupCount <= 0 ) {\n\n\t\t\t\t\t\t\t\tthis.materials.splice( mi, 1 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Guarantee at least one empty material, this makes the creation later more straight forward.\n\t\t\t\t\tif ( end && this.materials.length === 0 ) {\n\n\t\t\t\t\t\tthis.materials.push( {\n\t\t\t\t\t\t\tname: '',\n\t\t\t\t\t\t\tsmooth: this.smooth\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn lastMultiMaterial;\n\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Inherit previous objects material.\n\t\t\t// Spec tells us that a declared material must be set to all objects until a new material is declared.\n\t\t\t// If a usemtl declaration is encountered while this new object is being parsed, it will\n\t\t\t// overwrite the inherited material. Exception being that there was already face declarations\n\t\t\t// to the inherited material, then it will be preserved for proper MultiMaterial continuation.\n\n\t\t\tif ( previousMaterial && previousMaterial.name && typeof previousMaterial.clone === 'function' ) {\n\n\t\t\t\tconst declared = previousMaterial.clone( 0 );\n\t\t\t\tdeclared.inherited = true;\n\t\t\t\tthis.object.materials.push( declared );\n\n\t\t\t}\n\n\t\t\tthis.objects.push( this.object );\n\n\t\t},\n\n\t\tfinalize: function () {\n\n\t\t\tif ( this.object && typeof this.object._finalize === 'function' ) {\n\n\t\t\t\tthis.object._finalize( true );\n\n\t\t\t}\n\n\t\t},\n\n\t\tparseVertexIndex: function ( value, len ) {\n\n\t\t\tconst index = parseInt( value, 10 );\n\t\t\treturn ( index >= 0 ? index - 1 : index + len / 3 ) * 3;\n\n\t\t},\n\n\t\tparseNormalIndex: function ( value, len ) {\n\n\t\t\tconst index = parseInt( value, 10 );\n\t\t\treturn ( index >= 0 ? index - 1 : index + len / 3 ) * 3;\n\n\t\t},\n\n\t\tparseUVIndex: function ( value, len ) {\n\n\t\t\tconst index = parseInt( value, 10 );\n\t\t\treturn ( index >= 0 ? index - 1 : index + len / 2 ) * 2;\n\n\t\t},\n\n\t\taddVertex: function ( a, b, c ) {\n\n\t\t\tconst src = this.vertices;\n\t\t\tconst dst = this.object.geometry.vertices;\n\n\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\t\t\tdst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );\n\t\t\tdst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );\n\n\t\t},\n\n\t\taddVertexPoint: function ( a ) {\n\n\t\t\tconst src = this.vertices;\n\t\t\tconst dst = this.object.geometry.vertices;\n\n\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\n\t\t},\n\n\t\taddVertexLine: function ( a ) {\n\n\t\t\tconst src = this.vertices;\n\t\t\tconst dst = this.object.geometry.vertices;\n\n\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\n\t\t},\n\n\t\taddNormal: function ( a, b, c ) {\n\n\t\t\tconst src = this.normals;\n\t\t\tconst dst = this.object.geometry.normals;\n\n\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\t\t\tdst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );\n\t\t\tdst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );\n\n\t\t},\n\n\t\taddFaceNormal: function ( a, b, c ) {\n\n\t\t\tconst src = this.vertices;\n\t\t\tconst dst = this.object.geometry.normals;\n\n\t\t\t_vA.fromArray( src, a );\n\t\t\t_vB.fromArray( src, b );\n\t\t\t_vC.fromArray( src, c );\n\n\t\t\t_cb.subVectors( _vC, _vB );\n\t\t\t_ab.subVectors( _vA, _vB );\n\t\t\t_cb.cross( _ab );\n\n\t\t\t_cb.normalize();\n\n\t\t\tdst.push( _cb.x, _cb.y, _cb.z );\n\t\t\tdst.push( _cb.x, _cb.y, _cb.z );\n\t\t\tdst.push( _cb.x, _cb.y, _cb.z );\n\n\t\t},\n\n\t\taddColor: function ( a, b, c ) {\n\n\t\t\tconst src = this.colors;\n\t\t\tconst dst = this.object.geometry.colors;\n\n\t\t\tif ( src[ a ] !== undefined ) dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\t\t\tif ( src[ b ] !== undefined ) dst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );\n\t\t\tif ( src[ c ] !== undefined ) dst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );\n\n\t\t},\n\n\t\taddUV: function ( a, b, c ) {\n\n\t\t\tconst src = this.uvs;\n\t\t\tconst dst = this.object.geometry.uvs;\n\n\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ] );\n\t\t\tdst.push( src[ b + 0 ], src[ b + 1 ] );\n\t\t\tdst.push( src[ c + 0 ], src[ c + 1 ] );\n\n\t\t},\n\n\t\taddDefaultUV: function () {\n\n\t\t\tconst dst = this.object.geometry.uvs;\n\n\t\t\tdst.push( 0, 0 );\n\t\t\tdst.push( 0, 0 );\n\t\t\tdst.push( 0, 0 );\n\n\t\t},\n\n\t\taddUVLine: function ( a ) {\n\n\t\t\tconst src = this.uvs;\n\t\t\tconst dst = this.object.geometry.uvs;\n\n\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ] );\n\n\t\t},\n\n\t\taddFace: function ( a, b, c, ua, ub, uc, na, nb, nc ) {\n\n\t\t\tconst vLen = this.vertices.length;\n\n\t\t\tlet ia = this.parseVertexIndex( a, vLen );\n\t\t\tlet ib = this.parseVertexIndex( b, vLen );\n\t\t\tlet ic = this.parseVertexIndex( c, vLen );\n\n\t\t\tthis.addVertex( ia, ib, ic );\n\t\t\tthis.addColor( ia, ib, ic );\n\n\t\t\t// normals\n\n\t\t\tif ( na !== undefined && na !== '' ) {\n\n\t\t\t\tconst nLen = this.normals.length;\n\n\t\t\t\tia = this.parseNormalIndex( na, nLen );\n\t\t\t\tib = this.parseNormalIndex( nb, nLen );\n\t\t\t\tic = this.parseNormalIndex( nc, nLen );\n\n\t\t\t\tthis.addNormal( ia, ib, ic );\n\n\t\t\t} else {\n\n\t\t\t\tthis.addFaceNormal( ia, ib, ic );\n\n\t\t\t}\n\n\t\t\t// uvs\n\n\t\t\tif ( ua !== undefined && ua !== '' ) {\n\n\t\t\t\tconst uvLen = this.uvs.length;\n\n\t\t\t\tia = this.parseUVIndex( ua, uvLen );\n\t\t\t\tib = this.parseUVIndex( ub, uvLen );\n\t\t\t\tic = this.parseUVIndex( uc, uvLen );\n\n\t\t\t\tthis.addUV( ia, ib, ic );\n\n\t\t\t\tthis.object.geometry.hasUVIndices = true;\n\n\t\t\t} else {\n\n\t\t\t\t// add placeholder values (for inconsistent face definitions)\n\n\t\t\t\tthis.addDefaultUV();\n\n\t\t\t}\n\n\t\t},\n\n\t\taddPointGeometry: function ( vertices ) {\n\n\t\t\tthis.object.geometry.type = 'Points';\n\n\t\t\tconst vLen = this.vertices.length;\n\n\t\t\tfor ( let vi = 0, l = vertices.length; vi < l; vi ++ ) {\n\n\t\t\t\tconst index = this.parseVertexIndex( vertices[ vi ], vLen );\n\n\t\t\t\tthis.addVertexPoint( index );\n\t\t\t\tthis.addColor( index );\n\n\t\t\t}\n\n\t\t},\n\n\t\taddLineGeometry: function ( vertices, uvs ) {\n\n\t\t\tthis.object.geometry.type = 'Line';\n\n\t\t\tconst vLen = this.vertices.length;\n\t\t\tconst uvLen = this.uvs.length;\n\n\t\t\tfor ( let vi = 0, l = vertices.length; vi < l; vi ++ ) {\n\n\t\t\t\tthis.addVertexLine( this.parseVertexIndex( vertices[ vi ], vLen ) );\n\n\t\t\t}\n\n\t\t\tfor ( let uvi = 0, l = uvs.length; uvi < l; uvi ++ ) {\n\n\t\t\t\tthis.addUVLine( this.parseUVIndex( uvs[ uvi ], uvLen ) );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tstate.startObject( '', false );\n\n\treturn state;\n\n}\n\n//\n\nclass OBJLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t\tthis.materials = null;\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( text ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tsetMaterials( materials ) {\n\n\t\tthis.materials = materials;\n\n\t\treturn this;\n\n\t}\n\n\tparse( text ) {\n\n\t\tconst state = new ParserState();\n\n\t\tif ( text.indexOf( '\\r\\n' ) !== - 1 ) {\n\n\t\t\t// This is faster than String.split with regex that splits on both\n\t\t\ttext = text.replace( /\\r\\n/g, '\\n' );\n\n\t\t}\n\n\t\tif ( text.indexOf( '\\\\\\n' ) !== - 1 ) {\n\n\t\t\t// join lines separated by a line continuation character (\\)\n\t\t\ttext = text.replace( /\\\\\\n/g, '' );\n\n\t\t}\n\n\t\tconst lines = text.split( '\\n' );\n\t\tlet result = [];\n\n\t\tfor ( let i = 0, l = lines.length; i < l; i ++ ) {\n\n\t\t\tconst line = lines[ i ].trimStart();\n\n\t\t\tif ( line.length === 0 ) continue;\n\n\t\t\tconst lineFirstChar = line.charAt( 0 );\n\n\t\t\t// @todo invoke passed in handler if any\n\t\t\tif ( lineFirstChar === '#' ) continue; // skip comments\n\n\t\t\tif ( lineFirstChar === 'v' ) {\n\n\t\t\t\tconst data = line.split( _face_vertex_data_separator_pattern );\n\n\t\t\t\tswitch ( data[ 0 ] ) {\n\n\t\t\t\t\tcase 'v':\n\t\t\t\t\t\tstate.vertices.push(\n\t\t\t\t\t\t\tparseFloat( data[ 1 ] ),\n\t\t\t\t\t\t\tparseFloat( data[ 2 ] ),\n\t\t\t\t\t\t\tparseFloat( data[ 3 ] )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( data.length >= 7 ) {\n\n\t\t\t\t\t\t\t_color.setRGB(\n\t\t\t\t\t\t\t\tparseFloat( data[ 4 ] ),\n\t\t\t\t\t\t\t\tparseFloat( data[ 5 ] ),\n\t\t\t\t\t\t\t\tparseFloat( data[ 6 ] ),\n\t\t\t\t\t\t\t\tSRGBColorSpace\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tstate.colors.push( _color.r, _color.g, _color.b );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// if no colors are defined, add placeholders so color and vertex indices match\n\n\t\t\t\t\t\t\tstate.colors.push( undefined, undefined, undefined );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'vn':\n\t\t\t\t\t\tstate.normals.push(\n\t\t\t\t\t\t\tparseFloat( data[ 1 ] ),\n\t\t\t\t\t\t\tparseFloat( data[ 2 ] ),\n\t\t\t\t\t\t\tparseFloat( data[ 3 ] )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'vt':\n\t\t\t\t\t\tstate.uvs.push(\n\t\t\t\t\t\t\tparseFloat( data[ 1 ] ),\n\t\t\t\t\t\t\tparseFloat( data[ 2 ] )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t} else if ( lineFirstChar === 'f' ) {\n\n\t\t\t\tconst lineData = line.slice( 1 ).trim();\n\t\t\t\tconst vertexData = lineData.split( _face_vertex_data_separator_pattern );\n\t\t\t\tconst faceVertices = [];\n\n\t\t\t\t// Parse the face vertex data into an easy to work with format\n\n\t\t\t\tfor ( let j = 0, jl = vertexData.length; j < jl; j ++ ) {\n\n\t\t\t\t\tconst vertex = vertexData[ j ];\n\n\t\t\t\t\tif ( vertex.length > 0 ) {\n\n\t\t\t\t\t\tconst vertexParts = vertex.split( '/' );\n\t\t\t\t\t\tfaceVertices.push( vertexParts );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// Draw an edge between the first vertex and all subsequent vertices to form an n-gon\n\n\t\t\t\tconst v1 = faceVertices[ 0 ];\n\n\t\t\t\tfor ( let j = 1, jl = faceVertices.length - 1; j < jl; j ++ ) {\n\n\t\t\t\t\tconst v2 = faceVertices[ j ];\n\t\t\t\t\tconst v3 = faceVertices[ j + 1 ];\n\n\t\t\t\t\tstate.addFace(\n\t\t\t\t\t\tv1[ 0 ], v2[ 0 ], v3[ 0 ],\n\t\t\t\t\t\tv1[ 1 ], v2[ 1 ], v3[ 1 ],\n\t\t\t\t\t\tv1[ 2 ], v2[ 2 ], v3[ 2 ]\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t} else if ( lineFirstChar === 'l' ) {\n\n\t\t\t\tconst lineParts = line.substring( 1 ).trim().split( ' ' );\n\t\t\t\tlet lineVertices = [];\n\t\t\t\tconst lineUVs = [];\n\n\t\t\t\tif ( line.indexOf( '/' ) === - 1 ) {\n\n\t\t\t\t\tlineVertices = lineParts;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tfor ( let li = 0, llen = lineParts.length; li < llen; li ++ ) {\n\n\t\t\t\t\t\tconst parts = lineParts[ li ].split( '/' );\n\n\t\t\t\t\t\tif ( parts[ 0 ] !== '' ) lineVertices.push( parts[ 0 ] );\n\t\t\t\t\t\tif ( parts[ 1 ] !== '' ) lineUVs.push( parts[ 1 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tstate.addLineGeometry( lineVertices, lineUVs );\n\n\t\t\t} else if ( lineFirstChar === 'p' ) {\n\n\t\t\t\tconst lineData = line.slice( 1 ).trim();\n\t\t\t\tconst pointData = lineData.split( ' ' );\n\n\t\t\t\tstate.addPointGeometry( pointData );\n\n\t\t\t} else if ( ( result = _object_pattern.exec( line ) ) !== null ) {\n\n\t\t\t\t// o object_name\n\t\t\t\t// or\n\t\t\t\t// g group_name\n\n\t\t\t\t// WORKAROUND: https://bugs.chromium.org/p/v8/issues/detail?id=2869\n\t\t\t\t// let name = result[ 0 ].slice( 1 ).trim();\n\t\t\t\tconst name = ( ' ' + result[ 0 ].slice( 1 ).trim() ).slice( 1 );\n\n\t\t\t\tstate.startObject( name );\n\n\t\t\t} else if ( _material_use_pattern.test( line ) ) {\n\n\t\t\t\t// material\n\n\t\t\t\tstate.object.startMaterial( line.substring( 7 ).trim(), state.materialLibraries );\n\n\t\t\t} else if ( _material_library_pattern.test( line ) ) {\n\n\t\t\t\t// mtl file\n\n\t\t\t\tstate.materialLibraries.push( line.substring( 7 ).trim() );\n\n\t\t\t} else if ( _map_use_pattern.test( line ) ) {\n\n\t\t\t\t// the line is parsed but ignored since the loader assumes textures are defined MTL files\n\t\t\t\t// (according to https://www.okino.com/conv/imp_wave.htm, 'usemap' is the old-style Wavefront texture reference method)\n\n\t\t\t\tconsole.warn( 'THREE.OBJLoader: Rendering identifier \"usemap\" not supported. Textures must be defined in MTL files.' );\n\n\t\t\t} else if ( lineFirstChar === 's' ) {\n\n\t\t\t\tresult = line.split( ' ' );\n\n\t\t\t\t// smooth shading\n\n\t\t\t\t// @todo Handle files that have varying smooth values for a set of faces inside one geometry,\n\t\t\t\t// but does not define a usemtl for each face set.\n\t\t\t\t// This should be detected and a dummy material created (later MultiMaterial and geometry groups).\n\t\t\t\t// This requires some care to not create extra material on each smooth value for \"normal\" obj files.\n\t\t\t\t// where explicit usemtl defines geometry groups.\n\t\t\t\t// Example asset: examples/models/obj/cerberus/Cerberus.obj\n\n\t\t\t\t/*\n\t\t\t\t\t * http://paulbourke.net/dataformats/obj/\n\t\t\t\t\t *\n\t\t\t\t\t * From chapter \"Grouping\" Syntax explanation \"s group_number\":\n\t\t\t\t\t * \"group_number is the smoothing group number. To turn off smoothing groups, use a value of 0 or off.\n\t\t\t\t\t * Polygonal elements use group numbers to put elements in different smoothing groups. For free-form\n\t\t\t\t\t * surfaces, smoothing groups are either turned on or off; there is no difference between values greater\n\t\t\t\t\t * than 0.\"\n\t\t\t\t\t */\n\t\t\t\tif ( result.length > 1 ) {\n\n\t\t\t\t\tconst value = result[ 1 ].trim().toLowerCase();\n\t\t\t\t\tstate.object.smooth = ( value !== '0' && value !== 'off' );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// ZBrush can produce \"s\" lines #11707\n\t\t\t\t\tstate.object.smooth = true;\n\n\t\t\t\t}\n\n\t\t\t\tconst material = state.object.currentMaterial();\n\t\t\t\tif ( material ) material.smooth = state.object.smooth;\n\n\t\t\t} else {\n\n\t\t\t\t// Handle null terminated files without exception\n\t\t\t\tif ( line === '\\0' ) continue;\n\n\t\t\t\tconsole.warn( 'THREE.OBJLoader: Unexpected line: \"' + line + '\"' );\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.finalize();\n\n\t\tconst container = new Group();\n\t\tcontainer.materialLibraries = [].concat( state.materialLibraries );\n\n\t\tconst hasPrimitives = ! ( state.objects.length === 1 && state.objects[ 0 ].geometry.vertices.length === 0 );\n\n\t\tif ( hasPrimitives === true ) {\n\n\t\t\tfor ( let i = 0, l = state.objects.length; i < l; i ++ ) {\n\n\t\t\t\tconst object = state.objects[ i ];\n\t\t\t\tconst geometry = object.geometry;\n\t\t\t\tconst materials = object.materials;\n\t\t\t\tconst isLine = ( geometry.type === 'Line' );\n\t\t\t\tconst isPoints = ( geometry.type === 'Points' );\n\t\t\t\tlet hasVertexColors = false;\n\n\t\t\t\t// Skip o/g line declarations that did not follow with any faces\n\t\t\t\tif ( geometry.vertices.length === 0 ) continue;\n\n\t\t\t\tconst buffergeometry = new BufferGeometry();\n\n\t\t\t\tbuffergeometry.setAttribute( 'position', new Float32BufferAttribute( geometry.vertices, 3 ) );\n\n\t\t\t\tif ( geometry.normals.length > 0 ) {\n\n\t\t\t\t\tbuffergeometry.setAttribute( 'normal', new Float32BufferAttribute( geometry.normals, 3 ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( geometry.colors.length > 0 ) {\n\n\t\t\t\t\thasVertexColors = true;\n\t\t\t\t\tbuffergeometry.setAttribute( 'color', new Float32BufferAttribute( geometry.colors, 3 ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( geometry.hasUVIndices === true ) {\n\n\t\t\t\t\tbuffergeometry.setAttribute( 'uv', new Float32BufferAttribute( geometry.uvs, 2 ) );\n\n\t\t\t\t}\n\n\t\t\t\t// Create materials\n\n\t\t\t\tconst createdMaterials = [];\n\n\t\t\t\tfor ( let mi = 0, miLen = materials.length; mi < miLen; mi ++ ) {\n\n\t\t\t\t\tconst sourceMaterial = materials[ mi ];\n\t\t\t\t\tconst materialHash = sourceMaterial.name + '_' + sourceMaterial.smooth + '_' + hasVertexColors;\n\t\t\t\t\tlet material = state.materials[ materialHash ];\n\n\t\t\t\t\tif ( this.materials !== null ) {\n\n\t\t\t\t\t\tmaterial = this.materials.create( sourceMaterial.name );\n\n\t\t\t\t\t\t// mtl etc. loaders probably can't create line materials correctly, copy properties to a line material.\n\t\t\t\t\t\tif ( isLine && material && ! ( material instanceof LineBasicMaterial ) ) {\n\n\t\t\t\t\t\t\tconst materialLine = new LineBasicMaterial();\n\t\t\t\t\t\t\tMaterial.prototype.copy.call( materialLine, material );\n\t\t\t\t\t\t\tmaterialLine.color.copy( material.color );\n\t\t\t\t\t\t\tmaterial = materialLine;\n\n\t\t\t\t\t\t} else if ( isPoints && material && ! ( material instanceof PointsMaterial ) ) {\n\n\t\t\t\t\t\t\tconst materialPoints = new PointsMaterial( { size: 10, sizeAttenuation: false } );\n\t\t\t\t\t\t\tMaterial.prototype.copy.call( materialPoints, material );\n\t\t\t\t\t\t\tmaterialPoints.color.copy( material.color );\n\t\t\t\t\t\t\tmaterialPoints.map = material.map;\n\t\t\t\t\t\t\tmaterial = materialPoints;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( material === undefined ) {\n\n\t\t\t\t\t\tif ( isLine ) {\n\n\t\t\t\t\t\t\tmaterial = new LineBasicMaterial();\n\n\t\t\t\t\t\t} else if ( isPoints ) {\n\n\t\t\t\t\t\t\tmaterial = new PointsMaterial( { size: 1, sizeAttenuation: false } );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tmaterial = new MeshPhongMaterial();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmaterial.name = sourceMaterial.name;\n\t\t\t\t\t\tmaterial.flatShading = sourceMaterial.smooth ? false : true;\n\t\t\t\t\t\tmaterial.vertexColors = hasVertexColors;\n\n\t\t\t\t\t\tstate.materials[ materialHash ] = material;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcreatedMaterials.push( material );\n\n\t\t\t\t}\n\n\t\t\t\t// Create mesh\n\n\t\t\t\tlet mesh;\n\n\t\t\t\tif ( createdMaterials.length > 1 ) {\n\n\t\t\t\t\tfor ( let mi = 0, miLen = materials.length; mi < miLen; mi ++ ) {\n\n\t\t\t\t\t\tconst sourceMaterial = materials[ mi ];\n\t\t\t\t\t\tbuffergeometry.addGroup( sourceMaterial.groupStart, sourceMaterial.groupCount, mi );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( isLine ) {\n\n\t\t\t\t\t\tmesh = new LineSegments( buffergeometry, createdMaterials );\n\n\t\t\t\t\t} else if ( isPoints ) {\n\n\t\t\t\t\t\tmesh = new Points( buffergeometry, createdMaterials );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tmesh = new Mesh( buffergeometry, createdMaterials );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( isLine ) {\n\n\t\t\t\t\t\tmesh = new LineSegments( buffergeometry, createdMaterials[ 0 ] );\n\n\t\t\t\t\t} else if ( isPoints ) {\n\n\t\t\t\t\t\tmesh = new Points( buffergeometry, createdMaterials[ 0 ] );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tmesh = new Mesh( buffergeometry, createdMaterials[ 0 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tmesh.name = object.name;\n\n\t\t\t\tcontainer.add( mesh );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// if there is only the default parser state object with no geometry data, interpret data as point cloud\n\n\t\t\tif ( state.vertices.length > 0 ) {\n\n\t\t\t\tconst material = new PointsMaterial( { size: 1, sizeAttenuation: false } );\n\n\t\t\t\tconst buffergeometry = new BufferGeometry();\n\n\t\t\t\tbuffergeometry.setAttribute( 'position', new Float32BufferAttribute( state.vertices, 3 ) );\n\n\t\t\t\tif ( state.colors.length > 0 && state.colors[ 0 ] !== undefined ) {\n\n\t\t\t\t\tbuffergeometry.setAttribute( 'color', new Float32BufferAttribute( state.colors, 3 ) );\n\t\t\t\t\tmaterial.vertexColors = true;\n\n\t\t\t\t}\n\n\t\t\t\tconst points = new Points( buffergeometry, material );\n\t\t\t\tcontainer.add( points );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn container;\n\n\t}\n\n}\n\nexport { OBJLoader };\n","import {\n\tBufferAttribute,\n\tBufferGeometry,\n\tColor,\n\tFileLoader,\n\tFloat32BufferAttribute,\n\tLoader,\n\tVector3,\n\tSRGBColorSpace\n} from 'three';\n\n/**\n * Description: A THREE loader for STL ASCII files, as created by Solidworks and other CAD programs.\n *\n * Supports both binary and ASCII encoded files, with automatic detection of type.\n *\n * The loader returns a non-indexed buffer geometry.\n *\n * Limitations:\n * Binary decoding supports \"Magics\" color format (http://en.wikipedia.org/wiki/STL_(file_format)#Color_in_binary_STL).\n * There is perhaps some question as to how valid it is to always assume little-endian-ness.\n * ASCII decoding assumes file is UTF-8.\n *\n * Usage:\n * const loader = new STLLoader();\n * loader.load( './models/stl/slotted_disk.stl', function ( geometry ) {\n * scene.add( new THREE.Mesh( geometry ) );\n * });\n *\n * For binary STLs geometry might contain colors for vertices. To use it:\n * // use the same code to load STL as above\n * if (geometry.hasColors) {\n * material = new THREE.MeshPhongMaterial({ opacity: geometry.alpha, vertexColors: true });\n * } else { .... }\n * const mesh = new THREE.Mesh( geometry, material );\n *\n * For ASCII STLs containing multiple solids, each solid is assigned to a different group.\n * Groups can be used to assign a different color by defining an array of materials with the same length of\n * geometry.groups and passing it to the Mesh constructor:\n *\n * const mesh = new THREE.Mesh( geometry, material );\n *\n * For example:\n *\n * const materials = [];\n * const nGeometryGroups = geometry.groups.length;\n *\n * const colorMap = ...; // Some logic to index colors.\n *\n * for (let i = 0; i < nGeometryGroups; i++) {\n *\n *\t\tconst material = new THREE.MeshPhongMaterial({\n *\t\t\tcolor: colorMap[i],\n *\t\t\twireframe: false\n *\t\t});\n *\n * }\n *\n * materials.push(material);\n * const mesh = new THREE.Mesh(geometry, materials);\n */\n\n\nclass STLLoader extends Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( text ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tparse( data ) {\n\n\t\tfunction isBinary( data ) {\n\n\t\t\tconst reader = new DataView( data );\n\t\t\tconst face_size = ( 32 / 8 * 3 ) + ( ( 32 / 8 * 3 ) * 3 ) + ( 16 / 8 );\n\t\t\tconst n_faces = reader.getUint32( 80, true );\n\t\t\tconst expect = 80 + ( 32 / 8 ) + ( n_faces * face_size );\n\n\t\t\tif ( expect === reader.byteLength ) {\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t\t// An ASCII STL data must begin with 'solid ' as the first six bytes.\n\t\t\t// However, ASCII STLs lacking the SPACE after the 'd' are known to be\n\t\t\t// plentiful. So, check the first 5 bytes for 'solid'.\n\n\t\t\t// Several encodings, such as UTF-8, precede the text with up to 5 bytes:\n\t\t\t// https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding\n\t\t\t// Search for \"solid\" to start anywhere after those prefixes.\n\n\t\t\t// US-ASCII ordinal values for 's', 'o', 'l', 'i', 'd'\n\n\t\t\tconst solid = [ 115, 111, 108, 105, 100 ];\n\n\t\t\tfor ( let off = 0; off < 5; off ++ ) {\n\n\t\t\t\t// If \"solid\" text is matched to the current offset, declare it to be an ASCII STL.\n\n\t\t\t\tif ( matchDataViewAt( solid, reader, off ) ) return false;\n\n\t\t\t}\n\n\t\t\t// Couldn't find \"solid\" text at the beginning; it is binary STL.\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\tfunction matchDataViewAt( query, reader, offset ) {\n\n\t\t\t// Check if each byte in query matches the corresponding byte from the current offset\n\n\t\t\tfor ( let i = 0, il = query.length; i < il; i ++ ) {\n\n\t\t\t\tif ( query[ i ] !== reader.getUint8( offset + i ) ) return false;\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\tfunction parseBinary( data ) {\n\n\t\t\tconst reader = new DataView( data );\n\t\t\tconst faces = reader.getUint32( 80, true );\n\n\t\t\tlet r, g, b, hasColors = false, colors;\n\t\t\tlet defaultR, defaultG, defaultB, alpha;\n\n\t\t\t// process STL header\n\t\t\t// check for default color in header (\"COLOR=rgba\" sequence).\n\n\t\t\tfor ( let index = 0; index < 80 - 10; index ++ ) {\n\n\t\t\t\tif ( ( reader.getUint32( index, false ) == 0x434F4C4F /*COLO*/ ) &&\n\t\t\t\t\t( reader.getUint8( index + 4 ) == 0x52 /*'R'*/ ) &&\n\t\t\t\t\t( reader.getUint8( index + 5 ) == 0x3D /*'='*/ ) ) {\n\n\t\t\t\t\thasColors = true;\n\t\t\t\t\tcolors = new Float32Array( faces * 3 * 3 );\n\n\t\t\t\t\tdefaultR = reader.getUint8( index + 6 ) / 255;\n\t\t\t\t\tdefaultG = reader.getUint8( index + 7 ) / 255;\n\t\t\t\t\tdefaultB = reader.getUint8( index + 8 ) / 255;\n\t\t\t\t\talpha = reader.getUint8( index + 9 ) / 255;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst dataOffset = 84;\n\t\t\tconst faceLength = 12 * 4 + 2;\n\n\t\t\tconst geometry = new BufferGeometry();\n\n\t\t\tconst vertices = new Float32Array( faces * 3 * 3 );\n\t\t\tconst normals = new Float32Array( faces * 3 * 3 );\n\n\t\t\tconst color = new Color();\n\n\t\t\tfor ( let face = 0; face < faces; face ++ ) {\n\n\t\t\t\tconst start = dataOffset + face * faceLength;\n\t\t\t\tconst normalX = reader.getFloat32( start, true );\n\t\t\t\tconst normalY = reader.getFloat32( start + 4, true );\n\t\t\t\tconst normalZ = reader.getFloat32( start + 8, true );\n\n\t\t\t\tif ( hasColors ) {\n\n\t\t\t\t\tconst packedColor = reader.getUint16( start + 48, true );\n\n\t\t\t\t\tif ( ( packedColor & 0x8000 ) === 0 ) {\n\n\t\t\t\t\t\t// facet has its own unique color\n\n\t\t\t\t\t\tr = ( packedColor & 0x1F ) / 31;\n\t\t\t\t\t\tg = ( ( packedColor >> 5 ) & 0x1F ) / 31;\n\t\t\t\t\t\tb = ( ( packedColor >> 10 ) & 0x1F ) / 31;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tr = defaultR;\n\t\t\t\t\t\tg = defaultG;\n\t\t\t\t\t\tb = defaultB;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 1; i <= 3; i ++ ) {\n\n\t\t\t\t\tconst vertexstart = start + i * 12;\n\t\t\t\t\tconst componentIdx = ( face * 3 * 3 ) + ( ( i - 1 ) * 3 );\n\n\t\t\t\t\tvertices[ componentIdx ] = reader.getFloat32( vertexstart, true );\n\t\t\t\t\tvertices[ componentIdx + 1 ] = reader.getFloat32( vertexstart + 4, true );\n\t\t\t\t\tvertices[ componentIdx + 2 ] = reader.getFloat32( vertexstart + 8, true );\n\n\t\t\t\t\tnormals[ componentIdx ] = normalX;\n\t\t\t\t\tnormals[ componentIdx + 1 ] = normalY;\n\t\t\t\t\tnormals[ componentIdx + 2 ] = normalZ;\n\n\t\t\t\t\tif ( hasColors ) {\n\n\t\t\t\t\t\tcolor.setRGB( r, g, b, SRGBColorSpace );\n\n\t\t\t\t\t\tcolors[ componentIdx ] = color.r;\n\t\t\t\t\t\tcolors[ componentIdx + 1 ] = color.g;\n\t\t\t\t\t\tcolors[ componentIdx + 2 ] = color.b;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( 'position', new BufferAttribute( vertices, 3 ) );\n\t\t\tgeometry.setAttribute( 'normal', new BufferAttribute( normals, 3 ) );\n\n\t\t\tif ( hasColors ) {\n\n\t\t\t\tgeometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) );\n\t\t\t\tgeometry.hasColors = true;\n\t\t\t\tgeometry.alpha = alpha;\n\n\t\t\t}\n\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\tfunction parseASCII( data ) {\n\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tconst patternSolid = /solid([\\s\\S]*?)endsolid/g;\n\t\t\tconst patternFace = /facet([\\s\\S]*?)endfacet/g;\n\t\t\tconst patternName = /solid\\s(.+)/;\n\t\t\tlet faceCounter = 0;\n\n\t\t\tconst patternFloat = /[\\s]+([+-]?(?:\\d*)(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)/.source;\n\t\t\tconst patternVertex = new RegExp( 'vertex' + patternFloat + patternFloat + patternFloat, 'g' );\n\t\t\tconst patternNormal = new RegExp( 'normal' + patternFloat + patternFloat + patternFloat, 'g' );\n\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst groupNames = [];\n\n\t\t\tconst normal = new Vector3();\n\n\t\t\tlet result;\n\n\t\t\tlet groupCount = 0;\n\t\t\tlet startVertex = 0;\n\t\t\tlet endVertex = 0;\n\n\t\t\twhile ( ( result = patternSolid.exec( data ) ) !== null ) {\n\n\t\t\t\tstartVertex = endVertex;\n\n\t\t\t\tconst solid = result[ 0 ];\n\n\t\t\t\tconst name = ( result = patternName.exec( solid ) ) !== null ? result[ 1 ] : '';\n\t\t\t\tgroupNames.push( name );\n\n\t\t\t\twhile ( ( result = patternFace.exec( solid ) ) !== null ) {\n\n\t\t\t\t\tlet vertexCountPerFace = 0;\n\t\t\t\t\tlet normalCountPerFace = 0;\n\n\t\t\t\t\tconst text = result[ 0 ];\n\n\t\t\t\t\twhile ( ( result = patternNormal.exec( text ) ) !== null ) {\n\n\t\t\t\t\t\tnormal.x = parseFloat( result[ 1 ] );\n\t\t\t\t\t\tnormal.y = parseFloat( result[ 2 ] );\n\t\t\t\t\t\tnormal.z = parseFloat( result[ 3 ] );\n\t\t\t\t\t\tnormalCountPerFace ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t\twhile ( ( result = patternVertex.exec( text ) ) !== null ) {\n\n\t\t\t\t\t\tvertices.push( parseFloat( result[ 1 ] ), parseFloat( result[ 2 ] ), parseFloat( result[ 3 ] ) );\n\t\t\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\t\t\t\t\t\tvertexCountPerFace ++;\n\t\t\t\t\t\tendVertex ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// every face have to own ONE valid normal\n\n\t\t\t\t\tif ( normalCountPerFace !== 1 ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.STLLoader: Something isn\\'t right with the normal of face number ' + faceCounter );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// each face have to own THREE valid vertices\n\n\t\t\t\t\tif ( vertexCountPerFace !== 3 ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.STLLoader: Something isn\\'t right with the vertices of face number ' + faceCounter );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfaceCounter ++;\n\n\t\t\t\t}\n\n\t\t\t\tconst start = startVertex;\n\t\t\t\tconst count = endVertex - startVertex;\n\n\t\t\t\tgeometry.userData.groupNames = groupNames;\n\n\t\t\t\tgeometry.addGroup( start, count, groupCount );\n\t\t\t\tgroupCount ++;\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\t\tgeometry.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\tfunction ensureString( buffer ) {\n\n\t\t\tif ( typeof buffer !== 'string' ) {\n\n\t\t\t\treturn new TextDecoder().decode( buffer );\n\n\t\t\t}\n\n\t\t\treturn buffer;\n\n\t\t}\n\n\t\tfunction ensureBinary( buffer ) {\n\n\t\t\tif ( typeof buffer === 'string' ) {\n\n\t\t\t\tconst array_buffer = new Uint8Array( buffer.length );\n\t\t\t\tfor ( let i = 0; i < buffer.length; i ++ ) {\n\n\t\t\t\t\tarray_buffer[ i ] = buffer.charCodeAt( i ) & 0xff; // implicitly assumes little-endian\n\n\t\t\t\t}\n\n\t\t\t\treturn array_buffer.buffer || array_buffer;\n\n\t\t\t} else {\n\n\t\t\t\treturn buffer;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// start\n\n\t\tconst binData = ensureBinary( data );\n\n\t\treturn isBinary( binData ) ? parseBinary( binData ) : parseASCII( ensureString( data ) );\n\n\t}\n\n}\n\nexport { STLLoader };\n","import * as THREE from 'three'\nimport { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader'\nimport { GLTF, GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'\nimport { MTLLoader } from 'three/examples/jsm/loaders/MTLLoader'\nimport { OBJLoader } from 'three/examples/jsm/loaders/OBJLoader'\nimport { STLLoader } from 'three/examples/jsm/loaders/STLLoader'\n\nimport { useToastStore } from '@/stores/toastStore'\n\nimport {\n EventManagerInterface,\n LoaderManagerInterface,\n ModelManagerInterface\n} from './interfaces'\n\nexport class LoaderManager implements LoaderManagerInterface {\n gltfLoader: GLTFLoader\n objLoader: OBJLoader\n mtlLoader: MTLLoader\n fbxLoader: FBXLoader\n stlLoader: STLLoader\n\n private modelManager: ModelManagerInterface\n private eventManager: EventManagerInterface\n\n constructor(\n modelManager: ModelManagerInterface,\n eventManager: EventManagerInterface\n ) {\n this.modelManager = modelManager\n this.eventManager = eventManager\n\n this.gltfLoader = new GLTFLoader()\n this.objLoader = new OBJLoader()\n this.mtlLoader = new MTLLoader()\n this.fbxLoader = new FBXLoader()\n this.stlLoader = new STLLoader()\n }\n\n init(): void {}\n\n dispose(): void {}\n\n async loadModel(url: string, originalFileName?: string): Promise {\n try {\n this.eventManager.emitEvent('modelLoadingStart', null)\n\n this.modelManager.clearModel()\n\n let fileExtension: string | undefined\n if (originalFileName) {\n fileExtension = originalFileName.split('.').pop()?.toLowerCase()\n } else {\n const filename = new URLSearchParams(url.split('?')[1]).get('filename')\n fileExtension = filename?.split('.').pop()?.toLowerCase()\n }\n\n if (!fileExtension) {\n useToastStore().addAlert('Could not determine file type')\n return\n }\n\n let model = await this.loadModelInternal(url, fileExtension)\n\n if (model) {\n await this.modelManager.setupModel(model)\n }\n\n this.eventManager.emitEvent('modelLoadingEnd', null)\n } catch (error) {\n this.eventManager.emitEvent('modelLoadingEnd', null)\n console.error('Error loading model:', error)\n useToastStore().addAlert('Error loading model')\n }\n }\n\n private async loadModelInternal(\n url: string,\n fileExtension: string\n ): Promise {\n let model: THREE.Object3D | null = null\n\n switch (fileExtension) {\n case 'stl':\n const geometry = await this.stlLoader.loadAsync(url)\n this.modelManager.setOriginalModel(geometry)\n geometry.computeVertexNormals()\n\n const mesh = new THREE.Mesh(\n geometry,\n this.modelManager.standardMaterial\n )\n\n const group = new THREE.Group()\n group.add(mesh)\n model = group\n break\n\n case 'fbx':\n const fbxModel = await this.fbxLoader.loadAsync(url)\n this.modelManager.setOriginalModel(fbxModel)\n model = fbxModel\n\n fbxModel.traverse((child) => {\n if (child instanceof THREE.Mesh) {\n this.modelManager.originalMaterials.set(child, child.material)\n }\n })\n break\n\n case 'obj':\n if (this.modelManager.materialMode === 'original') {\n const mtlUrl = url.replace(/\\.obj([^.]*$)/, '.mtl$1')\n try {\n const materials = await this.mtlLoader.loadAsync(mtlUrl)\n materials.preload()\n this.objLoader.setMaterials(materials)\n } catch (e) {\n console.log(\n 'No MTL file found or error loading it, continuing without materials'\n )\n }\n }\n\n model = await this.objLoader.loadAsync(url)\n model.traverse((child) => {\n if (child instanceof THREE.Mesh) {\n this.modelManager.originalMaterials.set(child, child.material)\n }\n })\n break\n\n case 'gltf':\n case 'glb':\n const gltf = await this.gltfLoader.loadAsync(url)\n this.modelManager.setOriginalModel(gltf)\n model = gltf.scene\n\n gltf.scene.traverse((child) => {\n if (child instanceof THREE.Mesh) {\n child.geometry.computeVertexNormals()\n this.modelManager.originalMaterials.set(child, child.material)\n }\n })\n break\n }\n\n return model\n }\n}\n","import * as THREE from 'three'\nimport { GLTF } from 'three/examples/jsm/loaders/GLTFLoader'\n\nimport {\n EventManagerInterface,\n MaterialMode,\n ModelManagerInterface,\n UpDirection\n} from './interfaces'\n\nexport class ModelManager implements ModelManagerInterface {\n currentModel: THREE.Object3D | null = null\n originalModel: THREE.Object3D | THREE.BufferGeometry | GLTF | null = null\n originalRotation: THREE.Euler | null = null\n currentUpDirection: UpDirection = 'original'\n materialMode: MaterialMode = 'original'\n originalMaterials: WeakMap =\n new WeakMap()\n normalMaterial: THREE.MeshNormalMaterial\n standardMaterial: THREE.MeshStandardMaterial\n wireframeMaterial: THREE.MeshBasicMaterial\n depthMaterial: THREE.MeshDepthMaterial\n\n private scene: THREE.Scene\n private renderer: THREE.WebGLRenderer\n private eventManager: EventManagerInterface\n private activeCamera: THREE.Camera\n private setupCamera: (size: THREE.Vector3) => void\n\n constructor(\n scene: THREE.Scene,\n renderer: THREE.WebGLRenderer,\n eventManager: EventManagerInterface,\n getActiveCamera: () => THREE.Camera,\n setupCamera: (size: THREE.Vector3) => void\n ) {\n this.scene = scene\n this.renderer = renderer\n this.eventManager = eventManager\n this.activeCamera = getActiveCamera()\n this.setupCamera = setupCamera\n\n this.normalMaterial = new THREE.MeshNormalMaterial({\n flatShading: false,\n side: THREE.DoubleSide,\n normalScale: new THREE.Vector2(1, 1),\n transparent: false,\n opacity: 1.0\n })\n\n this.wireframeMaterial = new THREE.MeshBasicMaterial({\n color: 0xffffff,\n wireframe: true,\n transparent: false,\n opacity: 1.0\n })\n\n this.depthMaterial = new THREE.MeshDepthMaterial({\n depthPacking: THREE.BasicDepthPacking,\n side: THREE.DoubleSide\n })\n\n this.standardMaterial = this.createSTLMaterial()\n }\n\n init(): void {}\n\n dispose(): void {\n this.clearModel()\n this.normalMaterial.dispose()\n this.standardMaterial.dispose()\n this.wireframeMaterial.dispose()\n this.depthMaterial.dispose()\n }\n\n createSTLMaterial(): THREE.MeshStandardMaterial {\n return new THREE.MeshStandardMaterial({\n color: 0x808080,\n metalness: 0.1,\n roughness: 0.8,\n flatShading: false,\n side: THREE.DoubleSide\n })\n }\n\n setMaterialMode(mode: MaterialMode): void {\n this.materialMode = mode\n\n if (!this.currentModel) return\n\n if (mode === 'depth') {\n this.renderer.outputColorSpace = THREE.LinearSRGBColorSpace\n } else {\n this.renderer.outputColorSpace = THREE.SRGBColorSpace\n }\n\n this.currentModel.traverse((child) => {\n if (child instanceof THREE.Mesh) {\n switch (mode) {\n case 'depth':\n if (!this.originalMaterials.has(child)) {\n this.originalMaterials.set(child, child.material)\n }\n const depthMat = new THREE.MeshDepthMaterial({\n depthPacking: THREE.BasicDepthPacking,\n side: THREE.DoubleSide\n })\n\n depthMat.onBeforeCompile = (shader) => {\n shader.uniforms.cameraType = {\n value:\n this.activeCamera instanceof THREE.OrthographicCamera\n ? 1.0\n : 0.0\n }\n\n shader.fragmentShader = `\n uniform float cameraType;\n ${shader.fragmentShader}\n `\n\n shader.fragmentShader = shader.fragmentShader.replace(\n /gl_FragColor\\s*=\\s*vec4\\(\\s*vec3\\(\\s*1.0\\s*-\\s*fragCoordZ\\s*\\)\\s*,\\s*opacity\\s*\\)\\s*;/,\n `\n float depth = 1.0 - fragCoordZ;\n if (cameraType > 0.5) {\n depth = pow(depth, 400.0);\n } else {\n depth = pow(depth, 0.6);\n }\n gl_FragColor = vec4(vec3(depth), opacity);\n `\n )\n }\n\n depthMat.customProgramCacheKey = () => {\n return this.activeCamera instanceof THREE.OrthographicCamera\n ? 'ortho'\n : 'persp'\n }\n\n child.material = depthMat\n break\n case 'normal':\n if (!this.originalMaterials.has(child)) {\n this.originalMaterials.set(child, child.material)\n }\n child.material = new THREE.MeshNormalMaterial({\n flatShading: false,\n side: THREE.DoubleSide,\n normalScale: new THREE.Vector2(1, 1),\n transparent: false,\n opacity: 1.0\n })\n break\n\n case 'wireframe':\n if (!this.originalMaterials.has(child)) {\n this.originalMaterials.set(child, child.material)\n }\n child.material = new THREE.MeshBasicMaterial({\n color: 0xffffff,\n wireframe: true,\n transparent: false,\n opacity: 1.0\n })\n break\n\n case 'original':\n const originalMaterial = this.originalMaterials.get(child)\n if (originalMaterial) {\n child.material = originalMaterial\n } else {\n child.material = this.standardMaterial\n }\n break\n }\n }\n })\n\n this.eventManager.emitEvent('materialModeChange', mode)\n }\n\n setupModelMaterials(model: THREE.Object3D): void {\n model.traverse((child) => {\n if (child instanceof THREE.Mesh) {\n this.originalMaterials.set(child, child.material)\n }\n })\n\n if (this.materialMode !== 'original') {\n this.setMaterialMode(this.materialMode)\n }\n }\n\n clearModel(): void {\n const objectsToRemove: THREE.Object3D[] = []\n\n this.scene.traverse((object) => {\n const isEnvironmentObject =\n object instanceof THREE.GridHelper ||\n object instanceof THREE.Light ||\n object instanceof THREE.Camera\n\n if (!isEnvironmentObject) {\n objectsToRemove.push(object)\n }\n })\n\n objectsToRemove.forEach((obj) => {\n if (obj.parent && obj.parent !== this.scene) {\n obj.parent.remove(obj)\n } else {\n this.scene.remove(obj)\n }\n\n if (obj instanceof THREE.Mesh) {\n obj.geometry?.dispose()\n if (Array.isArray(obj.material)) {\n obj.material.forEach((material) => material.dispose())\n } else {\n obj.material?.dispose()\n }\n }\n })\n\n this.reset()\n }\n\n reset(): void {\n this.currentModel = null\n this.originalRotation = null\n this.currentUpDirection = 'original'\n this.setMaterialMode('original')\n\n this.originalMaterials = new WeakMap()\n }\n\n async setupModel(model: THREE.Object3D): Promise {\n this.currentModel = model\n\n const box = new THREE.Box3().setFromObject(model)\n const size = box.getSize(new THREE.Vector3())\n const center = box.getCenter(new THREE.Vector3())\n\n const maxDim = Math.max(size.x, size.y, size.z)\n const targetSize = 5\n const scale = targetSize / maxDim\n model.scale.multiplyScalar(scale)\n\n box.setFromObject(model)\n box.getCenter(center)\n box.getSize(size)\n\n model.position.set(-center.x, -box.min.y, -center.z)\n\n this.scene.add(model)\n\n if (this.materialMode !== 'original') {\n this.setMaterialMode(this.materialMode)\n }\n\n if (this.currentUpDirection !== 'original') {\n this.setUpDirection(this.currentUpDirection)\n }\n this.setupModelMaterials(model)\n\n this.setupCamera(size)\n }\n\n setOriginalModel(model: THREE.Object3D | THREE.BufferGeometry | GLTF): void {\n this.originalModel = model\n }\n\n setUpDirection(direction: UpDirection): void {\n if (!this.currentModel) return\n\n if (!this.originalRotation && this.currentModel.rotation) {\n this.originalRotation = this.currentModel.rotation.clone()\n }\n\n this.currentUpDirection = direction\n\n if (this.originalRotation) {\n this.currentModel.rotation.copy(this.originalRotation)\n }\n\n switch (direction) {\n case 'original':\n break\n case '-x':\n this.currentModel.rotation.z = Math.PI / 2\n break\n case '+x':\n this.currentModel.rotation.z = -Math.PI / 2\n break\n case '-y':\n this.currentModel.rotation.x = Math.PI\n break\n case '+y':\n break\n case '-z':\n this.currentModel.rotation.x = Math.PI / 2\n break\n case '+z':\n this.currentModel.rotation.x = -Math.PI / 2\n break\n }\n\n this.eventManager.emitEvent('upDirectionChange', direction)\n }\n}\n","import { LGraphNode } from '@comfyorg/litegraph'\n\nimport { NodeStorageInterface } from './interfaces'\n\nexport class NodeStorage implements NodeStorageInterface {\n private node: LGraphNode\n\n constructor(node: LGraphNode = {} as LGraphNode) {\n this.node = node\n }\n\n storeNodeProperty(name: string, value: any): void {\n if (this.node && this.node.properties) {\n this.node.properties[name] = value\n }\n }\n\n loadNodeProperty(name: string, defaultValue: any): any {\n if (\n !this.node ||\n !this.node.properties ||\n !(name in this.node.properties)\n ) {\n return defaultValue\n }\n return this.node.properties[name]\n }\n\n setNode(node: LGraphNode): void {\n this.node = node\n }\n}\n","import * as THREE from 'three'\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'\n\nimport { EventManagerInterface, PreviewManagerInterface } from './interfaces'\n\nexport class PreviewManager implements PreviewManagerInterface {\n previewRenderer: THREE.WebGLRenderer | null = null\n previewCamera: THREE.Camera\n previewContainer: HTMLDivElement = {} as HTMLDivElement\n showPreview: boolean = true\n previewWidth: number = 120\n\n private targetWidth: number = 1024\n private targetHeight: number = 1024\n private scene: THREE.Scene\n private getActiveCamera: () => THREE.Camera\n private getControls: () => OrbitControls\n private eventManager: EventManagerInterface\n\n private getRenderer: () => THREE.WebGLRenderer\n\n private previewBackgroundScene: THREE.Scene\n private previewBackgroundCamera: THREE.OrthographicCamera\n private previewBackgroundMesh: THREE.Mesh | null = null\n private previewBackgroundTexture: THREE.Texture | null = null\n\n constructor(\n scene: THREE.Scene,\n getActiveCamera: () => THREE.Camera,\n getControls: () => OrbitControls,\n getRenderer: () => THREE.WebGLRenderer,\n eventManager: EventManagerInterface,\n backgroundScene: THREE.Scene,\n backgroundCamera: THREE.OrthographicCamera\n ) {\n this.scene = scene\n this.getActiveCamera = getActiveCamera\n this.getControls = getControls\n this.getRenderer = getRenderer\n this.eventManager = eventManager\n\n this.previewCamera = this.getActiveCamera().clone()\n\n this.previewBackgroundScene = backgroundScene.clone()\n this.previewBackgroundCamera = backgroundCamera.clone()\n\n const planeGeometry = new THREE.PlaneGeometry(2, 2)\n const planeMaterial = new THREE.MeshBasicMaterial({\n transparent: true,\n depthWrite: false,\n depthTest: false,\n side: THREE.DoubleSide\n })\n\n this.previewBackgroundMesh = new THREE.Mesh(planeGeometry, planeMaterial)\n this.previewBackgroundMesh.position.set(0, 0, 0)\n this.previewBackgroundScene.add(this.previewBackgroundMesh)\n }\n\n init(): void {}\n\n dispose(): void {\n if (this.previewRenderer) {\n this.previewRenderer.dispose()\n }\n\n if (this.previewBackgroundTexture) {\n this.previewBackgroundTexture.dispose()\n }\n\n if (this.previewBackgroundMesh) {\n this.previewBackgroundMesh.geometry.dispose()\n ;(this.previewBackgroundMesh.material as THREE.Material).dispose()\n }\n }\n\n createCapturePreview(container: Element | HTMLElement): void {\n this.previewRenderer = new THREE.WebGLRenderer({\n alpha: true,\n antialias: true,\n preserveDrawingBuffer: true\n })\n\n this.previewRenderer.setSize(this.targetWidth, this.targetHeight)\n this.previewRenderer.setClearColor(0x282828)\n this.previewRenderer.autoClear = false\n this.previewRenderer.outputColorSpace = THREE.SRGBColorSpace\n\n this.previewContainer = document.createElement('div')\n this.previewContainer.style.cssText = `\n position: absolute;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.2);\n display: block;\n transition: border-color 0.1s ease;\n `\n this.previewContainer.appendChild(this.previewRenderer.domElement)\n\n const MIN_PREVIEW_WIDTH = 120\n const MAX_PREVIEW_WIDTH = 240\n\n this.previewContainer.addEventListener('wheel', (event) => {\n event.preventDefault()\n event.stopPropagation()\n\n const delta = event.deltaY\n const oldWidth = this.previewWidth\n\n if (delta > 0) {\n this.previewWidth = Math.max(MIN_PREVIEW_WIDTH, this.previewWidth - 10)\n } else {\n this.previewWidth = Math.min(MAX_PREVIEW_WIDTH, this.previewWidth + 10)\n }\n\n if (\n oldWidth !== this.previewWidth &&\n (this.previewWidth === MIN_PREVIEW_WIDTH ||\n this.previewWidth === MAX_PREVIEW_WIDTH)\n ) {\n this.flashPreviewBorder()\n }\n\n this.updatePreviewSize()\n this.updatePreviewRender()\n })\n\n this.previewContainer.style.display = this.showPreview ? 'block' : 'none'\n\n container.appendChild(this.previewContainer)\n\n this.updatePreviewSize()\n }\n\n flashPreviewBorder(): void {\n const originalBorder = this.previewContainer.style.border\n const originalBoxShadow = this.previewContainer.style.boxShadow\n\n this.previewContainer.style.border = '2px solid rgba(255, 255, 255, 0.8)'\n this.previewContainer.style.boxShadow = '0 0 8px rgba(255, 255, 255, 0.5)'\n\n setTimeout(() => {\n this.previewContainer.style.border = originalBorder\n this.previewContainer.style.boxShadow = originalBoxShadow\n }, 100)\n }\n\n updatePreviewSize(): void {\n if (!this.previewContainer) return\n\n const previewHeight =\n (this.previewWidth * this.targetHeight) / this.targetWidth\n this.previewRenderer?.setSize(this.previewWidth, previewHeight, false)\n }\n\n updatePreviewRender(): void {\n if (!this.previewRenderer || !this.previewContainer || !this.showPreview)\n return\n\n if (\n !this.previewCamera ||\n (this.getActiveCamera() instanceof THREE.PerspectiveCamera &&\n !(this.previewCamera instanceof THREE.PerspectiveCamera)) ||\n (this.getActiveCamera() instanceof THREE.OrthographicCamera &&\n !(this.previewCamera instanceof THREE.OrthographicCamera))\n ) {\n this.previewCamera = this.getActiveCamera().clone()\n }\n\n this.previewCamera.position.copy(this.getActiveCamera().position)\n this.previewCamera.rotation.copy(this.getActiveCamera().rotation)\n\n const aspect = this.targetWidth / this.targetHeight\n\n if (this.getActiveCamera() instanceof THREE.OrthographicCamera) {\n const activeOrtho = this.getActiveCamera() as THREE.OrthographicCamera\n const previewOrtho = this.previewCamera as THREE.OrthographicCamera\n\n const frustumHeight =\n (activeOrtho.top - activeOrtho.bottom) / activeOrtho.zoom\n\n const frustumWidth = frustumHeight * aspect\n\n previewOrtho.top = frustumHeight / 2\n previewOrtho.left = -frustumWidth / 2\n previewOrtho.right = frustumWidth / 2\n previewOrtho.bottom = -frustumHeight / 2\n previewOrtho.zoom = 1\n\n previewOrtho.updateProjectionMatrix()\n } else {\n ;(this.previewCamera as THREE.PerspectiveCamera).aspect = aspect\n ;(this.previewCamera as THREE.PerspectiveCamera).fov = (\n this.getActiveCamera() as THREE.PerspectiveCamera\n ).fov\n ;(this.previewCamera as THREE.PerspectiveCamera).updateProjectionMatrix()\n }\n\n this.previewCamera.lookAt(this.getControls().target)\n\n const previewHeight =\n (this.previewWidth * this.targetHeight) / this.targetWidth\n this.previewRenderer.setSize(this.previewWidth, previewHeight, false)\n this.previewRenderer.outputColorSpace = THREE.SRGBColorSpace\n this.previewRenderer.clear()\n\n if (this.previewBackgroundMesh && this.previewBackgroundTexture) {\n const material = this.previewBackgroundMesh\n .material as THREE.MeshBasicMaterial\n if (material.map) {\n const currentToneMapping = this.previewRenderer.toneMapping\n const currentExposure = this.previewRenderer.toneMappingExposure\n\n this.previewRenderer.toneMapping = THREE.NoToneMapping\n this.previewRenderer.render(\n this.previewBackgroundScene,\n this.previewBackgroundCamera\n )\n\n this.previewRenderer.toneMapping = currentToneMapping\n this.previewRenderer.toneMappingExposure = currentExposure\n }\n }\n\n this.previewRenderer.render(this.scene, this.previewCamera)\n }\n\n togglePreview(showPreview: boolean): void {\n if (this.previewRenderer) {\n this.showPreview = showPreview\n this.previewContainer.style.display = this.showPreview ? 'block' : 'none'\n }\n\n this.eventManager.emitEvent('showPreviewChange', showPreview)\n }\n\n setTargetSize(width: number, height: number): void {\n const oldAspect = this.targetWidth / this.targetHeight\n\n this.targetWidth = width\n this.targetHeight = height\n\n this.updatePreviewSize()\n\n const newAspect = width / height\n if (Math.abs(oldAspect - newAspect) > 0.001) {\n this.updateBackgroundSize(\n this.previewBackgroundTexture,\n this.previewBackgroundMesh,\n width,\n height\n )\n }\n\n if (this.previewRenderer && this.previewCamera) {\n if (this.previewCamera instanceof THREE.PerspectiveCamera) {\n this.previewCamera.aspect = width / height\n this.previewCamera.updateProjectionMatrix()\n } else if (this.previewCamera instanceof THREE.OrthographicCamera) {\n const frustumSize = 10\n const aspect = width / height\n this.previewCamera.left = (-frustumSize * aspect) / 2\n this.previewCamera.right = (frustumSize * aspect) / 2\n this.previewCamera.updateProjectionMatrix()\n }\n }\n }\n\n handleResize(): void {\n this.updatePreviewSize()\n this.updatePreviewRender()\n }\n\n updateBackgroundTexture(texture: THREE.Texture | null): void {\n if (this.previewBackgroundTexture) {\n this.previewBackgroundTexture.dispose()\n }\n\n this.previewBackgroundTexture = texture\n\n if (texture && this.previewBackgroundMesh) {\n const material2 = this.previewBackgroundMesh\n .material as THREE.MeshBasicMaterial\n material2.map = texture\n material2.needsUpdate = true\n\n this.previewBackgroundMesh.position.set(0, 0, 0)\n\n this.updateBackgroundSize(\n this.previewBackgroundTexture,\n this.previewBackgroundMesh,\n this.targetWidth,\n this.targetHeight\n )\n }\n }\n\n private updateBackgroundSize(\n backgroundTexture: THREE.Texture | null,\n backgroundMesh: THREE.Mesh | null,\n targetWidth: number,\n targetHeight: number\n ): void {\n if (!backgroundTexture || !backgroundMesh) return\n\n const material = backgroundMesh.material as THREE.MeshBasicMaterial\n\n if (!material.map) return\n\n const imageAspect =\n backgroundTexture.image.width / backgroundTexture.image.height\n const targetAspect = targetWidth / targetHeight\n\n if (imageAspect > targetAspect) {\n backgroundMesh.scale.set(imageAspect / targetAspect, 1, 1)\n } else {\n backgroundMesh.scale.set(1, targetAspect / imageAspect, 1)\n }\n\n material.needsUpdate = true\n }\n\n reset(): void {}\n}\n","import { api } from '@/scripts/api'\nimport { app } from '@/scripts/app'\nimport { useToastStore } from '@/stores/toastStore'\n\nclass Load3dUtils {\n static async uploadTempImage(imageData: string, prefix: string) {\n const blob = await fetch(imageData).then((r) => r.blob())\n const name = `${prefix}_${Date.now()}.png`\n const file = new File([blob], name)\n\n const body = new FormData()\n body.append('image', file)\n body.append('subfolder', 'threed')\n body.append('type', 'temp')\n\n const resp = await api.fetchApi('/upload/image', {\n method: 'POST',\n body\n })\n\n if (resp.status !== 200) {\n const err = `Error uploading temp image: ${resp.status} - ${resp.statusText}`\n useToastStore().addAlert(err)\n throw new Error(err)\n }\n\n return await resp.json()\n }\n\n static async uploadFile(file: File) {\n let uploadPath\n\n try {\n const body = new FormData()\n body.append('image', file)\n body.append('subfolder', '3d')\n\n const resp = await api.fetchApi('/upload/image', {\n method: 'POST',\n body\n })\n\n if (resp.status === 200) {\n const data = await resp.json()\n let path = data.name\n\n if (data.subfolder) {\n path = data.subfolder + '/' + path\n }\n\n uploadPath = path\n } else {\n useToastStore().addAlert(resp.status + ' - ' + resp.statusText)\n }\n } catch (error) {\n console.error('Upload error:', error)\n useToastStore().addAlert(\n error instanceof Error ? error.message : 'Upload failed'\n )\n }\n\n return uploadPath\n }\n\n static splitFilePath(path: string): [string, string] {\n const folder_separator = path.lastIndexOf('/')\n if (folder_separator === -1) {\n return ['', path]\n }\n return [\n path.substring(0, folder_separator),\n path.substring(folder_separator + 1)\n ]\n }\n\n static getResourceURL(\n subfolder: string,\n filename: string,\n type: string = 'input'\n ): string {\n const params = [\n 'filename=' + encodeURIComponent(filename),\n 'type=' + type,\n 'subfolder=' + subfolder,\n app.getRandParam().substring(1)\n ].join('&')\n\n return `/view?${params}`\n }\n}\n\nexport default Load3dUtils\n","import * as THREE from 'three'\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'\n\nimport Load3dUtils from './Load3dUtils'\nimport { EventManagerInterface, SceneManagerInterface } from './interfaces'\n\nexport class SceneManager implements SceneManagerInterface {\n scene: THREE.Scene\n gridHelper: THREE.GridHelper\n\n backgroundScene: THREE.Scene\n backgroundCamera: THREE.OrthographicCamera\n backgroundMesh: THREE.Mesh | null = null\n backgroundTexture: THREE.Texture | null = null\n\n private eventManager: EventManagerInterface\n private renderer: THREE.WebGLRenderer\n\n private getActiveCamera: () => THREE.Camera\n private getControls: () => OrbitControls\n\n constructor(\n renderer: THREE.WebGLRenderer,\n getActiveCamera: () => THREE.Camera,\n getControls: () => OrbitControls,\n eventManager: EventManagerInterface\n ) {\n this.renderer = renderer\n this.eventManager = eventManager\n this.scene = new THREE.Scene()\n\n this.getActiveCamera = getActiveCamera\n this.getControls = getControls\n\n this.gridHelper = new THREE.GridHelper(20, 20)\n this.gridHelper.position.set(0, 0, 0)\n this.scene.add(this.gridHelper)\n\n this.backgroundScene = new THREE.Scene()\n this.backgroundCamera = new THREE.OrthographicCamera(-1, 1, 1, -1, -1, 1)\n\n const planeGeometry = new THREE.PlaneGeometry(2, 2)\n const planeMaterial = new THREE.MeshBasicMaterial({\n transparent: true,\n depthWrite: false,\n depthTest: false,\n side: THREE.DoubleSide\n })\n\n this.backgroundMesh = new THREE.Mesh(planeGeometry, planeMaterial)\n this.backgroundMesh.position.set(0, 0, 0)\n this.backgroundScene.add(this.backgroundMesh)\n }\n\n init(): void {}\n\n dispose(): void {\n if (this.backgroundTexture) {\n this.backgroundTexture.dispose()\n }\n\n if (this.backgroundMesh) {\n this.backgroundMesh.geometry.dispose()\n ;(this.backgroundMesh.material as THREE.Material).dispose()\n }\n\n this.scene.clear()\n }\n\n toggleGrid(showGrid: boolean): void {\n if (this.gridHelper) {\n this.gridHelper.visible = showGrid\n }\n\n this.eventManager.emitEvent('showGridChange', showGrid)\n }\n\n setBackgroundColor(color: string): void {\n this.renderer.setClearColor(new THREE.Color(color))\n this.eventManager.emitEvent('backgroundColorChange', color)\n }\n\n async setBackgroundImage(uploadPath: string): Promise {\n if (uploadPath === '') {\n this.removeBackgroundImage()\n return\n }\n\n let imageUrl = Load3dUtils.getResourceURL(\n ...Load3dUtils.splitFilePath(uploadPath)\n )\n\n if (!imageUrl.startsWith('/api')) {\n imageUrl = '/api' + imageUrl\n }\n\n try {\n const textureLoader = new THREE.TextureLoader()\n const texture = await new Promise((resolve, reject) => {\n textureLoader.load(imageUrl, resolve, undefined, reject)\n })\n\n if (this.backgroundTexture) {\n this.backgroundTexture.dispose()\n }\n\n texture.colorSpace = THREE.SRGBColorSpace\n\n this.backgroundTexture = texture\n\n const material = this.backgroundMesh?.material as THREE.MeshBasicMaterial\n material.map = texture\n material.needsUpdate = true\n\n this.backgroundMesh?.position.set(0, 0, 0)\n\n this.updateBackgroundSize(\n this.backgroundTexture,\n this.backgroundMesh,\n this.renderer.domElement.width,\n this.renderer.domElement.height\n )\n\n this.eventManager.emitEvent('backgroundImageChange', uploadPath)\n } catch (error) {\n console.error('Error loading background image:', error)\n }\n }\n\n removeBackgroundImage(): void {\n if (this.backgroundMesh) {\n const material = this.backgroundMesh.material as THREE.MeshBasicMaterial\n material.map = null\n material.needsUpdate = true\n }\n\n if (this.backgroundTexture) {\n this.backgroundTexture.dispose()\n this.backgroundTexture = null\n }\n }\n\n updateBackgroundSize(\n backgroundTexture: THREE.Texture | null,\n backgroundMesh: THREE.Mesh | null,\n targetWidth: number,\n targetHeight: number\n ): void {\n if (!backgroundTexture || !backgroundMesh) return\n\n const material = backgroundMesh.material as THREE.MeshBasicMaterial\n\n if (!material.map) return\n\n const imageAspect =\n backgroundTexture.image.width / backgroundTexture.image.height\n const targetAspect = targetWidth / targetHeight\n\n if (imageAspect > targetAspect) {\n backgroundMesh.scale.set(imageAspect / targetAspect, 1, 1)\n } else {\n backgroundMesh.scale.set(1, targetAspect / imageAspect, 1)\n }\n\n material.needsUpdate = true\n }\n\n handleResize(width: number, height: number): void {\n if (this.backgroundTexture && this.backgroundMesh) {\n this.updateBackgroundSize(\n this.backgroundTexture,\n this.backgroundMesh,\n width,\n height\n )\n }\n }\n\n renderBackground(): void {\n if (this.backgroundMesh && this.backgroundTexture) {\n const material = this.backgroundMesh.material as THREE.MeshBasicMaterial\n if (material.map) {\n const currentToneMapping = this.renderer.toneMapping\n const currentExposure = this.renderer.toneMappingExposure\n\n this.renderer.toneMapping = THREE.NoToneMapping\n this.renderer.render(this.backgroundScene, this.backgroundCamera)\n\n this.renderer.toneMapping = currentToneMapping\n this.renderer.toneMappingExposure = currentExposure\n }\n }\n }\n\n captureScene(\n width: number,\n height: number\n ): Promise<{ scene: string; mask: string }> {\n return new Promise(async (resolve, reject) => {\n try {\n const originalWidth = this.renderer.domElement.width\n const originalHeight = this.renderer.domElement.height\n const originalClearColor = this.renderer.getClearColor(\n new THREE.Color()\n )\n const originalClearAlpha = this.renderer.getClearAlpha()\n const originalToneMapping = this.renderer.toneMapping\n const originalExposure = this.renderer.toneMappingExposure\n\n this.renderer.setSize(width, height)\n\n if (this.getActiveCamera() instanceof THREE.PerspectiveCamera) {\n const perspectiveCamera =\n this.getActiveCamera() as THREE.PerspectiveCamera\n\n perspectiveCamera.aspect = width / height\n perspectiveCamera.updateProjectionMatrix()\n } else {\n const orthographicCamera =\n this.getActiveCamera() as THREE.OrthographicCamera\n\n const frustumSize = 10\n const aspect = width / height\n\n orthographicCamera.left = (-frustumSize * aspect) / 2\n orthographicCamera.right = (frustumSize * aspect) / 2\n orthographicCamera.top = frustumSize / 2\n orthographicCamera.bottom = -frustumSize / 2\n\n orthographicCamera.updateProjectionMatrix()\n }\n\n if (this.backgroundTexture && this.backgroundMesh) {\n this.updateBackgroundSize(\n this.backgroundTexture,\n this.backgroundMesh,\n width,\n height\n )\n }\n\n this.renderer.clear()\n\n if (this.backgroundMesh && this.backgroundTexture) {\n const material = this.backgroundMesh\n .material as THREE.MeshBasicMaterial\n\n if (material.map) {\n this.renderer.toneMapping = THREE.NoToneMapping\n this.renderer.render(this.backgroundScene, this.backgroundCamera)\n this.renderer.toneMapping = originalToneMapping\n this.renderer.toneMappingExposure = originalExposure\n }\n }\n\n this.renderer.render(this.scene, this.getActiveCamera())\n const sceneData = this.renderer.domElement.toDataURL('image/png')\n\n this.renderer.setClearColor(0x000000, 0)\n this.renderer.clear()\n this.renderer.render(this.scene, this.getActiveCamera())\n const maskData = this.renderer.domElement.toDataURL('image/png')\n\n this.renderer.setClearColor(originalClearColor, originalClearAlpha)\n this.renderer.setSize(originalWidth, originalHeight)\n\n this.handleResize(width, height)\n\n resolve({ scene: sceneData, mask: maskData })\n } catch (error) {\n reject(error)\n }\n })\n }\n\n reset(): void {}\n}\n","import {\n\tCylinderGeometry,\n\tCanvasTexture,\n\tColor,\n\tEuler,\n\tMesh,\n\tMeshBasicMaterial,\n\tObject3D,\n\tOrthographicCamera,\n\tQuaternion,\n\tRaycaster,\n\tSprite,\n\tSpriteMaterial,\n\tSRGBColorSpace,\n\tVector2,\n\tVector3,\n\tVector4\n} from 'three';\n\nclass ViewHelper extends Object3D {\n\n\tconstructor( camera, domElement ) {\n\n\t\tsuper();\n\n\t\tthis.isViewHelper = true;\n\n\t\tthis.animating = false;\n\t\tthis.center = new Vector3();\n\n\t\tconst color1 = new Color( '#ff4466' );\n\t\tconst color2 = new Color( '#88ff44' );\n\t\tconst color3 = new Color( '#4488ff' );\n\t\tconst color4 = new Color( '#000000' );\n\n\t\tconst options = {};\n\n\t\tconst interactiveObjects = [];\n\t\tconst raycaster = new Raycaster();\n\t\tconst mouse = new Vector2();\n\t\tconst dummy = new Object3D();\n\n\t\tconst orthoCamera = new OrthographicCamera( - 2, 2, 2, - 2, 0, 4 );\n\t\torthoCamera.position.set( 0, 0, 2 );\n\n\t\tconst geometry = new CylinderGeometry( 0.04, 0.04, 0.8, 5 ).rotateZ( - Math.PI / 2 ).translate( 0.4, 0, 0 );\n\n\t\tconst xAxis = new Mesh( geometry, getAxisMaterial( color1 ) );\n\t\tconst yAxis = new Mesh( geometry, getAxisMaterial( color2 ) );\n\t\tconst zAxis = new Mesh( geometry, getAxisMaterial( color3 ) );\n\n\t\tyAxis.rotation.z = Math.PI / 2;\n\t\tzAxis.rotation.y = - Math.PI / 2;\n\n\t\tthis.add( xAxis );\n\t\tthis.add( zAxis );\n\t\tthis.add( yAxis );\n\n\t\tconst spriteMaterial1 = getSpriteMaterial( color1 );\n\t\tconst spriteMaterial2 = getSpriteMaterial( color2 );\n\t\tconst spriteMaterial3 = getSpriteMaterial( color3 );\n\t\tconst spriteMaterial4 = getSpriteMaterial( color4 );\n\n\t\tconst posXAxisHelper = new Sprite( spriteMaterial1 );\n\t\tconst posYAxisHelper = new Sprite( spriteMaterial2 );\n\t\tconst posZAxisHelper = new Sprite( spriteMaterial3 );\n\t\tconst negXAxisHelper = new Sprite( spriteMaterial4 );\n\t\tconst negYAxisHelper = new Sprite( spriteMaterial4 );\n\t\tconst negZAxisHelper = new Sprite( spriteMaterial4 );\n\n\t\tposXAxisHelper.position.x = 1;\n\t\tposYAxisHelper.position.y = 1;\n\t\tposZAxisHelper.position.z = 1;\n\t\tnegXAxisHelper.position.x = - 1;\n\t\tnegYAxisHelper.position.y = - 1;\n\t\tnegZAxisHelper.position.z = - 1;\n\n\t\tnegXAxisHelper.material.opacity = 0.2;\n\t\tnegYAxisHelper.material.opacity = 0.2;\n\t\tnegZAxisHelper.material.opacity = 0.2;\n\n\t\tposXAxisHelper.userData.type = 'posX';\n\t\tposYAxisHelper.userData.type = 'posY';\n\t\tposZAxisHelper.userData.type = 'posZ';\n\t\tnegXAxisHelper.userData.type = 'negX';\n\t\tnegYAxisHelper.userData.type = 'negY';\n\t\tnegZAxisHelper.userData.type = 'negZ';\n\n\t\tthis.add( posXAxisHelper );\n\t\tthis.add( posYAxisHelper );\n\t\tthis.add( posZAxisHelper );\n\t\tthis.add( negXAxisHelper );\n\t\tthis.add( negYAxisHelper );\n\t\tthis.add( negZAxisHelper );\n\n\t\tinteractiveObjects.push( posXAxisHelper );\n\t\tinteractiveObjects.push( posYAxisHelper );\n\t\tinteractiveObjects.push( posZAxisHelper );\n\t\tinteractiveObjects.push( negXAxisHelper );\n\t\tinteractiveObjects.push( negYAxisHelper );\n\t\tinteractiveObjects.push( negZAxisHelper );\n\n\t\tconst point = new Vector3();\n\t\tconst dim = 128;\n\t\tconst turnRate = 2 * Math.PI; // turn rate in angles per second\n\n\t\tthis.render = function ( renderer ) {\n\n\t\t\tthis.quaternion.copy( camera.quaternion ).invert();\n\t\t\tthis.updateMatrixWorld();\n\n\t\t\tpoint.set( 0, 0, 1 );\n\t\t\tpoint.applyQuaternion( camera.quaternion );\n\n\t\t\t//\n\n\t\t\tconst x = domElement.offsetWidth - dim;\n\n\t\t\trenderer.clearDepth();\n\n\t\t\trenderer.getViewport( viewport );\n\t\t\trenderer.setViewport( x, 0, dim, dim );\n\n\t\t\trenderer.render( this, orthoCamera );\n\n\t\t\trenderer.setViewport( viewport.x, viewport.y, viewport.z, viewport.w );\n\n\t\t};\n\n\t\tconst targetPosition = new Vector3();\n\t\tconst targetQuaternion = new Quaternion();\n\n\t\tconst q1 = new Quaternion();\n\t\tconst q2 = new Quaternion();\n\t\tconst viewport = new Vector4();\n\t\tlet radius = 0;\n\n\t\tthis.handleClick = function ( event ) {\n\n\t\t\tif ( this.animating === true ) return false;\n\n\t\t\tconst rect = domElement.getBoundingClientRect();\n\t\t\tconst offsetX = rect.left + ( domElement.offsetWidth - dim );\n\t\t\tconst offsetY = rect.top + ( domElement.offsetHeight - dim );\n\t\t\tmouse.x = ( ( event.clientX - offsetX ) / ( rect.right - offsetX ) ) * 2 - 1;\n\t\t\tmouse.y = - ( ( event.clientY - offsetY ) / ( rect.bottom - offsetY ) ) * 2 + 1;\n\n\t\t\traycaster.setFromCamera( mouse, orthoCamera );\n\n\t\t\tconst intersects = raycaster.intersectObjects( interactiveObjects );\n\n\t\t\tif ( intersects.length > 0 ) {\n\n\t\t\t\tconst intersection = intersects[ 0 ];\n\t\t\t\tconst object = intersection.object;\n\n\t\t\t\tprepareAnimationData( object, this.center );\n\n\t\t\t\tthis.animating = true;\n\n\t\t\t\treturn true;\n\n\t\t\t} else {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.setLabels = function ( labelX, labelY, labelZ ) {\n\n\t\t\toptions.labelX = labelX;\n\t\t\toptions.labelY = labelY;\n\t\t\toptions.labelZ = labelZ;\n\n\t\t\tupdateLabels();\n\n\t\t};\n\n\t\tthis.setLabelStyle = function ( font, color, radius ) {\n\n\t\t\toptions.font = font;\n\t\t\toptions.color = color;\n\t\t\toptions.radius = radius;\n\n\t\t\tupdateLabels();\n\n\t\t};\n\n\t\tthis.update = function ( delta ) {\n\n\t\t\tconst step = delta * turnRate;\n\n\t\t\t// animate position by doing a slerp and then scaling the position on the unit sphere\n\n\t\t\tq1.rotateTowards( q2, step );\n\t\t\tcamera.position.set( 0, 0, 1 ).applyQuaternion( q1 ).multiplyScalar( radius ).add( this.center );\n\n\t\t\t// animate orientation\n\n\t\t\tcamera.quaternion.rotateTowards( targetQuaternion, step );\n\n\t\t\tif ( q1.angleTo( q2 ) === 0 ) {\n\n\t\t\t\tthis.animating = false;\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.dispose = function () {\n\n\t\t\tgeometry.dispose();\n\n\t\t\txAxis.material.dispose();\n\t\t\tyAxis.material.dispose();\n\t\t\tzAxis.material.dispose();\n\n\t\t\tposXAxisHelper.material.map.dispose();\n\t\t\tposYAxisHelper.material.map.dispose();\n\t\t\tposZAxisHelper.material.map.dispose();\n\t\t\tnegXAxisHelper.material.map.dispose();\n\t\t\tnegYAxisHelper.material.map.dispose();\n\t\t\tnegZAxisHelper.material.map.dispose();\n\n\t\t\tposXAxisHelper.material.dispose();\n\t\t\tposYAxisHelper.material.dispose();\n\t\t\tposZAxisHelper.material.dispose();\n\t\t\tnegXAxisHelper.material.dispose();\n\t\t\tnegYAxisHelper.material.dispose();\n\t\t\tnegZAxisHelper.material.dispose();\n\n\t\t};\n\n\t\tfunction prepareAnimationData( object, focusPoint ) {\n\n\t\t\tswitch ( object.userData.type ) {\n\n\t\t\t\tcase 'posX':\n\t\t\t\t\ttargetPosition.set( 1, 0, 0 );\n\t\t\t\t\ttargetQuaternion.setFromEuler( new Euler( 0, Math.PI * 0.5, 0 ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'posY':\n\t\t\t\t\ttargetPosition.set( 0, 1, 0 );\n\t\t\t\t\ttargetQuaternion.setFromEuler( new Euler( - Math.PI * 0.5, 0, 0 ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'posZ':\n\t\t\t\t\ttargetPosition.set( 0, 0, 1 );\n\t\t\t\t\ttargetQuaternion.setFromEuler( new Euler() );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'negX':\n\t\t\t\t\ttargetPosition.set( - 1, 0, 0 );\n\t\t\t\t\ttargetQuaternion.setFromEuler( new Euler( 0, - Math.PI * 0.5, 0 ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'negY':\n\t\t\t\t\ttargetPosition.set( 0, - 1, 0 );\n\t\t\t\t\ttargetQuaternion.setFromEuler( new Euler( Math.PI * 0.5, 0, 0 ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'negZ':\n\t\t\t\t\ttargetPosition.set( 0, 0, - 1 );\n\t\t\t\t\ttargetQuaternion.setFromEuler( new Euler( 0, Math.PI, 0 ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.error( 'ViewHelper: Invalid axis.' );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tradius = camera.position.distanceTo( focusPoint );\n\t\t\ttargetPosition.multiplyScalar( radius ).add( focusPoint );\n\n\t\t\tdummy.position.copy( focusPoint );\n\n\t\t\tdummy.lookAt( camera.position );\n\t\t\tq1.copy( dummy.quaternion );\n\n\t\t\tdummy.lookAt( targetPosition );\n\t\t\tq2.copy( dummy.quaternion );\n\n\t\t}\n\n\t\tfunction getAxisMaterial( color ) {\n\n\t\t\treturn new MeshBasicMaterial( { color: color, toneMapped: false } );\n\n\t\t}\n\n\t\tfunction getSpriteMaterial( color, text ) {\n\n\t\t\tconst { font = '24px Arial', color: labelColor = '#000000', radius = 14 } = options;\n\n\t\t\tconst canvas = document.createElement( 'canvas' );\n\t\t\tcanvas.width = 64;\n\t\t\tcanvas.height = 64;\n\n\t\t\tconst context = canvas.getContext( '2d' );\n\t\t\tcontext.beginPath();\n\t\t\tcontext.arc( 32, 32, radius, 0, 2 * Math.PI );\n\t\t\tcontext.closePath();\n\t\t\tcontext.fillStyle = color.getStyle();\n\t\t\tcontext.fill();\n\n\t\t\tif ( text ) {\n\n\t\t\t\tcontext.font = font;\n\t\t\t\tcontext.textAlign = 'center';\n\t\t\t\tcontext.fillStyle = labelColor;\n\t\t\t\tcontext.fillText( text, 32, 41 );\n\n\t\t\t}\n\n\t\t\tconst texture = new CanvasTexture( canvas );\n\t\t\ttexture.colorSpace = SRGBColorSpace;\n\n\t\t\treturn new SpriteMaterial( { map: texture, toneMapped: false } );\n\n\t\t}\n\n\t\tfunction updateLabels() {\n\n\t\t\tposXAxisHelper.material.map.dispose();\n\t\t\tposYAxisHelper.material.map.dispose();\n\t\t\tposZAxisHelper.material.map.dispose();\n\n\t\t\tposXAxisHelper.material.dispose();\n\t\t\tposYAxisHelper.material.dispose();\n\t\t\tposZAxisHelper.material.dispose();\n\n\t\t\tposXAxisHelper.material = getSpriteMaterial( color1, options.labelX );\n\t\t\tposYAxisHelper.material = getSpriteMaterial( color2, options.labelY );\n\t\t\tposZAxisHelper.material = getSpriteMaterial( color3, options.labelZ );\n\n\t\t}\n\n\t}\n\n}\n\nexport { ViewHelper };\n","import * as THREE from 'three'\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'\nimport { ViewHelper } from 'three/examples/jsm/helpers/ViewHelper'\n\nimport { NodeStorageInterface, ViewHelperManagerInterface } from './interfaces'\n\nexport class ViewHelperManager implements ViewHelperManagerInterface {\n viewHelper: ViewHelper = {} as ViewHelper\n viewHelperContainer: HTMLDivElement = {} as HTMLDivElement\n\n private getActiveCamera: () => THREE.Camera\n private getControls: () => OrbitControls\n private nodeStorage: NodeStorageInterface\n private renderer: THREE.WebGLRenderer\n\n constructor(\n renderer: THREE.WebGLRenderer,\n getActiveCamera: () => THREE.Camera,\n getControls: () => OrbitControls,\n nodeStorage: NodeStorageInterface\n ) {\n this.renderer = renderer\n this.getActiveCamera = getActiveCamera\n this.getControls = getControls\n this.nodeStorage = nodeStorage\n }\n\n init(): void {}\n\n dispose(): void {\n if (this.viewHelper) {\n this.viewHelper.dispose()\n }\n\n if (this.viewHelperContainer && this.viewHelperContainer.parentNode) {\n this.viewHelperContainer.parentNode.removeChild(this.viewHelperContainer)\n }\n }\n\n createViewHelper(container: Element | HTMLElement): void {\n this.viewHelperContainer = document.createElement('div')\n\n this.viewHelperContainer.style.position = 'absolute'\n this.viewHelperContainer.style.bottom = '0'\n this.viewHelperContainer.style.left = '0'\n this.viewHelperContainer.style.width = '128px'\n this.viewHelperContainer.style.height = '128px'\n\n this.viewHelperContainer.addEventListener('pointerup', (event) => {\n event.stopPropagation()\n this.viewHelper.handleClick(event)\n })\n\n this.viewHelperContainer.addEventListener('pointerdown', (event) => {\n event.stopPropagation()\n })\n\n container.appendChild(this.viewHelperContainer)\n\n this.viewHelper = new ViewHelper(\n this.getActiveCamera(),\n this.viewHelperContainer\n )\n\n this.viewHelper.center = this.getControls().target\n }\n\n update(delta: number): void {\n if (this.viewHelper.animating) {\n this.viewHelper.update(delta)\n\n if (!this.viewHelper.animating) {\n this.nodeStorage.storeNodeProperty('Camera Info', {\n position: this.getActiveCamera().position.clone(),\n target: this.getControls().target.clone(),\n zoom:\n this.getActiveCamera() instanceof THREE.OrthographicCamera\n ? (this.getActiveCamera() as THREE.OrthographicCamera).zoom\n : (this.getActiveCamera() as THREE.PerspectiveCamera).zoom,\n cameraType:\n this.getActiveCamera() instanceof THREE.PerspectiveCamera\n ? 'perspective'\n : 'orthographic'\n })\n }\n }\n }\n\n handleResize(): void {}\n\n recreateViewHelper(): void {\n if (this.viewHelper) {\n this.viewHelper.dispose()\n }\n\n this.viewHelper = new ViewHelper(\n this.getActiveCamera(),\n this.viewHelperContainer\n )\n this.viewHelper.center = this.getControls().target\n }\n\n reset(): void {}\n}\n","import { LGraphNode } from '@comfyorg/litegraph'\nimport * as THREE from 'three'\n\nimport { CameraManager } from './CameraManager'\nimport { ControlsManager } from './ControlsManager'\nimport { EventManager } from './EventManager'\nimport { LightingManager } from './LightingManager'\nimport { LoaderManager } from './LoaderManager'\nimport { ModelManager } from './ModelManager'\nimport { NodeStorage } from './NodeStorage'\nimport { PreviewManager } from './PreviewManager'\nimport { SceneManager } from './SceneManager'\nimport { ViewHelperManager } from './ViewHelperManager'\nimport {\n CameraState,\n CaptureResult,\n Load3DOptions,\n MaterialMode,\n UpDirection\n} from './interfaces'\n\nclass Load3d {\n renderer: THREE.WebGLRenderer\n protected clock: THREE.Clock\n protected animationFrameId: number | null = null\n protected node: LGraphNode\n\n protected eventManager: EventManager\n protected nodeStorage: NodeStorage\n protected sceneManager: SceneManager\n protected cameraManager: CameraManager\n protected controlsManager: ControlsManager\n protected lightingManager: LightingManager\n protected viewHelperManager: ViewHelperManager\n protected previewManager: PreviewManager\n protected loaderManager: LoaderManager\n protected modelManager: ModelManager\n\n constructor(\n container: Element | HTMLElement,\n options: Load3DOptions = {\n node: {} as LGraphNode\n }\n ) {\n this.node = options.node || ({} as LGraphNode)\n this.clock = new THREE.Clock()\n\n this.renderer = new THREE.WebGLRenderer({ alpha: true, antialias: true })\n this.renderer.setSize(300, 300)\n this.renderer.setClearColor(0x282828)\n this.renderer.autoClear = false\n this.renderer.outputColorSpace = THREE.SRGBColorSpace\n container.appendChild(this.renderer.domElement)\n\n this.eventManager = new EventManager()\n this.nodeStorage = new NodeStorage(this.node)\n\n this.sceneManager = new SceneManager(\n this.renderer,\n this.getActiveCamera.bind(this),\n this.getControls.bind(this),\n this.eventManager\n )\n\n this.cameraManager = new CameraManager(\n this.renderer,\n this.eventManager,\n this.nodeStorage\n )\n\n this.controlsManager = new ControlsManager(\n this.renderer,\n this.cameraManager.activeCamera,\n this.eventManager,\n this.nodeStorage\n )\n\n this.cameraManager.setControls(this.controlsManager.controls)\n\n this.lightingManager = new LightingManager(\n this.sceneManager.scene,\n this.eventManager\n )\n\n this.viewHelperManager = new ViewHelperManager(\n this.renderer,\n this.getActiveCamera.bind(this),\n this.getControls.bind(this),\n this.nodeStorage\n )\n\n this.previewManager = new PreviewManager(\n this.sceneManager.scene,\n this.getActiveCamera.bind(this),\n this.getControls.bind(this),\n () => this.renderer,\n this.eventManager,\n this.sceneManager.backgroundScene,\n this.sceneManager.backgroundCamera\n )\n\n this.modelManager = new ModelManager(\n this.sceneManager.scene,\n this.renderer,\n this.eventManager,\n this.getActiveCamera.bind(this),\n this.setupCamera.bind(this)\n )\n\n this.loaderManager = new LoaderManager(this.modelManager, this.eventManager)\n\n this.sceneManager.init()\n this.cameraManager.init()\n this.controlsManager.init()\n this.lightingManager.init()\n this.loaderManager.init()\n this.loaderManager.init()\n\n this.viewHelperManager.createViewHelper(container)\n this.viewHelperManager.init()\n\n if (options && options.createPreview) {\n this.previewManager.createCapturePreview(container)\n this.previewManager.init()\n }\n\n this.handleResize()\n this.startAnimation()\n }\n\n private getActiveCamera(): THREE.Camera {\n return this.cameraManager.activeCamera\n }\n\n private getControls() {\n return this.controlsManager.controls\n }\n\n private setupCamera(size: THREE.Vector3): void {\n this.cameraManager.setupForModel(size)\n }\n\n private startAnimation(): void {\n const animate = () => {\n this.animationFrameId = requestAnimationFrame(animate)\n\n if (this.previewManager.showPreview) {\n this.previewManager.updatePreviewRender()\n }\n\n const delta = this.clock.getDelta()\n this.viewHelperManager.update(delta)\n this.controlsManager.update()\n\n this.renderer.clear()\n this.sceneManager.renderBackground()\n this.renderer.render(\n this.sceneManager.scene,\n this.cameraManager.activeCamera\n )\n\n if (this.viewHelperManager.viewHelper.render) {\n this.viewHelperManager.viewHelper.render(this.renderer)\n }\n }\n\n animate()\n }\n\n setBackgroundColor(color: string): void {\n this.sceneManager.setBackgroundColor(color)\n this.renderer.render(\n this.sceneManager.scene,\n this.cameraManager.activeCamera\n )\n }\n\n async setBackgroundImage(uploadPath: string): Promise {\n await this.sceneManager.setBackgroundImage(uploadPath)\n\n if (this.previewManager.previewRenderer) {\n this.previewManager.updateBackgroundTexture(\n this.sceneManager.backgroundTexture\n )\n }\n }\n\n removeBackgroundImage(): void {\n this.sceneManager.removeBackgroundImage()\n\n if (\n this.previewManager.previewRenderer &&\n this.previewManager.previewCamera\n ) {\n this.previewManager.updateBackgroundTexture(null)\n }\n }\n\n toggleGrid(showGrid: boolean): void {\n this.sceneManager.toggleGrid(showGrid)\n }\n\n toggleCamera(cameraType?: 'perspective' | 'orthographic'): void {\n this.cameraManager.toggleCamera(cameraType)\n\n this.controlsManager.updateCamera(this.cameraManager.activeCamera)\n this.viewHelperManager.recreateViewHelper()\n\n this.handleResize()\n }\n\n getCurrentCameraType(): 'perspective' | 'orthographic' {\n return this.cameraManager.getCurrentCameraType()\n }\n\n setCameraState(state: CameraState): void {\n this.cameraManager.setCameraState(state)\n }\n\n getCameraState(): CameraState {\n return this.cameraManager.getCameraState()\n }\n\n setFOV(fov: number): void {\n this.cameraManager.setFOV(fov)\n this.renderer.render(\n this.sceneManager.scene,\n this.cameraManager.activeCamera\n )\n }\n\n setMaterialMode(mode: MaterialMode): void {\n this.modelManager.setMaterialMode(mode)\n\n this.renderer.render(\n this.sceneManager.scene,\n this.cameraManager.activeCamera\n )\n }\n\n async loadModel(url: string, originalFileName?: string): Promise {\n this.cameraManager.reset()\n this.controlsManager.reset()\n this.modelManager.reset()\n\n await this.loaderManager.loadModel(url, originalFileName)\n\n this.handleResize()\n }\n\n clearModel(): void {\n this.modelManager.clearModel()\n }\n\n setUpDirection(direction: UpDirection): void {\n this.modelManager.setUpDirection(direction)\n\n this.renderer.render(\n this.sceneManager.scene,\n this.cameraManager.activeCamera\n )\n }\n\n setLightIntensity(intensity: number): void {\n this.lightingManager.setLightIntensity(intensity)\n }\n\n togglePreview(showPreview: boolean): void {\n this.previewManager.togglePreview(showPreview)\n }\n\n setTargetSize(width: number, height: number): void {\n this.previewManager.setTargetSize(width, height)\n }\n\n addEventListener(event: string, callback: (data?: any) => void): void {\n this.eventManager.addEventListener(event, callback)\n }\n\n removeEventListener(event: string, callback: (data?: any) => void): void {\n this.eventManager.removeEventListener(event, callback)\n }\n\n refreshViewport(): void {\n this.handleResize()\n }\n\n handleResize(): void {\n const parentElement = this.renderer?.domElement?.parentElement\n\n if (!parentElement) {\n console.warn('Parent element not found')\n return\n }\n\n const width = parentElement.clientWidth\n const height = parentElement.clientHeight\n\n this.cameraManager.handleResize(width, height)\n this.sceneManager.handleResize(width, height)\n\n this.renderer.setSize(width, height)\n\n this.previewManager.handleResize()\n }\n\n captureScene(width: number, height: number): Promise {\n return this.sceneManager.captureScene(width, height)\n }\n\n loadNodeProperty(name: string, defaultValue: any) {\n return this.nodeStorage.loadNodeProperty(name, defaultValue)\n }\n\n remove(): void {\n if (this.animationFrameId !== null) {\n cancelAnimationFrame(this.animationFrameId)\n }\n\n this.sceneManager.dispose()\n this.cameraManager.dispose()\n this.controlsManager.dispose()\n this.lightingManager.dispose()\n this.viewHelperManager.dispose()\n this.previewManager.dispose()\n this.loaderManager.dispose()\n this.modelManager.dispose()\n\n this.renderer.dispose()\n this.renderer.domElement.remove()\n }\n}\n\nexport default Load3d\n","import * as THREE from 'three'\n\nimport {\n AnimationItem,\n AnimationManagerInterface,\n EventManagerInterface\n} from '@/extensions/core/load3d/interfaces'\n\nexport class AnimationManager implements AnimationManagerInterface {\n currentAnimation: THREE.AnimationMixer | null = null\n animationActions: THREE.AnimationAction[] = []\n animationClips: THREE.AnimationClip[] = []\n selectedAnimationIndex: number = 0\n isAnimationPlaying: boolean = false\n animationSpeed: number = 1.0\n\n private eventManager: EventManagerInterface\n private getCurrentModel: () => THREE.Object3D | null\n\n constructor(\n eventManager: EventManagerInterface,\n getCurrentModel: () => THREE.Object3D | null\n ) {\n this.eventManager = eventManager\n this.getCurrentModel = getCurrentModel\n }\n\n init(): void {}\n\n dispose(): void {\n if (this.currentAnimation) {\n this.animationActions.forEach((action) => {\n action.stop()\n })\n this.currentAnimation = null\n }\n this.animationActions = []\n this.animationClips = []\n this.selectedAnimationIndex = 0\n this.isAnimationPlaying = false\n this.animationSpeed = 1.0\n\n this.eventManager.emitEvent('animationListChange', [])\n }\n\n setupModelAnimations(model: THREE.Object3D, originalModel: any): void {\n if (this.currentAnimation) {\n this.currentAnimation.stopAllAction()\n this.animationActions = []\n }\n\n let animations: THREE.AnimationClip[] = []\n if (model.animations?.length > 0) {\n animations = model.animations\n } else if (originalModel && 'animations' in originalModel) {\n animations = originalModel.animations\n }\n\n if (animations.length > 0) {\n this.animationClips = animations\n if (model.type === 'Scene') {\n this.currentAnimation = new THREE.AnimationMixer(model)\n } else {\n this.currentAnimation = new THREE.AnimationMixer(\n this.getCurrentModel()!\n )\n }\n\n if (this.animationClips.length > 0) {\n this.updateSelectedAnimation(0)\n }\n }\n\n this.updateAnimationList()\n }\n\n updateAnimationList(): void {\n let updatedAnimationList: AnimationItem[] = []\n\n if (this.animationClips.length > 0) {\n updatedAnimationList = this.animationClips.map((clip, index) => ({\n name: clip.name || `Animation ${index + 1}`,\n index\n }))\n }\n\n this.eventManager.emitEvent('animationListChange', updatedAnimationList)\n }\n\n setAnimationSpeed(speed: number): void {\n this.animationSpeed = speed\n this.animationActions.forEach((action) => {\n action.setEffectiveTimeScale(speed)\n })\n }\n\n updateSelectedAnimation(index: number): void {\n if (\n !this.currentAnimation ||\n !this.animationClips ||\n index >= this.animationClips.length\n ) {\n console.warn('Invalid animation update request')\n return\n }\n\n this.animationActions.forEach((action) => {\n action.stop()\n })\n this.currentAnimation.stopAllAction()\n this.animationActions = []\n\n this.selectedAnimationIndex = index\n const clip = this.animationClips[index]\n\n const action = this.currentAnimation.clipAction(clip)\n\n action.setEffectiveTimeScale(this.animationSpeed)\n\n action.reset()\n action.clampWhenFinished = false\n action.loop = THREE.LoopRepeat\n\n if (this.isAnimationPlaying) {\n action.play()\n } else {\n action.play()\n action.paused = true\n }\n\n this.animationActions = [action]\n }\n\n toggleAnimation(play?: boolean): void {\n if (!this.currentAnimation || this.animationActions.length === 0) {\n console.warn('No animation to toggle')\n return\n }\n\n this.isAnimationPlaying = play ?? !this.isAnimationPlaying\n\n this.animationActions.forEach((action) => {\n if (this.isAnimationPlaying) {\n action.paused = false\n if (action.time === 0 || action.time === action.getClip().duration) {\n action.reset()\n }\n } else {\n action.paused = true\n }\n })\n }\n\n update(delta: number): void {\n if (this.currentAnimation && this.isAnimationPlaying) {\n this.currentAnimation.update(delta)\n }\n }\n\n reset(): void {}\n}\n","import { LGraphNode } from '@comfyorg/litegraph'\nimport * as THREE from 'three'\n\nimport { AnimationManager } from './AnimationManager'\nimport Load3d from './Load3d'\nimport { Load3DOptions } from './interfaces'\n\nclass Load3dAnimation extends Load3d {\n private animationManager: AnimationManager\n\n constructor(\n container: Element | HTMLElement,\n options: Load3DOptions = {\n node: {} as LGraphNode\n }\n ) {\n super(container, options)\n\n this.animationManager = new AnimationManager(\n this.eventManager,\n this.getCurrentModel.bind(this)\n )\n\n this.animationManager.init()\n\n this.overrideAnimationLoop()\n }\n\n private getCurrentModel(): THREE.Object3D | null {\n return this.modelManager.currentModel\n }\n\n private overrideAnimationLoop(): void {\n if (this.animationFrameId !== null) {\n cancelAnimationFrame(this.animationFrameId)\n }\n\n const animate = () => {\n this.animationFrameId = requestAnimationFrame(animate)\n\n if (this.previewManager.showPreview) {\n this.previewManager.updatePreviewRender()\n }\n\n const delta = this.clock.getDelta()\n\n this.animationManager.update(delta)\n\n this.viewHelperManager.update(delta)\n\n this.controlsManager.update()\n\n this.renderer.clear()\n this.sceneManager.renderBackground()\n this.renderer.render(\n this.sceneManager.scene,\n this.cameraManager.activeCamera\n )\n\n if (this.viewHelperManager.viewHelper.render) {\n this.viewHelperManager.viewHelper.render(this.renderer)\n }\n }\n\n animate()\n }\n\n async loadModel(url: string, originalFileName?: string): Promise {\n await super.loadModel(url, originalFileName)\n\n if (this.modelManager.currentModel) {\n this.animationManager.setupModelAnimations(\n this.modelManager.currentModel,\n this.modelManager.originalModel\n )\n }\n }\n\n clearModel(): void {\n this.animationManager.dispose()\n super.clearModel()\n }\n\n updateAnimationList(): void {\n this.animationManager.updateAnimationList()\n }\n\n setAnimationSpeed(speed: number): void {\n this.animationManager.setAnimationSpeed(speed)\n }\n\n updateSelectedAnimation(index: number): void {\n this.animationManager.updateSelectedAnimation(index)\n }\n\n toggleAnimation(play?: boolean): void {\n this.animationManager.toggleAnimation(play)\n }\n\n get isAnimationPlaying(): boolean {\n return this.animationManager.isAnimationPlaying\n }\n\n get animationSpeed(): number {\n return this.animationManager.animationSpeed\n }\n\n get selectedAnimationIndex(): number {\n return this.animationManager.selectedAnimationIndex\n }\n\n get animationClips(): THREE.AnimationClip[] {\n return this.animationManager.animationClips\n }\n\n get animationActions(): THREE.AnimationAction[] {\n return this.animationManager.animationActions\n }\n\n get currentAnimation(): THREE.AnimationMixer | null {\n return this.animationManager.currentAnimation\n }\n\n remove(): void {\n this.animationManager.dispose()\n super.remove()\n }\n}\n\nexport default Load3dAnimation\n","import type { LGraphNode } from '@comfyorg/litegraph'\nimport { toRaw } from 'vue'\n\nimport Load3d from '@/extensions/core/load3d/Load3d'\nimport Load3dAnimation from '@/extensions/core/load3d/Load3dAnimation'\n\nexport class Load3dService {\n private static instance: Load3dService\n private nodeToLoad3dMap = new Map()\n\n private constructor() {}\n\n static getInstance(): Load3dService {\n if (!Load3dService.instance) {\n Load3dService.instance = new Load3dService()\n }\n return Load3dService.instance\n }\n\n registerLoad3d(\n node: LGraphNode,\n container: HTMLElement,\n type: 'Load3D' | 'Load3DAnimation' | 'Preview3D' | 'Preview3DAnimation'\n ) {\n const rawNode = toRaw(node)\n\n if (this.nodeToLoad3dMap.has(rawNode)) {\n this.removeLoad3d(rawNode)\n }\n\n const isAnimation = type.includes('Animation')\n\n const Load3dClass = isAnimation ? Load3dAnimation : Load3d\n\n const isPreview = type.includes('Preview')\n\n const instance = new Load3dClass(container, {\n createPreview: !isPreview,\n node: rawNode\n })\n\n rawNode.onMouseEnter = function () {\n instance.refreshViewport()\n }\n\n rawNode.onResize = function () {\n instance.handleResize()\n }\n\n rawNode.onDrawBackground = function () {\n instance.renderer.domElement.hidden = this.flags.collapsed ?? false\n }\n\n this.nodeToLoad3dMap.set(rawNode, instance)\n\n return instance\n }\n\n getLoad3d(node: LGraphNode): Load3d | Load3dAnimation | null {\n const rawNode = toRaw(node)\n\n return this.nodeToLoad3dMap.get(rawNode) || null\n }\n\n getNodeByLoad3d(load3d: Load3d | Load3dAnimation): LGraphNode | null {\n for (const [node, instance] of this.nodeToLoad3dMap) {\n if (instance === load3d) {\n return node\n }\n }\n return null\n }\n\n removeLoad3d(node: LGraphNode) {\n const rawNode = toRaw(node)\n\n const instance = this.nodeToLoad3dMap.get(rawNode)\n\n if (instance) {\n instance.remove()\n\n this.nodeToLoad3dMap.delete(rawNode)\n }\n }\n\n clear() {\n for (const [node] of this.nodeToLoad3dMap) {\n this.removeLoad3d(node)\n }\n }\n}\n\nexport const useLoad3dService = () => {\n return Load3dService.getInstance()\n}\n","\n\n\n","\n\n\n","\n\n\n","\n\n","\n\n\n","import type { IWidget } from '@comfyorg/litegraph'\n\nimport Load3d from '@/extensions/core/load3d/Load3d'\nimport Load3dUtils from '@/extensions/core/load3d/Load3dUtils'\nimport { MaterialMode } from '@/extensions/core/load3d/interfaces'\nimport { api } from '@/scripts/api'\n\nclass Load3DConfiguration {\n constructor(private load3d: Load3d) {}\n\n configure(\n loadFolder: 'input' | 'output',\n modelWidget: IWidget,\n cameraState?: any,\n width: IWidget | null = null,\n height: IWidget | null = null\n ) {\n this.setupModelHandling(modelWidget, loadFolder, cameraState)\n this.setupTargetSize(width, height)\n this.setupDefaultProperties()\n }\n\n private setupTargetSize(width: IWidget | null, height: IWidget | null) {\n if (width && height) {\n this.load3d.setTargetSize(width.value as number, height.value as number)\n\n width.callback = (value: number) => {\n this.load3d.setTargetSize(value, height.value as number)\n }\n\n height.callback = (value: number) => {\n this.load3d.setTargetSize(width.value as number, value)\n }\n }\n }\n\n private setupModelHandling(\n modelWidget: IWidget,\n loadFolder: 'input' | 'output',\n cameraState?: any\n ) {\n const onModelWidgetUpdate = this.createModelUpdateHandler(\n loadFolder,\n cameraState\n )\n if (modelWidget.value) {\n onModelWidgetUpdate(modelWidget.value)\n }\n modelWidget.callback = onModelWidgetUpdate\n }\n\n private setupDefaultProperties() {\n const cameraType = this.load3d.loadNodeProperty(\n 'Camera Type',\n 'perspective'\n )\n this.load3d.toggleCamera(cameraType)\n\n const showGrid = this.load3d.loadNodeProperty('Show Grid', true)\n\n this.load3d.toggleGrid(showGrid)\n\n const showPreview = this.load3d.loadNodeProperty('Show Preview', true)\n\n this.load3d.togglePreview(showPreview)\n\n const bgColor = this.load3d.loadNodeProperty('Background Color', '#282828')\n\n this.load3d.setBackgroundColor(bgColor)\n\n const lightIntensity = this.load3d.loadNodeProperty('Light Intensity', 5)\n\n this.load3d.setLightIntensity(lightIntensity)\n\n const fov = this.load3d.loadNodeProperty('FOV', 35)\n\n this.load3d.setFOV(fov)\n\n const backgroundImage = this.load3d.loadNodeProperty('Background Image', '')\n\n this.load3d.setBackgroundImage(backgroundImage)\n }\n\n private createModelUpdateHandler(\n loadFolder: 'input' | 'output',\n cameraState?: any\n ) {\n let isFirstLoad = true\n return async (value: string | number | boolean | object) => {\n if (!value) return\n\n const filename = value as string\n const modelUrl = api.apiURL(\n Load3dUtils.getResourceURL(\n ...Load3dUtils.splitFilePath(filename),\n loadFolder\n )\n )\n\n await this.load3d.loadModel(modelUrl, filename)\n\n const upDirection = this.load3d.loadNodeProperty(\n 'Up Direction',\n 'original'\n )\n\n this.load3d.setUpDirection(upDirection)\n\n const materialMode = this.load3d.loadNodeProperty(\n 'Material Mode',\n 'original'\n )\n\n this.load3d.setMaterialMode(materialMode)\n\n if (isFirstLoad && cameraState && typeof cameraState === 'object') {\n try {\n this.load3d.setCameraState(cameraState)\n } catch (error) {\n console.warn('Failed to restore camera state:', error)\n }\n isFirstLoad = false\n }\n }\n }\n}\n\nexport default Load3DConfiguration\n","// @ts-strict-ignore\nimport { IWidget } from '@comfyorg/litegraph'\nimport { IStringWidget } from '@comfyorg/litegraph/dist/types/widgets'\nimport PrimeVue from 'primevue/config'\nimport { createApp, h, nextTick, render } from 'vue'\n\nimport Load3D from '@/components/load3d/Load3D.vue'\nimport Load3DAnimation from '@/components/load3d/Load3DAnimation.vue'\nimport Load3DConfiguration from '@/extensions/core/load3d/Load3DConfiguration'\nimport Load3dAnimation from '@/extensions/core/load3d/Load3dAnimation'\nimport Load3dUtils from '@/extensions/core/load3d/Load3dUtils'\nimport { api } from '@/scripts/api'\nimport { app } from '@/scripts/app'\nimport { useLoad3dService } from '@/services/load3dService'\nimport { useToastStore } from '@/stores/toastStore'\n\napp.registerExtension({\n name: 'Comfy.Load3D',\n\n getCustomWidgets(app) {\n return {\n LOAD_3D(node, inputName) {\n node.addProperty('Camera Info', '')\n\n const container = document.createElement('div')\n container.classList.add('comfy-load-3d')\n\n /* Hold off for now\n const mountComponent = () => {\n const vnode = h(Load3D, {\n node: node,\n type: 'Load3D'\n })\n\n render(vnode, container)\n }\n */\n\n let controlsApp = createApp(Load3D, {\n node: node,\n type: 'Load3D'\n })\n\n controlsApp.mount(container)\n\n const origOnRemoved = node.onRemoved\n\n node.onRemoved = function () {\n /*\n render(null, container)\n\n container.remove()\n */\n\n if (controlsApp) {\n controlsApp.unmount()\n controlsApp = null\n }\n\n origOnRemoved?.apply(this, [])\n }\n\n const fileInput = document.createElement('input')\n fileInput.type = 'file'\n fileInput.accept = '.gltf,.glb,.obj,.mtl,.fbx,.stl'\n fileInput.style.display = 'none'\n\n fileInput.onchange = async () => {\n if (fileInput.files?.length) {\n const modelWidget = node.widgets?.find(\n (w: IWidget) => w.name === 'model_file'\n ) as IStringWidget\n\n const uploadPath = await Load3dUtils.uploadFile(\n fileInput.files[0]\n ).catch((error) => {\n console.error('File upload failed:', error)\n useToastStore().addAlert('File upload failed')\n })\n\n const modelUrl = api.apiURL(\n Load3dUtils.getResourceURL(\n ...Load3dUtils.splitFilePath(uploadPath),\n 'input'\n )\n )\n\n await useLoad3dService().getLoad3d(node).loadModel(modelUrl)\n\n if (uploadPath && modelWidget) {\n if (!modelWidget.options?.values?.includes(uploadPath)) {\n modelWidget.options?.values?.push(uploadPath)\n }\n\n modelWidget.value = uploadPath\n }\n }\n }\n\n node.addWidget('button', 'upload 3d model', 'upload3dmodel', () => {\n fileInput.click()\n })\n\n node.addWidget('button', 'clear', 'clear', () => {\n useLoad3dService().getLoad3d(node).clearModel()\n\n const modelWidget = node.widgets?.find(\n (w: IWidget) => w.name === 'model_file'\n )\n if (modelWidget) {\n modelWidget.value = ''\n }\n })\n\n //mountComponent()\n\n return {\n widget: node.addDOMWidget(inputName, 'LOAD_3D', container)\n }\n }\n }\n },\n\n async nodeCreated(node) {\n if (node.constructor.comfyClass !== 'Load3D') return\n\n const [oldWidth, oldHeight] = node.size\n\n node.setSize([Math.max(oldWidth, 300), Math.max(oldHeight, 600)])\n\n await nextTick()\n\n const sceneWidget = node.widgets.find((w: IWidget) => w.name === 'image')\n\n const load3d = useLoad3dService().getLoad3d(node)\n\n const modelWidget = node.widgets.find(\n (w: IWidget) => w.name === 'model_file'\n )\n\n let cameraState = node.properties['Camera Info']\n\n const config = new Load3DConfiguration(load3d)\n\n const width = node.widgets.find((w: IWidget) => w.name === 'width')\n const height = node.widgets.find((w: IWidget) => w.name === 'height')\n\n config.configure('input', modelWidget, cameraState, width, height)\n\n sceneWidget.serializeValue = async () => {\n node.properties['Camera Info'] = load3d.getCameraState()\n\n const { scene: imageData, mask: maskData } = await load3d.captureScene(\n width.value as number,\n height.value as number\n )\n\n const [data, dataMask] = await Promise.all([\n Load3dUtils.uploadTempImage(imageData, 'scene'),\n Load3dUtils.uploadTempImage(maskData, 'scene_mask')\n ])\n\n load3d.handleResize()\n\n return {\n image: `threed/${data.name} [temp]`,\n mask: `threed/${dataMask.name} [temp]`\n }\n }\n }\n})\n\napp.registerExtension({\n name: 'Comfy.Load3DAnimation',\n\n getCustomWidgets(app) {\n return {\n LOAD_3D_ANIMATION(node, inputName) {\n node.addProperty('Camera Info', '')\n\n const container = document.createElement('div')\n\n container.classList.add('comfy-load-3d-animation')\n\n /*\n const mountComponent = () => {\n const vnode = h(Load3DAnimation, {\n node: node,\n type: 'Load3DAnimation'\n })\n\n render(vnode, container)\n }\n */\n\n let controlsApp = createApp(Load3DAnimation, {\n node: node,\n type: 'Load3DAnimation'\n })\n\n controlsApp.use(PrimeVue)\n\n controlsApp.mount(container)\n\n const origOnRemoved = node.onRemoved\n\n node.onRemoved = function () {\n /*\n render(null, container)\n\n container.remove()\n */\n\n if (controlsApp) {\n controlsApp.unmount()\n controlsApp = null\n }\n\n origOnRemoved?.apply(this, [])\n }\n\n const fileInput = document.createElement('input')\n fileInput.type = 'file'\n fileInput.accept = '.fbx,glb,gltf'\n fileInput.style.display = 'none'\n fileInput.onchange = async () => {\n if (fileInput.files?.length) {\n const modelWidget = node.widgets?.find(\n (w: IWidget) => w.name === 'model_file'\n ) as IStringWidget\n\n const uploadPath = await Load3dUtils.uploadFile(\n fileInput.files[0]\n ).catch((error) => {\n console.error('File upload failed:', error)\n useToastStore().addAlert('File upload failed')\n })\n\n const modelUrl = api.apiURL(\n Load3dUtils.getResourceURL(\n ...Load3dUtils.splitFilePath(uploadPath),\n 'input'\n )\n )\n\n await useLoad3dService().getLoad3d(node).loadModel(modelUrl)\n\n if (uploadPath && modelWidget) {\n if (!modelWidget.options?.values?.includes(uploadPath)) {\n modelWidget.options?.values?.push(uploadPath)\n }\n\n modelWidget.value = uploadPath\n }\n }\n }\n\n node.addWidget('button', 'upload 3d model', 'upload3dmodel', () => {\n fileInput.click()\n })\n\n node.addWidget('button', 'clear', 'clear', () => {\n useLoad3dService().getLoad3d(node).clearModel()\n const modelWidget = node.widgets?.find(\n (w: IWidget) => w.name === 'model_file'\n )\n if (modelWidget) {\n modelWidget.value = ''\n }\n })\n\n //mountComponent()\n\n return {\n widget: node.addDOMWidget(inputName, 'LOAD_3D_ANIMATION', container)\n }\n }\n }\n },\n\n async nodeCreated(node) {\n if (node.constructor.comfyClass !== 'Load3DAnimation') return\n\n const [oldWidth, oldHeight] = node.size\n\n node.setSize([Math.max(oldWidth, 400), Math.max(oldHeight, 700)])\n\n await nextTick()\n\n const sceneWidget = node.widgets.find((w: IWidget) => w.name === 'image')\n\n const load3d = useLoad3dService().getLoad3d(node) as Load3dAnimation\n\n const modelWidget = node.widgets.find(\n (w: IWidget) => w.name === 'model_file'\n )\n\n let cameraState = node.properties['Camera Info']\n\n const config = new Load3DConfiguration(load3d)\n\n const width = node.widgets.find((w: IWidget) => w.name === 'width')\n const height = node.widgets.find((w: IWidget) => w.name === 'height')\n\n config.configure('input', modelWidget, cameraState, width, height)\n\n sceneWidget.serializeValue = async () => {\n node.properties['Camera Info'] = load3d.getCameraState()\n\n load3d.toggleAnimation(false)\n\n const { scene: imageData, mask: maskData } = await load3d.captureScene(\n width.value as number,\n height.value as number\n )\n\n const [data, dataMask] = await Promise.all([\n Load3dUtils.uploadTempImage(imageData, 'scene'),\n Load3dUtils.uploadTempImage(maskData, 'scene_mask')\n ])\n\n load3d.handleResize()\n\n return {\n image: `threed/${data.name} [temp]`,\n mask: `threed/${dataMask.name} [temp]`\n }\n }\n }\n})\n\napp.registerExtension({\n name: 'Comfy.Preview3D',\n\n async beforeRegisterNodeDef(nodeType, nodeData) {\n if (\n // @ts-expect-error ComfyNode\n ['Preview3D'].includes(nodeType.comfyClass)\n ) {\n nodeData.input.required.image = ['PREVIEW_3D']\n }\n },\n\n getCustomWidgets(app) {\n return {\n PREVIEW_3D(node, inputName) {\n const container = document.createElement('div')\n\n container.classList.add('comfy-preview-3d')\n\n /*\n const mountComponent = () => {\n const vnode = h(Load3D, {\n node: node,\n type: 'Preview3D'\n })\n\n render(vnode, container)\n }\n */\n\n let controlsApp = createApp(Load3D, {\n node: node,\n type: 'Preview3D'\n })\n\n controlsApp.mount(container)\n\n const origOnRemoved = node.onRemoved\n\n node.onRemoved = function () {\n /*\n render(null, container)\n\n container.remove()\n */\n\n if (controlsApp) {\n controlsApp.unmount()\n controlsApp = null\n }\n\n origOnRemoved?.apply(this, [])\n }\n\n //mountComponent()\n\n return {\n widget: node.addDOMWidget(inputName, 'PREVIEW_3D', container)\n }\n }\n }\n },\n\n async nodeCreated(node) {\n if (node.constructor.comfyClass !== 'Preview3D') return\n\n const [oldWidth, oldHeight] = node.size\n\n node.setSize([Math.max(oldWidth, 400), Math.max(oldHeight, 550)])\n\n await nextTick()\n\n const load3d = useLoad3dService().getLoad3d(node)\n\n const modelWidget = node.widgets.find(\n (w: IWidget) => w.name === 'model_file'\n )\n\n const onExecuted = node.onExecuted\n\n node.onExecuted = function (message: any) {\n onExecuted?.apply(this, arguments)\n\n let filePath = message.model_file[0]\n\n if (!filePath) {\n const msg = 'unable to get model file path.'\n\n console.error(msg)\n\n useToastStore().addAlert(msg)\n }\n\n modelWidget.value = filePath.replaceAll('\\\\', '/')\n\n const config = new Load3DConfiguration(load3d)\n\n config.configure('output', modelWidget)\n }\n }\n})\n\napp.registerExtension({\n name: 'Comfy.Preview3DAnimation',\n\n async beforeRegisterNodeDef(nodeType, nodeData) {\n if (\n // @ts-expect-error ComfyNode\n ['Preview3DAnimation'].includes(nodeType.comfyClass)\n ) {\n nodeData.input.required.image = ['PREVIEW_3D_ANIMATION']\n }\n },\n\n getCustomWidgets(app) {\n return {\n PREVIEW_3D_ANIMATION(node, inputName) {\n const container = document.createElement('div')\n\n container.classList.add('comfy-preview-3d-animation')\n\n let controlsApp = createApp(Load3DAnimation, {\n node: node,\n type: 'Preview3DAnimation'\n })\n\n controlsApp.use(PrimeVue)\n\n controlsApp.mount(container)\n\n const origOnRemoved = node.onRemoved\n\n node.onRemoved = function () {\n /*\n render(null, container)\n\n container.remove()\n */\n\n if (controlsApp) {\n controlsApp.unmount()\n controlsApp = null\n }\n\n origOnRemoved?.apply(this, [])\n }\n\n return {\n widget: node.addDOMWidget(\n inputName,\n 'PREVIEW_3D_ANIMATION',\n container\n )\n }\n }\n }\n },\n\n async nodeCreated(node) {\n if (node.constructor.comfyClass !== 'Preview3DAnimation') return\n\n const [oldWidth, oldHeight] = node.size\n\n node.setSize([Math.max(oldWidth, 300), Math.max(oldHeight, 550)])\n\n await nextTick()\n\n const load3d = useLoad3dService().getLoad3d(node)\n\n const modelWidget = node.widgets.find(\n (w: IWidget) => w.name === 'model_file'\n )\n\n const onExecuted = node.onExecuted\n\n node.onExecuted = function (message: any) {\n onExecuted?.apply(this, arguments)\n\n let filePath = message.model_file[0]\n\n if (!filePath) {\n const msg = 'unable to get model file path.'\n\n console.error(msg)\n\n useToastStore().addAlert(msg)\n }\n\n modelWidget.value = filePath.replaceAll('\\\\', '/')\n\n const config = new Load3DConfiguration(load3d)\n\n config.configure('output', modelWidget)\n }\n }\n})\n","// @ts-strict-ignore\nimport { api } from '../../scripts/api'\nimport { app } from '../../scripts/app'\nimport { ComfyApp } from '../../scripts/app'\nimport { $el, ComfyDialog } from '../../scripts/ui'\nimport { ClipspaceDialog } from './clipspace'\n\n// Helper function to convert a data URL to a Blob object\nfunction dataURLToBlob(dataURL) {\n const parts = dataURL.split(';base64,')\n const contentType = parts[0].split(':')[1]\n const byteString = atob(parts[1])\n const arrayBuffer = new ArrayBuffer(byteString.length)\n const uint8Array = new Uint8Array(arrayBuffer)\n for (let i = 0; i < byteString.length; i++) {\n uint8Array[i] = byteString.charCodeAt(i)\n }\n return new Blob([arrayBuffer], { type: contentType })\n}\n\nfunction loadedImageToBlob(image) {\n const canvas = document.createElement('canvas')\n\n canvas.width = image.width\n canvas.height = image.height\n\n const ctx = canvas.getContext('2d')\n\n ctx.drawImage(image, 0, 0)\n\n const dataURL = canvas.toDataURL('image/png', 1)\n const blob = dataURLToBlob(dataURL)\n\n return blob\n}\n\nfunction loadImage(imagePath) {\n return new Promise((resolve, reject) => {\n const image = new Image()\n\n image.onload = function () {\n resolve(image)\n }\n\n image.src = imagePath\n })\n}\n\nasync function uploadMask(filepath, formData) {\n await api\n .fetchApi('/upload/mask', {\n method: 'POST',\n body: formData\n })\n .then((response) => {})\n .catch((error) => {\n console.error('Error:', error)\n })\n\n ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']] = new Image()\n ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']].src = api.apiURL(\n '/view?' +\n new URLSearchParams(filepath).toString() +\n app.getPreviewFormatParam() +\n app.getRandParam()\n )\n\n if (ComfyApp.clipspace.images)\n ComfyApp.clipspace.images[ComfyApp.clipspace['selectedIndex']] = filepath\n\n ClipspaceDialog.invalidatePreview()\n}\n\nfunction prepare_mask(image, maskCanvas, maskCtx, maskColor) {\n // paste mask data into alpha channel\n maskCtx.drawImage(image, 0, 0, maskCanvas.width, maskCanvas.height)\n const maskData = maskCtx.getImageData(\n 0,\n 0,\n maskCanvas.width,\n maskCanvas.height\n )\n\n // invert mask\n for (let i = 0; i < maskData.data.length; i += 4) {\n if (maskData.data[i + 3] == 255) maskData.data[i + 3] = 0\n else maskData.data[i + 3] = 255\n\n maskData.data[i] = maskColor.r\n maskData.data[i + 1] = maskColor.g\n maskData.data[i + 2] = maskColor.b\n }\n\n maskCtx.globalCompositeOperation = 'source-over'\n maskCtx.putImageData(maskData, 0, 0)\n}\n\n// Define the PointerType enum\nenum PointerType {\n Arc = 'arc',\n Rect = 'rect'\n}\n\nenum CompositionOperation {\n SourceOver = 'source-over',\n DestinationOut = 'destination-out'\n}\n\nexport class MaskEditorDialogOld extends ComfyDialog {\n static instance = null\n static mousedown_x: number | null = null\n static mousedown_y: number | null = null\n\n brush: HTMLDivElement\n maskCtx: any\n maskCanvas: HTMLCanvasElement\n brush_size_slider: HTMLDivElement\n brush_opacity_slider: HTMLDivElement\n colorButton: HTMLButtonElement\n saveButton: HTMLButtonElement\n zoom_ratio: number\n pan_x: number\n pan_y: number\n imgCanvas: HTMLCanvasElement\n last_display_style: string\n is_visible: boolean\n image: HTMLImageElement\n handler_registered: boolean\n brush_slider_input: HTMLInputElement\n cursorX: number\n cursorY: number\n mousedown_pan_x: number\n mousedown_pan_y: number\n last_pressure: number\n pointer_type: PointerType\n brush_pointer_type_select: HTMLDivElement\n\n static getInstance() {\n if (!MaskEditorDialogOld.instance) {\n MaskEditorDialogOld.instance = new MaskEditorDialogOld()\n }\n\n return MaskEditorDialogOld.instance\n }\n\n is_layout_created = false\n\n constructor() {\n super()\n this.element = $el('div.comfy-modal', { parent: document.body }, [\n $el('div.comfy-modal-content', [...this.createButtons()])\n ])\n }\n\n createButtons() {\n return []\n }\n\n createButton(name, callback): HTMLButtonElement {\n var button = document.createElement('button')\n button.style.pointerEvents = 'auto'\n button.innerText = name\n button.addEventListener('click', callback)\n return button\n }\n\n createLeftButton(name, callback) {\n var button = this.createButton(name, callback)\n button.style.cssFloat = 'left'\n button.style.marginRight = '4px'\n return button\n }\n\n createRightButton(name, callback) {\n var button = this.createButton(name, callback)\n button.style.cssFloat = 'right'\n button.style.marginLeft = '4px'\n return button\n }\n\n createLeftSlider(self, name, callback): HTMLDivElement {\n const divElement = document.createElement('div')\n divElement.id = 'maskeditor-slider'\n divElement.style.cssFloat = 'left'\n divElement.style.fontFamily = 'sans-serif'\n divElement.style.marginRight = '4px'\n divElement.style.color = 'var(--input-text)'\n divElement.style.backgroundColor = 'var(--comfy-input-bg)'\n divElement.style.borderRadius = '8px'\n divElement.style.borderColor = 'var(--border-color)'\n divElement.style.borderStyle = 'solid'\n divElement.style.fontSize = '15px'\n divElement.style.height = '25px'\n divElement.style.padding = '1px 6px'\n divElement.style.display = 'flex'\n divElement.style.position = 'relative'\n divElement.style.top = '2px'\n divElement.style.pointerEvents = 'auto'\n self.brush_slider_input = document.createElement('input')\n self.brush_slider_input.setAttribute('type', 'range')\n self.brush_slider_input.setAttribute('min', '1')\n self.brush_slider_input.setAttribute('max', '100')\n self.brush_slider_input.setAttribute('value', '10')\n const labelElement = document.createElement('label')\n labelElement.textContent = name\n\n divElement.appendChild(labelElement)\n divElement.appendChild(self.brush_slider_input)\n\n self.brush_slider_input.addEventListener('change', callback)\n\n return divElement\n }\n\n createOpacitySlider(self, name, callback): HTMLDivElement {\n const divElement = document.createElement('div')\n divElement.id = 'maskeditor-opacity-slider'\n divElement.style.cssFloat = 'left'\n divElement.style.fontFamily = 'sans-serif'\n divElement.style.marginRight = '4px'\n divElement.style.color = 'var(--input-text)'\n divElement.style.backgroundColor = 'var(--comfy-input-bg)'\n divElement.style.borderRadius = '8px'\n divElement.style.borderColor = 'var(--border-color)'\n divElement.style.borderStyle = 'solid'\n divElement.style.fontSize = '15px'\n divElement.style.height = '25px'\n divElement.style.padding = '1px 6px'\n divElement.style.display = 'flex'\n divElement.style.position = 'relative'\n divElement.style.top = '2px'\n divElement.style.pointerEvents = 'auto'\n self.opacity_slider_input = document.createElement('input')\n self.opacity_slider_input.setAttribute('type', 'range')\n self.opacity_slider_input.setAttribute('min', '0.1')\n self.opacity_slider_input.setAttribute('max', '1.0')\n self.opacity_slider_input.setAttribute('step', '0.01')\n self.opacity_slider_input.setAttribute('value', '0.7')\n const labelElement = document.createElement('label')\n labelElement.textContent = name\n\n divElement.appendChild(labelElement)\n divElement.appendChild(self.opacity_slider_input)\n\n self.opacity_slider_input.addEventListener('input', callback)\n\n return divElement\n }\n\n createPointerTypeSelect(self: any): HTMLDivElement {\n const divElement = document.createElement('div')\n divElement.id = 'maskeditor-pointer-type'\n divElement.style.cssFloat = 'left'\n divElement.style.fontFamily = 'sans-serif'\n divElement.style.marginRight = '4px'\n divElement.style.color = 'var(--input-text)'\n divElement.style.backgroundColor = 'var(--comfy-input-bg)'\n divElement.style.borderRadius = '8px'\n divElement.style.borderColor = 'var(--border-color)'\n divElement.style.borderStyle = 'solid'\n divElement.style.fontSize = '15px'\n divElement.style.height = '25px'\n divElement.style.padding = '1px 6px'\n divElement.style.display = 'flex'\n divElement.style.position = 'relative'\n divElement.style.top = '2px'\n divElement.style.pointerEvents = 'auto'\n\n const labelElement = document.createElement('label')\n labelElement.textContent = 'Pointer Type:'\n\n const selectElement = document.createElement('select')\n selectElement.style.borderRadius = '0'\n selectElement.style.borderColor = 'transparent'\n selectElement.style.borderStyle = 'unset'\n selectElement.style.fontSize = '0.9em'\n\n const optionArc = document.createElement('option')\n optionArc.value = 'arc'\n optionArc.text = 'Circle'\n optionArc.selected = true // Fix for TypeScript, \"selected\" should be boolean\n\n const optionRect = document.createElement('option')\n optionRect.value = 'rect'\n optionRect.text = 'Square'\n\n selectElement.appendChild(optionArc)\n selectElement.appendChild(optionRect)\n\n selectElement.addEventListener('change', (event: Event) => {\n const target = event.target as HTMLSelectElement\n self.pointer_type = target.value\n this.setBrushBorderRadius(self)\n })\n\n divElement.appendChild(labelElement)\n divElement.appendChild(selectElement)\n\n return divElement\n }\n\n setBrushBorderRadius(self: any): void {\n if (self.pointer_type === PointerType.Rect) {\n this.brush.style.borderRadius = '0%'\n // @ts-expect-error\n this.brush.style.MozBorderRadius = '0%'\n // @ts-expect-error\n this.brush.style.WebkitBorderRadius = '0%'\n } else {\n this.brush.style.borderRadius = '50%'\n // @ts-expect-error\n this.brush.style.MozBorderRadius = '50%'\n // @ts-expect-error\n this.brush.style.WebkitBorderRadius = '50%'\n }\n }\n\n setlayout(imgCanvas: HTMLCanvasElement, maskCanvas: HTMLCanvasElement) {\n const self = this\n self.pointer_type = PointerType.Arc\n\n // If it is specified as relative, using it only as a hidden placeholder for padding is recommended\n // to prevent anomalies where it exceeds a certain size and goes outside of the window.\n var bottom_panel = document.createElement('div')\n bottom_panel.style.position = 'absolute'\n bottom_panel.style.bottom = '0px'\n bottom_panel.style.left = '20px'\n bottom_panel.style.right = '20px'\n bottom_panel.style.height = '50px'\n bottom_panel.style.pointerEvents = 'none'\n\n var brush = document.createElement('div')\n brush.id = 'brush'\n brush.style.backgroundColor = 'transparent'\n brush.style.outline = '1px dashed black'\n brush.style.boxShadow = '0 0 0 1px white'\n brush.style.position = 'absolute'\n brush.style.zIndex = '8889'\n brush.style.pointerEvents = 'none'\n this.brush = brush\n this.setBrushBorderRadius(self)\n this.element.appendChild(imgCanvas)\n this.element.appendChild(maskCanvas)\n this.element.appendChild(bottom_panel)\n document.body.appendChild(brush)\n\n var clearButton = this.createLeftButton('Clear', () => {\n self.maskCtx.clearRect(\n 0,\n 0,\n self.maskCanvas.width,\n self.maskCanvas.height\n )\n })\n\n this.brush_size_slider = this.createLeftSlider(\n self,\n 'Thickness',\n (event) => {\n self.brush_size = event.target.value\n self.updateBrushPreview(self)\n }\n )\n\n this.brush_opacity_slider = this.createOpacitySlider(\n self,\n 'Opacity',\n (event) => {\n self.brush_opacity = event.target.value\n if (self.brush_color_mode !== 'negative') {\n self.maskCanvas.style.opacity = self.brush_opacity.toString()\n }\n }\n )\n\n this.brush_pointer_type_select = this.createPointerTypeSelect(self)\n this.colorButton = this.createLeftButton(this.getColorButtonText(), () => {\n if (self.brush_color_mode === 'black') {\n self.brush_color_mode = 'white'\n } else if (self.brush_color_mode === 'white') {\n self.brush_color_mode = 'negative'\n } else {\n self.brush_color_mode = 'black'\n }\n\n self.updateWhenBrushColorModeChanged()\n })\n\n var cancelButton = this.createRightButton('Cancel', () => {\n document.removeEventListener('keydown', MaskEditorDialogOld.handleKeyDown)\n self.close()\n })\n\n this.saveButton = this.createRightButton('Save', () => {\n document.removeEventListener('keydown', MaskEditorDialogOld.handleKeyDown)\n self.save()\n })\n\n this.element.appendChild(imgCanvas)\n this.element.appendChild(maskCanvas)\n this.element.appendChild(bottom_panel)\n\n bottom_panel.appendChild(clearButton)\n bottom_panel.appendChild(this.saveButton)\n bottom_panel.appendChild(cancelButton)\n bottom_panel.appendChild(this.brush_size_slider)\n bottom_panel.appendChild(this.brush_opacity_slider)\n bottom_panel.appendChild(this.brush_pointer_type_select)\n bottom_panel.appendChild(this.colorButton)\n\n imgCanvas.style.position = 'absolute'\n maskCanvas.style.position = 'absolute'\n\n imgCanvas.style.top = '200'\n imgCanvas.style.left = '0'\n\n maskCanvas.style.top = imgCanvas.style.top\n maskCanvas.style.left = imgCanvas.style.left\n\n const maskCanvasStyle = this.getMaskCanvasStyle()\n maskCanvas.style.mixBlendMode = maskCanvasStyle.mixBlendMode\n maskCanvas.style.opacity = maskCanvasStyle.opacity.toString()\n }\n\n async show() {\n this.zoom_ratio = 1.0\n this.pan_x = 0\n this.pan_y = 0\n\n if (!this.is_layout_created) {\n // layout\n const imgCanvas = document.createElement('canvas')\n const maskCanvas = document.createElement('canvas')\n\n imgCanvas.id = 'imageCanvas'\n maskCanvas.id = 'maskCanvas'\n\n this.setlayout(imgCanvas, maskCanvas)\n\n // prepare content\n this.imgCanvas = imgCanvas\n this.maskCanvas = maskCanvas\n this.maskCtx = maskCanvas.getContext('2d', { willReadFrequently: true })\n\n this.setEventHandler(maskCanvas)\n\n this.is_layout_created = true\n\n // replacement of onClose hook since close is not real close\n const self = this\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach(function (mutation) {\n if (\n mutation.type === 'attributes' &&\n mutation.attributeName === 'style'\n ) {\n if (\n self.last_display_style &&\n self.last_display_style != 'none' &&\n self.element.style.display == 'none'\n ) {\n self.brush.style.display = 'none'\n ComfyApp.onClipspaceEditorClosed()\n }\n\n self.last_display_style = self.element.style.display\n }\n })\n })\n\n const config = { attributes: true }\n observer.observe(this.element, config)\n }\n\n // The keydown event needs to be reconfigured when closing the dialog as it gets removed.\n document.addEventListener('keydown', MaskEditorDialogOld.handleKeyDown)\n\n if (ComfyApp.clipspace_return_node) {\n this.saveButton.innerText = 'Save to node'\n } else {\n this.saveButton.innerText = 'Save'\n }\n this.saveButton.disabled = false\n\n this.element.style.display = 'block'\n this.element.style.width = '85%'\n this.element.style.margin = '0 7.5%'\n this.element.style.height = '100vh'\n this.element.style.top = '50%'\n this.element.style.left = '42%'\n this.element.style.zIndex = '8888' // NOTE: alert dialog must be high priority.\n\n await this.setImages(this.imgCanvas)\n\n this.is_visible = true\n }\n\n isOpened() {\n return this.element.style.display == 'block'\n }\n\n invalidateCanvas(orig_image, mask_image) {\n this.imgCanvas.width = orig_image.width\n this.imgCanvas.height = orig_image.height\n\n this.maskCanvas.width = orig_image.width\n this.maskCanvas.height = orig_image.height\n\n let imgCtx = this.imgCanvas.getContext('2d', { willReadFrequently: true })\n let maskCtx = this.maskCanvas.getContext('2d', {\n willReadFrequently: true\n })\n\n imgCtx.drawImage(orig_image, 0, 0, orig_image.width, orig_image.height)\n prepare_mask(mask_image, this.maskCanvas, maskCtx, this.getMaskColor())\n }\n\n async setImages(imgCanvas) {\n let self = this\n\n const imgCtx = imgCanvas.getContext('2d', { willReadFrequently: true })\n const maskCtx = this.maskCtx\n const maskCanvas = this.maskCanvas\n\n imgCtx.clearRect(0, 0, this.imgCanvas.width, this.imgCanvas.height)\n maskCtx.clearRect(0, 0, this.maskCanvas.width, this.maskCanvas.height)\n\n // image load\n const filepath = ComfyApp.clipspace.images\n\n const alpha_url = new URL(\n ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']].src\n )\n alpha_url.searchParams.delete('channel')\n alpha_url.searchParams.delete('preview')\n alpha_url.searchParams.set('channel', 'a')\n let mask_image = await loadImage(alpha_url)\n\n // original image load\n const rgb_url = new URL(\n ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']].src\n )\n rgb_url.searchParams.delete('channel')\n rgb_url.searchParams.set('channel', 'rgb')\n this.image = new Image()\n this.image.onload = function () {\n maskCanvas.width = self.image.width\n maskCanvas.height = self.image.height\n\n self.invalidateCanvas(self.image, mask_image)\n self.initializeCanvasPanZoom()\n }\n this.image.src = rgb_url.toString()\n }\n\n initializeCanvasPanZoom() {\n // set initialize\n let drawWidth = this.image.width\n let drawHeight = this.image.height\n\n let width = this.element.clientWidth\n let height = this.element.clientHeight\n\n if (this.image.width > width) {\n drawWidth = width\n drawHeight = (drawWidth / this.image.width) * this.image.height\n }\n\n if (drawHeight > height) {\n drawHeight = height\n drawWidth = (drawHeight / this.image.height) * this.image.width\n }\n\n this.zoom_ratio = drawWidth / this.image.width\n\n const canvasX = (width - drawWidth) / 2\n const canvasY = (height - drawHeight) / 2\n this.pan_x = canvasX\n this.pan_y = canvasY\n\n this.invalidatePanZoom()\n }\n\n invalidatePanZoom() {\n let raw_width = this.image.width * this.zoom_ratio\n let raw_height = this.image.height * this.zoom_ratio\n\n if (this.pan_x + raw_width < 10) {\n this.pan_x = 10 - raw_width\n }\n\n if (this.pan_y + raw_height < 10) {\n this.pan_y = 10 - raw_height\n }\n\n let width = `${raw_width}px`\n let height = `${raw_height}px`\n\n let left = `${this.pan_x}px`\n let top = `${this.pan_y}px`\n\n this.maskCanvas.style.width = width\n this.maskCanvas.style.height = height\n this.maskCanvas.style.left = left\n this.maskCanvas.style.top = top\n\n this.imgCanvas.style.width = width\n this.imgCanvas.style.height = height\n this.imgCanvas.style.left = left\n this.imgCanvas.style.top = top\n }\n\n setEventHandler(maskCanvas) {\n const self = this\n\n if (!this.handler_registered) {\n maskCanvas.addEventListener('contextmenu', (event) => {\n event.preventDefault()\n })\n\n this.element.addEventListener('wheel', (event) =>\n this.handleWheelEvent(self, event)\n )\n this.element.addEventListener('pointermove', (event) =>\n this.pointMoveEvent(self, event)\n )\n this.element.addEventListener('touchmove', (event) =>\n this.pointMoveEvent(self, event)\n )\n\n this.element.addEventListener('dragstart', (event) => {\n if (event.ctrlKey) {\n event.preventDefault()\n }\n })\n\n maskCanvas.addEventListener('pointerdown', (event) =>\n this.handlePointerDown(self, event)\n )\n maskCanvas.addEventListener('pointermove', (event) =>\n this.draw_move(self, event)\n )\n maskCanvas.addEventListener('touchmove', (event) =>\n this.draw_move(self, event)\n )\n maskCanvas.addEventListener('pointerover', (event) => {\n this.brush.style.display = 'block'\n })\n maskCanvas.addEventListener('pointerleave', (event) => {\n this.brush.style.display = 'none'\n })\n\n document.addEventListener(\n 'pointerup',\n MaskEditorDialogOld.handlePointerUp\n )\n\n this.handler_registered = true\n }\n }\n\n getMaskCanvasStyle() {\n if (this.brush_color_mode === 'negative') {\n return {\n mixBlendMode: 'difference',\n opacity: '1'\n }\n } else {\n return {\n mixBlendMode: 'initial',\n opacity: this.brush_opacity\n }\n }\n }\n\n getMaskColor() {\n if (this.brush_color_mode === 'black') {\n return { r: 0, g: 0, b: 0 }\n }\n if (this.brush_color_mode === 'white') {\n return { r: 255, g: 255, b: 255 }\n }\n if (this.brush_color_mode === 'negative') {\n // negative effect only works with white color\n return { r: 255, g: 255, b: 255 }\n }\n\n return { r: 0, g: 0, b: 0 }\n }\n\n getMaskFillStyle() {\n const maskColor = this.getMaskColor()\n\n return 'rgb(' + maskColor.r + ',' + maskColor.g + ',' + maskColor.b + ')'\n }\n\n getColorButtonText() {\n let colorCaption = 'unknown'\n\n if (this.brush_color_mode === 'black') {\n colorCaption = 'black'\n } else if (this.brush_color_mode === 'white') {\n colorCaption = 'white'\n } else if (this.brush_color_mode === 'negative') {\n colorCaption = 'negative'\n }\n\n return 'Color: ' + colorCaption\n }\n\n updateWhenBrushColorModeChanged() {\n this.colorButton.innerText = this.getColorButtonText()\n\n // update mask canvas css styles\n\n const maskCanvasStyle = this.getMaskCanvasStyle()\n this.maskCanvas.style.mixBlendMode = maskCanvasStyle.mixBlendMode\n this.maskCanvas.style.opacity = maskCanvasStyle.opacity.toString()\n\n // update mask canvas rgb colors\n\n const maskColor = this.getMaskColor()\n\n const maskData = this.maskCtx.getImageData(\n 0,\n 0,\n this.maskCanvas.width,\n this.maskCanvas.height\n )\n\n for (let i = 0; i < maskData.data.length; i += 4) {\n maskData.data[i] = maskColor.r\n maskData.data[i + 1] = maskColor.g\n maskData.data[i + 2] = maskColor.b\n }\n\n this.maskCtx.putImageData(maskData, 0, 0)\n }\n\n brush_opacity = 0.7\n brush_size = 10\n brush_color_mode = 'black'\n drawing_mode = false\n lastx = -1\n lasty = -1\n lasttime = 0\n\n static handleKeyDown(event) {\n const self = MaskEditorDialogOld.instance\n if (event.key === ']') {\n self.brush_size = Math.min(self.brush_size + 2, 100)\n self.brush_slider_input.value = self.brush_size\n } else if (event.key === '[') {\n self.brush_size = Math.max(self.brush_size - 2, 1)\n self.brush_slider_input.value = self.brush_size\n } else if (event.key === 'Enter') {\n self.save()\n }\n\n self.updateBrushPreview(self)\n }\n\n static handlePointerUp(event) {\n event.preventDefault()\n\n this.mousedown_x = null\n this.mousedown_y = null\n\n MaskEditorDialogOld.instance.drawing_mode = false\n }\n\n updateBrushPreview(self) {\n const brush = self.brush\n\n var centerX = self.cursorX\n var centerY = self.cursorY\n\n brush.style.width = self.brush_size * 2 * this.zoom_ratio + 'px'\n brush.style.height = self.brush_size * 2 * this.zoom_ratio + 'px'\n brush.style.left = centerX - self.brush_size * this.zoom_ratio + 'px'\n brush.style.top = centerY - self.brush_size * this.zoom_ratio + 'px'\n }\n\n handleWheelEvent(self, event) {\n event.preventDefault()\n\n if (event.ctrlKey) {\n // zoom canvas\n if (event.deltaY < 0) {\n this.zoom_ratio = Math.min(10.0, this.zoom_ratio + 0.2)\n } else {\n this.zoom_ratio = Math.max(0.2, this.zoom_ratio - 0.2)\n }\n\n this.invalidatePanZoom()\n } else {\n // adjust brush size\n if (event.deltaY < 0) this.brush_size = Math.min(this.brush_size + 2, 100)\n else this.brush_size = Math.max(this.brush_size - 2, 1)\n\n this.brush_slider_input.value = this.brush_size.toString()\n\n this.updateBrushPreview(this)\n }\n }\n\n pointMoveEvent(self, event) {\n this.cursorX = event.pageX\n this.cursorY = event.pageY\n\n self.updateBrushPreview(self)\n\n if (event.ctrlKey) {\n event.preventDefault()\n self.pan_move(self, event)\n }\n\n let left_button_down =\n (window.TouchEvent && event instanceof TouchEvent) || event.buttons == 1\n\n if (event.shiftKey && left_button_down) {\n self.drawing_mode = false\n\n const y = event.clientY\n let delta = (self.zoom_lasty - y) * 0.005\n self.zoom_ratio = Math.max(\n Math.min(10.0, self.last_zoom_ratio - delta),\n 0.2\n )\n\n this.invalidatePanZoom()\n return\n }\n }\n\n pan_move(self, event) {\n if (event.buttons == 1) {\n if (MaskEditorDialogOld.mousedown_x) {\n let deltaX = MaskEditorDialogOld.mousedown_x - event.clientX\n let deltaY = MaskEditorDialogOld.mousedown_y - event.clientY\n\n self.pan_x = this.mousedown_pan_x - deltaX\n self.pan_y = this.mousedown_pan_y - deltaY\n\n self.invalidatePanZoom()\n }\n }\n }\n\n draw_move(self, event) {\n if (event.ctrlKey || event.shiftKey) {\n return\n }\n\n event.preventDefault()\n\n this.cursorX = event.pageX\n this.cursorY = event.pageY\n\n self.updateBrushPreview(self)\n\n let left_button_down =\n (window.TouchEvent && event instanceof TouchEvent) || event.buttons == 1\n let right_button_down = [2, 5, 32].includes(event.buttons)\n\n if (!event.altKey && left_button_down) {\n var diff = performance.now() - self.lasttime\n\n const maskRect = self.maskCanvas.getBoundingClientRect()\n\n var x = event.offsetX\n var y = event.offsetY\n\n if (event.offsetX == null) {\n x = event.targetTouches[0].clientX - maskRect.left\n }\n\n if (event.offsetY == null) {\n y = event.targetTouches[0].clientY - maskRect.top\n }\n\n x /= self.zoom_ratio\n y /= self.zoom_ratio\n\n var brush_size = this.brush_size\n if (event instanceof PointerEvent && event.pointerType == 'pen') {\n brush_size *= event.pressure\n this.last_pressure = event.pressure\n } else if (\n window.TouchEvent &&\n event instanceof TouchEvent &&\n diff < 20\n ) {\n // The firing interval of PointerEvents in Pen is unreliable, so it is supplemented by TouchEvents.\n brush_size *= this.last_pressure\n } else {\n brush_size = this.brush_size\n }\n\n if (diff > 20 && !this.drawing_mode)\n requestAnimationFrame(() => {\n self.init_shape(self, CompositionOperation.SourceOver)\n self.draw_shape(self, x, y, brush_size)\n self.lastx = x\n self.lasty = y\n })\n else\n requestAnimationFrame(() => {\n self.init_shape(self, CompositionOperation.SourceOver)\n\n var dx = x - self.lastx\n var dy = y - self.lasty\n\n var distance = Math.sqrt(dx * dx + dy * dy)\n var directionX = dx / distance\n var directionY = dy / distance\n\n for (var i = 0; i < distance; i += 5) {\n var px = self.lastx + directionX * i\n var py = self.lasty + directionY * i\n self.draw_shape(self, px, py, brush_size)\n }\n self.lastx = x\n self.lasty = y\n })\n\n self.lasttime = performance.now()\n } else if ((event.altKey && left_button_down) || right_button_down) {\n const maskRect = self.maskCanvas.getBoundingClientRect()\n const x =\n (event.offsetX || event.targetTouches[0].clientX - maskRect.left) /\n self.zoom_ratio\n const y =\n (event.offsetY || event.targetTouches[0].clientY - maskRect.top) /\n self.zoom_ratio\n\n var brush_size = this.brush_size\n if (event instanceof PointerEvent && event.pointerType == 'pen') {\n brush_size *= event.pressure\n this.last_pressure = event.pressure\n } else if (\n window.TouchEvent &&\n event instanceof TouchEvent &&\n diff < 20\n ) {\n brush_size *= this.last_pressure\n } else {\n brush_size = this.brush_size\n }\n\n if (diff > 20 && !this.drawing_mode)\n // cannot tracking drawing_mode for touch event\n requestAnimationFrame(() => {\n self.init_shape(self, CompositionOperation.DestinationOut)\n self.draw_shape(self, x, y, brush_size)\n self.lastx = x\n self.lasty = y\n })\n else\n requestAnimationFrame(() => {\n self.init_shape(self, CompositionOperation.DestinationOut)\n\n var dx = x - self.lastx\n var dy = y - self.lasty\n\n var distance = Math.sqrt(dx * dx + dy * dy)\n var directionX = dx / distance\n var directionY = dy / distance\n\n for (var i = 0; i < distance; i += 5) {\n var px = self.lastx + directionX * i\n var py = self.lasty + directionY * i\n self.draw_shape(self, px, py, brush_size)\n }\n self.lastx = x\n self.lasty = y\n })\n\n self.lasttime = performance.now()\n }\n }\n\n handlePointerDown(self, event) {\n if (event.ctrlKey) {\n if (event.buttons == 1) {\n MaskEditorDialogOld.mousedown_x = event.clientX\n MaskEditorDialogOld.mousedown_y = event.clientY\n\n this.mousedown_pan_x = this.pan_x\n this.mousedown_pan_y = this.pan_y\n }\n return\n }\n\n var brush_size = this.brush_size\n if (event instanceof PointerEvent && event.pointerType == 'pen') {\n brush_size *= event.pressure\n this.last_pressure = event.pressure\n }\n\n if ([0, 2, 5].includes(event.button)) {\n self.drawing_mode = true\n\n event.preventDefault()\n\n if (event.shiftKey) {\n self.zoom_lasty = event.clientY\n self.last_zoom_ratio = self.zoom_ratio\n return\n }\n\n const maskRect = self.maskCanvas.getBoundingClientRect()\n const x =\n (event.offsetX || event.targetTouches[0].clientX - maskRect.left) /\n self.zoom_ratio\n const y =\n (event.offsetY || event.targetTouches[0].clientY - maskRect.top) /\n self.zoom_ratio\n\n if (!event.altKey && event.button == 0) {\n self.init_shape(self, CompositionOperation.SourceOver)\n } else {\n self.init_shape(self, CompositionOperation.DestinationOut)\n }\n self.draw_shape(self, x, y, brush_size)\n self.lastx = x\n self.lasty = y\n self.lasttime = performance.now()\n }\n }\n\n init_shape(self, compositionOperation) {\n self.maskCtx.beginPath()\n if (compositionOperation == CompositionOperation.SourceOver) {\n self.maskCtx.fillStyle = this.getMaskFillStyle()\n self.maskCtx.globalCompositeOperation = CompositionOperation.SourceOver\n } else if (compositionOperation == CompositionOperation.DestinationOut) {\n self.maskCtx.globalCompositeOperation =\n CompositionOperation.DestinationOut\n }\n }\n\n draw_shape(self, x, y, brush_size) {\n if (self.pointer_type === PointerType.Rect) {\n self.maskCtx.rect(\n x - brush_size,\n y - brush_size,\n brush_size * 2,\n brush_size * 2\n )\n } else {\n self.maskCtx.arc(x, y, brush_size, 0, Math.PI * 2, false)\n }\n self.maskCtx.fill()\n }\n\n async save() {\n const backupCanvas = document.createElement('canvas')\n const backupCtx = backupCanvas.getContext('2d', {\n willReadFrequently: true\n })\n backupCanvas.width = this.image.width\n backupCanvas.height = this.image.height\n\n backupCtx.clearRect(0, 0, backupCanvas.width, backupCanvas.height)\n backupCtx.drawImage(\n this.maskCanvas,\n 0,\n 0,\n this.maskCanvas.width,\n this.maskCanvas.height,\n 0,\n 0,\n backupCanvas.width,\n backupCanvas.height\n )\n\n // paste mask data into alpha channel\n const backupData = backupCtx.getImageData(\n 0,\n 0,\n backupCanvas.width,\n backupCanvas.height\n )\n\n // refine mask image\n for (let i = 0; i < backupData.data.length; i += 4) {\n if (backupData.data[i + 3] == 255) backupData.data[i + 3] = 0\n else backupData.data[i + 3] = 255\n\n backupData.data[i] = 0\n backupData.data[i + 1] = 0\n backupData.data[i + 2] = 0\n }\n\n backupCtx.globalCompositeOperation = CompositionOperation.SourceOver\n backupCtx.putImageData(backupData, 0, 0)\n\n const formData = new FormData()\n const filename = 'clipspace-mask-' + performance.now() + '.png'\n\n const item = {\n filename: filename,\n subfolder: 'clipspace',\n type: 'input'\n }\n\n if (ComfyApp.clipspace.images) ComfyApp.clipspace.images[0] = item\n\n if (ComfyApp.clipspace.widgets) {\n const index = ComfyApp.clipspace.widgets.findIndex(\n (obj) => obj.name === 'image'\n )\n\n if (index >= 0) ComfyApp.clipspace.widgets[index].value = item\n }\n\n const dataURL = backupCanvas.toDataURL()\n const blob = dataURLToBlob(dataURL)\n\n let original_url = new URL(this.image.src)\n\n type Ref = { filename: string; subfolder?: string; type?: string }\n\n const original_ref: Ref = {\n filename: original_url.searchParams.get('filename')\n }\n\n let original_subfolder = original_url.searchParams.get('subfolder')\n if (original_subfolder) original_ref.subfolder = original_subfolder\n\n let original_type = original_url.searchParams.get('type')\n if (original_type) original_ref.type = original_type\n\n formData.append('image', blob, filename)\n formData.append('original_ref', JSON.stringify(original_ref))\n formData.append('type', 'input')\n formData.append('subfolder', 'clipspace')\n\n this.saveButton.innerText = 'Saving...'\n this.saveButton.disabled = true\n await uploadMask(item, formData)\n ComfyApp.onClipspaceEditorSave()\n this.close()\n }\n}\n","import { debounce } from 'lodash'\n\nimport { api } from '../../scripts/api'\nimport { app } from '../../scripts/app'\nimport { ComfyApp } from '../../scripts/app'\nimport { $el, ComfyDialog } from '../../scripts/ui'\nimport { getStorageValue, setStorageValue } from '../../scripts/utils'\nimport { ClipspaceDialog } from './clipspace'\nimport { MaskEditorDialogOld } from './maskEditorOld'\n\nvar styles = `\n #maskEditorContainer {\n display: fixed;\n }\n #maskEditor_brush {\n position: absolute;\n backgroundColor: transparent;\n z-index: 8889;\n pointer-events: none;\n border-radius: 50%;\n overflow: visible;\n outline: 1px dashed black;\n box-shadow: 0 0 0 1px white;\n }\n #maskEditor_brushPreviewGradient {\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n display: none;\n }\n #maskEditor {\n display: block;\n width: 100%;\n height: 100vh;\n left: 0;\n z-index: 8888;\n position: fixed;\n background: rgba(50,50,50,0.75);\n backdrop-filter: blur(10px);\n overflow: hidden;\n user-select: none;\n }\n #maskEditor_sidePanelContainer {\n height: 100%;\n width: 220px;\n z-index: 8888;\n display: flex;\n flex-direction: column;\n }\n #maskEditor_sidePanel {\n background: var(--comfy-menu-bg);\n height: 100%;\n display: flex;\n align-items: center;\n overflow-y: hidden;\n width: 220px;\n }\n #maskEditor_sidePanelShortcuts {\n display: flex;\n flex-direction: row;\n width: 200px;\n margin-top: 10px;\n gap: 10px;\n justify-content: center;\n }\n .maskEditor_sidePanelIconButton {\n width: 40px;\n height: 40px;\n pointer-events: auto;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s;\n }\n .maskEditor_sidePanelIconButton:hover {\n background-color: rgba(0, 0, 0, 0.2);\n }\n #maskEditor_sidePanelBrushSettings {\n display: flex;\n flex-direction: column;\n gap: 10px;\n width: 200px;\n padding: 10px;\n }\n .maskEditor_sidePanelTitle {\n text-align: center;\n font-size: 15px;\n font-family: sans-serif;\n color: var(--descrip-text);\n margin-top: 10px;\n }\n #maskEditor_sidePanelBrushShapeContainer {\n display: flex;\n width: 180px;\n height: 50px;\n border: 1px solid var(--border-color);\n pointer-events: auto;\n background: rgba(0, 0, 0, 0.2);\n }\n #maskEditor_sidePanelBrushShapeCircle {\n width: 35px;\n height: 35px;\n border-radius: 50%;\n border: 1px solid var(--border-color);\n pointer-events: auto;\n transition: background 0.1s;\n margin-left: 7.5px;\n }\n .maskEditor_sidePanelBrushRange {\n width: 180px;\n -webkit-appearance: none;\n appearance: none;\n background: transparent;\n cursor: pointer;\n }\n .maskEditor_sidePanelBrushRange::-webkit-slider-thumb {\n height: 20px;\n width: 20px;\n border-radius: 50%;\n cursor: grab;\n margin-top: -8px;\n background: var(--p-surface-700);\n border: 1px solid var(--border-color);\n }\n .maskEditor_sidePanelBrushRange::-moz-range-thumb {\n height: 20px;\n width: 20px;\n border-radius: 50%;\n cursor: grab;\n background: var(--p-surface-800);\n border: 1px solid var(--border-color);\n }\n .maskEditor_sidePanelBrushRange::-webkit-slider-runnable-track {\n background: var(--p-surface-700);\n height: 3px;\n }\n .maskEditor_sidePanelBrushRange::-moz-range-track {\n background: var(--p-surface-700);\n height: 3px;\n }\n\n #maskEditor_sidePanelBrushShapeSquare {\n width: 35px;\n height: 35px;\n margin: 5px;\n border: 1px solid var(--border-color);\n pointer-events: auto;\n transition: background 0.1s;\n }\n\n .maskEditor_brushShape_dark {\n background: transparent;\n }\n\n .maskEditor_brushShape_dark:hover {\n background: var(--p-surface-900);\n }\n\n .maskEditor_brushShape_light {\n background: transparent;\n }\n\n .maskEditor_brushShape_light:hover {\n background: var(--comfy-menu-bg);\n }\n\n #maskEditor_sidePanelImageLayerSettings {\n display: flex;\n flex-direction: column;\n gap: 10px;\n width: 200px;\n align-items: center;\n }\n .maskEditor_sidePanelLayer {\n display: flex;\n width: 200px;\n height: 50px;\n }\n .maskEditor_sidePanelLayerVisibilityContainer {\n width: 50px;\n height: 50px;\n border-radius: 8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .maskEditor_sidePanelVisibilityToggle {\n width: 12px;\n height: 12px;\n border-radius: 50%;\n pointer-events: auto;\n }\n .maskEditor_sidePanelLayerIconContainer {\n width: 60px;\n height: 50px;\n border-radius: 8px;\n display: flex;\n justify-content: center;\n align-items: center;\n fill: var(--input-text);\n }\n .maskEditor_sidePanelLayerIconContainer svg {\n width: 30px;\n height: 30px;\n }\n #maskEditor_sidePanelMaskLayerBlendingContainer {\n width: 80px;\n height: 50px;\n border-radius: 8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n #maskEditor_sidePanelMaskLayerBlendingSelect {\n width: 80px;\n height: 30px;\n border: 1px solid var(--border-color);\n background-color: rgba(0, 0, 0, 0.2);\n color: var(--input-text);\n font-family: sans-serif;\n font-size: 15px;\n pointer-events: auto;\n transition: background-color border 0.1s;\n }\n #maskEditor_sidePanelClearCanvasButton:hover {\n background-color: var(--p-overlaybadge-outline-color);\n border: none;\n }\n #maskEditor_sidePanelClearCanvasButton {\n width: 180px;\n height: 30px;\n border: none;\n background: rgba(0, 0, 0, 0.2);\n border: 1px solid var(--border-color);\n color: var(--input-text);\n font-family: sans-serif;\n font-size: 15px;\n pointer-events: auto;\n transition: background-color 0.1s;\n }\n #maskEditor_sidePanelClearCanvasButton:hover {\n background-color: var(--p-overlaybadge-outline-color);\n }\n #maskEditor_sidePanelHorizontalButtonContainer {\n display: flex;\n gap: 10px;\n height: 40px;\n }\n .maskEditor_sidePanelBigButton {\n width: 85px;\n height: 30px;\n border: none;\n background: rgba(0, 0, 0, 0.2);\n border: 1px solid var(--border-color);\n color: var(--input-text);\n font-family: sans-serif;\n font-size: 15px;\n pointer-events: auto;\n transition: background-color border 0.1s;\n }\n .maskEditor_sidePanelBigButton:hover {\n background-color: var(--p-overlaybadge-outline-color);\n border: none;\n }\n #maskEditor_toolPanel {\n height: 100%;\n width: 4rem;\n z-index: 8888;\n background: var(--comfy-menu-bg);\n display: flex;\n flex-direction: column;\n }\n .maskEditor_toolPanelContainer {\n width: 4rem;\n height: 4rem;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n transition: background-color 0.2s;\n }\n .maskEditor_toolPanelContainerSelected svg {\n fill: var(--p-button-text-primary-color) !important;\n }\n .maskEditor_toolPanelContainerSelected .maskEditor_toolPanelIndicator {\n display: block;\n }\n .maskEditor_toolPanelContainer svg {\n width: 75%;\n aspect-ratio: 1/1;\n fill: var(--p-button-text-secondary-color);\n }\n\n .maskEditor_toolPanelContainerDark:hover {\n background-color: var(--p-surface-800);\n }\n\n .maskEditor_toolPanelContainerLight:hover {\n background-color: var(--p-surface-300);\n }\n\n .maskEditor_toolPanelIndicator {\n display: none;\n height: 100%;\n width: 4px;\n position: absolute;\n left: 0;\n background: var(--p-button-text-primary-color);\n }\n #maskEditor_sidePanelPaintBucketSettings {\n display: flex;\n flex-direction: column;\n gap: 10px;\n width: 200px;\n padding: 10px;\n }\n #canvasBackground {\n background: white;\n width: 100%;\n height: 100%;\n }\n #maskEditor_sidePanelButtonsContainer {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin-top: 10px;\n }\n .maskEditor_sidePanelSeparator {\n width: 200px;\n height: 2px;\n background: var(--border-color);\n margin-top: 5px;\n margin-bottom: 5px;\n }\n #maskEditor_pointerZone {\n width: calc(100% - 4rem - 220px);\n height: 100%;\n }\n #maskEditor_uiContainer {\n width: 100%;\n height: 100%;\n position: absolute;\n z-index: 8888;\n display: flex;\n flex-direction: column;\n }\n #maskEditorCanvasContainer {\n position: absolute;\n width: 1000px;\n height: 667px;\n left: 359px;\n top: 280px;\n }\n #imageCanvas {\n width: 100%;\n height: 100%;\n }\n #maskCanvas {\n width: 100%;\n height: 100%;\n }\n #maskEditor_uiHorizontalContainer {\n width: 100%;\n height: 100%;\n display: flex;\n }\n #maskEditor_topBar {\n display: flex;\n height: 44px;\n align-items: center;\n background: var(--comfy-menu-bg);\n }\n #maskEditor_topBarTitle {\n margin: 0;\n margin-left: 0.5rem;\n margin-right: 0.5rem;\n font-size: 1.2em;\n }\n #maskEditor_topBarButtonContainer {\n display: flex;\n gap: 10px;\n margin-right: 0.5rem;\n position: absolute;\n right: 0;\n width: 200px;\n }\n #maskEditor_topBarShortcutsContainer {\n display: flex;\n gap: 10px;\n margin-left: 5px;\n }\n\n .maskEditor_topPanelIconButton_dark {\n width: 50px;\n height: 30px;\n pointer-events: auto;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s;\n background: var(--p-surface-800);\n border: 1px solid var(--p-form-field-border-color);\n border-radius: 10px;\n }\n\n .maskEditor_topPanelIconButton_dark:hover {\n background-color: var(--p-surface-900);\n }\n\n .maskEditor_topPanelIconButton_dark svg {\n width: 25px;\n height: 25px;\n pointer-events: none;\n fill: var(--input-text);\n }\n\n .maskEditor_topPanelIconButton_light {\n width: 50px;\n height: 30px;\n pointer-events: auto;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s;\n background: var(--comfy-menu-bg);\n border: 1px solid var(--p-form-field-border-color);\n border-radius: 10px;\n }\n\n .maskEditor_topPanelIconButton_light:hover {\n background-color: var(--p-surface-300);\n }\n\n .maskEditor_topPanelIconButton_light svg {\n width: 25px;\n height: 25px;\n pointer-events: none;\n fill: var(--input-text);\n }\n\n .maskEditor_topPanelButton_dark {\n height: 30px;\n background: var(--p-surface-800);\n border: 1px solid var(--p-form-field-border-color);\n border-radius: 10px;\n color: var(--input-text);\n font-family: sans-serif;\n pointer-events: auto;\n transition: 0.1s;\n width: 60px;\n }\n\n .maskEditor_topPanelButton_dark:hover {\n background-color: var(--p-surface-900);\n }\n\n .maskEditor_topPanelButton_light {\n height: 30px;\n background: var(--comfy-menu-bg);\n border: 1px solid var(--p-form-field-border-color);\n border-radius: 10px;\n color: var(--input-text);\n font-family: sans-serif;\n pointer-events: auto;\n transition: 0.1s;\n width: 60px;\n }\n\n .maskEditor_topPanelButton_light:hover {\n background-color: var(--p-surface-300);\n }\n\n\n #maskEditor_sidePanelColorSelectSettings {\n flex-direction: column;\n }\n\n .maskEditor_sidePanel_paintBucket_Container {\n width: 180px;\n display: flex;\n flex-direction: column;\n position: relative;\n }\n\n .maskEditor_sidePanel_colorSelect_Container {\n display: flex;\n width: 180px;\n align-items: center;\n gap: 5px;\n height: 30px;\n }\n\n #maskEditor_sidePanelVisibilityToggle {\n position: absolute;\n right: 0;\n }\n\n #maskEditor_sidePanelColorSelectMethodSelect {\n position: absolute;\n right: 0;\n height: 30px;\n border-radius: 0;\n border: 1px solid var(--border-color);\n background: rgba(0,0,0,0.2);\n }\n\n #maskEditor_sidePanelVisibilityToggle {\n position: absolute;\n right: 0;\n }\n\n .maskEditor_sidePanel_colorSelect_tolerance_container {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin-bottom: 10px;\n }\n\n .maskEditor_sidePanelContainerColumn {\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .maskEditor_sidePanelContainerRow {\n display: flex;\n flex-direction: row;\n gap: 10px;\n align-items: center;\n min-height: 24px;\n position: relative;\n }\n\n .maskEditor_accent_bg_dark {\n background: var(--p-surface-800);\n }\n\n .maskEditor_accent_bg_very_dark {\n background: var(--p-surface-900);\n }\n\n .maskEditor_accent_bg_light {\n background: var(--p-surface-300);\n }\n\n .maskEditor_accent_bg_very_light {\n background: var(--comfy-menu-bg);\n }\n\n #maskEditor_paintBucketSettings {\n display: none;\n }\n\n #maskEditor_colorSelectSettings {\n display: none;\n }\n\n .maskEditor_sidePanelToggleContainer {\n cursor: pointer;\n display: inline-block;\n position: absolute;\n right: 0;\n }\n\n .maskEditor_toggle_bg_dark {\n background: var(--p-surface-700);\n }\n\n .maskEditor_toggle_bg_light {\n background: var(--p-surface-300);\n }\n\n .maskEditor_sidePanelToggleSwitch {\n display: inline-block;\n border-radius: 16px;\n width: 40px;\n height: 24px;\n position: relative;\n vertical-align: middle;\n transition: background 0.25s;\n }\n .maskEditor_sidePanelToggleSwitch:before, .maskEditor_sidePanelToggleSwitch:after {\n content: \"\";\n }\n .maskEditor_sidePanelToggleSwitch:before {\n display: block;\n background: linear-gradient(to bottom, #fff 0%, #eee 100%);\n border-radius: 50%;\n width: 16px;\n height: 16px;\n position: absolute;\n top: 4px;\n left: 4px;\n transition: ease 0.2s;\n }\n .maskEditor_sidePanelToggleContainer:hover .maskEditor_sidePanelToggleSwitch:before {\n background: linear-gradient(to bottom, #fff 0%, #fff 100%);\n }\n .maskEditor_sidePanelToggleCheckbox:checked + .maskEditor_sidePanelToggleSwitch {\n background: var(--p-button-text-primary-color);\n }\n .maskEditor_sidePanelToggleCheckbox:checked + .maskEditor_toggle_bg_dark:before {\n background: var(--p-surface-900);\n }\n .maskEditor_sidePanelToggleCheckbox:checked + .maskEditor_toggle_bg_light:before {\n background: var(--comfy-menu-bg);\n }\n .maskEditor_sidePanelToggleCheckbox:checked + .maskEditor_sidePanelToggleSwitch:before {\n left: 20px;\n }\n\n .maskEditor_sidePanelToggleCheckbox {\n position: absolute;\n visibility: hidden;\n }\n\n .maskEditor_sidePanelDropdown_dark {\n border: 1px solid var(--p-form-field-border-color);\n background: var(--p-surface-900);\n height: 24px;\n padding-left: 5px;\n padding-right: 5px;\n border-radius: 6px;\n transition: background 0.1s;\n }\n\n .maskEditor_sidePanelDropdown_dark option {\n background: var(--p-surface-900);\n }\n\n .maskEditor_sidePanelDropdown_dark:focus {\n outline: 1px solid var(--p-button-text-primary-color);\n }\n\n .maskEditor_sidePanelDropdown_dark option:hover {\n background: white;\n }\n .maskEditor_sidePanelDropdown_dark option:active {\n background: var(--p-highlight-background);\n }\n\n .maskEditor_sidePanelDropdown_light {\n border: 1px solid var(--p-form-field-border-color);\n background: var(--comfy-menu-bg);\n height: 24px;\n padding-left: 5px;\n padding-right: 5px;\n border-radius: 6px;\n transition: background 0.1s;\n }\n\n .maskEditor_sidePanelDropdown_light option {\n background: var(--comfy-menu-bg);\n }\n\n .maskEditor_sidePanelDropdown_light:focus {\n outline: 1px solid var(--p-surface-300);\n }\n\n .maskEditor_sidePanelDropdown_light option:hover {\n background: white;\n }\n .maskEditor_sidePanelDropdown_light option:active {\n background: var(--p-surface-300);\n }\n\n .maskEditor_layerRow {\n height: 50px;\n width: 200px;\n border-radius: 10px;\n }\n\n .maskEditor_sidePanelLayerPreviewContainer {\n width: 40px;\n height: 30px;\n }\n\n .maskEditor_sidePanelLayerPreviewContainer > svg{\n width: 100%;\n height: 100%;\n object-fit: contain;\n fill: var(--p-surface-100);\n }\n\n #maskEditor_sidePanelImageLayerImage {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n\n .maskEditor_sidePanelSubTitle {\n text-align: left;\n font-size: 12px;\n font-family: sans-serif;\n color: var(--descrip-text);\n }\n\n .maskEditor_containerDropdown {\n position: absolute;\n right: 0;\n }\n\n .maskEditor_sidePanelLayerCheckbox {\n margin-left: 15px;\n }\n\n .maskEditor_toolPanelZoomIndicator {\n width: 4rem;\n height: 4rem;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n color: var(--p-button-text-secondary-color);\n position: absolute;\n bottom: 0;\n transition: background-color 0.2s;\n }\n\n #maskEditor_toolPanelDimensionsText {\n font-size: 12px;\n }\n\n #maskEditor_topBarSaveButton {\n background: var(--p-primary-color) !important;\n color: var(--p-button-primary-color) !important;\n }\n\n #maskEditor_topBarSaveButton:hover {\n background: var(--p-primary-hover-color) !important;\n }\n\n`\n\nvar styleSheet = document.createElement('style')\nstyleSheet.type = 'text/css'\nstyleSheet.innerText = styles\ndocument.head.appendChild(styleSheet)\n\nenum BrushShape {\n Arc = 'arc',\n Rect = 'rect'\n}\n\nenum Tools {\n Pen = 'pen',\n Eraser = 'eraser',\n PaintBucket = 'paintBucket',\n ColorSelect = 'colorSelect'\n}\n\nenum CompositionOperation {\n SourceOver = 'source-over',\n DestinationOut = 'destination-out'\n}\n\nenum MaskBlendMode {\n Black = 'black',\n White = 'white',\n Negative = 'negative'\n}\n\nenum ColorComparisonMethod {\n Simple = 'simple',\n HSL = 'hsl',\n LAB = 'lab'\n}\n\ninterface Point {\n x: number\n y: number\n}\n\ninterface Offset {\n x: number\n y: number\n}\n\nexport interface Brush {\n type: BrushShape\n size: number\n opacity: number\n hardness: number\n smoothingPrecision: number\n}\n\nconst saveBrushToCache = debounce(function (key: string, brush: Brush): void {\n try {\n const brushString = JSON.stringify(brush)\n setStorageValue(key, brushString)\n } catch (error) {\n console.error('Failed to save brush to cache:', error)\n }\n}, 300)\n\nfunction loadBrushFromCache(key: string): Brush | null {\n try {\n const brushString = getStorageValue(key)\n if (brushString) {\n const brush = JSON.parse(brushString) as Brush\n console.log('Loaded brush from cache:', brush)\n return brush\n } else {\n console.log('No brush found in cache.')\n return null\n }\n } catch (error) {\n console.error('Failed to load brush from cache:', error)\n return null\n }\n}\n\ntype Callback = (data?: any) => void\n\nclass MaskEditorDialog extends ComfyDialog {\n static instance: MaskEditorDialog | null = null\n\n //new\n private uiManager!: UIManager\n private toolManager!: ToolManager\n private panAndZoomManager!: PanAndZoomManager\n private brushTool!: BrushTool\n private paintBucketTool!: PaintBucketTool\n private colorSelectTool!: ColorSelectTool\n private canvasHistory!: CanvasHistory\n private messageBroker!: MessageBroker\n private keyboardManager!: KeyboardManager\n\n private rootElement!: HTMLElement\n private imageURL!: string\n\n private isLayoutCreated: boolean = false\n private isOpen: boolean = false\n\n //variables needed?\n last_display_style: string | null = null\n\n constructor() {\n super()\n this.rootElement = $el(\n 'div.maskEditor_hidden',\n { parent: document.body },\n []\n )\n\n this.element = this.rootElement\n }\n\n static getInstance() {\n if (!ComfyApp.clipspace || !ComfyApp.clipspace.imgs) {\n throw new Error('No clipspace images found')\n }\n const currentSrc =\n ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']].src\n\n if (\n !MaskEditorDialog.instance ||\n currentSrc !== MaskEditorDialog.instance.imageURL\n ) {\n MaskEditorDialog.instance = new MaskEditorDialog()\n }\n return MaskEditorDialog.instance\n }\n\n async show() {\n this.cleanup()\n if (!this.isLayoutCreated) {\n // layout\n this.messageBroker = new MessageBroker()\n this.canvasHistory = new CanvasHistory(this, 20)\n this.paintBucketTool = new PaintBucketTool(this)\n this.brushTool = new BrushTool(this)\n this.panAndZoomManager = new PanAndZoomManager(this)\n this.toolManager = new ToolManager(this)\n this.keyboardManager = new KeyboardManager(this)\n this.uiManager = new UIManager(this.rootElement, this)\n this.colorSelectTool = new ColorSelectTool(this)\n\n // replacement of onClose hook since close is not real close\n const self = this\n const observer = new MutationObserver(function (mutations) {\n mutations.forEach(function (mutation) {\n if (\n mutation.type === 'attributes' &&\n mutation.attributeName === 'style'\n ) {\n if (\n self.last_display_style &&\n self.last_display_style != 'none' &&\n self.element.style.display == 'none'\n ) {\n //self.brush.style.display = 'none'\n ComfyApp.onClipspaceEditorClosed()\n }\n\n self.last_display_style = self.element.style.display\n }\n })\n })\n\n const config = { attributes: true }\n observer.observe(this.rootElement, config)\n\n this.isLayoutCreated = true\n\n await this.uiManager.setlayout()\n }\n\n //this.zoomAndPanManager.reset()\n\n this.rootElement.id = 'maskEditor'\n this.rootElement.style.display = 'flex'\n this.element.style.display = 'flex'\n await this.uiManager.initUI()\n this.paintBucketTool.initPaintBucketTool()\n this.colorSelectTool.initColorSelectTool()\n await this.canvasHistory.saveInitialState()\n this.isOpen = true\n if (ComfyApp.clipspace && ComfyApp.clipspace.imgs) {\n this.uiManager.setSidebarImage()\n }\n this.keyboardManager.addListeners()\n }\n\n private cleanup() {\n // Remove all maskEditor elements\n const maskEditors = document.querySelectorAll('[id^=\"maskEditor\"]')\n maskEditors.forEach((element) => element.remove())\n\n // Remove brush elements specifically\n const brushElements = document.querySelectorAll('#maskEditor_brush')\n brushElements.forEach((element) => element.remove())\n }\n\n isOpened() {\n return this.isOpen\n }\n\n async save() {\n const backupCanvas = document.createElement('canvas')\n const imageCanvas = this.uiManager.getImgCanvas()\n const maskCanvas = this.uiManager.getMaskCanvas()\n const image = this.uiManager.getImage()\n const backupCtx = backupCanvas.getContext('2d', {\n willReadFrequently: true\n })\n\n backupCanvas.width = imageCanvas.width\n backupCanvas.height = imageCanvas.height\n\n if (!backupCtx) {\n return\n }\n\n // Ensure the mask image is fully loaded\n const maskImageLoaded = new Promise((resolve, reject) => {\n const maskImage = new Image()\n maskImage.src = maskCanvas.toDataURL()\n maskImage.onload = () => {\n resolve()\n }\n maskImage.onerror = (error) => {\n reject(error)\n }\n })\n\n try {\n await maskImageLoaded\n } catch (error) {\n console.error('Error loading mask image:', error)\n return\n }\n\n backupCtx.clearRect(0, 0, backupCanvas.width, backupCanvas.height)\n backupCtx.drawImage(\n maskCanvas,\n 0,\n 0,\n maskCanvas.width,\n maskCanvas.height,\n 0,\n 0,\n backupCanvas.width,\n backupCanvas.height\n )\n\n let maskHasContent = false\n const maskData = backupCtx.getImageData(\n 0,\n 0,\n backupCanvas.width,\n backupCanvas.height\n )\n\n for (let i = 0; i < maskData.data.length; i += 4) {\n if (maskData.data[i + 3] !== 0) {\n maskHasContent = true\n break\n }\n }\n\n // paste mask data into alpha channel\n const backupData = backupCtx.getImageData(\n 0,\n 0,\n backupCanvas.width,\n backupCanvas.height\n )\n\n let backupHasContent = false\n for (let i = 0; i < backupData.data.length; i += 4) {\n if (backupData.data[i + 3] !== 0) {\n backupHasContent = true\n break\n }\n }\n\n if (maskHasContent && !backupHasContent) {\n console.error('Mask appears to be empty')\n alert('Cannot save empty mask')\n return\n }\n\n // refine mask image\n for (let i = 0; i < backupData.data.length; i += 4) {\n const alpha = backupData.data[i + 3]\n backupData.data[i] = 0\n backupData.data[i + 1] = 0\n backupData.data[i + 2] = 0\n backupData.data[i + 3] = 255 - alpha\n }\n\n backupCtx.globalCompositeOperation = CompositionOperation.SourceOver\n backupCtx.putImageData(backupData, 0, 0)\n\n const formData = new FormData()\n const filename = 'clipspace-mask-' + performance.now() + '.png'\n\n const item = {\n filename: filename,\n subfolder: 'clipspace',\n type: 'input'\n }\n\n if (ComfyApp?.clipspace?.widgets?.length) {\n const index = ComfyApp.clipspace.widgets.findIndex(\n (obj) => obj?.name === 'image'\n )\n\n if (index >= 0 && item !== undefined) {\n try {\n ComfyApp.clipspace.widgets[index].value = item\n } catch (err) {\n console.warn('Failed to set widget value:', err)\n }\n }\n }\n\n const dataURL = backupCanvas.toDataURL()\n const blob = this.dataURLToBlob(dataURL)\n\n let original_url = new URL(image.src)\n\n type Ref = { filename: string; subfolder?: string; type?: string }\n\n this.uiManager.setBrushOpacity(0)\n\n const filenameRef = original_url.searchParams.get('filename')\n if (!filenameRef) {\n throw new Error('filename parameter is required')\n }\n const original_ref: Ref = {\n filename: filenameRef\n }\n\n let original_subfolder = original_url.searchParams.get('subfolder')\n if (original_subfolder) original_ref.subfolder = original_subfolder\n\n let original_type = original_url.searchParams.get('type')\n if (original_type) original_ref.type = original_type\n\n formData.append('image', blob, filename)\n formData.append('original_ref', JSON.stringify(original_ref))\n formData.append('type', 'input')\n formData.append('subfolder', 'clipspace')\n\n this.uiManager.setSaveButtonText('Saving')\n this.uiManager.setSaveButtonEnabled(false)\n this.keyboardManager.removeListeners()\n\n // Retry mechanism\n const maxRetries = 3\n let attempt = 0\n let success = false\n\n while (attempt < maxRetries && !success) {\n try {\n await this.uploadMask(item, formData)\n success = true\n } catch (error) {\n console.error(`Upload attempt ${attempt + 1} failed:`, error)\n attempt++\n if (attempt < maxRetries) {\n console.log('Retrying upload...')\n } else {\n console.log('Max retries reached. Upload failed.')\n }\n }\n }\n\n if (success) {\n ComfyApp.onClipspaceEditorSave()\n this.close()\n this.isOpen = false\n } else {\n this.uiManager.setSaveButtonText('Save')\n this.uiManager.setSaveButtonEnabled(true)\n this.keyboardManager.addListeners()\n }\n }\n\n getMessageBroker() {\n return this.messageBroker\n }\n\n // Helper function to convert a data URL to a Blob object\n private dataURLToBlob(dataURL: string) {\n const parts = dataURL.split(';base64,')\n const contentType = parts[0].split(':')[1]\n const byteString = atob(parts[1])\n const arrayBuffer = new ArrayBuffer(byteString.length)\n const uint8Array = new Uint8Array(arrayBuffer)\n for (let i = 0; i < byteString.length; i++) {\n uint8Array[i] = byteString.charCodeAt(i)\n }\n return new Blob([arrayBuffer], { type: contentType })\n }\n\n private async uploadMask(\n filepath: { filename: string; subfolder: string; type: string },\n formData: FormData,\n retries = 3\n ) {\n if (retries <= 0) {\n throw new Error('Max retries reached')\n return\n }\n await api\n .fetchApi('/upload/mask', {\n method: 'POST',\n body: formData\n })\n .then((response) => {\n if (!response.ok) {\n console.log('Failed to upload mask:', response)\n this.uploadMask(filepath, formData, retries - 1)\n }\n })\n .catch((error) => {\n console.error('Error:', error)\n })\n\n try {\n const selectedIndex = ComfyApp.clipspace?.selectedIndex\n if (ComfyApp.clipspace?.imgs && selectedIndex !== undefined) {\n // Create and set new image\n const newImage = new Image()\n newImage.src = api.apiURL(\n '/view?' +\n new URLSearchParams(filepath).toString() +\n app.getPreviewFormatParam() +\n app.getRandParam()\n )\n ComfyApp.clipspace.imgs[selectedIndex] = newImage\n\n // Update images array if it exists\n if (ComfyApp.clipspace.images) {\n ComfyApp.clipspace.images[selectedIndex] = filepath\n }\n }\n } catch (err) {\n console.warn('Failed to update clipspace image:', err)\n }\n ClipspaceDialog.invalidatePreview()\n }\n}\n\nclass CanvasHistory {\n private maskEditor!: MaskEditorDialog\n private messageBroker!: MessageBroker\n\n private canvas!: HTMLCanvasElement\n private ctx!: CanvasRenderingContext2D\n private states: ImageData[] = []\n private currentStateIndex: number = -1\n private maxStates: number = 20\n private initialized: boolean = false\n\n constructor(maskEditor: MaskEditorDialog, maxStates = 20) {\n this.maskEditor = maskEditor\n this.messageBroker = maskEditor.getMessageBroker()\n this.maxStates = maxStates\n this.createListeners()\n }\n\n private async pullCanvas() {\n this.canvas = await this.messageBroker.pull('maskCanvas')\n this.ctx = await this.messageBroker.pull('maskCtx')\n }\n\n private createListeners() {\n this.messageBroker.subscribe('saveState', () => this.saveState())\n this.messageBroker.subscribe('undo', () => this.undo())\n this.messageBroker.subscribe('redo', () => this.redo())\n }\n\n clearStates() {\n this.states = []\n this.currentStateIndex = -1\n this.initialized = false\n }\n\n async saveInitialState() {\n await this.pullCanvas()\n if (!this.canvas.width || !this.canvas.height) {\n // Canvas not ready yet, defer initialization\n requestAnimationFrame(() => this.saveInitialState())\n return\n }\n\n this.clearStates()\n const state = this.ctx.getImageData(\n 0,\n 0,\n this.canvas.width,\n this.canvas.height\n )\n\n this.states.push(state)\n this.currentStateIndex = 0\n this.initialized = true\n }\n\n saveState() {\n // Ensure we have an initial state\n if (!this.initialized || this.currentStateIndex === -1) {\n this.saveInitialState()\n return\n }\n\n this.states = this.states.slice(0, this.currentStateIndex + 1)\n const state = this.ctx.getImageData(\n 0,\n 0,\n this.canvas.width,\n this.canvas.height\n )\n this.states.push(state)\n this.currentStateIndex++\n\n if (this.states.length > this.maxStates) {\n this.states.shift()\n this.currentStateIndex--\n }\n }\n\n undo() {\n if (this.states.length > 1 && this.currentStateIndex > 0) {\n this.currentStateIndex--\n this.restoreState(this.states[this.currentStateIndex])\n } else {\n alert('No more undo states available')\n }\n }\n\n redo() {\n if (\n this.states.length > 1 &&\n this.currentStateIndex < this.states.length - 1\n ) {\n this.currentStateIndex++\n this.restoreState(this.states[this.currentStateIndex])\n } else {\n alert('No more redo states available')\n }\n }\n\n restoreState(state: ImageData) {\n if (state && this.initialized) {\n this.ctx.putImageData(state, 0, 0)\n }\n }\n}\n\nclass PaintBucketTool {\n maskEditor: MaskEditorDialog\n messageBroker: MessageBroker\n\n private canvas!: HTMLCanvasElement\n private ctx!: CanvasRenderingContext2D\n private width: number | null = null\n private height: number | null = null\n private imageData: ImageData | null = null\n private data: Uint8ClampedArray | null = null\n private tolerance: number = 5\n\n constructor(maskEditor: MaskEditorDialog) {\n this.maskEditor = maskEditor\n this.messageBroker = maskEditor.getMessageBroker()\n this.createListeners()\n this.addPullTopics()\n }\n\n initPaintBucketTool() {\n this.pullCanvas()\n }\n\n private async pullCanvas() {\n this.canvas = await this.messageBroker.pull('maskCanvas')\n this.ctx = await this.messageBroker.pull('maskCtx')\n }\n\n private createListeners() {\n this.messageBroker.subscribe(\n 'setPaintBucketTolerance',\n (tolerance: number) => this.setTolerance(tolerance)\n )\n\n this.messageBroker.subscribe('paintBucketFill', (point: Point) =>\n this.floodFill(point)\n )\n\n this.messageBroker.subscribe('invert', () => this.invertMask())\n }\n\n private addPullTopics() {\n this.messageBroker.createPullTopic(\n 'getTolerance',\n async () => this.tolerance\n )\n }\n\n private getPixel(x: number, y: number): number {\n return this.data![(y * this.width! + x) * 4 + 3]\n }\n\n private setPixel(\n x: number,\n y: number,\n alpha: number,\n color: { r: number; g: number; b: number }\n ): void {\n const index = (y * this.width! + x) * 4\n this.data![index] = color.r // R\n this.data![index + 1] = color.g // G\n this.data![index + 2] = color.b // B\n this.data![index + 3] = alpha // A\n }\n\n private shouldProcessPixel(\n currentAlpha: number,\n targetAlpha: number,\n tolerance: number,\n isFillMode: boolean\n ): boolean {\n if (currentAlpha === -1) return false\n\n if (isFillMode) {\n // Fill mode: process pixels that are empty/similar to target\n return (\n currentAlpha !== 255 &&\n Math.abs(currentAlpha - targetAlpha) <= tolerance\n )\n } else {\n // Erase mode: process pixels that are filled/similar to target\n return (\n currentAlpha === 255 ||\n Math.abs(currentAlpha - targetAlpha) <= tolerance\n )\n }\n }\n\n private async floodFill(point: Point): Promise {\n let startX = Math.floor(point.x)\n let startY = Math.floor(point.y)\n this.width = this.canvas.width\n this.height = this.canvas.height\n\n if (\n startX < 0 ||\n startX >= this.width ||\n startY < 0 ||\n startY >= this.height\n ) {\n return\n }\n\n this.imageData = this.ctx.getImageData(0, 0, this.width, this.height)\n this.data = this.imageData.data\n\n const targetAlpha = this.getPixel(startX, startY)\n const isFillMode = targetAlpha !== 255 // Determine mode based on clicked pixel\n\n if (targetAlpha === -1) return\n\n const maskColor = await this.messageBroker.pull('getMaskColor')\n const stack: Array<[number, number]> = []\n const visited = new Uint8Array(this.width * this.height)\n\n if (\n this.shouldProcessPixel(\n targetAlpha,\n targetAlpha,\n this.tolerance,\n isFillMode\n )\n ) {\n stack.push([startX, startY])\n }\n\n while (stack.length > 0) {\n const [x, y] = stack.pop()!\n const visitedIndex = y * this.width + x\n\n if (visited[visitedIndex]) continue\n\n const currentAlpha = this.getPixel(x, y)\n if (\n !this.shouldProcessPixel(\n currentAlpha,\n targetAlpha,\n this.tolerance,\n isFillMode\n )\n ) {\n continue\n }\n\n visited[visitedIndex] = 1\n // Set alpha to 255 for fill mode, 0 for erase mode\n this.setPixel(x, y, isFillMode ? 255 : 0, maskColor)\n\n // Check neighbors\n const checkNeighbor = (nx: number, ny: number) => {\n if (nx < 0 || nx >= this.width! || ny < 0 || ny >= this.height!) return\n if (!visited[ny * this.width! + nx]) {\n const alpha = this.getPixel(nx, ny)\n if (\n this.shouldProcessPixel(\n alpha,\n targetAlpha,\n this.tolerance,\n isFillMode\n )\n ) {\n stack.push([nx, ny])\n }\n }\n }\n\n checkNeighbor(x - 1, y) // Left\n checkNeighbor(x + 1, y) // Right\n checkNeighbor(x, y - 1) // Up\n checkNeighbor(x, y + 1) // Down\n }\n\n this.ctx.putImageData(this.imageData, 0, 0)\n this.imageData = null\n this.data = null\n }\n\n setTolerance(tolerance: number): void {\n this.tolerance = tolerance\n }\n\n getTolerance(): number {\n return this.tolerance\n }\n\n //invert mask\n\n private invertMask() {\n const imageData = this.ctx.getImageData(\n 0,\n 0,\n this.canvas.width,\n this.canvas.height\n )\n const data = imageData.data\n\n // Find first non-transparent pixel to get mask color\n let maskR = 0,\n maskG = 0,\n maskB = 0\n for (let i = 0; i < data.length; i += 4) {\n if (data[i + 3] > 0) {\n maskR = data[i]\n maskG = data[i + 1]\n maskB = data[i + 2]\n break\n }\n }\n\n // Process each pixel\n for (let i = 0; i < data.length; i += 4) {\n const alpha = data[i + 3]\n // Invert alpha channel (0 becomes 255, 255 becomes 0)\n data[i + 3] = 255 - alpha\n\n // If this was originally transparent (now opaque), fill with mask color\n if (alpha === 0) {\n data[i] = maskR\n data[i + 1] = maskG\n data[i + 2] = maskB\n }\n }\n\n this.ctx.putImageData(imageData, 0, 0)\n this.messageBroker.publish('saveState')\n }\n}\n\nclass ColorSelectTool {\n private maskEditor!: MaskEditorDialog\n private messageBroker!: MessageBroker\n private width: number | null = null\n private height: number | null = null\n private canvas!: HTMLCanvasElement\n private maskCTX!: CanvasRenderingContext2D\n private imageCTX!: CanvasRenderingContext2D\n private maskData: Uint8ClampedArray | null = null\n private imageData: Uint8ClampedArray | null = null\n private tolerance: number = 20\n private livePreview: boolean = false\n private lastPoint: Point | null = null\n private colorComparisonMethod: ColorComparisonMethod =\n ColorComparisonMethod.Simple\n private applyWholeImage: boolean = false\n private maskBoundry: boolean = false\n private maskTolerance: number = 0\n\n constructor(maskEditor: MaskEditorDialog) {\n this.maskEditor = maskEditor\n this.messageBroker = maskEditor.getMessageBroker()\n this.createListeners()\n this.addPullTopics()\n }\n\n async initColorSelectTool() {\n await this.pullCanvas()\n }\n\n private async pullCanvas() {\n this.canvas = await this.messageBroker.pull('imgCanvas')\n this.maskCTX = await this.messageBroker.pull('maskCtx')\n this.imageCTX = await this.messageBroker.pull('imageCtx')\n }\n\n private createListeners() {\n this.messageBroker.subscribe('colorSelectFill', (point: Point) =>\n this.fillColorSelection(point)\n )\n this.messageBroker.subscribe(\n 'setColorSelectTolerance',\n (tolerance: number) => this.setTolerance(tolerance)\n )\n this.messageBroker.subscribe('setLivePreview', (livePreview: boolean) =>\n this.setLivePreview(livePreview)\n )\n this.messageBroker.subscribe(\n 'setColorComparisonMethod',\n (method: ColorComparisonMethod) => this.setComparisonMethod(method)\n )\n\n this.messageBroker.subscribe('clearLastPoint', () => this.clearLastPoint())\n\n this.messageBroker.subscribe('setWholeImage', (applyWholeImage: boolean) =>\n this.setApplyWholeImage(applyWholeImage)\n )\n\n this.messageBroker.subscribe('setMaskBoundary', (maskBoundry: boolean) =>\n this.setMaskBoundary(maskBoundry)\n )\n\n this.messageBroker.subscribe('setMaskTolerance', (maskTolerance: number) =>\n this.setMaskTolerance(maskTolerance)\n )\n }\n\n private async addPullTopics() {\n this.messageBroker.createPullTopic(\n 'getLivePreview',\n async () => this.livePreview\n )\n }\n\n private getPixel(x: number, y: number): { r: number; g: number; b: number } {\n const index = (y * this.width! + x) * 4\n return {\n r: this.imageData![index],\n g: this.imageData![index + 1],\n b: this.imageData![index + 2]\n }\n }\n\n private getMaskAlpha(x: number, y: number): number {\n return this.maskData![(y * this.width! + x) * 4 + 3]\n }\n\n private isPixelInRange(\n pixel: { r: number; g: number; b: number },\n target: { r: number; g: number; b: number }\n ): boolean {\n switch (this.colorComparisonMethod) {\n case ColorComparisonMethod.Simple:\n return this.isPixelInRangeSimple(pixel, target)\n case ColorComparisonMethod.HSL:\n return this.isPixelInRangeHSL(pixel, target)\n case ColorComparisonMethod.LAB:\n return this.isPixelInRangeLab(pixel, target)\n default:\n return this.isPixelInRangeSimple(pixel, target)\n }\n }\n\n private isPixelInRangeSimple(\n pixel: { r: number; g: number; b: number },\n target: { r: number; g: number; b: number }\n ): boolean {\n //calculate the euclidean distance between the two colors\n const distance = Math.sqrt(\n Math.pow(pixel.r - target.r, 2) +\n Math.pow(pixel.g - target.g, 2) +\n Math.pow(pixel.b - target.b, 2)\n )\n return distance <= this.tolerance\n }\n\n private isPixelInRangeHSL(\n pixel: { r: number; g: number; b: number },\n target: { r: number; g: number; b: number }\n ): boolean {\n // Convert RGB to HSL\n const pixelHSL = this.rgbToHSL(pixel.r, pixel.g, pixel.b)\n const targetHSL = this.rgbToHSL(target.r, target.g, target.b)\n\n // Compare mainly hue and saturation, be more lenient with lightness\n const hueDiff = Math.abs(pixelHSL.h - targetHSL.h)\n const satDiff = Math.abs(pixelHSL.s - targetHSL.s)\n const lightDiff = Math.abs(pixelHSL.l - targetHSL.l)\n\n const distance = Math.sqrt(\n Math.pow((hueDiff / 360) * 255, 2) +\n Math.pow((satDiff / 100) * 255, 2) +\n Math.pow((lightDiff / 100) * 255, 2)\n )\n return distance <= this.tolerance\n }\n\n private rgbToHSL(\n r: number,\n g: number,\n b: number\n ): { h: number; s: number; l: number } {\n r /= 255\n g /= 255\n b /= 255\n\n const max = Math.max(r, g, b)\n const min = Math.min(r, g, b)\n let h = 0,\n s = 0,\n l = (max + min) / 2\n\n if (max !== min) {\n const d = max - min\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min)\n\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0)\n break\n case g:\n h = (b - r) / d + 2\n break\n case b:\n h = (r - g) / d + 4\n break\n }\n h /= 6\n }\n\n return {\n h: h * 360,\n s: s * 100,\n l: l * 100\n }\n }\n\n private isPixelInRangeLab(\n pixel: { r: number; g: number; b: number },\n target: { r: number; g: number; b: number }\n ): boolean {\n const pixelLab = this.rgbToLab(pixel)\n const targetLab = this.rgbToLab(target)\n\n // Calculate Delta E (CIE76 formula)\n const deltaE = Math.sqrt(\n Math.pow(pixelLab.l - targetLab.l, 2) +\n Math.pow(pixelLab.a - targetLab.a, 2) +\n Math.pow(pixelLab.b - targetLab.b, 2)\n )\n\n const normalizedDeltaE = (deltaE / 100) * 255\n return normalizedDeltaE <= this.tolerance\n }\n\n private rgbToLab(rgb: { r: number; g: number; b: number }): {\n l: number\n a: number\n b: number\n } {\n // First convert RGB to XYZ\n let r = rgb.r / 255\n let g = rgb.g / 255\n let b = rgb.b / 255\n\n r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92\n g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92\n b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92\n\n r *= 100\n g *= 100\n b *= 100\n\n const x = r * 0.4124 + g * 0.3576 + b * 0.1805\n const y = r * 0.2126 + g * 0.7152 + b * 0.0722\n const z = r * 0.0193 + g * 0.1192 + b * 0.9505\n\n // Then XYZ to Lab\n const xn = 95.047\n const yn = 100.0\n const zn = 108.883\n\n const xyz = [x / xn, y / yn, z / zn]\n for (let i = 0; i < xyz.length; i++) {\n xyz[i] =\n xyz[i] > 0.008856 ? Math.pow(xyz[i], 1 / 3) : 7.787 * xyz[i] + 16 / 116\n }\n\n return {\n l: 116 * xyz[1] - 16,\n a: 500 * (xyz[0] - xyz[1]),\n b: 200 * (xyz[1] - xyz[2])\n }\n }\n\n private setPixel(\n x: number,\n y: number,\n alpha: number,\n color: { r: number; g: number; b: number }\n ): void {\n const index = (y * this.width! + x) * 4\n this.maskData![index] = color.r // R\n this.maskData![index + 1] = color.g // G\n this.maskData![index + 2] = color.b // B\n this.maskData![index + 3] = alpha // A\n }\n\n async fillColorSelection(point: Point) {\n this.width = this.canvas.width\n this.height = this.canvas.height\n this.lastPoint = point\n\n // Get image data\n const maskData = this.maskCTX.getImageData(0, 0, this.width, this.height)\n this.maskData = maskData.data\n this.imageData = this.imageCTX.getImageData(\n 0,\n 0,\n this.width,\n this.height\n ).data\n\n if (this.applyWholeImage) {\n // Process entire image\n const targetPixel = this.getPixel(\n Math.floor(point.x),\n Math.floor(point.y)\n )\n const maskColor = await this.messageBroker.pull('getMaskColor')\n\n // Use TypedArrays for better performance\n const width = this.width!\n const height = this.height!\n\n // Process in chunks for better performance\n const CHUNK_SIZE = 10000\n for (let i = 0; i < width * height; i += CHUNK_SIZE) {\n const endIndex = Math.min(i + CHUNK_SIZE, width * height)\n for (let pixelIndex = i; pixelIndex < endIndex; pixelIndex++) {\n const x = pixelIndex % width\n const y = Math.floor(pixelIndex / width)\n if (this.isPixelInRange(this.getPixel(x, y), targetPixel)) {\n this.setPixel(x, y, 255, maskColor)\n }\n }\n // Allow UI updates between chunks\n await new Promise((resolve) => setTimeout(resolve, 0))\n }\n } else {\n // Original flood fill logic\n let startX = Math.floor(point.x)\n let startY = Math.floor(point.y)\n\n if (\n startX < 0 ||\n startX >= this.width ||\n startY < 0 ||\n startY >= this.height\n ) {\n return\n }\n\n const pixel = this.getPixel(startX, startY)\n\n const stack: Array<[number, number]> = []\n const visited = new Uint8Array(this.width * this.height)\n\n stack.push([startX, startY])\n const maskColor = await this.messageBroker.pull('getMaskColor')\n\n while (stack.length > 0) {\n const [x, y] = stack.pop()!\n const visitedIndex = y * this.width + x\n\n if (\n visited[visitedIndex] ||\n !this.isPixelInRange(this.getPixel(x, y), pixel)\n ) {\n continue\n }\n\n visited[visitedIndex] = 1\n this.setPixel(x, y, 255, maskColor)\n\n // Inline direction checks for better performance\n if (\n x > 0 &&\n !visited[y * this.width + (x - 1)] &&\n this.isPixelInRange(this.getPixel(x - 1, y), pixel)\n ) {\n if (\n !this.maskBoundry ||\n 255 - this.getMaskAlpha(x - 1, y) > this.maskTolerance\n ) {\n stack.push([x - 1, y])\n }\n }\n if (\n x < this.width - 1 &&\n !visited[y * this.width + (x + 1)] &&\n this.isPixelInRange(this.getPixel(x + 1, y), pixel)\n ) {\n if (\n !this.maskBoundry ||\n 255 - this.getMaskAlpha(x + 1, y) > this.maskTolerance\n ) {\n stack.push([x + 1, y])\n }\n }\n if (\n y > 0 &&\n !visited[(y - 1) * this.width + x] &&\n this.isPixelInRange(this.getPixel(x, y - 1), pixel)\n ) {\n if (\n !this.maskBoundry ||\n 255 - this.getMaskAlpha(x, y - 1) > this.maskTolerance\n ) {\n stack.push([x, y - 1])\n }\n }\n if (\n y < this.height - 1 &&\n !visited[(y + 1) * this.width + x] &&\n this.isPixelInRange(this.getPixel(x, y + 1), pixel)\n ) {\n if (\n !this.maskBoundry ||\n 255 - this.getMaskAlpha(x, y + 1) > this.maskTolerance\n ) {\n stack.push([x, y + 1])\n }\n }\n }\n }\n\n this.maskCTX.putImageData(maskData, 0, 0)\n this.messageBroker.publish('saveState')\n this.maskData = null\n this.imageData = null\n }\n setTolerance(tolerance: number): void {\n this.tolerance = tolerance\n\n if (this.lastPoint && this.livePreview) {\n this.messageBroker.publish('undo')\n this.fillColorSelection(this.lastPoint)\n }\n }\n\n setLivePreview(livePreview: boolean): void {\n this.livePreview = livePreview\n }\n\n setComparisonMethod(method: ColorComparisonMethod): void {\n this.colorComparisonMethod = method\n\n if (this.lastPoint && this.livePreview) {\n this.messageBroker.publish('undo')\n this.fillColorSelection(this.lastPoint)\n }\n }\n\n clearLastPoint() {\n this.lastPoint = null\n }\n\n setApplyWholeImage(applyWholeImage: boolean): void {\n this.applyWholeImage = applyWholeImage\n }\n\n setMaskBoundary(maskBoundry: boolean): void {\n this.maskBoundry = maskBoundry\n }\n\n setMaskTolerance(maskTolerance: number): void {\n this.maskTolerance = maskTolerance\n }\n}\n\nclass BrushTool {\n brushSettings: Brush //this saves the current brush settings\n maskBlendMode: MaskBlendMode\n\n isDrawing: boolean = false\n isDrawingLine: boolean = false\n lineStartPoint: Point | null = null\n smoothingPrecision: number = 10\n smoothingCordsArray: Point[] = []\n smoothingLastDrawTime!: Date\n maskCtx: CanvasRenderingContext2D | null = null\n initialDraw: boolean = true\n\n brushStrokeCanvas: HTMLCanvasElement | null = null\n brushStrokeCtx: CanvasRenderingContext2D | null = null\n\n //brush adjustment\n isBrushAdjusting: boolean = false\n brushPreviewGradient: HTMLElement | null = null\n initialPoint: Point | null = null\n useDominantAxis: boolean = false\n brushAdjustmentSpeed: number = 1.0\n\n maskEditor: MaskEditorDialog\n messageBroker: MessageBroker\n\n constructor(maskEditor: MaskEditorDialog) {\n this.maskEditor = maskEditor\n this.messageBroker = maskEditor.getMessageBroker()\n this.createListeners()\n this.addPullTopics()\n\n this.useDominantAxis = app.extensionManager.setting.get(\n 'Comfy.MaskEditor.UseDominantAxis'\n )\n this.brushAdjustmentSpeed = app.extensionManager.setting.get(\n 'Comfy.MaskEditor.BrushAdjustmentSpeed'\n )\n\n const cachedBrushSettings = loadBrushFromCache('maskeditor_brush_settings')\n if (cachedBrushSettings) {\n this.brushSettings = cachedBrushSettings\n } else {\n this.brushSettings = {\n type: BrushShape.Arc,\n size: 10,\n opacity: 0.7,\n hardness: 1,\n smoothingPrecision: 10\n }\n }\n\n this.maskBlendMode = MaskBlendMode.Black\n }\n\n private createListeners() {\n //setters\n this.messageBroker.subscribe('setBrushSize', (size: number) =>\n this.setBrushSize(size)\n )\n this.messageBroker.subscribe('setBrushOpacity', (opacity: number) =>\n this.setBrushOpacity(opacity)\n )\n this.messageBroker.subscribe('setBrushHardness', (hardness: number) =>\n this.setBrushHardness(hardness)\n )\n this.messageBroker.subscribe('setBrushShape', (type: BrushShape) =>\n this.setBrushType(type)\n )\n this.messageBroker.subscribe(\n 'setBrushSmoothingPrecision',\n (precision: number) => this.setBrushSmoothingPrecision(precision)\n )\n //brush adjustment\n this.messageBroker.subscribe(\n 'brushAdjustmentStart',\n (event: PointerEvent) => this.startBrushAdjustment(event)\n )\n this.messageBroker.subscribe('brushAdjustment', (event: PointerEvent) =>\n this.handleBrushAdjustment(event)\n )\n //drawing\n this.messageBroker.subscribe('drawStart', (event: PointerEvent) =>\n this.startDrawing(event)\n )\n this.messageBroker.subscribe('draw', (event: PointerEvent) =>\n this.handleDrawing(event)\n )\n this.messageBroker.subscribe('drawEnd', (event: PointerEvent) =>\n this.drawEnd(event)\n )\n }\n\n private addPullTopics() {\n this.messageBroker.createPullTopic(\n 'brushSize',\n async () => this.brushSettings.size\n )\n this.messageBroker.createPullTopic(\n 'brushOpacity',\n async () => this.brushSettings.opacity\n )\n this.messageBroker.createPullTopic(\n 'brushHardness',\n async () => this.brushSettings.hardness\n )\n this.messageBroker.createPullTopic(\n 'brushType',\n async () => this.brushSettings.type\n )\n this.messageBroker.createPullTopic(\n 'brushSmoothingPrecision',\n async () => this.brushSettings.smoothingPrecision\n )\n this.messageBroker.createPullTopic(\n 'maskBlendMode',\n async () => this.maskBlendMode\n )\n this.messageBroker.createPullTopic(\n 'brushSettings',\n async () => this.brushSettings\n )\n }\n\n private async createBrushStrokeCanvas() {\n if (this.brushStrokeCanvas !== null) {\n return\n }\n\n const maskCanvas = await this.messageBroker.pull('maskCanvas')\n const canvas = document.createElement('canvas')\n canvas.width = maskCanvas.width\n canvas.height = maskCanvas.height\n\n this.brushStrokeCanvas = canvas\n this.brushStrokeCtx = canvas.getContext('2d')!\n }\n\n private async startDrawing(event: PointerEvent) {\n this.isDrawing = true\n let compositionOp: CompositionOperation\n let currentTool = await this.messageBroker.pull('currentTool')\n let coords = { x: event.offsetX, y: event.offsetY }\n let coords_canvas = await this.messageBroker.pull('screenToCanvas', coords)\n await this.createBrushStrokeCanvas()\n\n //set drawing mode\n if (currentTool === Tools.Eraser || event.buttons == 2) {\n compositionOp = CompositionOperation.DestinationOut //eraser\n } else {\n compositionOp = CompositionOperation.SourceOver //pen\n }\n\n //check if user wants to draw line or free draw\n if (event.shiftKey && this.lineStartPoint) {\n this.isDrawingLine = true\n this.drawLine(this.lineStartPoint, coords_canvas, compositionOp)\n } else {\n this.isDrawingLine = false\n this.init_shape(compositionOp)\n this.draw_shape(coords_canvas)\n }\n this.lineStartPoint = coords_canvas\n this.smoothingCordsArray = [coords_canvas] //used to smooth the drawing line\n this.smoothingLastDrawTime = new Date()\n }\n\n private async handleDrawing(event: PointerEvent) {\n var diff = performance.now() - this.smoothingLastDrawTime.getTime()\n let coords = { x: event.offsetX, y: event.offsetY }\n let coords_canvas = await this.messageBroker.pull('screenToCanvas', coords)\n let currentTool = await this.messageBroker.pull('currentTool')\n\n if (diff > 20 && !this.isDrawing)\n requestAnimationFrame(() => {\n this.init_shape(CompositionOperation.SourceOver)\n this.draw_shape(coords_canvas)\n this.smoothingCordsArray.push(coords_canvas)\n })\n else\n requestAnimationFrame(() => {\n if (currentTool === Tools.Eraser || event.buttons == 2) {\n this.init_shape(CompositionOperation.DestinationOut)\n } else {\n this.init_shape(CompositionOperation.SourceOver)\n }\n\n //use drawWithSmoothing for better performance or change step in drawWithBetterSmoothing\n this.drawWithBetterSmoothing(coords_canvas)\n })\n\n this.smoothingLastDrawTime = new Date()\n }\n\n private async drawEnd(event: PointerEvent) {\n const coords = { x: event.offsetX, y: event.offsetY }\n const coords_canvas = await this.messageBroker.pull(\n 'screenToCanvas',\n coords\n )\n\n if (this.isDrawing) {\n this.isDrawing = false\n this.messageBroker.publish('saveState')\n this.lineStartPoint = coords_canvas\n this.initialDraw = true\n }\n }\n\n private drawWithBetterSmoothing(point: Point) {\n // Add current point to the smoothing array\n if (!this.smoothingCordsArray) {\n this.smoothingCordsArray = []\n }\n const opacityConstant = 1 / (1 + Math.exp(3))\n const interpolatedOpacity =\n 1 / (1 + Math.exp(-6 * (this.brushSettings.opacity - 0.5))) -\n opacityConstant\n\n this.smoothingCordsArray.push(point)\n\n // Keep a moving window of points for the spline\n const POINTS_NR = 5\n if (this.smoothingCordsArray.length < POINTS_NR) {\n return\n }\n\n // Calculate total length more efficiently\n let totalLength = 0\n const points = this.smoothingCordsArray\n const len = points.length - 1\n\n // Use local variables for better performance\n let dx, dy\n for (let i = 0; i < len; i++) {\n dx = points[i + 1].x - points[i].x\n dy = points[i + 1].y - points[i].y\n totalLength += Math.sqrt(dx * dx + dy * dy)\n }\n\n const distanceBetweenPoints =\n (this.brushSettings.size / this.brushSettings.smoothingPrecision) * 6\n const stepNr = Math.ceil(totalLength / distanceBetweenPoints)\n\n let interpolatedPoints = points\n\n if (stepNr > 0) {\n //this calculation needs to be improved\n interpolatedPoints = this.generateEquidistantPoints(\n this.smoothingCordsArray,\n distanceBetweenPoints // Distance between interpolated points\n )\n }\n\n if (!this.initialDraw) {\n // Remove the first 3 points from the array to avoid drawing the same points twice\n const spliceIndex = interpolatedPoints.findIndex(\n (point) =>\n point.x === this.smoothingCordsArray[2].x &&\n point.y === this.smoothingCordsArray[2].y\n )\n\n if (spliceIndex !== -1) {\n interpolatedPoints = interpolatedPoints.slice(spliceIndex + 1)\n }\n }\n\n // Draw all interpolated points\n for (const point of interpolatedPoints) {\n this.draw_shape(point, interpolatedOpacity)\n }\n\n if (!this.initialDraw) {\n // initially draw on all 5 points, then remove the first 3 points to go into 2 new, 3 old points cycle\n this.smoothingCordsArray = this.smoothingCordsArray.slice(2)\n } else {\n this.initialDraw = false\n }\n }\n\n private async drawLine(\n p1: Point,\n p2: Point,\n compositionOp: CompositionOperation\n ) {\n const brush_size = await this.messageBroker.pull('brushSize')\n const distance = Math.sqrt((p2.x - p1.x) ** 2 + (p2.y - p1.y) ** 2)\n const steps = Math.ceil(\n distance / ((brush_size / this.brushSettings.smoothingPrecision) * 4)\n ) // Adjust for smoother lines\n const interpolatedOpacity =\n 1 / (1 + Math.exp(-6 * (this.brushSettings.opacity - 0.5))) -\n 1 / (1 + Math.exp(3))\n this.init_shape(compositionOp)\n\n for (let i = 0; i <= steps; i++) {\n const t = i / steps\n const x = p1.x + (p2.x - p1.x) * t\n const y = p1.y + (p2.y - p1.y) * t\n const point = { x: x, y: y }\n this.draw_shape(point, interpolatedOpacity)\n }\n }\n\n //brush adjustment\n\n private async startBrushAdjustment(event: PointerEvent) {\n event.preventDefault()\n const coords = { x: event.offsetX, y: event.offsetY }\n let coords_canvas = await this.messageBroker.pull('screenToCanvas', coords)\n this.messageBroker.publish('setBrushPreviewGradientVisibility', true)\n this.initialPoint = coords_canvas\n this.isBrushAdjusting = true\n return\n }\n\n private async handleBrushAdjustment(event: PointerEvent) {\n const coords = { x: event.offsetX, y: event.offsetY }\n const brushDeadZone = 5\n let coords_canvas = await this.messageBroker.pull('screenToCanvas', coords)\n\n const delta_x = coords_canvas.x - this.initialPoint!.x\n const delta_y = coords_canvas.y - this.initialPoint!.y\n\n const effectiveDeltaX = Math.abs(delta_x) < brushDeadZone ? 0 : delta_x\n const effectiveDeltaY = Math.abs(delta_y) < brushDeadZone ? 0 : delta_y\n\n // New dominant axis logic\n let finalDeltaX = effectiveDeltaX\n let finalDeltaY = effectiveDeltaY\n\n console.log(this.useDominantAxis)\n\n if (this.useDominantAxis) {\n // New setting flag\n const ratio = Math.abs(effectiveDeltaX) / Math.abs(effectiveDeltaY)\n const threshold = 2.0 // Configurable threshold\n\n if (ratio > threshold) {\n finalDeltaY = 0 // X is dominant\n } else if (ratio < 1 / threshold) {\n finalDeltaX = 0 // Y is dominant\n }\n }\n\n const cappedDeltaX = Math.max(-100, Math.min(100, finalDeltaX))\n const cappedDeltaY = Math.max(-100, Math.min(100, finalDeltaY))\n\n // Rest of the function remains the same\n const sizeDelta = cappedDeltaX / 40\n const hardnessDelta = cappedDeltaY / 800\n\n const newSize = Math.max(\n 1,\n Math.min(\n 100,\n this.brushSettings.size! +\n (cappedDeltaX / 35) * this.brushAdjustmentSpeed\n )\n )\n\n const newHardness = Math.max(\n 0,\n Math.min(\n 1,\n this.brushSettings!.hardness -\n (cappedDeltaY / 4000) * this.brushAdjustmentSpeed\n )\n )\n\n this.brushSettings.size = newSize\n this.brushSettings.hardness = newHardness\n\n this.messageBroker.publish('updateBrushPreview')\n }\n\n //helper functions\n\n private async draw_shape(point: Point, overrideOpacity?: number) {\n const brushSettings: Brush = this.brushSettings\n const maskCtx = this.maskCtx || (await this.messageBroker.pull('maskCtx'))\n const brushType = await this.messageBroker.pull('brushType')\n const maskColor = await this.messageBroker.pull('getMaskColor')\n const size = brushSettings.size\n const sliderOpacity = brushSettings.opacity\n const opacity =\n overrideOpacity == undefined ? sliderOpacity : overrideOpacity\n const hardness = brushSettings.hardness\n\n const x = point.x\n const y = point.y\n\n // Extend the gradient radius beyond the brush size\n const extendedSize = size * (2 - hardness)\n\n let gradient = maskCtx.createRadialGradient(x, y, 0, x, y, extendedSize)\n\n const isErasing = maskCtx.globalCompositeOperation === 'destination-out'\n\n if (hardness === 1) {\n console.log(sliderOpacity, opacity)\n gradient.addColorStop(\n 0,\n isErasing\n ? `rgba(255, 255, 255, ${opacity})`\n : `rgba(${maskColor.r}, ${maskColor.g}, ${maskColor.b}, ${opacity})`\n )\n gradient.addColorStop(\n 1,\n isErasing\n ? `rgba(255, 255, 255, ${opacity})`\n : `rgba(${maskColor.r}, ${maskColor.g}, ${maskColor.b}, ${opacity})`\n )\n } else {\n let softness = 1 - hardness\n let innerStop = Math.max(0, hardness - softness)\n let outerStop = size / extendedSize\n\n if (isErasing) {\n gradient.addColorStop(0, `rgba(255, 255, 255, ${opacity})`)\n gradient.addColorStop(innerStop, `rgba(255, 255, 255, ${opacity})`)\n gradient.addColorStop(outerStop, `rgba(255, 255, 255, ${opacity / 2})`)\n gradient.addColorStop(1, `rgba(255, 255, 255, 0)`)\n } else {\n gradient.addColorStop(\n 0,\n `rgba(${maskColor.r}, ${maskColor.g}, ${maskColor.b}, ${opacity})`\n )\n gradient.addColorStop(\n innerStop,\n `rgba(${maskColor.r}, ${maskColor.g}, ${maskColor.b}, ${opacity})`\n )\n gradient.addColorStop(\n outerStop,\n `rgba(${maskColor.r}, ${maskColor.g}, ${maskColor.b}, ${opacity / 2})`\n )\n gradient.addColorStop(\n 1,\n `rgba(${maskColor.r}, ${maskColor.g}, ${maskColor.b}, 0)`\n )\n }\n }\n\n maskCtx.fillStyle = gradient\n maskCtx.beginPath()\n if (brushType === BrushShape.Rect) {\n maskCtx.rect(\n x - extendedSize,\n y - extendedSize,\n extendedSize * 2,\n extendedSize * 2\n )\n } else {\n maskCtx.arc(x, y, extendedSize, 0, Math.PI * 2, false)\n }\n maskCtx.fill()\n }\n\n private async init_shape(compositionOperation: CompositionOperation) {\n const maskBlendMode = await this.messageBroker.pull('maskBlendMode')\n const maskCtx = this.maskCtx || (await this.messageBroker.pull('maskCtx'))\n maskCtx.beginPath()\n if (compositionOperation == CompositionOperation.SourceOver) {\n maskCtx.fillStyle = maskBlendMode\n maskCtx.globalCompositeOperation = CompositionOperation.SourceOver\n } else if (compositionOperation == CompositionOperation.DestinationOut) {\n maskCtx.globalCompositeOperation = CompositionOperation.DestinationOut\n }\n }\n\n private calculateCubicSplinePoints(\n points: Point[],\n numSegments: number = 10\n ): Point[] {\n const result: Point[] = []\n\n const xCoords = points.map((p) => p.x)\n const yCoords = points.map((p) => p.y)\n\n const xDerivatives = this.calculateSplineCoefficients(xCoords)\n const yDerivatives = this.calculateSplineCoefficients(yCoords)\n\n // Generate points along the spline\n for (let i = 0; i < points.length - 1; i++) {\n const p0 = points[i]\n const p1 = points[i + 1]\n const d0x = xDerivatives[i]\n const d1x = xDerivatives[i + 1]\n const d0y = yDerivatives[i]\n const d1y = yDerivatives[i + 1]\n\n for (let t = 0; t <= numSegments; t++) {\n const t_normalized = t / numSegments\n\n // Hermite basis functions\n const h00 = 2 * t_normalized ** 3 - 3 * t_normalized ** 2 + 1\n const h10 = t_normalized ** 3 - 2 * t_normalized ** 2 + t_normalized\n const h01 = -2 * t_normalized ** 3 + 3 * t_normalized ** 2\n const h11 = t_normalized ** 3 - t_normalized ** 2\n\n const x = h00 * p0.x + h10 * d0x + h01 * p1.x + h11 * d1x\n const y = h00 * p0.y + h10 * d0y + h01 * p1.y + h11 * d1y\n\n result.push({ x, y })\n }\n }\n\n return result\n }\n\n private generateEvenlyDistributedPoints(\n splinePoints: Point[],\n numPoints: number\n ): Point[] {\n const distances: number[] = [0]\n for (let i = 1; i < splinePoints.length; i++) {\n const dx = splinePoints[i].x - splinePoints[i - 1].x\n const dy = splinePoints[i].y - splinePoints[i - 1].y\n const dist = Math.hypot(dx, dy)\n distances.push(distances[i - 1] + dist)\n }\n\n const totalLength = distances[distances.length - 1]\n const interval = totalLength / (numPoints - 1)\n const result: Point[] = []\n let currentIndex = 0\n\n for (let i = 0; i < numPoints; i++) {\n const targetDistance = i * interval\n\n while (\n currentIndex < distances.length - 1 &&\n distances[currentIndex + 1] < targetDistance\n ) {\n currentIndex++\n }\n\n const t =\n (targetDistance - distances[currentIndex]) /\n (distances[currentIndex + 1] - distances[currentIndex])\n\n const x =\n splinePoints[currentIndex].x +\n t * (splinePoints[currentIndex + 1].x - splinePoints[currentIndex].x)\n const y =\n splinePoints[currentIndex].y +\n t * (splinePoints[currentIndex + 1].y - splinePoints[currentIndex].y)\n\n result.push({ x, y })\n }\n\n return result\n }\n\n private generateEquidistantPoints(\n points: Point[],\n distance: number\n ): Point[] {\n const result: Point[] = []\n const cumulativeDistances: number[] = [0]\n\n // Calculate cumulative distances between points\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x\n const dy = points[i].y - points[i - 1].y\n const dist = Math.hypot(dx, dy)\n cumulativeDistances[i] = cumulativeDistances[i - 1] + dist\n }\n\n const totalLength = cumulativeDistances[cumulativeDistances.length - 1]\n const numPoints = Math.floor(totalLength / distance)\n\n for (let i = 0; i <= numPoints; i++) {\n const targetDistance = i * distance\n let idx = 0\n\n // Find the segment where the target distance falls\n while (\n idx < cumulativeDistances.length - 1 &&\n cumulativeDistances[idx + 1] < targetDistance\n ) {\n idx++\n }\n\n if (idx >= points.length - 1) {\n result.push(points[points.length - 1])\n continue\n }\n\n const d0 = cumulativeDistances[idx]\n const d1 = cumulativeDistances[idx + 1]\n const t = (targetDistance - d0) / (d1 - d0)\n\n const x = points[idx].x + t * (points[idx + 1].x - points[idx].x)\n const y = points[idx].y + t * (points[idx + 1].y - points[idx].y)\n\n result.push({ x, y })\n }\n\n return result\n }\n\n private calculateSplineCoefficients(values: number[]): number[] {\n const n = values.length - 1\n const matrix: number[][] = new Array(n + 1)\n .fill(0)\n .map(() => new Array(n + 1).fill(0))\n const rhs: number[] = new Array(n + 1).fill(0)\n\n // Set up tridiagonal matrix\n for (let i = 1; i < n; i++) {\n matrix[i][i - 1] = 1\n matrix[i][i] = 4\n matrix[i][i + 1] = 1\n rhs[i] = 3 * (values[i + 1] - values[i - 1])\n }\n\n // Set boundary conditions (natural spline)\n matrix[0][0] = 2\n matrix[0][1] = 1\n matrix[n][n - 1] = 1\n matrix[n][n] = 2\n rhs[0] = 3 * (values[1] - values[0])\n rhs[n] = 3 * (values[n] - values[n - 1])\n\n // Solve tridiagonal system using Thomas algorithm\n for (let i = 1; i <= n; i++) {\n const m = matrix[i][i - 1] / matrix[i - 1][i - 1]\n matrix[i][i] -= m * matrix[i - 1][i]\n rhs[i] -= m * rhs[i - 1]\n }\n\n const solution: number[] = new Array(n + 1)\n solution[n] = rhs[n] / matrix[n][n]\n for (let i = n - 1; i >= 0; i--) {\n solution[i] = (rhs[i] - matrix[i][i + 1] * solution[i + 1]) / matrix[i][i]\n }\n\n return solution\n }\n\n private setBrushSize(size: number) {\n this.brushSettings.size = size\n saveBrushToCache('maskeditor_brush_settings', this.brushSettings)\n }\n\n private setBrushOpacity(opacity: number) {\n this.brushSettings.opacity = opacity\n saveBrushToCache('maskeditor_brush_settings', this.brushSettings)\n }\n\n private setBrushHardness(hardness: number) {\n this.brushSettings.hardness = hardness\n saveBrushToCache('maskeditor_brush_settings', this.brushSettings)\n }\n\n private setBrushType(type: BrushShape) {\n this.brushSettings.type = type\n saveBrushToCache('maskeditor_brush_settings', this.brushSettings)\n }\n\n private setBrushSmoothingPrecision(precision: number) {\n this.brushSettings.smoothingPrecision = precision\n saveBrushToCache('maskeditor_brush_settings', this.brushSettings)\n }\n}\n\nclass UIManager {\n private rootElement: HTMLElement\n private brush!: HTMLDivElement\n private brushPreviewGradient!: HTMLDivElement\n private maskCtx!: CanvasRenderingContext2D\n private imageCtx!: CanvasRenderingContext2D\n private maskCanvas!: HTMLCanvasElement\n private imgCanvas!: HTMLCanvasElement\n private brushSettingsHTML!: HTMLDivElement\n private paintBucketSettingsHTML!: HTMLDivElement\n private colorSelectSettingsHTML!: HTMLDivElement\n private maskOpacitySlider!: HTMLInputElement\n private brushHardnessSlider!: HTMLInputElement\n private brushSizeSlider!: HTMLInputElement\n private brushOpacitySlider!: HTMLInputElement\n private sidebarImage!: HTMLImageElement\n private saveButton!: HTMLButtonElement\n private toolPanel!: HTMLDivElement\n private sidePanel!: HTMLDivElement\n private pointerZone!: HTMLDivElement\n private canvasBackground!: HTMLDivElement\n private canvasContainer!: HTMLDivElement\n private image!: HTMLImageElement\n private imageURL!: URL\n private darkMode: boolean = true\n\n private maskEditor: MaskEditorDialog\n private messageBroker: MessageBroker\n\n private mask_opacity: number = 1.0\n private maskBlendMode: MaskBlendMode = MaskBlendMode.Black\n\n private zoomTextHTML!: HTMLSpanElement\n private dimensionsTextHTML!: HTMLSpanElement\n\n constructor(rootElement: HTMLElement, maskEditor: MaskEditorDialog) {\n this.rootElement = rootElement\n this.maskEditor = maskEditor\n this.messageBroker = maskEditor.getMessageBroker()\n this.addListeners()\n this.addPullTopics()\n }\n\n addListeners() {\n this.messageBroker.subscribe('updateBrushPreview', async () =>\n this.updateBrushPreview()\n )\n\n this.messageBroker.subscribe(\n 'paintBucketCursor',\n (isPaintBucket: boolean) => this.handlePaintBucketCursor(isPaintBucket)\n )\n\n this.messageBroker.subscribe('panCursor', (isPan: boolean) =>\n this.handlePanCursor(isPan)\n )\n\n this.messageBroker.subscribe('setBrushVisibility', (isVisible: boolean) =>\n this.setBrushVisibility(isVisible)\n )\n\n this.messageBroker.subscribe(\n 'setBrushPreviewGradientVisibility',\n (isVisible: boolean) => this.setBrushPreviewGradientVisibility(isVisible)\n )\n\n this.messageBroker.subscribe('updateCursor', () => this.updateCursor())\n\n this.messageBroker.subscribe('setZoomText', (text: string) =>\n this.setZoomText(text)\n )\n }\n\n addPullTopics() {\n this.messageBroker.createPullTopic(\n 'maskCanvas',\n async () => this.maskCanvas\n )\n this.messageBroker.createPullTopic('maskCtx', async () => this.maskCtx)\n this.messageBroker.createPullTopic('imageCtx', async () => this.imageCtx)\n this.messageBroker.createPullTopic('imgCanvas', async () => this.imgCanvas)\n this.messageBroker.createPullTopic(\n 'screenToCanvas',\n async (coords: Point) => this.screenToCanvas(coords)\n )\n this.messageBroker.createPullTopic(\n 'getCanvasContainer',\n async () => this.canvasContainer\n )\n this.messageBroker.createPullTopic('getMaskColor', async () =>\n this.getMaskColor()\n )\n }\n\n async setlayout() {\n this.detectLightMode()\n var user_ui = await this.createUI()\n var canvasContainer = this.createBackgroundUI()\n\n var brush = await this.createBrush()\n await this.setBrushBorderRadius()\n this.setBrushOpacity(1)\n this.rootElement.appendChild(canvasContainer)\n this.rootElement.appendChild(user_ui)\n document.body.appendChild(brush)\n }\n\n private async createUI() {\n var ui_container = document.createElement('div')\n ui_container.id = 'maskEditor_uiContainer'\n\n var top_bar = await this.createTopBar()\n\n var ui_horizontal_container = document.createElement('div')\n ui_horizontal_container.id = 'maskEditor_uiHorizontalContainer'\n\n var side_panel_container = await this.createSidePanel()\n\n var pointer_zone = this.createPointerZone()\n\n var tool_panel = this.createToolPanel()\n\n ui_horizontal_container.appendChild(tool_panel)\n ui_horizontal_container.appendChild(pointer_zone)\n ui_horizontal_container.appendChild(side_panel_container)\n\n ui_container.appendChild(top_bar)\n ui_container.appendChild(ui_horizontal_container)\n\n return ui_container\n }\n\n private createBackgroundUI() {\n const canvasContainer = document.createElement('div')\n canvasContainer.id = 'maskEditorCanvasContainer'\n\n const imgCanvas = document.createElement('canvas')\n imgCanvas.id = 'imageCanvas'\n\n const maskCanvas = document.createElement('canvas')\n maskCanvas.id = 'maskCanvas'\n\n const canvas_background = document.createElement('div')\n canvas_background.id = 'canvasBackground'\n\n canvasContainer.appendChild(imgCanvas)\n canvasContainer.appendChild(maskCanvas)\n canvasContainer.appendChild(canvas_background)\n\n // prepare content\n this.imgCanvas = imgCanvas!\n this.maskCanvas = maskCanvas!\n this.canvasContainer = canvasContainer!\n this.canvasBackground = canvas_background!\n let maskCtx = maskCanvas!.getContext('2d', { willReadFrequently: true })\n if (maskCtx) {\n this.maskCtx = maskCtx\n }\n let imgCtx = imgCanvas!.getContext('2d', { willReadFrequently: true })\n if (imgCtx) {\n this.imageCtx = imgCtx\n }\n this.setEventHandler()\n\n //remove styling and move to css file\n\n this.imgCanvas.style.position = 'absolute'\n this.maskCanvas.style.position = 'absolute'\n\n this.imgCanvas.style.top = '200'\n this.imgCanvas.style.left = '0'\n\n this.maskCanvas.style.top = this.imgCanvas.style.top\n this.maskCanvas.style.left = this.imgCanvas.style.left\n\n const maskCanvasStyle = this.getMaskCanvasStyle()\n this.maskCanvas.style.mixBlendMode = maskCanvasStyle.mixBlendMode\n this.maskCanvas.style.opacity = maskCanvasStyle.opacity.toString()\n\n return canvasContainer\n }\n\n async setBrushBorderRadius() {\n const brushSettings = await this.messageBroker.pull('brushSettings')\n\n if (brushSettings.type === BrushShape.Rect) {\n this.brush.style.borderRadius = '0%'\n // @ts-expect-error\n this.brush.style.MozBorderRadius = '0%'\n // @ts-expect-error\n this.brush.style.WebkitBorderRadius = '0%'\n } else {\n this.brush.style.borderRadius = '50%'\n // @ts-expect-error\n this.brush.style.MozBorderRadius = '50%'\n // @ts-expect-error\n this.brush.style.WebkitBorderRadius = '50%'\n }\n }\n\n async initUI() {\n this.saveButton.innerText = 'Save'\n this.saveButton.disabled = false\n\n await this.setImages(this.imgCanvas) //probably change method to initImageCanvas\n }\n\n private async createSidePanel() {\n const side_panel = this.createContainer(true)\n side_panel.id = 'maskEditor_sidePanel'\n\n const brush_settings = await this.createBrushSettings()\n brush_settings.id = 'maskEditor_brushSettings'\n this.brushSettingsHTML = brush_settings\n\n const paint_bucket_settings = await this.createPaintBucketSettings()\n paint_bucket_settings.id = 'maskEditor_paintBucketSettings'\n this.paintBucketSettingsHTML = paint_bucket_settings\n\n const color_select_settings = await this.createColorSelectSettings()\n color_select_settings.id = 'maskEditor_colorSelectSettings'\n this.colorSelectSettingsHTML = color_select_settings\n\n const image_layer_settings = await this.createImageLayerSettings()\n\n const separator = this.createSeparator()\n\n side_panel.appendChild(brush_settings)\n side_panel.appendChild(paint_bucket_settings)\n side_panel.appendChild(color_select_settings)\n side_panel.appendChild(separator)\n side_panel.appendChild(image_layer_settings)\n\n return side_panel\n }\n\n private async createBrushSettings() {\n const shapeColor = this.darkMode\n ? 'maskEditor_brushShape_dark'\n : 'maskEditor_brushShape_light'\n const brush_settings_container = this.createContainer(true)\n\n const brush_settings_title = this.createHeadline('Brush Settings')\n\n const brush_shape_outer_container = this.createContainer(true)\n\n const brush_shape_title = this.createContainerTitle('Brush Shape')\n\n const brush_shape_container = this.createContainer(false)\n\n const accentColor = this.darkMode\n ? 'maskEditor_accent_bg_dark'\n : 'maskEditor_accent_bg_light'\n\n brush_shape_container.classList.add(accentColor)\n brush_shape_container.classList.add('maskEditor_layerRow')\n\n const circle_shape = document.createElement('div')\n circle_shape.id = 'maskEditor_sidePanelBrushShapeCircle'\n circle_shape.classList.add(shapeColor)\n circle_shape.addEventListener('click', () => {\n this.messageBroker.publish('setBrushShape', BrushShape.Arc)\n this.setBrushBorderRadius()\n circle_shape.style.background = 'var(--p-button-text-primary-color)'\n square_shape.style.background = ''\n })\n\n const square_shape = document.createElement('div')\n square_shape.id = 'maskEditor_sidePanelBrushShapeSquare'\n square_shape.classList.add(shapeColor)\n square_shape.addEventListener('click', () => {\n this.messageBroker.publish('setBrushShape', BrushShape.Rect)\n this.setBrushBorderRadius()\n square_shape.style.background = 'var(--p-button-text-primary-color)'\n circle_shape.style.background = ''\n })\n\n if (\n (await this.messageBroker.pull('brushSettings')).type === BrushShape.Arc\n ) {\n circle_shape.style.background = 'var(--p-button-text-primary-color)'\n square_shape.style.background = ''\n } else {\n circle_shape.style.background = ''\n square_shape.style.background = 'var(--p-button-text-primary-color)'\n }\n\n brush_shape_container.appendChild(circle_shape)\n brush_shape_container.appendChild(square_shape)\n\n brush_shape_outer_container.appendChild(brush_shape_title)\n brush_shape_outer_container.appendChild(brush_shape_container)\n\n const thicknesSliderObj = this.createSlider(\n 'Thickness',\n 1,\n 100,\n 1,\n (await this.messageBroker.pull('brushSettings')).size,\n (event, value) => {\n this.messageBroker.publish('setBrushSize', parseInt(value))\n this.updateBrushPreview()\n }\n )\n this.brushSizeSlider = thicknesSliderObj.slider\n\n const opacitySliderObj = this.createSlider(\n 'Opacity',\n 0,\n 1,\n 0.01,\n (await this.messageBroker.pull('brushSettings')).opacity,\n (event, value) => {\n this.messageBroker.publish('setBrushOpacity', parseFloat(value))\n this.updateBrushPreview()\n }\n )\n this.brushOpacitySlider = opacitySliderObj.slider\n\n const hardnessSliderObj = this.createSlider(\n 'Hardness',\n 0,\n 1,\n 0.01,\n (await this.messageBroker.pull('brushSettings')).hardness,\n (event, value) => {\n this.messageBroker.publish('setBrushHardness', parseFloat(value))\n this.updateBrushPreview()\n }\n )\n this.brushHardnessSlider = hardnessSliderObj.slider\n\n const brushSmoothingPrecisionSliderObj = this.createSlider(\n 'Smoothing Precision',\n 1,\n 100,\n 1,\n (await this.messageBroker.pull('brushSettings')).smoothingPrecision,\n (event, value) => {\n this.messageBroker.publish(\n 'setBrushSmoothingPrecision',\n parseInt(value)\n )\n }\n )\n\n const resetBrushSettingsButton = document.createElement('button')\n resetBrushSettingsButton.id = 'resetBrushSettingsButton'\n resetBrushSettingsButton.innerText = 'Reset to Default'\n\n resetBrushSettingsButton.addEventListener('click', () => {\n this.messageBroker.publish('setBrushShape', BrushShape.Arc)\n this.messageBroker.publish('setBrushSize', 10)\n this.messageBroker.publish('setBrushOpacity', 0.7)\n this.messageBroker.publish('setBrushHardness', 1)\n this.messageBroker.publish('setBrushSmoothingPrecision', 10)\n\n circle_shape.style.background = 'var(--p-button-text-primary-color)'\n square_shape.style.background = ''\n\n thicknesSliderObj.slider.value = '10'\n opacitySliderObj.slider.value = '0.7'\n hardnessSliderObj.slider.value = '1'\n brushSmoothingPrecisionSliderObj.slider.value = '10'\n\n this.setBrushBorderRadius()\n this.updateBrushPreview()\n })\n\n brush_settings_container.appendChild(brush_settings_title)\n brush_settings_container.appendChild(resetBrushSettingsButton)\n brush_settings_container.appendChild(brush_shape_outer_container)\n brush_settings_container.appendChild(thicknesSliderObj.container)\n brush_settings_container.appendChild(opacitySliderObj.container)\n brush_settings_container.appendChild(hardnessSliderObj.container)\n brush_settings_container.appendChild(\n brushSmoothingPrecisionSliderObj.container\n )\n\n return brush_settings_container\n }\n\n private async createPaintBucketSettings() {\n const paint_bucket_settings_container = this.createContainer(true)\n\n const paint_bucket_settings_title = this.createHeadline(\n 'Paint Bucket Settings'\n )\n\n const tolerance = await this.messageBroker.pull('getTolerance')\n const paintBucketToleranceSliderObj = this.createSlider(\n 'Tolerance',\n 0,\n 255,\n 1,\n tolerance,\n (event, value) => {\n this.messageBroker.publish('setPaintBucketTolerance', parseInt(value))\n }\n )\n\n paint_bucket_settings_container.appendChild(paint_bucket_settings_title)\n paint_bucket_settings_container.appendChild(\n paintBucketToleranceSliderObj.container\n )\n\n return paint_bucket_settings_container\n }\n\n private async createColorSelectSettings() {\n const color_select_settings_container = this.createContainer(true)\n\n const color_select_settings_title = this.createHeadline(\n 'Color Select Settings'\n )\n\n var tolerance = await this.messageBroker.pull('getTolerance')\n const colorSelectToleranceSliderObj = this.createSlider(\n 'Tolerance',\n 0,\n 255,\n 1,\n tolerance,\n (event, value) => {\n this.messageBroker.publish('setColorSelectTolerance', parseInt(value))\n }\n )\n\n const livePreviewToggle = this.createToggle(\n 'Live Preview',\n (event, value) => {\n this.messageBroker.publish('setLivePreview', value)\n }\n )\n\n const wholeImageToggle = this.createToggle(\n 'Apply to Whole Image',\n (event, value) => {\n this.messageBroker.publish('setWholeImage', value)\n }\n )\n\n const methodOptions = Object.values(ColorComparisonMethod)\n const methodSelect = this.createDropdown(\n 'Method',\n methodOptions,\n (event, value) => {\n this.messageBroker.publish('setColorComparisonMethod', value)\n }\n )\n\n const maskBoundaryToggle = this.createToggle(\n 'Stop at mask',\n (event, value) => {\n this.messageBroker.publish('setMaskBoundary', value)\n }\n )\n\n const maskToleranceSliderObj = this.createSlider(\n 'Mask Tolerance',\n 0,\n 255,\n 1,\n 0,\n (event, value) => {\n this.messageBroker.publish('setMaskTolerance', parseInt(value))\n }\n )\n\n color_select_settings_container.appendChild(color_select_settings_title)\n color_select_settings_container.appendChild(\n colorSelectToleranceSliderObj.container\n )\n color_select_settings_container.appendChild(livePreviewToggle)\n color_select_settings_container.appendChild(wholeImageToggle)\n color_select_settings_container.appendChild(methodSelect)\n color_select_settings_container.appendChild(maskBoundaryToggle)\n color_select_settings_container.appendChild(\n maskToleranceSliderObj.container\n )\n\n return color_select_settings_container\n }\n\n private async createImageLayerSettings() {\n const accentColor = this.darkMode\n ? 'maskEditor_accent_bg_dark'\n : 'maskEditor_accent_bg_light'\n\n const image_layer_settings_container = this.createContainer(true)\n\n const image_layer_settings_title = this.createHeadline('Layers')\n\n const mask_layer_title = this.createContainerTitle('Mask Layer')\n\n const mask_layer_container = this.createContainer(false)\n mask_layer_container.classList.add(accentColor)\n mask_layer_container.classList.add('maskEditor_layerRow')\n\n const mask_layer_visibility_checkbox = document.createElement('input')\n mask_layer_visibility_checkbox.setAttribute('type', 'checkbox')\n mask_layer_visibility_checkbox.checked = true\n mask_layer_visibility_checkbox.classList.add(\n 'maskEditor_sidePanelLayerCheckbox'\n )\n mask_layer_visibility_checkbox.addEventListener('change', (event) => {\n if (!(event.target as HTMLInputElement)!.checked) {\n this.maskCanvas.style.opacity = '0'\n } else {\n this.maskCanvas.style.opacity = String(this.mask_opacity) //change name\n }\n })\n\n var mask_layer_image_container = document.createElement('div')\n mask_layer_image_container.classList.add(\n 'maskEditor_sidePanelLayerPreviewContainer'\n )\n mask_layer_image_container.innerHTML =\n ' '\n\n var blending_options = ['black', 'white', 'negative']\n\n const sidePanelDropdownAccent = this.darkMode\n ? 'maskEditor_sidePanelDropdown_dark'\n : 'maskEditor_sidePanelDropdown_light'\n\n var mask_layer_dropdown = document.createElement('select')\n mask_layer_dropdown.classList.add(sidePanelDropdownAccent)\n mask_layer_dropdown.classList.add(sidePanelDropdownAccent)\n blending_options.forEach((option) => {\n var option_element = document.createElement('option')\n option_element.value = option\n option_element.innerText = option\n mask_layer_dropdown.appendChild(option_element)\n\n if (option == this.maskBlendMode) {\n option_element.selected = true\n }\n })\n\n mask_layer_dropdown.addEventListener('change', (event) => {\n const selectedValue = (event.target as HTMLSelectElement)\n .value as MaskBlendMode\n this.maskBlendMode = selectedValue\n this.updateMaskColor()\n })\n\n mask_layer_container.appendChild(mask_layer_visibility_checkbox)\n mask_layer_container.appendChild(mask_layer_image_container)\n mask_layer_container.appendChild(mask_layer_dropdown)\n\n const mask_layer_opacity_sliderObj = this.createSlider(\n 'Mask Opacity',\n 0.0,\n 1.0,\n 0.01,\n this.mask_opacity,\n (event, value) => {\n this.mask_opacity = parseFloat(value)\n this.maskCanvas.style.opacity = String(this.mask_opacity)\n\n if (this.mask_opacity == 0) {\n mask_layer_visibility_checkbox.checked = false\n } else {\n mask_layer_visibility_checkbox.checked = true\n }\n }\n )\n this.maskOpacitySlider = mask_layer_opacity_sliderObj.slider\n\n const image_layer_title = this.createContainerTitle('Image Layer')\n\n const image_layer_container = this.createContainer(false)\n image_layer_container.classList.add(accentColor)\n image_layer_container.classList.add('maskEditor_layerRow')\n\n const image_layer_visibility_checkbox = document.createElement('input')\n image_layer_visibility_checkbox.setAttribute('type', 'checkbox')\n image_layer_visibility_checkbox.classList.add(\n 'maskEditor_sidePanelLayerCheckbox'\n )\n image_layer_visibility_checkbox.checked = true\n image_layer_visibility_checkbox.addEventListener('change', (event) => {\n if (!(event.target as HTMLInputElement)!.checked) {\n this.imgCanvas.style.opacity = '0'\n } else {\n this.imgCanvas.style.opacity = '1'\n }\n })\n\n const image_layer_image_container = document.createElement('div')\n image_layer_image_container.classList.add(\n 'maskEditor_sidePanelLayerPreviewContainer'\n )\n\n const image_layer_image = document.createElement('img')\n image_layer_image.id = 'maskEditor_sidePanelImageLayerImage'\n image_layer_image.src =\n ComfyApp.clipspace?.imgs?.[ComfyApp.clipspace?.selectedIndex ?? 0]?.src ??\n ''\n this.sidebarImage = image_layer_image\n\n image_layer_image_container.appendChild(image_layer_image)\n\n image_layer_container.appendChild(image_layer_visibility_checkbox)\n image_layer_container.appendChild(image_layer_image_container)\n\n image_layer_settings_container.appendChild(image_layer_settings_title)\n image_layer_settings_container.appendChild(mask_layer_title)\n image_layer_settings_container.appendChild(mask_layer_container)\n image_layer_settings_container.appendChild(\n mask_layer_opacity_sliderObj.container\n )\n image_layer_settings_container.appendChild(image_layer_title)\n image_layer_settings_container.appendChild(image_layer_container)\n\n return image_layer_settings_container\n }\n\n private createHeadline(title: string) {\n var headline = document.createElement('h3')\n headline.classList.add('maskEditor_sidePanelTitle')\n headline.innerText = title\n\n return headline\n }\n\n private createContainer(flexDirection: boolean) {\n var container = document.createElement('div')\n if (flexDirection) {\n container.classList.add('maskEditor_sidePanelContainerColumn')\n } else {\n container.classList.add('maskEditor_sidePanelContainerRow')\n }\n\n return container\n }\n\n private createContainerTitle(title: string) {\n var container_title = document.createElement('span')\n container_title.classList.add('maskEditor_sidePanelSubTitle')\n container_title.innerText = title\n\n return container_title\n }\n\n private createSlider(\n title: string,\n min: number,\n max: number,\n step: number,\n value: number,\n callback: (event: Event, value: string) => void\n ) {\n var slider_container = this.createContainer(true)\n var slider_title = this.createContainerTitle(title)\n\n var slider = document.createElement('input')\n slider.classList.add('maskEditor_sidePanelBrushRange')\n slider.setAttribute('type', 'range')\n slider.setAttribute('min', String(min))\n slider.setAttribute('max', String(max))\n slider.setAttribute('step', String(step))\n slider.setAttribute('value', String(value))\n slider.addEventListener('input', (event) => {\n callback(event, (event.target as HTMLInputElement).value)\n })\n slider_container.appendChild(slider_title)\n slider_container.appendChild(slider)\n\n return { container: slider_container, slider: slider }\n }\n\n private createToggle(\n title: string,\n callback: (event: Event, value: boolean) => void\n ) {\n var outer_Container = this.createContainer(false)\n var toggle_title = this.createContainerTitle(title)\n\n var toggle_container = document.createElement('label')\n toggle_container.classList.add('maskEditor_sidePanelToggleContainer')\n\n var toggle_checkbox = document.createElement('input')\n toggle_checkbox.setAttribute('type', 'checkbox')\n toggle_checkbox.classList.add('maskEditor_sidePanelToggleCheckbox')\n toggle_checkbox.addEventListener('change', (event) => {\n callback(event, (event.target as HTMLInputElement).checked)\n })\n\n var toggleAccentColor = this.darkMode\n ? 'maskEditor_toggle_bg_dark'\n : 'maskEditor_toggle_bg_light'\n\n var toggle_switch = document.createElement('div')\n toggle_switch.classList.add('maskEditor_sidePanelToggleSwitch')\n toggle_switch.classList.add(toggleAccentColor)\n\n toggle_container.appendChild(toggle_checkbox)\n toggle_container.appendChild(toggle_switch)\n\n outer_Container.appendChild(toggle_title)\n outer_Container.appendChild(toggle_container)\n\n return outer_Container\n }\n\n private createDropdown(\n title: string,\n options: string[],\n callback: (event: Event, value: string) => void\n ) {\n const sidePanelDropdownAccent = this.darkMode\n ? 'maskEditor_sidePanelDropdown_dark'\n : 'maskEditor_sidePanelDropdown_light'\n var dropdown_container = this.createContainer(false)\n var dropdown_title = this.createContainerTitle(title)\n\n var dropdown = document.createElement('select')\n dropdown.classList.add(sidePanelDropdownAccent)\n dropdown.classList.add('maskEditor_containerDropdown')\n\n options.forEach((option) => {\n var option_element = document.createElement('option')\n option_element.value = option\n option_element.innerText = option\n dropdown.appendChild(option_element)\n })\n\n dropdown.addEventListener('change', (event) => {\n callback(event, (event.target as HTMLSelectElement).value)\n })\n\n dropdown_container.appendChild(dropdown_title)\n dropdown_container.appendChild(dropdown)\n\n return dropdown_container\n }\n\n private createSeparator() {\n var separator = document.createElement('div')\n separator.classList.add('maskEditor_sidePanelSeparator')\n\n return separator\n }\n\n //----------------\n\n private async createTopBar() {\n const buttonAccentColor = this.darkMode\n ? 'maskEditor_topPanelButton_dark'\n : 'maskEditor_topPanelButton_light'\n\n const iconButtonAccentColor = this.darkMode\n ? 'maskEditor_topPanelIconButton_dark'\n : 'maskEditor_topPanelIconButton_light'\n\n var top_bar = document.createElement('div')\n top_bar.id = 'maskEditor_topBar'\n\n var top_bar_title_container = document.createElement('div')\n top_bar_title_container.id = 'maskEditor_topBarTitleContainer'\n\n var top_bar_title = document.createElement('h1')\n top_bar_title.id = 'maskEditor_topBarTitle'\n top_bar_title.innerText = 'ComfyUI'\n\n top_bar_title_container.appendChild(top_bar_title)\n\n var top_bar_shortcuts_container = document.createElement('div')\n top_bar_shortcuts_container.id = 'maskEditor_topBarShortcutsContainer'\n\n var top_bar_undo_button = document.createElement('div')\n top_bar_undo_button.id = 'maskEditor_topBarUndoButton'\n top_bar_undo_button.classList.add(iconButtonAccentColor)\n top_bar_undo_button.innerHTML =\n ' '\n\n top_bar_undo_button.addEventListener('click', () => {\n this.messageBroker.publish('undo')\n })\n\n var top_bar_redo_button = document.createElement('div')\n top_bar_redo_button.id = 'maskEditor_topBarRedoButton'\n top_bar_redo_button.classList.add(iconButtonAccentColor)\n top_bar_redo_button.innerHTML =\n ' '\n\n top_bar_redo_button.addEventListener('click', () => {\n this.messageBroker.publish('redo')\n })\n\n var top_bar_invert_button = document.createElement('button')\n top_bar_invert_button.id = 'maskEditor_topBarInvertButton'\n top_bar_invert_button.classList.add(buttonAccentColor)\n top_bar_invert_button.innerText = 'Invert'\n top_bar_invert_button.addEventListener('click', () => {\n this.messageBroker.publish('invert')\n })\n\n var top_bar_clear_button = document.createElement('button')\n top_bar_clear_button.id = 'maskEditor_topBarClearButton'\n top_bar_clear_button.classList.add(buttonAccentColor)\n top_bar_clear_button.innerText = 'Clear'\n\n top_bar_clear_button.addEventListener('click', () => {\n this.maskCtx.clearRect(\n 0,\n 0,\n this.maskCanvas.width,\n this.maskCanvas.height\n )\n this.messageBroker.publish('saveState')\n })\n\n var top_bar_save_button = document.createElement('button')\n top_bar_save_button.id = 'maskEditor_topBarSaveButton'\n top_bar_save_button.classList.add(buttonAccentColor)\n top_bar_save_button.innerText = 'Save'\n this.saveButton = top_bar_save_button\n\n top_bar_save_button.addEventListener('click', () => {\n this.maskEditor.save()\n })\n\n var top_bar_cancel_button = document.createElement('button')\n top_bar_cancel_button.id = 'maskEditor_topBarCancelButton'\n top_bar_cancel_button.classList.add(buttonAccentColor)\n top_bar_cancel_button.innerText = 'Cancel'\n\n top_bar_cancel_button.addEventListener('click', () => {\n this.maskEditor.close()\n })\n\n top_bar_shortcuts_container.appendChild(top_bar_undo_button)\n top_bar_shortcuts_container.appendChild(top_bar_redo_button)\n top_bar_shortcuts_container.appendChild(top_bar_invert_button)\n top_bar_shortcuts_container.appendChild(top_bar_clear_button)\n top_bar_shortcuts_container.appendChild(top_bar_save_button)\n top_bar_shortcuts_container.appendChild(top_bar_cancel_button)\n\n top_bar.appendChild(top_bar_title_container)\n top_bar.appendChild(top_bar_shortcuts_container)\n\n return top_bar\n }\n\n private createToolPanel() {\n var tool_panel = document.createElement('div')\n tool_panel.id = 'maskEditor_toolPanel'\n this.toolPanel = tool_panel\n var toolPanelHoverAccent = this.darkMode\n ? 'maskEditor_toolPanelContainerDark'\n : 'maskEditor_toolPanelContainerLight'\n\n var toolElements: HTMLElement[] = []\n\n //brush tool\n\n var toolPanel_brushToolContainer = document.createElement('div')\n toolPanel_brushToolContainer.classList.add('maskEditor_toolPanelContainer')\n toolPanel_brushToolContainer.classList.add(\n 'maskEditor_toolPanelContainerSelected'\n )\n toolPanel_brushToolContainer.classList.add(toolPanelHoverAccent)\n toolPanel_brushToolContainer.innerHTML = `\n \n \n \n \n `\n toolElements.push(toolPanel_brushToolContainer)\n\n toolPanel_brushToolContainer.addEventListener('click', () => {\n //move logic to tool manager\n this.messageBroker.publish('setTool', Tools.Pen)\n for (let toolElement of toolElements) {\n if (toolElement != toolPanel_brushToolContainer) {\n toolElement.classList.remove('maskEditor_toolPanelContainerSelected')\n } else {\n toolElement.classList.add('maskEditor_toolPanelContainerSelected')\n this.brushSettingsHTML.style.display = 'flex'\n this.colorSelectSettingsHTML.style.display = 'none'\n this.paintBucketSettingsHTML.style.display = 'none'\n }\n }\n this.messageBroker.publish('setTool', Tools.Pen)\n this.pointerZone.style.cursor = 'none'\n })\n\n var toolPanel_brushToolIndicator = document.createElement('div')\n toolPanel_brushToolIndicator.classList.add('maskEditor_toolPanelIndicator')\n\n toolPanel_brushToolContainer.appendChild(toolPanel_brushToolIndicator)\n\n //eraser tool\n\n var toolPanel_eraserToolContainer = document.createElement('div')\n toolPanel_eraserToolContainer.classList.add('maskEditor_toolPanelContainer')\n toolPanel_eraserToolContainer.classList.add(toolPanelHoverAccent)\n toolPanel_eraserToolContainer.innerHTML = `\n \n \n \n \n \n \n \n `\n toolElements.push(toolPanel_eraserToolContainer)\n\n toolPanel_eraserToolContainer.addEventListener('click', () => {\n //move logic to tool manager\n this.messageBroker.publish('setTool', Tools.Eraser)\n for (let toolElement of toolElements) {\n if (toolElement != toolPanel_eraserToolContainer) {\n toolElement.classList.remove('maskEditor_toolPanelContainerSelected')\n } else {\n toolElement.classList.add('maskEditor_toolPanelContainerSelected')\n this.brushSettingsHTML.style.display = 'flex'\n this.colorSelectSettingsHTML.style.display = 'none'\n this.paintBucketSettingsHTML.style.display = 'none'\n }\n }\n this.messageBroker.publish('setTool', Tools.Eraser)\n this.pointerZone.style.cursor = 'none'\n })\n\n var toolPanel_eraserToolIndicator = document.createElement('div')\n toolPanel_eraserToolIndicator.classList.add('maskEditor_toolPanelIndicator')\n\n toolPanel_eraserToolContainer.appendChild(toolPanel_eraserToolIndicator)\n\n //paint bucket tool\n\n var toolPanel_paintBucketToolContainer = document.createElement('div')\n toolPanel_paintBucketToolContainer.classList.add(\n 'maskEditor_toolPanelContainer'\n )\n toolPanel_paintBucketToolContainer.classList.add(toolPanelHoverAccent)\n toolPanel_paintBucketToolContainer.innerHTML = `\n \n \n \n \n \n `\n toolElements.push(toolPanel_paintBucketToolContainer)\n\n toolPanel_paintBucketToolContainer.addEventListener('click', () => {\n //move logic to tool manager\n this.messageBroker.publish('setTool', Tools.PaintBucket)\n for (let toolElement of toolElements) {\n if (toolElement != toolPanel_paintBucketToolContainer) {\n toolElement.classList.remove('maskEditor_toolPanelContainerSelected')\n } else {\n toolElement.classList.add('maskEditor_toolPanelContainerSelected')\n this.brushSettingsHTML.style.display = 'none'\n this.colorSelectSettingsHTML.style.display = 'none'\n this.paintBucketSettingsHTML.style.display = 'flex'\n }\n }\n this.messageBroker.publish('setTool', Tools.PaintBucket)\n this.pointerZone.style.cursor =\n \"url('/cursor/paintBucket.png') 30 25, auto\"\n this.brush.style.opacity = '0'\n })\n\n var toolPanel_paintBucketToolIndicator = document.createElement('div')\n toolPanel_paintBucketToolIndicator.classList.add(\n 'maskEditor_toolPanelIndicator'\n )\n\n toolPanel_paintBucketToolContainer.appendChild(\n toolPanel_paintBucketToolIndicator\n )\n\n //color select tool\n\n var toolPanel_colorSelectToolContainer = document.createElement('div')\n toolPanel_colorSelectToolContainer.classList.add(\n 'maskEditor_toolPanelContainer'\n )\n toolPanel_colorSelectToolContainer.classList.add(toolPanelHoverAccent)\n toolPanel_colorSelectToolContainer.innerHTML = `\n \n \n \n `\n toolElements.push(toolPanel_colorSelectToolContainer)\n toolPanel_colorSelectToolContainer.addEventListener('click', () => {\n this.messageBroker.publish('setTool', 'colorSelect')\n for (let toolElement of toolElements) {\n if (toolElement != toolPanel_colorSelectToolContainer) {\n toolElement.classList.remove('maskEditor_toolPanelContainerSelected')\n } else {\n toolElement.classList.add('maskEditor_toolPanelContainerSelected')\n this.brushSettingsHTML.style.display = 'none'\n this.paintBucketSettingsHTML.style.display = 'none'\n this.colorSelectSettingsHTML.style.display = 'flex'\n }\n }\n this.messageBroker.publish('setTool', Tools.ColorSelect)\n this.pointerZone.style.cursor =\n \"url('/cursor/colorSelect.png') 15 25, auto\"\n this.brush.style.opacity = '0'\n })\n\n var toolPanel_colorSelectToolIndicator = document.createElement('div')\n toolPanel_colorSelectToolIndicator.classList.add(\n 'maskEditor_toolPanelIndicator'\n )\n toolPanel_colorSelectToolContainer.appendChild(\n toolPanel_colorSelectToolIndicator\n )\n\n //zoom indicator\n var toolPanel_zoomIndicator = document.createElement('div')\n toolPanel_zoomIndicator.classList.add('maskEditor_toolPanelZoomIndicator')\n toolPanel_zoomIndicator.classList.add(toolPanelHoverAccent)\n\n var toolPanel_zoomText = document.createElement('span')\n toolPanel_zoomText.id = 'maskEditor_toolPanelZoomText'\n toolPanel_zoomText.innerText = '100%'\n this.zoomTextHTML = toolPanel_zoomText\n\n var toolPanel_DimensionsText = document.createElement('span')\n toolPanel_DimensionsText.id = 'maskEditor_toolPanelDimensionsText'\n toolPanel_DimensionsText.innerText = ' '\n this.dimensionsTextHTML = toolPanel_DimensionsText\n\n toolPanel_zoomIndicator.appendChild(toolPanel_zoomText)\n toolPanel_zoomIndicator.appendChild(toolPanel_DimensionsText)\n\n toolPanel_zoomIndicator.addEventListener('click', () => {\n this.messageBroker.publish('resetZoom')\n })\n\n tool_panel.appendChild(toolPanel_brushToolContainer)\n tool_panel.appendChild(toolPanel_eraserToolContainer)\n tool_panel.appendChild(toolPanel_paintBucketToolContainer)\n tool_panel.appendChild(toolPanel_colorSelectToolContainer)\n tool_panel.appendChild(toolPanel_zoomIndicator)\n\n return tool_panel\n }\n\n private createPointerZone() {\n const pointer_zone = document.createElement('div')\n pointer_zone.id = 'maskEditor_pointerZone'\n\n this.pointerZone = pointer_zone\n\n pointer_zone.addEventListener('pointerdown', (event: PointerEvent) => {\n this.messageBroker.publish('pointerDown', event)\n })\n\n pointer_zone.addEventListener('pointermove', (event: PointerEvent) => {\n this.messageBroker.publish('pointerMove', event)\n })\n\n pointer_zone.addEventListener('pointerup', (event: PointerEvent) => {\n this.messageBroker.publish('pointerUp', event)\n })\n\n pointer_zone.addEventListener('pointerleave', (event: PointerEvent) => {\n this.brush.style.opacity = '0'\n this.pointerZone.style.cursor = ''\n })\n\n pointer_zone.addEventListener('touchstart', (event: TouchEvent) => {\n this.messageBroker.publish('handleTouchStart', event)\n })\n\n pointer_zone.addEventListener('touchmove', (event: TouchEvent) => {\n this.messageBroker.publish('handleTouchMove', event)\n })\n\n pointer_zone.addEventListener('touchend', (event: TouchEvent) => {\n this.messageBroker.publish('handleTouchEnd', event)\n })\n\n pointer_zone.addEventListener('wheel', (event) =>\n this.messageBroker.publish('wheel', event)\n )\n\n pointer_zone.addEventListener(\n 'pointerenter',\n async (event: PointerEvent) => {\n this.updateCursor()\n }\n )\n\n return pointer_zone\n }\n\n async screenToCanvas(clientPoint: Point): Promise {\n // Get the bounding rectangles for both elements\n const zoomRatio = await this.messageBroker.pull('zoomRatio')\n const canvasRect = this.maskCanvas.getBoundingClientRect()\n\n // Calculate the offset between pointer zone and canvas\n const offsetX = clientPoint.x - canvasRect.left + this.toolPanel.clientWidth\n const offsetY = clientPoint.y - canvasRect.top + 44 // 44 is the height of the top menu\n\n const x = offsetX / zoomRatio\n const y = offsetY / zoomRatio\n\n return { x: x, y: y }\n }\n\n private setEventHandler() {\n this.maskCanvas.addEventListener('contextmenu', (event: Event) => {\n event.preventDefault()\n })\n\n this.rootElement.addEventListener('contextmenu', (event: Event) => {\n event.preventDefault()\n })\n\n this.rootElement.addEventListener('dragstart', (event) => {\n if (event.ctrlKey) {\n event.preventDefault()\n }\n })\n }\n\n private async createBrush() {\n var brush = document.createElement('div')\n const brushSettings = await this.messageBroker.pull('brushSettings')\n brush.id = 'maskEditor_brush'\n\n var brush_preview_gradient = document.createElement('div')\n brush_preview_gradient.id = 'maskEditor_brushPreviewGradient'\n\n brush.appendChild(brush_preview_gradient)\n\n this.brush = brush\n this.brushPreviewGradient = brush_preview_gradient\n\n return brush\n }\n\n async setImages(imgCanvas: HTMLCanvasElement) {\n const imgCtx = imgCanvas.getContext('2d', { willReadFrequently: true })\n const maskCtx = this.maskCtx\n const maskCanvas = this.maskCanvas\n\n imgCtx!.clearRect(0, 0, this.imgCanvas.width, this.imgCanvas.height)\n maskCtx.clearRect(0, 0, this.maskCanvas.width, this.maskCanvas.height)\n\n const alpha_url = new URL(\n ComfyApp.clipspace?.imgs?.[ComfyApp.clipspace?.selectedIndex ?? 0]?.src ??\n ''\n )\n alpha_url.searchParams.delete('channel')\n alpha_url.searchParams.delete('preview')\n alpha_url.searchParams.set('channel', 'a')\n let mask_image: HTMLImageElement = await this.loadImage(alpha_url)\n\n // original image load\n if (\n !ComfyApp.clipspace?.imgs?.[ComfyApp.clipspace?.selectedIndex ?? 0]?.src\n ) {\n throw new Error(\n 'Unable to access image source - clipspace or image is null'\n )\n }\n\n const rgb_url = new URL(\n ComfyApp.clipspace.imgs[ComfyApp.clipspace.selectedIndex].src\n )\n this.imageURL = rgb_url\n console.log(rgb_url)\n rgb_url.searchParams.delete('channel')\n rgb_url.searchParams.set('channel', 'rgb')\n this.image = new Image()\n\n this.image = await new Promise((resolve, reject) => {\n const img = new Image()\n img.onload = () => resolve(img)\n img.onerror = reject\n img.src = rgb_url.toString()\n })\n\n maskCanvas.width = this.image.width\n maskCanvas.height = this.image.height\n\n this.dimensionsTextHTML.innerText = `${this.image.width}x${this.image.height}`\n\n await this.invalidateCanvas(this.image, mask_image)\n this.messageBroker.publish('initZoomPan', [this.image, this.rootElement])\n }\n\n async invalidateCanvas(\n orig_image: HTMLImageElement,\n mask_image: HTMLImageElement\n ) {\n this.imgCanvas.width = orig_image.width\n this.imgCanvas.height = orig_image.height\n\n this.maskCanvas.width = orig_image.width\n this.maskCanvas.height = orig_image.height\n\n let imgCtx = this.imgCanvas.getContext('2d', { willReadFrequently: true })\n let maskCtx = this.maskCanvas.getContext('2d', {\n willReadFrequently: true\n })\n\n imgCtx!.drawImage(orig_image, 0, 0, orig_image.width, orig_image.height)\n await this.prepare_mask(\n mask_image,\n this.maskCanvas,\n maskCtx!,\n await this.getMaskColor()\n )\n }\n\n private async prepare_mask(\n image: HTMLImageElement,\n maskCanvas: HTMLCanvasElement,\n maskCtx: CanvasRenderingContext2D,\n maskColor: { r: number; g: number; b: number }\n ) {\n // paste mask data into alpha channel\n maskCtx.drawImage(image, 0, 0, maskCanvas.width, maskCanvas.height)\n const maskData = maskCtx.getImageData(\n 0,\n 0,\n maskCanvas.width,\n maskCanvas.height\n )\n\n // invert mask\n for (let i = 0; i < maskData.data.length; i += 4) {\n const alpha = maskData.data[i + 3]\n maskData.data[i] = maskColor.r\n maskData.data[i + 1] = maskColor.g\n maskData.data[i + 2] = maskColor.b\n maskData.data[i + 3] = 255 - alpha\n }\n\n maskCtx.globalCompositeOperation = 'source-over'\n maskCtx.putImageData(maskData, 0, 0)\n }\n\n private async updateMaskColor() {\n // update mask canvas css styles\n const maskCanvasStyle = this.getMaskCanvasStyle()\n this.maskCanvas.style.mixBlendMode = maskCanvasStyle.mixBlendMode\n this.maskCanvas.style.opacity = maskCanvasStyle.opacity.toString()\n\n // update mask canvas rgb colors\n const maskColor = await this.getMaskColor()\n this.maskCtx.fillStyle = `rgb(${maskColor.r}, ${maskColor.g}, ${maskColor.b})`\n\n //set canvas background color\n this.setCanvasBackground()\n\n const maskData = this.maskCtx.getImageData(\n 0,\n 0,\n this.maskCanvas.width,\n this.maskCanvas.height\n )\n for (let i = 0; i < maskData.data.length; i += 4) {\n maskData.data[i] = maskColor.r\n maskData.data[i + 1] = maskColor.g\n maskData.data[i + 2] = maskColor.b\n }\n this.maskCtx.putImageData(maskData, 0, 0)\n }\n\n getMaskCanvasStyle() {\n if (this.maskBlendMode === MaskBlendMode.Negative) {\n return {\n mixBlendMode: 'difference',\n opacity: '1'\n }\n } else {\n return {\n mixBlendMode: 'initial',\n opacity: this.mask_opacity\n }\n }\n }\n\n private detectLightMode() {\n this.darkMode = document.body.classList.contains('dark-theme')\n }\n\n private loadImage(imagePath: URL): Promise {\n return new Promise((resolve, reject) => {\n const image = new Image() as HTMLImageElement\n image.onload = function () {\n resolve(image)\n }\n image.onerror = function (error) {\n reject(error)\n }\n image.src = imagePath.href\n })\n }\n\n async updateBrushPreview() {\n const cursorPoint = await this.messageBroker.pull('cursorPoint')\n const pan_offset = await this.messageBroker.pull('panOffset')\n const brushSettings = await this.messageBroker.pull('brushSettings')\n const zoom_ratio = await this.messageBroker.pull('zoomRatio')\n const centerX = cursorPoint.x + pan_offset.x\n const centerY = cursorPoint.y + pan_offset.y\n const brush = this.brush\n const hardness = brushSettings.hardness\n const extendedSize = brushSettings.size * (2 - hardness) * 2 * zoom_ratio\n\n this.brushSizeSlider.value = String(brushSettings.size)\n this.brushHardnessSlider.value = String(hardness)\n\n brush.style.width = extendedSize + 'px'\n brush.style.height = extendedSize + 'px'\n brush.style.left = centerX - extendedSize / 2 + 'px'\n brush.style.top = centerY - extendedSize / 2 + 'px'\n\n if (hardness === 1) {\n this.brushPreviewGradient.style.background = 'rgba(255, 0, 0, 0.5)'\n return\n }\n\n const opacityStop = hardness / 4 + 0.25\n\n this.brushPreviewGradient.style.background = `\n radial-gradient(\n circle,\n rgba(255, 0, 0, 0.5) 0%,\n rgba(255, 0, 0, ${opacityStop}) ${hardness * 100}%,\n rgba(255, 0, 0, 0) 100%\n )\n `\n }\n\n getMaskBlendMode() {\n return this.maskBlendMode\n }\n\n setSidebarImage() {\n this.sidebarImage.src = this.imageURL.href\n }\n\n async getMaskColor() {\n if (this.maskBlendMode === MaskBlendMode.Black) {\n return { r: 0, g: 0, b: 0 }\n }\n if (this.maskBlendMode === MaskBlendMode.White) {\n return { r: 255, g: 255, b: 255 }\n }\n if (this.maskBlendMode === MaskBlendMode.Negative) {\n // negative effect only works with white color\n return { r: 255, g: 255, b: 255 }\n }\n\n return { r: 0, g: 0, b: 0 }\n }\n\n async getMaskFillStyle() {\n const maskColor = await this.getMaskColor()\n\n return 'rgb(' + maskColor.r + ',' + maskColor.g + ',' + maskColor.b + ')'\n }\n\n async setCanvasBackground() {\n if (this.maskBlendMode === MaskBlendMode.White) {\n this.canvasBackground.style.background = 'black'\n } else {\n this.canvasBackground.style.background = 'white'\n }\n }\n\n getMaskCanvas() {\n return this.maskCanvas\n }\n\n getImgCanvas() {\n return this.imgCanvas\n }\n\n getImage() {\n return this.image\n }\n\n setBrushOpacity(opacity: number) {\n this.brush.style.opacity = String(opacity)\n }\n\n setSaveButtonEnabled(enabled: boolean) {\n this.saveButton.disabled = !enabled\n }\n\n setSaveButtonText(text: string) {\n this.saveButton.innerText = text\n }\n\n handlePaintBucketCursor(isPaintBucket: boolean) {\n if (isPaintBucket) {\n this.pointerZone.style.cursor =\n \"url('/cursor/paintBucket.png') 30 25, auto\"\n } else {\n this.pointerZone.style.cursor = 'none'\n }\n }\n\n handlePanCursor(isPanning: boolean) {\n if (isPanning) {\n this.pointerZone.style.cursor = 'grabbing'\n } else {\n this.pointerZone.style.cursor = 'none'\n }\n }\n\n setBrushVisibility(visible: boolean) {\n this.brush.style.opacity = visible ? '1' : '0'\n }\n\n setBrushPreviewGradientVisibility(visible: boolean) {\n this.brushPreviewGradient.style.display = visible ? 'block' : 'none'\n }\n\n async updateCursor() {\n const currentTool = await this.messageBroker.pull('currentTool')\n if (currentTool === Tools.PaintBucket) {\n this.pointerZone.style.cursor =\n \"url('/cursor/paintBucket.png') 30 25, auto\"\n this.setBrushOpacity(0)\n } else if (currentTool === Tools.ColorSelect) {\n this.pointerZone.style.cursor =\n \"url('/cursor/colorSelect.png') 15 25, auto\"\n this.setBrushOpacity(0)\n } else {\n this.pointerZone.style.cursor = 'none'\n this.setBrushOpacity(1)\n }\n\n this.updateBrushPreview()\n this.setBrushPreviewGradientVisibility(false)\n }\n\n setZoomText(zoomText: string) {\n this.zoomTextHTML.innerText = zoomText\n }\n\n setDimensionsText(dimensionsText: string) {\n this.dimensionsTextHTML.innerText = dimensionsText\n }\n}\n\nclass ToolManager {\n maskEditor: MaskEditorDialog\n messageBroker: MessageBroker\n mouseDownPoint: Point | null = null\n\n currentTool: Tools = Tools.Pen\n isAdjustingBrush: boolean = false // is user adjusting brush size or hardness with alt + right mouse button\n\n constructor(maskEditor: MaskEditorDialog) {\n this.maskEditor = maskEditor\n this.messageBroker = maskEditor.getMessageBroker()\n this.addListeners()\n this.addPullTopics()\n }\n\n private addListeners() {\n this.messageBroker.subscribe('setTool', async (tool: Tools) => {\n this.setTool(tool)\n })\n\n this.messageBroker.subscribe('pointerDown', async (event: PointerEvent) => {\n this.handlePointerDown(event)\n })\n\n this.messageBroker.subscribe('pointerMove', async (event: PointerEvent) => {\n this.handlePointerMove(event)\n })\n\n this.messageBroker.subscribe('pointerUp', async (event: PointerEvent) => {\n this.handlePointerUp(event)\n })\n\n this.messageBroker.subscribe('wheel', async (event: WheelEvent) => {\n this.handleWheelEvent(event)\n })\n }\n\n private async addPullTopics() {\n this.messageBroker.createPullTopic('currentTool', async () =>\n this.getCurrentTool()\n )\n }\n\n //tools\n\n setTool(tool: Tools) {\n this.currentTool = tool\n\n if (tool != Tools.ColorSelect) {\n this.messageBroker.publish('clearLastPoint')\n }\n }\n\n getCurrentTool() {\n return this.currentTool\n }\n\n private async handlePointerDown(event: PointerEvent) {\n event.preventDefault()\n if (event.pointerType == 'touch') return\n\n var isSpacePressed = await this.messageBroker.pull('isKeyPressed', ' ')\n\n // Pan canvas\n if (event.buttons === 4 || (event.buttons === 1 && isSpacePressed)) {\n this.messageBroker.publish('panStart', event)\n this.messageBroker.publish('setBrushVisibility', false)\n return\n }\n\n //paint bucket\n if (this.currentTool === Tools.PaintBucket && event.button === 0) {\n const offset = { x: event.offsetX, y: event.offsetY }\n const coords_canvas = await this.messageBroker.pull(\n 'screenToCanvas',\n offset\n )\n this.messageBroker.publish('paintBucketFill', coords_canvas)\n this.messageBroker.publish('saveState')\n return\n }\n\n if (this.currentTool === Tools.ColorSelect && event.button === 0) {\n const offset = { x: event.offsetX, y: event.offsetY }\n const coords_canvas = await this.messageBroker.pull(\n 'screenToCanvas',\n offset\n )\n this.messageBroker.publish('colorSelectFill', coords_canvas)\n return\n }\n\n // (brush resize/change hardness) Check for alt + right mouse button\n if (event.altKey && event.button === 2) {\n this.isAdjustingBrush = true\n this.messageBroker.publish('brushAdjustmentStart', event)\n return\n }\n\n var isDrawingTool = [Tools.Pen, Tools.Eraser].includes(this.currentTool)\n //drawing\n if ([0, 2].includes(event.button) && isDrawingTool) {\n this.messageBroker.publish('drawStart', event)\n return\n }\n }\n\n private async handlePointerMove(event: PointerEvent) {\n event.preventDefault()\n if (event.pointerType == 'touch') return\n const newCursorPoint = { x: event.clientX, y: event.clientY }\n this.messageBroker.publish('cursorPoint', newCursorPoint)\n\n var isSpacePressed = await this.messageBroker.pull('isKeyPressed', ' ')\n this.messageBroker.publish('updateBrushPreview')\n\n //move the canvas\n if (event.buttons === 4 || (event.buttons === 1 && isSpacePressed)) {\n this.messageBroker.publish('panMove', event)\n return\n }\n\n //prevent drawing with other tools\n\n var isDrawingTool = [Tools.Pen, Tools.Eraser].includes(this.currentTool)\n if (!isDrawingTool) return\n\n // alt + right mouse button hold brush adjustment\n if (\n this.isAdjustingBrush &&\n (this.currentTool === Tools.Pen || this.currentTool === Tools.Eraser) &&\n event.altKey &&\n event.buttons === 2\n ) {\n this.messageBroker.publish('brushAdjustment', event)\n return\n }\n\n //draw with pen or eraser\n if (event.buttons == 1 || event.buttons == 2) {\n this.messageBroker.publish('draw', event)\n return\n }\n }\n\n private handlePointerUp(event: PointerEvent) {\n this.messageBroker.publish('panCursor', false)\n if (event.pointerType === 'touch') return\n this.messageBroker.publish('updateCursor')\n this.isAdjustingBrush = false\n this.messageBroker.publish('drawEnd', event)\n this.mouseDownPoint = null\n }\n\n private handleWheelEvent(event: WheelEvent) {\n this.messageBroker.publish('zoom', event)\n const newCursorPoint = { x: event.clientX, y: event.clientY }\n this.messageBroker.publish('cursorPoint', newCursorPoint)\n }\n}\n\nclass PanAndZoomManager {\n maskEditor: MaskEditorDialog\n messageBroker: MessageBroker\n\n DOUBLE_TAP_DELAY: number = 300\n lastTwoFingerTap: number = 0\n\n isTouchZooming: boolean = false\n lastTouchZoomDistance: number = 0\n lastTouchMidPoint: Point = { x: 0, y: 0 }\n lastTouchPoint: Point = { x: 0, y: 0 }\n\n zoom_ratio: number = 1\n interpolatedZoomRatio: number = 1\n pan_offset: Offset = { x: 0, y: 0 }\n\n mouseDownPoint: Point | null = null\n initialPan: Offset = { x: 0, y: 0 }\n\n canvasContainer: HTMLElement | null = null\n maskCanvas: HTMLCanvasElement | null = null\n rootElement: HTMLElement | null = null\n\n image: HTMLImageElement | null = null\n imageRootWidth: number = 0\n imageRootHeight: number = 0\n\n cursorPoint: Point = { x: 0, y: 0 }\n\n constructor(maskEditor: MaskEditorDialog) {\n this.maskEditor = maskEditor\n this.messageBroker = maskEditor.getMessageBroker()\n\n this.addListeners()\n this.addPullTopics()\n }\n\n private addListeners() {\n this.messageBroker.subscribe(\n 'initZoomPan',\n async (args: [HTMLImageElement, HTMLElement]) => {\n await this.initializeCanvasPanZoom(args[0], args[1])\n }\n )\n\n this.messageBroker.subscribe('panStart', async (event: PointerEvent) => {\n this.handlePanStart(event)\n })\n\n this.messageBroker.subscribe('panMove', async (event: PointerEvent) => {\n this.handlePanMove(event)\n })\n\n this.messageBroker.subscribe('zoom', async (event: WheelEvent) => {\n this.zoom(event)\n })\n\n this.messageBroker.subscribe('cursorPoint', async (point: Point) => {\n this.updateCursorPosition(point)\n })\n\n this.messageBroker.subscribe(\n 'handleTouchStart',\n async (event: TouchEvent) => {\n this.handleTouchStart(event)\n }\n )\n\n this.messageBroker.subscribe(\n 'handleTouchMove',\n async (event: TouchEvent) => {\n this.handleTouchMove(event)\n }\n )\n\n this.messageBroker.subscribe(\n 'handleTouchEnd',\n async (event: TouchEvent) => {\n this.handleTouchEnd(event)\n }\n )\n\n this.messageBroker.subscribe('resetZoom', async () => {\n if (this.interpolatedZoomRatio === 1) return\n await this.smoothResetView()\n })\n }\n\n private addPullTopics() {\n this.messageBroker.createPullTopic(\n 'cursorPoint',\n async () => this.cursorPoint\n )\n this.messageBroker.createPullTopic('zoomRatio', async () => this.zoom_ratio)\n this.messageBroker.createPullTopic('panOffset', async () => this.pan_offset)\n }\n\n handleTouchStart(event: TouchEvent) {\n event.preventDefault()\n if ((event.touches[0] as any).touchType === 'stylus') return\n this.messageBroker.publish('setBrushVisibility', false)\n if (event.touches.length === 2) {\n const currentTime = new Date().getTime()\n const tapTimeDiff = currentTime - this.lastTwoFingerTap\n\n if (tapTimeDiff < this.DOUBLE_TAP_DELAY) {\n // Double tap detected\n this.handleDoubleTap()\n this.lastTwoFingerTap = 0 // Reset to prevent triple-tap\n } else {\n this.lastTwoFingerTap = currentTime\n\n // Existing two-finger touch logic\n this.isTouchZooming = true\n this.lastTouchZoomDistance = this.getTouchDistance(event.touches)\n const midpoint = this.getTouchMidpoint(event.touches)\n this.lastTouchMidPoint = midpoint\n }\n } else if (event.touches.length === 1) {\n this.lastTouchPoint = {\n x: event.touches[0].clientX,\n y: event.touches[0].clientY\n }\n }\n }\n\n async handleTouchMove(event: TouchEvent) {\n event.preventDefault()\n if ((event.touches[0] as any).touchType === 'stylus') return\n\n this.lastTwoFingerTap = 0\n if (this.isTouchZooming && event.touches.length === 2) {\n // Handle zooming\n const newDistance = this.getTouchDistance(event.touches)\n const zoomFactor = newDistance / this.lastTouchZoomDistance\n const oldZoom = this.zoom_ratio\n this.zoom_ratio = Math.max(\n 0.2,\n Math.min(10.0, this.zoom_ratio * zoomFactor)\n )\n const newZoom = this.zoom_ratio\n\n // Calculate the midpoint of the two touches\n const midpoint = this.getTouchMidpoint(event.touches)\n\n // Handle panning - calculate the movement of the midpoint\n if (this.lastTouchMidPoint) {\n const deltaX = midpoint.x - this.lastTouchMidPoint.x\n const deltaY = midpoint.y - this.lastTouchMidPoint.y\n\n // Apply the pan\n this.pan_offset.x += deltaX\n this.pan_offset.y += deltaY\n }\n\n // Get touch position relative to the container\n if (this.maskCanvas === null) {\n this.maskCanvas = await this.messageBroker.pull('maskCanvas')\n }\n const rect = this.maskCanvas!.getBoundingClientRect()\n const touchX = midpoint.x - rect.left\n const touchY = midpoint.y - rect.top\n\n // Calculate new pan position based on zoom\n const scaleFactor = newZoom / oldZoom\n this.pan_offset.x += touchX - touchX * scaleFactor\n this.pan_offset.y += touchY - touchY * scaleFactor\n\n this.invalidatePanZoom()\n this.lastTouchZoomDistance = newDistance\n this.lastTouchMidPoint = midpoint\n } else if (event.touches.length === 1) {\n // Handle single touch pan\n this.handleSingleTouchPan(event.touches[0])\n }\n }\n\n handleTouchEnd(event: TouchEvent) {\n event.preventDefault()\n if (\n event.touches.length === 0 &&\n (event.touches[0] as any).touchType === 'stylus'\n ) {\n return\n }\n\n this.isTouchZooming = false\n this.lastTouchMidPoint = { x: 0, y: 0 }\n\n if (event.touches.length === 0) {\n this.lastTouchPoint = { x: 0, y: 0 }\n } else if (event.touches.length === 1) {\n this.lastTouchPoint = {\n x: event.touches[0].clientX,\n y: event.touches[0].clientY\n }\n }\n }\n\n private getTouchDistance(touches: TouchList) {\n const dx = touches[0].clientX - touches[1].clientX\n const dy = touches[0].clientY - touches[1].clientY\n return Math.sqrt(dx * dx + dy * dy)\n }\n\n private getTouchMidpoint(touches: TouchList) {\n return {\n x: (touches[0].clientX + touches[1].clientX) / 2,\n y: (touches[0].clientY + touches[1].clientY) / 2\n }\n }\n\n private async handleSingleTouchPan(touch: Touch) {\n if (this.lastTouchPoint === null) {\n this.lastTouchPoint = { x: touch.clientX, y: touch.clientY }\n return\n }\n\n const deltaX = touch.clientX - this.lastTouchPoint.x\n const deltaY = touch.clientY - this.lastTouchPoint.y\n\n this.pan_offset.x += deltaX\n this.pan_offset.y += deltaY\n\n await this.invalidatePanZoom()\n\n this.lastTouchPoint = { x: touch.clientX, y: touch.clientY }\n }\n\n private updateCursorPosition(clientPoint: Point) {\n var cursorX = clientPoint.x - this.pan_offset.x\n var cursorY = clientPoint.y - this.pan_offset.y\n\n this.cursorPoint = { x: cursorX, y: cursorY }\n }\n\n //prob redundant\n handleDoubleTap() {\n this.messageBroker.publish('undo')\n // Add any additional logic needed after undo\n }\n\n async zoom(event: WheelEvent) {\n // Store original cursor position\n const cursorPoint = { x: event.clientX, y: event.clientY }\n\n // zoom canvas\n const oldZoom = this.zoom_ratio\n const zoomFactor = event.deltaY < 0 ? 1.1 : 0.9\n this.zoom_ratio = Math.max(\n 0.2,\n Math.min(10.0, this.zoom_ratio * zoomFactor)\n )\n const newZoom = this.zoom_ratio\n\n const maskCanvas = await this.messageBroker.pull('maskCanvas')\n\n // Get mouse position relative to the container\n const rect = maskCanvas.getBoundingClientRect()\n const mouseX = cursorPoint.x - rect.left\n const mouseY = cursorPoint.y - rect.top\n\n console.log(oldZoom, newZoom)\n // Calculate new pan position\n const scaleFactor = newZoom / oldZoom\n this.pan_offset.x += mouseX - mouseX * scaleFactor\n this.pan_offset.y += mouseY - mouseY * scaleFactor\n\n // Update pan and zoom immediately\n await this.invalidatePanZoom()\n\n const newImageWidth = maskCanvas.clientWidth\n\n const zoomRatio = newImageWidth / this.imageRootWidth\n\n this.interpolatedZoomRatio = zoomRatio\n\n this.messageBroker.publish('setZoomText', `${Math.round(zoomRatio * 100)}%`)\n\n // Update cursor position with new pan values\n this.updateCursorPosition(cursorPoint)\n\n // Update brush preview after pan/zoom is complete\n requestAnimationFrame(() => {\n this.messageBroker.publish('updateBrushPreview')\n })\n }\n\n private async smoothResetView(duration: number = 500) {\n // Store initial state\n const startZoom = this.zoom_ratio\n const startPan = { ...this.pan_offset }\n\n // Panel dimensions\n const sidePanelWidth = 220\n const toolPanelWidth = 64\n const topBarHeight = 44\n\n // Calculate available space\n const availableWidth =\n this.rootElement!.clientWidth - sidePanelWidth - toolPanelWidth\n const availableHeight = this.rootElement!.clientHeight - topBarHeight\n\n // Calculate target zoom\n const zoomRatioWidth = availableWidth / this.image!.width\n const zoomRatioHeight = availableHeight / this.image!.height\n const targetZoom = Math.min(zoomRatioWidth, zoomRatioHeight)\n\n // Calculate final dimensions\n const aspectRatio = this.image!.width / this.image!.height\n let finalWidth = 0\n let finalHeight = 0\n\n // Calculate target pan position\n const targetPan = { x: toolPanelWidth, y: topBarHeight }\n\n if (zoomRatioHeight > zoomRatioWidth) {\n finalWidth = availableWidth\n finalHeight = finalWidth / aspectRatio\n targetPan.y = (availableHeight - finalHeight) / 2 + topBarHeight\n } else {\n finalHeight = availableHeight\n finalWidth = finalHeight * aspectRatio\n targetPan.x = (availableWidth - finalWidth) / 2 + toolPanelWidth\n }\n\n const startTime = performance.now()\n const animate = (currentTime: number) => {\n const elapsed = currentTime - startTime\n const progress = Math.min(elapsed / duration, 1)\n // Cubic easing out for smooth deceleration\n const eased = 1 - Math.pow(1 - progress, 3)\n\n // Calculate intermediate zoom and pan values\n const currentZoom = startZoom + (targetZoom - startZoom) * eased\n\n this.zoom_ratio = currentZoom\n this.pan_offset.x = startPan.x + (targetPan.x - startPan.x) * eased\n this.pan_offset.y = startPan.y + (targetPan.y - startPan.y) * eased\n\n this.invalidatePanZoom()\n\n const interpolatedZoomRatio = startZoom + (1.0 - startZoom) * eased\n\n this.messageBroker.publish(\n 'setZoomText',\n `${Math.round(interpolatedZoomRatio * 100)}%`\n )\n\n if (progress < 1) {\n requestAnimationFrame(animate)\n }\n }\n\n requestAnimationFrame(animate)\n this.interpolatedZoomRatio = 1.0\n }\n\n async initializeCanvasPanZoom(\n image: HTMLImageElement,\n rootElement: HTMLElement\n ) {\n // Get side panel width\n let sidePanelWidth = 220\n const toolPanelWidth = 64\n let topBarHeight = 44\n\n this.rootElement = rootElement\n\n // Calculate available width accounting for both side panels\n let availableWidth =\n rootElement.clientWidth - sidePanelWidth - toolPanelWidth\n let availableHeight = rootElement.clientHeight - topBarHeight\n\n let zoomRatioWidth = availableWidth / image.width\n let zoomRatioHeight = availableHeight / image.height\n\n let aspectRatio = image.width / image.height\n\n let finalWidth = 0\n let finalHeight = 0\n\n let pan_offset: Offset = { x: toolPanelWidth, y: topBarHeight }\n\n if (zoomRatioHeight > zoomRatioWidth) {\n finalWidth = availableWidth\n finalHeight = finalWidth / aspectRatio\n pan_offset.y = (availableHeight - finalHeight) / 2 + topBarHeight\n } else {\n finalHeight = availableHeight\n finalWidth = finalHeight * aspectRatio\n pan_offset.x = (availableWidth - finalWidth) / 2 + toolPanelWidth\n }\n\n if (this.image === null) {\n this.image = image\n }\n\n this.imageRootWidth = finalWidth\n this.imageRootHeight = finalHeight\n\n this.zoom_ratio = Math.min(zoomRatioWidth, zoomRatioHeight)\n this.pan_offset = pan_offset\n\n await this.invalidatePanZoom()\n }\n\n async invalidatePanZoom() {\n // Single validation check upfront\n if (\n !this.image?.width ||\n !this.image?.height ||\n !this.pan_offset ||\n !this.zoom_ratio\n ) {\n console.warn('Missing required properties for pan/zoom')\n return\n }\n\n // Now TypeScript knows these are non-null\n const raw_width = this.image.width * this.zoom_ratio\n const raw_height = this.image.height * this.zoom_ratio\n\n // Get canvas container\n this.canvasContainer ??=\n await this.messageBroker?.pull('getCanvasContainer')\n if (!this.canvasContainer) return\n\n // Apply styles\n Object.assign(this.canvasContainer.style, {\n width: `${raw_width}px`,\n height: `${raw_height}px`,\n left: `${this.pan_offset.x}px`,\n top: `${this.pan_offset.y}px`\n })\n }\n\n private handlePanStart(event: PointerEvent) {\n let coords_canvas = this.messageBroker.pull('screenToCanvas', {\n x: event.offsetX,\n y: event.offsetY\n })\n this.mouseDownPoint = { x: event.clientX, y: event.clientY }\n this.messageBroker.publish('panCursor', true)\n this.initialPan = this.pan_offset\n return\n }\n\n private handlePanMove(event: PointerEvent) {\n if (this.mouseDownPoint === null) throw new Error('mouseDownPoint is null')\n\n let deltaX = this.mouseDownPoint.x - event.clientX\n let deltaY = this.mouseDownPoint.y - event.clientY\n\n let pan_x = this.initialPan.x - deltaX\n let pan_y = this.initialPan.y - deltaY\n\n this.pan_offset = { x: pan_x, y: pan_y }\n\n this.invalidatePanZoom()\n }\n}\n\nclass MessageBroker {\n private pushTopics: Record = {}\n private pullTopics: Record Promise> = {}\n\n constructor() {\n this.registerListeners()\n }\n\n // Push\n\n private registerListeners() {\n // Register listeners\n this.createPushTopic('panStart')\n this.createPushTopic('paintBucketFill')\n this.createPushTopic('saveState')\n this.createPushTopic('brushAdjustmentStart')\n this.createPushTopic('drawStart')\n this.createPushTopic('panMove')\n this.createPushTopic('updateBrushPreview')\n this.createPushTopic('brushAdjustment')\n this.createPushTopic('draw')\n this.createPushTopic('paintBucketCursor')\n this.createPushTopic('panCursor')\n this.createPushTopic('drawEnd')\n this.createPushTopic('zoom')\n this.createPushTopic('undo')\n this.createPushTopic('redo')\n this.createPushTopic('cursorPoint')\n this.createPushTopic('panOffset')\n this.createPushTopic('zoomRatio')\n this.createPushTopic('getMaskCanvas')\n this.createPushTopic('getCanvasContainer')\n this.createPushTopic('screenToCanvas')\n this.createPushTopic('isKeyPressed')\n this.createPushTopic('isCombinationPressed')\n this.createPushTopic('setPaintBucketTolerance')\n this.createPushTopic('setBrushSize')\n this.createPushTopic('setBrushHardness')\n this.createPushTopic('setBrushOpacity')\n this.createPushTopic('setBrushShape')\n this.createPushTopic('initZoomPan')\n this.createPushTopic('setTool')\n this.createPushTopic('pointerDown')\n this.createPushTopic('pointerMove')\n this.createPushTopic('pointerUp')\n this.createPushTopic('wheel')\n this.createPushTopic('initPaintBucketTool')\n this.createPushTopic('setBrushVisibility')\n this.createPushTopic('setBrushPreviewGradientVisibility')\n this.createPushTopic('handleTouchStart')\n this.createPushTopic('handleTouchMove')\n this.createPushTopic('handleTouchEnd')\n this.createPushTopic('colorSelectFill')\n this.createPushTopic('setColorSelectTolerance')\n this.createPushTopic('setLivePreview')\n this.createPushTopic('updateCursor')\n this.createPushTopic('setColorComparisonMethod')\n this.createPushTopic('clearLastPoint')\n this.createPushTopic('setWholeImage')\n this.createPushTopic('setMaskBoundary')\n this.createPushTopic('setMaskTolerance')\n this.createPushTopic('setBrushSmoothingPrecision')\n this.createPushTopic('setZoomText')\n this.createPushTopic('resetZoom')\n this.createPushTopic('invert')\n }\n\n /**\n * Creates a new push topic (listener is notified)\n *\n * @param {string} topicName - The name of the topic to create.\n * @throws {Error} If the topic already exists.\n */\n createPushTopic(topicName: string) {\n if (this.topicExists(this.pushTopics, topicName)) {\n throw new Error('Topic already exists')\n }\n this.pushTopics[topicName] = []\n }\n\n /**\n * Subscribe a callback function to the given topic.\n *\n * @param {string} topicName - The name of the topic to subscribe to.\n * @param {Callback} callback - The callback function to be subscribed.\n * @throws {Error} If the topic does not exist.\n */\n subscribe(topicName: string, callback: Callback) {\n if (!this.topicExists(this.pushTopics, topicName)) {\n throw new Error(`Topic \"${topicName}\" does not exist!`)\n }\n this.pushTopics[topicName].push(callback)\n }\n\n /**\n * Removes a callback function from the list of subscribers for a given topic.\n *\n * @param {string} topicName - The name of the topic to unsubscribe from.\n * @param {Callback} callback - The callback function to remove from the subscribers list.\n * @throws {Error} If the topic does not exist in the list of topics.\n */\n unsubscribe(topicName: string, callback: Callback) {\n if (!this.topicExists(this.pushTopics, topicName)) {\n throw new Error('Topic does not exist')\n }\n const index = this.pushTopics[topicName].indexOf(callback)\n if (index > -1) {\n this.pushTopics[topicName].splice(index, 1)\n }\n }\n\n /**\n * Publishes data to a specified topic with variable number of arguments.\n * @param {string} topicName - The name of the topic to publish to.\n * @param {...any[]} args - Variable number of arguments to pass to subscribers\n * @throws {Error} If the specified topic does not exist.\n */\n publish(topicName: string, ...args: any[]) {\n if (!this.topicExists(this.pushTopics, topicName)) {\n throw new Error(`Topic \"${topicName}\" does not exist!`)\n }\n\n this.pushTopics[topicName].forEach((callback) => {\n callback(...args)\n })\n }\n\n // Pull\n\n /**\n * Creates a new pull topic (listener must request data)\n *\n * @param {string} topicName - The name of the topic to create.\n * @param {() => Promise} callBack - The callback function to be called when data is requested.\n * @throws {Error} If the topic already exists.\n */\n createPullTopic(topicName: string, callBack: (data?: any) => Promise) {\n if (this.topicExists(this.pullTopics, topicName)) {\n throw new Error('Topic already exists')\n }\n this.pullTopics[topicName] = callBack\n }\n\n /**\n * Requests data from a specified pull topic.\n * @param {string} topicName - The name of the topic to request data from.\n * @returns {Promise} - The data from the pull topic.\n * @throws {Error} If the specified topic does not exist.\n */\n async pull(topicName: string, data?: any): Promise {\n if (!this.topicExists(this.pullTopics, topicName)) {\n throw new Error('Topic does not exist')\n }\n\n const callBack = this.pullTopics[topicName]\n try {\n const result = await callBack(data)\n return result\n } catch (error) {\n console.error(`Error pulling data from topic \"${topicName}\":`, error)\n throw error\n }\n }\n\n // Helper Methods\n\n /**\n * Checks if a topic exists in the given topics object.\n * @param {Record} topics - The topics object to check.\n * @param {string} topicName - The name of the topic to check.\n * @returns {boolean} - True if the topic exists, false otherwise.\n */\n private topicExists(topics: Record, topicName: string): boolean {\n return topics.hasOwnProperty(topicName)\n }\n}\n\nclass KeyboardManager {\n private keysDown: string[] = []\n private maskEditor: MaskEditorDialog\n private messageBroker: MessageBroker\n\n constructor(maskEditor: MaskEditorDialog) {\n this.maskEditor = maskEditor\n this.messageBroker = maskEditor.getMessageBroker()\n this.addPullTopics()\n }\n\n private addPullTopics() {\n // isKeyPressed\n this.messageBroker.createPullTopic('isKeyPressed', (key: string) =>\n Promise.resolve(this.isKeyDown(key))\n )\n }\n\n addListeners() {\n document.addEventListener('keydown', (event) => this.handleKeyDown(event))\n document.addEventListener('keyup', (event) => this.handleKeyUp(event))\n window.addEventListener('blur', () => this.clearKeys())\n }\n\n removeListeners() {\n document.removeEventListener('keydown', (event) =>\n this.handleKeyDown(event)\n )\n document.removeEventListener('keyup', (event) => this.handleKeyUp(event))\n }\n\n private clearKeys() {\n this.keysDown = []\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (!this.keysDown.includes(event.key)) {\n this.keysDown.push(event.key)\n }\n //if (this.redoCombinationPressed()) return\n //this.undoCombinationPressed()\n }\n\n private handleKeyUp(event: KeyboardEvent) {\n this.keysDown = this.keysDown.filter((key) => key !== event.key)\n }\n\n private isKeyDown(key: string) {\n return this.keysDown.includes(key)\n }\n\n // combinations\n\n private undoCombinationPressed() {\n const combination = ['ctrl', 'z']\n const keysDownLower = this.keysDown.map((key) => key.toLowerCase())\n const result = combination.every((key) => keysDownLower.includes(key))\n if (result) this.messageBroker.publish('undo')\n return result\n }\n\n private redoCombinationPressed() {\n const combination = ['ctrl', 'shift', 'z']\n const keysDownLower = this.keysDown.map((key) => key.toLowerCase())\n const result = combination.every((key) => keysDownLower.includes(key))\n if (result) this.messageBroker.publish('redo')\n return result\n }\n}\n\napp.registerExtension({\n name: 'Comfy.MaskEditor',\n settings: [\n {\n id: 'Comfy.MaskEditor.UseNewEditor',\n category: ['Mask Editor', 'NewEditor'],\n name: 'Use new mask editor',\n tooltip: 'Switch to the new mask editor interface',\n type: 'boolean',\n defaultValue: true,\n experimental: true\n },\n {\n id: 'Comfy.MaskEditor.BrushAdjustmentSpeed',\n category: ['Mask Editor', 'BrushAdjustment', 'Sensitivity'],\n name: 'Brush adjustment speed multiplier',\n tooltip:\n 'Controls how quickly the brush size and hardness change when adjusting. Higher values mean faster changes.',\n experimental: true,\n type: 'slider',\n attrs: {\n min: 0.1,\n max: 2.0,\n step: 0.1\n },\n defaultValue: 1.0,\n versionAdded: '1.0.0'\n },\n {\n id: 'Comfy.MaskEditor.UseDominantAxis',\n category: ['Mask Editor', 'BrushAdjustment', 'UseDominantAxis'],\n name: 'Lock brush adjustment to dominant axis',\n tooltip:\n 'When enabled, brush adjustments will only affect size OR hardness based on which direction you move more',\n type: 'boolean',\n defaultValue: true,\n experimental: true\n }\n ],\n init(app) {\n // Create function before assignment\n function openMaskEditor(): void {\n const useNewEditor = app.extensionManager.setting.get(\n 'Comfy.MaskEditor.UseNewEditor'\n )\n if (useNewEditor) {\n const dlg = MaskEditorDialog.getInstance() as any\n if (dlg?.isOpened && !dlg.isOpened()) {\n dlg.show()\n }\n } else {\n const dlg = MaskEditorDialogOld.getInstance() as any\n if (dlg?.isOpened && !dlg.isOpened()) {\n dlg.show()\n }\n }\n }\n\n // Assign the created function\n ;(ComfyApp as any).open_maskeditor = openMaskEditor\n\n // Ensure boolean return type\n const context_predicate = (): boolean => {\n return !!(\n ComfyApp.clipspace &&\n ComfyApp.clipspace.imgs &&\n ComfyApp.clipspace.imgs.length > 0\n )\n }\n\n ClipspaceDialog.registerButton(\n 'MaskEditor',\n context_predicate,\n openMaskEditor\n )\n }\n})\n","// @ts-strict-ignore\nimport { LGraphCanvas } from '@comfyorg/litegraph'\n\nimport { t } from '@/i18n'\nimport { useDialogService } from '@/services/dialogService'\nimport { useToastStore } from '@/stores/toastStore'\nimport { deserialiseAndCreate } from '@/utils/vintageClipboard'\n\nimport { api } from '../../scripts/api'\nimport { app } from '../../scripts/app'\nimport { $el, ComfyDialog } from '../../scripts/ui'\nimport { GroupNodeConfig, GroupNodeHandler } from './groupNode'\n\n// Adds the ability to save and add multiple nodes as a template\n// To save:\n// Select multiple nodes (ctrl + drag to select a region or ctrl+click individual nodes)\n// Right click the canvas\n// Save Node Template -> give it a name\n//\n// To add:\n// Right click the canvas\n// Node templates -> click the one to add\n//\n// To delete/rename:\n// Right click the canvas\n// Node templates -> Manage\n//\n// To rearrange:\n// Open the manage dialog and Drag and drop elements using the \"Name:\" label as handle\n\nconst id = 'Comfy.NodeTemplates'\nconst file = 'comfy.templates.json'\n\nclass ManageTemplates extends ComfyDialog {\n templates: any[]\n draggedEl: HTMLElement | null\n saveVisualCue: number | null\n emptyImg: HTMLImageElement\n importInput: HTMLInputElement\n\n constructor() {\n super()\n this.load().then((v) => {\n this.templates = v\n })\n\n this.element.classList.add('comfy-manage-templates')\n this.draggedEl = null\n this.saveVisualCue = null\n this.emptyImg = new Image()\n this.emptyImg.src =\n 'data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='\n\n this.importInput = $el('input', {\n type: 'file',\n accept: '.json',\n multiple: true,\n style: { display: 'none' },\n parent: document.body,\n onchange: () => this.importAll()\n }) as HTMLInputElement\n }\n\n createButtons() {\n const btns = super.createButtons()\n btns[0].textContent = 'Close'\n btns[0].onclick = (e) => {\n clearTimeout(this.saveVisualCue)\n this.close()\n }\n btns.unshift(\n $el('button', {\n type: 'button',\n textContent: 'Export',\n onclick: () => this.exportAll()\n })\n )\n btns.unshift(\n $el('button', {\n type: 'button',\n textContent: 'Import',\n onclick: () => {\n this.importInput.click()\n }\n })\n )\n return btns\n }\n\n async load() {\n let templates = []\n const res = await api.getUserData(file)\n if (res.status === 200) {\n try {\n templates = await res.json()\n } catch (error) {}\n } else if (res.status !== 404) {\n console.error(res.status + ' ' + res.statusText)\n }\n return templates ?? []\n }\n\n async store() {\n const templates = JSON.stringify(this.templates, undefined, 4)\n try {\n await api.storeUserData(file, templates, { stringify: false })\n } catch (error) {\n console.error(error)\n useToastStore().addAlert(error.message)\n }\n }\n\n async importAll() {\n for (const file of this.importInput.files) {\n if (file.type === 'application/json' || file.name.endsWith('.json')) {\n const reader = new FileReader()\n reader.onload = async () => {\n const importFile = JSON.parse(reader.result as string)\n if (importFile?.templates) {\n for (const template of importFile.templates) {\n if (template?.name && template?.data) {\n this.templates.push(template)\n }\n }\n await this.store()\n }\n }\n await reader.readAsText(file)\n }\n }\n\n this.importInput.value = null\n\n this.close()\n }\n\n exportAll() {\n if (this.templates.length == 0) {\n useToastStore().addAlert('No templates to export.')\n return\n }\n\n const json = JSON.stringify({ templates: this.templates }, null, 2) // convert the data to a JSON string\n const blob = new Blob([json], { type: 'application/json' })\n const url = URL.createObjectURL(blob)\n const a = $el('a', {\n href: url,\n download: 'node_templates.json',\n style: { display: 'none' },\n parent: document.body\n })\n a.click()\n setTimeout(function () {\n a.remove()\n window.URL.revokeObjectURL(url)\n }, 0)\n }\n\n show() {\n // Show list of template names + delete button\n super.show(\n $el(\n 'div',\n {},\n this.templates.flatMap((t, i) => {\n let nameInput\n return [\n $el(\n 'div',\n {\n dataset: { id: i.toString() },\n className: 'templateManagerRow',\n style: {\n display: 'grid',\n gridTemplateColumns: '1fr auto',\n border: '1px dashed transparent',\n gap: '5px',\n backgroundColor: 'var(--comfy-menu-bg)'\n },\n ondragstart: (e) => {\n this.draggedEl = e.currentTarget\n e.currentTarget.style.opacity = '0.6'\n e.currentTarget.style.border = '1px dashed yellow'\n e.dataTransfer.effectAllowed = 'move'\n e.dataTransfer.setDragImage(this.emptyImg, 0, 0)\n },\n ondragend: (e) => {\n e.target.style.opacity = '1'\n e.currentTarget.style.border = '1px dashed transparent'\n e.currentTarget.removeAttribute('draggable')\n\n // rearrange the elements\n this.element\n .querySelectorAll('.templateManagerRow')\n .forEach((el: HTMLElement, i) => {\n var prev_i = Number.parseInt(el.dataset.id)\n\n if (el == this.draggedEl && prev_i != i) {\n this.templates.splice(\n i,\n 0,\n this.templates.splice(prev_i, 1)[0]\n )\n }\n el.dataset.id = i.toString()\n })\n this.store()\n },\n ondragover: (e) => {\n e.preventDefault()\n if (e.currentTarget == this.draggedEl) return\n\n let rect = e.currentTarget.getBoundingClientRect()\n if (e.clientY > rect.top + rect.height / 2) {\n e.currentTarget.parentNode.insertBefore(\n this.draggedEl,\n e.currentTarget.nextSibling\n )\n } else {\n e.currentTarget.parentNode.insertBefore(\n this.draggedEl,\n e.currentTarget\n )\n }\n }\n },\n [\n $el(\n 'label',\n {\n textContent: 'Name: ',\n style: {\n cursor: 'grab'\n },\n onmousedown: (e) => {\n // enable dragging only from the label\n if (e.target.localName == 'label')\n e.currentTarget.parentNode.draggable = 'true'\n }\n },\n [\n $el('input', {\n value: t.name,\n dataset: { name: t.name },\n style: {\n transitionProperty: 'background-color',\n transitionDuration: '0s'\n },\n onchange: (e) => {\n clearTimeout(this.saveVisualCue)\n var el = e.target\n var row = el.parentNode.parentNode\n this.templates[row.dataset.id].name =\n el.value.trim() || 'untitled'\n this.store()\n el.style.backgroundColor = 'rgb(40, 95, 40)'\n el.style.transitionDuration = '0s'\n // @ts-expect-error\n // In browser env the return value is number.\n this.saveVisualCue = setTimeout(function () {\n el.style.transitionDuration = '.7s'\n el.style.backgroundColor = 'var(--comfy-input-bg)'\n }, 15)\n },\n onkeypress: (e) => {\n var el = e.target\n clearTimeout(this.saveVisualCue)\n el.style.transitionDuration = '0s'\n el.style.backgroundColor = 'var(--comfy-input-bg)'\n },\n $: (el) => (nameInput = el)\n })\n ]\n ),\n $el('div', {}, [\n $el('button', {\n textContent: 'Export',\n style: {\n fontSize: '12px',\n fontWeight: 'normal'\n },\n onclick: (e) => {\n const json = JSON.stringify({ templates: [t] }, null, 2) // convert the data to a JSON string\n const blob = new Blob([json], {\n type: 'application/json'\n })\n const url = URL.createObjectURL(blob)\n const a = $el('a', {\n href: url,\n download: (nameInput.value || t.name) + '.json',\n style: { display: 'none' },\n parent: document.body\n })\n a.click()\n setTimeout(function () {\n a.remove()\n window.URL.revokeObjectURL(url)\n }, 0)\n }\n }),\n $el('button', {\n textContent: 'Delete',\n style: {\n fontSize: '12px',\n color: 'red',\n fontWeight: 'normal'\n },\n onclick: (e) => {\n const item = e.target.parentNode.parentNode\n item.parentNode.removeChild(item)\n this.templates.splice(item.dataset.id * 1, 1)\n this.store()\n // update the rows index, setTimeout ensures that the list is updated\n var that = this\n setTimeout(function () {\n that.element\n .querySelectorAll('.templateManagerRow')\n .forEach((el: HTMLElement, i) => {\n el.dataset.id = i.toString()\n })\n }, 0)\n }\n })\n ])\n ]\n )\n ]\n })\n )\n )\n }\n}\n\napp.registerExtension({\n name: id,\n setup() {\n const manage = new ManageTemplates()\n\n const clipboardAction = async (cb) => {\n // We use the clipboard functions but dont want to overwrite the current user clipboard\n // Restore it after we've run our callback\n const old = localStorage.getItem('litegrapheditor_clipboard')\n await cb()\n localStorage.setItem('litegrapheditor_clipboard', old)\n }\n\n const orig = LGraphCanvas.prototype.getCanvasMenuOptions\n LGraphCanvas.prototype.getCanvasMenuOptions = function () {\n const options = orig.apply(this, arguments)\n\n options.push(null)\n options.push({\n content: `Save Selected as Template`,\n disabled: !Object.keys(app.canvas.selected_nodes || {}).length,\n callback: async () => {\n const name = await useDialogService().prompt({\n title: t('nodeTemplates.saveAsTemplate'),\n message: t('nodeTemplates.enterName'),\n defaultValue: ''\n })\n if (!name?.trim()) return\n\n clipboardAction(() => {\n app.canvas.copyToClipboard()\n let data = localStorage.getItem('litegrapheditor_clipboard')\n data = JSON.parse(data)\n const nodeIds = Object.keys(app.canvas.selected_nodes)\n for (let i = 0; i < nodeIds.length; i++) {\n const node = app.graph.getNodeById(nodeIds[i])\n const nodeData = node?.constructor.nodeData\n\n let groupData = GroupNodeHandler.getGroupData(node)\n if (groupData) {\n groupData = groupData.nodeData\n // @ts-expect-error\n if (!data.groupNodes) {\n // @ts-expect-error\n data.groupNodes = {}\n }\n // @ts-expect-error\n data.groupNodes[nodeData.name] = groupData\n // @ts-expect-error\n data.nodes[i].type = nodeData.name\n }\n }\n\n manage.templates.push({\n name,\n data: JSON.stringify(data)\n })\n manage.store()\n })\n }\n })\n\n // Map each template to a menu item\n const subItems = manage.templates.map((t) => {\n return {\n content: t.name,\n callback: () => {\n clipboardAction(async () => {\n const data = JSON.parse(t.data)\n await GroupNodeConfig.registerFromWorkflow(data.groupNodes, {})\n\n // Check for old clipboard format\n if (!data.reroutes) {\n deserialiseAndCreate(t.data, app.canvas)\n } else {\n localStorage.setItem('litegrapheditor_clipboard', t.data)\n app.canvas.pasteFromClipboard()\n }\n })\n }\n }\n })\n\n subItems.push(null, {\n content: 'Manage',\n callback: () => manage.show()\n })\n\n options.push({\n content: 'Node Templates',\n submenu: {\n options: subItems\n }\n })\n\n return options\n }\n }\n})\n","// @ts-strict-ignore\nimport { LGraphCanvas, LiteGraph } from '@comfyorg/litegraph'\nimport { LGraphNode } from '@comfyorg/litegraph'\n\nimport { app } from '../../scripts/app'\nimport { ComfyWidgets } from '../../scripts/widgets'\n\n// Node that add notes to your project\n\napp.registerExtension({\n name: 'Comfy.NoteNode',\n registerCustomNodes() {\n class NoteNode extends LGraphNode {\n static category: string\n static collapsable: boolean\n static title_mode: number\n\n color = LGraphCanvas.node_colors.yellow.color\n bgcolor = LGraphCanvas.node_colors.yellow.bgcolor\n groupcolor = LGraphCanvas.node_colors.yellow.groupcolor\n isVirtualNode: boolean\n\n constructor(title?: string) {\n super(title)\n if (!this.properties) {\n this.properties = { text: '' }\n }\n ComfyWidgets.STRING(\n // Should we extends LGraphNode? Yesss\n this,\n '',\n ['', { default: this.properties.text, multiline: true }],\n app\n )\n\n this.serialize_widgets = true\n this.isVirtualNode = true\n }\n }\n\n // Load default visibility\n\n LiteGraph.registerNodeType(\n 'Note',\n Object.assign(NoteNode, {\n title_mode: LiteGraph.NORMAL_TITLE,\n title: 'Note',\n collapsable: true\n })\n )\n\n NoteNode.category = 'utils'\n\n /** Markdown variant of NoteNode */\n class MarkdownNoteNode extends LGraphNode {\n static title = 'Markdown Note'\n\n color = LGraphCanvas.node_colors.yellow.color\n bgcolor = LGraphCanvas.node_colors.yellow.bgcolor\n groupcolor = LGraphCanvas.node_colors.yellow.groupcolor\n\n constructor(title?: string) {\n super(title)\n if (!this.properties) {\n this.properties = { text: '' }\n }\n ComfyWidgets.MARKDOWN(\n this,\n '',\n ['', { default: this.properties.text }],\n app\n )\n\n this.serialize_widgets = true\n this.isVirtualNode = true\n }\n }\n\n LiteGraph.registerNodeType('MarkdownNote', MarkdownNoteNode)\n MarkdownNoteNode.category = 'utils'\n }\n})\n","// @ts-strict-ignore\nimport type { IContextMenuValue } from '@comfyorg/litegraph'\nimport { LGraphCanvas, LGraphNode, LiteGraph } from '@comfyorg/litegraph'\n\nimport { app } from '../../scripts/app'\nimport { getWidgetConfig, mergeIfValid, setWidgetConfig } from './widgetInputs'\n\n// Node that allows you to redirect connections for cleaner graphs\n\napp.registerExtension({\n name: 'Comfy.RerouteNode',\n registerCustomNodes(app) {\n interface RerouteNode extends LGraphNode {\n __outputType?: string\n }\n\n class RerouteNode extends LGraphNode {\n static category: string | undefined\n static defaultVisibility = false\n\n constructor(title?: string) {\n super(title)\n if (!this.properties) {\n this.properties = {}\n }\n this.properties.showOutputText = RerouteNode.defaultVisibility\n this.properties.horizontal = false\n\n this.addInput('', '*')\n this.addOutput(this.properties.showOutputText ? '*' : '', '*')\n\n this.onAfterGraphConfigured = function () {\n requestAnimationFrame(() => {\n this.onConnectionsChange(LiteGraph.INPUT, null, true, null)\n })\n }\n\n this.onConnectionsChange = (type, index, connected, link_info) => {\n if (app.configuringGraph) return\n\n // Prevent multiple connections to different types when we have no input\n if (connected && type === LiteGraph.OUTPUT) {\n // Ignore wildcard nodes as these will be updated to real types\n const types = new Set(\n this.outputs[0].links\n .map((l) => app.graph.links[l].type)\n .filter((t) => t !== '*')\n )\n if (types.size > 1) {\n const linksToDisconnect = []\n for (let i = 0; i < this.outputs[0].links.length - 1; i++) {\n const linkId = this.outputs[0].links[i]\n const link = app.graph.links[linkId]\n linksToDisconnect.push(link)\n }\n for (const link of linksToDisconnect) {\n const node = app.graph.getNodeById(link.target_id)\n node.disconnectInput(link.target_slot)\n }\n }\n }\n\n // Find root input\n let currentNode: LGraphNode | null = this\n let updateNodes = []\n let inputType = null\n let inputNode = null\n while (currentNode) {\n updateNodes.unshift(currentNode)\n const linkId = currentNode.inputs[0].link\n if (linkId !== null) {\n const link = app.graph.links[linkId]\n if (!link) return\n const node = app.graph.getNodeById(link.origin_id)\n const type = node.constructor.type\n if (type === 'Reroute') {\n if (node === this) {\n // We've found a circle\n currentNode.disconnectInput(link.target_slot)\n currentNode = null\n } else {\n // Move the previous node\n currentNode = node\n }\n } else {\n // We've found the end\n inputNode = currentNode\n inputType = node.outputs[link.origin_slot]?.type ?? null\n break\n }\n } else {\n // This path has no input node\n currentNode = null\n break\n }\n }\n\n // Find all outputs\n const nodes: LGraphNode[] = [this]\n let outputType = null\n while (nodes.length) {\n currentNode = nodes.pop()\n const outputs =\n (currentNode.outputs ? currentNode.outputs[0].links : []) || []\n if (outputs.length) {\n for (const linkId of outputs) {\n const link = app.graph.links[linkId]\n\n // When disconnecting sometimes the link is still registered\n if (!link) continue\n\n const node = app.graph.getNodeById(link.target_id)\n const type = node.constructor.type\n\n if (type === 'Reroute') {\n // Follow reroute nodes\n nodes.push(node)\n updateNodes.push(node)\n } else {\n // We've found an output\n const nodeOutType =\n node.inputs &&\n node.inputs[link?.target_slot] &&\n node.inputs[link.target_slot].type\n ? node.inputs[link.target_slot].type\n : null\n if (\n inputType &&\n !LiteGraph.isValidConnection(inputType, nodeOutType)\n ) {\n // The output doesnt match our input so disconnect it\n node.disconnectInput(link.target_slot)\n } else {\n outputType = nodeOutType\n }\n }\n }\n } else {\n // No more outputs for this path\n }\n }\n\n const displayType = inputType || outputType || '*'\n const color = LGraphCanvas.link_type_colors[displayType]\n\n let widgetConfig\n let targetWidget\n let widgetType\n // Update the types of each node\n for (const node of updateNodes) {\n // If we dont have an input type we are always wildcard but we'll show the output type\n // This lets you change the output link to a different type and all nodes will update\n node.outputs[0].type = inputType || '*'\n node.__outputType = displayType\n node.outputs[0].name = node.properties.showOutputText\n ? displayType\n : ''\n node.setSize(node.computeSize())\n\n for (const l of node.outputs[0].links || []) {\n const link = app.graph.links[l]\n if (link) {\n link.color = color\n\n if (app.configuringGraph) continue\n const targetNode = app.graph.getNodeById(link.target_id)\n const targetInput = targetNode.inputs?.[link.target_slot]\n if (targetInput?.widget) {\n const config = getWidgetConfig(targetInput)\n if (!widgetConfig) {\n widgetConfig = config[1] ?? {}\n widgetType = config[0]\n }\n if (!targetWidget) {\n targetWidget = targetNode.widgets?.find(\n (w) => w.name === (targetInput.widget as any).name\n )\n }\n\n const merged = mergeIfValid(targetInput, [\n config[0],\n widgetConfig\n ])\n if (merged.customConfig) {\n widgetConfig = merged.customConfig\n }\n }\n }\n }\n }\n\n for (const node of updateNodes) {\n if (widgetConfig && outputType) {\n node.inputs[0].widget = { name: 'value' }\n setWidgetConfig(\n node.inputs[0],\n [widgetType ?? displayType, widgetConfig],\n targetWidget\n )\n } else {\n setWidgetConfig(node.inputs[0], null)\n }\n }\n\n if (inputNode) {\n const link = app.graph.links[inputNode.inputs[0].link]\n if (link) {\n link.color = color\n }\n }\n }\n\n this.clone = function () {\n const cloned = RerouteNode.prototype.clone.apply(this)\n cloned.removeOutput(0)\n cloned.addOutput(this.properties.showOutputText ? '*' : '', '*')\n cloned.setSize(cloned.computeSize())\n return cloned\n }\n\n // This node is purely frontend and does not impact the resulting prompt so should not be serialized\n this.isVirtualNode = true\n }\n\n getExtraMenuOptions(_, options): IContextMenuValue[] {\n options.unshift(\n {\n content:\n (this.properties.showOutputText ? 'Hide' : 'Show') + ' Type',\n callback: () => {\n this.properties.showOutputText = !this.properties.showOutputText\n if (this.properties.showOutputText) {\n this.outputs[0].name =\n this.__outputType || (this.outputs[0].type as string)\n } else {\n this.outputs[0].name = ''\n }\n this.setSize(this.computeSize())\n app.graph.setDirtyCanvas(true, true)\n }\n },\n {\n content:\n (RerouteNode.defaultVisibility ? 'Hide' : 'Show') +\n ' Type By Default',\n callback: () => {\n RerouteNode.setDefaultTextVisibility(\n !RerouteNode.defaultVisibility\n )\n }\n }\n )\n return []\n }\n computeSize(): [number, number] {\n return [\n this.properties.showOutputText && this.outputs && this.outputs.length\n ? Math.max(\n 75,\n LiteGraph.NODE_TEXT_SIZE * this.outputs[0].name.length * 0.6 +\n 40\n )\n : 75,\n 26\n ]\n }\n\n static setDefaultTextVisibility(visible) {\n RerouteNode.defaultVisibility = visible\n if (visible) {\n localStorage['Comfy.RerouteNode.DefaultVisibility'] = 'true'\n } else {\n delete localStorage['Comfy.RerouteNode.DefaultVisibility']\n }\n }\n }\n\n // Load default visibility\n RerouteNode.setDefaultTextVisibility(\n !!localStorage['Comfy.RerouteNode.DefaultVisibility']\n )\n\n LiteGraph.registerNodeType(\n 'Reroute',\n Object.assign(RerouteNode, {\n title_mode: LiteGraph.NO_TITLE,\n title: 'Reroute',\n collapsable: false\n })\n )\n\n RerouteNode.category = 'utils'\n }\n})\n","// @ts-strict-ignore\nimport { app } from '../../scripts/app'\nimport { applyTextReplacements } from '../../scripts/utils'\n\n// Use widget values and dates in output filenames\n\napp.registerExtension({\n name: 'Comfy.SaveImageExtraOutput',\n async beforeRegisterNodeDef(nodeType, nodeData, app) {\n if (\n nodeData.name === 'SaveImage' ||\n nodeData.name === 'SaveAnimatedWEBP' ||\n nodeData.name === 'SaveAnimatedWEBM'\n ) {\n const onNodeCreated = nodeType.prototype.onNodeCreated\n // When the SaveImage node is created we want to override the serialization of the output name widget to run our S&R\n nodeType.prototype.onNodeCreated = function () {\n const r = onNodeCreated\n ? onNodeCreated.apply(this, arguments)\n : undefined\n\n const widget = this.widgets.find((w) => w.name === 'filename_prefix')\n widget.serializeValue = () => {\n return applyTextReplacements(app, widget.value)\n }\n\n return r\n }\n } else {\n // When any other node is created add a property to alias the node\n const onNodeCreated = nodeType.prototype.onNodeCreated\n nodeType.prototype.onNodeCreated = function () {\n const r = onNodeCreated\n ? onNodeCreated.apply(this, arguments)\n : undefined\n\n if (!this.properties || !('Node name for S&R' in this.properties)) {\n this.addProperty('Node name for S&R', this.constructor.type, 'string')\n }\n\n return r\n }\n }\n }\n})\n","// @ts-strict-ignore\nimport { LGraphCanvas, LiteGraph } from '@comfyorg/litegraph'\n\nimport { app } from '../../scripts/app'\n\nlet touchZooming\nlet touchCount = 0\n\napp.registerExtension({\n name: 'Comfy.SimpleTouchSupport',\n setup() {\n let touchDist\n let touchTime\n let lastTouch\n let lastScale\n function getMultiTouchPos(e) {\n return Math.hypot(\n e.touches[0].clientX - e.touches[1].clientX,\n e.touches[0].clientY - e.touches[1].clientY\n )\n }\n\n function getMultiTouchCenter(e) {\n return {\n clientX: (e.touches[0].clientX + e.touches[1].clientX) / 2,\n clientY: (e.touches[0].clientY + e.touches[1].clientY) / 2\n }\n }\n\n app.canvasEl.parentElement.addEventListener(\n 'touchstart',\n (e: TouchEvent) => {\n touchCount++\n lastTouch = null\n lastScale = null\n if (e.touches?.length === 1) {\n // Store start time for press+hold for context menu\n touchTime = new Date()\n lastTouch = e.touches[0]\n } else {\n touchTime = null\n if (e.touches?.length === 2) {\n // Store center pos for zoom\n lastScale = app.canvas.ds.scale\n lastTouch = getMultiTouchCenter(e)\n\n touchDist = getMultiTouchPos(e)\n app.canvas.pointer.isDown = false\n }\n }\n },\n true\n )\n\n app.canvasEl.parentElement.addEventListener('touchend', (e: TouchEvent) => {\n touchCount--\n\n if (e.touches?.length !== 1) touchZooming = false\n if (touchTime && !e.touches?.length) {\n if (new Date().getTime() - touchTime > 600) {\n if (e.target === app.canvasEl) {\n app.canvasEl.dispatchEvent(\n new PointerEvent('pointerdown', {\n button: 2,\n clientX: e.changedTouches[0].clientX,\n clientY: e.changedTouches[0].clientY\n })\n )\n e.preventDefault()\n }\n }\n touchTime = null\n }\n })\n\n app.canvasEl.parentElement.addEventListener(\n 'touchmove',\n (e) => {\n touchTime = null\n if (e.touches?.length === 2 && lastTouch && !e.ctrlKey && !e.shiftKey) {\n e.preventDefault() // Prevent browser from zooming when two textareas are touched\n app.canvas.pointer.isDown = false\n touchZooming = true\n\n LiteGraph.closeAllContextMenus(window)\n // @ts-expect-error\n app.canvas.search_box?.close()\n const newTouchDist = getMultiTouchPos(e)\n\n const center = getMultiTouchCenter(e)\n\n let scale = (lastScale * newTouchDist) / touchDist\n\n const newX = (center.clientX - lastTouch.clientX) / scale\n const newY = (center.clientY - lastTouch.clientY) / scale\n\n // Code from LiteGraph\n if (scale < app.canvas.ds.min_scale) {\n scale = app.canvas.ds.min_scale\n } else if (scale > app.canvas.ds.max_scale) {\n scale = app.canvas.ds.max_scale\n }\n\n const oldScale = app.canvas.ds.scale\n\n app.canvas.ds.scale = scale\n\n // Code from LiteGraph\n if (Math.abs(app.canvas.ds.scale - 1) < 0.01) {\n app.canvas.ds.scale = 1\n }\n\n const newScale = app.canvas.ds.scale\n\n const convertScaleToOffset = (scale) => [\n center.clientX / scale - app.canvas.ds.offset[0],\n center.clientY / scale - app.canvas.ds.offset[1]\n ]\n var oldCenter = convertScaleToOffset(oldScale)\n var newCenter = convertScaleToOffset(newScale)\n\n app.canvas.ds.offset[0] += newX + newCenter[0] - oldCenter[0]\n app.canvas.ds.offset[1] += newY + newCenter[1] - oldCenter[1]\n\n lastTouch.clientX = center.clientX\n lastTouch.clientY = center.clientY\n\n app.canvas.setDirty(true, true)\n }\n },\n true\n )\n }\n})\n\nconst processMouseDown = LGraphCanvas.prototype.processMouseDown\nLGraphCanvas.prototype.processMouseDown = function (e) {\n if (touchZooming || touchCount) {\n return\n }\n app.canvas.pointer.isDown = false // Prevent context menu from opening on second tap\n return processMouseDown.apply(this, arguments)\n}\n\nconst processMouseMove = LGraphCanvas.prototype.processMouseMove\nLGraphCanvas.prototype.processMouseMove = function (e) {\n if (touchZooming || touchCount > 1) {\n return\n }\n return processMouseMove.apply(this, arguments)\n}\n","import { LiteGraph } from '@comfyorg/litegraph'\n\nimport { app } from '../../scripts/app'\nimport { ComfyWidgets } from '../../scripts/widgets'\n\n// Adds defaults for quickly adding nodes with middle click on the input/output\n\napp.registerExtension({\n name: 'Comfy.SlotDefaults',\n suggestionsNumber: null,\n init() {\n LiteGraph.search_filter_enabled = true\n LiteGraph.middle_click_slot_add_default_node = true\n this.suggestionsNumber = app.ui.settings.addSetting({\n id: 'Comfy.NodeSuggestions.number',\n category: ['Comfy', 'Node Search Box', 'NodeSuggestions'],\n name: 'Number of nodes suggestions',\n tooltip: 'Only for litegraph searchbox/context menu',\n type: 'slider',\n attrs: {\n min: 1,\n max: 100,\n step: 1\n },\n defaultValue: 5,\n onChange: (newVal, oldVal) => {\n this.setDefaults(newVal)\n }\n })\n },\n slot_types_default_out: {},\n slot_types_default_in: {},\n async beforeRegisterNodeDef(nodeType, nodeData, app) {\n var nodeId = nodeData.name\n const inputs = nodeData['input']?.['required'] //only show required inputs to reduce the mess also not logical to create node with optional inputs\n for (const inputKey in inputs) {\n var input = inputs[inputKey]\n if (typeof input[0] !== 'string') continue\n\n var type = input[0]\n if (type in ComfyWidgets) {\n var customProperties = input[1]\n if (!customProperties?.forceInput) continue //ignore widgets that don't force input\n }\n\n if (!(type in this.slot_types_default_out)) {\n this.slot_types_default_out[type] = ['Reroute']\n }\n if (this.slot_types_default_out[type].includes(nodeId)) continue\n this.slot_types_default_out[type].push(nodeId)\n\n // Input types have to be stored as lower case\n // Store each node that can handle this input type\n const lowerType = type.toLocaleLowerCase()\n if (!(lowerType in LiteGraph.registered_slot_in_types)) {\n LiteGraph.registered_slot_in_types[lowerType] = { nodes: [] }\n }\n LiteGraph.registered_slot_in_types[lowerType].nodes.push(\n // @ts-expect-error ComfyNode\n nodeType.comfyClass\n )\n }\n\n var outputs = nodeData['output'] ?? []\n for (const el of outputs) {\n const type = el as string\n if (!(type in this.slot_types_default_in)) {\n this.slot_types_default_in[type] = ['Reroute'] // [\"Reroute\", \"Primitive\"]; primitive doesn't always work :'()\n }\n\n this.slot_types_default_in[type].push(nodeId)\n\n // Store each node that can handle this output type\n if (!(type in LiteGraph.registered_slot_out_types)) {\n LiteGraph.registered_slot_out_types[type] = { nodes: [] }\n }\n // @ts-expect-error ComfyNode\n LiteGraph.registered_slot_out_types[type].nodes.push(nodeType.comfyClass)\n\n if (!LiteGraph.slot_types_out.includes(type)) {\n LiteGraph.slot_types_out.push(type)\n }\n }\n\n var maxNum = this.suggestionsNumber.value\n this.setDefaults(maxNum)\n },\n setDefaults(maxNum?: number | null) {\n LiteGraph.slot_types_default_out = {}\n LiteGraph.slot_types_default_in = {}\n\n for (const type in this.slot_types_default_out) {\n LiteGraph.slot_types_default_out[type] = this.slot_types_default_out[\n type\n ].slice(0, maxNum)\n }\n for (const type in this.slot_types_default_in) {\n LiteGraph.slot_types_default_in[type] = this.slot_types_default_in[\n type\n ].slice(0, maxNum)\n }\n }\n})\n","// @ts-strict-ignore\nimport type { IWidget } from '@comfyorg/litegraph'\nimport type { IStringWidget } from '@comfyorg/litegraph/dist/types/widgets'\n\nimport { useNodeDragAndDrop } from '@/composables/node/useNodeDragAndDrop'\nimport { useNodeFileInput } from '@/composables/node/useNodeFileInput'\nimport type { DOMWidget } from '@/scripts/domWidget'\nimport { useToastStore } from '@/stores/toastStore'\nimport { ComfyNodeDef } from '@/types/apiTypes'\n\nimport { api } from '../../scripts/api'\nimport { app } from '../../scripts/app'\n\ntype FolderType = 'input' | 'output' | 'temp'\n\nfunction splitFilePath(path: string): [string, string] {\n const folder_separator = path.lastIndexOf('/')\n if (folder_separator === -1) {\n return ['', path]\n }\n return [\n path.substring(0, folder_separator),\n path.substring(folder_separator + 1)\n ]\n}\n\nfunction getResourceURL(\n subfolder: string,\n filename: string,\n type: FolderType = 'input'\n): string {\n const params = [\n 'filename=' + encodeURIComponent(filename),\n 'type=' + type,\n 'subfolder=' + subfolder,\n app.getRandParam().substring(1)\n ].join('&')\n\n return `/view?${params}`\n}\n\nasync function uploadFile(\n audioWidget: IStringWidget,\n audioUIWidget: DOMWidget,\n file: File,\n updateNode: boolean,\n pasted: boolean = false\n) {\n try {\n // Wrap file in formdata so it includes filename\n const body = new FormData()\n body.append('image', file)\n if (pasted) body.append('subfolder', 'pasted')\n const resp = await api.fetchApi('/upload/image', {\n method: 'POST',\n body\n })\n\n if (resp.status === 200) {\n const data = await resp.json()\n // Add the file to the dropdown list and update the widget value\n let path = data.name\n if (data.subfolder) path = data.subfolder + '/' + path\n\n if (!audioWidget.options.values.includes(path)) {\n audioWidget.options.values.push(path)\n }\n\n if (updateNode) {\n audioUIWidget.element.src = api.apiURL(\n getResourceURL(...splitFilePath(path))\n )\n audioWidget.value = path\n }\n } else {\n useToastStore().addAlert(resp.status + ' - ' + resp.statusText)\n }\n } catch (error) {\n useToastStore().addAlert(error)\n }\n}\n\n// AudioWidget MUST be registered first, as AUDIOUPLOAD depends on AUDIO_UI to be\n// present.\napp.registerExtension({\n name: 'Comfy.AudioWidget',\n async beforeRegisterNodeDef(nodeType, nodeData) {\n if (\n // @ts-expect-error ComfyNode\n ['LoadAudio', 'SaveAudio', 'PreviewAudio'].includes(nodeType.comfyClass)\n ) {\n nodeData.input.required.audioUI = ['AUDIO_UI']\n }\n },\n getCustomWidgets() {\n return {\n AUDIO_UI(node, inputName: string) {\n const audio = document.createElement('audio')\n audio.controls = true\n audio.classList.add('comfy-audio')\n audio.setAttribute('name', 'media')\n\n const audioUIWidget: DOMWidget =\n node.addDOMWidget(inputName, /* name=*/ 'audioUI', audio, {\n serialize: false\n })\n\n const isOutputNode = node.constructor.nodeData.output_node\n if (isOutputNode) {\n // Hide the audio widget when there is no audio initially.\n audioUIWidget.element.classList.add('empty-audio-widget')\n // Populate the audio widget UI on node execution.\n const onExecuted = node.onExecuted\n node.onExecuted = function (message: any) {\n onExecuted?.apply(this, arguments)\n const audios = message.audio\n if (!audios) return\n const audio = audios[0]\n audioUIWidget.element.src = api.apiURL(\n getResourceURL(audio.subfolder, audio.filename, audio.type)\n )\n audioUIWidget.element.classList.remove('empty-audio-widget')\n }\n }\n return { widget: audioUIWidget }\n }\n }\n },\n onNodeOutputsUpdated(nodeOutputs: Record) {\n for (const [nodeId, output] of Object.entries(nodeOutputs)) {\n const node = app.graph.getNodeById(nodeId)\n if ('audio' in output) {\n const audioUIWidget = node.widgets.find(\n (w) => w.name === 'audioUI'\n ) as unknown as DOMWidget\n const audio = output.audio[0]\n audioUIWidget.element.src = api.apiURL(\n getResourceURL(audio.subfolder, audio.filename, audio.type)\n )\n audioUIWidget.element.classList.remove('empty-audio-widget')\n }\n }\n }\n})\n\napp.registerExtension({\n name: 'Comfy.UploadAudio',\n async beforeRegisterNodeDef(nodeType, nodeData: ComfyNodeDef) {\n if (nodeData?.input?.required?.audio?.[1]?.audio_upload === true) {\n nodeData.input.required.upload = ['AUDIOUPLOAD']\n }\n },\n getCustomWidgets() {\n return {\n AUDIOUPLOAD(node, inputName: string) {\n // The widget that allows user to select file.\n const audioWidget = node.widgets.find(\n (w: IWidget) => w.name === 'audio'\n ) as IStringWidget\n const audioUIWidget = node.widgets.find(\n (w: IWidget) => w.name === 'audioUI'\n ) as unknown as DOMWidget\n\n const onAudioWidgetUpdate = () => {\n audioUIWidget.element.src = api.apiURL(\n getResourceURL(...splitFilePath(audioWidget.value as string))\n )\n }\n // Initially load default audio file to audioUIWidget.\n if (audioWidget.value) {\n onAudioWidgetUpdate()\n }\n audioWidget.callback = onAudioWidgetUpdate\n\n // Load saved audio file widget values if restoring from workflow\n const onGraphConfigured = node.onGraphConfigured\n node.onGraphConfigured = function () {\n onGraphConfigured?.apply(this, arguments)\n if (audioWidget.value) {\n onAudioWidgetUpdate()\n }\n }\n\n const handleUpload = async (files: File[]) => {\n if (files?.length) {\n uploadFile(audioWidget, audioUIWidget, files[0], true)\n }\n return files\n }\n\n const { openFileSelection } = useNodeFileInput(node, {\n accept: 'audio/*',\n onSelect: handleUpload\n })\n\n // The widget to pop up the upload dialog.\n const uploadWidget = node.addWidget(\n 'button',\n inputName,\n '',\n openFileSelection,\n { serialize: false }\n )\n uploadWidget.label = 'choose file to upload'\n\n useNodeDragAndDrop(node, {\n fileFilter: (file) => file.type.startsWith('audio/'),\n onDrop: handleUpload\n })\n\n node.previewMediaType = 'audio'\n\n return { widget: uploadWidget }\n }\n }\n }\n})\n","import { ComfyNodeDef, InputSpec, isComboInputSpecV1 } from '@/types/apiTypes'\n\nimport { app } from '../../scripts/app'\n\n// Adds an upload button to the nodes\n\nconst isMediaUploadComboInput = (inputSpec: InputSpec) => {\n const [inputName, inputOptions] = inputSpec\n if (!inputOptions) return false\n\n const isUploadInput =\n inputOptions['image_upload'] === true ||\n inputOptions['video_upload'] === true\n\n return (\n isUploadInput && (isComboInputSpecV1(inputSpec) || inputName === 'COMBO')\n )\n}\n\nconst createUploadInput = (\n imageInputName: string,\n imageInputOptions: InputSpec\n): InputSpec => [\n 'IMAGEUPLOAD',\n {\n ...imageInputOptions[1],\n imageInputName\n }\n]\n\napp.registerExtension({\n name: 'Comfy.UploadImage',\n beforeRegisterNodeDef(nodeType, nodeData: ComfyNodeDef) {\n const { input } = nodeData ?? {}\n const { required } = input ?? {}\n if (!required) return\n\n const found = Object.entries(required).find(([_, input]) =>\n isMediaUploadComboInput(input)\n )\n\n // If media combo input found, attach upload input\n if (found) {\n const [inputName, inputSpec] = found\n required.upload = createUploadInput(inputName, inputSpec)\n }\n }\n})\n","// @ts-strict-ignore\nimport { useToastStore } from '@/stores/toastStore'\n\nimport { api } from '../../scripts/api'\nimport { app } from '../../scripts/app'\n\nconst WEBCAM_READY = Symbol()\n\napp.registerExtension({\n name: 'Comfy.WebcamCapture',\n getCustomWidgets(app) {\n return {\n WEBCAM(node, inputName) {\n let res\n node[WEBCAM_READY] = new Promise((resolve) => (res = resolve))\n\n const container = document.createElement('div')\n container.style.background = 'rgba(0,0,0,0.25)'\n container.style.textAlign = 'center'\n\n const video = document.createElement('video')\n video.style.height = video.style.width = '100%'\n\n const loadVideo = async () => {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({\n video: true,\n audio: false\n })\n container.replaceChildren(video)\n\n setTimeout(() => res(video), 500) // Fallback as loadedmetadata doesnt fire sometimes?\n video.addEventListener('loadedmetadata', () => res(video), false)\n video.srcObject = stream\n video.play()\n } catch (error) {\n const label = document.createElement('div')\n label.style.color = 'red'\n label.style.overflow = 'auto'\n label.style.maxHeight = '100%'\n label.style.whiteSpace = 'pre-wrap'\n\n if (window.isSecureContext) {\n label.textContent =\n 'Unable to load webcam, please ensure access is granted:\\n' +\n error.message\n } else {\n label.textContent =\n 'Unable to load webcam. A secure context is required, if you are not accessing ComfyUI on localhost (127.0.0.1) you will have to enable TLS (https)\\n\\n' +\n error.message\n }\n\n container.replaceChildren(label)\n }\n }\n\n loadVideo()\n\n return { widget: node.addDOMWidget(inputName, 'WEBCAM', container) }\n }\n }\n },\n nodeCreated(node) {\n if ((node.type, node.constructor.comfyClass !== 'WebcamCapture')) return\n\n let video\n const camera = node.widgets.find((w) => w.name === 'image')\n const w = node.widgets.find((w) => w.name === 'width')\n const h = node.widgets.find((w) => w.name === 'height')\n const captureOnQueue = node.widgets.find(\n (w) => w.name === 'capture_on_queue'\n )\n\n const canvas = document.createElement('canvas')\n\n const capture = () => {\n // @ts-expect-error widget value type narrow down\n canvas.width = w.value\n // @ts-expect-error widget value type narrow down\n canvas.height = h.value\n const ctx = canvas.getContext('2d')\n // @ts-expect-error widget value type narrow down\n ctx.drawImage(video, 0, 0, w.value, h.value)\n const data = canvas.toDataURL('image/png')\n\n const img = new Image()\n img.onload = () => {\n node.imgs = [img]\n app.graph.setDirtyCanvas(true)\n requestAnimationFrame(() => {\n node.setSizeForImage?.()\n })\n }\n img.src = data\n }\n\n const btn = node.addWidget(\n 'button',\n 'waiting for camera...',\n 'capture',\n capture\n )\n btn.disabled = true\n btn.serializeValue = () => undefined\n\n camera.serializeValue = async () => {\n if (captureOnQueue.value) {\n capture()\n } else if (!node.imgs?.length) {\n const err = `No webcam image captured`\n useToastStore().addAlert(err)\n throw new Error(err)\n }\n\n // Upload image to temp storage\n const blob = await new Promise((r) => canvas.toBlob(r))\n const name = `${+new Date()}.png`\n const file = new File([blob], name)\n const body = new FormData()\n body.append('image', file)\n body.append('subfolder', 'webcam')\n body.append('type', 'temp')\n const resp = await api.fetchApi('/upload/image', {\n method: 'POST',\n body\n })\n if (resp.status !== 200) {\n const err = `Error uploading camera image: ${resp.status} - ${resp.statusText}`\n useToastStore().addAlert(err)\n throw new Error(err)\n }\n return `webcam/${name} [temp]`\n }\n\n node[WEBCAM_READY].then((v) => {\n video = v\n // If width isnt specified then use video output resolution\n if (!w.value) {\n w.value = video.videoWidth || 640\n h.value = video.videoHeight || 480\n }\n btn.disabled = false\n btn.label = 'capture'\n })\n }\n})\n"],"names":["self","td","app","ext","electronAPI","getElectronAPI","PREFIX","SEPARATOR","type","t","id","links","node","widget","max","w","def","link","i","fill","group","fov","b2","te","tmp","sign","_color","data","tmp2","indices","intersects","intersect","width","height","depth","aspect","renderList","renderer","scene","alpha","attributes","precision","x","_frustum","drawBuffers","scissor","viewport","_canvas","err","texture","cameraL","cameraR","cameras","cameraXR","info","chunkOffset","_projScreenMatrix","_vector3","stencil","bits","drawCount","materials","currentRenderList","parameters","reverseDepthBuffer","framebuffer","_vA","_vB","_vC","_identityMatrix","index","l","_ray","t2","vertex","detail","radius","azimuth","px","py","bs","contour","p","q","file","json","loadImage","now","shapes","tmpPath","tmpShape","THREE.PerspectiveCamera","THREE.OrthographicCamera","THREE.Vector3","document","THREE.AmbientLight","THREE.DirectionalLight","_a","_b","dat","fl","Deflate","AsyncDeflate","Inflate","AsyncInflate","Gzip","AsyncGzip","Gunzip","AsyncGunzip","Zlib","AsyncZlib","Unzlib","AsyncUnzlib","Decompress","AsyncDecompress","DecodeUTF8","EncodeUTF8","ZipPassThrough","ZipDeflate","AsyncZipDeflate","Zip","UnzipPassThrough","UnzipInflate","AsyncUnzipInflate","Unzip","final","e","r","j","NURBSUtils.calcBSplinePoint","NURBSUtils.calcNURBSDerivatives","child","material","skeleton","fflate.unzlibSync","_geometry","_tempA","_morphA","object","morphTargetsRelative","a","b","c","il","res","ref","URL","sourceURI","accessor","name","THREE.Mesh","THREE.Group","THREE.MeshNormalMaterial","THREE.DoubleSide","THREE.Vector2","THREE.MeshBasicMaterial","THREE.MeshDepthMaterial","THREE.BasicDepthPacking","THREE.MeshStandardMaterial","THREE.LinearSRGBColorSpace","THREE.SRGBColorSpace","THREE.GridHelper","THREE.Light","THREE.Camera","THREE.Box3","THREE.PlaneGeometry","THREE.WebGLRenderer","THREE.NoToneMapping","THREE.Scene","THREE.Color","THREE.TextureLoader","THREE.Clock","THREE.AnimationMixer","action","THREE.LoopRepeat","Load3D","Load3DAnimation","PointerType","CompositionOperation","y","BrushShape","Tools","MaskBlendMode","ColorComparisonMethod","debounce","point","scale","audio","input"],"mappings":";;;;;;;;;;;AAIO,MAAM,wBAAwB,YAAY;AAAA,SAAA;AAAA;AAAA;AAAA,EAC/C,OAAO,QAIH,CAAC;AAAA,EACL,OAAO,WAAmC;AAAA,EAE1C,OAAO,eACL,MACA,kBACA,UACA;AACM,UAAA,OAAO,IAAI,UAAU;AAAA,MACzB,MAAM;AAAA,MACN,aAAa;AAAA,MACb;AAAA,MACA,SAAS;AAAA,IAAA,CACV;AAEe,oBAAA,MAAM,KAAK,IAAI;AAAA,EAAA;AAAA,EAGjC,OAAO,oBAAoB;AAEvB,QAAA,SAAS,aACT,SAAS,UAAU,QACnB,SAAS,UAAU,KAAK,SAAS,GACjC;AACA,YAAM,cAAc,SAAS;AAAA,QAC3B;AAAA,MACF;AACA,UAAI,aAAa;AACH,oBAAA,MACV,SAAS,UAAU,KAAK,SAAS,UAAU,eAAe,CAAC,EAAE;AAC/D,oBAAY,MAAM,YAAY;AAC9B,oBAAY,MAAM,WAAW;AAAA,MAAA;AAAA,IAC/B;AAAA,EACF;AAAA,EAGF,OAAO,aAAa;AAClB,QAAI,gBAAgB,UAAU;AAC5B,YAAMA,QAAO,gBAAgB;AAEvB,YAAA,WAAW,IAAI,2BAA2B;AAAA,QAC9CA,MAAK,kBAAkB;AAAA,QACvB,GAAGA,MAAK,cAAc;AAAA,MAAA,CACvB;AAED,UAAIA,M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AAMoC,QAAO,IAAI,KAAK,CAAC,IAAI,GAAG,IAAI;AAC5B,YAAA,OAAO,IAAI,SAAS;AACrB,WAAA,OAAO,SAASA,KAAI;AACpB,WAAA,OAAO,aAAa,QAAQ;AAC5B,WAAA,OAAO,QAAQ,MAAM;AAC1B,YAAM,OAAO,MAAM,IAAI,SAAS,iBAAiB;AAAA,QAC/C,QAAQ;AAAA,QACR;AAAA,MAAA,CACD;AACG,UAAA,KAAK,WAAW,KAAK;AACvB,cAAMpC,OAAM,iCAAiC,KAAK,MAAM,MAAM,KAAK,UAAU;AAC/D,sBAAA,EAAE,SAASA,IAAG;AACtB,cAAA,IAAI,MAAMA,IAAG;AAAA,MAAA;AAErB,aAAO,UAAU,IAAI;AAAA,IACvB;AAEA,SAAK,YAAY,EAAE,KAAK,CAAC,MAAM;AACrB,cAAA;AAEJ,UAAA,CAAC,EAAE,OAAO;AACV,UAAA,QAAQ,MAAM,cAAc;AAC5B,UAAA,QAAQ,MAAM,eAAe;AAAA,MAAA;AAEjC,UAAI,WAAW;AACf,UAAI,QAAQ;AAAA,IAAA,CACb;AAAA,EAAA;AAEL,CAAC;","x_google_ignoreList":[11,13,17,18,19,20,21,22,23,24,25,32]} \ No newline at end of file diff --git a/comfy/web/assets/index-Czd3J-KM.js b/comfy/web/assets/index-Czd3J-KM.js deleted file mode 100644 index 81e39876b..000000000 --- a/comfy/web/assets/index-Czd3J-KM.js +++ /dev/null @@ -1,8790 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { ce as BaseStyle, cf as script$s, cu as script$t, o as openBlock, f as createElementBlock, aE as mergeProps, m as createBaseVNode, E as toDisplayString, cl as Ripple, r as resolveDirective, i as withDirectives, y as createBlock, C as resolveDynamicComponent, bv as script$u, co as resolveComponent, Z as normalizeClass, cY as createSlots, z as withCtx, b6 as script$v, cO as script$w, F as Fragment, D as renderList, ak as createTextVNode, cH as setAttribute, d3 as normalizeProps, A as renderSlot, B as createCommentVNode, cv as script$x, cN as equals, db as script$y, bE as script$z, df as getFirstFocusableElement, cG as OverlayEventBus, dv as getVNodeProp, cL as resolveFieldData, dO as invokeElementMethod, ch as getAttribute, dw as getNextElementSibling, cB as getOuterWidth, dx as getPreviousElementSibling, l as script$A, ck as script$B, cn as script$C, cU as script$E, cM as isNotEmpty, aD as withModifiers, dD as getOuterHeight, cm as UniqueComponentId, dz as _default, cw as ZIndex, ci as focus, cx as addStyle, cC as absolutePosition, cy as ConnectedOverlayScrollHandler, cz as isTouchDevice, dP as FilterOperator, cJ as script$F, c$ as script$G, d7 as FocusTrap, k as createVNode, c8 as Transition, bs as withKeys, cE as getIndex, d1 as script$H, dy as isClickable, dA as clearSelection, cI as localeComparator, cX as sort, dh as FilterService, dI as FilterMatchMode, cg as findSingle, dk as findIndexInList, cD as find, dQ as exportCSV, ds as getOffset, dB as isRTL, dR as getHiddenElementOuterWidth, dS as getHiddenElementOuterHeight, dT as reorderArray, cq as removeClass, cr as addClass, cR as isEmpty, di as script$I, cT as script$J } from "./index-DIgj6hpb.js"; -import { s as script$D } from "./index-D8hjiWMw.js"; -var ColumnStyle = BaseStyle.extend({ - name: "column" -}); -var script$1$3 = { - name: "BaseColumn", - "extends": script$s, - props: { - columnKey: { - type: null, - "default": null - }, - field: { - type: [String, Function], - "default": null - }, - sortField: { - type: [String, Function], - "default": null - }, - filterField: { - type: [String, Function], - "default": null - }, - dataType: { - type: String, - "default": "text" - }, - sortable: { - type: Boolean, - "default": false - }, - header: { - type: null, - "default": null - }, - footer: { - type: null, - "default": null - }, - style: { - type: null, - "default": null - }, - "class": { - type: String, - "default": null - }, - headerStyle: { - type: null, - "default": null - }, - headerClass: { - type: String, - "default": null - }, - bodyStyle: { - type: null, - "default": null - }, - bodyClass: { - type: String, - "default": null - }, - footerStyle: { - type: null, - "default": null - }, - footerClass: { - type: String, - "default": null - }, - showFilterMenu: { - type: Boolean, - "default": true - }, - showFilterOperator: { - type: Boolean, - "default": true - }, - showClearButton: { - type: Boolean, - "default": true - }, - showApplyButton: { - type: Boolean, - "default": true - }, - showFilterMatchModes: { - type: Boolean, - "default": true - }, - showAddButton: { - type: Boolean, - "default": true - }, - filterMatchModeOptions: { - type: Array, - "default": null - }, - maxConstraints: { - type: Number, - "default": 2 - }, - excludeGlobalFilter: { - type: Boolean, - "default": false - }, - filterHeaderClass: { - type: String, - "default": null - }, - filterHeaderStyle: { - type: null, - "default": null - }, - filterMenuClass: { - type: String, - "default": null - }, - filterMenuStyle: { - type: null, - "default": null - }, - selectionMode: { - type: String, - "default": null - }, - expander: { - type: Boolean, - "default": false - }, - colspan: { - type: Number, - "default": null - }, - rowspan: { - type: Number, - "default": null - }, - rowReorder: { - type: Boolean, - "default": false - }, - rowReorderIcon: { - type: String, - "default": void 0 - }, - reorderableColumn: { - type: Boolean, - "default": true - }, - rowEditor: { - type: Boolean, - "default": false - }, - frozen: { - type: Boolean, - "default": false - }, - alignFrozen: { - type: String, - "default": "left" - }, - exportable: { - type: Boolean, - "default": true - }, - exportHeader: { - type: String, - "default": null - }, - exportFooter: { - type: String, - "default": null - }, - filterMatchMode: { - type: String, - "default": null - }, - hidden: { - type: Boolean, - "default": false - } - }, - style: ColumnStyle, - provide: /* @__PURE__ */ __name(function provide() { - return { - $pcColumn: this, - $parentInstance: this - }; - }, "provide") -}; -var script$r = { - name: "Column", - "extends": script$1$3, - inheritAttrs: false, - inject: ["$columns"], - mounted: /* @__PURE__ */ __name(function mounted() { - var _this$$columns; - (_this$$columns = this.$columns) === null || _this$$columns === void 0 || _this$$columns.add(this.$); - }, "mounted"), - unmounted: /* @__PURE__ */ __name(function unmounted() { - var _this$$columns2; - (_this$$columns2 = this.$columns) === null || _this$$columns2 === void 0 || _this$$columns2["delete"](this.$); - }, "unmounted"), - render: /* @__PURE__ */ __name(function render() { - return null; - }, "render") -}; -var script$q = { - name: "ArrowDownIcon", - "extends": script$t -}; -function render$p(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - "fill-rule": "evenodd", - "clip-rule": "evenodd", - d: "M6.99994 14C6.91097 14.0004 6.82281 13.983 6.74064 13.9489C6.65843 13.9148 6.58387 13.8646 6.52133 13.8013L1.10198 8.38193C0.982318 8.25351 0.917175 8.08367 0.920272 7.90817C0.923368 7.73267 0.994462 7.56523 1.11858 7.44111C1.24269 7.317 1.41014 7.2459 1.58563 7.2428C1.76113 7.23971 1.93098 7.30485 2.0594 7.42451L6.32263 11.6877V0.677419C6.32263 0.497756 6.394 0.325452 6.52104 0.198411C6.64808 0.0713706 6.82039 0 7.00005 0C7.17971 0 7.35202 0.0713706 7.47906 0.198411C7.6061 0.325452 7.67747 0.497756 7.67747 0.677419V11.6877L11.9407 7.42451C12.0691 7.30485 12.2389 7.23971 12.4144 7.2428C12.5899 7.2459 12.7574 7.317 12.8815 7.44111C13.0056 7.56523 13.0767 7.73267 13.0798 7.90817C13.0829 8.08367 13.0178 8.25351 12.8981 8.38193L7.47875 13.8013C7.41621 13.8646 7.34164 13.9148 7.25944 13.9489C7.17727 13.983 7.08912 14.0004 7.00015 14C7.00012 14 7.00009 14 7.00005 14C7.00001 14 6.99998 14 6.99994 14Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$p, "render$p"); -script$q.render = render$p; -var script$p = { - name: "ArrowUpIcon", - "extends": script$t -}; -function render$o(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - "fill-rule": "evenodd", - "clip-rule": "evenodd", - d: "M6.51551 13.799C6.64205 13.9255 6.813 13.9977 6.99193 14C7.17087 13.9977 7.34182 13.9255 7.46835 13.799C7.59489 13.6725 7.66701 13.5015 7.66935 13.3226V2.31233L11.9326 6.57554C11.9951 6.63887 12.0697 6.68907 12.1519 6.72319C12.2341 6.75731 12.3223 6.77467 12.4113 6.77425C12.5003 6.77467 12.5885 6.75731 12.6707 6.72319C12.7529 6.68907 12.8274 6.63887 12.89 6.57554C13.0168 6.44853 13.0881 6.27635 13.0881 6.09683C13.0881 5.91732 13.0168 5.74514 12.89 5.61812L7.48846 0.216594C7.48274 0.210436 7.4769 0.204374 7.47094 0.198411C7.3439 0.0713707 7.1716 0 6.99193 0C6.81227 0 6.63997 0.0713707 6.51293 0.198411C6.50704 0.204296 6.50128 0.210278 6.49563 0.216354L1.09386 5.61812C0.974201 5.74654 0.909057 5.91639 0.912154 6.09189C0.91525 6.26738 0.986345 6.43483 1.11046 6.55894C1.23457 6.68306 1.40202 6.75415 1.57752 6.75725C1.75302 6.76035 1.92286 6.6952 2.05128 6.57554L6.31451 2.31231V13.3226C6.31685 13.5015 6.38898 13.6725 6.51551 13.799Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$o, "render$o"); -script$p.render = render$o; -function _typeof$c(o) { - "@babel/helpers - typeof"; - return _typeof$c = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$c(o); -} -__name(_typeof$c, "_typeof$c"); -function _defineProperty$b(e, r, t) { - return (r = _toPropertyKey$b(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$b, "_defineProperty$b"); -function _toPropertyKey$b(t) { - var i = _toPrimitive$b(t, "string"); - return "symbol" == _typeof$c(i) ? i : i + ""; -} -__name(_toPropertyKey$b, "_toPropertyKey$b"); -function _toPrimitive$b(t, r) { - if ("object" != _typeof$c(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$c(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$b, "_toPrimitive$b"); -var theme$2 = /* @__PURE__ */ __name(function theme(_ref) { - var dt = _ref.dt; - return "\n.p-paginator {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n background: ".concat(dt("paginator.background"), ";\n color: ").concat(dt("paginator.color"), ";\n padding: ").concat(dt("paginator.padding"), ";\n border-radius: ").concat(dt("paginator.border.radius"), ";\n gap: ").concat(dt("paginator.gap"), ";\n}\n\n.p-paginator-content {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n gap: ").concat(dt("paginator.gap"), ";\n}\n\n.p-paginator-content-start {\n margin-inline-end: auto;\n}\n\n.p-paginator-content-end {\n margin-inline-start: auto;\n}\n\n.p-paginator-page,\n.p-paginator-next,\n.p-paginator-last,\n.p-paginator-first,\n.p-paginator-prev {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n user-select: none;\n overflow: hidden;\n position: relative;\n background: ").concat(dt("paginator.nav.button.background"), ";\n border: 0 none;\n color: ").concat(dt("paginator.nav.button.color"), ";\n min-width: ").concat(dt("paginator.nav.button.width"), ";\n height: ").concat(dt("paginator.nav.button.height"), ";\n transition: background ").concat(dt("paginator.transition.duration"), ", color ").concat(dt("paginator.transition.duration"), ", outline-color ").concat(dt("paginator.transition.duration"), ", box-shadow ").concat(dt("paginator.transition.duration"), ";\n border-radius: ").concat(dt("paginator.nav.button.border.radius"), ";\n padding: 0;\n margin: 0;\n}\n\n.p-paginator-page:focus-visible,\n.p-paginator-next:focus-visible,\n.p-paginator-last:focus-visible,\n.p-paginator-first:focus-visible,\n.p-paginator-prev:focus-visible {\n box-shadow: ").concat(dt("paginator.nav.button.focus.ring.shadow"), ";\n outline: ").concat(dt("paginator.nav.button.focus.ring.width"), " ").concat(dt("paginator.nav.button.focus.ring.style"), " ").concat(dt("paginator.nav.button.focus.ring.color"), ";\n outline-offset: ").concat(dt("paginator.nav.button.focus.ring.offset"), ";\n}\n\n.p-paginator-page:not(.p-disabled):not(.p-paginator-page-selected):hover,\n.p-paginator-first:not(.p-disabled):hover,\n.p-paginator-prev:not(.p-disabled):hover,\n.p-paginator-next:not(.p-disabled):hover,\n.p-paginator-last:not(.p-disabled):hover {\n background: ").concat(dt("paginator.nav.button.hover.background"), ";\n color: ").concat(dt("paginator.nav.button.hover.color"), ";\n}\n\n.p-paginator-page.p-paginator-page-selected {\n background: ").concat(dt("paginator.nav.button.selected.background"), ";\n color: ").concat(dt("paginator.nav.button.selected.color"), ";\n}\n\n.p-paginator-current {\n color: ").concat(dt("paginator.current.page.report.color"), ";\n}\n\n.p-paginator-pages {\n display: flex;\n align-items: center;\n gap: ").concat(dt("paginator.gap"), ";\n}\n\n.p-paginator-jtp-input .p-inputtext {\n max-width: ").concat(dt("paginator.jump.to.page.input.max.width"), ";\n}\n\n.p-paginator-first:dir(rtl),\n.p-paginator-prev:dir(rtl),\n.p-paginator-next:dir(rtl),\n.p-paginator-last:dir(rtl) {\n transform: rotate(180deg);\n}\n"); -}, "theme"); -var classes$2 = { - paginator: /* @__PURE__ */ __name(function paginator(_ref2) { - var instance = _ref2.instance, key = _ref2.key; - return ["p-paginator p-component", _defineProperty$b({ - "p-paginator-default": !instance.hasBreakpoints() - }, "p-paginator-".concat(key), instance.hasBreakpoints())]; - }, "paginator"), - content: "p-paginator-content", - contentStart: "p-paginator-content-start", - contentEnd: "p-paginator-content-end", - first: /* @__PURE__ */ __name(function first(_ref4) { - var instance = _ref4.instance; - return ["p-paginator-first", { - "p-disabled": instance.$attrs.disabled - }]; - }, "first"), - firstIcon: "p-paginator-first-icon", - prev: /* @__PURE__ */ __name(function prev(_ref5) { - var instance = _ref5.instance; - return ["p-paginator-prev", { - "p-disabled": instance.$attrs.disabled - }]; - }, "prev"), - prevIcon: "p-paginator-prev-icon", - next: /* @__PURE__ */ __name(function next(_ref6) { - var instance = _ref6.instance; - return ["p-paginator-next", { - "p-disabled": instance.$attrs.disabled - }]; - }, "next"), - nextIcon: "p-paginator-next-icon", - last: /* @__PURE__ */ __name(function last(_ref7) { - var instance = _ref7.instance; - return ["p-paginator-last", { - "p-disabled": instance.$attrs.disabled - }]; - }, "last"), - lastIcon: "p-paginator-last-icon", - pages: "p-paginator-pages", - page: /* @__PURE__ */ __name(function page(_ref8) { - var props = _ref8.props, pageLink = _ref8.pageLink; - return ["p-paginator-page", { - "p-paginator-page-selected": pageLink - 1 === props.page - }]; - }, "page"), - current: "p-paginator-current", - pcRowPerPageDropdown: "p-paginator-rpp-dropdown", - pcJumpToPageDropdown: "p-paginator-jtp-dropdown", - pcJumpToPageInputText: "p-paginator-jtp-input" -}; -var PaginatorStyle = BaseStyle.extend({ - name: "paginator", - theme: theme$2, - classes: classes$2 -}); -var script$o = { - name: "AngleDoubleLeftIcon", - "extends": script$t -}; -function render$n(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - "fill-rule": "evenodd", - "clip-rule": "evenodd", - d: "M5.71602 11.164C5.80782 11.2021 5.9063 11.2215 6.00569 11.221C6.20216 11.2301 6.39427 11.1612 6.54025 11.0294C6.68191 10.8875 6.76148 10.6953 6.76148 10.4948C6.76148 10.2943 6.68191 10.1021 6.54025 9.96024L3.51441 6.9344L6.54025 3.90855C6.624 3.76126 6.65587 3.59011 6.63076 3.42254C6.60564 3.25498 6.525 3.10069 6.40175 2.98442C6.2785 2.86815 6.11978 2.79662 5.95104 2.7813C5.78229 2.76598 5.61329 2.80776 5.47112 2.89994L1.97123 6.39983C1.82957 6.54167 1.75 6.73393 1.75 6.9344C1.75 7.13486 1.82957 7.32712 1.97123 7.46896L5.47112 10.9991C5.54096 11.0698 5.62422 11.1259 5.71602 11.164ZM11.0488 10.9689C11.1775 11.1156 11.3585 11.2061 11.5531 11.221C11.7477 11.2061 11.9288 11.1156 12.0574 10.9689C12.1815 10.8302 12.25 10.6506 12.25 10.4645C12.25 10.2785 12.1815 10.0989 12.0574 9.96024L9.03158 6.93439L12.0574 3.90855C12.1248 3.76739 12.1468 3.60881 12.1204 3.45463C12.0939 3.30045 12.0203 3.15826 11.9097 3.04765C11.7991 2.93703 11.6569 2.86343 11.5027 2.83698C11.3486 2.81053 11.19 2.83252 11.0488 2.89994L7.51865 6.36957C7.37699 6.51141 7.29742 6.70367 7.29742 6.90414C7.29742 7.1046 7.37699 7.29686 7.51865 7.4387L11.0488 10.9689Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$n, "render$n"); -script$o.render = render$n; -var script$n = { - name: "AngleDoubleRightIcon", - "extends": script$t -}; -function render$m(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - "fill-rule": "evenodd", - "clip-rule": "evenodd", - d: "M7.68757 11.1451C7.7791 11.1831 7.8773 11.2024 7.9764 11.2019C8.07769 11.1985 8.17721 11.1745 8.26886 11.1312C8.36052 11.088 8.44238 11.0265 8.50943 10.9505L12.0294 7.49085C12.1707 7.34942 12.25 7.15771 12.25 6.95782C12.25 6.75794 12.1707 6.56622 12.0294 6.42479L8.50943 2.90479C8.37014 2.82159 8.20774 2.78551 8.04633 2.80192C7.88491 2.81833 7.73309 2.88635 7.6134 2.99588C7.4937 3.10541 7.41252 3.25061 7.38189 3.40994C7.35126 3.56927 7.37282 3.73423 7.44337 3.88033L10.4605 6.89748L7.44337 9.91463C7.30212 10.0561 7.22278 10.2478 7.22278 10.4477C7.22278 10.6475 7.30212 10.8393 7.44337 10.9807C7.51301 11.0512 7.59603 11.1071 7.68757 11.1451ZM1.94207 10.9505C2.07037 11.0968 2.25089 11.1871 2.44493 11.2019C2.63898 11.1871 2.81949 11.0968 2.94779 10.9505L6.46779 7.49085C6.60905 7.34942 6.68839 7.15771 6.68839 6.95782C6.68839 6.75793 6.60905 6.56622 6.46779 6.42479L2.94779 2.90479C2.80704 2.83757 2.6489 2.81563 2.49517 2.84201C2.34143 2.86839 2.19965 2.94178 2.08936 3.05207C1.97906 3.16237 1.90567 3.30415 1.8793 3.45788C1.85292 3.61162 1.87485 3.76975 1.94207 3.9105L4.95922 6.92765L1.94207 9.9448C1.81838 10.0831 1.75 10.2621 1.75 10.4477C1.75 10.6332 1.81838 10.8122 1.94207 10.9505Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$m, "render$m"); -script$n.render = render$m; -var script$m = { - name: "AngleLeftIcon", - "extends": script$t -}; -function render$l(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - d: "M8.75 11.185C8.65146 11.1854 8.55381 11.1662 8.4628 11.1284C8.37179 11.0906 8.28924 11.0351 8.22 10.965L4.72 7.46496C4.57955 7.32433 4.50066 7.13371 4.50066 6.93496C4.50066 6.73621 4.57955 6.54558 4.72 6.40496L8.22 2.93496C8.36095 2.84357 8.52851 2.80215 8.69582 2.81733C8.86312 2.83252 9.02048 2.90344 9.14268 3.01872C9.26487 3.134 9.34483 3.28696 9.36973 3.4531C9.39463 3.61924 9.36303 3.78892 9.28 3.93496L6.28 6.93496L9.28 9.93496C9.42045 10.0756 9.49934 10.2662 9.49934 10.465C9.49934 10.6637 9.42045 10.8543 9.28 10.995C9.13526 11.1257 8.9448 11.1939 8.75 11.185Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$l, "render$l"); -script$m.render = render$l; -var script$a$1 = { - name: "BasePaginator", - "extends": script$s, - props: { - totalRecords: { - type: Number, - "default": 0 - }, - rows: { - type: Number, - "default": 0 - }, - first: { - type: Number, - "default": 0 - }, - pageLinkSize: { - type: Number, - "default": 5 - }, - rowsPerPageOptions: { - type: Array, - "default": null - }, - template: { - type: [Object, String], - "default": "FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown" - }, - currentPageReportTemplate: { - type: null, - "default": "({currentPage} of {totalPages})" - }, - alwaysShow: { - type: Boolean, - "default": true - } - }, - style: PaginatorStyle, - provide: /* @__PURE__ */ __name(function provide2() { - return { - $pcPaginator: this, - $parentInstance: this - }; - }, "provide") -}; -var script$9$1 = { - name: "CurrentPageReport", - hostName: "Paginator", - "extends": script$s, - props: { - pageCount: { - type: Number, - "default": 0 - }, - currentPage: { - type: Number, - "default": 0 - }, - page: { - type: Number, - "default": 0 - }, - first: { - type: Number, - "default": 0 - }, - rows: { - type: Number, - "default": 0 - }, - totalRecords: { - type: Number, - "default": 0 - }, - template: { - type: String, - "default": "({currentPage} of {totalPages})" - } - }, - computed: { - text: /* @__PURE__ */ __name(function text() { - var text2 = this.template.replace("{currentPage}", this.currentPage).replace("{totalPages}", this.pageCount).replace("{first}", this.pageCount > 0 ? this.first + 1 : 0).replace("{last}", Math.min(this.first + this.rows, this.totalRecords)).replace("{rows}", this.rows).replace("{totalRecords}", this.totalRecords); - return text2; - }, "text") - } -}; -function render$9$1(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("span", mergeProps({ - "class": _ctx.cx("current") - }, _ctx.ptm("current")), toDisplayString($options.text), 17); -} -__name(render$9$1, "render$9$1"); -script$9$1.render = render$9$1; -var script$8$1 = { - name: "FirstPageLink", - hostName: "Paginator", - "extends": script$s, - props: { - template: { - type: Function, - "default": null - } - }, - methods: { - getPTOptions: /* @__PURE__ */ __name(function getPTOptions(key) { - return this.ptm(key, { - context: { - disabled: this.$attrs.disabled - } - }); - }, "getPTOptions") - }, - components: { - AngleDoubleLeftIcon: script$o - }, - directives: { - ripple: Ripple - } -}; -function render$8$1(_ctx, _cache, $props, $setup, $data, $options) { - var _directive_ripple = resolveDirective("ripple"); - return withDirectives((openBlock(), createElementBlock("button", mergeProps({ - "class": _ctx.cx("first"), - type: "button" - }, $options.getPTOptions("first"), { - "data-pc-group-section": "pagebutton" - }), [(openBlock(), createBlock(resolveDynamicComponent($props.template || "AngleDoubleLeftIcon"), mergeProps({ - "class": _ctx.cx("firstIcon") - }, $options.getPTOptions("firstIcon")), null, 16, ["class"]))], 16)), [[_directive_ripple]]); -} -__name(render$8$1, "render$8$1"); -script$8$1.render = render$8$1; -var script$7$1 = { - name: "JumpToPageDropdown", - hostName: "Paginator", - "extends": script$s, - emits: ["page-change"], - props: { - page: Number, - pageCount: Number, - disabled: Boolean, - templates: null - }, - methods: { - onChange: /* @__PURE__ */ __name(function onChange(value) { - this.$emit("page-change", value); - }, "onChange") - }, - computed: { - pageOptions: /* @__PURE__ */ __name(function pageOptions() { - var opts = []; - for (var i = 0; i < this.pageCount; i++) { - opts.push({ - label: String(i + 1), - value: i - }); - } - return opts; - }, "pageOptions") - }, - components: { - JTPSelect: script$u - } -}; -function render$7$1(_ctx, _cache, $props, $setup, $data, $options) { - var _component_JTPSelect = resolveComponent("JTPSelect"); - return openBlock(), createBlock(_component_JTPSelect, { - modelValue: $props.page, - options: $options.pageOptions, - optionLabel: "label", - optionValue: "value", - "onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) { - return $options.onChange($event); - }), - "class": normalizeClass(_ctx.cx("pcJumpToPageDropdown")), - disabled: $props.disabled, - unstyled: _ctx.unstyled, - pt: _ctx.ptm("pcJumpToPageDropdown"), - "data-pc-group-section": "pagedropdown" - }, createSlots({ - _: 2 - }, [$props.templates["jumptopagedropdownicon"] ? { - name: "dropdownicon", - fn: withCtx(function(slotProps) { - return [(openBlock(), createBlock(resolveDynamicComponent($props.templates["jumptopagedropdownicon"]), { - "class": normalizeClass(slotProps["class"]) - }, null, 8, ["class"]))]; - }), - key: "0" - } : void 0]), 1032, ["modelValue", "options", "class", "disabled", "unstyled", "pt"]); -} -__name(render$7$1, "render$7$1"); -script$7$1.render = render$7$1; -var script$6$1 = { - name: "JumpToPageInput", - hostName: "Paginator", - "extends": script$s, - inheritAttrs: false, - emits: ["page-change"], - props: { - page: Number, - pageCount: Number, - disabled: Boolean - }, - data: /* @__PURE__ */ __name(function data() { - return { - d_page: this.page - }; - }, "data"), - watch: { - page: /* @__PURE__ */ __name(function page2(newValue) { - this.d_page = newValue; - }, "page") - }, - methods: { - onChange: /* @__PURE__ */ __name(function onChange2(value) { - if (value !== this.page) { - this.d_page = value; - this.$emit("page-change", value - 1); - } - }, "onChange") - }, - computed: { - inputArialabel: /* @__PURE__ */ __name(function inputArialabel() { - return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.jumpToPageInputLabel : void 0; - }, "inputArialabel") - }, - components: { - JTPInput: script$v - } -}; -function render$6$1(_ctx, _cache, $props, $setup, $data, $options) { - var _component_JTPInput = resolveComponent("JTPInput"); - return openBlock(), createBlock(_component_JTPInput, { - ref: "jtpInput", - modelValue: $data.d_page, - "class": normalizeClass(_ctx.cx("pcJumpToPageInputText")), - "aria-label": $options.inputArialabel, - disabled: $props.disabled, - "onUpdate:modelValue": $options.onChange, - unstyled: _ctx.unstyled, - pt: _ctx.ptm("pcJumpToPageInputText") - }, null, 8, ["modelValue", "class", "aria-label", "disabled", "onUpdate:modelValue", "unstyled", "pt"]); -} -__name(render$6$1, "render$6$1"); -script$6$1.render = render$6$1; -var script$5$1 = { - name: "LastPageLink", - hostName: "Paginator", - "extends": script$s, - props: { - template: { - type: Function, - "default": null - } - }, - methods: { - getPTOptions: /* @__PURE__ */ __name(function getPTOptions2(key) { - return this.ptm(key, { - context: { - disabled: this.$attrs.disabled - } - }); - }, "getPTOptions") - }, - components: { - AngleDoubleRightIcon: script$n - }, - directives: { - ripple: Ripple - } -}; -function render$5$1(_ctx, _cache, $props, $setup, $data, $options) { - var _directive_ripple = resolveDirective("ripple"); - return withDirectives((openBlock(), createElementBlock("button", mergeProps({ - "class": _ctx.cx("last"), - type: "button" - }, $options.getPTOptions("last"), { - "data-pc-group-section": "pagebutton" - }), [(openBlock(), createBlock(resolveDynamicComponent($props.template || "AngleDoubleRightIcon"), mergeProps({ - "class": _ctx.cx("lastIcon") - }, $options.getPTOptions("lastIcon")), null, 16, ["class"]))], 16)), [[_directive_ripple]]); -} -__name(render$5$1, "render$5$1"); -script$5$1.render = render$5$1; -var script$4$1 = { - name: "NextPageLink", - hostName: "Paginator", - "extends": script$s, - props: { - template: { - type: Function, - "default": null - } - }, - methods: { - getPTOptions: /* @__PURE__ */ __name(function getPTOptions3(key) { - return this.ptm(key, { - context: { - disabled: this.$attrs.disabled - } - }); - }, "getPTOptions") - }, - components: { - AngleRightIcon: script$w - }, - directives: { - ripple: Ripple - } -}; -function render$4$1(_ctx, _cache, $props, $setup, $data, $options) { - var _directive_ripple = resolveDirective("ripple"); - return withDirectives((openBlock(), createElementBlock("button", mergeProps({ - "class": _ctx.cx("next"), - type: "button" - }, $options.getPTOptions("next"), { - "data-pc-group-section": "pagebutton" - }), [(openBlock(), createBlock(resolveDynamicComponent($props.template || "AngleRightIcon"), mergeProps({ - "class": _ctx.cx("nextIcon") - }, $options.getPTOptions("nextIcon")), null, 16, ["class"]))], 16)), [[_directive_ripple]]); -} -__name(render$4$1, "render$4$1"); -script$4$1.render = render$4$1; -var script$3$1 = { - name: "PageLinks", - hostName: "Paginator", - "extends": script$s, - inheritAttrs: false, - emits: ["click"], - props: { - value: Array, - page: Number - }, - methods: { - getPTOptions: /* @__PURE__ */ __name(function getPTOptions4(pageLink, key) { - return this.ptm(key, { - context: { - active: pageLink === this.page - } - }); - }, "getPTOptions"), - onPageLinkClick: /* @__PURE__ */ __name(function onPageLinkClick(event2, pageLink) { - this.$emit("click", { - originalEvent: event2, - value: pageLink - }); - }, "onPageLinkClick"), - ariaPageLabel: /* @__PURE__ */ __name(function ariaPageLabel(value) { - return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g, value) : void 0; - }, "ariaPageLabel") - }, - directives: { - ripple: Ripple - } -}; -var _hoisted_1$6 = ["aria-label", "aria-current", "onClick", "data-p-active"]; -function render$3$1(_ctx, _cache, $props, $setup, $data, $options) { - var _directive_ripple = resolveDirective("ripple"); - return openBlock(), createElementBlock("span", mergeProps({ - "class": _ctx.cx("pages") - }, _ctx.ptm("pages")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.value, function(pageLink) { - return withDirectives((openBlock(), createElementBlock("button", mergeProps({ - key: pageLink, - "class": _ctx.cx("page", { - pageLink - }), - type: "button", - "aria-label": $options.ariaPageLabel(pageLink), - "aria-current": pageLink - 1 === $props.page ? "page" : void 0, - onClick: /* @__PURE__ */ __name(function onClick3($event) { - return $options.onPageLinkClick($event, pageLink); - }, "onClick"), - ref_for: true - }, $options.getPTOptions(pageLink - 1, "page"), { - "data-p-active": pageLink - 1 === $props.page - }), [createTextVNode(toDisplayString(pageLink), 1)], 16, _hoisted_1$6)), [[_directive_ripple]]); - }), 128))], 16); -} -__name(render$3$1, "render$3$1"); -script$3$1.render = render$3$1; -var script$2$1 = { - name: "PrevPageLink", - hostName: "Paginator", - "extends": script$s, - props: { - template: { - type: Function, - "default": null - } - }, - methods: { - getPTOptions: /* @__PURE__ */ __name(function getPTOptions5(key) { - return this.ptm(key, { - context: { - disabled: this.$attrs.disabled - } - }); - }, "getPTOptions") - }, - components: { - AngleLeftIcon: script$m - }, - directives: { - ripple: Ripple - } -}; -function render$2$1(_ctx, _cache, $props, $setup, $data, $options) { - var _directive_ripple = resolveDirective("ripple"); - return withDirectives((openBlock(), createElementBlock("button", mergeProps({ - "class": _ctx.cx("prev"), - type: "button" - }, $options.getPTOptions("prev"), { - "data-pc-group-section": "pagebutton" - }), [(openBlock(), createBlock(resolveDynamicComponent($props.template || "AngleLeftIcon"), mergeProps({ - "class": _ctx.cx("prevIcon") - }, $options.getPTOptions("prevIcon")), null, 16, ["class"]))], 16)), [[_directive_ripple]]); -} -__name(render$2$1, "render$2$1"); -script$2$1.render = render$2$1; -var script$1$2 = { - name: "RowsPerPageDropdown", - hostName: "Paginator", - "extends": script$s, - emits: ["rows-change"], - props: { - options: Array, - rows: Number, - disabled: Boolean, - templates: null - }, - methods: { - onChange: /* @__PURE__ */ __name(function onChange3(value) { - this.$emit("rows-change", value); - }, "onChange") - }, - computed: { - rowsOptions: /* @__PURE__ */ __name(function rowsOptions() { - var opts = []; - if (this.options) { - for (var i = 0; i < this.options.length; i++) { - opts.push({ - label: String(this.options[i]), - value: this.options[i] - }); - } - } - return opts; - }, "rowsOptions") - }, - components: { - RPPSelect: script$u - } -}; -function render$1$1(_ctx, _cache, $props, $setup, $data, $options) { - var _component_RPPSelect = resolveComponent("RPPSelect"); - return openBlock(), createBlock(_component_RPPSelect, { - modelValue: $props.rows, - options: $options.rowsOptions, - optionLabel: "label", - optionValue: "value", - "onUpdate:modelValue": _cache[0] || (_cache[0] = function($event) { - return $options.onChange($event); - }), - "class": normalizeClass(_ctx.cx("pcRowPerPageDropdown")), - disabled: $props.disabled, - unstyled: _ctx.unstyled, - pt: _ctx.ptm("pcRowPerPageDropdown"), - "data-pc-group-section": "pagedropdown" - }, createSlots({ - _: 2 - }, [$props.templates["rowsperpagedropdownicon"] ? { - name: "dropdownicon", - fn: withCtx(function(slotProps) { - return [(openBlock(), createBlock(resolveDynamicComponent($props.templates["rowsperpagedropdownicon"]), { - "class": normalizeClass(slotProps["class"]) - }, null, 8, ["class"]))]; - }), - key: "0" - } : void 0]), 1032, ["modelValue", "options", "class", "disabled", "unstyled", "pt"]); -} -__name(render$1$1, "render$1$1"); -script$1$2.render = render$1$1; -function _typeof$b(o) { - "@babel/helpers - typeof"; - return _typeof$b = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$b(o); -} -__name(_typeof$b, "_typeof$b"); -function _slicedToArray$1(r, e) { - return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e) || _unsupportedIterableToArray$3(r, e) || _nonIterableRest$1(); -} -__name(_slicedToArray$1, "_slicedToArray$1"); -function _nonIterableRest$1() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} -__name(_nonIterableRest$1, "_nonIterableRest$1"); -function _unsupportedIterableToArray$3(r, a) { - if (r) { - if ("string" == typeof r) return _arrayLikeToArray$3(r, a); - var t = {}.toString.call(r).slice(8, -1); - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0; - } -} -__name(_unsupportedIterableToArray$3, "_unsupportedIterableToArray$3"); -function _arrayLikeToArray$3(r, a) { - (null == a || a > r.length) && (a = r.length); - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; - return n; -} -__name(_arrayLikeToArray$3, "_arrayLikeToArray$3"); -function _iterableToArrayLimit$1(r, l) { - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; - if (null != t) { - var e, n, i, u, a = [], f = true, o = false; - try { - if (i = (t = t.call(r)).next, 0 === l) { - if (Object(t) !== t) return; - f = false; - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ; - } catch (r2) { - o = true, n = r2; - } finally { - try { - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; - } finally { - if (o) throw n; - } - } - return a; - } -} -__name(_iterableToArrayLimit$1, "_iterableToArrayLimit$1"); -function _arrayWithHoles$1(r) { - if (Array.isArray(r)) return r; -} -__name(_arrayWithHoles$1, "_arrayWithHoles$1"); -var script$l = { - name: "Paginator", - "extends": script$a$1, - inheritAttrs: false, - emits: ["update:first", "update:rows", "page"], - data: /* @__PURE__ */ __name(function data2() { - return { - d_first: this.first, - d_rows: this.rows - }; - }, "data"), - watch: { - first: /* @__PURE__ */ __name(function first2(newValue) { - this.d_first = newValue; - }, "first"), - rows: /* @__PURE__ */ __name(function rows(newValue) { - this.d_rows = newValue; - }, "rows"), - totalRecords: /* @__PURE__ */ __name(function totalRecords(newValue) { - if (this.page > 0 && newValue && this.d_first >= newValue) { - this.changePage(this.pageCount - 1); - } - }, "totalRecords") - }, - mounted: /* @__PURE__ */ __name(function mounted2() { - this.createStyle(); - }, "mounted"), - methods: { - changePage: /* @__PURE__ */ __name(function changePage(p) { - var pc = this.pageCount; - if (p >= 0 && p < pc) { - this.d_first = this.d_rows * p; - var state = { - page: p, - first: this.d_first, - rows: this.d_rows, - pageCount: pc - }; - this.$emit("update:first", this.d_first); - this.$emit("update:rows", this.d_rows); - this.$emit("page", state); - } - }, "changePage"), - changePageToFirst: /* @__PURE__ */ __name(function changePageToFirst(event2) { - if (!this.isFirstPage) { - this.changePage(0); - } - event2.preventDefault(); - }, "changePageToFirst"), - changePageToPrev: /* @__PURE__ */ __name(function changePageToPrev(event2) { - this.changePage(this.page - 1); - event2.preventDefault(); - }, "changePageToPrev"), - changePageLink: /* @__PURE__ */ __name(function changePageLink(event2) { - this.changePage(event2.value - 1); - event2.originalEvent.preventDefault(); - }, "changePageLink"), - changePageToNext: /* @__PURE__ */ __name(function changePageToNext(event2) { - this.changePage(this.page + 1); - event2.preventDefault(); - }, "changePageToNext"), - changePageToLast: /* @__PURE__ */ __name(function changePageToLast(event2) { - if (!this.isLastPage) { - this.changePage(this.pageCount - 1); - } - event2.preventDefault(); - }, "changePageToLast"), - onRowChange: /* @__PURE__ */ __name(function onRowChange(value) { - this.d_rows = value; - this.changePage(this.page); - }, "onRowChange"), - createStyle: /* @__PURE__ */ __name(function createStyle() { - var _this = this; - if (this.hasBreakpoints() && !this.isUnstyled) { - var _this$$primevue; - this.styleElement = document.createElement("style"); - this.styleElement.type = "text/css"; - setAttribute(this.styleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce); - document.body.appendChild(this.styleElement); - var innerHTML = ""; - var keys = Object.keys(this.template); - var sortedBreakpoints = {}; - keys.sort(function(a, b) { - return parseInt(a) - parseInt(b); - }).forEach(function(key2) { - sortedBreakpoints[key2] = _this.template[key2]; - }); - for (var _i = 0, _Object$entries = Object.entries(Object.entries(sortedBreakpoints)); _i < _Object$entries.length; _i++) { - var _Object$entries$_i = _slicedToArray$1(_Object$entries[_i], 2), index = _Object$entries$_i[0], _Object$entries$_i$ = _slicedToArray$1(_Object$entries$_i[1], 1), key = _Object$entries$_i$[0]; - var minValue = void 0, calculatedMinValue = void 0; - if (key !== "default" && typeof Object.keys(sortedBreakpoints)[index - 1] === "string") { - calculatedMinValue = Number(Object.keys(sortedBreakpoints)[index - 1].slice(0, -2)) + 1 + "px"; - } else { - calculatedMinValue = Object.keys(sortedBreakpoints)[index - 1]; - } - minValue = Object.entries(sortedBreakpoints)[index - 1] ? "and (min-width:".concat(calculatedMinValue, ")") : ""; - if (key === "default") { - innerHTML += "\n @media screen ".concat(minValue, " {\n .p-paginator[").concat(this.$attrSelector, "],\n display: flex;\n }\n }\n "); - } else { - innerHTML += "\n.p-paginator-".concat(key, " {\n display: none;\n}\n@media screen ").concat(minValue, " and (max-width: ").concat(key, ") {\n .p-paginator-").concat(key, " {\n display: flex;\n }\n\n .p-paginator-default{\n display: none;\n }\n}\n "); - } - } - this.styleElement.innerHTML = innerHTML; - } - }, "createStyle"), - hasBreakpoints: /* @__PURE__ */ __name(function hasBreakpoints() { - return _typeof$b(this.template) === "object"; - }, "hasBreakpoints"), - getAriaLabel: /* @__PURE__ */ __name(function getAriaLabel(labelType) { - return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria[labelType] : void 0; - }, "getAriaLabel") - }, - computed: { - templateItems: /* @__PURE__ */ __name(function templateItems() { - var keys = {}; - if (this.hasBreakpoints()) { - keys = this.template; - if (!keys["default"]) { - keys["default"] = "FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"; - } - for (var item in keys) { - keys[item] = this.template[item].split(" ").map(function(value) { - return value.trim(); - }); - } - return keys; - } - keys["default"] = this.template.split(" ").map(function(value) { - return value.trim(); - }); - return keys; - }, "templateItems"), - page: /* @__PURE__ */ __name(function page3() { - return Math.floor(this.d_first / this.d_rows); - }, "page"), - pageCount: /* @__PURE__ */ __name(function pageCount() { - return Math.ceil(this.totalRecords / this.d_rows); - }, "pageCount"), - isFirstPage: /* @__PURE__ */ __name(function isFirstPage() { - return this.page === 0; - }, "isFirstPage"), - isLastPage: /* @__PURE__ */ __name(function isLastPage() { - return this.page === this.pageCount - 1; - }, "isLastPage"), - calculatePageLinkBoundaries: /* @__PURE__ */ __name(function calculatePageLinkBoundaries() { - var numberOfPages = this.pageCount; - var visiblePages = Math.min(this.pageLinkSize, numberOfPages); - var start = Math.max(0, Math.ceil(this.page - visiblePages / 2)); - var end = Math.min(numberOfPages - 1, start + visiblePages - 1); - var delta = this.pageLinkSize - (end - start + 1); - start = Math.max(0, start - delta); - return [start, end]; - }, "calculatePageLinkBoundaries"), - pageLinks: /* @__PURE__ */ __name(function pageLinks() { - var pageLinks2 = []; - var boundaries = this.calculatePageLinkBoundaries; - var start = boundaries[0]; - var end = boundaries[1]; - for (var i = start; i <= end; i++) { - pageLinks2.push(i + 1); - } - return pageLinks2; - }, "pageLinks"), - currentState: /* @__PURE__ */ __name(function currentState() { - return { - page: this.page, - first: this.d_first, - rows: this.d_rows - }; - }, "currentState"), - empty: /* @__PURE__ */ __name(function empty() { - return this.pageCount === 0; - }, "empty"), - currentPage: /* @__PURE__ */ __name(function currentPage() { - return this.pageCount > 0 ? this.page + 1 : 0; - }, "currentPage"), - last: /* @__PURE__ */ __name(function last2() { - return Math.min(this.d_first + this.rows, this.totalRecords); - }, "last") - }, - components: { - CurrentPageReport: script$9$1, - FirstPageLink: script$8$1, - LastPageLink: script$5$1, - NextPageLink: script$4$1, - PageLinks: script$3$1, - PrevPageLink: script$2$1, - RowsPerPageDropdown: script$1$2, - JumpToPageDropdown: script$7$1, - JumpToPageInput: script$6$1 - } -}; -function render$k(_ctx, _cache, $props, $setup, $data, $options) { - var _component_FirstPageLink = resolveComponent("FirstPageLink"); - var _component_PrevPageLink = resolveComponent("PrevPageLink"); - var _component_NextPageLink = resolveComponent("NextPageLink"); - var _component_LastPageLink = resolveComponent("LastPageLink"); - var _component_PageLinks = resolveComponent("PageLinks"); - var _component_CurrentPageReport = resolveComponent("CurrentPageReport"); - var _component_RowsPerPageDropdown = resolveComponent("RowsPerPageDropdown"); - var _component_JumpToPageDropdown = resolveComponent("JumpToPageDropdown"); - var _component_JumpToPageInput = resolveComponent("JumpToPageInput"); - return (_ctx.alwaysShow ? true : $options.pageLinks && $options.pageLinks.length > 1) ? (openBlock(), createElementBlock("nav", normalizeProps(mergeProps({ - key: 0 - }, _ctx.ptmi("paginatorContainer"))), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.templateItems, function(value, key) { - return openBlock(), createElementBlock("div", mergeProps({ - key, - ref_for: true, - ref: "paginator", - "class": _ctx.cx("paginator", { - key - }) - }, _ctx.ptm("root")), [_ctx.$slots.container ? renderSlot(_ctx.$slots, "container", { - key: 0, - first: $data.d_first + 1, - last: $options.last, - rows: $data.d_rows, - page: $options.page, - pageCount: $options.pageCount, - totalRecords: _ctx.totalRecords, - firstPageCallback: $options.changePageToFirst, - lastPageCallback: $options.changePageToLast, - prevPageCallback: $options.changePageToPrev, - nextPageCallback: $options.changePageToNext, - rowChangeCallback: $options.onRowChange - }) : (openBlock(), createElementBlock(Fragment, { - key: 1 - }, [_ctx.$slots.start ? (openBlock(), createElementBlock("div", mergeProps({ - key: 0, - "class": _ctx.cx("contentStart"), - ref_for: true - }, _ctx.ptm("contentStart")), [renderSlot(_ctx.$slots, "start", { - state: $options.currentState - })], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ - "class": _ctx.cx("content"), - ref_for: true - }, _ctx.ptm("content")), [(openBlock(true), createElementBlock(Fragment, null, renderList(value, function(item) { - return openBlock(), createElementBlock(Fragment, { - key: item - }, [item === "FirstPageLink" ? (openBlock(), createBlock(_component_FirstPageLink, { - key: 0, - "aria-label": $options.getAriaLabel("firstPageLabel"), - template: _ctx.$slots.firsticon || _ctx.$slots.firstpagelinkicon, - onClick: _cache[0] || (_cache[0] = function($event) { - return $options.changePageToFirst($event); - }), - disabled: $options.isFirstPage || $options.empty, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["aria-label", "template", "disabled", "unstyled", "pt"])) : item === "PrevPageLink" ? (openBlock(), createBlock(_component_PrevPageLink, { - key: 1, - "aria-label": $options.getAriaLabel("prevPageLabel"), - template: _ctx.$slots.previcon || _ctx.$slots.prevpagelinkicon, - onClick: _cache[1] || (_cache[1] = function($event) { - return $options.changePageToPrev($event); - }), - disabled: $options.isFirstPage || $options.empty, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["aria-label", "template", "disabled", "unstyled", "pt"])) : item === "NextPageLink" ? (openBlock(), createBlock(_component_NextPageLink, { - key: 2, - "aria-label": $options.getAriaLabel("nextPageLabel"), - template: _ctx.$slots.nexticon || _ctx.$slots.nextpagelinkicon, - onClick: _cache[2] || (_cache[2] = function($event) { - return $options.changePageToNext($event); - }), - disabled: $options.isLastPage || $options.empty, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["aria-label", "template", "disabled", "unstyled", "pt"])) : item === "LastPageLink" ? (openBlock(), createBlock(_component_LastPageLink, { - key: 3, - "aria-label": $options.getAriaLabel("lastPageLabel"), - template: _ctx.$slots.lasticon || _ctx.$slots.lastpagelinkicon, - onClick: _cache[3] || (_cache[3] = function($event) { - return $options.changePageToLast($event); - }), - disabled: $options.isLastPage || $options.empty, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["aria-label", "template", "disabled", "unstyled", "pt"])) : item === "PageLinks" ? (openBlock(), createBlock(_component_PageLinks, { - key: 4, - "aria-label": $options.getAriaLabel("pageLabel"), - value: $options.pageLinks, - page: $options.page, - onClick: _cache[4] || (_cache[4] = function($event) { - return $options.changePageLink($event); - }), - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["aria-label", "value", "page", "unstyled", "pt"])) : item === "CurrentPageReport" ? (openBlock(), createBlock(_component_CurrentPageReport, { - key: 5, - "aria-live": "polite", - template: _ctx.currentPageReportTemplate, - currentPage: $options.currentPage, - page: $options.page, - pageCount: $options.pageCount, - first: $data.d_first, - rows: $data.d_rows, - totalRecords: _ctx.totalRecords, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["template", "currentPage", "page", "pageCount", "first", "rows", "totalRecords", "unstyled", "pt"])) : item === "RowsPerPageDropdown" && _ctx.rowsPerPageOptions ? (openBlock(), createBlock(_component_RowsPerPageDropdown, { - key: 6, - "aria-label": $options.getAriaLabel("rowsPerPageLabel"), - rows: $data.d_rows, - options: _ctx.rowsPerPageOptions, - onRowsChange: _cache[5] || (_cache[5] = function($event) { - return $options.onRowChange($event); - }), - disabled: $options.empty, - templates: _ctx.$slots, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["aria-label", "rows", "options", "disabled", "templates", "unstyled", "pt"])) : item === "JumpToPageDropdown" ? (openBlock(), createBlock(_component_JumpToPageDropdown, { - key: 7, - "aria-label": $options.getAriaLabel("jumpToPageDropdownLabel"), - page: $options.page, - pageCount: $options.pageCount, - onPageChange: _cache[6] || (_cache[6] = function($event) { - return $options.changePage($event); - }), - disabled: $options.empty, - templates: _ctx.$slots, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["aria-label", "page", "pageCount", "disabled", "templates", "unstyled", "pt"])) : item === "JumpToPageInput" ? (openBlock(), createBlock(_component_JumpToPageInput, { - key: 8, - page: $options.currentPage, - onPageChange: _cache[7] || (_cache[7] = function($event) { - return $options.changePage($event); - }), - disabled: $options.empty, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["page", "disabled", "unstyled", "pt"])) : createCommentVNode("", true)], 64); - }), 128))], 16), _ctx.$slots.end ? (openBlock(), createElementBlock("div", mergeProps({ - key: 1, - "class": _ctx.cx("contentEnd"), - ref_for: true - }, _ctx.ptm("contentEnd")), [renderSlot(_ctx.$slots, "end", { - state: $options.currentState - })], 16)) : createCommentVNode("", true)], 64))], 16); - }), 128))], 16)) : createCommentVNode("", true); -} -__name(render$k, "render$k"); -script$l.render = render$k; -var theme$1 = /* @__PURE__ */ __name(function theme2(_ref) { - var dt = _ref.dt; - return "\n.p-datatable {\n position: relative;\n}\n\n.p-datatable-table {\n border-spacing: 0;\n border-collapse: separate;\n width: 100%;\n}\n\n.p-datatable-scrollable > .p-datatable-table-container {\n position: relative;\n}\n\n.p-datatable-scrollable-table > .p-datatable-thead {\n inset-block-start: 0;\n z-index: 1;\n}\n\n.p-datatable-scrollable-table > .p-datatable-frozen-tbody {\n position: sticky;\n z-index: 1;\n}\n\n.p-datatable-scrollable-table > .p-datatable-tfoot {\n inset-block-end: 0;\n z-index: 1;\n}\n\n.p-datatable-scrollable .p-datatable-frozen-column {\n position: sticky;\n background: ".concat(dt("datatable.header.cell.background"), ";\n}\n\n.p-datatable-scrollable th.p-datatable-frozen-column {\n z-index: 1;\n}\n\n.p-datatable-scrollable > .p-datatable-table-container > .p-datatable-table > .p-datatable-thead,\n.p-datatable-scrollable > .p-datatable-table-container > .p-virtualscroller > .p-datatable-table > .p-datatable-thead {\n background: ").concat(dt("datatable.header.cell.background"), ";\n}\n\n.p-datatable-scrollable > .p-datatable-table-container > .p-datatable-table > .p-datatable-tfoot,\n.p-datatable-scrollable > .p-datatable-table-container > .p-virtualscroller > .p-datatable-table > .p-datatable-tfoot {\n background: ").concat(dt("datatable.footer.cell.background"), ";\n}\n\n.p-datatable-flex-scrollable {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.p-datatable-flex-scrollable > .p-datatable-table-container {\n display: flex;\n flex-direction: column;\n flex: 1;\n height: 100%;\n}\n\n.p-datatable-scrollable-table > .p-datatable-tbody > .p-datatable-row-group-header {\n position: sticky;\n z-index: 1;\n}\n\n.p-datatable-resizable-table > .p-datatable-thead > tr > th,\n.p-datatable-resizable-table > .p-datatable-tfoot > tr > td,\n.p-datatable-resizable-table > .p-datatable-tbody > tr > td {\n overflow: hidden;\n white-space: nowrap;\n}\n\n.p-datatable-resizable-table > .p-datatable-thead > tr > th.p-datatable-resizable-column:not(.p-datatable-frozen-column) {\n background-clip: padding-box;\n position: relative;\n}\n\n.p-datatable-resizable-table-fit > .p-datatable-thead > tr > th.p-datatable-resizable-column:last-child .p-datatable-column-resizer {\n display: none;\n}\n\n.p-datatable-column-resizer {\n display: block;\n position: absolute;\n inset-block-start: 0;\n inset-inline-end: 0;\n margin: 0;\n width: ").concat(dt("datatable.column.resizer.width"), ";\n height: 100%;\n padding: 0;\n cursor: col-resize;\n border: 1px solid transparent;\n}\n\n.p-datatable-column-header-content {\n display: flex;\n align-items: center;\n gap: ").concat(dt("datatable.header.cell.gap"), ";\n}\n\n.p-datatable-column-resize-indicator {\n width: ").concat(dt("datatable.resize.indicator.width"), ";\n position: absolute;\n z-index: 10;\n display: none;\n background: ").concat(dt("datatable.resize.indicator.color"), ";\n}\n\n.p-datatable-row-reorder-indicator-up,\n.p-datatable-row-reorder-indicator-down {\n position: absolute;\n display: none;\n}\n\n.p-datatable-reorderable-column,\n.p-datatable-reorderable-row-handle {\n cursor: move;\n}\n\n.p-datatable-mask {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 2;\n}\n\n.p-datatable-inline-filter {\n display: flex;\n align-items: center;\n width: 100%;\n gap: ").concat(dt("datatable.filter.inline.gap"), ";\n}\n\n.p-datatable-inline-filter .p-datatable-filter-element-container {\n flex: 1 1 auto;\n width: 1%;\n}\n\n.p-datatable-filter-overlay {\n background: ").concat(dt("datatable.filter.overlay.select.background"), ";\n color: ").concat(dt("datatable.filter.overlay.select.color"), ";\n border: 1px solid ").concat(dt("datatable.filter.overlay.select.border.color"), ";\n border-radius: ").concat(dt("datatable.filter.overlay.select.border.radius"), ";\n box-shadow: ").concat(dt("datatable.filter.overlay.select.shadow"), ";\n min-width: 12.5rem;\n}\n\n.p-datatable-filter-constraint-list {\n margin: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n padding: ").concat(dt("datatable.filter.constraint.list.padding"), ";\n gap: ").concat(dt("datatable.filter.constraint.list.gap"), ";\n}\n\n.p-datatable-filter-constraint {\n padding: ").concat(dt("datatable.filter.constraint.padding"), ";\n color: ").concat(dt("datatable.filter.constraint.color"), ";\n border-radius: ").concat(dt("datatable.filter.constraint.border.radius"), ";\n cursor: pointer;\n transition: background ").concat(dt("datatable.transition.duration"), ", color ").concat(dt("datatable.transition.duration"), ", border-color ").concat(dt("datatable.transition.duration"), ",\n box-shadow ").concat(dt("datatable.transition.duration"), ";\n}\n\n.p-datatable-filter-constraint-selected {\n background: ").concat(dt("datatable.filter.constraint.selected.background"), ";\n color: ").concat(dt("datatable.filter.constraint.selected.color"), ";\n}\n\n.p-datatable-filter-constraint:not(.p-datatable-filter-constraint-selected):not(.p-disabled):hover {\n background: ").concat(dt("datatable.filter.constraint.focus.background"), ";\n color: ").concat(dt("datatable.filter.constraint.focus.color"), ";\n}\n\n.p-datatable-filter-constraint:focus-visible {\n outline: 0 none;\n background: ").concat(dt("datatable.filter.constraint.focus.background"), ";\n color: ").concat(dt("datatable.filter.constraint.focus.color"), ";\n}\n\n.p-datatable-filter-constraint-selected:focus-visible {\n outline: 0 none;\n background: ").concat(dt("datatable.filter.constraint.selected.focus.background"), ";\n color: ").concat(dt("datatable.filter.constraint.selected.focus.color"), ";\n}\n\n.p-datatable-filter-constraint-separator {\n border-block-start: 1px solid ").concat(dt("datatable.filter.constraint.separator.border.color"), ";\n}\n\n.p-datatable-popover-filter {\n display: inline-flex;\n margin-inline-start: auto;\n}\n\n.p-datatable-filter-overlay-popover {\n background: ").concat(dt("datatable.filter.overlay.popover.background"), ";\n color: ").concat(dt("datatable.filter.overlay.popover.color"), ";\n border: 1px solid ").concat(dt("datatable.filter.overlay.popover.border.color"), ";\n border-radius: ").concat(dt("datatable.filter.overlay.popover.border.radius"), ";\n box-shadow: ").concat(dt("datatable.filter.overlay.popover.shadow"), ";\n min-width: 12.5rem;\n padding: ").concat(dt("datatable.filter.overlay.popover.padding"), ";\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("datatable.filter.overlay.popover.gap"), ";\n}\n\n.p-datatable-filter-operator-dropdown {\n width: 100%;\n}\n\n.p-datatable-filter-rule-list,\n.p-datatable-filter-rule {\n display: flex;\n flex-direction: column;\n gap: ").concat(dt("datatable.filter.overlay.popover.gap"), ";\n}\n\n.p-datatable-filter-rule {\n border-block-end: 1px solid ").concat(dt("datatable.filter.rule.border.color"), ";\n padding-bottom: ").concat(dt("datatable.filter.overlay.popover.gap"), ";\n}\n\n.p-datatable-filter-rule:last-child {\n border-block-end: 0 none;\n padding-bottom: 0;\n}\n\n.p-datatable-filter-add-rule-button {\n width: 100%;\n}\n\n.p-datatable-filter-remove-rule-button {\n width: 100%;\n}\n\n.p-datatable-filter-buttonbar {\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.p-datatable-virtualscroller-spacer {\n display: flex;\n}\n\n.p-datatable .p-virtualscroller .p-virtualscroller-loading {\n transform: none !important;\n min-height: 0;\n position: sticky;\n inset-block-start: 0;\n inset-inline-start: 0;\n}\n\n.p-datatable-paginator-top {\n border-color: ").concat(dt("datatable.paginator.top.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("datatable.paginator.top.border.width"), ";\n}\n\n.p-datatable-paginator-bottom {\n border-color: ").concat(dt("datatable.paginator.bottom.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("datatable.paginator.bottom.border.width"), ";\n}\n\n.p-datatable-header {\n background: ").concat(dt("datatable.header.background"), ";\n color: ").concat(dt("datatable.header.color"), ";\n border-color: ").concat(dt("datatable.header.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("datatable.header.border.width"), ";\n padding: ").concat(dt("datatable.header.padding"), ";\n}\n\n.p-datatable-footer {\n background: ").concat(dt("datatable.footer.background"), ";\n color: ").concat(dt("datatable.footer.color"), ";\n border-color: ").concat(dt("datatable.footer.border.color"), ";\n border-style: solid;\n border-width: ").concat(dt("datatable.footer.border.width"), ";\n padding: ").concat(dt("datatable.footer.padding"), ";\n}\n\n.p-datatable-header-cell {\n padding: ").concat(dt("datatable.header.cell.padding"), ";\n background: ").concat(dt("datatable.header.cell.background"), ";\n border-color: ").concat(dt("datatable.header.cell.border.color"), ";\n border-style: solid;\n border-width: 0 0 1px 0;\n color: ").concat(dt("datatable.header.cell.color"), ";\n font-weight: normal;\n text-align: start;\n transition: background ").concat(dt("datatable.transition.duration"), ", color ").concat(dt("datatable.transition.duration"), ", border-color ").concat(dt("datatable.transition.duration"), ",\n outline-color ").concat(dt("datatable.transition.duration"), ", box-shadow ").concat(dt("datatable.transition.duration"), ";\n}\n\n.p-datatable-column-title {\n font-weight: ").concat(dt("datatable.column.title.font.weight"), ";\n}\n\n.p-datatable-tbody > tr {\n outline-color: transparent;\n background: ").concat(dt("datatable.row.background"), ";\n color: ").concat(dt("datatable.row.color"), ";\n transition: background ").concat(dt("datatable.transition.duration"), ", color ").concat(dt("datatable.transition.duration"), ", border-color ").concat(dt("datatable.transition.duration"), ",\n outline-color ").concat(dt("datatable.transition.duration"), ", box-shadow ").concat(dt("datatable.transition.duration"), ";\n}\n\n.p-datatable-tbody > tr > td {\n text-align: start;\n border-color: ").concat(dt("datatable.body.cell.border.color"), ";\n border-style: solid;\n border-width: 0 0 1px 0;\n padding: ").concat(dt("datatable.body.cell.padding"), ";\n}\n\n.p-datatable-hoverable .p-datatable-tbody > tr:not(.p-datatable-row-selected):hover {\n background: ").concat(dt("datatable.row.hover.background"), ";\n color: ").concat(dt("datatable.row.hover.color"), ";\n}\n\n.p-datatable-tbody > tr.p-datatable-row-selected {\n background: ").concat(dt("datatable.row.selected.background"), ";\n color: ").concat(dt("datatable.row.selected.color"), ";\n}\n\n.p-datatable-tbody > tr:has(+ .p-datatable-row-selected) > td {\n border-block-end-color: ").concat(dt("datatable.body.cell.selected.border.color"), ";\n}\n\n.p-datatable-tbody > tr.p-datatable-row-selected > td {\n border-block-end-color: ").concat(dt("datatable.body.cell.selected.border.color"), ";\n}\n\n.p-datatable-tbody > tr:focus-visible,\n.p-datatable-tbody > tr.p-datatable-contextmenu-row-selected {\n box-shadow: ").concat(dt("datatable.row.focus.ring.shadow"), ";\n outline: ").concat(dt("datatable.row.focus.ring.width"), " ").concat(dt("datatable.row.focus.ring.style"), " ").concat(dt("datatable.row.focus.ring.color"), ";\n outline-offset: ").concat(dt("datatable.row.focus.ring.offset"), ";\n}\n\n.p-datatable-tfoot > tr > td {\n text-align: start;\n padding: ").concat(dt("datatable.footer.cell.padding"), ";\n border-color: ").concat(dt("datatable.footer.cell.border.color"), ";\n border-style: solid;\n border-width: 0 0 1px 0;\n color: ").concat(dt("datatable.footer.cell.color"), ";\n background: ").concat(dt("datatable.footer.cell.background"), ";\n}\n\n.p-datatable-column-footer {\n font-weight: ").concat(dt("datatable.column.footer.font.weight"), ";\n}\n\n.p-datatable-sortable-column {\n cursor: pointer;\n user-select: none;\n outline-color: transparent;\n}\n\n.p-datatable-column-title,\n.p-datatable-sort-icon,\n.p-datatable-sort-badge {\n vertical-align: middle;\n}\n\n.p-datatable-sort-icon {\n color: ").concat(dt("datatable.sort.icon.color"), ";\n font-size: ").concat(dt("datatable.sort.icon.size"), ";\n width: ").concat(dt("datatable.sort.icon.size"), ";\n height: ").concat(dt("datatable.sort.icon.size"), ";\n transition: color ").concat(dt("datatable.transition.duration"), ";\n}\n\n.p-datatable-sortable-column:not(.p-datatable-column-sorted):hover {\n background: ").concat(dt("datatable.header.cell.hover.background"), ";\n color: ").concat(dt("datatable.header.cell.hover.color"), ";\n}\n\n.p-datatable-sortable-column:not(.p-datatable-column-sorted):hover .p-datatable-sort-icon {\n color: ").concat(dt("datatable.sort.icon.hover.color"), ";\n}\n\n.p-datatable-column-sorted {\n background: ").concat(dt("datatable.header.cell.selected.background"), ";\n color: ").concat(dt("datatable.header.cell.selected.color"), ";\n}\n\n.p-datatable-column-sorted .p-datatable-sort-icon {\n color: ").concat(dt("datatable.header.cell.selected.color"), ";\n}\n\n.p-datatable-sortable-column:focus-visible {\n box-shadow: ").concat(dt("datatable.header.cell.focus.ring.shadow"), ";\n outline: ").concat(dt("datatable.header.cell.focus.ring.width"), " ").concat(dt("datatable.header.cell.focus.ring.style"), " ").concat(dt("datatable.header.cell.focus.ring.color"), ";\n outline-offset: ").concat(dt("datatable.header.cell.focus.ring.offset"), ";\n}\n\n.p-datatable-hoverable .p-datatable-selectable-row {\n cursor: pointer;\n}\n\n.p-datatable-tbody > tr.p-datatable-dragpoint-top > td {\n box-shadow: inset 0 2px 0 0 ").concat(dt("datatable.drop.point.color"), ";\n}\n\n.p-datatable-tbody > tr.p-datatable-dragpoint-bottom > td {\n box-shadow: inset 0 -2px 0 0 ").concat(dt("datatable.drop.point.color"), ";\n}\n\n.p-datatable-loading-icon {\n font-size: ").concat(dt("datatable.loading.icon.size"), ";\n width: ").concat(dt("datatable.loading.icon.size"), ";\n height: ").concat(dt("datatable.loading.icon.size"), ";\n}\n\n.p-datatable-gridlines .p-datatable-header {\n border-width: 1px 1px 0 1px;\n}\n\n.p-datatable-gridlines .p-datatable-footer {\n border-width: 0 1px 1px 1px;\n}\n\n.p-datatable-gridlines .p-datatable-paginator-top {\n border-width: 1px 1px 0 1px;\n}\n\n.p-datatable-gridlines .p-datatable-paginator-bottom {\n border-width: 0 1px 1px 1px;\n}\n\n.p-datatable-gridlines .p-datatable-thead > tr > th {\n border-width: 1px 0 1px 1px;\n}\n\n.p-datatable-gridlines .p-datatable-thead > tr > th:last-child {\n border-width: 1px;\n}\n\n.p-datatable-gridlines .p-datatable-tbody > tr > td {\n border-width: 1px 0 0 1px;\n}\n\n.p-datatable-gridlines .p-datatable-tbody > tr > td:last-child {\n border-width: 1px 1px 0 1px;\n}\n\n.p-datatable-gridlines .p-datatable-tbody > tr:last-child > td {\n border-width: 1px 0 1px 1px;\n}\n\n.p-datatable-gridlines .p-datatable-tbody > tr:last-child > td:last-child {\n border-width: 1px;\n}\n\n.p-datatable-gridlines .p-datatable-tfoot > tr > td {\n border-width: 1px 0 1px 1px;\n}\n\n.p-datatable-gridlines .p-datatable-tfoot > tr > td:last-child {\n border-width: 1px 1px 1px 1px;\n}\n\n.p-datatable.p-datatable-gridlines .p-datatable-thead + .p-datatable-tfoot > tr > td {\n border-width: 0 0 1px 1px;\n}\n\n.p-datatable.p-datatable-gridlines .p-datatable-thead + .p-datatable-tfoot > tr > td:last-child {\n border-width: 0 1px 1px 1px;\n}\n\n.p-datatable.p-datatable-gridlines:has(.p-datatable-thead):has(.p-datatable-tbody) .p-datatable-tbody > tr > td {\n border-width: 0 0 1px 1px;\n}\n\n.p-datatable.p-datatable-gridlines:has(.p-datatable-thead):has(.p-datatable-tbody) .p-datatable-tbody > tr > td:last-child {\n border-width: 0 1px 1px 1px;\n}\n\n.p-datatable.p-datatable-gridlines:has(.p-datatable-tbody):has(.p-datatable-tfoot) .p-datatable-tbody > tr:last-child > td {\n border-width: 0 0 0 1px;\n}\n\n.p-datatable.p-datatable-gridlines:has(.p-datatable-tbody):has(.p-datatable-tfoot) .p-datatable-tbody > tr:last-child > td:last-child {\n border-width: 0 1px 0 1px;\n}\n\n.p-datatable.p-datatable-striped .p-datatable-tbody > tr.p-row-odd {\n background: ").concat(dt("datatable.row.striped.background"), ";\n}\n\n.p-datatable.p-datatable-striped .p-datatable-tbody > tr.p-row-odd.p-datatable-row-selected {\n background: ").concat(dt("datatable.row.selected.background"), ";\n color: ").concat(dt("datatable.row.selected.color"), ";\n}\n\n.p-datatable-striped.p-datatable-hoverable .p-datatable-tbody > tr:not(.p-datatable-row-selected):hover {\n background: ").concat(dt("datatable.row.hover.background"), ";\n color: ").concat(dt("datatable.row.hover.color"), ";\n}\n\n.p-datatable.p-datatable-sm .p-datatable-header {\n padding: 0.375rem 0.5rem;\n}\n\n.p-datatable.p-datatable-sm .p-datatable-thead > tr > th {\n padding: 0.375rem 0.5rem;\n}\n\n.p-datatable.p-datatable-sm .p-datatable-tbody > tr > td {\n padding: 0.375rem 0.5rem;\n}\n\n.p-datatable.p-datatable-sm .p-datatable-tfoot > tr > td {\n padding: 0.375rem 0.5rem;\n}\n\n.p-datatable.p-datatable-sm .p-datatable-footer {\n padding: 0.375rem 0.5rem;\n}\n\n.p-datatable.p-datatable-lg .p-datatable-header {\n padding: 1rem 1.25rem;\n}\n\n.p-datatable.p-datatable-lg .p-datatable-thead > tr > th {\n padding: 1rem 1.25rem;\n}\n\n.p-datatable.p-datatable-lg .p-datatable-tbody > tr > td {\n padding: 1rem 1.25rem;\n}\n\n.p-datatable.p-datatable-lg .p-datatable-tfoot > tr > td {\n padding: 1rem 1.25rem;\n}\n\n.p-datatable.p-datatable-lg .p-datatable-footer {\n padding: 1rem 1.25rem;\n}\n\n.p-datatable-row-toggle-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n width: ").concat(dt("datatable.row.toggle.button.size"), ";\n height: ").concat(dt("datatable.row.toggle.button.size"), ";\n color: ").concat(dt("datatable.row.toggle.button.color"), ";\n border: 0 none;\n background: transparent;\n cursor: pointer;\n border-radius: ").concat(dt("datatable.row.toggle.button.border.radius"), ";\n transition: background ").concat(dt("datatable.transition.duration"), ", color ").concat(dt("datatable.transition.duration"), ", border-color ").concat(dt("datatable.transition.duration"), ",\n outline-color ").concat(dt("datatable.transition.duration"), ", box-shadow ").concat(dt("datatable.transition.duration"), ";\n outline-color: transparent;\n user-select: none;\n}\n\n.p-datatable-row-toggle-button:enabled:hover {\n color: ").concat(dt("datatable.row.toggle.button.hover.color"), ";\n background: ").concat(dt("datatable.row.toggle.button.hover.background"), ";\n}\n\n.p-datatable-tbody > tr.p-datatable-row-selected .p-datatable-row-toggle-button:hover {\n background: ").concat(dt("datatable.row.toggle.button.selected.hover.background"), ";\n color: ").concat(dt("datatable.row.toggle.button.selected.hover.color"), ";\n}\n\n.p-datatable-row-toggle-button:focus-visible {\n box-shadow: ").concat(dt("datatable.row.toggle.button.focus.ring.shadow"), ";\n outline: ").concat(dt("datatable.row.toggle.button.focus.ring.width"), " ").concat(dt("datatable.row.toggle.button.focus.ring.style"), " ").concat(dt("datatable.row.toggle.button.focus.ring.color"), ";\n outline-offset: ").concat(dt("datatable.row.toggle.button.focus.ring.offset"), ";\n}\n\n.p-datatable-row-toggle-icon:dir(rtl) {\n transform: rotate(180deg);\n}\n"); -}, "theme"); -var classes$1 = { - root: /* @__PURE__ */ __name(function root(_ref2) { - var props = _ref2.props; - return ["p-datatable p-component", { - "p-datatable-hoverable": props.rowHover || props.selectionMode, - "p-datatable-resizable": props.resizableColumns, - "p-datatable-resizable-fit": props.resizableColumns && props.columnResizeMode === "fit", - "p-datatable-scrollable": props.scrollable, - "p-datatable-flex-scrollable": props.scrollable && props.scrollHeight === "flex", - "p-datatable-striped": props.stripedRows, - "p-datatable-gridlines": props.showGridlines, - "p-datatable-sm": props.size === "small", - "p-datatable-lg": props.size === "large" - }]; - }, "root"), - mask: "p-datatable-mask p-overlay-mask", - loadingIcon: "p-datatable-loading-icon", - header: "p-datatable-header", - pcPaginator: /* @__PURE__ */ __name(function pcPaginator(_ref3) { - var position = _ref3.position; - return "p-datatable-paginator-" + position; - }, "pcPaginator"), - tableContainer: "p-datatable-table-container", - table: /* @__PURE__ */ __name(function table(_ref4) { - var props = _ref4.props; - return ["p-datatable-table", { - "p-datatable-scrollable-table": props.scrollable, - "p-datatable-resizable-table": props.resizableColumns, - "p-datatable-resizable-table-fit": props.resizableColumns && props.columnResizeMode === "fit" - }]; - }, "table"), - thead: "p-datatable-thead", - headerCell: /* @__PURE__ */ __name(function headerCell(_ref5) { - var instance = _ref5.instance, props = _ref5.props, column = _ref5.column; - return column && !instance.columnProp(column, "hidden") && (props.rowGroupMode !== "subheader" || props.groupRowsBy !== instance.columnProp(column, "field")) ? ["p-datatable-header-cell", { - "p-datatable-frozen-column": instance.columnProp(column, "frozen") - }] : ["p-datatable-header-cell", { - "p-datatable-sortable-column": instance.columnProp("sortable"), - "p-datatable-resizable-column": instance.resizableColumns, - "p-datatable-column-sorted": instance.isColumnSorted(), - "p-datatable-frozen-column": instance.columnProp("frozen"), - "p-datatable-reorderable-column": props.reorderableColumns - }]; - }, "headerCell"), - columnResizer: "p-datatable-column-resizer", - columnHeaderContent: "p-datatable-column-header-content", - columnTitle: "p-datatable-column-title", - columnFooter: "p-datatable-column-footer", - sortIcon: "p-datatable-sort-icon", - pcSortBadge: "p-datatable-sort-badge", - filter: /* @__PURE__ */ __name(function filter(_ref6) { - var props = _ref6.props; - return ["p-datatable-filter", { - "p-datatable-inline-filter": props.display === "row", - "p-datatable-popover-filter": props.display === "menu" - }]; - }, "filter"), - filterElementContainer: "p-datatable-filter-element-container", - pcColumnFilterButton: "p-datatable-column-filter-button", - pcColumnFilterClearButton: "p-datatable-column-filter-clear-button", - filterOverlay: /* @__PURE__ */ __name(function filterOverlay(_ref7) { - _ref7.instance; - var props = _ref7.props; - return ["p-datatable-filter-overlay p-component", { - "p-datatable-filter-overlay-popover": props.display === "menu" - }]; - }, "filterOverlay"), - filterConstraintList: "p-datatable-filter-constraint-list", - filterConstraint: /* @__PURE__ */ __name(function filterConstraint(_ref8) { - var instance = _ref8.instance, matchMode = _ref8.matchMode; - return ["p-datatable-filter-constraint", { - "p-datatable-filter-constraint-selected": matchMode && instance.isRowMatchModeSelected(matchMode.value) - }]; - }, "filterConstraint"), - filterConstraintSeparator: "p-datatable-filter-constraint-separator", - filterOperator: "p-datatable-filter-operator", - pcFilterOperatorDropdown: "p-datatable-filter-operator-dropdown", - filterRuleList: "p-datatable-filter-rule-list", - filterRule: "p-datatable-filter-rule", - pcFilterConstraintDropdown: "p-datatable-filter-constraint-dropdown", - pcFilterRemoveRuleButton: "p-datatable-filter-remove-rule-button", - pcFilterAddRuleButton: "p-datatable-filter-add-rule-button", - filterButtonbar: "p-datatable-filter-buttonbar", - pcFilterClearButton: "p-datatable-filter-clear-button", - pcFilterApplyButton: "p-datatable-filter-apply-button", - tbody: /* @__PURE__ */ __name(function tbody(_ref9) { - var props = _ref9.props; - return props.frozenRow ? "p-datatable-tbody p-datatable-frozen-tbody" : "p-datatable-tbody"; - }, "tbody"), - rowGroupHeader: "p-datatable-row-group-header", - rowToggleButton: "p-datatable-row-toggle-button", - rowToggleIcon: "p-datatable-row-toggle-icon", - row: /* @__PURE__ */ __name(function row(_ref10) { - var instance = _ref10.instance, props = _ref10.props, index = _ref10.index, columnSelectionMode = _ref10.columnSelectionMode; - var rowStyleClass = []; - if (props.selectionMode) { - rowStyleClass.push("p-datatable-selectable-row"); - } - if (props.selection) { - rowStyleClass.push({ - "p-datatable-row-selected": columnSelectionMode ? instance.isSelected && instance.$parentInstance.$parentInstance.highlightOnSelect : instance.isSelected - }); - } - if (props.contextMenuSelection) { - rowStyleClass.push({ - "p-datatable-contextmenu-row-selected": instance.isSelectedWithContextMenu - }); - } - rowStyleClass.push(index % 2 === 0 ? "p-row-even" : "p-row-odd"); - return rowStyleClass; - }, "row"), - rowExpansion: "p-datatable-row-expansion", - rowGroupFooter: "p-datatable-row-group-footer", - emptyMessage: "p-datatable-empty-message", - bodyCell: /* @__PURE__ */ __name(function bodyCell(_ref11) { - var instance = _ref11.instance; - return [{ - "p-datatable-frozen-column": instance.columnProp("frozen") - }]; - }, "bodyCell"), - reorderableRowHandle: "p-datatable-reorderable-row-handle", - pcRowEditorInit: "p-datatable-row-editor-init", - pcRowEditorSave: "p-datatable-row-editor-save", - pcRowEditorCancel: "p-datatable-row-editor-cancel", - tfoot: "p-datatable-tfoot", - footerCell: /* @__PURE__ */ __name(function footerCell(_ref12) { - var instance = _ref12.instance; - return [{ - "p-datatable-frozen-column": instance.columnProp("frozen") - }]; - }, "footerCell"), - virtualScrollerSpacer: "p-datatable-virtualscroller-spacer", - footer: "p-datatable-footer", - columnResizeIndicator: "p-datatable-column-resize-indicator", - rowReorderIndicatorUp: "p-datatable-row-reorder-indicator-up", - rowReorderIndicatorDown: "p-datatable-row-reorder-indicator-down" -}; -var inlineStyles = { - tableContainer: { - overflow: "auto" - }, - thead: { - position: "sticky" - }, - tfoot: { - position: "sticky" - } -}; -var DataTableStyle = BaseStyle.extend({ - name: "datatable", - theme: theme$1, - classes: classes$1, - inlineStyles -}); -var script$k = { - name: "PencilIcon", - "extends": script$t -}; -function render$j(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - d: "M0.609628 13.959C0.530658 13.9599 0.452305 13.9451 0.379077 13.9156C0.305849 13.8861 0.239191 13.8424 0.18294 13.787C0.118447 13.7234 0.0688234 13.6464 0.0376166 13.5614C0.00640987 13.4765 -0.00560954 13.3857 0.00241768 13.2956L0.25679 10.1501C0.267698 10.0041 0.331934 9.86709 0.437312 9.76516L9.51265 0.705715C10.0183 0.233014 10.6911 -0.0203041 11.3835 0.00127367C12.0714 0.00660201 12.7315 0.27311 13.2298 0.746671C13.7076 1.23651 13.9824 1.88848 13.9992 2.57201C14.0159 3.25554 13.7733 3.92015 13.32 4.4327L4.23648 13.5331C4.13482 13.6342 4.0017 13.6978 3.85903 13.7133L0.667067 14L0.609628 13.959ZM1.43018 10.4696L1.25787 12.714L3.50619 12.5092L12.4502 3.56444C12.6246 3.35841 12.7361 3.10674 12.7714 2.83933C12.8067 2.57193 12.7644 2.30002 12.6495 2.05591C12.5346 1.8118 12.3519 1.60575 12.1231 1.46224C11.8943 1.31873 11.6291 1.2438 11.3589 1.24633C11.1813 1.23508 11.0033 1.25975 10.8355 1.31887C10.6677 1.37798 10.5136 1.47033 10.3824 1.59036L1.43018 10.4696Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$j, "render$j"); -script$k.render = render$j; -var theme3 = /* @__PURE__ */ __name(function theme4(_ref) { - var dt = _ref.dt; - return "\n.p-radiobutton {\n position: relative;\n display: inline-flex;\n user-select: none;\n vertical-align: bottom;\n width: ".concat(dt("radiobutton.width"), ";\n height: ").concat(dt("radiobutton.height"), ";\n}\n\n.p-radiobutton-input {\n cursor: pointer;\n appearance: none;\n position: absolute;\n top: 0;\n inset-inline-start: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n opacity: 0;\n z-index: 1;\n outline: 0 none;\n border: 1px solid transparent;\n border-radius: 50%;\n}\n\n.p-radiobutton-box {\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n border: 1px solid ").concat(dt("radiobutton.border.color"), ";\n background: ").concat(dt("radiobutton.background"), ";\n width: ").concat(dt("radiobutton.width"), ";\n height: ").concat(dt("radiobutton.height"), ";\n transition: background ").concat(dt("radiobutton.transition.duration"), ", color ").concat(dt("radiobutton.transition.duration"), ", border-color ").concat(dt("radiobutton.transition.duration"), ", box-shadow ").concat(dt("radiobutton.transition.duration"), ", outline-color ").concat(dt("radiobutton.transition.duration"), ";\n outline-color: transparent;\n box-shadow: ").concat(dt("radiobutton.shadow"), ";\n}\n\n.p-radiobutton-icon {\n transition-duration: ").concat(dt("radiobutton.transition.duration"), ";\n background: transparent;\n font-size: ").concat(dt("radiobutton.icon.size"), ";\n width: ").concat(dt("radiobutton.icon.size"), ";\n height: ").concat(dt("radiobutton.icon.size"), ";\n border-radius: 50%;\n backface-visibility: hidden;\n transform: translateZ(0) scale(0.1);\n}\n\n.p-radiobutton:not(.p-disabled):has(.p-radiobutton-input:hover) .p-radiobutton-box {\n border-color: ").concat(dt("radiobutton.hover.border.color"), ";\n}\n\n.p-radiobutton-checked .p-radiobutton-box {\n border-color: ").concat(dt("radiobutton.checked.border.color"), ";\n background: ").concat(dt("radiobutton.checked.background"), ";\n}\n\n.p-radiobutton-checked .p-radiobutton-box .p-radiobutton-icon {\n background: ").concat(dt("radiobutton.icon.checked.color"), ";\n transform: translateZ(0) scale(1, 1);\n visibility: visible;\n}\n\n.p-radiobutton-checked:not(.p-disabled):has(.p-radiobutton-input:hover) .p-radiobutton-box {\n border-color: ").concat(dt("radiobutton.checked.hover.border.color"), ";\n background: ").concat(dt("radiobutton.checked.hover.background"), ";\n}\n\n.p-radiobutton:not(.p-disabled):has(.p-radiobutton-input:hover).p-radiobutton-checked .p-radiobutton-box .p-radiobutton-icon {\n background: ").concat(dt("radiobutton.icon.checked.hover.color"), ";\n}\n\n.p-radiobutton:not(.p-disabled):has(.p-radiobutton-input:focus-visible) .p-radiobutton-box {\n border-color: ").concat(dt("radiobutton.focus.border.color"), ";\n box-shadow: ").concat(dt("radiobutton.focus.ring.shadow"), ";\n outline: ").concat(dt("radiobutton.focus.ring.width"), " ").concat(dt("radiobutton.focus.ring.style"), " ").concat(dt("radiobutton.focus.ring.color"), ";\n outline-offset: ").concat(dt("radiobutton.focus.ring.offset"), ";\n}\n\n.p-radiobutton-checked:not(.p-disabled):has(.p-radiobutton-input:focus-visible) .p-radiobutton-box {\n border-color: ").concat(dt("radiobutton.checked.focus.border.color"), ";\n}\n\n.p-radiobutton.p-invalid > .p-radiobutton-box {\n border-color: ").concat(dt("radiobutton.invalid.border.color"), ";\n}\n\n.p-radiobutton.p-variant-filled .p-radiobutton-box {\n background: ").concat(dt("radiobutton.filled.background"), ";\n}\n\n.p-radiobutton.p-variant-filled.p-radiobutton-checked .p-radiobutton-box {\n background: ").concat(dt("radiobutton.checked.background"), ";\n}\n\n.p-radiobutton.p-variant-filled:not(.p-disabled):has(.p-radiobutton-input:hover).p-radiobutton-checked .p-radiobutton-box {\n background: ").concat(dt("radiobutton.checked.hover.background"), ";\n}\n\n.p-radiobutton.p-disabled {\n opacity: 1;\n}\n\n.p-radiobutton.p-disabled .p-radiobutton-box {\n background: ").concat(dt("radiobutton.disabled.background"), ";\n border-color: ").concat(dt("radiobutton.checked.disabled.border.color"), ";\n}\n\n.p-radiobutton-checked.p-disabled .p-radiobutton-box .p-radiobutton-icon {\n background: ").concat(dt("radiobutton.icon.disabled.color"), ";\n}\n\n.p-radiobutton-sm,\n.p-radiobutton-sm .p-radiobutton-box {\n width: ").concat(dt("radiobutton.sm.width"), ";\n height: ").concat(dt("radiobutton.sm.height"), ";\n}\n\n.p-radiobutton-sm .p-radiobutton-icon {\n font-size: ").concat(dt("radiobutton.icon.sm.size"), ";\n width: ").concat(dt("radiobutton.icon.sm.size"), ";\n height: ").concat(dt("radiobutton.icon.sm.size"), ";\n}\n\n.p-radiobutton-lg,\n.p-radiobutton-lg .p-radiobutton-box {\n width: ").concat(dt("radiobutton.lg.width"), ";\n height: ").concat(dt("radiobutton.lg.height"), ";\n}\n\n.p-radiobutton-lg .p-radiobutton-icon {\n font-size: ").concat(dt("radiobutton.icon.lg.size"), ";\n width: ").concat(dt("radiobutton.icon.lg.size"), ";\n height: ").concat(dt("radiobutton.icon.lg.size"), ";\n}\n"); -}, "theme"); -var classes = { - root: /* @__PURE__ */ __name(function root2(_ref2) { - var instance = _ref2.instance, props = _ref2.props; - return ["p-radiobutton p-component", { - "p-radiobutton-checked": instance.checked, - "p-disabled": props.disabled, - "p-invalid": instance.$pcRadioButtonGroup ? instance.$pcRadioButtonGroup.$invalid : instance.$invalid, - "p-variant-filled": instance.$variant === "filled", - "p-radiobutton-sm p-inputfield-sm": props.size === "small", - "p-radiobutton-lg p-inputfield-lg": props.size === "large" - }]; - }, "root"), - box: "p-radiobutton-box", - input: "p-radiobutton-input", - icon: "p-radiobutton-icon" -}; -var RadioButtonStyle = BaseStyle.extend({ - name: "radiobutton", - theme: theme3, - classes -}); -var script$1$1 = { - name: "BaseRadioButton", - "extends": script$x, - props: { - value: null, - binary: Boolean, - readonly: { - type: Boolean, - "default": false - }, - tabindex: { - type: Number, - "default": null - }, - inputId: { - type: String, - "default": null - }, - inputClass: { - type: [String, Object], - "default": null - }, - inputStyle: { - type: Object, - "default": null - }, - ariaLabelledby: { - type: String, - "default": null - }, - ariaLabel: { - type: String, - "default": null - } - }, - style: RadioButtonStyle, - provide: /* @__PURE__ */ __name(function provide3() { - return { - $pcRadioButton: this, - $parentInstance: this - }; - }, "provide") -}; -var script$j = { - name: "RadioButton", - "extends": script$1$1, - inheritAttrs: false, - emits: ["change", "focus", "blur"], - inject: { - $pcRadioButtonGroup: { - "default": void 0 - } - }, - methods: { - getPTOptions: /* @__PURE__ */ __name(function getPTOptions6(key) { - var _ptm = key === "root" ? this.ptmi : this.ptm; - return _ptm(key, { - context: { - checked: this.checked, - disabled: this.disabled - } - }); - }, "getPTOptions"), - onChange: /* @__PURE__ */ __name(function onChange4(event2) { - if (!this.disabled && !this.readonly) { - var newModelValue = this.binary ? !this.checked : this.value; - this.$pcRadioButtonGroup ? this.$pcRadioButtonGroup.writeValue(newModelValue, event2) : this.writeValue(newModelValue, event2); - this.$emit("change", event2); - } - }, "onChange"), - onFocus: /* @__PURE__ */ __name(function onFocus(event2) { - this.$emit("focus", event2); - }, "onFocus"), - onBlur: /* @__PURE__ */ __name(function onBlur(event2) { - var _this$formField$onBlu, _this$formField; - this.$emit("blur", event2); - (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField, event2); - }, "onBlur") - }, - computed: { - groupName: /* @__PURE__ */ __name(function groupName() { - return this.$pcRadioButtonGroup ? this.$pcRadioButtonGroup.groupName : this.$formName; - }, "groupName"), - checked: /* @__PURE__ */ __name(function checked() { - var value = this.$pcRadioButtonGroup ? this.$pcRadioButtonGroup.d_value : this.d_value; - return value != null && (this.binary ? !!value : equals(value, this.value)); - }, "checked") - } -}; -var _hoisted_1$5 = ["data-p-checked", "data-p-disabled"]; -var _hoisted_2$3 = ["id", "value", "name", "checked", "tabindex", "disabled", "readonly", "aria-labelledby", "aria-label", "aria-invalid"]; -function render$i(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("div", mergeProps({ - "class": _ctx.cx("root") - }, $options.getPTOptions("root"), { - "data-p-checked": $options.checked, - "data-p-disabled": _ctx.disabled - }), [createBaseVNode("input", mergeProps({ - id: _ctx.inputId, - type: "radio", - "class": [_ctx.cx("input"), _ctx.inputClass], - style: _ctx.inputStyle, - value: _ctx.value, - name: $options.groupName, - checked: $options.checked, - tabindex: _ctx.tabindex, - disabled: _ctx.disabled, - readonly: _ctx.readonly, - "aria-labelledby": _ctx.ariaLabelledby, - "aria-label": _ctx.ariaLabel, - "aria-invalid": _ctx.invalid || void 0, - onFocus: _cache[0] || (_cache[0] = function() { - return $options.onFocus && $options.onFocus.apply($options, arguments); - }), - onBlur: _cache[1] || (_cache[1] = function() { - return $options.onBlur && $options.onBlur.apply($options, arguments); - }), - onChange: _cache[2] || (_cache[2] = function() { - return $options.onChange && $options.onChange.apply($options, arguments); - }) - }, $options.getPTOptions("input")), null, 16, _hoisted_2$3), createBaseVNode("div", mergeProps({ - "class": _ctx.cx("box") - }, $options.getPTOptions("box")), [createBaseVNode("div", mergeProps({ - "class": _ctx.cx("icon") - }, $options.getPTOptions("icon")), null, 16)], 16)], 16, _hoisted_1$5); -} -__name(render$i, "render$i"); -script$j.render = render$i; -var script$i = { - name: "FilterIcon", - "extends": script$t -}; -function render$h(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - d: "M8.64708 14H5.35296C5.18981 13.9979 5.03395 13.9321 4.91858 13.8167C4.8032 13.7014 4.73745 13.5455 4.73531 13.3824V7L0.329431 0.98C0.259794 0.889466 0.217389 0.780968 0.20718 0.667208C0.19697 0.553448 0.219379 0.439133 0.271783 0.337647C0.324282 0.236453 0.403423 0.151519 0.500663 0.0920138C0.597903 0.0325088 0.709548 0.000692754 0.823548 0H13.1765C13.2905 0.000692754 13.4021 0.0325088 13.4994 0.0920138C13.5966 0.151519 13.6758 0.236453 13.7283 0.337647C13.7807 0.439133 13.8031 0.553448 13.7929 0.667208C13.7826 0.780968 13.7402 0.889466 13.6706 0.98L9.26472 7V13.3824C9.26259 13.5455 9.19683 13.7014 9.08146 13.8167C8.96609 13.9321 8.81022 13.9979 8.64708 14ZM5.97061 12.7647H8.02943V6.79412C8.02878 6.66289 8.07229 6.53527 8.15296 6.43177L11.9412 1.23529H2.05884L5.86355 6.43177C5.94422 6.53527 5.98773 6.66289 5.98708 6.79412L5.97061 12.7647Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$h, "render$h"); -script$i.render = render$h; -var script$h = { - name: "FilterSlashIcon", - "extends": script$t -}; -function render$g(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - "fill-rule": "evenodd", - "clip-rule": "evenodd", - d: "M13.4994 0.0920138C13.5967 0.151519 13.6758 0.236453 13.7283 0.337647C13.7807 0.439133 13.8031 0.553448 13.7929 0.667208C13.7827 0.780968 13.7403 0.889466 13.6707 0.98L11.406 4.06823C11.3099 4.19928 11.1656 4.28679 11.005 4.3115C10.8444 4.33621 10.6805 4.2961 10.5495 4.2C10.4184 4.1039 10.3309 3.95967 10.3062 3.79905C10.2815 3.63843 10.3216 3.47458 10.4177 3.34353L11.9412 1.23529H7.41184C7.24803 1.23529 7.09093 1.17022 6.97509 1.05439C6.85926 0.938558 6.79419 0.781457 6.79419 0.617647C6.79419 0.453837 6.85926 0.296736 6.97509 0.180905C7.09093 0.0650733 7.24803 0 7.41184 0H13.1765C13.2905 0.000692754 13.4022 0.0325088 13.4994 0.0920138ZM4.20008 0.181168H4.24126L13.2013 9.03411C13.3169 9.14992 13.3819 9.3069 13.3819 9.47058C13.3819 9.63426 13.3169 9.79124 13.2013 9.90705C13.1445 9.96517 13.0766 10.0112 13.0016 10.0423C12.9266 10.0735 12.846 10.0891 12.7648 10.0882C12.6836 10.0886 12.6032 10.0728 12.5283 10.0417C12.4533 10.0106 12.3853 9.96479 12.3283 9.90705L9.3142 6.92587L9.26479 6.99999V13.3823C9.26265 13.5455 9.19689 13.7014 9.08152 13.8167C8.96615 13.9321 8.81029 13.9979 8.64714 14H5.35302C5.18987 13.9979 5.03401 13.9321 4.91864 13.8167C4.80327 13.7014 4.73751 13.5455 4.73537 13.3823V6.99999L0.329492 1.02117C0.259855 0.930634 0.21745 0.822137 0.207241 0.708376C0.197031 0.594616 0.21944 0.480301 0.271844 0.378815C0.324343 0.277621 0.403484 0.192687 0.500724 0.133182C0.597964 0.073677 0.709609 0.041861 0.823609 0.0411682H3.86243C3.92448 0.0461551 3.9855 0.060022 4.04361 0.0823446C4.10037 0.10735 4.15311 0.140655 4.20008 0.181168ZM8.02949 6.79411C8.02884 6.66289 8.07235 6.53526 8.15302 6.43176L8.42478 6.05293L3.55773 1.23529H2.0589L5.84714 6.43176C5.92781 6.53526 5.97132 6.66289 5.97067 6.79411V12.7647H8.02949V6.79411Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$g, "render$g"); -script$h.render = render$g; -var script$g = { - name: "TrashIcon", - "extends": script$t -}; -function render$f(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - "fill-rule": "evenodd", - "clip-rule": "evenodd", - d: "M3.44802 13.9955H10.552C10.8056 14.0129 11.06 13.9797 11.3006 13.898C11.5412 13.8163 11.7632 13.6877 11.9537 13.5196C12.1442 13.3515 12.2995 13.1473 12.4104 12.9188C12.5213 12.6903 12.5858 12.442 12.6 12.1884V4.36041H13.4C13.5591 4.36041 13.7117 4.29722 13.8243 4.18476C13.9368 4.07229 14 3.91976 14 3.76071C14 3.60166 13.9368 3.44912 13.8243 3.33666C13.7117 3.22419 13.5591 3.16101 13.4 3.16101H12.0537C12.0203 3.1557 11.9863 3.15299 11.952 3.15299C11.9178 3.15299 11.8838 3.1557 11.8503 3.16101H11.2285C11.2421 3.10893 11.2487 3.05513 11.248 3.00106V1.80966C11.2171 1.30262 10.9871 0.828306 10.608 0.48989C10.229 0.151475 9.73159 -0.0236625 9.22402 0.00257442H4.77602C4.27251 -0.0171866 3.78126 0.160868 3.40746 0.498617C3.03365 0.836366 2.807 1.30697 2.77602 1.80966V3.00106C2.77602 3.0556 2.78346 3.10936 2.79776 3.16101H0.6C0.521207 3.16101 0.443185 3.17652 0.37039 3.20666C0.297595 3.2368 0.231451 3.28097 0.175736 3.33666C0.120021 3.39235 0.0758251 3.45846 0.0456722 3.53121C0.0155194 3.60397 0 3.68196 0 3.76071C0 3.83946 0.0155194 3.91744 0.0456722 3.9902C0.0758251 4.06296 0.120021 4.12907 0.175736 4.18476C0.231451 4.24045 0.297595 4.28462 0.37039 4.31476C0.443185 4.3449 0.521207 4.36041 0.6 4.36041H1.40002V12.1884C1.41426 12.442 1.47871 12.6903 1.58965 12.9188C1.7006 13.1473 1.85582 13.3515 2.04633 13.5196C2.23683 13.6877 2.45882 13.8163 2.69944 13.898C2.94005 13.9797 3.1945 14.0129 3.44802 13.9955ZM2.60002 4.36041H11.304V12.1884C11.304 12.5163 10.952 12.7961 10.504 12.7961H3.40002C2.97602 12.7961 2.60002 12.5163 2.60002 12.1884V4.36041ZM3.95429 3.16101C3.96859 3.10936 3.97602 3.0556 3.97602 3.00106V1.80966C3.97602 1.48183 4.33602 1.20197 4.77602 1.20197H9.24802C9.66403 1.20197 10.048 1.48183 10.048 1.80966V3.00106C10.0473 3.05515 10.054 3.10896 10.0678 3.16101H3.95429ZM5.57571 10.997C5.41731 10.995 5.26597 10.9311 5.15395 10.8191C5.04193 10.7071 4.97808 10.5558 4.97601 10.3973V6.77517C4.97601 6.61612 5.0392 6.46359 5.15166 6.35112C5.26413 6.23866 5.41666 6.17548 5.57571 6.17548C5.73476 6.17548 5.8873 6.23866 5.99976 6.35112C6.11223 6.46359 6.17541 6.61612 6.17541 6.77517V10.3894C6.17647 10.4688 6.16174 10.5476 6.13208 10.6213C6.10241 10.695 6.05841 10.762 6.00261 10.8186C5.94682 10.8751 5.88035 10.92 5.80707 10.9506C5.73378 10.9813 5.65514 10.9971 5.57571 10.997ZM7.99968 10.8214C8.11215 10.9339 8.26468 10.997 8.42373 10.997C8.58351 10.9949 8.73604 10.93 8.84828 10.8163C8.96052 10.7025 9.02345 10.5491 9.02343 10.3894V6.77517C9.02343 6.61612 8.96025 6.46359 8.84778 6.35112C8.73532 6.23866 8.58278 6.17548 8.42373 6.17548C8.26468 6.17548 8.11215 6.23866 7.99968 6.35112C7.88722 6.46359 7.82404 6.61612 7.82404 6.77517V10.3973C7.82404 10.5564 7.88722 10.7089 7.99968 10.8214Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$f, "render$f"); -script$g.render = render$f; -var script$f = { - name: "SortAltIcon", - "extends": script$t -}; -function render$e(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - d: "M5.64515 3.61291C5.47353 3.61291 5.30192 3.54968 5.16644 3.4142L3.38708 1.63484L1.60773 3.4142C1.34579 3.67613 0.912244 3.67613 0.650309 3.4142C0.388374 3.15226 0.388374 2.71871 0.650309 2.45678L2.90837 0.198712C3.17031 -0.0632236 3.60386 -0.0632236 3.86579 0.198712L6.12386 2.45678C6.38579 2.71871 6.38579 3.15226 6.12386 3.4142C5.98837 3.54968 5.81676 3.61291 5.64515 3.61291Z", - fill: "currentColor" - }, null, -1), createBaseVNode("path", { - d: "M3.38714 14C3.01681 14 2.70972 13.6929 2.70972 13.3226V0.677419C2.70972 0.307097 3.01681 0 3.38714 0C3.75746 0 4.06456 0.307097 4.06456 0.677419V13.3226C4.06456 13.6929 3.75746 14 3.38714 14Z", - fill: "currentColor" - }, null, -1), createBaseVNode("path", { - d: "M10.6129 14C10.4413 14 10.2697 13.9368 10.1342 13.8013L7.87611 11.5432C7.61418 11.2813 7.61418 10.8477 7.87611 10.5858C8.13805 10.3239 8.5716 10.3239 8.83353 10.5858L10.6129 12.3652L12.3922 10.5858C12.6542 10.3239 13.0877 10.3239 13.3497 10.5858C13.6116 10.8477 13.6116 11.2813 13.3497 11.5432L11.0916 13.8013C10.9561 13.9368 10.7845 14 10.6129 14Z", - fill: "currentColor" - }, null, -1), createBaseVNode("path", { - d: "M10.6129 14C10.2426 14 9.93552 13.6929 9.93552 13.3226V0.677419C9.93552 0.307097 10.2426 0 10.6129 0C10.9833 0 11.2904 0.307097 11.2904 0.677419V13.3226C11.2904 13.6929 10.9832 14 10.6129 14Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$e, "render$e"); -script$f.render = render$e; -var script$e = { - name: "SortAmountDownIcon", - "extends": script$t -}; -function render$d(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - d: "M4.93953 10.5858L3.83759 11.6877V0.677419C3.83759 0.307097 3.53049 0 3.16017 0C2.78985 0 2.48275 0.307097 2.48275 0.677419V11.6877L1.38082 10.5858C1.11888 10.3239 0.685331 10.3239 0.423396 10.5858C0.16146 10.8477 0.16146 11.2813 0.423396 11.5432L2.68146 13.8013C2.74469 13.8645 2.81694 13.9097 2.89823 13.9458C2.97952 13.9819 3.06985 14 3.16017 14C3.25049 14 3.33178 13.9819 3.42211 13.9458C3.5034 13.9097 3.57565 13.8645 3.63888 13.8013L5.89694 11.5432C6.15888 11.2813 6.15888 10.8477 5.89694 10.5858C5.63501 10.3239 5.20146 10.3239 4.93953 10.5858ZM13.0957 0H7.22468C6.85436 0 6.54726 0.307097 6.54726 0.677419C6.54726 1.04774 6.85436 1.35484 7.22468 1.35484H13.0957C13.466 1.35484 13.7731 1.04774 13.7731 0.677419C13.7731 0.307097 13.466 0 13.0957 0ZM7.22468 5.41935H9.48275C9.85307 5.41935 10.1602 5.72645 10.1602 6.09677C10.1602 6.4671 9.85307 6.77419 9.48275 6.77419H7.22468C6.85436 6.77419 6.54726 6.4671 6.54726 6.09677C6.54726 5.72645 6.85436 5.41935 7.22468 5.41935ZM7.6763 8.12903H7.22468C6.85436 8.12903 6.54726 8.43613 6.54726 8.80645C6.54726 9.17677 6.85436 9.48387 7.22468 9.48387H7.6763C8.04662 9.48387 8.35372 9.17677 8.35372 8.80645C8.35372 8.43613 8.04662 8.12903 7.6763 8.12903ZM7.22468 2.70968H11.2892C11.6595 2.70968 11.9666 3.01677 11.9666 3.3871C11.9666 3.75742 11.6595 4.06452 11.2892 4.06452H7.22468C6.85436 4.06452 6.54726 3.75742 6.54726 3.3871C6.54726 3.01677 6.85436 2.70968 7.22468 2.70968Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$d, "render$d"); -script$e.render = render$d; -var script$d = { - name: "SortAmountUpAltIcon", - "extends": script$t -}; -function render$c(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - d: "M3.63435 0.19871C3.57113 0.135484 3.49887 0.0903226 3.41758 0.0541935C3.255 -0.0180645 3.06532 -0.0180645 2.90274 0.0541935C2.82145 0.0903226 2.74919 0.135484 2.68597 0.19871L0.427901 2.45677C0.165965 2.71871 0.165965 3.15226 0.427901 3.41419C0.689836 3.67613 1.12338 3.67613 1.38532 3.41419L2.48726 2.31226V13.3226C2.48726 13.6929 2.79435 14 3.16467 14C3.535 14 3.84209 13.6929 3.84209 13.3226V2.31226L4.94403 3.41419C5.07951 3.54968 5.25113 3.6129 5.42274 3.6129C5.59435 3.6129 5.76597 3.54968 5.90145 3.41419C6.16338 3.15226 6.16338 2.71871 5.90145 2.45677L3.64338 0.19871H3.63435ZM13.7685 13.3226C13.7685 12.9523 13.4615 12.6452 13.0911 12.6452H7.22016C6.84984 12.6452 6.54274 12.9523 6.54274 13.3226C6.54274 13.6929 6.84984 14 7.22016 14H13.0911C13.4615 14 13.7685 13.6929 13.7685 13.3226ZM7.22016 8.58064C6.84984 8.58064 6.54274 8.27355 6.54274 7.90323C6.54274 7.5329 6.84984 7.22581 7.22016 7.22581H9.47823C9.84855 7.22581 10.1556 7.5329 10.1556 7.90323C10.1556 8.27355 9.84855 8.58064 9.47823 8.58064H7.22016ZM7.22016 5.87097H7.67177C8.0421 5.87097 8.34919 5.56387 8.34919 5.19355C8.34919 4.82323 8.0421 4.51613 7.67177 4.51613H7.22016C6.84984 4.51613 6.54274 4.82323 6.54274 5.19355C6.54274 5.56387 6.84984 5.87097 7.22016 5.87097ZM11.2847 11.2903H7.22016C6.84984 11.2903 6.54274 10.9832 6.54274 10.6129C6.54274 10.2426 6.84984 9.93548 7.22016 9.93548H11.2847C11.655 9.93548 11.9621 10.2426 11.9621 10.6129C11.9621 10.9832 11.655 11.2903 11.2847 11.2903Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render$c, "render$c"); -script$d.render = render$c; -var script$c = { - name: "BaseDataTable", - "extends": script$s, - props: { - value: { - type: Array, - "default": null - }, - dataKey: { - type: [String, Function], - "default": null - }, - rows: { - type: Number, - "default": 0 - }, - first: { - type: Number, - "default": 0 - }, - totalRecords: { - type: Number, - "default": 0 - }, - paginator: { - type: Boolean, - "default": false - }, - paginatorPosition: { - type: String, - "default": "bottom" - }, - alwaysShowPaginator: { - type: Boolean, - "default": true - }, - paginatorTemplate: { - type: [Object, String], - "default": "FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown" - }, - pageLinkSize: { - type: Number, - "default": 5 - }, - rowsPerPageOptions: { - type: Array, - "default": null - }, - currentPageReportTemplate: { - type: String, - "default": "({currentPage} of {totalPages})" - }, - lazy: { - type: Boolean, - "default": false - }, - loading: { - type: Boolean, - "default": false - }, - loadingIcon: { - type: String, - "default": void 0 - }, - sortField: { - type: [String, Function], - "default": null - }, - sortOrder: { - type: Number, - "default": null - }, - defaultSortOrder: { - type: Number, - "default": 1 - }, - nullSortOrder: { - type: Number, - "default": 1 - }, - multiSortMeta: { - type: Array, - "default": null - }, - sortMode: { - type: String, - "default": "single" - }, - removableSort: { - type: Boolean, - "default": false - }, - filters: { - type: Object, - "default": null - }, - filterDisplay: { - type: String, - "default": null - }, - globalFilterFields: { - type: Array, - "default": null - }, - filterLocale: { - type: String, - "default": void 0 - }, - selection: { - type: [Array, Object], - "default": null - }, - selectionMode: { - type: String, - "default": null - }, - compareSelectionBy: { - type: String, - "default": "deepEquals" - }, - metaKeySelection: { - type: Boolean, - "default": false - }, - contextMenu: { - type: Boolean, - "default": false - }, - contextMenuSelection: { - type: Object, - "default": null - }, - selectAll: { - type: Boolean, - "default": null - }, - rowHover: { - type: Boolean, - "default": false - }, - csvSeparator: { - type: String, - "default": "," - }, - exportFilename: { - type: String, - "default": "download" - }, - exportFunction: { - type: Function, - "default": null - }, - resizableColumns: { - type: Boolean, - "default": false - }, - columnResizeMode: { - type: String, - "default": "fit" - }, - reorderableColumns: { - type: Boolean, - "default": false - }, - expandedRows: { - type: [Array, Object], - "default": null - }, - expandedRowIcon: { - type: String, - "default": void 0 - }, - collapsedRowIcon: { - type: String, - "default": void 0 - }, - rowGroupMode: { - type: String, - "default": null - }, - groupRowsBy: { - type: [Array, String, Function], - "default": null - }, - expandableRowGroups: { - type: Boolean, - "default": false - }, - expandedRowGroups: { - type: Array, - "default": null - }, - stateStorage: { - type: String, - "default": "session" - }, - stateKey: { - type: String, - "default": null - }, - editMode: { - type: String, - "default": null - }, - editingRows: { - type: Array, - "default": null - }, - rowClass: { - type: Function, - "default": null - }, - rowStyle: { - type: Function, - "default": null - }, - scrollable: { - type: Boolean, - "default": false - }, - virtualScrollerOptions: { - type: Object, - "default": null - }, - scrollHeight: { - type: String, - "default": null - }, - frozenValue: { - type: Array, - "default": null - }, - breakpoint: { - type: String, - "default": "960px" - }, - showHeaders: { - type: Boolean, - "default": true - }, - showGridlines: { - type: Boolean, - "default": false - }, - stripedRows: { - type: Boolean, - "default": false - }, - highlightOnSelect: { - type: Boolean, - "default": false - }, - size: { - type: String, - "default": null - }, - tableStyle: { - type: null, - "default": null - }, - tableClass: { - type: [String, Object], - "default": null - }, - tableProps: { - type: Object, - "default": null - }, - filterInputProps: { - type: null, - "default": null - }, - filterButtonProps: { - type: Object, - "default": /* @__PURE__ */ __name(function _default2() { - return { - filter: { - severity: "secondary", - text: true, - rounded: true - }, - inline: { - clear: { - severity: "secondary", - text: true, - rounded: true - } - }, - popover: { - addRule: { - severity: "info", - text: true, - size: "small" - }, - removeRule: { - severity: "danger", - text: true, - size: "small" - }, - apply: { - size: "small" - }, - clear: { - outlined: true, - size: "small" - } - } - }; - }, "_default") - }, - editButtonProps: { - type: Object, - "default": /* @__PURE__ */ __name(function _default3() { - return { - init: { - severity: "secondary", - text: true, - rounded: true - }, - save: { - severity: "secondary", - text: true, - rounded: true - }, - cancel: { - severity: "secondary", - text: true, - rounded: true - } - }; - }, "_default") - } - }, - style: DataTableStyle, - provide: /* @__PURE__ */ __name(function provide4() { - return { - $pcDataTable: this, - $parentInstance: this - }; - }, "provide") -}; -var script$b = { - name: "RowCheckbox", - hostName: "DataTable", - "extends": script$s, - emits: ["change"], - props: { - value: null, - checked: null, - column: null, - rowCheckboxIconTemplate: { - type: Function, - "default": null - }, - index: { - type: Number, - "default": null - } - }, - methods: { - getColumnPT: /* @__PURE__ */ __name(function getColumnPT(key) { - var columnMetaData = { - props: this.column.props, - parent: { - instance: this, - props: this.$props, - state: this.$data - }, - context: { - index: this.index, - checked: this.checked, - disabled: this.$attrs.disabled - } - }; - return mergeProps(this.ptm("column.".concat(key), { - column: columnMetaData - }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); - }, "getColumnPT"), - getColumnProp: /* @__PURE__ */ __name(function getColumnProp() { - return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; - }, "getColumnProp"), - onChange: /* @__PURE__ */ __name(function onChange5(event2) { - if (!this.$attrs.disabled) { - this.$emit("change", { - originalEvent: event2, - data: this.value - }); - } - }, "onChange") - }, - computed: { - checkboxAriaLabel: /* @__PURE__ */ __name(function checkboxAriaLabel() { - return this.$primevue.config.locale.aria ? this.checked ? this.$primevue.config.locale.aria.selectRow : this.$primevue.config.locale.aria.unselectRow : void 0; - }, "checkboxAriaLabel") - }, - components: { - CheckIcon: script$y, - Checkbox: script$z - } -}; -function render$b(_ctx, _cache, $props, $setup, $data, $options) { - var _component_CheckIcon = resolveComponent("CheckIcon"); - var _component_Checkbox = resolveComponent("Checkbox"); - return openBlock(), createBlock(_component_Checkbox, { - modelValue: $props.checked, - binary: true, - disabled: _ctx.$attrs.disabled, - "aria-label": $options.checkboxAriaLabel, - onChange: $options.onChange, - unstyled: _ctx.unstyled, - pt: $options.getColumnPT("pcRowCheckbox") - }, { - icon: withCtx(function(slotProps) { - return [$props.rowCheckboxIconTemplate ? (openBlock(), createBlock(resolveDynamicComponent($props.rowCheckboxIconTemplate), { - key: 0, - checked: slotProps.checked, - "class": normalizeClass(slotProps["class"]) - }, null, 8, ["checked", "class"])) : !$props.rowCheckboxIconTemplate && slotProps.checked ? (openBlock(), createBlock(_component_CheckIcon, mergeProps({ - key: 1, - "class": slotProps["class"] - }, $options.getColumnPT("pcRowCheckbox")["icon"]), null, 16, ["class"])) : createCommentVNode("", true)]; - }), - _: 1 - }, 8, ["modelValue", "disabled", "aria-label", "onChange", "unstyled", "pt"]); -} -__name(render$b, "render$b"); -script$b.render = render$b; -var script$a = { - name: "RowRadioButton", - hostName: "DataTable", - "extends": script$s, - emits: ["change"], - props: { - value: null, - checked: null, - name: null, - column: null, - index: { - type: Number, - "default": null - } - }, - methods: { - getColumnPT: /* @__PURE__ */ __name(function getColumnPT2(key) { - var columnMetaData = { - props: this.column.props, - parent: { - instance: this, - props: this.$props, - state: this.$data - }, - context: { - index: this.index, - checked: this.checked, - disabled: this.$attrs.disabled - } - }; - return mergeProps(this.ptm("column.".concat(key), { - column: columnMetaData - }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); - }, "getColumnPT"), - getColumnProp: /* @__PURE__ */ __name(function getColumnProp2() { - return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; - }, "getColumnProp"), - onChange: /* @__PURE__ */ __name(function onChange6(event2) { - if (!this.$attrs.disabled) { - this.$emit("change", { - originalEvent: event2, - data: this.value - }); - } - }, "onChange") - }, - components: { - RadioButton: script$j - } -}; -function render$a(_ctx, _cache, $props, $setup, $data, $options) { - var _component_RadioButton = resolveComponent("RadioButton"); - return openBlock(), createBlock(_component_RadioButton, { - modelValue: $props.checked, - binary: true, - disabled: _ctx.$attrs.disabled, - name: $props.name, - onChange: $options.onChange, - unstyled: _ctx.unstyled, - pt: $options.getColumnPT("pcRowRadiobutton") - }, null, 8, ["modelValue", "disabled", "name", "onChange", "unstyled", "pt"]); -} -__name(render$a, "render$a"); -script$a.render = render$a; -var script$9 = { - name: "BodyCell", - hostName: "DataTable", - "extends": script$s, - emits: ["cell-edit-init", "cell-edit-complete", "cell-edit-cancel", "row-edit-init", "row-edit-save", "row-edit-cancel", "row-toggle", "radio-change", "checkbox-change", "editing-meta-change"], - props: { - rowData: { - type: Object, - "default": null - }, - column: { - type: Object, - "default": null - }, - frozenRow: { - type: Boolean, - "default": false - }, - rowIndex: { - type: Number, - "default": null - }, - index: { - type: Number, - "default": null - }, - isRowExpanded: { - type: Boolean, - "default": false - }, - selected: { - type: Boolean, - "default": false - }, - editing: { - type: Boolean, - "default": false - }, - editingMeta: { - type: Object, - "default": null - }, - editMode: { - type: String, - "default": null - }, - virtualScrollerContentProps: { - type: Object, - "default": null - }, - ariaControls: { - type: String, - "default": null - }, - name: { - type: String, - "default": null - }, - expandedRowIcon: { - type: String, - "default": null - }, - collapsedRowIcon: { - type: String, - "default": null - }, - editButtonProps: { - type: Object, - "default": null - } - }, - documentEditListener: null, - selfClick: false, - overlayEventListener: null, - data: /* @__PURE__ */ __name(function data3() { - return { - d_editing: this.editing, - styleObject: {} - }; - }, "data"), - watch: { - editing: /* @__PURE__ */ __name(function editing(newValue) { - this.d_editing = newValue; - }, "editing"), - "$data.d_editing": /* @__PURE__ */ __name(function $dataD_editing(newValue) { - this.$emit("editing-meta-change", { - data: this.rowData, - field: this.field || "field_".concat(this.index), - index: this.rowIndex, - editing: newValue - }); - }, "$dataD_editing") - }, - mounted: /* @__PURE__ */ __name(function mounted3() { - if (this.columnProp("frozen")) { - this.updateStickyPosition(); - } - }, "mounted"), - updated: /* @__PURE__ */ __name(function updated() { - var _this = this; - if (this.columnProp("frozen")) { - this.updateStickyPosition(); - } - if (this.d_editing && (this.editMode === "cell" || this.editMode === "row" && this.columnProp("rowEditor"))) { - setTimeout(function() { - var focusableEl = getFirstFocusableElement(_this.$el); - focusableEl && focusableEl.focus(); - }, 1); - } - }, "updated"), - beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount() { - if (this.overlayEventListener) { - OverlayEventBus.off("overlay-click", this.overlayEventListener); - this.overlayEventListener = null; - } - }, "beforeUnmount"), - methods: { - columnProp: /* @__PURE__ */ __name(function columnProp(prop) { - return getVNodeProp(this.column, prop); - }, "columnProp"), - getColumnPT: /* @__PURE__ */ __name(function getColumnPT3(key) { - var _this$$parentInstance, _this$$parentInstance2; - var columnMetaData = { - props: this.column.props, - parent: { - instance: this, - props: this.$props, - state: this.$data - }, - context: { - index: this.index, - size: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.size, - showGridlines: (_this$$parentInstance2 = this.$parentInstance) === null || _this$$parentInstance2 === void 0 || (_this$$parentInstance2 = _this$$parentInstance2.$parentInstance) === null || _this$$parentInstance2 === void 0 ? void 0 : _this$$parentInstance2.showGridlines - } - }; - return mergeProps(this.ptm("column.".concat(key), { - column: columnMetaData - }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); - }, "getColumnPT"), - getColumnProp: /* @__PURE__ */ __name(function getColumnProp3() { - return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; - }, "getColumnProp"), - resolveFieldData: /* @__PURE__ */ __name(function resolveFieldData$1() { - return resolveFieldData(this.rowData, this.field); - }, "resolveFieldData$1"), - toggleRow: /* @__PURE__ */ __name(function toggleRow(event2) { - this.$emit("row-toggle", { - originalEvent: event2, - data: this.rowData - }); - }, "toggleRow"), - toggleRowWithRadio: /* @__PURE__ */ __name(function toggleRowWithRadio(event2, index) { - this.$emit("radio-change", { - originalEvent: event2.originalEvent, - index, - data: event2.data - }); - }, "toggleRowWithRadio"), - toggleRowWithCheckbox: /* @__PURE__ */ __name(function toggleRowWithCheckbox(event2, index) { - this.$emit("checkbox-change", { - originalEvent: event2.originalEvent, - index, - data: event2.data - }); - }, "toggleRowWithCheckbox"), - isEditable: /* @__PURE__ */ __name(function isEditable() { - return this.column.children && this.column.children.editor != null; - }, "isEditable"), - bindDocumentEditListener: /* @__PURE__ */ __name(function bindDocumentEditListener() { - var _this2 = this; - if (!this.documentEditListener) { - this.documentEditListener = function(event2) { - if (!_this2.selfClick) { - _this2.completeEdit(event2, "outside"); - } - _this2.selfClick = false; - }; - document.addEventListener("click", this.documentEditListener); - } - }, "bindDocumentEditListener"), - unbindDocumentEditListener: /* @__PURE__ */ __name(function unbindDocumentEditListener() { - if (this.documentEditListener) { - document.removeEventListener("click", this.documentEditListener); - this.documentEditListener = null; - this.selfClick = false; - } - }, "unbindDocumentEditListener"), - switchCellToViewMode: /* @__PURE__ */ __name(function switchCellToViewMode() { - this.d_editing = false; - this.unbindDocumentEditListener(); - OverlayEventBus.off("overlay-click", this.overlayEventListener); - this.overlayEventListener = null; - }, "switchCellToViewMode"), - onClick: /* @__PURE__ */ __name(function onClick(event2) { - var _this3 = this; - if (this.editMode === "cell" && this.isEditable()) { - this.selfClick = true; - if (!this.d_editing) { - this.d_editing = true; - this.bindDocumentEditListener(); - this.$emit("cell-edit-init", { - originalEvent: event2, - data: this.rowData, - field: this.field, - index: this.rowIndex - }); - this.overlayEventListener = function(e) { - if (_this3.$el && _this3.$el.contains(e.target)) { - _this3.selfClick = true; - } - }; - OverlayEventBus.on("overlay-click", this.overlayEventListener); - } - } - }, "onClick"), - completeEdit: /* @__PURE__ */ __name(function completeEdit(event2, type) { - var completeEvent = { - originalEvent: event2, - data: this.rowData, - newData: this.editingRowData, - value: this.rowData[this.field], - newValue: this.editingRowData[this.field], - field: this.field, - index: this.rowIndex, - type, - defaultPrevented: false, - preventDefault: /* @__PURE__ */ __name(function preventDefault() { - this.defaultPrevented = true; - }, "preventDefault") - }; - this.$emit("cell-edit-complete", completeEvent); - if (!completeEvent.defaultPrevented) { - this.switchCellToViewMode(); - } - }, "completeEdit"), - onKeyDown: /* @__PURE__ */ __name(function onKeyDown(event2) { - if (this.editMode === "cell") { - switch (event2.code) { - case "Enter": - case "NumpadEnter": - this.completeEdit(event2, "enter"); - break; - case "Escape": - this.switchCellToViewMode(); - this.$emit("cell-edit-cancel", { - originalEvent: event2, - data: this.rowData, - field: this.field, - index: this.rowIndex - }); - break; - case "Tab": - this.completeEdit(event2, "tab"); - if (event2.shiftKey) this.moveToPreviousCell(event2); - else this.moveToNextCell(event2); - break; - } - } - }, "onKeyDown"), - moveToPreviousCell: /* @__PURE__ */ __name(function moveToPreviousCell(event2) { - var currentCell = this.findCell(event2.target); - var targetCell = this.findPreviousEditableColumn(currentCell); - if (targetCell) { - invokeElementMethod(targetCell, "click"); - event2.preventDefault(); - } - }, "moveToPreviousCell"), - moveToNextCell: /* @__PURE__ */ __name(function moveToNextCell(event2) { - var currentCell = this.findCell(event2.target); - var targetCell = this.findNextEditableColumn(currentCell); - if (targetCell) { - invokeElementMethod(targetCell, "click"); - event2.preventDefault(); - } - }, "moveToNextCell"), - findCell: /* @__PURE__ */ __name(function findCell(element) { - if (element) { - var cell = element; - while (cell && !getAttribute(cell, "data-p-cell-editing")) { - cell = cell.parentElement; - } - return cell; - } else { - return null; - } - }, "findCell"), - findPreviousEditableColumn: /* @__PURE__ */ __name(function findPreviousEditableColumn(cell) { - var prevCell = cell.previousElementSibling; - if (!prevCell) { - var previousRow = cell.parentElement.previousElementSibling; - if (previousRow) { - prevCell = previousRow.lastElementChild; - } - } - if (prevCell) { - if (getAttribute(prevCell, "data-p-editable-column")) return prevCell; - else return this.findPreviousEditableColumn(prevCell); - } else { - return null; - } - }, "findPreviousEditableColumn"), - findNextEditableColumn: /* @__PURE__ */ __name(function findNextEditableColumn(cell) { - var nextCell = cell.nextElementSibling; - if (!nextCell) { - var nextRow = cell.parentElement.nextElementSibling; - if (nextRow) { - nextCell = nextRow.firstElementChild; - } - } - if (nextCell) { - if (getAttribute(nextCell, "data-p-editable-column")) return nextCell; - else return this.findNextEditableColumn(nextCell); - } else { - return null; - } - }, "findNextEditableColumn"), - onRowEditInit: /* @__PURE__ */ __name(function onRowEditInit(event2) { - this.$emit("row-edit-init", { - originalEvent: event2, - data: this.rowData, - newData: this.editingRowData, - field: this.field, - index: this.rowIndex - }); - }, "onRowEditInit"), - onRowEditSave: /* @__PURE__ */ __name(function onRowEditSave(event2) { - this.$emit("row-edit-save", { - originalEvent: event2, - data: this.rowData, - newData: this.editingRowData, - field: this.field, - index: this.rowIndex - }); - }, "onRowEditSave"), - onRowEditCancel: /* @__PURE__ */ __name(function onRowEditCancel(event2) { - this.$emit("row-edit-cancel", { - originalEvent: event2, - data: this.rowData, - newData: this.editingRowData, - field: this.field, - index: this.rowIndex - }); - }, "onRowEditCancel"), - editorInitCallback: /* @__PURE__ */ __name(function editorInitCallback(event2) { - this.$emit("row-edit-init", { - originalEvent: event2, - data: this.rowData, - newData: this.editingRowData, - field: this.field, - index: this.rowIndex - }); - }, "editorInitCallback"), - editorSaveCallback: /* @__PURE__ */ __name(function editorSaveCallback(event2) { - if (this.editMode === "row") { - this.$emit("row-edit-save", { - originalEvent: event2, - data: this.rowData, - newData: this.editingRowData, - field: this.field, - index: this.rowIndex - }); - } else { - this.completeEdit(event2, "enter"); - } - }, "editorSaveCallback"), - editorCancelCallback: /* @__PURE__ */ __name(function editorCancelCallback(event2) { - if (this.editMode === "row") { - this.$emit("row-edit-cancel", { - originalEvent: event2, - data: this.rowData, - newData: this.editingRowData, - field: this.field, - index: this.rowIndex - }); - } else { - this.switchCellToViewMode(); - this.$emit("cell-edit-cancel", { - originalEvent: event2, - data: this.rowData, - field: this.field, - index: this.rowIndex - }); - } - }, "editorCancelCallback"), - updateStickyPosition: /* @__PURE__ */ __name(function updateStickyPosition() { - if (this.columnProp("frozen")) { - var align = this.columnProp("alignFrozen"); - if (align === "right") { - var pos = 0; - var next2 = getNextElementSibling(this.$el, '[data-p-frozen-column="true"]'); - if (next2) { - pos = getOuterWidth(next2) + parseFloat(next2.style.right || 0); - } - this.styleObject.insetInlineEnd = pos + "px"; - } else { - var _pos = 0; - var prev2 = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]'); - if (prev2) { - _pos = getOuterWidth(prev2) + parseFloat(prev2.style.left || 0); - } - this.styleObject.insetInlineStart = _pos + "px"; - } - } - }, "updateStickyPosition"), - getVirtualScrollerProp: /* @__PURE__ */ __name(function getVirtualScrollerProp(option) { - return this.virtualScrollerContentProps ? this.virtualScrollerContentProps[option] : null; - }, "getVirtualScrollerProp") - }, - computed: { - editingRowData: /* @__PURE__ */ __name(function editingRowData() { - return this.editingMeta[this.rowIndex] ? this.editingMeta[this.rowIndex].data : this.rowData; - }, "editingRowData"), - field: /* @__PURE__ */ __name(function field() { - return this.columnProp("field"); - }, "field"), - containerClass: /* @__PURE__ */ __name(function containerClass() { - return [this.columnProp("bodyClass"), this.columnProp("class"), this.cx("bodyCell")]; - }, "containerClass"), - containerStyle: /* @__PURE__ */ __name(function containerStyle() { - var bodyStyle = this.columnProp("bodyStyle"); - var columnStyle = this.columnProp("style"); - return this.columnProp("frozen") ? [columnStyle, bodyStyle, this.styleObject] : [columnStyle, bodyStyle]; - }, "containerStyle"), - loading: /* @__PURE__ */ __name(function loading() { - return this.getVirtualScrollerProp("loading"); - }, "loading"), - loadingOptions: /* @__PURE__ */ __name(function loadingOptions() { - var getLoaderOptions = this.getVirtualScrollerProp("getLoaderOptions"); - return getLoaderOptions && getLoaderOptions(this.rowIndex, { - cellIndex: this.index, - cellFirst: this.index === 0, - cellLast: this.index === this.getVirtualScrollerProp("columns").length - 1, - cellEven: this.index % 2 === 0, - cellOdd: this.index % 2 !== 0, - column: this.column, - field: this.field - }); - }, "loadingOptions"), - expandButtonAriaLabel: /* @__PURE__ */ __name(function expandButtonAriaLabel() { - return this.$primevue.config.locale.aria ? this.isRowExpanded ? this.$primevue.config.locale.aria.expandRow : this.$primevue.config.locale.aria.collapseRow : void 0; - }, "expandButtonAriaLabel"), - initButtonAriaLabel: /* @__PURE__ */ __name(function initButtonAriaLabel() { - return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.editRow : void 0; - }, "initButtonAriaLabel"), - saveButtonAriaLabel: /* @__PURE__ */ __name(function saveButtonAriaLabel() { - return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.saveEdit : void 0; - }, "saveButtonAriaLabel"), - cancelButtonAriaLabel: /* @__PURE__ */ __name(function cancelButtonAriaLabel() { - return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.cancelEdit : void 0; - }, "cancelButtonAriaLabel") - }, - components: { - DTRadioButton: script$a, - DTCheckbox: script$b, - Button: script$A, - ChevronDownIcon: script$B, - ChevronRightIcon: script$C, - BarsIcon: script$D, - PencilIcon: script$k, - CheckIcon: script$y, - TimesIcon: script$E - }, - directives: { - ripple: Ripple - } -}; -function _typeof$a(o) { - "@babel/helpers - typeof"; - return _typeof$a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$a(o); -} -__name(_typeof$a, "_typeof$a"); -function ownKeys$a(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys$a, "ownKeys$a"); -function _objectSpread$a(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys$a(Object(t), true).forEach(function(r2) { - _defineProperty$a(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread$a, "_objectSpread$a"); -function _defineProperty$a(e, r, t) { - return (r = _toPropertyKey$a(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$a, "_defineProperty$a"); -function _toPropertyKey$a(t) { - var i = _toPrimitive$a(t, "string"); - return "symbol" == _typeof$a(i) ? i : i + ""; -} -__name(_toPropertyKey$a, "_toPropertyKey$a"); -function _toPrimitive$a(t, r) { - if ("object" != _typeof$a(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$a(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$a, "_toPrimitive$a"); -var _hoisted_1$4 = ["colspan", "rowspan", "data-p-selection-column", "data-p-editable-column", "data-p-cell-editing", "data-p-frozen-column"]; -var _hoisted_2$2 = ["aria-expanded", "aria-controls", "aria-label"]; -function render$9(_ctx, _cache, $props, $setup, $data, $options) { - var _component_DTRadioButton = resolveComponent("DTRadioButton"); - var _component_DTCheckbox = resolveComponent("DTCheckbox"); - var _component_BarsIcon = resolveComponent("BarsIcon"); - var _component_ChevronDownIcon = resolveComponent("ChevronDownIcon"); - var _component_ChevronRightIcon = resolveComponent("ChevronRightIcon"); - var _component_Button = resolveComponent("Button"); - var _directive_ripple = resolveDirective("ripple"); - return $options.loading ? (openBlock(), createElementBlock("td", mergeProps({ - key: 0, - style: $options.containerStyle, - "class": $options.containerClass, - role: "cell" - }, _objectSpread$a(_objectSpread$a({}, $options.getColumnPT("root")), $options.getColumnPT("bodyCell"))), [(openBlock(), createBlock(resolveDynamicComponent($props.column.children.loading), { - data: $props.rowData, - column: $props.column, - field: $options.field, - index: $props.rowIndex, - frozenRow: $props.frozenRow, - loadingOptions: $options.loadingOptions - }, null, 8, ["data", "column", "field", "index", "frozenRow", "loadingOptions"]))], 16)) : (openBlock(), createElementBlock("td", mergeProps({ - key: 1, - style: $options.containerStyle, - "class": $options.containerClass, - colspan: $options.columnProp("colspan"), - rowspan: $options.columnProp("rowspan"), - onClick: _cache[3] || (_cache[3] = function() { - return $options.onClick && $options.onClick.apply($options, arguments); - }), - onKeydown: _cache[4] || (_cache[4] = function() { - return $options.onKeyDown && $options.onKeyDown.apply($options, arguments); - }), - role: "cell" - }, _objectSpread$a(_objectSpread$a({}, $options.getColumnPT("root")), $options.getColumnPT("bodyCell")), { - "data-p-selection-column": $options.columnProp("selectionMode") != null, - "data-p-editable-column": $options.isEditable(), - "data-p-cell-editing": $data.d_editing, - "data-p-frozen-column": $options.columnProp("frozen") - }), [$props.column.children && $props.column.children.body && !$data.d_editing ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.body), { - key: 0, - data: $props.rowData, - column: $props.column, - field: $options.field, - index: $props.rowIndex, - frozenRow: $props.frozenRow, - editorInitCallback: $options.editorInitCallback, - rowTogglerCallback: $options.toggleRow - }, null, 8, ["data", "column", "field", "index", "frozenRow", "editorInitCallback", "rowTogglerCallback"])) : $props.column.children && $props.column.children.editor && $data.d_editing ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.editor), { - key: 1, - data: $options.editingRowData, - column: $props.column, - field: $options.field, - index: $props.rowIndex, - frozenRow: $props.frozenRow, - editorSaveCallback: $options.editorSaveCallback, - editorCancelCallback: $options.editorCancelCallback - }, null, 8, ["data", "column", "field", "index", "frozenRow", "editorSaveCallback", "editorCancelCallback"])) : $props.column.children && $props.column.children.body && !$props.column.children.editor && $data.d_editing ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.body), { - key: 2, - data: $options.editingRowData, - column: $props.column, - field: $options.field, - index: $props.rowIndex, - frozenRow: $props.frozenRow - }, null, 8, ["data", "column", "field", "index", "frozenRow"])) : $options.columnProp("selectionMode") ? (openBlock(), createElementBlock(Fragment, { - key: 3 - }, [$options.columnProp("selectionMode") === "single" ? (openBlock(), createBlock(_component_DTRadioButton, { - key: 0, - value: $props.rowData, - name: $props.name, - checked: $props.selected, - onChange: _cache[0] || (_cache[0] = function($event) { - return $options.toggleRowWithRadio($event, $props.rowIndex); - }), - column: $props.column, - index: $props.index, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["value", "name", "checked", "column", "index", "unstyled", "pt"])) : $options.columnProp("selectionMode") === "multiple" ? (openBlock(), createBlock(_component_DTCheckbox, { - key: 1, - value: $props.rowData, - checked: $props.selected, - rowCheckboxIconTemplate: $props.column.children && $props.column.children.rowcheckboxicon, - "aria-selected": $props.selected ? true : void 0, - onChange: _cache[1] || (_cache[1] = function($event) { - return $options.toggleRowWithCheckbox($event, $props.rowIndex); - }), - column: $props.column, - index: $props.index, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["value", "checked", "rowCheckboxIconTemplate", "aria-selected", "column", "index", "unstyled", "pt"])) : createCommentVNode("", true)], 64)) : $options.columnProp("rowReorder") ? (openBlock(), createElementBlock(Fragment, { - key: 4 - }, [$props.column.children && $props.column.children.rowreordericon ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.rowreordericon), { - key: 0, - "class": normalizeClass(_ctx.cx("reorderableRowHandle")) - }, null, 8, ["class"])) : $options.columnProp("rowReorderIcon") ? (openBlock(), createElementBlock("i", mergeProps({ - key: 1, - "class": [_ctx.cx("reorderableRowHandle"), $options.columnProp("rowReorderIcon")] - }, $options.getColumnPT("reorderableRowHandle")), null, 16)) : (openBlock(), createBlock(_component_BarsIcon, mergeProps({ - key: 2, - "class": _ctx.cx("reorderableRowHandle") - }, $options.getColumnPT("reorderableRowHandle")), null, 16, ["class"]))], 64)) : $options.columnProp("expander") ? withDirectives((openBlock(), createElementBlock("button", mergeProps({ - key: 5, - "class": _ctx.cx("rowToggleButton"), - type: "button", - "aria-expanded": $props.isRowExpanded, - "aria-controls": $props.ariaControls, - "aria-label": $options.expandButtonAriaLabel, - onClick: _cache[2] || (_cache[2] = function() { - return $options.toggleRow && $options.toggleRow.apply($options, arguments); - }) - }, $options.getColumnPT("rowToggleButton"), { - "data-pc-group-section": "rowactionbutton" - }), [$props.column.children && $props.column.children.rowtogglericon ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.rowtogglericon), { - key: 0, - "class": normalizeClass(_ctx.cx("rowToggleIcon")), - rowExpanded: $props.isRowExpanded - }, null, 8, ["class", "rowExpanded"])) : (openBlock(), createElementBlock(Fragment, { - key: 1 - }, [$props.isRowExpanded && $props.expandedRowIcon ? (openBlock(), createElementBlock("span", { - key: 0, - "class": normalizeClass([_ctx.cx("rowToggleIcon"), $props.expandedRowIcon]) - }, null, 2)) : $props.isRowExpanded && !$props.expandedRowIcon ? (openBlock(), createBlock(_component_ChevronDownIcon, mergeProps({ - key: 1, - "class": _ctx.cx("rowToggleIcon") - }, $options.getColumnPT("rowToggleIcon")), null, 16, ["class"])) : !$props.isRowExpanded && $props.collapsedRowIcon ? (openBlock(), createElementBlock("span", { - key: 2, - "class": normalizeClass([_ctx.cx("rowToggleIcon"), $props.collapsedRowIcon]) - }, null, 2)) : !$props.isRowExpanded && !$props.collapsedRowIcon ? (openBlock(), createBlock(_component_ChevronRightIcon, mergeProps({ - key: 3, - "class": _ctx.cx("rowToggleIcon") - }, $options.getColumnPT("rowToggleIcon")), null, 16, ["class"])) : createCommentVNode("", true)], 64))], 16, _hoisted_2$2)), [[_directive_ripple]]) : $props.editMode === "row" && $options.columnProp("rowEditor") ? (openBlock(), createElementBlock(Fragment, { - key: 6 - }, [!$data.d_editing ? (openBlock(), createBlock(_component_Button, mergeProps({ - key: 0, - "class": _ctx.cx("pcRowEditorInit"), - "aria-label": $options.initButtonAriaLabel, - unstyled: _ctx.unstyled, - onClick: $options.onRowEditInit - }, $props.editButtonProps.init, { - pt: $options.getColumnPT("pcRowEditorInit"), - "data-pc-group-section": "rowactionbutton" - }), { - icon: withCtx(function(slotProps) { - return [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.roweditoriniticon || "PencilIcon"), mergeProps({ - "class": slotProps["class"] - }, $options.getColumnPT("pcRowEditorInit")["icon"]), null, 16, ["class"]))]; - }), - _: 1 - }, 16, ["class", "aria-label", "unstyled", "onClick", "pt"])) : createCommentVNode("", true), $data.d_editing ? (openBlock(), createBlock(_component_Button, mergeProps({ - key: 1, - "class": _ctx.cx("pcRowEditorSave"), - "aria-label": $options.saveButtonAriaLabel, - unstyled: _ctx.unstyled, - onClick: $options.onRowEditSave - }, $props.editButtonProps.save, { - pt: $options.getColumnPT("pcRowEditorSave"), - "data-pc-group-section": "rowactionbutton" - }), { - icon: withCtx(function(slotProps) { - return [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.roweditorsaveicon || "CheckIcon"), mergeProps({ - "class": slotProps["class"] - }, $options.getColumnPT("pcRowEditorSave")["icon"]), null, 16, ["class"]))]; - }), - _: 1 - }, 16, ["class", "aria-label", "unstyled", "onClick", "pt"])) : createCommentVNode("", true), $data.d_editing ? (openBlock(), createBlock(_component_Button, mergeProps({ - key: 2, - "class": _ctx.cx("pcRowEditorCancel"), - "aria-label": $options.cancelButtonAriaLabel, - unstyled: _ctx.unstyled, - onClick: $options.onRowEditCancel - }, $props.editButtonProps.cancel, { - pt: $options.getColumnPT("pcRowEditorCancel"), - "data-pc-group-section": "rowactionbutton" - }), { - icon: withCtx(function(slotProps) { - return [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.roweditorcancelicon || "TimesIcon"), mergeProps({ - "class": slotProps["class"] - }, $options.getColumnPT("pcRowEditorCancel")["icon"]), null, 16, ["class"]))]; - }), - _: 1 - }, 16, ["class", "aria-label", "unstyled", "onClick", "pt"])) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock(Fragment, { - key: 7 - }, [createTextVNode(toDisplayString($options.resolveFieldData()), 1)], 64))], 16, _hoisted_1$4)); -} -__name(render$9, "render$9"); -script$9.render = render$9; -function _typeof$9(o) { - "@babel/helpers - typeof"; - return _typeof$9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$9(o); -} -__name(_typeof$9, "_typeof$9"); -function _createForOfIteratorHelper$2(r, e) { - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; - if (!t) { - if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e) { - t && (r = t); - var _n = 0, F = /* @__PURE__ */ __name(function F2() { - }, "F"); - return { s: F, n: /* @__PURE__ */ __name(function n() { - return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; - }, "n"), e: /* @__PURE__ */ __name(function e2(r2) { - throw r2; - }, "e"), f: F }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - var o, a = true, u = false; - return { s: /* @__PURE__ */ __name(function s() { - t = t.call(r); - }, "s"), n: /* @__PURE__ */ __name(function n() { - var r2 = t.next(); - return a = r2.done, r2; - }, "n"), e: /* @__PURE__ */ __name(function e2(r2) { - u = true, o = r2; - }, "e"), f: /* @__PURE__ */ __name(function f() { - try { - a || null == t["return"] || t["return"](); - } finally { - if (u) throw o; - } - }, "f") }; -} -__name(_createForOfIteratorHelper$2, "_createForOfIteratorHelper$2"); -function _unsupportedIterableToArray$2(r, a) { - if (r) { - if ("string" == typeof r) return _arrayLikeToArray$2(r, a); - var t = {}.toString.call(r).slice(8, -1); - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; - } -} -__name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray$2"); -function _arrayLikeToArray$2(r, a) { - (null == a || a > r.length) && (a = r.length); - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; - return n; -} -__name(_arrayLikeToArray$2, "_arrayLikeToArray$2"); -function ownKeys$9(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys$9, "ownKeys$9"); -function _objectSpread$9(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys$9(Object(t), true).forEach(function(r2) { - _defineProperty$9(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread$9, "_objectSpread$9"); -function _defineProperty$9(e, r, t) { - return (r = _toPropertyKey$9(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$9, "_defineProperty$9"); -function _toPropertyKey$9(t) { - var i = _toPrimitive$9(t, "string"); - return "symbol" == _typeof$9(i) ? i : i + ""; -} -__name(_toPropertyKey$9, "_toPropertyKey$9"); -function _toPrimitive$9(t, r) { - if ("object" != _typeof$9(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$9(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$9, "_toPrimitive$9"); -var script$8 = { - name: "BodyRow", - hostName: "DataTable", - "extends": script$s, - emits: ["rowgroup-toggle", "row-click", "row-dblclick", "row-rightclick", "row-touchend", "row-keydown", "row-mousedown", "row-dragstart", "row-dragover", "row-dragleave", "row-dragend", "row-drop", "row-toggle", "radio-change", "checkbox-change", "cell-edit-init", "cell-edit-complete", "cell-edit-cancel", "row-edit-init", "row-edit-save", "row-edit-cancel", "editing-meta-change"], - props: { - rowData: { - type: Object, - "default": null - }, - index: { - type: Number, - "default": 0 - }, - value: { - type: Array, - "default": null - }, - columns: { - type: null, - "default": null - }, - frozenRow: { - type: Boolean, - "default": false - }, - empty: { - type: Boolean, - "default": false - }, - rowGroupMode: { - type: String, - "default": null - }, - groupRowsBy: { - type: [Array, String, Function], - "default": null - }, - expandableRowGroups: { - type: Boolean, - "default": false - }, - expandedRowGroups: { - type: Array, - "default": null - }, - first: { - type: Number, - "default": 0 - }, - dataKey: { - type: [String, Function], - "default": null - }, - expandedRowIcon: { - type: String, - "default": null - }, - collapsedRowIcon: { - type: String, - "default": null - }, - expandedRows: { - type: [Array, Object], - "default": null - }, - selection: { - type: [Array, Object], - "default": null - }, - selectionKeys: { - type: null, - "default": null - }, - selectionMode: { - type: String, - "default": null - }, - contextMenu: { - type: Boolean, - "default": false - }, - contextMenuSelection: { - type: Object, - "default": null - }, - rowClass: { - type: null, - "default": null - }, - rowStyle: { - type: null, - "default": null - }, - rowGroupHeaderStyle: { - type: null, - "default": null - }, - editMode: { - type: String, - "default": null - }, - compareSelectionBy: { - type: String, - "default": "deepEquals" - }, - editingRows: { - type: Array, - "default": null - }, - editingRowKeys: { - type: null, - "default": null - }, - editingMeta: { - type: Object, - "default": null - }, - templates: { - type: null, - "default": null - }, - scrollable: { - type: Boolean, - "default": false - }, - editButtonProps: { - type: Object, - "default": null - }, - virtualScrollerContentProps: { - type: Object, - "default": null - }, - isVirtualScrollerDisabled: { - type: Boolean, - "default": false - }, - expandedRowId: { - type: String, - "default": null - }, - nameAttributeSelector: { - type: String, - "default": null - } - }, - data: /* @__PURE__ */ __name(function data4() { - return { - d_rowExpanded: false - }; - }, "data"), - watch: { - expandedRows: { - deep: true, - immediate: true, - handler: /* @__PURE__ */ __name(function handler(newValue) { - var _this = this; - this.d_rowExpanded = this.dataKey ? (newValue === null || newValue === void 0 ? void 0 : newValue[resolveFieldData(this.rowData, this.dataKey)]) !== void 0 : newValue === null || newValue === void 0 ? void 0 : newValue.some(function(d) { - return _this.equals(_this.rowData, d); - }); - }, "handler") - } - }, - methods: { - columnProp: /* @__PURE__ */ __name(function columnProp2(col, prop) { - return getVNodeProp(col, prop); - }, "columnProp"), - //@todo - update this method - getColumnPT: /* @__PURE__ */ __name(function getColumnPT4(key) { - var columnMetaData = { - parent: { - instance: this, - props: this.$props, - state: this.$data - } - }; - return mergeProps(this.ptm("column.".concat(key), { - column: columnMetaData - }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.columnProp({}, "pt"), key, columnMetaData)); - }, "getColumnPT"), - //@todo - update this method - getBodyRowPTOptions: /* @__PURE__ */ __name(function getBodyRowPTOptions(key) { - var _this$$parentInstance; - var datatable = (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.$parentInstance; - return this.ptm(key, { - context: { - index: this.rowIndex, - selectable: (datatable === null || datatable === void 0 ? void 0 : datatable.rowHover) || (datatable === null || datatable === void 0 ? void 0 : datatable.selectionMode), - selected: this.isSelected, - stripedRows: (datatable === null || datatable === void 0 ? void 0 : datatable.stripedRows) || false - } - }); - }, "getBodyRowPTOptions"), - shouldRenderBodyCell: /* @__PURE__ */ __name(function shouldRenderBodyCell(column) { - var isHidden = this.columnProp(column, "hidden"); - if (this.rowGroupMode && !isHidden) { - var field2 = this.columnProp(column, "field"); - if (this.rowGroupMode === "subheader") { - return this.groupRowsBy !== field2; - } else if (this.rowGroupMode === "rowspan") { - if (this.isGrouped(column)) { - var prevRowData = this.value[this.rowIndex - 1]; - if (prevRowData) { - var currentRowFieldData = resolveFieldData(this.value[this.rowIndex], field2); - var previousRowFieldData = resolveFieldData(prevRowData, field2); - return currentRowFieldData !== previousRowFieldData; - } else { - return true; - } - } else { - return true; - } - } - } else { - return !isHidden; - } - }, "shouldRenderBodyCell"), - calculateRowGroupSize: /* @__PURE__ */ __name(function calculateRowGroupSize(column) { - if (this.isGrouped(column)) { - var index = this.rowIndex; - var field2 = this.columnProp(column, "field"); - var currentRowFieldData = resolveFieldData(this.value[index], field2); - var nextRowFieldData = currentRowFieldData; - var groupRowSpan = 0; - while (currentRowFieldData === nextRowFieldData) { - groupRowSpan++; - var nextRowData = this.value[++index]; - if (nextRowData) { - nextRowFieldData = resolveFieldData(nextRowData, field2); - } else { - break; - } - } - return groupRowSpan === 1 ? null : groupRowSpan; - } else { - return null; - } - }, "calculateRowGroupSize"), - isGrouped: /* @__PURE__ */ __name(function isGrouped(column) { - var field2 = this.columnProp(column, "field"); - if (this.groupRowsBy && field2) { - if (Array.isArray(this.groupRowsBy)) return this.groupRowsBy.indexOf(field2) > -1; - else return this.groupRowsBy === field2; - } else { - return false; - } - }, "isGrouped"), - findIndexInSelection: /* @__PURE__ */ __name(function findIndexInSelection(data12) { - return this.findIndex(data12, this.selection); - }, "findIndexInSelection"), - findIndex: /* @__PURE__ */ __name(function findIndex(data12, collection) { - var index = -1; - if (collection && collection.length) { - for (var i = 0; i < collection.length; i++) { - if (this.equals(data12, collection[i])) { - index = i; - break; - } - } - } - return index; - }, "findIndex"), - equals: /* @__PURE__ */ __name(function equals$1(data1, data22) { - return this.compareSelectionBy === "equals" ? data1 === data22 : equals(data1, data22, this.dataKey); - }, "equals$1"), - onRowGroupToggle: /* @__PURE__ */ __name(function onRowGroupToggle(event2) { - this.$emit("rowgroup-toggle", { - originalEvent: event2, - data: this.rowData - }); - }, "onRowGroupToggle"), - onRowClick: /* @__PURE__ */ __name(function onRowClick(event2) { - this.$emit("row-click", { - originalEvent: event2, - data: this.rowData, - index: this.rowIndex - }); - }, "onRowClick"), - onRowDblClick: /* @__PURE__ */ __name(function onRowDblClick(event2) { - this.$emit("row-dblclick", { - originalEvent: event2, - data: this.rowData, - index: this.rowIndex - }); - }, "onRowDblClick"), - onRowRightClick: /* @__PURE__ */ __name(function onRowRightClick(event2) { - this.$emit("row-rightclick", { - originalEvent: event2, - data: this.rowData, - index: this.rowIndex - }); - }, "onRowRightClick"), - onRowTouchEnd: /* @__PURE__ */ __name(function onRowTouchEnd(event2) { - this.$emit("row-touchend", event2); - }, "onRowTouchEnd"), - onRowKeyDown: /* @__PURE__ */ __name(function onRowKeyDown(event2) { - this.$emit("row-keydown", { - originalEvent: event2, - data: this.rowData, - index: this.rowIndex - }); - }, "onRowKeyDown"), - onRowMouseDown: /* @__PURE__ */ __name(function onRowMouseDown(event2) { - this.$emit("row-mousedown", event2); - }, "onRowMouseDown"), - onRowDragStart: /* @__PURE__ */ __name(function onRowDragStart(event2) { - this.$emit("row-dragstart", { - originalEvent: event2, - index: this.rowIndex - }); - }, "onRowDragStart"), - onRowDragOver: /* @__PURE__ */ __name(function onRowDragOver(event2) { - this.$emit("row-dragover", { - originalEvent: event2, - index: this.rowIndex - }); - }, "onRowDragOver"), - onRowDragLeave: /* @__PURE__ */ __name(function onRowDragLeave(event2) { - this.$emit("row-dragleave", event2); - }, "onRowDragLeave"), - onRowDragEnd: /* @__PURE__ */ __name(function onRowDragEnd(event2) { - this.$emit("row-dragend", event2); - }, "onRowDragEnd"), - onRowDrop: /* @__PURE__ */ __name(function onRowDrop(event2) { - this.$emit("row-drop", event2); - }, "onRowDrop"), - onRowToggle: /* @__PURE__ */ __name(function onRowToggle(event2) { - this.d_rowExpanded = !this.d_rowExpanded; - this.$emit("row-toggle", _objectSpread$9(_objectSpread$9({}, event2), {}, { - expanded: this.d_rowExpanded - })); - }, "onRowToggle"), - onRadioChange: /* @__PURE__ */ __name(function onRadioChange(event2) { - this.$emit("radio-change", event2); - }, "onRadioChange"), - onCheckboxChange: /* @__PURE__ */ __name(function onCheckboxChange(event2) { - this.$emit("checkbox-change", event2); - }, "onCheckboxChange"), - onCellEditInit: /* @__PURE__ */ __name(function onCellEditInit(event2) { - this.$emit("cell-edit-init", event2); - }, "onCellEditInit"), - onCellEditComplete: /* @__PURE__ */ __name(function onCellEditComplete(event2) { - this.$emit("cell-edit-complete", event2); - }, "onCellEditComplete"), - onCellEditCancel: /* @__PURE__ */ __name(function onCellEditCancel(event2) { - this.$emit("cell-edit-cancel", event2); - }, "onCellEditCancel"), - onRowEditInit: /* @__PURE__ */ __name(function onRowEditInit2(event2) { - this.$emit("row-edit-init", event2); - }, "onRowEditInit"), - onRowEditSave: /* @__PURE__ */ __name(function onRowEditSave2(event2) { - this.$emit("row-edit-save", event2); - }, "onRowEditSave"), - onRowEditCancel: /* @__PURE__ */ __name(function onRowEditCancel2(event2) { - this.$emit("row-edit-cancel", event2); - }, "onRowEditCancel"), - onEditingMetaChange: /* @__PURE__ */ __name(function onEditingMetaChange(event2) { - this.$emit("editing-meta-change", event2); - }, "onEditingMetaChange"), - getVirtualScrollerProp: /* @__PURE__ */ __name(function getVirtualScrollerProp2(option, options) { - options = options || this.virtualScrollerContentProps; - return options ? options[option] : null; - }, "getVirtualScrollerProp") - }, - computed: { - rowIndex: /* @__PURE__ */ __name(function rowIndex() { - var getItemOptions = this.getVirtualScrollerProp("getItemOptions"); - return getItemOptions ? getItemOptions(this.index).index : this.index; - }, "rowIndex"), - rowStyles: /* @__PURE__ */ __name(function rowStyles() { - var _this$rowStyle; - return (_this$rowStyle = this.rowStyle) === null || _this$rowStyle === void 0 ? void 0 : _this$rowStyle.call(this, this.rowData); - }, "rowStyles"), - rowClasses: /* @__PURE__ */ __name(function rowClasses() { - var rowStyleClass = []; - var columnSelectionMode = null; - if (this.rowClass) { - var rowClassValue = this.rowClass(this.rowData); - if (rowClassValue) { - rowStyleClass.push(rowClassValue); - } - } - if (this.columns) { - var _iterator = _createForOfIteratorHelper$2(this.columns), _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done; ) { - var col = _step.value; - var _selectionMode = this.columnProp(col, "selectionMode"); - if (isNotEmpty(_selectionMode)) { - columnSelectionMode = _selectionMode; - break; - } - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - } - return [this.cx("row", { - rowData: this.rowData, - index: this.rowIndex, - columnSelectionMode - }), rowStyleClass]; - }, "rowClasses"), - rowTabindex: /* @__PURE__ */ __name(function rowTabindex() { - if (this.selection === null && (this.selectionMode === "single" || this.selectionMode === "multiple")) { - return this.rowIndex === 0 ? 0 : -1; - } - return -1; - }, "rowTabindex"), - isRowEditing: /* @__PURE__ */ __name(function isRowEditing() { - if (this.rowData && this.editingRows) { - if (this.dataKey) return this.editingRowKeys ? this.editingRowKeys[resolveFieldData(this.rowData, this.dataKey)] !== void 0 : false; - else return this.findIndex(this.rowData, this.editingRows) > -1; - } - return false; - }, "isRowEditing"), - isRowGroupExpanded: /* @__PURE__ */ __name(function isRowGroupExpanded() { - if (this.expandableRowGroups && this.expandedRowGroups) { - var groupFieldValue = resolveFieldData(this.rowData, this.groupRowsBy); - return this.expandedRowGroups.indexOf(groupFieldValue) > -1; - } - return false; - }, "isRowGroupExpanded"), - isSelected: /* @__PURE__ */ __name(function isSelected() { - if (this.rowData && this.selection) { - if (this.dataKey) { - return this.selectionKeys ? this.selectionKeys[resolveFieldData(this.rowData, this.dataKey)] !== void 0 : false; - } else { - if (this.selection instanceof Array) return this.findIndexInSelection(this.rowData) > -1; - else return this.equals(this.rowData, this.selection); - } - } - return false; - }, "isSelected"), - isSelectedWithContextMenu: /* @__PURE__ */ __name(function isSelectedWithContextMenu() { - if (this.rowData && this.contextMenuSelection) { - return this.equals(this.rowData, this.contextMenuSelection, this.dataKey); - } - return false; - }, "isSelectedWithContextMenu"), - shouldRenderRowGroupHeader: /* @__PURE__ */ __name(function shouldRenderRowGroupHeader() { - var currentRowFieldData = resolveFieldData(this.rowData, this.groupRowsBy); - var prevRowData = this.value[this.rowIndex - 1]; - if (prevRowData) { - var previousRowFieldData = resolveFieldData(prevRowData, this.groupRowsBy); - return currentRowFieldData !== previousRowFieldData; - } else { - return true; - } - }, "shouldRenderRowGroupHeader"), - shouldRenderRowGroupFooter: /* @__PURE__ */ __name(function shouldRenderRowGroupFooter() { - if (this.expandableRowGroups && !this.isRowGroupExpanded) { - return false; - } else { - var currentRowFieldData = resolveFieldData(this.rowData, this.groupRowsBy); - var nextRowData = this.value[this.rowIndex + 1]; - if (nextRowData) { - var nextRowFieldData = resolveFieldData(nextRowData, this.groupRowsBy); - return currentRowFieldData !== nextRowFieldData; - } else { - return true; - } - } - }, "shouldRenderRowGroupFooter"), - columnsLength: /* @__PURE__ */ __name(function columnsLength() { - var _this2 = this; - if (this.columns) { - var hiddenColLength = 0; - this.columns.forEach(function(column) { - if (_this2.columnProp(column, "selectionMode") === "single") hiddenColLength--; - if (_this2.columnProp(column, "hidden")) hiddenColLength++; - }); - return this.columns.length - hiddenColLength; - } - return 0; - }, "columnsLength") - }, - components: { - DTBodyCell: script$9, - ChevronDownIcon: script$B, - ChevronRightIcon: script$C - } -}; -function _typeof$8(o) { - "@babel/helpers - typeof"; - return _typeof$8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$8(o); -} -__name(_typeof$8, "_typeof$8"); -function ownKeys$8(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys$8, "ownKeys$8"); -function _objectSpread$8(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys$8(Object(t), true).forEach(function(r2) { - _defineProperty$8(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread$8, "_objectSpread$8"); -function _defineProperty$8(e, r, t) { - return (r = _toPropertyKey$8(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$8, "_defineProperty$8"); -function _toPropertyKey$8(t) { - var i = _toPrimitive$8(t, "string"); - return "symbol" == _typeof$8(i) ? i : i + ""; -} -__name(_toPropertyKey$8, "_toPropertyKey$8"); -function _toPrimitive$8(t, r) { - if ("object" != _typeof$8(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$8(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$8, "_toPrimitive$8"); -var _hoisted_1$3 = ["colspan"]; -var _hoisted_2$1 = ["tabindex", "aria-selected", "data-p-index", "data-p-selectable-row", "data-p-selected", "data-p-selected-contextmenu"]; -var _hoisted_3 = ["id"]; -var _hoisted_4 = ["colspan"]; -var _hoisted_5 = ["colspan"]; -var _hoisted_6 = ["colspan"]; -function render$8(_ctx, _cache, $props, $setup, $data, $options) { - var _component_ChevronDownIcon = resolveComponent("ChevronDownIcon"); - var _component_ChevronRightIcon = resolveComponent("ChevronRightIcon"); - var _component_DTBodyCell = resolveComponent("DTBodyCell"); - return !$props.empty ? (openBlock(), createElementBlock(Fragment, { - key: 0 - }, [$props.templates["groupheader"] && $props.rowGroupMode === "subheader" && $options.shouldRenderRowGroupHeader ? (openBlock(), createElementBlock("tr", mergeProps({ - key: 0, - "class": _ctx.cx("rowGroupHeader"), - style: $props.rowGroupHeaderStyle, - role: "row" - }, _ctx.ptm("rowGroupHeader")), [createBaseVNode("td", mergeProps({ - colspan: $options.columnsLength - 1 - }, _objectSpread$8(_objectSpread$8({}, $options.getColumnPT("bodycell")), _ctx.ptm("rowGroupHeaderCell"))), [$props.expandableRowGroups ? (openBlock(), createElementBlock("button", mergeProps({ - key: 0, - "class": _ctx.cx("rowToggleButton"), - onClick: _cache[0] || (_cache[0] = function() { - return $options.onRowGroupToggle && $options.onRowGroupToggle.apply($options, arguments); - }), - type: "button" - }, _ctx.ptm("rowToggleButton")), [$props.templates["rowtoggleicon"] || $props.templates["rowgrouptogglericon"] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates["rowtoggleicon"] || $props.templates["rowgrouptogglericon"]), { - key: 0, - expanded: $options.isRowGroupExpanded - }, null, 8, ["expanded"])) : (openBlock(), createElementBlock(Fragment, { - key: 1 - }, [$options.isRowGroupExpanded && $props.expandedRowIcon ? (openBlock(), createElementBlock("span", mergeProps({ - key: 0, - "class": [_ctx.cx("rowToggleIcon"), $props.expandedRowIcon] - }, _ctx.ptm("rowToggleIcon")), null, 16)) : $options.isRowGroupExpanded && !$props.expandedRowIcon ? (openBlock(), createBlock(_component_ChevronDownIcon, mergeProps({ - key: 1, - "class": _ctx.cx("rowToggleIcon") - }, _ctx.ptm("rowToggleIcon")), null, 16, ["class"])) : !$options.isRowGroupExpanded && $props.collapsedRowIcon ? (openBlock(), createElementBlock("span", mergeProps({ - key: 2, - "class": [_ctx.cx("rowToggleIcon"), $props.collapsedRowIcon] - }, _ctx.ptm("rowToggleIcon")), null, 16)) : !$options.isRowGroupExpanded && !$props.collapsedRowIcon ? (openBlock(), createBlock(_component_ChevronRightIcon, mergeProps({ - key: 3, - "class": _ctx.cx("rowToggleIcon") - }, _ctx.ptm("rowToggleIcon")), null, 16, ["class"])) : createCommentVNode("", true)], 64))], 16)) : createCommentVNode("", true), (openBlock(), createBlock(resolveDynamicComponent($props.templates["groupheader"]), { - data: $props.rowData, - index: $options.rowIndex - }, null, 8, ["data", "index"]))], 16, _hoisted_1$3)], 16)) : createCommentVNode("", true), ($props.expandableRowGroups ? $options.isRowGroupExpanded : true) ? (openBlock(), createElementBlock("tr", mergeProps({ - key: 1, - "class": $options.rowClasses, - style: $options.rowStyles, - tabindex: $options.rowTabindex, - role: "row", - "aria-selected": $props.selectionMode ? $options.isSelected : null, - onClick: _cache[1] || (_cache[1] = function() { - return $options.onRowClick && $options.onRowClick.apply($options, arguments); - }), - onDblclick: _cache[2] || (_cache[2] = function() { - return $options.onRowDblClick && $options.onRowDblClick.apply($options, arguments); - }), - onContextmenu: _cache[3] || (_cache[3] = function() { - return $options.onRowRightClick && $options.onRowRightClick.apply($options, arguments); - }), - onTouchend: _cache[4] || (_cache[4] = function() { - return $options.onRowTouchEnd && $options.onRowTouchEnd.apply($options, arguments); - }), - onKeydown: _cache[5] || (_cache[5] = withModifiers(function() { - return $options.onRowKeyDown && $options.onRowKeyDown.apply($options, arguments); - }, ["self"])), - onMousedown: _cache[6] || (_cache[6] = function() { - return $options.onRowMouseDown && $options.onRowMouseDown.apply($options, arguments); - }), - onDragstart: _cache[7] || (_cache[7] = function() { - return $options.onRowDragStart && $options.onRowDragStart.apply($options, arguments); - }), - onDragover: _cache[8] || (_cache[8] = function() { - return $options.onRowDragOver && $options.onRowDragOver.apply($options, arguments); - }), - onDragleave: _cache[9] || (_cache[9] = function() { - return $options.onRowDragLeave && $options.onRowDragLeave.apply($options, arguments); - }), - onDragend: _cache[10] || (_cache[10] = function() { - return $options.onRowDragEnd && $options.onRowDragEnd.apply($options, arguments); - }), - onDrop: _cache[11] || (_cache[11] = function() { - return $options.onRowDrop && $options.onRowDrop.apply($options, arguments); - }) - }, $options.getBodyRowPTOptions("bodyRow"), { - "data-p-index": $options.rowIndex, - "data-p-selectable-row": $props.selectionMode ? true : false, - "data-p-selected": $props.selection && $options.isSelected, - "data-p-selected-contextmenu": $props.contextMenuSelection && $options.isSelectedWithContextMenu - }), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function(col, i) { - return openBlock(), createElementBlock(Fragment, null, [$options.shouldRenderBodyCell(col) ? (openBlock(), createBlock(_component_DTBodyCell, { - key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || i, - rowData: $props.rowData, - column: col, - rowIndex: $options.rowIndex, - index: i, - selected: $options.isSelected, - frozenRow: $props.frozenRow, - rowspan: $props.rowGroupMode === "rowspan" ? $options.calculateRowGroupSize(col) : null, - editMode: $props.editMode, - editing: $props.editMode === "row" && $options.isRowEditing, - editingMeta: $props.editingMeta, - virtualScrollerContentProps: $props.virtualScrollerContentProps, - ariaControls: $props.expandedRowId + "_" + $options.rowIndex + "_expansion", - name: $props.nameAttributeSelector, - isRowExpanded: $data.d_rowExpanded, - expandedRowIcon: $props.expandedRowIcon, - collapsedRowIcon: $props.collapsedRowIcon, - editButtonProps: $props.editButtonProps, - onRadioChange: $options.onRadioChange, - onCheckboxChange: $options.onCheckboxChange, - onRowToggle: $options.onRowToggle, - onCellEditInit: $options.onCellEditInit, - onCellEditComplete: $options.onCellEditComplete, - onCellEditCancel: $options.onCellEditCancel, - onRowEditInit: $options.onRowEditInit, - onRowEditSave: $options.onRowEditSave, - onRowEditCancel: $options.onRowEditCancel, - onEditingMetaChange: $options.onEditingMetaChange, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["rowData", "column", "rowIndex", "index", "selected", "frozenRow", "rowspan", "editMode", "editing", "editingMeta", "virtualScrollerContentProps", "ariaControls", "name", "isRowExpanded", "expandedRowIcon", "collapsedRowIcon", "editButtonProps", "onRadioChange", "onCheckboxChange", "onRowToggle", "onCellEditInit", "onCellEditComplete", "onCellEditCancel", "onRowEditInit", "onRowEditSave", "onRowEditCancel", "onEditingMetaChange", "unstyled", "pt"])) : createCommentVNode("", true)], 64); - }), 256))], 16, _hoisted_2$1)) : createCommentVNode("", true), $props.templates["expansion"] && $props.expandedRows && $data.d_rowExpanded ? (openBlock(), createElementBlock("tr", mergeProps({ - key: 2, - id: $props.expandedRowId + "_" + $options.rowIndex + "_expansion", - "class": _ctx.cx("rowExpansion"), - role: "row" - }, _ctx.ptm("rowExpansion")), [createBaseVNode("td", mergeProps({ - colspan: $options.columnsLength - }, _objectSpread$8(_objectSpread$8({}, $options.getColumnPT("bodycell")), _ctx.ptm("rowExpansionCell"))), [(openBlock(), createBlock(resolveDynamicComponent($props.templates["expansion"]), { - data: $props.rowData, - index: $options.rowIndex - }, null, 8, ["data", "index"]))], 16, _hoisted_4)], 16, _hoisted_3)) : createCommentVNode("", true), $props.templates["groupfooter"] && $props.rowGroupMode === "subheader" && $options.shouldRenderRowGroupFooter ? (openBlock(), createElementBlock("tr", mergeProps({ - key: 3, - "class": _ctx.cx("rowGroupFooter"), - role: "row" - }, _ctx.ptm("rowGroupFooter")), [createBaseVNode("td", mergeProps({ - colspan: $options.columnsLength - 1 - }, _objectSpread$8(_objectSpread$8({}, $options.getColumnPT("bodycell")), _ctx.ptm("rowGroupFooterCell"))), [(openBlock(), createBlock(resolveDynamicComponent($props.templates["groupfooter"]), { - data: $props.rowData, - index: $options.rowIndex - }, null, 8, ["data", "index"]))], 16, _hoisted_5)], 16)) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock("tr", mergeProps({ - key: 1, - "class": _ctx.cx("emptyMessage"), - role: "row" - }, _ctx.ptm("emptyMessage")), [createBaseVNode("td", mergeProps({ - colspan: $options.columnsLength - }, _objectSpread$8(_objectSpread$8({}, $options.getColumnPT("bodycell")), _ctx.ptm("emptyMessageCell"))), [$props.templates.empty ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.empty), { - key: 0 - })) : createCommentVNode("", true)], 16, _hoisted_6)], 16)); -} -__name(render$8, "render$8"); -script$8.render = render$8; -var script$7 = { - name: "TableBody", - hostName: "DataTable", - "extends": script$s, - emits: ["rowgroup-toggle", "row-click", "row-dblclick", "row-rightclick", "row-touchend", "row-keydown", "row-mousedown", "row-dragstart", "row-dragover", "row-dragleave", "row-dragend", "row-drop", "row-toggle", "radio-change", "checkbox-change", "cell-edit-init", "cell-edit-complete", "cell-edit-cancel", "row-edit-init", "row-edit-save", "row-edit-cancel", "editing-meta-change"], - props: { - value: { - type: Array, - "default": null - }, - columns: { - type: null, - "default": null - }, - frozenRow: { - type: Boolean, - "default": false - }, - empty: { - type: Boolean, - "default": false - }, - rowGroupMode: { - type: String, - "default": null - }, - groupRowsBy: { - type: [Array, String, Function], - "default": null - }, - expandableRowGroups: { - type: Boolean, - "default": false - }, - expandedRowGroups: { - type: Array, - "default": null - }, - first: { - type: Number, - "default": 0 - }, - dataKey: { - type: [String, Function], - "default": null - }, - expandedRowIcon: { - type: String, - "default": null - }, - collapsedRowIcon: { - type: String, - "default": null - }, - expandedRows: { - type: [Array, Object], - "default": null - }, - selection: { - type: [Array, Object], - "default": null - }, - selectionKeys: { - type: null, - "default": null - }, - selectionMode: { - type: String, - "default": null - }, - contextMenu: { - type: Boolean, - "default": false - }, - contextMenuSelection: { - type: Object, - "default": null - }, - rowClass: { - type: null, - "default": null - }, - rowStyle: { - type: null, - "default": null - }, - editMode: { - type: String, - "default": null - }, - compareSelectionBy: { - type: String, - "default": "deepEquals" - }, - editingRows: { - type: Array, - "default": null - }, - editingRowKeys: { - type: null, - "default": null - }, - editingMeta: { - type: Object, - "default": null - }, - templates: { - type: null, - "default": null - }, - scrollable: { - type: Boolean, - "default": false - }, - editButtonProps: { - type: Object, - "default": null - }, - virtualScrollerContentProps: { - type: Object, - "default": null - }, - isVirtualScrollerDisabled: { - type: Boolean, - "default": false - } - }, - data: /* @__PURE__ */ __name(function data5() { - return { - rowGroupHeaderStyleObject: {} - }; - }, "data"), - mounted: /* @__PURE__ */ __name(function mounted4() { - if (this.frozenRow) { - this.updateFrozenRowStickyPosition(); - } - if (this.scrollable && this.rowGroupMode === "subheader") { - this.updateFrozenRowGroupHeaderStickyPosition(); - } - }, "mounted"), - updated: /* @__PURE__ */ __name(function updated2() { - if (this.frozenRow) { - this.updateFrozenRowStickyPosition(); - } - if (this.scrollable && this.rowGroupMode === "subheader") { - this.updateFrozenRowGroupHeaderStickyPosition(); - } - }, "updated"), - methods: { - getRowKey: /* @__PURE__ */ __name(function getRowKey(rowData, rowIndex2) { - return this.dataKey ? resolveFieldData(rowData, this.dataKey) : rowIndex2; - }, "getRowKey"), - updateFrozenRowStickyPosition: /* @__PURE__ */ __name(function updateFrozenRowStickyPosition() { - this.$el.style.top = getOuterHeight(this.$el.previousElementSibling) + "px"; - }, "updateFrozenRowStickyPosition"), - updateFrozenRowGroupHeaderStickyPosition: /* @__PURE__ */ __name(function updateFrozenRowGroupHeaderStickyPosition() { - var tableHeaderHeight = getOuterHeight(this.$el.previousElementSibling); - this.rowGroupHeaderStyleObject.top = tableHeaderHeight + "px"; - }, "updateFrozenRowGroupHeaderStickyPosition"), - getVirtualScrollerProp: /* @__PURE__ */ __name(function getVirtualScrollerProp3(option, options) { - options = options || this.virtualScrollerContentProps; - return options ? options[option] : null; - }, "getVirtualScrollerProp"), - bodyRef: /* @__PURE__ */ __name(function bodyRef(el) { - var contentRef = this.getVirtualScrollerProp("contentRef"); - contentRef && contentRef(el); - }, "bodyRef") - }, - computed: { - rowGroupHeaderStyle: /* @__PURE__ */ __name(function rowGroupHeaderStyle() { - if (this.scrollable) { - return { - top: this.rowGroupHeaderStyleObject.top - }; - } - return null; - }, "rowGroupHeaderStyle"), - bodyContentStyle: /* @__PURE__ */ __name(function bodyContentStyle() { - return this.getVirtualScrollerProp("contentStyle"); - }, "bodyContentStyle"), - ptmTBodyOptions: /* @__PURE__ */ __name(function ptmTBodyOptions() { - var _this$$parentInstance; - return { - context: { - scrollable: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.scrollable - } - }; - }, "ptmTBodyOptions"), - expandedRowId: /* @__PURE__ */ __name(function expandedRowId() { - return UniqueComponentId(); - }, "expandedRowId"), - nameAttributeSelector: /* @__PURE__ */ __name(function nameAttributeSelector() { - return UniqueComponentId(); - }, "nameAttributeSelector") - }, - components: { - DTBodyRow: script$8 - } -}; -function render$7(_ctx, _cache, $props, $setup, $data, $options) { - var _component_DTBodyRow = resolveComponent("DTBodyRow"); - return openBlock(), createElementBlock("tbody", mergeProps({ - ref: $options.bodyRef, - "class": _ctx.cx("tbody"), - role: "rowgroup", - style: $options.bodyContentStyle - }, _ctx.ptm("tbody", $options.ptmTBodyOptions)), [!$props.empty ? (openBlock(true), createElementBlock(Fragment, { - key: 0 - }, renderList($props.value, function(rowData, rowIndex2) { - return openBlock(), createBlock(_component_DTBodyRow, { - key: $options.getRowKey(rowData, rowIndex2), - rowData, - index: rowIndex2, - value: $props.value, - columns: $props.columns, - frozenRow: $props.frozenRow, - empty: $props.empty, - first: $props.first, - dataKey: $props.dataKey, - selection: $props.selection, - selectionKeys: $props.selectionKeys, - selectionMode: $props.selectionMode, - contextMenu: $props.contextMenu, - contextMenuSelection: $props.contextMenuSelection, - rowGroupMode: $props.rowGroupMode, - groupRowsBy: $props.groupRowsBy, - expandableRowGroups: $props.expandableRowGroups, - rowClass: $props.rowClass, - rowStyle: $props.rowStyle, - editMode: $props.editMode, - compareSelectionBy: $props.compareSelectionBy, - scrollable: $props.scrollable, - expandedRowIcon: $props.expandedRowIcon, - collapsedRowIcon: $props.collapsedRowIcon, - expandedRows: $props.expandedRows, - expandedRowGroups: $props.expandedRowGroups, - editingRows: $props.editingRows, - editingRowKeys: $props.editingRowKeys, - templates: $props.templates, - editButtonProps: $props.editButtonProps, - virtualScrollerContentProps: $props.virtualScrollerContentProps, - isVirtualScrollerDisabled: $props.isVirtualScrollerDisabled, - editingMeta: $props.editingMeta, - rowGroupHeaderStyle: $options.rowGroupHeaderStyle, - expandedRowId: $options.expandedRowId, - nameAttributeSelector: $options.nameAttributeSelector, - onRowgroupToggle: _cache[0] || (_cache[0] = function($event) { - return _ctx.$emit("rowgroup-toggle", $event); - }), - onRowClick: _cache[1] || (_cache[1] = function($event) { - return _ctx.$emit("row-click", $event); - }), - onRowDblclick: _cache[2] || (_cache[2] = function($event) { - return _ctx.$emit("row-dblclick", $event); - }), - onRowRightclick: _cache[3] || (_cache[3] = function($event) { - return _ctx.$emit("row-rightclick", $event); - }), - onRowTouchend: _cache[4] || (_cache[4] = function($event) { - return _ctx.$emit("row-touchend", $event); - }), - onRowKeydown: _cache[5] || (_cache[5] = function($event) { - return _ctx.$emit("row-keydown", $event); - }), - onRowMousedown: _cache[6] || (_cache[6] = function($event) { - return _ctx.$emit("row-mousedown", $event); - }), - onRowDragstart: _cache[7] || (_cache[7] = function($event) { - return _ctx.$emit("row-dragstart", $event); - }), - onRowDragover: _cache[8] || (_cache[8] = function($event) { - return _ctx.$emit("row-dragover", $event); - }), - onRowDragleave: _cache[9] || (_cache[9] = function($event) { - return _ctx.$emit("row-dragleave", $event); - }), - onRowDragend: _cache[10] || (_cache[10] = function($event) { - return _ctx.$emit("row-dragend", $event); - }), - onRowDrop: _cache[11] || (_cache[11] = function($event) { - return _ctx.$emit("row-drop", $event); - }), - onRowToggle: _cache[12] || (_cache[12] = function($event) { - return _ctx.$emit("row-toggle", $event); - }), - onRadioChange: _cache[13] || (_cache[13] = function($event) { - return _ctx.$emit("radio-change", $event); - }), - onCheckboxChange: _cache[14] || (_cache[14] = function($event) { - return _ctx.$emit("checkbox-change", $event); - }), - onCellEditInit: _cache[15] || (_cache[15] = function($event) { - return _ctx.$emit("cell-edit-init", $event); - }), - onCellEditComplete: _cache[16] || (_cache[16] = function($event) { - return _ctx.$emit("cell-edit-complete", $event); - }), - onCellEditCancel: _cache[17] || (_cache[17] = function($event) { - return _ctx.$emit("cell-edit-cancel", $event); - }), - onRowEditInit: _cache[18] || (_cache[18] = function($event) { - return _ctx.$emit("row-edit-init", $event); - }), - onRowEditSave: _cache[19] || (_cache[19] = function($event) { - return _ctx.$emit("row-edit-save", $event); - }), - onRowEditCancel: _cache[20] || (_cache[20] = function($event) { - return _ctx.$emit("row-edit-cancel", $event); - }), - onEditingMetaChange: _cache[21] || (_cache[21] = function($event) { - return _ctx.$emit("editing-meta-change", $event); - }), - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["rowData", "index", "value", "columns", "frozenRow", "empty", "first", "dataKey", "selection", "selectionKeys", "selectionMode", "contextMenu", "contextMenuSelection", "rowGroupMode", "groupRowsBy", "expandableRowGroups", "rowClass", "rowStyle", "editMode", "compareSelectionBy", "scrollable", "expandedRowIcon", "collapsedRowIcon", "expandedRows", "expandedRowGroups", "editingRows", "editingRowKeys", "templates", "editButtonProps", "virtualScrollerContentProps", "isVirtualScrollerDisabled", "editingMeta", "rowGroupHeaderStyle", "expandedRowId", "nameAttributeSelector", "unstyled", "pt"]); - }), 128)) : (openBlock(), createBlock(_component_DTBodyRow, { - key: 1, - empty: $props.empty, - columns: $props.columns, - templates: $props.templates, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["empty", "columns", "templates", "unstyled", "pt"]))], 16); -} -__name(render$7, "render$7"); -script$7.render = render$7; -var script$6 = { - name: "FooterCell", - hostName: "DataTable", - "extends": script$s, - props: { - column: { - type: Object, - "default": null - }, - index: { - type: Number, - "default": null - } - }, - data: /* @__PURE__ */ __name(function data6() { - return { - styleObject: {} - }; - }, "data"), - mounted: /* @__PURE__ */ __name(function mounted5() { - if (this.columnProp("frozen")) { - this.updateStickyPosition(); - } - }, "mounted"), - updated: /* @__PURE__ */ __name(function updated3() { - if (this.columnProp("frozen")) { - this.updateStickyPosition(); - } - }, "updated"), - methods: { - columnProp: /* @__PURE__ */ __name(function columnProp3(prop) { - return getVNodeProp(this.column, prop); - }, "columnProp"), - getColumnPT: /* @__PURE__ */ __name(function getColumnPT5(key) { - var _this$$parentInstance, _this$$parentInstance2; - var columnMetaData = { - props: this.column.props, - parent: { - instance: this, - props: this.$props, - state: this.$data - }, - context: { - index: this.index, - size: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.size, - showGridlines: ((_this$$parentInstance2 = this.$parentInstance) === null || _this$$parentInstance2 === void 0 || (_this$$parentInstance2 = _this$$parentInstance2.$parentInstance) === null || _this$$parentInstance2 === void 0 ? void 0 : _this$$parentInstance2.showGridlines) || false - } - }; - return mergeProps(this.ptm("column.".concat(key), { - column: columnMetaData - }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); - }, "getColumnPT"), - getColumnProp: /* @__PURE__ */ __name(function getColumnProp4() { - return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; - }, "getColumnProp"), - updateStickyPosition: /* @__PURE__ */ __name(function updateStickyPosition2() { - if (this.columnProp("frozen")) { - var align = this.columnProp("alignFrozen"); - if (align === "right") { - var pos = 0; - var next2 = getNextElementSibling(this.$el, '[data-p-frozen-column="true"]'); - if (next2) { - pos = getOuterWidth(next2) + parseFloat(next2.style.right || 0); - } - this.styleObject.insetInlineEnd = pos + "px"; - } else { - var _pos = 0; - var prev2 = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]'); - if (prev2) { - _pos = getOuterWidth(prev2) + parseFloat(prev2.style.left || 0); - } - this.styleObject.insetInlineStart = _pos + "px"; - } - } - }, "updateStickyPosition") - }, - computed: { - containerClass: /* @__PURE__ */ __name(function containerClass2() { - return [this.columnProp("footerClass"), this.columnProp("class"), this.cx("footerCell")]; - }, "containerClass"), - containerStyle: /* @__PURE__ */ __name(function containerStyle2() { - var bodyStyle = this.columnProp("footerStyle"); - var columnStyle = this.columnProp("style"); - return this.columnProp("frozen") ? [columnStyle, bodyStyle, this.styleObject] : [columnStyle, bodyStyle]; - }, "containerStyle") - } -}; -function _typeof$7(o) { - "@babel/helpers - typeof"; - return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$7(o); -} -__name(_typeof$7, "_typeof$7"); -function ownKeys$7(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys$7, "ownKeys$7"); -function _objectSpread$7(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys$7(Object(t), true).forEach(function(r2) { - _defineProperty$7(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread$7, "_objectSpread$7"); -function _defineProperty$7(e, r, t) { - return (r = _toPropertyKey$7(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$7, "_defineProperty$7"); -function _toPropertyKey$7(t) { - var i = _toPrimitive$7(t, "string"); - return "symbol" == _typeof$7(i) ? i : i + ""; -} -__name(_toPropertyKey$7, "_toPropertyKey$7"); -function _toPrimitive$7(t, r) { - if ("object" != _typeof$7(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$7(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$7, "_toPrimitive$7"); -var _hoisted_1$2 = ["colspan", "rowspan", "data-p-frozen-column"]; -function render$6(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("td", mergeProps({ - style: $options.containerStyle, - "class": $options.containerClass, - role: "cell", - colspan: $options.columnProp("colspan"), - rowspan: $options.columnProp("rowspan") - }, _objectSpread$7(_objectSpread$7({}, $options.getColumnPT("root")), $options.getColumnPT("footerCell")), { - "data-p-frozen-column": $options.columnProp("frozen") - }), [$props.column.children && $props.column.children.footer ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.footer), { - key: 0, - column: $props.column - }, null, 8, ["column"])) : createCommentVNode("", true), $options.columnProp("footer") ? (openBlock(), createElementBlock("span", mergeProps({ - key: 1, - "class": _ctx.cx("columnFooter") - }, $options.getColumnPT("columnFooter")), toDisplayString($options.columnProp("footer")), 17)) : createCommentVNode("", true)], 16, _hoisted_1$2); -} -__name(render$6, "render$6"); -script$6.render = render$6; -function _createForOfIteratorHelper$1(r, e) { - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; - if (!t) { - if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e) { - t && (r = t); - var _n = 0, F = /* @__PURE__ */ __name(function F2() { - }, "F"); - return { s: F, n: /* @__PURE__ */ __name(function n() { - return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; - }, "n"), e: /* @__PURE__ */ __name(function e2(r2) { - throw r2; - }, "e"), f: F }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - var o, a = true, u = false; - return { s: /* @__PURE__ */ __name(function s() { - t = t.call(r); - }, "s"), n: /* @__PURE__ */ __name(function n() { - var r2 = t.next(); - return a = r2.done, r2; - }, "n"), e: /* @__PURE__ */ __name(function e2(r2) { - u = true, o = r2; - }, "e"), f: /* @__PURE__ */ __name(function f() { - try { - a || null == t["return"] || t["return"](); - } finally { - if (u) throw o; - } - }, "f") }; -} -__name(_createForOfIteratorHelper$1, "_createForOfIteratorHelper$1"); -function _unsupportedIterableToArray$1(r, a) { - if (r) { - if ("string" == typeof r) return _arrayLikeToArray$1(r, a); - var t = {}.toString.call(r).slice(8, -1); - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; - } -} -__name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray$1"); -function _arrayLikeToArray$1(r, a) { - (null == a || a > r.length) && (a = r.length); - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; - return n; -} -__name(_arrayLikeToArray$1, "_arrayLikeToArray$1"); -var script$5 = { - name: "TableFooter", - hostName: "DataTable", - "extends": script$s, - props: { - columnGroup: { - type: null, - "default": null - }, - columns: { - type: Object, - "default": null - } - }, - provide: /* @__PURE__ */ __name(function provide5() { - return { - $rows: this.d_footerRows, - $columns: this.d_footerColumns - }; - }, "provide"), - data: /* @__PURE__ */ __name(function data7() { - return { - d_footerRows: new _default({ - type: "Row" - }), - d_footerColumns: new _default({ - type: "Column" - }) - }; - }, "data"), - beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount2() { - this.d_footerRows.clear(); - this.d_footerColumns.clear(); - }, "beforeUnmount"), - methods: { - columnProp: /* @__PURE__ */ __name(function columnProp4(col, prop) { - return getVNodeProp(col, prop); - }, "columnProp"), - getColumnGroupPT: /* @__PURE__ */ __name(function getColumnGroupPT(key) { - var columnGroupMetaData = { - props: this.getColumnGroupProps(), - parent: { - instance: this, - props: this.$props, - state: this.$data - }, - context: { - type: "footer", - scrollable: this.ptmTFootOptions.context.scrollable - } - }; - return mergeProps(this.ptm("columnGroup.".concat(key), { - columnGroup: columnGroupMetaData - }), this.ptm("columnGroup.".concat(key), columnGroupMetaData), this.ptmo(this.getColumnGroupProps(), key, columnGroupMetaData)); - }, "getColumnGroupPT"), - getColumnGroupProps: /* @__PURE__ */ __name(function getColumnGroupProps() { - return this.columnGroup && this.columnGroup.props && this.columnGroup.props.pt ? this.columnGroup.props.pt : void 0; - }, "getColumnGroupProps"), - getRowPT: /* @__PURE__ */ __name(function getRowPT(row2, key, index) { - var rowMetaData = { - props: row2.props, - parent: { - instance: this, - props: this.$props, - state: this.$data - }, - context: { - index - } - }; - return mergeProps(this.ptm("row.".concat(key), { - row: rowMetaData - }), this.ptm("row.".concat(key), rowMetaData), this.ptmo(this.getRowProp(row2), key, rowMetaData)); - }, "getRowPT"), - getRowProp: /* @__PURE__ */ __name(function getRowProp(row2) { - return row2.props && row2.props.pt ? row2.props.pt : void 0; - }, "getRowProp"), - getFooterRows: /* @__PURE__ */ __name(function getFooterRows() { - var _this$d_footerRows; - return (_this$d_footerRows = this.d_footerRows) === null || _this$d_footerRows === void 0 ? void 0 : _this$d_footerRows.get(this.columnGroup, this.columnGroup.children); - }, "getFooterRows"), - getFooterColumns: /* @__PURE__ */ __name(function getFooterColumns(row2) { - var _this$d_footerColumns; - return (_this$d_footerColumns = this.d_footerColumns) === null || _this$d_footerColumns === void 0 ? void 0 : _this$d_footerColumns.get(row2, row2.children); - }, "getFooterColumns") - }, - computed: { - hasFooter: /* @__PURE__ */ __name(function hasFooter() { - var hasFooter2 = false; - if (this.columnGroup) { - hasFooter2 = true; - } else if (this.columns) { - var _iterator = _createForOfIteratorHelper$1(this.columns), _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done; ) { - var col = _step.value; - if (this.columnProp(col, "footer") || col.children && col.children.footer) { - hasFooter2 = true; - break; - } - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - } - return hasFooter2; - }, "hasFooter"), - ptmTFootOptions: /* @__PURE__ */ __name(function ptmTFootOptions() { - var _this$$parentInstance; - return { - context: { - scrollable: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.scrollable - } - }; - }, "ptmTFootOptions") - }, - components: { - DTFooterCell: script$6 - } -}; -function _typeof$6(o) { - "@babel/helpers - typeof"; - return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$6(o); -} -__name(_typeof$6, "_typeof$6"); -function ownKeys$6(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys$6, "ownKeys$6"); -function _objectSpread$6(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys$6(Object(t), true).forEach(function(r2) { - _defineProperty$6(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread$6, "_objectSpread$6"); -function _defineProperty$6(e, r, t) { - return (r = _toPropertyKey$6(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$6, "_defineProperty$6"); -function _toPropertyKey$6(t) { - var i = _toPrimitive$6(t, "string"); - return "symbol" == _typeof$6(i) ? i : i + ""; -} -__name(_toPropertyKey$6, "_toPropertyKey$6"); -function _toPrimitive$6(t, r) { - if ("object" != _typeof$6(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$6(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$6, "_toPrimitive$6"); -function render$5(_ctx, _cache, $props, $setup, $data, $options) { - var _component_DTFooterCell = resolveComponent("DTFooterCell"); - return $options.hasFooter ? (openBlock(), createElementBlock("tfoot", mergeProps({ - key: 0, - "class": _ctx.cx("tfoot"), - style: _ctx.sx("tfoot"), - role: "rowgroup" - }, $props.columnGroup ? _objectSpread$6(_objectSpread$6({}, _ctx.ptm("tfoot", $options.ptmTFootOptions)), $options.getColumnGroupPT("root")) : _ctx.ptm("tfoot", $options.ptmTFootOptions), { - "data-pc-section": "tfoot" - }), [!$props.columnGroup ? (openBlock(), createElementBlock("tr", mergeProps({ - key: 0, - role: "row" - }, _ctx.ptm("footerRow")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function(col, i) { - return openBlock(), createElementBlock(Fragment, { - key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || i - }, [!$options.columnProp(col, "hidden") ? (openBlock(), createBlock(_component_DTFooterCell, { - key: 0, - column: col, - pt: _ctx.pt - }, null, 8, ["column", "pt"])) : createCommentVNode("", true)], 64); - }), 128))], 16)) : (openBlock(true), createElementBlock(Fragment, { - key: 1 - }, renderList($options.getFooterRows(), function(row2, i) { - return openBlock(), createElementBlock("tr", mergeProps({ - key: i, - role: "row", - ref_for: true - }, _objectSpread$6(_objectSpread$6({}, _ctx.ptm("footerRow")), $options.getRowPT(row2, "root", i))), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.getFooterColumns(row2), function(col, j) { - return openBlock(), createElementBlock(Fragment, { - key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || j - }, [!$options.columnProp(col, "hidden") ? (openBlock(), createBlock(_component_DTFooterCell, { - key: 0, - column: col, - index: i, - pt: _ctx.pt - }, null, 8, ["column", "index", "pt"])) : createCommentVNode("", true)], 64); - }), 128))], 16); - }), 128))], 16)) : createCommentVNode("", true); -} -__name(render$5, "render$5"); -script$5.render = render$5; -function _typeof$5(o) { - "@babel/helpers - typeof"; - return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$5(o); -} -__name(_typeof$5, "_typeof$5"); -function ownKeys$5(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys$5, "ownKeys$5"); -function _objectSpread$5(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys$5(Object(t), true).forEach(function(r2) { - _defineProperty$5(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread$5, "_objectSpread$5"); -function _defineProperty$5(e, r, t) { - return (r = _toPropertyKey$5(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$5, "_defineProperty$5"); -function _toPropertyKey$5(t) { - var i = _toPrimitive$5(t, "string"); - return "symbol" == _typeof$5(i) ? i : i + ""; -} -__name(_toPropertyKey$5, "_toPropertyKey$5"); -function _toPrimitive$5(t, r) { - if ("object" != _typeof$5(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$5(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$5, "_toPrimitive$5"); -var script$4 = { - name: "ColumnFilter", - hostName: "DataTable", - "extends": script$s, - emits: ["filter-change", "filter-apply", "operator-change", "matchmode-change", "constraint-add", "constraint-remove", "filter-clear", "apply-click"], - props: { - field: { - type: String, - "default": null - }, - type: { - type: String, - "default": "text" - }, - display: { - type: String, - "default": null - }, - showMenu: { - type: Boolean, - "default": true - }, - matchMode: { - type: String, - "default": null - }, - showOperator: { - type: Boolean, - "default": true - }, - showClearButton: { - type: Boolean, - "default": true - }, - showApplyButton: { - type: Boolean, - "default": true - }, - showMatchModes: { - type: Boolean, - "default": true - }, - showAddButton: { - type: Boolean, - "default": true - }, - matchModeOptions: { - type: Array, - "default": null - }, - maxConstraints: { - type: Number, - "default": 2 - }, - filterElement: { - type: Function, - "default": null - }, - filterHeaderTemplate: { - type: Function, - "default": null - }, - filterFooterTemplate: { - type: Function, - "default": null - }, - filterClearTemplate: { - type: Function, - "default": null - }, - filterApplyTemplate: { - type: Function, - "default": null - }, - filterIconTemplate: { - type: Function, - "default": null - }, - filterAddIconTemplate: { - type: Function, - "default": null - }, - filterRemoveIconTemplate: { - type: Function, - "default": null - }, - filterClearIconTemplate: { - type: Function, - "default": null - }, - filters: { - type: Object, - "default": null - }, - filtersStore: { - type: Object, - "default": null - }, - filterMenuClass: { - type: String, - "default": null - }, - filterMenuStyle: { - type: null, - "default": null - }, - filterInputProps: { - type: null, - "default": null - }, - filterButtonProps: { - type: null, - "default": null - }, - column: null - }, - data: /* @__PURE__ */ __name(function data8() { - return { - id: this.$attrs.id, - overlayVisible: false, - defaultMatchMode: null, - defaultOperator: null - }; - }, "data"), - watch: { - "$attrs.id": /* @__PURE__ */ __name(function $attrsId(newValue) { - this.id = newValue || UniqueComponentId(); - }, "$attrsId") - }, - overlay: null, - selfClick: false, - overlayEventListener: null, - beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount3() { - if (this.overlayEventListener) { - OverlayEventBus.off("overlay-click", this.overlayEventListener); - this.overlayEventListener = null; - } - if (this.overlay) { - ZIndex.clear(this.overlay); - this.onOverlayHide(); - } - }, "beforeUnmount"), - mounted: /* @__PURE__ */ __name(function mounted6() { - this.id = this.id || UniqueComponentId(); - if (this.filters && this.filters[this.field]) { - var fieldFilters = this.filters[this.field]; - if (fieldFilters.operator) { - this.defaultMatchMode = fieldFilters.constraints[0].matchMode; - this.defaultOperator = fieldFilters.operator; - } else { - this.defaultMatchMode = this.filters[this.field].matchMode; - } - } - }, "mounted"), - methods: { - getColumnPT: /* @__PURE__ */ __name(function getColumnPT6(key, params) { - var columnMetaData = _objectSpread$5({ - props: this.column.props, - parent: { - instance: this, - props: this.$props, - state: this.$data - } - }, params); - return mergeProps(this.ptm("column.".concat(key), { - column: columnMetaData - }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); - }, "getColumnPT"), - getColumnProp: /* @__PURE__ */ __name(function getColumnProp5() { - return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; - }, "getColumnProp"), - ptmFilterConstraintOptions: /* @__PURE__ */ __name(function ptmFilterConstraintOptions(matchMode) { - return { - context: { - highlighted: matchMode && this.isRowMatchModeSelected(matchMode.value) - } - }; - }, "ptmFilterConstraintOptions"), - clearFilter: /* @__PURE__ */ __name(function clearFilter() { - var _filters = _objectSpread$5({}, this.filters); - if (_filters[this.field].operator) { - _filters[this.field].constraints.splice(1); - _filters[this.field].operator = this.defaultOperator; - _filters[this.field].constraints[0] = { - value: null, - matchMode: this.defaultMatchMode - }; - } else { - _filters[this.field].value = null; - _filters[this.field].matchMode = this.defaultMatchMode; - } - this.$emit("filter-clear"); - this.$emit("filter-change", _filters); - this.$emit("filter-apply"); - this.hide(); - }, "clearFilter"), - applyFilter: /* @__PURE__ */ __name(function applyFilter() { - this.$emit("apply-click", { - field: this.field, - constraints: this.filters[this.field] - }); - this.$emit("filter-apply"); - this.hide(); - }, "applyFilter"), - hasFilter: /* @__PURE__ */ __name(function hasFilter() { - if (this.filtersStore) { - var fieldFilter = this.filtersStore[this.field]; - if (fieldFilter) { - if (fieldFilter.operator) return !this.isFilterBlank(fieldFilter.constraints[0].value); - else return !this.isFilterBlank(fieldFilter.value); - } - } - return false; - }, "hasFilter"), - hasRowFilter: /* @__PURE__ */ __name(function hasRowFilter() { - return this.filters[this.field] && !this.isFilterBlank(this.filters[this.field].value); - }, "hasRowFilter"), - isFilterBlank: /* @__PURE__ */ __name(function isFilterBlank(filter3) { - if (filter3 !== null && filter3 !== void 0) { - if (typeof filter3 === "string" && filter3.trim().length == 0 || filter3 instanceof Array && filter3.length == 0) return true; - else return false; - } - return true; - }, "isFilterBlank"), - toggleMenu: /* @__PURE__ */ __name(function toggleMenu(event2) { - this.overlayVisible = !this.overlayVisible; - event2.preventDefault(); - }, "toggleMenu"), - onToggleButtonKeyDown: /* @__PURE__ */ __name(function onToggleButtonKeyDown(event2) { - switch (event2.code) { - case "Enter": - case "NumpadEnter": - case "Space": - this.toggleMenu(event2); - break; - case "Escape": - this.overlayVisible = false; - break; - } - }, "onToggleButtonKeyDown"), - onRowMatchModeChange: /* @__PURE__ */ __name(function onRowMatchModeChange(matchMode) { - var _filters = _objectSpread$5({}, this.filters); - _filters[this.field].matchMode = matchMode; - this.$emit("matchmode-change", { - field: this.field, - matchMode - }); - this.$emit("filter-change", _filters); - this.$emit("filter-apply"); - this.hide(); - }, "onRowMatchModeChange"), - onRowMatchModeKeyDown: /* @__PURE__ */ __name(function onRowMatchModeKeyDown(event2) { - var item = event2.target; - switch (event2.code) { - case "ArrowDown": - var nextItem = this.findNextItem(item); - if (nextItem) { - item.removeAttribute("tabindex"); - nextItem.tabIndex = "0"; - nextItem.focus(); - } - event2.preventDefault(); - break; - case "ArrowUp": - var prevItem = this.findPrevItem(item); - if (prevItem) { - item.removeAttribute("tabindex"); - prevItem.tabIndex = "0"; - prevItem.focus(); - } - event2.preventDefault(); - break; - } - }, "onRowMatchModeKeyDown"), - isRowMatchModeSelected: /* @__PURE__ */ __name(function isRowMatchModeSelected(matchMode) { - return this.filters[this.field].matchMode === matchMode; - }, "isRowMatchModeSelected"), - onOperatorChange: /* @__PURE__ */ __name(function onOperatorChange(value) { - var _filters = _objectSpread$5({}, this.filters); - _filters[this.field].operator = value; - this.$emit("filter-change", _filters); - this.$emit("operator-change", { - field: this.field, - operator: value - }); - if (!this.showApplyButton) { - this.$emit("filter-apply"); - } - }, "onOperatorChange"), - onMenuMatchModeChange: /* @__PURE__ */ __name(function onMenuMatchModeChange(value, index) { - var _filters = _objectSpread$5({}, this.filters); - _filters[this.field].constraints[index].matchMode = value; - this.$emit("matchmode-change", { - field: this.field, - matchMode: value, - index - }); - if (!this.showApplyButton) { - this.$emit("filter-apply"); - } - }, "onMenuMatchModeChange"), - addConstraint: /* @__PURE__ */ __name(function addConstraint() { - var _filters = _objectSpread$5({}, this.filters); - var newConstraint = { - value: null, - matchMode: this.defaultMatchMode - }; - _filters[this.field].constraints.push(newConstraint); - this.$emit("constraint-add", { - field: this.field, - constraing: newConstraint - }); - this.$emit("filter-change", _filters); - if (!this.showApplyButton) { - this.$emit("filter-apply"); - } - }, "addConstraint"), - removeConstraint: /* @__PURE__ */ __name(function removeConstraint(index) { - var _filters = _objectSpread$5({}, this.filters); - var removedConstraint = _filters[this.field].constraints.splice(index, 1); - this.$emit("constraint-remove", { - field: this.field, - constraing: removedConstraint - }); - this.$emit("filter-change", _filters); - if (!this.showApplyButton) { - this.$emit("filter-apply"); - } - }, "removeConstraint"), - filterCallback: /* @__PURE__ */ __name(function filterCallback() { - this.$emit("filter-apply"); - }, "filterCallback"), - findNextItem: /* @__PURE__ */ __name(function findNextItem(item) { - var nextItem = item.nextElementSibling; - if (nextItem) return getAttribute(nextItem, "data-pc-section") === "filterconstraintseparator" ? this.findNextItem(nextItem) : nextItem; - else return item.parentElement.firstElementChild; - }, "findNextItem"), - findPrevItem: /* @__PURE__ */ __name(function findPrevItem(item) { - var prevItem = item.previousElementSibling; - if (prevItem) return getAttribute(prevItem, "data-pc-section") === "filterconstraintseparator" ? this.findPrevItem(prevItem) : prevItem; - else return item.parentElement.lastElementChild; - }, "findPrevItem"), - hide: /* @__PURE__ */ __name(function hide() { - this.overlayVisible = false; - this.showMenuButton && focus(this.$refs.icon.$el); - }, "hide"), - onContentClick: /* @__PURE__ */ __name(function onContentClick(event2) { - this.selfClick = true; - OverlayEventBus.emit("overlay-click", { - originalEvent: event2, - target: this.overlay - }); - }, "onContentClick"), - onContentMouseDown: /* @__PURE__ */ __name(function onContentMouseDown() { - this.selfClick = true; - }, "onContentMouseDown"), - onOverlayEnter: /* @__PURE__ */ __name(function onOverlayEnter(el) { - var _this = this; - if (this.filterMenuStyle) { - addStyle(this.overlay, this.filterMenuStyle); - } - ZIndex.set("overlay", el, this.$primevue.config.zIndex.overlay); - addStyle(el, { - position: "absolute", - top: "0", - left: "0" - }); - absolutePosition(this.overlay, this.$refs.icon.$el); - this.bindOutsideClickListener(); - this.bindScrollListener(); - this.bindResizeListener(); - this.overlayEventListener = function(e) { - if (!_this.isOutsideClicked(e.target)) { - _this.selfClick = true; - } - }; - OverlayEventBus.on("overlay-click", this.overlayEventListener); - }, "onOverlayEnter"), - onOverlayAfterEnter: /* @__PURE__ */ __name(function onOverlayAfterEnter() { - var _this$overlay; - (_this$overlay = this.overlay) === null || _this$overlay === void 0 || (_this$overlay = _this$overlay.$focustrap) === null || _this$overlay === void 0 || _this$overlay.autoFocus(); - }, "onOverlayAfterEnter"), - onOverlayLeave: /* @__PURE__ */ __name(function onOverlayLeave() { - this.onOverlayHide(); - }, "onOverlayLeave"), - onOverlayAfterLeave: /* @__PURE__ */ __name(function onOverlayAfterLeave(el) { - ZIndex.clear(el); - }, "onOverlayAfterLeave"), - onOverlayHide: /* @__PURE__ */ __name(function onOverlayHide() { - this.unbindOutsideClickListener(); - this.unbindResizeListener(); - this.unbindScrollListener(); - this.overlay = null; - OverlayEventBus.off("overlay-click", this.overlayEventListener); - this.overlayEventListener = null; - }, "onOverlayHide"), - overlayRef: /* @__PURE__ */ __name(function overlayRef(el) { - this.overlay = el; - }, "overlayRef"), - isOutsideClicked: /* @__PURE__ */ __name(function isOutsideClicked(target) { - return !this.isTargetClicked(target) && this.overlay && !(this.overlay.isSameNode(target) || this.overlay.contains(target)); - }, "isOutsideClicked"), - isTargetClicked: /* @__PURE__ */ __name(function isTargetClicked(target) { - return this.$refs.icon && (this.$refs.icon.$el.isSameNode(target) || this.$refs.icon.$el.contains(target)); - }, "isTargetClicked"), - bindOutsideClickListener: /* @__PURE__ */ __name(function bindOutsideClickListener() { - var _this2 = this; - if (!this.outsideClickListener) { - this.outsideClickListener = function(event2) { - if (_this2.overlayVisible && !_this2.selfClick && _this2.isOutsideClicked(event2.target)) { - _this2.overlayVisible = false; - } - _this2.selfClick = false; - }; - document.addEventListener("click", this.outsideClickListener); - } - }, "bindOutsideClickListener"), - unbindOutsideClickListener: /* @__PURE__ */ __name(function unbindOutsideClickListener() { - if (this.outsideClickListener) { - document.removeEventListener("click", this.outsideClickListener); - this.outsideClickListener = null; - this.selfClick = false; - } - }, "unbindOutsideClickListener"), - bindScrollListener: /* @__PURE__ */ __name(function bindScrollListener() { - var _this3 = this; - if (!this.scrollHandler) { - this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.icon.$el, function() { - if (_this3.overlayVisible) { - _this3.hide(); - } - }); - } - this.scrollHandler.bindScrollListener(); - }, "bindScrollListener"), - unbindScrollListener: /* @__PURE__ */ __name(function unbindScrollListener() { - if (this.scrollHandler) { - this.scrollHandler.unbindScrollListener(); - } - }, "unbindScrollListener"), - bindResizeListener: /* @__PURE__ */ __name(function bindResizeListener() { - var _this4 = this; - if (!this.resizeListener) { - this.resizeListener = function() { - if (_this4.overlayVisible && !isTouchDevice()) { - _this4.hide(); - } - }; - window.addEventListener("resize", this.resizeListener); - } - }, "bindResizeListener"), - unbindResizeListener: /* @__PURE__ */ __name(function unbindResizeListener() { - if (this.resizeListener) { - window.removeEventListener("resize", this.resizeListener); - this.resizeListener = null; - } - }, "unbindResizeListener") - }, - computed: { - showMenuButton: /* @__PURE__ */ __name(function showMenuButton() { - return this.showMenu && (this.display === "row" ? this.type !== "boolean" : true); - }, "showMenuButton"), - overlayId: /* @__PURE__ */ __name(function overlayId() { - return this.id + "_overlay"; - }, "overlayId"), - matchModes: /* @__PURE__ */ __name(function matchModes() { - var _this5 = this; - return this.matchModeOptions || this.$primevue.config.filterMatchModeOptions[this.type].map(function(key) { - return { - label: _this5.$primevue.config.locale[key], - value: key - }; - }); - }, "matchModes"), - isShowMatchModes: /* @__PURE__ */ __name(function isShowMatchModes() { - return this.type !== "boolean" && this.showMatchModes && this.matchModes; - }, "isShowMatchModes"), - operatorOptions: /* @__PURE__ */ __name(function operatorOptions() { - return [{ - label: this.$primevue.config.locale.matchAll, - value: FilterOperator.AND - }, { - label: this.$primevue.config.locale.matchAny, - value: FilterOperator.OR - }]; - }, "operatorOptions"), - noFilterLabel: /* @__PURE__ */ __name(function noFilterLabel() { - return this.$primevue.config.locale ? this.$primevue.config.locale.noFilter : void 0; - }, "noFilterLabel"), - isShowOperator: /* @__PURE__ */ __name(function isShowOperator() { - return this.showOperator && this.filters[this.field].operator; - }, "isShowOperator"), - operator: /* @__PURE__ */ __name(function operator() { - return this.filters[this.field].operator; - }, "operator"), - fieldConstraints: /* @__PURE__ */ __name(function fieldConstraints() { - return this.filters[this.field].constraints || [this.filters[this.field]]; - }, "fieldConstraints"), - showRemoveIcon: /* @__PURE__ */ __name(function showRemoveIcon() { - return this.fieldConstraints.length > 1; - }, "showRemoveIcon"), - removeRuleButtonLabel: /* @__PURE__ */ __name(function removeRuleButtonLabel() { - return this.$primevue.config.locale ? this.$primevue.config.locale.removeRule : void 0; - }, "removeRuleButtonLabel"), - addRuleButtonLabel: /* @__PURE__ */ __name(function addRuleButtonLabel() { - return this.$primevue.config.locale ? this.$primevue.config.locale.addRule : void 0; - }, "addRuleButtonLabel"), - isShowAddConstraint: /* @__PURE__ */ __name(function isShowAddConstraint() { - return this.showAddButton && this.filters[this.field].operator && this.fieldConstraints && this.fieldConstraints.length < this.maxConstraints; - }, "isShowAddConstraint"), - clearButtonLabel: /* @__PURE__ */ __name(function clearButtonLabel() { - return this.$primevue.config.locale ? this.$primevue.config.locale.clear : void 0; - }, "clearButtonLabel"), - applyButtonLabel: /* @__PURE__ */ __name(function applyButtonLabel() { - return this.$primevue.config.locale ? this.$primevue.config.locale.apply : void 0; - }, "applyButtonLabel"), - columnFilterButtonAriaLabel: /* @__PURE__ */ __name(function columnFilterButtonAriaLabel() { - return this.$primevue.config.locale ? this.overlayVisible ? this.$primevue.config.locale.showFilterMenu : this.$primevue.config.locale.hideFilterMenu : void 0; - }, "columnFilterButtonAriaLabel"), - filterOperatorAriaLabel: /* @__PURE__ */ __name(function filterOperatorAriaLabel() { - return this.$primevue.config.locale ? this.$primevue.config.locale.filterOperator : void 0; - }, "filterOperatorAriaLabel"), - filterRuleAriaLabel: /* @__PURE__ */ __name(function filterRuleAriaLabel() { - return this.$primevue.config.locale ? this.$primevue.config.locale.filterConstraint : void 0; - }, "filterRuleAriaLabel"), - ptmHeaderFilterClearParams: /* @__PURE__ */ __name(function ptmHeaderFilterClearParams() { - return { - context: { - hidden: this.hasRowFilter() - } - }; - }, "ptmHeaderFilterClearParams"), - ptmFilterMenuParams: /* @__PURE__ */ __name(function ptmFilterMenuParams() { - return { - context: { - overlayVisible: this.overlayVisible, - active: this.hasFilter() - } - }; - }, "ptmFilterMenuParams") - }, - components: { - Select: script$u, - Button: script$A, - Portal: script$F, - FilterSlashIcon: script$h, - FilterIcon: script$i, - TrashIcon: script$g, - PlusIcon: script$G - }, - directives: { - focustrap: FocusTrap - } -}; -function _typeof$4(o) { - "@babel/helpers - typeof"; - return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$4(o); -} -__name(_typeof$4, "_typeof$4"); -function ownKeys$4(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys$4, "ownKeys$4"); -function _objectSpread$4(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys$4(Object(t), true).forEach(function(r2) { - _defineProperty$4(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread$4, "_objectSpread$4"); -function _defineProperty$4(e, r, t) { - return (r = _toPropertyKey$4(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$4, "_defineProperty$4"); -function _toPropertyKey$4(t) { - var i = _toPrimitive$4(t, "string"); - return "symbol" == _typeof$4(i) ? i : i + ""; -} -__name(_toPropertyKey$4, "_toPropertyKey$4"); -function _toPrimitive$4(t, r) { - if ("object" != _typeof$4(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$4(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$4, "_toPrimitive$4"); -var _hoisted_1$1 = ["id", "aria-modal"]; -var _hoisted_2 = ["onClick", "onKeydown", "tabindex"]; -function render$4(_ctx, _cache, $props, $setup, $data, $options) { - var _component_Button = resolveComponent("Button"); - var _component_Select = resolveComponent("Select"); - var _component_Portal = resolveComponent("Portal"); - var _directive_focustrap = resolveDirective("focustrap"); - return openBlock(), createElementBlock("div", mergeProps({ - "class": _ctx.cx("filter") - }, $options.getColumnPT("filter")), [$props.display === "row" ? (openBlock(), createElementBlock("div", mergeProps({ - key: 0, - "class": _ctx.cx("filterElementContainer") - }, _objectSpread$4(_objectSpread$4({}, $props.filterInputProps), $options.getColumnPT("filterElementContainer"))), [(openBlock(), createBlock(resolveDynamicComponent($props.filterElement), { - field: $props.field, - filterModel: $props.filters[$props.field], - filterCallback: $options.filterCallback - }, null, 8, ["field", "filterModel", "filterCallback"]))], 16)) : createCommentVNode("", true), $options.showMenuButton ? (openBlock(), createBlock(_component_Button, mergeProps({ - key: 1, - ref: "icon", - "aria-label": $options.columnFilterButtonAriaLabel, - "aria-haspopup": "true", - "aria-expanded": $data.overlayVisible, - "aria-controls": $options.overlayId, - "class": _ctx.cx("pcColumnFilterButton"), - unstyled: _ctx.unstyled, - onClick: _cache[0] || (_cache[0] = function($event) { - return $options.toggleMenu($event); - }), - onKeydown: _cache[1] || (_cache[1] = function($event) { - return $options.onToggleButtonKeyDown($event); - }) - }, _objectSpread$4(_objectSpread$4({}, $options.getColumnPT("pcColumnFilterButton", $options.ptmFilterMenuParams)), $props.filterButtonProps.filter)), { - icon: withCtx(function(slotProps) { - return [(openBlock(), createBlock(resolveDynamicComponent($props.filterIconTemplate || "FilterIcon"), mergeProps({ - "class": slotProps["class"] - }, $options.getColumnPT("filterMenuIcon")), null, 16, ["class"]))]; - }), - _: 1 - }, 16, ["aria-label", "aria-expanded", "aria-controls", "class", "unstyled"])) : createCommentVNode("", true), $props.showClearButton && $props.display === "row" && $options.hasRowFilter() ? (openBlock(), createBlock(_component_Button, mergeProps({ - key: 2, - "class": _ctx.cx("pcColumnFilterClearButton"), - unstyled: _ctx.unstyled, - onClick: _cache[2] || (_cache[2] = function($event) { - return $options.clearFilter(); - }) - }, _objectSpread$4(_objectSpread$4({}, $options.getColumnPT("pcColumnFilterClearButton", $options.ptmHeaderFilterClearParams)), $props.filterButtonProps.inline.clear)), { - icon: withCtx(function(slotProps) { - return [(openBlock(), createBlock(resolveDynamicComponent($props.filterClearIconTemplate || "FilterSlashIcon"), mergeProps({ - "class": slotProps["class"] - }, $options.getColumnPT("filterClearIcon")), null, 16, ["class"]))]; - }), - _: 1 - }, 16, ["class", "unstyled"])) : createCommentVNode("", true), createVNode(_component_Portal, null, { - "default": withCtx(function() { - return [createVNode(Transition, mergeProps({ - name: "p-connected-overlay", - onEnter: $options.onOverlayEnter, - onAfterEnter: $options.onOverlayAfterEnter, - onLeave: $options.onOverlayLeave, - onAfterLeave: $options.onOverlayAfterLeave - }, $options.getColumnPT("transition")), { - "default": withCtx(function() { - return [$data.overlayVisible ? withDirectives((openBlock(), createElementBlock("div", mergeProps({ - key: 0, - ref: $options.overlayRef, - id: $options.overlayId, - "aria-modal": $data.overlayVisible, - role: "dialog", - "class": [_ctx.cx("filterOverlay"), $props.filterMenuClass], - onKeydown: _cache[10] || (_cache[10] = withKeys(function() { - return $options.hide && $options.hide.apply($options, arguments); - }, ["escape"])), - onClick: _cache[11] || (_cache[11] = function() { - return $options.onContentClick && $options.onContentClick.apply($options, arguments); - }), - onMousedown: _cache[12] || (_cache[12] = function() { - return $options.onContentMouseDown && $options.onContentMouseDown.apply($options, arguments); - }) - }, $options.getColumnPT("filterOverlay")), [(openBlock(), createBlock(resolveDynamicComponent($props.filterHeaderTemplate), { - field: $props.field, - filterModel: $props.filters[$props.field], - filterCallback: $options.filterCallback - }, null, 8, ["field", "filterModel", "filterCallback"])), $props.display === "row" ? (openBlock(), createElementBlock("ul", mergeProps({ - key: 0, - "class": _ctx.cx("filterConstraintList") - }, $options.getColumnPT("filterConstraintList")), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.matchModes, function(matchMode, i) { - return openBlock(), createElementBlock("li", mergeProps({ - key: matchMode.label, - "class": _ctx.cx("filterConstraint", { - matchMode - }), - onClick: /* @__PURE__ */ __name(function onClick3($event) { - return $options.onRowMatchModeChange(matchMode.value); - }, "onClick"), - onKeydown: [_cache[3] || (_cache[3] = function($event) { - return $options.onRowMatchModeKeyDown($event); - }), withKeys(withModifiers(function($event) { - return $options.onRowMatchModeChange(matchMode.value); - }, ["prevent"]), ["enter"])], - tabindex: i === 0 ? "0" : null, - ref_for: true - }, $options.getColumnPT("filterConstraint", $options.ptmFilterConstraintOptions(matchMode))), toDisplayString(matchMode.label), 17, _hoisted_2); - }), 128)), createBaseVNode("li", mergeProps({ - "class": _ctx.cx("filterConstraintSeparator") - }, $options.getColumnPT("filterConstraintSeparator")), null, 16), createBaseVNode("li", mergeProps({ - "class": _ctx.cx("filterConstraint"), - onClick: _cache[4] || (_cache[4] = function($event) { - return $options.clearFilter(); - }), - onKeydown: [_cache[5] || (_cache[5] = function($event) { - return $options.onRowMatchModeKeyDown($event); - }), _cache[6] || (_cache[6] = withKeys(function($event) { - return _ctx.onRowClearItemClick(); - }, ["enter"]))] - }, $options.getColumnPT("filterConstraint")), toDisplayString($options.noFilterLabel), 17)], 16)) : (openBlock(), createElementBlock(Fragment, { - key: 1 - }, [$options.isShowOperator ? (openBlock(), createElementBlock("div", mergeProps({ - key: 0, - "class": _ctx.cx("filterOperator") - }, $options.getColumnPT("filterOperator")), [createVNode(_component_Select, { - options: $options.operatorOptions, - modelValue: $options.operator, - "aria-label": $options.filterOperatorAriaLabel, - "class": normalizeClass(_ctx.cx("pcFilterOperatorDropdown")), - optionLabel: "label", - optionValue: "value", - "onUpdate:modelValue": _cache[7] || (_cache[7] = function($event) { - return $options.onOperatorChange($event); - }), - unstyled: _ctx.unstyled, - pt: $options.getColumnPT("pcFilterOperatorDropdown") - }, null, 8, ["options", "modelValue", "aria-label", "class", "unstyled", "pt"])], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ - "class": _ctx.cx("filterRuleList") - }, $options.getColumnPT("filterRuleList")), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldConstraints, function(fieldConstraint, i) { - return openBlock(), createElementBlock("div", mergeProps({ - key: i, - "class": _ctx.cx("filterRule"), - ref_for: true - }, $options.getColumnPT("filterRule")), [$options.isShowMatchModes ? (openBlock(), createBlock(_component_Select, { - key: 0, - options: $options.matchModes, - modelValue: fieldConstraint.matchMode, - "class": normalizeClass(_ctx.cx("pcFilterConstraintDropdown")), - optionLabel: "label", - optionValue: "value", - "aria-label": $options.filterRuleAriaLabel, - "onUpdate:modelValue": /* @__PURE__ */ __name(function onUpdateModelValue($event) { - return $options.onMenuMatchModeChange($event, i); - }, "onUpdateModelValue"), - unstyled: _ctx.unstyled, - pt: $options.getColumnPT("pcFilterConstraintDropdown") - }, null, 8, ["options", "modelValue", "class", "aria-label", "onUpdate:modelValue", "unstyled", "pt"])) : createCommentVNode("", true), $props.display === "menu" ? (openBlock(), createBlock(resolveDynamicComponent($props.filterElement), { - key: 1, - field: $props.field, - filterModel: fieldConstraint, - filterCallback: $options.filterCallback, - applyFilter: $options.applyFilter - }, null, 8, ["field", "filterModel", "filterCallback", "applyFilter"])) : createCommentVNode("", true), $options.showRemoveIcon ? (openBlock(), createElementBlock("div", mergeProps({ - key: 2, - ref_for: true - }, $options.getColumnPT("filterRemove")), [createVNode(_component_Button, mergeProps({ - type: "button", - "class": _ctx.cx("pcFilterRemoveRuleButton"), - onClick: /* @__PURE__ */ __name(function onClick3($event) { - return $options.removeConstraint(i); - }, "onClick"), - label: $options.removeRuleButtonLabel, - unstyled: _ctx.unstyled, - ref_for: true - }, $props.filterButtonProps.popover.removeRule, { - pt: $options.getColumnPT("pcFilterRemoveRuleButton") - }), { - icon: withCtx(function(iconProps) { - return [(openBlock(), createBlock(resolveDynamicComponent($props.filterRemoveIconTemplate || "TrashIcon"), mergeProps({ - "class": iconProps["class"], - ref_for: true - }, $options.getColumnPT("pcFilterRemoveRuleButton")["icon"]), null, 16, ["class"]))]; - }), - _: 2 - }, 1040, ["class", "onClick", "label", "unstyled", "pt"])], 16)) : createCommentVNode("", true)], 16); - }), 128))], 16), $options.isShowAddConstraint ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ - key: 1 - }, $options.getColumnPT("filterAddButtonContainer"))), [createVNode(_component_Button, mergeProps({ - type: "button", - label: $options.addRuleButtonLabel, - iconPos: "left", - "class": _ctx.cx("pcFilterAddRuleButton"), - onClick: _cache[8] || (_cache[8] = function($event) { - return $options.addConstraint(); - }), - unstyled: _ctx.unstyled - }, $props.filterButtonProps.popover.addRule, { - pt: $options.getColumnPT("pcFilterAddRuleButton") - }), { - icon: withCtx(function(iconProps) { - return [(openBlock(), createBlock(resolveDynamicComponent($props.filterAddIconTemplate || "PlusIcon"), mergeProps({ - "class": iconProps["class"] - }, $options.getColumnPT("pcFilterAddRuleButton")["icon"]), null, 16, ["class"]))]; - }), - _: 1 - }, 16, ["label", "class", "unstyled", "pt"])], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ - "class": _ctx.cx("filterButtonbar") - }, $options.getColumnPT("filterButtonbar")), [!$props.filterClearTemplate && $props.showClearButton ? (openBlock(), createBlock(_component_Button, mergeProps({ - key: 0, - type: "button", - "class": _ctx.cx("pcFilterClearButton"), - label: $options.clearButtonLabel, - onClick: $options.clearFilter, - unstyled: _ctx.unstyled - }, $props.filterButtonProps.popover.clear, { - pt: $options.getColumnPT("pcFilterClearButton") - }), null, 16, ["class", "label", "onClick", "unstyled", "pt"])) : (openBlock(), createBlock(resolveDynamicComponent($props.filterClearTemplate), { - key: 1, - field: $props.field, - filterModel: $props.filters[$props.field], - filterCallback: $options.clearFilter - }, null, 8, ["field", "filterModel", "filterCallback"])), $props.showApplyButton ? (openBlock(), createElementBlock(Fragment, { - key: 2 - }, [!$props.filterApplyTemplate ? (openBlock(), createBlock(_component_Button, mergeProps({ - key: 0, - type: "button", - "class": _ctx.cx("pcFilterApplyButton"), - label: $options.applyButtonLabel, - onClick: _cache[9] || (_cache[9] = function($event) { - return $options.applyFilter(); - }), - unstyled: _ctx.unstyled - }, $props.filterButtonProps.popover.apply, { - pt: $options.getColumnPT("pcFilterApplyButton") - }), null, 16, ["class", "label", "unstyled", "pt"])) : (openBlock(), createBlock(resolveDynamicComponent($props.filterApplyTemplate), { - key: 1, - field: $props.field, - filterModel: $props.filters[$props.field], - filterCallback: $options.applyFilter - }, null, 8, ["field", "filterModel", "filterCallback"]))], 64)) : createCommentVNode("", true)], 16)], 64)), (openBlock(), createBlock(resolveDynamicComponent($props.filterFooterTemplate), { - field: $props.field, - filterModel: $props.filters[$props.field], - filterCallback: $options.filterCallback - }, null, 8, ["field", "filterModel", "filterCallback"]))], 16, _hoisted_1$1)), [[_directive_focustrap]]) : createCommentVNode("", true)]; - }), - _: 1 - }, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])]; - }), - _: 1 - })], 16); -} -__name(render$4, "render$4"); -script$4.render = render$4; -var script$3 = { - name: "HeaderCheckbox", - hostName: "DataTable", - "extends": script$s, - emits: ["change"], - props: { - checked: null, - disabled: null, - column: null, - headerCheckboxIconTemplate: { - type: Function, - "default": null - } - }, - methods: { - getColumnPT: /* @__PURE__ */ __name(function getColumnPT7(key) { - var columnMetaData = { - props: this.column.props, - parent: { - instance: this, - props: this.$props, - state: this.$data - }, - context: { - checked: this.checked, - disabled: this.disabled - } - }; - return mergeProps(this.ptm("column.".concat(key), { - column: columnMetaData - }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); - }, "getColumnPT"), - getColumnProp: /* @__PURE__ */ __name(function getColumnProp6() { - return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; - }, "getColumnProp"), - onChange: /* @__PURE__ */ __name(function onChange7(event2) { - this.$emit("change", { - originalEvent: event2, - checked: !this.checked - }); - }, "onChange") - }, - computed: { - headerCheckboxAriaLabel: /* @__PURE__ */ __name(function headerCheckboxAriaLabel() { - return this.$primevue.config.locale.aria ? this.checked ? this.$primevue.config.locale.aria.selectAll : this.$primevue.config.locale.aria.unselectAll : void 0; - }, "headerCheckboxAriaLabel") - }, - components: { - CheckIcon: script$y, - Checkbox: script$z - } -}; -function render$3(_ctx, _cache, $props, $setup, $data, $options) { - var _component_CheckIcon = resolveComponent("CheckIcon"); - var _component_Checkbox = resolveComponent("Checkbox"); - return openBlock(), createBlock(_component_Checkbox, { - modelValue: $props.checked, - binary: true, - disabled: $props.disabled, - "aria-label": $options.headerCheckboxAriaLabel, - onChange: $options.onChange, - unstyled: _ctx.unstyled, - pt: $options.getColumnPT("pcHeaderCheckbox") - }, { - icon: withCtx(function(slotProps) { - return [$props.headerCheckboxIconTemplate ? (openBlock(), createBlock(resolveDynamicComponent($props.headerCheckboxIconTemplate), { - key: 0, - checked: slotProps.checked, - "class": normalizeClass(slotProps["class"]) - }, null, 8, ["checked", "class"])) : !$props.headerCheckboxIconTemplate && slotProps.checked ? (openBlock(), createBlock(_component_CheckIcon, mergeProps({ - key: 1, - "class": slotProps["class"] - }, $options.getColumnPT("pcHeaderCheckbox")["icon"]), null, 16, ["class"])) : createCommentVNode("", true)]; - }), - _: 1 - }, 8, ["modelValue", "disabled", "aria-label", "onChange", "unstyled", "pt"]); -} -__name(render$3, "render$3"); -script$3.render = render$3; -var script$2 = { - name: "HeaderCell", - hostName: "DataTable", - "extends": script$s, - emits: ["column-click", "column-mousedown", "column-dragstart", "column-dragover", "column-dragleave", "column-drop", "column-resizestart", "checkbox-change", "filter-change", "filter-apply", "operator-change", "matchmode-change", "constraint-add", "constraint-remove", "filter-clear", "apply-click"], - props: { - column: { - type: Object, - "default": null - }, - index: { - type: Number, - "default": null - }, - resizableColumns: { - type: Boolean, - "default": false - }, - groupRowsBy: { - type: [Array, String, Function], - "default": null - }, - sortMode: { - type: String, - "default": "single" - }, - groupRowSortField: { - type: [String, Function], - "default": null - }, - sortField: { - type: [String, Function], - "default": null - }, - sortOrder: { - type: Number, - "default": null - }, - multiSortMeta: { - type: Array, - "default": null - }, - allRowsSelected: { - type: Boolean, - "default": false - }, - empty: { - type: Boolean, - "default": false - }, - filterDisplay: { - type: String, - "default": null - }, - filters: { - type: Object, - "default": null - }, - filtersStore: { - type: Object, - "default": null - }, - filterColumn: { - type: Boolean, - "default": false - }, - reorderableColumns: { - type: Boolean, - "default": false - }, - filterInputProps: { - type: null, - "default": null - }, - filterButtonProps: { - type: null, - "default": null - } - }, - data: /* @__PURE__ */ __name(function data9() { - return { - styleObject: {} - }; - }, "data"), - mounted: /* @__PURE__ */ __name(function mounted7() { - if (this.columnProp("frozen")) { - this.updateStickyPosition(); - } - }, "mounted"), - updated: /* @__PURE__ */ __name(function updated4() { - if (this.columnProp("frozen")) { - this.updateStickyPosition(); - } - }, "updated"), - methods: { - columnProp: /* @__PURE__ */ __name(function columnProp5(prop) { - return getVNodeProp(this.column, prop); - }, "columnProp"), - getColumnPT: /* @__PURE__ */ __name(function getColumnPT8(key) { - var _this$$parentInstance, _this$$parentInstance2; - var columnMetaData = { - props: this.column.props, - parent: { - instance: this, - props: this.$props, - state: this.$data - }, - context: { - index: this.index, - sortable: this.columnProp("sortable") === "" || this.columnProp("sortable"), - sorted: this.isColumnSorted(), - resizable: this.resizableColumns, - size: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.size, - showGridlines: ((_this$$parentInstance2 = this.$parentInstance) === null || _this$$parentInstance2 === void 0 || (_this$$parentInstance2 = _this$$parentInstance2.$parentInstance) === null || _this$$parentInstance2 === void 0 ? void 0 : _this$$parentInstance2.showGridlines) || false - } - }; - return mergeProps(this.ptm("column.".concat(key), { - column: columnMetaData - }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData)); - }, "getColumnPT"), - getColumnProp: /* @__PURE__ */ __name(function getColumnProp7() { - return this.column.props && this.column.props.pt ? this.column.props.pt : void 0; - }, "getColumnProp"), - onClick: /* @__PURE__ */ __name(function onClick2(event2) { - this.$emit("column-click", { - originalEvent: event2, - column: this.column - }); - }, "onClick"), - onKeyDown: /* @__PURE__ */ __name(function onKeyDown2(event2) { - if ((event2.code === "Enter" || event2.code === "NumpadEnter" || event2.code === "Space") && event2.currentTarget.nodeName === "TH" && getAttribute(event2.currentTarget, "data-p-sortable-column")) { - this.$emit("column-click", { - originalEvent: event2, - column: this.column - }); - event2.preventDefault(); - } - }, "onKeyDown"), - onMouseDown: /* @__PURE__ */ __name(function onMouseDown(event2) { - this.$emit("column-mousedown", { - originalEvent: event2, - column: this.column - }); - }, "onMouseDown"), - onDragStart: /* @__PURE__ */ __name(function onDragStart(event2) { - this.$emit("column-dragstart", { - originalEvent: event2, - column: this.column - }); - }, "onDragStart"), - onDragOver: /* @__PURE__ */ __name(function onDragOver(event2) { - this.$emit("column-dragover", { - originalEvent: event2, - column: this.column - }); - }, "onDragOver"), - onDragLeave: /* @__PURE__ */ __name(function onDragLeave(event2) { - this.$emit("column-dragleave", { - originalEvent: event2, - column: this.column - }); - }, "onDragLeave"), - onDrop: /* @__PURE__ */ __name(function onDrop(event2) { - this.$emit("column-drop", { - originalEvent: event2, - column: this.column - }); - }, "onDrop"), - onResizeStart: /* @__PURE__ */ __name(function onResizeStart(event2) { - this.$emit("column-resizestart", event2); - }, "onResizeStart"), - getMultiSortMetaIndex: /* @__PURE__ */ __name(function getMultiSortMetaIndex() { - var _this = this; - return this.multiSortMeta.findIndex(function(meta) { - return meta.field === _this.columnProp("field") || meta.field === _this.columnProp("sortField"); - }); - }, "getMultiSortMetaIndex"), - getBadgeValue: /* @__PURE__ */ __name(function getBadgeValue() { - var index = this.getMultiSortMetaIndex(); - return this.groupRowsBy && this.groupRowsBy === this.groupRowSortField && index > -1 ? index : index + 1; - }, "getBadgeValue"), - isMultiSorted: /* @__PURE__ */ __name(function isMultiSorted() { - return this.sortMode === "multiple" && this.columnProp("sortable") && this.getMultiSortMetaIndex() > -1; - }, "isMultiSorted"), - isColumnSorted: /* @__PURE__ */ __name(function isColumnSorted() { - return this.sortMode === "single" ? this.sortField && (this.sortField === this.columnProp("field") || this.sortField === this.columnProp("sortField")) : this.isMultiSorted(); - }, "isColumnSorted"), - updateStickyPosition: /* @__PURE__ */ __name(function updateStickyPosition3() { - if (this.columnProp("frozen")) { - var align = this.columnProp("alignFrozen"); - if (align === "right") { - var pos = 0; - var next2 = getNextElementSibling(this.$el, '[data-p-frozen-column="true"]'); - if (next2) { - pos = getOuterWidth(next2) + parseFloat(next2.style.right || 0); - } - this.styleObject.insetInlineEnd = pos + "px"; - } else { - var _pos = 0; - var prev2 = getPreviousElementSibling(this.$el, '[data-p-frozen-column="true"]'); - if (prev2) { - _pos = getOuterWidth(prev2) + parseFloat(prev2.style.left || 0); - } - this.styleObject.insetInlineStart = _pos + "px"; - } - var filterRow = this.$el.parentElement.nextElementSibling; - if (filterRow) { - var index = getIndex(this.$el); - if (filterRow.children[index]) { - filterRow.children[index].style.left = this.styleObject.left; - filterRow.children[index].style.right = this.styleObject.right; - } - } - } - }, "updateStickyPosition"), - onHeaderCheckboxChange: /* @__PURE__ */ __name(function onHeaderCheckboxChange(event2) { - this.$emit("checkbox-change", event2); - }, "onHeaderCheckboxChange") - }, - computed: { - containerClass: /* @__PURE__ */ __name(function containerClass3() { - return [this.cx("headerCell"), this.filterColumn ? this.columnProp("filterHeaderClass") : this.columnProp("headerClass"), this.columnProp("class")]; - }, "containerClass"), - containerStyle: /* @__PURE__ */ __name(function containerStyle3() { - var headerStyle = this.filterColumn ? this.columnProp("filterHeaderStyle") : this.columnProp("headerStyle"); - var columnStyle = this.columnProp("style"); - return this.columnProp("frozen") ? [columnStyle, headerStyle, this.styleObject] : [columnStyle, headerStyle]; - }, "containerStyle"), - sortState: /* @__PURE__ */ __name(function sortState() { - var sorted2 = false; - var sortOrder2 = null; - if (this.sortMode === "single") { - sorted2 = this.sortField && (this.sortField === this.columnProp("field") || this.sortField === this.columnProp("sortField")); - sortOrder2 = sorted2 ? this.sortOrder : 0; - } else if (this.sortMode === "multiple") { - var metaIndex = this.getMultiSortMetaIndex(); - if (metaIndex > -1) { - sorted2 = true; - sortOrder2 = this.multiSortMeta[metaIndex].order; - } - } - return { - sorted: sorted2, - sortOrder: sortOrder2 - }; - }, "sortState"), - sortableColumnIcon: /* @__PURE__ */ __name(function sortableColumnIcon() { - var _this$sortState = this.sortState, sorted2 = _this$sortState.sorted, sortOrder2 = _this$sortState.sortOrder; - if (!sorted2) return script$f; - else if (sorted2 && sortOrder2 > 0) return script$d; - else if (sorted2 && sortOrder2 < 0) return script$e; - return null; - }, "sortableColumnIcon"), - ariaSort: /* @__PURE__ */ __name(function ariaSort() { - if (this.columnProp("sortable")) { - var _this$sortState2 = this.sortState, sorted2 = _this$sortState2.sorted, sortOrder2 = _this$sortState2.sortOrder; - if (sorted2 && sortOrder2 < 0) return "descending"; - else if (sorted2 && sortOrder2 > 0) return "ascending"; - else return "none"; - } else { - return null; - } - }, "ariaSort") - }, - components: { - Badge: script$H, - DTHeaderCheckbox: script$3, - DTColumnFilter: script$4, - SortAltIcon: script$f, - SortAmountUpAltIcon: script$d, - SortAmountDownIcon: script$e - } -}; -function _typeof$3(o) { - "@babel/helpers - typeof"; - return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$3(o); -} -__name(_typeof$3, "_typeof$3"); -function ownKeys$3(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys$3, "ownKeys$3"); -function _objectSpread$3(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys$3(Object(t), true).forEach(function(r2) { - _defineProperty$3(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread$3, "_objectSpread$3"); -function _defineProperty$3(e, r, t) { - return (r = _toPropertyKey$3(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$3, "_defineProperty$3"); -function _toPropertyKey$3(t) { - var i = _toPrimitive$3(t, "string"); - return "symbol" == _typeof$3(i) ? i : i + ""; -} -__name(_toPropertyKey$3, "_toPropertyKey$3"); -function _toPrimitive$3(t, r) { - if ("object" != _typeof$3(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$3(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$3, "_toPrimitive$3"); -var _hoisted_1 = ["tabindex", "colspan", "rowspan", "aria-sort", "data-p-sortable-column", "data-p-resizable-column", "data-p-sorted", "data-p-filter-column", "data-p-frozen-column", "data-p-reorderable-column"]; -function render$2(_ctx, _cache, $props, $setup, $data, $options) { - var _component_Badge = resolveComponent("Badge"); - var _component_DTHeaderCheckbox = resolveComponent("DTHeaderCheckbox"); - var _component_DTColumnFilter = resolveComponent("DTColumnFilter"); - return openBlock(), createElementBlock("th", mergeProps({ - style: $options.containerStyle, - "class": $options.containerClass, - tabindex: $options.columnProp("sortable") ? "0" : null, - role: "columnheader", - colspan: $options.columnProp("colspan"), - rowspan: $options.columnProp("rowspan"), - "aria-sort": $options.ariaSort, - onClick: _cache[8] || (_cache[8] = function() { - return $options.onClick && $options.onClick.apply($options, arguments); - }), - onKeydown: _cache[9] || (_cache[9] = function() { - return $options.onKeyDown && $options.onKeyDown.apply($options, arguments); - }), - onMousedown: _cache[10] || (_cache[10] = function() { - return $options.onMouseDown && $options.onMouseDown.apply($options, arguments); - }), - onDragstart: _cache[11] || (_cache[11] = function() { - return $options.onDragStart && $options.onDragStart.apply($options, arguments); - }), - onDragover: _cache[12] || (_cache[12] = function() { - return $options.onDragOver && $options.onDragOver.apply($options, arguments); - }), - onDragleave: _cache[13] || (_cache[13] = function() { - return $options.onDragLeave && $options.onDragLeave.apply($options, arguments); - }), - onDrop: _cache[14] || (_cache[14] = function() { - return $options.onDrop && $options.onDrop.apply($options, arguments); - }) - }, _objectSpread$3(_objectSpread$3({}, $options.getColumnPT("root")), $options.getColumnPT("headerCell")), { - "data-p-sortable-column": $options.columnProp("sortable"), - "data-p-resizable-column": $props.resizableColumns, - "data-p-sorted": $options.isColumnSorted(), - "data-p-filter-column": $props.filterColumn, - "data-p-frozen-column": $options.columnProp("frozen"), - "data-p-reorderable-column": $props.reorderableColumns - }), [$props.resizableColumns && !$options.columnProp("frozen") ? (openBlock(), createElementBlock("span", mergeProps({ - key: 0, - "class": _ctx.cx("columnResizer"), - onMousedown: _cache[0] || (_cache[0] = function() { - return $options.onResizeStart && $options.onResizeStart.apply($options, arguments); - }) - }, $options.getColumnPT("columnResizer")), null, 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ - "class": _ctx.cx("columnHeaderContent") - }, $options.getColumnPT("columnHeaderContent")), [$props.column.children && $props.column.children.header ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.header), { - key: 0, - column: $props.column - }, null, 8, ["column"])) : createCommentVNode("", true), $options.columnProp("header") ? (openBlock(), createElementBlock("span", mergeProps({ - key: 1, - "class": _ctx.cx("columnTitle") - }, $options.getColumnPT("columnTitle")), toDisplayString($options.columnProp("header")), 17)) : createCommentVNode("", true), $options.columnProp("sortable") ? (openBlock(), createElementBlock("span", normalizeProps(mergeProps({ - key: 2 - }, $options.getColumnPT("sort"))), [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.sorticon || $options.sortableColumnIcon), mergeProps({ - sorted: $options.sortState.sorted, - sortOrder: $options.sortState.sortOrder, - "class": _ctx.cx("sortIcon") - }, $options.getColumnPT("sorticon")), null, 16, ["sorted", "sortOrder", "class"]))], 16)) : createCommentVNode("", true), $options.isMultiSorted() ? (openBlock(), createBlock(_component_Badge, { - key: 3, - "class": normalizeClass(_ctx.cx("pcSortBadge")), - pt: $options.getColumnPT("pcSortBadge"), - value: $options.getBadgeValue(), - size: "small" - }, null, 8, ["class", "pt", "value"])) : createCommentVNode("", true), $options.columnProp("selectionMode") === "multiple" && $props.filterDisplay !== "row" ? (openBlock(), createBlock(_component_DTHeaderCheckbox, { - key: 4, - checked: $props.allRowsSelected, - onChange: $options.onHeaderCheckboxChange, - disabled: $props.empty, - headerCheckboxIconTemplate: $props.column.children && $props.column.children.headercheckboxicon, - column: $props.column, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["checked", "onChange", "disabled", "headerCheckboxIconTemplate", "column", "unstyled", "pt"])) : createCommentVNode("", true), $props.filterDisplay === "menu" && $props.column.children && $props.column.children.filter ? (openBlock(), createBlock(_component_DTColumnFilter, { - key: 5, - field: $options.columnProp("filterField") || $options.columnProp("field"), - type: $options.columnProp("dataType"), - display: "menu", - showMenu: $options.columnProp("showFilterMenu"), - filterElement: $props.column.children && $props.column.children.filter, - filterHeaderTemplate: $props.column.children && $props.column.children.filterheader, - filterFooterTemplate: $props.column.children && $props.column.children.filterfooter, - filterClearTemplate: $props.column.children && $props.column.children.filterclear, - filterApplyTemplate: $props.column.children && $props.column.children.filterapply, - filterIconTemplate: $props.column.children && $props.column.children.filtericon, - filterAddIconTemplate: $props.column.children && $props.column.children.filteraddicon, - filterRemoveIconTemplate: $props.column.children && $props.column.children.filterremoveicon, - filterClearIconTemplate: $props.column.children && $props.column.children.filterclearicon, - filters: $props.filters, - filtersStore: $props.filtersStore, - filterInputProps: $props.filterInputProps, - filterButtonProps: $props.filterButtonProps, - onFilterChange: _cache[1] || (_cache[1] = function($event) { - return _ctx.$emit("filter-change", $event); - }), - onFilterApply: _cache[2] || (_cache[2] = function($event) { - return _ctx.$emit("filter-apply"); - }), - filterMenuStyle: $options.columnProp("filterMenuStyle"), - filterMenuClass: $options.columnProp("filterMenuClass"), - showOperator: $options.columnProp("showFilterOperator"), - showClearButton: $options.columnProp("showClearButton"), - showApplyButton: $options.columnProp("showApplyButton"), - showMatchModes: $options.columnProp("showFilterMatchModes"), - showAddButton: $options.columnProp("showAddButton"), - matchModeOptions: $options.columnProp("filterMatchModeOptions"), - maxConstraints: $options.columnProp("maxConstraints"), - onOperatorChange: _cache[3] || (_cache[3] = function($event) { - return _ctx.$emit("operator-change", $event); - }), - onMatchmodeChange: _cache[4] || (_cache[4] = function($event) { - return _ctx.$emit("matchmode-change", $event); - }), - onConstraintAdd: _cache[5] || (_cache[5] = function($event) { - return _ctx.$emit("constraint-add", $event); - }), - onConstraintRemove: _cache[6] || (_cache[6] = function($event) { - return _ctx.$emit("constraint-remove", $event); - }), - onApplyClick: _cache[7] || (_cache[7] = function($event) { - return _ctx.$emit("apply-click", $event); - }), - column: $props.column, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["field", "type", "showMenu", "filterElement", "filterHeaderTemplate", "filterFooterTemplate", "filterClearTemplate", "filterApplyTemplate", "filterIconTemplate", "filterAddIconTemplate", "filterRemoveIconTemplate", "filterClearIconTemplate", "filters", "filtersStore", "filterInputProps", "filterButtonProps", "filterMenuStyle", "filterMenuClass", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "matchModeOptions", "maxConstraints", "column", "unstyled", "pt"])) : createCommentVNode("", true)], 16)], 16, _hoisted_1); -} -__name(render$2, "render$2"); -script$2.render = render$2; -var script$1 = { - name: "TableHeader", - hostName: "DataTable", - "extends": script$s, - emits: ["column-click", "column-mousedown", "column-dragstart", "column-dragover", "column-dragleave", "column-drop", "column-resizestart", "checkbox-change", "filter-change", "filter-apply", "operator-change", "matchmode-change", "constraint-add", "constraint-remove", "filter-clear", "apply-click"], - props: { - columnGroup: { - type: null, - "default": null - }, - columns: { - type: null, - "default": null - }, - rowGroupMode: { - type: String, - "default": null - }, - groupRowsBy: { - type: [Array, String, Function], - "default": null - }, - resizableColumns: { - type: Boolean, - "default": false - }, - allRowsSelected: { - type: Boolean, - "default": false - }, - empty: { - type: Boolean, - "default": false - }, - sortMode: { - type: String, - "default": "single" - }, - groupRowSortField: { - type: [String, Function], - "default": null - }, - sortField: { - type: [String, Function], - "default": null - }, - sortOrder: { - type: Number, - "default": null - }, - multiSortMeta: { - type: Array, - "default": null - }, - filterDisplay: { - type: String, - "default": null - }, - filters: { - type: Object, - "default": null - }, - filtersStore: { - type: Object, - "default": null - }, - reorderableColumns: { - type: Boolean, - "default": false - }, - first: { - type: Number, - "default": 0 - }, - filterInputProps: { - type: null, - "default": null - }, - filterButtonProps: { - type: null, - "default": null - } - }, - provide: /* @__PURE__ */ __name(function provide6() { - return { - $rows: this.d_headerRows, - $columns: this.d_headerColumns - }; - }, "provide"), - data: /* @__PURE__ */ __name(function data10() { - return { - d_headerRows: new _default({ - type: "Row" - }), - d_headerColumns: new _default({ - type: "Column" - }) - }; - }, "data"), - beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount4() { - this.d_headerRows.clear(); - this.d_headerColumns.clear(); - }, "beforeUnmount"), - methods: { - columnProp: /* @__PURE__ */ __name(function columnProp6(col, prop) { - return getVNodeProp(col, prop); - }, "columnProp"), - getColumnGroupPT: /* @__PURE__ */ __name(function getColumnGroupPT2(key) { - var _this$$parentInstance; - var columnGroupMetaData = { - props: this.getColumnGroupProps(), - parent: { - instance: this, - props: this.$props, - state: this.$data - }, - context: { - type: "header", - scrollable: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.scrollable - } - }; - return mergeProps(this.ptm("columnGroup.".concat(key), { - columnGroup: columnGroupMetaData - }), this.ptm("columnGroup.".concat(key), columnGroupMetaData), this.ptmo(this.getColumnGroupProps(), key, columnGroupMetaData)); - }, "getColumnGroupPT"), - getColumnGroupProps: /* @__PURE__ */ __name(function getColumnGroupProps2() { - return this.columnGroup && this.columnGroup.props && this.columnGroup.props.pt ? this.columnGroup.props.pt : void 0; - }, "getColumnGroupProps"), - getRowPT: /* @__PURE__ */ __name(function getRowPT2(row2, key, index) { - var rowMetaData = { - props: row2.props, - parent: { - instance: this, - props: this.$props, - state: this.$data - }, - context: { - index - } - }; - return mergeProps(this.ptm("row.".concat(key), { - row: rowMetaData - }), this.ptm("row.".concat(key), rowMetaData), this.ptmo(this.getRowProp(row2), key, rowMetaData)); - }, "getRowPT"), - getRowProp: /* @__PURE__ */ __name(function getRowProp2(row2) { - return row2.props && row2.props.pt ? row2.props.pt : void 0; - }, "getRowProp"), - getColumnPT: /* @__PURE__ */ __name(function getColumnPT9(column, key, index) { - var columnMetaData = { - props: column.props, - parent: { - instance: this, - props: this.$props, - state: this.$data - }, - context: { - index - } - }; - return mergeProps(this.ptm("column.".concat(key), { - column: columnMetaData - }), this.ptm("column.".concat(key), columnMetaData), this.ptmo(this.getColumnProp(column), key, columnMetaData)); - }, "getColumnPT"), - getColumnProp: /* @__PURE__ */ __name(function getColumnProp8(column) { - return column.props && column.props.pt ? column.props.pt : void 0; - }, "getColumnProp"), - getFilterColumnHeaderClass: /* @__PURE__ */ __name(function getFilterColumnHeaderClass(column) { - return [this.cx("headerCell", { - column - }), this.columnProp(column, "filterHeaderClass"), this.columnProp(column, "class")]; - }, "getFilterColumnHeaderClass"), - getFilterColumnHeaderStyle: /* @__PURE__ */ __name(function getFilterColumnHeaderStyle(column) { - return [this.columnProp(column, "filterHeaderStyle"), this.columnProp(column, "style")]; - }, "getFilterColumnHeaderStyle"), - getHeaderRows: /* @__PURE__ */ __name(function getHeaderRows() { - var _this$d_headerRows; - return (_this$d_headerRows = this.d_headerRows) === null || _this$d_headerRows === void 0 ? void 0 : _this$d_headerRows.get(this.columnGroup, this.columnGroup.children); - }, "getHeaderRows"), - getHeaderColumns: /* @__PURE__ */ __name(function getHeaderColumns(row2) { - var _this$d_headerColumns; - return (_this$d_headerColumns = this.d_headerColumns) === null || _this$d_headerColumns === void 0 ? void 0 : _this$d_headerColumns.get(row2, row2.children); - }, "getHeaderColumns") - }, - computed: { - ptmTHeadOptions: /* @__PURE__ */ __name(function ptmTHeadOptions() { - var _this$$parentInstance2; - return { - context: { - scrollable: (_this$$parentInstance2 = this.$parentInstance) === null || _this$$parentInstance2 === void 0 || (_this$$parentInstance2 = _this$$parentInstance2.$parentInstance) === null || _this$$parentInstance2 === void 0 ? void 0 : _this$$parentInstance2.scrollable - } - }; - }, "ptmTHeadOptions") - }, - components: { - DTHeaderCell: script$2, - DTHeaderCheckbox: script$3, - DTColumnFilter: script$4 - } -}; -function _typeof$2(o) { - "@babel/helpers - typeof"; - return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$2(o); -} -__name(_typeof$2, "_typeof$2"); -function ownKeys$2(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys$2, "ownKeys$2"); -function _objectSpread$2(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys$2(Object(t), true).forEach(function(r2) { - _defineProperty$2(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread$2, "_objectSpread$2"); -function _defineProperty$2(e, r, t) { - return (r = _toPropertyKey$2(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$2, "_defineProperty$2"); -function _toPropertyKey$2(t) { - var i = _toPrimitive$2(t, "string"); - return "symbol" == _typeof$2(i) ? i : i + ""; -} -__name(_toPropertyKey$2, "_toPropertyKey$2"); -function _toPrimitive$2(t, r) { - if ("object" != _typeof$2(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$2(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$2, "_toPrimitive$2"); -function render$1(_ctx, _cache, $props, $setup, $data, $options) { - var _component_DTHeaderCell = resolveComponent("DTHeaderCell"); - var _component_DTHeaderCheckbox = resolveComponent("DTHeaderCheckbox"); - var _component_DTColumnFilter = resolveComponent("DTColumnFilter"); - return openBlock(), createElementBlock("thead", mergeProps({ - "class": _ctx.cx("thead"), - style: _ctx.sx("thead"), - role: "rowgroup" - }, $props.columnGroup ? _objectSpread$2(_objectSpread$2({}, _ctx.ptm("thead", $options.ptmTHeadOptions)), $options.getColumnGroupPT("root")) : _ctx.ptm("thead", $options.ptmTHeadOptions), { - "data-pc-section": "thead" - }), [!$props.columnGroup ? (openBlock(), createElementBlock("tr", mergeProps({ - key: 0, - role: "row" - }, _ctx.ptm("headerRow")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function(col, i) { - return openBlock(), createElementBlock(Fragment, { - key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || i - }, [!$options.columnProp(col, "hidden") && ($props.rowGroupMode !== "subheader" || $props.groupRowsBy !== $options.columnProp(col, "field")) ? (openBlock(), createBlock(_component_DTHeaderCell, { - key: 0, - column: col, - index: i, - onColumnClick: _cache[0] || (_cache[0] = function($event) { - return _ctx.$emit("column-click", $event); - }), - onColumnMousedown: _cache[1] || (_cache[1] = function($event) { - return _ctx.$emit("column-mousedown", $event); - }), - onColumnDragstart: _cache[2] || (_cache[2] = function($event) { - return _ctx.$emit("column-dragstart", $event); - }), - onColumnDragover: _cache[3] || (_cache[3] = function($event) { - return _ctx.$emit("column-dragover", $event); - }), - onColumnDragleave: _cache[4] || (_cache[4] = function($event) { - return _ctx.$emit("column-dragleave", $event); - }), - onColumnDrop: _cache[5] || (_cache[5] = function($event) { - return _ctx.$emit("column-drop", $event); - }), - groupRowsBy: $props.groupRowsBy, - groupRowSortField: $props.groupRowSortField, - reorderableColumns: $props.reorderableColumns, - resizableColumns: $props.resizableColumns, - onColumnResizestart: _cache[6] || (_cache[6] = function($event) { - return _ctx.$emit("column-resizestart", $event); - }), - sortMode: $props.sortMode, - sortField: $props.sortField, - sortOrder: $props.sortOrder, - multiSortMeta: $props.multiSortMeta, - allRowsSelected: $props.allRowsSelected, - empty: $props.empty, - onCheckboxChange: _cache[7] || (_cache[7] = function($event) { - return _ctx.$emit("checkbox-change", $event); - }), - filters: $props.filters, - filterDisplay: $props.filterDisplay, - filtersStore: $props.filtersStore, - filterInputProps: $props.filterInputProps, - filterButtonProps: $props.filterButtonProps, - first: $props.first, - onFilterChange: _cache[8] || (_cache[8] = function($event) { - return _ctx.$emit("filter-change", $event); - }), - onFilterApply: _cache[9] || (_cache[9] = function($event) { - return _ctx.$emit("filter-apply"); - }), - onOperatorChange: _cache[10] || (_cache[10] = function($event) { - return _ctx.$emit("operator-change", $event); - }), - onMatchmodeChange: _cache[11] || (_cache[11] = function($event) { - return _ctx.$emit("matchmode-change", $event); - }), - onConstraintAdd: _cache[12] || (_cache[12] = function($event) { - return _ctx.$emit("constraint-add", $event); - }), - onConstraintRemove: _cache[13] || (_cache[13] = function($event) { - return _ctx.$emit("constraint-remove", $event); - }), - onApplyClick: _cache[14] || (_cache[14] = function($event) { - return _ctx.$emit("apply-click", $event); - }), - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["column", "index", "groupRowsBy", "groupRowSortField", "reorderableColumns", "resizableColumns", "sortMode", "sortField", "sortOrder", "multiSortMeta", "allRowsSelected", "empty", "filters", "filterDisplay", "filtersStore", "filterInputProps", "filterButtonProps", "first", "unstyled", "pt"])) : createCommentVNode("", true)], 64); - }), 128))], 16)) : (openBlock(true), createElementBlock(Fragment, { - key: 1 - }, renderList($options.getHeaderRows(), function(row2, i) { - return openBlock(), createElementBlock("tr", mergeProps({ - key: i, - role: "row", - ref_for: true - }, _objectSpread$2(_objectSpread$2({}, _ctx.ptm("headerRow")), $options.getRowPT(row2, "root", i))), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.getHeaderColumns(row2), function(col, j) { - return openBlock(), createElementBlock(Fragment, { - key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || j - }, [!$options.columnProp(col, "hidden") && ($props.rowGroupMode !== "subheader" || $props.groupRowsBy !== $options.columnProp(col, "field")) && typeof col.children !== "string" ? (openBlock(), createBlock(_component_DTHeaderCell, { - key: 0, - column: col, - onColumnClick: _cache[15] || (_cache[15] = function($event) { - return _ctx.$emit("column-click", $event); - }), - onColumnMousedown: _cache[16] || (_cache[16] = function($event) { - return _ctx.$emit("column-mousedown", $event); - }), - groupRowsBy: $props.groupRowsBy, - groupRowSortField: $props.groupRowSortField, - sortMode: $props.sortMode, - sortField: $props.sortField, - sortOrder: $props.sortOrder, - multiSortMeta: $props.multiSortMeta, - allRowsSelected: $props.allRowsSelected, - empty: $props.empty, - onCheckboxChange: _cache[17] || (_cache[17] = function($event) { - return _ctx.$emit("checkbox-change", $event); - }), - filters: $props.filters, - filterDisplay: $props.filterDisplay, - filtersStore: $props.filtersStore, - onFilterChange: _cache[18] || (_cache[18] = function($event) { - return _ctx.$emit("filter-change", $event); - }), - onFilterApply: _cache[19] || (_cache[19] = function($event) { - return _ctx.$emit("filter-apply"); - }), - onOperatorChange: _cache[20] || (_cache[20] = function($event) { - return _ctx.$emit("operator-change", $event); - }), - onMatchmodeChange: _cache[21] || (_cache[21] = function($event) { - return _ctx.$emit("matchmode-change", $event); - }), - onConstraintAdd: _cache[22] || (_cache[22] = function($event) { - return _ctx.$emit("constraint-add", $event); - }), - onConstraintRemove: _cache[23] || (_cache[23] = function($event) { - return _ctx.$emit("constraint-remove", $event); - }), - onApplyClick: _cache[24] || (_cache[24] = function($event) { - return _ctx.$emit("apply-click", $event); - }), - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["column", "groupRowsBy", "groupRowSortField", "sortMode", "sortField", "sortOrder", "multiSortMeta", "allRowsSelected", "empty", "filters", "filterDisplay", "filtersStore", "unstyled", "pt"])) : createCommentVNode("", true)], 64); - }), 128))], 16); - }), 128)), $props.filterDisplay === "row" ? (openBlock(), createElementBlock("tr", mergeProps({ - key: 2, - role: "row" - }, _ctx.ptm("headerRow")), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function(col, i) { - return openBlock(), createElementBlock(Fragment, { - key: $options.columnProp(col, "columnKey") || $options.columnProp(col, "field") || i - }, [!$options.columnProp(col, "hidden") && ($props.rowGroupMode !== "subheader" || $props.groupRowsBy !== $options.columnProp(col, "field")) ? (openBlock(), createElementBlock("th", mergeProps({ - key: 0, - style: $options.getFilterColumnHeaderStyle(col), - "class": $options.getFilterColumnHeaderClass(col), - ref_for: true - }, _objectSpread$2(_objectSpread$2({}, $options.getColumnPT(col, "root", i)), $options.getColumnPT(col, "headerCell", i))), [$options.columnProp(col, "selectionMode") === "multiple" ? (openBlock(), createBlock(_component_DTHeaderCheckbox, { - key: 0, - checked: $props.allRowsSelected, - disabled: $props.empty, - onChange: _cache[25] || (_cache[25] = function($event) { - return _ctx.$emit("checkbox-change", $event); - }), - column: col, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["checked", "disabled", "column", "unstyled", "pt"])) : createCommentVNode("", true), col.children && col.children.filter ? (openBlock(), createBlock(_component_DTColumnFilter, { - key: 1, - field: $options.columnProp(col, "filterField") || $options.columnProp(col, "field"), - type: $options.columnProp(col, "dataType"), - display: "row", - showMenu: $options.columnProp(col, "showFilterMenu"), - filterElement: col.children && col.children.filter, - filterHeaderTemplate: col.children && col.children.filterheader, - filterFooterTemplate: col.children && col.children.filterfooter, - filterClearTemplate: col.children && col.children.filterclear, - filterApplyTemplate: col.children && col.children.filterapply, - filterIconTemplate: col.children && col.children.filtericon, - filterAddIconTemplate: col.children && col.children.filteraddicon, - filterRemoveIconTemplate: col.children && col.children.filterremoveicon, - filterClearIconTemplate: col.children && col.children.filterclearicon, - filters: $props.filters, - filtersStore: $props.filtersStore, - filterInputProps: $props.filterInputProps, - filterButtonProps: $props.filterButtonProps, - onFilterChange: _cache[26] || (_cache[26] = function($event) { - return _ctx.$emit("filter-change", $event); - }), - onFilterApply: _cache[27] || (_cache[27] = function($event) { - return _ctx.$emit("filter-apply"); - }), - filterMenuStyle: $options.columnProp(col, "filterMenuStyle"), - filterMenuClass: $options.columnProp(col, "filterMenuClass"), - showOperator: $options.columnProp(col, "showFilterOperator"), - showClearButton: $options.columnProp(col, "showClearButton"), - showApplyButton: $options.columnProp(col, "showApplyButton"), - showMatchModes: $options.columnProp(col, "showFilterMatchModes"), - showAddButton: $options.columnProp(col, "showAddButton"), - matchModeOptions: $options.columnProp(col, "filterMatchModeOptions"), - maxConstraints: $options.columnProp(col, "maxConstraints"), - onOperatorChange: _cache[28] || (_cache[28] = function($event) { - return _ctx.$emit("operator-change", $event); - }), - onMatchmodeChange: _cache[29] || (_cache[29] = function($event) { - return _ctx.$emit("matchmode-change", $event); - }), - onConstraintAdd: _cache[30] || (_cache[30] = function($event) { - return _ctx.$emit("constraint-add", $event); - }), - onConstraintRemove: _cache[31] || (_cache[31] = function($event) { - return _ctx.$emit("constraint-remove", $event); - }), - onApplyClick: _cache[32] || (_cache[32] = function($event) { - return _ctx.$emit("apply-click", $event); - }), - column: col, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["field", "type", "showMenu", "filterElement", "filterHeaderTemplate", "filterFooterTemplate", "filterClearTemplate", "filterApplyTemplate", "filterIconTemplate", "filterAddIconTemplate", "filterRemoveIconTemplate", "filterClearIconTemplate", "filters", "filtersStore", "filterInputProps", "filterButtonProps", "filterMenuStyle", "filterMenuClass", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "matchModeOptions", "maxConstraints", "column", "unstyled", "pt"])) : createCommentVNode("", true)], 16)) : createCommentVNode("", true)], 64); - }), 128))], 16)) : createCommentVNode("", true)], 16); -} -__name(render$1, "render$1"); -script$1.render = render$1; -function _typeof$1(o) { - "@babel/helpers - typeof"; - return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof$1(o); -} -__name(_typeof$1, "_typeof$1"); -var _excluded = ["expanded"]; -function _objectWithoutProperties(e, t) { - if (null == e) return {}; - var o, r, i = _objectWithoutPropertiesLoose(e, t); - if (Object.getOwnPropertySymbols) { - var s = Object.getOwnPropertySymbols(e); - for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); - } - return i; -} -__name(_objectWithoutProperties, "_objectWithoutProperties"); -function _objectWithoutPropertiesLoose(r, e) { - if (null == r) return {}; - var t = {}; - for (var n in r) if ({}.hasOwnProperty.call(r, n)) { - if (e.includes(n)) continue; - t[n] = r[n]; - } - return t; -} -__name(_objectWithoutPropertiesLoose, "_objectWithoutPropertiesLoose"); -function ownKeys$1(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys$1, "ownKeys$1"); -function _objectSpread$1(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys$1(Object(t), true).forEach(function(r2) { - _defineProperty$1(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread$1, "_objectSpread$1"); -function _defineProperty$1(e, r, t) { - return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty$1, "_defineProperty$1"); -function _toPropertyKey$1(t) { - var i = _toPrimitive$1(t, "string"); - return "symbol" == _typeof$1(i) ? i : i + ""; -} -__name(_toPropertyKey$1, "_toPropertyKey$1"); -function _toPrimitive$1(t, r) { - if ("object" != _typeof$1(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof$1(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive$1, "_toPrimitive$1"); -function _slicedToArray(r, e) { - return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); -} -__name(_slicedToArray, "_slicedToArray"); -function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} -__name(_nonIterableRest, "_nonIterableRest"); -function _iterableToArrayLimit(r, l) { - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; - if (null != t) { - var e, n, i, u, a = [], f = true, o = false; - try { - if (i = (t = t.call(r)).next, 0 === l) ; - else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ; - } catch (r2) { - o = true, n = r2; - } finally { - try { - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; - } finally { - if (o) throw n; - } - } - return a; - } -} -__name(_iterableToArrayLimit, "_iterableToArrayLimit"); -function _arrayWithHoles(r) { - if (Array.isArray(r)) return r; -} -__name(_arrayWithHoles, "_arrayWithHoles"); -function _createForOfIteratorHelper(r, e) { - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; - if (!t) { - if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { - t && (r = t); - var _n = 0, F = /* @__PURE__ */ __name(function F2() { - }, "F"); - return { s: F, n: /* @__PURE__ */ __name(function n() { - return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; - }, "n"), e: /* @__PURE__ */ __name(function e2(r2) { - throw r2; - }, "e"), f: F }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - var o, a = true, u = false; - return { s: /* @__PURE__ */ __name(function s() { - t = t.call(r); - }, "s"), n: /* @__PURE__ */ __name(function n() { - var r2 = t.next(); - return a = r2.done, r2; - }, "n"), e: /* @__PURE__ */ __name(function e2(r2) { - u = true, o = r2; - }, "e"), f: /* @__PURE__ */ __name(function f() { - try { - a || null == t["return"] || t["return"](); - } finally { - if (u) throw o; - } - }, "f") }; -} -__name(_createForOfIteratorHelper, "_createForOfIteratorHelper"); -function _toConsumableArray(r) { - return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); -} -__name(_toConsumableArray, "_toConsumableArray"); -function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} -__name(_nonIterableSpread, "_nonIterableSpread"); -function _unsupportedIterableToArray(r, a) { - if (r) { - if ("string" == typeof r) return _arrayLikeToArray(r, a); - var t = {}.toString.call(r).slice(8, -1); - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; - } -} -__name(_unsupportedIterableToArray, "_unsupportedIterableToArray"); -function _iterableToArray(r) { - if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); -} -__name(_iterableToArray, "_iterableToArray"); -function _arrayWithoutHoles(r) { - if (Array.isArray(r)) return _arrayLikeToArray(r); -} -__name(_arrayWithoutHoles, "_arrayWithoutHoles"); -function _arrayLikeToArray(r, a) { - (null == a || a > r.length) && (a = r.length); - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; - return n; -} -__name(_arrayLikeToArray, "_arrayLikeToArray"); -var script = { - name: "DataTable", - "extends": script$c, - inheritAttrs: false, - emits: ["value-change", "update:first", "update:rows", "page", "update:sortField", "update:sortOrder", "update:multiSortMeta", "sort", "filter", "row-click", "row-dblclick", "update:selection", "row-select", "row-unselect", "update:contextMenuSelection", "row-contextmenu", "row-unselect-all", "row-select-all", "select-all-change", "column-resize-end", "column-reorder", "row-reorder", "update:expandedRows", "row-collapse", "row-expand", "update:expandedRowGroups", "rowgroup-collapse", "rowgroup-expand", "update:filters", "state-restore", "state-save", "cell-edit-init", "cell-edit-complete", "cell-edit-cancel", "update:editingRows", "row-edit-init", "row-edit-save", "row-edit-cancel"], - provide: /* @__PURE__ */ __name(function provide7() { - return { - $columns: this.d_columns, - $columnGroups: this.d_columnGroups - }; - }, "provide"), - data: /* @__PURE__ */ __name(function data11() { - return { - d_first: this.first, - d_rows: this.rows, - d_sortField: this.sortField, - d_sortOrder: this.sortOrder, - d_nullSortOrder: this.nullSortOrder, - d_multiSortMeta: this.multiSortMeta ? _toConsumableArray(this.multiSortMeta) : [], - d_groupRowsSortMeta: null, - d_selectionKeys: null, - d_columnOrder: null, - d_editingRowKeys: null, - d_editingMeta: {}, - d_filters: this.cloneFilters(this.filters), - d_columns: new _default({ - type: "Column" - }), - d_columnGroups: new _default({ - type: "ColumnGroup" - }) - }; - }, "data"), - rowTouched: false, - anchorRowIndex: null, - rangeRowIndex: null, - documentColumnResizeListener: null, - documentColumnResizeEndListener: null, - lastResizeHelperX: null, - resizeColumnElement: null, - columnResizing: false, - colReorderIconWidth: null, - colReorderIconHeight: null, - draggedColumn: null, - draggedColumnElement: null, - draggedRowIndex: null, - droppedRowIndex: null, - rowDragging: null, - columnWidthsState: null, - tableWidthState: null, - columnWidthsRestored: false, - watch: { - first: /* @__PURE__ */ __name(function first3(newValue) { - this.d_first = newValue; - }, "first"), - rows: /* @__PURE__ */ __name(function rows2(newValue) { - this.d_rows = newValue; - }, "rows"), - sortField: /* @__PURE__ */ __name(function sortField(newValue) { - this.d_sortField = newValue; - }, "sortField"), - sortOrder: /* @__PURE__ */ __name(function sortOrder(newValue) { - this.d_sortOrder = newValue; - }, "sortOrder"), - nullSortOrder: /* @__PURE__ */ __name(function nullSortOrder(newValue) { - this.d_nullSortOrder = newValue; - }, "nullSortOrder"), - multiSortMeta: /* @__PURE__ */ __name(function multiSortMeta(newValue) { - this.d_multiSortMeta = newValue; - }, "multiSortMeta"), - selection: { - immediate: true, - handler: /* @__PURE__ */ __name(function handler2(newValue) { - if (this.dataKey) { - this.updateSelectionKeys(newValue); - } - }, "handler") - }, - editingRows: { - immediate: true, - handler: /* @__PURE__ */ __name(function handler3(newValue) { - if (this.dataKey) { - this.updateEditingRowKeys(newValue); - } - }, "handler") - }, - filters: { - deep: true, - handler: /* @__PURE__ */ __name(function handler4(newValue) { - this.d_filters = this.cloneFilters(newValue); - }, "handler") - } - }, - mounted: /* @__PURE__ */ __name(function mounted8() { - if (this.isStateful()) { - this.restoreState(); - this.resizableColumns && this.restoreColumnWidths(); - } - if (this.editMode === "row" && this.dataKey && !this.d_editingRowKeys) { - this.updateEditingRowKeys(this.editingRows); - } - }, "mounted"), - beforeUnmount: /* @__PURE__ */ __name(function beforeUnmount5() { - this.unbindColumnResizeEvents(); - this.destroyStyleElement(); - this.d_columns.clear(); - this.d_columnGroups.clear(); - }, "beforeUnmount"), - updated: /* @__PURE__ */ __name(function updated5() { - if (this.isStateful()) { - this.saveState(); - } - if (this.editMode === "row" && this.dataKey && !this.d_editingRowKeys) { - this.updateEditingRowKeys(this.editingRows); - } - }, "updated"), - methods: { - columnProp: /* @__PURE__ */ __name(function columnProp7(col, prop) { - return getVNodeProp(col, prop); - }, "columnProp"), - onPage: /* @__PURE__ */ __name(function onPage(event2) { - var _this = this; - this.clearEditingMetaData(); - this.d_first = event2.first; - this.d_rows = event2.rows; - var pageEvent = this.createLazyLoadEvent(event2); - pageEvent.pageCount = event2.pageCount; - pageEvent.page = event2.page; - this.$emit("update:first", this.d_first); - this.$emit("update:rows", this.d_rows); - this.$emit("page", pageEvent); - this.$nextTick(function() { - _this.$emit("value-change", _this.processedData); - }); - }, "onPage"), - onColumnHeaderClick: /* @__PURE__ */ __name(function onColumnHeaderClick(e) { - var _this2 = this; - var event2 = e.originalEvent; - var column = e.column; - if (this.columnProp(column, "sortable")) { - var targetNode = event2.target; - var columnField = this.columnProp(column, "sortField") || this.columnProp(column, "field"); - if (getAttribute(targetNode, "data-p-sortable-column") === true || getAttribute(targetNode, "data-pc-section") === "columntitle" || getAttribute(targetNode, "data-pc-section") === "columnheadercontent" || getAttribute(targetNode, "data-pc-section") === "sorticon" || getAttribute(targetNode.parentElement, "data-pc-section") === "sorticon" || getAttribute(targetNode.parentElement.parentElement, "data-pc-section") === "sorticon" || targetNode.closest('[data-p-sortable-column="true"]') && !targetNode.closest('[data-pc-section="columnfilterbutton"]') && !isClickable(event2.target)) { - clearSelection(); - if (this.sortMode === "single") { - if (this.d_sortField === columnField) { - if (this.removableSort && this.d_sortOrder * -1 === this.defaultSortOrder) { - this.d_sortOrder = null; - this.d_sortField = null; - } else { - this.d_sortOrder = this.d_sortOrder * -1; - } - } else { - this.d_sortOrder = this.defaultSortOrder; - this.d_sortField = columnField; - } - this.$emit("update:sortField", this.d_sortField); - this.$emit("update:sortOrder", this.d_sortOrder); - this.resetPage(); - } else if (this.sortMode === "multiple") { - var metaKey = event2.metaKey || event2.ctrlKey; - if (!metaKey) { - this.d_multiSortMeta = this.d_multiSortMeta.filter(function(meta) { - return meta.field === columnField; - }); - } - this.addMultiSortField(columnField); - this.$emit("update:multiSortMeta", this.d_multiSortMeta); - } - this.$emit("sort", this.createLazyLoadEvent(event2)); - this.$nextTick(function() { - _this2.$emit("value-change", _this2.processedData); - }); - } - } - }, "onColumnHeaderClick"), - sortSingle: /* @__PURE__ */ __name(function sortSingle(value) { - var _this3 = this; - this.clearEditingMetaData(); - if (this.groupRowsBy && this.groupRowsBy === this.sortField) { - this.d_multiSortMeta = [{ - field: this.sortField, - order: this.sortOrder || this.defaultSortOrder - }, { - field: this.d_sortField, - order: this.d_sortOrder - }]; - return this.sortMultiple(value); - } - var data12 = _toConsumableArray(value); - var resolvedFieldData = /* @__PURE__ */ new Map(); - var _iterator = _createForOfIteratorHelper(data12), _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done; ) { - var item = _step.value; - resolvedFieldData.set(item, resolveFieldData(item, this.d_sortField)); - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - var comparer = localeComparator(); - data12.sort(function(data1, data22) { - var value1 = resolvedFieldData.get(data1); - var value2 = resolvedFieldData.get(data22); - return sort(value1, value2, _this3.d_sortOrder, comparer, _this3.d_nullSortOrder); - }); - return data12; - }, "sortSingle"), - sortMultiple: /* @__PURE__ */ __name(function sortMultiple(value) { - var _this4 = this; - this.clearEditingMetaData(); - if (this.groupRowsBy && (this.d_groupRowsSortMeta || this.d_multiSortMeta.length && this.groupRowsBy === this.d_multiSortMeta[0].field)) { - var firstSortMeta = this.d_multiSortMeta[0]; - !this.d_groupRowsSortMeta && (this.d_groupRowsSortMeta = firstSortMeta); - if (firstSortMeta.field !== this.d_groupRowsSortMeta.field) { - this.d_multiSortMeta = [this.d_groupRowsSortMeta].concat(_toConsumableArray(this.d_multiSortMeta)); - } - } - var data12 = _toConsumableArray(value); - data12.sort(function(data1, data22) { - return _this4.multisortField(data1, data22, 0); - }); - return data12; - }, "sortMultiple"), - multisortField: /* @__PURE__ */ __name(function multisortField(data1, data22, index) { - var value1 = resolveFieldData(data1, this.d_multiSortMeta[index].field); - var value2 = resolveFieldData(data22, this.d_multiSortMeta[index].field); - var comparer = localeComparator(); - if (value1 === value2) { - return this.d_multiSortMeta.length - 1 > index ? this.multisortField(data1, data22, index + 1) : 0; - } - return sort(value1, value2, this.d_multiSortMeta[index].order, comparer, this.d_nullSortOrder); - }, "multisortField"), - addMultiSortField: /* @__PURE__ */ __name(function addMultiSortField(field2) { - var index = this.d_multiSortMeta.findIndex(function(meta) { - return meta.field === field2; - }); - if (index >= 0) { - if (this.removableSort && this.d_multiSortMeta[index].order * -1 === this.defaultSortOrder) this.d_multiSortMeta.splice(index, 1); - else this.d_multiSortMeta[index] = { - field: field2, - order: this.d_multiSortMeta[index].order * -1 - }; - } else { - this.d_multiSortMeta.push({ - field: field2, - order: this.defaultSortOrder - }); - } - this.d_multiSortMeta = _toConsumableArray(this.d_multiSortMeta); - }, "addMultiSortField"), - getActiveFilters: /* @__PURE__ */ __name(function getActiveFilters(filters) { - var removeEmptyFilters = /* @__PURE__ */ __name(function removeEmptyFilters2(_ref) { - var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1]; - if (value.constraints) { - var filteredConstraints = value.constraints.filter(function(constraint) { - return constraint.value !== null; - }); - if (filteredConstraints.length > 0) { - return [key, _objectSpread$1(_objectSpread$1({}, value), {}, { - constraints: filteredConstraints - })]; - } - } else if (value.value !== null) { - return [key, value]; - } - return void 0; - }, "removeEmptyFilters"); - var filterValidEntries = /* @__PURE__ */ __name(function filterValidEntries2(entry) { - return entry !== void 0; - }, "filterValidEntries"); - var entries = Object.entries(filters).map(removeEmptyFilters).filter(filterValidEntries); - return Object.fromEntries(entries); - }, "getActiveFilters"), - filter: /* @__PURE__ */ __name(function filter2(data12) { - var _this5 = this; - if (!data12) { - return; - } - this.clearEditingMetaData(); - var activeFilters = this.getActiveFilters(this.filters); - var globalFilterFieldsArray; - if (activeFilters["global"]) { - globalFilterFieldsArray = this.globalFilterFields || this.columns.map(function(col) { - return _this5.columnProp(col, "filterField") || _this5.columnProp(col, "field"); - }); - } - var filteredValue = []; - for (var i = 0; i < data12.length; i++) { - var localMatch = true; - var globalMatch = false; - var localFiltered = false; - for (var prop in activeFilters) { - if (Object.prototype.hasOwnProperty.call(activeFilters, prop) && prop !== "global") { - localFiltered = true; - var filterField = prop; - var filterMeta = activeFilters[filterField]; - if (filterMeta.operator) { - var _iterator2 = _createForOfIteratorHelper(filterMeta.constraints), _step2; - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) { - var filterConstraint2 = _step2.value; - localMatch = this.executeLocalFilter(filterField, data12[i], filterConstraint2); - if (filterMeta.operator === FilterOperator.OR && localMatch || filterMeta.operator === FilterOperator.AND && !localMatch) { - break; - } - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - } else { - localMatch = this.executeLocalFilter(filterField, data12[i], filterMeta); - } - if (!localMatch) { - break; - } - } - } - if (localMatch && activeFilters["global"] && !globalMatch && globalFilterFieldsArray) { - for (var j = 0; j < globalFilterFieldsArray.length; j++) { - var globalFilterField = globalFilterFieldsArray[j]; - globalMatch = FilterService.filters[activeFilters["global"].matchMode || FilterMatchMode.CONTAINS](resolveFieldData(data12[i], globalFilterField), activeFilters["global"].value, this.filterLocale); - if (globalMatch) { - break; - } - } - } - var matches = void 0; - if (activeFilters["global"]) { - matches = localFiltered ? localFiltered && localMatch && globalMatch : globalMatch; - } else { - matches = localFiltered && localMatch; - } - if (matches) { - filteredValue.push(data12[i]); - } - } - if (filteredValue.length === this.value.length || Object.keys(activeFilters).length == 0) { - filteredValue = data12; - } - var filterEvent = this.createLazyLoadEvent(); - filterEvent.filteredValue = filteredValue; - this.$emit("filter", filterEvent); - this.$nextTick(function() { - _this5.$emit("value-change", _this5.processedData); - }); - return filteredValue; - }, "filter"), - executeLocalFilter: /* @__PURE__ */ __name(function executeLocalFilter(field2, rowData, filterMeta) { - var filterValue = filterMeta.value; - var filterMatchMode = filterMeta.matchMode || FilterMatchMode.STARTS_WITH; - var dataFieldValue = resolveFieldData(rowData, field2); - var filterConstraint2 = FilterService.filters[filterMatchMode]; - return filterConstraint2(dataFieldValue, filterValue, this.filterLocale); - }, "executeLocalFilter"), - onRowClick: /* @__PURE__ */ __name(function onRowClick2(e) { - var event2 = e.originalEvent; - var body = this.$refs.bodyRef && this.$refs.bodyRef.$el; - var focusedItem = findSingle(body, 'tr[data-p-selectable-row="true"][tabindex="0"]'); - if (isClickable(event2.target)) { - return; - } - this.$emit("row-click", e); - if (this.selectionMode) { - var rowData = e.data; - var rowIndex2 = this.d_first + e.index; - if (this.isMultipleSelectionMode() && event2.shiftKey && this.anchorRowIndex != null) { - clearSelection(); - this.rangeRowIndex = rowIndex2; - this.selectRange(event2); - } else { - var selected = this.isSelected(rowData); - var metaSelection = this.rowTouched ? false : this.metaKeySelection; - this.anchorRowIndex = rowIndex2; - this.rangeRowIndex = rowIndex2; - if (metaSelection) { - var metaKey = event2.metaKey || event2.ctrlKey; - if (selected && metaKey) { - if (this.isSingleSelectionMode()) { - this.$emit("update:selection", null); - } else { - var selectionIndex = this.findIndexInSelection(rowData); - var _selection = this.selection.filter(function(val, i) { - return i != selectionIndex; - }); - this.$emit("update:selection", _selection); - } - this.$emit("row-unselect", { - originalEvent: event2, - data: rowData, - index: rowIndex2, - type: "row" - }); - } else { - if (this.isSingleSelectionMode()) { - this.$emit("update:selection", rowData); - } else if (this.isMultipleSelectionMode()) { - var _selection2 = metaKey ? this.selection || [] : []; - _selection2 = [].concat(_toConsumableArray(_selection2), [rowData]); - this.$emit("update:selection", _selection2); - } - this.$emit("row-select", { - originalEvent: event2, - data: rowData, - index: rowIndex2, - type: "row" - }); - } - } else { - if (this.selectionMode === "single") { - if (selected) { - this.$emit("update:selection", null); - this.$emit("row-unselect", { - originalEvent: event2, - data: rowData, - index: rowIndex2, - type: "row" - }); - } else { - this.$emit("update:selection", rowData); - this.$emit("row-select", { - originalEvent: event2, - data: rowData, - index: rowIndex2, - type: "row" - }); - } - } else if (this.selectionMode === "multiple") { - if (selected) { - var _selectionIndex = this.findIndexInSelection(rowData); - var _selection3 = this.selection.filter(function(val, i) { - return i != _selectionIndex; - }); - this.$emit("update:selection", _selection3); - this.$emit("row-unselect", { - originalEvent: event2, - data: rowData, - index: rowIndex2, - type: "row" - }); - } else { - var _selection4 = this.selection ? [].concat(_toConsumableArray(this.selection), [rowData]) : [rowData]; - this.$emit("update:selection", _selection4); - this.$emit("row-select", { - originalEvent: event2, - data: rowData, - index: rowIndex2, - type: "row" - }); - } - } - } - } - } - this.rowTouched = false; - if (focusedItem) { - var _event$target, _event$currentTarget; - if (((_event$target = event2.target) === null || _event$target === void 0 ? void 0 : _event$target.getAttribute("data-pc-section")) === "rowtoggleicon") return; - var targetRow = (_event$currentTarget = event2.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.closest('tr[data-p-selectable-row="true"]'); - focusedItem.tabIndex = "-1"; - if (targetRow) targetRow.tabIndex = "0"; - } - }, "onRowClick"), - onRowDblClick: /* @__PURE__ */ __name(function onRowDblClick2(e) { - var event2 = e.originalEvent; - if (isClickable(event2.target)) { - return; - } - this.$emit("row-dblclick", e); - }, "onRowDblClick"), - onRowRightClick: /* @__PURE__ */ __name(function onRowRightClick2(event2) { - if (this.contextMenu) { - clearSelection(); - event2.originalEvent.target.focus(); - } - this.$emit("update:contextMenuSelection", event2.data); - this.$emit("row-contextmenu", event2); - }, "onRowRightClick"), - onRowTouchEnd: /* @__PURE__ */ __name(function onRowTouchEnd2() { - this.rowTouched = true; - }, "onRowTouchEnd"), - onRowKeyDown: /* @__PURE__ */ __name(function onRowKeyDown2(e, slotProps) { - var event2 = e.originalEvent; - var rowData = e.data; - var rowIndex2 = e.index; - var metaKey = event2.metaKey || event2.ctrlKey; - if (this.selectionMode) { - var row2 = event2.target; - switch (event2.code) { - case "ArrowDown": - this.onArrowDownKey(event2, row2, rowIndex2, slotProps); - break; - case "ArrowUp": - this.onArrowUpKey(event2, row2, rowIndex2, slotProps); - break; - case "Home": - this.onHomeKey(event2, row2, rowIndex2, slotProps); - break; - case "End": - this.onEndKey(event2, row2, rowIndex2, slotProps); - break; - case "Enter": - case "NumpadEnter": - this.onEnterKey(event2, rowData, rowIndex2); - break; - case "Space": - this.onSpaceKey(event2, rowData, rowIndex2, slotProps); - break; - case "Tab": - this.onTabKey(event2, rowIndex2); - break; - default: - if (event2.code === "KeyA" && metaKey && this.isMultipleSelectionMode()) { - var data12 = this.dataToRender(slotProps.rows); - this.$emit("update:selection", data12); - } - event2.preventDefault(); - break; - } - } - }, "onRowKeyDown"), - onArrowDownKey: /* @__PURE__ */ __name(function onArrowDownKey(event2, row2, rowIndex2, slotProps) { - var nextRow = this.findNextSelectableRow(row2); - nextRow && this.focusRowChange(row2, nextRow); - if (event2.shiftKey) { - var data12 = this.dataToRender(slotProps.rows); - var nextRowIndex = rowIndex2 + 1 >= data12.length ? data12.length - 1 : rowIndex2 + 1; - this.onRowClick({ - originalEvent: event2, - data: data12[nextRowIndex], - index: nextRowIndex - }); - } - event2.preventDefault(); - }, "onArrowDownKey"), - onArrowUpKey: /* @__PURE__ */ __name(function onArrowUpKey(event2, row2, rowIndex2, slotProps) { - var prevRow = this.findPrevSelectableRow(row2); - prevRow && this.focusRowChange(row2, prevRow); - if (event2.shiftKey) { - var data12 = this.dataToRender(slotProps.rows); - var prevRowIndex = rowIndex2 - 1 <= 0 ? 0 : rowIndex2 - 1; - this.onRowClick({ - originalEvent: event2, - data: data12[prevRowIndex], - index: prevRowIndex - }); - } - event2.preventDefault(); - }, "onArrowUpKey"), - onHomeKey: /* @__PURE__ */ __name(function onHomeKey(event2, row2, rowIndex2, slotProps) { - var firstRow = this.findFirstSelectableRow(); - firstRow && this.focusRowChange(row2, firstRow); - if (event2.ctrlKey && event2.shiftKey) { - var data12 = this.dataToRender(slotProps.rows); - this.$emit("update:selection", data12.slice(0, rowIndex2 + 1)); - } - event2.preventDefault(); - }, "onHomeKey"), - onEndKey: /* @__PURE__ */ __name(function onEndKey(event2, row2, rowIndex2, slotProps) { - var lastRow = this.findLastSelectableRow(); - lastRow && this.focusRowChange(row2, lastRow); - if (event2.ctrlKey && event2.shiftKey) { - var data12 = this.dataToRender(slotProps.rows); - this.$emit("update:selection", data12.slice(rowIndex2, data12.length)); - } - event2.preventDefault(); - }, "onEndKey"), - onEnterKey: /* @__PURE__ */ __name(function onEnterKey(event2, rowData, rowIndex2) { - this.onRowClick({ - originalEvent: event2, - data: rowData, - index: rowIndex2 - }); - event2.preventDefault(); - }, "onEnterKey"), - onSpaceKey: /* @__PURE__ */ __name(function onSpaceKey(event2, rowData, rowIndex2, slotProps) { - this.onEnterKey(event2, rowData, rowIndex2); - if (event2.shiftKey && this.selection !== null) { - var data12 = this.dataToRender(slotProps.rows); - var index; - if (this.selection.length > 0) { - var firstSelectedRowIndex, lastSelectedRowIndex; - firstSelectedRowIndex = findIndexInList(this.selection[0], data12); - lastSelectedRowIndex = findIndexInList(this.selection[this.selection.length - 1], data12); - index = rowIndex2 <= firstSelectedRowIndex ? lastSelectedRowIndex : firstSelectedRowIndex; - } else { - index = findIndexInList(this.selection, data12); - } - var _selection = index !== rowIndex2 ? data12.slice(Math.min(index, rowIndex2), Math.max(index, rowIndex2) + 1) : rowData; - this.$emit("update:selection", _selection); - } - }, "onSpaceKey"), - onTabKey: /* @__PURE__ */ __name(function onTabKey(event2, rowIndex2) { - var body = this.$refs.bodyRef && this.$refs.bodyRef.$el; - var rows3 = find(body, 'tr[data-p-selectable-row="true"]'); - if (event2.code === "Tab" && rows3 && rows3.length > 0) { - var firstSelectedRow = findSingle(body, 'tr[data-p-selected="true"]'); - var focusedItem = findSingle(body, 'tr[data-p-selectable-row="true"][tabindex="0"]'); - if (firstSelectedRow) { - firstSelectedRow.tabIndex = "0"; - focusedItem && focusedItem !== firstSelectedRow && (focusedItem.tabIndex = "-1"); - } else { - rows3[0].tabIndex = "0"; - focusedItem !== rows3[0] && (rows3[rowIndex2].tabIndex = "-1"); - } - } - }, "onTabKey"), - findNextSelectableRow: /* @__PURE__ */ __name(function findNextSelectableRow(row2) { - var nextRow = row2.nextElementSibling; - if (nextRow) { - if (getAttribute(nextRow, "data-p-selectable-row") === true) return nextRow; - else return this.findNextSelectableRow(nextRow); - } else { - return null; - } - }, "findNextSelectableRow"), - findPrevSelectableRow: /* @__PURE__ */ __name(function findPrevSelectableRow(row2) { - var prevRow = row2.previousElementSibling; - if (prevRow) { - if (getAttribute(prevRow, "data-p-selectable-row") === true) return prevRow; - else return this.findPrevSelectableRow(prevRow); - } else { - return null; - } - }, "findPrevSelectableRow"), - findFirstSelectableRow: /* @__PURE__ */ __name(function findFirstSelectableRow() { - var firstRow = findSingle(this.$refs.table, 'tr[data-p-selectable-row="true"]'); - return firstRow; - }, "findFirstSelectableRow"), - findLastSelectableRow: /* @__PURE__ */ __name(function findLastSelectableRow() { - var rows3 = find(this.$refs.table, 'tr[data-p-selectable-row="true"]'); - return rows3 ? rows3[rows3.length - 1] : null; - }, "findLastSelectableRow"), - focusRowChange: /* @__PURE__ */ __name(function focusRowChange(firstFocusableRow, currentFocusedRow) { - firstFocusableRow.tabIndex = "-1"; - currentFocusedRow.tabIndex = "0"; - focus(currentFocusedRow); - }, "focusRowChange"), - toggleRowWithRadio: /* @__PURE__ */ __name(function toggleRowWithRadio2(event2) { - var rowData = event2.data; - if (this.isSelected(rowData)) { - this.$emit("update:selection", null); - this.$emit("row-unselect", { - originalEvent: event2.originalEvent, - data: rowData, - index: event2.index, - type: "radiobutton" - }); - } else { - this.$emit("update:selection", rowData); - this.$emit("row-select", { - originalEvent: event2.originalEvent, - data: rowData, - index: event2.index, - type: "radiobutton" - }); - } - }, "toggleRowWithRadio"), - toggleRowWithCheckbox: /* @__PURE__ */ __name(function toggleRowWithCheckbox2(event2) { - var rowData = event2.data; - if (this.isSelected(rowData)) { - var selectionIndex = this.findIndexInSelection(rowData); - var _selection = this.selection.filter(function(val, i) { - return i != selectionIndex; - }); - this.$emit("update:selection", _selection); - this.$emit("row-unselect", { - originalEvent: event2.originalEvent, - data: rowData, - index: event2.index, - type: "checkbox" - }); - } else { - var _selection5 = this.selection ? _toConsumableArray(this.selection) : []; - _selection5 = [].concat(_toConsumableArray(_selection5), [rowData]); - this.$emit("update:selection", _selection5); - this.$emit("row-select", { - originalEvent: event2.originalEvent, - data: rowData, - index: event2.index, - type: "checkbox" - }); - } - }, "toggleRowWithCheckbox"), - toggleRowsWithCheckbox: /* @__PURE__ */ __name(function toggleRowsWithCheckbox(event2) { - if (this.selectAll !== null) { - this.$emit("select-all-change", event2); - } else { - var originalEvent = event2.originalEvent, checked2 = event2.checked; - var _selection = []; - if (checked2) { - _selection = this.frozenValue ? [].concat(_toConsumableArray(this.frozenValue), _toConsumableArray(this.processedData)) : this.processedData; - this.$emit("row-select-all", { - originalEvent, - data: _selection - }); - } else { - this.$emit("row-unselect-all", { - originalEvent - }); - } - this.$emit("update:selection", _selection); - } - }, "toggleRowsWithCheckbox"), - isSingleSelectionMode: /* @__PURE__ */ __name(function isSingleSelectionMode() { - return this.selectionMode === "single"; - }, "isSingleSelectionMode"), - isMultipleSelectionMode: /* @__PURE__ */ __name(function isMultipleSelectionMode() { - return this.selectionMode === "multiple"; - }, "isMultipleSelectionMode"), - isSelected: /* @__PURE__ */ __name(function isSelected2(rowData) { - if (rowData && this.selection) { - if (this.dataKey) { - return this.d_selectionKeys ? this.d_selectionKeys[resolveFieldData(rowData, this.dataKey)] !== void 0 : false; - } else { - if (this.selection instanceof Array) return this.findIndexInSelection(rowData) > -1; - else return this.equals(rowData, this.selection); - } - } - return false; - }, "isSelected"), - findIndexInSelection: /* @__PURE__ */ __name(function findIndexInSelection2(rowData) { - return this.findIndex(rowData, this.selection); - }, "findIndexInSelection"), - findIndex: /* @__PURE__ */ __name(function findIndex2(rowData, collection) { - var index = -1; - if (collection && collection.length) { - for (var i = 0; i < collection.length; i++) { - if (this.equals(rowData, collection[i])) { - index = i; - break; - } - } - } - return index; - }, "findIndex"), - updateSelectionKeys: /* @__PURE__ */ __name(function updateSelectionKeys(selection) { - this.d_selectionKeys = {}; - if (Array.isArray(selection)) { - var _iterator3 = _createForOfIteratorHelper(selection), _step3; - try { - for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) { - var data12 = _step3.value; - this.d_selectionKeys[String(resolveFieldData(data12, this.dataKey))] = 1; - } - } catch (err) { - _iterator3.e(err); - } finally { - _iterator3.f(); - } - } else { - this.d_selectionKeys[String(resolveFieldData(selection, this.dataKey))] = 1; - } - }, "updateSelectionKeys"), - updateEditingRowKeys: /* @__PURE__ */ __name(function updateEditingRowKeys(editingRows) { - if (editingRows && editingRows.length) { - this.d_editingRowKeys = {}; - var _iterator4 = _createForOfIteratorHelper(editingRows), _step4; - try { - for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) { - var data12 = _step4.value; - this.d_editingRowKeys[String(resolveFieldData(data12, this.dataKey))] = 1; - } - } catch (err) { - _iterator4.e(err); - } finally { - _iterator4.f(); - } - } else { - this.d_editingRowKeys = null; - } - }, "updateEditingRowKeys"), - equals: /* @__PURE__ */ __name(function equals$12(data1, data22) { - return this.compareSelectionBy === "equals" ? data1 === data22 : equals(data1, data22, this.dataKey); - }, "equals$1"), - selectRange: /* @__PURE__ */ __name(function selectRange(event2) { - var rangeStart, rangeEnd; - if (this.rangeRowIndex > this.anchorRowIndex) { - rangeStart = this.anchorRowIndex; - rangeEnd = this.rangeRowIndex; - } else if (this.rangeRowIndex < this.anchorRowIndex) { - rangeStart = this.rangeRowIndex; - rangeEnd = this.anchorRowIndex; - } else { - rangeStart = this.rangeRowIndex; - rangeEnd = this.rangeRowIndex; - } - if (this.lazy && this.paginator) { - rangeStart -= this.first; - rangeEnd -= this.first; - } - var value = this.processedData; - var _selection = []; - for (var i = rangeStart; i <= rangeEnd; i++) { - var rangeRowData = value[i]; - _selection.push(rangeRowData); - this.$emit("row-select", { - originalEvent: event2, - data: rangeRowData, - type: "row" - }); - } - this.$emit("update:selection", _selection); - }, "selectRange"), - exportCSV: /* @__PURE__ */ __name(function exportCSV$1(options, data12) { - var _this6 = this; - var csv = "\uFEFF"; - if (!data12) { - data12 = this.processedData; - if (options && options.selectionOnly) data12 = this.selection || []; - else if (this.frozenValue) data12 = data12 ? [].concat(_toConsumableArray(this.frozenValue), _toConsumableArray(data12)) : this.frozenValue; - } - var headerInitiated = false; - for (var i = 0; i < this.columns.length; i++) { - var column = this.columns[i]; - if (this.columnProp(column, "exportable") !== false && this.columnProp(column, "field")) { - if (headerInitiated) csv += this.csvSeparator; - else headerInitiated = true; - csv += '"' + (this.columnProp(column, "exportHeader") || this.columnProp(column, "header") || this.columnProp(column, "field")) + '"'; - } - } - if (data12) { - data12.forEach(function(record) { - csv += "\n"; - var rowInitiated = false; - for (var _i = 0; _i < _this6.columns.length; _i++) { - var _column = _this6.columns[_i]; - if (_this6.columnProp(_column, "exportable") !== false && _this6.columnProp(_column, "field")) { - if (rowInitiated) csv += _this6.csvSeparator; - else rowInitiated = true; - var cellData = resolveFieldData(record, _this6.columnProp(_column, "field")); - if (cellData != null) { - if (_this6.exportFunction) { - cellData = _this6.exportFunction({ - data: cellData, - field: _this6.columnProp(_column, "field") - }); - } else cellData = String(cellData).replace(/"/g, '""'); - } else cellData = ""; - csv += '"' + cellData + '"'; - } - } - }); - } - var footerInitiated = false; - for (var _i2 = 0; _i2 < this.columns.length; _i2++) { - var _column2 = this.columns[_i2]; - if (_i2 === 0) csv += "\n"; - if (this.columnProp(_column2, "exportable") !== false && this.columnProp(_column2, "exportFooter")) { - if (footerInitiated) csv += this.csvSeparator; - else footerInitiated = true; - csv += '"' + (this.columnProp(_column2, "exportFooter") || this.columnProp(_column2, "footer") || this.columnProp(_column2, "field")) + '"'; - } - } - exportCSV(csv, this.exportFilename); - }, "exportCSV$1"), - resetPage: /* @__PURE__ */ __name(function resetPage() { - this.d_first = 0; - this.$emit("update:first", this.d_first); - }, "resetPage"), - onColumnResizeStart: /* @__PURE__ */ __name(function onColumnResizeStart(event2) { - var containerLeft = getOffset(this.$el).left; - this.resizeColumnElement = event2.target.parentElement; - this.columnResizing = true; - this.lastResizeHelperX = event2.pageX - containerLeft + this.$el.scrollLeft; - this.bindColumnResizeEvents(); - }, "onColumnResizeStart"), - onColumnResize: /* @__PURE__ */ __name(function onColumnResize(event2) { - var containerLeft = getOffset(this.$el).left; - this.$el.setAttribute("data-p-unselectable-text", "true"); - !this.isUnstyled && addStyle(this.$el, { - "user-select": "none" - }); - this.$refs.resizeHelper.style.height = this.$el.offsetHeight + "px"; - this.$refs.resizeHelper.style.top = "0px"; - this.$refs.resizeHelper.style.left = event2.pageX - containerLeft + this.$el.scrollLeft + "px"; - this.$refs.resizeHelper.style.display = "block"; - }, "onColumnResize"), - onColumnResizeEnd: /* @__PURE__ */ __name(function onColumnResizeEnd() { - var delta = isRTL(this.$el) ? this.lastResizeHelperX - this.$refs.resizeHelper.offsetLeft : this.$refs.resizeHelper.offsetLeft - this.lastResizeHelperX; - var columnWidth = this.resizeColumnElement.offsetWidth; - var newColumnWidth = columnWidth + delta; - var minWidth = this.resizeColumnElement.style.minWidth || 15; - if (columnWidth + delta > parseInt(minWidth, 10)) { - if (this.columnResizeMode === "fit") { - var nextColumn = this.resizeColumnElement.nextElementSibling; - var nextColumnWidth = nextColumn.offsetWidth - delta; - if (newColumnWidth > 15 && nextColumnWidth > 15) { - this.resizeTableCells(newColumnWidth, nextColumnWidth); - } - } else if (this.columnResizeMode === "expand") { - var tableWidth = this.$refs.table.offsetWidth + delta + "px"; - var updateTableWidth = /* @__PURE__ */ __name(function updateTableWidth2(el) { - !!el && (el.style.width = el.style.minWidth = tableWidth); - }, "updateTableWidth"); - this.resizeTableCells(newColumnWidth); - updateTableWidth(this.$refs.table); - if (!this.virtualScrollerDisabled) { - var body = this.$refs.bodyRef && this.$refs.bodyRef.$el; - var frozenBody = this.$refs.frozenBodyRef && this.$refs.frozenBodyRef.$el; - updateTableWidth(body); - updateTableWidth(frozenBody); - } - } - this.$emit("column-resize-end", { - element: this.resizeColumnElement, - delta - }); - } - this.$refs.resizeHelper.style.display = "none"; - this.resizeColumn = null; - this.$el.removeAttribute("data-p-unselectable-text"); - !this.isUnstyled && (this.$el.style["user-select"] = ""); - this.unbindColumnResizeEvents(); - if (this.isStateful()) { - this.saveState(); - } - }, "onColumnResizeEnd"), - resizeTableCells: /* @__PURE__ */ __name(function resizeTableCells(newColumnWidth, nextColumnWidth) { - var colIndex = getIndex(this.resizeColumnElement); - var widths = []; - var headers = find(this.$refs.table, 'thead[data-pc-section="thead"] > tr > th'); - headers.forEach(function(header) { - return widths.push(getOuterWidth(header)); - }); - this.destroyStyleElement(); - this.createStyleElement(); - var innerHTML = ""; - var selector = '[data-pc-name="datatable"]['.concat(this.$attrSelector, '] > [data-pc-section="tablecontainer"] ').concat(this.virtualScrollerDisabled ? "" : '> [data-pc-name="virtualscroller"]', ' > table[data-pc-section="table"]'); - widths.forEach(function(width, index) { - var colWidth = index === colIndex ? newColumnWidth : nextColumnWidth && index === colIndex + 1 ? nextColumnWidth : width; - var style = "width: ".concat(colWidth, "px !important; max-width: ").concat(colWidth, "px !important"); - innerHTML += "\n ".concat(selector, ' > thead[data-pc-section="thead"] > tr > th:nth-child(').concat(index + 1, "),\n ").concat(selector, ' > tbody[data-pc-section="tbody"] > tr > td:nth-child(').concat(index + 1, "),\n ").concat(selector, ' > tfoot[data-pc-section="tfoot"] > tr > td:nth-child(').concat(index + 1, ") {\n ").concat(style, "\n }\n "); - }); - this.styleElement.innerHTML = innerHTML; - }, "resizeTableCells"), - bindColumnResizeEvents: /* @__PURE__ */ __name(function bindColumnResizeEvents() { - var _this7 = this; - if (!this.documentColumnResizeListener) { - this.documentColumnResizeListener = document.addEventListener("mousemove", function() { - if (_this7.columnResizing) { - _this7.onColumnResize(event); - } - }); - } - if (!this.documentColumnResizeEndListener) { - this.documentColumnResizeEndListener = document.addEventListener("mouseup", function() { - if (_this7.columnResizing) { - _this7.columnResizing = false; - _this7.onColumnResizeEnd(); - } - }); - } - }, "bindColumnResizeEvents"), - unbindColumnResizeEvents: /* @__PURE__ */ __name(function unbindColumnResizeEvents() { - if (this.documentColumnResizeListener) { - document.removeEventListener("document", this.documentColumnResizeListener); - this.documentColumnResizeListener = null; - } - if (this.documentColumnResizeEndListener) { - document.removeEventListener("document", this.documentColumnResizeEndListener); - this.documentColumnResizeEndListener = null; - } - }, "unbindColumnResizeEvents"), - onColumnHeaderMouseDown: /* @__PURE__ */ __name(function onColumnHeaderMouseDown(e) { - var event2 = e.originalEvent; - var column = e.column; - if (this.reorderableColumns && this.columnProp(column, "reorderableColumn") !== false) { - if (event2.target.nodeName === "INPUT" || event2.target.nodeName === "TEXTAREA" || getAttribute(event2.target, '[data-pc-section="columnresizer"]')) event2.currentTarget.draggable = false; - else event2.currentTarget.draggable = true; - } - }, "onColumnHeaderMouseDown"), - onColumnHeaderDragStart: /* @__PURE__ */ __name(function onColumnHeaderDragStart(e) { - var event2 = e.originalEvent, column = e.column; - if (this.columnResizing) { - event2.preventDefault(); - return; - } - this.colReorderIconWidth = getHiddenElementOuterWidth(this.$refs.reorderIndicatorUp); - this.colReorderIconHeight = getHiddenElementOuterHeight(this.$refs.reorderIndicatorUp); - this.draggedColumn = column; - this.draggedColumnElement = this.findParentHeader(event2.target); - event2.dataTransfer.setData("text", "b"); - }, "onColumnHeaderDragStart"), - onColumnHeaderDragOver: /* @__PURE__ */ __name(function onColumnHeaderDragOver(e) { - var event2 = e.originalEvent, column = e.column; - var dropHeader = this.findParentHeader(event2.target); - if (this.reorderableColumns && this.draggedColumnElement && dropHeader && !this.columnProp(column, "frozen")) { - event2.preventDefault(); - var containerOffset = getOffset(this.$el); - var dropHeaderOffset = getOffset(dropHeader); - if (this.draggedColumnElement !== dropHeader) { - var targetLeft = dropHeaderOffset.left - containerOffset.left; - var columnCenter = dropHeaderOffset.left + dropHeader.offsetWidth / 2; - this.$refs.reorderIndicatorUp.style.top = dropHeaderOffset.top - containerOffset.top - (this.colReorderIconHeight - 1) + "px"; - this.$refs.reorderIndicatorDown.style.top = dropHeaderOffset.top - containerOffset.top + dropHeader.offsetHeight + "px"; - if (event2.pageX > columnCenter) { - this.$refs.reorderIndicatorUp.style.left = targetLeft + dropHeader.offsetWidth - Math.ceil(this.colReorderIconWidth / 2) + "px"; - this.$refs.reorderIndicatorDown.style.left = targetLeft + dropHeader.offsetWidth - Math.ceil(this.colReorderIconWidth / 2) + "px"; - this.dropPosition = 1; - } else { - this.$refs.reorderIndicatorUp.style.left = targetLeft - Math.ceil(this.colReorderIconWidth / 2) + "px"; - this.$refs.reorderIndicatorDown.style.left = targetLeft - Math.ceil(this.colReorderIconWidth / 2) + "px"; - this.dropPosition = -1; - } - this.$refs.reorderIndicatorUp.style.display = "block"; - this.$refs.reorderIndicatorDown.style.display = "block"; - } - } - }, "onColumnHeaderDragOver"), - onColumnHeaderDragLeave: /* @__PURE__ */ __name(function onColumnHeaderDragLeave(e) { - var event2 = e.originalEvent; - if (this.reorderableColumns && this.draggedColumnElement) { - event2.preventDefault(); - this.$refs.reorderIndicatorUp.style.display = "none"; - this.$refs.reorderIndicatorDown.style.display = "none"; - } - }, "onColumnHeaderDragLeave"), - onColumnHeaderDrop: /* @__PURE__ */ __name(function onColumnHeaderDrop(e) { - var _this8 = this; - var event2 = e.originalEvent, column = e.column; - event2.preventDefault(); - if (this.draggedColumnElement) { - var dragIndex = getIndex(this.draggedColumnElement); - var dropIndex = getIndex(this.findParentHeader(event2.target)); - var allowDrop = dragIndex !== dropIndex; - if (allowDrop && (dropIndex - dragIndex === 1 && this.dropPosition === -1 || dropIndex - dragIndex === -1 && this.dropPosition === 1)) { - allowDrop = false; - } - if (allowDrop) { - var isSameColumn = /* @__PURE__ */ __name(function isSameColumn2(col1, col2) { - return _this8.columnProp(col1, "columnKey") || _this8.columnProp(col2, "columnKey") ? _this8.columnProp(col1, "columnKey") === _this8.columnProp(col2, "columnKey") : _this8.columnProp(col1, "field") === _this8.columnProp(col2, "field"); - }, "isSameColumn"); - var dragColIndex = this.columns.findIndex(function(child) { - return isSameColumn(child, _this8.draggedColumn); - }); - var dropColIndex = this.columns.findIndex(function(child) { - return isSameColumn(child, column); - }); - var widths = []; - var headers = find(this.$el, 'thead[data-pc-section="thead"] > tr > th'); - headers.forEach(function(header) { - return widths.push(getOuterWidth(header)); - }); - var movedItem = widths.find(function(_, index) { - return index === dragColIndex; - }); - var remainingItems = widths.filter(function(_, index) { - return index !== dragColIndex; - }); - var reorderedWidths = [].concat(_toConsumableArray(remainingItems.slice(0, dropColIndex)), [movedItem], _toConsumableArray(remainingItems.slice(dropColIndex))); - this.addColumnWidthStyles(reorderedWidths); - if (dropColIndex < dragColIndex && this.dropPosition === 1) { - dropColIndex++; - } - if (dropColIndex > dragColIndex && this.dropPosition === -1) { - dropColIndex--; - } - reorderArray(this.columns, dragColIndex, dropColIndex); - this.updateReorderableColumns(); - this.$emit("column-reorder", { - originalEvent: event2, - dragIndex: dragColIndex, - dropIndex: dropColIndex - }); - } - this.$refs.reorderIndicatorUp.style.display = "none"; - this.$refs.reorderIndicatorDown.style.display = "none"; - this.draggedColumnElement.draggable = false; - this.draggedColumnElement = null; - this.draggedColumn = null; - this.dropPosition = null; - } - }, "onColumnHeaderDrop"), - findParentHeader: /* @__PURE__ */ __name(function findParentHeader(element) { - if (element.nodeName === "TH") { - return element; - } else { - var parent = element.parentElement; - while (parent.nodeName !== "TH") { - parent = parent.parentElement; - if (!parent) break; - } - return parent; - } - }, "findParentHeader"), - findColumnByKey: /* @__PURE__ */ __name(function findColumnByKey(columns2, key) { - if (columns2 && columns2.length) { - for (var i = 0; i < columns2.length; i++) { - var column = columns2[i]; - if (this.columnProp(column, "columnKey") === key || this.columnProp(column, "field") === key) { - return column; - } - } - } - return null; - }, "findColumnByKey"), - onRowMouseDown: /* @__PURE__ */ __name(function onRowMouseDown2(event2) { - if (getAttribute(event2.target, "data-pc-section") === "reorderablerowhandle" || getAttribute(event2.target.parentElement, "data-pc-section") === "reorderablerowhandle") event2.currentTarget.draggable = true; - else event2.currentTarget.draggable = false; - }, "onRowMouseDown"), - onRowDragStart: /* @__PURE__ */ __name(function onRowDragStart2(e) { - var event2 = e.originalEvent; - var index = e.index; - this.rowDragging = true; - this.draggedRowIndex = index; - event2.dataTransfer.setData("text", "b"); - }, "onRowDragStart"), - onRowDragOver: /* @__PURE__ */ __name(function onRowDragOver2(e) { - var event2 = e.originalEvent; - var index = e.index; - if (this.rowDragging && this.draggedRowIndex !== index) { - var rowElement = event2.currentTarget; - var rowY = getOffset(rowElement).top; - var pageY = event2.pageY; - var rowMidY = rowY + getOuterHeight(rowElement) / 2; - var prevRowElement = rowElement.previousElementSibling; - if (pageY < rowMidY) { - rowElement.setAttribute("data-p-datatable-dragpoint-bottom", "false"); - !this.isUnstyled && removeClass(rowElement, "p-datatable-dragpoint-bottom"); - this.droppedRowIndex = index; - if (prevRowElement) { - prevRowElement.setAttribute("data-p-datatable-dragpoint-bottom", "true"); - !this.isUnstyled && addClass(prevRowElement, "p-datatable-dragpoint-bottom"); - } else { - rowElement.setAttribute("data-p-datatable-dragpoint-top", "true"); - !this.isUnstyled && addClass(rowElement, "p-datatable-dragpoint-top"); - } - } else { - if (prevRowElement) { - prevRowElement.setAttribute("data-p-datatable-dragpoint-bottom", "false"); - !this.isUnstyled && removeClass(prevRowElement, "p-datatable-dragpoint-bottom"); - } else { - rowElement.setAttribute("data-p-datatable-dragpoint-top", "true"); - !this.isUnstyled && addClass(rowElement, "p-datatable-dragpoint-top"); - } - this.droppedRowIndex = index + 1; - rowElement.setAttribute("data-p-datatable-dragpoint-bottom", "true"); - !this.isUnstyled && addClass(rowElement, "p-datatable-dragpoint-bottom"); - } - event2.preventDefault(); - } - }, "onRowDragOver"), - onRowDragLeave: /* @__PURE__ */ __name(function onRowDragLeave2(event2) { - var rowElement = event2.currentTarget; - var prevRowElement = rowElement.previousElementSibling; - if (prevRowElement) { - prevRowElement.setAttribute("data-p-datatable-dragpoint-bottom", "false"); - !this.isUnstyled && removeClass(prevRowElement, "p-datatable-dragpoint-bottom"); - } - rowElement.setAttribute("data-p-datatable-dragpoint-bottom", "false"); - !this.isUnstyled && removeClass(rowElement, "p-datatable-dragpoint-bottom"); - rowElement.setAttribute("data-p-datatable-dragpoint-top", "false"); - !this.isUnstyled && removeClass(rowElement, "p-datatable-dragpoint-top"); - }, "onRowDragLeave"), - onRowDragEnd: /* @__PURE__ */ __name(function onRowDragEnd2(event2) { - this.rowDragging = false; - this.draggedRowIndex = null; - this.droppedRowIndex = null; - event2.currentTarget.draggable = false; - }, "onRowDragEnd"), - onRowDrop: /* @__PURE__ */ __name(function onRowDrop2(event2) { - if (this.droppedRowIndex != null) { - var dropIndex = this.draggedRowIndex > this.droppedRowIndex ? this.droppedRowIndex : this.droppedRowIndex === 0 ? 0 : this.droppedRowIndex - 1; - var processedData2 = _toConsumableArray(this.processedData); - reorderArray(processedData2, this.draggedRowIndex + this.d_first, dropIndex + this.d_first); - this.$emit("row-reorder", { - originalEvent: event2, - dragIndex: this.draggedRowIndex, - dropIndex, - value: processedData2 - }); - } - this.onRowDragLeave(event2); - this.onRowDragEnd(event2); - event2.preventDefault(); - }, "onRowDrop"), - toggleRow: /* @__PURE__ */ __name(function toggleRow2(event2) { - var _this9 = this; - var expanded = event2.expanded, rest = _objectWithoutProperties(event2, _excluded); - var rowData = event2.data; - var expandedRows; - if (this.dataKey) { - var value = resolveFieldData(rowData, this.dataKey); - expandedRows = this.expandedRows ? _objectSpread$1({}, this.expandedRows) : {}; - expanded ? expandedRows[value] = true : delete expandedRows[value]; - } else { - expandedRows = this.expandedRows ? _toConsumableArray(this.expandedRows) : []; - expanded ? expandedRows.push(rowData) : expandedRows = expandedRows.filter(function(d) { - return !_this9.equals(rowData, d); - }); - } - this.$emit("update:expandedRows", expandedRows); - expanded ? this.$emit("row-expand", rest) : this.$emit("row-collapse", rest); - }, "toggleRow"), - toggleRowGroup: /* @__PURE__ */ __name(function toggleRowGroup(e) { - var event2 = e.originalEvent; - var data12 = e.data; - var groupFieldValue = resolveFieldData(data12, this.groupRowsBy); - var _expandedRowGroups = this.expandedRowGroups ? _toConsumableArray(this.expandedRowGroups) : []; - if (this.isRowGroupExpanded(data12)) { - _expandedRowGroups = _expandedRowGroups.filter(function(group) { - return group !== groupFieldValue; - }); - this.$emit("update:expandedRowGroups", _expandedRowGroups); - this.$emit("rowgroup-collapse", { - originalEvent: event2, - data: groupFieldValue - }); - } else { - _expandedRowGroups.push(groupFieldValue); - this.$emit("update:expandedRowGroups", _expandedRowGroups); - this.$emit("rowgroup-expand", { - originalEvent: event2, - data: groupFieldValue - }); - } - }, "toggleRowGroup"), - isRowGroupExpanded: /* @__PURE__ */ __name(function isRowGroupExpanded2(rowData) { - if (this.expandableRowGroups && this.expandedRowGroups) { - var groupFieldValue = resolveFieldData(rowData, this.groupRowsBy); - return this.expandedRowGroups.indexOf(groupFieldValue) > -1; - } - return false; - }, "isRowGroupExpanded"), - isStateful: /* @__PURE__ */ __name(function isStateful() { - return this.stateKey != null; - }, "isStateful"), - getStorage: /* @__PURE__ */ __name(function getStorage() { - switch (this.stateStorage) { - case "local": - return window.localStorage; - case "session": - return window.sessionStorage; - default: - throw new Error(this.stateStorage + ' is not a valid value for the state storage, supported values are "local" and "session".'); - } - }, "getStorage"), - saveState: /* @__PURE__ */ __name(function saveState() { - var storage = this.getStorage(); - var state = {}; - if (this.paginator) { - state.first = this.d_first; - state.rows = this.d_rows; - } - if (this.d_sortField) { - state.sortField = this.d_sortField; - state.sortOrder = this.d_sortOrder; - } - if (this.d_multiSortMeta) { - state.multiSortMeta = this.d_multiSortMeta; - } - if (this.hasFilters) { - state.filters = this.filters; - } - if (this.resizableColumns) { - this.saveColumnWidths(state); - } - if (this.reorderableColumns) { - state.columnOrder = this.d_columnOrder; - } - if (this.expandedRows) { - state.expandedRows = this.expandedRows; - } - if (this.expandedRowGroups) { - state.expandedRowGroups = this.expandedRowGroups; - } - if (this.selection) { - state.selection = this.selection; - state.selectionKeys = this.d_selectionKeys; - } - if (Object.keys(state).length) { - storage.setItem(this.stateKey, JSON.stringify(state)); - } - this.$emit("state-save", state); - }, "saveState"), - restoreState: /* @__PURE__ */ __name(function restoreState() { - var storage = this.getStorage(); - var stateString = storage.getItem(this.stateKey); - var dateFormat = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/; - var reviver = /* @__PURE__ */ __name(function reviver2(key, value) { - if (typeof value === "string" && dateFormat.test(value)) { - return new Date(value); - } - return value; - }, "reviver"); - if (stateString) { - var restoredState = JSON.parse(stateString, reviver); - if (this.paginator) { - this.d_first = restoredState.first; - this.d_rows = restoredState.rows; - } - if (restoredState.sortField) { - this.d_sortField = restoredState.sortField; - this.d_sortOrder = restoredState.sortOrder; - } - if (restoredState.multiSortMeta) { - this.d_multiSortMeta = restoredState.multiSortMeta; - } - if (restoredState.filters) { - this.$emit("update:filters", restoredState.filters); - } - if (this.resizableColumns) { - this.columnWidthsState = restoredState.columnWidths; - this.tableWidthState = restoredState.tableWidth; - } - if (this.reorderableColumns) { - this.d_columnOrder = restoredState.columnOrder; - } - if (restoredState.expandedRows) { - this.$emit("update:expandedRows", restoredState.expandedRows); - } - if (restoredState.expandedRowGroups) { - this.$emit("update:expandedRowGroups", restoredState.expandedRowGroups); - } - if (restoredState.selection) { - this.d_selectionKeys = restoredState.d_selectionKeys; - this.$emit("update:selection", restoredState.selection); - } - this.$emit("state-restore", restoredState); - } - }, "restoreState"), - saveColumnWidths: /* @__PURE__ */ __name(function saveColumnWidths(state) { - var widths = []; - var headers = find(this.$el, 'thead[data-pc-section="thead"] > tr > th'); - headers.forEach(function(header) { - return widths.push(getOuterWidth(header)); - }); - state.columnWidths = widths.join(","); - if (this.columnResizeMode === "expand") { - state.tableWidth = getOuterWidth(this.$refs.table) + "px"; - } - }, "saveColumnWidths"), - addColumnWidthStyles: /* @__PURE__ */ __name(function addColumnWidthStyles(widths) { - this.createStyleElement(); - var innerHTML = ""; - var selector = '[data-pc-name="datatable"]['.concat(this.$attrSelector, '] > [data-pc-section="tablecontainer"] ').concat(this.virtualScrollerDisabled ? "" : '> [data-pc-name="virtualscroller"]', ' > table[data-pc-section="table"]'); - widths.forEach(function(width, index) { - var style = "width: ".concat(width, "px !important; max-width: ").concat(width, "px !important"); - innerHTML += "\n ".concat(selector, ' > thead[data-pc-section="thead"] > tr > th:nth-child(').concat(index + 1, "),\n ").concat(selector, ' > tbody[data-pc-section="tbody"] > tr > td:nth-child(').concat(index + 1, "),\n ").concat(selector, ' > tfoot[data-pc-section="tfoot"] > tr > td:nth-child(').concat(index + 1, ") {\n ").concat(style, "\n }\n "); - }); - this.styleElement.innerHTML = innerHTML; - }, "addColumnWidthStyles"), - restoreColumnWidths: /* @__PURE__ */ __name(function restoreColumnWidths() { - if (this.columnWidthsState) { - var widths = this.columnWidthsState.split(","); - if (this.columnResizeMode === "expand" && this.tableWidthState) { - this.$refs.table.style.width = this.tableWidthState; - this.$refs.table.style.minWidth = this.tableWidthState; - } - if (isNotEmpty(widths)) { - this.addColumnWidthStyles(widths); - } - } - }, "restoreColumnWidths"), - onCellEditInit: /* @__PURE__ */ __name(function onCellEditInit2(event2) { - this.$emit("cell-edit-init", event2); - }, "onCellEditInit"), - onCellEditComplete: /* @__PURE__ */ __name(function onCellEditComplete2(event2) { - this.$emit("cell-edit-complete", event2); - }, "onCellEditComplete"), - onCellEditCancel: /* @__PURE__ */ __name(function onCellEditCancel2(event2) { - this.$emit("cell-edit-cancel", event2); - }, "onCellEditCancel"), - onRowEditInit: /* @__PURE__ */ __name(function onRowEditInit3(event2) { - var _editingRows = this.editingRows ? _toConsumableArray(this.editingRows) : []; - _editingRows.push(event2.data); - this.$emit("update:editingRows", _editingRows); - this.$emit("row-edit-init", event2); - }, "onRowEditInit"), - onRowEditSave: /* @__PURE__ */ __name(function onRowEditSave3(event2) { - var _editingRows = _toConsumableArray(this.editingRows); - _editingRows.splice(this.findIndex(event2.data, _editingRows), 1); - this.$emit("update:editingRows", _editingRows); - this.$emit("row-edit-save", event2); - }, "onRowEditSave"), - onRowEditCancel: /* @__PURE__ */ __name(function onRowEditCancel3(event2) { - var _editingRows = _toConsumableArray(this.editingRows); - _editingRows.splice(this.findIndex(event2.data, _editingRows), 1); - this.$emit("update:editingRows", _editingRows); - this.$emit("row-edit-cancel", event2); - }, "onRowEditCancel"), - onEditingMetaChange: /* @__PURE__ */ __name(function onEditingMetaChange2(event2) { - var data12 = event2.data, field2 = event2.field, index = event2.index, editing2 = event2.editing; - var editingMeta = _objectSpread$1({}, this.d_editingMeta); - var meta = editingMeta[index]; - if (editing2) { - !meta && (meta = editingMeta[index] = { - data: _objectSpread$1({}, data12), - fields: [] - }); - meta["fields"].push(field2); - } else if (meta) { - var fields = meta["fields"].filter(function(f) { - return f !== field2; - }); - !fields.length ? delete editingMeta[index] : meta["fields"] = fields; - } - this.d_editingMeta = editingMeta; - }, "onEditingMetaChange"), - clearEditingMetaData: /* @__PURE__ */ __name(function clearEditingMetaData() { - if (this.editMode) { - this.d_editingMeta = {}; - } - }, "clearEditingMetaData"), - createLazyLoadEvent: /* @__PURE__ */ __name(function createLazyLoadEvent(event2) { - return { - originalEvent: event2, - first: this.d_first, - rows: this.d_rows, - sortField: this.d_sortField, - sortOrder: this.d_sortOrder, - multiSortMeta: this.d_multiSortMeta, - filters: this.d_filters - }; - }, "createLazyLoadEvent"), - hasGlobalFilter: /* @__PURE__ */ __name(function hasGlobalFilter() { - return this.filters && Object.prototype.hasOwnProperty.call(this.filters, "global"); - }, "hasGlobalFilter"), - onFilterChange: /* @__PURE__ */ __name(function onFilterChange(filters) { - this.d_filters = filters; - }, "onFilterChange"), - onFilterApply: /* @__PURE__ */ __name(function onFilterApply() { - this.d_first = 0; - this.$emit("update:first", this.d_first); - this.$emit("update:filters", this.d_filters); - if (this.lazy) { - this.$emit("filter", this.createLazyLoadEvent()); - } - }, "onFilterApply"), - cloneFilters: /* @__PURE__ */ __name(function cloneFilters() { - var cloned = {}; - if (this.filters) { - Object.entries(this.filters).forEach(function(_ref3) { - var _ref4 = _slicedToArray(_ref3, 2), prop = _ref4[0], value = _ref4[1]; - cloned[prop] = value.operator ? { - operator: value.operator, - constraints: value.constraints.map(function(constraint) { - return _objectSpread$1({}, constraint); - }) - } : _objectSpread$1({}, value); - }); - } - return cloned; - }, "cloneFilters"), - updateReorderableColumns: /* @__PURE__ */ __name(function updateReorderableColumns() { - var _this10 = this; - var columnOrder = []; - this.columns.forEach(function(col) { - return columnOrder.push(_this10.columnProp(col, "columnKey") || _this10.columnProp(col, "field")); - }); - this.d_columnOrder = columnOrder; - }, "updateReorderableColumns"), - createStyleElement: /* @__PURE__ */ __name(function createStyleElement() { - var _this$$primevue; - this.styleElement = document.createElement("style"); - this.styleElement.type = "text/css"; - setAttribute(this.styleElement, "nonce", (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce); - document.head.appendChild(this.styleElement); - }, "createStyleElement"), - destroyStyleElement: /* @__PURE__ */ __name(function destroyStyleElement() { - if (this.styleElement) { - document.head.removeChild(this.styleElement); - this.styleElement = null; - } - }, "destroyStyleElement"), - dataToRender: /* @__PURE__ */ __name(function dataToRender(data12) { - var _data = data12 || this.processedData; - if (_data && this.paginator) { - var first4 = this.lazy ? 0 : this.d_first; - return _data.slice(first4, first4 + this.d_rows); - } - return _data; - }, "dataToRender"), - getVirtualScrollerRef: /* @__PURE__ */ __name(function getVirtualScrollerRef() { - return this.$refs.virtualScroller; - }, "getVirtualScrollerRef"), - hasSpacerStyle: /* @__PURE__ */ __name(function hasSpacerStyle(style) { - return isNotEmpty(style); - }, "hasSpacerStyle") - }, - computed: { - columns: /* @__PURE__ */ __name(function columns() { - var cols = this.d_columns.get(this); - if (this.reorderableColumns && this.d_columnOrder) { - var orderedColumns = []; - var _iterator5 = _createForOfIteratorHelper(this.d_columnOrder), _step5; - try { - for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) { - var columnKey = _step5.value; - var column = this.findColumnByKey(cols, columnKey); - if (column && !this.columnProp(column, "hidden")) { - orderedColumns.push(column); - } - } - } catch (err) { - _iterator5.e(err); - } finally { - _iterator5.f(); - } - return [].concat(orderedColumns, _toConsumableArray(cols.filter(function(item) { - return orderedColumns.indexOf(item) < 0; - }))); - } - return cols; - }, "columns"), - columnGroups: /* @__PURE__ */ __name(function columnGroups() { - return this.d_columnGroups.get(this); - }, "columnGroups"), - headerColumnGroup: /* @__PURE__ */ __name(function headerColumnGroup() { - var _this$columnGroups, _this11 = this; - return (_this$columnGroups = this.columnGroups) === null || _this$columnGroups === void 0 ? void 0 : _this$columnGroups.find(function(group) { - return _this11.columnProp(group, "type") === "header"; - }); - }, "headerColumnGroup"), - footerColumnGroup: /* @__PURE__ */ __name(function footerColumnGroup() { - var _this$columnGroups2, _this12 = this; - return (_this$columnGroups2 = this.columnGroups) === null || _this$columnGroups2 === void 0 ? void 0 : _this$columnGroups2.find(function(group) { - return _this12.columnProp(group, "type") === "footer"; - }); - }, "footerColumnGroup"), - hasFilters: /* @__PURE__ */ __name(function hasFilters() { - return this.filters && Object.keys(this.filters).length > 0 && this.filters.constructor === Object; - }, "hasFilters"), - processedData: /* @__PURE__ */ __name(function processedData() { - var _this$virtualScroller; - var data12 = this.value || []; - if (!this.lazy && !((_this$virtualScroller = this.virtualScrollerOptions) !== null && _this$virtualScroller !== void 0 && _this$virtualScroller.lazy)) { - if (data12 && data12.length) { - if (this.hasFilters) { - data12 = this.filter(data12); - } - if (this.sorted) { - if (this.sortMode === "single") data12 = this.sortSingle(data12); - else if (this.sortMode === "multiple") data12 = this.sortMultiple(data12); - } - } - } - return data12; - }, "processedData"), - totalRecordsLength: /* @__PURE__ */ __name(function totalRecordsLength() { - if (this.lazy) { - return this.totalRecords; - } else { - var data12 = this.processedData; - return data12 ? data12.length : 0; - } - }, "totalRecordsLength"), - empty: /* @__PURE__ */ __name(function empty2() { - var data12 = this.processedData; - return !data12 || data12.length === 0; - }, "empty"), - paginatorTop: /* @__PURE__ */ __name(function paginatorTop() { - return this.paginator && (this.paginatorPosition !== "bottom" || this.paginatorPosition === "both"); - }, "paginatorTop"), - paginatorBottom: /* @__PURE__ */ __name(function paginatorBottom() { - return this.paginator && (this.paginatorPosition !== "top" || this.paginatorPosition === "both"); - }, "paginatorBottom"), - sorted: /* @__PURE__ */ __name(function sorted() { - return this.d_sortField || this.d_multiSortMeta && this.d_multiSortMeta.length > 0; - }, "sorted"), - allRowsSelected: /* @__PURE__ */ __name(function allRowsSelected() { - var _this13 = this; - if (this.selectAll !== null) { - return this.selectAll; - } else { - var val = this.frozenValue ? [].concat(_toConsumableArray(this.frozenValue), _toConsumableArray(this.processedData)) : this.processedData; - return isNotEmpty(val) && this.selection && Array.isArray(this.selection) && val.every(function(v) { - return _this13.selection.some(function(s) { - return _this13.equals(s, v); - }); - }); - } - }, "allRowsSelected"), - groupRowSortField: /* @__PURE__ */ __name(function groupRowSortField() { - return this.sortMode === "single" ? this.sortField : this.d_groupRowsSortMeta ? this.d_groupRowsSortMeta.field : null; - }, "groupRowSortField"), - headerFilterButtonProps: /* @__PURE__ */ __name(function headerFilterButtonProps() { - return _objectSpread$1(_objectSpread$1({ - filter: { - severity: "secondary", - text: true, - rounded: true - } - }, this.filterButtonProps), {}, { - inline: _objectSpread$1({ - clear: { - severity: "secondary", - text: true, - rounded: true - } - }, this.filterButtonProps.inline), - popover: _objectSpread$1({ - addRule: { - severity: "info", - text: true, - size: "small" - }, - removeRule: { - severity: "danger", - text: true, - size: "small" - }, - apply: { - size: "small" - }, - clear: { - outlined: true, - size: "small" - } - }, this.filterButtonProps.popover) - }); - }, "headerFilterButtonProps"), - rowEditButtonProps: /* @__PURE__ */ __name(function rowEditButtonProps() { - return _objectSpread$1(_objectSpread$1({}, { - init: { - severity: "secondary", - text: true, - rounded: true - }, - save: { - severity: "secondary", - text: true, - rounded: true - }, - cancel: { - severity: "secondary", - text: true, - rounded: true - } - }), this.editButtonProps); - }, "rowEditButtonProps"), - virtualScrollerDisabled: /* @__PURE__ */ __name(function virtualScrollerDisabled() { - return isEmpty(this.virtualScrollerOptions) || !this.scrollable; - }, "virtualScrollerDisabled") - }, - components: { - DTPaginator: script$l, - DTTableHeader: script$1, - DTTableBody: script$7, - DTTableFooter: script$5, - DTVirtualScroller: script$I, - ArrowDownIcon: script$q, - ArrowUpIcon: script$p, - SpinnerIcon: script$J - } -}; -function _typeof(o) { - "@babel/helpers - typeof"; - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { - return typeof o2; - } : function(o2) { - return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; - }, _typeof(o); -} -__name(_typeof, "_typeof"); -function ownKeys(e, r) { - var t = Object.keys(e); - if (Object.getOwnPropertySymbols) { - var o = Object.getOwnPropertySymbols(e); - r && (o = o.filter(function(r2) { - return Object.getOwnPropertyDescriptor(e, r2).enumerable; - })), t.push.apply(t, o); - } - return t; -} -__name(ownKeys, "ownKeys"); -function _objectSpread(e) { - for (var r = 1; r < arguments.length; r++) { - var t = null != arguments[r] ? arguments[r] : {}; - r % 2 ? ownKeys(Object(t), true).forEach(function(r2) { - _defineProperty(e, r2, t[r2]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) { - Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); - }); - } - return e; -} -__name(_objectSpread, "_objectSpread"); -function _defineProperty(e, r, t) { - return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; -} -__name(_defineProperty, "_defineProperty"); -function _toPropertyKey(t) { - var i = _toPrimitive(t, "string"); - return "symbol" == _typeof(i) ? i : i + ""; -} -__name(_toPropertyKey, "_toPropertyKey"); -function _toPrimitive(t, r) { - if ("object" != _typeof(t) || !t) return t; - var e = t[Symbol.toPrimitive]; - if (void 0 !== e) { - var i = e.call(t, r || "default"); - if ("object" != _typeof(i)) return i; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r ? String : Number)(t); -} -__name(_toPrimitive, "_toPrimitive"); -function render2(_ctx, _cache, $props, $setup, $data, $options) { - var _component_SpinnerIcon = resolveComponent("SpinnerIcon"); - var _component_DTPaginator = resolveComponent("DTPaginator"); - var _component_DTTableHeader = resolveComponent("DTTableHeader"); - var _component_DTTableBody = resolveComponent("DTTableBody"); - var _component_DTTableFooter = resolveComponent("DTTableFooter"); - var _component_DTVirtualScroller = resolveComponent("DTVirtualScroller"); - return openBlock(), createElementBlock("div", mergeProps({ - "class": _ctx.cx("root"), - "data-scrollselectors": ".p-datatable-wrapper" - }, _ctx.ptmi("root")), [renderSlot(_ctx.$slots, "default"), _ctx.loading ? (openBlock(), createElementBlock("div", mergeProps({ - key: 0, - "class": _ctx.cx("mask") - }, _ctx.ptm("mask")), [_ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { - key: 0 - }) : (openBlock(), createElementBlock(Fragment, { - key: 1 - }, [_ctx.$slots.loadingicon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.loadingicon), { - key: 0, - "class": normalizeClass(_ctx.cx("loadingIcon")) - }, null, 8, ["class"])) : _ctx.loadingIcon ? (openBlock(), createElementBlock("i", mergeProps({ - key: 1, - "class": [_ctx.cx("loadingIcon"), "pi-spin", _ctx.loadingIcon] - }, _ctx.ptm("loadingIcon")), null, 16)) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({ - key: 2, - spin: "", - "class": _ctx.cx("loadingIcon") - }, _ctx.ptm("loadingIcon")), null, 16, ["class"]))], 64))], 16)) : createCommentVNode("", true), _ctx.$slots.header ? (openBlock(), createElementBlock("div", mergeProps({ - key: 1, - "class": _ctx.cx("header") - }, _ctx.ptm("header")), [renderSlot(_ctx.$slots, "header")], 16)) : createCommentVNode("", true), $options.paginatorTop ? (openBlock(), createBlock(_component_DTPaginator, { - key: 2, - rows: $data.d_rows, - first: $data.d_first, - totalRecords: $options.totalRecordsLength, - pageLinkSize: _ctx.pageLinkSize, - template: _ctx.paginatorTemplate, - rowsPerPageOptions: _ctx.rowsPerPageOptions, - currentPageReportTemplate: _ctx.currentPageReportTemplate, - "class": normalizeClass(_ctx.cx("pcPaginator", { - position: "top" - })), - onPage: _cache[0] || (_cache[0] = function($event) { - return $options.onPage($event); - }), - alwaysShow: _ctx.alwaysShowPaginator, - unstyled: _ctx.unstyled, - pt: _ctx.ptm("pcPaginator") - }, createSlots({ - _: 2 - }, [_ctx.$slots.paginatorcontainer ? { - name: "container", - fn: withCtx(function() { - return [renderSlot(_ctx.$slots, "paginatorcontainer", { - first: _ctx.slotProps.first, - last: _ctx.slotProps.last, - rows: _ctx.slotProps.rows, - page: _ctx.slotProps.page, - pageCount: _ctx.slotProps.pageCount, - totalRecords: _ctx.slotProps.totalRecords, - firstPageCallback: _ctx.slotProps.firstPageCallback, - lastPageCallback: _ctx.slotProps.lastPageCallback, - prevPageCallback: _ctx.slotProps.prevPageCallback, - nextPageCallback: _ctx.slotProps.nextPageCallback, - rowChangeCallback: _ctx.slotProps.rowChangeCallback - })]; - }), - key: "0" - } : void 0, _ctx.$slots.paginatorstart ? { - name: "start", - fn: withCtx(function() { - return [renderSlot(_ctx.$slots, "paginatorstart")]; - }), - key: "1" - } : void 0, _ctx.$slots.paginatorend ? { - name: "end", - fn: withCtx(function() { - return [renderSlot(_ctx.$slots, "paginatorend")]; - }), - key: "2" - } : void 0, _ctx.$slots.paginatorfirstpagelinkicon ? { - name: "firstpagelinkicon", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatorfirstpagelinkicon", { - "class": normalizeClass(slotProps["class"]) - })]; - }), - key: "3" - } : void 0, _ctx.$slots.paginatorprevpagelinkicon ? { - name: "prevpagelinkicon", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatorprevpagelinkicon", { - "class": normalizeClass(slotProps["class"]) - })]; - }), - key: "4" - } : void 0, _ctx.$slots.paginatornextpagelinkicon ? { - name: "nextpagelinkicon", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatornextpagelinkicon", { - "class": normalizeClass(slotProps["class"]) - })]; - }), - key: "5" - } : void 0, _ctx.$slots.paginatorlastpagelinkicon ? { - name: "lastpagelinkicon", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatorlastpagelinkicon", { - "class": normalizeClass(slotProps["class"]) - })]; - }), - key: "6" - } : void 0, _ctx.$slots.paginatorjumptopagedropdownicon ? { - name: "jumptopagedropdownicon", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatorjumptopagedropdownicon", { - "class": normalizeClass(slotProps["class"]) - })]; - }), - key: "7" - } : void 0, _ctx.$slots.paginatorrowsperpagedropdownicon ? { - name: "rowsperpagedropdownicon", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatorrowsperpagedropdownicon", { - "class": normalizeClass(slotProps["class"]) - })]; - }), - key: "8" - } : void 0]), 1032, ["rows", "first", "totalRecords", "pageLinkSize", "template", "rowsPerPageOptions", "currentPageReportTemplate", "class", "alwaysShow", "unstyled", "pt"])) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ - "class": _ctx.cx("tableContainer"), - style: [_ctx.sx("tableContainer"), { - maxHeight: $options.virtualScrollerDisabled ? _ctx.scrollHeight : "" - }] - }, _ctx.ptm("tableContainer")), [createVNode(_component_DTVirtualScroller, mergeProps({ - ref: "virtualScroller" - }, _ctx.virtualScrollerOptions, { - items: $options.processedData, - columns: $options.columns, - style: _ctx.scrollHeight !== "flex" ? { - height: _ctx.scrollHeight - } : void 0, - scrollHeight: _ctx.scrollHeight !== "flex" ? void 0 : "100%", - disabled: $options.virtualScrollerDisabled, - loaderDisabled: "", - inline: "", - autoSize: "", - showSpacer: false, - pt: _ctx.ptm("virtualScroller") - }), { - content: withCtx(function(slotProps) { - return [createBaseVNode("table", mergeProps({ - ref: "table", - role: "table", - "class": [_ctx.cx("table"), _ctx.tableClass], - style: [_ctx.tableStyle, slotProps.spacerStyle] - }, _objectSpread(_objectSpread({}, _ctx.tableProps), _ctx.ptm("table"))), [_ctx.showHeaders ? (openBlock(), createBlock(_component_DTTableHeader, { - key: 0, - columnGroup: $options.headerColumnGroup, - columns: slotProps.columns, - rowGroupMode: _ctx.rowGroupMode, - groupRowsBy: _ctx.groupRowsBy, - groupRowSortField: $options.groupRowSortField, - reorderableColumns: _ctx.reorderableColumns, - resizableColumns: _ctx.resizableColumns, - allRowsSelected: $options.allRowsSelected, - empty: $options.empty, - sortMode: _ctx.sortMode, - sortField: $data.d_sortField, - sortOrder: $data.d_sortOrder, - multiSortMeta: $data.d_multiSortMeta, - filters: $data.d_filters, - filtersStore: _ctx.filters, - filterDisplay: _ctx.filterDisplay, - filterButtonProps: $options.headerFilterButtonProps, - filterInputProps: _ctx.filterInputProps, - first: $data.d_first, - onColumnClick: _cache[1] || (_cache[1] = function($event) { - return $options.onColumnHeaderClick($event); - }), - onColumnMousedown: _cache[2] || (_cache[2] = function($event) { - return $options.onColumnHeaderMouseDown($event); - }), - onFilterChange: $options.onFilterChange, - onFilterApply: $options.onFilterApply, - onColumnDragstart: _cache[3] || (_cache[3] = function($event) { - return $options.onColumnHeaderDragStart($event); - }), - onColumnDragover: _cache[4] || (_cache[4] = function($event) { - return $options.onColumnHeaderDragOver($event); - }), - onColumnDragleave: _cache[5] || (_cache[5] = function($event) { - return $options.onColumnHeaderDragLeave($event); - }), - onColumnDrop: _cache[6] || (_cache[6] = function($event) { - return $options.onColumnHeaderDrop($event); - }), - onColumnResizestart: _cache[7] || (_cache[7] = function($event) { - return $options.onColumnResizeStart($event); - }), - onCheckboxChange: _cache[8] || (_cache[8] = function($event) { - return $options.toggleRowsWithCheckbox($event); - }), - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["columnGroup", "columns", "rowGroupMode", "groupRowsBy", "groupRowSortField", "reorderableColumns", "resizableColumns", "allRowsSelected", "empty", "sortMode", "sortField", "sortOrder", "multiSortMeta", "filters", "filtersStore", "filterDisplay", "filterButtonProps", "filterInputProps", "first", "onFilterChange", "onFilterApply", "unstyled", "pt"])) : createCommentVNode("", true), _ctx.frozenValue ? (openBlock(), createBlock(_component_DTTableBody, { - key: 1, - ref: "frozenBodyRef", - value: _ctx.frozenValue, - frozenRow: true, - columns: slotProps.columns, - first: $data.d_first, - dataKey: _ctx.dataKey, - selection: _ctx.selection, - selectionKeys: $data.d_selectionKeys, - selectionMode: _ctx.selectionMode, - contextMenu: _ctx.contextMenu, - contextMenuSelection: _ctx.contextMenuSelection, - rowGroupMode: _ctx.rowGroupMode, - groupRowsBy: _ctx.groupRowsBy, - expandableRowGroups: _ctx.expandableRowGroups, - rowClass: _ctx.rowClass, - rowStyle: _ctx.rowStyle, - editMode: _ctx.editMode, - compareSelectionBy: _ctx.compareSelectionBy, - scrollable: _ctx.scrollable, - expandedRowIcon: _ctx.expandedRowIcon, - collapsedRowIcon: _ctx.collapsedRowIcon, - expandedRows: _ctx.expandedRows, - expandedRowGroups: _ctx.expandedRowGroups, - editingRows: _ctx.editingRows, - editingRowKeys: $data.d_editingRowKeys, - templates: _ctx.$slots, - editButtonProps: $options.rowEditButtonProps, - isVirtualScrollerDisabled: true, - onRowgroupToggle: $options.toggleRowGroup, - onRowClick: _cache[9] || (_cache[9] = function($event) { - return $options.onRowClick($event); - }), - onRowDblclick: _cache[10] || (_cache[10] = function($event) { - return $options.onRowDblClick($event); - }), - onRowRightclick: _cache[11] || (_cache[11] = function($event) { - return $options.onRowRightClick($event); - }), - onRowTouchend: $options.onRowTouchEnd, - onRowKeydown: $options.onRowKeyDown, - onRowMousedown: $options.onRowMouseDown, - onRowDragstart: _cache[12] || (_cache[12] = function($event) { - return $options.onRowDragStart($event); - }), - onRowDragover: _cache[13] || (_cache[13] = function($event) { - return $options.onRowDragOver($event); - }), - onRowDragleave: _cache[14] || (_cache[14] = function($event) { - return $options.onRowDragLeave($event); - }), - onRowDragend: _cache[15] || (_cache[15] = function($event) { - return $options.onRowDragEnd($event); - }), - onRowDrop: _cache[16] || (_cache[16] = function($event) { - return $options.onRowDrop($event); - }), - onRowToggle: _cache[17] || (_cache[17] = function($event) { - return $options.toggleRow($event); - }), - onRadioChange: _cache[18] || (_cache[18] = function($event) { - return $options.toggleRowWithRadio($event); - }), - onCheckboxChange: _cache[19] || (_cache[19] = function($event) { - return $options.toggleRowWithCheckbox($event); - }), - onCellEditInit: _cache[20] || (_cache[20] = function($event) { - return $options.onCellEditInit($event); - }), - onCellEditComplete: _cache[21] || (_cache[21] = function($event) { - return $options.onCellEditComplete($event); - }), - onCellEditCancel: _cache[22] || (_cache[22] = function($event) { - return $options.onCellEditCancel($event); - }), - onRowEditInit: _cache[23] || (_cache[23] = function($event) { - return $options.onRowEditInit($event); - }), - onRowEditSave: _cache[24] || (_cache[24] = function($event) { - return $options.onRowEditSave($event); - }), - onRowEditCancel: _cache[25] || (_cache[25] = function($event) { - return $options.onRowEditCancel($event); - }), - editingMeta: $data.d_editingMeta, - onEditingMetaChange: $options.onEditingMetaChange, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["value", "columns", "first", "dataKey", "selection", "selectionKeys", "selectionMode", "contextMenu", "contextMenuSelection", "rowGroupMode", "groupRowsBy", "expandableRowGroups", "rowClass", "rowStyle", "editMode", "compareSelectionBy", "scrollable", "expandedRowIcon", "collapsedRowIcon", "expandedRows", "expandedRowGroups", "editingRows", "editingRowKeys", "templates", "editButtonProps", "onRowgroupToggle", "onRowTouchend", "onRowKeydown", "onRowMousedown", "editingMeta", "onEditingMetaChange", "unstyled", "pt"])) : createCommentVNode("", true), createVNode(_component_DTTableBody, { - ref: "bodyRef", - value: $options.dataToRender(slotProps.rows), - "class": normalizeClass(slotProps.styleClass), - columns: slotProps.columns, - empty: $options.empty, - first: $data.d_first, - dataKey: _ctx.dataKey, - selection: _ctx.selection, - selectionKeys: $data.d_selectionKeys, - selectionMode: _ctx.selectionMode, - contextMenu: _ctx.contextMenu, - contextMenuSelection: _ctx.contextMenuSelection, - rowGroupMode: _ctx.rowGroupMode, - groupRowsBy: _ctx.groupRowsBy, - expandableRowGroups: _ctx.expandableRowGroups, - rowClass: _ctx.rowClass, - rowStyle: _ctx.rowStyle, - editMode: _ctx.editMode, - compareSelectionBy: _ctx.compareSelectionBy, - scrollable: _ctx.scrollable, - expandedRowIcon: _ctx.expandedRowIcon, - collapsedRowIcon: _ctx.collapsedRowIcon, - expandedRows: _ctx.expandedRows, - expandedRowGroups: _ctx.expandedRowGroups, - editingRows: _ctx.editingRows, - editingRowKeys: $data.d_editingRowKeys, - templates: _ctx.$slots, - editButtonProps: $options.rowEditButtonProps, - virtualScrollerContentProps: slotProps, - isVirtualScrollerDisabled: $options.virtualScrollerDisabled, - onRowgroupToggle: $options.toggleRowGroup, - onRowClick: _cache[26] || (_cache[26] = function($event) { - return $options.onRowClick($event); - }), - onRowDblclick: _cache[27] || (_cache[27] = function($event) { - return $options.onRowDblClick($event); - }), - onRowRightclick: _cache[28] || (_cache[28] = function($event) { - return $options.onRowRightClick($event); - }), - onRowTouchend: $options.onRowTouchEnd, - onRowKeydown: /* @__PURE__ */ __name(function onRowKeydown($event) { - return $options.onRowKeyDown($event, slotProps); - }, "onRowKeydown"), - onRowMousedown: $options.onRowMouseDown, - onRowDragstart: _cache[29] || (_cache[29] = function($event) { - return $options.onRowDragStart($event); - }), - onRowDragover: _cache[30] || (_cache[30] = function($event) { - return $options.onRowDragOver($event); - }), - onRowDragleave: _cache[31] || (_cache[31] = function($event) { - return $options.onRowDragLeave($event); - }), - onRowDragend: _cache[32] || (_cache[32] = function($event) { - return $options.onRowDragEnd($event); - }), - onRowDrop: _cache[33] || (_cache[33] = function($event) { - return $options.onRowDrop($event); - }), - onRowToggle: _cache[34] || (_cache[34] = function($event) { - return $options.toggleRow($event); - }), - onRadioChange: _cache[35] || (_cache[35] = function($event) { - return $options.toggleRowWithRadio($event); - }), - onCheckboxChange: _cache[36] || (_cache[36] = function($event) { - return $options.toggleRowWithCheckbox($event); - }), - onCellEditInit: _cache[37] || (_cache[37] = function($event) { - return $options.onCellEditInit($event); - }), - onCellEditComplete: _cache[38] || (_cache[38] = function($event) { - return $options.onCellEditComplete($event); - }), - onCellEditCancel: _cache[39] || (_cache[39] = function($event) { - return $options.onCellEditCancel($event); - }), - onRowEditInit: _cache[40] || (_cache[40] = function($event) { - return $options.onRowEditInit($event); - }), - onRowEditSave: _cache[41] || (_cache[41] = function($event) { - return $options.onRowEditSave($event); - }), - onRowEditCancel: _cache[42] || (_cache[42] = function($event) { - return $options.onRowEditCancel($event); - }), - editingMeta: $data.d_editingMeta, - onEditingMetaChange: $options.onEditingMetaChange, - unstyled: _ctx.unstyled, - pt: _ctx.pt - }, null, 8, ["value", "class", "columns", "empty", "first", "dataKey", "selection", "selectionKeys", "selectionMode", "contextMenu", "contextMenuSelection", "rowGroupMode", "groupRowsBy", "expandableRowGroups", "rowClass", "rowStyle", "editMode", "compareSelectionBy", "scrollable", "expandedRowIcon", "collapsedRowIcon", "expandedRows", "expandedRowGroups", "editingRows", "editingRowKeys", "templates", "editButtonProps", "virtualScrollerContentProps", "isVirtualScrollerDisabled", "onRowgroupToggle", "onRowTouchend", "onRowKeydown", "onRowMousedown", "editingMeta", "onEditingMetaChange", "unstyled", "pt"]), $options.hasSpacerStyle(slotProps.spacerStyle) ? (openBlock(), createElementBlock("tbody", mergeProps({ - key: 2, - "class": _ctx.cx("virtualScrollerSpacer"), - style: { - height: "calc(".concat(slotProps.spacerStyle.height, " - ").concat(slotProps.rows.length * slotProps.itemSize, "px)") - } - }, _ctx.ptm("virtualScrollerSpacer")), null, 16)) : createCommentVNode("", true), createVNode(_component_DTTableFooter, { - columnGroup: $options.footerColumnGroup, - columns: slotProps.columns, - pt: _ctx.pt - }, null, 8, ["columnGroup", "columns", "pt"])], 16)]; - }), - _: 1 - }, 16, ["items", "columns", "style", "scrollHeight", "disabled", "pt"])], 16), $options.paginatorBottom ? (openBlock(), createBlock(_component_DTPaginator, { - key: 3, - rows: $data.d_rows, - first: $data.d_first, - totalRecords: $options.totalRecordsLength, - pageLinkSize: _ctx.pageLinkSize, - template: _ctx.paginatorTemplate, - rowsPerPageOptions: _ctx.rowsPerPageOptions, - currentPageReportTemplate: _ctx.currentPageReportTemplate, - "class": normalizeClass(_ctx.cx("pcPaginator", { - position: "bottom" - })), - onPage: _cache[43] || (_cache[43] = function($event) { - return $options.onPage($event); - }), - alwaysShow: _ctx.alwaysShowPaginator, - unstyled: _ctx.unstyled, - pt: _ctx.ptm("pcPaginator") - }, createSlots({ - _: 2 - }, [_ctx.$slots.paginatorcontainer ? { - name: "container", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatorcontainer", { - first: slotProps.first, - last: slotProps.last, - rows: slotProps.rows, - page: slotProps.page, - pageCount: slotProps.pageCount, - totalRecords: slotProps.totalRecords, - firstPageCallback: slotProps.firstPageCallback, - lastPageCallback: slotProps.lastPageCallback, - prevPageCallback: slotProps.prevPageCallback, - nextPageCallback: slotProps.nextPageCallback, - rowChangeCallback: slotProps.rowChangeCallback - })]; - }), - key: "0" - } : void 0, _ctx.$slots.paginatorstart ? { - name: "start", - fn: withCtx(function() { - return [renderSlot(_ctx.$slots, "paginatorstart")]; - }), - key: "1" - } : void 0, _ctx.$slots.paginatorend ? { - name: "end", - fn: withCtx(function() { - return [renderSlot(_ctx.$slots, "paginatorend")]; - }), - key: "2" - } : void 0, _ctx.$slots.paginatorfirstpagelinkicon ? { - name: "firstpagelinkicon", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatorfirstpagelinkicon", { - "class": normalizeClass(slotProps["class"]) - })]; - }), - key: "3" - } : void 0, _ctx.$slots.paginatorprevpagelinkicon ? { - name: "prevpagelinkicon", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatorprevpagelinkicon", { - "class": normalizeClass(slotProps["class"]) - })]; - }), - key: "4" - } : void 0, _ctx.$slots.paginatornextpagelinkicon ? { - name: "nextpagelinkicon", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatornextpagelinkicon", { - "class": normalizeClass(slotProps["class"]) - })]; - }), - key: "5" - } : void 0, _ctx.$slots.paginatorlastpagelinkicon ? { - name: "lastpagelinkicon", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatorlastpagelinkicon", { - "class": normalizeClass(slotProps["class"]) - })]; - }), - key: "6" - } : void 0, _ctx.$slots.paginatorjumptopagedropdownicon ? { - name: "jumptopagedropdownicon", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatorjumptopagedropdownicon", { - "class": normalizeClass(slotProps["class"]) - })]; - }), - key: "7" - } : void 0, _ctx.$slots.paginatorrowsperpagedropdownicon ? { - name: "rowsperpagedropdownicon", - fn: withCtx(function(slotProps) { - return [renderSlot(_ctx.$slots, "paginatorrowsperpagedropdownicon", { - "class": normalizeClass(slotProps["class"]) - })]; - }), - key: "8" - } : void 0]), 1032, ["rows", "first", "totalRecords", "pageLinkSize", "template", "rowsPerPageOptions", "currentPageReportTemplate", "class", "alwaysShow", "unstyled", "pt"])) : createCommentVNode("", true), _ctx.$slots.footer ? (openBlock(), createElementBlock("div", mergeProps({ - key: 4, - "class": _ctx.cx("footer") - }, _ctx.ptm("footer")), [renderSlot(_ctx.$slots, "footer")], 16)) : createCommentVNode("", true), createBaseVNode("div", mergeProps({ - ref: "resizeHelper", - "class": _ctx.cx("columnResizeIndicator"), - style: { - "display": "none" - } - }, _ctx.ptm("columnResizeIndicator")), null, 16), _ctx.reorderableColumns ? (openBlock(), createElementBlock("span", mergeProps({ - key: 5, - ref: "reorderIndicatorUp", - "class": _ctx.cx("rowReorderIndicatorUp"), - style: { - "position": "absolute", - "display": "none" - } - }, _ctx.ptm("rowReorderIndicatorUp")), [(openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.rowreorderindicatorupicon || _ctx.$slots.reorderindicatorupicon || "ArrowDownIcon")))], 16)) : createCommentVNode("", true), _ctx.reorderableColumns ? (openBlock(), createElementBlock("span", mergeProps({ - key: 6, - ref: "reorderIndicatorDown", - "class": _ctx.cx("rowReorderIndicatorDown"), - style: { - "position": "absolute", - "display": "none" - } - }, _ctx.ptm("rowReorderIndicatorDown")), [(openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.rowreorderindicatordownicon || _ctx.$slots.reorderindicatordownicon || "ArrowUpIcon")))], 16)) : createCommentVNode("", true)], 16); -} -__name(render2, "render"); -script.render = render2; -export { - script$m as a, - script$n as b, - script$o as c, - script$f as d, - script$d as e, - script$e as f, - script$r as g, - script as h, - script$l as s -}; -//# sourceMappingURL=index-Czd3J-KM.js.map diff --git a/comfy/web/assets/index-Czd3J-KM.js.map b/comfy/web/assets/index-Czd3J-KM.js.map deleted file mode 100644 index 05ffe3de7..000000000 --- a/comfy/web/assets/index-Czd3J-KM.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-Czd3J-KM.js","sources":["../../../../../node_modules/primevue/column/style/index.mjs","../../../../../node_modules/primevue/column/index.mjs","../../../../../node_modules/@primevue/icons/arrowdown/index.mjs","../../../../../node_modules/@primevue/icons/arrowup/index.mjs","../../../../../node_modules/primevue/paginator/style/index.mjs","../../../../../node_modules/@primevue/icons/angledoubleleft/index.mjs","../../../../../node_modules/@primevue/icons/angledoubleright/index.mjs","../../../../../node_modules/@primevue/icons/angleleft/index.mjs","../../../../../node_modules/primevue/paginator/index.mjs","../../../../../node_modules/primevue/datatable/style/index.mjs","../../../../../node_modules/@primevue/icons/pencil/index.mjs","../../../../../node_modules/primevue/radiobutton/style/index.mjs","../../../../../node_modules/primevue/radiobutton/index.mjs","../../../../../node_modules/@primevue/icons/filter/index.mjs","../../../../../node_modules/@primevue/icons/filterslash/index.mjs","../../../../../node_modules/@primevue/icons/trash/index.mjs","../../../../../node_modules/@primevue/icons/sortalt/index.mjs","../../../../../node_modules/@primevue/icons/sortamountdown/index.mjs","../../../../../node_modules/@primevue/icons/sortamountupalt/index.mjs","../../../../../node_modules/primevue/datatable/index.mjs"],"sourcesContent":["import BaseStyle from '@primevue/core/base/style';\n\nvar ColumnStyle = BaseStyle.extend({\n name: 'column'\n});\n\nexport { ColumnStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseComponent from '@primevue/core/basecomponent';\nimport ColumnStyle from 'primevue/column/style';\n\nvar script$1 = {\n name: 'BaseColumn',\n \"extends\": BaseComponent,\n props: {\n columnKey: {\n type: null,\n \"default\": null\n },\n field: {\n type: [String, Function],\n \"default\": null\n },\n sortField: {\n type: [String, Function],\n \"default\": null\n },\n filterField: {\n type: [String, Function],\n \"default\": null\n },\n dataType: {\n type: String,\n \"default\": 'text'\n },\n sortable: {\n type: Boolean,\n \"default\": false\n },\n header: {\n type: null,\n \"default\": null\n },\n footer: {\n type: null,\n \"default\": null\n },\n style: {\n type: null,\n \"default\": null\n },\n \"class\": {\n type: String,\n \"default\": null\n },\n headerStyle: {\n type: null,\n \"default\": null\n },\n headerClass: {\n type: String,\n \"default\": null\n },\n bodyStyle: {\n type: null,\n \"default\": null\n },\n bodyClass: {\n type: String,\n \"default\": null\n },\n footerStyle: {\n type: null,\n \"default\": null\n },\n footerClass: {\n type: String,\n \"default\": null\n },\n showFilterMenu: {\n type: Boolean,\n \"default\": true\n },\n showFilterOperator: {\n type: Boolean,\n \"default\": true\n },\n showClearButton: {\n type: Boolean,\n \"default\": true\n },\n showApplyButton: {\n type: Boolean,\n \"default\": true\n },\n showFilterMatchModes: {\n type: Boolean,\n \"default\": true\n },\n showAddButton: {\n type: Boolean,\n \"default\": true\n },\n filterMatchModeOptions: {\n type: Array,\n \"default\": null\n },\n maxConstraints: {\n type: Number,\n \"default\": 2\n },\n excludeGlobalFilter: {\n type: Boolean,\n \"default\": false\n },\n filterHeaderClass: {\n type: String,\n \"default\": null\n },\n filterHeaderStyle: {\n type: null,\n \"default\": null\n },\n filterMenuClass: {\n type: String,\n \"default\": null\n },\n filterMenuStyle: {\n type: null,\n \"default\": null\n },\n selectionMode: {\n type: String,\n \"default\": null\n },\n expander: {\n type: Boolean,\n \"default\": false\n },\n colspan: {\n type: Number,\n \"default\": null\n },\n rowspan: {\n type: Number,\n \"default\": null\n },\n rowReorder: {\n type: Boolean,\n \"default\": false\n },\n rowReorderIcon: {\n type: String,\n \"default\": undefined\n },\n reorderableColumn: {\n type: Boolean,\n \"default\": true\n },\n rowEditor: {\n type: Boolean,\n \"default\": false\n },\n frozen: {\n type: Boolean,\n \"default\": false\n },\n alignFrozen: {\n type: String,\n \"default\": 'left'\n },\n exportable: {\n type: Boolean,\n \"default\": true\n },\n exportHeader: {\n type: String,\n \"default\": null\n },\n exportFooter: {\n type: String,\n \"default\": null\n },\n filterMatchMode: {\n type: String,\n \"default\": null\n },\n hidden: {\n type: Boolean,\n \"default\": false\n }\n },\n style: ColumnStyle,\n provide: function provide() {\n return {\n $pcColumn: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'Column',\n \"extends\": script$1,\n inheritAttrs: false,\n inject: ['$columns'],\n mounted: function mounted() {\n var _this$$columns;\n (_this$$columns = this.$columns) === null || _this$$columns === void 0 || _this$$columns.add(this.$);\n },\n unmounted: function unmounted() {\n var _this$$columns2;\n (_this$$columns2 = this.$columns) === null || _this$$columns2 === void 0 || _this$$columns2[\"delete\"](this.$);\n },\n render: function render() {\n return null;\n }\n};\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'ArrowDownIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M6.99994 14C6.91097 14.0004 6.82281 13.983 6.74064 13.9489C6.65843 13.9148 6.58387 13.8646 6.52133 13.8013L1.10198 8.38193C0.982318 8.25351 0.917175 8.08367 0.920272 7.90817C0.923368 7.73267 0.994462 7.56523 1.11858 7.44111C1.24269 7.317 1.41014 7.2459 1.58563 7.2428C1.76113 7.23971 1.93098 7.30485 2.0594 7.42451L6.32263 11.6877V0.677419C6.32263 0.497756 6.394 0.325452 6.52104 0.198411C6.64808 0.0713706 6.82039 0 7.00005 0C7.17971 0 7.35202 0.0713706 7.47906 0.198411C7.6061 0.325452 7.67747 0.497756 7.67747 0.677419V11.6877L11.9407 7.42451C12.0691 7.30485 12.2389 7.23971 12.4144 7.2428C12.5899 7.2459 12.7574 7.317 12.8815 7.44111C13.0056 7.56523 13.0767 7.73267 13.0798 7.90817C13.0829 8.08367 13.0178 8.25351 12.8981 8.38193L7.47875 13.8013C7.41621 13.8646 7.34164 13.9148 7.25944 13.9489C7.17727 13.983 7.08912 14.0004 7.00015 14C7.00012 14 7.00009 14 7.00005 14C7.00001 14 6.99998 14 6.99994 14Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'ArrowUpIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M6.51551 13.799C6.64205 13.9255 6.813 13.9977 6.99193 14C7.17087 13.9977 7.34182 13.9255 7.46835 13.799C7.59489 13.6725 7.66701 13.5015 7.66935 13.3226V2.31233L11.9326 6.57554C11.9951 6.63887 12.0697 6.68907 12.1519 6.72319C12.2341 6.75731 12.3223 6.77467 12.4113 6.77425C12.5003 6.77467 12.5885 6.75731 12.6707 6.72319C12.7529 6.68907 12.8274 6.63887 12.89 6.57554C13.0168 6.44853 13.0881 6.27635 13.0881 6.09683C13.0881 5.91732 13.0168 5.74514 12.89 5.61812L7.48846 0.216594C7.48274 0.210436 7.4769 0.204374 7.47094 0.198411C7.3439 0.0713707 7.1716 0 6.99193 0C6.81227 0 6.63997 0.0713707 6.51293 0.198411C6.50704 0.204296 6.50128 0.210278 6.49563 0.216354L1.09386 5.61812C0.974201 5.74654 0.909057 5.91639 0.912154 6.09189C0.91525 6.26738 0.986345 6.43483 1.11046 6.55894C1.23457 6.68306 1.40202 6.75415 1.57752 6.75725C1.75302 6.76035 1.92286 6.6952 2.05128 6.57554L6.31451 2.31231V13.3226C6.31685 13.5015 6.38898 13.6725 6.51551 13.799Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-paginator {\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n flex-wrap: wrap;\\n background: \".concat(dt('paginator.background'), \";\\n color: \").concat(dt('paginator.color'), \";\\n padding: \").concat(dt('paginator.padding'), \";\\n border-radius: \").concat(dt('paginator.border.radius'), \";\\n gap: \").concat(dt('paginator.gap'), \";\\n}\\n\\n.p-paginator-content {\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n flex-wrap: wrap;\\n gap: \").concat(dt('paginator.gap'), \";\\n}\\n\\n.p-paginator-content-start {\\n margin-inline-end: auto;\\n}\\n\\n.p-paginator-content-end {\\n margin-inline-start: auto;\\n}\\n\\n.p-paginator-page,\\n.p-paginator-next,\\n.p-paginator-last,\\n.p-paginator-first,\\n.p-paginator-prev {\\n cursor: pointer;\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n line-height: 1;\\n user-select: none;\\n overflow: hidden;\\n position: relative;\\n background: \").concat(dt('paginator.nav.button.background'), \";\\n border: 0 none;\\n color: \").concat(dt('paginator.nav.button.color'), \";\\n min-width: \").concat(dt('paginator.nav.button.width'), \";\\n height: \").concat(dt('paginator.nav.button.height'), \";\\n transition: background \").concat(dt('paginator.transition.duration'), \", color \").concat(dt('paginator.transition.duration'), \", outline-color \").concat(dt('paginator.transition.duration'), \", box-shadow \").concat(dt('paginator.transition.duration'), \";\\n border-radius: \").concat(dt('paginator.nav.button.border.radius'), \";\\n padding: 0;\\n margin: 0;\\n}\\n\\n.p-paginator-page:focus-visible,\\n.p-paginator-next:focus-visible,\\n.p-paginator-last:focus-visible,\\n.p-paginator-first:focus-visible,\\n.p-paginator-prev:focus-visible {\\n box-shadow: \").concat(dt('paginator.nav.button.focus.ring.shadow'), \";\\n outline: \").concat(dt('paginator.nav.button.focus.ring.width'), \" \").concat(dt('paginator.nav.button.focus.ring.style'), \" \").concat(dt('paginator.nav.button.focus.ring.color'), \";\\n outline-offset: \").concat(dt('paginator.nav.button.focus.ring.offset'), \";\\n}\\n\\n.p-paginator-page:not(.p-disabled):not(.p-paginator-page-selected):hover,\\n.p-paginator-first:not(.p-disabled):hover,\\n.p-paginator-prev:not(.p-disabled):hover,\\n.p-paginator-next:not(.p-disabled):hover,\\n.p-paginator-last:not(.p-disabled):hover {\\n background: \").concat(dt('paginator.nav.button.hover.background'), \";\\n color: \").concat(dt('paginator.nav.button.hover.color'), \";\\n}\\n\\n.p-paginator-page.p-paginator-page-selected {\\n background: \").concat(dt('paginator.nav.button.selected.background'), \";\\n color: \").concat(dt('paginator.nav.button.selected.color'), \";\\n}\\n\\n.p-paginator-current {\\n color: \").concat(dt('paginator.current.page.report.color'), \";\\n}\\n\\n.p-paginator-pages {\\n display: flex;\\n align-items: center;\\n gap: \").concat(dt('paginator.gap'), \";\\n}\\n\\n.p-paginator-jtp-input .p-inputtext {\\n max-width: \").concat(dt('paginator.jump.to.page.input.max.width'), \";\\n}\\n\\n.p-paginator-first:dir(rtl),\\n.p-paginator-prev:dir(rtl),\\n.p-paginator-next:dir(rtl),\\n.p-paginator-last:dir(rtl) {\\n transform: rotate(180deg);\\n}\\n\");\n};\nvar classes = {\n paginator: function paginator(_ref2) {\n var instance = _ref2.instance,\n key = _ref2.key;\n return ['p-paginator p-component', _defineProperty({\n 'p-paginator-default': !instance.hasBreakpoints()\n }, \"p-paginator-\".concat(key), instance.hasBreakpoints())];\n },\n content: 'p-paginator-content',\n contentStart: 'p-paginator-content-start',\n contentEnd: 'p-paginator-content-end',\n first: function first(_ref4) {\n var instance = _ref4.instance;\n return ['p-paginator-first', {\n 'p-disabled': instance.$attrs.disabled\n }];\n },\n firstIcon: 'p-paginator-first-icon',\n prev: function prev(_ref5) {\n var instance = _ref5.instance;\n return ['p-paginator-prev', {\n 'p-disabled': instance.$attrs.disabled\n }];\n },\n prevIcon: 'p-paginator-prev-icon',\n next: function next(_ref6) {\n var instance = _ref6.instance;\n return ['p-paginator-next', {\n 'p-disabled': instance.$attrs.disabled\n }];\n },\n nextIcon: 'p-paginator-next-icon',\n last: function last(_ref7) {\n var instance = _ref7.instance;\n return ['p-paginator-last', {\n 'p-disabled': instance.$attrs.disabled\n }];\n },\n lastIcon: 'p-paginator-last-icon',\n pages: 'p-paginator-pages',\n page: function page(_ref8) {\n var props = _ref8.props,\n pageLink = _ref8.pageLink;\n return ['p-paginator-page', {\n 'p-paginator-page-selected': pageLink - 1 === props.page\n }];\n },\n current: 'p-paginator-current',\n pcRowPerPageDropdown: 'p-paginator-rpp-dropdown',\n pcJumpToPageDropdown: 'p-paginator-jtp-dropdown',\n pcJumpToPageInputText: 'p-paginator-jtp-input'\n};\nvar PaginatorStyle = BaseStyle.extend({\n name: 'paginator',\n theme: theme,\n classes: classes\n});\n\nexport { PaginatorStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'AngleDoubleLeftIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M5.71602 11.164C5.80782 11.2021 5.9063 11.2215 6.00569 11.221C6.20216 11.2301 6.39427 11.1612 6.54025 11.0294C6.68191 10.8875 6.76148 10.6953 6.76148 10.4948C6.76148 10.2943 6.68191 10.1021 6.54025 9.96024L3.51441 6.9344L6.54025 3.90855C6.624 3.76126 6.65587 3.59011 6.63076 3.42254C6.60564 3.25498 6.525 3.10069 6.40175 2.98442C6.2785 2.86815 6.11978 2.79662 5.95104 2.7813C5.78229 2.76598 5.61329 2.80776 5.47112 2.89994L1.97123 6.39983C1.82957 6.54167 1.75 6.73393 1.75 6.9344C1.75 7.13486 1.82957 7.32712 1.97123 7.46896L5.47112 10.9991C5.54096 11.0698 5.62422 11.1259 5.71602 11.164ZM11.0488 10.9689C11.1775 11.1156 11.3585 11.2061 11.5531 11.221C11.7477 11.2061 11.9288 11.1156 12.0574 10.9689C12.1815 10.8302 12.25 10.6506 12.25 10.4645C12.25 10.2785 12.1815 10.0989 12.0574 9.96024L9.03158 6.93439L12.0574 3.90855C12.1248 3.76739 12.1468 3.60881 12.1204 3.45463C12.0939 3.30045 12.0203 3.15826 11.9097 3.04765C11.7991 2.93703 11.6569 2.86343 11.5027 2.83698C11.3486 2.81053 11.19 2.83252 11.0488 2.89994L7.51865 6.36957C7.37699 6.51141 7.29742 6.70367 7.29742 6.90414C7.29742 7.1046 7.37699 7.29686 7.51865 7.4387L11.0488 10.9689Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'AngleDoubleRightIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M7.68757 11.1451C7.7791 11.1831 7.8773 11.2024 7.9764 11.2019C8.07769 11.1985 8.17721 11.1745 8.26886 11.1312C8.36052 11.088 8.44238 11.0265 8.50943 10.9505L12.0294 7.49085C12.1707 7.34942 12.25 7.15771 12.25 6.95782C12.25 6.75794 12.1707 6.56622 12.0294 6.42479L8.50943 2.90479C8.37014 2.82159 8.20774 2.78551 8.04633 2.80192C7.88491 2.81833 7.73309 2.88635 7.6134 2.99588C7.4937 3.10541 7.41252 3.25061 7.38189 3.40994C7.35126 3.56927 7.37282 3.73423 7.44337 3.88033L10.4605 6.89748L7.44337 9.91463C7.30212 10.0561 7.22278 10.2478 7.22278 10.4477C7.22278 10.6475 7.30212 10.8393 7.44337 10.9807C7.51301 11.0512 7.59603 11.1071 7.68757 11.1451ZM1.94207 10.9505C2.07037 11.0968 2.25089 11.1871 2.44493 11.2019C2.63898 11.1871 2.81949 11.0968 2.94779 10.9505L6.46779 7.49085C6.60905 7.34942 6.68839 7.15771 6.68839 6.95782C6.68839 6.75793 6.60905 6.56622 6.46779 6.42479L2.94779 2.90479C2.80704 2.83757 2.6489 2.81563 2.49517 2.84201C2.34143 2.86839 2.19965 2.94178 2.08936 3.05207C1.97906 3.16237 1.90567 3.30415 1.8793 3.45788C1.85292 3.61162 1.87485 3.76975 1.94207 3.9105L4.95922 6.92765L1.94207 9.9448C1.81838 10.0831 1.75 10.2621 1.75 10.4477C1.75 10.6332 1.81838 10.8122 1.94207 10.9505Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'AngleLeftIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M8.75 11.185C8.65146 11.1854 8.55381 11.1662 8.4628 11.1284C8.37179 11.0906 8.28924 11.0351 8.22 10.965L4.72 7.46496C4.57955 7.32433 4.50066 7.13371 4.50066 6.93496C4.50066 6.73621 4.57955 6.54558 4.72 6.40496L8.22 2.93496C8.36095 2.84357 8.52851 2.80215 8.69582 2.81733C8.86312 2.83252 9.02048 2.90344 9.14268 3.01872C9.26487 3.134 9.34483 3.28696 9.36973 3.4531C9.39463 3.61924 9.36303 3.78892 9.28 3.93496L6.28 6.93496L9.28 9.93496C9.42045 10.0756 9.49934 10.2662 9.49934 10.465C9.49934 10.6637 9.42045 10.8543 9.28 10.995C9.13526 11.1257 8.9448 11.1939 8.75 11.185Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import { setAttribute } from '@primeuix/utils/dom';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport PaginatorStyle from 'primevue/paginator/style';\nimport { openBlock, createElementBlock, mergeProps, toDisplayString, resolveDirective, withDirectives, createBlock, resolveDynamicComponent, resolveComponent, normalizeClass, createSlots, withCtx, Fragment, renderList, createTextVNode, normalizeProps, renderSlot, createCommentVNode, createElementVNode } from 'vue';\nimport AngleDoubleLeftIcon from '@primevue/icons/angledoubleleft';\nimport Ripple from 'primevue/ripple';\nimport Select from 'primevue/select';\nimport InputNumber from 'primevue/inputnumber';\nimport AngleDoubleRightIcon from '@primevue/icons/angledoubleright';\nimport AngleRightIcon from '@primevue/icons/angleright';\nimport AngleLeftIcon from '@primevue/icons/angleleft';\n\nvar script$a = {\n name: 'BasePaginator',\n \"extends\": BaseComponent,\n props: {\n totalRecords: {\n type: Number,\n \"default\": 0\n },\n rows: {\n type: Number,\n \"default\": 0\n },\n first: {\n type: Number,\n \"default\": 0\n },\n pageLinkSize: {\n type: Number,\n \"default\": 5\n },\n rowsPerPageOptions: {\n type: Array,\n \"default\": null\n },\n template: {\n type: [Object, String],\n \"default\": 'FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown'\n },\n currentPageReportTemplate: {\n type: null,\n \"default\": '({currentPage} of {totalPages})'\n },\n alwaysShow: {\n type: Boolean,\n \"default\": true\n }\n },\n style: PaginatorStyle,\n provide: function provide() {\n return {\n $pcPaginator: this,\n $parentInstance: this\n };\n }\n};\n\nvar script$9 = {\n name: 'CurrentPageReport',\n hostName: 'Paginator',\n \"extends\": BaseComponent,\n props: {\n pageCount: {\n type: Number,\n \"default\": 0\n },\n currentPage: {\n type: Number,\n \"default\": 0\n },\n page: {\n type: Number,\n \"default\": 0\n },\n first: {\n type: Number,\n \"default\": 0\n },\n rows: {\n type: Number,\n \"default\": 0\n },\n totalRecords: {\n type: Number,\n \"default\": 0\n },\n template: {\n type: String,\n \"default\": '({currentPage} of {totalPages})'\n }\n },\n computed: {\n text: function text() {\n var text = this.template.replace('{currentPage}', this.currentPage).replace('{totalPages}', this.pageCount).replace('{first}', this.pageCount > 0 ? this.first + 1 : 0).replace('{last}', Math.min(this.first + this.rows, this.totalRecords)).replace('{rows}', this.rows).replace('{totalRecords}', this.totalRecords);\n return text;\n }\n }\n};\n\nfunction render$9(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"span\", mergeProps({\n \"class\": _ctx.cx('current')\n }, _ctx.ptm('current')), toDisplayString($options.text), 17);\n}\n\nscript$9.render = render$9;\n\nvar script$8 = {\n name: 'FirstPageLink',\n hostName: 'Paginator',\n \"extends\": BaseComponent,\n props: {\n template: {\n type: Function,\n \"default\": null\n }\n },\n methods: {\n getPTOptions: function getPTOptions(key) {\n return this.ptm(key, {\n context: {\n disabled: this.$attrs.disabled\n }\n });\n }\n },\n components: {\n AngleDoubleLeftIcon: AngleDoubleLeftIcon\n },\n directives: {\n ripple: Ripple\n }\n};\n\nfunction render$8(_ctx, _cache, $props, $setup, $data, $options) {\n var _directive_ripple = resolveDirective(\"ripple\");\n return withDirectives((openBlock(), createElementBlock(\"button\", mergeProps({\n \"class\": _ctx.cx('first'),\n type: \"button\"\n }, $options.getPTOptions('first'), {\n \"data-pc-group-section\": \"pagebutton\"\n }), [(openBlock(), createBlock(resolveDynamicComponent($props.template || 'AngleDoubleLeftIcon'), mergeProps({\n \"class\": _ctx.cx('firstIcon')\n }, $options.getPTOptions('firstIcon')), null, 16, [\"class\"]))], 16)), [[_directive_ripple]]);\n}\n\nscript$8.render = render$8;\n\nvar script$7 = {\n name: 'JumpToPageDropdown',\n hostName: 'Paginator',\n \"extends\": BaseComponent,\n emits: ['page-change'],\n props: {\n page: Number,\n pageCount: Number,\n disabled: Boolean,\n templates: null\n },\n methods: {\n onChange: function onChange(value) {\n this.$emit('page-change', value);\n }\n },\n computed: {\n pageOptions: function pageOptions() {\n var opts = [];\n for (var i = 0; i < this.pageCount; i++) {\n opts.push({\n label: String(i + 1),\n value: i\n });\n }\n return opts;\n }\n },\n components: {\n JTPSelect: Select\n }\n};\n\nfunction render$7(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_JTPSelect = resolveComponent(\"JTPSelect\");\n return openBlock(), createBlock(_component_JTPSelect, {\n modelValue: $props.page,\n options: $options.pageOptions,\n optionLabel: \"label\",\n optionValue: \"value\",\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = function ($event) {\n return $options.onChange($event);\n }),\n \"class\": normalizeClass(_ctx.cx('pcJumpToPageDropdown')),\n disabled: $props.disabled,\n unstyled: _ctx.unstyled,\n pt: _ctx.ptm('pcJumpToPageDropdown'),\n \"data-pc-group-section\": \"pagedropdown\"\n }, createSlots({\n _: 2\n }, [$props.templates['jumptopagedropdownicon'] ? {\n name: \"dropdownicon\",\n fn: withCtx(function (slotProps) {\n return [(openBlock(), createBlock(resolveDynamicComponent($props.templates['jumptopagedropdownicon']), {\n \"class\": normalizeClass(slotProps[\"class\"])\n }, null, 8, [\"class\"]))];\n }),\n key: \"0\"\n } : undefined]), 1032, [\"modelValue\", \"options\", \"class\", \"disabled\", \"unstyled\", \"pt\"]);\n}\n\nscript$7.render = render$7;\n\nvar script$6 = {\n name: 'JumpToPageInput',\n hostName: 'Paginator',\n \"extends\": BaseComponent,\n inheritAttrs: false,\n emits: ['page-change'],\n props: {\n page: Number,\n pageCount: Number,\n disabled: Boolean\n },\n data: function data() {\n return {\n d_page: this.page\n };\n },\n watch: {\n page: function page(newValue) {\n this.d_page = newValue;\n }\n },\n methods: {\n onChange: function onChange(value) {\n if (value !== this.page) {\n this.d_page = value;\n this.$emit('page-change', value - 1);\n }\n }\n },\n computed: {\n inputArialabel: function inputArialabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.jumpToPageInputLabel : undefined;\n }\n },\n components: {\n JTPInput: InputNumber\n }\n};\n\nfunction render$6(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_JTPInput = resolveComponent(\"JTPInput\");\n return openBlock(), createBlock(_component_JTPInput, {\n ref: \"jtpInput\",\n modelValue: $data.d_page,\n \"class\": normalizeClass(_ctx.cx('pcJumpToPageInputText')),\n \"aria-label\": $options.inputArialabel,\n disabled: $props.disabled,\n \"onUpdate:modelValue\": $options.onChange,\n unstyled: _ctx.unstyled,\n pt: _ctx.ptm('pcJumpToPageInputText')\n }, null, 8, [\"modelValue\", \"class\", \"aria-label\", \"disabled\", \"onUpdate:modelValue\", \"unstyled\", \"pt\"]);\n}\n\nscript$6.render = render$6;\n\nvar script$5 = {\n name: 'LastPageLink',\n hostName: 'Paginator',\n \"extends\": BaseComponent,\n props: {\n template: {\n type: Function,\n \"default\": null\n }\n },\n methods: {\n getPTOptions: function getPTOptions(key) {\n return this.ptm(key, {\n context: {\n disabled: this.$attrs.disabled\n }\n });\n }\n },\n components: {\n AngleDoubleRightIcon: AngleDoubleRightIcon\n },\n directives: {\n ripple: Ripple\n }\n};\n\nfunction render$5(_ctx, _cache, $props, $setup, $data, $options) {\n var _directive_ripple = resolveDirective(\"ripple\");\n return withDirectives((openBlock(), createElementBlock(\"button\", mergeProps({\n \"class\": _ctx.cx('last'),\n type: \"button\"\n }, $options.getPTOptions('last'), {\n \"data-pc-group-section\": \"pagebutton\"\n }), [(openBlock(), createBlock(resolveDynamicComponent($props.template || 'AngleDoubleRightIcon'), mergeProps({\n \"class\": _ctx.cx('lastIcon')\n }, $options.getPTOptions('lastIcon')), null, 16, [\"class\"]))], 16)), [[_directive_ripple]]);\n}\n\nscript$5.render = render$5;\n\nvar script$4 = {\n name: 'NextPageLink',\n hostName: 'Paginator',\n \"extends\": BaseComponent,\n props: {\n template: {\n type: Function,\n \"default\": null\n }\n },\n methods: {\n getPTOptions: function getPTOptions(key) {\n return this.ptm(key, {\n context: {\n disabled: this.$attrs.disabled\n }\n });\n }\n },\n components: {\n AngleRightIcon: AngleRightIcon\n },\n directives: {\n ripple: Ripple\n }\n};\n\nfunction render$4(_ctx, _cache, $props, $setup, $data, $options) {\n var _directive_ripple = resolveDirective(\"ripple\");\n return withDirectives((openBlock(), createElementBlock(\"button\", mergeProps({\n \"class\": _ctx.cx('next'),\n type: \"button\"\n }, $options.getPTOptions('next'), {\n \"data-pc-group-section\": \"pagebutton\"\n }), [(openBlock(), createBlock(resolveDynamicComponent($props.template || 'AngleRightIcon'), mergeProps({\n \"class\": _ctx.cx('nextIcon')\n }, $options.getPTOptions('nextIcon')), null, 16, [\"class\"]))], 16)), [[_directive_ripple]]);\n}\n\nscript$4.render = render$4;\n\nvar script$3 = {\n name: 'PageLinks',\n hostName: 'Paginator',\n \"extends\": BaseComponent,\n inheritAttrs: false,\n emits: ['click'],\n props: {\n value: Array,\n page: Number\n },\n methods: {\n getPTOptions: function getPTOptions(pageLink, key) {\n return this.ptm(key, {\n context: {\n active: pageLink === this.page\n }\n });\n },\n onPageLinkClick: function onPageLinkClick(event, pageLink) {\n this.$emit('click', {\n originalEvent: event,\n value: pageLink\n });\n },\n ariaPageLabel: function ariaPageLabel(value) {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g, value) : undefined;\n }\n },\n directives: {\n ripple: Ripple\n }\n};\n\nvar _hoisted_1 = [\"aria-label\", \"aria-current\", \"onClick\", \"data-p-active\"];\nfunction render$3(_ctx, _cache, $props, $setup, $data, $options) {\n var _directive_ripple = resolveDirective(\"ripple\");\n return openBlock(), createElementBlock(\"span\", mergeProps({\n \"class\": _ctx.cx('pages')\n }, _ctx.ptm('pages')), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.value, function (pageLink) {\n return withDirectives((openBlock(), createElementBlock(\"button\", mergeProps({\n key: pageLink,\n \"class\": _ctx.cx('page', {\n pageLink: pageLink\n }),\n type: \"button\",\n \"aria-label\": $options.ariaPageLabel(pageLink),\n \"aria-current\": pageLink - 1 === $props.page ? 'page' : undefined,\n onClick: function onClick($event) {\n return $options.onPageLinkClick($event, pageLink);\n },\n ref_for: true\n }, $options.getPTOptions(pageLink - 1, 'page'), {\n \"data-p-active\": pageLink - 1 === $props.page\n }), [createTextVNode(toDisplayString(pageLink), 1)], 16, _hoisted_1)), [[_directive_ripple]]);\n }), 128))], 16);\n}\n\nscript$3.render = render$3;\n\nvar script$2 = {\n name: 'PrevPageLink',\n hostName: 'Paginator',\n \"extends\": BaseComponent,\n props: {\n template: {\n type: Function,\n \"default\": null\n }\n },\n methods: {\n getPTOptions: function getPTOptions(key) {\n return this.ptm(key, {\n context: {\n disabled: this.$attrs.disabled\n }\n });\n }\n },\n components: {\n AngleLeftIcon: AngleLeftIcon\n },\n directives: {\n ripple: Ripple\n }\n};\n\nfunction render$2(_ctx, _cache, $props, $setup, $data, $options) {\n var _directive_ripple = resolveDirective(\"ripple\");\n return withDirectives((openBlock(), createElementBlock(\"button\", mergeProps({\n \"class\": _ctx.cx('prev'),\n type: \"button\"\n }, $options.getPTOptions('prev'), {\n \"data-pc-group-section\": \"pagebutton\"\n }), [(openBlock(), createBlock(resolveDynamicComponent($props.template || 'AngleLeftIcon'), mergeProps({\n \"class\": _ctx.cx('prevIcon')\n }, $options.getPTOptions('prevIcon')), null, 16, [\"class\"]))], 16)), [[_directive_ripple]]);\n}\n\nscript$2.render = render$2;\n\nvar script$1 = {\n name: 'RowsPerPageDropdown',\n hostName: 'Paginator',\n \"extends\": BaseComponent,\n emits: ['rows-change'],\n props: {\n options: Array,\n rows: Number,\n disabled: Boolean,\n templates: null\n },\n methods: {\n onChange: function onChange(value) {\n this.$emit('rows-change', value);\n }\n },\n computed: {\n rowsOptions: function rowsOptions() {\n var opts = [];\n if (this.options) {\n for (var i = 0; i < this.options.length; i++) {\n opts.push({\n label: String(this.options[i]),\n value: this.options[i]\n });\n }\n }\n return opts;\n }\n },\n components: {\n RPPSelect: Select\n }\n};\n\nfunction render$1(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_RPPSelect = resolveComponent(\"RPPSelect\");\n return openBlock(), createBlock(_component_RPPSelect, {\n modelValue: $props.rows,\n options: $options.rowsOptions,\n optionLabel: \"label\",\n optionValue: \"value\",\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = function ($event) {\n return $options.onChange($event);\n }),\n \"class\": normalizeClass(_ctx.cx('pcRowPerPageDropdown')),\n disabled: $props.disabled,\n unstyled: _ctx.unstyled,\n pt: _ctx.ptm('pcRowPerPageDropdown'),\n \"data-pc-group-section\": \"pagedropdown\"\n }, createSlots({\n _: 2\n }, [$props.templates['rowsperpagedropdownicon'] ? {\n name: \"dropdownicon\",\n fn: withCtx(function (slotProps) {\n return [(openBlock(), createBlock(resolveDynamicComponent($props.templates['rowsperpagedropdownicon']), {\n \"class\": normalizeClass(slotProps[\"class\"])\n }, null, 8, [\"class\"]))];\n }),\n key: \"0\"\n } : undefined]), 1032, [\"modelValue\", \"options\", \"class\", \"disabled\", \"unstyled\", \"pt\"]);\n}\n\nscript$1.render = render$1;\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nvar script = {\n name: 'Paginator',\n \"extends\": script$a,\n inheritAttrs: false,\n emits: ['update:first', 'update:rows', 'page'],\n data: function data() {\n return {\n d_first: this.first,\n d_rows: this.rows\n };\n },\n watch: {\n first: function first(newValue) {\n this.d_first = newValue;\n },\n rows: function rows(newValue) {\n this.d_rows = newValue;\n },\n totalRecords: function totalRecords(newValue) {\n if (this.page > 0 && newValue && this.d_first >= newValue) {\n this.changePage(this.pageCount - 1);\n }\n }\n },\n mounted: function mounted() {\n this.createStyle();\n },\n methods: {\n changePage: function changePage(p) {\n var pc = this.pageCount;\n if (p >= 0 && p < pc) {\n this.d_first = this.d_rows * p;\n var state = {\n page: p,\n first: this.d_first,\n rows: this.d_rows,\n pageCount: pc\n };\n this.$emit('update:first', this.d_first);\n this.$emit('update:rows', this.d_rows);\n this.$emit('page', state);\n }\n },\n changePageToFirst: function changePageToFirst(event) {\n if (!this.isFirstPage) {\n this.changePage(0);\n }\n event.preventDefault();\n },\n changePageToPrev: function changePageToPrev(event) {\n this.changePage(this.page - 1);\n event.preventDefault();\n },\n changePageLink: function changePageLink(event) {\n this.changePage(event.value - 1);\n event.originalEvent.preventDefault();\n },\n changePageToNext: function changePageToNext(event) {\n this.changePage(this.page + 1);\n event.preventDefault();\n },\n changePageToLast: function changePageToLast(event) {\n if (!this.isLastPage) {\n this.changePage(this.pageCount - 1);\n }\n event.preventDefault();\n },\n onRowChange: function onRowChange(value) {\n this.d_rows = value;\n this.changePage(this.page);\n },\n createStyle: function createStyle() {\n var _this = this;\n if (this.hasBreakpoints() && !this.isUnstyled) {\n var _this$$primevue;\n this.styleElement = document.createElement('style');\n this.styleElement.type = 'text/css';\n setAttribute(this.styleElement, 'nonce', (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);\n document.body.appendChild(this.styleElement);\n var innerHTML = '';\n var keys = Object.keys(this.template);\n var sortedBreakpoints = {};\n keys.sort(function (a, b) {\n return parseInt(a) - parseInt(b);\n }).forEach(function (key) {\n sortedBreakpoints[key] = _this.template[key];\n });\n for (var _i = 0, _Object$entries = Object.entries(Object.entries(sortedBreakpoints)); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n index = _Object$entries$_i[0],\n _Object$entries$_i$ = _slicedToArray(_Object$entries$_i[1], 1),\n key = _Object$entries$_i$[0];\n var minValue = void 0,\n calculatedMinValue = void 0;\n if (key !== 'default' && typeof Object.keys(sortedBreakpoints)[index - 1] === 'string') {\n calculatedMinValue = Number(Object.keys(sortedBreakpoints)[index - 1].slice(0, -2)) + 1 + 'px';\n } else {\n calculatedMinValue = Object.keys(sortedBreakpoints)[index - 1];\n }\n minValue = Object.entries(sortedBreakpoints)[index - 1] ? \"and (min-width:\".concat(calculatedMinValue, \")\") : '';\n if (key === 'default') {\n innerHTML += \"\\n @media screen \".concat(minValue, \" {\\n .p-paginator[\").concat(this.$attrSelector, \"],\\n display: flex;\\n }\\n }\\n \");\n } else {\n innerHTML += \"\\n.p-paginator-\".concat(key, \" {\\n display: none;\\n}\\n@media screen \").concat(minValue, \" and (max-width: \").concat(key, \") {\\n .p-paginator-\").concat(key, \" {\\n display: flex;\\n }\\n\\n .p-paginator-default{\\n display: none;\\n }\\n}\\n \");\n }\n }\n this.styleElement.innerHTML = innerHTML;\n }\n },\n hasBreakpoints: function hasBreakpoints() {\n return _typeof(this.template) === 'object';\n },\n getAriaLabel: function getAriaLabel(labelType) {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria[labelType] : undefined;\n }\n },\n computed: {\n templateItems: function templateItems() {\n var keys = {};\n if (this.hasBreakpoints()) {\n keys = this.template;\n if (!keys[\"default\"]) {\n keys[\"default\"] = 'FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown';\n }\n for (var item in keys) {\n keys[item] = this.template[item].split(' ').map(function (value) {\n return value.trim();\n });\n }\n return keys;\n }\n keys['default'] = this.template.split(' ').map(function (value) {\n return value.trim();\n });\n return keys;\n },\n page: function page() {\n return Math.floor(this.d_first / this.d_rows);\n },\n pageCount: function pageCount() {\n return Math.ceil(this.totalRecords / this.d_rows);\n },\n isFirstPage: function isFirstPage() {\n return this.page === 0;\n },\n isLastPage: function isLastPage() {\n return this.page === this.pageCount - 1;\n },\n calculatePageLinkBoundaries: function calculatePageLinkBoundaries() {\n var numberOfPages = this.pageCount;\n var visiblePages = Math.min(this.pageLinkSize, numberOfPages);\n\n //calculate range, keep current in middle if necessary\n var start = Math.max(0, Math.ceil(this.page - visiblePages / 2));\n var end = Math.min(numberOfPages - 1, start + visiblePages - 1);\n\n //check when approaching to last page\n var delta = this.pageLinkSize - (end - start + 1);\n start = Math.max(0, start - delta);\n return [start, end];\n },\n pageLinks: function pageLinks() {\n var pageLinks = [];\n var boundaries = this.calculatePageLinkBoundaries;\n var start = boundaries[0];\n var end = boundaries[1];\n for (var i = start; i <= end; i++) {\n pageLinks.push(i + 1);\n }\n return pageLinks;\n },\n currentState: function currentState() {\n return {\n page: this.page,\n first: this.d_first,\n rows: this.d_rows\n };\n },\n empty: function empty() {\n return this.pageCount === 0;\n },\n currentPage: function currentPage() {\n return this.pageCount > 0 ? this.page + 1 : 0;\n },\n last: function last() {\n return Math.min(this.d_first + this.rows, this.totalRecords);\n }\n },\n components: {\n CurrentPageReport: script$9,\n FirstPageLink: script$8,\n LastPageLink: script$5,\n NextPageLink: script$4,\n PageLinks: script$3,\n PrevPageLink: script$2,\n RowsPerPageDropdown: script$1,\n JumpToPageDropdown: script$7,\n JumpToPageInput: script$6\n }\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_FirstPageLink = resolveComponent(\"FirstPageLink\");\n var _component_PrevPageLink = resolveComponent(\"PrevPageLink\");\n var _component_NextPageLink = resolveComponent(\"NextPageLink\");\n var _component_LastPageLink = resolveComponent(\"LastPageLink\");\n var _component_PageLinks = resolveComponent(\"PageLinks\");\n var _component_CurrentPageReport = resolveComponent(\"CurrentPageReport\");\n var _component_RowsPerPageDropdown = resolveComponent(\"RowsPerPageDropdown\");\n var _component_JumpToPageDropdown = resolveComponent(\"JumpToPageDropdown\");\n var _component_JumpToPageInput = resolveComponent(\"JumpToPageInput\");\n return (_ctx.alwaysShow ? true : $options.pageLinks && $options.pageLinks.length > 1) ? (openBlock(), createElementBlock(\"nav\", normalizeProps(mergeProps({\n key: 0\n }, _ctx.ptmi('paginatorContainer'))), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.templateItems, function (value, key) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n key: key,\n ref_for: true,\n ref: \"paginator\",\n \"class\": _ctx.cx('paginator', {\n key: key\n })\n }, _ctx.ptm('root')), [_ctx.$slots.container ? renderSlot(_ctx.$slots, \"container\", {\n key: 0,\n first: $data.d_first + 1,\n last: $options.last,\n rows: $data.d_rows,\n page: $options.page,\n pageCount: $options.pageCount,\n totalRecords: _ctx.totalRecords,\n firstPageCallback: $options.changePageToFirst,\n lastPageCallback: $options.changePageToLast,\n prevPageCallback: $options.changePageToPrev,\n nextPageCallback: $options.changePageToNext,\n rowChangeCallback: $options.onRowChange\n }) : (openBlock(), createElementBlock(Fragment, {\n key: 1\n }, [_ctx.$slots.start ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('contentStart'),\n ref_for: true\n }, _ctx.ptm('contentStart')), [renderSlot(_ctx.$slots, \"start\", {\n state: $options.currentState\n })], 16)) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('content'),\n ref_for: true\n }, _ctx.ptm('content')), [(openBlock(true), createElementBlock(Fragment, null, renderList(value, function (item) {\n return openBlock(), createElementBlock(Fragment, {\n key: item\n }, [item === 'FirstPageLink' ? (openBlock(), createBlock(_component_FirstPageLink, {\n key: 0,\n \"aria-label\": $options.getAriaLabel('firstPageLabel'),\n template: _ctx.$slots.firsticon || _ctx.$slots.firstpagelinkicon,\n onClick: _cache[0] || (_cache[0] = function ($event) {\n return $options.changePageToFirst($event);\n }),\n disabled: $options.isFirstPage || $options.empty,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"aria-label\", \"template\", \"disabled\", \"unstyled\", \"pt\"])) : item === 'PrevPageLink' ? (openBlock(), createBlock(_component_PrevPageLink, {\n key: 1,\n \"aria-label\": $options.getAriaLabel('prevPageLabel'),\n template: _ctx.$slots.previcon || _ctx.$slots.prevpagelinkicon,\n onClick: _cache[1] || (_cache[1] = function ($event) {\n return $options.changePageToPrev($event);\n }),\n disabled: $options.isFirstPage || $options.empty,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"aria-label\", \"template\", \"disabled\", \"unstyled\", \"pt\"])) : item === 'NextPageLink' ? (openBlock(), createBlock(_component_NextPageLink, {\n key: 2,\n \"aria-label\": $options.getAriaLabel('nextPageLabel'),\n template: _ctx.$slots.nexticon || _ctx.$slots.nextpagelinkicon,\n onClick: _cache[2] || (_cache[2] = function ($event) {\n return $options.changePageToNext($event);\n }),\n disabled: $options.isLastPage || $options.empty,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"aria-label\", \"template\", \"disabled\", \"unstyled\", \"pt\"])) : item === 'LastPageLink' ? (openBlock(), createBlock(_component_LastPageLink, {\n key: 3,\n \"aria-label\": $options.getAriaLabel('lastPageLabel'),\n template: _ctx.$slots.lasticon || _ctx.$slots.lastpagelinkicon,\n onClick: _cache[3] || (_cache[3] = function ($event) {\n return $options.changePageToLast($event);\n }),\n disabled: $options.isLastPage || $options.empty,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"aria-label\", \"template\", \"disabled\", \"unstyled\", \"pt\"])) : item === 'PageLinks' ? (openBlock(), createBlock(_component_PageLinks, {\n key: 4,\n \"aria-label\": $options.getAriaLabel('pageLabel'),\n value: $options.pageLinks,\n page: $options.page,\n onClick: _cache[4] || (_cache[4] = function ($event) {\n return $options.changePageLink($event);\n }),\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"aria-label\", \"value\", \"page\", \"unstyled\", \"pt\"])) : item === 'CurrentPageReport' ? (openBlock(), createBlock(_component_CurrentPageReport, {\n key: 5,\n \"aria-live\": \"polite\",\n template: _ctx.currentPageReportTemplate,\n currentPage: $options.currentPage,\n page: $options.page,\n pageCount: $options.pageCount,\n first: $data.d_first,\n rows: $data.d_rows,\n totalRecords: _ctx.totalRecords,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"template\", \"currentPage\", \"page\", \"pageCount\", \"first\", \"rows\", \"totalRecords\", \"unstyled\", \"pt\"])) : item === 'RowsPerPageDropdown' && _ctx.rowsPerPageOptions ? (openBlock(), createBlock(_component_RowsPerPageDropdown, {\n key: 6,\n \"aria-label\": $options.getAriaLabel('rowsPerPageLabel'),\n rows: $data.d_rows,\n options: _ctx.rowsPerPageOptions,\n onRowsChange: _cache[5] || (_cache[5] = function ($event) {\n return $options.onRowChange($event);\n }),\n disabled: $options.empty,\n templates: _ctx.$slots,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"aria-label\", \"rows\", \"options\", \"disabled\", \"templates\", \"unstyled\", \"pt\"])) : item === 'JumpToPageDropdown' ? (openBlock(), createBlock(_component_JumpToPageDropdown, {\n key: 7,\n \"aria-label\": $options.getAriaLabel('jumpToPageDropdownLabel'),\n page: $options.page,\n pageCount: $options.pageCount,\n onPageChange: _cache[6] || (_cache[6] = function ($event) {\n return $options.changePage($event);\n }),\n disabled: $options.empty,\n templates: _ctx.$slots,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"aria-label\", \"page\", \"pageCount\", \"disabled\", \"templates\", \"unstyled\", \"pt\"])) : item === 'JumpToPageInput' ? (openBlock(), createBlock(_component_JumpToPageInput, {\n key: 8,\n page: $options.currentPage,\n onPageChange: _cache[7] || (_cache[7] = function ($event) {\n return $options.changePage($event);\n }),\n disabled: $options.empty,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"page\", \"disabled\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true)], 64);\n }), 128))], 16), _ctx.$slots.end ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('contentEnd'),\n ref_for: true\n }, _ctx.ptm('contentEnd')), [renderSlot(_ctx.$slots, \"end\", {\n state: $options.currentState\n })], 16)) : createCommentVNode(\"\", true)], 64))], 16);\n }), 128))], 16)) : createCommentVNode(\"\", true);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-datatable {\\n position: relative;\\n}\\n\\n.p-datatable-table {\\n border-spacing: 0;\\n border-collapse: separate;\\n width: 100%;\\n}\\n\\n.p-datatable-scrollable > .p-datatable-table-container {\\n position: relative;\\n}\\n\\n.p-datatable-scrollable-table > .p-datatable-thead {\\n inset-block-start: 0;\\n z-index: 1;\\n}\\n\\n.p-datatable-scrollable-table > .p-datatable-frozen-tbody {\\n position: sticky;\\n z-index: 1;\\n}\\n\\n.p-datatable-scrollable-table > .p-datatable-tfoot {\\n inset-block-end: 0;\\n z-index: 1;\\n}\\n\\n.p-datatable-scrollable .p-datatable-frozen-column {\\n position: sticky;\\n background: \".concat(dt('datatable.header.cell.background'), \";\\n}\\n\\n.p-datatable-scrollable th.p-datatable-frozen-column {\\n z-index: 1;\\n}\\n\\n.p-datatable-scrollable > .p-datatable-table-container > .p-datatable-table > .p-datatable-thead,\\n.p-datatable-scrollable > .p-datatable-table-container > .p-virtualscroller > .p-datatable-table > .p-datatable-thead {\\n background: \").concat(dt('datatable.header.cell.background'), \";\\n}\\n\\n.p-datatable-scrollable > .p-datatable-table-container > .p-datatable-table > .p-datatable-tfoot,\\n.p-datatable-scrollable > .p-datatable-table-container > .p-virtualscroller > .p-datatable-table > .p-datatable-tfoot {\\n background: \").concat(dt('datatable.footer.cell.background'), \";\\n}\\n\\n.p-datatable-flex-scrollable {\\n display: flex;\\n flex-direction: column;\\n height: 100%;\\n}\\n\\n.p-datatable-flex-scrollable > .p-datatable-table-container {\\n display: flex;\\n flex-direction: column;\\n flex: 1;\\n height: 100%;\\n}\\n\\n.p-datatable-scrollable-table > .p-datatable-tbody > .p-datatable-row-group-header {\\n position: sticky;\\n z-index: 1;\\n}\\n\\n.p-datatable-resizable-table > .p-datatable-thead > tr > th,\\n.p-datatable-resizable-table > .p-datatable-tfoot > tr > td,\\n.p-datatable-resizable-table > .p-datatable-tbody > tr > td {\\n overflow: hidden;\\n white-space: nowrap;\\n}\\n\\n.p-datatable-resizable-table > .p-datatable-thead > tr > th.p-datatable-resizable-column:not(.p-datatable-frozen-column) {\\n background-clip: padding-box;\\n position: relative;\\n}\\n\\n.p-datatable-resizable-table-fit > .p-datatable-thead > tr > th.p-datatable-resizable-column:last-child .p-datatable-column-resizer {\\n display: none;\\n}\\n\\n.p-datatable-column-resizer {\\n display: block;\\n position: absolute;\\n inset-block-start: 0;\\n inset-inline-end: 0;\\n margin: 0;\\n width: \").concat(dt('datatable.column.resizer.width'), \";\\n height: 100%;\\n padding: 0;\\n cursor: col-resize;\\n border: 1px solid transparent;\\n}\\n\\n.p-datatable-column-header-content {\\n display: flex;\\n align-items: center;\\n gap: \").concat(dt('datatable.header.cell.gap'), \";\\n}\\n\\n.p-datatable-column-resize-indicator {\\n width: \").concat(dt('datatable.resize.indicator.width'), \";\\n position: absolute;\\n z-index: 10;\\n display: none;\\n background: \").concat(dt('datatable.resize.indicator.color'), \";\\n}\\n\\n.p-datatable-row-reorder-indicator-up,\\n.p-datatable-row-reorder-indicator-down {\\n position: absolute;\\n display: none;\\n}\\n\\n.p-datatable-reorderable-column,\\n.p-datatable-reorderable-row-handle {\\n cursor: move;\\n}\\n\\n.p-datatable-mask {\\n position: absolute;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n z-index: 2;\\n}\\n\\n.p-datatable-inline-filter {\\n display: flex;\\n align-items: center;\\n width: 100%;\\n gap: \").concat(dt('datatable.filter.inline.gap'), \";\\n}\\n\\n.p-datatable-inline-filter .p-datatable-filter-element-container {\\n flex: 1 1 auto;\\n width: 1%;\\n}\\n\\n.p-datatable-filter-overlay {\\n background: \").concat(dt('datatable.filter.overlay.select.background'), \";\\n color: \").concat(dt('datatable.filter.overlay.select.color'), \";\\n border: 1px solid \").concat(dt('datatable.filter.overlay.select.border.color'), \";\\n border-radius: \").concat(dt('datatable.filter.overlay.select.border.radius'), \";\\n box-shadow: \").concat(dt('datatable.filter.overlay.select.shadow'), \";\\n min-width: 12.5rem;\\n}\\n\\n.p-datatable-filter-constraint-list {\\n margin: 0;\\n list-style: none;\\n display: flex;\\n flex-direction: column;\\n padding: \").concat(dt('datatable.filter.constraint.list.padding'), \";\\n gap: \").concat(dt('datatable.filter.constraint.list.gap'), \";\\n}\\n\\n.p-datatable-filter-constraint {\\n padding: \").concat(dt('datatable.filter.constraint.padding'), \";\\n color: \").concat(dt('datatable.filter.constraint.color'), \";\\n border-radius: \").concat(dt('datatable.filter.constraint.border.radius'), \";\\n cursor: pointer;\\n transition: background \").concat(dt('datatable.transition.duration'), \", color \").concat(dt('datatable.transition.duration'), \", border-color \").concat(dt('datatable.transition.duration'), \",\\n box-shadow \").concat(dt('datatable.transition.duration'), \";\\n}\\n\\n.p-datatable-filter-constraint-selected {\\n background: \").concat(dt('datatable.filter.constraint.selected.background'), \";\\n color: \").concat(dt('datatable.filter.constraint.selected.color'), \";\\n}\\n\\n.p-datatable-filter-constraint:not(.p-datatable-filter-constraint-selected):not(.p-disabled):hover {\\n background: \").concat(dt('datatable.filter.constraint.focus.background'), \";\\n color: \").concat(dt('datatable.filter.constraint.focus.color'), \";\\n}\\n\\n.p-datatable-filter-constraint:focus-visible {\\n outline: 0 none;\\n background: \").concat(dt('datatable.filter.constraint.focus.background'), \";\\n color: \").concat(dt('datatable.filter.constraint.focus.color'), \";\\n}\\n\\n.p-datatable-filter-constraint-selected:focus-visible {\\n outline: 0 none;\\n background: \").concat(dt('datatable.filter.constraint.selected.focus.background'), \";\\n color: \").concat(dt('datatable.filter.constraint.selected.focus.color'), \";\\n}\\n\\n.p-datatable-filter-constraint-separator {\\n border-block-start: 1px solid \").concat(dt('datatable.filter.constraint.separator.border.color'), \";\\n}\\n\\n.p-datatable-popover-filter {\\n display: inline-flex;\\n margin-inline-start: auto;\\n}\\n\\n.p-datatable-filter-overlay-popover {\\n background: \").concat(dt('datatable.filter.overlay.popover.background'), \";\\n color: \").concat(dt('datatable.filter.overlay.popover.color'), \";\\n border: 1px solid \").concat(dt('datatable.filter.overlay.popover.border.color'), \";\\n border-radius: \").concat(dt('datatable.filter.overlay.popover.border.radius'), \";\\n box-shadow: \").concat(dt('datatable.filter.overlay.popover.shadow'), \";\\n min-width: 12.5rem;\\n padding: \").concat(dt('datatable.filter.overlay.popover.padding'), \";\\n display: flex;\\n flex-direction: column;\\n gap: \").concat(dt('datatable.filter.overlay.popover.gap'), \";\\n}\\n\\n.p-datatable-filter-operator-dropdown {\\n width: 100%;\\n}\\n\\n.p-datatable-filter-rule-list,\\n.p-datatable-filter-rule {\\n display: flex;\\n flex-direction: column;\\n gap: \").concat(dt('datatable.filter.overlay.popover.gap'), \";\\n}\\n\\n.p-datatable-filter-rule {\\n border-block-end: 1px solid \").concat(dt('datatable.filter.rule.border.color'), \";\\n padding-bottom: \").concat(dt('datatable.filter.overlay.popover.gap'), \";\\n}\\n\\n.p-datatable-filter-rule:last-child {\\n border-block-end: 0 none;\\n padding-bottom: 0;\\n}\\n\\n.p-datatable-filter-add-rule-button {\\n width: 100%;\\n}\\n\\n.p-datatable-filter-remove-rule-button {\\n width: 100%;\\n}\\n\\n.p-datatable-filter-buttonbar {\\n padding: 0;\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n}\\n\\n.p-datatable-virtualscroller-spacer {\\n display: flex;\\n}\\n\\n.p-datatable .p-virtualscroller .p-virtualscroller-loading {\\n transform: none !important;\\n min-height: 0;\\n position: sticky;\\n inset-block-start: 0;\\n inset-inline-start: 0;\\n}\\n\\n.p-datatable-paginator-top {\\n border-color: \").concat(dt('datatable.paginator.top.border.color'), \";\\n border-style: solid;\\n border-width: \").concat(dt('datatable.paginator.top.border.width'), \";\\n}\\n\\n.p-datatable-paginator-bottom {\\n border-color: \").concat(dt('datatable.paginator.bottom.border.color'), \";\\n border-style: solid;\\n border-width: \").concat(dt('datatable.paginator.bottom.border.width'), \";\\n}\\n\\n.p-datatable-header {\\n background: \").concat(dt('datatable.header.background'), \";\\n color: \").concat(dt('datatable.header.color'), \";\\n border-color: \").concat(dt('datatable.header.border.color'), \";\\n border-style: solid;\\n border-width: \").concat(dt('datatable.header.border.width'), \";\\n padding: \").concat(dt('datatable.header.padding'), \";\\n}\\n\\n.p-datatable-footer {\\n background: \").concat(dt('datatable.footer.background'), \";\\n color: \").concat(dt('datatable.footer.color'), \";\\n border-color: \").concat(dt('datatable.footer.border.color'), \";\\n border-style: solid;\\n border-width: \").concat(dt('datatable.footer.border.width'), \";\\n padding: \").concat(dt('datatable.footer.padding'), \";\\n}\\n\\n.p-datatable-header-cell {\\n padding: \").concat(dt('datatable.header.cell.padding'), \";\\n background: \").concat(dt('datatable.header.cell.background'), \";\\n border-color: \").concat(dt('datatable.header.cell.border.color'), \";\\n border-style: solid;\\n border-width: 0 0 1px 0;\\n color: \").concat(dt('datatable.header.cell.color'), \";\\n font-weight: normal;\\n text-align: start;\\n transition: background \").concat(dt('datatable.transition.duration'), \", color \").concat(dt('datatable.transition.duration'), \", border-color \").concat(dt('datatable.transition.duration'), \",\\n outline-color \").concat(dt('datatable.transition.duration'), \", box-shadow \").concat(dt('datatable.transition.duration'), \";\\n}\\n\\n.p-datatable-column-title {\\n font-weight: \").concat(dt('datatable.column.title.font.weight'), \";\\n}\\n\\n.p-datatable-tbody > tr {\\n outline-color: transparent;\\n background: \").concat(dt('datatable.row.background'), \";\\n color: \").concat(dt('datatable.row.color'), \";\\n transition: background \").concat(dt('datatable.transition.duration'), \", color \").concat(dt('datatable.transition.duration'), \", border-color \").concat(dt('datatable.transition.duration'), \",\\n outline-color \").concat(dt('datatable.transition.duration'), \", box-shadow \").concat(dt('datatable.transition.duration'), \";\\n}\\n\\n.p-datatable-tbody > tr > td {\\n text-align: start;\\n border-color: \").concat(dt('datatable.body.cell.border.color'), \";\\n border-style: solid;\\n border-width: 0 0 1px 0;\\n padding: \").concat(dt('datatable.body.cell.padding'), \";\\n}\\n\\n.p-datatable-hoverable .p-datatable-tbody > tr:not(.p-datatable-row-selected):hover {\\n background: \").concat(dt('datatable.row.hover.background'), \";\\n color: \").concat(dt('datatable.row.hover.color'), \";\\n}\\n\\n.p-datatable-tbody > tr.p-datatable-row-selected {\\n background: \").concat(dt('datatable.row.selected.background'), \";\\n color: \").concat(dt('datatable.row.selected.color'), \";\\n}\\n\\n.p-datatable-tbody > tr:has(+ .p-datatable-row-selected) > td {\\n border-block-end-color: \").concat(dt('datatable.body.cell.selected.border.color'), \";\\n}\\n\\n.p-datatable-tbody > tr.p-datatable-row-selected > td {\\n border-block-end-color: \").concat(dt('datatable.body.cell.selected.border.color'), \";\\n}\\n\\n.p-datatable-tbody > tr:focus-visible,\\n.p-datatable-tbody > tr.p-datatable-contextmenu-row-selected {\\n box-shadow: \").concat(dt('datatable.row.focus.ring.shadow'), \";\\n outline: \").concat(dt('datatable.row.focus.ring.width'), \" \").concat(dt('datatable.row.focus.ring.style'), \" \").concat(dt('datatable.row.focus.ring.color'), \";\\n outline-offset: \").concat(dt('datatable.row.focus.ring.offset'), \";\\n}\\n\\n.p-datatable-tfoot > tr > td {\\n text-align: start;\\n padding: \").concat(dt('datatable.footer.cell.padding'), \";\\n border-color: \").concat(dt('datatable.footer.cell.border.color'), \";\\n border-style: solid;\\n border-width: 0 0 1px 0;\\n color: \").concat(dt('datatable.footer.cell.color'), \";\\n background: \").concat(dt('datatable.footer.cell.background'), \";\\n}\\n\\n.p-datatable-column-footer {\\n font-weight: \").concat(dt('datatable.column.footer.font.weight'), \";\\n}\\n\\n.p-datatable-sortable-column {\\n cursor: pointer;\\n user-select: none;\\n outline-color: transparent;\\n}\\n\\n.p-datatable-column-title,\\n.p-datatable-sort-icon,\\n.p-datatable-sort-badge {\\n vertical-align: middle;\\n}\\n\\n.p-datatable-sort-icon {\\n color: \").concat(dt('datatable.sort.icon.color'), \";\\n font-size: \").concat(dt('datatable.sort.icon.size'), \";\\n width: \").concat(dt('datatable.sort.icon.size'), \";\\n height: \").concat(dt('datatable.sort.icon.size'), \";\\n transition: color \").concat(dt('datatable.transition.duration'), \";\\n}\\n\\n.p-datatable-sortable-column:not(.p-datatable-column-sorted):hover {\\n background: \").concat(dt('datatable.header.cell.hover.background'), \";\\n color: \").concat(dt('datatable.header.cell.hover.color'), \";\\n}\\n\\n.p-datatable-sortable-column:not(.p-datatable-column-sorted):hover .p-datatable-sort-icon {\\n color: \").concat(dt('datatable.sort.icon.hover.color'), \";\\n}\\n\\n.p-datatable-column-sorted {\\n background: \").concat(dt('datatable.header.cell.selected.background'), \";\\n color: \").concat(dt('datatable.header.cell.selected.color'), \";\\n}\\n\\n.p-datatable-column-sorted .p-datatable-sort-icon {\\n color: \").concat(dt('datatable.header.cell.selected.color'), \";\\n}\\n\\n.p-datatable-sortable-column:focus-visible {\\n box-shadow: \").concat(dt('datatable.header.cell.focus.ring.shadow'), \";\\n outline: \").concat(dt('datatable.header.cell.focus.ring.width'), \" \").concat(dt('datatable.header.cell.focus.ring.style'), \" \").concat(dt('datatable.header.cell.focus.ring.color'), \";\\n outline-offset: \").concat(dt('datatable.header.cell.focus.ring.offset'), \";\\n}\\n\\n.p-datatable-hoverable .p-datatable-selectable-row {\\n cursor: pointer;\\n}\\n\\n.p-datatable-tbody > tr.p-datatable-dragpoint-top > td {\\n box-shadow: inset 0 2px 0 0 \").concat(dt('datatable.drop.point.color'), \";\\n}\\n\\n.p-datatable-tbody > tr.p-datatable-dragpoint-bottom > td {\\n box-shadow: inset 0 -2px 0 0 \").concat(dt('datatable.drop.point.color'), \";\\n}\\n\\n.p-datatable-loading-icon {\\n font-size: \").concat(dt('datatable.loading.icon.size'), \";\\n width: \").concat(dt('datatable.loading.icon.size'), \";\\n height: \").concat(dt('datatable.loading.icon.size'), \";\\n}\\n\\n.p-datatable-gridlines .p-datatable-header {\\n border-width: 1px 1px 0 1px;\\n}\\n\\n.p-datatable-gridlines .p-datatable-footer {\\n border-width: 0 1px 1px 1px;\\n}\\n\\n.p-datatable-gridlines .p-datatable-paginator-top {\\n border-width: 1px 1px 0 1px;\\n}\\n\\n.p-datatable-gridlines .p-datatable-paginator-bottom {\\n border-width: 0 1px 1px 1px;\\n}\\n\\n.p-datatable-gridlines .p-datatable-thead > tr > th {\\n border-width: 1px 0 1px 1px;\\n}\\n\\n.p-datatable-gridlines .p-datatable-thead > tr > th:last-child {\\n border-width: 1px;\\n}\\n\\n.p-datatable-gridlines .p-datatable-tbody > tr > td {\\n border-width: 1px 0 0 1px;\\n}\\n\\n.p-datatable-gridlines .p-datatable-tbody > tr > td:last-child {\\n border-width: 1px 1px 0 1px;\\n}\\n\\n.p-datatable-gridlines .p-datatable-tbody > tr:last-child > td {\\n border-width: 1px 0 1px 1px;\\n}\\n\\n.p-datatable-gridlines .p-datatable-tbody > tr:last-child > td:last-child {\\n border-width: 1px;\\n}\\n\\n.p-datatable-gridlines .p-datatable-tfoot > tr > td {\\n border-width: 1px 0 1px 1px;\\n}\\n\\n.p-datatable-gridlines .p-datatable-tfoot > tr > td:last-child {\\n border-width: 1px 1px 1px 1px;\\n}\\n\\n.p-datatable.p-datatable-gridlines .p-datatable-thead + .p-datatable-tfoot > tr > td {\\n border-width: 0 0 1px 1px;\\n}\\n\\n.p-datatable.p-datatable-gridlines .p-datatable-thead + .p-datatable-tfoot > tr > td:last-child {\\n border-width: 0 1px 1px 1px;\\n}\\n\\n.p-datatable.p-datatable-gridlines:has(.p-datatable-thead):has(.p-datatable-tbody) .p-datatable-tbody > tr > td {\\n border-width: 0 0 1px 1px;\\n}\\n\\n.p-datatable.p-datatable-gridlines:has(.p-datatable-thead):has(.p-datatable-tbody) .p-datatable-tbody > tr > td:last-child {\\n border-width: 0 1px 1px 1px;\\n}\\n\\n.p-datatable.p-datatable-gridlines:has(.p-datatable-tbody):has(.p-datatable-tfoot) .p-datatable-tbody > tr:last-child > td {\\n border-width: 0 0 0 1px;\\n}\\n\\n.p-datatable.p-datatable-gridlines:has(.p-datatable-tbody):has(.p-datatable-tfoot) .p-datatable-tbody > tr:last-child > td:last-child {\\n border-width: 0 1px 0 1px;\\n}\\n\\n.p-datatable.p-datatable-striped .p-datatable-tbody > tr.p-row-odd {\\n background: \").concat(dt('datatable.row.striped.background'), \";\\n}\\n\\n.p-datatable.p-datatable-striped .p-datatable-tbody > tr.p-row-odd.p-datatable-row-selected {\\n background: \").concat(dt('datatable.row.selected.background'), \";\\n color: \").concat(dt('datatable.row.selected.color'), \";\\n}\\n\\n.p-datatable-striped.p-datatable-hoverable .p-datatable-tbody > tr:not(.p-datatable-row-selected):hover {\\n background: \").concat(dt('datatable.row.hover.background'), \";\\n color: \").concat(dt('datatable.row.hover.color'), \";\\n}\\n\\n.p-datatable.p-datatable-sm .p-datatable-header {\\n padding: 0.375rem 0.5rem;\\n}\\n\\n.p-datatable.p-datatable-sm .p-datatable-thead > tr > th {\\n padding: 0.375rem 0.5rem;\\n}\\n\\n.p-datatable.p-datatable-sm .p-datatable-tbody > tr > td {\\n padding: 0.375rem 0.5rem;\\n}\\n\\n.p-datatable.p-datatable-sm .p-datatable-tfoot > tr > td {\\n padding: 0.375rem 0.5rem;\\n}\\n\\n.p-datatable.p-datatable-sm .p-datatable-footer {\\n padding: 0.375rem 0.5rem;\\n}\\n\\n.p-datatable.p-datatable-lg .p-datatable-header {\\n padding: 1rem 1.25rem;\\n}\\n\\n.p-datatable.p-datatable-lg .p-datatable-thead > tr > th {\\n padding: 1rem 1.25rem;\\n}\\n\\n.p-datatable.p-datatable-lg .p-datatable-tbody > tr > td {\\n padding: 1rem 1.25rem;\\n}\\n\\n.p-datatable.p-datatable-lg .p-datatable-tfoot > tr > td {\\n padding: 1rem 1.25rem;\\n}\\n\\n.p-datatable.p-datatable-lg .p-datatable-footer {\\n padding: 1rem 1.25rem;\\n}\\n\\n.p-datatable-row-toggle-button {\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n overflow: hidden;\\n position: relative;\\n width: \").concat(dt('datatable.row.toggle.button.size'), \";\\n height: \").concat(dt('datatable.row.toggle.button.size'), \";\\n color: \").concat(dt('datatable.row.toggle.button.color'), \";\\n border: 0 none;\\n background: transparent;\\n cursor: pointer;\\n border-radius: \").concat(dt('datatable.row.toggle.button.border.radius'), \";\\n transition: background \").concat(dt('datatable.transition.duration'), \", color \").concat(dt('datatable.transition.duration'), \", border-color \").concat(dt('datatable.transition.duration'), \",\\n outline-color \").concat(dt('datatable.transition.duration'), \", box-shadow \").concat(dt('datatable.transition.duration'), \";\\n outline-color: transparent;\\n user-select: none;\\n}\\n\\n.p-datatable-row-toggle-button:enabled:hover {\\n color: \").concat(dt('datatable.row.toggle.button.hover.color'), \";\\n background: \").concat(dt('datatable.row.toggle.button.hover.background'), \";\\n}\\n\\n.p-datatable-tbody > tr.p-datatable-row-selected .p-datatable-row-toggle-button:hover {\\n background: \").concat(dt('datatable.row.toggle.button.selected.hover.background'), \";\\n color: \").concat(dt('datatable.row.toggle.button.selected.hover.color'), \";\\n}\\n\\n.p-datatable-row-toggle-button:focus-visible {\\n box-shadow: \").concat(dt('datatable.row.toggle.button.focus.ring.shadow'), \";\\n outline: \").concat(dt('datatable.row.toggle.button.focus.ring.width'), \" \").concat(dt('datatable.row.toggle.button.focus.ring.style'), \" \").concat(dt('datatable.row.toggle.button.focus.ring.color'), \";\\n outline-offset: \").concat(dt('datatable.row.toggle.button.focus.ring.offset'), \";\\n}\\n\\n.p-datatable-row-toggle-icon:dir(rtl) {\\n transform: rotate(180deg);\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var props = _ref2.props;\n return ['p-datatable p-component', {\n 'p-datatable-hoverable': props.rowHover || props.selectionMode,\n 'p-datatable-resizable': props.resizableColumns,\n 'p-datatable-resizable-fit': props.resizableColumns && props.columnResizeMode === 'fit',\n 'p-datatable-scrollable': props.scrollable,\n 'p-datatable-flex-scrollable': props.scrollable && props.scrollHeight === 'flex',\n 'p-datatable-striped': props.stripedRows,\n 'p-datatable-gridlines': props.showGridlines,\n 'p-datatable-sm': props.size === 'small',\n 'p-datatable-lg': props.size === 'large'\n }];\n },\n mask: 'p-datatable-mask p-overlay-mask',\n loadingIcon: 'p-datatable-loading-icon',\n header: 'p-datatable-header',\n pcPaginator: function pcPaginator(_ref3) {\n var position = _ref3.position;\n return 'p-datatable-paginator-' + position;\n },\n tableContainer: 'p-datatable-table-container',\n table: function table(_ref4) {\n var props = _ref4.props;\n return ['p-datatable-table', {\n 'p-datatable-scrollable-table': props.scrollable,\n 'p-datatable-resizable-table': props.resizableColumns,\n 'p-datatable-resizable-table-fit': props.resizableColumns && props.columnResizeMode === 'fit'\n }];\n },\n thead: 'p-datatable-thead',\n headerCell: function headerCell(_ref5) {\n var instance = _ref5.instance,\n props = _ref5.props,\n column = _ref5.column;\n return column && !instance.columnProp(column, 'hidden') && (props.rowGroupMode !== 'subheader' || props.groupRowsBy !== instance.columnProp(column, 'field')) ? ['p-datatable-header-cell', {\n 'p-datatable-frozen-column': instance.columnProp(column, 'frozen')\n }] : ['p-datatable-header-cell', {\n 'p-datatable-sortable-column': instance.columnProp('sortable'),\n 'p-datatable-resizable-column': instance.resizableColumns,\n 'p-datatable-column-sorted': instance.isColumnSorted(),\n 'p-datatable-frozen-column': instance.columnProp('frozen'),\n 'p-datatable-reorderable-column': props.reorderableColumns\n }];\n },\n columnResizer: 'p-datatable-column-resizer',\n columnHeaderContent: 'p-datatable-column-header-content',\n columnTitle: 'p-datatable-column-title',\n columnFooter: 'p-datatable-column-footer',\n sortIcon: 'p-datatable-sort-icon',\n pcSortBadge: 'p-datatable-sort-badge',\n filter: function filter(_ref6) {\n var props = _ref6.props;\n return ['p-datatable-filter', {\n 'p-datatable-inline-filter': props.display === 'row',\n 'p-datatable-popover-filter': props.display === 'menu'\n }];\n },\n filterElementContainer: 'p-datatable-filter-element-container',\n pcColumnFilterButton: 'p-datatable-column-filter-button',\n pcColumnFilterClearButton: 'p-datatable-column-filter-clear-button',\n filterOverlay: function filterOverlay(_ref7) {\n _ref7.instance;\n var props = _ref7.props;\n return ['p-datatable-filter-overlay p-component', {\n 'p-datatable-filter-overlay-popover': props.display === 'menu'\n }];\n },\n filterConstraintList: 'p-datatable-filter-constraint-list',\n filterConstraint: function filterConstraint(_ref8) {\n var instance = _ref8.instance,\n matchMode = _ref8.matchMode;\n return ['p-datatable-filter-constraint', {\n 'p-datatable-filter-constraint-selected': matchMode && instance.isRowMatchModeSelected(matchMode.value)\n }];\n },\n filterConstraintSeparator: 'p-datatable-filter-constraint-separator',\n filterOperator: 'p-datatable-filter-operator',\n pcFilterOperatorDropdown: 'p-datatable-filter-operator-dropdown',\n filterRuleList: 'p-datatable-filter-rule-list',\n filterRule: 'p-datatable-filter-rule',\n pcFilterConstraintDropdown: 'p-datatable-filter-constraint-dropdown',\n pcFilterRemoveRuleButton: 'p-datatable-filter-remove-rule-button',\n pcFilterAddRuleButton: 'p-datatable-filter-add-rule-button',\n filterButtonbar: 'p-datatable-filter-buttonbar',\n pcFilterClearButton: 'p-datatable-filter-clear-button',\n pcFilterApplyButton: 'p-datatable-filter-apply-button',\n tbody: function tbody(_ref9) {\n var props = _ref9.props;\n return props.frozenRow ? 'p-datatable-tbody p-datatable-frozen-tbody' : 'p-datatable-tbody';\n },\n rowGroupHeader: 'p-datatable-row-group-header',\n rowToggleButton: 'p-datatable-row-toggle-button',\n rowToggleIcon: 'p-datatable-row-toggle-icon',\n row: function row(_ref10) {\n var instance = _ref10.instance,\n props = _ref10.props,\n index = _ref10.index,\n columnSelectionMode = _ref10.columnSelectionMode;\n var rowStyleClass = [];\n if (props.selectionMode) {\n rowStyleClass.push('p-datatable-selectable-row');\n }\n if (props.selection) {\n rowStyleClass.push({\n 'p-datatable-row-selected': columnSelectionMode ? instance.isSelected && instance.$parentInstance.$parentInstance.highlightOnSelect : instance.isSelected\n });\n }\n if (props.contextMenuSelection) {\n rowStyleClass.push({\n 'p-datatable-contextmenu-row-selected': instance.isSelectedWithContextMenu\n });\n }\n rowStyleClass.push(index % 2 === 0 ? 'p-row-even' : 'p-row-odd');\n return rowStyleClass;\n },\n rowExpansion: 'p-datatable-row-expansion',\n rowGroupFooter: 'p-datatable-row-group-footer',\n emptyMessage: 'p-datatable-empty-message',\n bodyCell: function bodyCell(_ref11) {\n var instance = _ref11.instance;\n return [{\n 'p-datatable-frozen-column': instance.columnProp('frozen')\n }];\n },\n reorderableRowHandle: 'p-datatable-reorderable-row-handle',\n pcRowEditorInit: 'p-datatable-row-editor-init',\n pcRowEditorSave: 'p-datatable-row-editor-save',\n pcRowEditorCancel: 'p-datatable-row-editor-cancel',\n tfoot: 'p-datatable-tfoot',\n footerCell: function footerCell(_ref12) {\n var instance = _ref12.instance;\n return [{\n 'p-datatable-frozen-column': instance.columnProp('frozen')\n }];\n },\n virtualScrollerSpacer: 'p-datatable-virtualscroller-spacer',\n footer: 'p-datatable-footer',\n columnResizeIndicator: 'p-datatable-column-resize-indicator',\n rowReorderIndicatorUp: 'p-datatable-row-reorder-indicator-up',\n rowReorderIndicatorDown: 'p-datatable-row-reorder-indicator-down'\n};\nvar inlineStyles = {\n tableContainer: {\n overflow: 'auto'\n },\n thead: {\n position: 'sticky'\n },\n tfoot: {\n position: 'sticky'\n }\n};\nvar DataTableStyle = BaseStyle.extend({\n name: 'datatable',\n theme: theme,\n classes: classes,\n inlineStyles: inlineStyles\n});\n\nexport { DataTableStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'PencilIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M0.609628 13.959C0.530658 13.9599 0.452305 13.9451 0.379077 13.9156C0.305849 13.8861 0.239191 13.8424 0.18294 13.787C0.118447 13.7234 0.0688234 13.6464 0.0376166 13.5614C0.00640987 13.4765 -0.00560954 13.3857 0.00241768 13.2956L0.25679 10.1501C0.267698 10.0041 0.331934 9.86709 0.437312 9.76516L9.51265 0.705715C10.0183 0.233014 10.6911 -0.0203041 11.3835 0.00127367C12.0714 0.00660201 12.7315 0.27311 13.2298 0.746671C13.7076 1.23651 13.9824 1.88848 13.9992 2.57201C14.0159 3.25554 13.7733 3.92015 13.32 4.4327L4.23648 13.5331C4.13482 13.6342 4.0017 13.6978 3.85903 13.7133L0.667067 14L0.609628 13.959ZM1.43018 10.4696L1.25787 12.714L3.50619 12.5092L12.4502 3.56444C12.6246 3.35841 12.7361 3.10674 12.7714 2.83933C12.8067 2.57193 12.7644 2.30002 12.6495 2.05591C12.5346 1.8118 12.3519 1.60575 12.1231 1.46224C11.8943 1.31873 11.6291 1.2438 11.3589 1.24633C11.1813 1.23508 11.0033 1.25975 10.8355 1.31887C10.6677 1.37798 10.5136 1.47033 10.3824 1.59036L1.43018 10.4696Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-radiobutton {\\n position: relative;\\n display: inline-flex;\\n user-select: none;\\n vertical-align: bottom;\\n width: \".concat(dt('radiobutton.width'), \";\\n height: \").concat(dt('radiobutton.height'), \";\\n}\\n\\n.p-radiobutton-input {\\n cursor: pointer;\\n appearance: none;\\n position: absolute;\\n top: 0;\\n inset-inline-start: 0;\\n width: 100%;\\n height: 100%;\\n padding: 0;\\n margin: 0;\\n opacity: 0;\\n z-index: 1;\\n outline: 0 none;\\n border: 1px solid transparent;\\n border-radius: 50%;\\n}\\n\\n.p-radiobutton-box {\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n border-radius: 50%;\\n border: 1px solid \").concat(dt('radiobutton.border.color'), \";\\n background: \").concat(dt('radiobutton.background'), \";\\n width: \").concat(dt('radiobutton.width'), \";\\n height: \").concat(dt('radiobutton.height'), \";\\n transition: background \").concat(dt('radiobutton.transition.duration'), \", color \").concat(dt('radiobutton.transition.duration'), \", border-color \").concat(dt('radiobutton.transition.duration'), \", box-shadow \").concat(dt('radiobutton.transition.duration'), \", outline-color \").concat(dt('radiobutton.transition.duration'), \";\\n outline-color: transparent;\\n box-shadow: \").concat(dt('radiobutton.shadow'), \";\\n}\\n\\n.p-radiobutton-icon {\\n transition-duration: \").concat(dt('radiobutton.transition.duration'), \";\\n background: transparent;\\n font-size: \").concat(dt('radiobutton.icon.size'), \";\\n width: \").concat(dt('radiobutton.icon.size'), \";\\n height: \").concat(dt('radiobutton.icon.size'), \";\\n border-radius: 50%;\\n backface-visibility: hidden;\\n transform: translateZ(0) scale(0.1);\\n}\\n\\n.p-radiobutton:not(.p-disabled):has(.p-radiobutton-input:hover) .p-radiobutton-box {\\n border-color: \").concat(dt('radiobutton.hover.border.color'), \";\\n}\\n\\n.p-radiobutton-checked .p-radiobutton-box {\\n border-color: \").concat(dt('radiobutton.checked.border.color'), \";\\n background: \").concat(dt('radiobutton.checked.background'), \";\\n}\\n\\n.p-radiobutton-checked .p-radiobutton-box .p-radiobutton-icon {\\n background: \").concat(dt('radiobutton.icon.checked.color'), \";\\n transform: translateZ(0) scale(1, 1);\\n visibility: visible;\\n}\\n\\n.p-radiobutton-checked:not(.p-disabled):has(.p-radiobutton-input:hover) .p-radiobutton-box {\\n border-color: \").concat(dt('radiobutton.checked.hover.border.color'), \";\\n background: \").concat(dt('radiobutton.checked.hover.background'), \";\\n}\\n\\n.p-radiobutton:not(.p-disabled):has(.p-radiobutton-input:hover).p-radiobutton-checked .p-radiobutton-box .p-radiobutton-icon {\\n background: \").concat(dt('radiobutton.icon.checked.hover.color'), \";\\n}\\n\\n.p-radiobutton:not(.p-disabled):has(.p-radiobutton-input:focus-visible) .p-radiobutton-box {\\n border-color: \").concat(dt('radiobutton.focus.border.color'), \";\\n box-shadow: \").concat(dt('radiobutton.focus.ring.shadow'), \";\\n outline: \").concat(dt('radiobutton.focus.ring.width'), \" \").concat(dt('radiobutton.focus.ring.style'), \" \").concat(dt('radiobutton.focus.ring.color'), \";\\n outline-offset: \").concat(dt('radiobutton.focus.ring.offset'), \";\\n}\\n\\n.p-radiobutton-checked:not(.p-disabled):has(.p-radiobutton-input:focus-visible) .p-radiobutton-box {\\n border-color: \").concat(dt('radiobutton.checked.focus.border.color'), \";\\n}\\n\\n.p-radiobutton.p-invalid > .p-radiobutton-box {\\n border-color: \").concat(dt('radiobutton.invalid.border.color'), \";\\n}\\n\\n.p-radiobutton.p-variant-filled .p-radiobutton-box {\\n background: \").concat(dt('radiobutton.filled.background'), \";\\n}\\n\\n.p-radiobutton.p-variant-filled.p-radiobutton-checked .p-radiobutton-box {\\n background: \").concat(dt('radiobutton.checked.background'), \";\\n}\\n\\n.p-radiobutton.p-variant-filled:not(.p-disabled):has(.p-radiobutton-input:hover).p-radiobutton-checked .p-radiobutton-box {\\n background: \").concat(dt('radiobutton.checked.hover.background'), \";\\n}\\n\\n.p-radiobutton.p-disabled {\\n opacity: 1;\\n}\\n\\n.p-radiobutton.p-disabled .p-radiobutton-box {\\n background: \").concat(dt('radiobutton.disabled.background'), \";\\n border-color: \").concat(dt('radiobutton.checked.disabled.border.color'), \";\\n}\\n\\n.p-radiobutton-checked.p-disabled .p-radiobutton-box .p-radiobutton-icon {\\n background: \").concat(dt('radiobutton.icon.disabled.color'), \";\\n}\\n\\n.p-radiobutton-sm,\\n.p-radiobutton-sm .p-radiobutton-box {\\n width: \").concat(dt('radiobutton.sm.width'), \";\\n height: \").concat(dt('radiobutton.sm.height'), \";\\n}\\n\\n.p-radiobutton-sm .p-radiobutton-icon {\\n font-size: \").concat(dt('radiobutton.icon.sm.size'), \";\\n width: \").concat(dt('radiobutton.icon.sm.size'), \";\\n height: \").concat(dt('radiobutton.icon.sm.size'), \";\\n}\\n\\n.p-radiobutton-lg,\\n.p-radiobutton-lg .p-radiobutton-box {\\n width: \").concat(dt('radiobutton.lg.width'), \";\\n height: \").concat(dt('radiobutton.lg.height'), \";\\n}\\n\\n.p-radiobutton-lg .p-radiobutton-icon {\\n font-size: \").concat(dt('radiobutton.icon.lg.size'), \";\\n width: \").concat(dt('radiobutton.icon.lg.size'), \";\\n height: \").concat(dt('radiobutton.icon.lg.size'), \";\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var instance = _ref2.instance,\n props = _ref2.props;\n return ['p-radiobutton p-component', {\n 'p-radiobutton-checked': instance.checked,\n 'p-disabled': props.disabled,\n 'p-invalid': instance.$pcRadioButtonGroup ? instance.$pcRadioButtonGroup.$invalid : instance.$invalid,\n 'p-variant-filled': instance.$variant === 'filled',\n 'p-radiobutton-sm p-inputfield-sm': props.size === 'small',\n 'p-radiobutton-lg p-inputfield-lg': props.size === 'large'\n }];\n },\n box: 'p-radiobutton-box',\n input: 'p-radiobutton-input',\n icon: 'p-radiobutton-icon'\n};\nvar RadioButtonStyle = BaseStyle.extend({\n name: 'radiobutton',\n theme: theme,\n classes: classes\n});\n\nexport { RadioButtonStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { equals } from '@primeuix/utils/object';\nimport BaseInput from '@primevue/core/baseinput';\nimport RadioButtonStyle from 'primevue/radiobutton/style';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script$1 = {\n name: 'BaseRadioButton',\n \"extends\": BaseInput,\n props: {\n value: null,\n binary: Boolean,\n readonly: {\n type: Boolean,\n \"default\": false\n },\n tabindex: {\n type: Number,\n \"default\": null\n },\n inputId: {\n type: String,\n \"default\": null\n },\n inputClass: {\n type: [String, Object],\n \"default\": null\n },\n inputStyle: {\n type: Object,\n \"default\": null\n },\n ariaLabelledby: {\n type: String,\n \"default\": null\n },\n ariaLabel: {\n type: String,\n \"default\": null\n }\n },\n style: RadioButtonStyle,\n provide: function provide() {\n return {\n $pcRadioButton: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'RadioButton',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['change', 'focus', 'blur'],\n inject: {\n $pcRadioButtonGroup: {\n \"default\": undefined\n }\n },\n methods: {\n getPTOptions: function getPTOptions(key) {\n var _ptm = key === 'root' ? this.ptmi : this.ptm;\n return _ptm(key, {\n context: {\n checked: this.checked,\n disabled: this.disabled\n }\n });\n },\n onChange: function onChange(event) {\n if (!this.disabled && !this.readonly) {\n var newModelValue = this.binary ? !this.checked : this.value;\n this.$pcRadioButtonGroup ? this.$pcRadioButtonGroup.writeValue(newModelValue, event) : this.writeValue(newModelValue, event);\n this.$emit('change', event);\n }\n },\n onFocus: function onFocus(event) {\n this.$emit('focus', event);\n },\n onBlur: function onBlur(event) {\n var _this$formField$onBlu, _this$formField;\n this.$emit('blur', event);\n (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField, event);\n }\n },\n computed: {\n groupName: function groupName() {\n return this.$pcRadioButtonGroup ? this.$pcRadioButtonGroup.groupName : this.$formName;\n },\n checked: function checked() {\n var value = this.$pcRadioButtonGroup ? this.$pcRadioButtonGroup.d_value : this.d_value;\n return value != null && (this.binary ? !!value : equals(value, this.value));\n }\n }\n};\n\nvar _hoisted_1 = [\"data-p-checked\", \"data-p-disabled\"];\nvar _hoisted_2 = [\"id\", \"value\", \"name\", \"checked\", \"tabindex\", \"disabled\", \"readonly\", \"aria-labelledby\", \"aria-label\", \"aria-invalid\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root')\n }, $options.getPTOptions('root'), {\n \"data-p-checked\": $options.checked,\n \"data-p-disabled\": _ctx.disabled\n }), [createElementVNode(\"input\", mergeProps({\n id: _ctx.inputId,\n type: \"radio\",\n \"class\": [_ctx.cx('input'), _ctx.inputClass],\n style: _ctx.inputStyle,\n value: _ctx.value,\n name: $options.groupName,\n checked: $options.checked,\n tabindex: _ctx.tabindex,\n disabled: _ctx.disabled,\n readonly: _ctx.readonly,\n \"aria-labelledby\": _ctx.ariaLabelledby,\n \"aria-label\": _ctx.ariaLabel,\n \"aria-invalid\": _ctx.invalid || undefined,\n onFocus: _cache[0] || (_cache[0] = function () {\n return $options.onFocus && $options.onFocus.apply($options, arguments);\n }),\n onBlur: _cache[1] || (_cache[1] = function () {\n return $options.onBlur && $options.onBlur.apply($options, arguments);\n }),\n onChange: _cache[2] || (_cache[2] = function () {\n return $options.onChange && $options.onChange.apply($options, arguments);\n })\n }, $options.getPTOptions('input')), null, 16, _hoisted_2), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('box')\n }, $options.getPTOptions('box')), [createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('icon')\n }, $options.getPTOptions('icon')), null, 16)], 16)], 16, _hoisted_1);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'FilterIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M8.64708 14H5.35296C5.18981 13.9979 5.03395 13.9321 4.91858 13.8167C4.8032 13.7014 4.73745 13.5455 4.73531 13.3824V7L0.329431 0.98C0.259794 0.889466 0.217389 0.780968 0.20718 0.667208C0.19697 0.553448 0.219379 0.439133 0.271783 0.337647C0.324282 0.236453 0.403423 0.151519 0.500663 0.0920138C0.597903 0.0325088 0.709548 0.000692754 0.823548 0H13.1765C13.2905 0.000692754 13.4021 0.0325088 13.4994 0.0920138C13.5966 0.151519 13.6758 0.236453 13.7283 0.337647C13.7807 0.439133 13.8031 0.553448 13.7929 0.667208C13.7826 0.780968 13.7402 0.889466 13.6706 0.98L9.26472 7V13.3824C9.26259 13.5455 9.19683 13.7014 9.08146 13.8167C8.96609 13.9321 8.81022 13.9979 8.64708 14ZM5.97061 12.7647H8.02943V6.79412C8.02878 6.66289 8.07229 6.53527 8.15296 6.43177L11.9412 1.23529H2.05884L5.86355 6.43177C5.94422 6.53527 5.98773 6.66289 5.98708 6.79412L5.97061 12.7647Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'FilterSlashIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M13.4994 0.0920138C13.5967 0.151519 13.6758 0.236453 13.7283 0.337647C13.7807 0.439133 13.8031 0.553448 13.7929 0.667208C13.7827 0.780968 13.7403 0.889466 13.6707 0.98L11.406 4.06823C11.3099 4.19928 11.1656 4.28679 11.005 4.3115C10.8444 4.33621 10.6805 4.2961 10.5495 4.2C10.4184 4.1039 10.3309 3.95967 10.3062 3.79905C10.2815 3.63843 10.3216 3.47458 10.4177 3.34353L11.9412 1.23529H7.41184C7.24803 1.23529 7.09093 1.17022 6.97509 1.05439C6.85926 0.938558 6.79419 0.781457 6.79419 0.617647C6.79419 0.453837 6.85926 0.296736 6.97509 0.180905C7.09093 0.0650733 7.24803 0 7.41184 0H13.1765C13.2905 0.000692754 13.4022 0.0325088 13.4994 0.0920138ZM4.20008 0.181168H4.24126L13.2013 9.03411C13.3169 9.14992 13.3819 9.3069 13.3819 9.47058C13.3819 9.63426 13.3169 9.79124 13.2013 9.90705C13.1445 9.96517 13.0766 10.0112 13.0016 10.0423C12.9266 10.0735 12.846 10.0891 12.7648 10.0882C12.6836 10.0886 12.6032 10.0728 12.5283 10.0417C12.4533 10.0106 12.3853 9.96479 12.3283 9.90705L9.3142 6.92587L9.26479 6.99999V13.3823C9.26265 13.5455 9.19689 13.7014 9.08152 13.8167C8.96615 13.9321 8.81029 13.9979 8.64714 14H5.35302C5.18987 13.9979 5.03401 13.9321 4.91864 13.8167C4.80327 13.7014 4.73751 13.5455 4.73537 13.3823V6.99999L0.329492 1.02117C0.259855 0.930634 0.21745 0.822137 0.207241 0.708376C0.197031 0.594616 0.21944 0.480301 0.271844 0.378815C0.324343 0.277621 0.403484 0.192687 0.500724 0.133182C0.597964 0.073677 0.709609 0.041861 0.823609 0.0411682H3.86243C3.92448 0.0461551 3.9855 0.060022 4.04361 0.0823446C4.10037 0.10735 4.15311 0.140655 4.20008 0.181168ZM8.02949 6.79411C8.02884 6.66289 8.07235 6.53526 8.15302 6.43176L8.42478 6.05293L3.55773 1.23529H2.0589L5.84714 6.43176C5.92781 6.53526 5.97132 6.66289 5.97067 6.79411V12.7647H8.02949V6.79411Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'TrashIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M3.44802 13.9955H10.552C10.8056 14.0129 11.06 13.9797 11.3006 13.898C11.5412 13.8163 11.7632 13.6877 11.9537 13.5196C12.1442 13.3515 12.2995 13.1473 12.4104 12.9188C12.5213 12.6903 12.5858 12.442 12.6 12.1884V4.36041H13.4C13.5591 4.36041 13.7117 4.29722 13.8243 4.18476C13.9368 4.07229 14 3.91976 14 3.76071C14 3.60166 13.9368 3.44912 13.8243 3.33666C13.7117 3.22419 13.5591 3.16101 13.4 3.16101H12.0537C12.0203 3.1557 11.9863 3.15299 11.952 3.15299C11.9178 3.15299 11.8838 3.1557 11.8503 3.16101H11.2285C11.2421 3.10893 11.2487 3.05513 11.248 3.00106V1.80966C11.2171 1.30262 10.9871 0.828306 10.608 0.48989C10.229 0.151475 9.73159 -0.0236625 9.22402 0.00257442H4.77602C4.27251 -0.0171866 3.78126 0.160868 3.40746 0.498617C3.03365 0.836366 2.807 1.30697 2.77602 1.80966V3.00106C2.77602 3.0556 2.78346 3.10936 2.79776 3.16101H0.6C0.521207 3.16101 0.443185 3.17652 0.37039 3.20666C0.297595 3.2368 0.231451 3.28097 0.175736 3.33666C0.120021 3.39235 0.0758251 3.45846 0.0456722 3.53121C0.0155194 3.60397 0 3.68196 0 3.76071C0 3.83946 0.0155194 3.91744 0.0456722 3.9902C0.0758251 4.06296 0.120021 4.12907 0.175736 4.18476C0.231451 4.24045 0.297595 4.28462 0.37039 4.31476C0.443185 4.3449 0.521207 4.36041 0.6 4.36041H1.40002V12.1884C1.41426 12.442 1.47871 12.6903 1.58965 12.9188C1.7006 13.1473 1.85582 13.3515 2.04633 13.5196C2.23683 13.6877 2.45882 13.8163 2.69944 13.898C2.94005 13.9797 3.1945 14.0129 3.44802 13.9955ZM2.60002 4.36041H11.304V12.1884C11.304 12.5163 10.952 12.7961 10.504 12.7961H3.40002C2.97602 12.7961 2.60002 12.5163 2.60002 12.1884V4.36041ZM3.95429 3.16101C3.96859 3.10936 3.97602 3.0556 3.97602 3.00106V1.80966C3.97602 1.48183 4.33602 1.20197 4.77602 1.20197H9.24802C9.66403 1.20197 10.048 1.48183 10.048 1.80966V3.00106C10.0473 3.05515 10.054 3.10896 10.0678 3.16101H3.95429ZM5.57571 10.997C5.41731 10.995 5.26597 10.9311 5.15395 10.8191C5.04193 10.7071 4.97808 10.5558 4.97601 10.3973V6.77517C4.97601 6.61612 5.0392 6.46359 5.15166 6.35112C5.26413 6.23866 5.41666 6.17548 5.57571 6.17548C5.73476 6.17548 5.8873 6.23866 5.99976 6.35112C6.11223 6.46359 6.17541 6.61612 6.17541 6.77517V10.3894C6.17647 10.4688 6.16174 10.5476 6.13208 10.6213C6.10241 10.695 6.05841 10.762 6.00261 10.8186C5.94682 10.8751 5.88035 10.92 5.80707 10.9506C5.73378 10.9813 5.65514 10.9971 5.57571 10.997ZM7.99968 10.8214C8.11215 10.9339 8.26468 10.997 8.42373 10.997C8.58351 10.9949 8.73604 10.93 8.84828 10.8163C8.96052 10.7025 9.02345 10.5491 9.02343 10.3894V6.77517C9.02343 6.61612 8.96025 6.46359 8.84778 6.35112C8.73532 6.23866 8.58278 6.17548 8.42373 6.17548C8.26468 6.17548 8.11215 6.23866 7.99968 6.35112C7.88722 6.46359 7.82404 6.61612 7.82404 6.77517V10.3973C7.82404 10.5564 7.88722 10.7089 7.99968 10.8214Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'SortAltIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M5.64515 3.61291C5.47353 3.61291 5.30192 3.54968 5.16644 3.4142L3.38708 1.63484L1.60773 3.4142C1.34579 3.67613 0.912244 3.67613 0.650309 3.4142C0.388374 3.15226 0.388374 2.71871 0.650309 2.45678L2.90837 0.198712C3.17031 -0.0632236 3.60386 -0.0632236 3.86579 0.198712L6.12386 2.45678C6.38579 2.71871 6.38579 3.15226 6.12386 3.4142C5.98837 3.54968 5.81676 3.61291 5.64515 3.61291Z\",\n fill: \"currentColor\"\n }, null, -1), createElementVNode(\"path\", {\n d: \"M3.38714 14C3.01681 14 2.70972 13.6929 2.70972 13.3226V0.677419C2.70972 0.307097 3.01681 0 3.38714 0C3.75746 0 4.06456 0.307097 4.06456 0.677419V13.3226C4.06456 13.6929 3.75746 14 3.38714 14Z\",\n fill: \"currentColor\"\n }, null, -1), createElementVNode(\"path\", {\n d: \"M10.6129 14C10.4413 14 10.2697 13.9368 10.1342 13.8013L7.87611 11.5432C7.61418 11.2813 7.61418 10.8477 7.87611 10.5858C8.13805 10.3239 8.5716 10.3239 8.83353 10.5858L10.6129 12.3652L12.3922 10.5858C12.6542 10.3239 13.0877 10.3239 13.3497 10.5858C13.6116 10.8477 13.6116 11.2813 13.3497 11.5432L11.0916 13.8013C10.9561 13.9368 10.7845 14 10.6129 14Z\",\n fill: \"currentColor\"\n }, null, -1), createElementVNode(\"path\", {\n d: \"M10.6129 14C10.2426 14 9.93552 13.6929 9.93552 13.3226V0.677419C9.93552 0.307097 10.2426 0 10.6129 0C10.9833 0 11.2904 0.307097 11.2904 0.677419V13.3226C11.2904 13.6929 10.9832 14 10.6129 14Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'SortAmountDownIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M4.93953 10.5858L3.83759 11.6877V0.677419C3.83759 0.307097 3.53049 0 3.16017 0C2.78985 0 2.48275 0.307097 2.48275 0.677419V11.6877L1.38082 10.5858C1.11888 10.3239 0.685331 10.3239 0.423396 10.5858C0.16146 10.8477 0.16146 11.2813 0.423396 11.5432L2.68146 13.8013C2.74469 13.8645 2.81694 13.9097 2.89823 13.9458C2.97952 13.9819 3.06985 14 3.16017 14C3.25049 14 3.33178 13.9819 3.42211 13.9458C3.5034 13.9097 3.57565 13.8645 3.63888 13.8013L5.89694 11.5432C6.15888 11.2813 6.15888 10.8477 5.89694 10.5858C5.63501 10.3239 5.20146 10.3239 4.93953 10.5858ZM13.0957 0H7.22468C6.85436 0 6.54726 0.307097 6.54726 0.677419C6.54726 1.04774 6.85436 1.35484 7.22468 1.35484H13.0957C13.466 1.35484 13.7731 1.04774 13.7731 0.677419C13.7731 0.307097 13.466 0 13.0957 0ZM7.22468 5.41935H9.48275C9.85307 5.41935 10.1602 5.72645 10.1602 6.09677C10.1602 6.4671 9.85307 6.77419 9.48275 6.77419H7.22468C6.85436 6.77419 6.54726 6.4671 6.54726 6.09677C6.54726 5.72645 6.85436 5.41935 7.22468 5.41935ZM7.6763 8.12903H7.22468C6.85436 8.12903 6.54726 8.43613 6.54726 8.80645C6.54726 9.17677 6.85436 9.48387 7.22468 9.48387H7.6763C8.04662 9.48387 8.35372 9.17677 8.35372 8.80645C8.35372 8.43613 8.04662 8.12903 7.6763 8.12903ZM7.22468 2.70968H11.2892C11.6595 2.70968 11.9666 3.01677 11.9666 3.3871C11.9666 3.75742 11.6595 4.06452 11.2892 4.06452H7.22468C6.85436 4.06452 6.54726 3.75742 6.54726 3.3871C6.54726 3.01677 6.85436 2.70968 7.22468 2.70968Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'SortAmountUpAltIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M3.63435 0.19871C3.57113 0.135484 3.49887 0.0903226 3.41758 0.0541935C3.255 -0.0180645 3.06532 -0.0180645 2.90274 0.0541935C2.82145 0.0903226 2.74919 0.135484 2.68597 0.19871L0.427901 2.45677C0.165965 2.71871 0.165965 3.15226 0.427901 3.41419C0.689836 3.67613 1.12338 3.67613 1.38532 3.41419L2.48726 2.31226V13.3226C2.48726 13.6929 2.79435 14 3.16467 14C3.535 14 3.84209 13.6929 3.84209 13.3226V2.31226L4.94403 3.41419C5.07951 3.54968 5.25113 3.6129 5.42274 3.6129C5.59435 3.6129 5.76597 3.54968 5.90145 3.41419C6.16338 3.15226 6.16338 2.71871 5.90145 2.45677L3.64338 0.19871H3.63435ZM13.7685 13.3226C13.7685 12.9523 13.4615 12.6452 13.0911 12.6452H7.22016C6.84984 12.6452 6.54274 12.9523 6.54274 13.3226C6.54274 13.6929 6.84984 14 7.22016 14H13.0911C13.4615 14 13.7685 13.6929 13.7685 13.3226ZM7.22016 8.58064C6.84984 8.58064 6.54274 8.27355 6.54274 7.90323C6.54274 7.5329 6.84984 7.22581 7.22016 7.22581H9.47823C9.84855 7.22581 10.1556 7.5329 10.1556 7.90323C10.1556 8.27355 9.84855 8.58064 9.47823 8.58064H7.22016ZM7.22016 5.87097H7.67177C8.0421 5.87097 8.34919 5.56387 8.34919 5.19355C8.34919 4.82323 8.0421 4.51613 7.67177 4.51613H7.22016C6.84984 4.51613 6.54274 4.82323 6.54274 5.19355C6.54274 5.56387 6.84984 5.87097 7.22016 5.87097ZM11.2847 11.2903H7.22016C6.84984 11.2903 6.54274 10.9832 6.54274 10.6129C6.54274 10.2426 6.84984 9.93548 7.22016 9.93548H11.2847C11.655 9.93548 11.9621 10.2426 11.9621 10.6129C11.9621 10.9832 11.655 11.2903 11.2847 11.2903Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import { getFirstFocusableElement, invokeElementMethod, getAttribute, getNextElementSibling, getOuterWidth, getPreviousElementSibling, getOuterHeight, focus, addStyle, absolutePosition, isTouchDevice, getIndex, isClickable, clearSelection, findSingle, find, exportCSV, getOffset, isRTL, getHiddenElementOuterWidth, getHiddenElementOuterHeight, removeClass, addClass, setAttribute } from '@primeuix/utils/dom';\nimport { resolveFieldData, equals, isNotEmpty, localeComparator, sort, findIndexInList, reorderArray, isEmpty } from '@primeuix/utils/object';\nimport { FilterOperator, FilterService, FilterMatchMode } from '@primevue/core/api';\nimport { getVNodeProp, UniqueComponentId, HelperSet, ConnectedOverlayScrollHandler } from '@primevue/core/utils';\nimport ArrowDownIcon from '@primevue/icons/arrowdown';\nimport ArrowUpIcon from '@primevue/icons/arrowup';\nimport SpinnerIcon from '@primevue/icons/spinner';\nimport Paginator from 'primevue/paginator';\nimport VirtualScroller from 'primevue/virtualscroller';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport DataTableStyle from 'primevue/datatable/style';\nimport ChevronDownIcon from '@primevue/icons/chevrondown';\nimport ChevronRightIcon from '@primevue/icons/chevronright';\nimport { mergeProps, resolveComponent, openBlock, createBlock, withCtx, resolveDynamicComponent, normalizeClass, createCommentVNode, resolveDirective, createElementBlock, Fragment, withDirectives, createTextVNode, toDisplayString, createElementVNode, withModifiers, renderList, createVNode, Transition, withKeys, normalizeProps, renderSlot, createSlots } from 'vue';\nimport BarsIcon from '@primevue/icons/bars';\nimport CheckIcon from '@primevue/icons/check';\nimport PencilIcon from '@primevue/icons/pencil';\nimport TimesIcon from '@primevue/icons/times';\nimport Button from 'primevue/button';\nimport OverlayEventBus from 'primevue/overlayeventbus';\nimport Ripple from 'primevue/ripple';\nimport Checkbox from 'primevue/checkbox';\nimport RadioButton from 'primevue/radiobutton';\nimport { ZIndex } from '@primeuix/utils/zindex';\nimport FilterIcon from '@primevue/icons/filter';\nimport FilterSlashIcon from '@primevue/icons/filterslash';\nimport PlusIcon from '@primevue/icons/plus';\nimport TrashIcon from '@primevue/icons/trash';\nimport FocusTrap from 'primevue/focustrap';\nimport Portal from 'primevue/portal';\nimport Select from 'primevue/select';\nimport SortAltIcon from '@primevue/icons/sortalt';\nimport SortAmountDownIcon from '@primevue/icons/sortamountdown';\nimport SortAmountUpAltIcon from '@primevue/icons/sortamountupalt';\nimport Badge from 'primevue/badge';\n\nvar script$c = {\n name: 'BaseDataTable',\n \"extends\": BaseComponent,\n props: {\n value: {\n type: Array,\n \"default\": null\n },\n dataKey: {\n type: [String, Function],\n \"default\": null\n },\n rows: {\n type: Number,\n \"default\": 0\n },\n first: {\n type: Number,\n \"default\": 0\n },\n totalRecords: {\n type: Number,\n \"default\": 0\n },\n paginator: {\n type: Boolean,\n \"default\": false\n },\n paginatorPosition: {\n type: String,\n \"default\": 'bottom'\n },\n alwaysShowPaginator: {\n type: Boolean,\n \"default\": true\n },\n paginatorTemplate: {\n type: [Object, String],\n \"default\": 'FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown'\n },\n pageLinkSize: {\n type: Number,\n \"default\": 5\n },\n rowsPerPageOptions: {\n type: Array,\n \"default\": null\n },\n currentPageReportTemplate: {\n type: String,\n \"default\": '({currentPage} of {totalPages})'\n },\n lazy: {\n type: Boolean,\n \"default\": false\n },\n loading: {\n type: Boolean,\n \"default\": false\n },\n loadingIcon: {\n type: String,\n \"default\": undefined\n },\n sortField: {\n type: [String, Function],\n \"default\": null\n },\n sortOrder: {\n type: Number,\n \"default\": null\n },\n defaultSortOrder: {\n type: Number,\n \"default\": 1\n },\n nullSortOrder: {\n type: Number,\n \"default\": 1\n },\n multiSortMeta: {\n type: Array,\n \"default\": null\n },\n sortMode: {\n type: String,\n \"default\": 'single'\n },\n removableSort: {\n type: Boolean,\n \"default\": false\n },\n filters: {\n type: Object,\n \"default\": null\n },\n filterDisplay: {\n type: String,\n \"default\": null\n },\n globalFilterFields: {\n type: Array,\n \"default\": null\n },\n filterLocale: {\n type: String,\n \"default\": undefined\n },\n selection: {\n type: [Array, Object],\n \"default\": null\n },\n selectionMode: {\n type: String,\n \"default\": null\n },\n compareSelectionBy: {\n type: String,\n \"default\": 'deepEquals'\n },\n metaKeySelection: {\n type: Boolean,\n \"default\": false\n },\n contextMenu: {\n type: Boolean,\n \"default\": false\n },\n contextMenuSelection: {\n type: Object,\n \"default\": null\n },\n selectAll: {\n type: Boolean,\n \"default\": null\n },\n rowHover: {\n type: Boolean,\n \"default\": false\n },\n csvSeparator: {\n type: String,\n \"default\": ','\n },\n exportFilename: {\n type: String,\n \"default\": 'download'\n },\n exportFunction: {\n type: Function,\n \"default\": null\n },\n resizableColumns: {\n type: Boolean,\n \"default\": false\n },\n columnResizeMode: {\n type: String,\n \"default\": 'fit'\n },\n reorderableColumns: {\n type: Boolean,\n \"default\": false\n },\n expandedRows: {\n type: [Array, Object],\n \"default\": null\n },\n expandedRowIcon: {\n type: String,\n \"default\": undefined\n },\n collapsedRowIcon: {\n type: String,\n \"default\": undefined\n },\n rowGroupMode: {\n type: String,\n \"default\": null\n },\n groupRowsBy: {\n type: [Array, String, Function],\n \"default\": null\n },\n expandableRowGroups: {\n type: Boolean,\n \"default\": false\n },\n expandedRowGroups: {\n type: Array,\n \"default\": null\n },\n stateStorage: {\n type: String,\n \"default\": 'session'\n },\n stateKey: {\n type: String,\n \"default\": null\n },\n editMode: {\n type: String,\n \"default\": null\n },\n editingRows: {\n type: Array,\n \"default\": null\n },\n rowClass: {\n type: Function,\n \"default\": null\n },\n rowStyle: {\n type: Function,\n \"default\": null\n },\n scrollable: {\n type: Boolean,\n \"default\": false\n },\n virtualScrollerOptions: {\n type: Object,\n \"default\": null\n },\n scrollHeight: {\n type: String,\n \"default\": null\n },\n frozenValue: {\n type: Array,\n \"default\": null\n },\n breakpoint: {\n type: String,\n \"default\": '960px'\n },\n showHeaders: {\n type: Boolean,\n \"default\": true\n },\n showGridlines: {\n type: Boolean,\n \"default\": false\n },\n stripedRows: {\n type: Boolean,\n \"default\": false\n },\n highlightOnSelect: {\n type: Boolean,\n \"default\": false\n },\n size: {\n type: String,\n \"default\": null\n },\n tableStyle: {\n type: null,\n \"default\": null\n },\n tableClass: {\n type: [String, Object],\n \"default\": null\n },\n tableProps: {\n type: Object,\n \"default\": null\n },\n filterInputProps: {\n type: null,\n \"default\": null\n },\n filterButtonProps: {\n type: Object,\n \"default\": function _default() {\n return {\n filter: {\n severity: 'secondary',\n text: true,\n rounded: true\n },\n inline: {\n clear: {\n severity: 'secondary',\n text: true,\n rounded: true\n }\n },\n popover: {\n addRule: {\n severity: 'info',\n text: true,\n size: 'small'\n },\n removeRule: {\n severity: 'danger',\n text: true,\n size: 'small'\n },\n apply: {\n size: 'small'\n },\n clear: {\n outlined: true,\n size: 'small'\n }\n }\n };\n }\n },\n editButtonProps: {\n type: Object,\n \"default\": function _default() {\n return {\n init: {\n severity: 'secondary',\n text: true,\n rounded: true\n },\n save: {\n severity: 'secondary',\n text: true,\n rounded: true\n },\n cancel: {\n severity: 'secondary',\n text: true,\n rounded: true\n }\n };\n }\n }\n },\n style: DataTableStyle,\n provide: function provide() {\n return {\n $pcDataTable: this,\n $parentInstance: this\n };\n }\n};\n\nvar script$b = {\n name: 'RowCheckbox',\n hostName: 'DataTable',\n \"extends\": BaseComponent,\n emits: ['change'],\n props: {\n value: null,\n checked: null,\n column: null,\n rowCheckboxIconTemplate: {\n type: Function,\n \"default\": null\n },\n index: {\n type: Number,\n \"default\": null\n }\n },\n methods: {\n getColumnPT: function getColumnPT(key) {\n var columnMetaData = {\n props: this.column.props,\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n },\n context: {\n index: this.index,\n checked: this.checked,\n disabled: this.$attrs.disabled\n }\n };\n return mergeProps(this.ptm(\"column.\".concat(key), {\n column: columnMetaData\n }), this.ptm(\"column.\".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData));\n },\n getColumnProp: function getColumnProp() {\n return this.column.props && this.column.props.pt ? this.column.props.pt : undefined; //@todo:\n },\n onChange: function onChange(event) {\n if (!this.$attrs.disabled) {\n this.$emit('change', {\n originalEvent: event,\n data: this.value\n });\n }\n }\n },\n computed: {\n checkboxAriaLabel: function checkboxAriaLabel() {\n return this.$primevue.config.locale.aria ? this.checked ? this.$primevue.config.locale.aria.selectRow : this.$primevue.config.locale.aria.unselectRow : undefined;\n }\n },\n components: {\n CheckIcon: CheckIcon,\n Checkbox: Checkbox\n }\n};\n\nfunction render$b(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_CheckIcon = resolveComponent(\"CheckIcon\");\n var _component_Checkbox = resolveComponent(\"Checkbox\");\n return openBlock(), createBlock(_component_Checkbox, {\n modelValue: $props.checked,\n binary: true,\n disabled: _ctx.$attrs.disabled,\n \"aria-label\": $options.checkboxAriaLabel,\n onChange: $options.onChange,\n unstyled: _ctx.unstyled,\n pt: $options.getColumnPT('pcRowCheckbox')\n }, {\n icon: withCtx(function (slotProps) {\n return [$props.rowCheckboxIconTemplate ? (openBlock(), createBlock(resolveDynamicComponent($props.rowCheckboxIconTemplate), {\n key: 0,\n checked: slotProps.checked,\n \"class\": normalizeClass(slotProps[\"class\"])\n }, null, 8, [\"checked\", \"class\"])) : !$props.rowCheckboxIconTemplate && slotProps.checked ? (openBlock(), createBlock(_component_CheckIcon, mergeProps({\n key: 1,\n \"class\": slotProps[\"class\"]\n }, $options.getColumnPT('pcRowCheckbox')['icon']), null, 16, [\"class\"])) : createCommentVNode(\"\", true)];\n }),\n _: 1\n }, 8, [\"modelValue\", \"disabled\", \"aria-label\", \"onChange\", \"unstyled\", \"pt\"]);\n}\n\nscript$b.render = render$b;\n\nvar script$a = {\n name: 'RowRadioButton',\n hostName: 'DataTable',\n \"extends\": BaseComponent,\n emits: ['change'],\n props: {\n value: null,\n checked: null,\n name: null,\n column: null,\n index: {\n type: Number,\n \"default\": null\n }\n },\n methods: {\n getColumnPT: function getColumnPT(key) {\n var columnMetaData = {\n props: this.column.props,\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n },\n context: {\n index: this.index,\n checked: this.checked,\n disabled: this.$attrs.disabled\n }\n };\n return mergeProps(this.ptm(\"column.\".concat(key), {\n column: columnMetaData\n }), this.ptm(\"column.\".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData));\n },\n getColumnProp: function getColumnProp() {\n return this.column.props && this.column.props.pt ? this.column.props.pt : undefined; //@todo:\n },\n onChange: function onChange(event) {\n if (!this.$attrs.disabled) {\n this.$emit('change', {\n originalEvent: event,\n data: this.value\n });\n }\n }\n },\n components: {\n RadioButton: RadioButton\n }\n};\n\nfunction render$a(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_RadioButton = resolveComponent(\"RadioButton\");\n return openBlock(), createBlock(_component_RadioButton, {\n modelValue: $props.checked,\n binary: true,\n disabled: _ctx.$attrs.disabled,\n name: $props.name,\n onChange: $options.onChange,\n unstyled: _ctx.unstyled,\n pt: $options.getColumnPT('pcRowRadiobutton')\n }, null, 8, [\"modelValue\", \"disabled\", \"name\", \"onChange\", \"unstyled\", \"pt\"]);\n}\n\nscript$a.render = render$a;\n\nvar script$9 = {\n name: 'BodyCell',\n hostName: 'DataTable',\n \"extends\": BaseComponent,\n emits: ['cell-edit-init', 'cell-edit-complete', 'cell-edit-cancel', 'row-edit-init', 'row-edit-save', 'row-edit-cancel', 'row-toggle', 'radio-change', 'checkbox-change', 'editing-meta-change'],\n props: {\n rowData: {\n type: Object,\n \"default\": null\n },\n column: {\n type: Object,\n \"default\": null\n },\n frozenRow: {\n type: Boolean,\n \"default\": false\n },\n rowIndex: {\n type: Number,\n \"default\": null\n },\n index: {\n type: Number,\n \"default\": null\n },\n isRowExpanded: {\n type: Boolean,\n \"default\": false\n },\n selected: {\n type: Boolean,\n \"default\": false\n },\n editing: {\n type: Boolean,\n \"default\": false\n },\n editingMeta: {\n type: Object,\n \"default\": null\n },\n editMode: {\n type: String,\n \"default\": null\n },\n virtualScrollerContentProps: {\n type: Object,\n \"default\": null\n },\n ariaControls: {\n type: String,\n \"default\": null\n },\n name: {\n type: String,\n \"default\": null\n },\n expandedRowIcon: {\n type: String,\n \"default\": null\n },\n collapsedRowIcon: {\n type: String,\n \"default\": null\n },\n editButtonProps: {\n type: Object,\n \"default\": null\n }\n },\n documentEditListener: null,\n selfClick: false,\n overlayEventListener: null,\n data: function data() {\n return {\n d_editing: this.editing,\n styleObject: {}\n };\n },\n watch: {\n editing: function editing(newValue) {\n this.d_editing = newValue;\n },\n '$data.d_editing': function $dataD_editing(newValue) {\n this.$emit('editing-meta-change', {\n data: this.rowData,\n field: this.field || \"field_\".concat(this.index),\n index: this.rowIndex,\n editing: newValue\n });\n }\n },\n mounted: function mounted() {\n if (this.columnProp('frozen')) {\n this.updateStickyPosition();\n }\n },\n updated: function updated() {\n var _this = this;\n if (this.columnProp('frozen')) {\n this.updateStickyPosition();\n }\n if (this.d_editing && (this.editMode === 'cell' || this.editMode === 'row' && this.columnProp('rowEditor'))) {\n setTimeout(function () {\n var focusableEl = getFirstFocusableElement(_this.$el);\n focusableEl && focusableEl.focus();\n }, 1);\n }\n },\n beforeUnmount: function beforeUnmount() {\n if (this.overlayEventListener) {\n OverlayEventBus.off('overlay-click', this.overlayEventListener);\n this.overlayEventListener = null;\n }\n },\n methods: {\n columnProp: function columnProp(prop) {\n return getVNodeProp(this.column, prop);\n },\n getColumnPT: function getColumnPT(key) {\n var _this$$parentInstance, _this$$parentInstance2;\n var columnMetaData = {\n props: this.column.props,\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n },\n context: {\n index: this.index,\n size: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.size,\n showGridlines: (_this$$parentInstance2 = this.$parentInstance) === null || _this$$parentInstance2 === void 0 || (_this$$parentInstance2 = _this$$parentInstance2.$parentInstance) === null || _this$$parentInstance2 === void 0 ? void 0 : _this$$parentInstance2.showGridlines\n }\n };\n return mergeProps(this.ptm(\"column.\".concat(key), {\n column: columnMetaData\n }), this.ptm(\"column.\".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData));\n },\n getColumnProp: function getColumnProp() {\n return this.column.props && this.column.props.pt ? this.column.props.pt : undefined;\n },\n resolveFieldData: function resolveFieldData$1() {\n return resolveFieldData(this.rowData, this.field);\n },\n toggleRow: function toggleRow(event) {\n this.$emit('row-toggle', {\n originalEvent: event,\n data: this.rowData\n });\n },\n toggleRowWithRadio: function toggleRowWithRadio(event, index) {\n this.$emit('radio-change', {\n originalEvent: event.originalEvent,\n index: index,\n data: event.data\n });\n },\n toggleRowWithCheckbox: function toggleRowWithCheckbox(event, index) {\n this.$emit('checkbox-change', {\n originalEvent: event.originalEvent,\n index: index,\n data: event.data\n });\n },\n isEditable: function isEditable() {\n return this.column.children && this.column.children.editor != null;\n },\n bindDocumentEditListener: function bindDocumentEditListener() {\n var _this2 = this;\n if (!this.documentEditListener) {\n this.documentEditListener = function (event) {\n if (!_this2.selfClick) {\n _this2.completeEdit(event, 'outside');\n }\n _this2.selfClick = false;\n };\n document.addEventListener('click', this.documentEditListener);\n }\n },\n unbindDocumentEditListener: function unbindDocumentEditListener() {\n if (this.documentEditListener) {\n document.removeEventListener('click', this.documentEditListener);\n this.documentEditListener = null;\n this.selfClick = false;\n }\n },\n switchCellToViewMode: function switchCellToViewMode() {\n this.d_editing = false;\n this.unbindDocumentEditListener();\n OverlayEventBus.off('overlay-click', this.overlayEventListener);\n this.overlayEventListener = null;\n },\n onClick: function onClick(event) {\n var _this3 = this;\n if (this.editMode === 'cell' && this.isEditable()) {\n this.selfClick = true;\n if (!this.d_editing) {\n this.d_editing = true;\n this.bindDocumentEditListener();\n this.$emit('cell-edit-init', {\n originalEvent: event,\n data: this.rowData,\n field: this.field,\n index: this.rowIndex\n });\n this.overlayEventListener = function (e) {\n if (_this3.$el && _this3.$el.contains(e.target)) {\n _this3.selfClick = true;\n }\n };\n OverlayEventBus.on('overlay-click', this.overlayEventListener);\n }\n }\n },\n completeEdit: function completeEdit(event, type) {\n var completeEvent = {\n originalEvent: event,\n data: this.rowData,\n newData: this.editingRowData,\n value: this.rowData[this.field],\n newValue: this.editingRowData[this.field],\n field: this.field,\n index: this.rowIndex,\n type: type,\n defaultPrevented: false,\n preventDefault: function preventDefault() {\n this.defaultPrevented = true;\n }\n };\n this.$emit('cell-edit-complete', completeEvent);\n if (!completeEvent.defaultPrevented) {\n this.switchCellToViewMode();\n }\n },\n onKeyDown: function onKeyDown(event) {\n if (this.editMode === 'cell') {\n switch (event.code) {\n case 'Enter':\n case 'NumpadEnter':\n this.completeEdit(event, 'enter');\n break;\n case 'Escape':\n this.switchCellToViewMode();\n this.$emit('cell-edit-cancel', {\n originalEvent: event,\n data: this.rowData,\n field: this.field,\n index: this.rowIndex\n });\n break;\n case 'Tab':\n this.completeEdit(event, 'tab');\n if (event.shiftKey) this.moveToPreviousCell(event);else this.moveToNextCell(event);\n break;\n }\n }\n },\n moveToPreviousCell: function moveToPreviousCell(event) {\n var currentCell = this.findCell(event.target);\n var targetCell = this.findPreviousEditableColumn(currentCell);\n if (targetCell) {\n invokeElementMethod(targetCell, 'click');\n event.preventDefault();\n }\n },\n moveToNextCell: function moveToNextCell(event) {\n var currentCell = this.findCell(event.target);\n var targetCell = this.findNextEditableColumn(currentCell);\n if (targetCell) {\n invokeElementMethod(targetCell, 'click');\n event.preventDefault();\n }\n },\n findCell: function findCell(element) {\n if (element) {\n var cell = element;\n while (cell && !getAttribute(cell, 'data-p-cell-editing')) {\n cell = cell.parentElement;\n }\n return cell;\n } else {\n return null;\n }\n },\n findPreviousEditableColumn: function findPreviousEditableColumn(cell) {\n var prevCell = cell.previousElementSibling;\n if (!prevCell) {\n var previousRow = cell.parentElement.previousElementSibling;\n if (previousRow) {\n prevCell = previousRow.lastElementChild;\n }\n }\n if (prevCell) {\n if (getAttribute(prevCell, 'data-p-editable-column')) return prevCell;else return this.findPreviousEditableColumn(prevCell);\n } else {\n return null;\n }\n },\n findNextEditableColumn: function findNextEditableColumn(cell) {\n var nextCell = cell.nextElementSibling;\n if (!nextCell) {\n var nextRow = cell.parentElement.nextElementSibling;\n if (nextRow) {\n nextCell = nextRow.firstElementChild;\n }\n }\n if (nextCell) {\n if (getAttribute(nextCell, 'data-p-editable-column')) return nextCell;else return this.findNextEditableColumn(nextCell);\n } else {\n return null;\n }\n },\n onRowEditInit: function onRowEditInit(event) {\n this.$emit('row-edit-init', {\n originalEvent: event,\n data: this.rowData,\n newData: this.editingRowData,\n field: this.field,\n index: this.rowIndex\n });\n },\n onRowEditSave: function onRowEditSave(event) {\n this.$emit('row-edit-save', {\n originalEvent: event,\n data: this.rowData,\n newData: this.editingRowData,\n field: this.field,\n index: this.rowIndex\n });\n },\n onRowEditCancel: function onRowEditCancel(event) {\n this.$emit('row-edit-cancel', {\n originalEvent: event,\n data: this.rowData,\n newData: this.editingRowData,\n field: this.field,\n index: this.rowIndex\n });\n },\n editorInitCallback: function editorInitCallback(event) {\n this.$emit('row-edit-init', {\n originalEvent: event,\n data: this.rowData,\n newData: this.editingRowData,\n field: this.field,\n index: this.rowIndex\n });\n },\n editorSaveCallback: function editorSaveCallback(event) {\n if (this.editMode === 'row') {\n this.$emit('row-edit-save', {\n originalEvent: event,\n data: this.rowData,\n newData: this.editingRowData,\n field: this.field,\n index: this.rowIndex\n });\n } else {\n this.completeEdit(event, 'enter');\n }\n },\n editorCancelCallback: function editorCancelCallback(event) {\n if (this.editMode === 'row') {\n this.$emit('row-edit-cancel', {\n originalEvent: event,\n data: this.rowData,\n newData: this.editingRowData,\n field: this.field,\n index: this.rowIndex\n });\n } else {\n this.switchCellToViewMode();\n this.$emit('cell-edit-cancel', {\n originalEvent: event,\n data: this.rowData,\n field: this.field,\n index: this.rowIndex\n });\n }\n },\n updateStickyPosition: function updateStickyPosition() {\n if (this.columnProp('frozen')) {\n var align = this.columnProp('alignFrozen');\n if (align === 'right') {\n var pos = 0;\n var next = getNextElementSibling(this.$el, '[data-p-frozen-column=\"true\"]');\n if (next) {\n pos = getOuterWidth(next) + parseFloat(next.style.right || 0);\n }\n this.styleObject.insetInlineEnd = pos + 'px';\n } else {\n var _pos = 0;\n var prev = getPreviousElementSibling(this.$el, '[data-p-frozen-column=\"true\"]');\n if (prev) {\n _pos = getOuterWidth(prev) + parseFloat(prev.style.left || 0);\n }\n this.styleObject.insetInlineStart = _pos + 'px';\n }\n }\n },\n getVirtualScrollerProp: function getVirtualScrollerProp(option) {\n return this.virtualScrollerContentProps ? this.virtualScrollerContentProps[option] : null;\n }\n },\n computed: {\n editingRowData: function editingRowData() {\n return this.editingMeta[this.rowIndex] ? this.editingMeta[this.rowIndex].data : this.rowData;\n },\n field: function field() {\n return this.columnProp('field');\n },\n containerClass: function containerClass() {\n return [this.columnProp('bodyClass'), this.columnProp('class'), this.cx('bodyCell')];\n },\n containerStyle: function containerStyle() {\n var bodyStyle = this.columnProp('bodyStyle');\n var columnStyle = this.columnProp('style');\n return this.columnProp('frozen') ? [columnStyle, bodyStyle, this.styleObject] : [columnStyle, bodyStyle];\n },\n loading: function loading() {\n return this.getVirtualScrollerProp('loading');\n },\n loadingOptions: function loadingOptions() {\n var getLoaderOptions = this.getVirtualScrollerProp('getLoaderOptions');\n return getLoaderOptions && getLoaderOptions(this.rowIndex, {\n cellIndex: this.index,\n cellFirst: this.index === 0,\n cellLast: this.index === this.getVirtualScrollerProp('columns').length - 1,\n cellEven: this.index % 2 === 0,\n cellOdd: this.index % 2 !== 0,\n column: this.column,\n field: this.field\n });\n },\n expandButtonAriaLabel: function expandButtonAriaLabel() {\n return this.$primevue.config.locale.aria ? this.isRowExpanded ? this.$primevue.config.locale.aria.expandRow : this.$primevue.config.locale.aria.collapseRow : undefined;\n },\n initButtonAriaLabel: function initButtonAriaLabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.editRow : undefined;\n },\n saveButtonAriaLabel: function saveButtonAriaLabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.saveEdit : undefined;\n },\n cancelButtonAriaLabel: function cancelButtonAriaLabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.cancelEdit : undefined;\n }\n },\n components: {\n DTRadioButton: script$a,\n DTCheckbox: script$b,\n Button: Button,\n ChevronDownIcon: ChevronDownIcon,\n ChevronRightIcon: ChevronRightIcon,\n BarsIcon: BarsIcon,\n PencilIcon: PencilIcon,\n CheckIcon: CheckIcon,\n TimesIcon: TimesIcon\n },\n directives: {\n ripple: Ripple\n }\n};\n\nfunction _typeof$a(o) { \"@babel/helpers - typeof\"; return _typeof$a = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof$a(o); }\nfunction ownKeys$a(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty$a(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty$a(e, r, t) { return (r = _toPropertyKey$a(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey$a(t) { var i = _toPrimitive$a(t, \"string\"); return \"symbol\" == _typeof$a(i) ? i : i + \"\"; }\nfunction _toPrimitive$a(t, r) { if (\"object\" != _typeof$a(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof$a(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar _hoisted_1$4 = [\"colspan\", \"rowspan\", \"data-p-selection-column\", \"data-p-editable-column\", \"data-p-cell-editing\", \"data-p-frozen-column\"];\nvar _hoisted_2$2 = [\"aria-expanded\", \"aria-controls\", \"aria-label\"];\nfunction render$9(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_DTRadioButton = resolveComponent(\"DTRadioButton\");\n var _component_DTCheckbox = resolveComponent(\"DTCheckbox\");\n var _component_BarsIcon = resolveComponent(\"BarsIcon\");\n var _component_ChevronDownIcon = resolveComponent(\"ChevronDownIcon\");\n var _component_ChevronRightIcon = resolveComponent(\"ChevronRightIcon\");\n var _component_Button = resolveComponent(\"Button\");\n var _directive_ripple = resolveDirective(\"ripple\");\n return $options.loading ? (openBlock(), createElementBlock(\"td\", mergeProps({\n key: 0,\n style: $options.containerStyle,\n \"class\": $options.containerClass,\n role: \"cell\"\n }, _objectSpread$a(_objectSpread$a({}, $options.getColumnPT('root')), $options.getColumnPT('bodyCell'))), [(openBlock(), createBlock(resolveDynamicComponent($props.column.children.loading), {\n data: $props.rowData,\n column: $props.column,\n field: $options.field,\n index: $props.rowIndex,\n frozenRow: $props.frozenRow,\n loadingOptions: $options.loadingOptions\n }, null, 8, [\"data\", \"column\", \"field\", \"index\", \"frozenRow\", \"loadingOptions\"]))], 16)) : (openBlock(), createElementBlock(\"td\", mergeProps({\n key: 1,\n style: $options.containerStyle,\n \"class\": $options.containerClass,\n colspan: $options.columnProp('colspan'),\n rowspan: $options.columnProp('rowspan'),\n onClick: _cache[3] || (_cache[3] = function () {\n return $options.onClick && $options.onClick.apply($options, arguments);\n }),\n onKeydown: _cache[4] || (_cache[4] = function () {\n return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);\n }),\n role: \"cell\"\n }, _objectSpread$a(_objectSpread$a({}, $options.getColumnPT('root')), $options.getColumnPT('bodyCell')), {\n \"data-p-selection-column\": $options.columnProp('selectionMode') != null,\n \"data-p-editable-column\": $options.isEditable(),\n \"data-p-cell-editing\": $data.d_editing,\n \"data-p-frozen-column\": $options.columnProp('frozen')\n }), [$props.column.children && $props.column.children.body && !$data.d_editing ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.body), {\n key: 0,\n data: $props.rowData,\n column: $props.column,\n field: $options.field,\n index: $props.rowIndex,\n frozenRow: $props.frozenRow,\n editorInitCallback: $options.editorInitCallback,\n rowTogglerCallback: $options.toggleRow\n }, null, 8, [\"data\", \"column\", \"field\", \"index\", \"frozenRow\", \"editorInitCallback\", \"rowTogglerCallback\"])) : $props.column.children && $props.column.children.editor && $data.d_editing ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.editor), {\n key: 1,\n data: $options.editingRowData,\n column: $props.column,\n field: $options.field,\n index: $props.rowIndex,\n frozenRow: $props.frozenRow,\n editorSaveCallback: $options.editorSaveCallback,\n editorCancelCallback: $options.editorCancelCallback\n }, null, 8, [\"data\", \"column\", \"field\", \"index\", \"frozenRow\", \"editorSaveCallback\", \"editorCancelCallback\"])) : $props.column.children && $props.column.children.body && !$props.column.children.editor && $data.d_editing ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.body), {\n key: 2,\n data: $options.editingRowData,\n column: $props.column,\n field: $options.field,\n index: $props.rowIndex,\n frozenRow: $props.frozenRow\n }, null, 8, [\"data\", \"column\", \"field\", \"index\", \"frozenRow\"])) : $options.columnProp('selectionMode') ? (openBlock(), createElementBlock(Fragment, {\n key: 3\n }, [$options.columnProp('selectionMode') === 'single' ? (openBlock(), createBlock(_component_DTRadioButton, {\n key: 0,\n value: $props.rowData,\n name: $props.name,\n checked: $props.selected,\n onChange: _cache[0] || (_cache[0] = function ($event) {\n return $options.toggleRowWithRadio($event, $props.rowIndex);\n }),\n column: $props.column,\n index: $props.index,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"value\", \"name\", \"checked\", \"column\", \"index\", \"unstyled\", \"pt\"])) : $options.columnProp('selectionMode') === 'multiple' ? (openBlock(), createBlock(_component_DTCheckbox, {\n key: 1,\n value: $props.rowData,\n checked: $props.selected,\n rowCheckboxIconTemplate: $props.column.children && $props.column.children.rowcheckboxicon,\n \"aria-selected\": $props.selected ? true : undefined,\n onChange: _cache[1] || (_cache[1] = function ($event) {\n return $options.toggleRowWithCheckbox($event, $props.rowIndex);\n }),\n column: $props.column,\n index: $props.index,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"value\", \"checked\", \"rowCheckboxIconTemplate\", \"aria-selected\", \"column\", \"index\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true)], 64)) : $options.columnProp('rowReorder') ? (openBlock(), createElementBlock(Fragment, {\n key: 4\n }, [$props.column.children && $props.column.children.rowreordericon ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.rowreordericon), {\n key: 0,\n \"class\": normalizeClass(_ctx.cx('reorderableRowHandle'))\n }, null, 8, [\"class\"])) : $options.columnProp('rowReorderIcon') ? (openBlock(), createElementBlock(\"i\", mergeProps({\n key: 1,\n \"class\": [_ctx.cx('reorderableRowHandle'), $options.columnProp('rowReorderIcon')]\n }, $options.getColumnPT('reorderableRowHandle')), null, 16)) : (openBlock(), createBlock(_component_BarsIcon, mergeProps({\n key: 2,\n \"class\": _ctx.cx('reorderableRowHandle')\n }, $options.getColumnPT('reorderableRowHandle')), null, 16, [\"class\"]))], 64)) : $options.columnProp('expander') ? withDirectives((openBlock(), createElementBlock(\"button\", mergeProps({\n key: 5,\n \"class\": _ctx.cx('rowToggleButton'),\n type: \"button\",\n \"aria-expanded\": $props.isRowExpanded,\n \"aria-controls\": $props.ariaControls,\n \"aria-label\": $options.expandButtonAriaLabel,\n onClick: _cache[2] || (_cache[2] = function () {\n return $options.toggleRow && $options.toggleRow.apply($options, arguments);\n })\n }, $options.getColumnPT('rowToggleButton'), {\n \"data-pc-group-section\": \"rowactionbutton\"\n }), [$props.column.children && $props.column.children.rowtogglericon ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.rowtogglericon), {\n key: 0,\n \"class\": normalizeClass(_ctx.cx('rowToggleIcon')),\n rowExpanded: $props.isRowExpanded\n }, null, 8, [\"class\", \"rowExpanded\"])) : (openBlock(), createElementBlock(Fragment, {\n key: 1\n }, [$props.isRowExpanded && $props.expandedRowIcon ? (openBlock(), createElementBlock(\"span\", {\n key: 0,\n \"class\": normalizeClass([_ctx.cx('rowToggleIcon'), $props.expandedRowIcon])\n }, null, 2)) : $props.isRowExpanded && !$props.expandedRowIcon ? (openBlock(), createBlock(_component_ChevronDownIcon, mergeProps({\n key: 1,\n \"class\": _ctx.cx('rowToggleIcon')\n }, $options.getColumnPT('rowToggleIcon')), null, 16, [\"class\"])) : !$props.isRowExpanded && $props.collapsedRowIcon ? (openBlock(), createElementBlock(\"span\", {\n key: 2,\n \"class\": normalizeClass([_ctx.cx('rowToggleIcon'), $props.collapsedRowIcon])\n }, null, 2)) : !$props.isRowExpanded && !$props.collapsedRowIcon ? (openBlock(), createBlock(_component_ChevronRightIcon, mergeProps({\n key: 3,\n \"class\": _ctx.cx('rowToggleIcon')\n }, $options.getColumnPT('rowToggleIcon')), null, 16, [\"class\"])) : createCommentVNode(\"\", true)], 64))], 16, _hoisted_2$2)), [[_directive_ripple]]) : $props.editMode === 'row' && $options.columnProp('rowEditor') ? (openBlock(), createElementBlock(Fragment, {\n key: 6\n }, [!$data.d_editing ? (openBlock(), createBlock(_component_Button, mergeProps({\n key: 0,\n \"class\": _ctx.cx('pcRowEditorInit'),\n \"aria-label\": $options.initButtonAriaLabel,\n unstyled: _ctx.unstyled,\n onClick: $options.onRowEditInit\n }, $props.editButtonProps.init, {\n pt: $options.getColumnPT('pcRowEditorInit'),\n \"data-pc-group-section\": \"rowactionbutton\"\n }), {\n icon: withCtx(function (slotProps) {\n return [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.roweditoriniticon || 'PencilIcon'), mergeProps({\n \"class\": slotProps[\"class\"]\n }, $options.getColumnPT('pcRowEditorInit')['icon']), null, 16, [\"class\"]))];\n }),\n _: 1\n }, 16, [\"class\", \"aria-label\", \"unstyled\", \"onClick\", \"pt\"])) : createCommentVNode(\"\", true), $data.d_editing ? (openBlock(), createBlock(_component_Button, mergeProps({\n key: 1,\n \"class\": _ctx.cx('pcRowEditorSave'),\n \"aria-label\": $options.saveButtonAriaLabel,\n unstyled: _ctx.unstyled,\n onClick: $options.onRowEditSave\n }, $props.editButtonProps.save, {\n pt: $options.getColumnPT('pcRowEditorSave'),\n \"data-pc-group-section\": \"rowactionbutton\"\n }), {\n icon: withCtx(function (slotProps) {\n return [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.roweditorsaveicon || 'CheckIcon'), mergeProps({\n \"class\": slotProps[\"class\"]\n }, $options.getColumnPT('pcRowEditorSave')['icon']), null, 16, [\"class\"]))];\n }),\n _: 1\n }, 16, [\"class\", \"aria-label\", \"unstyled\", \"onClick\", \"pt\"])) : createCommentVNode(\"\", true), $data.d_editing ? (openBlock(), createBlock(_component_Button, mergeProps({\n key: 2,\n \"class\": _ctx.cx('pcRowEditorCancel'),\n \"aria-label\": $options.cancelButtonAriaLabel,\n unstyled: _ctx.unstyled,\n onClick: $options.onRowEditCancel\n }, $props.editButtonProps.cancel, {\n pt: $options.getColumnPT('pcRowEditorCancel'),\n \"data-pc-group-section\": \"rowactionbutton\"\n }), {\n icon: withCtx(function (slotProps) {\n return [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.roweditorcancelicon || 'TimesIcon'), mergeProps({\n \"class\": slotProps[\"class\"]\n }, $options.getColumnPT('pcRowEditorCancel')['icon']), null, 16, [\"class\"]))];\n }),\n _: 1\n }, 16, [\"class\", \"aria-label\", \"unstyled\", \"onClick\", \"pt\"])) : createCommentVNode(\"\", true)], 64)) : (openBlock(), createElementBlock(Fragment, {\n key: 7\n }, [createTextVNode(toDisplayString($options.resolveFieldData()), 1)], 64))], 16, _hoisted_1$4));\n}\n\nscript$9.render = render$9;\n\nfunction _typeof$9(o) { \"@babel/helpers - typeof\"; return _typeof$9 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof$9(o); }\nfunction _createForOfIteratorHelper$2(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray$2(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray$2(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; } }\nfunction _arrayLikeToArray$2(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction ownKeys$9(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty$9(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty$9(e, r, t) { return (r = _toPropertyKey$9(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey$9(t) { var i = _toPrimitive$9(t, \"string\"); return \"symbol\" == _typeof$9(i) ? i : i + \"\"; }\nfunction _toPrimitive$9(t, r) { if (\"object\" != _typeof$9(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof$9(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar script$8 = {\n name: 'BodyRow',\n hostName: 'DataTable',\n \"extends\": BaseComponent,\n emits: ['rowgroup-toggle', 'row-click', 'row-dblclick', 'row-rightclick', 'row-touchend', 'row-keydown', 'row-mousedown', 'row-dragstart', 'row-dragover', 'row-dragleave', 'row-dragend', 'row-drop', 'row-toggle', 'radio-change', 'checkbox-change', 'cell-edit-init', 'cell-edit-complete', 'cell-edit-cancel', 'row-edit-init', 'row-edit-save', 'row-edit-cancel', 'editing-meta-change'],\n props: {\n rowData: {\n type: Object,\n \"default\": null\n },\n index: {\n type: Number,\n \"default\": 0\n },\n value: {\n type: Array,\n \"default\": null\n },\n columns: {\n type: null,\n \"default\": null\n },\n frozenRow: {\n type: Boolean,\n \"default\": false\n },\n empty: {\n type: Boolean,\n \"default\": false\n },\n rowGroupMode: {\n type: String,\n \"default\": null\n },\n groupRowsBy: {\n type: [Array, String, Function],\n \"default\": null\n },\n expandableRowGroups: {\n type: Boolean,\n \"default\": false\n },\n expandedRowGroups: {\n type: Array,\n \"default\": null\n },\n first: {\n type: Number,\n \"default\": 0\n },\n dataKey: {\n type: [String, Function],\n \"default\": null\n },\n expandedRowIcon: {\n type: String,\n \"default\": null\n },\n collapsedRowIcon: {\n type: String,\n \"default\": null\n },\n expandedRows: {\n type: [Array, Object],\n \"default\": null\n },\n selection: {\n type: [Array, Object],\n \"default\": null\n },\n selectionKeys: {\n type: null,\n \"default\": null\n },\n selectionMode: {\n type: String,\n \"default\": null\n },\n contextMenu: {\n type: Boolean,\n \"default\": false\n },\n contextMenuSelection: {\n type: Object,\n \"default\": null\n },\n rowClass: {\n type: null,\n \"default\": null\n },\n rowStyle: {\n type: null,\n \"default\": null\n },\n rowGroupHeaderStyle: {\n type: null,\n \"default\": null\n },\n editMode: {\n type: String,\n \"default\": null\n },\n compareSelectionBy: {\n type: String,\n \"default\": 'deepEquals'\n },\n editingRows: {\n type: Array,\n \"default\": null\n },\n editingRowKeys: {\n type: null,\n \"default\": null\n },\n editingMeta: {\n type: Object,\n \"default\": null\n },\n templates: {\n type: null,\n \"default\": null\n },\n scrollable: {\n type: Boolean,\n \"default\": false\n },\n editButtonProps: {\n type: Object,\n \"default\": null\n },\n virtualScrollerContentProps: {\n type: Object,\n \"default\": null\n },\n isVirtualScrollerDisabled: {\n type: Boolean,\n \"default\": false\n },\n expandedRowId: {\n type: String,\n \"default\": null\n },\n nameAttributeSelector: {\n type: String,\n \"default\": null\n }\n },\n data: function data() {\n return {\n d_rowExpanded: false\n };\n },\n watch: {\n expandedRows: {\n deep: true,\n immediate: true,\n handler: function handler(newValue) {\n var _this = this;\n this.d_rowExpanded = this.dataKey ? (newValue === null || newValue === void 0 ? void 0 : newValue[resolveFieldData(this.rowData, this.dataKey)]) !== undefined : newValue === null || newValue === void 0 ? void 0 : newValue.some(function (d) {\n return _this.equals(_this.rowData, d);\n });\n }\n }\n },\n methods: {\n columnProp: function columnProp(col, prop) {\n return getVNodeProp(col, prop);\n },\n //@todo - update this method\n getColumnPT: function getColumnPT(key) {\n var columnMetaData = {\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n }\n };\n return mergeProps(this.ptm(\"column.\".concat(key), {\n column: columnMetaData\n }), this.ptm(\"column.\".concat(key), columnMetaData), this.ptmo(this.columnProp({}, 'pt'), key, columnMetaData));\n },\n //@todo - update this method\n getBodyRowPTOptions: function getBodyRowPTOptions(key) {\n var _this$$parentInstance;\n var datatable = (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.$parentInstance;\n return this.ptm(key, {\n context: {\n index: this.rowIndex,\n selectable: (datatable === null || datatable === void 0 ? void 0 : datatable.rowHover) || (datatable === null || datatable === void 0 ? void 0 : datatable.selectionMode),\n selected: this.isSelected,\n stripedRows: (datatable === null || datatable === void 0 ? void 0 : datatable.stripedRows) || false\n }\n });\n },\n shouldRenderBodyCell: function shouldRenderBodyCell(column) {\n var isHidden = this.columnProp(column, 'hidden');\n if (this.rowGroupMode && !isHidden) {\n var field = this.columnProp(column, 'field');\n if (this.rowGroupMode === 'subheader') {\n return this.groupRowsBy !== field;\n } else if (this.rowGroupMode === 'rowspan') {\n if (this.isGrouped(column)) {\n var prevRowData = this.value[this.rowIndex - 1];\n if (prevRowData) {\n var currentRowFieldData = resolveFieldData(this.value[this.rowIndex], field);\n var previousRowFieldData = resolveFieldData(prevRowData, field);\n return currentRowFieldData !== previousRowFieldData;\n } else {\n return true;\n }\n } else {\n return true;\n }\n }\n } else {\n return !isHidden;\n }\n },\n calculateRowGroupSize: function calculateRowGroupSize(column) {\n if (this.isGrouped(column)) {\n var index = this.rowIndex;\n var field = this.columnProp(column, 'field');\n var currentRowFieldData = resolveFieldData(this.value[index], field);\n var nextRowFieldData = currentRowFieldData;\n var groupRowSpan = 0;\n while (currentRowFieldData === nextRowFieldData) {\n groupRowSpan++;\n var nextRowData = this.value[++index];\n if (nextRowData) {\n nextRowFieldData = resolveFieldData(nextRowData, field);\n } else {\n break;\n }\n }\n return groupRowSpan === 1 ? null : groupRowSpan;\n } else {\n return null;\n }\n },\n isGrouped: function isGrouped(column) {\n var field = this.columnProp(column, 'field');\n if (this.groupRowsBy && field) {\n if (Array.isArray(this.groupRowsBy)) return this.groupRowsBy.indexOf(field) > -1;else return this.groupRowsBy === field;\n } else {\n return false;\n }\n },\n findIndexInSelection: function findIndexInSelection(data) {\n return this.findIndex(data, this.selection);\n },\n findIndex: function findIndex(data, collection) {\n var index = -1;\n if (collection && collection.length) {\n for (var i = 0; i < collection.length; i++) {\n if (this.equals(data, collection[i])) {\n index = i;\n break;\n }\n }\n }\n return index;\n },\n equals: function equals$1(data1, data2) {\n return this.compareSelectionBy === 'equals' ? data1 === data2 : equals(data1, data2, this.dataKey);\n },\n onRowGroupToggle: function onRowGroupToggle(event) {\n this.$emit('rowgroup-toggle', {\n originalEvent: event,\n data: this.rowData\n });\n },\n onRowClick: function onRowClick(event) {\n this.$emit('row-click', {\n originalEvent: event,\n data: this.rowData,\n index: this.rowIndex\n });\n },\n onRowDblClick: function onRowDblClick(event) {\n this.$emit('row-dblclick', {\n originalEvent: event,\n data: this.rowData,\n index: this.rowIndex\n });\n },\n onRowRightClick: function onRowRightClick(event) {\n this.$emit('row-rightclick', {\n originalEvent: event,\n data: this.rowData,\n index: this.rowIndex\n });\n },\n onRowTouchEnd: function onRowTouchEnd(event) {\n this.$emit('row-touchend', event);\n },\n onRowKeyDown: function onRowKeyDown(event) {\n this.$emit('row-keydown', {\n originalEvent: event,\n data: this.rowData,\n index: this.rowIndex\n });\n },\n onRowMouseDown: function onRowMouseDown(event) {\n this.$emit('row-mousedown', event);\n },\n onRowDragStart: function onRowDragStart(event) {\n this.$emit('row-dragstart', {\n originalEvent: event,\n index: this.rowIndex\n });\n },\n onRowDragOver: function onRowDragOver(event) {\n this.$emit('row-dragover', {\n originalEvent: event,\n index: this.rowIndex\n });\n },\n onRowDragLeave: function onRowDragLeave(event) {\n this.$emit('row-dragleave', event);\n },\n onRowDragEnd: function onRowDragEnd(event) {\n this.$emit('row-dragend', event);\n },\n onRowDrop: function onRowDrop(event) {\n this.$emit('row-drop', event);\n },\n onRowToggle: function onRowToggle(event) {\n this.d_rowExpanded = !this.d_rowExpanded;\n this.$emit('row-toggle', _objectSpread$9(_objectSpread$9({}, event), {}, {\n expanded: this.d_rowExpanded\n }));\n },\n onRadioChange: function onRadioChange(event) {\n this.$emit('radio-change', event);\n },\n onCheckboxChange: function onCheckboxChange(event) {\n this.$emit('checkbox-change', event);\n },\n onCellEditInit: function onCellEditInit(event) {\n this.$emit('cell-edit-init', event);\n },\n onCellEditComplete: function onCellEditComplete(event) {\n this.$emit('cell-edit-complete', event);\n },\n onCellEditCancel: function onCellEditCancel(event) {\n this.$emit('cell-edit-cancel', event);\n },\n onRowEditInit: function onRowEditInit(event) {\n this.$emit('row-edit-init', event);\n },\n onRowEditSave: function onRowEditSave(event) {\n this.$emit('row-edit-save', event);\n },\n onRowEditCancel: function onRowEditCancel(event) {\n this.$emit('row-edit-cancel', event);\n },\n onEditingMetaChange: function onEditingMetaChange(event) {\n this.$emit('editing-meta-change', event);\n },\n getVirtualScrollerProp: function getVirtualScrollerProp(option, options) {\n options = options || this.virtualScrollerContentProps;\n return options ? options[option] : null;\n }\n },\n computed: {\n rowIndex: function rowIndex() {\n var getItemOptions = this.getVirtualScrollerProp('getItemOptions');\n return getItemOptions ? getItemOptions(this.index).index : this.index;\n },\n rowStyles: function rowStyles() {\n var _this$rowStyle;\n return (_this$rowStyle = this.rowStyle) === null || _this$rowStyle === void 0 ? void 0 : _this$rowStyle.call(this, this.rowData);\n },\n rowClasses: function rowClasses() {\n var rowStyleClass = [];\n var columnSelectionMode = null;\n if (this.rowClass) {\n var rowClassValue = this.rowClass(this.rowData);\n if (rowClassValue) {\n rowStyleClass.push(rowClassValue);\n }\n }\n if (this.columns) {\n var _iterator = _createForOfIteratorHelper$2(this.columns),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var col = _step.value;\n var _selectionMode = this.columnProp(col, 'selectionMode');\n if (isNotEmpty(_selectionMode)) {\n columnSelectionMode = _selectionMode;\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n return [this.cx('row', {\n rowData: this.rowData,\n index: this.rowIndex,\n columnSelectionMode: columnSelectionMode\n }), rowStyleClass];\n },\n rowTabindex: function rowTabindex() {\n if (this.selection === null && (this.selectionMode === 'single' || this.selectionMode === 'multiple')) {\n return this.rowIndex === 0 ? 0 : -1;\n }\n return -1;\n },\n isRowEditing: function isRowEditing() {\n if (this.rowData && this.editingRows) {\n if (this.dataKey) return this.editingRowKeys ? this.editingRowKeys[resolveFieldData(this.rowData, this.dataKey)] !== undefined : false;else return this.findIndex(this.rowData, this.editingRows) > -1;\n }\n return false;\n },\n isRowGroupExpanded: function isRowGroupExpanded() {\n if (this.expandableRowGroups && this.expandedRowGroups) {\n var groupFieldValue = resolveFieldData(this.rowData, this.groupRowsBy);\n return this.expandedRowGroups.indexOf(groupFieldValue) > -1;\n }\n return false;\n },\n isSelected: function isSelected() {\n if (this.rowData && this.selection) {\n if (this.dataKey) {\n return this.selectionKeys ? this.selectionKeys[resolveFieldData(this.rowData, this.dataKey)] !== undefined : false;\n } else {\n if (this.selection instanceof Array) return this.findIndexInSelection(this.rowData) > -1;else return this.equals(this.rowData, this.selection);\n }\n }\n return false;\n },\n isSelectedWithContextMenu: function isSelectedWithContextMenu() {\n if (this.rowData && this.contextMenuSelection) {\n return this.equals(this.rowData, this.contextMenuSelection, this.dataKey);\n }\n return false;\n },\n shouldRenderRowGroupHeader: function shouldRenderRowGroupHeader() {\n var currentRowFieldData = resolveFieldData(this.rowData, this.groupRowsBy);\n var prevRowData = this.value[this.rowIndex - 1];\n if (prevRowData) {\n var previousRowFieldData = resolveFieldData(prevRowData, this.groupRowsBy);\n return currentRowFieldData !== previousRowFieldData;\n } else {\n return true;\n }\n },\n shouldRenderRowGroupFooter: function shouldRenderRowGroupFooter() {\n if (this.expandableRowGroups && !this.isRowGroupExpanded) {\n return false;\n } else {\n var currentRowFieldData = resolveFieldData(this.rowData, this.groupRowsBy);\n var nextRowData = this.value[this.rowIndex + 1];\n if (nextRowData) {\n var nextRowFieldData = resolveFieldData(nextRowData, this.groupRowsBy);\n return currentRowFieldData !== nextRowFieldData;\n } else {\n return true;\n }\n }\n },\n columnsLength: function columnsLength() {\n var _this2 = this;\n if (this.columns) {\n var hiddenColLength = 0;\n this.columns.forEach(function (column) {\n if (_this2.columnProp(column, 'selectionMode') === 'single') hiddenColLength--;\n if (_this2.columnProp(column, 'hidden')) hiddenColLength++;\n });\n return this.columns.length - hiddenColLength;\n }\n return 0;\n }\n },\n components: {\n DTBodyCell: script$9,\n ChevronDownIcon: ChevronDownIcon,\n ChevronRightIcon: ChevronRightIcon\n }\n};\n\nfunction _typeof$8(o) { \"@babel/helpers - typeof\"; return _typeof$8 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof$8(o); }\nfunction ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty$8(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty$8(e, r, t) { return (r = _toPropertyKey$8(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey$8(t) { var i = _toPrimitive$8(t, \"string\"); return \"symbol\" == _typeof$8(i) ? i : i + \"\"; }\nfunction _toPrimitive$8(t, r) { if (\"object\" != _typeof$8(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof$8(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar _hoisted_1$3 = [\"colspan\"];\nvar _hoisted_2$1 = [\"tabindex\", \"aria-selected\", \"data-p-index\", \"data-p-selectable-row\", \"data-p-selected\", \"data-p-selected-contextmenu\"];\nvar _hoisted_3 = [\"id\"];\nvar _hoisted_4 = [\"colspan\"];\nvar _hoisted_5 = [\"colspan\"];\nvar _hoisted_6 = [\"colspan\"];\nfunction render$8(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_ChevronDownIcon = resolveComponent(\"ChevronDownIcon\");\n var _component_ChevronRightIcon = resolveComponent(\"ChevronRightIcon\");\n var _component_DTBodyCell = resolveComponent(\"DTBodyCell\");\n return !$props.empty ? (openBlock(), createElementBlock(Fragment, {\n key: 0\n }, [$props.templates['groupheader'] && $props.rowGroupMode === 'subheader' && $options.shouldRenderRowGroupHeader ? (openBlock(), createElementBlock(\"tr\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('rowGroupHeader'),\n style: $props.rowGroupHeaderStyle,\n role: \"row\"\n }, _ctx.ptm('rowGroupHeader')), [createElementVNode(\"td\", mergeProps({\n colspan: $options.columnsLength - 1\n }, _objectSpread$8(_objectSpread$8({}, $options.getColumnPT('bodycell')), _ctx.ptm('rowGroupHeaderCell'))), [$props.expandableRowGroups ? (openBlock(), createElementBlock(\"button\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('rowToggleButton'),\n onClick: _cache[0] || (_cache[0] = function () {\n return $options.onRowGroupToggle && $options.onRowGroupToggle.apply($options, arguments);\n }),\n type: \"button\"\n }, _ctx.ptm('rowToggleButton')), [$props.templates['rowtoggleicon'] || $props.templates['rowgrouptogglericon'] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates['rowtoggleicon'] || $props.templates['rowgrouptogglericon']), {\n key: 0,\n expanded: $options.isRowGroupExpanded\n }, null, 8, [\"expanded\"])) : (openBlock(), createElementBlock(Fragment, {\n key: 1\n }, [$options.isRowGroupExpanded && $props.expandedRowIcon ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 0,\n \"class\": [_ctx.cx('rowToggleIcon'), $props.expandedRowIcon]\n }, _ctx.ptm('rowToggleIcon')), null, 16)) : $options.isRowGroupExpanded && !$props.expandedRowIcon ? (openBlock(), createBlock(_component_ChevronDownIcon, mergeProps({\n key: 1,\n \"class\": _ctx.cx('rowToggleIcon')\n }, _ctx.ptm('rowToggleIcon')), null, 16, [\"class\"])) : !$options.isRowGroupExpanded && $props.collapsedRowIcon ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 2,\n \"class\": [_ctx.cx('rowToggleIcon'), $props.collapsedRowIcon]\n }, _ctx.ptm('rowToggleIcon')), null, 16)) : !$options.isRowGroupExpanded && !$props.collapsedRowIcon ? (openBlock(), createBlock(_component_ChevronRightIcon, mergeProps({\n key: 3,\n \"class\": _ctx.cx('rowToggleIcon')\n }, _ctx.ptm('rowToggleIcon')), null, 16, [\"class\"])) : createCommentVNode(\"\", true)], 64))], 16)) : createCommentVNode(\"\", true), (openBlock(), createBlock(resolveDynamicComponent($props.templates['groupheader']), {\n data: $props.rowData,\n index: $options.rowIndex\n }, null, 8, [\"data\", \"index\"]))], 16, _hoisted_1$3)], 16)) : createCommentVNode(\"\", true), ($props.expandableRowGroups ? $options.isRowGroupExpanded : true) ? (openBlock(), createElementBlock(\"tr\", mergeProps({\n key: 1,\n \"class\": $options.rowClasses,\n style: $options.rowStyles,\n tabindex: $options.rowTabindex,\n role: \"row\",\n \"aria-selected\": $props.selectionMode ? $options.isSelected : null,\n onClick: _cache[1] || (_cache[1] = function () {\n return $options.onRowClick && $options.onRowClick.apply($options, arguments);\n }),\n onDblclick: _cache[2] || (_cache[2] = function () {\n return $options.onRowDblClick && $options.onRowDblClick.apply($options, arguments);\n }),\n onContextmenu: _cache[3] || (_cache[3] = function () {\n return $options.onRowRightClick && $options.onRowRightClick.apply($options, arguments);\n }),\n onTouchend: _cache[4] || (_cache[4] = function () {\n return $options.onRowTouchEnd && $options.onRowTouchEnd.apply($options, arguments);\n }),\n onKeydown: _cache[5] || (_cache[5] = withModifiers(function () {\n return $options.onRowKeyDown && $options.onRowKeyDown.apply($options, arguments);\n }, [\"self\"])),\n onMousedown: _cache[6] || (_cache[6] = function () {\n return $options.onRowMouseDown && $options.onRowMouseDown.apply($options, arguments);\n }),\n onDragstart: _cache[7] || (_cache[7] = function () {\n return $options.onRowDragStart && $options.onRowDragStart.apply($options, arguments);\n }),\n onDragover: _cache[8] || (_cache[8] = function () {\n return $options.onRowDragOver && $options.onRowDragOver.apply($options, arguments);\n }),\n onDragleave: _cache[9] || (_cache[9] = function () {\n return $options.onRowDragLeave && $options.onRowDragLeave.apply($options, arguments);\n }),\n onDragend: _cache[10] || (_cache[10] = function () {\n return $options.onRowDragEnd && $options.onRowDragEnd.apply($options, arguments);\n }),\n onDrop: _cache[11] || (_cache[11] = function () {\n return $options.onRowDrop && $options.onRowDrop.apply($options, arguments);\n })\n }, $options.getBodyRowPTOptions('bodyRow'), {\n \"data-p-index\": $options.rowIndex,\n \"data-p-selectable-row\": $props.selectionMode ? true : false,\n \"data-p-selected\": $props.selection && $options.isSelected,\n \"data-p-selected-contextmenu\": $props.contextMenuSelection && $options.isSelectedWithContextMenu\n }), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function (col, i) {\n return openBlock(), createElementBlock(Fragment, null, [$options.shouldRenderBodyCell(col) ? (openBlock(), createBlock(_component_DTBodyCell, {\n key: $options.columnProp(col, 'columnKey') || $options.columnProp(col, 'field') || i,\n rowData: $props.rowData,\n column: col,\n rowIndex: $options.rowIndex,\n index: i,\n selected: $options.isSelected,\n frozenRow: $props.frozenRow,\n rowspan: $props.rowGroupMode === 'rowspan' ? $options.calculateRowGroupSize(col) : null,\n editMode: $props.editMode,\n editing: $props.editMode === 'row' && $options.isRowEditing,\n editingMeta: $props.editingMeta,\n virtualScrollerContentProps: $props.virtualScrollerContentProps,\n ariaControls: $props.expandedRowId + '_' + $options.rowIndex + '_expansion',\n name: $props.nameAttributeSelector,\n isRowExpanded: $data.d_rowExpanded,\n expandedRowIcon: $props.expandedRowIcon,\n collapsedRowIcon: $props.collapsedRowIcon,\n editButtonProps: $props.editButtonProps,\n onRadioChange: $options.onRadioChange,\n onCheckboxChange: $options.onCheckboxChange,\n onRowToggle: $options.onRowToggle,\n onCellEditInit: $options.onCellEditInit,\n onCellEditComplete: $options.onCellEditComplete,\n onCellEditCancel: $options.onCellEditCancel,\n onRowEditInit: $options.onRowEditInit,\n onRowEditSave: $options.onRowEditSave,\n onRowEditCancel: $options.onRowEditCancel,\n onEditingMetaChange: $options.onEditingMetaChange,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"rowData\", \"column\", \"rowIndex\", \"index\", \"selected\", \"frozenRow\", \"rowspan\", \"editMode\", \"editing\", \"editingMeta\", \"virtualScrollerContentProps\", \"ariaControls\", \"name\", \"isRowExpanded\", \"expandedRowIcon\", \"collapsedRowIcon\", \"editButtonProps\", \"onRadioChange\", \"onCheckboxChange\", \"onRowToggle\", \"onCellEditInit\", \"onCellEditComplete\", \"onCellEditCancel\", \"onRowEditInit\", \"onRowEditSave\", \"onRowEditCancel\", \"onEditingMetaChange\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true)], 64);\n }), 256))], 16, _hoisted_2$1)) : createCommentVNode(\"\", true), $props.templates['expansion'] && $props.expandedRows && $data.d_rowExpanded ? (openBlock(), createElementBlock(\"tr\", mergeProps({\n key: 2,\n id: $props.expandedRowId + '_' + $options.rowIndex + '_expansion',\n \"class\": _ctx.cx('rowExpansion'),\n role: \"row\"\n }, _ctx.ptm('rowExpansion')), [createElementVNode(\"td\", mergeProps({\n colspan: $options.columnsLength\n }, _objectSpread$8(_objectSpread$8({}, $options.getColumnPT('bodycell')), _ctx.ptm('rowExpansionCell'))), [(openBlock(), createBlock(resolveDynamicComponent($props.templates['expansion']), {\n data: $props.rowData,\n index: $options.rowIndex\n }, null, 8, [\"data\", \"index\"]))], 16, _hoisted_4)], 16, _hoisted_3)) : createCommentVNode(\"\", true), $props.templates['groupfooter'] && $props.rowGroupMode === 'subheader' && $options.shouldRenderRowGroupFooter ? (openBlock(), createElementBlock(\"tr\", mergeProps({\n key: 3,\n \"class\": _ctx.cx('rowGroupFooter'),\n role: \"row\"\n }, _ctx.ptm('rowGroupFooter')), [createElementVNode(\"td\", mergeProps({\n colspan: $options.columnsLength - 1\n }, _objectSpread$8(_objectSpread$8({}, $options.getColumnPT('bodycell')), _ctx.ptm('rowGroupFooterCell'))), [(openBlock(), createBlock(resolveDynamicComponent($props.templates['groupfooter']), {\n data: $props.rowData,\n index: $options.rowIndex\n }, null, 8, [\"data\", \"index\"]))], 16, _hoisted_5)], 16)) : createCommentVNode(\"\", true)], 64)) : (openBlock(), createElementBlock(\"tr\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('emptyMessage'),\n role: \"row\"\n }, _ctx.ptm('emptyMessage')), [createElementVNode(\"td\", mergeProps({\n colspan: $options.columnsLength\n }, _objectSpread$8(_objectSpread$8({}, $options.getColumnPT('bodycell')), _ctx.ptm('emptyMessageCell'))), [$props.templates.empty ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.empty), {\n key: 0\n })) : createCommentVNode(\"\", true)], 16, _hoisted_6)], 16));\n}\n\nscript$8.render = render$8;\n\nvar script$7 = {\n name: 'TableBody',\n hostName: 'DataTable',\n \"extends\": BaseComponent,\n emits: ['rowgroup-toggle', 'row-click', 'row-dblclick', 'row-rightclick', 'row-touchend', 'row-keydown', 'row-mousedown', 'row-dragstart', 'row-dragover', 'row-dragleave', 'row-dragend', 'row-drop', 'row-toggle', 'radio-change', 'checkbox-change', 'cell-edit-init', 'cell-edit-complete', 'cell-edit-cancel', 'row-edit-init', 'row-edit-save', 'row-edit-cancel', 'editing-meta-change'],\n props: {\n value: {\n type: Array,\n \"default\": null\n },\n columns: {\n type: null,\n \"default\": null\n },\n frozenRow: {\n type: Boolean,\n \"default\": false\n },\n empty: {\n type: Boolean,\n \"default\": false\n },\n rowGroupMode: {\n type: String,\n \"default\": null\n },\n groupRowsBy: {\n type: [Array, String, Function],\n \"default\": null\n },\n expandableRowGroups: {\n type: Boolean,\n \"default\": false\n },\n expandedRowGroups: {\n type: Array,\n \"default\": null\n },\n first: {\n type: Number,\n \"default\": 0\n },\n dataKey: {\n type: [String, Function],\n \"default\": null\n },\n expandedRowIcon: {\n type: String,\n \"default\": null\n },\n collapsedRowIcon: {\n type: String,\n \"default\": null\n },\n expandedRows: {\n type: [Array, Object],\n \"default\": null\n },\n selection: {\n type: [Array, Object],\n \"default\": null\n },\n selectionKeys: {\n type: null,\n \"default\": null\n },\n selectionMode: {\n type: String,\n \"default\": null\n },\n contextMenu: {\n type: Boolean,\n \"default\": false\n },\n contextMenuSelection: {\n type: Object,\n \"default\": null\n },\n rowClass: {\n type: null,\n \"default\": null\n },\n rowStyle: {\n type: null,\n \"default\": null\n },\n editMode: {\n type: String,\n \"default\": null\n },\n compareSelectionBy: {\n type: String,\n \"default\": 'deepEquals'\n },\n editingRows: {\n type: Array,\n \"default\": null\n },\n editingRowKeys: {\n type: null,\n \"default\": null\n },\n editingMeta: {\n type: Object,\n \"default\": null\n },\n templates: {\n type: null,\n \"default\": null\n },\n scrollable: {\n type: Boolean,\n \"default\": false\n },\n editButtonProps: {\n type: Object,\n \"default\": null\n },\n virtualScrollerContentProps: {\n type: Object,\n \"default\": null\n },\n isVirtualScrollerDisabled: {\n type: Boolean,\n \"default\": false\n }\n },\n data: function data() {\n return {\n rowGroupHeaderStyleObject: {}\n };\n },\n mounted: function mounted() {\n if (this.frozenRow) {\n this.updateFrozenRowStickyPosition();\n }\n if (this.scrollable && this.rowGroupMode === 'subheader') {\n this.updateFrozenRowGroupHeaderStickyPosition();\n }\n },\n updated: function updated() {\n if (this.frozenRow) {\n this.updateFrozenRowStickyPosition();\n }\n if (this.scrollable && this.rowGroupMode === 'subheader') {\n this.updateFrozenRowGroupHeaderStickyPosition();\n }\n },\n methods: {\n getRowKey: function getRowKey(rowData, rowIndex) {\n return this.dataKey ? resolveFieldData(rowData, this.dataKey) : rowIndex;\n },\n updateFrozenRowStickyPosition: function updateFrozenRowStickyPosition() {\n this.$el.style.top = getOuterHeight(this.$el.previousElementSibling) + 'px';\n },\n updateFrozenRowGroupHeaderStickyPosition: function updateFrozenRowGroupHeaderStickyPosition() {\n var tableHeaderHeight = getOuterHeight(this.$el.previousElementSibling);\n this.rowGroupHeaderStyleObject.top = tableHeaderHeight + 'px';\n },\n getVirtualScrollerProp: function getVirtualScrollerProp(option, options) {\n options = options || this.virtualScrollerContentProps;\n return options ? options[option] : null;\n },\n bodyRef: function bodyRef(el) {\n // For VirtualScroller\n var contentRef = this.getVirtualScrollerProp('contentRef');\n contentRef && contentRef(el);\n }\n },\n computed: {\n rowGroupHeaderStyle: function rowGroupHeaderStyle() {\n if (this.scrollable) {\n return {\n top: this.rowGroupHeaderStyleObject.top\n };\n }\n return null;\n },\n bodyContentStyle: function bodyContentStyle() {\n return this.getVirtualScrollerProp('contentStyle');\n },\n ptmTBodyOptions: function ptmTBodyOptions() {\n var _this$$parentInstance;\n return {\n context: {\n scrollable: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.scrollable\n }\n };\n },\n expandedRowId: function expandedRowId() {\n return UniqueComponentId();\n },\n nameAttributeSelector: function nameAttributeSelector() {\n return UniqueComponentId();\n }\n },\n components: {\n DTBodyRow: script$8\n }\n};\n\nfunction render$7(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_DTBodyRow = resolveComponent(\"DTBodyRow\");\n return openBlock(), createElementBlock(\"tbody\", mergeProps({\n ref: $options.bodyRef,\n \"class\": _ctx.cx('tbody'),\n role: \"rowgroup\",\n style: $options.bodyContentStyle\n }, _ctx.ptm('tbody', $options.ptmTBodyOptions)), [!$props.empty ? (openBlock(true), createElementBlock(Fragment, {\n key: 0\n }, renderList($props.value, function (rowData, rowIndex) {\n return openBlock(), createBlock(_component_DTBodyRow, {\n key: $options.getRowKey(rowData, rowIndex),\n rowData: rowData,\n index: rowIndex,\n value: $props.value,\n columns: $props.columns,\n frozenRow: $props.frozenRow,\n empty: $props.empty,\n first: $props.first,\n dataKey: $props.dataKey,\n selection: $props.selection,\n selectionKeys: $props.selectionKeys,\n selectionMode: $props.selectionMode,\n contextMenu: $props.contextMenu,\n contextMenuSelection: $props.contextMenuSelection,\n rowGroupMode: $props.rowGroupMode,\n groupRowsBy: $props.groupRowsBy,\n expandableRowGroups: $props.expandableRowGroups,\n rowClass: $props.rowClass,\n rowStyle: $props.rowStyle,\n editMode: $props.editMode,\n compareSelectionBy: $props.compareSelectionBy,\n scrollable: $props.scrollable,\n expandedRowIcon: $props.expandedRowIcon,\n collapsedRowIcon: $props.collapsedRowIcon,\n expandedRows: $props.expandedRows,\n expandedRowGroups: $props.expandedRowGroups,\n editingRows: $props.editingRows,\n editingRowKeys: $props.editingRowKeys,\n templates: $props.templates,\n editButtonProps: $props.editButtonProps,\n virtualScrollerContentProps: $props.virtualScrollerContentProps,\n isVirtualScrollerDisabled: $props.isVirtualScrollerDisabled,\n editingMeta: $props.editingMeta,\n rowGroupHeaderStyle: $options.rowGroupHeaderStyle,\n expandedRowId: $options.expandedRowId,\n nameAttributeSelector: $options.nameAttributeSelector,\n onRowgroupToggle: _cache[0] || (_cache[0] = function ($event) {\n return _ctx.$emit('rowgroup-toggle', $event);\n }),\n onRowClick: _cache[1] || (_cache[1] = function ($event) {\n return _ctx.$emit('row-click', $event);\n }),\n onRowDblclick: _cache[2] || (_cache[2] = function ($event) {\n return _ctx.$emit('row-dblclick', $event);\n }),\n onRowRightclick: _cache[3] || (_cache[3] = function ($event) {\n return _ctx.$emit('row-rightclick', $event);\n }),\n onRowTouchend: _cache[4] || (_cache[4] = function ($event) {\n return _ctx.$emit('row-touchend', $event);\n }),\n onRowKeydown: _cache[5] || (_cache[5] = function ($event) {\n return _ctx.$emit('row-keydown', $event);\n }),\n onRowMousedown: _cache[6] || (_cache[6] = function ($event) {\n return _ctx.$emit('row-mousedown', $event);\n }),\n onRowDragstart: _cache[7] || (_cache[7] = function ($event) {\n return _ctx.$emit('row-dragstart', $event);\n }),\n onRowDragover: _cache[8] || (_cache[8] = function ($event) {\n return _ctx.$emit('row-dragover', $event);\n }),\n onRowDragleave: _cache[9] || (_cache[9] = function ($event) {\n return _ctx.$emit('row-dragleave', $event);\n }),\n onRowDragend: _cache[10] || (_cache[10] = function ($event) {\n return _ctx.$emit('row-dragend', $event);\n }),\n onRowDrop: _cache[11] || (_cache[11] = function ($event) {\n return _ctx.$emit('row-drop', $event);\n }),\n onRowToggle: _cache[12] || (_cache[12] = function ($event) {\n return _ctx.$emit('row-toggle', $event);\n }),\n onRadioChange: _cache[13] || (_cache[13] = function ($event) {\n return _ctx.$emit('radio-change', $event);\n }),\n onCheckboxChange: _cache[14] || (_cache[14] = function ($event) {\n return _ctx.$emit('checkbox-change', $event);\n }),\n onCellEditInit: _cache[15] || (_cache[15] = function ($event) {\n return _ctx.$emit('cell-edit-init', $event);\n }),\n onCellEditComplete: _cache[16] || (_cache[16] = function ($event) {\n return _ctx.$emit('cell-edit-complete', $event);\n }),\n onCellEditCancel: _cache[17] || (_cache[17] = function ($event) {\n return _ctx.$emit('cell-edit-cancel', $event);\n }),\n onRowEditInit: _cache[18] || (_cache[18] = function ($event) {\n return _ctx.$emit('row-edit-init', $event);\n }),\n onRowEditSave: _cache[19] || (_cache[19] = function ($event) {\n return _ctx.$emit('row-edit-save', $event);\n }),\n onRowEditCancel: _cache[20] || (_cache[20] = function ($event) {\n return _ctx.$emit('row-edit-cancel', $event);\n }),\n onEditingMetaChange: _cache[21] || (_cache[21] = function ($event) {\n return _ctx.$emit('editing-meta-change', $event);\n }),\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"rowData\", \"index\", \"value\", \"columns\", \"frozenRow\", \"empty\", \"first\", \"dataKey\", \"selection\", \"selectionKeys\", \"selectionMode\", \"contextMenu\", \"contextMenuSelection\", \"rowGroupMode\", \"groupRowsBy\", \"expandableRowGroups\", \"rowClass\", \"rowStyle\", \"editMode\", \"compareSelectionBy\", \"scrollable\", \"expandedRowIcon\", \"collapsedRowIcon\", \"expandedRows\", \"expandedRowGroups\", \"editingRows\", \"editingRowKeys\", \"templates\", \"editButtonProps\", \"virtualScrollerContentProps\", \"isVirtualScrollerDisabled\", \"editingMeta\", \"rowGroupHeaderStyle\", \"expandedRowId\", \"nameAttributeSelector\", \"unstyled\", \"pt\"]);\n }), 128)) : (openBlock(), createBlock(_component_DTBodyRow, {\n key: 1,\n empty: $props.empty,\n columns: $props.columns,\n templates: $props.templates,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"empty\", \"columns\", \"templates\", \"unstyled\", \"pt\"]))], 16);\n}\n\nscript$7.render = render$7;\n\nvar script$6 = {\n name: 'FooterCell',\n hostName: 'DataTable',\n \"extends\": BaseComponent,\n props: {\n column: {\n type: Object,\n \"default\": null\n },\n index: {\n type: Number,\n \"default\": null\n }\n },\n data: function data() {\n return {\n styleObject: {}\n };\n },\n mounted: function mounted() {\n if (this.columnProp('frozen')) {\n this.updateStickyPosition();\n }\n },\n updated: function updated() {\n if (this.columnProp('frozen')) {\n this.updateStickyPosition();\n }\n },\n methods: {\n columnProp: function columnProp(prop) {\n return getVNodeProp(this.column, prop);\n },\n getColumnPT: function getColumnPT(key) {\n var _this$$parentInstance, _this$$parentInstance2;\n var columnMetaData = {\n props: this.column.props,\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n },\n context: {\n index: this.index,\n size: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.size,\n showGridlines: ((_this$$parentInstance2 = this.$parentInstance) === null || _this$$parentInstance2 === void 0 || (_this$$parentInstance2 = _this$$parentInstance2.$parentInstance) === null || _this$$parentInstance2 === void 0 ? void 0 : _this$$parentInstance2.showGridlines) || false\n }\n };\n return mergeProps(this.ptm(\"column.\".concat(key), {\n column: columnMetaData\n }), this.ptm(\"column.\".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData));\n },\n getColumnProp: function getColumnProp() {\n return this.column.props && this.column.props.pt ? this.column.props.pt : undefined;\n },\n updateStickyPosition: function updateStickyPosition() {\n if (this.columnProp('frozen')) {\n var align = this.columnProp('alignFrozen');\n if (align === 'right') {\n var pos = 0;\n var next = getNextElementSibling(this.$el, '[data-p-frozen-column=\"true\"]');\n if (next) {\n pos = getOuterWidth(next) + parseFloat(next.style.right || 0);\n }\n this.styleObject.insetInlineEnd = pos + 'px';\n } else {\n var _pos = 0;\n var prev = getPreviousElementSibling(this.$el, '[data-p-frozen-column=\"true\"]');\n if (prev) {\n _pos = getOuterWidth(prev) + parseFloat(prev.style.left || 0);\n }\n this.styleObject.insetInlineStart = _pos + 'px';\n }\n }\n }\n },\n computed: {\n containerClass: function containerClass() {\n return [this.columnProp('footerClass'), this.columnProp('class'), this.cx('footerCell')];\n },\n containerStyle: function containerStyle() {\n var bodyStyle = this.columnProp('footerStyle');\n var columnStyle = this.columnProp('style');\n return this.columnProp('frozen') ? [columnStyle, bodyStyle, this.styleObject] : [columnStyle, bodyStyle];\n }\n }\n};\n\nfunction _typeof$7(o) { \"@babel/helpers - typeof\"; return _typeof$7 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof$7(o); }\nfunction ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty$7(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty$7(e, r, t) { return (r = _toPropertyKey$7(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey$7(t) { var i = _toPrimitive$7(t, \"string\"); return \"symbol\" == _typeof$7(i) ? i : i + \"\"; }\nfunction _toPrimitive$7(t, r) { if (\"object\" != _typeof$7(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof$7(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar _hoisted_1$2 = [\"colspan\", \"rowspan\", \"data-p-frozen-column\"];\nfunction render$6(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"td\", mergeProps({\n style: $options.containerStyle,\n \"class\": $options.containerClass,\n role: \"cell\",\n colspan: $options.columnProp('colspan'),\n rowspan: $options.columnProp('rowspan')\n }, _objectSpread$7(_objectSpread$7({}, $options.getColumnPT('root')), $options.getColumnPT('footerCell')), {\n \"data-p-frozen-column\": $options.columnProp('frozen')\n }), [$props.column.children && $props.column.children.footer ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.footer), {\n key: 0,\n column: $props.column\n }, null, 8, [\"column\"])) : createCommentVNode(\"\", true), $options.columnProp('footer') ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('columnFooter')\n }, $options.getColumnPT('columnFooter')), toDisplayString($options.columnProp('footer')), 17)) : createCommentVNode(\"\", true)], 16, _hoisted_1$2);\n}\n\nscript$6.render = render$6;\n\nfunction _createForOfIteratorHelper$1(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray$1(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }\nfunction _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nvar script$5 = {\n name: 'TableFooter',\n hostName: 'DataTable',\n \"extends\": BaseComponent,\n props: {\n columnGroup: {\n type: null,\n \"default\": null\n },\n columns: {\n type: Object,\n \"default\": null\n }\n },\n provide: function provide() {\n return {\n $rows: this.d_footerRows,\n $columns: this.d_footerColumns\n };\n },\n data: function data() {\n return {\n d_footerRows: new HelperSet({\n type: 'Row'\n }),\n d_footerColumns: new HelperSet({\n type: 'Column'\n })\n };\n },\n beforeUnmount: function beforeUnmount() {\n this.d_footerRows.clear();\n this.d_footerColumns.clear();\n },\n methods: {\n columnProp: function columnProp(col, prop) {\n return getVNodeProp(col, prop);\n },\n getColumnGroupPT: function getColumnGroupPT(key) {\n var columnGroupMetaData = {\n props: this.getColumnGroupProps(),\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n },\n context: {\n type: 'footer',\n scrollable: this.ptmTFootOptions.context.scrollable\n }\n };\n return mergeProps(this.ptm(\"columnGroup.\".concat(key), {\n columnGroup: columnGroupMetaData\n }), this.ptm(\"columnGroup.\".concat(key), columnGroupMetaData), this.ptmo(this.getColumnGroupProps(), key, columnGroupMetaData));\n },\n getColumnGroupProps: function getColumnGroupProps() {\n return this.columnGroup && this.columnGroup.props && this.columnGroup.props.pt ? this.columnGroup.props.pt : undefined; //@todo\n },\n getRowPT: function getRowPT(row, key, index) {\n var rowMetaData = {\n props: row.props,\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n },\n context: {\n index: index\n }\n };\n return mergeProps(this.ptm(\"row.\".concat(key), {\n row: rowMetaData\n }), this.ptm(\"row.\".concat(key), rowMetaData), this.ptmo(this.getRowProp(row), key, rowMetaData));\n },\n getRowProp: function getRowProp(row) {\n return row.props && row.props.pt ? row.props.pt : undefined; //@todo\n },\n getFooterRows: function getFooterRows() {\n var _this$d_footerRows;\n return (_this$d_footerRows = this.d_footerRows) === null || _this$d_footerRows === void 0 ? void 0 : _this$d_footerRows.get(this.columnGroup, this.columnGroup.children);\n },\n getFooterColumns: function getFooterColumns(row) {\n var _this$d_footerColumns;\n return (_this$d_footerColumns = this.d_footerColumns) === null || _this$d_footerColumns === void 0 ? void 0 : _this$d_footerColumns.get(row, row.children);\n }\n },\n computed: {\n hasFooter: function hasFooter() {\n var hasFooter = false;\n if (this.columnGroup) {\n hasFooter = true;\n } else if (this.columns) {\n var _iterator = _createForOfIteratorHelper$1(this.columns),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var col = _step.value;\n if (this.columnProp(col, 'footer') || col.children && col.children.footer) {\n hasFooter = true;\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n return hasFooter;\n },\n ptmTFootOptions: function ptmTFootOptions() {\n var _this$$parentInstance;\n return {\n context: {\n scrollable: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.scrollable\n }\n };\n }\n },\n components: {\n DTFooterCell: script$6\n }\n};\n\nfunction _typeof$6(o) { \"@babel/helpers - typeof\"; return _typeof$6 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof$6(o); }\nfunction ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty$6(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty$6(e, r, t) { return (r = _toPropertyKey$6(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey$6(t) { var i = _toPrimitive$6(t, \"string\"); return \"symbol\" == _typeof$6(i) ? i : i + \"\"; }\nfunction _toPrimitive$6(t, r) { if (\"object\" != _typeof$6(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof$6(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction render$5(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_DTFooterCell = resolveComponent(\"DTFooterCell\");\n return $options.hasFooter ? (openBlock(), createElementBlock(\"tfoot\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('tfoot'),\n style: _ctx.sx('tfoot'),\n role: \"rowgroup\"\n }, $props.columnGroup ? _objectSpread$6(_objectSpread$6({}, _ctx.ptm('tfoot', $options.ptmTFootOptions)), $options.getColumnGroupPT('root')) : _ctx.ptm('tfoot', $options.ptmTFootOptions), {\n \"data-pc-section\": \"tfoot\"\n }), [!$props.columnGroup ? (openBlock(), createElementBlock(\"tr\", mergeProps({\n key: 0,\n role: \"row\"\n }, _ctx.ptm('footerRow')), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function (col, i) {\n return openBlock(), createElementBlock(Fragment, {\n key: $options.columnProp(col, 'columnKey') || $options.columnProp(col, 'field') || i\n }, [!$options.columnProp(col, 'hidden') ? (openBlock(), createBlock(_component_DTFooterCell, {\n key: 0,\n column: col,\n pt: _ctx.pt\n }, null, 8, [\"column\", \"pt\"])) : createCommentVNode(\"\", true)], 64);\n }), 128))], 16)) : (openBlock(true), createElementBlock(Fragment, {\n key: 1\n }, renderList($options.getFooterRows(), function (row, i) {\n return openBlock(), createElementBlock(\"tr\", mergeProps({\n key: i,\n role: \"row\",\n ref_for: true\n }, _objectSpread$6(_objectSpread$6({}, _ctx.ptm('footerRow')), $options.getRowPT(row, 'root', i))), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.getFooterColumns(row), function (col, j) {\n return openBlock(), createElementBlock(Fragment, {\n key: $options.columnProp(col, 'columnKey') || $options.columnProp(col, 'field') || j\n }, [!$options.columnProp(col, 'hidden') ? (openBlock(), createBlock(_component_DTFooterCell, {\n key: 0,\n column: col,\n index: i,\n pt: _ctx.pt\n }, null, 8, [\"column\", \"index\", \"pt\"])) : createCommentVNode(\"\", true)], 64);\n }), 128))], 16);\n }), 128))], 16)) : createCommentVNode(\"\", true);\n}\n\nscript$5.render = render$5;\n\nfunction _typeof$5(o) { \"@babel/helpers - typeof\"; return _typeof$5 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof$5(o); }\nfunction ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty$5(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty$5(e, r, t) { return (r = _toPropertyKey$5(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey$5(t) { var i = _toPrimitive$5(t, \"string\"); return \"symbol\" == _typeof$5(i) ? i : i + \"\"; }\nfunction _toPrimitive$5(t, r) { if (\"object\" != _typeof$5(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof$5(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar script$4 = {\n name: 'ColumnFilter',\n hostName: 'DataTable',\n \"extends\": BaseComponent,\n emits: ['filter-change', 'filter-apply', 'operator-change', 'matchmode-change', 'constraint-add', 'constraint-remove', 'filter-clear', 'apply-click'],\n props: {\n field: {\n type: String,\n \"default\": null\n },\n type: {\n type: String,\n \"default\": 'text'\n },\n display: {\n type: String,\n \"default\": null\n },\n showMenu: {\n type: Boolean,\n \"default\": true\n },\n matchMode: {\n type: String,\n \"default\": null\n },\n showOperator: {\n type: Boolean,\n \"default\": true\n },\n showClearButton: {\n type: Boolean,\n \"default\": true\n },\n showApplyButton: {\n type: Boolean,\n \"default\": true\n },\n showMatchModes: {\n type: Boolean,\n \"default\": true\n },\n showAddButton: {\n type: Boolean,\n \"default\": true\n },\n matchModeOptions: {\n type: Array,\n \"default\": null\n },\n maxConstraints: {\n type: Number,\n \"default\": 2\n },\n filterElement: {\n type: Function,\n \"default\": null\n },\n filterHeaderTemplate: {\n type: Function,\n \"default\": null\n },\n filterFooterTemplate: {\n type: Function,\n \"default\": null\n },\n filterClearTemplate: {\n type: Function,\n \"default\": null\n },\n filterApplyTemplate: {\n type: Function,\n \"default\": null\n },\n filterIconTemplate: {\n type: Function,\n \"default\": null\n },\n filterAddIconTemplate: {\n type: Function,\n \"default\": null\n },\n filterRemoveIconTemplate: {\n type: Function,\n \"default\": null\n },\n filterClearIconTemplate: {\n type: Function,\n \"default\": null\n },\n filters: {\n type: Object,\n \"default\": null\n },\n filtersStore: {\n type: Object,\n \"default\": null\n },\n filterMenuClass: {\n type: String,\n \"default\": null\n },\n filterMenuStyle: {\n type: null,\n \"default\": null\n },\n filterInputProps: {\n type: null,\n \"default\": null\n },\n filterButtonProps: {\n type: null,\n \"default\": null\n },\n column: null\n },\n data: function data() {\n return {\n id: this.$attrs.id,\n overlayVisible: false,\n defaultMatchMode: null,\n defaultOperator: null\n };\n },\n watch: {\n '$attrs.id': function $attrsId(newValue) {\n this.id = newValue || UniqueComponentId();\n }\n },\n overlay: null,\n selfClick: false,\n overlayEventListener: null,\n beforeUnmount: function beforeUnmount() {\n if (this.overlayEventListener) {\n OverlayEventBus.off('overlay-click', this.overlayEventListener);\n this.overlayEventListener = null;\n }\n if (this.overlay) {\n ZIndex.clear(this.overlay);\n this.onOverlayHide();\n }\n },\n mounted: function mounted() {\n this.id = this.id || UniqueComponentId();\n if (this.filters && this.filters[this.field]) {\n var fieldFilters = this.filters[this.field];\n if (fieldFilters.operator) {\n this.defaultMatchMode = fieldFilters.constraints[0].matchMode;\n this.defaultOperator = fieldFilters.operator;\n } else {\n this.defaultMatchMode = this.filters[this.field].matchMode;\n }\n }\n },\n methods: {\n getColumnPT: function getColumnPT(key, params) {\n var columnMetaData = _objectSpread$5({\n props: this.column.props,\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n }\n }, params);\n return mergeProps(this.ptm(\"column.\".concat(key), {\n column: columnMetaData\n }), this.ptm(\"column.\".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData));\n },\n getColumnProp: function getColumnProp() {\n return this.column.props && this.column.props.pt ? this.column.props.pt : undefined;\n },\n ptmFilterConstraintOptions: function ptmFilterConstraintOptions(matchMode) {\n return {\n context: {\n highlighted: matchMode && this.isRowMatchModeSelected(matchMode.value)\n }\n };\n },\n clearFilter: function clearFilter() {\n var _filters = _objectSpread$5({}, this.filters);\n if (_filters[this.field].operator) {\n _filters[this.field].constraints.splice(1);\n _filters[this.field].operator = this.defaultOperator;\n _filters[this.field].constraints[0] = {\n value: null,\n matchMode: this.defaultMatchMode\n };\n } else {\n _filters[this.field].value = null;\n _filters[this.field].matchMode = this.defaultMatchMode;\n }\n this.$emit('filter-clear');\n this.$emit('filter-change', _filters);\n this.$emit('filter-apply');\n this.hide();\n },\n applyFilter: function applyFilter() {\n this.$emit('apply-click', {\n field: this.field,\n constraints: this.filters[this.field]\n });\n this.$emit('filter-apply');\n this.hide();\n },\n hasFilter: function hasFilter() {\n if (this.filtersStore) {\n var fieldFilter = this.filtersStore[this.field];\n if (fieldFilter) {\n if (fieldFilter.operator) return !this.isFilterBlank(fieldFilter.constraints[0].value);else return !this.isFilterBlank(fieldFilter.value);\n }\n }\n return false;\n },\n hasRowFilter: function hasRowFilter() {\n return this.filters[this.field] && !this.isFilterBlank(this.filters[this.field].value);\n },\n isFilterBlank: function isFilterBlank(filter) {\n if (filter !== null && filter !== undefined) {\n if (typeof filter === 'string' && filter.trim().length == 0 || filter instanceof Array && filter.length == 0) return true;else return false;\n }\n return true;\n },\n toggleMenu: function toggleMenu(event) {\n this.overlayVisible = !this.overlayVisible;\n event.preventDefault();\n },\n onToggleButtonKeyDown: function onToggleButtonKeyDown(event) {\n switch (event.code) {\n case 'Enter':\n case 'NumpadEnter':\n case 'Space':\n this.toggleMenu(event);\n break;\n case 'Escape':\n this.overlayVisible = false;\n break;\n }\n },\n onRowMatchModeChange: function onRowMatchModeChange(matchMode) {\n var _filters = _objectSpread$5({}, this.filters);\n _filters[this.field].matchMode = matchMode;\n this.$emit('matchmode-change', {\n field: this.field,\n matchMode: matchMode\n });\n this.$emit('filter-change', _filters);\n this.$emit('filter-apply');\n this.hide();\n },\n onRowMatchModeKeyDown: function onRowMatchModeKeyDown(event) {\n var item = event.target;\n switch (event.code) {\n case 'ArrowDown':\n var nextItem = this.findNextItem(item);\n if (nextItem) {\n item.removeAttribute('tabindex');\n nextItem.tabIndex = '0';\n nextItem.focus();\n }\n event.preventDefault();\n break;\n case 'ArrowUp':\n var prevItem = this.findPrevItem(item);\n if (prevItem) {\n item.removeAttribute('tabindex');\n prevItem.tabIndex = '0';\n prevItem.focus();\n }\n event.preventDefault();\n break;\n }\n },\n isRowMatchModeSelected: function isRowMatchModeSelected(matchMode) {\n return this.filters[this.field].matchMode === matchMode;\n },\n onOperatorChange: function onOperatorChange(value) {\n var _filters = _objectSpread$5({}, this.filters);\n _filters[this.field].operator = value;\n this.$emit('filter-change', _filters);\n this.$emit('operator-change', {\n field: this.field,\n operator: value\n });\n if (!this.showApplyButton) {\n this.$emit('filter-apply');\n }\n },\n onMenuMatchModeChange: function onMenuMatchModeChange(value, index) {\n var _filters = _objectSpread$5({}, this.filters);\n _filters[this.field].constraints[index].matchMode = value;\n this.$emit('matchmode-change', {\n field: this.field,\n matchMode: value,\n index: index\n });\n if (!this.showApplyButton) {\n this.$emit('filter-apply');\n }\n },\n addConstraint: function addConstraint() {\n var _filters = _objectSpread$5({}, this.filters);\n var newConstraint = {\n value: null,\n matchMode: this.defaultMatchMode\n };\n _filters[this.field].constraints.push(newConstraint);\n this.$emit('constraint-add', {\n field: this.field,\n constraing: newConstraint\n });\n this.$emit('filter-change', _filters);\n if (!this.showApplyButton) {\n this.$emit('filter-apply');\n }\n },\n removeConstraint: function removeConstraint(index) {\n var _filters = _objectSpread$5({}, this.filters);\n var removedConstraint = _filters[this.field].constraints.splice(index, 1);\n this.$emit('constraint-remove', {\n field: this.field,\n constraing: removedConstraint\n });\n this.$emit('filter-change', _filters);\n if (!this.showApplyButton) {\n this.$emit('filter-apply');\n }\n },\n filterCallback: function filterCallback() {\n this.$emit('filter-apply');\n },\n findNextItem: function findNextItem(item) {\n var nextItem = item.nextElementSibling;\n if (nextItem) return getAttribute(nextItem, 'data-pc-section') === 'filterconstraintseparator' ? this.findNextItem(nextItem) : nextItem;else return item.parentElement.firstElementChild;\n },\n findPrevItem: function findPrevItem(item) {\n var prevItem = item.previousElementSibling;\n if (prevItem) return getAttribute(prevItem, 'data-pc-section') === 'filterconstraintseparator' ? this.findPrevItem(prevItem) : prevItem;else return item.parentElement.lastElementChild;\n },\n hide: function hide() {\n this.overlayVisible = false;\n this.showMenuButton && focus(this.$refs.icon.$el);\n },\n onContentClick: function onContentClick(event) {\n this.selfClick = true;\n OverlayEventBus.emit('overlay-click', {\n originalEvent: event,\n target: this.overlay\n });\n },\n onContentMouseDown: function onContentMouseDown() {\n this.selfClick = true;\n },\n onOverlayEnter: function onOverlayEnter(el) {\n var _this = this;\n if (this.filterMenuStyle) {\n addStyle(this.overlay, this.filterMenuStyle);\n }\n ZIndex.set('overlay', el, this.$primevue.config.zIndex.overlay);\n addStyle(el, {\n position: 'absolute',\n top: '0',\n left: '0'\n });\n absolutePosition(this.overlay, this.$refs.icon.$el);\n this.bindOutsideClickListener();\n this.bindScrollListener();\n this.bindResizeListener();\n this.overlayEventListener = function (e) {\n if (!_this.isOutsideClicked(e.target)) {\n _this.selfClick = true;\n }\n };\n OverlayEventBus.on('overlay-click', this.overlayEventListener);\n },\n onOverlayAfterEnter: function onOverlayAfterEnter() {\n var _this$overlay;\n (_this$overlay = this.overlay) === null || _this$overlay === void 0 || (_this$overlay = _this$overlay.$focustrap) === null || _this$overlay === void 0 || _this$overlay.autoFocus();\n },\n onOverlayLeave: function onOverlayLeave() {\n this.onOverlayHide();\n },\n onOverlayAfterLeave: function onOverlayAfterLeave(el) {\n ZIndex.clear(el);\n },\n onOverlayHide: function onOverlayHide() {\n this.unbindOutsideClickListener();\n this.unbindResizeListener();\n this.unbindScrollListener();\n this.overlay = null;\n OverlayEventBus.off('overlay-click', this.overlayEventListener);\n this.overlayEventListener = null;\n },\n overlayRef: function overlayRef(el) {\n this.overlay = el;\n },\n isOutsideClicked: function isOutsideClicked(target) {\n return !this.isTargetClicked(target) && this.overlay && !(this.overlay.isSameNode(target) || this.overlay.contains(target));\n },\n isTargetClicked: function isTargetClicked(target) {\n return this.$refs.icon && (this.$refs.icon.$el.isSameNode(target) || this.$refs.icon.$el.contains(target));\n },\n bindOutsideClickListener: function bindOutsideClickListener() {\n var _this2 = this;\n if (!this.outsideClickListener) {\n this.outsideClickListener = function (event) {\n if (_this2.overlayVisible && !_this2.selfClick && _this2.isOutsideClicked(event.target)) {\n _this2.overlayVisible = false;\n }\n _this2.selfClick = false;\n };\n document.addEventListener('click', this.outsideClickListener);\n }\n },\n unbindOutsideClickListener: function unbindOutsideClickListener() {\n if (this.outsideClickListener) {\n document.removeEventListener('click', this.outsideClickListener);\n this.outsideClickListener = null;\n this.selfClick = false;\n }\n },\n bindScrollListener: function bindScrollListener() {\n var _this3 = this;\n if (!this.scrollHandler) {\n this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.icon.$el, function () {\n if (_this3.overlayVisible) {\n _this3.hide();\n }\n });\n }\n this.scrollHandler.bindScrollListener();\n },\n unbindScrollListener: function unbindScrollListener() {\n if (this.scrollHandler) {\n this.scrollHandler.unbindScrollListener();\n }\n },\n bindResizeListener: function bindResizeListener() {\n var _this4 = this;\n if (!this.resizeListener) {\n this.resizeListener = function () {\n if (_this4.overlayVisible && !isTouchDevice()) {\n _this4.hide();\n }\n };\n window.addEventListener('resize', this.resizeListener);\n }\n },\n unbindResizeListener: function unbindResizeListener() {\n if (this.resizeListener) {\n window.removeEventListener('resize', this.resizeListener);\n this.resizeListener = null;\n }\n }\n },\n computed: {\n showMenuButton: function showMenuButton() {\n return this.showMenu && (this.display === 'row' ? this.type !== 'boolean' : true);\n },\n overlayId: function overlayId() {\n return this.id + '_overlay';\n },\n matchModes: function matchModes() {\n var _this5 = this;\n return this.matchModeOptions || this.$primevue.config.filterMatchModeOptions[this.type].map(function (key) {\n return {\n label: _this5.$primevue.config.locale[key],\n value: key\n };\n });\n },\n isShowMatchModes: function isShowMatchModes() {\n return this.type !== 'boolean' && this.showMatchModes && this.matchModes;\n },\n operatorOptions: function operatorOptions() {\n return [{\n label: this.$primevue.config.locale.matchAll,\n value: FilterOperator.AND\n }, {\n label: this.$primevue.config.locale.matchAny,\n value: FilterOperator.OR\n }];\n },\n noFilterLabel: function noFilterLabel() {\n return this.$primevue.config.locale ? this.$primevue.config.locale.noFilter : undefined;\n },\n isShowOperator: function isShowOperator() {\n return this.showOperator && this.filters[this.field].operator;\n },\n operator: function operator() {\n return this.filters[this.field].operator;\n },\n fieldConstraints: function fieldConstraints() {\n return this.filters[this.field].constraints || [this.filters[this.field]];\n },\n showRemoveIcon: function showRemoveIcon() {\n return this.fieldConstraints.length > 1;\n },\n removeRuleButtonLabel: function removeRuleButtonLabel() {\n return this.$primevue.config.locale ? this.$primevue.config.locale.removeRule : undefined;\n },\n addRuleButtonLabel: function addRuleButtonLabel() {\n return this.$primevue.config.locale ? this.$primevue.config.locale.addRule : undefined;\n },\n isShowAddConstraint: function isShowAddConstraint() {\n return this.showAddButton && this.filters[this.field].operator && this.fieldConstraints && this.fieldConstraints.length < this.maxConstraints;\n },\n clearButtonLabel: function clearButtonLabel() {\n return this.$primevue.config.locale ? this.$primevue.config.locale.clear : undefined;\n },\n applyButtonLabel: function applyButtonLabel() {\n return this.$primevue.config.locale ? this.$primevue.config.locale.apply : undefined;\n },\n columnFilterButtonAriaLabel: function columnFilterButtonAriaLabel() {\n return this.$primevue.config.locale ? this.overlayVisible ? this.$primevue.config.locale.showFilterMenu : this.$primevue.config.locale.hideFilterMenu : undefined;\n },\n filterOperatorAriaLabel: function filterOperatorAriaLabel() {\n return this.$primevue.config.locale ? this.$primevue.config.locale.filterOperator : undefined;\n },\n filterRuleAriaLabel: function filterRuleAriaLabel() {\n return this.$primevue.config.locale ? this.$primevue.config.locale.filterConstraint : undefined;\n },\n ptmHeaderFilterClearParams: function ptmHeaderFilterClearParams() {\n return {\n context: {\n hidden: this.hasRowFilter()\n }\n };\n },\n ptmFilterMenuParams: function ptmFilterMenuParams() {\n return {\n context: {\n overlayVisible: this.overlayVisible,\n active: this.hasFilter()\n }\n };\n }\n },\n components: {\n Select: Select,\n Button: Button,\n Portal: Portal,\n FilterSlashIcon: FilterSlashIcon,\n FilterIcon: FilterIcon,\n TrashIcon: TrashIcon,\n PlusIcon: PlusIcon\n },\n directives: {\n focustrap: FocusTrap\n }\n};\n\nfunction _typeof$4(o) { \"@babel/helpers - typeof\"; return _typeof$4 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof$4(o); }\nfunction ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty$4(e, r, t) { return (r = _toPropertyKey$4(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey$4(t) { var i = _toPrimitive$4(t, \"string\"); return \"symbol\" == _typeof$4(i) ? i : i + \"\"; }\nfunction _toPrimitive$4(t, r) { if (\"object\" != _typeof$4(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof$4(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar _hoisted_1$1 = [\"id\", \"aria-modal\"];\nvar _hoisted_2 = [\"onClick\", \"onKeydown\", \"tabindex\"];\nfunction render$4(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_Button = resolveComponent(\"Button\");\n var _component_Select = resolveComponent(\"Select\");\n var _component_Portal = resolveComponent(\"Portal\");\n var _directive_focustrap = resolveDirective(\"focustrap\");\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('filter')\n }, $options.getColumnPT('filter')), [$props.display === 'row' ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('filterElementContainer')\n }, _objectSpread$4(_objectSpread$4({}, $props.filterInputProps), $options.getColumnPT('filterElementContainer'))), [(openBlock(), createBlock(resolveDynamicComponent($props.filterElement), {\n field: $props.field,\n filterModel: $props.filters[$props.field],\n filterCallback: $options.filterCallback\n }, null, 8, [\"field\", \"filterModel\", \"filterCallback\"]))], 16)) : createCommentVNode(\"\", true), $options.showMenuButton ? (openBlock(), createBlock(_component_Button, mergeProps({\n key: 1,\n ref: \"icon\",\n \"aria-label\": $options.columnFilterButtonAriaLabel,\n \"aria-haspopup\": \"true\",\n \"aria-expanded\": $data.overlayVisible,\n \"aria-controls\": $options.overlayId,\n \"class\": _ctx.cx('pcColumnFilterButton'),\n unstyled: _ctx.unstyled,\n onClick: _cache[0] || (_cache[0] = function ($event) {\n return $options.toggleMenu($event);\n }),\n onKeydown: _cache[1] || (_cache[1] = function ($event) {\n return $options.onToggleButtonKeyDown($event);\n })\n }, _objectSpread$4(_objectSpread$4({}, $options.getColumnPT('pcColumnFilterButton', $options.ptmFilterMenuParams)), $props.filterButtonProps.filter)), {\n icon: withCtx(function (slotProps) {\n return [(openBlock(), createBlock(resolveDynamicComponent($props.filterIconTemplate || 'FilterIcon'), mergeProps({\n \"class\": slotProps[\"class\"]\n }, $options.getColumnPT('filterMenuIcon')), null, 16, [\"class\"]))];\n }),\n _: 1\n }, 16, [\"aria-label\", \"aria-expanded\", \"aria-controls\", \"class\", \"unstyled\"])) : createCommentVNode(\"\", true), $props.showClearButton && $props.display === 'row' && $options.hasRowFilter() ? (openBlock(), createBlock(_component_Button, mergeProps({\n key: 2,\n \"class\": _ctx.cx('pcColumnFilterClearButton'),\n unstyled: _ctx.unstyled,\n onClick: _cache[2] || (_cache[2] = function ($event) {\n return $options.clearFilter();\n })\n }, _objectSpread$4(_objectSpread$4({}, $options.getColumnPT('pcColumnFilterClearButton', $options.ptmHeaderFilterClearParams)), $props.filterButtonProps.inline.clear)), {\n icon: withCtx(function (slotProps) {\n return [(openBlock(), createBlock(resolveDynamicComponent($props.filterClearIconTemplate || 'FilterSlashIcon'), mergeProps({\n \"class\": slotProps[\"class\"]\n }, $options.getColumnPT('filterClearIcon')), null, 16, [\"class\"]))];\n }),\n _: 1\n }, 16, [\"class\", \"unstyled\"])) : createCommentVNode(\"\", true), createVNode(_component_Portal, null, {\n \"default\": withCtx(function () {\n return [createVNode(Transition, mergeProps({\n name: \"p-connected-overlay\",\n onEnter: $options.onOverlayEnter,\n onAfterEnter: $options.onOverlayAfterEnter,\n onLeave: $options.onOverlayLeave,\n onAfterLeave: $options.onOverlayAfterLeave\n }, $options.getColumnPT('transition')), {\n \"default\": withCtx(function () {\n return [$data.overlayVisible ? withDirectives((openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n ref: $options.overlayRef,\n id: $options.overlayId,\n \"aria-modal\": $data.overlayVisible,\n role: \"dialog\",\n \"class\": [_ctx.cx('filterOverlay'), $props.filterMenuClass],\n onKeydown: _cache[10] || (_cache[10] = withKeys(function () {\n return $options.hide && $options.hide.apply($options, arguments);\n }, [\"escape\"])),\n onClick: _cache[11] || (_cache[11] = function () {\n return $options.onContentClick && $options.onContentClick.apply($options, arguments);\n }),\n onMousedown: _cache[12] || (_cache[12] = function () {\n return $options.onContentMouseDown && $options.onContentMouseDown.apply($options, arguments);\n })\n }, $options.getColumnPT('filterOverlay')), [(openBlock(), createBlock(resolveDynamicComponent($props.filterHeaderTemplate), {\n field: $props.field,\n filterModel: $props.filters[$props.field],\n filterCallback: $options.filterCallback\n }, null, 8, [\"field\", \"filterModel\", \"filterCallback\"])), $props.display === 'row' ? (openBlock(), createElementBlock(\"ul\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('filterConstraintList')\n }, $options.getColumnPT('filterConstraintList')), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.matchModes, function (matchMode, i) {\n return openBlock(), createElementBlock(\"li\", mergeProps({\n key: matchMode.label,\n \"class\": _ctx.cx('filterConstraint', {\n matchMode: matchMode\n }),\n onClick: function onClick($event) {\n return $options.onRowMatchModeChange(matchMode.value);\n },\n onKeydown: [_cache[3] || (_cache[3] = function ($event) {\n return $options.onRowMatchModeKeyDown($event);\n }), withKeys(withModifiers(function ($event) {\n return $options.onRowMatchModeChange(matchMode.value);\n }, [\"prevent\"]), [\"enter\"])],\n tabindex: i === 0 ? '0' : null,\n ref_for: true\n }, $options.getColumnPT('filterConstraint', $options.ptmFilterConstraintOptions(matchMode))), toDisplayString(matchMode.label), 17, _hoisted_2);\n }), 128)), createElementVNode(\"li\", mergeProps({\n \"class\": _ctx.cx('filterConstraintSeparator')\n }, $options.getColumnPT('filterConstraintSeparator')), null, 16), createElementVNode(\"li\", mergeProps({\n \"class\": _ctx.cx('filterConstraint'),\n onClick: _cache[4] || (_cache[4] = function ($event) {\n return $options.clearFilter();\n }),\n onKeydown: [_cache[5] || (_cache[5] = function ($event) {\n return $options.onRowMatchModeKeyDown($event);\n }), _cache[6] || (_cache[6] = withKeys(function ($event) {\n return _ctx.onRowClearItemClick();\n }, [\"enter\"]))]\n }, $options.getColumnPT('filterConstraint')), toDisplayString($options.noFilterLabel), 17)], 16)) : (openBlock(), createElementBlock(Fragment, {\n key: 1\n }, [$options.isShowOperator ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('filterOperator')\n }, $options.getColumnPT('filterOperator')), [createVNode(_component_Select, {\n options: $options.operatorOptions,\n modelValue: $options.operator,\n \"aria-label\": $options.filterOperatorAriaLabel,\n \"class\": normalizeClass(_ctx.cx('pcFilterOperatorDropdown')),\n optionLabel: \"label\",\n optionValue: \"value\",\n \"onUpdate:modelValue\": _cache[7] || (_cache[7] = function ($event) {\n return $options.onOperatorChange($event);\n }),\n unstyled: _ctx.unstyled,\n pt: $options.getColumnPT('pcFilterOperatorDropdown')\n }, null, 8, [\"options\", \"modelValue\", \"aria-label\", \"class\", \"unstyled\", \"pt\"])], 16)) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('filterRuleList')\n }, $options.getColumnPT('filterRuleList')), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldConstraints, function (fieldConstraint, i) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n key: i,\n \"class\": _ctx.cx('filterRule'),\n ref_for: true\n }, $options.getColumnPT('filterRule')), [$options.isShowMatchModes ? (openBlock(), createBlock(_component_Select, {\n key: 0,\n options: $options.matchModes,\n modelValue: fieldConstraint.matchMode,\n \"class\": normalizeClass(_ctx.cx('pcFilterConstraintDropdown')),\n optionLabel: \"label\",\n optionValue: \"value\",\n \"aria-label\": $options.filterRuleAriaLabel,\n \"onUpdate:modelValue\": function onUpdateModelValue($event) {\n return $options.onMenuMatchModeChange($event, i);\n },\n unstyled: _ctx.unstyled,\n pt: $options.getColumnPT('pcFilterConstraintDropdown')\n }, null, 8, [\"options\", \"modelValue\", \"class\", \"aria-label\", \"onUpdate:modelValue\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true), $props.display === 'menu' ? (openBlock(), createBlock(resolveDynamicComponent($props.filterElement), {\n key: 1,\n field: $props.field,\n filterModel: fieldConstraint,\n filterCallback: $options.filterCallback,\n applyFilter: $options.applyFilter\n }, null, 8, [\"field\", \"filterModel\", \"filterCallback\", \"applyFilter\"])) : createCommentVNode(\"\", true), $options.showRemoveIcon ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 2,\n ref_for: true\n }, $options.getColumnPT('filterRemove')), [createVNode(_component_Button, mergeProps({\n type: \"button\",\n \"class\": _ctx.cx('pcFilterRemoveRuleButton'),\n onClick: function onClick($event) {\n return $options.removeConstraint(i);\n },\n label: $options.removeRuleButtonLabel,\n unstyled: _ctx.unstyled,\n ref_for: true\n }, $props.filterButtonProps.popover.removeRule, {\n pt: $options.getColumnPT('pcFilterRemoveRuleButton')\n }), {\n icon: withCtx(function (iconProps) {\n return [(openBlock(), createBlock(resolveDynamicComponent($props.filterRemoveIconTemplate || 'TrashIcon'), mergeProps({\n \"class\": iconProps[\"class\"],\n ref_for: true\n }, $options.getColumnPT('pcFilterRemoveRuleButton')['icon']), null, 16, [\"class\"]))];\n }),\n _: 2\n }, 1040, [\"class\", \"onClick\", \"label\", \"unstyled\", \"pt\"])], 16)) : createCommentVNode(\"\", true)], 16);\n }), 128))], 16), $options.isShowAddConstraint ? (openBlock(), createElementBlock(\"div\", normalizeProps(mergeProps({\n key: 1\n }, $options.getColumnPT('filterAddButtonContainer'))), [createVNode(_component_Button, mergeProps({\n type: \"button\",\n label: $options.addRuleButtonLabel,\n iconPos: \"left\",\n \"class\": _ctx.cx('pcFilterAddRuleButton'),\n onClick: _cache[8] || (_cache[8] = function ($event) {\n return $options.addConstraint();\n }),\n unstyled: _ctx.unstyled\n }, $props.filterButtonProps.popover.addRule, {\n pt: $options.getColumnPT('pcFilterAddRuleButton')\n }), {\n icon: withCtx(function (iconProps) {\n return [(openBlock(), createBlock(resolveDynamicComponent($props.filterAddIconTemplate || 'PlusIcon'), mergeProps({\n \"class\": iconProps[\"class\"]\n }, $options.getColumnPT('pcFilterAddRuleButton')['icon']), null, 16, [\"class\"]))];\n }),\n _: 1\n }, 16, [\"label\", \"class\", \"unstyled\", \"pt\"])], 16)) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('filterButtonbar')\n }, $options.getColumnPT('filterButtonbar')), [!$props.filterClearTemplate && $props.showClearButton ? (openBlock(), createBlock(_component_Button, mergeProps({\n key: 0,\n type: \"button\",\n \"class\": _ctx.cx('pcFilterClearButton'),\n label: $options.clearButtonLabel,\n onClick: $options.clearFilter,\n unstyled: _ctx.unstyled\n }, $props.filterButtonProps.popover.clear, {\n pt: $options.getColumnPT('pcFilterClearButton')\n }), null, 16, [\"class\", \"label\", \"onClick\", \"unstyled\", \"pt\"])) : (openBlock(), createBlock(resolveDynamicComponent($props.filterClearTemplate), {\n key: 1,\n field: $props.field,\n filterModel: $props.filters[$props.field],\n filterCallback: $options.clearFilter\n }, null, 8, [\"field\", \"filterModel\", \"filterCallback\"])), $props.showApplyButton ? (openBlock(), createElementBlock(Fragment, {\n key: 2\n }, [!$props.filterApplyTemplate ? (openBlock(), createBlock(_component_Button, mergeProps({\n key: 0,\n type: \"button\",\n \"class\": _ctx.cx('pcFilterApplyButton'),\n label: $options.applyButtonLabel,\n onClick: _cache[9] || (_cache[9] = function ($event) {\n return $options.applyFilter();\n }),\n unstyled: _ctx.unstyled\n }, $props.filterButtonProps.popover.apply, {\n pt: $options.getColumnPT('pcFilterApplyButton')\n }), null, 16, [\"class\", \"label\", \"unstyled\", \"pt\"])) : (openBlock(), createBlock(resolveDynamicComponent($props.filterApplyTemplate), {\n key: 1,\n field: $props.field,\n filterModel: $props.filters[$props.field],\n filterCallback: $options.applyFilter\n }, null, 8, [\"field\", \"filterModel\", \"filterCallback\"]))], 64)) : createCommentVNode(\"\", true)], 16)], 64)), (openBlock(), createBlock(resolveDynamicComponent($props.filterFooterTemplate), {\n field: $props.field,\n filterModel: $props.filters[$props.field],\n filterCallback: $options.filterCallback\n }, null, 8, [\"field\", \"filterModel\", \"filterCallback\"]))], 16, _hoisted_1$1)), [[_directive_focustrap]]) : createCommentVNode(\"\", true)];\n }),\n _: 1\n }, 16, [\"onEnter\", \"onAfterEnter\", \"onLeave\", \"onAfterLeave\"])];\n }),\n _: 1\n })], 16);\n}\n\nscript$4.render = render$4;\n\nvar script$3 = {\n name: 'HeaderCheckbox',\n hostName: 'DataTable',\n \"extends\": BaseComponent,\n emits: ['change'],\n props: {\n checked: null,\n disabled: null,\n column: null,\n headerCheckboxIconTemplate: {\n type: Function,\n \"default\": null\n }\n },\n methods: {\n getColumnPT: function getColumnPT(key) {\n var columnMetaData = {\n props: this.column.props,\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n },\n context: {\n checked: this.checked,\n disabled: this.disabled\n }\n };\n return mergeProps(this.ptm(\"column.\".concat(key), {\n column: columnMetaData\n }), this.ptm(\"column.\".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData));\n },\n getColumnProp: function getColumnProp() {\n return this.column.props && this.column.props.pt ? this.column.props.pt : undefined; //@todo:\n },\n onChange: function onChange(event) {\n this.$emit('change', {\n originalEvent: event,\n checked: !this.checked\n });\n }\n },\n computed: {\n headerCheckboxAriaLabel: function headerCheckboxAriaLabel() {\n return this.$primevue.config.locale.aria ? this.checked ? this.$primevue.config.locale.aria.selectAll : this.$primevue.config.locale.aria.unselectAll : undefined;\n }\n },\n components: {\n CheckIcon: CheckIcon,\n Checkbox: Checkbox\n }\n};\n\nfunction render$3(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_CheckIcon = resolveComponent(\"CheckIcon\");\n var _component_Checkbox = resolveComponent(\"Checkbox\");\n return openBlock(), createBlock(_component_Checkbox, {\n modelValue: $props.checked,\n binary: true,\n disabled: $props.disabled,\n \"aria-label\": $options.headerCheckboxAriaLabel,\n onChange: $options.onChange,\n unstyled: _ctx.unstyled,\n pt: $options.getColumnPT('pcHeaderCheckbox')\n }, {\n icon: withCtx(function (slotProps) {\n return [$props.headerCheckboxIconTemplate ? (openBlock(), createBlock(resolveDynamicComponent($props.headerCheckboxIconTemplate), {\n key: 0,\n checked: slotProps.checked,\n \"class\": normalizeClass(slotProps[\"class\"])\n }, null, 8, [\"checked\", \"class\"])) : !$props.headerCheckboxIconTemplate && slotProps.checked ? (openBlock(), createBlock(_component_CheckIcon, mergeProps({\n key: 1,\n \"class\": slotProps[\"class\"]\n }, $options.getColumnPT('pcHeaderCheckbox')['icon']), null, 16, [\"class\"])) : createCommentVNode(\"\", true)];\n }),\n _: 1\n }, 8, [\"modelValue\", \"disabled\", \"aria-label\", \"onChange\", \"unstyled\", \"pt\"]);\n}\n\nscript$3.render = render$3;\n\nvar script$2 = {\n name: 'HeaderCell',\n hostName: 'DataTable',\n \"extends\": BaseComponent,\n emits: ['column-click', 'column-mousedown', 'column-dragstart', 'column-dragover', 'column-dragleave', 'column-drop', 'column-resizestart', 'checkbox-change', 'filter-change', 'filter-apply', 'operator-change', 'matchmode-change', 'constraint-add', 'constraint-remove', 'filter-clear', 'apply-click'],\n props: {\n column: {\n type: Object,\n \"default\": null\n },\n index: {\n type: Number,\n \"default\": null\n },\n resizableColumns: {\n type: Boolean,\n \"default\": false\n },\n groupRowsBy: {\n type: [Array, String, Function],\n \"default\": null\n },\n sortMode: {\n type: String,\n \"default\": 'single'\n },\n groupRowSortField: {\n type: [String, Function],\n \"default\": null\n },\n sortField: {\n type: [String, Function],\n \"default\": null\n },\n sortOrder: {\n type: Number,\n \"default\": null\n },\n multiSortMeta: {\n type: Array,\n \"default\": null\n },\n allRowsSelected: {\n type: Boolean,\n \"default\": false\n },\n empty: {\n type: Boolean,\n \"default\": false\n },\n filterDisplay: {\n type: String,\n \"default\": null\n },\n filters: {\n type: Object,\n \"default\": null\n },\n filtersStore: {\n type: Object,\n \"default\": null\n },\n filterColumn: {\n type: Boolean,\n \"default\": false\n },\n reorderableColumns: {\n type: Boolean,\n \"default\": false\n },\n filterInputProps: {\n type: null,\n \"default\": null\n },\n filterButtonProps: {\n type: null,\n \"default\": null\n }\n },\n data: function data() {\n return {\n styleObject: {}\n };\n },\n mounted: function mounted() {\n if (this.columnProp('frozen')) {\n this.updateStickyPosition();\n }\n },\n updated: function updated() {\n if (this.columnProp('frozen')) {\n this.updateStickyPosition();\n }\n },\n methods: {\n columnProp: function columnProp(prop) {\n return getVNodeProp(this.column, prop);\n },\n getColumnPT: function getColumnPT(key) {\n var _this$$parentInstance, _this$$parentInstance2;\n var columnMetaData = {\n props: this.column.props,\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n },\n context: {\n index: this.index,\n sortable: this.columnProp('sortable') === '' || this.columnProp('sortable'),\n sorted: this.isColumnSorted(),\n resizable: this.resizableColumns,\n size: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.size,\n showGridlines: ((_this$$parentInstance2 = this.$parentInstance) === null || _this$$parentInstance2 === void 0 || (_this$$parentInstance2 = _this$$parentInstance2.$parentInstance) === null || _this$$parentInstance2 === void 0 ? void 0 : _this$$parentInstance2.showGridlines) || false\n }\n };\n return mergeProps(this.ptm(\"column.\".concat(key), {\n column: columnMetaData\n }), this.ptm(\"column.\".concat(key), columnMetaData), this.ptmo(this.getColumnProp(), key, columnMetaData));\n },\n getColumnProp: function getColumnProp() {\n return this.column.props && this.column.props.pt ? this.column.props.pt : undefined; //@todo:\n },\n onClick: function onClick(event) {\n this.$emit('column-click', {\n originalEvent: event,\n column: this.column\n });\n },\n onKeyDown: function onKeyDown(event) {\n if ((event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && event.currentTarget.nodeName === 'TH' && getAttribute(event.currentTarget, 'data-p-sortable-column')) {\n this.$emit('column-click', {\n originalEvent: event,\n column: this.column\n });\n event.preventDefault();\n }\n },\n onMouseDown: function onMouseDown(event) {\n this.$emit('column-mousedown', {\n originalEvent: event,\n column: this.column\n });\n },\n onDragStart: function onDragStart(event) {\n this.$emit('column-dragstart', {\n originalEvent: event,\n column: this.column\n });\n },\n onDragOver: function onDragOver(event) {\n this.$emit('column-dragover', {\n originalEvent: event,\n column: this.column\n });\n },\n onDragLeave: function onDragLeave(event) {\n this.$emit('column-dragleave', {\n originalEvent: event,\n column: this.column\n });\n },\n onDrop: function onDrop(event) {\n this.$emit('column-drop', {\n originalEvent: event,\n column: this.column\n });\n },\n onResizeStart: function onResizeStart(event) {\n this.$emit('column-resizestart', event);\n },\n getMultiSortMetaIndex: function getMultiSortMetaIndex() {\n var _this = this;\n return this.multiSortMeta.findIndex(function (meta) {\n return meta.field === _this.columnProp('field') || meta.field === _this.columnProp('sortField');\n });\n },\n getBadgeValue: function getBadgeValue() {\n var index = this.getMultiSortMetaIndex();\n return this.groupRowsBy && this.groupRowsBy === this.groupRowSortField && index > -1 ? index : index + 1;\n },\n isMultiSorted: function isMultiSorted() {\n return this.sortMode === 'multiple' && this.columnProp('sortable') && this.getMultiSortMetaIndex() > -1;\n },\n isColumnSorted: function isColumnSorted() {\n return this.sortMode === 'single' ? this.sortField && (this.sortField === this.columnProp('field') || this.sortField === this.columnProp('sortField')) : this.isMultiSorted();\n },\n updateStickyPosition: function updateStickyPosition() {\n if (this.columnProp('frozen')) {\n var align = this.columnProp('alignFrozen');\n if (align === 'right') {\n var pos = 0;\n var next = getNextElementSibling(this.$el, '[data-p-frozen-column=\"true\"]');\n if (next) {\n pos = getOuterWidth(next) + parseFloat(next.style.right || 0);\n }\n this.styleObject.insetInlineEnd = pos + 'px';\n } else {\n var _pos = 0;\n var prev = getPreviousElementSibling(this.$el, '[data-p-frozen-column=\"true\"]');\n if (prev) {\n _pos = getOuterWidth(prev) + parseFloat(prev.style.left || 0);\n }\n this.styleObject.insetInlineStart = _pos + 'px';\n }\n var filterRow = this.$el.parentElement.nextElementSibling;\n if (filterRow) {\n var index = getIndex(this.$el);\n if (filterRow.children[index]) {\n filterRow.children[index].style.left = this.styleObject.left;\n filterRow.children[index].style.right = this.styleObject.right;\n }\n }\n }\n },\n onHeaderCheckboxChange: function onHeaderCheckboxChange(event) {\n this.$emit('checkbox-change', event);\n }\n },\n computed: {\n containerClass: function containerClass() {\n return [this.cx('headerCell'), this.filterColumn ? this.columnProp('filterHeaderClass') : this.columnProp('headerClass'), this.columnProp('class')];\n },\n containerStyle: function containerStyle() {\n var headerStyle = this.filterColumn ? this.columnProp('filterHeaderStyle') : this.columnProp('headerStyle');\n var columnStyle = this.columnProp('style');\n return this.columnProp('frozen') ? [columnStyle, headerStyle, this.styleObject] : [columnStyle, headerStyle];\n },\n sortState: function sortState() {\n var sorted = false;\n var sortOrder = null;\n if (this.sortMode === 'single') {\n sorted = this.sortField && (this.sortField === this.columnProp('field') || this.sortField === this.columnProp('sortField'));\n sortOrder = sorted ? this.sortOrder : 0;\n } else if (this.sortMode === 'multiple') {\n var metaIndex = this.getMultiSortMetaIndex();\n if (metaIndex > -1) {\n sorted = true;\n sortOrder = this.multiSortMeta[metaIndex].order;\n }\n }\n return {\n sorted: sorted,\n sortOrder: sortOrder\n };\n },\n sortableColumnIcon: function sortableColumnIcon() {\n var _this$sortState = this.sortState,\n sorted = _this$sortState.sorted,\n sortOrder = _this$sortState.sortOrder;\n if (!sorted) return SortAltIcon;else if (sorted && sortOrder > 0) return SortAmountUpAltIcon;else if (sorted && sortOrder < 0) return SortAmountDownIcon;\n return null;\n },\n ariaSort: function ariaSort() {\n if (this.columnProp('sortable')) {\n var _this$sortState2 = this.sortState,\n sorted = _this$sortState2.sorted,\n sortOrder = _this$sortState2.sortOrder;\n if (sorted && sortOrder < 0) return 'descending';else if (sorted && sortOrder > 0) return 'ascending';else return 'none';\n } else {\n return null;\n }\n }\n },\n components: {\n Badge: Badge,\n DTHeaderCheckbox: script$3,\n DTColumnFilter: script$4,\n SortAltIcon: SortAltIcon,\n SortAmountUpAltIcon: SortAmountUpAltIcon,\n SortAmountDownIcon: SortAmountDownIcon\n }\n};\n\nfunction _typeof$3(o) { \"@babel/helpers - typeof\"; return _typeof$3 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof$3(o); }\nfunction ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty$3(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty$3(e, r, t) { return (r = _toPropertyKey$3(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey$3(t) { var i = _toPrimitive$3(t, \"string\"); return \"symbol\" == _typeof$3(i) ? i : i + \"\"; }\nfunction _toPrimitive$3(t, r) { if (\"object\" != _typeof$3(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof$3(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar _hoisted_1 = [\"tabindex\", \"colspan\", \"rowspan\", \"aria-sort\", \"data-p-sortable-column\", \"data-p-resizable-column\", \"data-p-sorted\", \"data-p-filter-column\", \"data-p-frozen-column\", \"data-p-reorderable-column\"];\nfunction render$2(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_Badge = resolveComponent(\"Badge\");\n var _component_DTHeaderCheckbox = resolveComponent(\"DTHeaderCheckbox\");\n var _component_DTColumnFilter = resolveComponent(\"DTColumnFilter\");\n return openBlock(), createElementBlock(\"th\", mergeProps({\n style: $options.containerStyle,\n \"class\": $options.containerClass,\n tabindex: $options.columnProp('sortable') ? '0' : null,\n role: \"columnheader\",\n colspan: $options.columnProp('colspan'),\n rowspan: $options.columnProp('rowspan'),\n \"aria-sort\": $options.ariaSort,\n onClick: _cache[8] || (_cache[8] = function () {\n return $options.onClick && $options.onClick.apply($options, arguments);\n }),\n onKeydown: _cache[9] || (_cache[9] = function () {\n return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);\n }),\n onMousedown: _cache[10] || (_cache[10] = function () {\n return $options.onMouseDown && $options.onMouseDown.apply($options, arguments);\n }),\n onDragstart: _cache[11] || (_cache[11] = function () {\n return $options.onDragStart && $options.onDragStart.apply($options, arguments);\n }),\n onDragover: _cache[12] || (_cache[12] = function () {\n return $options.onDragOver && $options.onDragOver.apply($options, arguments);\n }),\n onDragleave: _cache[13] || (_cache[13] = function () {\n return $options.onDragLeave && $options.onDragLeave.apply($options, arguments);\n }),\n onDrop: _cache[14] || (_cache[14] = function () {\n return $options.onDrop && $options.onDrop.apply($options, arguments);\n })\n }, _objectSpread$3(_objectSpread$3({}, $options.getColumnPT('root')), $options.getColumnPT('headerCell')), {\n \"data-p-sortable-column\": $options.columnProp('sortable'),\n \"data-p-resizable-column\": $props.resizableColumns,\n \"data-p-sorted\": $options.isColumnSorted(),\n \"data-p-filter-column\": $props.filterColumn,\n \"data-p-frozen-column\": $options.columnProp('frozen'),\n \"data-p-reorderable-column\": $props.reorderableColumns\n }), [$props.resizableColumns && !$options.columnProp('frozen') ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('columnResizer'),\n onMousedown: _cache[0] || (_cache[0] = function () {\n return $options.onResizeStart && $options.onResizeStart.apply($options, arguments);\n })\n }, $options.getColumnPT('columnResizer')), null, 16)) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('columnHeaderContent')\n }, $options.getColumnPT('columnHeaderContent')), [$props.column.children && $props.column.children.header ? (openBlock(), createBlock(resolveDynamicComponent($props.column.children.header), {\n key: 0,\n column: $props.column\n }, null, 8, [\"column\"])) : createCommentVNode(\"\", true), $options.columnProp('header') ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('columnTitle')\n }, $options.getColumnPT('columnTitle')), toDisplayString($options.columnProp('header')), 17)) : createCommentVNode(\"\", true), $options.columnProp('sortable') ? (openBlock(), createElementBlock(\"span\", normalizeProps(mergeProps({\n key: 2\n }, $options.getColumnPT('sort'))), [(openBlock(), createBlock(resolveDynamicComponent($props.column.children && $props.column.children.sorticon || $options.sortableColumnIcon), mergeProps({\n sorted: $options.sortState.sorted,\n sortOrder: $options.sortState.sortOrder,\n \"class\": _ctx.cx('sortIcon')\n }, $options.getColumnPT('sorticon')), null, 16, [\"sorted\", \"sortOrder\", \"class\"]))], 16)) : createCommentVNode(\"\", true), $options.isMultiSorted() ? (openBlock(), createBlock(_component_Badge, {\n key: 3,\n \"class\": normalizeClass(_ctx.cx('pcSortBadge')),\n pt: $options.getColumnPT('pcSortBadge'),\n value: $options.getBadgeValue(),\n size: \"small\"\n }, null, 8, [\"class\", \"pt\", \"value\"])) : createCommentVNode(\"\", true), $options.columnProp('selectionMode') === 'multiple' && $props.filterDisplay !== 'row' ? (openBlock(), createBlock(_component_DTHeaderCheckbox, {\n key: 4,\n checked: $props.allRowsSelected,\n onChange: $options.onHeaderCheckboxChange,\n disabled: $props.empty,\n headerCheckboxIconTemplate: $props.column.children && $props.column.children.headercheckboxicon,\n column: $props.column,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"checked\", \"onChange\", \"disabled\", \"headerCheckboxIconTemplate\", \"column\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true), $props.filterDisplay === 'menu' && $props.column.children && $props.column.children.filter ? (openBlock(), createBlock(_component_DTColumnFilter, {\n key: 5,\n field: $options.columnProp('filterField') || $options.columnProp('field'),\n type: $options.columnProp('dataType'),\n display: \"menu\",\n showMenu: $options.columnProp('showFilterMenu'),\n filterElement: $props.column.children && $props.column.children.filter,\n filterHeaderTemplate: $props.column.children && $props.column.children.filterheader,\n filterFooterTemplate: $props.column.children && $props.column.children.filterfooter,\n filterClearTemplate: $props.column.children && $props.column.children.filterclear,\n filterApplyTemplate: $props.column.children && $props.column.children.filterapply,\n filterIconTemplate: $props.column.children && $props.column.children.filtericon,\n filterAddIconTemplate: $props.column.children && $props.column.children.filteraddicon,\n filterRemoveIconTemplate: $props.column.children && $props.column.children.filterremoveicon,\n filterClearIconTemplate: $props.column.children && $props.column.children.filterclearicon,\n filters: $props.filters,\n filtersStore: $props.filtersStore,\n filterInputProps: $props.filterInputProps,\n filterButtonProps: $props.filterButtonProps,\n onFilterChange: _cache[1] || (_cache[1] = function ($event) {\n return _ctx.$emit('filter-change', $event);\n }),\n onFilterApply: _cache[2] || (_cache[2] = function ($event) {\n return _ctx.$emit('filter-apply');\n }),\n filterMenuStyle: $options.columnProp('filterMenuStyle'),\n filterMenuClass: $options.columnProp('filterMenuClass'),\n showOperator: $options.columnProp('showFilterOperator'),\n showClearButton: $options.columnProp('showClearButton'),\n showApplyButton: $options.columnProp('showApplyButton'),\n showMatchModes: $options.columnProp('showFilterMatchModes'),\n showAddButton: $options.columnProp('showAddButton'),\n matchModeOptions: $options.columnProp('filterMatchModeOptions'),\n maxConstraints: $options.columnProp('maxConstraints'),\n onOperatorChange: _cache[3] || (_cache[3] = function ($event) {\n return _ctx.$emit('operator-change', $event);\n }),\n onMatchmodeChange: _cache[4] || (_cache[4] = function ($event) {\n return _ctx.$emit('matchmode-change', $event);\n }),\n onConstraintAdd: _cache[5] || (_cache[5] = function ($event) {\n return _ctx.$emit('constraint-add', $event);\n }),\n onConstraintRemove: _cache[6] || (_cache[6] = function ($event) {\n return _ctx.$emit('constraint-remove', $event);\n }),\n onApplyClick: _cache[7] || (_cache[7] = function ($event) {\n return _ctx.$emit('apply-click', $event);\n }),\n column: $props.column,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"field\", \"type\", \"showMenu\", \"filterElement\", \"filterHeaderTemplate\", \"filterFooterTemplate\", \"filterClearTemplate\", \"filterApplyTemplate\", \"filterIconTemplate\", \"filterAddIconTemplate\", \"filterRemoveIconTemplate\", \"filterClearIconTemplate\", \"filters\", \"filtersStore\", \"filterInputProps\", \"filterButtonProps\", \"filterMenuStyle\", \"filterMenuClass\", \"showOperator\", \"showClearButton\", \"showApplyButton\", \"showMatchModes\", \"showAddButton\", \"matchModeOptions\", \"maxConstraints\", \"column\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true)], 16)], 16, _hoisted_1);\n}\n\nscript$2.render = render$2;\n\nvar script$1 = {\n name: 'TableHeader',\n hostName: 'DataTable',\n \"extends\": BaseComponent,\n emits: ['column-click', 'column-mousedown', 'column-dragstart', 'column-dragover', 'column-dragleave', 'column-drop', 'column-resizestart', 'checkbox-change', 'filter-change', 'filter-apply', 'operator-change', 'matchmode-change', 'constraint-add', 'constraint-remove', 'filter-clear', 'apply-click'],\n props: {\n columnGroup: {\n type: null,\n \"default\": null\n },\n columns: {\n type: null,\n \"default\": null\n },\n rowGroupMode: {\n type: String,\n \"default\": null\n },\n groupRowsBy: {\n type: [Array, String, Function],\n \"default\": null\n },\n resizableColumns: {\n type: Boolean,\n \"default\": false\n },\n allRowsSelected: {\n type: Boolean,\n \"default\": false\n },\n empty: {\n type: Boolean,\n \"default\": false\n },\n sortMode: {\n type: String,\n \"default\": 'single'\n },\n groupRowSortField: {\n type: [String, Function],\n \"default\": null\n },\n sortField: {\n type: [String, Function],\n \"default\": null\n },\n sortOrder: {\n type: Number,\n \"default\": null\n },\n multiSortMeta: {\n type: Array,\n \"default\": null\n },\n filterDisplay: {\n type: String,\n \"default\": null\n },\n filters: {\n type: Object,\n \"default\": null\n },\n filtersStore: {\n type: Object,\n \"default\": null\n },\n reorderableColumns: {\n type: Boolean,\n \"default\": false\n },\n first: {\n type: Number,\n \"default\": 0\n },\n filterInputProps: {\n type: null,\n \"default\": null\n },\n filterButtonProps: {\n type: null,\n \"default\": null\n }\n },\n provide: function provide() {\n return {\n $rows: this.d_headerRows,\n $columns: this.d_headerColumns\n };\n },\n data: function data() {\n return {\n d_headerRows: new HelperSet({\n type: 'Row'\n }),\n d_headerColumns: new HelperSet({\n type: 'Column'\n })\n };\n },\n beforeUnmount: function beforeUnmount() {\n this.d_headerRows.clear();\n this.d_headerColumns.clear();\n },\n methods: {\n columnProp: function columnProp(col, prop) {\n return getVNodeProp(col, prop);\n },\n getColumnGroupPT: function getColumnGroupPT(key) {\n var _this$$parentInstance;\n var columnGroupMetaData = {\n props: this.getColumnGroupProps(),\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n },\n context: {\n type: 'header',\n scrollable: (_this$$parentInstance = this.$parentInstance) === null || _this$$parentInstance === void 0 || (_this$$parentInstance = _this$$parentInstance.$parentInstance) === null || _this$$parentInstance === void 0 ? void 0 : _this$$parentInstance.scrollable\n }\n };\n return mergeProps(this.ptm(\"columnGroup.\".concat(key), {\n columnGroup: columnGroupMetaData\n }), this.ptm(\"columnGroup.\".concat(key), columnGroupMetaData), this.ptmo(this.getColumnGroupProps(), key, columnGroupMetaData));\n },\n getColumnGroupProps: function getColumnGroupProps() {\n return this.columnGroup && this.columnGroup.props && this.columnGroup.props.pt ? this.columnGroup.props.pt : undefined; //@todo\n },\n getRowPT: function getRowPT(row, key, index) {\n var rowMetaData = {\n props: row.props,\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n },\n context: {\n index: index\n }\n };\n return mergeProps(this.ptm(\"row.\".concat(key), {\n row: rowMetaData\n }), this.ptm(\"row.\".concat(key), rowMetaData), this.ptmo(this.getRowProp(row), key, rowMetaData));\n },\n getRowProp: function getRowProp(row) {\n return row.props && row.props.pt ? row.props.pt : undefined; //@todo\n },\n getColumnPT: function getColumnPT(column, key, index) {\n var columnMetaData = {\n props: column.props,\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n },\n context: {\n index: index\n }\n };\n return mergeProps(this.ptm(\"column.\".concat(key), {\n column: columnMetaData\n }), this.ptm(\"column.\".concat(key), columnMetaData), this.ptmo(this.getColumnProp(column), key, columnMetaData));\n },\n getColumnProp: function getColumnProp(column) {\n return column.props && column.props.pt ? column.props.pt : undefined; //@todo\n },\n getFilterColumnHeaderClass: function getFilterColumnHeaderClass(column) {\n return [this.cx('headerCell', {\n column: column\n }), this.columnProp(column, 'filterHeaderClass'), this.columnProp(column, 'class')];\n },\n getFilterColumnHeaderStyle: function getFilterColumnHeaderStyle(column) {\n return [this.columnProp(column, 'filterHeaderStyle'), this.columnProp(column, 'style')];\n },\n getHeaderRows: function getHeaderRows() {\n var _this$d_headerRows;\n return (_this$d_headerRows = this.d_headerRows) === null || _this$d_headerRows === void 0 ? void 0 : _this$d_headerRows.get(this.columnGroup, this.columnGroup.children);\n },\n getHeaderColumns: function getHeaderColumns(row) {\n var _this$d_headerColumns;\n return (_this$d_headerColumns = this.d_headerColumns) === null || _this$d_headerColumns === void 0 ? void 0 : _this$d_headerColumns.get(row, row.children);\n }\n },\n computed: {\n ptmTHeadOptions: function ptmTHeadOptions() {\n var _this$$parentInstance2;\n return {\n context: {\n scrollable: (_this$$parentInstance2 = this.$parentInstance) === null || _this$$parentInstance2 === void 0 || (_this$$parentInstance2 = _this$$parentInstance2.$parentInstance) === null || _this$$parentInstance2 === void 0 ? void 0 : _this$$parentInstance2.scrollable\n }\n };\n }\n },\n components: {\n DTHeaderCell: script$2,\n DTHeaderCheckbox: script$3,\n DTColumnFilter: script$4\n }\n};\n\nfunction _typeof$2(o) { \"@babel/helpers - typeof\"; return _typeof$2 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof$2(o); }\nfunction ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty$2(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty$2(e, r, t) { return (r = _toPropertyKey$2(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey$2(t) { var i = _toPrimitive$2(t, \"string\"); return \"symbol\" == _typeof$2(i) ? i : i + \"\"; }\nfunction _toPrimitive$2(t, r) { if (\"object\" != _typeof$2(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof$2(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction render$1(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_DTHeaderCell = resolveComponent(\"DTHeaderCell\");\n var _component_DTHeaderCheckbox = resolveComponent(\"DTHeaderCheckbox\");\n var _component_DTColumnFilter = resolveComponent(\"DTColumnFilter\");\n return openBlock(), createElementBlock(\"thead\", mergeProps({\n \"class\": _ctx.cx('thead'),\n style: _ctx.sx('thead'),\n role: \"rowgroup\"\n }, $props.columnGroup ? _objectSpread$2(_objectSpread$2({}, _ctx.ptm('thead', $options.ptmTHeadOptions)), $options.getColumnGroupPT('root')) : _ctx.ptm('thead', $options.ptmTHeadOptions), {\n \"data-pc-section\": \"thead\"\n }), [!$props.columnGroup ? (openBlock(), createElementBlock(\"tr\", mergeProps({\n key: 0,\n role: \"row\"\n }, _ctx.ptm('headerRow')), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function (col, i) {\n return openBlock(), createElementBlock(Fragment, {\n key: $options.columnProp(col, 'columnKey') || $options.columnProp(col, 'field') || i\n }, [!$options.columnProp(col, 'hidden') && ($props.rowGroupMode !== 'subheader' || $props.groupRowsBy !== $options.columnProp(col, 'field')) ? (openBlock(), createBlock(_component_DTHeaderCell, {\n key: 0,\n column: col,\n index: i,\n onColumnClick: _cache[0] || (_cache[0] = function ($event) {\n return _ctx.$emit('column-click', $event);\n }),\n onColumnMousedown: _cache[1] || (_cache[1] = function ($event) {\n return _ctx.$emit('column-mousedown', $event);\n }),\n onColumnDragstart: _cache[2] || (_cache[2] = function ($event) {\n return _ctx.$emit('column-dragstart', $event);\n }),\n onColumnDragover: _cache[3] || (_cache[3] = function ($event) {\n return _ctx.$emit('column-dragover', $event);\n }),\n onColumnDragleave: _cache[4] || (_cache[4] = function ($event) {\n return _ctx.$emit('column-dragleave', $event);\n }),\n onColumnDrop: _cache[5] || (_cache[5] = function ($event) {\n return _ctx.$emit('column-drop', $event);\n }),\n groupRowsBy: $props.groupRowsBy,\n groupRowSortField: $props.groupRowSortField,\n reorderableColumns: $props.reorderableColumns,\n resizableColumns: $props.resizableColumns,\n onColumnResizestart: _cache[6] || (_cache[6] = function ($event) {\n return _ctx.$emit('column-resizestart', $event);\n }),\n sortMode: $props.sortMode,\n sortField: $props.sortField,\n sortOrder: $props.sortOrder,\n multiSortMeta: $props.multiSortMeta,\n allRowsSelected: $props.allRowsSelected,\n empty: $props.empty,\n onCheckboxChange: _cache[7] || (_cache[7] = function ($event) {\n return _ctx.$emit('checkbox-change', $event);\n }),\n filters: $props.filters,\n filterDisplay: $props.filterDisplay,\n filtersStore: $props.filtersStore,\n filterInputProps: $props.filterInputProps,\n filterButtonProps: $props.filterButtonProps,\n first: $props.first,\n onFilterChange: _cache[8] || (_cache[8] = function ($event) {\n return _ctx.$emit('filter-change', $event);\n }),\n onFilterApply: _cache[9] || (_cache[9] = function ($event) {\n return _ctx.$emit('filter-apply');\n }),\n onOperatorChange: _cache[10] || (_cache[10] = function ($event) {\n return _ctx.$emit('operator-change', $event);\n }),\n onMatchmodeChange: _cache[11] || (_cache[11] = function ($event) {\n return _ctx.$emit('matchmode-change', $event);\n }),\n onConstraintAdd: _cache[12] || (_cache[12] = function ($event) {\n return _ctx.$emit('constraint-add', $event);\n }),\n onConstraintRemove: _cache[13] || (_cache[13] = function ($event) {\n return _ctx.$emit('constraint-remove', $event);\n }),\n onApplyClick: _cache[14] || (_cache[14] = function ($event) {\n return _ctx.$emit('apply-click', $event);\n }),\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"column\", \"index\", \"groupRowsBy\", \"groupRowSortField\", \"reorderableColumns\", \"resizableColumns\", \"sortMode\", \"sortField\", \"sortOrder\", \"multiSortMeta\", \"allRowsSelected\", \"empty\", \"filters\", \"filterDisplay\", \"filtersStore\", \"filterInputProps\", \"filterButtonProps\", \"first\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true)], 64);\n }), 128))], 16)) : (openBlock(true), createElementBlock(Fragment, {\n key: 1\n }, renderList($options.getHeaderRows(), function (row, i) {\n return openBlock(), createElementBlock(\"tr\", mergeProps({\n key: i,\n role: \"row\",\n ref_for: true\n }, _objectSpread$2(_objectSpread$2({}, _ctx.ptm('headerRow')), $options.getRowPT(row, 'root', i))), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.getHeaderColumns(row), function (col, j) {\n return openBlock(), createElementBlock(Fragment, {\n key: $options.columnProp(col, 'columnKey') || $options.columnProp(col, 'field') || j\n }, [!$options.columnProp(col, 'hidden') && ($props.rowGroupMode !== 'subheader' || $props.groupRowsBy !== $options.columnProp(col, 'field')) && typeof col.children !== 'string' ? (openBlock(), createBlock(_component_DTHeaderCell, {\n key: 0,\n column: col,\n onColumnClick: _cache[15] || (_cache[15] = function ($event) {\n return _ctx.$emit('column-click', $event);\n }),\n onColumnMousedown: _cache[16] || (_cache[16] = function ($event) {\n return _ctx.$emit('column-mousedown', $event);\n }),\n groupRowsBy: $props.groupRowsBy,\n groupRowSortField: $props.groupRowSortField,\n sortMode: $props.sortMode,\n sortField: $props.sortField,\n sortOrder: $props.sortOrder,\n multiSortMeta: $props.multiSortMeta,\n allRowsSelected: $props.allRowsSelected,\n empty: $props.empty,\n onCheckboxChange: _cache[17] || (_cache[17] = function ($event) {\n return _ctx.$emit('checkbox-change', $event);\n }),\n filters: $props.filters,\n filterDisplay: $props.filterDisplay,\n filtersStore: $props.filtersStore,\n onFilterChange: _cache[18] || (_cache[18] = function ($event) {\n return _ctx.$emit('filter-change', $event);\n }),\n onFilterApply: _cache[19] || (_cache[19] = function ($event) {\n return _ctx.$emit('filter-apply');\n }),\n onOperatorChange: _cache[20] || (_cache[20] = function ($event) {\n return _ctx.$emit('operator-change', $event);\n }),\n onMatchmodeChange: _cache[21] || (_cache[21] = function ($event) {\n return _ctx.$emit('matchmode-change', $event);\n }),\n onConstraintAdd: _cache[22] || (_cache[22] = function ($event) {\n return _ctx.$emit('constraint-add', $event);\n }),\n onConstraintRemove: _cache[23] || (_cache[23] = function ($event) {\n return _ctx.$emit('constraint-remove', $event);\n }),\n onApplyClick: _cache[24] || (_cache[24] = function ($event) {\n return _ctx.$emit('apply-click', $event);\n }),\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"column\", \"groupRowsBy\", \"groupRowSortField\", \"sortMode\", \"sortField\", \"sortOrder\", \"multiSortMeta\", \"allRowsSelected\", \"empty\", \"filters\", \"filterDisplay\", \"filtersStore\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true)], 64);\n }), 128))], 16);\n }), 128)), $props.filterDisplay === 'row' ? (openBlock(), createElementBlock(\"tr\", mergeProps({\n key: 2,\n role: \"row\"\n }, _ctx.ptm('headerRow')), [(openBlock(true), createElementBlock(Fragment, null, renderList($props.columns, function (col, i) {\n return openBlock(), createElementBlock(Fragment, {\n key: $options.columnProp(col, 'columnKey') || $options.columnProp(col, 'field') || i\n }, [!$options.columnProp(col, 'hidden') && ($props.rowGroupMode !== 'subheader' || $props.groupRowsBy !== $options.columnProp(col, 'field')) ? (openBlock(), createElementBlock(\"th\", mergeProps({\n key: 0,\n style: $options.getFilterColumnHeaderStyle(col),\n \"class\": $options.getFilterColumnHeaderClass(col),\n ref_for: true\n }, _objectSpread$2(_objectSpread$2({}, $options.getColumnPT(col, 'root', i)), $options.getColumnPT(col, 'headerCell', i))), [$options.columnProp(col, 'selectionMode') === 'multiple' ? (openBlock(), createBlock(_component_DTHeaderCheckbox, {\n key: 0,\n checked: $props.allRowsSelected,\n disabled: $props.empty,\n onChange: _cache[25] || (_cache[25] = function ($event) {\n return _ctx.$emit('checkbox-change', $event);\n }),\n column: col,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"checked\", \"disabled\", \"column\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true), col.children && col.children.filter ? (openBlock(), createBlock(_component_DTColumnFilter, {\n key: 1,\n field: $options.columnProp(col, 'filterField') || $options.columnProp(col, 'field'),\n type: $options.columnProp(col, 'dataType'),\n display: \"row\",\n showMenu: $options.columnProp(col, 'showFilterMenu'),\n filterElement: col.children && col.children.filter,\n filterHeaderTemplate: col.children && col.children.filterheader,\n filterFooterTemplate: col.children && col.children.filterfooter,\n filterClearTemplate: col.children && col.children.filterclear,\n filterApplyTemplate: col.children && col.children.filterapply,\n filterIconTemplate: col.children && col.children.filtericon,\n filterAddIconTemplate: col.children && col.children.filteraddicon,\n filterRemoveIconTemplate: col.children && col.children.filterremoveicon,\n filterClearIconTemplate: col.children && col.children.filterclearicon,\n filters: $props.filters,\n filtersStore: $props.filtersStore,\n filterInputProps: $props.filterInputProps,\n filterButtonProps: $props.filterButtonProps,\n onFilterChange: _cache[26] || (_cache[26] = function ($event) {\n return _ctx.$emit('filter-change', $event);\n }),\n onFilterApply: _cache[27] || (_cache[27] = function ($event) {\n return _ctx.$emit('filter-apply');\n }),\n filterMenuStyle: $options.columnProp(col, 'filterMenuStyle'),\n filterMenuClass: $options.columnProp(col, 'filterMenuClass'),\n showOperator: $options.columnProp(col, 'showFilterOperator'),\n showClearButton: $options.columnProp(col, 'showClearButton'),\n showApplyButton: $options.columnProp(col, 'showApplyButton'),\n showMatchModes: $options.columnProp(col, 'showFilterMatchModes'),\n showAddButton: $options.columnProp(col, 'showAddButton'),\n matchModeOptions: $options.columnProp(col, 'filterMatchModeOptions'),\n maxConstraints: $options.columnProp(col, 'maxConstraints'),\n onOperatorChange: _cache[28] || (_cache[28] = function ($event) {\n return _ctx.$emit('operator-change', $event);\n }),\n onMatchmodeChange: _cache[29] || (_cache[29] = function ($event) {\n return _ctx.$emit('matchmode-change', $event);\n }),\n onConstraintAdd: _cache[30] || (_cache[30] = function ($event) {\n return _ctx.$emit('constraint-add', $event);\n }),\n onConstraintRemove: _cache[31] || (_cache[31] = function ($event) {\n return _ctx.$emit('constraint-remove', $event);\n }),\n onApplyClick: _cache[32] || (_cache[32] = function ($event) {\n return _ctx.$emit('apply-click', $event);\n }),\n column: col,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"field\", \"type\", \"showMenu\", \"filterElement\", \"filterHeaderTemplate\", \"filterFooterTemplate\", \"filterClearTemplate\", \"filterApplyTemplate\", \"filterIconTemplate\", \"filterAddIconTemplate\", \"filterRemoveIconTemplate\", \"filterClearIconTemplate\", \"filters\", \"filtersStore\", \"filterInputProps\", \"filterButtonProps\", \"filterMenuStyle\", \"filterMenuClass\", \"showOperator\", \"showClearButton\", \"showApplyButton\", \"showMatchModes\", \"showAddButton\", \"matchModeOptions\", \"maxConstraints\", \"column\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true)], 16)) : createCommentVNode(\"\", true)], 64);\n }), 128))], 16)) : createCommentVNode(\"\", true)], 16);\n}\n\nscript$1.render = render$1;\n\nfunction _typeof$1(o) { \"@babel/helpers - typeof\"; return _typeof$1 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof$1(o); }\nvar _excluded = [\"expanded\"];\nfunction _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }\nfunction _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }\nfunction ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty$1(e, r, t) { return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey$1(t) { var i = _toPrimitive$1(t, \"string\"); return \"symbol\" == _typeof$1(i) ? i : i + \"\"; }\nfunction _toPrimitive$1(t, r) { if (\"object\" != _typeof$1(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof$1(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nvar script = {\n name: 'DataTable',\n \"extends\": script$c,\n inheritAttrs: false,\n emits: ['value-change', 'update:first', 'update:rows', 'page', 'update:sortField', 'update:sortOrder', 'update:multiSortMeta', 'sort', 'filter', 'row-click', 'row-dblclick', 'update:selection', 'row-select', 'row-unselect', 'update:contextMenuSelection', 'row-contextmenu', 'row-unselect-all', 'row-select-all', 'select-all-change', 'column-resize-end', 'column-reorder', 'row-reorder', 'update:expandedRows', 'row-collapse', 'row-expand', 'update:expandedRowGroups', 'rowgroup-collapse', 'rowgroup-expand', 'update:filters', 'state-restore', 'state-save', 'cell-edit-init', 'cell-edit-complete', 'cell-edit-cancel', 'update:editingRows', 'row-edit-init', 'row-edit-save', 'row-edit-cancel'],\n provide: function provide() {\n return {\n $columns: this.d_columns,\n $columnGroups: this.d_columnGroups\n };\n },\n data: function data() {\n return {\n d_first: this.first,\n d_rows: this.rows,\n d_sortField: this.sortField,\n d_sortOrder: this.sortOrder,\n d_nullSortOrder: this.nullSortOrder,\n d_multiSortMeta: this.multiSortMeta ? _toConsumableArray(this.multiSortMeta) : [],\n d_groupRowsSortMeta: null,\n d_selectionKeys: null,\n d_columnOrder: null,\n d_editingRowKeys: null,\n d_editingMeta: {},\n d_filters: this.cloneFilters(this.filters),\n d_columns: new HelperSet({\n type: 'Column'\n }),\n d_columnGroups: new HelperSet({\n type: 'ColumnGroup'\n })\n };\n },\n rowTouched: false,\n anchorRowIndex: null,\n rangeRowIndex: null,\n documentColumnResizeListener: null,\n documentColumnResizeEndListener: null,\n lastResizeHelperX: null,\n resizeColumnElement: null,\n columnResizing: false,\n colReorderIconWidth: null,\n colReorderIconHeight: null,\n draggedColumn: null,\n draggedColumnElement: null,\n draggedRowIndex: null,\n droppedRowIndex: null,\n rowDragging: null,\n columnWidthsState: null,\n tableWidthState: null,\n columnWidthsRestored: false,\n watch: {\n first: function first(newValue) {\n this.d_first = newValue;\n },\n rows: function rows(newValue) {\n this.d_rows = newValue;\n },\n sortField: function sortField(newValue) {\n this.d_sortField = newValue;\n },\n sortOrder: function sortOrder(newValue) {\n this.d_sortOrder = newValue;\n },\n nullSortOrder: function nullSortOrder(newValue) {\n this.d_nullSortOrder = newValue;\n },\n multiSortMeta: function multiSortMeta(newValue) {\n this.d_multiSortMeta = newValue;\n },\n selection: {\n immediate: true,\n handler: function handler(newValue) {\n if (this.dataKey) {\n this.updateSelectionKeys(newValue);\n }\n }\n },\n editingRows: {\n immediate: true,\n handler: function handler(newValue) {\n if (this.dataKey) {\n this.updateEditingRowKeys(newValue);\n }\n }\n },\n filters: {\n deep: true,\n handler: function handler(newValue) {\n this.d_filters = this.cloneFilters(newValue);\n }\n }\n },\n mounted: function mounted() {\n if (this.isStateful()) {\n this.restoreState();\n this.resizableColumns && this.restoreColumnWidths();\n }\n if (this.editMode === 'row' && this.dataKey && !this.d_editingRowKeys) {\n this.updateEditingRowKeys(this.editingRows);\n }\n },\n beforeUnmount: function beforeUnmount() {\n this.unbindColumnResizeEvents();\n this.destroyStyleElement();\n this.d_columns.clear();\n this.d_columnGroups.clear();\n },\n updated: function updated() {\n if (this.isStateful()) {\n this.saveState();\n }\n if (this.editMode === 'row' && this.dataKey && !this.d_editingRowKeys) {\n this.updateEditingRowKeys(this.editingRows);\n }\n },\n methods: {\n columnProp: function columnProp(col, prop) {\n return getVNodeProp(col, prop);\n },\n onPage: function onPage(event) {\n var _this = this;\n this.clearEditingMetaData();\n this.d_first = event.first;\n this.d_rows = event.rows;\n var pageEvent = this.createLazyLoadEvent(event);\n pageEvent.pageCount = event.pageCount;\n pageEvent.page = event.page;\n this.$emit('update:first', this.d_first);\n this.$emit('update:rows', this.d_rows);\n this.$emit('page', pageEvent);\n this.$nextTick(function () {\n _this.$emit('value-change', _this.processedData);\n });\n },\n onColumnHeaderClick: function onColumnHeaderClick(e) {\n var _this2 = this;\n var event = e.originalEvent;\n var column = e.column;\n if (this.columnProp(column, 'sortable')) {\n var targetNode = event.target;\n var columnField = this.columnProp(column, 'sortField') || this.columnProp(column, 'field');\n if (getAttribute(targetNode, 'data-p-sortable-column') === true || getAttribute(targetNode, 'data-pc-section') === 'columntitle' || getAttribute(targetNode, 'data-pc-section') === 'columnheadercontent' || getAttribute(targetNode, 'data-pc-section') === 'sorticon' || getAttribute(targetNode.parentElement, 'data-pc-section') === 'sorticon' || getAttribute(targetNode.parentElement.parentElement, 'data-pc-section') === 'sorticon' || targetNode.closest('[data-p-sortable-column=\"true\"]') && !targetNode.closest('[data-pc-section=\"columnfilterbutton\"]') && !isClickable(event.target)) {\n clearSelection();\n if (this.sortMode === 'single') {\n if (this.d_sortField === columnField) {\n if (this.removableSort && this.d_sortOrder * -1 === this.defaultSortOrder) {\n this.d_sortOrder = null;\n this.d_sortField = null;\n } else {\n this.d_sortOrder = this.d_sortOrder * -1;\n }\n } else {\n this.d_sortOrder = this.defaultSortOrder;\n this.d_sortField = columnField;\n }\n this.$emit('update:sortField', this.d_sortField);\n this.$emit('update:sortOrder', this.d_sortOrder);\n this.resetPage();\n } else if (this.sortMode === 'multiple') {\n var metaKey = event.metaKey || event.ctrlKey;\n if (!metaKey) {\n this.d_multiSortMeta = this.d_multiSortMeta.filter(function (meta) {\n return meta.field === columnField;\n });\n }\n this.addMultiSortField(columnField);\n this.$emit('update:multiSortMeta', this.d_multiSortMeta);\n }\n this.$emit('sort', this.createLazyLoadEvent(event));\n this.$nextTick(function () {\n _this2.$emit('value-change', _this2.processedData);\n });\n }\n }\n },\n sortSingle: function sortSingle(value) {\n var _this3 = this;\n this.clearEditingMetaData();\n if (this.groupRowsBy && this.groupRowsBy === this.sortField) {\n this.d_multiSortMeta = [{\n field: this.sortField,\n order: this.sortOrder || this.defaultSortOrder\n }, {\n field: this.d_sortField,\n order: this.d_sortOrder\n }];\n return this.sortMultiple(value);\n }\n var data = _toConsumableArray(value);\n var resolvedFieldData = new Map();\n var _iterator = _createForOfIteratorHelper(data),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var item = _step.value;\n resolvedFieldData.set(item, resolveFieldData(item, this.d_sortField));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n var comparer = localeComparator();\n data.sort(function (data1, data2) {\n var value1 = resolvedFieldData.get(data1);\n var value2 = resolvedFieldData.get(data2);\n return sort(value1, value2, _this3.d_sortOrder, comparer, _this3.d_nullSortOrder);\n });\n return data;\n },\n sortMultiple: function sortMultiple(value) {\n var _this4 = this;\n this.clearEditingMetaData();\n if (this.groupRowsBy && (this.d_groupRowsSortMeta || this.d_multiSortMeta.length && this.groupRowsBy === this.d_multiSortMeta[0].field)) {\n var firstSortMeta = this.d_multiSortMeta[0];\n !this.d_groupRowsSortMeta && (this.d_groupRowsSortMeta = firstSortMeta);\n if (firstSortMeta.field !== this.d_groupRowsSortMeta.field) {\n this.d_multiSortMeta = [this.d_groupRowsSortMeta].concat(_toConsumableArray(this.d_multiSortMeta));\n }\n }\n var data = _toConsumableArray(value);\n data.sort(function (data1, data2) {\n return _this4.multisortField(data1, data2, 0);\n });\n return data;\n },\n multisortField: function multisortField(data1, data2, index) {\n var value1 = resolveFieldData(data1, this.d_multiSortMeta[index].field);\n var value2 = resolveFieldData(data2, this.d_multiSortMeta[index].field);\n var comparer = localeComparator();\n if (value1 === value2) {\n return this.d_multiSortMeta.length - 1 > index ? this.multisortField(data1, data2, index + 1) : 0;\n }\n return sort(value1, value2, this.d_multiSortMeta[index].order, comparer, this.d_nullSortOrder);\n },\n addMultiSortField: function addMultiSortField(field) {\n var index = this.d_multiSortMeta.findIndex(function (meta) {\n return meta.field === field;\n });\n if (index >= 0) {\n if (this.removableSort && this.d_multiSortMeta[index].order * -1 === this.defaultSortOrder) this.d_multiSortMeta.splice(index, 1);else this.d_multiSortMeta[index] = {\n field: field,\n order: this.d_multiSortMeta[index].order * -1\n };\n } else {\n this.d_multiSortMeta.push({\n field: field,\n order: this.defaultSortOrder\n });\n }\n this.d_multiSortMeta = _toConsumableArray(this.d_multiSortMeta);\n },\n getActiveFilters: function getActiveFilters(filters) {\n var removeEmptyFilters = function removeEmptyFilters(_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n if (value.constraints) {\n var filteredConstraints = value.constraints.filter(function (constraint) {\n return constraint.value !== null;\n });\n if (filteredConstraints.length > 0) {\n return [key, _objectSpread$1(_objectSpread$1({}, value), {}, {\n constraints: filteredConstraints\n })];\n }\n } else if (value.value !== null) {\n return [key, value];\n }\n return undefined;\n };\n var filterValidEntries = function filterValidEntries(entry) {\n return entry !== undefined;\n };\n var entries = Object.entries(filters).map(removeEmptyFilters).filter(filterValidEntries);\n return Object.fromEntries(entries);\n },\n filter: function filter(data) {\n var _this5 = this;\n if (!data) {\n return;\n }\n this.clearEditingMetaData();\n var activeFilters = this.getActiveFilters(this.filters);\n var globalFilterFieldsArray;\n if (activeFilters['global']) {\n globalFilterFieldsArray = this.globalFilterFields || this.columns.map(function (col) {\n return _this5.columnProp(col, 'filterField') || _this5.columnProp(col, 'field');\n });\n }\n var filteredValue = [];\n for (var i = 0; i < data.length; i++) {\n var localMatch = true;\n var globalMatch = false;\n var localFiltered = false;\n for (var prop in activeFilters) {\n if (Object.prototype.hasOwnProperty.call(activeFilters, prop) && prop !== 'global') {\n localFiltered = true;\n var filterField = prop;\n var filterMeta = activeFilters[filterField];\n if (filterMeta.operator) {\n var _iterator2 = _createForOfIteratorHelper(filterMeta.constraints),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var filterConstraint = _step2.value;\n localMatch = this.executeLocalFilter(filterField, data[i], filterConstraint);\n if (filterMeta.operator === FilterOperator.OR && localMatch || filterMeta.operator === FilterOperator.AND && !localMatch) {\n break;\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n } else {\n localMatch = this.executeLocalFilter(filterField, data[i], filterMeta);\n }\n if (!localMatch) {\n break;\n }\n }\n }\n if (localMatch && activeFilters['global'] && !globalMatch && globalFilterFieldsArray) {\n for (var j = 0; j < globalFilterFieldsArray.length; j++) {\n var globalFilterField = globalFilterFieldsArray[j];\n globalMatch = FilterService.filters[activeFilters['global'].matchMode || FilterMatchMode.CONTAINS](resolveFieldData(data[i], globalFilterField), activeFilters['global'].value, this.filterLocale);\n if (globalMatch) {\n break;\n }\n }\n }\n var matches = void 0;\n if (activeFilters['global']) {\n matches = localFiltered ? localFiltered && localMatch && globalMatch : globalMatch;\n } else {\n matches = localFiltered && localMatch;\n }\n if (matches) {\n filteredValue.push(data[i]);\n }\n }\n if (filteredValue.length === this.value.length || Object.keys(activeFilters).length == 0) {\n filteredValue = data;\n }\n var filterEvent = this.createLazyLoadEvent();\n filterEvent.filteredValue = filteredValue;\n this.$emit('filter', filterEvent);\n this.$nextTick(function () {\n _this5.$emit('value-change', _this5.processedData);\n });\n return filteredValue;\n },\n executeLocalFilter: function executeLocalFilter(field, rowData, filterMeta) {\n var filterValue = filterMeta.value;\n var filterMatchMode = filterMeta.matchMode || FilterMatchMode.STARTS_WITH;\n var dataFieldValue = resolveFieldData(rowData, field);\n var filterConstraint = FilterService.filters[filterMatchMode];\n return filterConstraint(dataFieldValue, filterValue, this.filterLocale);\n },\n onRowClick: function onRowClick(e) {\n var event = e.originalEvent;\n var body = this.$refs.bodyRef && this.$refs.bodyRef.$el;\n var focusedItem = findSingle(body, 'tr[data-p-selectable-row=\"true\"][tabindex=\"0\"]');\n if (isClickable(event.target)) {\n return;\n }\n this.$emit('row-click', e);\n if (this.selectionMode) {\n var rowData = e.data;\n var rowIndex = this.d_first + e.index;\n if (this.isMultipleSelectionMode() && event.shiftKey && this.anchorRowIndex != null) {\n clearSelection();\n this.rangeRowIndex = rowIndex;\n this.selectRange(event);\n } else {\n var selected = this.isSelected(rowData);\n var metaSelection = this.rowTouched ? false : this.metaKeySelection;\n this.anchorRowIndex = rowIndex;\n this.rangeRowIndex = rowIndex;\n if (metaSelection) {\n var metaKey = event.metaKey || event.ctrlKey;\n if (selected && metaKey) {\n if (this.isSingleSelectionMode()) {\n this.$emit('update:selection', null);\n } else {\n var selectionIndex = this.findIndexInSelection(rowData);\n var _selection = this.selection.filter(function (val, i) {\n return i != selectionIndex;\n });\n this.$emit('update:selection', _selection);\n }\n this.$emit('row-unselect', {\n originalEvent: event,\n data: rowData,\n index: rowIndex,\n type: 'row'\n });\n } else {\n if (this.isSingleSelectionMode()) {\n this.$emit('update:selection', rowData);\n } else if (this.isMultipleSelectionMode()) {\n var _selection2 = metaKey ? this.selection || [] : [];\n _selection2 = [].concat(_toConsumableArray(_selection2), [rowData]);\n this.$emit('update:selection', _selection2);\n }\n this.$emit('row-select', {\n originalEvent: event,\n data: rowData,\n index: rowIndex,\n type: 'row'\n });\n }\n } else {\n if (this.selectionMode === 'single') {\n if (selected) {\n this.$emit('update:selection', null);\n this.$emit('row-unselect', {\n originalEvent: event,\n data: rowData,\n index: rowIndex,\n type: 'row'\n });\n } else {\n this.$emit('update:selection', rowData);\n this.$emit('row-select', {\n originalEvent: event,\n data: rowData,\n index: rowIndex,\n type: 'row'\n });\n }\n } else if (this.selectionMode === 'multiple') {\n if (selected) {\n var _selectionIndex = this.findIndexInSelection(rowData);\n var _selection3 = this.selection.filter(function (val, i) {\n return i != _selectionIndex;\n });\n this.$emit('update:selection', _selection3);\n this.$emit('row-unselect', {\n originalEvent: event,\n data: rowData,\n index: rowIndex,\n type: 'row'\n });\n } else {\n var _selection4 = this.selection ? [].concat(_toConsumableArray(this.selection), [rowData]) : [rowData];\n this.$emit('update:selection', _selection4);\n this.$emit('row-select', {\n originalEvent: event,\n data: rowData,\n index: rowIndex,\n type: 'row'\n });\n }\n }\n }\n }\n }\n this.rowTouched = false;\n if (focusedItem) {\n var _event$target, _event$currentTarget;\n if (((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.getAttribute('data-pc-section')) === 'rowtoggleicon') return;\n var targetRow = (_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.closest('tr[data-p-selectable-row=\"true\"]');\n focusedItem.tabIndex = '-1';\n if (targetRow) targetRow.tabIndex = '0';\n }\n },\n onRowDblClick: function onRowDblClick(e) {\n var event = e.originalEvent;\n if (isClickable(event.target)) {\n return;\n }\n this.$emit('row-dblclick', e);\n },\n onRowRightClick: function onRowRightClick(event) {\n if (this.contextMenu) {\n clearSelection();\n event.originalEvent.target.focus();\n }\n this.$emit('update:contextMenuSelection', event.data);\n this.$emit('row-contextmenu', event);\n },\n onRowTouchEnd: function onRowTouchEnd() {\n this.rowTouched = true;\n },\n onRowKeyDown: function onRowKeyDown(e, slotProps) {\n var event = e.originalEvent;\n var rowData = e.data;\n var rowIndex = e.index;\n var metaKey = event.metaKey || event.ctrlKey;\n if (this.selectionMode) {\n var row = event.target;\n switch (event.code) {\n case 'ArrowDown':\n this.onArrowDownKey(event, row, rowIndex, slotProps);\n break;\n case 'ArrowUp':\n this.onArrowUpKey(event, row, rowIndex, slotProps);\n break;\n case 'Home':\n this.onHomeKey(event, row, rowIndex, slotProps);\n break;\n case 'End':\n this.onEndKey(event, row, rowIndex, slotProps);\n break;\n case 'Enter':\n case 'NumpadEnter':\n this.onEnterKey(event, rowData, rowIndex);\n break;\n case 'Space':\n this.onSpaceKey(event, rowData, rowIndex, slotProps);\n break;\n case 'Tab':\n this.onTabKey(event, rowIndex);\n break;\n default:\n if (event.code === 'KeyA' && metaKey && this.isMultipleSelectionMode()) {\n var data = this.dataToRender(slotProps.rows);\n this.$emit('update:selection', data);\n }\n event.preventDefault();\n break;\n }\n }\n },\n onArrowDownKey: function onArrowDownKey(event, row, rowIndex, slotProps) {\n var nextRow = this.findNextSelectableRow(row);\n nextRow && this.focusRowChange(row, nextRow);\n if (event.shiftKey) {\n var data = this.dataToRender(slotProps.rows);\n var nextRowIndex = rowIndex + 1 >= data.length ? data.length - 1 : rowIndex + 1;\n this.onRowClick({\n originalEvent: event,\n data: data[nextRowIndex],\n index: nextRowIndex\n });\n }\n event.preventDefault();\n },\n onArrowUpKey: function onArrowUpKey(event, row, rowIndex, slotProps) {\n var prevRow = this.findPrevSelectableRow(row);\n prevRow && this.focusRowChange(row, prevRow);\n if (event.shiftKey) {\n var data = this.dataToRender(slotProps.rows);\n var prevRowIndex = rowIndex - 1 <= 0 ? 0 : rowIndex - 1;\n this.onRowClick({\n originalEvent: event,\n data: data[prevRowIndex],\n index: prevRowIndex\n });\n }\n event.preventDefault();\n },\n onHomeKey: function onHomeKey(event, row, rowIndex, slotProps) {\n var firstRow = this.findFirstSelectableRow();\n firstRow && this.focusRowChange(row, firstRow);\n if (event.ctrlKey && event.shiftKey) {\n var data = this.dataToRender(slotProps.rows);\n this.$emit('update:selection', data.slice(0, rowIndex + 1));\n }\n event.preventDefault();\n },\n onEndKey: function onEndKey(event, row, rowIndex, slotProps) {\n var lastRow = this.findLastSelectableRow();\n lastRow && this.focusRowChange(row, lastRow);\n if (event.ctrlKey && event.shiftKey) {\n var data = this.dataToRender(slotProps.rows);\n this.$emit('update:selection', data.slice(rowIndex, data.length));\n }\n event.preventDefault();\n },\n onEnterKey: function onEnterKey(event, rowData, rowIndex) {\n this.onRowClick({\n originalEvent: event,\n data: rowData,\n index: rowIndex\n });\n event.preventDefault();\n },\n onSpaceKey: function onSpaceKey(event, rowData, rowIndex, slotProps) {\n this.onEnterKey(event, rowData, rowIndex);\n if (event.shiftKey && this.selection !== null) {\n var data = this.dataToRender(slotProps.rows);\n var index;\n if (this.selection.length > 0) {\n var firstSelectedRowIndex, lastSelectedRowIndex;\n firstSelectedRowIndex = findIndexInList(this.selection[0], data);\n lastSelectedRowIndex = findIndexInList(this.selection[this.selection.length - 1], data);\n index = rowIndex <= firstSelectedRowIndex ? lastSelectedRowIndex : firstSelectedRowIndex;\n } else {\n index = findIndexInList(this.selection, data);\n }\n var _selection = index !== rowIndex ? data.slice(Math.min(index, rowIndex), Math.max(index, rowIndex) + 1) : rowData;\n this.$emit('update:selection', _selection);\n }\n },\n onTabKey: function onTabKey(event, rowIndex) {\n var body = this.$refs.bodyRef && this.$refs.bodyRef.$el;\n var rows = find(body, 'tr[data-p-selectable-row=\"true\"]');\n if (event.code === 'Tab' && rows && rows.length > 0) {\n var firstSelectedRow = findSingle(body, 'tr[data-p-selected=\"true\"]');\n var focusedItem = findSingle(body, 'tr[data-p-selectable-row=\"true\"][tabindex=\"0\"]');\n if (firstSelectedRow) {\n firstSelectedRow.tabIndex = '0';\n focusedItem && focusedItem !== firstSelectedRow && (focusedItem.tabIndex = '-1');\n } else {\n rows[0].tabIndex = '0';\n focusedItem !== rows[0] && (rows[rowIndex].tabIndex = '-1');\n }\n }\n },\n findNextSelectableRow: function findNextSelectableRow(row) {\n var nextRow = row.nextElementSibling;\n if (nextRow) {\n if (getAttribute(nextRow, 'data-p-selectable-row') === true) return nextRow;else return this.findNextSelectableRow(nextRow);\n } else {\n return null;\n }\n },\n findPrevSelectableRow: function findPrevSelectableRow(row) {\n var prevRow = row.previousElementSibling;\n if (prevRow) {\n if (getAttribute(prevRow, 'data-p-selectable-row') === true) return prevRow;else return this.findPrevSelectableRow(prevRow);\n } else {\n return null;\n }\n },\n findFirstSelectableRow: function findFirstSelectableRow() {\n var firstRow = findSingle(this.$refs.table, 'tr[data-p-selectable-row=\"true\"]');\n return firstRow;\n },\n findLastSelectableRow: function findLastSelectableRow() {\n var rows = find(this.$refs.table, 'tr[data-p-selectable-row=\"true\"]');\n return rows ? rows[rows.length - 1] : null;\n },\n focusRowChange: function focusRowChange(firstFocusableRow, currentFocusedRow) {\n firstFocusableRow.tabIndex = '-1';\n currentFocusedRow.tabIndex = '0';\n focus(currentFocusedRow);\n },\n toggleRowWithRadio: function toggleRowWithRadio(event) {\n var rowData = event.data;\n if (this.isSelected(rowData)) {\n this.$emit('update:selection', null);\n this.$emit('row-unselect', {\n originalEvent: event.originalEvent,\n data: rowData,\n index: event.index,\n type: 'radiobutton'\n });\n } else {\n this.$emit('update:selection', rowData);\n this.$emit('row-select', {\n originalEvent: event.originalEvent,\n data: rowData,\n index: event.index,\n type: 'radiobutton'\n });\n }\n },\n toggleRowWithCheckbox: function toggleRowWithCheckbox(event) {\n var rowData = event.data;\n if (this.isSelected(rowData)) {\n var selectionIndex = this.findIndexInSelection(rowData);\n var _selection = this.selection.filter(function (val, i) {\n return i != selectionIndex;\n });\n this.$emit('update:selection', _selection);\n this.$emit('row-unselect', {\n originalEvent: event.originalEvent,\n data: rowData,\n index: event.index,\n type: 'checkbox'\n });\n } else {\n var _selection5 = this.selection ? _toConsumableArray(this.selection) : [];\n _selection5 = [].concat(_toConsumableArray(_selection5), [rowData]);\n this.$emit('update:selection', _selection5);\n this.$emit('row-select', {\n originalEvent: event.originalEvent,\n data: rowData,\n index: event.index,\n type: 'checkbox'\n });\n }\n },\n toggleRowsWithCheckbox: function toggleRowsWithCheckbox(event) {\n if (this.selectAll !== null) {\n this.$emit('select-all-change', event);\n } else {\n var originalEvent = event.originalEvent,\n checked = event.checked;\n var _selection = [];\n if (checked) {\n _selection = this.frozenValue ? [].concat(_toConsumableArray(this.frozenValue), _toConsumableArray(this.processedData)) : this.processedData;\n this.$emit('row-select-all', {\n originalEvent: originalEvent,\n data: _selection\n });\n } else {\n this.$emit('row-unselect-all', {\n originalEvent: originalEvent\n });\n }\n this.$emit('update:selection', _selection);\n }\n },\n isSingleSelectionMode: function isSingleSelectionMode() {\n return this.selectionMode === 'single';\n },\n isMultipleSelectionMode: function isMultipleSelectionMode() {\n return this.selectionMode === 'multiple';\n },\n isSelected: function isSelected(rowData) {\n if (rowData && this.selection) {\n if (this.dataKey) {\n return this.d_selectionKeys ? this.d_selectionKeys[resolveFieldData(rowData, this.dataKey)] !== undefined : false;\n } else {\n if (this.selection instanceof Array) return this.findIndexInSelection(rowData) > -1;else return this.equals(rowData, this.selection);\n }\n }\n return false;\n },\n findIndexInSelection: function findIndexInSelection(rowData) {\n return this.findIndex(rowData, this.selection);\n },\n findIndex: function findIndex(rowData, collection) {\n var index = -1;\n if (collection && collection.length) {\n for (var i = 0; i < collection.length; i++) {\n if (this.equals(rowData, collection[i])) {\n index = i;\n break;\n }\n }\n }\n return index;\n },\n updateSelectionKeys: function updateSelectionKeys(selection) {\n this.d_selectionKeys = {};\n if (Array.isArray(selection)) {\n var _iterator3 = _createForOfIteratorHelper(selection),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var data = _step3.value;\n this.d_selectionKeys[String(resolveFieldData(data, this.dataKey))] = 1;\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n } else {\n this.d_selectionKeys[String(resolveFieldData(selection, this.dataKey))] = 1;\n }\n },\n updateEditingRowKeys: function updateEditingRowKeys(editingRows) {\n if (editingRows && editingRows.length) {\n this.d_editingRowKeys = {};\n var _iterator4 = _createForOfIteratorHelper(editingRows),\n _step4;\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var data = _step4.value;\n this.d_editingRowKeys[String(resolveFieldData(data, this.dataKey))] = 1;\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n } else {\n this.d_editingRowKeys = null;\n }\n },\n equals: function equals$1(data1, data2) {\n return this.compareSelectionBy === 'equals' ? data1 === data2 : equals(data1, data2, this.dataKey);\n },\n selectRange: function selectRange(event) {\n var rangeStart, rangeEnd;\n if (this.rangeRowIndex > this.anchorRowIndex) {\n rangeStart = this.anchorRowIndex;\n rangeEnd = this.rangeRowIndex;\n } else if (this.rangeRowIndex < this.anchorRowIndex) {\n rangeStart = this.rangeRowIndex;\n rangeEnd = this.anchorRowIndex;\n } else {\n rangeStart = this.rangeRowIndex;\n rangeEnd = this.rangeRowIndex;\n }\n if (this.lazy && this.paginator) {\n rangeStart -= this.first;\n rangeEnd -= this.first;\n }\n var value = this.processedData;\n var _selection = [];\n for (var i = rangeStart; i <= rangeEnd; i++) {\n var rangeRowData = value[i];\n _selection.push(rangeRowData);\n this.$emit('row-select', {\n originalEvent: event,\n data: rangeRowData,\n type: 'row'\n });\n }\n this.$emit('update:selection', _selection);\n },\n exportCSV: function exportCSV$1(options, data) {\n var _this6 = this;\n var csv = \"\\uFEFF\";\n if (!data) {\n data = this.processedData;\n if (options && options.selectionOnly) data = this.selection || [];else if (this.frozenValue) data = data ? [].concat(_toConsumableArray(this.frozenValue), _toConsumableArray(data)) : this.frozenValue;\n }\n\n //headers\n var headerInitiated = false;\n for (var i = 0; i < this.columns.length; i++) {\n var column = this.columns[i];\n if (this.columnProp(column, 'exportable') !== false && this.columnProp(column, 'field')) {\n if (headerInitiated) csv += this.csvSeparator;else headerInitiated = true;\n csv += '\"' + (this.columnProp(column, 'exportHeader') || this.columnProp(column, 'header') || this.columnProp(column, 'field')) + '\"';\n }\n }\n\n //body\n if (data) {\n data.forEach(function (record) {\n csv += '\\n';\n var rowInitiated = false;\n for (var _i = 0; _i < _this6.columns.length; _i++) {\n var _column = _this6.columns[_i];\n if (_this6.columnProp(_column, 'exportable') !== false && _this6.columnProp(_column, 'field')) {\n if (rowInitiated) csv += _this6.csvSeparator;else rowInitiated = true;\n var cellData = resolveFieldData(record, _this6.columnProp(_column, 'field'));\n if (cellData != null) {\n if (_this6.exportFunction) {\n cellData = _this6.exportFunction({\n data: cellData,\n field: _this6.columnProp(_column, 'field')\n });\n } else cellData = String(cellData).replace(/\"/g, '\"\"');\n } else cellData = '';\n csv += '\"' + cellData + '\"';\n }\n }\n });\n }\n\n //footers\n var footerInitiated = false;\n for (var _i2 = 0; _i2 < this.columns.length; _i2++) {\n var _column2 = this.columns[_i2];\n if (_i2 === 0) csv += '\\n';\n if (this.columnProp(_column2, 'exportable') !== false && this.columnProp(_column2, 'exportFooter')) {\n if (footerInitiated) csv += this.csvSeparator;else footerInitiated = true;\n csv += '\"' + (this.columnProp(_column2, 'exportFooter') || this.columnProp(_column2, 'footer') || this.columnProp(_column2, 'field')) + '\"';\n }\n }\n exportCSV(csv, this.exportFilename);\n },\n resetPage: function resetPage() {\n this.d_first = 0;\n this.$emit('update:first', this.d_first);\n },\n onColumnResizeStart: function onColumnResizeStart(event) {\n var containerLeft = getOffset(this.$el).left;\n this.resizeColumnElement = event.target.parentElement;\n this.columnResizing = true;\n this.lastResizeHelperX = event.pageX - containerLeft + this.$el.scrollLeft;\n this.bindColumnResizeEvents();\n },\n onColumnResize: function onColumnResize(event) {\n var containerLeft = getOffset(this.$el).left;\n this.$el.setAttribute('data-p-unselectable-text', 'true');\n !this.isUnstyled && addStyle(this.$el, {\n 'user-select': 'none'\n });\n this.$refs.resizeHelper.style.height = this.$el.offsetHeight + 'px';\n this.$refs.resizeHelper.style.top = 0 + 'px';\n this.$refs.resizeHelper.style.left = event.pageX - containerLeft + this.$el.scrollLeft + 'px';\n this.$refs.resizeHelper.style.display = 'block';\n },\n onColumnResizeEnd: function onColumnResizeEnd() {\n var delta = isRTL(this.$el) ? this.lastResizeHelperX - this.$refs.resizeHelper.offsetLeft : this.$refs.resizeHelper.offsetLeft - this.lastResizeHelperX;\n var columnWidth = this.resizeColumnElement.offsetWidth;\n var newColumnWidth = columnWidth + delta;\n var minWidth = this.resizeColumnElement.style.minWidth || 15;\n if (columnWidth + delta > parseInt(minWidth, 10)) {\n if (this.columnResizeMode === 'fit') {\n var nextColumn = this.resizeColumnElement.nextElementSibling;\n var nextColumnWidth = nextColumn.offsetWidth - delta;\n if (newColumnWidth > 15 && nextColumnWidth > 15) {\n this.resizeTableCells(newColumnWidth, nextColumnWidth);\n }\n } else if (this.columnResizeMode === 'expand') {\n var tableWidth = this.$refs.table.offsetWidth + delta + 'px';\n var updateTableWidth = function updateTableWidth(el) {\n !!el && (el.style.width = el.style.minWidth = tableWidth);\n };\n\n // Reasoning: resize table cells before updating the table width so that it can use existing computed cell widths and adjust only the one column.\n this.resizeTableCells(newColumnWidth);\n updateTableWidth(this.$refs.table);\n if (!this.virtualScrollerDisabled) {\n var body = this.$refs.bodyRef && this.$refs.bodyRef.$el;\n var frozenBody = this.$refs.frozenBodyRef && this.$refs.frozenBodyRef.$el;\n updateTableWidth(body);\n updateTableWidth(frozenBody);\n }\n }\n this.$emit('column-resize-end', {\n element: this.resizeColumnElement,\n delta: delta\n });\n }\n this.$refs.resizeHelper.style.display = 'none';\n this.resizeColumn = null;\n this.$el.removeAttribute('data-p-unselectable-text');\n !this.isUnstyled && (this.$el.style['user-select'] = '');\n this.unbindColumnResizeEvents();\n if (this.isStateful()) {\n this.saveState();\n }\n },\n resizeTableCells: function resizeTableCells(newColumnWidth, nextColumnWidth) {\n var colIndex = getIndex(this.resizeColumnElement);\n var widths = [];\n var headers = find(this.$refs.table, 'thead[data-pc-section=\"thead\"] > tr > th');\n headers.forEach(function (header) {\n return widths.push(getOuterWidth(header));\n });\n this.destroyStyleElement();\n this.createStyleElement();\n var innerHTML = '';\n var selector = \"[data-pc-name=\\\"datatable\\\"][\".concat(this.$attrSelector, \"] > [data-pc-section=\\\"tablecontainer\\\"] \").concat(this.virtualScrollerDisabled ? '' : '> [data-pc-name=\"virtualscroller\"]', \" > table[data-pc-section=\\\"table\\\"]\");\n widths.forEach(function (width, index) {\n var colWidth = index === colIndex ? newColumnWidth : nextColumnWidth && index === colIndex + 1 ? nextColumnWidth : width;\n var style = \"width: \".concat(colWidth, \"px !important; max-width: \").concat(colWidth, \"px !important\");\n innerHTML += \"\\n \".concat(selector, \" > thead[data-pc-section=\\\"thead\\\"] > tr > th:nth-child(\").concat(index + 1, \"),\\n \").concat(selector, \" > tbody[data-pc-section=\\\"tbody\\\"] > tr > td:nth-child(\").concat(index + 1, \"),\\n \").concat(selector, \" > tfoot[data-pc-section=\\\"tfoot\\\"] > tr > td:nth-child(\").concat(index + 1, \") {\\n \").concat(style, \"\\n }\\n \");\n });\n this.styleElement.innerHTML = innerHTML;\n },\n bindColumnResizeEvents: function bindColumnResizeEvents() {\n var _this7 = this;\n if (!this.documentColumnResizeListener) {\n this.documentColumnResizeListener = document.addEventListener('mousemove', function () {\n if (_this7.columnResizing) {\n _this7.onColumnResize(event);\n }\n });\n }\n if (!this.documentColumnResizeEndListener) {\n this.documentColumnResizeEndListener = document.addEventListener('mouseup', function () {\n if (_this7.columnResizing) {\n _this7.columnResizing = false;\n _this7.onColumnResizeEnd();\n }\n });\n }\n },\n unbindColumnResizeEvents: function unbindColumnResizeEvents() {\n if (this.documentColumnResizeListener) {\n document.removeEventListener('document', this.documentColumnResizeListener);\n this.documentColumnResizeListener = null;\n }\n if (this.documentColumnResizeEndListener) {\n document.removeEventListener('document', this.documentColumnResizeEndListener);\n this.documentColumnResizeEndListener = null;\n }\n },\n onColumnHeaderMouseDown: function onColumnHeaderMouseDown(e) {\n var event = e.originalEvent;\n var column = e.column;\n if (this.reorderableColumns && this.columnProp(column, 'reorderableColumn') !== false) {\n if (event.target.nodeName === 'INPUT' || event.target.nodeName === 'TEXTAREA' || getAttribute(event.target, '[data-pc-section=\"columnresizer\"]')) event.currentTarget.draggable = false;else event.currentTarget.draggable = true;\n }\n },\n onColumnHeaderDragStart: function onColumnHeaderDragStart(e) {\n var event = e.originalEvent,\n column = e.column;\n if (this.columnResizing) {\n event.preventDefault();\n return;\n }\n this.colReorderIconWidth = getHiddenElementOuterWidth(this.$refs.reorderIndicatorUp);\n this.colReorderIconHeight = getHiddenElementOuterHeight(this.$refs.reorderIndicatorUp);\n this.draggedColumn = column;\n this.draggedColumnElement = this.findParentHeader(event.target);\n event.dataTransfer.setData('text', 'b'); // Firefox requires this to make dragging possible\n },\n onColumnHeaderDragOver: function onColumnHeaderDragOver(e) {\n var event = e.originalEvent,\n column = e.column;\n var dropHeader = this.findParentHeader(event.target);\n if (this.reorderableColumns && this.draggedColumnElement && dropHeader && !this.columnProp(column, 'frozen')) {\n event.preventDefault();\n var containerOffset = getOffset(this.$el);\n var dropHeaderOffset = getOffset(dropHeader);\n if (this.draggedColumnElement !== dropHeader) {\n var targetLeft = dropHeaderOffset.left - containerOffset.left;\n var columnCenter = dropHeaderOffset.left + dropHeader.offsetWidth / 2;\n this.$refs.reorderIndicatorUp.style.top = dropHeaderOffset.top - containerOffset.top - (this.colReorderIconHeight - 1) + 'px';\n this.$refs.reorderIndicatorDown.style.top = dropHeaderOffset.top - containerOffset.top + dropHeader.offsetHeight + 'px';\n if (event.pageX > columnCenter) {\n this.$refs.reorderIndicatorUp.style.left = targetLeft + dropHeader.offsetWidth - Math.ceil(this.colReorderIconWidth / 2) + 'px';\n this.$refs.reorderIndicatorDown.style.left = targetLeft + dropHeader.offsetWidth - Math.ceil(this.colReorderIconWidth / 2) + 'px';\n this.dropPosition = 1;\n } else {\n this.$refs.reorderIndicatorUp.style.left = targetLeft - Math.ceil(this.colReorderIconWidth / 2) + 'px';\n this.$refs.reorderIndicatorDown.style.left = targetLeft - Math.ceil(this.colReorderIconWidth / 2) + 'px';\n this.dropPosition = -1;\n }\n this.$refs.reorderIndicatorUp.style.display = 'block';\n this.$refs.reorderIndicatorDown.style.display = 'block';\n }\n }\n },\n onColumnHeaderDragLeave: function onColumnHeaderDragLeave(e) {\n var event = e.originalEvent;\n if (this.reorderableColumns && this.draggedColumnElement) {\n event.preventDefault();\n this.$refs.reorderIndicatorUp.style.display = 'none';\n this.$refs.reorderIndicatorDown.style.display = 'none';\n }\n },\n onColumnHeaderDrop: function onColumnHeaderDrop(e) {\n var _this8 = this;\n var event = e.originalEvent,\n column = e.column;\n event.preventDefault();\n if (this.draggedColumnElement) {\n var dragIndex = getIndex(this.draggedColumnElement);\n var dropIndex = getIndex(this.findParentHeader(event.target));\n var allowDrop = dragIndex !== dropIndex;\n if (allowDrop && (dropIndex - dragIndex === 1 && this.dropPosition === -1 || dropIndex - dragIndex === -1 && this.dropPosition === 1)) {\n allowDrop = false;\n }\n if (allowDrop) {\n var isSameColumn = function isSameColumn(col1, col2) {\n return _this8.columnProp(col1, 'columnKey') || _this8.columnProp(col2, 'columnKey') ? _this8.columnProp(col1, 'columnKey') === _this8.columnProp(col2, 'columnKey') : _this8.columnProp(col1, 'field') === _this8.columnProp(col2, 'field');\n };\n var dragColIndex = this.columns.findIndex(function (child) {\n return isSameColumn(child, _this8.draggedColumn);\n });\n var dropColIndex = this.columns.findIndex(function (child) {\n return isSameColumn(child, column);\n });\n var widths = [];\n var headers = find(this.$el, 'thead[data-pc-section=\"thead\"] > tr > th');\n headers.forEach(function (header) {\n return widths.push(getOuterWidth(header));\n });\n var movedItem = widths.find(function (_, index) {\n return index === dragColIndex;\n });\n var remainingItems = widths.filter(function (_, index) {\n return index !== dragColIndex;\n });\n var reorderedWidths = [].concat(_toConsumableArray(remainingItems.slice(0, dropColIndex)), [movedItem], _toConsumableArray(remainingItems.slice(dropColIndex)));\n this.addColumnWidthStyles(reorderedWidths);\n if (dropColIndex < dragColIndex && this.dropPosition === 1) {\n dropColIndex++;\n }\n if (dropColIndex > dragColIndex && this.dropPosition === -1) {\n dropColIndex--;\n }\n reorderArray(this.columns, dragColIndex, dropColIndex);\n this.updateReorderableColumns();\n this.$emit('column-reorder', {\n originalEvent: event,\n dragIndex: dragColIndex,\n dropIndex: dropColIndex\n });\n }\n this.$refs.reorderIndicatorUp.style.display = 'none';\n this.$refs.reorderIndicatorDown.style.display = 'none';\n this.draggedColumnElement.draggable = false;\n this.draggedColumnElement = null;\n this.draggedColumn = null;\n this.dropPosition = null;\n }\n },\n findParentHeader: function findParentHeader(element) {\n if (element.nodeName === 'TH') {\n return element;\n } else {\n var parent = element.parentElement;\n while (parent.nodeName !== 'TH') {\n parent = parent.parentElement;\n if (!parent) break;\n }\n return parent;\n }\n },\n findColumnByKey: function findColumnByKey(columns, key) {\n if (columns && columns.length) {\n for (var i = 0; i < columns.length; i++) {\n var column = columns[i];\n if (this.columnProp(column, 'columnKey') === key || this.columnProp(column, 'field') === key) {\n return column;\n }\n }\n }\n return null;\n },\n onRowMouseDown: function onRowMouseDown(event) {\n if (getAttribute(event.target, 'data-pc-section') === 'reorderablerowhandle' || getAttribute(event.target.parentElement, 'data-pc-section') === 'reorderablerowhandle') event.currentTarget.draggable = true;else event.currentTarget.draggable = false;\n },\n onRowDragStart: function onRowDragStart(e) {\n var event = e.originalEvent;\n var index = e.index;\n this.rowDragging = true;\n this.draggedRowIndex = index;\n event.dataTransfer.setData('text', 'b'); // For firefox\n },\n onRowDragOver: function onRowDragOver(e) {\n var event = e.originalEvent;\n var index = e.index;\n if (this.rowDragging && this.draggedRowIndex !== index) {\n var rowElement = event.currentTarget;\n var rowY = getOffset(rowElement).top;\n var pageY = event.pageY;\n var rowMidY = rowY + getOuterHeight(rowElement) / 2;\n var prevRowElement = rowElement.previousElementSibling;\n if (pageY < rowMidY) {\n rowElement.setAttribute('data-p-datatable-dragpoint-bottom', 'false');\n !this.isUnstyled && removeClass(rowElement, 'p-datatable-dragpoint-bottom');\n this.droppedRowIndex = index;\n if (prevRowElement) {\n prevRowElement.setAttribute('data-p-datatable-dragpoint-bottom', 'true');\n !this.isUnstyled && addClass(prevRowElement, 'p-datatable-dragpoint-bottom');\n } else {\n rowElement.setAttribute('data-p-datatable-dragpoint-top', 'true');\n !this.isUnstyled && addClass(rowElement, 'p-datatable-dragpoint-top');\n }\n } else {\n if (prevRowElement) {\n prevRowElement.setAttribute('data-p-datatable-dragpoint-bottom', 'false');\n !this.isUnstyled && removeClass(prevRowElement, 'p-datatable-dragpoint-bottom');\n } else {\n rowElement.setAttribute('data-p-datatable-dragpoint-top', 'true');\n !this.isUnstyled && addClass(rowElement, 'p-datatable-dragpoint-top');\n }\n this.droppedRowIndex = index + 1;\n rowElement.setAttribute('data-p-datatable-dragpoint-bottom', 'true');\n !this.isUnstyled && addClass(rowElement, 'p-datatable-dragpoint-bottom');\n }\n event.preventDefault();\n }\n },\n onRowDragLeave: function onRowDragLeave(event) {\n var rowElement = event.currentTarget;\n var prevRowElement = rowElement.previousElementSibling;\n if (prevRowElement) {\n prevRowElement.setAttribute('data-p-datatable-dragpoint-bottom', 'false');\n !this.isUnstyled && removeClass(prevRowElement, 'p-datatable-dragpoint-bottom');\n }\n rowElement.setAttribute('data-p-datatable-dragpoint-bottom', 'false');\n !this.isUnstyled && removeClass(rowElement, 'p-datatable-dragpoint-bottom');\n rowElement.setAttribute('data-p-datatable-dragpoint-top', 'false');\n !this.isUnstyled && removeClass(rowElement, 'p-datatable-dragpoint-top');\n },\n onRowDragEnd: function onRowDragEnd(event) {\n this.rowDragging = false;\n this.draggedRowIndex = null;\n this.droppedRowIndex = null;\n event.currentTarget.draggable = false;\n },\n onRowDrop: function onRowDrop(event) {\n if (this.droppedRowIndex != null) {\n var dropIndex = this.draggedRowIndex > this.droppedRowIndex ? this.droppedRowIndex : this.droppedRowIndex === 0 ? 0 : this.droppedRowIndex - 1;\n var processedData = _toConsumableArray(this.processedData);\n reorderArray(processedData, this.draggedRowIndex + this.d_first, dropIndex + this.d_first);\n this.$emit('row-reorder', {\n originalEvent: event,\n dragIndex: this.draggedRowIndex,\n dropIndex: dropIndex,\n value: processedData\n });\n }\n\n //cleanup\n this.onRowDragLeave(event);\n this.onRowDragEnd(event);\n event.preventDefault();\n },\n toggleRow: function toggleRow(event) {\n var _this9 = this;\n var expanded = event.expanded,\n rest = _objectWithoutProperties(event, _excluded);\n var rowData = event.data;\n var expandedRows;\n if (this.dataKey) {\n var value = resolveFieldData(rowData, this.dataKey);\n expandedRows = this.expandedRows ? _objectSpread$1({}, this.expandedRows) : {};\n expanded ? expandedRows[value] = true : delete expandedRows[value];\n } else {\n expandedRows = this.expandedRows ? _toConsumableArray(this.expandedRows) : [];\n expanded ? expandedRows.push(rowData) : expandedRows = expandedRows.filter(function (d) {\n return !_this9.equals(rowData, d);\n });\n }\n this.$emit('update:expandedRows', expandedRows);\n expanded ? this.$emit('row-expand', rest) : this.$emit('row-collapse', rest);\n },\n toggleRowGroup: function toggleRowGroup(e) {\n var event = e.originalEvent;\n var data = e.data;\n var groupFieldValue = resolveFieldData(data, this.groupRowsBy);\n var _expandedRowGroups = this.expandedRowGroups ? _toConsumableArray(this.expandedRowGroups) : [];\n if (this.isRowGroupExpanded(data)) {\n _expandedRowGroups = _expandedRowGroups.filter(function (group) {\n return group !== groupFieldValue;\n });\n this.$emit('update:expandedRowGroups', _expandedRowGroups);\n this.$emit('rowgroup-collapse', {\n originalEvent: event,\n data: groupFieldValue\n });\n } else {\n _expandedRowGroups.push(groupFieldValue);\n this.$emit('update:expandedRowGroups', _expandedRowGroups);\n this.$emit('rowgroup-expand', {\n originalEvent: event,\n data: groupFieldValue\n });\n }\n },\n isRowGroupExpanded: function isRowGroupExpanded(rowData) {\n if (this.expandableRowGroups && this.expandedRowGroups) {\n var groupFieldValue = resolveFieldData(rowData, this.groupRowsBy);\n return this.expandedRowGroups.indexOf(groupFieldValue) > -1;\n }\n return false;\n },\n isStateful: function isStateful() {\n return this.stateKey != null;\n },\n getStorage: function getStorage() {\n switch (this.stateStorage) {\n case 'local':\n return window.localStorage;\n case 'session':\n return window.sessionStorage;\n default:\n throw new Error(this.stateStorage + ' is not a valid value for the state storage, supported values are \"local\" and \"session\".');\n }\n },\n saveState: function saveState() {\n var storage = this.getStorage();\n var state = {};\n if (this.paginator) {\n state.first = this.d_first;\n state.rows = this.d_rows;\n }\n if (this.d_sortField) {\n state.sortField = this.d_sortField;\n state.sortOrder = this.d_sortOrder;\n }\n if (this.d_multiSortMeta) {\n state.multiSortMeta = this.d_multiSortMeta;\n }\n if (this.hasFilters) {\n state.filters = this.filters;\n }\n if (this.resizableColumns) {\n this.saveColumnWidths(state);\n }\n if (this.reorderableColumns) {\n state.columnOrder = this.d_columnOrder;\n }\n if (this.expandedRows) {\n state.expandedRows = this.expandedRows;\n }\n if (this.expandedRowGroups) {\n state.expandedRowGroups = this.expandedRowGroups;\n }\n if (this.selection) {\n state.selection = this.selection;\n state.selectionKeys = this.d_selectionKeys;\n }\n if (Object.keys(state).length) {\n storage.setItem(this.stateKey, JSON.stringify(state));\n }\n this.$emit('state-save', state);\n },\n restoreState: function restoreState() {\n var storage = this.getStorage();\n var stateString = storage.getItem(this.stateKey);\n var dateFormat = /\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z/;\n var reviver = function reviver(key, value) {\n if (typeof value === 'string' && dateFormat.test(value)) {\n return new Date(value);\n }\n return value;\n };\n if (stateString) {\n var restoredState = JSON.parse(stateString, reviver);\n if (this.paginator) {\n this.d_first = restoredState.first;\n this.d_rows = restoredState.rows;\n }\n if (restoredState.sortField) {\n this.d_sortField = restoredState.sortField;\n this.d_sortOrder = restoredState.sortOrder;\n }\n if (restoredState.multiSortMeta) {\n this.d_multiSortMeta = restoredState.multiSortMeta;\n }\n if (restoredState.filters) {\n this.$emit('update:filters', restoredState.filters);\n }\n if (this.resizableColumns) {\n this.columnWidthsState = restoredState.columnWidths;\n this.tableWidthState = restoredState.tableWidth;\n }\n if (this.reorderableColumns) {\n this.d_columnOrder = restoredState.columnOrder;\n }\n if (restoredState.expandedRows) {\n this.$emit('update:expandedRows', restoredState.expandedRows);\n }\n if (restoredState.expandedRowGroups) {\n this.$emit('update:expandedRowGroups', restoredState.expandedRowGroups);\n }\n if (restoredState.selection) {\n this.d_selectionKeys = restoredState.d_selectionKeys;\n this.$emit('update:selection', restoredState.selection);\n }\n this.$emit('state-restore', restoredState);\n }\n },\n saveColumnWidths: function saveColumnWidths(state) {\n var widths = [];\n var headers = find(this.$el, 'thead[data-pc-section=\"thead\"] > tr > th');\n headers.forEach(function (header) {\n return widths.push(getOuterWidth(header));\n });\n state.columnWidths = widths.join(',');\n if (this.columnResizeMode === 'expand') {\n state.tableWidth = getOuterWidth(this.$refs.table) + 'px';\n }\n },\n addColumnWidthStyles: function addColumnWidthStyles(widths) {\n this.createStyleElement();\n var innerHTML = '';\n var selector = \"[data-pc-name=\\\"datatable\\\"][\".concat(this.$attrSelector, \"] > [data-pc-section=\\\"tablecontainer\\\"] \").concat(this.virtualScrollerDisabled ? '' : '> [data-pc-name=\"virtualscroller\"]', \" > table[data-pc-section=\\\"table\\\"]\");\n widths.forEach(function (width, index) {\n var style = \"width: \".concat(width, \"px !important; max-width: \").concat(width, \"px !important\");\n innerHTML += \"\\n \".concat(selector, \" > thead[data-pc-section=\\\"thead\\\"] > tr > th:nth-child(\").concat(index + 1, \"),\\n \").concat(selector, \" > tbody[data-pc-section=\\\"tbody\\\"] > tr > td:nth-child(\").concat(index + 1, \"),\\n \").concat(selector, \" > tfoot[data-pc-section=\\\"tfoot\\\"] > tr > td:nth-child(\").concat(index + 1, \") {\\n \").concat(style, \"\\n }\\n \");\n });\n this.styleElement.innerHTML = innerHTML;\n },\n restoreColumnWidths: function restoreColumnWidths() {\n if (this.columnWidthsState) {\n var widths = this.columnWidthsState.split(',');\n if (this.columnResizeMode === 'expand' && this.tableWidthState) {\n this.$refs.table.style.width = this.tableWidthState;\n this.$refs.table.style.minWidth = this.tableWidthState;\n }\n if (isNotEmpty(widths)) {\n this.addColumnWidthStyles(widths);\n }\n }\n },\n onCellEditInit: function onCellEditInit(event) {\n this.$emit('cell-edit-init', event);\n },\n onCellEditComplete: function onCellEditComplete(event) {\n this.$emit('cell-edit-complete', event);\n },\n onCellEditCancel: function onCellEditCancel(event) {\n this.$emit('cell-edit-cancel', event);\n },\n onRowEditInit: function onRowEditInit(event) {\n var _editingRows = this.editingRows ? _toConsumableArray(this.editingRows) : [];\n _editingRows.push(event.data);\n this.$emit('update:editingRows', _editingRows);\n this.$emit('row-edit-init', event);\n },\n onRowEditSave: function onRowEditSave(event) {\n var _editingRows = _toConsumableArray(this.editingRows);\n _editingRows.splice(this.findIndex(event.data, _editingRows), 1);\n this.$emit('update:editingRows', _editingRows);\n this.$emit('row-edit-save', event);\n },\n onRowEditCancel: function onRowEditCancel(event) {\n var _editingRows = _toConsumableArray(this.editingRows);\n _editingRows.splice(this.findIndex(event.data, _editingRows), 1);\n this.$emit('update:editingRows', _editingRows);\n this.$emit('row-edit-cancel', event);\n },\n onEditingMetaChange: function onEditingMetaChange(event) {\n var data = event.data,\n field = event.field,\n index = event.index,\n editing = event.editing;\n var editingMeta = _objectSpread$1({}, this.d_editingMeta);\n var meta = editingMeta[index];\n if (editing) {\n !meta && (meta = editingMeta[index] = {\n data: _objectSpread$1({}, data),\n fields: []\n });\n meta['fields'].push(field);\n } else if (meta) {\n var fields = meta['fields'].filter(function (f) {\n return f !== field;\n });\n !fields.length ? delete editingMeta[index] : meta['fields'] = fields;\n }\n this.d_editingMeta = editingMeta;\n },\n clearEditingMetaData: function clearEditingMetaData() {\n if (this.editMode) {\n this.d_editingMeta = {};\n }\n },\n createLazyLoadEvent: function createLazyLoadEvent(event) {\n return {\n originalEvent: event,\n first: this.d_first,\n rows: this.d_rows,\n sortField: this.d_sortField,\n sortOrder: this.d_sortOrder,\n multiSortMeta: this.d_multiSortMeta,\n filters: this.d_filters\n };\n },\n hasGlobalFilter: function hasGlobalFilter() {\n return this.filters && Object.prototype.hasOwnProperty.call(this.filters, 'global');\n },\n onFilterChange: function onFilterChange(filters) {\n this.d_filters = filters;\n },\n onFilterApply: function onFilterApply() {\n this.d_first = 0;\n this.$emit('update:first', this.d_first);\n this.$emit('update:filters', this.d_filters);\n if (this.lazy) {\n this.$emit('filter', this.createLazyLoadEvent());\n }\n },\n cloneFilters: function cloneFilters() {\n var cloned = {};\n if (this.filters) {\n Object.entries(this.filters).forEach(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n prop = _ref4[0],\n value = _ref4[1];\n cloned[prop] = value.operator ? {\n operator: value.operator,\n constraints: value.constraints.map(function (constraint) {\n return _objectSpread$1({}, constraint);\n })\n } : _objectSpread$1({}, value);\n });\n }\n return cloned;\n },\n updateReorderableColumns: function updateReorderableColumns() {\n var _this10 = this;\n var columnOrder = [];\n this.columns.forEach(function (col) {\n return columnOrder.push(_this10.columnProp(col, 'columnKey') || _this10.columnProp(col, 'field'));\n });\n this.d_columnOrder = columnOrder;\n },\n createStyleElement: function createStyleElement() {\n var _this$$primevue;\n this.styleElement = document.createElement('style');\n this.styleElement.type = 'text/css';\n setAttribute(this.styleElement, 'nonce', (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);\n document.head.appendChild(this.styleElement);\n },\n destroyStyleElement: function destroyStyleElement() {\n if (this.styleElement) {\n document.head.removeChild(this.styleElement);\n this.styleElement = null;\n }\n },\n dataToRender: function dataToRender(data) {\n var _data = data || this.processedData;\n if (_data && this.paginator) {\n var first = this.lazy ? 0 : this.d_first;\n return _data.slice(first, first + this.d_rows);\n }\n return _data;\n },\n getVirtualScrollerRef: function getVirtualScrollerRef() {\n return this.$refs.virtualScroller;\n },\n hasSpacerStyle: function hasSpacerStyle(style) {\n return isNotEmpty(style);\n }\n },\n computed: {\n columns: function columns() {\n var cols = this.d_columns.get(this);\n if (this.reorderableColumns && this.d_columnOrder) {\n var orderedColumns = [];\n var _iterator5 = _createForOfIteratorHelper(this.d_columnOrder),\n _step5;\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var columnKey = _step5.value;\n var column = this.findColumnByKey(cols, columnKey);\n if (column && !this.columnProp(column, 'hidden')) {\n orderedColumns.push(column);\n }\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n return [].concat(orderedColumns, _toConsumableArray(cols.filter(function (item) {\n return orderedColumns.indexOf(item) < 0;\n })));\n }\n return cols;\n },\n columnGroups: function columnGroups() {\n return this.d_columnGroups.get(this);\n },\n headerColumnGroup: function headerColumnGroup() {\n var _this$columnGroups,\n _this11 = this;\n return (_this$columnGroups = this.columnGroups) === null || _this$columnGroups === void 0 ? void 0 : _this$columnGroups.find(function (group) {\n return _this11.columnProp(group, 'type') === 'header';\n });\n },\n footerColumnGroup: function footerColumnGroup() {\n var _this$columnGroups2,\n _this12 = this;\n return (_this$columnGroups2 = this.columnGroups) === null || _this$columnGroups2 === void 0 ? void 0 : _this$columnGroups2.find(function (group) {\n return _this12.columnProp(group, 'type') === 'footer';\n });\n },\n hasFilters: function hasFilters() {\n return this.filters && Object.keys(this.filters).length > 0 && this.filters.constructor === Object;\n },\n processedData: function processedData() {\n var _this$virtualScroller;\n var data = this.value || [];\n if (!this.lazy && !((_this$virtualScroller = this.virtualScrollerOptions) !== null && _this$virtualScroller !== void 0 && _this$virtualScroller.lazy)) {\n if (data && data.length) {\n if (this.hasFilters) {\n data = this.filter(data);\n }\n if (this.sorted) {\n if (this.sortMode === 'single') data = this.sortSingle(data);else if (this.sortMode === 'multiple') data = this.sortMultiple(data);\n }\n }\n }\n return data;\n },\n totalRecordsLength: function totalRecordsLength() {\n if (this.lazy) {\n return this.totalRecords;\n } else {\n var data = this.processedData;\n return data ? data.length : 0;\n }\n },\n empty: function empty() {\n var data = this.processedData;\n return !data || data.length === 0;\n },\n paginatorTop: function paginatorTop() {\n return this.paginator && (this.paginatorPosition !== 'bottom' || this.paginatorPosition === 'both');\n },\n paginatorBottom: function paginatorBottom() {\n return this.paginator && (this.paginatorPosition !== 'top' || this.paginatorPosition === 'both');\n },\n sorted: function sorted() {\n return this.d_sortField || this.d_multiSortMeta && this.d_multiSortMeta.length > 0;\n },\n allRowsSelected: function allRowsSelected() {\n var _this13 = this;\n if (this.selectAll !== null) {\n return this.selectAll;\n } else {\n var val = this.frozenValue ? [].concat(_toConsumableArray(this.frozenValue), _toConsumableArray(this.processedData)) : this.processedData;\n return isNotEmpty(val) && this.selection && Array.isArray(this.selection) && val.every(function (v) {\n return _this13.selection.some(function (s) {\n return _this13.equals(s, v);\n });\n });\n }\n },\n groupRowSortField: function groupRowSortField() {\n return this.sortMode === 'single' ? this.sortField : this.d_groupRowsSortMeta ? this.d_groupRowsSortMeta.field : null;\n },\n headerFilterButtonProps: function headerFilterButtonProps() {\n return _objectSpread$1(_objectSpread$1({\n filter: {\n severity: 'secondary',\n text: true,\n rounded: true\n }\n }, this.filterButtonProps), {}, {\n inline: _objectSpread$1({\n clear: {\n severity: 'secondary',\n text: true,\n rounded: true\n }\n }, this.filterButtonProps.inline),\n popover: _objectSpread$1({\n addRule: {\n severity: 'info',\n text: true,\n size: 'small'\n },\n removeRule: {\n severity: 'danger',\n text: true,\n size: 'small'\n },\n apply: {\n size: 'small'\n },\n clear: {\n outlined: true,\n size: 'small'\n }\n }, this.filterButtonProps.popover)\n });\n },\n rowEditButtonProps: function rowEditButtonProps() {\n return _objectSpread$1(_objectSpread$1({}, {\n init: {\n severity: 'secondary',\n text: true,\n rounded: true\n },\n save: {\n severity: 'secondary',\n text: true,\n rounded: true\n },\n cancel: {\n severity: 'secondary',\n text: true,\n rounded: true\n }\n }), this.editButtonProps);\n },\n virtualScrollerDisabled: function virtualScrollerDisabled() {\n return isEmpty(this.virtualScrollerOptions) || !this.scrollable;\n }\n },\n components: {\n DTPaginator: Paginator,\n DTTableHeader: script$1,\n DTTableBody: script$7,\n DTTableFooter: script$5,\n DTVirtualScroller: VirtualScroller,\n ArrowDownIcon: ArrowDownIcon,\n ArrowUpIcon: ArrowUpIcon,\n SpinnerIcon: SpinnerIcon\n }\n};\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_SpinnerIcon = resolveComponent(\"SpinnerIcon\");\n var _component_DTPaginator = resolveComponent(\"DTPaginator\");\n var _component_DTTableHeader = resolveComponent(\"DTTableHeader\");\n var _component_DTTableBody = resolveComponent(\"DTTableBody\");\n var _component_DTTableFooter = resolveComponent(\"DTTableFooter\");\n var _component_DTVirtualScroller = resolveComponent(\"DTVirtualScroller\");\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root'),\n \"data-scrollselectors\": \".p-datatable-wrapper\"\n }, _ctx.ptmi('root')), [renderSlot(_ctx.$slots, \"default\"), _ctx.loading ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('mask')\n }, _ctx.ptm('mask')), [_ctx.$slots.loading ? renderSlot(_ctx.$slots, \"loading\", {\n key: 0\n }) : (openBlock(), createElementBlock(Fragment, {\n key: 1\n }, [_ctx.$slots.loadingicon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.loadingicon), {\n key: 0,\n \"class\": normalizeClass(_ctx.cx('loadingIcon'))\n }, null, 8, [\"class\"])) : _ctx.loadingIcon ? (openBlock(), createElementBlock(\"i\", mergeProps({\n key: 1,\n \"class\": [_ctx.cx('loadingIcon'), 'pi-spin', _ctx.loadingIcon]\n }, _ctx.ptm('loadingIcon')), null, 16)) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({\n key: 2,\n spin: \"\",\n \"class\": _ctx.cx('loadingIcon')\n }, _ctx.ptm('loadingIcon')), null, 16, [\"class\"]))], 64))], 16)) : createCommentVNode(\"\", true), _ctx.$slots.header ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('header')\n }, _ctx.ptm('header')), [renderSlot(_ctx.$slots, \"header\")], 16)) : createCommentVNode(\"\", true), $options.paginatorTop ? (openBlock(), createBlock(_component_DTPaginator, {\n key: 2,\n rows: $data.d_rows,\n first: $data.d_first,\n totalRecords: $options.totalRecordsLength,\n pageLinkSize: _ctx.pageLinkSize,\n template: _ctx.paginatorTemplate,\n rowsPerPageOptions: _ctx.rowsPerPageOptions,\n currentPageReportTemplate: _ctx.currentPageReportTemplate,\n \"class\": normalizeClass(_ctx.cx('pcPaginator', {\n position: 'top'\n })),\n onPage: _cache[0] || (_cache[0] = function ($event) {\n return $options.onPage($event);\n }),\n alwaysShow: _ctx.alwaysShowPaginator,\n unstyled: _ctx.unstyled,\n pt: _ctx.ptm('pcPaginator')\n }, createSlots({\n _: 2\n }, [_ctx.$slots.paginatorcontainer ? {\n name: \"container\",\n fn: withCtx(function () {\n return [renderSlot(_ctx.$slots, \"paginatorcontainer\", {\n first: _ctx.slotProps.first,\n last: _ctx.slotProps.last,\n rows: _ctx.slotProps.rows,\n page: _ctx.slotProps.page,\n pageCount: _ctx.slotProps.pageCount,\n totalRecords: _ctx.slotProps.totalRecords,\n firstPageCallback: _ctx.slotProps.firstPageCallback,\n lastPageCallback: _ctx.slotProps.lastPageCallback,\n prevPageCallback: _ctx.slotProps.prevPageCallback,\n nextPageCallback: _ctx.slotProps.nextPageCallback,\n rowChangeCallback: _ctx.slotProps.rowChangeCallback\n })];\n }),\n key: \"0\"\n } : undefined, _ctx.$slots.paginatorstart ? {\n name: \"start\",\n fn: withCtx(function () {\n return [renderSlot(_ctx.$slots, \"paginatorstart\")];\n }),\n key: \"1\"\n } : undefined, _ctx.$slots.paginatorend ? {\n name: \"end\",\n fn: withCtx(function () {\n return [renderSlot(_ctx.$slots, \"paginatorend\")];\n }),\n key: \"2\"\n } : undefined, _ctx.$slots.paginatorfirstpagelinkicon ? {\n name: \"firstpagelinkicon\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatorfirstpagelinkicon\", {\n \"class\": normalizeClass(slotProps[\"class\"])\n })];\n }),\n key: \"3\"\n } : undefined, _ctx.$slots.paginatorprevpagelinkicon ? {\n name: \"prevpagelinkicon\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatorprevpagelinkicon\", {\n \"class\": normalizeClass(slotProps[\"class\"])\n })];\n }),\n key: \"4\"\n } : undefined, _ctx.$slots.paginatornextpagelinkicon ? {\n name: \"nextpagelinkicon\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatornextpagelinkicon\", {\n \"class\": normalizeClass(slotProps[\"class\"])\n })];\n }),\n key: \"5\"\n } : undefined, _ctx.$slots.paginatorlastpagelinkicon ? {\n name: \"lastpagelinkicon\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatorlastpagelinkicon\", {\n \"class\": normalizeClass(slotProps[\"class\"])\n })];\n }),\n key: \"6\"\n } : undefined, _ctx.$slots.paginatorjumptopagedropdownicon ? {\n name: \"jumptopagedropdownicon\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatorjumptopagedropdownicon\", {\n \"class\": normalizeClass(slotProps[\"class\"])\n })];\n }),\n key: \"7\"\n } : undefined, _ctx.$slots.paginatorrowsperpagedropdownicon ? {\n name: \"rowsperpagedropdownicon\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatorrowsperpagedropdownicon\", {\n \"class\": normalizeClass(slotProps[\"class\"])\n })];\n }),\n key: \"8\"\n } : undefined]), 1032, [\"rows\", \"first\", \"totalRecords\", \"pageLinkSize\", \"template\", \"rowsPerPageOptions\", \"currentPageReportTemplate\", \"class\", \"alwaysShow\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('tableContainer'),\n style: [_ctx.sx('tableContainer'), {\n maxHeight: $options.virtualScrollerDisabled ? _ctx.scrollHeight : ''\n }]\n }, _ctx.ptm('tableContainer')), [createVNode(_component_DTVirtualScroller, mergeProps({\n ref: \"virtualScroller\"\n }, _ctx.virtualScrollerOptions, {\n items: $options.processedData,\n columns: $options.columns,\n style: _ctx.scrollHeight !== 'flex' ? {\n height: _ctx.scrollHeight\n } : undefined,\n scrollHeight: _ctx.scrollHeight !== 'flex' ? undefined : '100%',\n disabled: $options.virtualScrollerDisabled,\n loaderDisabled: \"\",\n inline: \"\",\n autoSize: \"\",\n showSpacer: false,\n pt: _ctx.ptm('virtualScroller')\n }), {\n content: withCtx(function (slotProps) {\n return [createElementVNode(\"table\", mergeProps({\n ref: \"table\",\n role: \"table\",\n \"class\": [_ctx.cx('table'), _ctx.tableClass],\n style: [_ctx.tableStyle, slotProps.spacerStyle]\n }, _objectSpread(_objectSpread({}, _ctx.tableProps), _ctx.ptm('table'))), [_ctx.showHeaders ? (openBlock(), createBlock(_component_DTTableHeader, {\n key: 0,\n columnGroup: $options.headerColumnGroup,\n columns: slotProps.columns,\n rowGroupMode: _ctx.rowGroupMode,\n groupRowsBy: _ctx.groupRowsBy,\n groupRowSortField: $options.groupRowSortField,\n reorderableColumns: _ctx.reorderableColumns,\n resizableColumns: _ctx.resizableColumns,\n allRowsSelected: $options.allRowsSelected,\n empty: $options.empty,\n sortMode: _ctx.sortMode,\n sortField: $data.d_sortField,\n sortOrder: $data.d_sortOrder,\n multiSortMeta: $data.d_multiSortMeta,\n filters: $data.d_filters,\n filtersStore: _ctx.filters,\n filterDisplay: _ctx.filterDisplay,\n filterButtonProps: $options.headerFilterButtonProps,\n filterInputProps: _ctx.filterInputProps,\n first: $data.d_first,\n onColumnClick: _cache[1] || (_cache[1] = function ($event) {\n return $options.onColumnHeaderClick($event);\n }),\n onColumnMousedown: _cache[2] || (_cache[2] = function ($event) {\n return $options.onColumnHeaderMouseDown($event);\n }),\n onFilterChange: $options.onFilterChange,\n onFilterApply: $options.onFilterApply,\n onColumnDragstart: _cache[3] || (_cache[3] = function ($event) {\n return $options.onColumnHeaderDragStart($event);\n }),\n onColumnDragover: _cache[4] || (_cache[4] = function ($event) {\n return $options.onColumnHeaderDragOver($event);\n }),\n onColumnDragleave: _cache[5] || (_cache[5] = function ($event) {\n return $options.onColumnHeaderDragLeave($event);\n }),\n onColumnDrop: _cache[6] || (_cache[6] = function ($event) {\n return $options.onColumnHeaderDrop($event);\n }),\n onColumnResizestart: _cache[7] || (_cache[7] = function ($event) {\n return $options.onColumnResizeStart($event);\n }),\n onCheckboxChange: _cache[8] || (_cache[8] = function ($event) {\n return $options.toggleRowsWithCheckbox($event);\n }),\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"columnGroup\", \"columns\", \"rowGroupMode\", \"groupRowsBy\", \"groupRowSortField\", \"reorderableColumns\", \"resizableColumns\", \"allRowsSelected\", \"empty\", \"sortMode\", \"sortField\", \"sortOrder\", \"multiSortMeta\", \"filters\", \"filtersStore\", \"filterDisplay\", \"filterButtonProps\", \"filterInputProps\", \"first\", \"onFilterChange\", \"onFilterApply\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true), _ctx.frozenValue ? (openBlock(), createBlock(_component_DTTableBody, {\n key: 1,\n ref: \"frozenBodyRef\",\n value: _ctx.frozenValue,\n frozenRow: true,\n columns: slotProps.columns,\n first: $data.d_first,\n dataKey: _ctx.dataKey,\n selection: _ctx.selection,\n selectionKeys: $data.d_selectionKeys,\n selectionMode: _ctx.selectionMode,\n contextMenu: _ctx.contextMenu,\n contextMenuSelection: _ctx.contextMenuSelection,\n rowGroupMode: _ctx.rowGroupMode,\n groupRowsBy: _ctx.groupRowsBy,\n expandableRowGroups: _ctx.expandableRowGroups,\n rowClass: _ctx.rowClass,\n rowStyle: _ctx.rowStyle,\n editMode: _ctx.editMode,\n compareSelectionBy: _ctx.compareSelectionBy,\n scrollable: _ctx.scrollable,\n expandedRowIcon: _ctx.expandedRowIcon,\n collapsedRowIcon: _ctx.collapsedRowIcon,\n expandedRows: _ctx.expandedRows,\n expandedRowGroups: _ctx.expandedRowGroups,\n editingRows: _ctx.editingRows,\n editingRowKeys: $data.d_editingRowKeys,\n templates: _ctx.$slots,\n editButtonProps: $options.rowEditButtonProps,\n isVirtualScrollerDisabled: true,\n onRowgroupToggle: $options.toggleRowGroup,\n onRowClick: _cache[9] || (_cache[9] = function ($event) {\n return $options.onRowClick($event);\n }),\n onRowDblclick: _cache[10] || (_cache[10] = function ($event) {\n return $options.onRowDblClick($event);\n }),\n onRowRightclick: _cache[11] || (_cache[11] = function ($event) {\n return $options.onRowRightClick($event);\n }),\n onRowTouchend: $options.onRowTouchEnd,\n onRowKeydown: $options.onRowKeyDown,\n onRowMousedown: $options.onRowMouseDown,\n onRowDragstart: _cache[12] || (_cache[12] = function ($event) {\n return $options.onRowDragStart($event);\n }),\n onRowDragover: _cache[13] || (_cache[13] = function ($event) {\n return $options.onRowDragOver($event);\n }),\n onRowDragleave: _cache[14] || (_cache[14] = function ($event) {\n return $options.onRowDragLeave($event);\n }),\n onRowDragend: _cache[15] || (_cache[15] = function ($event) {\n return $options.onRowDragEnd($event);\n }),\n onRowDrop: _cache[16] || (_cache[16] = function ($event) {\n return $options.onRowDrop($event);\n }),\n onRowToggle: _cache[17] || (_cache[17] = function ($event) {\n return $options.toggleRow($event);\n }),\n onRadioChange: _cache[18] || (_cache[18] = function ($event) {\n return $options.toggleRowWithRadio($event);\n }),\n onCheckboxChange: _cache[19] || (_cache[19] = function ($event) {\n return $options.toggleRowWithCheckbox($event);\n }),\n onCellEditInit: _cache[20] || (_cache[20] = function ($event) {\n return $options.onCellEditInit($event);\n }),\n onCellEditComplete: _cache[21] || (_cache[21] = function ($event) {\n return $options.onCellEditComplete($event);\n }),\n onCellEditCancel: _cache[22] || (_cache[22] = function ($event) {\n return $options.onCellEditCancel($event);\n }),\n onRowEditInit: _cache[23] || (_cache[23] = function ($event) {\n return $options.onRowEditInit($event);\n }),\n onRowEditSave: _cache[24] || (_cache[24] = function ($event) {\n return $options.onRowEditSave($event);\n }),\n onRowEditCancel: _cache[25] || (_cache[25] = function ($event) {\n return $options.onRowEditCancel($event);\n }),\n editingMeta: $data.d_editingMeta,\n onEditingMetaChange: $options.onEditingMetaChange,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"value\", \"columns\", \"first\", \"dataKey\", \"selection\", \"selectionKeys\", \"selectionMode\", \"contextMenu\", \"contextMenuSelection\", \"rowGroupMode\", \"groupRowsBy\", \"expandableRowGroups\", \"rowClass\", \"rowStyle\", \"editMode\", \"compareSelectionBy\", \"scrollable\", \"expandedRowIcon\", \"collapsedRowIcon\", \"expandedRows\", \"expandedRowGroups\", \"editingRows\", \"editingRowKeys\", \"templates\", \"editButtonProps\", \"onRowgroupToggle\", \"onRowTouchend\", \"onRowKeydown\", \"onRowMousedown\", \"editingMeta\", \"onEditingMetaChange\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true), createVNode(_component_DTTableBody, {\n ref: \"bodyRef\",\n value: $options.dataToRender(slotProps.rows),\n \"class\": normalizeClass(slotProps.styleClass),\n columns: slotProps.columns,\n empty: $options.empty,\n first: $data.d_first,\n dataKey: _ctx.dataKey,\n selection: _ctx.selection,\n selectionKeys: $data.d_selectionKeys,\n selectionMode: _ctx.selectionMode,\n contextMenu: _ctx.contextMenu,\n contextMenuSelection: _ctx.contextMenuSelection,\n rowGroupMode: _ctx.rowGroupMode,\n groupRowsBy: _ctx.groupRowsBy,\n expandableRowGroups: _ctx.expandableRowGroups,\n rowClass: _ctx.rowClass,\n rowStyle: _ctx.rowStyle,\n editMode: _ctx.editMode,\n compareSelectionBy: _ctx.compareSelectionBy,\n scrollable: _ctx.scrollable,\n expandedRowIcon: _ctx.expandedRowIcon,\n collapsedRowIcon: _ctx.collapsedRowIcon,\n expandedRows: _ctx.expandedRows,\n expandedRowGroups: _ctx.expandedRowGroups,\n editingRows: _ctx.editingRows,\n editingRowKeys: $data.d_editingRowKeys,\n templates: _ctx.$slots,\n editButtonProps: $options.rowEditButtonProps,\n virtualScrollerContentProps: slotProps,\n isVirtualScrollerDisabled: $options.virtualScrollerDisabled,\n onRowgroupToggle: $options.toggleRowGroup,\n onRowClick: _cache[26] || (_cache[26] = function ($event) {\n return $options.onRowClick($event);\n }),\n onRowDblclick: _cache[27] || (_cache[27] = function ($event) {\n return $options.onRowDblClick($event);\n }),\n onRowRightclick: _cache[28] || (_cache[28] = function ($event) {\n return $options.onRowRightClick($event);\n }),\n onRowTouchend: $options.onRowTouchEnd,\n onRowKeydown: function onRowKeydown($event) {\n return $options.onRowKeyDown($event, slotProps);\n },\n onRowMousedown: $options.onRowMouseDown,\n onRowDragstart: _cache[29] || (_cache[29] = function ($event) {\n return $options.onRowDragStart($event);\n }),\n onRowDragover: _cache[30] || (_cache[30] = function ($event) {\n return $options.onRowDragOver($event);\n }),\n onRowDragleave: _cache[31] || (_cache[31] = function ($event) {\n return $options.onRowDragLeave($event);\n }),\n onRowDragend: _cache[32] || (_cache[32] = function ($event) {\n return $options.onRowDragEnd($event);\n }),\n onRowDrop: _cache[33] || (_cache[33] = function ($event) {\n return $options.onRowDrop($event);\n }),\n onRowToggle: _cache[34] || (_cache[34] = function ($event) {\n return $options.toggleRow($event);\n }),\n onRadioChange: _cache[35] || (_cache[35] = function ($event) {\n return $options.toggleRowWithRadio($event);\n }),\n onCheckboxChange: _cache[36] || (_cache[36] = function ($event) {\n return $options.toggleRowWithCheckbox($event);\n }),\n onCellEditInit: _cache[37] || (_cache[37] = function ($event) {\n return $options.onCellEditInit($event);\n }),\n onCellEditComplete: _cache[38] || (_cache[38] = function ($event) {\n return $options.onCellEditComplete($event);\n }),\n onCellEditCancel: _cache[39] || (_cache[39] = function ($event) {\n return $options.onCellEditCancel($event);\n }),\n onRowEditInit: _cache[40] || (_cache[40] = function ($event) {\n return $options.onRowEditInit($event);\n }),\n onRowEditSave: _cache[41] || (_cache[41] = function ($event) {\n return $options.onRowEditSave($event);\n }),\n onRowEditCancel: _cache[42] || (_cache[42] = function ($event) {\n return $options.onRowEditCancel($event);\n }),\n editingMeta: $data.d_editingMeta,\n onEditingMetaChange: $options.onEditingMetaChange,\n unstyled: _ctx.unstyled,\n pt: _ctx.pt\n }, null, 8, [\"value\", \"class\", \"columns\", \"empty\", \"first\", \"dataKey\", \"selection\", \"selectionKeys\", \"selectionMode\", \"contextMenu\", \"contextMenuSelection\", \"rowGroupMode\", \"groupRowsBy\", \"expandableRowGroups\", \"rowClass\", \"rowStyle\", \"editMode\", \"compareSelectionBy\", \"scrollable\", \"expandedRowIcon\", \"collapsedRowIcon\", \"expandedRows\", \"expandedRowGroups\", \"editingRows\", \"editingRowKeys\", \"templates\", \"editButtonProps\", \"virtualScrollerContentProps\", \"isVirtualScrollerDisabled\", \"onRowgroupToggle\", \"onRowTouchend\", \"onRowKeydown\", \"onRowMousedown\", \"editingMeta\", \"onEditingMetaChange\", \"unstyled\", \"pt\"]), $options.hasSpacerStyle(slotProps.spacerStyle) ? (openBlock(), createElementBlock(\"tbody\", mergeProps({\n key: 2,\n \"class\": _ctx.cx('virtualScrollerSpacer'),\n style: {\n height: \"calc(\".concat(slotProps.spacerStyle.height, \" - \").concat(slotProps.rows.length * slotProps.itemSize, \"px)\")\n }\n }, _ctx.ptm('virtualScrollerSpacer')), null, 16)) : createCommentVNode(\"\", true), createVNode(_component_DTTableFooter, {\n columnGroup: $options.footerColumnGroup,\n columns: slotProps.columns,\n pt: _ctx.pt\n }, null, 8, [\"columnGroup\", \"columns\", \"pt\"])], 16)];\n }),\n _: 1\n }, 16, [\"items\", \"columns\", \"style\", \"scrollHeight\", \"disabled\", \"pt\"])], 16), $options.paginatorBottom ? (openBlock(), createBlock(_component_DTPaginator, {\n key: 3,\n rows: $data.d_rows,\n first: $data.d_first,\n totalRecords: $options.totalRecordsLength,\n pageLinkSize: _ctx.pageLinkSize,\n template: _ctx.paginatorTemplate,\n rowsPerPageOptions: _ctx.rowsPerPageOptions,\n currentPageReportTemplate: _ctx.currentPageReportTemplate,\n \"class\": normalizeClass(_ctx.cx('pcPaginator', {\n position: 'bottom'\n })),\n onPage: _cache[43] || (_cache[43] = function ($event) {\n return $options.onPage($event);\n }),\n alwaysShow: _ctx.alwaysShowPaginator,\n unstyled: _ctx.unstyled,\n pt: _ctx.ptm('pcPaginator')\n }, createSlots({\n _: 2\n }, [_ctx.$slots.paginatorcontainer ? {\n name: \"container\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatorcontainer\", {\n first: slotProps.first,\n last: slotProps.last,\n rows: slotProps.rows,\n page: slotProps.page,\n pageCount: slotProps.pageCount,\n totalRecords: slotProps.totalRecords,\n firstPageCallback: slotProps.firstPageCallback,\n lastPageCallback: slotProps.lastPageCallback,\n prevPageCallback: slotProps.prevPageCallback,\n nextPageCallback: slotProps.nextPageCallback,\n rowChangeCallback: slotProps.rowChangeCallback\n })];\n }),\n key: \"0\"\n } : undefined, _ctx.$slots.paginatorstart ? {\n name: \"start\",\n fn: withCtx(function () {\n return [renderSlot(_ctx.$slots, \"paginatorstart\")];\n }),\n key: \"1\"\n } : undefined, _ctx.$slots.paginatorend ? {\n name: \"end\",\n fn: withCtx(function () {\n return [renderSlot(_ctx.$slots, \"paginatorend\")];\n }),\n key: \"2\"\n } : undefined, _ctx.$slots.paginatorfirstpagelinkicon ? {\n name: \"firstpagelinkicon\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatorfirstpagelinkicon\", {\n \"class\": normalizeClass(slotProps[\"class\"])\n })];\n }),\n key: \"3\"\n } : undefined, _ctx.$slots.paginatorprevpagelinkicon ? {\n name: \"prevpagelinkicon\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatorprevpagelinkicon\", {\n \"class\": normalizeClass(slotProps[\"class\"])\n })];\n }),\n key: \"4\"\n } : undefined, _ctx.$slots.paginatornextpagelinkicon ? {\n name: \"nextpagelinkicon\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatornextpagelinkicon\", {\n \"class\": normalizeClass(slotProps[\"class\"])\n })];\n }),\n key: \"5\"\n } : undefined, _ctx.$slots.paginatorlastpagelinkicon ? {\n name: \"lastpagelinkicon\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatorlastpagelinkicon\", {\n \"class\": normalizeClass(slotProps[\"class\"])\n })];\n }),\n key: \"6\"\n } : undefined, _ctx.$slots.paginatorjumptopagedropdownicon ? {\n name: \"jumptopagedropdownicon\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatorjumptopagedropdownicon\", {\n \"class\": normalizeClass(slotProps[\"class\"])\n })];\n }),\n key: \"7\"\n } : undefined, _ctx.$slots.paginatorrowsperpagedropdownicon ? {\n name: \"rowsperpagedropdownicon\",\n fn: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"paginatorrowsperpagedropdownicon\", {\n \"class\": normalizeClass(slotProps[\"class\"])\n })];\n }),\n key: \"8\"\n } : undefined]), 1032, [\"rows\", \"first\", \"totalRecords\", \"pageLinkSize\", \"template\", \"rowsPerPageOptions\", \"currentPageReportTemplate\", \"class\", \"alwaysShow\", \"unstyled\", \"pt\"])) : createCommentVNode(\"\", true), _ctx.$slots.footer ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 4,\n \"class\": _ctx.cx('footer')\n }, _ctx.ptm('footer')), [renderSlot(_ctx.$slots, \"footer\")], 16)) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n ref: \"resizeHelper\",\n \"class\": _ctx.cx('columnResizeIndicator'),\n style: {\n \"display\": \"none\"\n }\n }, _ctx.ptm('columnResizeIndicator')), null, 16), _ctx.reorderableColumns ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 5,\n ref: \"reorderIndicatorUp\",\n \"class\": _ctx.cx('rowReorderIndicatorUp'),\n style: {\n \"position\": \"absolute\",\n \"display\": \"none\"\n }\n }, _ctx.ptm('rowReorderIndicatorUp')), [(openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.rowreorderindicatorupicon || _ctx.$slots.reorderindicatorupicon || 'ArrowDownIcon')))], 16)) : createCommentVNode(\"\", true), _ctx.reorderableColumns ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 6,\n ref: \"reorderIndicatorDown\",\n \"class\": _ctx.cx('rowReorderIndicatorDown'),\n style: {\n \"position\": \"absolute\",\n \"display\": \"none\"\n }\n }, _ctx.ptm('rowReorderIndicatorDown')), [(openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.rowreorderindicatordownicon || _ctx.$slots.reorderindicatordownicon || 'ArrowUpIcon')))], 16)) : createCommentVNode(\"\", true)], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n"],"names":["script$1","BaseComponent","script","BaseIcon","render","createElementVNode","_typeof","o","_defineProperty","_toPropertyKey","_toPrimitive","theme","classes","script$a","provide","script$9","text","render$9","script$8","AngleDoubleLeftIcon","render$8","script$7","Select","render$7","script$6","page","onChange","InputNumber","render$6","script$5","getPTOptions","AngleDoubleRightIcon","render$5","script$4","AngleRightIcon","render$4","script$3","event","_hoisted_1","render$3","onClick","script$2","AngleLeftIcon","render$2","render$1","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","_arrayLikeToArray","r","data","first","mounted","key","pageLinks","last","root","BaseInput","_hoisted_2","_default","CheckIcon","Checkbox","getColumnPT","getColumnProp","RadioButton","next","prev","Button","ChevronDownIcon","ChevronRightIcon","BarsIcon","PencilIcon","TimesIcon","F","e","columnProp","field","data2","onRowEditInit","onRowEditSave","onRowEditCancel","getVirtualScrollerProp","updated","rowIndex","updateStickyPosition","containerClass","containerStyle","HelperSet","beforeUnmount","row","hasFooter","filter","Portal","FilterSlashIcon","FilterIcon","TrashIcon","PlusIcon","onKeyDown","sorted","sortOrder","SortAltIcon","SortAmountUpAltIcon","SortAmountDownIcon","Badge","getColumnGroupPT","getColumnGroupProps","getRowPT","getRowProp","rows","handler","removeEmptyFilters","filterValidEntries","filterConstraint","onRowClick","onRowDblClick","onRowRightClick","onRowTouchEnd","onRowKeyDown","toggleRowWithRadio","toggleRowWithCheckbox","checked","isSelected","findIndexInSelection","findIndex","equals$1","updateTableWidth","isSameColumn","columns","onRowMouseDown","onRowDragStart","onRowDragOver","onRowDragLeave","onRowDragEnd","onRowDrop","processedData","toggleRow","isRowGroupExpanded","reviver","onCellEditInit","onCellEditComplete","onCellEditCancel","onEditingMetaChange","editing","empty","Paginator","VirtualScroller","ArrowDownIcon","ArrowUpIcon","SpinnerIcon"],"mappings":";;;;AAEA,IAAI,cAAc,UAAU,OAAO;AAAA,EACjC,MAAM;AACR,CAAC;ACDD,IAAIA,aAAW;AAAA,EACb,MAAM;AAAA,EACN,WAAWC;AAAAA,EACX,OAAO;AAAA,IACL,WAAW;AAAA,MACT,MAAM;AAAA,MACN,WAAW;AAAA,IACZ;AAAA,IACD,OAAO;AAAA,MACL,MAAM,CAAC,QAAQ,QAAQ;AAAA,MACvB,WAAW;AAAA,IACZ;AAAA,IACD,WAAW;AAAA,MACT,MAAM,CAAC,QAAQ,QAAQ;AAAA,MACvB,WAAW;AAAA,IACZ;AAAA,IACD,aAAa;AAAA,MACX,MAAM,CAAC,QAAQ,QAAQ;AAAA,MACvB,WAAW;AAAA,IACZ;AAAA,IACD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,WAAW;AAAA,IACZ;AAAA,I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,11,12,13,14,15,16,17,18,19]} \ No newline at end of file diff --git a/comfy/web/assets/index-D8hjiWMw.js b/comfy/web/assets/index-D8hjiWMw.js deleted file mode 100644 index 2321aa998..000000000 --- a/comfy/web/assets/index-D8hjiWMw.js +++ /dev/null @@ -1,27 +0,0 @@ -var __defProp = Object.defineProperty; -var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); -import { cu as script$1, o as openBlock, f as createElementBlock, aE as mergeProps, m as createBaseVNode } from "./index-DIgj6hpb.js"; -var script = { - name: "BarsIcon", - "extends": script$1 -}; -function render(_ctx, _cache, $props, $setup, $data, $options) { - return openBlock(), createElementBlock("svg", mergeProps({ - width: "14", - height: "14", - viewBox: "0 0 14 14", - fill: "none", - xmlns: "http://www.w3.org/2000/svg" - }, _ctx.pti()), _cache[0] || (_cache[0] = [createBaseVNode("path", { - "fill-rule": "evenodd", - "clip-rule": "evenodd", - d: "M13.3226 3.6129H0.677419C0.497757 3.6129 0.325452 3.54152 0.198411 3.41448C0.0713707 3.28744 0 3.11514 0 2.93548C0 2.75581 0.0713707 2.58351 0.198411 2.45647C0.325452 2.32943 0.497757 2.25806 0.677419 2.25806H13.3226C13.5022 2.25806 13.6745 2.32943 13.8016 2.45647C13.9286 2.58351 14 2.75581 14 2.93548C14 3.11514 13.9286 3.28744 13.8016 3.41448C13.6745 3.54152 13.5022 3.6129 13.3226 3.6129ZM13.3226 7.67741H0.677419C0.497757 7.67741 0.325452 7.60604 0.198411 7.479C0.0713707 7.35196 0 7.17965 0 6.99999C0 6.82033 0.0713707 6.64802 0.198411 6.52098C0.325452 6.39394 0.497757 6.32257 0.677419 6.32257H13.3226C13.5022 6.32257 13.6745 6.39394 13.8016 6.52098C13.9286 6.64802 14 6.82033 14 6.99999C14 7.17965 13.9286 7.35196 13.8016 7.479C13.6745 7.60604 13.5022 7.67741 13.3226 7.67741ZM0.677419 11.7419H13.3226C13.5022 11.7419 13.6745 11.6706 13.8016 11.5435C13.9286 11.4165 14 11.2442 14 11.0645C14 10.8848 13.9286 10.7125 13.8016 10.5855C13.6745 10.4585 13.5022 10.3871 13.3226 10.3871H0.677419C0.497757 10.3871 0.325452 10.4585 0.198411 10.5855C0.0713707 10.7125 0 10.8848 0 11.0645C0 11.2442 0.0713707 11.4165 0.198411 11.5435C0.325452 11.6706 0.497757 11.7419 0.677419 11.7419Z", - fill: "currentColor" - }, null, -1)]), 16); -} -__name(render, "render"); -script.render = render; -export { - script as s -}; -//# sourceMappingURL=index-D8hjiWMw.js.map diff --git a/comfy/web/assets/index-D8hjiWMw.js.map b/comfy/web/assets/index-D8hjiWMw.js.map deleted file mode 100644 index 31bcc40db..000000000 --- a/comfy/web/assets/index-D8hjiWMw.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-D8hjiWMw.js","sources":["../../../../../node_modules/@primevue/icons/bars/index.mjs"],"sourcesContent":["import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'BarsIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M13.3226 3.6129H0.677419C0.497757 3.6129 0.325452 3.54152 0.198411 3.41448C0.0713707 3.28744 0 3.11514 0 2.93548C0 2.75581 0.0713707 2.58351 0.198411 2.45647C0.325452 2.32943 0.497757 2.25806 0.677419 2.25806H13.3226C13.5022 2.25806 13.6745 2.32943 13.8016 2.45647C13.9286 2.58351 14 2.75581 14 2.93548C14 3.11514 13.9286 3.28744 13.8016 3.41448C13.6745 3.54152 13.5022 3.6129 13.3226 3.6129ZM13.3226 7.67741H0.677419C0.497757 7.67741 0.325452 7.60604 0.198411 7.479C0.0713707 7.35196 0 7.17965 0 6.99999C0 6.82033 0.0713707 6.64802 0.198411 6.52098C0.325452 6.39394 0.497757 6.32257 0.677419 6.32257H13.3226C13.5022 6.32257 13.6745 6.39394 13.8016 6.52098C13.9286 6.64802 14 6.82033 14 6.99999C14 7.17965 13.9286 7.35196 13.8016 7.479C13.6745 7.60604 13.5022 7.67741 13.3226 7.67741ZM0.677419 11.7419H13.3226C13.5022 11.7419 13.6745 11.6706 13.8016 11.5435C13.9286 11.4165 14 11.2442 14 11.0645C14 10.8848 13.9286 10.7125 13.8016 10.5855C13.6745 10.4585 13.5022 10.3871 13.3226 10.3871H0.677419C0.497757 10.3871 0.325452 10.4585 0.198411 10.5855C0.0713707 10.7125 0 10.8848 0 11.0645C0 11.2442 0.0713707 11.4165 0.198411 11.5435C0.325452 11.6706 0.497757 11.7419 0.677419 11.7419Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n"],"names":["BaseIcon","createElementVNode"],"mappings":";;;AAGG,IAAC,SAAS;AAAA,EACX,MAAM;AAAA,EACN,WAAWA;AACb;AAEA,SAAS,OAAO,MAAM,QAAQ,QAAQ,QAAQ,OAAO,UAAU;AAC7D,SAAO,UAAW,GAAE,mBAAmB,OAAO,WAAW;AAAA,IACvD,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,EACR,GAAE,KAAK,KAAK,GAAG,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAACC,gBAAmB,QAAQ;AAAA,IACpE,aAAa;AAAA,IACb,aAAa;AAAA,IACb,GAAG;AAAA,IACH,MAAM;AAAA,EACP,GAAE,MAAM,EAAE,CAAC,IAAI,EAAE;AACpB;AAbS;AAeT,OAAO,SAAS;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/comfy/web/assets/index-DIgj6hpb.js b/comfy/web/assets/index-DIgj6hpb.js deleted file mode 100644 index 53ed32190..000000000 --- a/comfy/web/assets/index-DIgj6hpb.js +++ /dev/null @@ -1,223630 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GraphView-J5fY4zmU.js","./index-DdgRmRKP.js","./index-D8hjiWMw.js","./index-CE2hpomb.js","./keybindingService-CqDMAs0_.js","./serverConfigStore-3t3U367D.js","./GraphView-NWS5Ob8A.css","./UserSelectView-ByltuBH7.js","./BaseViewTemplate-DaGOaycP.js","./ServerStartView-CvFWnVGg.js","./ServerStartView-BLlSvhJ0.css","./InstallView-BwawagSr.js","./index-BKScv1mm.js","./uvMirrors-B-HKMf6X.js","./InstallView-C_PLT5gk.css","./WelcomeView-bWjYcpdL.js","./WelcomeView-aCH40CSK.css","./NotSupportedView-CMCKSnEd.js","./NotSupportedView-BiyVuLfX.css","./DownloadGitView-La5U0bHp.js","./ManualConfigurationView-hsnBcOeR.js","./ManualConfigurationView-Cq3hPfap.css","./MetricsConsentView-CVHnHa_u.js","./DesktopStartView-Dy1mcl-U.js","./MaintenanceView-BFp9KqAr.js","./index-mHcHTYAB.js","./index-Czd3J-KM.js","./index-C_ACzX5-.js","./TerminalOutputDrawer-B_NZxAv8.js","./MaintenanceView-DSwnnc8G.css","./DesktopUpdateView-dW35wQOR.js","./DesktopUpdateView-CoZUcBzh.css","./KeybindingPanel-BetULlhU.js","./KeybindingPanel-CwPLIgAf.css","./ExtensionPanel-CSL3CfyH.js","./ServerConfigPanel-di9WinBR.js","./index-CpICyVZm.js","./index-B8O-6_L7.css"])))=>i.map(i=>d[i]); -var __defProp2 = Object.defineProperty; -var __name = (target2, value4) => __defProp2(target2, "name", { value: value4, configurable: true }); -(/* @__PURE__ */ __name(function polyfill2() { - const relList = document.createElement("link").relList; - if (relList && relList.supports && relList.supports("modulepreload")) { - return; - } - for (const link2 of document.querySelectorAll('link[rel="modulepreload"]')) { - processPreload(link2); - } - new MutationObserver((mutations) => { - for (const mutation of mutations) { - if (mutation.type !== "childList") { - continue; - } - for (const node3 of mutation.addedNodes) { - if (node3.tagName === "LINK" && node3.rel === "modulepreload") - processPreload(node3); - } - } - }).observe(document, { childList: true, subtree: true }); - function getFetchOpts(link2) { - const fetchOpts = {}; - if (link2.integrity) fetchOpts.integrity = link2.integrity; - if (link2.referrerPolicy) fetchOpts.referrerPolicy = link2.referrerPolicy; - if (link2.crossOrigin === "use-credentials") - fetchOpts.credentials = "include"; - else if (link2.crossOrigin === "anonymous") fetchOpts.credentials = "omit"; - else fetchOpts.credentials = "same-origin"; - return fetchOpts; - } - __name(getFetchOpts, "getFetchOpts"); - function processPreload(link2) { - if (link2.ep) - return; - link2.ep = true; - const fetchOpts = getFetchOpts(link2); - fetch(link2.href, fetchOpts); - } - __name(processPreload, "processPreload"); -}, "polyfill"))(); -var __defProp$3 = Object.defineProperty; -var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols; -var __hasOwnProp$2 = Object.prototype.hasOwnProperty; -var __propIsEnum$2 = Object.prototype.propertyIsEnumerable; -var __defNormalProp$3 = /* @__PURE__ */ __name((obj, key, value4) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value: value4 }) : obj[key] = value4, "__defNormalProp$3"); -var __spreadValues$2 = /* @__PURE__ */ __name((a2, b2) => { - for (var prop2 in b2 || (b2 = {})) - if (__hasOwnProp$2.call(b2, prop2)) - __defNormalProp$3(a2, prop2, b2[prop2]); - if (__getOwnPropSymbols$2) - for (var prop2 of __getOwnPropSymbols$2(b2)) { - if (__propIsEnum$2.call(b2, prop2)) - __defNormalProp$3(a2, prop2, b2[prop2]); - } - return a2; -}, "__spreadValues$2"); -function isEmpty$1(value4) { - return value4 === null || value4 === void 0 || value4 === "" || Array.isArray(value4) && value4.length === 0 || !(value4 instanceof Date) && typeof value4 === "object" && Object.keys(value4).length === 0; -} -__name(isEmpty$1, "isEmpty$1"); -function compare$1(value1, value22, comparator, order = 1) { - let result = -1; - const emptyValue1 = isEmpty$1(value1); - const emptyValue2 = isEmpty$1(value22); - if (emptyValue1 && emptyValue2) result = 0; - else if (emptyValue1) result = order; - else if (emptyValue2) result = -order; - else if (typeof value1 === "string" && typeof value22 === "string") result = comparator(value1, value22); - else result = value1 < value22 ? -1 : value1 > value22 ? 1 : 0; - return result; -} -__name(compare$1, "compare$1"); -function _deepEquals(obj1, obj2, visited = /* @__PURE__ */ new WeakSet()) { - if (obj1 === obj2) return true; - if (!obj1 || !obj2 || typeof obj1 !== "object" || typeof obj2 !== "object") return false; - if (visited.has(obj1) || visited.has(obj2)) return false; - visited.add(obj1).add(obj2); - let arrObj1 = Array.isArray(obj1), arrObj2 = Array.isArray(obj2), i2, length, key; - if (arrObj1 && arrObj2) { - length = obj1.length; - if (length != obj2.length) return false; - for (i2 = length; i2-- !== 0; ) if (!_deepEquals(obj1[i2], obj2[i2], visited)) return false; - return true; - } - if (arrObj1 != arrObj2) return false; - let dateObj1 = obj1 instanceof Date, dateObj2 = obj2 instanceof Date; - if (dateObj1 != dateObj2) return false; - if (dateObj1 && dateObj2) return obj1.getTime() == obj2.getTime(); - let regexpObj1 = obj1 instanceof RegExp, regexpObj2 = obj2 instanceof RegExp; - if (regexpObj1 != regexpObj2) return false; - if (regexpObj1 && regexpObj2) return obj1.toString() == obj2.toString(); - let keys2 = Object.keys(obj1); - length = keys2.length; - if (length !== Object.keys(obj2).length) return false; - for (i2 = length; i2-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(obj2, keys2[i2])) return false; - for (i2 = length; i2-- !== 0; ) { - key = keys2[i2]; - if (!_deepEquals(obj1[key], obj2[key], visited)) return false; - } - return true; -} -__name(_deepEquals, "_deepEquals"); -function deepEquals(obj1, obj2) { - return _deepEquals(obj1, obj2); -} -__name(deepEquals, "deepEquals"); -function isFunction$b(value4) { - return !!(value4 && value4.constructor && value4.call && value4.apply); -} -__name(isFunction$b, "isFunction$b"); -function isNotEmpty(value4) { - return !isEmpty$1(value4); -} -__name(isNotEmpty, "isNotEmpty"); -function resolveFieldData(data26, field2) { - if (!data26 || !field2) { - return null; - } - try { - const value4 = data26[field2]; - if (isNotEmpty(value4)) return value4; - } catch (e2) { - } - if (Object.keys(data26).length) { - if (isFunction$b(field2)) { - return field2(data26); - } else if (field2.indexOf(".") === -1) { - return data26[field2]; - } else { - let fields = field2.split("."); - let value4 = data26; - for (let i2 = 0, len = fields.length; i2 < len; ++i2) { - if (value4 == null) { - return null; - } - value4 = value4[fields[i2]]; - } - return value4; - } - } - return null; -} -__name(resolveFieldData, "resolveFieldData"); -function equals(obj1, obj2, field2) { - if (field2) return resolveFieldData(obj1, field2) === resolveFieldData(obj2, field2); - else return deepEquals(obj1, obj2); -} -__name(equals, "equals"); -function contains(value4, list2) { - if (value4 != null && list2 && list2.length) { - for (let val of list2) { - if (equals(value4, val)) return true; - } - } - return false; -} -__name(contains, "contains"); -function filter(value4, fields, filterValue) { - let filteredItems = []; - if (value4) { - for (let item3 of value4) { - for (let field2 of fields) { - if (String(resolveFieldData(item3, field2)).toLowerCase().indexOf(filterValue.toLowerCase()) > -1) { - filteredItems.push(item3); - break; - } - } - } - } - return filteredItems; -} -__name(filter, "filter"); -function findIndexInList(value4, list2) { - let index2 = -1; - if (list2) { - for (let i2 = 0; i2 < list2.length; i2++) { - if (list2[i2] === value4) { - index2 = i2; - break; - } - } - } - return index2; -} -__name(findIndexInList, "findIndexInList"); -function findLast$1(arr, callback) { - let item3; - if (isNotEmpty(arr)) { - try { - item3 = arr.findLast(callback); - } catch (e2) { - item3 = [...arr].reverse().find(callback); - } - } - return item3; -} -__name(findLast$1, "findLast$1"); -function findLastIndex(arr, callback) { - let index2 = -1; - if (isNotEmpty(arr)) { - try { - index2 = arr.findLastIndex(callback); - } catch (e2) { - index2 = arr.lastIndexOf([...arr].reverse().find(callback)); - } - } - return index2; -} -__name(findLastIndex, "findLastIndex"); -function isObject$f(value4, empty3 = true) { - return value4 instanceof Object && value4.constructor === Object && (empty3 || Object.keys(value4).length !== 0); -} -__name(isObject$f, "isObject$f"); -function resolve$2(obj, ...params) { - return isFunction$b(obj) ? obj(...params) : obj; -} -__name(resolve$2, "resolve$2"); -function isString$b(value4, empty3 = true) { - return typeof value4 === "string" && (empty3 || value4 !== ""); -} -__name(isString$b, "isString$b"); -function toFlatCase(str) { - return isString$b(str) ? str.replace(/(-|_)/g, "").toLowerCase() : str; -} -__name(toFlatCase, "toFlatCase"); -function getKeyValue(obj, key = "", params = {}) { - const fKeys = toFlatCase(key).split("."); - const fKey = fKeys.shift(); - return fKey ? isObject$f(obj) ? getKeyValue(resolve$2(obj[Object.keys(obj).find((k2) => toFlatCase(k2) === fKey) || ""], params), fKeys.join("."), params) : void 0 : resolve$2(obj, params); -} -__name(getKeyValue, "getKeyValue"); -function insertIntoOrderedArray(item3, index2, arr, sourceArr) { - if (arr.length > 0) { - let injected = false; - for (let i2 = 0; i2 < arr.length; i2++) { - let currentItemIndex = findIndexInList(arr[i2], sourceArr); - if (currentItemIndex > index2) { - arr.splice(i2, 0, item3); - injected = true; - break; - } - } - if (!injected) { - arr.push(item3); - } - } else { - arr.push(item3); - } -} -__name(insertIntoOrderedArray, "insertIntoOrderedArray"); -function isArray$a(value4, empty3 = true) { - return Array.isArray(value4) && (empty3 || value4.length !== 0); -} -__name(isArray$a, "isArray$a"); -function isDate$3(value4) { - return value4 instanceof Date && value4.constructor === Date; -} -__name(isDate$3, "isDate$3"); -function isLetter$2(char) { - return /^[a-zA-Z\u00C0-\u017F]$/.test(char); -} -__name(isLetter$2, "isLetter$2"); -function isNumber$5(value4) { - return isNotEmpty(value4) && !isNaN(value4); -} -__name(isNumber$5, "isNumber$5"); -function isPrintableCharacter(char = "") { - return isNotEmpty(char) && char.length === 1 && !!char.match(/\S| /); -} -__name(isPrintableCharacter, "isPrintableCharacter"); -function isScalar(value4) { - return value4 != null && (typeof value4 === "string" || typeof value4 === "number" || typeof value4 === "bigint" || typeof value4 === "boolean"); -} -__name(isScalar, "isScalar"); -function localeComparator() { - return new Intl.Collator(void 0, { numeric: true }).compare; -} -__name(localeComparator, "localeComparator"); -function matchRegex(str, regex2) { - if (regex2) { - const match3 = regex2.test(str); - regex2.lastIndex = 0; - return match3; - } - return false; -} -__name(matchRegex, "matchRegex"); -function mergeKeys(...args) { - const _mergeKeys = /* @__PURE__ */ __name((target2 = {}, source = {}) => { - const mergedObj = __spreadValues$2({}, target2); - Object.keys(source).forEach((key) => { - if (isObject$f(source[key]) && key in target2 && isObject$f(target2[key])) { - mergedObj[key] = _mergeKeys(target2[key], source[key]); - } else { - mergedObj[key] = source[key]; - } - }); - return mergedObj; - }, "_mergeKeys"); - return args.reduce((acc, obj, i2) => i2 === 0 ? obj : _mergeKeys(acc, obj), {}); -} -__name(mergeKeys, "mergeKeys"); -function minifyCSS(css3) { - return css3 ? css3.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/ ([{:}]) /g, "$1").replace(/([;,]) /g, "$1").replace(/ !/g, "!").replace(/: /g, ":") : css3; -} -__name(minifyCSS, "minifyCSS"); -function nestedKeys(obj = {}, parentKey = "") { - return Object.entries(obj).reduce((o2, [key, value4]) => { - const currentKey = parentKey ? `${parentKey}.${key}` : key; - isObject$f(value4) ? o2 = o2.concat(nestedKeys(value4, currentKey)) : o2.push(currentKey); - return o2; - }, []); -} -__name(nestedKeys, "nestedKeys"); -function omit$1(obj, ...keys2) { - if (!isObject$f(obj)) return obj; - const copy2 = __spreadValues$2({}, obj); - keys2 == null ? void 0 : keys2.flat().forEach((key) => delete copy2[key]); - return copy2; -} -__name(omit$1, "omit$1"); -function removeAccents(str) { - const accentCheckRegex = /[\xC0-\xFF\u0100-\u017E]/; - if (str && accentCheckRegex.test(str)) { - const accentsMap = { - A: /[\xC0-\xC5\u0100\u0102\u0104]/g, - AE: /[\xC6]/g, - C: /[\xC7\u0106\u0108\u010A\u010C]/g, - D: /[\xD0\u010E\u0110]/g, - E: /[\xC8-\xCB\u0112\u0114\u0116\u0118\u011A]/g, - G: /[\u011C\u011E\u0120\u0122]/g, - H: /[\u0124\u0126]/g, - I: /[\xCC-\xCF\u0128\u012A\u012C\u012E\u0130]/g, - IJ: /[\u0132]/g, - J: /[\u0134]/g, - K: /[\u0136]/g, - L: /[\u0139\u013B\u013D\u013F\u0141]/g, - N: /[\xD1\u0143\u0145\u0147\u014A]/g, - O: /[\xD2-\xD6\xD8\u014C\u014E\u0150]/g, - OE: /[\u0152]/g, - R: /[\u0154\u0156\u0158]/g, - S: /[\u015A\u015C\u015E\u0160]/g, - T: /[\u0162\u0164\u0166]/g, - U: /[\xD9-\xDC\u0168\u016A\u016C\u016E\u0170\u0172]/g, - W: /[\u0174]/g, - Y: /[\xDD\u0176\u0178]/g, - Z: /[\u0179\u017B\u017D]/g, - a: /[\xE0-\xE5\u0101\u0103\u0105]/g, - ae: /[\xE6]/g, - c: /[\xE7\u0107\u0109\u010B\u010D]/g, - d: /[\u010F\u0111]/g, - e: /[\xE8-\xEB\u0113\u0115\u0117\u0119\u011B]/g, - g: /[\u011D\u011F\u0121\u0123]/g, - i: /[\xEC-\xEF\u0129\u012B\u012D\u012F\u0131]/g, - ij: /[\u0133]/g, - j: /[\u0135]/g, - k: /[\u0137,\u0138]/g, - l: /[\u013A\u013C\u013E\u0140\u0142]/g, - n: /[\xF1\u0144\u0146\u0148\u014B]/g, - p: /[\xFE]/g, - o: /[\xF2-\xF6\xF8\u014D\u014F\u0151]/g, - oe: /[\u0153]/g, - r: /[\u0155\u0157\u0159]/g, - s: /[\u015B\u015D\u015F\u0161]/g, - t: /[\u0163\u0165\u0167]/g, - u: /[\xF9-\xFC\u0169\u016B\u016D\u016F\u0171\u0173]/g, - w: /[\u0175]/g, - y: /[\xFD\xFF\u0177]/g, - z: /[\u017A\u017C\u017E]/g - }; - for (let key in accentsMap) { - str = str.replace(accentsMap[key], key); - } - } - return str; -} -__name(removeAccents, "removeAccents"); -function reorderArray(value4, from2, to) { - if (value4 && from2 !== to) { - if (to >= value4.length) { - to %= value4.length; - from2 %= value4.length; - } - value4.splice(to, 0, value4.splice(from2, 1)[0]); - } -} -__name(reorderArray, "reorderArray"); -function sort(value1, value22, order = 1, comparator, nullSortOrder = 1) { - const result = compare$1(value1, value22, comparator, order); - let finalSortOrder = order; - if (isEmpty$1(value1) || isEmpty$1(value22)) { - finalSortOrder = nullSortOrder === 1 ? order : nullSortOrder; - } - return finalSortOrder * result; -} -__name(sort, "sort"); -function stringify(value4, indent = 2, currentIndent = 0) { - const currentIndentStr = " ".repeat(currentIndent); - const nextIndentStr = " ".repeat(currentIndent + indent); - if (isArray$a(value4)) { - return "[" + value4.map((v2) => stringify(v2, indent, currentIndent + indent)).join(", ") + "]"; - } else if (isDate$3(value4)) { - return value4.toISOString(); - } else if (isFunction$b(value4)) { - return value4.toString(); - } else if (isObject$f(value4)) { - return "{\n" + Object.entries(value4).map(([k2, v2]) => `${nextIndentStr}${k2}: ${stringify(v2, indent, currentIndent + indent)}`).join(",\n") + ` -${currentIndentStr}}`; - } else { - return JSON.stringify(value4); - } -} -__name(stringify, "stringify"); -function toCapitalCase(str) { - return isString$b(str, false) ? str[0].toUpperCase() + str.slice(1) : str; -} -__name(toCapitalCase, "toCapitalCase"); -function toKebabCase(str) { - return isString$b(str) ? str.replace(/(_)/g, "-").replace(/[A-Z]/g, (c2, i2) => i2 === 0 ? c2 : "-" + c2.toLowerCase()).toLowerCase() : str; -} -__name(toKebabCase, "toKebabCase"); -function toTokenKey$1(str) { - return isString$b(str) ? str.replace(/[A-Z]/g, (c2, i2) => i2 === 0 ? c2 : "." + c2.toLowerCase()).toLowerCase() : str; -} -__name(toTokenKey$1, "toTokenKey$1"); -function toValue$3(value4) { - if (value4 && typeof value4 === "object") { - if (value4.hasOwnProperty("current")) { - return value4.current; - } else if (value4.hasOwnProperty("value")) { - return value4.value; - } - } - return resolve$2(value4); -} -__name(toValue$3, "toValue$3"); -function EventBus() { - const allHandlers = /* @__PURE__ */ new Map(); - return { - on(type, handler10) { - let handlers2 = allHandlers.get(type); - if (!handlers2) handlers2 = [handler10]; - else handlers2.push(handler10); - allHandlers.set(type, handlers2); - return this; - }, - off(type, handler10) { - let handlers2 = allHandlers.get(type); - if (handlers2) { - handlers2.splice(handlers2.indexOf(handler10) >>> 0, 1); - } - return this; - }, - emit(type, evt) { - let handlers2 = allHandlers.get(type); - if (handlers2) { - handlers2.slice().map((handler10) => { - handler10(evt); - }); - } - }, - clear() { - allHandlers.clear(); - } - }; -} -__name(EventBus, "EventBus"); -var __defProp$2 = Object.defineProperty; -var __defProps = Object.defineProperties; -var __getOwnPropDescs = Object.getOwnPropertyDescriptors; -var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols; -var __hasOwnProp$1 = Object.prototype.hasOwnProperty; -var __propIsEnum$1 = Object.prototype.propertyIsEnumerable; -var __defNormalProp$2 = /* @__PURE__ */ __name((obj, key, value4) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value: value4 }) : obj[key] = value4, "__defNormalProp$2"); -var __spreadValues$1 = /* @__PURE__ */ __name((a2, b2) => { - for (var prop2 in b2 || (b2 = {})) - if (__hasOwnProp$1.call(b2, prop2)) - __defNormalProp$2(a2, prop2, b2[prop2]); - if (__getOwnPropSymbols$1) - for (var prop2 of __getOwnPropSymbols$1(b2)) { - if (__propIsEnum$1.call(b2, prop2)) - __defNormalProp$2(a2, prop2, b2[prop2]); - } - return a2; -}, "__spreadValues$1"); -var __spreadProps = /* @__PURE__ */ __name((a2, b2) => __defProps(a2, __getOwnPropDescs(b2)), "__spreadProps"); -var __objRest = /* @__PURE__ */ __name((source, exclude) => { - var target2 = {}; - for (var prop2 in source) - if (__hasOwnProp$1.call(source, prop2) && exclude.indexOf(prop2) < 0) - target2[prop2] = source[prop2]; - if (source != null && __getOwnPropSymbols$1) - for (var prop2 of __getOwnPropSymbols$1(source)) { - if (exclude.indexOf(prop2) < 0 && __propIsEnum$1.call(source, prop2)) - target2[prop2] = source[prop2]; - } - return target2; -}, "__objRest"); -function definePreset(...presets) { - return mergeKeys(...presets); -} -__name(definePreset, "definePreset"); -var ThemeService = EventBus(); -var service_default = ThemeService; -function toTokenKey(str) { - return isString$b(str) ? str.replace(/[A-Z]/g, (c2, i2) => i2 === 0 ? c2 : "." + c2.toLowerCase()).toLowerCase() : str; -} -__name(toTokenKey, "toTokenKey"); -function merge$2(value1, value22) { - if (isArray$a(value1)) { - value1.push(...value22 || []); - } else if (isObject$f(value1)) { - Object.assign(value1, value22); - } -} -__name(merge$2, "merge$2"); -function toValue$2(value4) { - return isObject$f(value4) && value4.hasOwnProperty("value") && value4.hasOwnProperty("type") ? value4.value : value4; -} -__name(toValue$2, "toValue$2"); -function toUnit(value4, variable = "") { - const excludedProperties = ["opacity", "z-index", "line-height", "font-weight", "flex", "flex-grow", "flex-shrink", "order"]; - if (!excludedProperties.some((property) => variable.endsWith(property))) { - const val = `${value4}`.trim(); - const valArr = val.split(" "); - return valArr.map((v2) => isNumber$5(v2) ? `${v2}px` : v2).join(" "); - } - return value4; -} -__name(toUnit, "toUnit"); -function toNormalizePrefix(prefix2) { - return prefix2.replaceAll(/ /g, "").replace(/[^\w]/g, "-"); -} -__name(toNormalizePrefix, "toNormalizePrefix"); -function toNormalizeVariable(prefix2 = "", variable = "") { - return toNormalizePrefix(`${isString$b(prefix2, false) && isString$b(variable, false) ? `${prefix2}-` : prefix2}${variable}`); -} -__name(toNormalizeVariable, "toNormalizeVariable"); -function getVariableName(prefix2 = "", variable = "") { - return `--${toNormalizeVariable(prefix2, variable)}`; -} -__name(getVariableName, "getVariableName"); -function hasOddBraces(str = "") { - const openBraces = (str.match(/{/g) || []).length; - const closeBraces = (str.match(/}/g) || []).length; - return (openBraces + closeBraces) % 2 !== 0; -} -__name(hasOddBraces, "hasOddBraces"); -function getVariableValue(value4, variable = "", prefix2 = "", excludedKeyRegexes = [], fallback) { - if (isString$b(value4)) { - const regex2 = /{([^}]*)}/g; - const val = value4.trim(); - if (hasOddBraces(val)) { - return void 0; - } else if (matchRegex(val, regex2)) { - const _val = val.replaceAll(regex2, (v2) => { - const path = v2.replace(/{|}/g, ""); - const keys2 = path.split(".").filter((_v) => !excludedKeyRegexes.some((_r) => matchRegex(_v, _r))); - return `var(${getVariableName(prefix2, toKebabCase(keys2.join("-")))}${isNotEmpty(fallback) ? `, ${fallback}` : ""})`; - }); - const calculationRegex = /(\d+\s+[\+\-\*\/]\s+\d+)/g; - const cleanedVarRegex = /var\([^)]+\)/g; - return matchRegex(_val.replace(cleanedVarRegex, "0"), calculationRegex) ? `calc(${_val})` : _val; - } - return val; - } else if (isNumber$5(value4)) { - return value4; - } - return void 0; -} -__name(getVariableValue, "getVariableValue"); -function getComputedValue(obj = {}, value4) { - if (isString$b(value4)) { - const regex2 = /{([^}]*)}/g; - const val = value4.trim(); - return matchRegex(val, regex2) ? val.replaceAll(regex2, (v2) => getKeyValue(obj, v2.replace(/{|}/g, ""))) : val; - } else if (isNumber$5(value4)) { - return value4; - } - return void 0; -} -__name(getComputedValue, "getComputedValue"); -function setProperty(properties, key, value4) { - if (isString$b(key, false)) { - properties.push(`${key}:${value4};`); - } -} -__name(setProperty, "setProperty"); -function getRule(selector, properties) { - if (selector) { - return `${selector}{${properties}}`; - } - return ""; -} -__name(getRule, "getRule"); -function normalizeColor(color2) { - if (color2.length === 4) { - return `#${color2[1]}${color2[1]}${color2[2]}${color2[2]}${color2[3]}${color2[3]}`; - } - return color2; -} -__name(normalizeColor, "normalizeColor"); -function hexToRgb$1(hex) { - var bigint = parseInt(hex.substring(1), 16); - var r2 = bigint >> 16 & 255; - var g2 = bigint >> 8 & 255; - var b2 = bigint & 255; - return { r: r2, g: g2, b: b2 }; -} -__name(hexToRgb$1, "hexToRgb$1"); -function rgbToHex(r2, g2, b2) { - return `#${r2.toString(16).padStart(2, "0")}${g2.toString(16).padStart(2, "0")}${b2.toString(16).padStart(2, "0")}`; -} -__name(rgbToHex, "rgbToHex"); -var mix_default = /* @__PURE__ */ __name((color1, color2, weight) => { - color1 = normalizeColor(color1); - color2 = normalizeColor(color2); - var p2 = weight / 100; - var w2 = p2 * 2 - 1; - var w1 = (w2 + 1) / 2; - var w22 = 1 - w1; - var rgb1 = hexToRgb$1(color1); - var rgb2 = hexToRgb$1(color2); - var r2 = Math.round(rgb1.r * w1 + rgb2.r * w22); - var g2 = Math.round(rgb1.g * w1 + rgb2.g * w22); - var b2 = Math.round(rgb1.b * w1 + rgb2.b * w22); - return rgbToHex(r2, g2, b2); -}, "mix_default"); -var shade_default = /* @__PURE__ */ __name((color2, percent) => mix_default("#000000", color2, percent), "shade_default"); -var tint_default = /* @__PURE__ */ __name((color2, percent) => mix_default("#ffffff", color2, percent), "tint_default"); -var scales = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950]; -var palette_default = /* @__PURE__ */ __name((color2) => { - if (/{([^}]*)}/g.test(color2)) { - const token = color2.replace(/{|}/g, ""); - return scales.reduce((acc, scale) => (acc[scale] = `{${token}.${scale}}`, acc), {}); - } - return typeof color2 === "string" ? scales.reduce((acc, scale, i2) => (acc[scale] = i2 <= 5 ? tint_default(color2, (5 - i2) * 19) : shade_default(color2, (i2 - 5) * 15), acc), {}) : color2; -}, "palette_default"); -var $dt = /* @__PURE__ */ __name((tokenPath) => { - var _a2; - const theme42 = config_default.getTheme(); - const variable = dtwt(theme42, tokenPath, void 0, "variable"); - const name2 = (_a2 = variable == null ? void 0 : variable.match(/--[\w-]+/g)) == null ? void 0 : _a2[0]; - const value4 = dtwt(theme42, tokenPath, void 0, "value"); - return { - name: name2, - variable, - value: value4 - }; -}, "$dt"); -var dt = /* @__PURE__ */ __name((...args) => { - return dtwt(config_default.getTheme(), ...args); -}, "dt"); -var dtwt = /* @__PURE__ */ __name((theme42 = {}, tokenPath, fallback, type) => { - if (tokenPath) { - const { variable: VARIABLE, options: OPTIONS } = config_default.defaults || {}; - const { prefix: prefix2, transform: transform2 } = (theme42 == null ? void 0 : theme42.options) || OPTIONS || {}; - const regex2 = /{([^}]*)}/g; - const token = matchRegex(tokenPath, regex2) ? tokenPath : `{${tokenPath}}`; - const isStrictTransform = type === "value" || isEmpty$1(type) && transform2 === "strict"; - return isStrictTransform ? config_default.getTokenValue(tokenPath) : getVariableValue(token, void 0, prefix2, [VARIABLE.excludedKeyRegex], fallback); - } - return ""; -}, "dtwt"); -function css$3(style2) { - return resolve$2(style2, { dt }); -} -__name(css$3, "css$3"); -var $t = /* @__PURE__ */ __name((theme42 = {}) => { - let { preset: _preset, options: _options } = theme42; - return { - preset(value4) { - _preset = _preset ? mergeKeys(_preset, value4) : value4; - return this; - }, - options(value4) { - _options = _options ? __spreadValues$1(__spreadValues$1({}, _options), value4) : value4; - return this; - }, - // features - primaryPalette(primary) { - const { semantic } = _preset || {}; - _preset = __spreadProps(__spreadValues$1({}, _preset), { semantic: __spreadProps(__spreadValues$1({}, semantic), { primary }) }); - return this; - }, - surfacePalette(surface) { - var _a2, _b; - const { semantic } = _preset || {}; - const lightSurface = (surface == null ? void 0 : surface.hasOwnProperty("light")) ? surface == null ? void 0 : surface.light : surface; - const darkSurface = (surface == null ? void 0 : surface.hasOwnProperty("dark")) ? surface == null ? void 0 : surface.dark : surface; - const newColorScheme = { - colorScheme: { - light: __spreadValues$1(__spreadValues$1({}, (_a2 = semantic == null ? void 0 : semantic.colorScheme) == null ? void 0 : _a2.light), !!lightSurface && { surface: lightSurface }), - dark: __spreadValues$1(__spreadValues$1({}, (_b = semantic == null ? void 0 : semantic.colorScheme) == null ? void 0 : _b.dark), !!darkSurface && { surface: darkSurface }) - } - }; - _preset = __spreadProps(__spreadValues$1({}, _preset), { semantic: __spreadValues$1(__spreadValues$1({}, semantic), newColorScheme) }); - return this; - }, - // actions - define({ useDefaultPreset = false, useDefaultOptions = false } = {}) { - return { - preset: useDefaultPreset ? config_default.getPreset() : _preset, - options: useDefaultOptions ? config_default.getOptions() : _options - }; - }, - update({ mergePresets = true, mergeOptions: mergeOptions2 = true } = {}) { - const newTheme = { - preset: mergePresets ? mergeKeys(config_default.getPreset(), _preset) : _preset, - options: mergeOptions2 ? __spreadValues$1(__spreadValues$1({}, config_default.getOptions()), _options) : _options - }; - config_default.setTheme(newTheme); - return newTheme; - }, - use(options4) { - const newTheme = this.define(options4); - config_default.setTheme(newTheme); - return newTheme; - } - }; -}, "$t"); -function toVariables_default(theme42, options4 = {}) { - const VARIABLE = config_default.defaults.variable; - const { prefix: prefix2 = VARIABLE.prefix, selector = VARIABLE.selector, excludedKeyRegex = VARIABLE.excludedKeyRegex } = options4; - const _toVariables = /* @__PURE__ */ __name((_theme, _prefix = "") => { - return Object.entries(_theme).reduce( - (acc, [key, value4]) => { - const px = matchRegex(key, excludedKeyRegex) ? toNormalizeVariable(_prefix) : toNormalizeVariable(_prefix, toKebabCase(key)); - const v2 = toValue$2(value4); - if (isObject$f(v2)) { - const { variables: variables2, tokens: tokens2 } = _toVariables(v2, px); - merge$2(acc["tokens"], tokens2); - merge$2(acc["variables"], variables2); - } else { - acc["tokens"].push((prefix2 ? px.replace(`${prefix2}-`, "") : px).replaceAll("-", ".")); - setProperty(acc["variables"], getVariableName(px), getVariableValue(v2, px, prefix2, [excludedKeyRegex])); - } - return acc; - }, - { variables: [], tokens: [] } - ); - }, "_toVariables"); - const { variables, tokens } = _toVariables(theme42, prefix2); - return { - value: variables, - tokens, - declarations: variables.join(""), - css: getRule(selector, variables.join("")) - }; -} -__name(toVariables_default, "toVariables_default"); -var themeUtils_default = { - regex: { - rules: { - class: { - pattern: /^\.([a-zA-Z][\w-]*)$/, - resolve(value4) { - return { type: "class", selector: value4, matched: this.pattern.test(value4.trim()) }; - } - }, - attr: { - pattern: /^\[(.*)\]$/, - resolve(value4) { - return { type: "attr", selector: `:root${value4}`, matched: this.pattern.test(value4.trim()) }; - } - }, - media: { - pattern: /^@media (.*)$/, - resolve(value4) { - return { type: "media", selector: `${value4}{:root{[CSS]}}`, matched: this.pattern.test(value4.trim()) }; - } - }, - system: { - pattern: /^system$/, - resolve(value4) { - return { type: "system", selector: "@media (prefers-color-scheme: dark){:root{[CSS]}}", matched: this.pattern.test(value4.trim()) }; - } - }, - custom: { - resolve(value4) { - return { type: "custom", selector: value4, matched: true }; - } - } - }, - resolve(value4) { - const rules = Object.keys(this.rules).filter((k2) => k2 !== "custom").map((r2) => this.rules[r2]); - return [value4].flat().map((v2) => { - var _a2; - return (_a2 = rules.map((r2) => r2.resolve(v2)).find((rr) => rr.matched)) != null ? _a2 : this.rules.custom.resolve(v2); - }); - } - }, - _toVariables(theme42, options4) { - return toVariables_default(theme42, { prefix: options4 == null ? void 0 : options4.prefix }); - }, - getCommon({ name: name2 = "", theme: theme42 = {}, params, set: set4, defaults: defaults2 }) { - var _e, _f, _g, _h, _i, _j, _k; - const { preset, options: options4 } = theme42; - let primitive_css, primitive_tokens, semantic_css, semantic_tokens, global_css, global_tokens, style2; - if (isNotEmpty(preset) && options4.transform !== "strict") { - const { primitive, semantic, extend: extend4 } = preset; - const _a2 = semantic || {}, { colorScheme } = _a2, sRest = __objRest(_a2, ["colorScheme"]); - const _b = extend4 || {}, { colorScheme: eColorScheme } = _b, eRest = __objRest(_b, ["colorScheme"]); - const _c = colorScheme || {}, { dark: dark2 } = _c, csRest = __objRest(_c, ["dark"]); - const _d = eColorScheme || {}, { dark: eDark } = _d, ecsRest = __objRest(_d, ["dark"]); - const prim_var = isNotEmpty(primitive) ? this._toVariables({ primitive }, options4) : {}; - const sRest_var = isNotEmpty(sRest) ? this._toVariables({ semantic: sRest }, options4) : {}; - const csRest_var = isNotEmpty(csRest) ? this._toVariables({ light: csRest }, options4) : {}; - const csDark_var = isNotEmpty(dark2) ? this._toVariables({ dark: dark2 }, options4) : {}; - const eRest_var = isNotEmpty(eRest) ? this._toVariables({ semantic: eRest }, options4) : {}; - const ecsRest_var = isNotEmpty(ecsRest) ? this._toVariables({ light: ecsRest }, options4) : {}; - const ecsDark_var = isNotEmpty(eDark) ? this._toVariables({ dark: eDark }, options4) : {}; - const [prim_css, prim_tokens] = [(_e = prim_var.declarations) != null ? _e : "", prim_var.tokens]; - const [sRest_css, sRest_tokens] = [(_f = sRest_var.declarations) != null ? _f : "", sRest_var.tokens || []]; - const [csRest_css, csRest_tokens] = [(_g = csRest_var.declarations) != null ? _g : "", csRest_var.tokens || []]; - const [csDark_css, csDark_tokens] = [(_h = csDark_var.declarations) != null ? _h : "", csDark_var.tokens || []]; - const [eRest_css, eRest_tokens] = [(_i = eRest_var.declarations) != null ? _i : "", eRest_var.tokens || []]; - const [ecsRest_css, ecsRest_tokens] = [(_j = ecsRest_var.declarations) != null ? _j : "", ecsRest_var.tokens || []]; - const [ecsDark_css, ecsDark_tokens] = [(_k = ecsDark_var.declarations) != null ? _k : "", ecsDark_var.tokens || []]; - primitive_css = this.transformCSS(name2, prim_css, "light", "variable", options4, set4, defaults2); - primitive_tokens = prim_tokens; - const semantic_light_css = this.transformCSS(name2, `${sRest_css}${csRest_css}`, "light", "variable", options4, set4, defaults2); - const semantic_dark_css = this.transformCSS(name2, `${csDark_css}`, "dark", "variable", options4, set4, defaults2); - semantic_css = `${semantic_light_css}${semantic_dark_css}`; - semantic_tokens = [.../* @__PURE__ */ new Set([...sRest_tokens, ...csRest_tokens, ...csDark_tokens])]; - const global_light_css = this.transformCSS(name2, `${eRest_css}${ecsRest_css}color-scheme:light`, "light", "variable", options4, set4, defaults2); - const global_dark_css = this.transformCSS(name2, `${ecsDark_css}color-scheme:dark`, "dark", "variable", options4, set4, defaults2); - global_css = `${global_light_css}${global_dark_css}`; - global_tokens = [.../* @__PURE__ */ new Set([...eRest_tokens, ...ecsRest_tokens, ...ecsDark_tokens])]; - style2 = resolve$2(preset.css, { dt }); - } - return { - primitive: { - css: primitive_css, - tokens: primitive_tokens - }, - semantic: { - css: semantic_css, - tokens: semantic_tokens - }, - global: { - css: global_css, - tokens: global_tokens - }, - style: style2 - }; - }, - getPreset({ name: name2 = "", preset = {}, options: options4, params, set: set4, defaults: defaults2, selector }) { - var _e, _f, _g; - let p_css, p_tokens, p_style; - if (isNotEmpty(preset) && options4.transform !== "strict") { - const _name = name2.replace("-directive", ""); - const _a2 = preset, { colorScheme, extend: extend4, css: css22 } = _a2, vRest = __objRest(_a2, ["colorScheme", "extend", "css"]); - const _b = extend4 || {}, { colorScheme: eColorScheme } = _b, evRest = __objRest(_b, ["colorScheme"]); - const _c = colorScheme || {}, { dark: dark2 } = _c, csRest = __objRest(_c, ["dark"]); - const _d = eColorScheme || {}, { dark: ecsDark } = _d, ecsRest = __objRest(_d, ["dark"]); - const vRest_var = isNotEmpty(vRest) ? this._toVariables({ [_name]: __spreadValues$1(__spreadValues$1({}, vRest), evRest) }, options4) : {}; - const csRest_var = isNotEmpty(csRest) ? this._toVariables({ [_name]: __spreadValues$1(__spreadValues$1({}, csRest), ecsRest) }, options4) : {}; - const csDark_var = isNotEmpty(dark2) ? this._toVariables({ [_name]: __spreadValues$1(__spreadValues$1({}, dark2), ecsDark) }, options4) : {}; - const [vRest_css, vRest_tokens] = [(_e = vRest_var.declarations) != null ? _e : "", vRest_var.tokens || []]; - const [csRest_css, csRest_tokens] = [(_f = csRest_var.declarations) != null ? _f : "", csRest_var.tokens || []]; - const [csDark_css, csDark_tokens] = [(_g = csDark_var.declarations) != null ? _g : "", csDark_var.tokens || []]; - const light_variable_css = this.transformCSS(_name, `${vRest_css}${csRest_css}`, "light", "variable", options4, set4, defaults2, selector); - const dark_variable_css = this.transformCSS(_name, csDark_css, "dark", "variable", options4, set4, defaults2, selector); - p_css = `${light_variable_css}${dark_variable_css}`; - p_tokens = [.../* @__PURE__ */ new Set([...vRest_tokens, ...csRest_tokens, ...csDark_tokens])]; - p_style = resolve$2(css22, { dt }); - } - return { - css: p_css, - tokens: p_tokens, - style: p_style - }; - }, - getPresetC({ name: name2 = "", theme: theme42 = {}, params, set: set4, defaults: defaults2 }) { - var _a2; - const { preset, options: options4 } = theme42; - const cPreset = (_a2 = preset == null ? void 0 : preset.components) == null ? void 0 : _a2[name2]; - return this.getPreset({ name: name2, preset: cPreset, options: options4, params, set: set4, defaults: defaults2 }); - }, - getPresetD({ name: name2 = "", theme: theme42 = {}, params, set: set4, defaults: defaults2 }) { - var _a2; - const dName = name2.replace("-directive", ""); - const { preset, options: options4 } = theme42; - const dPreset = (_a2 = preset == null ? void 0 : preset.directives) == null ? void 0 : _a2[dName]; - return this.getPreset({ name: dName, preset: dPreset, options: options4, params, set: set4, defaults: defaults2 }); - }, - applyDarkColorScheme(options4) { - return !(options4.darkModeSelector === "none" || options4.darkModeSelector === false); - }, - getColorSchemeOption(options4, defaults2) { - var _a2; - return this.applyDarkColorScheme(options4) ? this.regex.resolve(options4.darkModeSelector === true ? defaults2.options.darkModeSelector : (_a2 = options4.darkModeSelector) != null ? _a2 : defaults2.options.darkModeSelector) : []; - }, - getLayerOrder(name2, options4 = {}, params, defaults2) { - const { cssLayer } = options4; - if (cssLayer) { - const order = resolve$2(cssLayer.order || "primeui", params); - return `@layer ${order}`; - } - return ""; - }, - getCommonStyleSheet({ name: name2 = "", theme: theme42 = {}, params, props = {}, set: set4, defaults: defaults2 }) { - const common = this.getCommon({ name: name2, theme: theme42, params, set: set4, defaults: defaults2 }); - const _props = Object.entries(props).reduce((acc, [k2, v2]) => acc.push(`${k2}="${v2}"`) && acc, []).join(" "); - return Object.entries(common || {}).reduce((acc, [key, value4]) => { - if (value4 == null ? void 0 : value4.css) { - const _css = minifyCSS(value4 == null ? void 0 : value4.css); - const id3 = `${key}-variables`; - acc.push(``); - } - return acc; - }, []).join(""); - }, - getStyleSheet({ name: name2 = "", theme: theme42 = {}, params, props = {}, set: set4, defaults: defaults2 }) { - var _a2; - const options4 = { name: name2, theme: theme42, params, set: set4, defaults: defaults2 }; - const preset_css = (_a2 = name2.includes("-directive") ? this.getPresetD(options4) : this.getPresetC(options4)) == null ? void 0 : _a2.css; - const _props = Object.entries(props).reduce((acc, [k2, v2]) => acc.push(`${k2}="${v2}"`) && acc, []).join(" "); - return preset_css ? `` : ""; - }, - createTokens(obj = {}, defaults2, parentKey = "", parentPath = "", tokens = {}) { - Object.entries(obj).forEach(([key, value4]) => { - const currentKey = matchRegex(key, defaults2.variable.excludedKeyRegex) ? parentKey : parentKey ? `${parentKey}.${toTokenKey$1(key)}` : toTokenKey$1(key); - const currentPath = parentPath ? `${parentPath}.${key}` : key; - if (isObject$f(value4)) { - this.createTokens(value4, defaults2, currentKey, currentPath, tokens); - } else { - tokens[currentKey] || (tokens[currentKey] = { - paths: [], - computed(colorScheme, tokenPathMap = {}) { - var _a2, _b; - if (this.paths.length === 1) { - return (_a2 = this.paths[0]) == null ? void 0 : _a2.computed(this.paths[0].scheme, tokenPathMap["binding"]); - } else if (colorScheme && colorScheme !== "none") { - return (_b = this.paths.find((p2) => p2.scheme === colorScheme)) == null ? void 0 : _b.computed(colorScheme, tokenPathMap["binding"]); - } - return this.paths.map((p2) => p2.computed(p2.scheme, tokenPathMap[p2.scheme])); - } - }); - tokens[currentKey].paths.push({ - path: currentPath, - value: value4, - scheme: currentPath.includes("colorScheme.light") ? "light" : currentPath.includes("colorScheme.dark") ? "dark" : "none", - computed(colorScheme, tokenPathMap = {}) { - const regex2 = /{([^}]*)}/g; - let computedValue = value4; - tokenPathMap["name"] = this.path; - tokenPathMap["binding"] || (tokenPathMap["binding"] = {}); - if (matchRegex(value4, regex2)) { - const val = value4.trim(); - const _val = val.replaceAll(regex2, (v2) => { - var _a2; - const path = v2.replace(/{|}/g, ""); - const computed2 = (_a2 = tokens[path]) == null ? void 0 : _a2.computed(colorScheme, tokenPathMap); - return isArray$a(computed2) && computed2.length === 2 ? `light-dark(${computed2[0].value},${computed2[1].value})` : computed2 == null ? void 0 : computed2.value; - }); - const calculationRegex = /(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g; - const cleanedVarRegex = /var\([^)]+\)/g; - computedValue = matchRegex(_val.replace(cleanedVarRegex, "0"), calculationRegex) ? `calc(${_val})` : _val; - } - isEmpty$1(tokenPathMap["binding"]) && delete tokenPathMap["binding"]; - return { - colorScheme, - path: this.path, - paths: tokenPathMap, - value: computedValue.includes("undefined") ? void 0 : computedValue - }; - } - }); - } - }); - return tokens; - }, - getTokenValue(tokens, path, defaults2) { - var _a2; - const normalizePath2 = /* @__PURE__ */ __name((str) => { - const strArr = str.split("."); - return strArr.filter((s2) => !matchRegex(s2.toLowerCase(), defaults2.variable.excludedKeyRegex)).join("."); - }, "normalizePath"); - const token = normalizePath2(path); - const colorScheme = path.includes("colorScheme.light") ? "light" : path.includes("colorScheme.dark") ? "dark" : void 0; - const computedValues = [(_a2 = tokens[token]) == null ? void 0 : _a2.computed(colorScheme)].flat().filter((computed2) => computed2); - return computedValues.length === 1 ? computedValues[0].value : computedValues.reduce((acc = {}, computed2) => { - const _a22 = computed2, { colorScheme: cs } = _a22, rest = __objRest(_a22, ["colorScheme"]); - acc[cs] = rest; - return acc; - }, void 0); - }, - getSelectorRule(selector1, selector2, type, css22) { - return type === "class" || type === "attr" ? getRule(isNotEmpty(selector2) ? `${selector1}${selector2},${selector1} ${selector2}` : selector1, css22) : getRule(selector1, isNotEmpty(selector2) ? getRule(selector2, css22) : css22); - }, - transformCSS(name2, css22, mode2, type, options4 = {}, set4, defaults2, selector) { - if (isNotEmpty(css22)) { - const { cssLayer } = options4; - if (type !== "style") { - const colorSchemeOption = this.getColorSchemeOption(options4, defaults2); - css22 = mode2 === "dark" ? colorSchemeOption.reduce((acc, { type: type2, selector: _selector }) => { - if (isNotEmpty(_selector)) { - acc += _selector.includes("[CSS]") ? _selector.replace("[CSS]", css22) : this.getSelectorRule(_selector, selector, type2, css22); - } - return acc; - }, "") : getRule(selector != null ? selector : ":root", css22); - } - if (cssLayer) { - const layerOptions = { - name: "primeui", - order: "primeui" - }; - isObject$f(cssLayer) && (layerOptions.name = resolve$2(cssLayer.name, { name: name2, type })); - if (isNotEmpty(layerOptions.name)) { - css22 = getRule(`@layer ${layerOptions.name}`, css22); - set4 == null ? void 0 : set4.layerNames(layerOptions.name); - } - } - return css22; - } - return ""; - } -}; -var config_default = { - defaults: { - variable: { - prefix: "p", - selector: ":root", - excludedKeyRegex: /^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi - }, - options: { - prefix: "p", - darkModeSelector: "system", - cssLayer: false - } - }, - _theme: void 0, - _layerNames: /* @__PURE__ */ new Set(), - _loadedStyleNames: /* @__PURE__ */ new Set(), - _loadingStyles: /* @__PURE__ */ new Set(), - _tokens: {}, - update(newValues = {}) { - const { theme: theme42 } = newValues; - if (theme42) { - this._theme = __spreadProps(__spreadValues$1({}, theme42), { - options: __spreadValues$1(__spreadValues$1({}, this.defaults.options), theme42.options) - }); - this._tokens = themeUtils_default.createTokens(this.preset, this.defaults); - this.clearLoadedStyleNames(); - } - }, - get theme() { - return this._theme; - }, - get preset() { - var _a2; - return ((_a2 = this.theme) == null ? void 0 : _a2.preset) || {}; - }, - get options() { - var _a2; - return ((_a2 = this.theme) == null ? void 0 : _a2.options) || {}; - }, - get tokens() { - return this._tokens; - }, - getTheme() { - return this.theme; - }, - setTheme(newValue2) { - this.update({ theme: newValue2 }); - service_default.emit("theme:change", newValue2); - }, - getPreset() { - return this.preset; - }, - setPreset(newValue2) { - this._theme = __spreadProps(__spreadValues$1({}, this.theme), { preset: newValue2 }); - this._tokens = themeUtils_default.createTokens(newValue2, this.defaults); - this.clearLoadedStyleNames(); - service_default.emit("preset:change", newValue2); - service_default.emit("theme:change", this.theme); - }, - getOptions() { - return this.options; - }, - setOptions(newValue2) { - this._theme = __spreadProps(__spreadValues$1({}, this.theme), { options: newValue2 }); - this.clearLoadedStyleNames(); - service_default.emit("options:change", newValue2); - service_default.emit("theme:change", this.theme); - }, - getLayerNames() { - return [...this._layerNames]; - }, - setLayerNames(layerName) { - this._layerNames.add(layerName); - }, - getLoadedStyleNames() { - return this._loadedStyleNames; - }, - isStyleNameLoaded(name2) { - return this._loadedStyleNames.has(name2); - }, - setLoadedStyleName(name2) { - this._loadedStyleNames.add(name2); - }, - deleteLoadedStyleName(name2) { - this._loadedStyleNames.delete(name2); - }, - clearLoadedStyleNames() { - this._loadedStyleNames.clear(); - }, - getTokenValue(tokenPath) { - return themeUtils_default.getTokenValue(this.tokens, tokenPath, this.defaults); - }, - getCommon(name2 = "", params) { - return themeUtils_default.getCommon({ name: name2, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }); - }, - getComponent(name2 = "", params) { - const options4 = { name: name2, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; - return themeUtils_default.getPresetC(options4); - }, - getDirective(name2 = "", params) { - const options4 = { name: name2, theme: this.theme, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; - return themeUtils_default.getPresetD(options4); - }, - getCustomPreset(name2 = "", preset, selector, params) { - const options4 = { name: name2, preset, options: this.options, selector, params, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }; - return themeUtils_default.getPreset(options4); - }, - getLayerOrderCSS(name2 = "") { - return themeUtils_default.getLayerOrder(name2, this.options, { names: this.getLayerNames() }, this.defaults); - }, - transformCSS(name2 = "", css22, type = "style", mode2) { - return themeUtils_default.transformCSS(name2, css22, mode2, type, this.options, { layerNames: this.setLayerNames.bind(this) }, this.defaults); - }, - getCommonStyleSheet(name2 = "", params, props = {}) { - return themeUtils_default.getCommonStyleSheet({ name: name2, theme: this.theme, params, props, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }); - }, - getStyleSheet(name2, params, props = {}) { - return themeUtils_default.getStyleSheet({ name: name2, theme: this.theme, params, props, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } }); - }, - onStyleMounted(name2) { - this._loadingStyles.add(name2); - }, - onStyleUpdated(name2) { - this._loadingStyles.add(name2); - }, - onStyleLoaded(event, { name: name2 }) { - if (this._loadingStyles.size) { - this._loadingStyles.delete(name2); - service_default.emit(`theme:${name2}:load`, event); - !this._loadingStyles.size && service_default.emit("theme:load"); - } - } -}; -function updatePreset(...presets) { - const newPreset = mergeKeys(config_default.getPreset(), ...presets); - config_default.setPreset(newPreset); - return newPreset; -} -__name(updatePreset, "updatePreset"); -function updatePrimaryPalette(primary) { - return $t().primaryPalette(primary).update().preset; -} -__name(updatePrimaryPalette, "updatePrimaryPalette"); -function updateSurfacePalette(palette) { - return $t().surfacePalette(palette).update().preset; -} -__name(updateSurfacePalette, "updateSurfacePalette"); -function usePreset(...presets) { - const newPreset = mergeKeys(...presets); - config_default.setPreset(newPreset); - return newPreset; -} -__name(usePreset, "usePreset"); -function useTheme(theme42) { - return $t(theme42).update({ mergePresets: false }); -} -__name(useTheme, "useTheme"); -var index$1r = { - root: { - transitionDuration: "{transition.duration}" - }, - panel: { - borderWidth: "0 0 1px 0", - borderColor: "{content.border.color}" - }, - header: { - color: "{text.muted.color}", - hoverColor: "{text.color}", - activeColor: "{text.color}", - padding: "1.125rem", - fontWeight: "600", - borderRadius: "0", - borderWidth: "0", - borderColor: "{content.border.color}", - background: "{content.background}", - hoverBackground: "{content.background}", - activeBackground: "{content.background}", - activeHoverBackground: "{content.background}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "-1px", - shadow: "{focus.ring.shadow}" - }, - toggleIcon: { - color: "{text.muted.color}", - hoverColor: "{text.color}", - activeColor: "{text.color}", - activeHoverColor: "{text.color}" - }, - first: { - topBorderRadius: "{content.border.radius}", - borderWidth: "0" - }, - last: { - bottomBorderRadius: "{content.border.radius}", - activeBottomBorderRadius: "0" - } - }, - content: { - borderWidth: "0", - borderColor: "{content.border.color}", - background: "{content.background}", - color: "{text.color}", - padding: "0 1.125rem 1.125rem 1.125rem" - } -}; -var index$1q = { - root: { - background: "{form.field.background}", - disabledBackground: "{form.field.disabled.background}", - filledBackground: "{form.field.filled.background}", - filledHoverBackground: "{form.field.filled.hover.background}", - filledFocusBackground: "{form.field.filled.focus.background}", - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.hover.border.color}", - focusBorderColor: "{form.field.focus.border.color}", - invalidBorderColor: "{form.field.invalid.border.color}", - color: "{form.field.color}", - disabledColor: "{form.field.disabled.color}", - placeholderColor: "{form.field.placeholder.color}", - invalidPlaceholderColor: "{form.field.invalid.placeholder.color}", - shadow: "{form.field.shadow}", - paddingX: "{form.field.padding.x}", - paddingY: "{form.field.padding.y}", - borderRadius: "{form.field.border.radius}", - focusRing: { - width: "{form.field.focus.ring.width}", - style: "{form.field.focus.ring.style}", - color: "{form.field.focus.ring.color}", - offset: "{form.field.focus.ring.offset}", - shadow: "{form.field.focus.ring.shadow}" - }, - transitionDuration: "{form.field.transition.duration}" - }, - overlay: { - background: "{overlay.select.background}", - borderColor: "{overlay.select.border.color}", - borderRadius: "{overlay.select.border.radius}", - color: "{overlay.select.color}", - shadow: "{overlay.select.shadow}" - }, - list: { - padding: "{list.padding}", - gap: "{list.gap}" - }, - option: { - focusBackground: "{list.option.focus.background}", - selectedBackground: "{list.option.selected.background}", - selectedFocusBackground: "{list.option.selected.focus.background}", - color: "{list.option.color}", - focusColor: "{list.option.focus.color}", - selectedColor: "{list.option.selected.color}", - selectedFocusColor: "{list.option.selected.focus.color}", - padding: "{list.option.padding}", - borderRadius: "{list.option.border.radius}" - }, - optionGroup: { - background: "{list.option.group.background}", - color: "{list.option.group.color}", - fontWeight: "{list.option.group.font.weight}", - padding: "{list.option.group.padding}" - }, - dropdown: { - width: "2.5rem", - sm: { - width: "2rem" - }, - lg: { - width: "3rem" - }, - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.border.color}", - activeBorderColor: "{form.field.border.color}", - borderRadius: "{form.field.border.radius}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - chip: { - borderRadius: "{border.radius.sm}" - }, - emptyMessage: { - padding: "{list.option.padding}" - }, - colorScheme: { - light: { - chip: { - focusBackground: "{surface.200}", - focusColor: "{surface.800}" - }, - dropdown: { - background: "{surface.100}", - hoverBackground: "{surface.200}", - activeBackground: "{surface.300}", - color: "{surface.600}", - hoverColor: "{surface.700}", - activeColor: "{surface.800}" - } - }, - dark: { - chip: { - focusBackground: "{surface.700}", - focusColor: "{surface.0}" - }, - dropdown: { - background: "{surface.800}", - hoverBackground: "{surface.700}", - activeBackground: "{surface.600}", - color: "{surface.300}", - hoverColor: "{surface.200}", - activeColor: "{surface.100}" - } - } - } -}; -var index$1p = { - root: { - width: "2rem", - height: "2rem", - fontSize: "1rem", - background: "{content.border.color}", - color: "{content.color}", - borderRadius: "{content.border.radius}" - }, - icon: { - size: "1rem" - }, - group: { - borderColor: "{content.background}", - offset: "-0.75rem" - }, - lg: { - width: "3rem", - height: "3rem", - fontSize: "1.5rem", - icon: { - size: "1.5rem" - }, - group: { - offset: "-1rem" - } - }, - xl: { - width: "4rem", - height: "4rem", - fontSize: "2rem", - icon: { - size: "2rem" - }, - group: { - offset: "-1.5rem" - } - } -}; -var index$1o = { - root: { - borderRadius: "{border.radius.md}", - padding: "0 0.5rem", - fontSize: "0.75rem", - fontWeight: "700", - minWidth: "1.5rem", - height: "1.5rem" - }, - dot: { - size: "0.5rem" - }, - sm: { - fontSize: "0.625rem", - minWidth: "1.25rem", - height: "1.25rem" - }, - lg: { - fontSize: "0.875rem", - minWidth: "1.75rem", - height: "1.75rem" - }, - xl: { - fontSize: "1rem", - minWidth: "2rem", - height: "2rem" - }, - colorScheme: { - light: { - primary: { - background: "{primary.color}", - color: "{primary.contrast.color}" - }, - secondary: { - background: "{surface.100}", - color: "{surface.600}" - }, - success: { - background: "{green.500}", - color: "{surface.0}" - }, - info: { - background: "{sky.500}", - color: "{surface.0}" - }, - warn: { - background: "{orange.500}", - color: "{surface.0}" - }, - danger: { - background: "{red.500}", - color: "{surface.0}" - }, - contrast: { - background: "{surface.950}", - color: "{surface.0}" - } - }, - dark: { - primary: { - background: "{primary.color}", - color: "{primary.contrast.color}" - }, - secondary: { - background: "{surface.800}", - color: "{surface.300}" - }, - success: { - background: "{green.400}", - color: "{green.950}" - }, - info: { - background: "{sky.400}", - color: "{sky.950}" - }, - warn: { - background: "{orange.400}", - color: "{orange.950}" - }, - danger: { - background: "{red.400}", - color: "{red.950}" - }, - contrast: { - background: "{surface.0}", - color: "{surface.950}" - } - } - } -}; -var index$1n = { - primitive: { - borderRadius: { - none: "0", - xs: "2px", - sm: "4px", - md: "6px", - lg: "8px", - xl: "12px" - }, - emerald: { - 50: "#ecfdf5", - 100: "#d1fae5", - 200: "#a7f3d0", - 300: "#6ee7b7", - 400: "#34d399", - 500: "#10b981", - 600: "#059669", - 700: "#047857", - 800: "#065f46", - 900: "#064e3b", - 950: "#022c22" - }, - green: { - 50: "#f0fdf4", - 100: "#dcfce7", - 200: "#bbf7d0", - 300: "#86efac", - 400: "#4ade80", - 500: "#22c55e", - 600: "#16a34a", - 700: "#15803d", - 800: "#166534", - 900: "#14532d", - 950: "#052e16" - }, - lime: { - 50: "#f7fee7", - 100: "#ecfccb", - 200: "#d9f99d", - 300: "#bef264", - 400: "#a3e635", - 500: "#84cc16", - 600: "#65a30d", - 700: "#4d7c0f", - 800: "#3f6212", - 900: "#365314", - 950: "#1a2e05" - }, - red: { - 50: "#fef2f2", - 100: "#fee2e2", - 200: "#fecaca", - 300: "#fca5a5", - 400: "#f87171", - 500: "#ef4444", - 600: "#dc2626", - 700: "#b91c1c", - 800: "#991b1b", - 900: "#7f1d1d", - 950: "#450a0a" - }, - orange: { - 50: "#fff7ed", - 100: "#ffedd5", - 200: "#fed7aa", - 300: "#fdba74", - 400: "#fb923c", - 500: "#f97316", - 600: "#ea580c", - 700: "#c2410c", - 800: "#9a3412", - 900: "#7c2d12", - 950: "#431407" - }, - amber: { - 50: "#fffbeb", - 100: "#fef3c7", - 200: "#fde68a", - 300: "#fcd34d", - 400: "#fbbf24", - 500: "#f59e0b", - 600: "#d97706", - 700: "#b45309", - 800: "#92400e", - 900: "#78350f", - 950: "#451a03" - }, - yellow: { - 50: "#fefce8", - 100: "#fef9c3", - 200: "#fef08a", - 300: "#fde047", - 400: "#facc15", - 500: "#eab308", - 600: "#ca8a04", - 700: "#a16207", - 800: "#854d0e", - 900: "#713f12", - 950: "#422006" - }, - teal: { - 50: "#f0fdfa", - 100: "#ccfbf1", - 200: "#99f6e4", - 300: "#5eead4", - 400: "#2dd4bf", - 500: "#14b8a6", - 600: "#0d9488", - 700: "#0f766e", - 800: "#115e59", - 900: "#134e4a", - 950: "#042f2e" - }, - cyan: { - 50: "#ecfeff", - 100: "#cffafe", - 200: "#a5f3fc", - 300: "#67e8f9", - 400: "#22d3ee", - 500: "#06b6d4", - 600: "#0891b2", - 700: "#0e7490", - 800: "#155e75", - 900: "#164e63", - 950: "#083344" - }, - sky: { - 50: "#f0f9ff", - 100: "#e0f2fe", - 200: "#bae6fd", - 300: "#7dd3fc", - 400: "#38bdf8", - 500: "#0ea5e9", - 600: "#0284c7", - 700: "#0369a1", - 800: "#075985", - 900: "#0c4a6e", - 950: "#082f49" - }, - blue: { - 50: "#eff6ff", - 100: "#dbeafe", - 200: "#bfdbfe", - 300: "#93c5fd", - 400: "#60a5fa", - 500: "#3b82f6", - 600: "#2563eb", - 700: "#1d4ed8", - 800: "#1e40af", - 900: "#1e3a8a", - 950: "#172554" - }, - indigo: { - 50: "#eef2ff", - 100: "#e0e7ff", - 200: "#c7d2fe", - 300: "#a5b4fc", - 400: "#818cf8", - 500: "#6366f1", - 600: "#4f46e5", - 700: "#4338ca", - 800: "#3730a3", - 900: "#312e81", - 950: "#1e1b4b" - }, - violet: { - 50: "#f5f3ff", - 100: "#ede9fe", - 200: "#ddd6fe", - 300: "#c4b5fd", - 400: "#a78bfa", - 500: "#8b5cf6", - 600: "#7c3aed", - 700: "#6d28d9", - 800: "#5b21b6", - 900: "#4c1d95", - 950: "#2e1065" - }, - purple: { - 50: "#faf5ff", - 100: "#f3e8ff", - 200: "#e9d5ff", - 300: "#d8b4fe", - 400: "#c084fc", - 500: "#a855f7", - 600: "#9333ea", - 700: "#7e22ce", - 800: "#6b21a8", - 900: "#581c87", - 950: "#3b0764" - }, - fuchsia: { - 50: "#fdf4ff", - 100: "#fae8ff", - 200: "#f5d0fe", - 300: "#f0abfc", - 400: "#e879f9", - 500: "#d946ef", - 600: "#c026d3", - 700: "#a21caf", - 800: "#86198f", - 900: "#701a75", - 950: "#4a044e" - }, - pink: { - 50: "#fdf2f8", - 100: "#fce7f3", - 200: "#fbcfe8", - 300: "#f9a8d4", - 400: "#f472b6", - 500: "#ec4899", - 600: "#db2777", - 700: "#be185d", - 800: "#9d174d", - 900: "#831843", - 950: "#500724" - }, - rose: { - 50: "#fff1f2", - 100: "#ffe4e6", - 200: "#fecdd3", - 300: "#fda4af", - 400: "#fb7185", - 500: "#f43f5e", - 600: "#e11d48", - 700: "#be123c", - 800: "#9f1239", - 900: "#881337", - 950: "#4c0519" - }, - slate: { - 50: "#f8fafc", - 100: "#f1f5f9", - 200: "#e2e8f0", - 300: "#cbd5e1", - 400: "#94a3b8", - 500: "#64748b", - 600: "#475569", - 700: "#334155", - 800: "#1e293b", - 900: "#0f172a", - 950: "#020617" - }, - gray: { - 50: "#f9fafb", - 100: "#f3f4f6", - 200: "#e5e7eb", - 300: "#d1d5db", - 400: "#9ca3af", - 500: "#6b7280", - 600: "#4b5563", - 700: "#374151", - 800: "#1f2937", - 900: "#111827", - 950: "#030712" - }, - zinc: { - 50: "#fafafa", - 100: "#f4f4f5", - 200: "#e4e4e7", - 300: "#d4d4d8", - 400: "#a1a1aa", - 500: "#71717a", - 600: "#52525b", - 700: "#3f3f46", - 800: "#27272a", - 900: "#18181b", - 950: "#09090b" - }, - neutral: { - 50: "#fafafa", - 100: "#f5f5f5", - 200: "#e5e5e5", - 300: "#d4d4d4", - 400: "#a3a3a3", - 500: "#737373", - 600: "#525252", - 700: "#404040", - 800: "#262626", - 900: "#171717", - 950: "#0a0a0a" - }, - stone: { - 50: "#fafaf9", - 100: "#f5f5f4", - 200: "#e7e5e4", - 300: "#d6d3d1", - 400: "#a8a29e", - 500: "#78716c", - 600: "#57534e", - 700: "#44403c", - 800: "#292524", - 900: "#1c1917", - 950: "#0c0a09" - } - }, - semantic: { - transitionDuration: "0.2s", - focusRing: { - width: "1px", - style: "solid", - color: "{primary.color}", - offset: "2px", - shadow: "none" - }, - disabledOpacity: "0.6", - iconSize: "1rem", - anchorGutter: "2px", - primary: { - 50: "{emerald.50}", - 100: "{emerald.100}", - 200: "{emerald.200}", - 300: "{emerald.300}", - 400: "{emerald.400}", - 500: "{emerald.500}", - 600: "{emerald.600}", - 700: "{emerald.700}", - 800: "{emerald.800}", - 900: "{emerald.900}", - 950: "{emerald.950}" - }, - formField: { - paddingX: "0.75rem", - paddingY: "0.5rem", - sm: { - fontSize: "0.875rem", - paddingX: "0.625rem", - paddingY: "0.375rem" - }, - lg: { - fontSize: "1.125rem", - paddingX: "0.875rem", - paddingY: "0.625rem" - }, - borderRadius: "{border.radius.md}", - focusRing: { - width: "0", - style: "none", - color: "transparent", - offset: "0", - shadow: "none" - }, - transitionDuration: "{transition.duration}" - }, - list: { - padding: "0.25rem 0.25rem", - gap: "2px", - header: { - padding: "0.5rem 1rem 0.25rem 1rem" - }, - option: { - padding: "0.5rem 0.75rem", - borderRadius: "{border.radius.sm}" - }, - optionGroup: { - padding: "0.5rem 0.75rem", - fontWeight: "600" - } - }, - content: { - borderRadius: "{border.radius.md}" - }, - mask: { - transitionDuration: "0.15s" - }, - navigation: { - list: { - padding: "0.25rem 0.25rem", - gap: "2px" - }, - item: { - padding: "0.5rem 0.75rem", - borderRadius: "{border.radius.sm}", - gap: "0.5rem" - }, - submenuLabel: { - padding: "0.5rem 0.75rem", - fontWeight: "600" - }, - submenuIcon: { - size: "0.875rem" - } - }, - overlay: { - select: { - borderRadius: "{border.radius.md}", - shadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)" - }, - popover: { - borderRadius: "{border.radius.md}", - padding: "0.75rem", - shadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)" - }, - modal: { - borderRadius: "{border.radius.xl}", - padding: "1.25rem", - shadow: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)" - }, - navigation: { - shadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)" - } - }, - colorScheme: { - light: { - surface: { - 0: "#ffffff", - 50: "{slate.50}", - 100: "{slate.100}", - 200: "{slate.200}", - 300: "{slate.300}", - 400: "{slate.400}", - 500: "{slate.500}", - 600: "{slate.600}", - 700: "{slate.700}", - 800: "{slate.800}", - 900: "{slate.900}", - 950: "{slate.950}" - }, - primary: { - color: "{primary.500}", - contrastColor: "#ffffff", - hoverColor: "{primary.600}", - activeColor: "{primary.700}" - }, - highlight: { - background: "{primary.50}", - focusBackground: "{primary.100}", - color: "{primary.700}", - focusColor: "{primary.800}" - }, - mask: { - background: "rgba(0,0,0,0.4)", - color: "{surface.200}" - }, - formField: { - background: "{surface.0}", - disabledBackground: "{surface.200}", - filledBackground: "{surface.50}", - filledHoverBackground: "{surface.50}", - filledFocusBackground: "{surface.50}", - borderColor: "{surface.300}", - hoverBorderColor: "{surface.400}", - focusBorderColor: "{primary.color}", - invalidBorderColor: "{red.400}", - color: "{surface.700}", - disabledColor: "{surface.500}", - placeholderColor: "{surface.500}", - invalidPlaceholderColor: "{red.600}", - floatLabelColor: "{surface.500}", - floatLabelFocusColor: "{primary.600}", - floatLabelActiveColor: "{surface.500}", - floatLabelInvalidColor: "{form.field.invalid.placeholder.color}", - iconColor: "{surface.400}", - shadow: "0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05)" - }, - text: { - color: "{surface.700}", - hoverColor: "{surface.800}", - mutedColor: "{surface.500}", - hoverMutedColor: "{surface.600}" - }, - content: { - background: "{surface.0}", - hoverBackground: "{surface.100}", - borderColor: "{surface.200}", - color: "{text.color}", - hoverColor: "{text.hover.color}" - }, - overlay: { - select: { - background: "{surface.0}", - borderColor: "{surface.200}", - color: "{text.color}" - }, - popover: { - background: "{surface.0}", - borderColor: "{surface.200}", - color: "{text.color}" - }, - modal: { - background: "{surface.0}", - borderColor: "{surface.200}", - color: "{text.color}" - } - }, - list: { - option: { - focusBackground: "{surface.100}", - selectedBackground: "{highlight.background}", - selectedFocusBackground: "{highlight.focus.background}", - color: "{text.color}", - focusColor: "{text.hover.color}", - selectedColor: "{highlight.color}", - selectedFocusColor: "{highlight.focus.color}", - icon: { - color: "{surface.400}", - focusColor: "{surface.500}" - } - }, - optionGroup: { - background: "transparent", - color: "{text.muted.color}" - } - }, - navigation: { - item: { - focusBackground: "{surface.100}", - activeBackground: "{surface.100}", - color: "{text.color}", - focusColor: "{text.hover.color}", - activeColor: "{text.hover.color}", - icon: { - color: "{surface.400}", - focusColor: "{surface.500}", - activeColor: "{surface.500}" - } - }, - submenuLabel: { - background: "transparent", - color: "{text.muted.color}" - }, - submenuIcon: { - color: "{surface.400}", - focusColor: "{surface.500}", - activeColor: "{surface.500}" - } - } - }, - dark: { - surface: { - 0: "#ffffff", - 50: "{zinc.50}", - 100: "{zinc.100}", - 200: "{zinc.200}", - 300: "{zinc.300}", - 400: "{zinc.400}", - 500: "{zinc.500}", - 600: "{zinc.600}", - 700: "{zinc.700}", - 800: "{zinc.800}", - 900: "{zinc.900}", - 950: "{zinc.950}" - }, - primary: { - color: "{primary.400}", - contrastColor: "{surface.900}", - hoverColor: "{primary.300}", - activeColor: "{primary.200}" - }, - highlight: { - background: "color-mix(in srgb, {primary.400}, transparent 84%)", - focusBackground: "color-mix(in srgb, {primary.400}, transparent 76%)", - color: "rgba(255,255,255,.87)", - focusColor: "rgba(255,255,255,.87)" - }, - mask: { - background: "rgba(0,0,0,0.6)", - color: "{surface.200}" - }, - formField: { - background: "{surface.950}", - disabledBackground: "{surface.700}", - filledBackground: "{surface.800}", - filledHoverBackground: "{surface.800}", - filledFocusBackground: "{surface.800}", - borderColor: "{surface.600}", - hoverBorderColor: "{surface.500}", - focusBorderColor: "{primary.color}", - invalidBorderColor: "{red.300}", - color: "{surface.0}", - disabledColor: "{surface.400}", - placeholderColor: "{surface.400}", - invalidPlaceholderColor: "{red.400}", - floatLabelColor: "{surface.400}", - floatLabelFocusColor: "{primary.color}", - floatLabelActiveColor: "{surface.400}", - floatLabelInvalidColor: "{form.field.invalid.placeholder.color}", - iconColor: "{surface.400}", - shadow: "0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05)" - }, - text: { - color: "{surface.0}", - hoverColor: "{surface.0}", - mutedColor: "{surface.400}", - hoverMutedColor: "{surface.300}" - }, - content: { - background: "{surface.900}", - hoverBackground: "{surface.800}", - borderColor: "{surface.700}", - color: "{text.color}", - hoverColor: "{text.hover.color}" - }, - overlay: { - select: { - background: "{surface.900}", - borderColor: "{surface.700}", - color: "{text.color}" - }, - popover: { - background: "{surface.900}", - borderColor: "{surface.700}", - color: "{text.color}" - }, - modal: { - background: "{surface.900}", - borderColor: "{surface.700}", - color: "{text.color}" - } - }, - list: { - option: { - focusBackground: "{surface.800}", - selectedBackground: "{highlight.background}", - selectedFocusBackground: "{highlight.focus.background}", - color: "{text.color}", - focusColor: "{text.hover.color}", - selectedColor: "{highlight.color}", - selectedFocusColor: "{highlight.focus.color}", - icon: { - color: "{surface.500}", - focusColor: "{surface.400}" - } - }, - optionGroup: { - background: "transparent", - color: "{text.muted.color}" - } - }, - navigation: { - item: { - focusBackground: "{surface.800}", - activeBackground: "{surface.800}", - color: "{text.color}", - focusColor: "{text.hover.color}", - activeColor: "{text.hover.color}", - icon: { - color: "{surface.500}", - focusColor: "{surface.400}", - activeColor: "{surface.400}" - } - }, - submenuLabel: { - background: "transparent", - color: "{text.muted.color}" - }, - submenuIcon: { - color: "{surface.500}", - focusColor: "{surface.400}", - activeColor: "{surface.400}" - } - } - } - } - } -}; -var index$1m = { - root: { - borderRadius: "{content.border.radius}" - } -}; -var index$1l = { - root: { - padding: "1rem", - background: "{content.background}", - gap: "0.5rem", - transitionDuration: "{transition.duration}" - }, - item: { - color: "{text.muted.color}", - hoverColor: "{text.color}", - borderRadius: "{content.border.radius}", - gap: "{navigation.item.gap}", - icon: { - color: "{navigation.item.icon.color}", - hoverColor: "{navigation.item.icon.focus.color}" - }, - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - separator: { - color: "{navigation.item.icon.color}" - } -}; -var index$1k = { - root: { - borderRadius: "{form.field.border.radius}", - roundedBorderRadius: "2rem", - gap: "0.5rem", - paddingX: "{form.field.padding.x}", - paddingY: "{form.field.padding.y}", - iconOnlyWidth: "2.5rem", - sm: { - fontSize: "{form.field.sm.font.size}", - paddingX: "{form.field.sm.padding.x}", - paddingY: "{form.field.sm.padding.y}" - }, - lg: { - fontSize: "{form.field.lg.font.size}", - paddingX: "{form.field.lg.padding.x}", - paddingY: "{form.field.lg.padding.y}" - }, - label: { - fontWeight: "500" - }, - raisedShadow: "0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - offset: "{focus.ring.offset}" - }, - badgeSize: "1rem", - transitionDuration: "{form.field.transition.duration}" - }, - colorScheme: { - light: { - root: { - primary: { - background: "{primary.color}", - hoverBackground: "{primary.hover.color}", - activeBackground: "{primary.active.color}", - borderColor: "{primary.color}", - hoverBorderColor: "{primary.hover.color}", - activeBorderColor: "{primary.active.color}", - color: "{primary.contrast.color}", - hoverColor: "{primary.contrast.color}", - activeColor: "{primary.contrast.color}", - focusRing: { - color: "{primary.color}", - shadow: "none" - } - }, - secondary: { - background: "{surface.100}", - hoverBackground: "{surface.200}", - activeBackground: "{surface.300}", - borderColor: "{surface.100}", - hoverBorderColor: "{surface.200}", - activeBorderColor: "{surface.300}", - color: "{surface.600}", - hoverColor: "{surface.700}", - activeColor: "{surface.800}", - focusRing: { - color: "{surface.600}", - shadow: "none" - } - }, - info: { - background: "{sky.500}", - hoverBackground: "{sky.600}", - activeBackground: "{sky.700}", - borderColor: "{sky.500}", - hoverBorderColor: "{sky.600}", - activeBorderColor: "{sky.700}", - color: "#ffffff", - hoverColor: "#ffffff", - activeColor: "#ffffff", - focusRing: { - color: "{sky.500}", - shadow: "none" - } - }, - success: { - background: "{green.500}", - hoverBackground: "{green.600}", - activeBackground: "{green.700}", - borderColor: "{green.500}", - hoverBorderColor: "{green.600}", - activeBorderColor: "{green.700}", - color: "#ffffff", - hoverColor: "#ffffff", - activeColor: "#ffffff", - focusRing: { - color: "{green.500}", - shadow: "none" - } - }, - warn: { - background: "{orange.500}", - hoverBackground: "{orange.600}", - activeBackground: "{orange.700}", - borderColor: "{orange.500}", - hoverBorderColor: "{orange.600}", - activeBorderColor: "{orange.700}", - color: "#ffffff", - hoverColor: "#ffffff", - activeColor: "#ffffff", - focusRing: { - color: "{orange.500}", - shadow: "none" - } - }, - help: { - background: "{purple.500}", - hoverBackground: "{purple.600}", - activeBackground: "{purple.700}", - borderColor: "{purple.500}", - hoverBorderColor: "{purple.600}", - activeBorderColor: "{purple.700}", - color: "#ffffff", - hoverColor: "#ffffff", - activeColor: "#ffffff", - focusRing: { - color: "{purple.500}", - shadow: "none" - } - }, - danger: { - background: "{red.500}", - hoverBackground: "{red.600}", - activeBackground: "{red.700}", - borderColor: "{red.500}", - hoverBorderColor: "{red.600}", - activeBorderColor: "{red.700}", - color: "#ffffff", - hoverColor: "#ffffff", - activeColor: "#ffffff", - focusRing: { - color: "{red.500}", - shadow: "none" - } - }, - contrast: { - background: "{surface.950}", - hoverBackground: "{surface.900}", - activeBackground: "{surface.800}", - borderColor: "{surface.950}", - hoverBorderColor: "{surface.900}", - activeBorderColor: "{surface.800}", - color: "{surface.0}", - hoverColor: "{surface.0}", - activeColor: "{surface.0}", - focusRing: { - color: "{surface.950}", - shadow: "none" - } - } - }, - outlined: { - primary: { - hoverBackground: "{primary.50}", - activeBackground: "{primary.100}", - borderColor: "{primary.200}", - color: "{primary.color}" - }, - secondary: { - hoverBackground: "{surface.50}", - activeBackground: "{surface.100}", - borderColor: "{surface.200}", - color: "{surface.500}" - }, - success: { - hoverBackground: "{green.50}", - activeBackground: "{green.100}", - borderColor: "{green.200}", - color: "{green.500}" - }, - info: { - hoverBackground: "{sky.50}", - activeBackground: "{sky.100}", - borderColor: "{sky.200}", - color: "{sky.500}" - }, - warn: { - hoverBackground: "{orange.50}", - activeBackground: "{orange.100}", - borderColor: "{orange.200}", - color: "{orange.500}" - }, - help: { - hoverBackground: "{purple.50}", - activeBackground: "{purple.100}", - borderColor: "{purple.200}", - color: "{purple.500}" - }, - danger: { - hoverBackground: "{red.50}", - activeBackground: "{red.100}", - borderColor: "{red.200}", - color: "{red.500}" - }, - contrast: { - hoverBackground: "{surface.50}", - activeBackground: "{surface.100}", - borderColor: "{surface.700}", - color: "{surface.950}" - }, - plain: { - hoverBackground: "{surface.50}", - activeBackground: "{surface.100}", - borderColor: "{surface.200}", - color: "{surface.700}" - } - }, - text: { - primary: { - hoverBackground: "{primary.50}", - activeBackground: "{primary.100}", - color: "{primary.color}" - }, - secondary: { - hoverBackground: "{surface.50}", - activeBackground: "{surface.100}", - color: "{surface.500}" - }, - success: { - hoverBackground: "{green.50}", - activeBackground: "{green.100}", - color: "{green.500}" - }, - info: { - hoverBackground: "{sky.50}", - activeBackground: "{sky.100}", - color: "{sky.500}" - }, - warn: { - hoverBackground: "{orange.50}", - activeBackground: "{orange.100}", - color: "{orange.500}" - }, - help: { - hoverBackground: "{purple.50}", - activeBackground: "{purple.100}", - color: "{purple.500}" - }, - danger: { - hoverBackground: "{red.50}", - activeBackground: "{red.100}", - color: "{red.500}" - }, - contrast: { - hoverBackground: "{surface.50}", - activeBackground: "{surface.100}", - color: "{surface.950}" - }, - plain: { - hoverBackground: "{surface.50}", - activeBackground: "{surface.100}", - color: "{surface.700}" - } - }, - link: { - color: "{primary.color}", - hoverColor: "{primary.color}", - activeColor: "{primary.color}" - } - }, - dark: { - root: { - primary: { - background: "{primary.color}", - hoverBackground: "{primary.hover.color}", - activeBackground: "{primary.active.color}", - borderColor: "{primary.color}", - hoverBorderColor: "{primary.hover.color}", - activeBorderColor: "{primary.active.color}", - color: "{primary.contrast.color}", - hoverColor: "{primary.contrast.color}", - activeColor: "{primary.contrast.color}", - focusRing: { - color: "{primary.color}", - shadow: "none" - } - }, - secondary: { - background: "{surface.800}", - hoverBackground: "{surface.700}", - activeBackground: "{surface.600}", - borderColor: "{surface.800}", - hoverBorderColor: "{surface.700}", - activeBorderColor: "{surface.600}", - color: "{surface.300}", - hoverColor: "{surface.200}", - activeColor: "{surface.100}", - focusRing: { - color: "{surface.300}", - shadow: "none" - } - }, - info: { - background: "{sky.400}", - hoverBackground: "{sky.300}", - activeBackground: "{sky.200}", - borderColor: "{sky.400}", - hoverBorderColor: "{sky.300}", - activeBorderColor: "{sky.200}", - color: "{sky.950}", - hoverColor: "{sky.950}", - activeColor: "{sky.950}", - focusRing: { - color: "{sky.400}", - shadow: "none" - } - }, - success: { - background: "{green.400}", - hoverBackground: "{green.300}", - activeBackground: "{green.200}", - borderColor: "{green.400}", - hoverBorderColor: "{green.300}", - activeBorderColor: "{green.200}", - color: "{green.950}", - hoverColor: "{green.950}", - activeColor: "{green.950}", - focusRing: { - color: "{green.400}", - shadow: "none" - } - }, - warn: { - background: "{orange.400}", - hoverBackground: "{orange.300}", - activeBackground: "{orange.200}", - borderColor: "{orange.400}", - hoverBorderColor: "{orange.300}", - activeBorderColor: "{orange.200}", - color: "{orange.950}", - hoverColor: "{orange.950}", - activeColor: "{orange.950}", - focusRing: { - color: "{orange.400}", - shadow: "none" - } - }, - help: { - background: "{purple.400}", - hoverBackground: "{purple.300}", - activeBackground: "{purple.200}", - borderColor: "{purple.400}", - hoverBorderColor: "{purple.300}", - activeBorderColor: "{purple.200}", - color: "{purple.950}", - hoverColor: "{purple.950}", - activeColor: "{purple.950}", - focusRing: { - color: "{purple.400}", - shadow: "none" - } - }, - danger: { - background: "{red.400}", - hoverBackground: "{red.300}", - activeBackground: "{red.200}", - borderColor: "{red.400}", - hoverBorderColor: "{red.300}", - activeBorderColor: "{red.200}", - color: "{red.950}", - hoverColor: "{red.950}", - activeColor: "{red.950}", - focusRing: { - color: "{red.400}", - shadow: "none" - } - }, - contrast: { - background: "{surface.0}", - hoverBackground: "{surface.100}", - activeBackground: "{surface.200}", - borderColor: "{surface.0}", - hoverBorderColor: "{surface.100}", - activeBorderColor: "{surface.200}", - color: "{surface.950}", - hoverColor: "{surface.950}", - activeColor: "{surface.950}", - focusRing: { - color: "{surface.0}", - shadow: "none" - } - } - }, - outlined: { - primary: { - hoverBackground: "color-mix(in srgb, {primary.color}, transparent 96%)", - activeBackground: "color-mix(in srgb, {primary.color}, transparent 84%)", - borderColor: "{primary.700}", - color: "{primary.color}" - }, - secondary: { - hoverBackground: "rgba(255,255,255,0.04)", - activeBackground: "rgba(255,255,255,0.16)", - borderColor: "{surface.700}", - color: "{surface.400}" - }, - success: { - hoverBackground: "color-mix(in srgb, {green.400}, transparent 96%)", - activeBackground: "color-mix(in srgb, {green.400}, transparent 84%)", - borderColor: "{green.700}", - color: "{green.400}" - }, - info: { - hoverBackground: "color-mix(in srgb, {sky.400}, transparent 96%)", - activeBackground: "color-mix(in srgb, {sky.400}, transparent 84%)", - borderColor: "{sky.700}", - color: "{sky.400}" - }, - warn: { - hoverBackground: "color-mix(in srgb, {orange.400}, transparent 96%)", - activeBackground: "color-mix(in srgb, {orange.400}, transparent 84%)", - borderColor: "{orange.700}", - color: "{orange.400}" - }, - help: { - hoverBackground: "color-mix(in srgb, {purple.400}, transparent 96%)", - activeBackground: "color-mix(in srgb, {purple.400}, transparent 84%)", - borderColor: "{purple.700}", - color: "{purple.400}" - }, - danger: { - hoverBackground: "color-mix(in srgb, {red.400}, transparent 96%)", - activeBackground: "color-mix(in srgb, {red.400}, transparent 84%)", - borderColor: "{red.700}", - color: "{red.400}" - }, - contrast: { - hoverBackground: "{surface.800}", - activeBackground: "{surface.700}", - borderColor: "{surface.500}", - color: "{surface.0}" - }, - plain: { - hoverBackground: "{surface.800}", - activeBackground: "{surface.700}", - borderColor: "{surface.600}", - color: "{surface.0}" - } - }, - text: { - primary: { - hoverBackground: "color-mix(in srgb, {primary.color}, transparent 96%)", - activeBackground: "color-mix(in srgb, {primary.color}, transparent 84%)", - color: "{primary.color}" - }, - secondary: { - hoverBackground: "{surface.800}", - activeBackground: "{surface.700}", - color: "{surface.400}" - }, - success: { - hoverBackground: "color-mix(in srgb, {green.400}, transparent 96%)", - activeBackground: "color-mix(in srgb, {green.400}, transparent 84%)", - color: "{green.400}" - }, - info: { - hoverBackground: "color-mix(in srgb, {sky.400}, transparent 96%)", - activeBackground: "color-mix(in srgb, {sky.400}, transparent 84%)", - color: "{sky.400}" - }, - warn: { - hoverBackground: "color-mix(in srgb, {orange.400}, transparent 96%)", - activeBackground: "color-mix(in srgb, {orange.400}, transparent 84%)", - color: "{orange.400}" - }, - help: { - hoverBackground: "color-mix(in srgb, {purple.400}, transparent 96%)", - activeBackground: "color-mix(in srgb, {purple.400}, transparent 84%)", - color: "{purple.400}" - }, - danger: { - hoverBackground: "color-mix(in srgb, {red.400}, transparent 96%)", - activeBackground: "color-mix(in srgb, {red.400}, transparent 84%)", - color: "{red.400}" - }, - contrast: { - hoverBackground: "{surface.800}", - activeBackground: "{surface.700}", - color: "{surface.0}" - }, - plain: { - hoverBackground: "{surface.800}", - activeBackground: "{surface.700}", - color: "{surface.0}" - } - }, - link: { - color: "{primary.color}", - hoverColor: "{primary.color}", - activeColor: "{primary.color}" - } - } - } -}; -var index$1j = { - root: { - background: "{content.background}", - borderRadius: "{border.radius.xl}", - color: "{content.color}", - shadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)" - }, - body: { - padding: "1.25rem", - gap: "0.5rem" - }, - caption: { - gap: "0.5rem" - }, - title: { - fontSize: "1.25rem", - fontWeight: "500" - }, - subtitle: { - color: "{text.muted.color}" - } -}; -var index$1i = { - root: { - transitionDuration: "{transition.duration}" - }, - content: { - gap: "0.25rem" - }, - indicatorList: { - padding: "1rem", - gap: "0.5rem" - }, - indicator: { - width: "2rem", - height: "0.5rem", - borderRadius: "{content.border.radius}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - colorScheme: { - light: { - indicator: { - background: "{surface.200}", - hoverBackground: "{surface.300}", - activeBackground: "{primary.color}" - } - }, - dark: { - indicator: { - background: "{surface.700}", - hoverBackground: "{surface.600}", - activeBackground: "{primary.color}" - } - } - } -}; -var index$1h = { - root: { - background: "{form.field.background}", - disabledBackground: "{form.field.disabled.background}", - filledBackground: "{form.field.filled.background}", - filledHoverBackground: "{form.field.filled.hover.background}", - filledFocusBackground: "{form.field.filled.focus.background}", - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.hover.border.color}", - focusBorderColor: "{form.field.focus.border.color}", - invalidBorderColor: "{form.field.invalid.border.color}", - color: "{form.field.color}", - disabledColor: "{form.field.disabled.color}", - placeholderColor: "{form.field.placeholder.color}", - invalidPlaceholderColor: "{form.field.invalid.placeholder.color}", - shadow: "{form.field.shadow}", - paddingX: "{form.field.padding.x}", - paddingY: "{form.field.padding.y}", - borderRadius: "{form.field.border.radius}", - focusRing: { - width: "{form.field.focus.ring.width}", - style: "{form.field.focus.ring.style}", - color: "{form.field.focus.ring.color}", - offset: "{form.field.focus.ring.offset}", - shadow: "{form.field.focus.ring.shadow}" - }, - transitionDuration: "{form.field.transition.duration}", - sm: { - fontSize: "{form.field.sm.font.size}", - paddingX: "{form.field.sm.padding.x}", - paddingY: "{form.field.sm.padding.y}" - }, - lg: { - fontSize: "{form.field.lg.font.size}", - paddingX: "{form.field.lg.padding.x}", - paddingY: "{form.field.lg.padding.y}" - } - }, - dropdown: { - width: "2.5rem", - color: "{form.field.icon.color}" - }, - overlay: { - background: "{overlay.select.background}", - borderColor: "{overlay.select.border.color}", - borderRadius: "{overlay.select.border.radius}", - color: "{overlay.select.color}", - shadow: "{overlay.select.shadow}" - }, - list: { - padding: "{list.padding}", - gap: "{list.gap}", - mobileIndent: "1rem" - }, - option: { - focusBackground: "{list.option.focus.background}", - selectedBackground: "{list.option.selected.background}", - selectedFocusBackground: "{list.option.selected.focus.background}", - color: "{list.option.color}", - focusColor: "{list.option.focus.color}", - selectedColor: "{list.option.selected.color}", - selectedFocusColor: "{list.option.selected.focus.color}", - padding: "{list.option.padding}", - borderRadius: "{list.option.border.radius}", - icon: { - color: "{list.option.icon.color}", - focusColor: "{list.option.icon.focus.color}", - size: "0.875rem" - } - }, - clearIcon: { - color: "{form.field.icon.color}" - } -}; -var index$1g = { - root: { - borderRadius: "{border.radius.sm}", - width: "1.25rem", - height: "1.25rem", - background: "{form.field.background}", - checkedBackground: "{primary.color}", - checkedHoverBackground: "{primary.hover.color}", - disabledBackground: "{form.field.disabled.background}", - filledBackground: "{form.field.filled.background}", - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.hover.border.color}", - focusBorderColor: "{form.field.border.color}", - checkedBorderColor: "{primary.color}", - checkedHoverBorderColor: "{primary.hover.color}", - checkedFocusBorderColor: "{primary.color}", - checkedDisabledBorderColor: "{form.field.border.color}", - invalidBorderColor: "{form.field.invalid.border.color}", - shadow: "{form.field.shadow}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - }, - transitionDuration: "{form.field.transition.duration}", - sm: { - width: "1rem", - height: "1rem" - }, - lg: { - width: "1.5rem", - height: "1.5rem" - } - }, - icon: { - size: "0.875rem", - color: "{form.field.color}", - checkedColor: "{primary.contrast.color}", - checkedHoverColor: "{primary.contrast.color}", - disabledColor: "{form.field.disabled.color}", - sm: { - size: "0.75rem" - }, - lg: { - size: "1rem" - } - } -}; -var index$1f = { - root: { - borderRadius: "16px", - paddingX: "0.75rem", - paddingY: "0.5rem", - gap: "0.5rem", - transitionDuration: "{transition.duration}" - }, - image: { - width: "2rem", - height: "2rem" - }, - icon: { - size: "1rem" - }, - removeIcon: { - size: "1rem", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{form.field.focus.ring.shadow}" - } - }, - colorScheme: { - light: { - root: { - background: "{surface.100}", - color: "{surface.800}" - }, - icon: { - color: "{surface.800}" - }, - removeIcon: { - color: "{surface.800}" - } - }, - dark: { - root: { - background: "{surface.800}", - color: "{surface.0}" - }, - icon: { - color: "{surface.0}" - }, - removeIcon: { - color: "{surface.0}" - } - } - } -}; -var index$1e = { - root: { - transitionDuration: "{transition.duration}" - }, - preview: { - width: "1.5rem", - height: "1.5rem", - borderRadius: "{form.field.border.radius}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - panel: { - shadow: "{overlay.popover.shadow}", - borderRadius: "{overlay.popover.borderRadius}" - }, - colorScheme: { - light: { - panel: { - background: "{surface.800}", - borderColor: "{surface.900}" - }, - handle: { - color: "{surface.0}" - } - }, - dark: { - panel: { - background: "{surface.900}", - borderColor: "{surface.700}" - }, - handle: { - color: "{surface.0}" - } - } - } -}; -var index$1d = { - icon: { - size: "2rem", - color: "{overlay.modal.color}" - }, - content: { - gap: "1rem" - } -}; -var index$1c = { - root: { - background: "{overlay.popover.background}", - borderColor: "{overlay.popover.border.color}", - color: "{overlay.popover.color}", - borderRadius: "{overlay.popover.border.radius}", - shadow: "{overlay.popover.shadow}", - gutter: "10px", - arrowOffset: "1.25rem" - }, - content: { - padding: "{overlay.popover.padding}", - gap: "1rem" - }, - icon: { - size: "1.5rem", - color: "{overlay.popover.color}" - }, - footer: { - gap: "0.5rem", - padding: "0 {overlay.popover.padding} {overlay.popover.padding} {overlay.popover.padding}" - } -}; -var index$1b = { - root: { - background: "{content.background}", - borderColor: "{content.border.color}", - color: "{content.color}", - borderRadius: "{content.border.radius}", - shadow: "{overlay.navigation.shadow}", - transitionDuration: "{transition.duration}" - }, - list: { - padding: "{navigation.list.padding}", - gap: "{navigation.list.gap}" - }, - item: { - focusBackground: "{navigation.item.focus.background}", - activeBackground: "{navigation.item.active.background}", - color: "{navigation.item.color}", - focusColor: "{navigation.item.focus.color}", - activeColor: "{navigation.item.active.color}", - padding: "{navigation.item.padding}", - borderRadius: "{navigation.item.border.radius}", - gap: "{navigation.item.gap}", - icon: { - color: "{navigation.item.icon.color}", - focusColor: "{navigation.item.icon.focus.color}", - activeColor: "{navigation.item.icon.active.color}" - } - }, - submenu: { - mobileIndent: "1rem" - }, - submenuIcon: { - size: "{navigation.submenu.icon.size}", - color: "{navigation.submenu.icon.color}", - focusColor: "{navigation.submenu.icon.focus.color}", - activeColor: "{navigation.submenu.icon.active.color}" - }, - separator: { - borderColor: "{content.border.color}" - } -}; -var index$1a = { - root: { - transitionDuration: "{transition.duration}" - }, - header: { - background: "{content.background}", - borderColor: "{datatable.border.color}", - color: "{content.color}", - borderWidth: "0 0 1px 0", - padding: "0.75rem 1rem" - }, - headerCell: { - background: "{content.background}", - hoverBackground: "{content.hover.background}", - selectedBackground: "{highlight.background}", - borderColor: "{datatable.border.color}", - color: "{content.color}", - hoverColor: "{content.hover.color}", - selectedColor: "{highlight.color}", - gap: "0.5rem", - padding: "0.75rem 1rem", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "-1px", - shadow: "{focus.ring.shadow}" - } - }, - columnTitle: { - fontWeight: "600" - }, - row: { - background: "{content.background}", - hoverBackground: "{content.hover.background}", - selectedBackground: "{highlight.background}", - color: "{content.color}", - hoverColor: "{content.hover.color}", - selectedColor: "{highlight.color}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "-1px", - shadow: "{focus.ring.shadow}" - } - }, - bodyCell: { - borderColor: "{datatable.border.color}", - padding: "0.75rem 1rem" - }, - footerCell: { - background: "{content.background}", - borderColor: "{datatable.border.color}", - color: "{content.color}", - padding: "0.75rem 1rem" - }, - columnFooter: { - fontWeight: "600" - }, - footer: { - background: "{content.background}", - borderColor: "{datatable.border.color}", - color: "{content.color}", - borderWidth: "0 0 1px 0", - padding: "0.75rem 1rem" - }, - dropPoint: { - color: "{primary.color}" - }, - columnResizerWidth: "0.5rem", - resizeIndicator: { - width: "1px", - color: "{primary.color}" - }, - sortIcon: { - color: "{text.muted.color}", - hoverColor: "{text.hover.muted.color}", - size: "0.875rem" - }, - loadingIcon: { - size: "2rem" - }, - rowToggleButton: { - hoverBackground: "{content.hover.background}", - selectedHoverBackground: "{content.background}", - color: "{text.muted.color}", - hoverColor: "{text.color}", - selectedHoverColor: "{primary.color}", - size: "1.75rem", - borderRadius: "50%", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - filter: { - inlineGap: "0.5rem", - overlaySelect: { - background: "{overlay.select.background}", - borderColor: "{overlay.select.border.color}", - borderRadius: "{overlay.select.border.radius}", - color: "{overlay.select.color}", - shadow: "{overlay.select.shadow}" - }, - overlayPopover: { - background: "{overlay.popover.background}", - borderColor: "{overlay.popover.border.color}", - borderRadius: "{overlay.popover.border.radius}", - color: "{overlay.popover.color}", - shadow: "{overlay.popover.shadow}", - padding: "{overlay.popover.padding}", - gap: "0.5rem" - }, - rule: { - borderColor: "{content.border.color}" - }, - constraintList: { - padding: "{list.padding}", - gap: "{list.gap}" - }, - constraint: { - focusBackground: "{list.option.focus.background}", - selectedBackground: "{list.option.selected.background}", - selectedFocusBackground: "{list.option.selected.focus.background}", - color: "{list.option.color}", - focusColor: "{list.option.focus.color}", - selectedColor: "{list.option.selected.color}", - selectedFocusColor: "{list.option.selected.focus.color}", - separator: { - borderColor: "{content.border.color}" - }, - padding: "{list.option.padding}", - borderRadius: "{list.option.border.radius}" - } - }, - paginatorTop: { - borderColor: "{datatable.border.color}", - borderWidth: "0 0 1px 0" - }, - paginatorBottom: { - borderColor: "{datatable.border.color}", - borderWidth: "0 0 1px 0" - }, - colorScheme: { - light: { - root: { - borderColor: "{content.border.color}" - }, - row: { - stripedBackground: "{surface.50}" - }, - bodyCell: { - selectedBorderColor: "{primary.100}" - } - }, - dark: { - root: { - borderColor: "{surface.800}" - }, - row: { - stripedBackground: "{surface.950}" - }, - bodyCell: { - selectedBorderColor: "{primary.900}" - } - } - } -}; -var index$19 = { - root: { - borderColor: "transparent", - borderWidth: "0", - borderRadius: "0", - padding: "0" - }, - header: { - background: "{content.background}", - color: "{content.color}", - borderColor: "{content.border.color}", - borderWidth: "0 0 1px 0", - padding: "0.75rem 1rem", - borderRadius: "0" - }, - content: { - background: "{content.background}", - color: "{content.color}", - borderColor: "transparent", - borderWidth: "0", - padding: "0", - borderRadius: "0" - }, - footer: { - background: "{content.background}", - color: "{content.color}", - borderColor: "{content.border.color}", - borderWidth: "1px 0 0 0", - padding: "0.75rem 1rem", - borderRadius: "0" - }, - paginatorTop: { - borderColor: "{content.border.color}", - borderWidth: "0 0 1px 0" - }, - paginatorBottom: { - borderColor: "{content.border.color}", - borderWidth: "1px 0 0 0" - } -}; -var index$18 = { - root: { - transitionDuration: "{transition.duration}" - }, - panel: { - background: "{content.background}", - borderColor: "{content.border.color}", - color: "{content.color}", - borderRadius: "{content.border.radius}", - shadow: "{overlay.popover.shadow}", - padding: "{overlay.popover.padding}" - }, - header: { - background: "{content.background}", - borderColor: "{content.border.color}", - color: "{content.color}", - padding: "0 0 0.5rem 0" - }, - title: { - gap: "0.5rem", - fontWeight: "500" - }, - dropdown: { - width: "2.5rem", - sm: { - width: "2rem" - }, - lg: { - width: "3rem" - }, - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.border.color}", - activeBorderColor: "{form.field.border.color}", - borderRadius: "{form.field.border.radius}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - inputIcon: { - color: "{form.field.icon.color}" - }, - selectMonth: { - hoverBackground: "{content.hover.background}", - color: "{content.color}", - hoverColor: "{content.hover.color}", - padding: "0.25rem 0.5rem", - borderRadius: "{content.border.radius}" - }, - selectYear: { - hoverBackground: "{content.hover.background}", - color: "{content.color}", - hoverColor: "{content.hover.color}", - padding: "0.25rem 0.5rem", - borderRadius: "{content.border.radius}" - }, - group: { - borderColor: "{content.border.color}", - gap: "{overlay.popover.padding}" - }, - dayView: { - margin: "0.5rem 0 0 0" - }, - weekDay: { - padding: "0.25rem", - fontWeight: "500", - color: "{content.color}" - }, - date: { - hoverBackground: "{content.hover.background}", - selectedBackground: "{primary.color}", - rangeSelectedBackground: "{highlight.background}", - color: "{content.color}", - hoverColor: "{content.hover.color}", - selectedColor: "{primary.contrast.color}", - rangeSelectedColor: "{highlight.color}", - width: "2rem", - height: "2rem", - borderRadius: "50%", - padding: "0.25rem", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - monthView: { - margin: "0.5rem 0 0 0" - }, - month: { - padding: "0.375rem", - borderRadius: "{content.border.radius}" - }, - yearView: { - margin: "0.5rem 0 0 0" - }, - year: { - padding: "0.375rem", - borderRadius: "{content.border.radius}" - }, - buttonbar: { - padding: "0.5rem 0 0 0", - borderColor: "{content.border.color}" - }, - timePicker: { - padding: "0.5rem 0 0 0", - borderColor: "{content.border.color}", - gap: "0.5rem", - buttonGap: "0.25rem" - }, - colorScheme: { - light: { - dropdown: { - background: "{surface.100}", - hoverBackground: "{surface.200}", - activeBackground: "{surface.300}", - color: "{surface.600}", - hoverColor: "{surface.700}", - activeColor: "{surface.800}" - }, - today: { - background: "{surface.200}", - color: "{surface.900}" - } - }, - dark: { - dropdown: { - background: "{surface.800}", - hoverBackground: "{surface.700}", - activeBackground: "{surface.600}", - color: "{surface.300}", - hoverColor: "{surface.200}", - activeColor: "{surface.100}" - }, - today: { - background: "{surface.700}", - color: "{surface.0}" - } - } - } -}; -var index$17 = { - root: { - background: "{overlay.modal.background}", - borderColor: "{overlay.modal.border.color}", - color: "{overlay.modal.color}", - borderRadius: "{overlay.modal.border.radius}", - shadow: "{overlay.modal.shadow}" - }, - header: { - padding: "{overlay.modal.padding}", - gap: "0.5rem" - }, - title: { - fontSize: "1.25rem", - fontWeight: "600" - }, - content: { - padding: "0 {overlay.modal.padding} {overlay.modal.padding} {overlay.modal.padding}" - }, - footer: { - padding: "0 {overlay.modal.padding} {overlay.modal.padding} {overlay.modal.padding}", - gap: "0.5rem" - } -}; -var index$16 = { - root: { - borderColor: "{content.border.color}" - }, - content: { - background: "{content.background}", - color: "{text.color}" - }, - horizontal: { - margin: "1rem 0", - padding: "0 1rem", - content: { - padding: "0 0.5rem" - } - }, - vertical: { - margin: "0 1rem", - padding: "0.5rem 0", - content: { - padding: "0.5rem 0" - } - } -}; -var index$15 = { - root: { - background: "rgba(255, 255, 255, 0.1)", - borderColor: "rgba(255, 255, 255, 0.2)", - padding: "0.5rem", - borderRadius: "{border.radius.xl}" - }, - item: { - borderRadius: "{content.border.radius}", - padding: "0.5rem", - size: "3rem", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - } -}; -var index$14 = { - root: { - background: "{overlay.modal.background}", - borderColor: "{overlay.modal.border.color}", - color: "{overlay.modal.color}", - shadow: "{overlay.modal.shadow}" - }, - header: { - padding: "{overlay.modal.padding}" - }, - title: { - fontSize: "1.5rem", - fontWeight: "600" - }, - content: { - padding: "0 {overlay.modal.padding} {overlay.modal.padding} {overlay.modal.padding}" - }, - footer: { - padding: "{overlay.modal.padding}" - } -}; -var index$13 = { - toolbar: { - background: "{content.background}", - borderColor: "{content.border.color}", - borderRadius: "{content.border.radius}" - }, - toolbarItem: { - color: "{text.muted.color}", - hoverColor: "{text.color}", - activeColor: "{primary.color}" - }, - overlay: { - background: "{overlay.select.background}", - borderColor: "{overlay.select.border.color}", - borderRadius: "{overlay.select.border.radius}", - color: "{overlay.select.color}", - shadow: "{overlay.select.shadow}", - padding: "{list.padding}" - }, - overlayOption: { - focusBackground: "{list.option.focus.background}", - color: "{list.option.color}", - focusColor: "{list.option.focus.color}", - padding: "{list.option.padding}", - borderRadius: "{list.option.border.radius}" - }, - content: { - background: "{content.background}", - borderColor: "{content.border.color}", - color: "{content.color}", - borderRadius: "{content.border.radius}" - } -}; -var index$12 = { - root: { - background: "{content.background}", - borderColor: "{content.border.color}", - borderRadius: "{content.border.radius}", - color: "{content.color}", - padding: "0 1.125rem 1.125rem 1.125rem", - transitionDuration: "{transition.duration}" - }, - legend: { - background: "{content.background}", - hoverBackground: "{content.hover.background}", - color: "{content.color}", - hoverColor: "{content.hover.color}", - borderRadius: "{content.border.radius}", - borderWidth: "1px", - borderColor: "transparent", - padding: "0.5rem 0.75rem", - gap: "0.5rem", - fontWeight: "600", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - toggleIcon: { - color: "{text.muted.color}", - hoverColor: "{text.hover.muted.color}" - }, - content: { - padding: "0" - } -}; -var index$11 = { - root: { - background: "{content.background}", - borderColor: "{content.border.color}", - color: "{content.color}", - borderRadius: "{content.border.radius}", - transitionDuration: "{transition.duration}" - }, - header: { - background: "transparent", - color: "{text.color}", - padding: "1.125rem", - borderColor: "unset", - borderWidth: "0", - borderRadius: "0", - gap: "0.5rem" - }, - content: { - highlightBorderColor: "{primary.color}", - padding: "0 1.125rem 1.125rem 1.125rem", - gap: "1rem" - }, - file: { - padding: "1rem", - gap: "1rem", - borderColor: "{content.border.color}", - info: { - gap: "0.5rem" - } - }, - fileList: { - gap: "0.5rem" - }, - progressbar: { - height: "0.25rem" - }, - basic: { - gap: "0.5rem" - } -}; -var index$10 = { - root: { - color: "{form.field.float.label.color}", - focusColor: "{form.field.float.label.focus.color}", - activeColor: "{form.field.float.label.active.color}", - invalidColor: "{form.field.float.label.invalid.color}", - transitionDuration: "0.2s", - positionX: "{form.field.padding.x}", - positionY: "{form.field.padding.y}", - fontWeight: "500", - active: { - fontSize: "0.75rem", - fontWeight: "400" - } - }, - over: { - active: { - top: "-1.25rem" - } - }, - "in": { - input: { - paddingTop: "1.5rem", - paddingBottom: "{form.field.padding.y}" - }, - active: { - top: "{form.field.padding.y}" - } - }, - on: { - borderRadius: "{border.radius.xs}", - active: { - background: "{form.field.background}", - padding: "0 0.125rem" - } - } -}; -var index$$ = { - root: { - borderWidth: "1px", - borderColor: "{content.border.color}", - borderRadius: "{content.border.radius}", - transitionDuration: "{transition.duration}" - }, - navButton: { - background: "rgba(255, 255, 255, 0.1)", - hoverBackground: "rgba(255, 255, 255, 0.2)", - color: "{surface.100}", - hoverColor: "{surface.0}", - size: "3rem", - gutter: "0.5rem", - prev: { - borderRadius: "50%" - }, - next: { - borderRadius: "50%" - }, - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - navIcon: { - size: "1.5rem" - }, - thumbnailsContent: { - background: "{content.background}", - padding: "1rem 0.25rem" - }, - thumbnailNavButton: { - size: "2rem", - borderRadius: "{content.border.radius}", - gutter: "0.5rem", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - thumbnailNavButtonIcon: { - size: "1rem" - }, - caption: { - background: "rgba(0, 0, 0, 0.5)", - color: "{surface.100}", - padding: "1rem" - }, - indicatorList: { - gap: "0.5rem", - padding: "1rem" - }, - indicatorButton: { - width: "1rem", - height: "1rem", - activeBackground: "{primary.color}", - borderRadius: "50%", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - insetIndicatorList: { - background: "rgba(0, 0, 0, 0.5)" - }, - insetIndicatorButton: { - background: "rgba(255, 255, 255, 0.4)", - hoverBackground: "rgba(255, 255, 255, 0.6)", - activeBackground: "rgba(255, 255, 255, 0.9)" - }, - closeButton: { - size: "3rem", - gutter: "0.5rem", - background: "rgba(255, 255, 255, 0.1)", - hoverBackground: "rgba(255, 255, 255, 0.2)", - color: "{surface.50}", - hoverColor: "{surface.0}", - borderRadius: "50%", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - closeButtonIcon: { - size: "1.5rem" - }, - colorScheme: { - light: { - thumbnailNavButton: { - hoverBackground: "{surface.100}", - color: "{surface.600}", - hoverColor: "{surface.700}" - }, - indicatorButton: { - background: "{surface.200}", - hoverBackground: "{surface.300}" - } - }, - dark: { - thumbnailNavButton: { - hoverBackground: "{surface.700}", - color: "{surface.400}", - hoverColor: "{surface.0}" - }, - indicatorButton: { - background: "{surface.700}", - hoverBackground: "{surface.600}" - } - } - } -}; -var index$_ = { - icon: { - color: "{form.field.icon.color}" - } -}; -var index$Z = { - root: { - color: "{form.field.float.label.color}", - focusColor: "{form.field.float.label.focus.color}", - invalidColor: "{form.field.float.label.invalid.color}", - transitionDuration: "0.2s", - positionX: "{form.field.padding.x}", - top: "{form.field.padding.y}", - fontSize: "0.75rem", - fontWeight: "400" - }, - input: { - paddingTop: "1.5rem", - paddingBottom: "{form.field.padding.y}" - } -}; -var index$Y = { - root: { - transitionDuration: "{transition.duration}" - }, - preview: { - icon: { - size: "1.5rem" - }, - mask: { - background: "{mask.background}", - color: "{mask.color}" - } - }, - toolbar: { - position: { - left: "auto", - right: "1rem", - top: "1rem", - bottom: "auto" - }, - blur: "8px", - background: "rgba(255,255,255,0.1)", - borderColor: "rgba(255,255,255,0.2)", - borderWidth: "1px", - borderRadius: "30px", - padding: ".5rem", - gap: "0.5rem" - }, - action: { - hoverBackground: "rgba(255,255,255,0.1)", - color: "{surface.50}", - hoverColor: "{surface.0}", - size: "3rem", - iconSize: "1.5rem", - borderRadius: "50%", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - } -}; -var index$X = { - handle: { - size: "15px", - hoverSize: "30px", - background: "rgba(255,255,255,0.3)", - hoverBackground: "rgba(255,255,255,0.3)", - borderColor: "unset", - hoverBorderColor: "unset", - borderWidth: "0", - borderRadius: "50%", - transitionDuration: "{transition.duration}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "rgba(255,255,255,0.3)", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - } -}; -var index$W = { - root: { - padding: "{form.field.padding.y} {form.field.padding.x}", - borderRadius: "{content.border.radius}", - gap: "0.5rem" - }, - text: { - fontWeight: "500" - }, - icon: { - size: "1rem" - }, - colorScheme: { - light: { - info: { - background: "color-mix(in srgb, {blue.50}, transparent 5%)", - borderColor: "{blue.200}", - color: "{blue.600}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)" - }, - success: { - background: "color-mix(in srgb, {green.50}, transparent 5%)", - borderColor: "{green.200}", - color: "{green.600}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)" - }, - warn: { - background: "color-mix(in srgb,{yellow.50}, transparent 5%)", - borderColor: "{yellow.200}", - color: "{yellow.600}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)" - }, - error: { - background: "color-mix(in srgb, {red.50}, transparent 5%)", - borderColor: "{red.200}", - color: "{red.600}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)" - }, - secondary: { - background: "{surface.100}", - borderColor: "{surface.200}", - color: "{surface.600}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)" - }, - contrast: { - background: "{surface.900}", - borderColor: "{surface.950}", - color: "{surface.50}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)" - } - }, - dark: { - info: { - background: "color-mix(in srgb, {blue.500}, transparent 84%)", - borderColor: "color-mix(in srgb, {blue.700}, transparent 64%)", - color: "{blue.500}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)" - }, - success: { - background: "color-mix(in srgb, {green.500}, transparent 84%)", - borderColor: "color-mix(in srgb, {green.700}, transparent 64%)", - color: "{green.500}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)" - }, - warn: { - background: "color-mix(in srgb, {yellow.500}, transparent 84%)", - borderColor: "color-mix(in srgb, {yellow.700}, transparent 64%)", - color: "{yellow.500}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)" - }, - error: { - background: "color-mix(in srgb, {red.500}, transparent 84%)", - borderColor: "color-mix(in srgb, {red.700}, transparent 64%)", - color: "{red.500}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)" - }, - secondary: { - background: "{surface.800}", - borderColor: "{surface.700}", - color: "{surface.300}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)" - }, - contrast: { - background: "{surface.0}", - borderColor: "{surface.100}", - color: "{surface.950}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)" - } - } - } -}; -var index$V = { - root: { - padding: "{form.field.padding.y} {form.field.padding.x}", - borderRadius: "{content.border.radius}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - }, - transitionDuration: "{transition.duration}" - }, - display: { - hoverBackground: "{content.hover.background}", - hoverColor: "{content.hover.color}" - } -}; -var index$U = { - root: { - background: "{form.field.background}", - disabledBackground: "{form.field.disabled.background}", - filledBackground: "{form.field.filled.background}", - filledFocusBackground: "{form.field.filled.focus.background}", - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.hover.border.color}", - focusBorderColor: "{form.field.focus.border.color}", - invalidBorderColor: "{form.field.invalid.border.color}", - color: "{form.field.color}", - disabledColor: "{form.field.disabled.color}", - placeholderColor: "{form.field.placeholder.color}", - shadow: "{form.field.shadow}", - paddingX: "{form.field.padding.x}", - paddingY: "{form.field.padding.y}", - borderRadius: "{form.field.border.radius}", - focusRing: { - width: "{form.field.focus.ring.width}", - style: "{form.field.focus.ring.style}", - color: "{form.field.focus.ring.color}", - offset: "{form.field.focus.ring.offset}", - shadow: "{form.field.focus.ring.shadow}" - }, - transitionDuration: "{form.field.transition.duration}" - }, - chip: { - borderRadius: "{border.radius.sm}" - }, - colorScheme: { - light: { - chip: { - focusBackground: "{surface.200}", - color: "{surface.800}" - } - }, - dark: { - chip: { - focusBackground: "{surface.700}", - color: "{surface.0}" - } - } - } -}; -var index$T = { - addon: { - background: "{form.field.background}", - borderColor: "{form.field.border.color}", - color: "{form.field.icon.color}", - borderRadius: "{form.field.border.radius}", - padding: "0.5rem", - minWidth: "2.5rem" - } -}; -var index$S = { - root: { - transitionDuration: "{transition.duration}" - }, - button: { - width: "2.5rem", - borderRadius: "{form.field.border.radius}", - verticalPadding: "{form.field.padding.y}" - }, - colorScheme: { - light: { - button: { - background: "transparent", - hoverBackground: "{surface.100}", - activeBackground: "{surface.200}", - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.border.color}", - activeBorderColor: "{form.field.border.color}", - color: "{surface.400}", - hoverColor: "{surface.500}", - activeColor: "{surface.600}" - } - }, - dark: { - button: { - background: "transparent", - hoverBackground: "{surface.800}", - activeBackground: "{surface.700}", - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.border.color}", - activeBorderColor: "{form.field.border.color}", - color: "{surface.400}", - hoverColor: "{surface.300}", - activeColor: "{surface.200}" - } - } - } -}; -var index$R = { - root: { - gap: "0.5rem" - }, - input: { - width: "2.5rem", - sm: { - width: "2rem" - }, - lg: { - width: "3rem" - } - } -}; -var index$Q = { - root: { - background: "{form.field.background}", - disabledBackground: "{form.field.disabled.background}", - filledBackground: "{form.field.filled.background}", - filledHoverBackground: "{form.field.filled.hover.background}", - filledFocusBackground: "{form.field.filled.focus.background}", - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.hover.border.color}", - focusBorderColor: "{form.field.focus.border.color}", - invalidBorderColor: "{form.field.invalid.border.color}", - color: "{form.field.color}", - disabledColor: "{form.field.disabled.color}", - placeholderColor: "{form.field.placeholder.color}", - invalidPlaceholderColor: "{form.field.invalid.placeholder.color}", - shadow: "{form.field.shadow}", - paddingX: "{form.field.padding.x}", - paddingY: "{form.field.padding.y}", - borderRadius: "{form.field.border.radius}", - focusRing: { - width: "{form.field.focus.ring.width}", - style: "{form.field.focus.ring.style}", - color: "{form.field.focus.ring.color}", - offset: "{form.field.focus.ring.offset}", - shadow: "{form.field.focus.ring.shadow}" - }, - transitionDuration: "{form.field.transition.duration}", - sm: { - fontSize: "{form.field.sm.font.size}", - paddingX: "{form.field.sm.padding.x}", - paddingY: "{form.field.sm.padding.y}" - }, - lg: { - fontSize: "{form.field.lg.font.size}", - paddingX: "{form.field.lg.padding.x}", - paddingY: "{form.field.lg.padding.y}" - } - } -}; -var index$P = { - root: { - transitionDuration: "{transition.duration}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - value: { - background: "{primary.color}" - }, - range: { - background: "{content.border.color}" - }, - text: { - color: "{text.muted.color}" - } -}; -var index$O = { - root: { - background: "{form.field.background}", - disabledBackground: "{form.field.disabled.background}", - borderColor: "{form.field.border.color}", - invalidBorderColor: "{form.field.invalid.border.color}", - color: "{form.field.color}", - disabledColor: "{form.field.disabled.color}", - shadow: "{form.field.shadow}", - borderRadius: "{form.field.border.radius}", - transitionDuration: "{form.field.transition.duration}" - }, - list: { - padding: "{list.padding}", - gap: "{list.gap}", - header: { - padding: "{list.header.padding}" - } - }, - option: { - focusBackground: "{list.option.focus.background}", - selectedBackground: "{list.option.selected.background}", - selectedFocusBackground: "{list.option.selected.focus.background}", - color: "{list.option.color}", - focusColor: "{list.option.focus.color}", - selectedColor: "{list.option.selected.color}", - selectedFocusColor: "{list.option.selected.focus.color}", - padding: "{list.option.padding}", - borderRadius: "{list.option.border.radius}" - }, - optionGroup: { - background: "{list.option.group.background}", - color: "{list.option.group.color}", - fontWeight: "{list.option.group.font.weight}", - padding: "{list.option.group.padding}" - }, - checkmark: { - color: "{list.option.color}", - gutterStart: "-0.375rem", - gutterEnd: "0.375rem" - }, - emptyMessage: { - padding: "{list.option.padding}" - }, - colorScheme: { - light: { - option: { - stripedBackground: "{surface.50}" - } - }, - dark: { - option: { - stripedBackground: "{surface.900}" - } - } - } -}; -var index$N = { - root: { - background: "{content.background}", - borderColor: "{content.border.color}", - borderRadius: "{content.border.radius}", - color: "{content.color}", - gap: "0.5rem", - verticalOrientation: { - padding: "{navigation.list.padding}", - gap: "{navigation.list.gap}" - }, - horizontalOrientation: { - padding: "0.5rem 0.75rem", - gap: "0.5rem" - }, - transitionDuration: "{transition.duration}" - }, - baseItem: { - borderRadius: "{content.border.radius}", - padding: "{navigation.item.padding}" - }, - item: { - focusBackground: "{navigation.item.focus.background}", - activeBackground: "{navigation.item.active.background}", - color: "{navigation.item.color}", - focusColor: "{navigation.item.focus.color}", - activeColor: "{navigation.item.active.color}", - padding: "{navigation.item.padding}", - borderRadius: "{navigation.item.border.radius}", - gap: "{navigation.item.gap}", - icon: { - color: "{navigation.item.icon.color}", - focusColor: "{navigation.item.icon.focus.color}", - activeColor: "{navigation.item.icon.active.color}" - } - }, - overlay: { - padding: "0", - background: "{content.background}", - borderColor: "{content.border.color}", - borderRadius: "{content.border.radius}", - color: "{content.color}", - shadow: "{overlay.navigation.shadow}", - gap: "0.5rem" - }, - submenu: { - padding: "{navigation.list.padding}", - gap: "{navigation.list.gap}" - }, - submenuLabel: { - padding: "{navigation.submenu.label.padding}", - fontWeight: "{navigation.submenu.label.font.weight}", - background: "{navigation.submenu.label.background.}", - color: "{navigation.submenu.label.color}" - }, - submenuIcon: { - size: "{navigation.submenu.icon.size}", - color: "{navigation.submenu.icon.color}", - focusColor: "{navigation.submenu.icon.focus.color}", - activeColor: "{navigation.submenu.icon.active.color}" - }, - separator: { - borderColor: "{content.border.color}" - }, - mobileButton: { - borderRadius: "50%", - size: "1.75rem", - color: "{text.muted.color}", - hoverColor: "{text.hover.muted.color}", - hoverBackground: "{content.hover.background}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - } -}; -var index$M = { - root: { - background: "{content.background}", - borderColor: "{content.border.color}", - color: "{content.color}", - borderRadius: "{content.border.radius}", - shadow: "{overlay.navigation.shadow}", - transitionDuration: "{transition.duration}" - }, - list: { - padding: "{navigation.list.padding}", - gap: "{navigation.list.gap}" - }, - item: { - focusBackground: "{navigation.item.focus.background}", - color: "{navigation.item.color}", - focusColor: "{navigation.item.focus.color}", - padding: "{navigation.item.padding}", - borderRadius: "{navigation.item.border.radius}", - gap: "{navigation.item.gap}", - icon: { - color: "{navigation.item.icon.color}", - focusColor: "{navigation.item.icon.focus.color}" - } - }, - submenuLabel: { - padding: "{navigation.submenu.label.padding}", - fontWeight: "{navigation.submenu.label.font.weight}", - background: "{navigation.submenu.label.background}", - color: "{navigation.submenu.label.color}" - }, - separator: { - borderColor: "{content.border.color}" - } -}; -var index$L = { - root: { - background: "{content.background}", - borderColor: "{content.border.color}", - borderRadius: "{content.border.radius}", - color: "{content.color}", - gap: "0.5rem", - padding: "0.5rem 0.75rem", - transitionDuration: "{transition.duration}" - }, - baseItem: { - borderRadius: "{content.border.radius}", - padding: "{navigation.item.padding}" - }, - item: { - focusBackground: "{navigation.item.focus.background}", - activeBackground: "{navigation.item.active.background}", - color: "{navigation.item.color}", - focusColor: "{navigation.item.focus.color}", - activeColor: "{navigation.item.active.color}", - padding: "{navigation.item.padding}", - borderRadius: "{navigation.item.border.radius}", - gap: "{navigation.item.gap}", - icon: { - color: "{navigation.item.icon.color}", - focusColor: "{navigation.item.icon.focus.color}", - activeColor: "{navigation.item.icon.active.color}" - } - }, - submenu: { - padding: "{navigation.list.padding}", - gap: "{navigation.list.gap}", - background: "{content.background}", - borderColor: "{content.border.color}", - borderRadius: "{content.border.radius}", - shadow: "{overlay.navigation.shadow}", - mobileIndent: "1rem", - icon: { - size: "{navigation.submenu.icon.size}", - color: "{navigation.submenu.icon.color}", - focusColor: "{navigation.submenu.icon.focus.color}", - activeColor: "{navigation.submenu.icon.active.color}" - } - }, - separator: { - borderColor: "{content.border.color}" - }, - mobileButton: { - borderRadius: "50%", - size: "1.75rem", - color: "{text.muted.color}", - hoverColor: "{text.hover.muted.color}", - hoverBackground: "{content.hover.background}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - } -}; -var index$K = { - root: { - borderRadius: "{content.border.radius}", - borderWidth: "1px", - transitionDuration: "{transition.duration}" - }, - content: { - padding: "0.5rem 0.75rem", - gap: "0.5rem", - sm: { - padding: "0.375rem 0.625rem" - }, - lg: { - padding: "0.625rem 0.875rem" - } - }, - text: { - fontSize: "1rem", - fontWeight: "500", - sm: { - fontSize: "0.875rem" - }, - lg: { - fontSize: "1.125rem" - } - }, - icon: { - size: "1.125rem", - sm: { - size: "1rem" - }, - lg: { - size: "1.25rem" - } - }, - closeButton: { - width: "1.75rem", - height: "1.75rem", - borderRadius: "50%", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - offset: "{focus.ring.offset}" - } - }, - closeIcon: { - size: "1rem", - sm: { - size: "0.875rem" - }, - lg: { - size: "1.125rem" - } - }, - outlined: { - root: { - borderWidth: "1px" - } - }, - simple: { - content: { - padding: "0" - } - }, - colorScheme: { - light: { - info: { - background: "color-mix(in srgb, {blue.50}, transparent 5%)", - borderColor: "{blue.200}", - color: "{blue.600}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)", - closeButton: { - hoverBackground: "{blue.100}", - focusRing: { - color: "{blue.600}", - shadow: "none" - } - }, - outlined: { - color: "{blue.600}", - borderColor: "{blue.600}" - }, - simple: { - color: "{blue.600}" - } - }, - success: { - background: "color-mix(in srgb, {green.50}, transparent 5%)", - borderColor: "{green.200}", - color: "{green.600}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)", - closeButton: { - hoverBackground: "{green.100}", - focusRing: { - color: "{green.600}", - shadow: "none" - } - }, - outlined: { - color: "{green.600}", - borderColor: "{green.600}" - }, - simple: { - color: "{green.600}" - } - }, - warn: { - background: "color-mix(in srgb,{yellow.50}, transparent 5%)", - borderColor: "{yellow.200}", - color: "{yellow.600}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)", - closeButton: { - hoverBackground: "{yellow.100}", - focusRing: { - color: "{yellow.600}", - shadow: "none" - } - }, - outlined: { - color: "{yellow.600}", - borderColor: "{yellow.600}" - }, - simple: { - color: "{yellow.600}" - } - }, - error: { - background: "color-mix(in srgb, {red.50}, transparent 5%)", - borderColor: "{red.200}", - color: "{red.600}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)", - closeButton: { - hoverBackground: "{red.100}", - focusRing: { - color: "{red.600}", - shadow: "none" - } - }, - outlined: { - color: "{red.600}", - borderColor: "{red.600}" - }, - simple: { - color: "{red.600}" - } - }, - secondary: { - background: "{surface.100}", - borderColor: "{surface.200}", - color: "{surface.600}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)", - closeButton: { - hoverBackground: "{surface.200}", - focusRing: { - color: "{surface.600}", - shadow: "none" - } - }, - outlined: { - color: "{surface.500}", - borderColor: "{surface.500}" - }, - simple: { - color: "{surface.500}" - } - }, - contrast: { - background: "{surface.900}", - borderColor: "{surface.950}", - color: "{surface.50}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)", - closeButton: { - hoverBackground: "{surface.800}", - focusRing: { - color: "{surface.50}", - shadow: "none" - } - }, - outlined: { - color: "{surface.950}", - borderColor: "{surface.950}" - }, - simple: { - color: "{surface.950}" - } - } - }, - dark: { - info: { - background: "color-mix(in srgb, {blue.500}, transparent 84%)", - borderColor: "color-mix(in srgb, {blue.700}, transparent 64%)", - color: "{blue.500}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)", - closeButton: { - hoverBackground: "rgba(255, 255, 255, 0.05)", - focusRing: { - color: "{blue.500}", - shadow: "none" - } - }, - outlined: { - color: "{blue.500}", - borderColor: "{blue.500}" - }, - simple: { - color: "{blue.500}" - } - }, - success: { - background: "color-mix(in srgb, {green.500}, transparent 84%)", - borderColor: "color-mix(in srgb, {green.700}, transparent 64%)", - color: "{green.500}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)", - closeButton: { - hoverBackground: "rgba(255, 255, 255, 0.05)", - focusRing: { - color: "{green.500}", - shadow: "none" - } - }, - outlined: { - color: "{green.500}", - borderColor: "{green.500}" - }, - simple: { - color: "{green.500}" - } - }, - warn: { - background: "color-mix(in srgb, {yellow.500}, transparent 84%)", - borderColor: "color-mix(in srgb, {yellow.700}, transparent 64%)", - color: "{yellow.500}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)", - closeButton: { - hoverBackground: "rgba(255, 255, 255, 0.05)", - focusRing: { - color: "{yellow.500}", - shadow: "none" - } - }, - outlined: { - color: "{yellow.500}", - borderColor: "{yellow.500}" - }, - simple: { - color: "{yellow.500}" - } - }, - error: { - background: "color-mix(in srgb, {red.500}, transparent 84%)", - borderColor: "color-mix(in srgb, {red.700}, transparent 64%)", - color: "{red.500}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)", - closeButton: { - hoverBackground: "rgba(255, 255, 255, 0.05)", - focusRing: { - color: "{red.500}", - shadow: "none" - } - }, - outlined: { - color: "{red.500}", - borderColor: "{red.500}" - }, - simple: { - color: "{red.500}" - } - }, - secondary: { - background: "{surface.800}", - borderColor: "{surface.700}", - color: "{surface.300}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)", - closeButton: { - hoverBackground: "{surface.700}", - focusRing: { - color: "{surface.300}", - shadow: "none" - } - }, - outlined: { - color: "{surface.400}", - borderColor: "{surface.400}" - }, - simple: { - color: "{surface.400}" - } - }, - contrast: { - background: "{surface.0}", - borderColor: "{surface.100}", - color: "{surface.950}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)", - closeButton: { - hoverBackground: "{surface.100}", - focusRing: { - color: "{surface.950}", - shadow: "none" - } - }, - outlined: { - color: "{surface.0}", - borderColor: "{surface.0}" - }, - simple: { - color: "{surface.0}" - } - } - } - } -}; -var index$J = { - root: { - borderRadius: "{content.border.radius}", - gap: "1rem" - }, - meters: { - background: "{content.border.color}", - size: "0.5rem" - }, - label: { - gap: "0.5rem" - }, - labelMarker: { - size: "0.5rem" - }, - labelIcon: { - size: "1rem" - }, - labelList: { - verticalGap: "0.5rem", - horizontalGap: "1rem" - } -}; -var index$I = { - root: { - background: "{form.field.background}", - disabledBackground: "{form.field.disabled.background}", - filledBackground: "{form.field.filled.background}", - filledHoverBackground: "{form.field.filled.hover.background}", - filledFocusBackground: "{form.field.filled.focus.background}", - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.hover.border.color}", - focusBorderColor: "{form.field.focus.border.color}", - invalidBorderColor: "{form.field.invalid.border.color}", - color: "{form.field.color}", - disabledColor: "{form.field.disabled.color}", - placeholderColor: "{form.field.placeholder.color}", - invalidPlaceholderColor: "{form.field.invalid.placeholder.color}", - shadow: "{form.field.shadow}", - paddingX: "{form.field.padding.x}", - paddingY: "{form.field.padding.y}", - borderRadius: "{form.field.border.radius}", - focusRing: { - width: "{form.field.focus.ring.width}", - style: "{form.field.focus.ring.style}", - color: "{form.field.focus.ring.color}", - offset: "{form.field.focus.ring.offset}", - shadow: "{form.field.focus.ring.shadow}" - }, - transitionDuration: "{form.field.transition.duration}", - sm: { - fontSize: "{form.field.sm.font.size}", - paddingX: "{form.field.sm.padding.x}", - paddingY: "{form.field.sm.padding.y}" - }, - lg: { - fontSize: "{form.field.lg.font.size}", - paddingX: "{form.field.lg.padding.x}", - paddingY: "{form.field.lg.padding.y}" - } - }, - dropdown: { - width: "2.5rem", - color: "{form.field.icon.color}" - }, - overlay: { - background: "{overlay.select.background}", - borderColor: "{overlay.select.border.color}", - borderRadius: "{overlay.select.border.radius}", - color: "{overlay.select.color}", - shadow: "{overlay.select.shadow}" - }, - list: { - padding: "{list.padding}", - gap: "{list.gap}", - header: { - padding: "{list.header.padding}" - } - }, - option: { - focusBackground: "{list.option.focus.background}", - selectedBackground: "{list.option.selected.background}", - selectedFocusBackground: "{list.option.selected.focus.background}", - color: "{list.option.color}", - focusColor: "{list.option.focus.color}", - selectedColor: "{list.option.selected.color}", - selectedFocusColor: "{list.option.selected.focus.color}", - padding: "{list.option.padding}", - borderRadius: "{list.option.border.radius}", - gap: "0.5rem" - }, - optionGroup: { - background: "{list.option.group.background}", - color: "{list.option.group.color}", - fontWeight: "{list.option.group.font.weight}", - padding: "{list.option.group.padding}" - }, - clearIcon: { - color: "{form.field.icon.color}" - }, - chip: { - borderRadius: "{border.radius.sm}" - }, - emptyMessage: { - padding: "{list.option.padding}" - } -}; -var index$H = { - root: { - gap: "1.125rem" - }, - controls: { - gap: "0.5rem" - } -}; -var index$G = { - root: { - gutter: "0.75rem", - transitionDuration: "{transition.duration}" - }, - node: { - background: "{content.background}", - hoverBackground: "{content.hover.background}", - selectedBackground: "{highlight.background}", - borderColor: "{content.border.color}", - color: "{content.color}", - selectedColor: "{highlight.color}", - hoverColor: "{content.hover.color}", - padding: "0.75rem 1rem", - toggleablePadding: "0.75rem 1rem 1.25rem 1rem", - borderRadius: "{content.border.radius}" - }, - nodeToggleButton: { - background: "{content.background}", - hoverBackground: "{content.hover.background}", - borderColor: "{content.border.color}", - color: "{text.muted.color}", - hoverColor: "{text.color}", - size: "1.5rem", - borderRadius: "50%", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - connector: { - color: "{content.border.color}", - borderRadius: "{content.border.radius}", - height: "24px" - } -}; -var index$F = { - root: { - outline: { - width: "2px", - color: "{content.background}" - } - } -}; -var index$E = { - root: { - padding: "0.5rem 1rem", - gap: "0.25rem", - borderRadius: "{content.border.radius}", - background: "{content.background}", - color: "{content.color}", - transitionDuration: "{transition.duration}" - }, - navButton: { - background: "transparent", - hoverBackground: "{content.hover.background}", - selectedBackground: "{highlight.background}", - color: "{text.muted.color}", - hoverColor: "{text.hover.muted.color}", - selectedColor: "{highlight.color}", - width: "2.5rem", - height: "2.5rem", - borderRadius: "50%", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - currentPageReport: { - color: "{text.muted.color}" - }, - jumpToPageInput: { - maxWidth: "2.5rem" - } -}; -var index$D = { - root: { - background: "{content.background}", - borderColor: "{content.border.color}", - color: "{content.color}", - borderRadius: "{content.border.radius}" - }, - header: { - background: "transparent", - color: "{text.color}", - padding: "1.125rem", - borderColor: "{content.border.color}", - borderWidth: "0", - borderRadius: "0" - }, - toggleableHeader: { - padding: "0.375rem 1.125rem" - }, - title: { - fontWeight: "600" - }, - content: { - padding: "0 1.125rem 1.125rem 1.125rem" - }, - footer: { - padding: "0 1.125rem 1.125rem 1.125rem" - } -}; -var index$C = { - root: { - gap: "0.5rem", - transitionDuration: "{transition.duration}" - }, - panel: { - background: "{content.background}", - borderColor: "{content.border.color}", - borderWidth: "1px", - color: "{content.color}", - padding: "0.25rem 0.25rem", - borderRadius: "{content.border.radius}", - first: { - borderWidth: "1px", - topBorderRadius: "{content.border.radius}" - }, - last: { - borderWidth: "1px", - bottomBorderRadius: "{content.border.radius}" - } - }, - item: { - focusBackground: "{navigation.item.focus.background}", - color: "{navigation.item.color}", - focusColor: "{navigation.item.focus.color}", - gap: "0.5rem", - padding: "{navigation.item.padding}", - borderRadius: "{content.border.radius}", - icon: { - color: "{navigation.item.icon.color}", - focusColor: "{navigation.item.icon.focus.color}" - } - }, - submenu: { - indent: "1rem" - }, - submenuIcon: { - color: "{navigation.submenu.icon.color}", - focusColor: "{navigation.submenu.icon.focus.color}" - } -}; -var index$B = { - meter: { - background: "{content.border.color}", - borderRadius: "{content.border.radius}", - height: ".75rem" - }, - icon: { - color: "{form.field.icon.color}" - }, - overlay: { - background: "{overlay.popover.background}", - borderColor: "{overlay.popover.border.color}", - borderRadius: "{overlay.popover.border.radius}", - color: "{overlay.popover.color}", - padding: "{overlay.popover.padding}", - shadow: "{overlay.popover.shadow}" - }, - content: { - gap: "0.5rem" - }, - colorScheme: { - light: { - strength: { - weakBackground: "{red.500}", - mediumBackground: "{amber.500}", - strongBackground: "{green.500}" - } - }, - dark: { - strength: { - weakBackground: "{red.400}", - mediumBackground: "{amber.400}", - strongBackground: "{green.400}" - } - } - } -}; -var index$A = { - root: { - gap: "1.125rem" - }, - controls: { - gap: "0.5rem" - } -}; -var index$z = { - root: { - background: "{overlay.popover.background}", - borderColor: "{overlay.popover.border.color}", - color: "{overlay.popover.color}", - borderRadius: "{overlay.popover.border.radius}", - shadow: "{overlay.popover.shadow}", - gutter: "10px", - arrowOffset: "1.25rem" - }, - content: { - padding: "{overlay.popover.padding}" - } -}; -var index$y = { - root: { - background: "{content.border.color}", - borderRadius: "{content.border.radius}", - height: "1.25rem" - }, - value: { - background: "{primary.color}" - }, - label: { - color: "{primary.contrast.color}", - fontSize: "0.75rem", - fontWeight: "600" - } -}; -var index$x = { - colorScheme: { - light: { - root: { - "color.1": "{red.500}", - "color.2": "{blue.500}", - "color.3": "{green.500}", - "color.4": "{yellow.500}" - } - }, - dark: { - root: { - "color.1": "{red.400}", - "color.2": "{blue.400}", - "color.3": "{green.400}", - "color.4": "{yellow.400}" - } - } - } -}; -var index$w = { - root: { - width: "1.25rem", - height: "1.25rem", - background: "{form.field.background}", - checkedBackground: "{primary.color}", - checkedHoverBackground: "{primary.hover.color}", - disabledBackground: "{form.field.disabled.background}", - filledBackground: "{form.field.filled.background}", - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.hover.border.color}", - focusBorderColor: "{form.field.border.color}", - checkedBorderColor: "{primary.color}", - checkedHoverBorderColor: "{primary.hover.color}", - checkedFocusBorderColor: "{primary.color}", - checkedDisabledBorderColor: "{form.field.border.color}", - invalidBorderColor: "{form.field.invalid.border.color}", - shadow: "{form.field.shadow}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - }, - transitionDuration: "{form.field.transition.duration}", - sm: { - width: "1rem", - height: "1rem" - }, - lg: { - width: "1.5rem", - height: "1.5rem" - } - }, - icon: { - size: "0.75rem", - checkedColor: "{primary.contrast.color}", - checkedHoverColor: "{primary.contrast.color}", - disabledColor: "{form.field.disabled.color}", - sm: { - size: "0.5rem" - }, - lg: { - size: "1rem" - } - } -}; -var index$v = { - root: { - gap: "0.25rem", - transitionDuration: "{transition.duration}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - icon: { - size: "1rem", - color: "{text.muted.color}", - hoverColor: "{primary.color}", - activeColor: "{primary.color}" - } -}; -var index$u = { - colorScheme: { - light: { - root: { - background: "rgba(0,0,0,0.1)" - } - }, - dark: { - root: { - background: "rgba(255,255,255,0.3)" - } - } - } -}; -var index$t = { - root: { - transitionDuration: "{transition.duration}" - }, - bar: { - size: "9px", - borderRadius: "{border.radius.sm}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - colorScheme: { - light: { - bar: { - background: "{surface.100}" - } - }, - dark: { - bar: { - background: "{surface.800}" - } - } - } -}; -var index$s = { - root: { - background: "{form.field.background}", - disabledBackground: "{form.field.disabled.background}", - filledBackground: "{form.field.filled.background}", - filledHoverBackground: "{form.field.filled.hover.background}", - filledFocusBackground: "{form.field.filled.focus.background}", - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.hover.border.color}", - focusBorderColor: "{form.field.focus.border.color}", - invalidBorderColor: "{form.field.invalid.border.color}", - color: "{form.field.color}", - disabledColor: "{form.field.disabled.color}", - placeholderColor: "{form.field.placeholder.color}", - invalidPlaceholderColor: "{form.field.invalid.placeholder.color}", - shadow: "{form.field.shadow}", - paddingX: "{form.field.padding.x}", - paddingY: "{form.field.padding.y}", - borderRadius: "{form.field.border.radius}", - focusRing: { - width: "{form.field.focus.ring.width}", - style: "{form.field.focus.ring.style}", - color: "{form.field.focus.ring.color}", - offset: "{form.field.focus.ring.offset}", - shadow: "{form.field.focus.ring.shadow}" - }, - transitionDuration: "{form.field.transition.duration}", - sm: { - fontSize: "{form.field.sm.font.size}", - paddingX: "{form.field.sm.padding.x}", - paddingY: "{form.field.sm.padding.y}" - }, - lg: { - fontSize: "{form.field.lg.font.size}", - paddingX: "{form.field.lg.padding.x}", - paddingY: "{form.field.lg.padding.y}" - } - }, - dropdown: { - width: "2.5rem", - color: "{form.field.icon.color}" - }, - overlay: { - background: "{overlay.select.background}", - borderColor: "{overlay.select.border.color}", - borderRadius: "{overlay.select.border.radius}", - color: "{overlay.select.color}", - shadow: "{overlay.select.shadow}" - }, - list: { - padding: "{list.padding}", - gap: "{list.gap}", - header: { - padding: "{list.header.padding}" - } - }, - option: { - focusBackground: "{list.option.focus.background}", - selectedBackground: "{list.option.selected.background}", - selectedFocusBackground: "{list.option.selected.focus.background}", - color: "{list.option.color}", - focusColor: "{list.option.focus.color}", - selectedColor: "{list.option.selected.color}", - selectedFocusColor: "{list.option.selected.focus.color}", - padding: "{list.option.padding}", - borderRadius: "{list.option.border.radius}" - }, - optionGroup: { - background: "{list.option.group.background}", - color: "{list.option.group.color}", - fontWeight: "{list.option.group.font.weight}", - padding: "{list.option.group.padding}" - }, - clearIcon: { - color: "{form.field.icon.color}" - }, - checkmark: { - color: "{list.option.color}", - gutterStart: "-0.375rem", - gutterEnd: "0.375rem" - }, - emptyMessage: { - padding: "{list.option.padding}" - } -}; -var index$r = { - root: { - borderRadius: "{form.field.border.radius}" - }, - colorScheme: { - light: { - root: { - invalidBorderColor: "{form.field.invalid.border.color}" - } - }, - dark: { - root: { - invalidBorderColor: "{form.field.invalid.border.color}" - } - } - } -}; -var index$q = { - root: { - borderRadius: "{content.border.radius}" - }, - colorScheme: { - light: { - root: { - background: "{surface.200}", - animationBackground: "rgba(255,255,255,0.4)" - } - }, - dark: { - root: { - background: "rgba(255, 255, 255, 0.06)", - animationBackground: "rgba(255, 255, 255, 0.04)" - } - } - } -}; -var index$p = { - root: { - transitionDuration: "{transition.duration}" - }, - track: { - background: "{content.border.color}", - borderRadius: "{content.border.radius}", - size: "3px" - }, - range: { - background: "{primary.color}" - }, - handle: { - width: "20px", - height: "20px", - borderRadius: "50%", - background: "{content.border.color}", - hoverBackground: "{content.border.color}", - content: { - borderRadius: "50%", - hoverBackground: "{content.background}", - width: "16px", - height: "16px", - shadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.08), 0px 1px 1px 0px rgba(0, 0, 0, 0.14)" - }, - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - colorScheme: { - light: { - handle: { - contentBackground: "{surface.0}" - } - }, - dark: { - handle: { - contentBackground: "{surface.950}" - } - } - } -}; -var index$o = { - root: { - gap: "0.5rem", - transitionDuration: "{transition.duration}" - } -}; -var index$n = { - root: { - borderRadius: "{form.field.border.radius}", - roundedBorderRadius: "2rem", - raisedShadow: "0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)" - } -}; -var index$m = { - root: { - background: "{content.background}", - borderColor: "{content.border.color}", - color: "{content.color}", - transitionDuration: "{transition.duration}" - }, - gutter: { - background: "{content.border.color}" - }, - handle: { - size: "24px", - background: "transparent", - borderRadius: "{content.border.radius}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - } -}; -var index$l = { - root: { - transitionDuration: "{transition.duration}" - }, - separator: { - background: "{content.border.color}", - activeBackground: "{primary.color}", - margin: "0 0 0 1.625rem", - size: "2px" - }, - step: { - padding: "0.5rem", - gap: "1rem" - }, - stepHeader: { - padding: "0", - borderRadius: "{content.border.radius}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - }, - gap: "0.5rem" - }, - stepTitle: { - color: "{text.muted.color}", - activeColor: "{primary.color}", - fontWeight: "500" - }, - stepNumber: { - background: "{content.background}", - activeBackground: "{content.background}", - borderColor: "{content.border.color}", - activeBorderColor: "{content.border.color}", - color: "{text.muted.color}", - activeColor: "{primary.color}", - size: "2rem", - fontSize: "1.143rem", - fontWeight: "500", - borderRadius: "50%", - shadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)" - }, - steppanels: { - padding: "0.875rem 0.5rem 1.125rem 0.5rem" - }, - steppanel: { - background: "{content.background}", - color: "{content.color}", - padding: "0", - indent: "1rem" - } -}; -var index$k = { - root: { - transitionDuration: "{transition.duration}" - }, - separator: { - background: "{content.border.color}" - }, - itemLink: { - borderRadius: "{content.border.radius}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - }, - gap: "0.5rem" - }, - itemLabel: { - color: "{text.muted.color}", - activeColor: "{primary.color}", - fontWeight: "500" - }, - itemNumber: { - background: "{content.background}", - activeBackground: "{content.background}", - borderColor: "{content.border.color}", - activeBorderColor: "{content.border.color}", - color: "{text.muted.color}", - activeColor: "{primary.color}", - size: "2rem", - fontSize: "1.143rem", - fontWeight: "500", - borderRadius: "50%", - shadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)" - } -}; -var index$j = { - root: { - transitionDuration: "{transition.duration}" - }, - tablist: { - borderWidth: "0 0 1px 0", - background: "{content.background}", - borderColor: "{content.border.color}" - }, - item: { - background: "transparent", - hoverBackground: "transparent", - activeBackground: "transparent", - borderWidth: "0 0 1px 0", - borderColor: "{content.border.color}", - hoverBorderColor: "{content.border.color}", - activeBorderColor: "{primary.color}", - color: "{text.muted.color}", - hoverColor: "{text.color}", - activeColor: "{primary.color}", - padding: "1rem 1.125rem", - fontWeight: "600", - margin: "0 0 -1px 0", - gap: "0.5rem", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - itemIcon: { - color: "{text.muted.color}", - hoverColor: "{text.color}", - activeColor: "{primary.color}" - }, - activeBar: { - height: "1px", - bottom: "-1px", - background: "{primary.color}" - } -}; -var index$i = { - root: { - transitionDuration: "{transition.duration}" - }, - tablist: { - borderWidth: "0 0 1px 0", - background: "{content.background}", - borderColor: "{content.border.color}" - }, - tab: { - background: "transparent", - hoverBackground: "transparent", - activeBackground: "transparent", - borderWidth: "0 0 1px 0", - borderColor: "{content.border.color}", - hoverBorderColor: "{content.border.color}", - activeBorderColor: "{primary.color}", - color: "{text.muted.color}", - hoverColor: "{text.color}", - activeColor: "{primary.color}", - padding: "1rem 1.125rem", - fontWeight: "600", - margin: "0 0 -1px 0", - gap: "0.5rem", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "-1px", - shadow: "{focus.ring.shadow}" - } - }, - tabpanel: { - background: "{content.background}", - color: "{content.color}", - padding: "0.875rem 1.125rem 1.125rem 1.125rem", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "inset {focus.ring.shadow}" - } - }, - navButton: { - background: "{content.background}", - color: "{text.muted.color}", - hoverColor: "{text.color}", - width: "2.5rem", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "-1px", - shadow: "{focus.ring.shadow}" - } - }, - activeBar: { - height: "1px", - bottom: "-1px", - background: "{primary.color}" - }, - colorScheme: { - light: { - navButton: { - shadow: "0px 0px 10px 50px rgba(255, 255, 255, 0.6)" - } - }, - dark: { - navButton: { - shadow: "0px 0px 10px 50px color-mix(in srgb, {content.background}, transparent 50%)" - } - } - } -}; -var index$h = { - root: { - transitionDuration: "{transition.duration}" - }, - tabList: { - background: "{content.background}", - borderColor: "{content.border.color}" - }, - tab: { - borderColor: "{content.border.color}", - activeBorderColor: "{primary.color}", - color: "{text.muted.color}", - hoverColor: "{text.color}", - activeColor: "{primary.color}" - }, - tabPanel: { - background: "{content.background}", - color: "{content.color}" - }, - navButton: { - background: "{content.background}", - color: "{text.muted.color}", - hoverColor: "{text.color}" - }, - colorScheme: { - light: { - navButton: { - shadow: "0px 0px 10px 50px rgba(255, 255, 255, 0.6)" - } - }, - dark: { - navButton: { - shadow: "0px 0px 10px 50px color-mix(in srgb, {content.background}, transparent 50%)" - } - } - } -}; -var index$g = { - root: { - fontSize: "0.875rem", - fontWeight: "700", - padding: "0.25rem 0.5rem", - gap: "0.25rem", - borderRadius: "{content.border.radius}", - roundedBorderRadius: "{border.radius.xl}" - }, - icon: { - size: "0.75rem" - }, - colorScheme: { - light: { - primary: { - background: "{primary.100}", - color: "{primary.700}" - }, - secondary: { - background: "{surface.100}", - color: "{surface.600}" - }, - success: { - background: "{green.100}", - color: "{green.700}" - }, - info: { - background: "{sky.100}", - color: "{sky.700}" - }, - warn: { - background: "{orange.100}", - color: "{orange.700}" - }, - danger: { - background: "{red.100}", - color: "{red.700}" - }, - contrast: { - background: "{surface.950}", - color: "{surface.0}" - } - }, - dark: { - primary: { - background: "color-mix(in srgb, {primary.500}, transparent 84%)", - color: "{primary.300}" - }, - secondary: { - background: "{surface.800}", - color: "{surface.300}" - }, - success: { - background: "color-mix(in srgb, {green.500}, transparent 84%)", - color: "{green.300}" - }, - info: { - background: "color-mix(in srgb, {sky.500}, transparent 84%)", - color: "{sky.300}" - }, - warn: { - background: "color-mix(in srgb, {orange.500}, transparent 84%)", - color: "{orange.300}" - }, - danger: { - background: "color-mix(in srgb, {red.500}, transparent 84%)", - color: "{red.300}" - }, - contrast: { - background: "{surface.0}", - color: "{surface.950}" - } - } - } -}; -var index$f = { - root: { - background: "{form.field.background}", - borderColor: "{form.field.border.color}", - color: "{form.field.color}", - height: "18rem", - padding: "{form.field.padding.y} {form.field.padding.x}", - borderRadius: "{form.field.border.radius}" - }, - prompt: { - gap: "0.25rem" - }, - commandResponse: { - margin: "2px 0" - } -}; -var index$e = { - root: { - background: "{form.field.background}", - disabledBackground: "{form.field.disabled.background}", - filledBackground: "{form.field.filled.background}", - filledFocusBackground: "{form.field.filled.focus.background}", - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.hover.border.color}", - focusBorderColor: "{form.field.focus.border.color}", - invalidBorderColor: "{form.field.invalid.border.color}", - color: "{form.field.color}", - disabledColor: "{form.field.disabled.color}", - placeholderColor: "{form.field.placeholder.color}", - invalidPlaceholderColor: "{form.field.invalid.placeholder.color}", - shadow: "{form.field.shadow}", - paddingX: "{form.field.padding.x}", - paddingY: "{form.field.padding.y}", - borderRadius: "{form.field.border.radius}", - focusRing: { - width: "{form.field.focus.ring.width}", - style: "{form.field.focus.ring.style}", - color: "{form.field.focus.ring.color}", - offset: "{form.field.focus.ring.offset}", - shadow: "{form.field.focus.ring.shadow}" - }, - transitionDuration: "{form.field.transition.duration}", - sm: { - fontSize: "{form.field.sm.font.size}", - paddingX: "{form.field.sm.padding.x}", - paddingY: "{form.field.sm.padding.y}" - }, - lg: { - fontSize: "{form.field.lg.font.size}", - paddingX: "{form.field.lg.padding.x}", - paddingY: "{form.field.lg.padding.y}" - } - } -}; -var index$d = { - root: { - background: "{content.background}", - borderColor: "{content.border.color}", - color: "{content.color}", - borderRadius: "{content.border.radius}", - shadow: "{overlay.navigation.shadow}", - transitionDuration: "{transition.duration}" - }, - list: { - padding: "{navigation.list.padding}", - gap: "{navigation.list.gap}" - }, - item: { - focusBackground: "{navigation.item.focus.background}", - activeBackground: "{navigation.item.active.background}", - color: "{navigation.item.color}", - focusColor: "{navigation.item.focus.color}", - activeColor: "{navigation.item.active.color}", - padding: "{navigation.item.padding}", - borderRadius: "{navigation.item.border.radius}", - gap: "{navigation.item.gap}", - icon: { - color: "{navigation.item.icon.color}", - focusColor: "{navigation.item.icon.focus.color}", - activeColor: "{navigation.item.icon.active.color}" - } - }, - submenu: { - mobileIndent: "1rem" - }, - submenuIcon: { - size: "{navigation.submenu.icon.size}", - color: "{navigation.submenu.icon.color}", - focusColor: "{navigation.submenu.icon.focus.color}", - activeColor: "{navigation.submenu.icon.active.color}" - }, - separator: { - borderColor: "{content.border.color}" - } -}; -var index$c = { - event: { - minHeight: "5rem" - }, - horizontal: { - eventContent: { - padding: "1rem 0" - } - }, - vertical: { - eventContent: { - padding: "0 1rem" - } - }, - eventMarker: { - size: "1.125rem", - borderRadius: "50%", - borderWidth: "2px", - background: "{content.background}", - borderColor: "{content.border.color}", - content: { - borderRadius: "50%", - size: "0.375rem", - background: "{primary.color}", - insetShadow: "0px 0.5px 0px 0px rgba(0, 0, 0, 0.06), 0px 1px 1px 0px rgba(0, 0, 0, 0.12)" - } - }, - eventConnector: { - color: "{content.border.color}", - size: "2px" - } -}; -var index$b = { - root: { - width: "25rem", - borderRadius: "{content.border.radius}", - borderWidth: "1px", - transitionDuration: "{transition.duration}" - }, - icon: { - size: "1.125rem" - }, - content: { - padding: "{overlay.popover.padding}", - gap: "0.5rem" - }, - text: { - gap: "0.5rem" - }, - summary: { - fontWeight: "500", - fontSize: "1rem" - }, - detail: { - fontWeight: "500", - fontSize: "0.875rem" - }, - closeButton: { - width: "1.75rem", - height: "1.75rem", - borderRadius: "50%", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - offset: "{focus.ring.offset}" - } - }, - closeIcon: { - size: "1rem" - }, - colorScheme: { - light: { - blur: "1.5px", - info: { - background: "color-mix(in srgb, {blue.50}, transparent 5%)", - borderColor: "{blue.200}", - color: "{blue.600}", - detailColor: "{surface.700}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)", - closeButton: { - hoverBackground: "{blue.100}", - focusRing: { - color: "{blue.600}", - shadow: "none" - } - } - }, - success: { - background: "color-mix(in srgb, {green.50}, transparent 5%)", - borderColor: "{green.200}", - color: "{green.600}", - detailColor: "{surface.700}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)", - closeButton: { - hoverBackground: "{green.100}", - focusRing: { - color: "{green.600}", - shadow: "none" - } - } - }, - warn: { - background: "color-mix(in srgb,{yellow.50}, transparent 5%)", - borderColor: "{yellow.200}", - color: "{yellow.600}", - detailColor: "{surface.700}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)", - closeButton: { - hoverBackground: "{yellow.100}", - focusRing: { - color: "{yellow.600}", - shadow: "none" - } - } - }, - error: { - background: "color-mix(in srgb, {red.50}, transparent 5%)", - borderColor: "{red.200}", - color: "{red.600}", - detailColor: "{surface.700}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)", - closeButton: { - hoverBackground: "{red.100}", - focusRing: { - color: "{red.600}", - shadow: "none" - } - } - }, - secondary: { - background: "{surface.100}", - borderColor: "{surface.200}", - color: "{surface.600}", - detailColor: "{surface.700}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)", - closeButton: { - hoverBackground: "{surface.200}", - focusRing: { - color: "{surface.600}", - shadow: "none" - } - } - }, - contrast: { - background: "{surface.900}", - borderColor: "{surface.950}", - color: "{surface.50}", - detailColor: "{surface.0}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)", - closeButton: { - hoverBackground: "{surface.800}", - focusRing: { - color: "{surface.50}", - shadow: "none" - } - } - } - }, - dark: { - blur: "10px", - info: { - background: "color-mix(in srgb, {blue.500}, transparent 84%)", - borderColor: "color-mix(in srgb, {blue.700}, transparent 64%)", - color: "{blue.500}", - detailColor: "{surface.0}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {blue.500}, transparent 96%)", - closeButton: { - hoverBackground: "rgba(255, 255, 255, 0.05)", - focusRing: { - color: "{blue.500}", - shadow: "none" - } - } - }, - success: { - background: "color-mix(in srgb, {green.500}, transparent 84%)", - borderColor: "color-mix(in srgb, {green.700}, transparent 64%)", - color: "{green.500}", - detailColor: "{surface.0}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {green.500}, transparent 96%)", - closeButton: { - hoverBackground: "rgba(255, 255, 255, 0.05)", - focusRing: { - color: "{green.500}", - shadow: "none" - } - } - }, - warn: { - background: "color-mix(in srgb, {yellow.500}, transparent 84%)", - borderColor: "color-mix(in srgb, {yellow.700}, transparent 64%)", - color: "{yellow.500}", - detailColor: "{surface.0}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {yellow.500}, transparent 96%)", - closeButton: { - hoverBackground: "rgba(255, 255, 255, 0.05)", - focusRing: { - color: "{yellow.500}", - shadow: "none" - } - } - }, - error: { - background: "color-mix(in srgb, {red.500}, transparent 84%)", - borderColor: "color-mix(in srgb, {red.700}, transparent 64%)", - color: "{red.500}", - detailColor: "{surface.0}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {red.500}, transparent 96%)", - closeButton: { - hoverBackground: "rgba(255, 255, 255, 0.05)", - focusRing: { - color: "{red.500}", - shadow: "none" - } - } - }, - secondary: { - background: "{surface.800}", - borderColor: "{surface.700}", - color: "{surface.300}", - detailColor: "{surface.0}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.500}, transparent 96%)", - closeButton: { - hoverBackground: "{surface.700}", - focusRing: { - color: "{surface.300}", - shadow: "none" - } - } - }, - contrast: { - background: "{surface.0}", - borderColor: "{surface.100}", - color: "{surface.950}", - detailColor: "{surface.950}", - shadow: "0px 4px 8px 0px color-mix(in srgb, {surface.950}, transparent 96%)", - closeButton: { - hoverBackground: "{surface.100}", - focusRing: { - color: "{surface.950}", - shadow: "none" - } - } - } - } - } -}; -var index$a = { - root: { - padding: "0.5rem 1rem", - borderRadius: "{content.border.radius}", - gap: "0.5rem", - fontWeight: "500", - disabledBackground: "{form.field.disabled.background}", - disabledBorderColor: "{form.field.disabled.background}", - disabledColor: "{form.field.disabled.color}", - invalidBorderColor: "{form.field.invalid.border.color}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - }, - transitionDuration: "{form.field.transition.duration}", - sm: { - fontSize: "{form.field.sm.font.size}", - padding: "0.375rem 0.75rem" - }, - lg: { - fontSize: "{form.field.lg.font.size}", - padding: "0.625rem 1.25rem" - } - }, - icon: { - disabledColor: "{form.field.disabled.color}" - }, - content: { - left: "0.25rem", - top: "0.25rem", - checkedShadow: "0px 1px 2px 0px rgba(0, 0, 0, 0.02), 0px 1px 2px 0px rgba(0, 0, 0, 0.04)" - }, - colorScheme: { - light: { - root: { - background: "{surface.100}", - checkedBackground: "{surface.100}", - hoverBackground: "{surface.100}", - borderColor: "{surface.100}", - color: "{surface.500}", - hoverColor: "{surface.700}", - checkedColor: "{surface.900}", - checkedBorderColor: "{surface.100}" - }, - content: { - checkedBackground: "{surface.0}" - }, - icon: { - color: "{surface.500}", - hoverColor: "{surface.700}", - checkedColor: "{surface.900}" - } - }, - dark: { - root: { - background: "{surface.950}", - checkedBackground: "{surface.950}", - hoverBackground: "{surface.950}", - borderColor: "{surface.950}", - color: "{surface.400}", - hoverColor: "{surface.300}", - checkedColor: "{surface.0}", - checkedBorderColor: "{surface.950}" - }, - content: { - checkedBackground: "{surface.800}" - }, - icon: { - color: "{surface.400}", - hoverColor: "{surface.300}", - checkedColor: "{surface.0}" - } - } - } -}; -var index$9 = { - root: { - width: "2.5rem", - height: "1.5rem", - borderRadius: "30px", - gap: "0.25rem", - shadow: "{form.field.shadow}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - }, - borderWidth: "1px", - borderColor: "transparent", - hoverBorderColor: "transparent", - checkedBorderColor: "transparent", - checkedHoverBorderColor: "transparent", - invalidBorderColor: "{form.field.invalid.border.color}", - transitionDuration: "{form.field.transition.duration}", - slideDuration: "0.2s" - }, - handle: { - borderRadius: "50%", - size: "1rem" - }, - colorScheme: { - light: { - root: { - background: "{surface.300}", - disabledBackground: "{form.field.disabled.background}", - hoverBackground: "{surface.400}", - checkedBackground: "{primary.color}", - checkedHoverBackground: "{primary.hover.color}" - }, - handle: { - background: "{surface.0}", - disabledBackground: "{form.field.disabled.color}", - hoverBackground: "{surface.0}", - checkedBackground: "{surface.0}", - checkedHoverBackground: "{surface.0}", - color: "{text.muted.color}", - hoverColor: "{text.color}", - checkedColor: "{primary.color}", - checkedHoverColor: "{primary.hover.color}" - } - }, - dark: { - root: { - background: "{surface.700}", - disabledBackground: "{surface.600}", - hoverBackground: "{surface.600}", - checkedBackground: "{primary.color}", - checkedHoverBackground: "{primary.hover.color}" - }, - handle: { - background: "{surface.400}", - disabledBackground: "{surface.900}", - hoverBackground: "{surface.300}", - checkedBackground: "{surface.900}", - checkedHoverBackground: "{surface.900}", - color: "{surface.900}", - hoverColor: "{surface.800}", - checkedColor: "{primary.color}", - checkedHoverColor: "{primary.hover.color}" - } - } - } -}; -var index$8 = { - root: { - background: "{content.background}", - borderColor: "{content.border.color}", - borderRadius: "{content.border.radius}", - color: "{content.color}", - gap: "0.5rem", - padding: "0.75rem" - } -}; -var index$7 = { - root: { - maxWidth: "12.5rem", - gutter: "0.25rem", - shadow: "{overlay.popover.shadow}", - padding: "0.5rem 0.75rem", - borderRadius: "{overlay.popover.border.radius}" - }, - colorScheme: { - light: { - root: { - background: "{surface.700}", - color: "{surface.0}" - } - }, - dark: { - root: { - background: "{surface.700}", - color: "{surface.0}" - } - } - } -}; -var index$6 = { - root: { - background: "{content.background}", - color: "{content.color}", - padding: "1rem", - gap: "2px", - indent: "1rem", - transitionDuration: "{transition.duration}" - }, - node: { - padding: "0.25rem 0.5rem", - borderRadius: "{content.border.radius}", - hoverBackground: "{content.hover.background}", - selectedBackground: "{highlight.background}", - color: "{text.color}", - hoverColor: "{text.hover.color}", - selectedColor: "{highlight.color}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "-1px", - shadow: "{focus.ring.shadow}" - }, - gap: "0.25rem" - }, - nodeIcon: { - color: "{text.muted.color}", - hoverColor: "{text.hover.muted.color}", - selectedColor: "{highlight.color}" - }, - nodeToggleButton: { - borderRadius: "50%", - size: "1.75rem", - hoverBackground: "{content.hover.background}", - selectedHoverBackground: "{content.background}", - color: "{text.muted.color}", - hoverColor: "{text.hover.muted.color}", - selectedHoverColor: "{primary.color}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - loadingIcon: { - size: "2rem" - }, - filter: { - margin: "0 0 0.5rem 0" - } -}; -var index$5 = { - root: { - background: "{form.field.background}", - disabledBackground: "{form.field.disabled.background}", - filledBackground: "{form.field.filled.background}", - filledHoverBackground: "{form.field.filled.hover.background}", - filledFocusBackground: "{form.field.filled.focus.background}", - borderColor: "{form.field.border.color}", - hoverBorderColor: "{form.field.hover.border.color}", - focusBorderColor: "{form.field.focus.border.color}", - invalidBorderColor: "{form.field.invalid.border.color}", - color: "{form.field.color}", - disabledColor: "{form.field.disabled.color}", - placeholderColor: "{form.field.placeholder.color}", - invalidPlaceholderColor: "{form.field.invalid.placeholder.color}", - shadow: "{form.field.shadow}", - paddingX: "{form.field.padding.x}", - paddingY: "{form.field.padding.y}", - borderRadius: "{form.field.border.radius}", - focusRing: { - width: "{form.field.focus.ring.width}", - style: "{form.field.focus.ring.style}", - color: "{form.field.focus.ring.color}", - offset: "{form.field.focus.ring.offset}", - shadow: "{form.field.focus.ring.shadow}" - }, - transitionDuration: "{form.field.transition.duration}", - sm: { - fontSize: "{form.field.sm.font.size}", - paddingX: "{form.field.sm.padding.x}", - paddingY: "{form.field.sm.padding.y}" - }, - lg: { - fontSize: "{form.field.lg.font.size}", - paddingX: "{form.field.lg.padding.x}", - paddingY: "{form.field.lg.padding.y}" - } - }, - dropdown: { - width: "2.5rem", - color: "{form.field.icon.color}" - }, - overlay: { - background: "{overlay.select.background}", - borderColor: "{overlay.select.border.color}", - borderRadius: "{overlay.select.border.radius}", - color: "{overlay.select.color}", - shadow: "{overlay.select.shadow}" - }, - tree: { - padding: "{list.padding}" - }, - clearIcon: { - color: "{form.field.icon.color}" - }, - emptyMessage: { - padding: "{list.option.padding}" - }, - chip: { - borderRadius: "{border.radius.sm}" - } -}; -var index$4 = { - root: { - transitionDuration: "{transition.duration}" - }, - header: { - background: "{content.background}", - borderColor: "{treetable.border.color}", - color: "{content.color}", - borderWidth: "0 0 1px 0", - padding: "0.75rem 1rem" - }, - headerCell: { - background: "{content.background}", - hoverBackground: "{content.hover.background}", - selectedBackground: "{highlight.background}", - borderColor: "{treetable.border.color}", - color: "{content.color}", - hoverColor: "{content.hover.color}", - selectedColor: "{highlight.color}", - gap: "0.5rem", - padding: "0.75rem 1rem", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "-1px", - shadow: "{focus.ring.shadow}" - } - }, - columnTitle: { - fontWeight: "600" - }, - row: { - background: "{content.background}", - hoverBackground: "{content.hover.background}", - selectedBackground: "{highlight.background}", - color: "{content.color}", - hoverColor: "{content.hover.color}", - selectedColor: "{highlight.color}", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "-1px", - shadow: "{focus.ring.shadow}" - } - }, - bodyCell: { - borderColor: "{treetable.border.color}", - padding: "0.75rem 1rem", - gap: "0.5rem" - }, - footerCell: { - background: "{content.background}", - borderColor: "{treetable.border.color}", - color: "{content.color}", - padding: "0.75rem 1rem" - }, - columnFooter: { - fontWeight: "600" - }, - footer: { - background: "{content.background}", - borderColor: "{treetable.border.color}", - color: "{content.color}", - borderWidth: "0 0 1px 0", - padding: "0.75rem 1rem" - }, - columnResizerWidth: "0.5rem", - resizeIndicator: { - width: "1px", - color: "{primary.color}" - }, - sortIcon: { - color: "{text.muted.color}", - hoverColor: "{text.hover.muted.color}", - size: "0.875rem" - }, - loadingIcon: { - size: "2rem" - }, - nodeToggleButton: { - hoverBackground: "{content.hover.background}", - selectedHoverBackground: "{content.background}", - color: "{text.muted.color}", - hoverColor: "{text.color}", - selectedHoverColor: "{primary.color}", - size: "1.75rem", - borderRadius: "50%", - focusRing: { - width: "{focus.ring.width}", - style: "{focus.ring.style}", - color: "{focus.ring.color}", - offset: "{focus.ring.offset}", - shadow: "{focus.ring.shadow}" - } - }, - paginatorTop: { - borderColor: "{content.border.color}", - borderWidth: "0 0 1px 0" - }, - paginatorBottom: { - borderColor: "{content.border.color}", - borderWidth: "0 0 1px 0" - }, - colorScheme: { - light: { - root: { - borderColor: "{content.border.color}" - }, - bodyCell: { - selectedBorderColor: "{primary.100}" - } - }, - dark: { - root: { - borderColor: "{surface.800}" - }, - bodyCell: { - selectedBorderColor: "{primary.900}" - } - } - } -}; -var index$3 = { - loader: { - mask: { - background: "{content.background}", - color: "{text.muted.color}" - }, - icon: { - size: "2rem" - } - } -}; -function _typeof$q(o2) { - "@babel/helpers - typeof"; - return _typeof$q = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) { - return typeof o3; - } : function(o3) { - return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3; - }, _typeof$q(o2); -} -__name(_typeof$q, "_typeof$q"); -function ownKeys$o(e2, r2) { - var t2 = Object.keys(e2); - if (Object.getOwnPropertySymbols) { - var o2 = Object.getOwnPropertySymbols(e2); - r2 && (o2 = o2.filter(function(r3) { - return Object.getOwnPropertyDescriptor(e2, r3).enumerable; - })), t2.push.apply(t2, o2); - } - return t2; -} -__name(ownKeys$o, "ownKeys$o"); -function _objectSpread$o(e2) { - for (var r2 = 1; r2 < arguments.length; r2++) { - var t2 = null != arguments[r2] ? arguments[r2] : {}; - r2 % 2 ? ownKeys$o(Object(t2), true).forEach(function(r3) { - _defineProperty$s(e2, r3, t2[r3]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$o(Object(t2)).forEach(function(r3) { - Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3)); - }); - } - return e2; -} -__name(_objectSpread$o, "_objectSpread$o"); -function _defineProperty$s(e2, r2, t2) { - return (r2 = _toPropertyKey$q(r2)) in e2 ? Object.defineProperty(e2, r2, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r2] = t2, e2; -} -__name(_defineProperty$s, "_defineProperty$s"); -function _toPropertyKey$q(t2) { - var i2 = _toPrimitive$q(t2, "string"); - return "symbol" == _typeof$q(i2) ? i2 : i2 + ""; -} -__name(_toPropertyKey$q, "_toPropertyKey$q"); -function _toPrimitive$q(t2, r2) { - if ("object" != _typeof$q(t2) || !t2) return t2; - var e2 = t2[Symbol.toPrimitive]; - if (void 0 !== e2) { - var i2 = e2.call(t2, r2 || "default"); - if ("object" != _typeof$q(i2)) return i2; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === r2 ? String : Number)(t2); -} -__name(_toPrimitive$q, "_toPrimitive$q"); -var index$2 = _objectSpread$o(_objectSpread$o({}, index$1n), {}, { - components: { - accordion: index$1r, - autocomplete: index$1q, - avatar: index$1p, - badge: index$1o, - blockui: index$1m, - breadcrumb: index$1l, - button: index$1k, - datepicker: index$18, - card: index$1j, - carousel: index$1i, - cascadeselect: index$1h, - checkbox: index$1g, - chip: index$1f, - colorpicker: index$1e, - confirmdialog: index$1d, - confirmpopup: index$1c, - contextmenu: index$1b, - dataview: index$19, - datatable: index$1a, - dialog: index$17, - divider: index$16, - dock: index$15, - drawer: index$14, - editor: index$13, - fieldset: index$12, - fileupload: index$11, - iftalabel: index$Z, - floatlabel: index$10, - galleria: index$$, - iconfield: index$_, - image: index$Y, - imagecompare: index$X, - inlinemessage: index$W, - inplace: index$V, - inputchips: index$U, - inputgroup: index$T, - inputnumber: index$S, - inputotp: index$R, - inputtext: index$Q, - knob: index$P, - listbox: index$O, - megamenu: index$N, - menu: index$M, - menubar: index$L, - message: index$K, - metergroup: index$J, - multiselect: index$I, - orderlist: index$H, - organizationchart: index$G, - overlaybadge: index$F, - popover: index$z, - paginator: index$E, - password: index$B, - panel: index$D, - panelmenu: index$C, - picklist: index$A, - progressbar: index$y, - progressspinner: index$x, - radiobutton: index$w, - rating: index$v, - scrollpanel: index$t, - select: index$s, - selectbutton: index$r, - skeleton: index$q, - slider: index$p, - speeddial: index$o, - splitter: index$m, - splitbutton: index$n, - stepper: index$l, - steps: index$k, - tabmenu: index$j, - tabs: index$i, - tabview: index$h, - textarea: index$e, - tieredmenu: index$d, - tag: index$g, - terminal: index$f, - timeline: index$c, - togglebutton: index$a, - toggleswitch: index$9, - tree: index$6, - treeselect: index$5, - treetable: index$4, - toast: index$b, - toolbar: index$8, - virtualscroller: index$3 - }, - directives: { - tooltip: index$7, - ripple: index$u - } -}); -const DEBUG_BUILD$6 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; -const SDK_VERSION = "8.55.0"; -const GLOBAL_OBJ = globalThis; -function getGlobalSingleton(name2, creator, obj) { - const gbl = obj || GLOBAL_OBJ; - const __SENTRY__ = gbl.__SENTRY__ = gbl.__SENTRY__ || {}; - const versionedCarrier = __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {}; - return versionedCarrier[name2] || (versionedCarrier[name2] = creator()); -} -__name(getGlobalSingleton, "getGlobalSingleton"); -const DEBUG_BUILD$5 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; -const PREFIX$2 = "Sentry Logger "; -const CONSOLE_LEVELS$1 = [ - "debug", - "info", - "warn", - "error", - "log", - "assert", - "trace" -]; -const originalConsoleMethods = {}; -function consoleSandbox(callback) { - if (!("console" in GLOBAL_OBJ)) { - return callback(); - } - const console2 = GLOBAL_OBJ.console; - const wrappedFuncs = {}; - const wrappedLevels = Object.keys(originalConsoleMethods); - wrappedLevels.forEach((level) => { - const originalConsoleMethod = originalConsoleMethods[level]; - wrappedFuncs[level] = console2[level]; - console2[level] = originalConsoleMethod; - }); - try { - return callback(); - } finally { - wrappedLevels.forEach((level) => { - console2[level] = wrappedFuncs[level]; - }); - } -} -__name(consoleSandbox, "consoleSandbox"); -function makeLogger() { - let enabled = false; - const logger2 = { - enable: /* @__PURE__ */ __name(() => { - enabled = true; - }, "enable"), - disable: /* @__PURE__ */ __name(() => { - enabled = false; - }, "disable"), - isEnabled: /* @__PURE__ */ __name(() => enabled, "isEnabled") - }; - if (DEBUG_BUILD$5) { - CONSOLE_LEVELS$1.forEach((name2) => { - logger2[name2] = (...args) => { - if (enabled) { - consoleSandbox(() => { - GLOBAL_OBJ.console[name2](`${PREFIX$2}[${name2}]:`, ...args); - }); - } - }; - }); - } else { - CONSOLE_LEVELS$1.forEach((name2) => { - logger2[name2] = () => void 0; - }); - } - return logger2; -} -__name(makeLogger, "makeLogger"); -const logger$2 = getGlobalSingleton("logger", makeLogger); -const STACKTRACE_FRAME_LIMIT = 50; -const UNKNOWN_FUNCTION = "?"; -const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/; -const STRIP_FRAME_REGEXP = /captureMessage|captureException/; -function createStackParser(...parsers) { - const sortedParsers = parsers.sort((a2, b2) => a2[0] - b2[0]).map((p2) => p2[1]); - return (stack2, skipFirstLines = 0, framesToPop = 0) => { - const frames = []; - const lines = stack2.split("\n"); - for (let i2 = skipFirstLines; i2 < lines.length; i2++) { - const line = lines[i2]; - if (line.length > 1024) { - continue; - } - const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, "$1") : line; - if (cleanedLine.match(/\S*Error: /)) { - continue; - } - for (const parser of sortedParsers) { - const frame = parser(cleanedLine); - if (frame) { - frames.push(frame); - break; - } - } - if (frames.length >= STACKTRACE_FRAME_LIMIT + framesToPop) { - break; - } - } - return stripSentryFramesAndReverse(frames.slice(framesToPop)); - }; -} -__name(createStackParser, "createStackParser"); -function stackParserFromStackParserOptions(stackParser) { - if (Array.isArray(stackParser)) { - return createStackParser(...stackParser); - } - return stackParser; -} -__name(stackParserFromStackParserOptions, "stackParserFromStackParserOptions"); -function stripSentryFramesAndReverse(stack2) { - if (!stack2.length) { - return []; - } - const localStack = Array.from(stack2); - if (/sentryWrapped/.test(getLastStackFrame(localStack).function || "")) { - localStack.pop(); - } - localStack.reverse(); - if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || "")) { - localStack.pop(); - if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || "")) { - localStack.pop(); - } - } - return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame) => ({ - ...frame, - filename: frame.filename || getLastStackFrame(localStack).filename, - function: frame.function || UNKNOWN_FUNCTION - })); -} -__name(stripSentryFramesAndReverse, "stripSentryFramesAndReverse"); -function getLastStackFrame(arr) { - return arr[arr.length - 1] || {}; -} -__name(getLastStackFrame, "getLastStackFrame"); -const defaultFunctionName = ""; -function getFunctionName(fn) { - try { - if (!fn || typeof fn !== "function") { - return defaultFunctionName; - } - return fn.name || defaultFunctionName; - } catch (e2) { - return defaultFunctionName; - } -} -__name(getFunctionName, "getFunctionName"); -function getFramesFromEvent(event) { - const exception = event.exception; - if (exception) { - const frames = []; - try { - exception.values.forEach((value4) => { - if (value4.stacktrace.frames) { - frames.push(...value4.stacktrace.frames); - } - }); - return frames; - } catch (_oO) { - return void 0; - } - } - return void 0; -} -__name(getFramesFromEvent, "getFramesFromEvent"); -const handlers$4 = {}; -const instrumented$1 = {}; -function addHandler$1(type, handler10) { - handlers$4[type] = handlers$4[type] || []; - handlers$4[type].push(handler10); -} -__name(addHandler$1, "addHandler$1"); -function resetInstrumentationHandlers() { - Object.keys(handlers$4).forEach((key) => { - handlers$4[key] = void 0; - }); -} -__name(resetInstrumentationHandlers, "resetInstrumentationHandlers"); -function maybeInstrument(type, instrumentFn) { - if (!instrumented$1[type]) { - instrumented$1[type] = true; - try { - instrumentFn(); - } catch (e2) { - DEBUG_BUILD$5 && logger$2.error(`Error while instrumenting ${type}`, e2); - } - } -} -__name(maybeInstrument, "maybeInstrument"); -function triggerHandlers$1(type, data26) { - const typeHandlers = type && handlers$4[type]; - if (!typeHandlers) { - return; - } - for (const handler10 of typeHandlers) { - try { - handler10(data26); - } catch (e2) { - DEBUG_BUILD$5 && logger$2.error( - `Error while triggering instrumentation handler. -Type: ${type} -Name: ${getFunctionName(handler10)} -Error:`, - e2 - ); - } - } -} -__name(triggerHandlers$1, "triggerHandlers$1"); -let _oldOnErrorHandler = null; -function addGlobalErrorInstrumentationHandler(handler10) { - const type = "error"; - addHandler$1(type, handler10); - maybeInstrument(type, instrumentError); -} -__name(addGlobalErrorInstrumentationHandler, "addGlobalErrorInstrumentationHandler"); -function instrumentError() { - _oldOnErrorHandler = GLOBAL_OBJ.onerror; - GLOBAL_OBJ.onerror = function(msg, url, line, column, error2) { - const handlerData = { - column, - error: error2, - line, - msg, - url - }; - triggerHandlers$1("error", handlerData); - if (_oldOnErrorHandler) { - return _oldOnErrorHandler.apply(this, arguments); - } - return false; - }; - GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true; -} -__name(instrumentError, "instrumentError"); -let _oldOnUnhandledRejectionHandler = null; -function addGlobalUnhandledRejectionInstrumentationHandler(handler10) { - const type = "unhandledrejection"; - addHandler$1(type, handler10); - maybeInstrument(type, instrumentUnhandledRejection); -} -__name(addGlobalUnhandledRejectionInstrumentationHandler, "addGlobalUnhandledRejectionInstrumentationHandler"); -function instrumentUnhandledRejection() { - _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection; - GLOBAL_OBJ.onunhandledrejection = function(e2) { - const handlerData = e2; - triggerHandlers$1("unhandledrejection", handlerData); - if (_oldOnUnhandledRejectionHandler) { - return _oldOnUnhandledRejectionHandler.apply(this, arguments); - } - return true; - }; - GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true; -} -__name(instrumentUnhandledRejection, "instrumentUnhandledRejection"); -function getMainCarrier() { - getSentryCarrier(GLOBAL_OBJ); - return GLOBAL_OBJ; -} -__name(getMainCarrier, "getMainCarrier"); -function getSentryCarrier(carrier) { - const __SENTRY__ = carrier.__SENTRY__ = carrier.__SENTRY__ || {}; - __SENTRY__.version = __SENTRY__.version || SDK_VERSION; - return __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {}; -} -__name(getSentryCarrier, "getSentryCarrier"); -const objectToString$4 = Object.prototype.toString; -function isError(wat) { - switch (objectToString$4.call(wat)) { - case "[object Error]": - case "[object Exception]": - case "[object DOMException]": - case "[object WebAssembly.Exception]": - return true; - default: - return isInstanceOf(wat, Error); - } -} -__name(isError, "isError"); -function isBuiltin(wat, className) { - return objectToString$4.call(wat) === `[object ${className}]`; -} -__name(isBuiltin, "isBuiltin"); -function isErrorEvent$2(wat) { - return isBuiltin(wat, "ErrorEvent"); -} -__name(isErrorEvent$2, "isErrorEvent$2"); -function isDOMError(wat) { - return isBuiltin(wat, "DOMError"); -} -__name(isDOMError, "isDOMError"); -function isDOMException(wat) { - return isBuiltin(wat, "DOMException"); -} -__name(isDOMException, "isDOMException"); -function isString$a(wat) { - return isBuiltin(wat, "String"); -} -__name(isString$a, "isString$a"); -function isParameterizedString(wat) { - return typeof wat === "object" && wat !== null && "__sentry_template_string__" in wat && "__sentry_template_values__" in wat; -} -__name(isParameterizedString, "isParameterizedString"); -function isPrimitive(wat) { - return wat === null || isParameterizedString(wat) || typeof wat !== "object" && typeof wat !== "function"; -} -__name(isPrimitive, "isPrimitive"); -function isPlainObject$5(wat) { - return isBuiltin(wat, "Object"); -} -__name(isPlainObject$5, "isPlainObject$5"); -function isEvent(wat) { - return typeof Event !== "undefined" && isInstanceOf(wat, Event); -} -__name(isEvent, "isEvent"); -function isElement$3(wat) { - return typeof Element !== "undefined" && isInstanceOf(wat, Element); -} -__name(isElement$3, "isElement$3"); -function isRegExp$6(wat) { - return isBuiltin(wat, "RegExp"); -} -__name(isRegExp$6, "isRegExp$6"); -function isThenable$1(wat) { - return Boolean(wat && wat.then && typeof wat.then === "function"); -} -__name(isThenable$1, "isThenable$1"); -function isSyntheticEvent(wat) { - return isPlainObject$5(wat) && "nativeEvent" in wat && "preventDefault" in wat && "stopPropagation" in wat; -} -__name(isSyntheticEvent, "isSyntheticEvent"); -function isInstanceOf(wat, base2) { - try { - return wat instanceof base2; - } catch (_e) { - return false; - } -} -__name(isInstanceOf, "isInstanceOf"); -function isVueViewModel(wat) { - return !!(typeof wat === "object" && wat !== null && (wat.__isVue || wat._isVue)); -} -__name(isVueViewModel, "isVueViewModel"); -const WINDOW$8 = GLOBAL_OBJ; -const DEFAULT_MAX_STRING_LENGTH = 80; -function htmlTreeAsString(elem, options4 = {}) { - if (!elem) { - return ""; - } - try { - let currentElem = elem; - const MAX_TRAVERSE_HEIGHT = 5; - const out = []; - let height = 0; - let len = 0; - const separator = " > "; - const sepLength = separator.length; - let nextStr; - const keyAttrs = Array.isArray(options4) ? options4 : options4.keyAttrs; - const maxStringLength = !Array.isArray(options4) && options4.maxStringLength || DEFAULT_MAX_STRING_LENGTH; - while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { - nextStr = _htmlElementAsString(currentElem, keyAttrs); - if (nextStr === "html" || height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength) { - break; - } - out.push(nextStr); - len += nextStr.length; - currentElem = currentElem.parentNode; - } - return out.reverse().join(separator); - } catch (_oO) { - return ""; - } -} -__name(htmlTreeAsString, "htmlTreeAsString"); -function _htmlElementAsString(el, keyAttrs) { - const elem = el; - const out = []; - if (!elem || !elem.tagName) { - return ""; - } - if (WINDOW$8.HTMLElement) { - if (elem instanceof HTMLElement && elem.dataset) { - if (elem.dataset["sentryComponent"]) { - return elem.dataset["sentryComponent"]; - } - if (elem.dataset["sentryElement"]) { - return elem.dataset["sentryElement"]; - } - } - } - out.push(elem.tagName.toLowerCase()); - const keyAttrPairs = keyAttrs && keyAttrs.length ? keyAttrs.filter((keyAttr) => elem.getAttribute(keyAttr)).map((keyAttr) => [keyAttr, elem.getAttribute(keyAttr)]) : null; - if (keyAttrPairs && keyAttrPairs.length) { - keyAttrPairs.forEach((keyAttrPair) => { - out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`); - }); - } else { - if (elem.id) { - out.push(`#${elem.id}`); - } - const className = elem.className; - if (className && isString$a(className)) { - const classes2 = className.split(/\s+/); - for (const c2 of classes2) { - out.push(`.${c2}`); - } - } - } - const allowedAttrs = ["aria-label", "type", "name", "title", "alt"]; - for (const k2 of allowedAttrs) { - const attr = elem.getAttribute(k2); - if (attr) { - out.push(`[${k2}="${attr}"]`); - } - } - return out.join(""); -} -__name(_htmlElementAsString, "_htmlElementAsString"); -function getLocationHref() { - try { - return WINDOW$8.document.location.href; - } catch (oO) { - return ""; - } -} -__name(getLocationHref, "getLocationHref"); -function getDomElement(selector) { - if (WINDOW$8.document && WINDOW$8.document.querySelector) { - return WINDOW$8.document.querySelector(selector); - } - return null; -} -__name(getDomElement, "getDomElement"); -function getComponentName$1(elem) { - if (!WINDOW$8.HTMLElement) { - return null; - } - let currentElem = elem; - const MAX_TRAVERSE_HEIGHT = 5; - for (let i2 = 0; i2 < MAX_TRAVERSE_HEIGHT; i2++) { - if (!currentElem) { - return null; - } - if (currentElem instanceof HTMLElement) { - if (currentElem.dataset["sentryComponent"]) { - return currentElem.dataset["sentryComponent"]; - } - if (currentElem.dataset["sentryElement"]) { - return currentElem.dataset["sentryElement"]; - } - } - currentElem = currentElem.parentNode; - } - return null; -} -__name(getComponentName$1, "getComponentName$1"); -function truncate(str, max = 0) { - if (typeof str !== "string" || max === 0) { - return str; - } - return str.length <= max ? str : `${str.slice(0, max)}...`; -} -__name(truncate, "truncate"); -function snipLine(line, colno) { - let newLine = line; - const lineLength = newLine.length; - if (lineLength <= 150) { - return newLine; - } - if (colno > lineLength) { - colno = lineLength; - } - let start2 = Math.max(colno - 60, 0); - if (start2 < 5) { - start2 = 0; - } - let end = Math.min(start2 + 140, lineLength); - if (end > lineLength - 5) { - end = lineLength; - } - if (end === lineLength) { - start2 = Math.max(end - 140, 0); - } - newLine = newLine.slice(start2, end); - if (start2 > 0) { - newLine = `'{snip} ${newLine}`; - } - if (end < lineLength) { - newLine += " {snip}"; - } - return newLine; -} -__name(snipLine, "snipLine"); -function safeJoin(input, delimiter2) { - if (!Array.isArray(input)) { - return ""; - } - const output = []; - for (let i2 = 0; i2 < input.length; i2++) { - const value4 = input[i2]; - try { - if (isVueViewModel(value4)) { - output.push("[VueViewModel]"); - } else { - output.push(String(value4)); - } - } catch (e2) { - output.push("[value cannot be serialized]"); - } - } - return output.join(delimiter2); -} -__name(safeJoin, "safeJoin"); -function isMatchingPattern(value4, pattern, requireExactStringMatch = false) { - if (!isString$a(value4)) { - return false; - } - if (isRegExp$6(pattern)) { - return pattern.test(value4); - } - if (isString$a(pattern)) { - return requireExactStringMatch ? value4 === pattern : value4.includes(pattern); - } - return false; -} -__name(isMatchingPattern, "isMatchingPattern"); -function stringMatchesSomePattern(testString, patterns = [], requireExactStringMatch = false) { - return patterns.some((pattern) => isMatchingPattern(testString, pattern, requireExactStringMatch)); -} -__name(stringMatchesSomePattern, "stringMatchesSomePattern"); -function fill(source, name2, replacementFactory) { - if (!(name2 in source)) { - return; - } - const original = source[name2]; - const wrapped = replacementFactory(original); - if (typeof wrapped === "function") { - markFunctionWrapped(wrapped, original); - } - try { - source[name2] = wrapped; - } catch (e2) { - DEBUG_BUILD$5 && logger$2.log(`Failed to replace method "${name2}" in object`, source); - } -} -__name(fill, "fill"); -function addNonEnumerableProperty(obj, name2, value4) { - try { - Object.defineProperty(obj, name2, { - // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it - value: value4, - writable: true, - configurable: true - }); - } catch (o_O) { - DEBUG_BUILD$5 && logger$2.log(`Failed to add non-enumerable property "${name2}" to object`, obj); - } -} -__name(addNonEnumerableProperty, "addNonEnumerableProperty"); -function markFunctionWrapped(wrapped, original) { - try { - const proto = original.prototype || {}; - wrapped.prototype = original.prototype = proto; - addNonEnumerableProperty(wrapped, "__sentry_original__", original); - } catch (o_O) { - } -} -__name(markFunctionWrapped, "markFunctionWrapped"); -function getOriginalFunction(func) { - return func.__sentry_original__; -} -__name(getOriginalFunction, "getOriginalFunction"); -function urlEncode(object) { - return Object.entries(object).map(([key, value4]) => `${encodeURIComponent(key)}=${encodeURIComponent(value4)}`).join("&"); -} -__name(urlEncode, "urlEncode"); -function convertToPlainObject(value4) { - if (isError(value4)) { - return { - message: value4.message, - name: value4.name, - stack: value4.stack, - ...getOwnProperties(value4) - }; - } else if (isEvent(value4)) { - const newObj = { - type: value4.type, - target: serializeEventTarget(value4.target), - currentTarget: serializeEventTarget(value4.currentTarget), - ...getOwnProperties(value4) - }; - if (typeof CustomEvent !== "undefined" && isInstanceOf(value4, CustomEvent)) { - newObj.detail = value4.detail; - } - return newObj; - } else { - return value4; - } -} -__name(convertToPlainObject, "convertToPlainObject"); -function serializeEventTarget(target2) { - try { - return isElement$3(target2) ? htmlTreeAsString(target2) : Object.prototype.toString.call(target2); - } catch (_oO) { - return ""; - } -} -__name(serializeEventTarget, "serializeEventTarget"); -function getOwnProperties(obj) { - if (typeof obj === "object" && obj !== null) { - const extractedProps = {}; - for (const property in obj) { - if (Object.prototype.hasOwnProperty.call(obj, property)) { - extractedProps[property] = obj[property]; - } - } - return extractedProps; - } else { - return {}; - } -} -__name(getOwnProperties, "getOwnProperties"); -function extractExceptionKeysForMessage(exception, maxLength = 40) { - const keys2 = Object.keys(convertToPlainObject(exception)); - keys2.sort(); - const firstKey = keys2[0]; - if (!firstKey) { - return "[object has no keys]"; - } - if (firstKey.length >= maxLength) { - return truncate(firstKey, maxLength); - } - for (let includedKeys = keys2.length; includedKeys > 0; includedKeys--) { - const serialized = keys2.slice(0, includedKeys).join(", "); - if (serialized.length > maxLength) { - continue; - } - if (includedKeys === keys2.length) { - return serialized; - } - return truncate(serialized, maxLength); - } - return ""; -} -__name(extractExceptionKeysForMessage, "extractExceptionKeysForMessage"); -function dropUndefinedKeys(inputValue) { - const memoizationMap = /* @__PURE__ */ new Map(); - return _dropUndefinedKeys(inputValue, memoizationMap); -} -__name(dropUndefinedKeys, "dropUndefinedKeys"); -function _dropUndefinedKeys(inputValue, memoizationMap) { - if (isPojo(inputValue)) { - const memoVal = memoizationMap.get(inputValue); - if (memoVal !== void 0) { - return memoVal; - } - const returnValue = {}; - memoizationMap.set(inputValue, returnValue); - for (const key of Object.getOwnPropertyNames(inputValue)) { - if (typeof inputValue[key] !== "undefined") { - returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); - } - } - return returnValue; - } - if (Array.isArray(inputValue)) { - const memoVal = memoizationMap.get(inputValue); - if (memoVal !== void 0) { - return memoVal; - } - const returnValue = []; - memoizationMap.set(inputValue, returnValue); - inputValue.forEach((item3) => { - returnValue.push(_dropUndefinedKeys(item3, memoizationMap)); - }); - return returnValue; - } - return inputValue; -} -__name(_dropUndefinedKeys, "_dropUndefinedKeys"); -function isPojo(input) { - if (!isPlainObject$5(input)) { - return false; - } - try { - const name2 = Object.getPrototypeOf(input).constructor.name; - return !name2 || name2 === "Object"; - } catch (e2) { - return true; - } -} -__name(isPojo, "isPojo"); -function objectify(wat) { - let objectified; - switch (true) { - case wat == void 0: - objectified = new String(wat); - break; - case (typeof wat === "symbol" || typeof wat === "bigint"): - objectified = Object(wat); - break; - case isPrimitive(wat): - objectified = new wat.constructor(wat); - break; - default: - objectified = wat; - break; - } - return objectified; -} -__name(objectify, "objectify"); -const ONE_SECOND_IN_MS = 1e3; -function dateTimestampInSeconds() { - return Date.now() / ONE_SECOND_IN_MS; -} -__name(dateTimestampInSeconds, "dateTimestampInSeconds"); -function createUnixTimestampInSecondsFunc() { - const { performance: performance2 } = GLOBAL_OBJ; - if (!performance2 || !performance2.now) { - return dateTimestampInSeconds; - } - const approxStartingTimeOrigin = Date.now() - performance2.now(); - const timeOrigin = performance2.timeOrigin == void 0 ? approxStartingTimeOrigin : performance2.timeOrigin; - return () => { - return (timeOrigin + performance2.now()) / ONE_SECOND_IN_MS; - }; -} -__name(createUnixTimestampInSecondsFunc, "createUnixTimestampInSecondsFunc"); -const timestampInSeconds = createUnixTimestampInSecondsFunc(); -let _browserPerformanceTimeOriginMode; -const browserPerformanceTimeOrigin = (() => { - const { performance: performance2 } = GLOBAL_OBJ; - if (!performance2 || !performance2.now) { - _browserPerformanceTimeOriginMode = "none"; - return void 0; - } - const threshold = 3600 * 1e3; - const performanceNow = performance2.now(); - const dateNow = Date.now(); - const timeOriginDelta = performance2.timeOrigin ? Math.abs(performance2.timeOrigin + performanceNow - dateNow) : threshold; - const timeOriginIsReliable = timeOriginDelta < threshold; - const navigationStart = performance2.timing && performance2.timing.navigationStart; - const hasNavigationStart = typeof navigationStart === "number"; - const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; - const navigationStartIsReliable = navigationStartDelta < threshold; - if (timeOriginIsReliable || navigationStartIsReliable) { - if (timeOriginDelta <= navigationStartDelta) { - _browserPerformanceTimeOriginMode = "timeOrigin"; - return performance2.timeOrigin; - } else { - _browserPerformanceTimeOriginMode = "navigationStart"; - return navigationStart; - } - } - _browserPerformanceTimeOriginMode = "dateNow"; - return dateNow; -})(); -function uuid4() { - const gbl = GLOBAL_OBJ; - const crypto = gbl.crypto || gbl.msCrypto; - let getRandomByte = /* @__PURE__ */ __name(() => Math.random() * 16, "getRandomByte"); - try { - if (crypto && crypto.randomUUID) { - return crypto.randomUUID().replace(/-/g, ""); - } - if (crypto && crypto.getRandomValues) { - getRandomByte = /* @__PURE__ */ __name(() => { - const typedArray = new Uint8Array(1); - crypto.getRandomValues(typedArray); - return typedArray[0]; - }, "getRandomByte"); - } - } catch (_2) { - } - return ("10000000100040008000" + 1e11).replace( - /[018]/g, - (c2) => ( - // eslint-disable-next-line no-bitwise - (c2 ^ (getRandomByte() & 15) >> c2 / 4).toString(16) - ) - ); -} -__name(uuid4, "uuid4"); -function getFirstException(event) { - return event.exception && event.exception.values ? event.exception.values[0] : void 0; -} -__name(getFirstException, "getFirstException"); -function getEventDescription(event) { - const { message: message3, event_id: eventId } = event; - if (message3) { - return message3; - } - const firstException = getFirstException(event); - if (firstException) { - if (firstException.type && firstException.value) { - return `${firstException.type}: ${firstException.value}`; - } - return firstException.type || firstException.value || eventId || ""; - } - return eventId || ""; -} -__name(getEventDescription, "getEventDescription"); -function addExceptionTypeValue(event, value4, type) { - const exception = event.exception = event.exception || {}; - const values = exception.values = exception.values || []; - const firstException = values[0] = values[0] || {}; - if (!firstException.value) { - firstException.value = value4 || ""; - } - if (!firstException.type) { - firstException.type = type || "Error"; - } -} -__name(addExceptionTypeValue, "addExceptionTypeValue"); -function addExceptionMechanism(event, newMechanism) { - const firstException = getFirstException(event); - if (!firstException) { - return; - } - const defaultMechanism = { type: "generic", handled: true }; - const currentMechanism = firstException.mechanism; - firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism }; - if (newMechanism && "data" in newMechanism) { - const mergedData = { ...currentMechanism && currentMechanism.data, ...newMechanism.data }; - firstException.mechanism.data = mergedData; - } -} -__name(addExceptionMechanism, "addExceptionMechanism"); -const SEMVER_REGEXP = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; -function _parseInt(input) { - return parseInt(input || "", 10); -} -__name(_parseInt, "_parseInt"); -function parseSemver(input) { - const match3 = input.match(SEMVER_REGEXP) || []; - const major = _parseInt(match3[1]); - const minor = _parseInt(match3[2]); - const patch2 = _parseInt(match3[3]); - return { - buildmetadata: match3[5], - major: isNaN(major) ? void 0 : major, - minor: isNaN(minor) ? void 0 : minor, - patch: isNaN(patch2) ? void 0 : patch2, - prerelease: match3[4] - }; -} -__name(parseSemver, "parseSemver"); -function addContextToFrame(lines, frame, linesOfContext = 5) { - if (frame.lineno === void 0) { - return; - } - const maxLines = lines.length; - const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0); - frame.pre_context = lines.slice(Math.max(0, sourceLine - linesOfContext), sourceLine).map((line) => snipLine(line, 0)); - const lineIndex = Math.min(maxLines - 1, sourceLine); - frame.context_line = snipLine(lines[lineIndex], frame.colno || 0); - frame.post_context = lines.slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext).map((line) => snipLine(line, 0)); -} -__name(addContextToFrame, "addContextToFrame"); -function checkOrSetAlreadyCaught(exception) { - if (isAlreadyCaptured(exception)) { - return true; - } - try { - addNonEnumerableProperty(exception, "__sentry_captured__", true); - } catch (err) { - } - return false; -} -__name(checkOrSetAlreadyCaught, "checkOrSetAlreadyCaught"); -function isAlreadyCaptured(exception) { - try { - return exception.__sentry_captured__; - } catch (e2) { - } -} -__name(isAlreadyCaptured, "isAlreadyCaptured"); -function arrayify(maybeArray) { - return Array.isArray(maybeArray) ? maybeArray : [maybeArray]; -} -__name(arrayify, "arrayify"); -var States; -(function(States2) { - const PENDING = 0; - States2[States2["PENDING"] = PENDING] = "PENDING"; - const RESOLVED = 1; - States2[States2["RESOLVED"] = RESOLVED] = "RESOLVED"; - const REJECTED = 2; - States2[States2["REJECTED"] = REJECTED] = "REJECTED"; -})(States || (States = {})); -function resolvedSyncPromise(value4) { - return new SyncPromise((resolve2) => { - resolve2(value4); - }); -} -__name(resolvedSyncPromise, "resolvedSyncPromise"); -function rejectedSyncPromise(reason) { - return new SyncPromise((_2, reject3) => { - reject3(reason); - }); -} -__name(rejectedSyncPromise, "rejectedSyncPromise"); -class SyncPromise { - static { - __name(this, "SyncPromise"); - } - constructor(executor) { - SyncPromise.prototype.__init.call(this); - SyncPromise.prototype.__init2.call(this); - SyncPromise.prototype.__init3.call(this); - SyncPromise.prototype.__init4.call(this); - this._state = States.PENDING; - this._handlers = []; - try { - executor(this._resolve, this._reject); - } catch (e2) { - this._reject(e2); - } - } - /** JSDoc */ - then(onfulfilled, onrejected) { - return new SyncPromise((resolve2, reject3) => { - this._handlers.push([ - false, - (result) => { - if (!onfulfilled) { - resolve2(result); - } else { - try { - resolve2(onfulfilled(result)); - } catch (e2) { - reject3(e2); - } - } - }, - (reason) => { - if (!onrejected) { - reject3(reason); - } else { - try { - resolve2(onrejected(reason)); - } catch (e2) { - reject3(e2); - } - } - } - ]); - this._executeHandlers(); - }); - } - /** JSDoc */ - catch(onrejected) { - return this.then((val) => val, onrejected); - } - /** JSDoc */ - finally(onfinally) { - return new SyncPromise((resolve2, reject3) => { - let val; - let isRejected; - return this.then( - (value4) => { - isRejected = false; - val = value4; - if (onfinally) { - onfinally(); - } - }, - (reason) => { - isRejected = true; - val = reason; - if (onfinally) { - onfinally(); - } - } - ).then(() => { - if (isRejected) { - reject3(val); - return; - } - resolve2(val); - }); - }); - } - /** JSDoc */ - __init() { - this._resolve = (value4) => { - this._setResult(States.RESOLVED, value4); - }; - } - /** JSDoc */ - __init2() { - this._reject = (reason) => { - this._setResult(States.REJECTED, reason); - }; - } - /** JSDoc */ - __init3() { - this._setResult = (state, value4) => { - if (this._state !== States.PENDING) { - return; - } - if (isThenable$1(value4)) { - void value4.then(this._resolve, this._reject); - return; - } - this._state = state; - this._value = value4; - this._executeHandlers(); - }; - } - /** JSDoc */ - __init4() { - this._executeHandlers = () => { - if (this._state === States.PENDING) { - return; - } - const cachedHandlers = this._handlers.slice(); - this._handlers = []; - cachedHandlers.forEach((handler10) => { - if (handler10[0]) { - return; - } - if (this._state === States.RESOLVED) { - handler10[1](this._value); - } - if (this._state === States.REJECTED) { - handler10[2](this._value); - } - handler10[0] = true; - }); - }; - } -} -function makeSession$1(context) { - const startingTime = timestampInSeconds(); - const session = { - sid: uuid4(), - init: true, - timestamp: startingTime, - started: startingTime, - duration: 0, - status: "ok", - errors: 0, - ignoreDuration: false, - toJSON: /* @__PURE__ */ __name(() => sessionToJSON(session), "toJSON") - }; - if (context) { - updateSession(session, context); - } - return session; -} -__name(makeSession$1, "makeSession$1"); -function updateSession(session, context = {}) { - if (context.user) { - if (!session.ipAddress && context.user.ip_address) { - session.ipAddress = context.user.ip_address; - } - if (!session.did && !context.did) { - session.did = context.user.id || context.user.email || context.user.username; - } - } - session.timestamp = context.timestamp || timestampInSeconds(); - if (context.abnormal_mechanism) { - session.abnormal_mechanism = context.abnormal_mechanism; - } - if (context.ignoreDuration) { - session.ignoreDuration = context.ignoreDuration; - } - if (context.sid) { - session.sid = context.sid.length === 32 ? context.sid : uuid4(); - } - if (context.init !== void 0) { - session.init = context.init; - } - if (!session.did && context.did) { - session.did = `${context.did}`; - } - if (typeof context.started === "number") { - session.started = context.started; - } - if (session.ignoreDuration) { - session.duration = void 0; - } else if (typeof context.duration === "number") { - session.duration = context.duration; - } else { - const duration = session.timestamp - session.started; - session.duration = duration >= 0 ? duration : 0; - } - if (context.release) { - session.release = context.release; - } - if (context.environment) { - session.environment = context.environment; - } - if (!session.ipAddress && context.ipAddress) { - session.ipAddress = context.ipAddress; - } - if (!session.userAgent && context.userAgent) { - session.userAgent = context.userAgent; - } - if (typeof context.errors === "number") { - session.errors = context.errors; - } - if (context.status) { - session.status = context.status; - } -} -__name(updateSession, "updateSession"); -function closeSession(session, status) { - let context = {}; - if (status) { - context = { status }; - } else if (session.status === "ok") { - context = { status: "exited" }; - } - updateSession(session, context); -} -__name(closeSession, "closeSession"); -function sessionToJSON(session) { - return dropUndefinedKeys({ - sid: `${session.sid}`, - init: session.init, - // Make sure that sec is converted to ms for date constructor - started: new Date(session.started * 1e3).toISOString(), - timestamp: new Date(session.timestamp * 1e3).toISOString(), - status: session.status, - errors: session.errors, - did: typeof session.did === "number" || typeof session.did === "string" ? `${session.did}` : void 0, - duration: session.duration, - abnormal_mechanism: session.abnormal_mechanism, - attrs: { - release: session.release, - environment: session.environment, - ip_address: session.ipAddress, - user_agent: session.userAgent - } - }); -} -__name(sessionToJSON, "sessionToJSON"); -function generatePropagationContext() { - return { - traceId: generateTraceId(), - spanId: generateSpanId() - }; -} -__name(generatePropagationContext, "generatePropagationContext"); -function generateTraceId() { - return uuid4(); -} -__name(generateTraceId, "generateTraceId"); -function generateSpanId() { - return uuid4().substring(16); -} -__name(generateSpanId, "generateSpanId"); -function merge$1(initialObj, mergeObj, levels = 2) { - if (!mergeObj || typeof mergeObj !== "object" || levels <= 0) { - return mergeObj; - } - if (initialObj && mergeObj && Object.keys(mergeObj).length === 0) { - return initialObj; - } - const output = { ...initialObj }; - for (const key in mergeObj) { - if (Object.prototype.hasOwnProperty.call(mergeObj, key)) { - output[key] = merge$1(output[key], mergeObj[key], levels - 1); - } - } - return output; -} -__name(merge$1, "merge$1"); -const SCOPE_SPAN_FIELD = "_sentrySpan"; -function _setSpanForScope(scope, span) { - if (span) { - addNonEnumerableProperty(scope, SCOPE_SPAN_FIELD, span); - } else { - delete scope[SCOPE_SPAN_FIELD]; - } -} -__name(_setSpanForScope, "_setSpanForScope"); -function _getSpanForScope(scope) { - return scope[SCOPE_SPAN_FIELD]; -} -__name(_getSpanForScope, "_getSpanForScope"); -const DEFAULT_MAX_BREADCRUMBS = 100; -class ScopeClass { - static { - __name(this, "ScopeClass"); - } - /** Flag if notifying is happening. */ - /** Callback for client to receive scope changes. */ - /** Callback list that will be called during event processing. */ - /** Array of breadcrumbs. */ - /** User */ - /** Tags */ - /** Extra */ - /** Contexts */ - /** Attachments */ - /** Propagation Context for distributed tracing */ - /** - * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get - * sent to Sentry - */ - /** Fingerprint */ - /** Severity */ - /** - * Transaction Name - * - * IMPORTANT: The transaction name on the scope has nothing to do with root spans/transaction objects. - * It's purpose is to assign a transaction to the scope that's added to non-transaction events. - */ - /** Session */ - /** Request Mode Session Status */ - // eslint-disable-next-line deprecation/deprecation - /** The client on this scope */ - /** Contains the last event id of a captured event. */ - // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method. - constructor() { - this._notifyingListeners = false; - this._scopeListeners = []; - this._eventProcessors = []; - this._breadcrumbs = []; - this._attachments = []; - this._user = {}; - this._tags = {}; - this._extra = {}; - this._contexts = {}; - this._sdkProcessingMetadata = {}; - this._propagationContext = { - traceId: generateTraceId(), - spanId: generateSpanId() - }; - } - /** - * @inheritDoc - */ - clone() { - const newScope = new ScopeClass(); - newScope._breadcrumbs = [...this._breadcrumbs]; - newScope._tags = { ...this._tags }; - newScope._extra = { ...this._extra }; - newScope._contexts = { ...this._contexts }; - if (this._contexts.flags) { - newScope._contexts.flags = { - values: [...this._contexts.flags.values] - }; - } - newScope._user = this._user; - newScope._level = this._level; - newScope._session = this._session; - newScope._transactionName = this._transactionName; - newScope._fingerprint = this._fingerprint; - newScope._eventProcessors = [...this._eventProcessors]; - newScope._requestSession = this._requestSession; - newScope._attachments = [...this._attachments]; - newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }; - newScope._propagationContext = { ...this._propagationContext }; - newScope._client = this._client; - newScope._lastEventId = this._lastEventId; - _setSpanForScope(newScope, _getSpanForScope(this)); - return newScope; - } - /** - * @inheritDoc - */ - setClient(client) { - this._client = client; - } - /** - * @inheritDoc - */ - setLastEventId(lastEventId2) { - this._lastEventId = lastEventId2; - } - /** - * @inheritDoc - */ - getClient() { - return this._client; - } - /** - * @inheritDoc - */ - lastEventId() { - return this._lastEventId; - } - /** - * @inheritDoc - */ - addScopeListener(callback) { - this._scopeListeners.push(callback); - } - /** - * @inheritDoc - */ - addEventProcessor(callback) { - this._eventProcessors.push(callback); - return this; - } - /** - * @inheritDoc - */ - setUser(user) { - this._user = user || { - email: void 0, - id: void 0, - ip_address: void 0, - username: void 0 - }; - if (this._session) { - updateSession(this._session, { user }); - } - this._notifyScopeListeners(); - return this; - } - /** - * @inheritDoc - */ - getUser() { - return this._user; - } - /** - * @inheritDoc - */ - // eslint-disable-next-line deprecation/deprecation - getRequestSession() { - return this._requestSession; - } - /** - * @inheritDoc - */ - // eslint-disable-next-line deprecation/deprecation - setRequestSession(requestSession) { - this._requestSession = requestSession; - return this; - } - /** - * @inheritDoc - */ - setTags(tags) { - this._tags = { - ...this._tags, - ...tags - }; - this._notifyScopeListeners(); - return this; - } - /** - * @inheritDoc - */ - setTag(key, value4) { - this._tags = { ...this._tags, [key]: value4 }; - this._notifyScopeListeners(); - return this; - } - /** - * @inheritDoc - */ - setExtras(extras) { - this._extra = { - ...this._extra, - ...extras - }; - this._notifyScopeListeners(); - return this; - } - /** - * @inheritDoc - */ - setExtra(key, extra) { - this._extra = { ...this._extra, [key]: extra }; - this._notifyScopeListeners(); - return this; - } - /** - * @inheritDoc - */ - setFingerprint(fingerprint) { - this._fingerprint = fingerprint; - this._notifyScopeListeners(); - return this; - } - /** - * @inheritDoc - */ - setLevel(level) { - this._level = level; - this._notifyScopeListeners(); - return this; - } - /** - * Sets the transaction name on the scope so that the name of e.g. taken server route or - * the page location is attached to future events. - * - * IMPORTANT: Calling this function does NOT change the name of the currently active - * root span. If you want to change the name of the active root span, use - * `Sentry.updateSpanName(rootSpan, 'new name')` instead. - * - * By default, the SDK updates the scope's transaction name automatically on sensible - * occasions, such as a page navigation or when handling a new request on the server. - */ - setTransactionName(name2) { - this._transactionName = name2; - this._notifyScopeListeners(); - return this; - } - /** - * @inheritDoc - */ - setContext(key, context) { - if (context === null) { - delete this._contexts[key]; - } else { - this._contexts[key] = context; - } - this._notifyScopeListeners(); - return this; - } - /** - * @inheritDoc - */ - setSession(session) { - if (!session) { - delete this._session; - } else { - this._session = session; - } - this._notifyScopeListeners(); - return this; - } - /** - * @inheritDoc - */ - getSession() { - return this._session; - } - /** - * @inheritDoc - */ - update(captureContext) { - if (!captureContext) { - return this; - } - const scopeToMerge = typeof captureContext === "function" ? captureContext(this) : captureContext; - const [scopeInstance, requestSession] = scopeToMerge instanceof Scope ? ( - // eslint-disable-next-line deprecation/deprecation - [scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()] - ) : isPlainObject$5(scopeToMerge) ? [captureContext, captureContext.requestSession] : []; - const { tags, extra, user, contexts, level, fingerprint = [], propagationContext } = scopeInstance || {}; - this._tags = { ...this._tags, ...tags }; - this._extra = { ...this._extra, ...extra }; - this._contexts = { ...this._contexts, ...contexts }; - if (user && Object.keys(user).length) { - this._user = user; - } - if (level) { - this._level = level; - } - if (fingerprint.length) { - this._fingerprint = fingerprint; - } - if (propagationContext) { - this._propagationContext = propagationContext; - } - if (requestSession) { - this._requestSession = requestSession; - } - return this; - } - /** - * @inheritDoc - */ - clear() { - this._breadcrumbs = []; - this._tags = {}; - this._extra = {}; - this._user = {}; - this._contexts = {}; - this._level = void 0; - this._transactionName = void 0; - this._fingerprint = void 0; - this._requestSession = void 0; - this._session = void 0; - _setSpanForScope(this, void 0); - this._attachments = []; - this.setPropagationContext({ traceId: generateTraceId() }); - this._notifyScopeListeners(); - return this; - } - /** - * @inheritDoc - */ - addBreadcrumb(breadcrumb, maxBreadcrumbs) { - const maxCrumbs = typeof maxBreadcrumbs === "number" ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS; - if (maxCrumbs <= 0) { - return this; - } - const mergedBreadcrumb = { - timestamp: dateTimestampInSeconds(), - ...breadcrumb - }; - this._breadcrumbs.push(mergedBreadcrumb); - if (this._breadcrumbs.length > maxCrumbs) { - this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs); - if (this._client) { - this._client.recordDroppedEvent("buffer_overflow", "log_item"); - } - } - this._notifyScopeListeners(); - return this; - } - /** - * @inheritDoc - */ - getLastBreadcrumb() { - return this._breadcrumbs[this._breadcrumbs.length - 1]; - } - /** - * @inheritDoc - */ - clearBreadcrumbs() { - this._breadcrumbs = []; - this._notifyScopeListeners(); - return this; - } - /** - * @inheritDoc - */ - addAttachment(attachment) { - this._attachments.push(attachment); - return this; - } - /** - * @inheritDoc - */ - clearAttachments() { - this._attachments = []; - return this; - } - /** @inheritDoc */ - getScopeData() { - return { - breadcrumbs: this._breadcrumbs, - attachments: this._attachments, - contexts: this._contexts, - tags: this._tags, - extra: this._extra, - user: this._user, - level: this._level, - fingerprint: this._fingerprint || [], - eventProcessors: this._eventProcessors, - propagationContext: this._propagationContext, - sdkProcessingMetadata: this._sdkProcessingMetadata, - transactionName: this._transactionName, - span: _getSpanForScope(this) - }; - } - /** - * @inheritDoc - */ - setSDKProcessingMetadata(newData) { - this._sdkProcessingMetadata = merge$1(this._sdkProcessingMetadata, newData, 2); - return this; - } - /** - * @inheritDoc - */ - setPropagationContext(context) { - this._propagationContext = { - // eslint-disable-next-line deprecation/deprecation - spanId: generateSpanId(), - ...context - }; - return this; - } - /** - * @inheritDoc - */ - getPropagationContext() { - return this._propagationContext; - } - /** - * @inheritDoc - */ - captureException(exception, hint) { - const eventId = hint && hint.event_id ? hint.event_id : uuid4(); - if (!this._client) { - logger$2.warn("No client configured on scope - will not capture exception!"); - return eventId; - } - const syntheticException = new Error("Sentry syntheticException"); - this._client.captureException( - exception, - { - originalException: exception, - syntheticException, - ...hint, - event_id: eventId - }, - this - ); - return eventId; - } - /** - * @inheritDoc - */ - captureMessage(message3, level, hint) { - const eventId = hint && hint.event_id ? hint.event_id : uuid4(); - if (!this._client) { - logger$2.warn("No client configured on scope - will not capture message!"); - return eventId; - } - const syntheticException = new Error(message3); - this._client.captureMessage( - message3, - level, - { - originalException: message3, - syntheticException, - ...hint, - event_id: eventId - }, - this - ); - return eventId; - } - /** - * @inheritDoc - */ - captureEvent(event, hint) { - const eventId = hint && hint.event_id ? hint.event_id : uuid4(); - if (!this._client) { - logger$2.warn("No client configured on scope - will not capture event!"); - return eventId; - } - this._client.captureEvent(event, { ...hint, event_id: eventId }, this); - return eventId; - } - /** - * This will be called on every set call. - */ - _notifyScopeListeners() { - if (!this._notifyingListeners) { - this._notifyingListeners = true; - this._scopeListeners.forEach((callback) => { - callback(this); - }); - this._notifyingListeners = false; - } - } -} -const Scope = ScopeClass; -function getDefaultCurrentScope() { - return getGlobalSingleton("defaultCurrentScope", () => new Scope()); -} -__name(getDefaultCurrentScope, "getDefaultCurrentScope"); -function getDefaultIsolationScope() { - return getGlobalSingleton("defaultIsolationScope", () => new Scope()); -} -__name(getDefaultIsolationScope, "getDefaultIsolationScope"); -class AsyncContextStack { - static { - __name(this, "AsyncContextStack"); - } - constructor(scope, isolationScope) { - let assignedScope; - if (!scope) { - assignedScope = new Scope(); - } else { - assignedScope = scope; - } - let assignedIsolationScope; - if (!isolationScope) { - assignedIsolationScope = new Scope(); - } else { - assignedIsolationScope = isolationScope; - } - this._stack = [{ scope: assignedScope }]; - this._isolationScope = assignedIsolationScope; - } - /** - * Fork a scope for the stack. - */ - withScope(callback) { - const scope = this._pushScope(); - let maybePromiseResult; - try { - maybePromiseResult = callback(scope); - } catch (e2) { - this._popScope(); - throw e2; - } - if (isThenable$1(maybePromiseResult)) { - return maybePromiseResult.then( - (res) => { - this._popScope(); - return res; - }, - (e2) => { - this._popScope(); - throw e2; - } - ); - } - this._popScope(); - return maybePromiseResult; - } - /** - * Get the client of the stack. - */ - getClient() { - return this.getStackTop().client; - } - /** - * Returns the scope of the top stack. - */ - getScope() { - return this.getStackTop().scope; - } - /** - * Get the isolation scope for the stack. - */ - getIsolationScope() { - return this._isolationScope; - } - /** - * Returns the topmost scope layer in the order domain > local > process. - */ - getStackTop() { - return this._stack[this._stack.length - 1]; - } - /** - * Push a scope to the stack. - */ - _pushScope() { - const scope = this.getScope().clone(); - this._stack.push({ - client: this.getClient(), - scope - }); - return scope; - } - /** - * Pop a scope from the stack. - */ - _popScope() { - if (this._stack.length <= 1) return false; - return !!this._stack.pop(); - } -} -function getAsyncContextStack() { - const registry = getMainCarrier(); - const sentry = getSentryCarrier(registry); - return sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope()); -} -__name(getAsyncContextStack, "getAsyncContextStack"); -function withScope$1(callback) { - return getAsyncContextStack().withScope(callback); -} -__name(withScope$1, "withScope$1"); -function withSetScope(scope, callback) { - const stack2 = getAsyncContextStack(); - return stack2.withScope(() => { - stack2.getStackTop().scope = scope; - return callback(scope); - }); -} -__name(withSetScope, "withSetScope"); -function withIsolationScope$1(callback) { - return getAsyncContextStack().withScope(() => { - return callback(getAsyncContextStack().getIsolationScope()); - }); -} -__name(withIsolationScope$1, "withIsolationScope$1"); -function getStackAsyncContextStrategy() { - return { - withIsolationScope: withIsolationScope$1, - withScope: withScope$1, - withSetScope, - withSetIsolationScope: /* @__PURE__ */ __name((_isolationScope, callback) => { - return withIsolationScope$1(callback); - }, "withSetIsolationScope"), - getCurrentScope: /* @__PURE__ */ __name(() => getAsyncContextStack().getScope(), "getCurrentScope"), - getIsolationScope: /* @__PURE__ */ __name(() => getAsyncContextStack().getIsolationScope(), "getIsolationScope") - }; -} -__name(getStackAsyncContextStrategy, "getStackAsyncContextStrategy"); -function setAsyncContextStrategy(strategy) { - const registry = getMainCarrier(); - const sentry = getSentryCarrier(registry); - sentry.acs = strategy; -} -__name(setAsyncContextStrategy, "setAsyncContextStrategy"); -function getAsyncContextStrategy(carrier) { - const sentry = getSentryCarrier(carrier); - if (sentry.acs) { - return sentry.acs; - } - return getStackAsyncContextStrategy(); -} -__name(getAsyncContextStrategy, "getAsyncContextStrategy"); -function getCurrentScope$1() { - const carrier = getMainCarrier(); - const acs = getAsyncContextStrategy(carrier); - return acs.getCurrentScope(); -} -__name(getCurrentScope$1, "getCurrentScope$1"); -function getIsolationScope() { - const carrier = getMainCarrier(); - const acs = getAsyncContextStrategy(carrier); - return acs.getIsolationScope(); -} -__name(getIsolationScope, "getIsolationScope"); -function getGlobalScope() { - return getGlobalSingleton("globalScope", () => new Scope()); -} -__name(getGlobalScope, "getGlobalScope"); -function withScope(...rest) { - const carrier = getMainCarrier(); - const acs = getAsyncContextStrategy(carrier); - if (rest.length === 2) { - const [scope, callback] = rest; - if (!scope) { - return acs.withScope(callback); - } - return acs.withSetScope(scope, callback); - } - return acs.withScope(rest[0]); -} -__name(withScope, "withScope"); -function withIsolationScope(...rest) { - const carrier = getMainCarrier(); - const acs = getAsyncContextStrategy(carrier); - if (rest.length === 2) { - const [isolationScope, callback] = rest; - if (!isolationScope) { - return acs.withIsolationScope(callback); - } - return acs.withSetIsolationScope(isolationScope, callback); - } - return acs.withIsolationScope(rest[0]); -} -__name(withIsolationScope, "withIsolationScope"); -function getClient() { - return getCurrentScope$1().getClient(); -} -__name(getClient, "getClient"); -function getTraceContextFromScope(scope) { - const propagationContext = scope.getPropagationContext(); - const { traceId, spanId, parentSpanId } = propagationContext; - const traceContext = dropUndefinedKeys({ - trace_id: traceId, - span_id: spanId, - parent_span_id: parentSpanId - }); - return traceContext; -} -__name(getTraceContextFromScope, "getTraceContextFromScope"); -const METRICS_SPAN_FIELD = "_sentryMetrics"; -function getMetricSummaryJsonForSpan(span) { - const storage = span[METRICS_SPAN_FIELD]; - if (!storage) { - return void 0; - } - const output = {}; - for (const [, [exportKey, summary]] of storage) { - const arr = output[exportKey] || (output[exportKey] = []); - arr.push(dropUndefinedKeys(summary)); - } - return output; -} -__name(getMetricSummaryJsonForSpan, "getMetricSummaryJsonForSpan"); -function updateMetricSummaryOnSpan(span, metricType, sanitizedName, value4, unit, tags, bucketKey) { - const existingStorage = span[METRICS_SPAN_FIELD]; - const storage = existingStorage || (span[METRICS_SPAN_FIELD] = /* @__PURE__ */ new Map()); - const exportKey = `${metricType}:${sanitizedName}@${unit}`; - const bucketItem = storage.get(bucketKey); - if (bucketItem) { - const [, summary] = bucketItem; - storage.set(bucketKey, [ - exportKey, - { - min: Math.min(summary.min, value4), - max: Math.max(summary.max, value4), - count: summary.count += 1, - sum: summary.sum += value4, - tags: summary.tags - } - ]); - } else { - storage.set(bucketKey, [ - exportKey, - { - min: value4, - max: value4, - count: 1, - sum: value4, - tags - } - ]); - } -} -__name(updateMetricSummaryOnSpan, "updateMetricSummaryOnSpan"); -const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = "sentry.source"; -const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = "sentry.sample_rate"; -const SEMANTIC_ATTRIBUTE_SENTRY_OP = "sentry.op"; -const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = "sentry.origin"; -const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = "sentry.idle_span_finish_reason"; -const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = "sentry.measurement_unit"; -const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = "sentry.measurement_value"; -const SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = "sentry.custom_span_name"; -const SEMANTIC_ATTRIBUTE_PROFILE_ID = "sentry.profile_id"; -const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = "sentry.exclusive_time"; -const SEMANTIC_ATTRIBUTE_CACHE_HIT = "cache.hit"; -const SEMANTIC_ATTRIBUTE_CACHE_KEY = "cache.key"; -const SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = "cache.item_size"; -const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = "http.request.method"; -const SEMANTIC_ATTRIBUTE_URL_FULL = "url.full"; -const SPAN_STATUS_UNSET = 0; -const SPAN_STATUS_OK = 1; -const SPAN_STATUS_ERROR = 2; -function getSpanStatusFromHttpCode(httpStatus) { - if (httpStatus < 400 && httpStatus >= 100) { - return { code: SPAN_STATUS_OK }; - } - if (httpStatus >= 400 && httpStatus < 500) { - switch (httpStatus) { - case 401: - return { code: SPAN_STATUS_ERROR, message: "unauthenticated" }; - case 403: - return { code: SPAN_STATUS_ERROR, message: "permission_denied" }; - case 404: - return { code: SPAN_STATUS_ERROR, message: "not_found" }; - case 409: - return { code: SPAN_STATUS_ERROR, message: "already_exists" }; - case 413: - return { code: SPAN_STATUS_ERROR, message: "failed_precondition" }; - case 429: - return { code: SPAN_STATUS_ERROR, message: "resource_exhausted" }; - case 499: - return { code: SPAN_STATUS_ERROR, message: "cancelled" }; - default: - return { code: SPAN_STATUS_ERROR, message: "invalid_argument" }; - } - } - if (httpStatus >= 500 && httpStatus < 600) { - switch (httpStatus) { - case 501: - return { code: SPAN_STATUS_ERROR, message: "unimplemented" }; - case 503: - return { code: SPAN_STATUS_ERROR, message: "unavailable" }; - case 504: - return { code: SPAN_STATUS_ERROR, message: "deadline_exceeded" }; - default: - return { code: SPAN_STATUS_ERROR, message: "internal_error" }; - } - } - return { code: SPAN_STATUS_ERROR, message: "unknown_error" }; -} -__name(getSpanStatusFromHttpCode, "getSpanStatusFromHttpCode"); -function setHttpStatus(span, httpStatus) { - span.setAttribute("http.response.status_code", httpStatus); - const spanStatus = getSpanStatusFromHttpCode(httpStatus); - if (spanStatus.message !== "unknown_error") { - span.setStatus(spanStatus); - } -} -__name(setHttpStatus, "setHttpStatus"); -const BAGGAGE_HEADER_NAME = "baggage"; -const SENTRY_BAGGAGE_KEY_PREFIX = "sentry-"; -const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/; -const MAX_BAGGAGE_STRING_LENGTH = 8192; -function baggageHeaderToDynamicSamplingContext(baggageHeader) { - const baggageObject = parseBaggageHeader(baggageHeader); - if (!baggageObject) { - return void 0; - } - const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value4]) => { - if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) { - const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length); - acc[nonPrefixedKey] = value4; - } - return acc; - }, {}); - if (Object.keys(dynamicSamplingContext).length > 0) { - return dynamicSamplingContext; - } else { - return void 0; - } -} -__name(baggageHeaderToDynamicSamplingContext, "baggageHeaderToDynamicSamplingContext"); -function dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext) { - if (!dynamicSamplingContext) { - return void 0; - } - const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce( - (acc, [dscKey, dscValue]) => { - if (dscValue) { - acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue; - } - return acc; - }, - {} - ); - return objectToBaggageHeader(sentryPrefixedDSC); -} -__name(dynamicSamplingContextToSentryBaggageHeader, "dynamicSamplingContextToSentryBaggageHeader"); -function parseBaggageHeader(baggageHeader) { - if (!baggageHeader || !isString$a(baggageHeader) && !Array.isArray(baggageHeader)) { - return void 0; - } - if (Array.isArray(baggageHeader)) { - return baggageHeader.reduce((acc, curr) => { - const currBaggageObject = baggageHeaderToObject(curr); - Object.entries(currBaggageObject).forEach(([key, value4]) => { - acc[key] = value4; - }); - return acc; - }, {}); - } - return baggageHeaderToObject(baggageHeader); -} -__name(parseBaggageHeader, "parseBaggageHeader"); -function baggageHeaderToObject(baggageHeader) { - return baggageHeader.split(",").map((baggageEntry) => baggageEntry.split("=").map((keyOrValue) => decodeURIComponent(keyOrValue.trim()))).reduce((acc, [key, value4]) => { - if (key && value4) { - acc[key] = value4; - } - return acc; - }, {}); -} -__name(baggageHeaderToObject, "baggageHeaderToObject"); -function objectToBaggageHeader(object) { - if (Object.keys(object).length === 0) { - return void 0; - } - return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => { - const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`; - const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`; - if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) { - DEBUG_BUILD$5 && logger$2.warn( - `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.` - ); - return baggageHeader; - } else { - return newBaggageHeader; - } - }, ""); -} -__name(objectToBaggageHeader, "objectToBaggageHeader"); -const TRACEPARENT_REGEXP = new RegExp( - "^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$" - // whitespace -); -function extractTraceparentData(traceparent) { - if (!traceparent) { - return void 0; - } - const matches2 = traceparent.match(TRACEPARENT_REGEXP); - if (!matches2) { - return void 0; - } - let parentSampled; - if (matches2[3] === "1") { - parentSampled = true; - } else if (matches2[3] === "0") { - parentSampled = false; - } - return { - traceId: matches2[1], - parentSampled, - parentSpanId: matches2[2] - }; -} -__name(extractTraceparentData, "extractTraceparentData"); -function propagationContextFromHeaders(sentryTrace, baggage) { - const traceparentData = extractTraceparentData(sentryTrace); - const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage); - if (!traceparentData || !traceparentData.traceId) { - return { traceId: generateTraceId(), spanId: generateSpanId() }; - } - const { traceId, parentSpanId, parentSampled } = traceparentData; - const virtualSpanId = generateSpanId(); - return { - traceId, - parentSpanId, - spanId: virtualSpanId, - sampled: parentSampled, - dsc: dynamicSamplingContext || {} - // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it - }; -} -__name(propagationContextFromHeaders, "propagationContextFromHeaders"); -function generateSentryTraceHeader(traceId = generateTraceId(), spanId = generateSpanId(), sampled) { - let sampledString = ""; - if (sampled !== void 0) { - sampledString = sampled ? "-1" : "-0"; - } - return `${traceId}-${spanId}${sampledString}`; -} -__name(generateSentryTraceHeader, "generateSentryTraceHeader"); -const TRACE_FLAG_NONE = 0; -const TRACE_FLAG_SAMPLED = 1; -let hasShownSpanDropWarning = false; -function spanToTransactionTraceContext(span) { - const { spanId: span_id, traceId: trace_id } = span.spanContext(); - const { data: data26, op, parent_span_id, status, origin: origin2 } = spanToJSON(span); - return dropUndefinedKeys({ - parent_span_id, - span_id, - trace_id, - data: data26, - op, - status, - origin: origin2 - }); -} -__name(spanToTransactionTraceContext, "spanToTransactionTraceContext"); -function spanToTraceContext(span) { - const { spanId, traceId: trace_id, isRemote } = span.spanContext(); - const parent_span_id = isRemote ? spanId : spanToJSON(span).parent_span_id; - const span_id = isRemote ? generateSpanId() : spanId; - return dropUndefinedKeys({ - parent_span_id, - span_id, - trace_id - }); -} -__name(spanToTraceContext, "spanToTraceContext"); -function spanToTraceHeader(span) { - const { traceId, spanId } = span.spanContext(); - const sampled = spanIsSampled(span); - return generateSentryTraceHeader(traceId, spanId, sampled); -} -__name(spanToTraceHeader, "spanToTraceHeader"); -function spanTimeInputToSeconds(input) { - if (typeof input === "number") { - return ensureTimestampInSeconds(input); - } - if (Array.isArray(input)) { - return input[0] + input[1] / 1e9; - } - if (input instanceof Date) { - return ensureTimestampInSeconds(input.getTime()); - } - return timestampInSeconds(); -} -__name(spanTimeInputToSeconds, "spanTimeInputToSeconds"); -function ensureTimestampInSeconds(timestamp2) { - const isMs = timestamp2 > 9999999999; - return isMs ? timestamp2 / 1e3 : timestamp2; -} -__name(ensureTimestampInSeconds, "ensureTimestampInSeconds"); -function spanToJSON(span) { - if (spanIsSentrySpan(span)) { - return span.getSpanJSON(); - } - try { - const { spanId: span_id, traceId: trace_id } = span.spanContext(); - if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) { - const { attributes, startTime, name: name2, endTime, parentSpanId, status } = span; - return dropUndefinedKeys({ - span_id, - trace_id, - data: attributes, - description: name2, - parent_span_id: parentSpanId, - start_timestamp: spanTimeInputToSeconds(startTime), - // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time - timestamp: spanTimeInputToSeconds(endTime) || void 0, - status: getStatusMessage(status), - op: attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP], - origin: attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN], - _metrics_summary: getMetricSummaryJsonForSpan(span) - }); - } - return { - span_id, - trace_id - }; - } catch (e2) { - return {}; - } -} -__name(spanToJSON, "spanToJSON"); -function spanIsOpenTelemetrySdkTraceBaseSpan(span) { - const castSpan = span; - return !!castSpan.attributes && !!castSpan.startTime && !!castSpan.name && !!castSpan.endTime && !!castSpan.status; -} -__name(spanIsOpenTelemetrySdkTraceBaseSpan, "spanIsOpenTelemetrySdkTraceBaseSpan"); -function spanIsSentrySpan(span) { - return typeof span.getSpanJSON === "function"; -} -__name(spanIsSentrySpan, "spanIsSentrySpan"); -function spanIsSampled(span) { - const { traceFlags } = span.spanContext(); - return traceFlags === TRACE_FLAG_SAMPLED; -} -__name(spanIsSampled, "spanIsSampled"); -function getStatusMessage(status) { - if (!status || status.code === SPAN_STATUS_UNSET) { - return void 0; - } - if (status.code === SPAN_STATUS_OK) { - return "ok"; - } - return status.message || "unknown_error"; -} -__name(getStatusMessage, "getStatusMessage"); -const CHILD_SPANS_FIELD = "_sentryChildSpans"; -const ROOT_SPAN_FIELD = "_sentryRootSpan"; -function addChildSpanToSpan(span, childSpan) { - const rootSpan = span[ROOT_SPAN_FIELD] || span; - addNonEnumerableProperty(childSpan, ROOT_SPAN_FIELD, rootSpan); - if (span[CHILD_SPANS_FIELD]) { - span[CHILD_SPANS_FIELD].add(childSpan); - } else { - addNonEnumerableProperty(span, CHILD_SPANS_FIELD, /* @__PURE__ */ new Set([childSpan])); - } -} -__name(addChildSpanToSpan, "addChildSpanToSpan"); -function removeChildSpanFromSpan(span, childSpan) { - if (span[CHILD_SPANS_FIELD]) { - span[CHILD_SPANS_FIELD].delete(childSpan); - } -} -__name(removeChildSpanFromSpan, "removeChildSpanFromSpan"); -function getSpanDescendants(span) { - const resultSet = /* @__PURE__ */ new Set(); - function addSpanChildren(span2) { - if (resultSet.has(span2)) { - return; - } else if (spanIsSampled(span2)) { - resultSet.add(span2); - const childSpans = span2[CHILD_SPANS_FIELD] ? Array.from(span2[CHILD_SPANS_FIELD]) : []; - for (const childSpan of childSpans) { - addSpanChildren(childSpan); - } - } - } - __name(addSpanChildren, "addSpanChildren"); - addSpanChildren(span); - return Array.from(resultSet); -} -__name(getSpanDescendants, "getSpanDescendants"); -function getRootSpan(span) { - return span[ROOT_SPAN_FIELD] || span; -} -__name(getRootSpan, "getRootSpan"); -function getActiveSpan() { - const carrier = getMainCarrier(); - const acs = getAsyncContextStrategy(carrier); - if (acs.getActiveSpan) { - return acs.getActiveSpan(); - } - return _getSpanForScope(getCurrentScope$1()); -} -__name(getActiveSpan, "getActiveSpan"); -function updateMetricSummaryOnActiveSpan(metricType, sanitizedName, value4, unit, tags, bucketKey) { - const span = getActiveSpan(); - if (span) { - updateMetricSummaryOnSpan(span, metricType, sanitizedName, value4, unit, tags, bucketKey); - } -} -__name(updateMetricSummaryOnActiveSpan, "updateMetricSummaryOnActiveSpan"); -function showSpanDropWarning() { - if (!hasShownSpanDropWarning) { - consoleSandbox(() => { - console.warn( - "[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly." - ); - }); - hasShownSpanDropWarning = true; - } -} -__name(showSpanDropWarning, "showSpanDropWarning"); -function updateSpanName(span, name2) { - span.updateName(name2); - span.setAttributes({ - [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "custom", - [SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]: name2 - }); -} -__name(updateSpanName, "updateSpanName"); -let errorsInstrumented = false; -function registerSpanErrorInstrumentation() { - if (errorsInstrumented) { - return; - } - errorsInstrumented = true; - addGlobalErrorInstrumentationHandler(errorCallback); - addGlobalUnhandledRejectionInstrumentationHandler(errorCallback); -} -__name(registerSpanErrorInstrumentation, "registerSpanErrorInstrumentation"); -function errorCallback() { - const activeSpan = getActiveSpan(); - const rootSpan = activeSpan && getRootSpan(activeSpan); - if (rootSpan) { - const message3 = "internal_error"; - DEBUG_BUILD$6 && logger$2.log(`[Tracing] Root span: ${message3} -> Global error occurred`); - rootSpan.setStatus({ code: SPAN_STATUS_ERROR, message: message3 }); - } -} -__name(errorCallback, "errorCallback"); -errorCallback.tag = "sentry_tracingErrorCallback"; -const SCOPE_ON_START_SPAN_FIELD = "_sentryScope"; -const ISOLATION_SCOPE_ON_START_SPAN_FIELD = "_sentryIsolationScope"; -function setCapturedScopesOnSpan(span, scope, isolationScope) { - if (span) { - addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, isolationScope); - addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope); - } -} -__name(setCapturedScopesOnSpan, "setCapturedScopesOnSpan"); -function getCapturedScopesOnSpan(span) { - return { - scope: span[SCOPE_ON_START_SPAN_FIELD], - isolationScope: span[ISOLATION_SCOPE_ON_START_SPAN_FIELD] - }; -} -__name(getCapturedScopesOnSpan, "getCapturedScopesOnSpan"); -function addTracingExtensions() { - registerSpanErrorInstrumentation(); -} -__name(addTracingExtensions, "addTracingExtensions"); -function hasTracingEnabled(maybeOptions) { - if (typeof __SENTRY_TRACING__ === "boolean" && !__SENTRY_TRACING__) { - return false; - } - const client = getClient(); - const options4 = maybeOptions || client && client.getOptions(); - return !!options4 && (options4.enableTracing || "tracesSampleRate" in options4 || "tracesSampler" in options4); -} -__name(hasTracingEnabled, "hasTracingEnabled"); -class SentryNonRecordingSpan { - static { - __name(this, "SentryNonRecordingSpan"); - } - constructor(spanContext = {}) { - this._traceId = spanContext.traceId || generateTraceId(); - this._spanId = spanContext.spanId || generateSpanId(); - } - /** @inheritdoc */ - spanContext() { - return { - spanId: this._spanId, - traceId: this._traceId, - traceFlags: TRACE_FLAG_NONE - }; - } - /** @inheritdoc */ - // eslint-disable-next-line @typescript-eslint/no-empty-function - end(_timestamp) { - } - /** @inheritdoc */ - setAttribute(_key, _value) { - return this; - } - /** @inheritdoc */ - setAttributes(_values) { - return this; - } - /** @inheritdoc */ - setStatus(_status) { - return this; - } - /** @inheritdoc */ - updateName(_name) { - return this; - } - /** @inheritdoc */ - isRecording() { - return false; - } - /** @inheritdoc */ - addEvent(_name, _attributesOrStartTime, _startTime) { - return this; - } - /** - * This should generally not be used, - * but we need it for being compliant with the OTEL Span interface. - * - * @hidden - * @internal - */ - addLink(_link) { - return this; - } - /** - * This should generally not be used, - * but we need it for being compliant with the OTEL Span interface. - * - * @hidden - * @internal - */ - addLinks(_links) { - return this; - } - /** - * This should generally not be used, - * but we need it for being compliant with the OTEL Span interface. - * - * @hidden - * @internal - */ - recordException(_exception, _time) { - } -} -function handleCallbackErrors(fn, onError, onFinally = () => { -}) { - let maybePromiseResult; - try { - maybePromiseResult = fn(); - } catch (e2) { - onError(e2); - onFinally(); - throw e2; - } - return maybeHandlePromiseRejection(maybePromiseResult, onError, onFinally); -} -__name(handleCallbackErrors, "handleCallbackErrors"); -function maybeHandlePromiseRejection(value4, onError, onFinally) { - if (isThenable$1(value4)) { - return value4.then( - (res) => { - onFinally(); - return res; - }, - (e2) => { - onError(e2); - onFinally(); - throw e2; - } - ); - } - onFinally(); - return value4; -} -__name(maybeHandlePromiseRejection, "maybeHandlePromiseRejection"); -const DEFAULT_ENVIRONMENT = "production"; -const FROZEN_DSC_FIELD = "_frozenDsc"; -function freezeDscOnSpan(span, dsc) { - const spanWithMaybeDsc = span; - addNonEnumerableProperty(spanWithMaybeDsc, FROZEN_DSC_FIELD, dsc); -} -__name(freezeDscOnSpan, "freezeDscOnSpan"); -function getDynamicSamplingContextFromClient(trace_id, client) { - const options4 = client.getOptions(); - const { publicKey: public_key } = client.getDsn() || {}; - const dsc = dropUndefinedKeys({ - environment: options4.environment || DEFAULT_ENVIRONMENT, - release: options4.release, - public_key, - trace_id - }); - client.emit("createDsc", dsc); - return dsc; -} -__name(getDynamicSamplingContextFromClient, "getDynamicSamplingContextFromClient"); -function getDynamicSamplingContextFromScope(client, scope) { - const propagationContext = scope.getPropagationContext(); - return propagationContext.dsc || getDynamicSamplingContextFromClient(propagationContext.traceId, client); -} -__name(getDynamicSamplingContextFromScope, "getDynamicSamplingContextFromScope"); -function getDynamicSamplingContextFromSpan(span) { - const client = getClient(); - if (!client) { - return {}; - } - const rootSpan = getRootSpan(span); - const frozenDsc = rootSpan[FROZEN_DSC_FIELD]; - if (frozenDsc) { - return frozenDsc; - } - const traceState = rootSpan.spanContext().traceState; - const traceStateDsc = traceState && traceState.get("sentry.dsc"); - const dscOnTraceState = traceStateDsc && baggageHeaderToDynamicSamplingContext(traceStateDsc); - if (dscOnTraceState) { - return dscOnTraceState; - } - const dsc = getDynamicSamplingContextFromClient(span.spanContext().traceId, client); - const jsonSpan = spanToJSON(rootSpan); - const attributes = jsonSpan.data || {}; - const maybeSampleRate = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]; - if (maybeSampleRate != null) { - dsc.sample_rate = `${maybeSampleRate}`; - } - const source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; - const name2 = jsonSpan.description; - if (source !== "url" && name2) { - dsc.transaction = name2; - } - if (hasTracingEnabled()) { - dsc.sampled = String(spanIsSampled(rootSpan)); - } - client.emit("createDsc", dsc, rootSpan); - return dsc; -} -__name(getDynamicSamplingContextFromSpan, "getDynamicSamplingContextFromSpan"); -function spanToBaggageHeader(span) { - const dsc = getDynamicSamplingContextFromSpan(span); - return dynamicSamplingContextToSentryBaggageHeader(dsc); -} -__name(spanToBaggageHeader, "spanToBaggageHeader"); -function logSpanStart(span) { - if (!DEBUG_BUILD$6) return; - const { description = "< unknown name >", op = "< unknown op >", parent_span_id: parentSpanId } = spanToJSON(span); - const { spanId } = span.spanContext(); - const sampled = spanIsSampled(span); - const rootSpan = getRootSpan(span); - const isRootSpan = rootSpan === span; - const header3 = `[Tracing] Starting ${sampled ? "sampled" : "unsampled"} ${isRootSpan ? "root " : ""}span`; - const infoParts = [`op: ${op}`, `name: ${description}`, `ID: ${spanId}`]; - if (parentSpanId) { - infoParts.push(`parent ID: ${parentSpanId}`); - } - if (!isRootSpan) { - const { op: op2, description: description2 } = spanToJSON(rootSpan); - infoParts.push(`root ID: ${rootSpan.spanContext().spanId}`); - if (op2) { - infoParts.push(`root op: ${op2}`); - } - if (description2) { - infoParts.push(`root description: ${description2}`); - } - } - logger$2.log(`${header3} - ${infoParts.join("\n ")}`); -} -__name(logSpanStart, "logSpanStart"); -function logSpanEnd(span) { - if (!DEBUG_BUILD$6) return; - const { description = "< unknown name >", op = "< unknown op >" } = spanToJSON(span); - const { spanId } = span.spanContext(); - const rootSpan = getRootSpan(span); - const isRootSpan = rootSpan === span; - const msg = `[Tracing] Finishing "${op}" ${isRootSpan ? "root " : ""}span "${description}" with ID ${spanId}`; - logger$2.log(msg); -} -__name(logSpanEnd, "logSpanEnd"); -function parseSampleRate(sampleRate) { - if (typeof sampleRate === "boolean") { - return Number(sampleRate); - } - const rate = typeof sampleRate === "string" ? parseFloat(sampleRate) : sampleRate; - if (typeof rate !== "number" || isNaN(rate) || rate < 0 || rate > 1) { - DEBUG_BUILD$6 && logger$2.warn( - `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify( - sampleRate - )} of type ${JSON.stringify(typeof sampleRate)}.` - ); - return void 0; - } - return rate; -} -__name(parseSampleRate, "parseSampleRate"); -function sampleSpan(options4, samplingContext) { - if (!hasTracingEnabled(options4)) { - return [false]; - } - const normalizedRequest = getIsolationScope().getScopeData().sdkProcessingMetadata.normalizedRequest; - const enhancedSamplingContext = { - ...samplingContext, - normalizedRequest: samplingContext.normalizedRequest || normalizedRequest - }; - let sampleRate; - if (typeof options4.tracesSampler === "function") { - sampleRate = options4.tracesSampler(enhancedSamplingContext); - } else if (enhancedSamplingContext.parentSampled !== void 0) { - sampleRate = enhancedSamplingContext.parentSampled; - } else if (typeof options4.tracesSampleRate !== "undefined") { - sampleRate = options4.tracesSampleRate; - } else { - sampleRate = 1; - } - const parsedSampleRate = parseSampleRate(sampleRate); - if (parsedSampleRate === void 0) { - DEBUG_BUILD$6 && logger$2.warn("[Tracing] Discarding transaction because of invalid sample rate."); - return [false]; - } - if (!parsedSampleRate) { - DEBUG_BUILD$6 && logger$2.log( - `[Tracing] Discarding transaction because ${typeof options4.tracesSampler === "function" ? "tracesSampler returned 0 or false" : "a negative sampling decision was inherited or tracesSampleRate is set to 0"}` - ); - return [false, parsedSampleRate]; - } - const shouldSample = Math.random() < parsedSampleRate; - if (!shouldSample) { - DEBUG_BUILD$6 && logger$2.log( - `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number( - sampleRate - )})` - ); - return [false, parsedSampleRate]; - } - return [true, parsedSampleRate]; -} -__name(sampleSpan, "sampleSpan"); -const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/; -function isValidProtocol(protocol) { - return protocol === "http" || protocol === "https"; -} -__name(isValidProtocol, "isValidProtocol"); -function dsnToString(dsn, withPassword = false) { - const { host, path, pass, port, projectId, protocol, publicKey } = dsn; - return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path ? `${path}/` : path}${projectId}`; -} -__name(dsnToString, "dsnToString"); -function dsnFromString(str) { - const match3 = DSN_REGEX.exec(str); - if (!match3) { - consoleSandbox(() => { - console.error(`Invalid Sentry Dsn: ${str}`); - }); - return void 0; - } - const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match3.slice(1); - let path = ""; - let projectId = lastPath; - const split2 = projectId.split("/"); - if (split2.length > 1) { - path = split2.slice(0, -1).join("/"); - projectId = split2.pop(); - } - if (projectId) { - const projectMatch = projectId.match(/^\d+/); - if (projectMatch) { - projectId = projectMatch[0]; - } - } - return dsnFromComponents({ host, pass, path, projectId, port, protocol, publicKey }); -} -__name(dsnFromString, "dsnFromString"); -function dsnFromComponents(components) { - return { - protocol: components.protocol, - publicKey: components.publicKey || "", - pass: components.pass || "", - host: components.host, - port: components.port || "", - path: components.path || "", - projectId: components.projectId - }; -} -__name(dsnFromComponents, "dsnFromComponents"); -function validateDsn(dsn) { - if (!DEBUG_BUILD$5) { - return true; - } - const { port, projectId, protocol } = dsn; - const requiredComponents = ["protocol", "publicKey", "host", "projectId"]; - const hasMissingRequiredComponent = requiredComponents.find((component) => { - if (!dsn[component]) { - logger$2.error(`Invalid Sentry Dsn: ${component} missing`); - return true; - } - return false; - }); - if (hasMissingRequiredComponent) { - return false; - } - if (!projectId.match(/^\d+$/)) { - logger$2.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`); - return false; - } - if (!isValidProtocol(protocol)) { - logger$2.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`); - return false; - } - if (port && isNaN(parseInt(port, 10))) { - logger$2.error(`Invalid Sentry Dsn: Invalid port ${port}`); - return false; - } - return true; -} -__name(validateDsn, "validateDsn"); -function makeDsn(from2) { - const components = typeof from2 === "string" ? dsnFromString(from2) : dsnFromComponents(from2); - if (!components || !validateDsn(components)) { - return void 0; - } - return components; -} -__name(makeDsn, "makeDsn"); -function memoBuilder() { - const hasWeakSet = typeof WeakSet === "function"; - const inner = hasWeakSet ? /* @__PURE__ */ new WeakSet() : []; - function memoize(obj) { - if (hasWeakSet) { - if (inner.has(obj)) { - return true; - } - inner.add(obj); - return false; - } - for (let i2 = 0; i2 < inner.length; i2++) { - const value4 = inner[i2]; - if (value4 === obj) { - return true; - } - } - inner.push(obj); - return false; - } - __name(memoize, "memoize"); - function unmemoize(obj) { - if (hasWeakSet) { - inner.delete(obj); - } else { - for (let i2 = 0; i2 < inner.length; i2++) { - if (inner[i2] === obj) { - inner.splice(i2, 1); - break; - } - } - } - } - __name(unmemoize, "unmemoize"); - return [memoize, unmemoize]; -} -__name(memoBuilder, "memoBuilder"); -function normalize$3(input, depth = 100, maxProperties = Infinity) { - try { - return visit("", input, depth, maxProperties); - } catch (err) { - return { ERROR: `**non-serializable** (${err})` }; - } -} -__name(normalize$3, "normalize$3"); -function normalizeToSize(object, depth = 3, maxSize = 100 * 1024) { - const normalized = normalize$3(object, depth); - if (jsonSize(normalized) > maxSize) { - return normalizeToSize(object, depth - 1, maxSize); - } - return normalized; -} -__name(normalizeToSize, "normalizeToSize"); -function visit(key, value4, depth = Infinity, maxProperties = Infinity, memo = memoBuilder()) { - const [memoize, unmemoize] = memo; - if (value4 == null || // this matches null and undefined -> eqeq not eqeqeq - ["boolean", "string"].includes(typeof value4) || typeof value4 === "number" && Number.isFinite(value4)) { - return value4; - } - const stringified = stringifyValue(key, value4); - if (!stringified.startsWith("[object ")) { - return stringified; - } - if (value4["__sentry_skip_normalization__"]) { - return value4; - } - const remainingDepth = typeof value4["__sentry_override_normalization_depth__"] === "number" ? value4["__sentry_override_normalization_depth__"] : depth; - if (remainingDepth === 0) { - return stringified.replace("object ", ""); - } - if (memoize(value4)) { - return "[Circular ~]"; - } - const valueWithToJSON = value4; - if (valueWithToJSON && typeof valueWithToJSON.toJSON === "function") { - try { - const jsonValue = valueWithToJSON.toJSON(); - return visit("", jsonValue, remainingDepth - 1, maxProperties, memo); - } catch (err) { - } - } - const normalized = Array.isArray(value4) ? [] : {}; - let numAdded = 0; - const visitable = convertToPlainObject(value4); - for (const visitKey in visitable) { - if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { - continue; - } - if (numAdded >= maxProperties) { - normalized[visitKey] = "[MaxProperties ~]"; - break; - } - const visitValue = visitable[visitKey]; - normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo); - numAdded++; - } - unmemoize(value4); - return normalized; -} -__name(visit, "visit"); -function stringifyValue(key, value4) { - try { - if (key === "domain" && value4 && typeof value4 === "object" && value4._events) { - return "[Domain]"; - } - if (key === "domainEmitter") { - return "[DomainEmitter]"; - } - if (typeof global !== "undefined" && value4 === global) { - return "[Global]"; - } - if (typeof window !== "undefined" && value4 === window) { - return "[Window]"; - } - if (typeof document !== "undefined" && value4 === document) { - return "[Document]"; - } - if (isVueViewModel(value4)) { - return "[VueViewModel]"; - } - if (isSyntheticEvent(value4)) { - return "[SyntheticEvent]"; - } - if (typeof value4 === "number" && !Number.isFinite(value4)) { - return `[${value4}]`; - } - if (typeof value4 === "function") { - return `[Function: ${getFunctionName(value4)}]`; - } - if (typeof value4 === "symbol") { - return `[${String(value4)}]`; - } - if (typeof value4 === "bigint") { - return `[BigInt: ${String(value4)}]`; - } - const objName = getConstructorName(value4); - if (/^HTML(\w*)Element$/.test(objName)) { - return `[HTMLElement: ${objName}]`; - } - return `[object ${objName}]`; - } catch (err) { - return `**non-serializable** (${err})`; - } -} -__name(stringifyValue, "stringifyValue"); -function getConstructorName(value4) { - const prototype2 = Object.getPrototypeOf(value4); - return prototype2 ? prototype2.constructor.name : "null prototype"; -} -__name(getConstructorName, "getConstructorName"); -function utf8Length(value4) { - return ~-encodeURI(value4).split(/%..|./).length; -} -__name(utf8Length, "utf8Length"); -function jsonSize(value4) { - return utf8Length(JSON.stringify(value4)); -} -__name(jsonSize, "jsonSize"); -function normalizeUrlToBase(url, basePath2) { - const escapedBase = basePath2.replace(/\\/g, "/").replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); - let newUrl = url; - try { - newUrl = decodeURI(url); - } catch (_Oo) { - } - return newUrl.replace(/\\/g, "/").replace(/webpack:\/?/g, "").replace(new RegExp(`(file://)?/*${escapedBase}/*`, "ig"), "app:///"); -} -__name(normalizeUrlToBase, "normalizeUrlToBase"); -function createEnvelope(headers, items2 = []) { - return [headers, items2]; -} -__name(createEnvelope, "createEnvelope"); -function addItemToEnvelope(envelope, newItem) { - const [headers, items2] = envelope; - return [headers, [...items2, newItem]]; -} -__name(addItemToEnvelope, "addItemToEnvelope"); -function forEachEnvelopeItem(envelope, callback) { - const envelopeItems = envelope[1]; - for (const envelopeItem of envelopeItems) { - const envelopeItemType = envelopeItem[0].type; - const result = callback(envelopeItem, envelopeItemType); - if (result) { - return true; - } - } - return false; -} -__name(forEachEnvelopeItem, "forEachEnvelopeItem"); -function envelopeContainsItemType(envelope, types) { - return forEachEnvelopeItem(envelope, (_2, type) => types.includes(type)); -} -__name(envelopeContainsItemType, "envelopeContainsItemType"); -function encodeUTF8(input) { - return GLOBAL_OBJ.__SENTRY__ && GLOBAL_OBJ.__SENTRY__.encodePolyfill ? GLOBAL_OBJ.__SENTRY__.encodePolyfill(input) : new TextEncoder().encode(input); -} -__name(encodeUTF8, "encodeUTF8"); -function decodeUTF8(input) { - return GLOBAL_OBJ.__SENTRY__ && GLOBAL_OBJ.__SENTRY__.decodePolyfill ? GLOBAL_OBJ.__SENTRY__.decodePolyfill(input) : new TextDecoder().decode(input); -} -__name(decodeUTF8, "decodeUTF8"); -function serializeEnvelope(envelope) { - const [envHeaders, items2] = envelope; - let parts2 = JSON.stringify(envHeaders); - function append3(next2) { - if (typeof parts2 === "string") { - parts2 = typeof next2 === "string" ? parts2 + next2 : [encodeUTF8(parts2), next2]; - } else { - parts2.push(typeof next2 === "string" ? encodeUTF8(next2) : next2); - } - } - __name(append3, "append"); - for (const item3 of items2) { - const [itemHeaders, payload] = item3; - append3(` -${JSON.stringify(itemHeaders)} -`); - if (typeof payload === "string" || payload instanceof Uint8Array) { - append3(payload); - } else { - let stringifiedPayload; - try { - stringifiedPayload = JSON.stringify(payload); - } catch (e2) { - stringifiedPayload = JSON.stringify(normalize$3(payload)); - } - append3(stringifiedPayload); - } - } - return typeof parts2 === "string" ? parts2 : concatBuffers(parts2); -} -__name(serializeEnvelope, "serializeEnvelope"); -function concatBuffers(buffers) { - const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0); - const merged = new Uint8Array(totalLength); - let offset = 0; - for (const buffer2 of buffers) { - merged.set(buffer2, offset); - offset += buffer2.length; - } - return merged; -} -__name(concatBuffers, "concatBuffers"); -function parseEnvelope(env) { - let buffer2 = typeof env === "string" ? encodeUTF8(env) : env; - function readBinary(length) { - const bin = buffer2.subarray(0, length); - buffer2 = buffer2.subarray(length + 1); - return bin; - } - __name(readBinary, "readBinary"); - function readJson() { - let i2 = buffer2.indexOf(10); - if (i2 < 0) { - i2 = buffer2.length; - } - return JSON.parse(decodeUTF8(readBinary(i2))); - } - __name(readJson, "readJson"); - const envelopeHeader = readJson(); - const items2 = []; - while (buffer2.length) { - const itemHeader = readJson(); - const binaryLength = typeof itemHeader.length === "number" ? itemHeader.length : void 0; - items2.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]); - } - return [envelopeHeader, items2]; -} -__name(parseEnvelope, "parseEnvelope"); -function createSpanEnvelopeItem(spanJson) { - const spanHeaders = { - type: "span" - }; - return [spanHeaders, spanJson]; -} -__name(createSpanEnvelopeItem, "createSpanEnvelopeItem"); -function createAttachmentEnvelopeItem(attachment) { - const buffer2 = typeof attachment.data === "string" ? encodeUTF8(attachment.data) : attachment.data; - return [ - dropUndefinedKeys({ - type: "attachment", - length: buffer2.length, - filename: attachment.filename, - content_type: attachment.contentType, - attachment_type: attachment.attachmentType - }), - buffer2 - ]; -} -__name(createAttachmentEnvelopeItem, "createAttachmentEnvelopeItem"); -const ITEM_TYPE_TO_DATA_CATEGORY_MAP = { - session: "session", - sessions: "session", - attachment: "attachment", - transaction: "transaction", - event: "error", - client_report: "internal", - user_report: "default", - profile: "profile", - profile_chunk: "profile", - replay_event: "replay", - replay_recording: "replay", - check_in: "monitor", - feedback: "feedback", - span: "span", - statsd: "metric_bucket", - raw_security: "security" -}; -function envelopeItemTypeToDataCategory(type) { - return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type]; -} -__name(envelopeItemTypeToDataCategory, "envelopeItemTypeToDataCategory"); -function getSdkMetadataForEnvelopeHeader(metadataOrEvent) { - if (!metadataOrEvent || !metadataOrEvent.sdk) { - return; - } - const { name: name2, version: version2 } = metadataOrEvent.sdk; - return { name: name2, version: version2 }; -} -__name(getSdkMetadataForEnvelopeHeader, "getSdkMetadataForEnvelopeHeader"); -function createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn) { - const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext; - return { - event_id: event.event_id, - sent_at: (/* @__PURE__ */ new Date()).toISOString(), - ...sdkInfo && { sdk: sdkInfo }, - ...!!tunnel && dsn && { dsn: dsnToString(dsn) }, - ...dynamicSamplingContext && { - trace: dropUndefinedKeys({ ...dynamicSamplingContext }) - } - }; -} -__name(createEventEnvelopeHeaders, "createEventEnvelopeHeaders"); -function enhanceEventWithSdkInfo(event, sdkInfo) { - if (!sdkInfo) { - return event; - } - event.sdk = event.sdk || {}; - event.sdk.name = event.sdk.name || sdkInfo.name; - event.sdk.version = event.sdk.version || sdkInfo.version; - event.sdk.integrations = [...event.sdk.integrations || [], ...sdkInfo.integrations || []]; - event.sdk.packages = [...event.sdk.packages || [], ...sdkInfo.packages || []]; - return event; -} -__name(enhanceEventWithSdkInfo, "enhanceEventWithSdkInfo"); -function createSessionEnvelope(session, dsn, metadata, tunnel) { - const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata); - const envelopeHeaders = { - sent_at: (/* @__PURE__ */ new Date()).toISOString(), - ...sdkInfo && { sdk: sdkInfo }, - ...!!tunnel && dsn && { dsn: dsnToString(dsn) } - }; - const envelopeItem = "aggregates" in session ? [{ type: "sessions" }, session] : [{ type: "session" }, session.toJSON()]; - return createEnvelope(envelopeHeaders, [envelopeItem]); -} -__name(createSessionEnvelope, "createSessionEnvelope"); -function createEventEnvelope(event, dsn, metadata, tunnel) { - const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata); - const eventType = event.type && event.type !== "replay_event" ? event.type : "event"; - enhanceEventWithSdkInfo(event, metadata && metadata.sdk); - const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn); - delete event.sdkProcessingMetadata; - const eventItem = [{ type: eventType }, event]; - return createEnvelope(envelopeHeaders, [eventItem]); -} -__name(createEventEnvelope, "createEventEnvelope"); -function createSpanEnvelope(spans, client) { - function dscHasRequiredProps(dsc2) { - return !!dsc2.trace_id && !!dsc2.public_key; - } - __name(dscHasRequiredProps, "dscHasRequiredProps"); - const dsc = getDynamicSamplingContextFromSpan(spans[0]); - const dsn = client && client.getDsn(); - const tunnel = client && client.getOptions().tunnel; - const headers = { - sent_at: (/* @__PURE__ */ new Date()).toISOString(), - ...dscHasRequiredProps(dsc) && { trace: dsc }, - ...!!tunnel && dsn && { dsn: dsnToString(dsn) } - }; - const beforeSendSpan = client && client.getOptions().beforeSendSpan; - const convertToSpanJSON = beforeSendSpan ? (span) => { - const spanJson = beforeSendSpan(spanToJSON(span)); - if (!spanJson) { - showSpanDropWarning(); - } - return spanJson; - } : (span) => spanToJSON(span); - const items2 = []; - for (const span of spans) { - const spanJson = convertToSpanJSON(span); - if (spanJson) { - items2.push(createSpanEnvelopeItem(spanJson)); - } - } - return createEnvelope(headers, items2); -} -__name(createSpanEnvelope, "createSpanEnvelope"); -function setMeasurement(name2, value4, unit, activeSpan = getActiveSpan()) { - const rootSpan = activeSpan && getRootSpan(activeSpan); - if (rootSpan) { - DEBUG_BUILD$6 && logger$2.log(`[Measurement] Setting measurement on root span: ${name2} = ${value4} ${unit}`); - rootSpan.addEvent(name2, { - [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value4, - [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit - }); - } -} -__name(setMeasurement, "setMeasurement"); -function timedEventsToMeasurements(events2) { - if (!events2 || events2.length === 0) { - return void 0; - } - const measurements = {}; - events2.forEach((event) => { - const attributes = event.attributes || {}; - const unit = attributes[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]; - const value4 = attributes[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]; - if (typeof unit === "string" && typeof value4 === "number") { - measurements[event.name] = { value: value4, unit }; - } - }); - return measurements; -} -__name(timedEventsToMeasurements, "timedEventsToMeasurements"); -const MAX_SPAN_COUNT = 1e3; -class SentrySpan { - static { - __name(this, "SentrySpan"); - } - /** Epoch timestamp in seconds when the span started. */ - /** Epoch timestamp in seconds when the span ended. */ - /** Internal keeper of the status */ - /** The timed events added to this span. */ - /** if true, treat span as a standalone span (not part of a transaction) */ - /** - * You should never call the constructor manually, always use `Sentry.startSpan()` - * or other span methods. - * @internal - * @hideconstructor - * @hidden - */ - constructor(spanContext = {}) { - this._traceId = spanContext.traceId || generateTraceId(); - this._spanId = spanContext.spanId || generateSpanId(); - this._startTime = spanContext.startTimestamp || timestampInSeconds(); - this._attributes = {}; - this.setAttributes({ - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "manual", - [SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op, - ...spanContext.attributes - }); - this._name = spanContext.name; - if (spanContext.parentSpanId) { - this._parentSpanId = spanContext.parentSpanId; - } - if ("sampled" in spanContext) { - this._sampled = spanContext.sampled; - } - if (spanContext.endTimestamp) { - this._endTime = spanContext.endTimestamp; - } - this._events = []; - this._isStandaloneSpan = spanContext.isStandalone; - if (this._endTime) { - this._onSpanEnded(); - } - } - /** - * This should generally not be used, - * but it is needed for being compliant with the OTEL Span interface. - * - * @hidden - * @internal - */ - addLink(_link) { - return this; - } - /** - * This should generally not be used, - * but it is needed for being compliant with the OTEL Span interface. - * - * @hidden - * @internal - */ - addLinks(_links) { - return this; - } - /** - * This should generally not be used, - * but it is needed for being compliant with the OTEL Span interface. - * - * @hidden - * @internal - */ - recordException(_exception, _time) { - } - /** @inheritdoc */ - spanContext() { - const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this; - return { - spanId, - traceId, - traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE - }; - } - /** @inheritdoc */ - setAttribute(key, value4) { - if (value4 === void 0) { - delete this._attributes[key]; - } else { - this._attributes[key] = value4; - } - return this; - } - /** @inheritdoc */ - setAttributes(attributes) { - Object.keys(attributes).forEach((key) => this.setAttribute(key, attributes[key])); - return this; - } - /** - * This should generally not be used, - * but we need it for browser tracing where we want to adjust the start time afterwards. - * USE THIS WITH CAUTION! - * - * @hidden - * @internal - */ - updateStartTime(timeInput) { - this._startTime = spanTimeInputToSeconds(timeInput); - } - /** - * @inheritDoc - */ - setStatus(value4) { - this._status = value4; - return this; - } - /** - * @inheritDoc - */ - updateName(name2) { - this._name = name2; - this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, "custom"); - return this; - } - /** @inheritdoc */ - end(endTimestamp) { - if (this._endTime) { - return; - } - this._endTime = spanTimeInputToSeconds(endTimestamp); - logSpanEnd(this); - this._onSpanEnded(); - } - /** - * Get JSON representation of this span. - * - * @hidden - * @internal This method is purely for internal purposes and should not be used outside - * of SDK code. If you need to get a JSON representation of a span, - * use `spanToJSON(span)` instead. - */ - getSpanJSON() { - return dropUndefinedKeys({ - data: this._attributes, - description: this._name, - op: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP], - parent_span_id: this._parentSpanId, - span_id: this._spanId, - start_timestamp: this._startTime, - status: getStatusMessage(this._status), - timestamp: this._endTime, - trace_id: this._traceId, - origin: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN], - _metrics_summary: getMetricSummaryJsonForSpan(this), - profile_id: this._attributes[SEMANTIC_ATTRIBUTE_PROFILE_ID], - exclusive_time: this._attributes[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME], - measurements: timedEventsToMeasurements(this._events), - is_segment: this._isStandaloneSpan && getRootSpan(this) === this || void 0, - segment_id: this._isStandaloneSpan ? getRootSpan(this).spanContext().spanId : void 0 - }); - } - /** @inheritdoc */ - isRecording() { - return !this._endTime && !!this._sampled; - } - /** - * @inheritdoc - */ - addEvent(name2, attributesOrStartTime, startTime) { - DEBUG_BUILD$6 && logger$2.log("[Tracing] Adding an event to span:", name2); - const time = isSpanTimeInput(attributesOrStartTime) ? attributesOrStartTime : startTime || timestampInSeconds(); - const attributes = isSpanTimeInput(attributesOrStartTime) ? {} : attributesOrStartTime || {}; - const event = { - name: name2, - time: spanTimeInputToSeconds(time), - attributes - }; - this._events.push(event); - return this; - } - /** - * This method should generally not be used, - * but for now we need a way to publicly check if the `_isStandaloneSpan` flag is set. - * USE THIS WITH CAUTION! - * @internal - * @hidden - * @experimental - */ - isStandaloneSpan() { - return !!this._isStandaloneSpan; - } - /** Emit `spanEnd` when the span is ended. */ - _onSpanEnded() { - const client = getClient(); - if (client) { - client.emit("spanEnd", this); - } - const isSegmentSpan = this._isStandaloneSpan || this === getRootSpan(this); - if (!isSegmentSpan) { - return; - } - if (this._isStandaloneSpan) { - if (this._sampled) { - sendSpanEnvelope(createSpanEnvelope([this], client)); - } else { - DEBUG_BUILD$6 && logger$2.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."); - if (client) { - client.recordDroppedEvent("sample_rate", "span"); - } - } - return; - } - const transactionEvent = this._convertSpanToTransaction(); - if (transactionEvent) { - const scope = getCapturedScopesOnSpan(this).scope || getCurrentScope$1(); - scope.captureEvent(transactionEvent); - } - } - /** - * Finish the transaction & prepare the event to send to Sentry. - */ - _convertSpanToTransaction() { - if (!isFullFinishedSpan(spanToJSON(this))) { - return void 0; - } - if (!this._name) { - DEBUG_BUILD$6 && logger$2.warn("Transaction has no name, falling back to ``."); - this._name = ""; - } - const { scope: capturedSpanScope, isolationScope: capturedSpanIsolationScope } = getCapturedScopesOnSpan(this); - const scope = capturedSpanScope || getCurrentScope$1(); - const client = scope.getClient() || getClient(); - if (this._sampled !== true) { - DEBUG_BUILD$6 && logger$2.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."); - if (client) { - client.recordDroppedEvent("sample_rate", "transaction"); - } - return void 0; - } - const finishedSpans = getSpanDescendants(this).filter((span) => span !== this && !isStandaloneSpan(span)); - const spans = finishedSpans.map((span) => spanToJSON(span)).filter(isFullFinishedSpan); - const source = this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; - delete this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; - spans.forEach((span) => { - span.data && delete span.data[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; - }); - const transaction = { - contexts: { - trace: spanToTransactionTraceContext(this) - }, - spans: ( - // spans.sort() mutates the array, but `spans` is already a copy so we can safely do this here - // we do not use spans anymore after this point - spans.length > MAX_SPAN_COUNT ? spans.sort((a2, b2) => a2.start_timestamp - b2.start_timestamp).slice(0, MAX_SPAN_COUNT) : spans - ), - start_timestamp: this._startTime, - timestamp: this._endTime, - transaction: this._name, - type: "transaction", - sdkProcessingMetadata: { - capturedSpanScope, - capturedSpanIsolationScope, - ...dropUndefinedKeys({ - dynamicSamplingContext: getDynamicSamplingContextFromSpan(this) - }) - }, - _metrics_summary: getMetricSummaryJsonForSpan(this), - ...source && { - transaction_info: { - source - } - } - }; - const measurements = timedEventsToMeasurements(this._events); - const hasMeasurements = measurements && Object.keys(measurements).length; - if (hasMeasurements) { - DEBUG_BUILD$6 && logger$2.log( - "[Measurements] Adding measurements to transaction event", - JSON.stringify(measurements, void 0, 2) - ); - transaction.measurements = measurements; - } - return transaction; - } -} -function isSpanTimeInput(value4) { - return value4 && typeof value4 === "number" || value4 instanceof Date || Array.isArray(value4); -} -__name(isSpanTimeInput, "isSpanTimeInput"); -function isFullFinishedSpan(input) { - return !!input.start_timestamp && !!input.timestamp && !!input.span_id && !!input.trace_id; -} -__name(isFullFinishedSpan, "isFullFinishedSpan"); -function isStandaloneSpan(span) { - return span instanceof SentrySpan && span.isStandaloneSpan(); -} -__name(isStandaloneSpan, "isStandaloneSpan"); -function sendSpanEnvelope(envelope) { - const client = getClient(); - if (!client) { - return; - } - const spanItems = envelope[1]; - if (!spanItems || spanItems.length === 0) { - client.recordDroppedEvent("before_send", "span"); - return; - } - client.sendEnvelope(envelope); -} -__name(sendSpanEnvelope, "sendSpanEnvelope"); -const SUPPRESS_TRACING_KEY = "__SENTRY_SUPPRESS_TRACING__"; -function startSpan(options4, callback) { - const acs = getAcs(); - if (acs.startSpan) { - return acs.startSpan(options4, callback); - } - const spanArguments = parseSentrySpanArguments(options4); - const { forceTransaction, parentSpan: customParentSpan } = options4; - return withScope(options4.scope, () => { - const wrapper = getActiveSpanWrapper(customParentSpan); - return wrapper(() => { - const scope = getCurrentScope$1(); - const parentSpan = getParentSpan(scope); - const shouldSkipSpan = options4.onlyIfParent && !parentSpan; - const activeSpan = shouldSkipSpan ? new SentryNonRecordingSpan() : createChildOrRootSpan({ - parentSpan, - spanArguments, - forceTransaction, - scope - }); - _setSpanForScope(scope, activeSpan); - return handleCallbackErrors( - () => callback(activeSpan), - () => { - const { status } = spanToJSON(activeSpan); - if (activeSpan.isRecording() && (!status || status === "ok")) { - activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: "internal_error" }); - } - }, - () => activeSpan.end() - ); - }); - }); -} -__name(startSpan, "startSpan"); -function startSpanManual(options4, callback) { - const acs = getAcs(); - if (acs.startSpanManual) { - return acs.startSpanManual(options4, callback); - } - const spanArguments = parseSentrySpanArguments(options4); - const { forceTransaction, parentSpan: customParentSpan } = options4; - return withScope(options4.scope, () => { - const wrapper = getActiveSpanWrapper(customParentSpan); - return wrapper(() => { - const scope = getCurrentScope$1(); - const parentSpan = getParentSpan(scope); - const shouldSkipSpan = options4.onlyIfParent && !parentSpan; - const activeSpan = shouldSkipSpan ? new SentryNonRecordingSpan() : createChildOrRootSpan({ - parentSpan, - spanArguments, - forceTransaction, - scope - }); - _setSpanForScope(scope, activeSpan); - function finishAndSetSpan() { - activeSpan.end(); - } - __name(finishAndSetSpan, "finishAndSetSpan"); - return handleCallbackErrors( - () => callback(activeSpan, finishAndSetSpan), - () => { - const { status } = spanToJSON(activeSpan); - if (activeSpan.isRecording() && (!status || status === "ok")) { - activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: "internal_error" }); - } - } - ); - }); - }); -} -__name(startSpanManual, "startSpanManual"); -function startInactiveSpan(options4) { - const acs = getAcs(); - if (acs.startInactiveSpan) { - return acs.startInactiveSpan(options4); - } - const spanArguments = parseSentrySpanArguments(options4); - const { forceTransaction, parentSpan: customParentSpan } = options4; - const wrapper = options4.scope ? (callback) => withScope(options4.scope, callback) : customParentSpan !== void 0 ? (callback) => withActiveSpan(customParentSpan, callback) : (callback) => callback(); - return wrapper(() => { - const scope = getCurrentScope$1(); - const parentSpan = getParentSpan(scope); - const shouldSkipSpan = options4.onlyIfParent && !parentSpan; - if (shouldSkipSpan) { - return new SentryNonRecordingSpan(); - } - return createChildOrRootSpan({ - parentSpan, - spanArguments, - forceTransaction, - scope - }); - }); -} -__name(startInactiveSpan, "startInactiveSpan"); -const continueTrace = /* @__PURE__ */ __name((options4, callback) => { - const carrier = getMainCarrier(); - const acs = getAsyncContextStrategy(carrier); - if (acs.continueTrace) { - return acs.continueTrace(options4, callback); - } - const { sentryTrace, baggage } = options4; - return withScope((scope) => { - const propagationContext = propagationContextFromHeaders(sentryTrace, baggage); - scope.setPropagationContext(propagationContext); - return callback(); - }); -}, "continueTrace"); -function withActiveSpan(span, callback) { - const acs = getAcs(); - if (acs.withActiveSpan) { - return acs.withActiveSpan(span, callback); - } - return withScope((scope) => { - _setSpanForScope(scope, span || void 0); - return callback(scope); - }); -} -__name(withActiveSpan, "withActiveSpan"); -function suppressTracing(callback) { - const acs = getAcs(); - if (acs.suppressTracing) { - return acs.suppressTracing(callback); - } - return withScope((scope) => { - scope.setSDKProcessingMetadata({ [SUPPRESS_TRACING_KEY]: true }); - return callback(); - }); -} -__name(suppressTracing, "suppressTracing"); -function startNewTrace(callback) { - return withScope((scope) => { - scope.setPropagationContext({ traceId: generateTraceId() }); - DEBUG_BUILD$6 && logger$2.info(`Starting a new trace with id ${scope.getPropagationContext().traceId}`); - return withActiveSpan(null, callback); - }); -} -__name(startNewTrace, "startNewTrace"); -function createChildOrRootSpan({ - parentSpan, - spanArguments, - forceTransaction, - scope -}) { - if (!hasTracingEnabled()) { - return new SentryNonRecordingSpan(); - } - const isolationScope = getIsolationScope(); - let span; - if (parentSpan && !forceTransaction) { - span = _startChildSpan(parentSpan, scope, spanArguments); - addChildSpanToSpan(parentSpan, span); - } else if (parentSpan) { - const dsc = getDynamicSamplingContextFromSpan(parentSpan); - const { traceId, spanId: parentSpanId } = parentSpan.spanContext(); - const parentSampled = spanIsSampled(parentSpan); - span = _startRootSpan( - { - traceId, - parentSpanId, - ...spanArguments - }, - scope, - parentSampled - ); - freezeDscOnSpan(span, dsc); - } else { - const { - traceId, - dsc, - parentSpanId, - sampled: parentSampled - } = { - ...isolationScope.getPropagationContext(), - ...scope.getPropagationContext() - }; - span = _startRootSpan( - { - traceId, - parentSpanId, - ...spanArguments - }, - scope, - parentSampled - ); - if (dsc) { - freezeDscOnSpan(span, dsc); - } - } - logSpanStart(span); - setCapturedScopesOnSpan(span, scope, isolationScope); - return span; -} -__name(createChildOrRootSpan, "createChildOrRootSpan"); -function parseSentrySpanArguments(options4) { - const exp = options4.experimental || {}; - const initialCtx = { - isStandalone: exp.standalone, - ...options4 - }; - if (options4.startTime) { - const ctx = { ...initialCtx }; - ctx.startTimestamp = spanTimeInputToSeconds(options4.startTime); - delete ctx.startTime; - return ctx; - } - return initialCtx; -} -__name(parseSentrySpanArguments, "parseSentrySpanArguments"); -function getAcs() { - const carrier = getMainCarrier(); - return getAsyncContextStrategy(carrier); -} -__name(getAcs, "getAcs"); -function _startRootSpan(spanArguments, scope, parentSampled) { - const client = getClient(); - const options4 = client && client.getOptions() || {}; - const { name: name2 = "", attributes } = spanArguments; - const [sampled, sampleRate] = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] ? [false] : sampleSpan(options4, { - name: name2, - parentSampled, - attributes, - transactionContext: { - name: name2, - parentSampled - } - }); - const rootSpan = new SentrySpan({ - ...spanArguments, - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "custom", - ...spanArguments.attributes - }, - sampled - }); - if (sampleRate !== void 0) { - rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate); - } - if (client) { - client.emit("spanStart", rootSpan); - } - return rootSpan; -} -__name(_startRootSpan, "_startRootSpan"); -function _startChildSpan(parentSpan, scope, spanArguments) { - const { spanId, traceId } = parentSpan.spanContext(); - const sampled = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] ? false : spanIsSampled(parentSpan); - const childSpan = sampled ? new SentrySpan({ - ...spanArguments, - parentSpanId: spanId, - traceId, - sampled - }) : new SentryNonRecordingSpan({ traceId }); - addChildSpanToSpan(parentSpan, childSpan); - const client = getClient(); - if (client) { - client.emit("spanStart", childSpan); - if (spanArguments.endTimestamp) { - client.emit("spanEnd", childSpan); - } - } - return childSpan; -} -__name(_startChildSpan, "_startChildSpan"); -function getParentSpan(scope) { - const span = _getSpanForScope(scope); - if (!span) { - return void 0; - } - const client = getClient(); - const options4 = client ? client.getOptions() : {}; - if (options4.parentSpanIsAlwaysRootSpan) { - return getRootSpan(span); - } - return span; -} -__name(getParentSpan, "getParentSpan"); -function getActiveSpanWrapper(parentSpan) { - return parentSpan !== void 0 ? (callback) => { - return withActiveSpan(parentSpan, callback); - } : (callback) => callback(); -} -__name(getActiveSpanWrapper, "getActiveSpanWrapper"); -const TRACING_DEFAULTS = { - idleTimeout: 1e3, - finalTimeout: 3e4, - childSpanTimeout: 15e3 -}; -const FINISH_REASON_HEARTBEAT_FAILED = "heartbeatFailed"; -const FINISH_REASON_IDLE_TIMEOUT = "idleTimeout"; -const FINISH_REASON_FINAL_TIMEOUT = "finalTimeout"; -const FINISH_REASON_EXTERNAL_FINISH = "externalFinish"; -function startIdleSpan(startSpanOptions, options4 = {}) { - const activities = /* @__PURE__ */ new Map(); - let _finished = false; - let _idleTimeoutID; - let _finishReason = FINISH_REASON_EXTERNAL_FINISH; - let _autoFinishAllowed = !options4.disableAutoFinish; - const _cleanupHooks = []; - const { - idleTimeout = TRACING_DEFAULTS.idleTimeout, - finalTimeout = TRACING_DEFAULTS.finalTimeout, - childSpanTimeout = TRACING_DEFAULTS.childSpanTimeout, - beforeSpanEnd - } = options4; - const client = getClient(); - if (!client || !hasTracingEnabled()) { - return new SentryNonRecordingSpan(); - } - const scope = getCurrentScope$1(); - const previousActiveSpan = getActiveSpan(); - const span = _startIdleSpan(startSpanOptions); - span.end = new Proxy(span.end, { - apply(target2, thisArg, args) { - if (beforeSpanEnd) { - beforeSpanEnd(span); - } - const [definedEndTimestamp, ...rest] = args; - const timestamp2 = definedEndTimestamp || timestampInSeconds(); - const spanEndTimestamp = spanTimeInputToSeconds(timestamp2); - const spans = getSpanDescendants(span).filter((child) => child !== span); - if (!spans.length) { - onIdleSpanEnded(spanEndTimestamp); - return Reflect.apply(target2, thisArg, [spanEndTimestamp, ...rest]); - } - const childEndTimestamps = spans.map((span2) => spanToJSON(span2).timestamp).filter((timestamp3) => !!timestamp3); - const latestSpanEndTimestamp = childEndTimestamps.length ? Math.max(...childEndTimestamps) : void 0; - const spanStartTimestamp = spanToJSON(span).start_timestamp; - const endTimestamp = Math.min( - spanStartTimestamp ? spanStartTimestamp + finalTimeout / 1e3 : Infinity, - Math.max(spanStartTimestamp || -Infinity, Math.min(spanEndTimestamp, latestSpanEndTimestamp || Infinity)) - ); - onIdleSpanEnded(endTimestamp); - return Reflect.apply(target2, thisArg, [endTimestamp, ...rest]); - } - }); - function _cancelIdleTimeout() { - if (_idleTimeoutID) { - clearTimeout(_idleTimeoutID); - _idleTimeoutID = void 0; - } - } - __name(_cancelIdleTimeout, "_cancelIdleTimeout"); - function _restartIdleTimeout(endTimestamp) { - _cancelIdleTimeout(); - _idleTimeoutID = setTimeout(() => { - if (!_finished && activities.size === 0 && _autoFinishAllowed) { - _finishReason = FINISH_REASON_IDLE_TIMEOUT; - span.end(endTimestamp); - } - }, idleTimeout); - } - __name(_restartIdleTimeout, "_restartIdleTimeout"); - function _restartChildSpanTimeout(endTimestamp) { - _idleTimeoutID = setTimeout(() => { - if (!_finished && _autoFinishAllowed) { - _finishReason = FINISH_REASON_HEARTBEAT_FAILED; - span.end(endTimestamp); - } - }, childSpanTimeout); - } - __name(_restartChildSpanTimeout, "_restartChildSpanTimeout"); - function _pushActivity(spanId) { - _cancelIdleTimeout(); - activities.set(spanId, true); - const endTimestamp = timestampInSeconds(); - _restartChildSpanTimeout(endTimestamp + childSpanTimeout / 1e3); - } - __name(_pushActivity, "_pushActivity"); - function _popActivity(spanId) { - if (activities.has(spanId)) { - activities.delete(spanId); - } - if (activities.size === 0) { - const endTimestamp = timestampInSeconds(); - _restartIdleTimeout(endTimestamp + idleTimeout / 1e3); - } - } - __name(_popActivity, "_popActivity"); - function onIdleSpanEnded(endTimestamp) { - _finished = true; - activities.clear(); - _cleanupHooks.forEach((cleanup) => cleanup()); - _setSpanForScope(scope, previousActiveSpan); - const spanJSON = spanToJSON(span); - const { start_timestamp: startTimestamp } = spanJSON; - if (!startTimestamp) { - return; - } - const attributes = spanJSON.data || {}; - if (!attributes[SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]) { - span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, _finishReason); - } - logger$2.log(`[Tracing] Idle span "${spanJSON.op}" finished`); - const childSpans = getSpanDescendants(span).filter((child) => child !== span); - let discardedSpans = 0; - childSpans.forEach((childSpan) => { - if (childSpan.isRecording()) { - childSpan.setStatus({ code: SPAN_STATUS_ERROR, message: "cancelled" }); - childSpan.end(endTimestamp); - DEBUG_BUILD$6 && logger$2.log("[Tracing] Cancelling span since span ended early", JSON.stringify(childSpan, void 0, 2)); - } - const childSpanJSON = spanToJSON(childSpan); - const { timestamp: childEndTimestamp = 0, start_timestamp: childStartTimestamp = 0 } = childSpanJSON; - const spanStartedBeforeIdleSpanEnd = childStartTimestamp <= endTimestamp; - const timeoutWithMarginOfError = (finalTimeout + idleTimeout) / 1e3; - const spanEndedBeforeFinalTimeout = childEndTimestamp - childStartTimestamp <= timeoutWithMarginOfError; - if (DEBUG_BUILD$6) { - const stringifiedSpan = JSON.stringify(childSpan, void 0, 2); - if (!spanStartedBeforeIdleSpanEnd) { - logger$2.log("[Tracing] Discarding span since it happened after idle span was finished", stringifiedSpan); - } else if (!spanEndedBeforeFinalTimeout) { - logger$2.log("[Tracing] Discarding span since it finished after idle span final timeout", stringifiedSpan); - } - } - if (!spanEndedBeforeFinalTimeout || !spanStartedBeforeIdleSpanEnd) { - removeChildSpanFromSpan(span, childSpan); - discardedSpans++; - } - }); - if (discardedSpans > 0) { - span.setAttribute("sentry.idle_span_discarded_spans", discardedSpans); - } - } - __name(onIdleSpanEnded, "onIdleSpanEnded"); - _cleanupHooks.push( - client.on("spanStart", (startedSpan) => { - if (_finished || startedSpan === span || !!spanToJSON(startedSpan).timestamp) { - return; - } - const allSpans = getSpanDescendants(span); - if (allSpans.includes(startedSpan)) { - _pushActivity(startedSpan.spanContext().spanId); - } - }) - ); - _cleanupHooks.push( - client.on("spanEnd", (endedSpan) => { - if (_finished) { - return; - } - _popActivity(endedSpan.spanContext().spanId); - }) - ); - _cleanupHooks.push( - client.on("idleSpanEnableAutoFinish", (spanToAllowAutoFinish) => { - if (spanToAllowAutoFinish === span) { - _autoFinishAllowed = true; - _restartIdleTimeout(); - if (activities.size) { - _restartChildSpanTimeout(); - } - } - }) - ); - if (!options4.disableAutoFinish) { - _restartIdleTimeout(); - } - setTimeout(() => { - if (!_finished) { - span.setStatus({ code: SPAN_STATUS_ERROR, message: "deadline_exceeded" }); - _finishReason = FINISH_REASON_FINAL_TIMEOUT; - span.end(); - } - }, finalTimeout); - return span; -} -__name(startIdleSpan, "startIdleSpan"); -function _startIdleSpan(options4) { - const span = startInactiveSpan(options4); - _setSpanForScope(getCurrentScope$1(), span); - DEBUG_BUILD$6 && logger$2.log("[Tracing] Started span is an idle span"); - return span; -} -__name(_startIdleSpan, "_startIdleSpan"); -function notifyEventProcessors(processors, event, hint, index2 = 0) { - return new SyncPromise((resolve2, reject3) => { - const processor = processors[index2]; - if (event === null || typeof processor !== "function") { - resolve2(event); - } else { - const result = processor({ ...event }, hint); - DEBUG_BUILD$6 && processor.id && result === null && logger$2.log(`Event processor "${processor.id}" dropped event`); - if (isThenable$1(result)) { - void result.then((final) => notifyEventProcessors(processors, final, hint, index2 + 1).then(resolve2)).then(null, reject3); - } else { - void notifyEventProcessors(processors, result, hint, index2 + 1).then(resolve2).then(null, reject3); - } - } - }); -} -__name(notifyEventProcessors, "notifyEventProcessors"); -let parsedStackResults; -let lastKeysCount; -let cachedFilenameDebugIds; -function getFilenameToDebugIdMap(stackParser) { - const debugIdMap = GLOBAL_OBJ._sentryDebugIds; - if (!debugIdMap) { - return {}; - } - const debugIdKeys = Object.keys(debugIdMap); - if (cachedFilenameDebugIds && debugIdKeys.length === lastKeysCount) { - return cachedFilenameDebugIds; - } - lastKeysCount = debugIdKeys.length; - cachedFilenameDebugIds = debugIdKeys.reduce((acc, stackKey) => { - if (!parsedStackResults) { - parsedStackResults = {}; - } - const result = parsedStackResults[stackKey]; - if (result) { - acc[result[0]] = result[1]; - } else { - const parsedStack = stackParser(stackKey); - for (let i2 = parsedStack.length - 1; i2 >= 0; i2--) { - const stackFrame = parsedStack[i2]; - const filename = stackFrame && stackFrame.filename; - const debugId = debugIdMap[stackKey]; - if (filename && debugId) { - acc[filename] = debugId; - parsedStackResults[stackKey] = [filename, debugId]; - break; - } - } - } - return acc; - }, {}); - return cachedFilenameDebugIds; -} -__name(getFilenameToDebugIdMap, "getFilenameToDebugIdMap"); -function getDebugImagesForResources(stackParser, resource_paths) { - const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser); - if (!filenameDebugIdMap) { - return []; - } - const images = []; - for (const path of resource_paths) { - if (path && filenameDebugIdMap[path]) { - images.push({ - type: "sourcemap", - code_file: path, - debug_id: filenameDebugIdMap[path] - }); - } - } - return images; -} -__name(getDebugImagesForResources, "getDebugImagesForResources"); -function applyScopeDataToEvent(event, data26) { - const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data26; - applyDataToEvent(event, data26); - if (span) { - applySpanToEvent(event, span); - } - applyFingerprintToEvent(event, fingerprint); - applyBreadcrumbsToEvent(event, breadcrumbs); - applySdkMetadataToEvent(event, sdkProcessingMetadata); -} -__name(applyScopeDataToEvent, "applyScopeDataToEvent"); -function mergeScopeData(data26, mergeData) { - const { - extra, - tags, - user, - contexts, - level, - sdkProcessingMetadata, - breadcrumbs, - fingerprint, - eventProcessors, - attachments, - propagationContext, - transactionName, - span - } = mergeData; - mergeAndOverwriteScopeData(data26, "extra", extra); - mergeAndOverwriteScopeData(data26, "tags", tags); - mergeAndOverwriteScopeData(data26, "user", user); - mergeAndOverwriteScopeData(data26, "contexts", contexts); - data26.sdkProcessingMetadata = merge$1(data26.sdkProcessingMetadata, sdkProcessingMetadata, 2); - if (level) { - data26.level = level; - } - if (transactionName) { - data26.transactionName = transactionName; - } - if (span) { - data26.span = span; - } - if (breadcrumbs.length) { - data26.breadcrumbs = [...data26.breadcrumbs, ...breadcrumbs]; - } - if (fingerprint.length) { - data26.fingerprint = [...data26.fingerprint, ...fingerprint]; - } - if (eventProcessors.length) { - data26.eventProcessors = [...data26.eventProcessors, ...eventProcessors]; - } - if (attachments.length) { - data26.attachments = [...data26.attachments, ...attachments]; - } - data26.propagationContext = { ...data26.propagationContext, ...propagationContext }; -} -__name(mergeScopeData, "mergeScopeData"); -function mergeAndOverwriteScopeData(data26, prop2, mergeVal) { - data26[prop2] = merge$1(data26[prop2], mergeVal, 1); -} -__name(mergeAndOverwriteScopeData, "mergeAndOverwriteScopeData"); -function applyDataToEvent(event, data26) { - const { extra, tags, user, contexts, level, transactionName } = data26; - const cleanedExtra = dropUndefinedKeys(extra); - if (cleanedExtra && Object.keys(cleanedExtra).length) { - event.extra = { ...cleanedExtra, ...event.extra }; - } - const cleanedTags = dropUndefinedKeys(tags); - if (cleanedTags && Object.keys(cleanedTags).length) { - event.tags = { ...cleanedTags, ...event.tags }; - } - const cleanedUser = dropUndefinedKeys(user); - if (cleanedUser && Object.keys(cleanedUser).length) { - event.user = { ...cleanedUser, ...event.user }; - } - const cleanedContexts = dropUndefinedKeys(contexts); - if (cleanedContexts && Object.keys(cleanedContexts).length) { - event.contexts = { ...cleanedContexts, ...event.contexts }; - } - if (level) { - event.level = level; - } - if (transactionName && event.type !== "transaction") { - event.transaction = transactionName; - } -} -__name(applyDataToEvent, "applyDataToEvent"); -function applyBreadcrumbsToEvent(event, breadcrumbs) { - const mergedBreadcrumbs = [...event.breadcrumbs || [], ...breadcrumbs]; - event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : void 0; -} -__name(applyBreadcrumbsToEvent, "applyBreadcrumbsToEvent"); -function applySdkMetadataToEvent(event, sdkProcessingMetadata) { - event.sdkProcessingMetadata = { - ...event.sdkProcessingMetadata, - ...sdkProcessingMetadata - }; -} -__name(applySdkMetadataToEvent, "applySdkMetadataToEvent"); -function applySpanToEvent(event, span) { - event.contexts = { - trace: spanToTraceContext(span), - ...event.contexts - }; - event.sdkProcessingMetadata = { - dynamicSamplingContext: getDynamicSamplingContextFromSpan(span), - ...event.sdkProcessingMetadata - }; - const rootSpan = getRootSpan(span); - const transactionName = spanToJSON(rootSpan).description; - if (transactionName && !event.transaction && event.type === "transaction") { - event.transaction = transactionName; - } -} -__name(applySpanToEvent, "applySpanToEvent"); -function applyFingerprintToEvent(event, fingerprint) { - event.fingerprint = event.fingerprint ? Array.isArray(event.fingerprint) ? event.fingerprint : [event.fingerprint] : []; - if (fingerprint) { - event.fingerprint = event.fingerprint.concat(fingerprint); - } - if (event.fingerprint && !event.fingerprint.length) { - delete event.fingerprint; - } -} -__name(applyFingerprintToEvent, "applyFingerprintToEvent"); -function prepareEvent(options4, event, hint, scope, client, isolationScope) { - const { normalizeDepth = 3, normalizeMaxBreadth = 1e3 } = options4; - const prepared = { - ...event, - event_id: event.event_id || hint.event_id || uuid4(), - timestamp: event.timestamp || dateTimestampInSeconds() - }; - const integrations = hint.integrations || options4.integrations.map((i2) => i2.name); - applyClientOptions(prepared, options4); - applyIntegrationsMetadata(prepared, integrations); - if (client) { - client.emit("applyFrameMetadata", event); - } - if (event.type === void 0) { - applyDebugIds(prepared, options4.stackParser); - } - const finalScope = getFinalScope(scope, hint.captureContext); - if (hint.mechanism) { - addExceptionMechanism(prepared, hint.mechanism); - } - const clientEventProcessors = client ? client.getEventProcessors() : []; - const data26 = getGlobalScope().getScopeData(); - if (isolationScope) { - const isolationData = isolationScope.getScopeData(); - mergeScopeData(data26, isolationData); - } - if (finalScope) { - const finalScopeData = finalScope.getScopeData(); - mergeScopeData(data26, finalScopeData); - } - const attachments = [...hint.attachments || [], ...data26.attachments]; - if (attachments.length) { - hint.attachments = attachments; - } - applyScopeDataToEvent(prepared, data26); - const eventProcessors = [ - ...clientEventProcessors, - // Run scope event processors _after_ all other processors - ...data26.eventProcessors - ]; - const result = notifyEventProcessors(eventProcessors, prepared, hint); - return result.then((evt) => { - if (evt) { - applyDebugMeta(evt); - } - if (typeof normalizeDepth === "number" && normalizeDepth > 0) { - return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); - } - return evt; - }); -} -__name(prepareEvent, "prepareEvent"); -function applyClientOptions(event, options4) { - const { environment, release, dist: dist3, maxValueLength = 250 } = options4; - event.environment = event.environment || environment || DEFAULT_ENVIRONMENT; - if (!event.release && release) { - event.release = release; - } - if (!event.dist && dist3) { - event.dist = dist3; - } - if (event.message) { - event.message = truncate(event.message, maxValueLength); - } - const exception = event.exception && event.exception.values && event.exception.values[0]; - if (exception && exception.value) { - exception.value = truncate(exception.value, maxValueLength); - } - const request = event.request; - if (request && request.url) { - request.url = truncate(request.url, maxValueLength); - } -} -__name(applyClientOptions, "applyClientOptions"); -function applyDebugIds(event, stackParser) { - const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser); - try { - event.exception.values.forEach((exception) => { - exception.stacktrace.frames.forEach((frame) => { - if (filenameDebugIdMap && frame.filename) { - frame.debug_id = filenameDebugIdMap[frame.filename]; - } - }); - }); - } catch (e2) { - } -} -__name(applyDebugIds, "applyDebugIds"); -function applyDebugMeta(event) { - const filenameDebugIdMap = {}; - try { - event.exception.values.forEach((exception) => { - exception.stacktrace.frames.forEach((frame) => { - if (frame.debug_id) { - if (frame.abs_path) { - filenameDebugIdMap[frame.abs_path] = frame.debug_id; - } else if (frame.filename) { - filenameDebugIdMap[frame.filename] = frame.debug_id; - } - delete frame.debug_id; - } - }); - }); - } catch (e2) { - } - if (Object.keys(filenameDebugIdMap).length === 0) { - return; - } - event.debug_meta = event.debug_meta || {}; - event.debug_meta.images = event.debug_meta.images || []; - const images = event.debug_meta.images; - Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => { - images.push({ - type: "sourcemap", - code_file: filename, - debug_id - }); - }); -} -__name(applyDebugMeta, "applyDebugMeta"); -function applyIntegrationsMetadata(event, integrationNames) { - if (integrationNames.length > 0) { - event.sdk = event.sdk || {}; - event.sdk.integrations = [...event.sdk.integrations || [], ...integrationNames]; - } -} -__name(applyIntegrationsMetadata, "applyIntegrationsMetadata"); -function normalizeEvent(event, depth, maxBreadth) { - if (!event) { - return null; - } - const normalized = { - ...event, - ...event.breadcrumbs && { - breadcrumbs: event.breadcrumbs.map((b2) => ({ - ...b2, - ...b2.data && { - data: normalize$3(b2.data, depth, maxBreadth) - } - })) - }, - ...event.user && { - user: normalize$3(event.user, depth, maxBreadth) - }, - ...event.contexts && { - contexts: normalize$3(event.contexts, depth, maxBreadth) - }, - ...event.extra && { - extra: normalize$3(event.extra, depth, maxBreadth) - } - }; - if (event.contexts && event.contexts.trace && normalized.contexts) { - normalized.contexts.trace = event.contexts.trace; - if (event.contexts.trace.data) { - normalized.contexts.trace.data = normalize$3(event.contexts.trace.data, depth, maxBreadth); - } - } - if (event.spans) { - normalized.spans = event.spans.map((span) => { - return { - ...span, - ...span.data && { - data: normalize$3(span.data, depth, maxBreadth) - } - }; - }); - } - if (event.contexts && event.contexts.flags && normalized.contexts) { - normalized.contexts.flags = normalize$3(event.contexts.flags, 3, maxBreadth); - } - return normalized; -} -__name(normalizeEvent, "normalizeEvent"); -function getFinalScope(scope, captureContext) { - if (!captureContext) { - return scope; - } - const finalScope = scope ? scope.clone() : new Scope(); - finalScope.update(captureContext); - return finalScope; -} -__name(getFinalScope, "getFinalScope"); -function parseEventHintOrCaptureContext(hint) { - if (!hint) { - return void 0; - } - if (hintIsScopeOrFunction(hint)) { - return { captureContext: hint }; - } - if (hintIsScopeContext(hint)) { - return { - captureContext: hint - }; - } - return hint; -} -__name(parseEventHintOrCaptureContext, "parseEventHintOrCaptureContext"); -function hintIsScopeOrFunction(hint) { - return hint instanceof Scope || typeof hint === "function"; -} -__name(hintIsScopeOrFunction, "hintIsScopeOrFunction"); -const captureContextKeys = [ - "user", - "level", - "extra", - "contexts", - "tags", - "fingerprint", - "requestSession", - "propagationContext" -]; -function hintIsScopeContext(hint) { - return Object.keys(hint).some((key) => captureContextKeys.includes(key)); -} -__name(hintIsScopeContext, "hintIsScopeContext"); -function captureException(exception, hint) { - return getCurrentScope$1().captureException(exception, parseEventHintOrCaptureContext(hint)); -} -__name(captureException, "captureException"); -function captureMessage(message3, captureContext) { - const level = typeof captureContext === "string" ? captureContext : void 0; - const context = typeof captureContext !== "string" ? { captureContext } : void 0; - return getCurrentScope$1().captureMessage(message3, level, context); -} -__name(captureMessage, "captureMessage"); -function captureEvent(event, hint) { - return getCurrentScope$1().captureEvent(event, hint); -} -__name(captureEvent, "captureEvent"); -function setContext(name2, context) { - getIsolationScope().setContext(name2, context); -} -__name(setContext, "setContext"); -function setExtras(extras) { - getIsolationScope().setExtras(extras); -} -__name(setExtras, "setExtras"); -function setExtra(key, extra) { - getIsolationScope().setExtra(key, extra); -} -__name(setExtra, "setExtra"); -function setTags(tags) { - getIsolationScope().setTags(tags); -} -__name(setTags, "setTags"); -function setTag$5(key, value4) { - getIsolationScope().setTag(key, value4); -} -__name(setTag$5, "setTag$5"); -function setUser(user) { - getIsolationScope().setUser(user); -} -__name(setUser, "setUser"); -function lastEventId() { - return getIsolationScope().lastEventId(); -} -__name(lastEventId, "lastEventId"); -function captureCheckIn(checkIn, upsertMonitorConfig) { - const scope = getCurrentScope$1(); - const client = getClient(); - if (!client) { - DEBUG_BUILD$6 && logger$2.warn("Cannot capture check-in. No client defined."); - } else if (!client.captureCheckIn) { - DEBUG_BUILD$6 && logger$2.warn("Cannot capture check-in. Client does not support sending check-ins."); - } else { - return client.captureCheckIn(checkIn, upsertMonitorConfig, scope); - } - return uuid4(); -} -__name(captureCheckIn, "captureCheckIn"); -function withMonitor(monitorSlug, callback, upsertMonitorConfig) { - const checkInId = captureCheckIn({ monitorSlug, status: "in_progress" }, upsertMonitorConfig); - const now2 = timestampInSeconds(); - function finishCheckIn(status) { - captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now2 }); - } - __name(finishCheckIn, "finishCheckIn"); - return withIsolationScope(() => { - let maybePromiseResult; - try { - maybePromiseResult = callback(); - } catch (e2) { - finishCheckIn("error"); - throw e2; - } - if (isThenable$1(maybePromiseResult)) { - Promise.resolve(maybePromiseResult).then( - () => { - finishCheckIn("ok"); - }, - (e2) => { - finishCheckIn("error"); - throw e2; - } - ); - } else { - finishCheckIn("ok"); - } - return maybePromiseResult; - }); -} -__name(withMonitor, "withMonitor"); -async function flush(timeout) { - const client = getClient(); - if (client) { - return client.flush(timeout); - } - DEBUG_BUILD$6 && logger$2.warn("Cannot flush events. No client defined."); - return Promise.resolve(false); -} -__name(flush, "flush"); -async function close$1(timeout) { - const client = getClient(); - if (client) { - return client.close(timeout); - } - DEBUG_BUILD$6 && logger$2.warn("Cannot flush events and disable SDK. No client defined."); - return Promise.resolve(false); -} -__name(close$1, "close$1"); -function isInitialized$1() { - return !!getClient(); -} -__name(isInitialized$1, "isInitialized$1"); -function isEnabled() { - const client = getClient(); - return !!client && client.getOptions().enabled !== false && !!client.getTransport(); -} -__name(isEnabled, "isEnabled"); -function addEventProcessor(callback) { - getIsolationScope().addEventProcessor(callback); -} -__name(addEventProcessor, "addEventProcessor"); -function startSession(context) { - const client = getClient(); - const isolationScope = getIsolationScope(); - const currentScope = getCurrentScope$1(); - const { release, environment = DEFAULT_ENVIRONMENT } = client && client.getOptions() || {}; - const { userAgent } = GLOBAL_OBJ.navigator || {}; - const session = makeSession$1({ - release, - environment, - user: currentScope.getUser() || isolationScope.getUser(), - ...userAgent && { userAgent }, - ...context - }); - const currentSession = isolationScope.getSession(); - if (currentSession && currentSession.status === "ok") { - updateSession(currentSession, { status: "exited" }); - } - endSession(); - isolationScope.setSession(session); - currentScope.setSession(session); - return session; -} -__name(startSession, "startSession"); -function endSession() { - const isolationScope = getIsolationScope(); - const currentScope = getCurrentScope$1(); - const session = currentScope.getSession() || isolationScope.getSession(); - if (session) { - closeSession(session); - } - _sendSessionUpdate$1(); - isolationScope.setSession(); - currentScope.setSession(); -} -__name(endSession, "endSession"); -function _sendSessionUpdate$1() { - const isolationScope = getIsolationScope(); - const currentScope = getCurrentScope$1(); - const client = getClient(); - const session = currentScope.getSession() || isolationScope.getSession(); - if (session && client) { - client.captureSession(session); - } -} -__name(_sendSessionUpdate$1, "_sendSessionUpdate$1"); -function captureSession(end = false) { - if (end) { - endSession(); - return; - } - _sendSessionUpdate$1(); -} -__name(captureSession, "captureSession"); -class SessionFlusher { - static { - __name(this, "SessionFlusher"); - } - // We adjust the type here to add the `unref()` part, as setInterval can technically return a number or a NodeJS.Timer - constructor(client, attrs6) { - this._client = client; - this.flushTimeout = 60; - this._pendingAggregates = /* @__PURE__ */ new Map(); - this._isEnabled = true; - this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1e3); - if (this._intervalId.unref) { - this._intervalId.unref(); - } - this._sessionAttrs = attrs6; - } - /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */ - flush() { - const sessionAggregates = this.getSessionAggregates(); - if (sessionAggregates.aggregates.length === 0) { - return; - } - this._pendingAggregates = /* @__PURE__ */ new Map(); - this._client.sendSession(sessionAggregates); - } - /** Massages the entries in `pendingAggregates` and returns aggregated sessions */ - getSessionAggregates() { - const aggregates = Array.from(this._pendingAggregates.values()); - const sessionAggregates = { - attrs: this._sessionAttrs, - aggregates - }; - return dropUndefinedKeys(sessionAggregates); - } - /** JSDoc */ - close() { - clearInterval(this._intervalId); - this._isEnabled = false; - this.flush(); - } - /** - * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then - * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to - * `_incrementSessionStatusCount` along with the start date - */ - incrementSessionStatusCount() { - if (!this._isEnabled) { - return; - } - const isolationScope = getIsolationScope(); - const requestSession = isolationScope.getRequestSession(); - if (requestSession && requestSession.status) { - this._incrementSessionStatusCount(requestSession.status, /* @__PURE__ */ new Date()); - isolationScope.setRequestSession(void 0); - } - } - /** - * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of - * the session received - */ - // eslint-disable-next-line deprecation/deprecation - _incrementSessionStatusCount(status, date) { - const sessionStartedTrunc = new Date(date).setSeconds(0, 0); - let aggregationCounts = this._pendingAggregates.get(sessionStartedTrunc); - if (!aggregationCounts) { - aggregationCounts = { started: new Date(sessionStartedTrunc).toISOString() }; - this._pendingAggregates.set(sessionStartedTrunc, aggregationCounts); - } - switch (status) { - case "errored": - aggregationCounts.errored = (aggregationCounts.errored || 0) + 1; - return aggregationCounts.errored; - case "ok": - aggregationCounts.exited = (aggregationCounts.exited || 0) + 1; - return aggregationCounts.exited; - default: - aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1; - return aggregationCounts.crashed; - } - } -} -const SENTRY_API_VERSION = "7"; -function getBaseApiEndpoint(dsn) { - const protocol = dsn.protocol ? `${dsn.protocol}:` : ""; - const port = dsn.port ? `:${dsn.port}` : ""; - return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ""}/api/`; -} -__name(getBaseApiEndpoint, "getBaseApiEndpoint"); -function _getIngestEndpoint(dsn) { - return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`; -} -__name(_getIngestEndpoint, "_getIngestEndpoint"); -function _encodedAuth(dsn, sdkInfo) { - const params = { - sentry_version: SENTRY_API_VERSION - }; - if (dsn.publicKey) { - params.sentry_key = dsn.publicKey; - } - if (sdkInfo) { - params.sentry_client = `${sdkInfo.name}/${sdkInfo.version}`; - } - return new URLSearchParams(params).toString(); -} -__name(_encodedAuth, "_encodedAuth"); -function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) { - return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`; -} -__name(getEnvelopeEndpointWithUrlEncodedAuth, "getEnvelopeEndpointWithUrlEncodedAuth"); -function getReportDialogEndpoint(dsnLike, dialogOptions) { - const dsn = makeDsn(dsnLike); - if (!dsn) { - return ""; - } - const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`; - let encodedOptions = `dsn=${dsnToString(dsn)}`; - for (const key in dialogOptions) { - if (key === "dsn") { - continue; - } - if (key === "onClose") { - continue; - } - if (key === "user") { - const user = dialogOptions.user; - if (!user) { - continue; - } - if (user.name) { - encodedOptions += `&name=${encodeURIComponent(user.name)}`; - } - if (user.email) { - encodedOptions += `&email=${encodeURIComponent(user.email)}`; - } - } else { - encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key])}`; - } - } - return `${endpoint}?${encodedOptions}`; -} -__name(getReportDialogEndpoint, "getReportDialogEndpoint"); -const installedIntegrations = []; -function filterDuplicates(integrations) { - const integrationsByName = {}; - integrations.forEach((currentInstance2) => { - const { name: name2 } = currentInstance2; - const existingInstance = integrationsByName[name2]; - if (existingInstance && !existingInstance.isDefaultInstance && currentInstance2.isDefaultInstance) { - return; - } - integrationsByName[name2] = currentInstance2; - }); - return Object.values(integrationsByName); -} -__name(filterDuplicates, "filterDuplicates"); -function getIntegrationsToSetup(options4) { - const defaultIntegrations = options4.defaultIntegrations || []; - const userIntegrations = options4.integrations; - defaultIntegrations.forEach((integration) => { - integration.isDefaultInstance = true; - }); - let integrations; - if (Array.isArray(userIntegrations)) { - integrations = [...defaultIntegrations, ...userIntegrations]; - } else if (typeof userIntegrations === "function") { - const resolvedUserIntegrations = userIntegrations(defaultIntegrations); - integrations = Array.isArray(resolvedUserIntegrations) ? resolvedUserIntegrations : [resolvedUserIntegrations]; - } else { - integrations = defaultIntegrations; - } - const finalIntegrations = filterDuplicates(integrations); - const debugIndex = finalIntegrations.findIndex((integration) => integration.name === "Debug"); - if (debugIndex > -1) { - const [debugInstance] = finalIntegrations.splice(debugIndex, 1); - finalIntegrations.push(debugInstance); - } - return finalIntegrations; -} -__name(getIntegrationsToSetup, "getIntegrationsToSetup"); -function setupIntegrations(client, integrations) { - const integrationIndex = {}; - integrations.forEach((integration) => { - if (integration) { - setupIntegration(client, integration, integrationIndex); - } - }); - return integrationIndex; -} -__name(setupIntegrations, "setupIntegrations"); -function afterSetupIntegrations(client, integrations) { - for (const integration of integrations) { - if (integration && integration.afterAllSetup) { - integration.afterAllSetup(client); - } - } -} -__name(afterSetupIntegrations, "afterSetupIntegrations"); -function setupIntegration(client, integration, integrationIndex) { - if (integrationIndex[integration.name]) { - DEBUG_BUILD$6 && logger$2.log(`Integration skipped because it was already installed: ${integration.name}`); - return; - } - integrationIndex[integration.name] = integration; - if (installedIntegrations.indexOf(integration.name) === -1 && typeof integration.setupOnce === "function") { - integration.setupOnce(); - installedIntegrations.push(integration.name); - } - if (integration.setup && typeof integration.setup === "function") { - integration.setup(client); - } - if (typeof integration.preprocessEvent === "function") { - const callback = integration.preprocessEvent.bind(integration); - client.on("preprocessEvent", (event, hint) => callback(event, hint, client)); - } - if (typeof integration.processEvent === "function") { - const callback = integration.processEvent.bind(integration); - const processor = Object.assign((event, hint) => callback(event, hint, client), { - id: integration.name - }); - client.addEventProcessor(processor); - } - DEBUG_BUILD$6 && logger$2.log(`Integration installed: ${integration.name}`); -} -__name(setupIntegration, "setupIntegration"); -function addIntegration(integration) { - const client = getClient(); - if (!client) { - DEBUG_BUILD$6 && logger$2.warn(`Cannot add integration "${integration.name}" because no SDK Client is available.`); - return; - } - client.addIntegration(integration); -} -__name(addIntegration, "addIntegration"); -function defineIntegration(fn) { - return fn; -} -__name(defineIntegration, "defineIntegration"); -function createClientReportEnvelope(discarded_events, dsn, timestamp2) { - const clientReportItem = [ - { type: "client_report" }, - { - timestamp: timestamp2 || dateTimestampInSeconds(), - discarded_events - } - ]; - return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]); -} -__name(createClientReportEnvelope, "createClientReportEnvelope"); -class SentryError extends Error { - static { - __name(this, "SentryError"); - } - constructor(message3, logLevel = "warn") { - super(message3); - this.message = message3; - this.logLevel = logLevel; - } -} -const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured."; -class BaseClient { - static { - __name(this, "BaseClient"); - } - /** Options passed to the SDK. */ - /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */ - /** Array of set up integrations. */ - /** Number of calls being processed */ - /** Holds flushable */ - // eslint-disable-next-line @typescript-eslint/ban-types - /** - * Initializes this client instance. - * - * @param options Options for the client. - */ - constructor(options4) { - this._options = options4; - this._integrations = {}; - this._numProcessing = 0; - this._outcomes = {}; - this._hooks = {}; - this._eventProcessors = []; - if (options4.dsn) { - this._dsn = makeDsn(options4.dsn); - } else { - DEBUG_BUILD$6 && logger$2.warn("No DSN provided, client will not send events."); - } - if (this._dsn) { - const url = getEnvelopeEndpointWithUrlEncodedAuth( - this._dsn, - options4.tunnel, - options4._metadata ? options4._metadata.sdk : void 0 - ); - this._transport = options4.transport({ - tunnel: this._options.tunnel, - recordDroppedEvent: this.recordDroppedEvent.bind(this), - ...options4.transportOptions, - url - }); - } - const tracingOptions = ["enableTracing", "tracesSampleRate", "tracesSampler"]; - const undefinedOption = tracingOptions.find((option3) => option3 in options4 && options4[option3] == void 0); - if (undefinedOption) { - consoleSandbox(() => { - console.warn( - `[Sentry] Deprecation warning: \`${undefinedOption}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.` - ); - }); - } - } - /** - * @inheritDoc - */ - captureException(exception, hint, scope) { - const eventId = uuid4(); - if (checkOrSetAlreadyCaught(exception)) { - DEBUG_BUILD$6 && logger$2.log(ALREADY_SEEN_ERROR); - return eventId; - } - const hintWithEventId = { - event_id: eventId, - ...hint - }; - this._process( - this.eventFromException(exception, hintWithEventId).then( - (event) => this._captureEvent(event, hintWithEventId, scope) - ) - ); - return hintWithEventId.event_id; - } - /** - * @inheritDoc - */ - captureMessage(message3, level, hint, currentScope) { - const hintWithEventId = { - event_id: uuid4(), - ...hint - }; - const eventMessage = isParameterizedString(message3) ? message3 : String(message3); - const promisedEvent = isPrimitive(message3) ? this.eventFromMessage(eventMessage, level, hintWithEventId) : this.eventFromException(message3, hintWithEventId); - this._process(promisedEvent.then((event) => this._captureEvent(event, hintWithEventId, currentScope))); - return hintWithEventId.event_id; - } - /** - * @inheritDoc - */ - captureEvent(event, hint, currentScope) { - const eventId = uuid4(); - if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) { - DEBUG_BUILD$6 && logger$2.log(ALREADY_SEEN_ERROR); - return eventId; - } - const hintWithEventId = { - event_id: eventId, - ...hint - }; - const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; - const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope; - this._process(this._captureEvent(event, hintWithEventId, capturedSpanScope || currentScope)); - return hintWithEventId.event_id; - } - /** - * @inheritDoc - */ - captureSession(session) { - if (!(typeof session.release === "string")) { - DEBUG_BUILD$6 && logger$2.warn("Discarded session because of missing or non-string release"); - } else { - this.sendSession(session); - updateSession(session, { init: false }); - } - } - /** - * @inheritDoc - */ - getDsn() { - return this._dsn; - } - /** - * @inheritDoc - */ - getOptions() { - return this._options; - } - /** - * @see SdkMetadata - * - * @return The metadata of the SDK - */ - getSdkMetadata() { - return this._options._metadata; - } - /** - * @inheritDoc - */ - getTransport() { - return this._transport; - } - /** - * @inheritDoc - */ - flush(timeout) { - const transport = this._transport; - if (transport) { - this.emit("flush"); - return this._isClientDoneProcessing(timeout).then((clientFinished) => { - return transport.flush(timeout).then((transportFlushed) => clientFinished && transportFlushed); - }); - } else { - return resolvedSyncPromise(true); - } - } - /** - * @inheritDoc - */ - close(timeout) { - return this.flush(timeout).then((result) => { - this.getOptions().enabled = false; - this.emit("close"); - return result; - }); - } - /** Get all installed event processors. */ - getEventProcessors() { - return this._eventProcessors; - } - /** @inheritDoc */ - addEventProcessor(eventProcessor) { - this._eventProcessors.push(eventProcessor); - } - /** @inheritdoc */ - init() { - if (this._isEnabled() || // Force integrations to be setup even if no DSN was set when we have - // Spotlight enabled. This is particularly important for browser as we - // don't support the `spotlight` option there and rely on the users - // adding the `spotlightBrowserIntegration()` to their integrations which - // wouldn't get initialized with the check below when there's no DSN set. - this._options.integrations.some(({ name: name2 }) => name2.startsWith("Spotlight"))) { - this._setupIntegrations(); - } - } - /** - * Gets an installed integration by its name. - * - * @returns The installed integration or `undefined` if no integration with that `name` was installed. - */ - getIntegrationByName(integrationName) { - return this._integrations[integrationName]; - } - /** - * @inheritDoc - */ - addIntegration(integration) { - const isAlreadyInstalled = this._integrations[integration.name]; - setupIntegration(this, integration, this._integrations); - if (!isAlreadyInstalled) { - afterSetupIntegrations(this, [integration]); - } - } - /** - * @inheritDoc - */ - sendEvent(event, hint = {}) { - this.emit("beforeSendEvent", event, hint); - let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel); - for (const attachment of hint.attachments || []) { - env = addItemToEnvelope(env, createAttachmentEnvelopeItem(attachment)); - } - const promise = this.sendEnvelope(env); - if (promise) { - promise.then((sendResponse) => this.emit("afterSendEvent", event, sendResponse), null); - } - } - /** - * @inheritDoc - */ - sendSession(session) { - const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel); - this.sendEnvelope(env); - } - /** - * @inheritDoc - */ - recordDroppedEvent(reason, category, eventOrCount) { - if (this._options.sendClientReports) { - const count = typeof eventOrCount === "number" ? eventOrCount : 1; - const key = `${reason}:${category}`; - DEBUG_BUILD$6 && logger$2.log(`Recording outcome: "${key}"${count > 1 ? ` (${count} times)` : ""}`); - this._outcomes[key] = (this._outcomes[key] || 0) + count; - } - } - // Keep on() & emit() signatures in sync with types' client.ts interface - /* eslint-disable @typescript-eslint/unified-signatures */ - /** @inheritdoc */ - /** @inheritdoc */ - on(hook, callback) { - const hooks2 = this._hooks[hook] = this._hooks[hook] || []; - hooks2.push(callback); - return () => { - const cbIndex = hooks2.indexOf(callback); - if (cbIndex > -1) { - hooks2.splice(cbIndex, 1); - } - }; - } - /** @inheritdoc */ - /** @inheritdoc */ - emit(hook, ...rest) { - const callbacks = this._hooks[hook]; - if (callbacks) { - callbacks.forEach((callback) => callback(...rest)); - } - } - /** - * @inheritdoc - */ - sendEnvelope(envelope) { - this.emit("beforeEnvelope", envelope); - if (this._isEnabled() && this._transport) { - return this._transport.send(envelope).then(null, (reason) => { - DEBUG_BUILD$6 && logger$2.error("Error while sending envelope:", reason); - return reason; - }); - } - DEBUG_BUILD$6 && logger$2.error("Transport disabled"); - return resolvedSyncPromise({}); - } - /* eslint-enable @typescript-eslint/unified-signatures */ - /** Setup integrations for this client. */ - _setupIntegrations() { - const { integrations } = this._options; - this._integrations = setupIntegrations(this, integrations); - afterSetupIntegrations(this, integrations); - } - /** Updates existing session based on the provided event */ - _updateSessionFromEvent(session, event) { - let crashed = event.level === "fatal"; - let errored = false; - const exceptions = event.exception && event.exception.values; - if (exceptions) { - errored = true; - for (const ex of exceptions) { - const mechanism = ex.mechanism; - if (mechanism && mechanism.handled === false) { - crashed = true; - break; - } - } - } - const sessionNonTerminal = session.status === "ok"; - const shouldUpdateAndSend = sessionNonTerminal && session.errors === 0 || sessionNonTerminal && crashed; - if (shouldUpdateAndSend) { - updateSession(session, { - ...crashed && { status: "crashed" }, - errors: session.errors || Number(errored || crashed) - }); - this.captureSession(session); - } - } - /** - * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying - * "no" (resolving to `false`) in order to give the client a chance to potentially finish first. - * - * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not - * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to - * `true`. - * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and - * `false` otherwise - */ - _isClientDoneProcessing(timeout) { - return new SyncPromise((resolve2) => { - let ticked = 0; - const tick = 1; - const interval = setInterval(() => { - if (this._numProcessing == 0) { - clearInterval(interval); - resolve2(true); - } else { - ticked += tick; - if (timeout && ticked >= timeout) { - clearInterval(interval); - resolve2(false); - } - } - }, tick); - }); - } - /** Determines whether this SDK is enabled and a transport is present. */ - _isEnabled() { - return this.getOptions().enabled !== false && this._transport !== void 0; - } - /** - * Adds common information to events. - * - * The information includes release and environment from `options`, - * breadcrumbs and context (extra, tags and user) from the scope. - * - * Information that is already present in the event is never overwritten. For - * nested objects, such as the context, keys are merged. - * - * @param event The original event. - * @param hint May contain additional information about the original exception. - * @param currentScope A scope containing event metadata. - * @returns A new event with more information. - */ - _prepareEvent(event, hint, currentScope = getCurrentScope$1(), isolationScope = getIsolationScope()) { - const options4 = this.getOptions(); - const integrations = Object.keys(this._integrations); - if (!hint.integrations && integrations.length > 0) { - hint.integrations = integrations; - } - this.emit("preprocessEvent", event, hint); - if (!event.type) { - isolationScope.setLastEventId(event.event_id || hint.event_id); - } - return prepareEvent(options4, event, hint, currentScope, this, isolationScope).then((evt) => { - if (evt === null) { - return evt; - } - evt.contexts = { - trace: getTraceContextFromScope(currentScope), - ...evt.contexts - }; - const dynamicSamplingContext = getDynamicSamplingContextFromScope(this, currentScope); - evt.sdkProcessingMetadata = { - dynamicSamplingContext, - ...evt.sdkProcessingMetadata - }; - return evt; - }); - } - /** - * Processes the event and logs an error in case of rejection - * @param event - * @param hint - * @param scope - */ - _captureEvent(event, hint = {}, scope) { - return this._processEvent(event, hint, scope).then( - (finalEvent) => { - return finalEvent.event_id; - }, - (reason) => { - if (DEBUG_BUILD$6) { - if (reason instanceof SentryError && reason.logLevel === "log") { - logger$2.log(reason.message); - } else { - logger$2.warn(reason); - } - } - return void 0; - } - ); - } - /** - * Processes an event (either error or message) and sends it to Sentry. - * - * This also adds breadcrumbs and context information to the event. However, - * platform specific meta data (such as the User's IP address) must be added - * by the SDK implementor. - * - * - * @param event The event to send to Sentry. - * @param hint May contain additional information about the original exception. - * @param currentScope A scope containing event metadata. - * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send. - */ - _processEvent(event, hint, currentScope) { - const options4 = this.getOptions(); - const { sampleRate } = options4; - const isTransaction = isTransactionEvent$1(event); - const isError2 = isErrorEvent$1(event); - const eventType = event.type || "error"; - const beforeSendLabel = `before send for type \`${eventType}\``; - const parsedSampleRate = typeof sampleRate === "undefined" ? void 0 : parseSampleRate(sampleRate); - if (isError2 && typeof parsedSampleRate === "number" && Math.random() > parsedSampleRate) { - this.recordDroppedEvent("sample_rate", "error", event); - return rejectedSyncPromise( - new SentryError( - `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`, - "log" - ) - ); - } - const dataCategory = eventType === "replay_event" ? "replay" : eventType; - const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; - const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope; - return this._prepareEvent(event, hint, currentScope, capturedSpanIsolationScope).then((prepared) => { - if (prepared === null) { - this.recordDroppedEvent("event_processor", dataCategory, event); - throw new SentryError("An event processor returned `null`, will not send event.", "log"); - } - const isInternalException = hint.data && hint.data.__sentry__ === true; - if (isInternalException) { - return prepared; - } - const result = processBeforeSend(this, options4, prepared, hint); - return _validateBeforeSendResult(result, beforeSendLabel); - }).then((processedEvent) => { - if (processedEvent === null) { - this.recordDroppedEvent("before_send", dataCategory, event); - if (isTransaction) { - const spans = event.spans || []; - const spanCount = 1 + spans.length; - this.recordDroppedEvent("before_send", "span", spanCount); - } - throw new SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, "log"); - } - const session = currentScope && currentScope.getSession(); - if (!isTransaction && session) { - this._updateSessionFromEvent(session, processedEvent); - } - if (isTransaction) { - const spanCountBefore = processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing || 0; - const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0; - const droppedSpanCount = spanCountBefore - spanCountAfter; - if (droppedSpanCount > 0) { - this.recordDroppedEvent("before_send", "span", droppedSpanCount); - } - } - const transactionInfo = processedEvent.transaction_info; - if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) { - const source = "custom"; - processedEvent.transaction_info = { - ...transactionInfo, - source - }; - } - this.sendEvent(processedEvent, hint); - return processedEvent; - }).then(null, (reason) => { - if (reason instanceof SentryError) { - throw reason; - } - this.captureException(reason, { - data: { - __sentry__: true - }, - originalException: reason - }); - throw new SentryError( - `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. -Reason: ${reason}` - ); - }); - } - /** - * Occupies the client with processing and event - */ - _process(promise) { - this._numProcessing++; - void promise.then( - (value4) => { - this._numProcessing--; - return value4; - }, - (reason) => { - this._numProcessing--; - return reason; - } - ); - } - /** - * Clears outcomes on this client and returns them. - */ - _clearOutcomes() { - const outcomes = this._outcomes; - this._outcomes = {}; - return Object.entries(outcomes).map(([key, quantity]) => { - const [reason, category] = key.split(":"); - return { - reason, - category, - quantity - }; - }); - } - /** - * Sends client reports as an envelope. - */ - _flushOutcomes() { - DEBUG_BUILD$6 && logger$2.log("Flushing outcomes..."); - const outcomes = this._clearOutcomes(); - if (outcomes.length === 0) { - DEBUG_BUILD$6 && logger$2.log("No outcomes to send"); - return; - } - if (!this._dsn) { - DEBUG_BUILD$6 && logger$2.log("No dsn provided, will not send outcomes"); - return; - } - DEBUG_BUILD$6 && logger$2.log("Sending outcomes:", outcomes); - const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn)); - this.sendEnvelope(envelope); - } - /** - * @inheritDoc - */ -} -function _validateBeforeSendResult(beforeSendResult, beforeSendLabel) { - const invalidValueError = `${beforeSendLabel} must return \`null\` or a valid event.`; - if (isThenable$1(beforeSendResult)) { - return beforeSendResult.then( - (event) => { - if (!isPlainObject$5(event) && event !== null) { - throw new SentryError(invalidValueError); - } - return event; - }, - (e2) => { - throw new SentryError(`${beforeSendLabel} rejected with ${e2}`); - } - ); - } else if (!isPlainObject$5(beforeSendResult) && beforeSendResult !== null) { - throw new SentryError(invalidValueError); - } - return beforeSendResult; -} -__name(_validateBeforeSendResult, "_validateBeforeSendResult"); -function processBeforeSend(client, options4, event, hint) { - const { beforeSend, beforeSendTransaction, beforeSendSpan } = options4; - if (isErrorEvent$1(event) && beforeSend) { - return beforeSend(event, hint); - } - if (isTransactionEvent$1(event)) { - if (event.spans && beforeSendSpan) { - const processedSpans = []; - for (const span of event.spans) { - const processedSpan = beforeSendSpan(span); - if (processedSpan) { - processedSpans.push(processedSpan); - } else { - showSpanDropWarning(); - client.recordDroppedEvent("before_send", "span"); - } - } - event.spans = processedSpans; - } - if (beforeSendTransaction) { - if (event.spans) { - const spanCountBefore = event.spans.length; - event.sdkProcessingMetadata = { - ...event.sdkProcessingMetadata, - spanCountBeforeProcessing: spanCountBefore - }; - } - return beforeSendTransaction(event, hint); - } - } - return event; -} -__name(processBeforeSend, "processBeforeSend"); -function isErrorEvent$1(event) { - return event.type === void 0; -} -__name(isErrorEvent$1, "isErrorEvent$1"); -function isTransactionEvent$1(event) { - return event.type === "transaction"; -} -__name(isTransactionEvent$1, "isTransactionEvent$1"); -function createCheckInEnvelope(checkIn, dynamicSamplingContext, metadata, tunnel, dsn) { - const headers = { - sent_at: (/* @__PURE__ */ new Date()).toISOString() - }; - if (metadata && metadata.sdk) { - headers.sdk = { - name: metadata.sdk.name, - version: metadata.sdk.version - }; - } - if (!!tunnel && !!dsn) { - headers.dsn = dsnToString(dsn); - } - if (dynamicSamplingContext) { - headers.trace = dropUndefinedKeys(dynamicSamplingContext); - } - const item3 = createCheckInEnvelopeItem(checkIn); - return createEnvelope(headers, [item3]); -} -__name(createCheckInEnvelope, "createCheckInEnvelope"); -function createCheckInEnvelopeItem(checkIn) { - const checkInHeaders = { - type: "check_in" - }; - return [checkInHeaders, checkIn]; -} -__name(createCheckInEnvelopeItem, "createCheckInEnvelopeItem"); -function parseStackFrames$1(stackParser, error2) { - return stackParser(error2.stack || "", 1); -} -__name(parseStackFrames$1, "parseStackFrames$1"); -function exceptionFromError$1(stackParser, error2) { - const exception = { - type: error2.name || error2.constructor.name, - value: error2.message - }; - const frames = parseStackFrames$1(stackParser, error2); - if (frames.length) { - exception.stacktrace = { frames }; - } - return exception; -} -__name(exceptionFromError$1, "exceptionFromError$1"); -function getErrorPropertyFromObject$1(obj) { - for (const prop2 in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop2)) { - const value4 = obj[prop2]; - if (value4 instanceof Error) { - return value4; - } - } - } - return void 0; -} -__name(getErrorPropertyFromObject$1, "getErrorPropertyFromObject$1"); -function getMessageForObject(exception) { - if ("name" in exception && typeof exception.name === "string") { - let message3 = `'${exception.name}' captured as exception`; - if ("message" in exception && typeof exception.message === "string") { - message3 += ` with message '${exception.message}'`; - } - return message3; - } else if ("message" in exception && typeof exception.message === "string") { - return exception.message; - } - const keys2 = extractExceptionKeysForMessage(exception); - if (isErrorEvent$2(exception)) { - return `Event \`ErrorEvent\` captured as exception with message \`${exception.message}\``; - } - const className = getObjectClassName$1(exception); - return `${className && className !== "Object" ? `'${className}'` : "Object"} captured as exception with keys: ${keys2}`; -} -__name(getMessageForObject, "getMessageForObject"); -function getObjectClassName$1(obj) { - try { - const prototype2 = Object.getPrototypeOf(obj); - return prototype2 ? prototype2.constructor.name : void 0; - } catch (e2) { - } -} -__name(getObjectClassName$1, "getObjectClassName$1"); -function getException(client, mechanism, exception, hint) { - if (isError(exception)) { - return [exception, void 0]; - } - mechanism.synthetic = true; - if (isPlainObject$5(exception)) { - const normalizeDepth = client && client.getOptions().normalizeDepth; - const extras = { ["__serialized__"]: normalizeToSize(exception, normalizeDepth) }; - const errorFromProp = getErrorPropertyFromObject$1(exception); - if (errorFromProp) { - return [errorFromProp, extras]; - } - const message3 = getMessageForObject(exception); - const ex2 = hint && hint.syntheticException || new Error(message3); - ex2.message = message3; - return [ex2, extras]; - } - const ex = hint && hint.syntheticException || new Error(exception); - ex.message = `${exception}`; - return [ex, void 0]; -} -__name(getException, "getException"); -function eventFromUnknownInput$1(client, stackParser, exception, hint) { - const providedMechanism = hint && hint.data && hint.data.mechanism; - const mechanism = providedMechanism || { - handled: true, - type: "generic" - }; - const [ex, extras] = getException(client, mechanism, exception, hint); - const event = { - exception: { - values: [exceptionFromError$1(stackParser, ex)] - } - }; - if (extras) { - event.extra = extras; - } - addExceptionTypeValue(event, void 0, void 0); - addExceptionMechanism(event, mechanism); - return { - ...event, - event_id: hint && hint.event_id - }; -} -__name(eventFromUnknownInput$1, "eventFromUnknownInput$1"); -function eventFromMessage$1(stackParser, message3, level = "info", hint, attachStacktrace) { - const event = { - event_id: hint && hint.event_id, - level - }; - if (attachStacktrace && hint && hint.syntheticException) { - const frames = parseStackFrames$1(stackParser, hint.syntheticException); - if (frames.length) { - event.exception = { - values: [ - { - value: message3, - stacktrace: { frames } - } - ] - }; - addExceptionMechanism(event, { synthetic: true }); - } - } - if (isParameterizedString(message3)) { - const { __sentry_template_string__, __sentry_template_values__ } = message3; - event.logentry = { - message: __sentry_template_string__, - params: __sentry_template_values__ - }; - return event; - } - event.message = message3; - return event; -} -__name(eventFromMessage$1, "eventFromMessage$1"); -class ServerRuntimeClient extends BaseClient { - static { - __name(this, "ServerRuntimeClient"); - } - // eslint-disable-next-line deprecation/deprecation - /** - * Creates a new Edge SDK instance. - * @param options Configuration options for this SDK. - */ - constructor(options4) { - registerSpanErrorInstrumentation(); - super(options4); - } - /** - * @inheritDoc - */ - eventFromException(exception, hint) { - const event = eventFromUnknownInput$1(this, this._options.stackParser, exception, hint); - event.level = "error"; - return resolvedSyncPromise(event); - } - /** - * @inheritDoc - */ - eventFromMessage(message3, level = "info", hint) { - return resolvedSyncPromise( - eventFromMessage$1(this._options.stackParser, message3, level, hint, this._options.attachStacktrace) - ); - } - /** - * @inheritDoc - */ - captureException(exception, hint, scope) { - if (this._options.autoSessionTracking && this._sessionFlusher) { - const requestSession = getIsolationScope().getRequestSession(); - if (requestSession && requestSession.status === "ok") { - requestSession.status = "errored"; - } - } - return super.captureException(exception, hint, scope); - } - /** - * @inheritDoc - */ - captureEvent(event, hint, scope) { - if (this._options.autoSessionTracking && this._sessionFlusher) { - const eventType = event.type || "exception"; - const isException = eventType === "exception" && event.exception && event.exception.values && event.exception.values.length > 0; - if (isException) { - const requestSession = getIsolationScope().getRequestSession(); - if (requestSession && requestSession.status === "ok") { - requestSession.status = "errored"; - } - } - } - return super.captureEvent(event, hint, scope); - } - /** - * - * @inheritdoc - */ - close(timeout) { - if (this._sessionFlusher) { - this._sessionFlusher.close(); - } - return super.close(timeout); - } - /** - * Initializes an instance of SessionFlusher on the client which will aggregate and periodically flush session data. - * - * NOTICE: This method will implicitly create an interval that is periodically called. - * To clean up this resources, call `.close()` when you no longer intend to use the client. - * Not doing so will result in a memory leak. - */ - initSessionFlusher() { - const { release, environment } = this._options; - if (!release) { - DEBUG_BUILD$6 && logger$2.warn("Cannot initialize an instance of SessionFlusher if no release is provided!"); - } else { - this._sessionFlusher = new SessionFlusher(this, { - release, - environment - }); - } - } - /** - * Create a cron monitor check in and send it to Sentry. - * - * @param checkIn An object that describes a check in. - * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want - * to create a monitor automatically when sending a check in. - */ - captureCheckIn(checkIn, monitorConfig, scope) { - const id3 = "checkInId" in checkIn && checkIn.checkInId ? checkIn.checkInId : uuid4(); - if (!this._isEnabled()) { - DEBUG_BUILD$6 && logger$2.warn("SDK not enabled, will not capture checkin."); - return id3; - } - const options4 = this.getOptions(); - const { release, environment, tunnel } = options4; - const serializedCheckIn = { - check_in_id: id3, - monitor_slug: checkIn.monitorSlug, - status: checkIn.status, - release, - environment - }; - if ("duration" in checkIn) { - serializedCheckIn.duration = checkIn.duration; - } - if (monitorConfig) { - serializedCheckIn.monitor_config = { - schedule: monitorConfig.schedule, - checkin_margin: monitorConfig.checkinMargin, - max_runtime: monitorConfig.maxRuntime, - timezone: monitorConfig.timezone, - failure_issue_threshold: monitorConfig.failureIssueThreshold, - recovery_threshold: monitorConfig.recoveryThreshold - }; - } - const [dynamicSamplingContext, traceContext] = this._getTraceInfoFromScope(scope); - if (traceContext) { - serializedCheckIn.contexts = { - trace: traceContext - }; - } - const envelope = createCheckInEnvelope( - serializedCheckIn, - dynamicSamplingContext, - this.getSdkMetadata(), - tunnel, - this.getDsn() - ); - DEBUG_BUILD$6 && logger$2.info("Sending checkin:", checkIn.monitorSlug, checkIn.status); - this.sendEnvelope(envelope); - return id3; - } - /** - * Method responsible for capturing/ending a request session by calling `incrementSessionStatusCount` to increment - * appropriate session aggregates bucket - * - * @deprecated This method should not be used or extended. It's functionality will move into the `httpIntegration` and not be part of any public API. - */ - _captureRequestSession() { - if (!this._sessionFlusher) { - DEBUG_BUILD$6 && logger$2.warn("Discarded request mode session because autoSessionTracking option was disabled"); - } else { - this._sessionFlusher.incrementSessionStatusCount(); - } - } - /** - * @inheritDoc - */ - _prepareEvent(event, hint, scope, isolationScope) { - if (this._options.platform) { - event.platform = event.platform || this._options.platform; - } - if (this._options.runtime) { - event.contexts = { - ...event.contexts, - runtime: (event.contexts || {}).runtime || this._options.runtime - }; - } - if (this._options.serverName) { - event.server_name = event.server_name || this._options.serverName; - } - return super._prepareEvent(event, hint, scope, isolationScope); - } - /** Extract trace information from scope */ - _getTraceInfoFromScope(scope) { - if (!scope) { - return [void 0, void 0]; - } - const span = _getSpanForScope(scope); - const traceContext = span ? spanToTraceContext(span) : getTraceContextFromScope(scope); - const dynamicSamplingContext = span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromScope(this, scope); - return [dynamicSamplingContext, traceContext]; - } -} -function initAndBind(clientClass, options4) { - if (options4.debug === true) { - if (DEBUG_BUILD$6) { - logger$2.enable(); - } else { - consoleSandbox(() => { - console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."); - }); - } - } - const scope = getCurrentScope$1(); - scope.update(options4.initialScope); - const client = new clientClass(options4); - setCurrentClient(client); - client.init(); - return client; -} -__name(initAndBind, "initAndBind"); -function setCurrentClient(client) { - getCurrentScope$1().setClient(client); -} -__name(setCurrentClient, "setCurrentClient"); -function makePromiseBuffer(limit) { - const buffer2 = []; - function isReady() { - return limit === void 0 || buffer2.length < limit; - } - __name(isReady, "isReady"); - function remove4(task) { - return buffer2.splice(buffer2.indexOf(task), 1)[0] || Promise.resolve(void 0); - } - __name(remove4, "remove"); - function add4(taskProducer) { - if (!isReady()) { - return rejectedSyncPromise(new SentryError("Not adding Promise because buffer limit was reached.")); - } - const task = taskProducer(); - if (buffer2.indexOf(task) === -1) { - buffer2.push(task); - } - void task.then(() => remove4(task)).then( - null, - () => remove4(task).then(null, () => { - }) - ); - return task; - } - __name(add4, "add"); - function drain(timeout) { - return new SyncPromise((resolve2, reject3) => { - let counter = buffer2.length; - if (!counter) { - return resolve2(true); - } - const capturedSetTimeout = setTimeout(() => { - if (timeout && timeout > 0) { - resolve2(false); - } - }, timeout); - buffer2.forEach((item3) => { - void resolvedSyncPromise(item3).then(() => { - if (!--counter) { - clearTimeout(capturedSetTimeout); - resolve2(true); - } - }, reject3); - }); - }); - } - __name(drain, "drain"); - return { - $: buffer2, - add: add4, - drain - }; -} -__name(makePromiseBuffer, "makePromiseBuffer"); -const DEFAULT_RETRY_AFTER = 60 * 1e3; -function parseRetryAfterHeader(header3, now2 = Date.now()) { - const headerDelay = parseInt(`${header3}`, 10); - if (!isNaN(headerDelay)) { - return headerDelay * 1e3; - } - const headerDate = Date.parse(`${header3}`); - if (!isNaN(headerDate)) { - return headerDate - now2; - } - return DEFAULT_RETRY_AFTER; -} -__name(parseRetryAfterHeader, "parseRetryAfterHeader"); -function disabledUntil(limits, dataCategory) { - return limits[dataCategory] || limits.all || 0; -} -__name(disabledUntil, "disabledUntil"); -function isRateLimited(limits, dataCategory, now2 = Date.now()) { - return disabledUntil(limits, dataCategory) > now2; -} -__name(isRateLimited, "isRateLimited"); -function updateRateLimits(limits, { statusCode, headers }, now2 = Date.now()) { - const updatedRateLimits = { - ...limits - }; - const rateLimitHeader = headers && headers["x-sentry-rate-limits"]; - const retryAfterHeader = headers && headers["retry-after"]; - if (rateLimitHeader) { - for (const limit of rateLimitHeader.trim().split(",")) { - const [retryAfter, categories, , , namespaces] = limit.split(":", 5); - const headerDelay = parseInt(retryAfter, 10); - const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1e3; - if (!categories) { - updatedRateLimits.all = now2 + delay; - } else { - for (const category of categories.split(";")) { - if (category === "metric_bucket") { - if (!namespaces || namespaces.split(";").includes("custom")) { - updatedRateLimits[category] = now2 + delay; - } - } else { - updatedRateLimits[category] = now2 + delay; - } - } - } - } - } else if (retryAfterHeader) { - updatedRateLimits.all = now2 + parseRetryAfterHeader(retryAfterHeader, now2); - } else if (statusCode === 429) { - updatedRateLimits.all = now2 + 60 * 1e3; - } - return updatedRateLimits; -} -__name(updateRateLimits, "updateRateLimits"); -const DEFAULT_TRANSPORT_BUFFER_SIZE = 64; -function createTransport(options4, makeRequest, buffer2 = makePromiseBuffer( - options4.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE -)) { - let rateLimits = {}; - const flush2 = /* @__PURE__ */ __name((timeout) => buffer2.drain(timeout), "flush"); - function send(envelope) { - const filteredEnvelopeItems = []; - forEachEnvelopeItem(envelope, (item3, type) => { - const dataCategory = envelopeItemTypeToDataCategory(type); - if (isRateLimited(rateLimits, dataCategory)) { - const event = getEventForEnvelopeItem(item3, type); - options4.recordDroppedEvent("ratelimit_backoff", dataCategory, event); - } else { - filteredEnvelopeItems.push(item3); - } - }); - if (filteredEnvelopeItems.length === 0) { - return resolvedSyncPromise({}); - } - const filteredEnvelope = createEnvelope(envelope[0], filteredEnvelopeItems); - const recordEnvelopeLoss = /* @__PURE__ */ __name((reason) => { - forEachEnvelopeItem(filteredEnvelope, (item3, type) => { - const event = getEventForEnvelopeItem(item3, type); - options4.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event); - }); - }, "recordEnvelopeLoss"); - const requestTask = /* @__PURE__ */ __name(() => makeRequest({ body: serializeEnvelope(filteredEnvelope) }).then( - (response) => { - if (response.statusCode !== void 0 && (response.statusCode < 200 || response.statusCode >= 300)) { - DEBUG_BUILD$6 && logger$2.warn(`Sentry responded with status code ${response.statusCode} to sent event.`); - } - rateLimits = updateRateLimits(rateLimits, response); - return response; - }, - (error2) => { - recordEnvelopeLoss("network_error"); - throw error2; - } - ), "requestTask"); - return buffer2.add(requestTask).then( - (result) => result, - (error2) => { - if (error2 instanceof SentryError) { - DEBUG_BUILD$6 && logger$2.error("Skipped sending event because buffer is full."); - recordEnvelopeLoss("queue_overflow"); - return resolvedSyncPromise({}); - } else { - throw error2; - } - } - ); - } - __name(send, "send"); - return { - send, - flush: flush2 - }; -} -__name(createTransport, "createTransport"); -function getEventForEnvelopeItem(item3, type) { - if (type !== "event" && type !== "transaction") { - return void 0; - } - return Array.isArray(item3) ? item3[1] : void 0; -} -__name(getEventForEnvelopeItem, "getEventForEnvelopeItem"); -const MIN_DELAY = 100; -const START_DELAY = 5e3; -const MAX_DELAY = 36e5; -function makeOfflineTransport(createTransport2) { - function log2(...args) { - DEBUG_BUILD$6 && logger$2.info("[Offline]:", ...args); - } - __name(log2, "log"); - return (options4) => { - const transport = createTransport2(options4); - if (!options4.createStore) { - throw new Error("No `createStore` function was provided"); - } - const store = options4.createStore(options4); - let retryDelay = START_DELAY; - let flushTimer; - function shouldQueue(env, error2, retryDelay2) { - if (envelopeContainsItemType(env, ["client_report"])) { - return false; - } - if (options4.shouldStore) { - return options4.shouldStore(env, error2, retryDelay2); - } - return true; - } - __name(shouldQueue, "shouldQueue"); - function flushIn(delay) { - if (flushTimer) { - clearTimeout(flushTimer); - } - flushTimer = setTimeout(async () => { - flushTimer = void 0; - const found2 = await store.shift(); - if (found2) { - log2("Attempting to send previously queued event"); - found2[0].sent_at = (/* @__PURE__ */ new Date()).toISOString(); - void send(found2, true).catch((e2) => { - log2("Failed to retry sending", e2); - }); - } - }, delay); - if (typeof flushTimer !== "number" && flushTimer.unref) { - flushTimer.unref(); - } - } - __name(flushIn, "flushIn"); - function flushWithBackOff() { - if (flushTimer) { - return; - } - flushIn(retryDelay); - retryDelay = Math.min(retryDelay * 2, MAX_DELAY); - } - __name(flushWithBackOff, "flushWithBackOff"); - async function send(envelope, isRetry = false) { - if (!isRetry && envelopeContainsItemType(envelope, ["replay_event", "replay_recording"])) { - await store.push(envelope); - flushIn(MIN_DELAY); - return {}; - } - try { - const result = await transport.send(envelope); - let delay = MIN_DELAY; - if (result) { - if (result.headers && result.headers["retry-after"]) { - delay = parseRetryAfterHeader(result.headers["retry-after"]); - } else if (result.headers && result.headers["x-sentry-rate-limits"]) { - delay = 6e4; - } else if ((result.statusCode || 0) >= 400) { - return result; - } - } - flushIn(delay); - retryDelay = START_DELAY; - return result; - } catch (e2) { - if (await shouldQueue(envelope, e2, retryDelay)) { - if (isRetry) { - await store.unshift(envelope); - } else { - await store.push(envelope); - } - flushWithBackOff(); - log2("Error sending. Event queued.", e2); - return {}; - } else { - throw e2; - } - } - } - __name(send, "send"); - if (options4.flushAtStartup) { - flushWithBackOff(); - } - return { - send, - flush: /* @__PURE__ */ __name((timeout) => { - if (timeout === void 0) { - retryDelay = START_DELAY; - flushIn(MIN_DELAY); - } - return transport.flush(timeout); - }, "flush") - }; - }; -} -__name(makeOfflineTransport, "makeOfflineTransport"); -function eventFromEnvelope(env, types) { - let event; - forEachEnvelopeItem(env, (item3, type) => { - if (types.includes(type)) { - event = Array.isArray(item3) ? item3[1] : void 0; - } - return !!event; - }); - return event; -} -__name(eventFromEnvelope, "eventFromEnvelope"); -function makeOverrideReleaseTransport(createTransport2, release) { - return (options4) => { - const transport = createTransport2(options4); - return { - ...transport, - send: /* @__PURE__ */ __name(async (envelope) => { - const event = eventFromEnvelope(envelope, ["event", "transaction", "profile", "replay_event"]); - if (event) { - event.release = release; - } - return transport.send(envelope); - }, "send") - }; - }; -} -__name(makeOverrideReleaseTransport, "makeOverrideReleaseTransport"); -function overrideDsn(envelope, dsn) { - return createEnvelope( - dsn ? { - ...envelope[0], - dsn - } : envelope[0], - envelope[1] - ); -} -__name(overrideDsn, "overrideDsn"); -function makeMultiplexedTransport(createTransport2, matcher) { - return (options4) => { - const fallbackTransport = createTransport2(options4); - const otherTransports = /* @__PURE__ */ new Map(); - function getTransport(dsn, release) { - const key = release ? `${dsn}:${release}` : dsn; - let transport = otherTransports.get(key); - if (!transport) { - const validatedDsn = dsnFromString(dsn); - if (!validatedDsn) { - return void 0; - } - const url = getEnvelopeEndpointWithUrlEncodedAuth(validatedDsn, options4.tunnel); - transport = release ? makeOverrideReleaseTransport(createTransport2, release)({ ...options4, url }) : createTransport2({ ...options4, url }); - otherTransports.set(key, transport); - } - return [dsn, transport]; - } - __name(getTransport, "getTransport"); - async function send(envelope) { - function getEvent(types) { - const eventTypes = types && types.length ? types : ["event"]; - return eventFromEnvelope(envelope, eventTypes); - } - __name(getEvent, "getEvent"); - const transports = matcher({ envelope, getEvent }).map((result) => { - if (typeof result === "string") { - return getTransport(result, void 0); - } else { - return getTransport(result.dsn, result.release); - } - }).filter((t2) => !!t2); - const transportsWithFallback = transports.length ? transports : [["", fallbackTransport]]; - const results = await Promise.all( - transportsWithFallback.map(([dsn, transport]) => transport.send(overrideDsn(envelope, dsn))) - ); - return results[0]; - } - __name(send, "send"); - async function flush2(timeout) { - const allTransports = [...otherTransports.values(), fallbackTransport]; - const results = await Promise.all(allTransports.map((transport) => transport.flush(timeout))); - return results.every((r2) => r2); - } - __name(flush2, "flush"); - return { - send, - flush: flush2 - }; - }; -} -__name(makeMultiplexedTransport, "makeMultiplexedTransport"); -function isSentryRequestUrl(url, client) { - const dsn = client && client.getDsn(); - const tunnel = client && client.getOptions().tunnel; - return checkDsn(url, dsn) || checkTunnel(url, tunnel); -} -__name(isSentryRequestUrl, "isSentryRequestUrl"); -function checkTunnel(url, tunnel) { - if (!tunnel) { - return false; - } - return removeTrailingSlash$1(url) === removeTrailingSlash$1(tunnel); -} -__name(checkTunnel, "checkTunnel"); -function checkDsn(url, dsn) { - return dsn ? url.includes(dsn.host) : false; -} -__name(checkDsn, "checkDsn"); -function removeTrailingSlash$1(str) { - return str[str.length - 1] === "/" ? str.slice(0, -1) : str; -} -__name(removeTrailingSlash$1, "removeTrailingSlash$1"); -function parameterize(strings, ...values) { - const formatted = new String(String.raw(strings, ...values)); - formatted.__sentry_template_string__ = strings.join("\0").replace(/%/g, "%%").replace(/\0/g, "%s"); - formatted.__sentry_template_values__ = values; - return formatted; -} -__name(parameterize, "parameterize"); -function applySdkMetadata(options4, name2, names = [name2], source = "npm") { - const metadata = options4._metadata || {}; - if (!metadata.sdk) { - metadata.sdk = { - name: `sentry.javascript.${name2}`, - packages: names.map((name3) => ({ - name: `${source}:@sentry/${name3}`, - version: SDK_VERSION - })), - version: SDK_VERSION - }; - } - options4._metadata = metadata; -} -__name(applySdkMetadata, "applySdkMetadata"); -function getTraceData(options4 = {}) { - const client = getClient(); - if (!isEnabled() || !client) { - return {}; - } - const carrier = getMainCarrier(); - const acs = getAsyncContextStrategy(carrier); - if (acs.getTraceData) { - return acs.getTraceData(options4); - } - const scope = getCurrentScope$1(); - const span = options4.span || getActiveSpan(); - const sentryTrace = span ? spanToTraceHeader(span) : scopeToTraceHeader(scope); - const dsc = span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromScope(client, scope); - const baggage = dynamicSamplingContextToSentryBaggageHeader(dsc); - const isValidSentryTraceHeader = TRACEPARENT_REGEXP.test(sentryTrace); - if (!isValidSentryTraceHeader) { - logger$2.warn("Invalid sentry-trace data. Cannot generate trace data"); - return {}; - } - return { - "sentry-trace": sentryTrace, - baggage - }; -} -__name(getTraceData, "getTraceData"); -function scopeToTraceHeader(scope) { - const { traceId, sampled, spanId } = scope.getPropagationContext(); - return generateSentryTraceHeader(traceId, spanId, sampled); -} -__name(scopeToTraceHeader, "scopeToTraceHeader"); -function getTraceMetaTags() { - return Object.entries(getTraceData()).map(([key, value4]) => ``).join("\n"); -} -__name(getTraceMetaTags, "getTraceMetaTags"); -const DEFAULT_BREADCRUMBS = 100; -function addBreadcrumb(breadcrumb, hint) { - const client = getClient(); - const isolationScope = getIsolationScope(); - if (!client) return; - const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = client.getOptions(); - if (maxBreadcrumbs <= 0) return; - const timestamp2 = dateTimestampInSeconds(); - const mergedBreadcrumb = { timestamp: timestamp2, ...breadcrumb }; - const finalBreadcrumb = beforeBreadcrumb ? consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) : mergedBreadcrumb; - if (finalBreadcrumb === null) return; - if (client.emit) { - client.emit("beforeAddBreadcrumb", finalBreadcrumb, hint); - } - isolationScope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs); -} -__name(addBreadcrumb, "addBreadcrumb"); -let originalFunctionToString; -const INTEGRATION_NAME$l = "FunctionToString"; -const SETUP_CLIENTS$1 = /* @__PURE__ */ new WeakMap(); -const _functionToStringIntegration = /* @__PURE__ */ __name(() => { - return { - name: INTEGRATION_NAME$l, - setupOnce() { - originalFunctionToString = Function.prototype.toString; - try { - Function.prototype.toString = function(...args) { - const originalFunction = getOriginalFunction(this); - const context = SETUP_CLIENTS$1.has(getClient()) && originalFunction !== void 0 ? originalFunction : this; - return originalFunctionToString.apply(context, args); - }; - } catch (e2) { - } - }, - setup(client) { - SETUP_CLIENTS$1.set(client, true); - } - }; -}, "_functionToStringIntegration"); -const functionToStringIntegration = defineIntegration(_functionToStringIntegration); -const DEFAULT_IGNORE_ERRORS = [ - /^Script error\.?$/, - /^Javascript error: Script error\.? on line 0$/, - /^ResizeObserver loop completed with undelivered notifications.$/, - // The browser logs this when a ResizeObserver handler takes a bit longer. Usually this is not an actual issue though. It indicates slowness. - /^Cannot redefine property: googletag$/, - // This is thrown when google tag manager is used in combination with an ad blocker - "undefined is not an object (evaluating 'a.L')", - // Random error that happens but not actionable or noticeable to end-users. - `can't redefine non-configurable property "solana"`, - // Probably a browser extension or custom browser (Brave) throwing this error - "vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)", - // Error thrown by GTM, seemingly not affecting end-users - "Can't find variable: _AutofillCallbackHandler", - // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/ - /^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/ - // unactionable error from CEFSharp, a .NET library that embeds chromium in .NET apps -]; -const INTEGRATION_NAME$k = "InboundFilters"; -const _inboundFiltersIntegration = /* @__PURE__ */ __name((options4 = {}) => { - return { - name: INTEGRATION_NAME$k, - processEvent(event, _hint, client) { - const clientOptions = client.getOptions(); - const mergedOptions = _mergeOptions(options4, clientOptions); - return _shouldDropEvent$1(event, mergedOptions) ? null : event; - } - }; -}, "_inboundFiltersIntegration"); -const inboundFiltersIntegration = defineIntegration(_inboundFiltersIntegration); -function _mergeOptions(internalOptions = {}, clientOptions = {}) { - return { - allowUrls: [...internalOptions.allowUrls || [], ...clientOptions.allowUrls || []], - denyUrls: [...internalOptions.denyUrls || [], ...clientOptions.denyUrls || []], - ignoreErrors: [ - ...internalOptions.ignoreErrors || [], - ...clientOptions.ignoreErrors || [], - ...internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS - ], - ignoreTransactions: [...internalOptions.ignoreTransactions || [], ...clientOptions.ignoreTransactions || []], - ignoreInternal: internalOptions.ignoreInternal !== void 0 ? internalOptions.ignoreInternal : true - }; -} -__name(_mergeOptions, "_mergeOptions"); -function _shouldDropEvent$1(event, options4) { - if (options4.ignoreInternal && _isSentryError(event)) { - DEBUG_BUILD$6 && logger$2.warn(`Event dropped due to being internal Sentry Error. -Event: ${getEventDescription(event)}`); - return true; - } - if (_isIgnoredError(event, options4.ignoreErrors)) { - DEBUG_BUILD$6 && logger$2.warn( - `Event dropped due to being matched by \`ignoreErrors\` option. -Event: ${getEventDescription(event)}` - ); - return true; - } - if (_isUselessError(event)) { - DEBUG_BUILD$6 && logger$2.warn( - `Event dropped due to not having an error message, error type or stacktrace. -Event: ${getEventDescription( - event - )}` - ); - return true; - } - if (_isIgnoredTransaction(event, options4.ignoreTransactions)) { - DEBUG_BUILD$6 && logger$2.warn( - `Event dropped due to being matched by \`ignoreTransactions\` option. -Event: ${getEventDescription(event)}` - ); - return true; - } - if (_isDeniedUrl(event, options4.denyUrls)) { - DEBUG_BUILD$6 && logger$2.warn( - `Event dropped due to being matched by \`denyUrls\` option. -Event: ${getEventDescription( - event - )}. -Url: ${_getEventFilterUrl(event)}` - ); - return true; - } - if (!_isAllowedUrl(event, options4.allowUrls)) { - DEBUG_BUILD$6 && logger$2.warn( - `Event dropped due to not being matched by \`allowUrls\` option. -Event: ${getEventDescription( - event - )}. -Url: ${_getEventFilterUrl(event)}` - ); - return true; - } - return false; -} -__name(_shouldDropEvent$1, "_shouldDropEvent$1"); -function _isIgnoredError(event, ignoreErrors) { - if (event.type || !ignoreErrors || !ignoreErrors.length) { - return false; - } - return _getPossibleEventMessages(event).some((message3) => stringMatchesSomePattern(message3, ignoreErrors)); -} -__name(_isIgnoredError, "_isIgnoredError"); -function _isIgnoredTransaction(event, ignoreTransactions) { - if (event.type !== "transaction" || !ignoreTransactions || !ignoreTransactions.length) { - return false; - } - const name2 = event.transaction; - return name2 ? stringMatchesSomePattern(name2, ignoreTransactions) : false; -} -__name(_isIgnoredTransaction, "_isIgnoredTransaction"); -function _isDeniedUrl(event, denyUrls) { - if (!denyUrls || !denyUrls.length) { - return false; - } - const url = _getEventFilterUrl(event); - return !url ? false : stringMatchesSomePattern(url, denyUrls); -} -__name(_isDeniedUrl, "_isDeniedUrl"); -function _isAllowedUrl(event, allowUrls) { - if (!allowUrls || !allowUrls.length) { - return true; - } - const url = _getEventFilterUrl(event); - return !url ? true : stringMatchesSomePattern(url, allowUrls); -} -__name(_isAllowedUrl, "_isAllowedUrl"); -function _getPossibleEventMessages(event) { - const possibleMessages = []; - if (event.message) { - possibleMessages.push(event.message); - } - let lastException; - try { - lastException = event.exception.values[event.exception.values.length - 1]; - } catch (e2) { - } - if (lastException) { - if (lastException.value) { - possibleMessages.push(lastException.value); - if (lastException.type) { - possibleMessages.push(`${lastException.type}: ${lastException.value}`); - } - } - } - return possibleMessages; -} -__name(_getPossibleEventMessages, "_getPossibleEventMessages"); -function _isSentryError(event) { - try { - return event.exception.values[0].type === "SentryError"; - } catch (e2) { - } - return false; -} -__name(_isSentryError, "_isSentryError"); -function _getLastValidUrl(frames = []) { - for (let i2 = frames.length - 1; i2 >= 0; i2--) { - const frame = frames[i2]; - if (frame && frame.filename !== "" && frame.filename !== "[native code]") { - return frame.filename || null; - } - } - return null; -} -__name(_getLastValidUrl, "_getLastValidUrl"); -function _getEventFilterUrl(event) { - try { - let frames; - try { - frames = event.exception.values[0].stacktrace.frames; - } catch (e2) { - } - return frames ? _getLastValidUrl(frames) : null; - } catch (oO) { - DEBUG_BUILD$6 && logger$2.error(`Cannot extract url for event ${getEventDescription(event)}`); - return null; - } -} -__name(_getEventFilterUrl, "_getEventFilterUrl"); -function _isUselessError(event) { - if (event.type) { - return false; - } - if (!event.exception || !event.exception.values || event.exception.values.length === 0) { - return false; - } - return ( - // No top-level message - !event.message && // There are no exception values that have a stacktrace, a non-generic-Error type or value - !event.exception.values.some((value4) => value4.stacktrace || value4.type && value4.type !== "Error" || value4.value) - ); -} -__name(_isUselessError, "_isUselessError"); -function applyAggregateErrorsToEvent(exceptionFromErrorImplementation, parser, maxValueLimit = 250, key, limit, event, hint) { - if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) { - return; - } - const originalException = event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : void 0; - if (originalException) { - event.exception.values = truncateAggregateExceptions( - aggregateExceptionsFromError( - exceptionFromErrorImplementation, - parser, - limit, - hint.originalException, - key, - event.exception.values, - originalException, - 0 - ), - maxValueLimit - ); - } -} -__name(applyAggregateErrorsToEvent, "applyAggregateErrorsToEvent"); -function aggregateExceptionsFromError(exceptionFromErrorImplementation, parser, limit, error2, key, prevExceptions, exception, exceptionId) { - if (prevExceptions.length >= limit + 1) { - return prevExceptions; - } - let newExceptions = [...prevExceptions]; - if (isInstanceOf(error2[key], Error)) { - applyExceptionGroupFieldsForParentException(exception, exceptionId); - const newException = exceptionFromErrorImplementation(parser, error2[key]); - const newExceptionId = newExceptions.length; - applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId); - newExceptions = aggregateExceptionsFromError( - exceptionFromErrorImplementation, - parser, - limit, - error2[key], - key, - [newException, ...newExceptions], - newException, - newExceptionId - ); - } - if (Array.isArray(error2.errors)) { - error2.errors.forEach((childError, i2) => { - if (isInstanceOf(childError, Error)) { - applyExceptionGroupFieldsForParentException(exception, exceptionId); - const newException = exceptionFromErrorImplementation(parser, childError); - const newExceptionId = newExceptions.length; - applyExceptionGroupFieldsForChildException(newException, `errors[${i2}]`, newExceptionId, exceptionId); - newExceptions = aggregateExceptionsFromError( - exceptionFromErrorImplementation, - parser, - limit, - childError, - key, - [newException, ...newExceptions], - newException, - newExceptionId - ); - } - }); - } - return newExceptions; -} -__name(aggregateExceptionsFromError, "aggregateExceptionsFromError"); -function applyExceptionGroupFieldsForParentException(exception, exceptionId) { - exception.mechanism = exception.mechanism || { type: "generic", handled: true }; - exception.mechanism = { - ...exception.mechanism, - ...exception.type === "AggregateError" && { is_exception_group: true }, - exception_id: exceptionId - }; -} -__name(applyExceptionGroupFieldsForParentException, "applyExceptionGroupFieldsForParentException"); -function applyExceptionGroupFieldsForChildException(exception, source, exceptionId, parentId) { - exception.mechanism = exception.mechanism || { type: "generic", handled: true }; - exception.mechanism = { - ...exception.mechanism, - type: "chained", - source, - exception_id: exceptionId, - parent_id: parentId - }; -} -__name(applyExceptionGroupFieldsForChildException, "applyExceptionGroupFieldsForChildException"); -function truncateAggregateExceptions(exceptions, maxValueLength) { - return exceptions.map((exception) => { - if (exception.value) { - exception.value = truncate(exception.value, maxValueLength); - } - return exception; - }); -} -__name(truncateAggregateExceptions, "truncateAggregateExceptions"); -const DEFAULT_KEY$1 = "cause"; -const DEFAULT_LIMIT$2 = 5; -const INTEGRATION_NAME$j = "LinkedErrors"; -const _linkedErrorsIntegration$1 = /* @__PURE__ */ __name((options4 = {}) => { - const limit = options4.limit || DEFAULT_LIMIT$2; - const key = options4.key || DEFAULT_KEY$1; - return { - name: INTEGRATION_NAME$j, - preprocessEvent(event, hint, client) { - const options5 = client.getOptions(); - applyAggregateErrorsToEvent( - exceptionFromError$1, - options5.stackParser, - options5.maxValueLength, - key, - limit, - event, - hint - ); - } - }; -}, "_linkedErrorsIntegration$1"); -const linkedErrorsIntegration$1 = defineIntegration(_linkedErrorsIntegration$1); -const filenameMetadataMap = /* @__PURE__ */ new Map(); -const parsedStacks = /* @__PURE__ */ new Set(); -function ensureMetadataStacksAreParsed(parser) { - if (!GLOBAL_OBJ._sentryModuleMetadata) { - return; - } - for (const stack2 of Object.keys(GLOBAL_OBJ._sentryModuleMetadata)) { - const metadata = GLOBAL_OBJ._sentryModuleMetadata[stack2]; - if (parsedStacks.has(stack2)) { - continue; - } - parsedStacks.add(stack2); - const frames = parser(stack2); - for (const frame of frames.reverse()) { - if (frame.filename) { - filenameMetadataMap.set(frame.filename, metadata); - break; - } - } - } -} -__name(ensureMetadataStacksAreParsed, "ensureMetadataStacksAreParsed"); -function getMetadataForUrl(parser, filename) { - ensureMetadataStacksAreParsed(parser); - return filenameMetadataMap.get(filename); -} -__name(getMetadataForUrl, "getMetadataForUrl"); -function addMetadataToStackFrames(parser, event) { - try { - event.exception.values.forEach((exception) => { - if (!exception.stacktrace) { - return; - } - for (const frame of exception.stacktrace.frames || []) { - if (!frame.filename || frame.module_metadata) { - continue; - } - const metadata = getMetadataForUrl(parser, frame.filename); - if (metadata) { - frame.module_metadata = metadata; - } - } - }); - } catch (_2) { - } -} -__name(addMetadataToStackFrames, "addMetadataToStackFrames"); -function stripMetadataFromStackFrames(event) { - try { - event.exception.values.forEach((exception) => { - if (!exception.stacktrace) { - return; - } - for (const frame of exception.stacktrace.frames || []) { - delete frame.module_metadata; - } - }); - } catch (_2) { - } -} -__name(stripMetadataFromStackFrames, "stripMetadataFromStackFrames"); -const moduleMetadataIntegration = defineIntegration(() => { - return { - name: "ModuleMetadata", - setup(client) { - client.on("beforeEnvelope", (envelope) => { - forEachEnvelopeItem(envelope, (item3, type) => { - if (type === "event") { - const event = Array.isArray(item3) ? item3[1] : void 0; - if (event) { - stripMetadataFromStackFrames(event); - item3[1] = event; - } - } - }); - }); - client.on("applyFrameMetadata", (event) => { - if (event.type) { - return; - } - const stackParser = client.getOptions().stackParser; - addMetadataToStackFrames(stackParser, event); - }); - } - }; -}); -function parseCookie(str) { - const obj = {}; - let index2 = 0; - while (index2 < str.length) { - const eqIdx = str.indexOf("=", index2); - if (eqIdx === -1) { - break; - } - let endIdx = str.indexOf(";", index2); - if (endIdx === -1) { - endIdx = str.length; - } else if (endIdx < eqIdx) { - index2 = str.lastIndexOf(";", eqIdx - 1) + 1; - continue; - } - const key = str.slice(index2, eqIdx).trim(); - if (void 0 === obj[key]) { - let val = str.slice(eqIdx + 1, endIdx).trim(); - if (val.charCodeAt(0) === 34) { - val = val.slice(1, -1); - } - try { - obj[key] = val.indexOf("%") !== -1 ? decodeURIComponent(val) : val; - } catch (e2) { - obj[key] = val; - } - } - index2 = endIdx + 1; - } - return obj; -} -__name(parseCookie, "parseCookie"); -function parseUrl$1(url) { - if (!url) { - return {}; - } - const match3 = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); - if (!match3) { - return {}; - } - const query = match3[6] || ""; - const fragment = match3[8] || ""; - return { - host: match3[4], - path: match3[5], - protocol: match3[2], - search: query, - hash: fragment, - relative: match3[5] + query + fragment - // everything minus origin - }; -} -__name(parseUrl$1, "parseUrl$1"); -function stripUrlQueryAndFragment(urlPath) { - return urlPath.split(/[?#]/, 1)[0]; -} -__name(stripUrlQueryAndFragment, "stripUrlQueryAndFragment"); -function getNumberOfUrlSegments(url) { - return url.split(/\\?\//).filter((s2) => s2.length > 0 && s2 !== ",").length; -} -__name(getNumberOfUrlSegments, "getNumberOfUrlSegments"); -function getSanitizedUrlString(url) { - const { protocol, host, path } = url; - const filteredHost = host && host.replace(/^.*@/, "[filtered]:[filtered]@").replace(/(:80)$/, "").replace(/(:443)$/, "") || ""; - return `${protocol ? `${protocol}://` : ""}${filteredHost}${path}`; -} -__name(getSanitizedUrlString, "getSanitizedUrlString"); -const ipHeaderNames = [ - "X-Client-IP", - "X-Forwarded-For", - "Fly-Client-IP", - "CF-Connecting-IP", - "Fastly-Client-Ip", - "True-Client-Ip", - "X-Real-IP", - "X-Cluster-Client-IP", - "X-Forwarded", - "Forwarded-For", - "Forwarded", - "X-Vercel-Forwarded-For" -]; -function getClientIPAddress(headers) { - const headerValues = ipHeaderNames.map((headerName) => { - const rawValue = headers[headerName]; - const value4 = Array.isArray(rawValue) ? rawValue.join(";") : rawValue; - if (headerName === "Forwarded") { - return parseForwardedHeader(value4); - } - return value4 && value4.split(",").map((v2) => v2.trim()); - }); - const flattenedHeaderValues = headerValues.reduce((acc, val) => { - if (!val) { - return acc; - } - return acc.concat(val); - }, []); - const ipAddress = flattenedHeaderValues.find((ip) => ip !== null && isIP(ip)); - return ipAddress || null; -} -__name(getClientIPAddress, "getClientIPAddress"); -function parseForwardedHeader(value4) { - if (!value4) { - return null; - } - for (const part of value4.split(";")) { - if (part.startsWith("for=")) { - return part.slice(4); - } - } - return null; -} -__name(parseForwardedHeader, "parseForwardedHeader"); -function isIP(str) { - const regex2 = /(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/; - return regex2.test(str); -} -__name(isIP, "isIP"); -const DEFAULT_INCLUDES = { - ip: false, - request: true, - user: true -}; -const DEFAULT_REQUEST_INCLUDES = ["cookies", "data", "headers", "method", "query_string", "url"]; -const DEFAULT_USER_INCLUDES = ["id", "username", "email"]; -function extractPathForTransaction(req, options4 = {}) { - const method = req.method && req.method.toUpperCase(); - let path = ""; - let source = "url"; - if (options4.customRoute || req.route) { - path = options4.customRoute || `${req.baseUrl || ""}${req.route && req.route.path}`; - source = "route"; - } else if (req.originalUrl || req.url) { - path = stripUrlQueryAndFragment(req.originalUrl || req.url || ""); - } - let name2 = ""; - if (options4.method && method) { - name2 += method; - } - if (options4.method && options4.path) { - name2 += " "; - } - if (options4.path && path) { - name2 += path; - } - return [name2, source]; -} -__name(extractPathForTransaction, "extractPathForTransaction"); -function extractUserData(user, keys2) { - const extractedUser = {}; - const attributes = Array.isArray(keys2) ? keys2 : DEFAULT_USER_INCLUDES; - attributes.forEach((key) => { - if (user && key in user) { - extractedUser[key] = user[key]; - } - }); - return extractedUser; -} -__name(extractUserData, "extractUserData"); -function extractRequestData(req, options4 = {}) { - const { include = DEFAULT_REQUEST_INCLUDES } = options4; - const requestData = {}; - const headers = req.headers || {}; - const method = req.method; - const host = headers.host || req.hostname || req.host || ""; - const protocol = req.protocol === "https" || req.socket && req.socket.encrypted ? "https" : "http"; - const originalUrl = req.originalUrl || req.url || ""; - const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`; - include.forEach((key) => { - switch (key) { - case "headers": { - requestData.headers = headers; - if (!include.includes("cookies")) { - delete requestData.headers.cookie; - } - if (!include.includes("ip")) { - ipHeaderNames.forEach((ipHeaderName) => { - delete requestData.headers[ipHeaderName]; - }); - } - break; - } - case "method": { - requestData.method = method; - break; - } - case "url": { - requestData.url = absoluteUrl; - break; - } - case "cookies": { - requestData.cookies = // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can - // come off in v8 - req.cookies || headers.cookie && parseCookie(headers.cookie) || {}; - break; - } - case "query_string": { - requestData.query_string = extractQueryParams(req); - break; - } - case "data": { - if (method === "GET" || method === "HEAD") { - break; - } - const body = req.body; - if (body !== void 0) { - const stringBody = isString$a(body) ? body : isPlainObject$5(body) ? JSON.stringify(normalize$3(body)) : truncate(`${body}`, 1024); - if (stringBody) { - requestData.data = stringBody; - } - } - break; - } - default: { - if ({}.hasOwnProperty.call(req, key)) { - requestData[key] = req[key]; - } - } - } - }); - return requestData; -} -__name(extractRequestData, "extractRequestData"); -function addNormalizedRequestDataToEvent(event, req, additionalData, options4) { - const include = { - ...DEFAULT_INCLUDES, - ...options4 && options4.include - }; - if (include.request) { - const includeRequest = Array.isArray(include.request) ? [...include.request] : [...DEFAULT_REQUEST_INCLUDES]; - if (include.ip) { - includeRequest.push("ip"); - } - const extractedRequestData = extractNormalizedRequestData(req, { include: includeRequest }); - event.request = { - ...event.request, - ...extractedRequestData - }; - } - if (include.user) { - const extractedUser = additionalData.user && isPlainObject$5(additionalData.user) ? extractUserData(additionalData.user, include.user) : {}; - if (Object.keys(extractedUser).length) { - event.user = { - ...extractedUser, - ...event.user - }; - } - } - if (include.ip) { - const ip = req.headers && getClientIPAddress(req.headers) || additionalData.ipAddress; - if (ip) { - event.user = { - ...event.user, - ip_address: ip - }; - } - } -} -__name(addNormalizedRequestDataToEvent, "addNormalizedRequestDataToEvent"); -function addRequestDataToEvent(event, req, options4) { - const include = { - ...DEFAULT_INCLUDES, - ...options4 && options4.include - }; - if (include.request) { - const includeRequest = Array.isArray(include.request) ? [...include.request] : [...DEFAULT_REQUEST_INCLUDES]; - if (include.ip) { - includeRequest.push("ip"); - } - const extractedRequestData = extractRequestData(req, { include: includeRequest }); - event.request = { - ...event.request, - ...extractedRequestData - }; - } - if (include.user) { - const extractedUser = req.user && isPlainObject$5(req.user) ? extractUserData(req.user, include.user) : {}; - if (Object.keys(extractedUser).length) { - event.user = { - ...event.user, - ...extractedUser - }; - } - } - if (include.ip) { - const ip = req.headers && getClientIPAddress(req.headers) || req.ip || req.socket && req.socket.remoteAddress; - if (ip) { - event.user = { - ...event.user, - ip_address: ip - }; - } - } - return event; -} -__name(addRequestDataToEvent, "addRequestDataToEvent"); -function extractQueryParams(req) { - let originalUrl = req.originalUrl || req.url || ""; - if (!originalUrl) { - return; - } - if (originalUrl.startsWith("/")) { - originalUrl = `http://dogs.are.great${originalUrl}`; - } - try { - const queryParams = req.query || new URL(originalUrl).search.slice(1); - return queryParams.length ? queryParams : void 0; - } catch (e2) { - return void 0; - } -} -__name(extractQueryParams, "extractQueryParams"); -function winterCGHeadersToDict(winterCGHeaders) { - const headers = {}; - try { - winterCGHeaders.forEach((value4, key) => { - if (typeof value4 === "string") { - headers[key] = value4; - } - }); - } catch (e2) { - DEBUG_BUILD$5 && logger$2.warn("Sentry failed extracting headers from a request object. If you see this, please file an issue."); - } - return headers; -} -__name(winterCGHeadersToDict, "winterCGHeadersToDict"); -function headersToDict(reqHeaders) { - const headers = /* @__PURE__ */ Object.create(null); - try { - Object.entries(reqHeaders).forEach(([key, value4]) => { - if (typeof value4 === "string") { - headers[key] = value4; - } - }); - } catch (e2) { - DEBUG_BUILD$5 && logger$2.warn("Sentry failed extracting headers from a request object. If you see this, please file an issue."); - } - return headers; -} -__name(headersToDict, "headersToDict"); -function winterCGRequestToRequestData(req) { - const headers = winterCGHeadersToDict(req.headers); - return { - method: req.method, - url: req.url, - query_string: extractQueryParamsFromUrl(req.url), - headers - // TODO: Can we extract body data from the request? - }; -} -__name(winterCGRequestToRequestData, "winterCGRequestToRequestData"); -function httpRequestToRequestData(request) { - const headers = request.headers || {}; - const host = headers.host || ""; - const protocol = request.socket && request.socket.encrypted ? "https" : "http"; - const originalUrl = request.url || ""; - const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`; - const data26 = request.body || void 0; - const cookies2 = request.cookies; - return dropUndefinedKeys({ - url: absoluteUrl, - method: request.method, - query_string: extractQueryParamsFromUrl(originalUrl), - headers: headersToDict(headers), - cookies: cookies2, - data: data26 - }); -} -__name(httpRequestToRequestData, "httpRequestToRequestData"); -function extractQueryParamsFromUrl(url) { - if (!url) { - return; - } - try { - const queryParams = new URL(url, "http://dogs.are.great").search.slice(1); - return queryParams.length ? queryParams : void 0; - } catch (e3) { - return void 0; - } -} -__name(extractQueryParamsFromUrl, "extractQueryParamsFromUrl"); -function extractNormalizedRequestData(normalizedRequest, { include }) { - const includeKeys = include ? Array.isArray(include) ? include : DEFAULT_REQUEST_INCLUDES : []; - const requestData = {}; - const headers = { ...normalizedRequest.headers }; - if (includeKeys.includes("headers")) { - requestData.headers = headers; - if (!include.includes("cookies")) { - delete headers.cookie; - } - if (!include.includes("ip")) { - ipHeaderNames.forEach((ipHeaderName) => { - delete headers[ipHeaderName]; - }); - } - } - if (includeKeys.includes("method")) { - requestData.method = normalizedRequest.method; - } - if (includeKeys.includes("url")) { - requestData.url = normalizedRequest.url; - } - if (includeKeys.includes("cookies")) { - const cookies2 = normalizedRequest.cookies || (headers && headers.cookie ? parseCookie(headers.cookie) : void 0); - requestData.cookies = cookies2 || {}; - } - if (includeKeys.includes("query_string")) { - requestData.query_string = normalizedRequest.query_string; - } - if (includeKeys.includes("data")) { - requestData.data = normalizedRequest.data; - } - return requestData; -} -__name(extractNormalizedRequestData, "extractNormalizedRequestData"); -const DEFAULT_OPTIONS$1 = { - include: { - cookies: true, - data: true, - headers: true, - ip: false, - query_string: true, - url: true, - user: { - id: true, - username: true, - email: true - } - }, - transactionNamingScheme: "methodPath" -}; -const INTEGRATION_NAME$i = "RequestData"; -const _requestDataIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const _options = { - ...DEFAULT_OPTIONS$1, - ...options4, - include: { - ...DEFAULT_OPTIONS$1.include, - ...options4.include, - user: options4.include && typeof options4.include.user === "boolean" ? options4.include.user : { - ...DEFAULT_OPTIONS$1.include.user, - // Unclear why TS still thinks `options.include.user` could be a boolean at this point - ...(options4.include || {}).user - } - } - }; - return { - name: INTEGRATION_NAME$i, - processEvent(event) { - const { sdkProcessingMetadata = {} } = event; - const { request, normalizedRequest } = sdkProcessingMetadata; - const addRequestDataOptions = convertReqDataIntegrationOptsToAddReqDataOpts(_options); - if (normalizedRequest) { - const ipAddress = request ? request.ip || request.socket && request.socket.remoteAddress : void 0; - const user = request ? request.user : void 0; - addNormalizedRequestDataToEvent(event, normalizedRequest, { ipAddress, user }, addRequestDataOptions); - return event; - } - if (!request) { - return event; - } - return addRequestDataToEvent(event, request, addRequestDataOptions); - } - }; -}, "_requestDataIntegration"); -const requestDataIntegration = defineIntegration(_requestDataIntegration); -function convertReqDataIntegrationOptsToAddReqDataOpts(integrationOptions) { - const { - // eslint-disable-next-line deprecation/deprecation - transactionNamingScheme, - include: { ip, user, ...requestOptions } - } = integrationOptions; - const requestIncludeKeys = ["method"]; - for (const [key, value4] of Object.entries(requestOptions)) { - if (value4) { - requestIncludeKeys.push(key); - } - } - let addReqDataUserOpt; - if (user === void 0) { - addReqDataUserOpt = true; - } else if (typeof user === "boolean") { - addReqDataUserOpt = user; - } else { - const userIncludeKeys = []; - for (const [key, value4] of Object.entries(user)) { - if (value4) { - userIncludeKeys.push(key); - } - } - addReqDataUserOpt = userIncludeKeys; - } - return { - include: { - ip, - user: addReqDataUserOpt, - request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : void 0, - transaction: transactionNamingScheme - } - }; -} -__name(convertReqDataIntegrationOptsToAddReqDataOpts, "convertReqDataIntegrationOptsToAddReqDataOpts"); -function addConsoleInstrumentationHandler(handler10) { - const type = "console"; - addHandler$1(type, handler10); - maybeInstrument(type, instrumentConsole); -} -__name(addConsoleInstrumentationHandler, "addConsoleInstrumentationHandler"); -function instrumentConsole() { - if (!("console" in GLOBAL_OBJ)) { - return; - } - CONSOLE_LEVELS$1.forEach(function(level) { - if (!(level in GLOBAL_OBJ.console)) { - return; - } - fill(GLOBAL_OBJ.console, level, function(originalConsoleMethod) { - originalConsoleMethods[level] = originalConsoleMethod; - return function(...args) { - const handlerData = { args, level }; - triggerHandlers$1("console", handlerData); - const log2 = originalConsoleMethods[level]; - log2 && log2.apply(GLOBAL_OBJ.console, args); - }; - }); - }); -} -__name(instrumentConsole, "instrumentConsole"); -const validSeverityLevels = ["fatal", "error", "warning", "log", "info", "debug"]; -function severityLevelFromString(level) { - return level === "warn" ? "warning" : ["fatal", "error", "warning", "log", "info", "debug"].includes(level) ? level : "log"; -} -__name(severityLevelFromString, "severityLevelFromString"); -const INTEGRATION_NAME$h = "CaptureConsole"; -const _captureConsoleIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const levels = options4.levels || CONSOLE_LEVELS$1; - const handled = !!options4.handled; - return { - name: INTEGRATION_NAME$h, - setup(client) { - if (!("console" in GLOBAL_OBJ)) { - return; - } - addConsoleInstrumentationHandler(({ args, level }) => { - if (getClient() !== client || !levels.includes(level)) { - return; - } - consoleHandler(args, level, handled); - }); - } - }; -}, "_captureConsoleIntegration"); -const captureConsoleIntegration = defineIntegration(_captureConsoleIntegration); -function consoleHandler(args, level, handled) { - const captureContext = { - level: severityLevelFromString(level), - extra: { - arguments: args - } - }; - withScope((scope) => { - scope.addEventProcessor((event) => { - event.logger = "console"; - addExceptionMechanism(event, { - handled, - type: "console" - }); - return event; - }); - if (level === "assert") { - if (!args[0]) { - const message4 = `Assertion failed: ${safeJoin(args.slice(1), " ") || "console.assert"}`; - scope.setExtra("arguments", args.slice(1)); - captureMessage(message4, captureContext); - } - return; - } - const error2 = args.find((arg) => arg instanceof Error); - if (error2) { - captureException(error2, captureContext); - return; - } - const message3 = safeJoin(args, " "); - captureMessage(message3, captureContext); - }); -} -__name(consoleHandler, "consoleHandler"); -const INTEGRATION_NAME$g = "Debug"; -const _debugIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const _options = { - debugger: false, - stringify: false, - ...options4 - }; - return { - name: INTEGRATION_NAME$g, - setup(client) { - client.on("beforeSendEvent", (event, hint) => { - if (_options.debugger) { - debugger; - } - consoleSandbox(() => { - if (_options.stringify) { - console.log(JSON.stringify(event, null, 2)); - if (hint && Object.keys(hint).length) { - console.log(JSON.stringify(hint, null, 2)); - } - } else { - console.log(event); - if (hint && Object.keys(hint).length) { - console.log(hint); - } - } - }); - }); - } - }; -}, "_debugIntegration"); -const debugIntegration = defineIntegration(_debugIntegration); -const INTEGRATION_NAME$f = "Dedupe"; -const _dedupeIntegration = /* @__PURE__ */ __name(() => { - let previousEvent; - return { - name: INTEGRATION_NAME$f, - processEvent(currentEvent) { - if (currentEvent.type) { - return currentEvent; - } - try { - if (_shouldDropEvent(currentEvent, previousEvent)) { - DEBUG_BUILD$6 && logger$2.warn("Event dropped due to being a duplicate of previously captured event."); - return null; - } - } catch (_oO) { - } - return previousEvent = currentEvent; - } - }; -}, "_dedupeIntegration"); -const dedupeIntegration = defineIntegration(_dedupeIntegration); -function _shouldDropEvent(currentEvent, previousEvent) { - if (!previousEvent) { - return false; - } - if (_isSameMessageEvent(currentEvent, previousEvent)) { - return true; - } - if (_isSameExceptionEvent(currentEvent, previousEvent)) { - return true; - } - return false; -} -__name(_shouldDropEvent, "_shouldDropEvent"); -function _isSameMessageEvent(currentEvent, previousEvent) { - const currentMessage = currentEvent.message; - const previousMessage = previousEvent.message; - if (!currentMessage && !previousMessage) { - return false; - } - if (currentMessage && !previousMessage || !currentMessage && previousMessage) { - return false; - } - if (currentMessage !== previousMessage) { - return false; - } - if (!_isSameFingerprint(currentEvent, previousEvent)) { - return false; - } - if (!_isSameStacktrace(currentEvent, previousEvent)) { - return false; - } - return true; -} -__name(_isSameMessageEvent, "_isSameMessageEvent"); -function _isSameExceptionEvent(currentEvent, previousEvent) { - const previousException = _getExceptionFromEvent(previousEvent); - const currentException = _getExceptionFromEvent(currentEvent); - if (!previousException || !currentException) { - return false; - } - if (previousException.type !== currentException.type || previousException.value !== currentException.value) { - return false; - } - if (!_isSameFingerprint(currentEvent, previousEvent)) { - return false; - } - if (!_isSameStacktrace(currentEvent, previousEvent)) { - return false; - } - return true; -} -__name(_isSameExceptionEvent, "_isSameExceptionEvent"); -function _isSameStacktrace(currentEvent, previousEvent) { - let currentFrames = getFramesFromEvent(currentEvent); - let previousFrames = getFramesFromEvent(previousEvent); - if (!currentFrames && !previousFrames) { - return true; - } - if (currentFrames && !previousFrames || !currentFrames && previousFrames) { - return false; - } - currentFrames = currentFrames; - previousFrames = previousFrames; - if (previousFrames.length !== currentFrames.length) { - return false; - } - for (let i2 = 0; i2 < previousFrames.length; i2++) { - const frameA = previousFrames[i2]; - const frameB = currentFrames[i2]; - if (frameA.filename !== frameB.filename || frameA.lineno !== frameB.lineno || frameA.colno !== frameB.colno || frameA.function !== frameB.function) { - return false; - } - } - return true; -} -__name(_isSameStacktrace, "_isSameStacktrace"); -function _isSameFingerprint(currentEvent, previousEvent) { - let currentFingerprint = currentEvent.fingerprint; - let previousFingerprint = previousEvent.fingerprint; - if (!currentFingerprint && !previousFingerprint) { - return true; - } - if (currentFingerprint && !previousFingerprint || !currentFingerprint && previousFingerprint) { - return false; - } - currentFingerprint = currentFingerprint; - previousFingerprint = previousFingerprint; - try { - return !!(currentFingerprint.join("") === previousFingerprint.join("")); - } catch (_oO) { - return false; - } -} -__name(_isSameFingerprint, "_isSameFingerprint"); -function _getExceptionFromEvent(event) { - return event.exception && event.exception.values && event.exception.values[0]; -} -__name(_getExceptionFromEvent, "_getExceptionFromEvent"); -const INTEGRATION_NAME$e = "ExtraErrorData"; -const _extraErrorDataIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const { depth = 3, captureErrorCause = true } = options4; - return { - name: INTEGRATION_NAME$e, - processEvent(event, hint, client) { - const { maxValueLength = 250 } = client.getOptions(); - return _enhanceEventWithErrorData(event, hint, depth, captureErrorCause, maxValueLength); - } - }; -}, "_extraErrorDataIntegration"); -const extraErrorDataIntegration = defineIntegration(_extraErrorDataIntegration); -function _enhanceEventWithErrorData(event, hint = {}, depth, captureErrorCause, maxValueLength) { - if (!hint.originalException || !isError(hint.originalException)) { - return event; - } - const exceptionName = hint.originalException.name || hint.originalException.constructor.name; - const errorData = _extractErrorData(hint.originalException, captureErrorCause, maxValueLength); - if (errorData) { - const contexts = { - ...event.contexts - }; - const normalizedErrorData = normalize$3(errorData, depth); - if (isPlainObject$5(normalizedErrorData)) { - addNonEnumerableProperty(normalizedErrorData, "__sentry_skip_normalization__", true); - contexts[exceptionName] = normalizedErrorData; - } - return { - ...event, - contexts - }; - } - return event; -} -__name(_enhanceEventWithErrorData, "_enhanceEventWithErrorData"); -function _extractErrorData(error2, captureErrorCause, maxValueLength) { - try { - const nativeKeys2 = [ - "name", - "message", - "stack", - "line", - "column", - "fileName", - "lineNumber", - "columnNumber", - "toJSON" - ]; - const extraErrorInfo = {}; - for (const key of Object.keys(error2)) { - if (nativeKeys2.indexOf(key) !== -1) { - continue; - } - const value4 = error2[key]; - extraErrorInfo[key] = isError(value4) || typeof value4 === "string" ? truncate(`${value4}`, maxValueLength) : value4; - } - if (captureErrorCause && error2.cause !== void 0) { - extraErrorInfo.cause = isError(error2.cause) ? error2.cause.toString() : error2.cause; - } - if (typeof error2.toJSON === "function") { - const serializedError = error2.toJSON(); - for (const key of Object.keys(serializedError)) { - const value4 = serializedError[key]; - extraErrorInfo[key] = isError(value4) ? value4.toString() : value4; - } - } - return extraErrorInfo; - } catch (oO) { - DEBUG_BUILD$6 && logger$2.error("Unable to extract extra data from the Error object:", oO); - } - return null; -} -__name(_extractErrorData, "_extractErrorData"); -function normalizeArray(parts2, allowAboveRoot) { - let up = 0; - for (let i2 = parts2.length - 1; i2 >= 0; i2--) { - const last = parts2[i2]; - if (last === ".") { - parts2.splice(i2, 1); - } else if (last === "..") { - parts2.splice(i2, 1); - up++; - } else if (up) { - parts2.splice(i2, 1); - up--; - } - } - if (allowAboveRoot) { - for (; up--; up) { - parts2.unshift(".."); - } - } - return parts2; -} -__name(normalizeArray, "normalizeArray"); -const splitPathRe = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/; -function splitPath(filename) { - const truncated = filename.length > 1024 ? `${filename.slice(-1024)}` : filename; - const parts2 = splitPathRe.exec(truncated); - return parts2 ? parts2.slice(1) : []; -} -__name(splitPath, "splitPath"); -function resolve$1(...args) { - let resolvedPath = ""; - let resolvedAbsolute = false; - for (let i2 = args.length - 1; i2 >= -1 && !resolvedAbsolute; i2--) { - const path = i2 >= 0 ? args[i2] : "/"; - if (!path) { - continue; - } - resolvedPath = `${path}/${resolvedPath}`; - resolvedAbsolute = path.charAt(0) === "/"; - } - resolvedPath = normalizeArray( - resolvedPath.split("/").filter((p2) => !!p2), - !resolvedAbsolute - ).join("/"); - return (resolvedAbsolute ? "/" : "") + resolvedPath || "."; -} -__name(resolve$1, "resolve$1"); -function trim$1(arr) { - let start2 = 0; - for (; start2 < arr.length; start2++) { - if (arr[start2] !== "") { - break; - } - } - let end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== "") { - break; - } - } - if (start2 > end) { - return []; - } - return arr.slice(start2, end - start2 + 1); -} -__name(trim$1, "trim$1"); -function relative(from2, to) { - from2 = resolve$1(from2).slice(1); - to = resolve$1(to).slice(1); - const fromParts = trim$1(from2.split("/")); - const toParts = trim$1(to.split("/")); - const length = Math.min(fromParts.length, toParts.length); - let samePartsLength = length; - for (let i2 = 0; i2 < length; i2++) { - if (fromParts[i2] !== toParts[i2]) { - samePartsLength = i2; - break; - } - } - let outputParts = []; - for (let i2 = samePartsLength; i2 < fromParts.length; i2++) { - outputParts.push(".."); - } - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - return outputParts.join("/"); -} -__name(relative, "relative"); -function normalizePath(path) { - const isPathAbsolute = isAbsolute(path); - const trailingSlash = path.slice(-1) === "/"; - let normalizedPath = normalizeArray( - path.split("/").filter((p2) => !!p2), - !isPathAbsolute - ).join("/"); - if (!normalizedPath && !isPathAbsolute) { - normalizedPath = "."; - } - if (normalizedPath && trailingSlash) { - normalizedPath += "/"; - } - return (isPathAbsolute ? "/" : "") + normalizedPath; -} -__name(normalizePath, "normalizePath"); -function isAbsolute(path) { - return path.charAt(0) === "/"; -} -__name(isAbsolute, "isAbsolute"); -function join$3(...args) { - return normalizePath(args.join("/")); -} -__name(join$3, "join$3"); -function dirname(path) { - const result = splitPath(path); - const root29 = result[0] || ""; - let dir = result[1]; - if (!root29 && !dir) { - return "."; - } - if (dir) { - dir = dir.slice(0, dir.length - 1); - } - return root29 + dir; -} -__name(dirname, "dirname"); -function basename(path, ext) { - let f2 = splitPath(path)[2] || ""; - if (ext && f2.slice(ext.length * -1) === ext) { - f2 = f2.slice(0, f2.length - ext.length); - } - return f2; -} -__name(basename, "basename"); -const INTEGRATION_NAME$d = "RewriteFrames"; -const rewriteFramesIntegration = defineIntegration((options4 = {}) => { - const root29 = options4.root; - const prefix2 = options4.prefix || "app:///"; - const isBrowser2 = "window" in GLOBAL_OBJ && GLOBAL_OBJ.window !== void 0; - const iteratee = options4.iteratee || generateIteratee({ isBrowser: isBrowser2, root: root29, prefix: prefix2 }); - function _processExceptionsEvent(event) { - try { - return { - ...event, - exception: { - ...event.exception, - // The check for this is performed inside `process` call itself, safe to skip here - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - values: event.exception.values.map((value4) => ({ - ...value4, - ...value4.stacktrace && { stacktrace: _processStacktrace(value4.stacktrace) } - })) - } - }; - } catch (_oO) { - return event; - } - } - __name(_processExceptionsEvent, "_processExceptionsEvent"); - function _processStacktrace(stacktrace) { - return { - ...stacktrace, - frames: stacktrace && stacktrace.frames && stacktrace.frames.map((f2) => iteratee(f2)) - }; - } - __name(_processStacktrace, "_processStacktrace"); - return { - name: INTEGRATION_NAME$d, - processEvent(originalEvent) { - let processedEvent = originalEvent; - if (originalEvent.exception && Array.isArray(originalEvent.exception.values)) { - processedEvent = _processExceptionsEvent(processedEvent); - } - return processedEvent; - } - }; -}); -function generateIteratee({ - isBrowser: isBrowser2, - root: root29, - prefix: prefix2 -}) { - return (frame) => { - if (!frame.filename) { - return frame; - } - const isWindowsFrame = /^[a-zA-Z]:\\/.test(frame.filename) || // or the presence of a backslash without a forward slash (which are not allowed on Windows) - frame.filename.includes("\\") && !frame.filename.includes("/"); - const startsWithSlash = /^\//.test(frame.filename); - if (isBrowser2) { - if (root29) { - const oldFilename = frame.filename; - if (oldFilename.indexOf(root29) === 0) { - frame.filename = oldFilename.replace(root29, prefix2); - } - } - } else { - if (isWindowsFrame || startsWithSlash) { - const filename = isWindowsFrame ? frame.filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/") : frame.filename; - const base2 = root29 ? relative(root29, filename) : basename(filename); - frame.filename = `${prefix2}${base2}`; - } - } - return frame; - }; -} -__name(generateIteratee, "generateIteratee"); -const INTEGRATION_NAME$c = "SessionTiming"; -const _sessionTimingIntegration = /* @__PURE__ */ __name(() => { - const startTime = timestampInSeconds() * 1e3; - return { - name: INTEGRATION_NAME$c, - processEvent(event) { - const now2 = timestampInSeconds() * 1e3; - return { - ...event, - extra: { - ...event.extra, - ["session:start"]: startTime, - ["session:duration"]: now2 - startTime, - ["session:end"]: now2 - } - }; - } - }; -}, "_sessionTimingIntegration"); -const sessionTimingIntegration = defineIntegration(_sessionTimingIntegration); -const DEFAULT_LIMIT$1 = 10; -const INTEGRATION_NAME$b = "ZodErrors"; -function originalExceptionIsZodError(originalException) { - return isError(originalException) && originalException.name === "ZodError" && Array.isArray(originalException.issues); -} -__name(originalExceptionIsZodError, "originalExceptionIsZodError"); -function flattenIssue(issue) { - return { - ...issue, - path: "path" in issue && Array.isArray(issue.path) ? issue.path.join(".") : void 0, - keys: "keys" in issue ? JSON.stringify(issue.keys) : void 0, - unionErrors: "unionErrors" in issue ? JSON.stringify(issue.unionErrors) : void 0 - }; -} -__name(flattenIssue, "flattenIssue"); -function flattenIssuePath(path) { - return path.map((p2) => { - if (typeof p2 === "number") { - return ""; - } else { - return p2; - } - }).join("."); -} -__name(flattenIssuePath, "flattenIssuePath"); -function formatIssueMessage(zodError) { - const errorKeyMap = /* @__PURE__ */ new Set(); - for (const iss of zodError.issues) { - const issuePath = flattenIssuePath(iss.path); - if (issuePath.length > 0) { - errorKeyMap.add(issuePath); - } - } - const errorKeys = Array.from(errorKeyMap); - if (errorKeys.length === 0) { - let rootExpectedType = "variable"; - if (zodError.issues.length > 0) { - const iss = zodError.issues[0]; - if (iss !== void 0 && "expected" in iss && typeof iss.expected === "string") { - rootExpectedType = iss.expected; - } - } - return `Failed to validate ${rootExpectedType}`; - } - return `Failed to validate keys: ${truncate(errorKeys.join(", "), 100)}`; -} -__name(formatIssueMessage, "formatIssueMessage"); -function applyZodErrorsToEvent(limit, saveZodIssuesAsAttachment = false, event, hint) { - if (!event.exception || !event.exception.values || !hint || !hint.originalException || !originalExceptionIsZodError(hint.originalException) || hint.originalException.issues.length === 0) { - return event; - } - try { - const issuesToFlatten = saveZodIssuesAsAttachment ? hint.originalException.issues : hint.originalException.issues.slice(0, limit); - const flattenedIssues = issuesToFlatten.map(flattenIssue); - if (saveZodIssuesAsAttachment) { - if (!Array.isArray(hint.attachments)) { - hint.attachments = []; - } - hint.attachments.push({ - filename: "zod_issues.json", - data: JSON.stringify({ - issues: flattenedIssues - }) - }); - } - return { - ...event, - exception: { - ...event.exception, - values: [ - { - ...event.exception.values[0], - value: formatIssueMessage(hint.originalException) - }, - ...event.exception.values.slice(1) - ] - }, - extra: { - ...event.extra, - "zoderror.issues": flattenedIssues.slice(0, limit) - } - }; - } catch (e2) { - return { - ...event, - extra: { - ...event.extra, - "zoderrors sentry integration parse error": { - message: "an exception was thrown while processing ZodError within applyZodErrorsToEvent()", - error: e2 instanceof Error ? `${e2.name}: ${e2.message} -${e2.stack}` : "unknown" - } - } - }; - } -} -__name(applyZodErrorsToEvent, "applyZodErrorsToEvent"); -const _zodErrorsIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const limit = typeof options4.limit === "undefined" ? DEFAULT_LIMIT$1 : options4.limit; - return { - name: INTEGRATION_NAME$b, - processEvent(originalEvent, hint) { - const processedEvent = applyZodErrorsToEvent(limit, options4.saveZodIssuesAsAttachment, originalEvent, hint); - return processedEvent; - } - }; -}, "_zodErrorsIntegration"); -const zodErrorsIntegration = defineIntegration(_zodErrorsIntegration); -const thirdPartyErrorFilterIntegration = defineIntegration((options4) => { - return { - name: "ThirdPartyErrorsFilter", - setup(client) { - client.on("beforeEnvelope", (envelope) => { - forEachEnvelopeItem(envelope, (item3, type) => { - if (type === "event") { - const event = Array.isArray(item3) ? item3[1] : void 0; - if (event) { - stripMetadataFromStackFrames(event); - item3[1] = event; - } - } - }); - }); - client.on("applyFrameMetadata", (event) => { - if (event.type) { - return; - } - const stackParser = client.getOptions().stackParser; - addMetadataToStackFrames(stackParser, event); - }); - }, - processEvent(event) { - const frameKeys = getBundleKeysForAllFramesWithFilenames(event); - if (frameKeys) { - const arrayMethod = options4.behaviour === "drop-error-if-contains-third-party-frames" || options4.behaviour === "apply-tag-if-contains-third-party-frames" ? "some" : "every"; - const behaviourApplies = frameKeys[arrayMethod]((keys2) => !keys2.some((key) => options4.filterKeys.includes(key))); - if (behaviourApplies) { - const shouldDrop = options4.behaviour === "drop-error-if-contains-third-party-frames" || options4.behaviour === "drop-error-if-exclusively-contains-third-party-frames"; - if (shouldDrop) { - return null; - } else { - event.tags = { - ...event.tags, - third_party_code: true - }; - } - } - } - return event; - } - }; -}); -function getBundleKeysForAllFramesWithFilenames(event) { - const frames = getFramesFromEvent(event); - if (!frames) { - return void 0; - } - return frames.filter((frame) => !!frame.filename).map((frame) => { - if (frame.module_metadata) { - return Object.keys(frame.module_metadata).filter((key) => key.startsWith(BUNDLER_PLUGIN_APP_KEY_PREFIX)).map((key) => key.slice(BUNDLER_PLUGIN_APP_KEY_PREFIX.length)); - } - return []; - }); -} -__name(getBundleKeysForAllFramesWithFilenames, "getBundleKeysForAllFramesWithFilenames"); -const BUNDLER_PLUGIN_APP_KEY_PREFIX = "_sentryBundlerPluginAppKey:"; -const COUNTER_METRIC_TYPE = "c"; -const GAUGE_METRIC_TYPE = "g"; -const SET_METRIC_TYPE = "s"; -const DISTRIBUTION_METRIC_TYPE = "d"; -const DEFAULT_BROWSER_FLUSH_INTERVAL = 5e3; -const DEFAULT_FLUSH_INTERVAL = 1e4; -const MAX_WEIGHT = 1e4; -function getMetricsAggregatorForClient$1(client, Aggregator) { - const globalMetricsAggregators = getGlobalSingleton( - "globalMetricsAggregators", - () => /* @__PURE__ */ new WeakMap() - ); - const aggregator = globalMetricsAggregators.get(client); - if (aggregator) { - return aggregator; - } - const newAggregator = new Aggregator(client); - client.on("flush", () => newAggregator.flush()); - client.on("close", () => newAggregator.close()); - globalMetricsAggregators.set(client, newAggregator); - return newAggregator; -} -__name(getMetricsAggregatorForClient$1, "getMetricsAggregatorForClient$1"); -function addToMetricsAggregator(Aggregator, metricType, name2, value4, data26 = {}) { - const client = data26.client || getClient(); - if (!client) { - return; - } - const span = getActiveSpan(); - const rootSpan = span ? getRootSpan(span) : void 0; - const transactionName = rootSpan && spanToJSON(rootSpan).description; - const { unit, tags, timestamp: timestamp2 } = data26; - const { release, environment } = client.getOptions(); - const metricTags = {}; - if (release) { - metricTags.release = release; - } - if (environment) { - metricTags.environment = environment; - } - if (transactionName) { - metricTags.transaction = transactionName; - } - DEBUG_BUILD$6 && logger$2.log(`Adding value of ${value4} to ${metricType} metric ${name2}`); - const aggregator = getMetricsAggregatorForClient$1(client, Aggregator); - aggregator.add(metricType, name2, value4, unit, { ...metricTags, ...tags }, timestamp2); -} -__name(addToMetricsAggregator, "addToMetricsAggregator"); -function increment$2(aggregator, name2, value4 = 1, data26) { - addToMetricsAggregator(aggregator, COUNTER_METRIC_TYPE, name2, ensureNumber(value4), data26); -} -__name(increment$2, "increment$2"); -function distribution$2(aggregator, name2, value4, data26) { - addToMetricsAggregator(aggregator, DISTRIBUTION_METRIC_TYPE, name2, ensureNumber(value4), data26); -} -__name(distribution$2, "distribution$2"); -function timing$2(aggregator, name2, value4, unit = "second", data26) { - if (typeof value4 === "function") { - const startTime = timestampInSeconds(); - return startSpanManual( - { - op: "metrics.timing", - name: name2, - startTime, - onlyIfParent: true - }, - (span) => { - return handleCallbackErrors( - () => value4(), - () => { - }, - () => { - const endTime = timestampInSeconds(); - const timeDiff = endTime - startTime; - distribution$2(aggregator, name2, timeDiff, { ...data26, unit: "second" }); - span.end(endTime); - } - ); - } - ); - } - distribution$2(aggregator, name2, value4, { ...data26, unit }); -} -__name(timing$2, "timing$2"); -function set$4(aggregator, name2, value4, data26) { - addToMetricsAggregator(aggregator, SET_METRIC_TYPE, name2, value4, data26); -} -__name(set$4, "set$4"); -function gauge$2(aggregator, name2, value4, data26) { - addToMetricsAggregator(aggregator, GAUGE_METRIC_TYPE, name2, ensureNumber(value4), data26); -} -__name(gauge$2, "gauge$2"); -const metrics$1 = { - increment: increment$2, - distribution: distribution$2, - set: set$4, - gauge: gauge$2, - timing: timing$2, - /** - * @ignore This is for internal use only. - */ - getMetricsAggregatorForClient: getMetricsAggregatorForClient$1 -}; -function ensureNumber(number2) { - return typeof number2 === "string" ? parseInt(number2) : number2; -} -__name(ensureNumber, "ensureNumber"); -function isProfilingIntegrationWithProfiler(integration) { - return !!integration && typeof integration["_profiler"] !== "undefined" && typeof integration["_profiler"]["start"] === "function" && typeof integration["_profiler"]["stop"] === "function"; -} -__name(isProfilingIntegrationWithProfiler, "isProfilingIntegrationWithProfiler"); -function startProfiler() { - const client = getClient(); - if (!client) { - DEBUG_BUILD$6 && logger$2.warn("No Sentry client available, profiling is not started"); - return; - } - const integration = client.getIntegrationByName("ProfilingIntegration"); - if (!integration) { - DEBUG_BUILD$6 && logger$2.warn("ProfilingIntegration is not available"); - return; - } - if (!isProfilingIntegrationWithProfiler(integration)) { - DEBUG_BUILD$6 && logger$2.warn("Profiler is not available on profiling integration."); - return; - } - integration._profiler.start(); -} -__name(startProfiler, "startProfiler"); -function stopProfiler() { - const client = getClient(); - if (!client) { - DEBUG_BUILD$6 && logger$2.warn("No Sentry client available, profiling is not started"); - return; - } - const integration = client.getIntegrationByName("ProfilingIntegration"); - if (!integration) { - DEBUG_BUILD$6 && logger$2.warn("ProfilingIntegration is not available"); - return; - } - if (!isProfilingIntegrationWithProfiler(integration)) { - DEBUG_BUILD$6 && logger$2.warn("Profiler is not available on profiling integration."); - return; - } - integration._profiler.stop(); -} -__name(stopProfiler, "stopProfiler"); -const profiler = { - startProfiler, - stopProfiler -}; -function getBucketKey(metricType, name2, unit, tags) { - const stringifiedTags = Object.entries(dropUndefinedKeys(tags)).sort((a2, b2) => a2[0].localeCompare(b2[0])); - return `${metricType}${name2}${unit}${stringifiedTags}`; -} -__name(getBucketKey, "getBucketKey"); -function simpleHash(s2) { - let rv = 0; - for (let i2 = 0; i2 < s2.length; i2++) { - const c2 = s2.charCodeAt(i2); - rv = (rv << 5) - rv + c2; - rv &= rv; - } - return rv >>> 0; -} -__name(simpleHash, "simpleHash"); -function serializeMetricBuckets(metricBucketItems) { - let out = ""; - for (const item3 of metricBucketItems) { - const tagEntries = Object.entries(item3.tags); - const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value4]) => `${key}:${value4}`).join(",")}` : ""; - out += `${item3.name}@${item3.unit}:${item3.metric}|${item3.metricType}${maybeTags}|T${item3.timestamp} -`; - } - return out; -} -__name(serializeMetricBuckets, "serializeMetricBuckets"); -function sanitizeUnit(unit) { - return unit.replace(/[^\w]+/gi, "_"); -} -__name(sanitizeUnit, "sanitizeUnit"); -function sanitizeMetricKey(key) { - return key.replace(/[^\w\-.]+/gi, "_"); -} -__name(sanitizeMetricKey, "sanitizeMetricKey"); -function sanitizeTagKey(key) { - return key.replace(/[^\w\-./]+/gi, ""); -} -__name(sanitizeTagKey, "sanitizeTagKey"); -const tagValueReplacements = [ - ["\n", "\\n"], - ["\r", "\\r"], - [" ", "\\t"], - ["\\", "\\\\"], - ["|", "\\u{7c}"], - [",", "\\u{2c}"] -]; -function getCharOrReplacement(input) { - for (const [search2, replacement] of tagValueReplacements) { - if (input === search2) { - return replacement; - } - } - return input; -} -__name(getCharOrReplacement, "getCharOrReplacement"); -function sanitizeTagValue(value4) { - return [...value4].reduce((acc, char) => acc + getCharOrReplacement(char), ""); -} -__name(sanitizeTagValue, "sanitizeTagValue"); -function sanitizeTags(unsanitizedTags) { - const tags = {}; - for (const key in unsanitizedTags) { - if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) { - const sanitizedKey = sanitizeTagKey(key); - tags[sanitizedKey] = sanitizeTagValue(String(unsanitizedTags[key])); - } - } - return tags; -} -__name(sanitizeTags, "sanitizeTags"); -function captureAggregateMetrics(client, metricBucketItems) { - logger$2.log(`Flushing aggregated metrics, number of metrics: ${metricBucketItems.length}`); - const dsn = client.getDsn(); - const metadata = client.getSdkMetadata(); - const tunnel = client.getOptions().tunnel; - const metricsEnvelope = createMetricEnvelope(metricBucketItems, dsn, metadata, tunnel); - client.sendEnvelope(metricsEnvelope); -} -__name(captureAggregateMetrics, "captureAggregateMetrics"); -function createMetricEnvelope(metricBucketItems, dsn, metadata, tunnel) { - const headers = { - sent_at: (/* @__PURE__ */ new Date()).toISOString() - }; - if (metadata && metadata.sdk) { - headers.sdk = { - name: metadata.sdk.name, - version: metadata.sdk.version - }; - } - if (!!tunnel && dsn) { - headers.dsn = dsnToString(dsn); - } - const item3 = createMetricEnvelopeItem(metricBucketItems); - return createEnvelope(headers, [item3]); -} -__name(createMetricEnvelope, "createMetricEnvelope"); -function createMetricEnvelopeItem(metricBucketItems) { - const payload = serializeMetricBuckets(metricBucketItems); - const metricHeaders = { - type: "statsd", - length: payload.length - }; - return [metricHeaders, payload]; -} -__name(createMetricEnvelopeItem, "createMetricEnvelopeItem"); -class CounterMetric { - static { - __name(this, "CounterMetric"); - } - constructor(_value) { - this._value = _value; - } - /** @inheritDoc */ - get weight() { - return 1; - } - /** @inheritdoc */ - add(value4) { - this._value += value4; - } - /** @inheritdoc */ - toString() { - return `${this._value}`; - } -} -class GaugeMetric { - static { - __name(this, "GaugeMetric"); - } - constructor(value4) { - this._last = value4; - this._min = value4; - this._max = value4; - this._sum = value4; - this._count = 1; - } - /** @inheritDoc */ - get weight() { - return 5; - } - /** @inheritdoc */ - add(value4) { - this._last = value4; - if (value4 < this._min) { - this._min = value4; - } - if (value4 > this._max) { - this._max = value4; - } - this._sum += value4; - this._count++; - } - /** @inheritdoc */ - toString() { - return `${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`; - } -} -class DistributionMetric { - static { - __name(this, "DistributionMetric"); - } - constructor(first2) { - this._value = [first2]; - } - /** @inheritDoc */ - get weight() { - return this._value.length; - } - /** @inheritdoc */ - add(value4) { - this._value.push(value4); - } - /** @inheritdoc */ - toString() { - return this._value.join(":"); - } -} -class SetMetric { - static { - __name(this, "SetMetric"); - } - constructor(first2) { - this.first = first2; - this._value = /* @__PURE__ */ new Set([first2]); - } - /** @inheritDoc */ - get weight() { - return this._value.size; - } - /** @inheritdoc */ - add(value4) { - this._value.add(value4); - } - /** @inheritdoc */ - toString() { - return Array.from(this._value).map((val) => typeof val === "string" ? simpleHash(val) : val).join(":"); - } -} -const METRIC_MAP = { - [COUNTER_METRIC_TYPE]: CounterMetric, - [GAUGE_METRIC_TYPE]: GaugeMetric, - [DISTRIBUTION_METRIC_TYPE]: DistributionMetric, - [SET_METRIC_TYPE]: SetMetric -}; -class MetricsAggregator { - static { - __name(this, "MetricsAggregator"); - } - // TODO(@anonrig): Use FinalizationRegistry to have a proper way of flushing the buckets - // when the aggregator is garbage collected. - // Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry - // Different metrics have different weights. We use this to limit the number of metrics - // that we store in memory. - // We adjust the type here to add the `unref()` part, as setInterval can technically return a number or a NodeJS.Timer - // SDKs are required to shift the flush interval by random() * rollup_in_seconds. - // That shift is determined once per startup to create jittering. - // An SDK is required to perform force flushing ahead of scheduled time if the memory - // pressure is too high. There is no rule for this other than that SDKs should be tracking - // abstract aggregation complexity (eg: a counter only carries a single float, whereas a - // distribution is a float per emission). - // - // Force flush is used on either shutdown, flush() or when we exceed the max weight. - constructor(_client) { - this._client = _client; - this._buckets = /* @__PURE__ */ new Map(); - this._bucketsTotalWeight = 0; - this._interval = setInterval(() => this._flush(), DEFAULT_FLUSH_INTERVAL); - if (this._interval.unref) { - this._interval.unref(); - } - this._flushShift = Math.floor(Math.random() * DEFAULT_FLUSH_INTERVAL / 1e3); - this._forceFlush = false; - } - /** - * @inheritDoc - */ - add(metricType, unsanitizedName, value4, unsanitizedUnit = "none", unsanitizedTags = {}, maybeFloatTimestamp = timestampInSeconds()) { - const timestamp2 = Math.floor(maybeFloatTimestamp); - const name2 = sanitizeMetricKey(unsanitizedName); - const tags = sanitizeTags(unsanitizedTags); - const unit = sanitizeUnit(unsanitizedUnit); - const bucketKey = getBucketKey(metricType, name2, unit, tags); - let bucketItem = this._buckets.get(bucketKey); - const previousWeight = bucketItem && metricType === SET_METRIC_TYPE ? bucketItem.metric.weight : 0; - if (bucketItem) { - bucketItem.metric.add(value4); - if (bucketItem.timestamp < timestamp2) { - bucketItem.timestamp = timestamp2; - } - } else { - bucketItem = { - // @ts-expect-error we don't need to narrow down the type of value here, saves bundle size. - metric: new METRIC_MAP[metricType](value4), - timestamp: timestamp2, - metricType, - name: name2, - unit, - tags - }; - this._buckets.set(bucketKey, bucketItem); - } - const val = typeof value4 === "string" ? bucketItem.metric.weight - previousWeight : value4; - updateMetricSummaryOnActiveSpan(metricType, name2, val, unit, unsanitizedTags, bucketKey); - this._bucketsTotalWeight += bucketItem.metric.weight; - if (this._bucketsTotalWeight >= MAX_WEIGHT) { - this.flush(); - } - } - /** - * Flushes the current metrics to the transport via the transport. - */ - flush() { - this._forceFlush = true; - this._flush(); - } - /** - * Shuts down metrics aggregator and clears all metrics. - */ - close() { - this._forceFlush = true; - clearInterval(this._interval); - this._flush(); - } - /** - * Flushes the buckets according to the internal state of the aggregator. - * If it is a force flush, which happens on shutdown, it will flush all buckets. - * Otherwise, it will only flush buckets that are older than the flush interval, - * and according to the flush shift. - * - * This function mutates `_forceFlush` and `_bucketsTotalWeight` properties. - */ - _flush() { - if (this._forceFlush) { - this._forceFlush = false; - this._bucketsTotalWeight = 0; - this._captureMetrics(this._buckets); - this._buckets.clear(); - return; - } - const cutoffSeconds = Math.floor(timestampInSeconds()) - DEFAULT_FLUSH_INTERVAL / 1e3 - this._flushShift; - const flushedBuckets = /* @__PURE__ */ new Map(); - for (const [key, bucket] of this._buckets) { - if (bucket.timestamp <= cutoffSeconds) { - flushedBuckets.set(key, bucket); - this._bucketsTotalWeight -= bucket.metric.weight; - } - } - for (const [key] of flushedBuckets) { - this._buckets.delete(key); - } - this._captureMetrics(flushedBuckets); - } - /** - * Only captures a subset of the buckets passed to this function. - * @param flushedBuckets - */ - _captureMetrics(flushedBuckets) { - if (flushedBuckets.size > 0) { - const buckets = Array.from(flushedBuckets).map(([, bucketItem]) => bucketItem); - captureAggregateMetrics(this._client, buckets); - } - } -} -function increment$1(name2, value4 = 1, data26) { - metrics$1.increment(MetricsAggregator, name2, value4, data26); -} -__name(increment$1, "increment$1"); -function distribution$1(name2, value4, data26) { - metrics$1.distribution(MetricsAggregator, name2, value4, data26); -} -__name(distribution$1, "distribution$1"); -function set$3(name2, value4, data26) { - metrics$1.set(MetricsAggregator, name2, value4, data26); -} -__name(set$3, "set$3"); -function gauge$1(name2, value4, data26) { - metrics$1.gauge(MetricsAggregator, name2, value4, data26); -} -__name(gauge$1, "gauge$1"); -function timing$1(name2, value4, unit = "second", data26) { - return metrics$1.timing(MetricsAggregator, name2, value4, unit, data26); -} -__name(timing$1, "timing$1"); -function getMetricsAggregatorForClient(client) { - return metrics$1.getMetricsAggregatorForClient(client, MetricsAggregator); -} -__name(getMetricsAggregatorForClient, "getMetricsAggregatorForClient"); -const metricsDefault = { - increment: increment$1, - distribution: distribution$1, - set: set$3, - gauge: gauge$1, - timing: timing$1, - /** - * @ignore This is for internal use only. - */ - getMetricsAggregatorForClient -}; -class BrowserMetricsAggregator { - static { - __name(this, "BrowserMetricsAggregator"); - } - // TODO(@anonrig): Use FinalizationRegistry to have a proper way of flushing the buckets - // when the aggregator is garbage collected. - // Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry - constructor(_client) { - this._client = _client; - this._buckets = /* @__PURE__ */ new Map(); - this._interval = setInterval(() => this.flush(), DEFAULT_BROWSER_FLUSH_INTERVAL); - } - /** - * @inheritDoc - */ - add(metricType, unsanitizedName, value4, unsanitizedUnit = "none", unsanitizedTags = {}, maybeFloatTimestamp = timestampInSeconds()) { - const timestamp2 = Math.floor(maybeFloatTimestamp); - const name2 = sanitizeMetricKey(unsanitizedName); - const tags = sanitizeTags(unsanitizedTags); - const unit = sanitizeUnit(unsanitizedUnit); - const bucketKey = getBucketKey(metricType, name2, unit, tags); - let bucketItem = this._buckets.get(bucketKey); - const previousWeight = bucketItem && metricType === SET_METRIC_TYPE ? bucketItem.metric.weight : 0; - if (bucketItem) { - bucketItem.metric.add(value4); - if (bucketItem.timestamp < timestamp2) { - bucketItem.timestamp = timestamp2; - } - } else { - bucketItem = { - // @ts-expect-error we don't need to narrow down the type of value here, saves bundle size. - metric: new METRIC_MAP[metricType](value4), - timestamp: timestamp2, - metricType, - name: name2, - unit, - tags - }; - this._buckets.set(bucketKey, bucketItem); - } - const val = typeof value4 === "string" ? bucketItem.metric.weight - previousWeight : value4; - updateMetricSummaryOnActiveSpan(metricType, name2, val, unit, unsanitizedTags, bucketKey); - } - /** - * @inheritDoc - */ - flush() { - if (this._buckets.size === 0) { - return; - } - const metricBuckets = Array.from(this._buckets.values()); - captureAggregateMetrics(this._client, metricBuckets); - this._buckets.clear(); - } - /** - * @inheritDoc - */ - close() { - clearInterval(this._interval); - this.flush(); - } -} -function instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeaders2, spans, spanOrigin = "auto.http.browser") { - if (!handlerData.fetchData) { - return void 0; - } - const shouldCreateSpanResult = hasTracingEnabled() && shouldCreateSpan(handlerData.fetchData.url); - if (handlerData.endTimestamp && shouldCreateSpanResult) { - const spanId = handlerData.fetchData.__span; - if (!spanId) return; - const span2 = spans[spanId]; - if (span2) { - endSpan(span2, handlerData); - delete spans[spanId]; - } - return void 0; - } - const { method, url } = handlerData.fetchData; - const fullUrl = getFullURL$1(url); - const host = fullUrl ? parseUrl$1(fullUrl).host : void 0; - const hasParent = !!getActiveSpan(); - const span = shouldCreateSpanResult && hasParent ? startInactiveSpan({ - name: `${method} ${url}`, - attributes: { - url, - type: "fetch", - "http.method": method, - "http.url": fullUrl, - "server.address": host, - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin, - [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.client" - } - }) : new SentryNonRecordingSpan(); - handlerData.fetchData.__span = span.spanContext().spanId; - spans[span.spanContext().spanId] = span; - if (shouldAttachHeaders2(handlerData.fetchData.url)) { - const request = handlerData.args[0]; - const options4 = handlerData.args[1] || {}; - const headers = _addTracingHeadersToFetchRequest( - request, - options4, - // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction), - // we do not want to use the span as base for the trace headers, - // which means that the headers will be generated from the scope and the sampling decision is deferred - hasTracingEnabled() && hasParent ? span : void 0 - ); - if (headers) { - handlerData.args[1] = options4; - options4.headers = headers; - } - } - return span; -} -__name(instrumentFetchRequest, "instrumentFetchRequest"); -function _addTracingHeadersToFetchRequest(request, fetchOptionsObj, span) { - const traceHeaders = getTraceData({ span }); - const sentryTrace = traceHeaders["sentry-trace"]; - const baggage = traceHeaders.baggage; - if (!sentryTrace) { - return void 0; - } - const headers = fetchOptionsObj.headers || (isRequest$1(request) ? request.headers : void 0); - if (!headers) { - return { ...traceHeaders }; - } else if (isHeaders$1(headers)) { - const newHeaders = new Headers(headers); - newHeaders.set("sentry-trace", sentryTrace); - if (baggage) { - const prevBaggageHeader = newHeaders.get("baggage"); - if (prevBaggageHeader) { - const prevHeaderStrippedFromSentryBaggage = stripBaggageHeaderOfSentryBaggageValues(prevBaggageHeader); - newHeaders.set( - "baggage", - // If there are non-sentry entries (i.e. if the stripped string is non-empty/truthy) combine the stripped header and sentry baggage header - // otherwise just set the sentry baggage header - prevHeaderStrippedFromSentryBaggage ? `${prevHeaderStrippedFromSentryBaggage},${baggage}` : baggage - ); - } else { - newHeaders.set("baggage", baggage); - } - } - return newHeaders; - } else if (Array.isArray(headers)) { - const newHeaders = [ - ...headers.filter((header3) => { - return !(Array.isArray(header3) && header3[0] === "sentry-trace"); - }).map((header3) => { - if (Array.isArray(header3) && header3[0] === "baggage" && typeof header3[1] === "string") { - const [headerName, headerValue, ...rest] = header3; - return [headerName, stripBaggageHeaderOfSentryBaggageValues(headerValue), ...rest]; - } else { - return header3; - } - }), - // Attach the new sentry-trace header - ["sentry-trace", sentryTrace] - ]; - if (baggage) { - newHeaders.push(["baggage", baggage]); - } - return newHeaders; - } else { - const existingBaggageHeader = "baggage" in headers ? headers.baggage : void 0; - let newBaggageHeaders = []; - if (Array.isArray(existingBaggageHeader)) { - newBaggageHeaders = existingBaggageHeader.map( - (headerItem) => typeof headerItem === "string" ? stripBaggageHeaderOfSentryBaggageValues(headerItem) : headerItem - ).filter((headerItem) => headerItem === ""); - } else if (existingBaggageHeader) { - newBaggageHeaders.push(stripBaggageHeaderOfSentryBaggageValues(existingBaggageHeader)); - } - if (baggage) { - newBaggageHeaders.push(baggage); - } - return { - ...headers, - "sentry-trace": sentryTrace, - baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(",") : void 0 - }; - } -} -__name(_addTracingHeadersToFetchRequest, "_addTracingHeadersToFetchRequest"); -function addTracingHeadersToFetchRequest(request, _client, _scope, fetchOptionsObj, span) { - return _addTracingHeadersToFetchRequest(request, fetchOptionsObj, span); -} -__name(addTracingHeadersToFetchRequest, "addTracingHeadersToFetchRequest"); -function getFullURL$1(url) { - try { - const parsed = new URL(url); - return parsed.href; - } catch (e2) { - return void 0; - } -} -__name(getFullURL$1, "getFullURL$1"); -function endSpan(span, handlerData) { - if (handlerData.response) { - setHttpStatus(span, handlerData.response.status); - const contentLength = handlerData.response && handlerData.response.headers && handlerData.response.headers.get("content-length"); - if (contentLength) { - const contentLengthNum = parseInt(contentLength); - if (contentLengthNum > 0) { - span.setAttribute("http.response_content_length", contentLengthNum); - } - } - } else if (handlerData.error) { - span.setStatus({ code: SPAN_STATUS_ERROR, message: "internal_error" }); - } - span.end(); -} -__name(endSpan, "endSpan"); -function stripBaggageHeaderOfSentryBaggageValues(baggageHeader) { - return baggageHeader.split(",").filter((baggageEntry) => !baggageEntry.split("=")[0].startsWith(SENTRY_BAGGAGE_KEY_PREFIX)).join(","); -} -__name(stripBaggageHeaderOfSentryBaggageValues, "stripBaggageHeaderOfSentryBaggageValues"); -function isRequest$1(request) { - return typeof Request !== "undefined" && isInstanceOf(request, Request); -} -__name(isRequest$1, "isRequest$1"); -function isHeaders$1(headers) { - return typeof Headers !== "undefined" && isInstanceOf(headers, Headers); -} -__name(isHeaders$1, "isHeaders$1"); -const trpcCaptureContext = { mechanism: { handled: false, data: { function: "trpcMiddleware" } } }; -function captureIfError(nextResult) { - if (typeof nextResult === "object" && nextResult !== null && "ok" in nextResult && !nextResult.ok && "error" in nextResult) { - captureException(nextResult.error, trpcCaptureContext); - } -} -__name(captureIfError, "captureIfError"); -function trpcMiddleware(options4 = {}) { - return async function(opts) { - const { path, type, next: next2, rawInput, getRawInput } = opts; - const client = getClient(); - const clientOptions = client && client.getOptions(); - const trpcContext = { - procedure_path: path, - procedure_type: type - }; - if (options4.attachRpcInput !== void 0 ? options4.attachRpcInput : clientOptions && clientOptions.sendDefaultPii) { - if (rawInput !== void 0) { - trpcContext.input = normalize$3(rawInput); - } - if (getRawInput !== void 0 && typeof getRawInput === "function") { - try { - const rawRes = await getRawInput(); - trpcContext.input = normalize$3(rawRes); - } catch (err) { - } - } - } - return withScope((scope) => { - scope.setContext("trpc", trpcContext); - return startSpanManual( - { - name: `trpc/${path}`, - op: "rpc.server", - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "route", - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.rpc.trpc" - } - }, - async (span) => { - try { - const nextResult = await next2(); - captureIfError(nextResult); - span.end(); - return nextResult; - } catch (e2) { - captureException(e2, trpcCaptureContext); - span.end(); - throw e2; - } - } - ); - }); - }; -} -__name(trpcMiddleware, "trpcMiddleware"); -function captureFeedback(params, hint = {}, scope = getCurrentScope$1()) { - const { message: message3, name: name2, email, url, source, associatedEventId, tags } = params; - const feedbackEvent = { - contexts: { - feedback: dropUndefinedKeys({ - contact_email: email, - name: name2, - message: message3, - url, - source, - associated_event_id: associatedEventId - }) - }, - type: "feedback", - level: "info", - tags - }; - const client = scope && scope.getClient() || getClient(); - if (client) { - client.emit("beforeSendFeedback", feedbackEvent, hint); - } - const eventId = scope.captureEvent(feedbackEvent, hint); - return eventId; -} -__name(captureFeedback, "captureFeedback"); -function getCurrentHubShim() { - return { - bindClient(client) { - const scope = getCurrentScope$1(); - scope.setClient(client); - }, - withScope, - getClient: /* @__PURE__ */ __name(() => getClient(), "getClient"), - getScope: getCurrentScope$1, - getIsolationScope, - captureException: /* @__PURE__ */ __name((exception, hint) => { - return getCurrentScope$1().captureException(exception, hint); - }, "captureException"), - captureMessage: /* @__PURE__ */ __name((message3, level, hint) => { - return getCurrentScope$1().captureMessage(message3, level, hint); - }, "captureMessage"), - captureEvent, - addBreadcrumb, - setUser, - setTags, - setTag: setTag$5, - setExtra, - setExtras, - setContext, - getIntegration(integration) { - const client = getClient(); - return client && client.getIntegrationByName(integration.id) || null; - }, - startSession, - endSession, - captureSession(end) { - if (end) { - return endSession(); - } - _sendSessionUpdate(); - } - }; -} -__name(getCurrentHubShim, "getCurrentHubShim"); -const getCurrentHub = getCurrentHubShim; -function _sendSessionUpdate() { - const scope = getCurrentScope$1(); - const client = getClient(); - const session = scope.getSession(); - if (client && session) { - client.captureSession(session); - } -} -__name(_sendSessionUpdate, "_sendSessionUpdate"); -function flatten(input) { - const result = []; - const flattenHelper = /* @__PURE__ */ __name((input2) => { - input2.forEach((el) => { - if (Array.isArray(el)) { - flattenHelper(el); - } else { - result.push(el); - } - }); - }, "flattenHelper"); - flattenHelper(input); - return result; -} -__name(flatten, "flatten"); -function getBreadcrumbLogLevelFromHttpStatusCode(statusCode) { - if (statusCode === void 0) { - return void 0; - } else if (statusCode >= 400 && statusCode < 500) { - return "warning"; - } else if (statusCode >= 500) { - return "error"; - } else { - return void 0; - } -} -__name(getBreadcrumbLogLevelFromHttpStatusCode, "getBreadcrumbLogLevelFromHttpStatusCode"); -const WINDOW$7 = GLOBAL_OBJ; -function supportsErrorEvent() { - try { - new ErrorEvent(""); - return true; - } catch (e2) { - return false; - } -} -__name(supportsErrorEvent, "supportsErrorEvent"); -function supportsDOMError() { - try { - new DOMError(""); - return true; - } catch (e2) { - return false; - } -} -__name(supportsDOMError, "supportsDOMError"); -function supportsDOMException() { - try { - new DOMException(""); - return true; - } catch (e2) { - return false; - } -} -__name(supportsDOMException, "supportsDOMException"); -function supportsFetch() { - if (!("fetch" in WINDOW$7)) { - return false; - } - try { - new Headers(); - new Request("http://www.example.com"); - new Response(); - return true; - } catch (e2) { - return false; - } -} -__name(supportsFetch, "supportsFetch"); -function isNativeFunction(func) { - return func && /^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); -} -__name(isNativeFunction, "isNativeFunction"); -function supportsNativeFetch() { - if (typeof EdgeRuntime === "string") { - return true; - } - if (!supportsFetch()) { - return false; - } - if (isNativeFunction(WINDOW$7.fetch)) { - return true; - } - let result = false; - const doc2 = WINDOW$7.document; - if (doc2 && typeof doc2.createElement === "function") { - try { - const sandbox = doc2.createElement("iframe"); - sandbox.hidden = true; - doc2.head.appendChild(sandbox); - if (sandbox.contentWindow && sandbox.contentWindow.fetch) { - result = isNativeFunction(sandbox.contentWindow.fetch); - } - doc2.head.removeChild(sandbox); - } catch (err) { - DEBUG_BUILD$5 && logger$2.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ", err); - } - } - return result; -} -__name(supportsNativeFetch, "supportsNativeFetch"); -function supportsReportingObserver() { - return "ReportingObserver" in WINDOW$7; -} -__name(supportsReportingObserver, "supportsReportingObserver"); -function supportsReferrerPolicy() { - if (!supportsFetch()) { - return false; - } - try { - new Request("_", { - referrerPolicy: "origin" - }); - return true; - } catch (e2) { - return false; - } -} -__name(supportsReferrerPolicy, "supportsReferrerPolicy"); -function addFetchInstrumentationHandler(handler10, skipNativeFetchCheck) { - const type = "fetch"; - addHandler$1(type, handler10); - maybeInstrument(type, () => instrumentFetch(void 0, skipNativeFetchCheck)); -} -__name(addFetchInstrumentationHandler, "addFetchInstrumentationHandler"); -function addFetchEndInstrumentationHandler(handler10) { - const type = "fetch-body-resolved"; - addHandler$1(type, handler10); - maybeInstrument(type, () => instrumentFetch(streamHandler)); -} -__name(addFetchEndInstrumentationHandler, "addFetchEndInstrumentationHandler"); -function instrumentFetch(onFetchResolved, skipNativeFetchCheck = false) { - if (skipNativeFetchCheck && !supportsNativeFetch()) { - return; - } - fill(GLOBAL_OBJ, "fetch", function(originalFetch) { - return function(...args) { - const virtualError = new Error(); - const { method, url } = parseFetchArgs(args); - const handlerData = { - args, - fetchData: { - method, - url - }, - startTimestamp: timestampInSeconds() * 1e3, - // // Adding the error to be able to fingerprint the failed fetch event in HttpClient instrumentation - virtualError - }; - if (!onFetchResolved) { - triggerHandlers$1("fetch", { - ...handlerData - }); - } - return originalFetch.apply(GLOBAL_OBJ, args).then( - async (response) => { - if (onFetchResolved) { - onFetchResolved(response); - } else { - triggerHandlers$1("fetch", { - ...handlerData, - endTimestamp: timestampInSeconds() * 1e3, - response - }); - } - return response; - }, - (error2) => { - triggerHandlers$1("fetch", { - ...handlerData, - endTimestamp: timestampInSeconds() * 1e3, - error: error2 - }); - if (isError(error2) && error2.stack === void 0) { - error2.stack = virtualError.stack; - addNonEnumerableProperty(error2, "framesToPop", 1); - } - throw error2; - } - ); - }; - }); -} -__name(instrumentFetch, "instrumentFetch"); -async function resolveResponse(res, onFinishedResolving) { - if (res && res.body) { - const body = res.body; - const responseReader = body.getReader(); - const maxFetchDurationTimeout = setTimeout( - () => { - body.cancel().then(null, () => { - }); - }, - 90 * 1e3 - // 90s - ); - let readingActive = true; - while (readingActive) { - let chunkTimeout; - try { - chunkTimeout = setTimeout(() => { - body.cancel().then(null, () => { - }); - }, 5e3); - const { done } = await responseReader.read(); - clearTimeout(chunkTimeout); - if (done) { - onFinishedResolving(); - readingActive = false; - } - } catch (error2) { - readingActive = false; - } finally { - clearTimeout(chunkTimeout); - } - } - clearTimeout(maxFetchDurationTimeout); - responseReader.releaseLock(); - body.cancel().then(null, () => { - }); - } -} -__name(resolveResponse, "resolveResponse"); -function streamHandler(response) { - let clonedResponseForResolving; - try { - clonedResponseForResolving = response.clone(); - } catch (e2) { - return; - } - resolveResponse(clonedResponseForResolving, () => { - triggerHandlers$1("fetch-body-resolved", { - endTimestamp: timestampInSeconds() * 1e3, - response - }); - }); -} -__name(streamHandler, "streamHandler"); -function hasProp(obj, prop2) { - return !!obj && typeof obj === "object" && !!obj[prop2]; -} -__name(hasProp, "hasProp"); -function getUrlFromResource(resource) { - if (typeof resource === "string") { - return resource; - } - if (!resource) { - return ""; - } - if (hasProp(resource, "url")) { - return resource.url; - } - if (resource.toString) { - return resource.toString(); - } - return ""; -} -__name(getUrlFromResource, "getUrlFromResource"); -function parseFetchArgs(fetchArgs) { - if (fetchArgs.length === 0) { - return { method: "GET", url: "" }; - } - if (fetchArgs.length === 2) { - const [url, options4] = fetchArgs; - return { - url: getUrlFromResource(url), - method: hasProp(options4, "method") ? String(options4.method).toUpperCase() : "GET" - }; - } - const arg = fetchArgs[0]; - return { - url: getUrlFromResource(arg), - method: hasProp(arg, "method") ? String(arg.method).toUpperCase() : "GET" - }; -} -__name(parseFetchArgs, "parseFetchArgs"); -function isBrowserBundle() { - return typeof __SENTRY_BROWSER_BUNDLE__ !== "undefined" && !!__SENTRY_BROWSER_BUNDLE__; -} -__name(isBrowserBundle, "isBrowserBundle"); -function getSDKSource() { - return "npm"; -} -__name(getSDKSource, "getSDKSource"); -function isNodeEnv() { - return !isBrowserBundle() && Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]"; -} -__name(isNodeEnv, "isNodeEnv"); -function dynamicRequire(mod, request) { - return mod.require(request); -} -__name(dynamicRequire, "dynamicRequire"); -function loadModule(moduleName, existingModule = module) { - let mod; - try { - mod = dynamicRequire(existingModule, moduleName); - } catch (e2) { - } - if (!mod) { - try { - const { cwd } = dynamicRequire(existingModule, "process"); - mod = dynamicRequire(existingModule, `${cwd()}/node_modules/${moduleName}`); - } catch (e2) { - } - } - return mod; -} -__name(loadModule, "loadModule"); -function isBrowser$1() { - return typeof window !== "undefined" && (!isNodeEnv() || isElectronNodeRenderer()); -} -__name(isBrowser$1, "isBrowser$1"); -function isElectronNodeRenderer() { - const process2 = GLOBAL_OBJ.process; - return !!process2 && process2.type === "renderer"; -} -__name(isElectronNodeRenderer, "isElectronNodeRenderer"); -function filenameIsInApp(filename, isNative = false) { - const isInternal = isNative || filename && // It's not internal if it's an absolute linux path - !filename.startsWith("/") && // It's not internal if it's an absolute windows path - !filename.match(/^[A-Z]:/) && // It's not internal if the path is starting with a dot - !filename.startsWith(".") && // It's not internal if the frame has a protocol. In node, this is usually the case if the file got pre-processed with a bundler like webpack - !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//); - return !isInternal && filename !== void 0 && !filename.includes("node_modules/"); -} -__name(filenameIsInApp, "filenameIsInApp"); -function node(getModule) { - const FILENAME_MATCH = /^\s*[-]{4,}$/; - const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/; - return (line) => { - const lineMatch = line.match(FULL_MATCH); - if (lineMatch) { - let object; - let method; - let functionName; - let typeName; - let methodName; - if (lineMatch[1]) { - functionName = lineMatch[1]; - let methodStart = functionName.lastIndexOf("."); - if (functionName[methodStart - 1] === ".") { - methodStart--; - } - if (methodStart > 0) { - object = functionName.slice(0, methodStart); - method = functionName.slice(methodStart + 1); - const objectEnd = object.indexOf(".Module"); - if (objectEnd > 0) { - functionName = functionName.slice(objectEnd + 1); - object = object.slice(0, objectEnd); - } - } - typeName = void 0; - } - if (method) { - typeName = object; - methodName = method; - } - if (method === "") { - methodName = void 0; - functionName = void 0; - } - if (functionName === void 0) { - methodName = methodName || UNKNOWN_FUNCTION; - functionName = typeName ? `${typeName}.${methodName}` : methodName; - } - let filename = lineMatch[2] && lineMatch[2].startsWith("file://") ? lineMatch[2].slice(7) : lineMatch[2]; - const isNative = lineMatch[5] === "native"; - if (filename && filename.match(/\/[A-Z]:/)) { - filename = filename.slice(1); - } - if (!filename && lineMatch[5] && !isNative) { - filename = lineMatch[5]; - } - return { - filename: filename ? decodeURI(filename) : void 0, - module: getModule ? getModule(filename) : void 0, - function: functionName, - lineno: _parseIntOrUndefined(lineMatch[3]), - colno: _parseIntOrUndefined(lineMatch[4]), - in_app: filenameIsInApp(filename || "", isNative) - }; - } - if (line.match(FILENAME_MATCH)) { - return { - filename: line - }; - } - return void 0; - }; -} -__name(node, "node"); -function nodeStackLineParser(getModule) { - return [90, node(getModule)]; -} -__name(nodeStackLineParser, "nodeStackLineParser"); -function _parseIntOrUndefined(input) { - return parseInt(input || "", 10) || void 0; -} -__name(_parseIntOrUndefined, "_parseIntOrUndefined"); -function makeFifoCache(size) { - let evictionOrder = []; - let cache2 = {}; - return { - add(key, value4) { - while (evictionOrder.length >= size) { - const evictCandidate = evictionOrder.shift(); - if (evictCandidate !== void 0) { - delete cache2[evictCandidate]; - } - } - if (cache2[key]) { - this.delete(key); - } - evictionOrder.push(key); - cache2[key] = value4; - }, - clear() { - cache2 = {}; - evictionOrder = []; - }, - get(key) { - return cache2[key]; - }, - size() { - return evictionOrder.length; - }, - // Delete cache key and return true if it existed, false otherwise. - delete(key) { - if (!cache2[key]) { - return false; - } - delete cache2[key]; - for (let i2 = 0; i2 < evictionOrder.length; i2++) { - if (evictionOrder[i2] === key) { - evictionOrder.splice(i2, 1); - break; - } - } - return true; - } - }; -} -__name(makeFifoCache, "makeFifoCache"); -function watchdogTimer(createTimer, pollInterval, anrThreshold, callback) { - const timer = createTimer(); - let triggered = false; - let enabled = true; - setInterval(() => { - const diffMs = timer.getTimeMs(); - if (triggered === false && diffMs > pollInterval + anrThreshold) { - triggered = true; - if (enabled) { - callback(); - } - } - if (diffMs < pollInterval + anrThreshold) { - triggered = false; - } - }, 20); - return { - poll: /* @__PURE__ */ __name(() => { - timer.reset(); - }, "poll"), - enabled: /* @__PURE__ */ __name((state) => { - enabled = state; - }, "enabled") - }; -} -__name(watchdogTimer, "watchdogTimer"); -function callFrameToStackFrame(frame, url, getModuleFromFilename) { - const filename = url ? url.replace(/^file:\/\//, "") : void 0; - const colno = frame.location.columnNumber ? frame.location.columnNumber + 1 : void 0; - const lineno = frame.location.lineNumber ? frame.location.lineNumber + 1 : void 0; - return dropUndefinedKeys({ - filename, - module: getModuleFromFilename(filename), - function: frame.functionName || UNKNOWN_FUNCTION, - colno, - lineno, - in_app: filename ? filenameIsInApp(filename) : void 0 - }); -} -__name(callFrameToStackFrame, "callFrameToStackFrame"); -class LRUMap { - static { - __name(this, "LRUMap"); - } - constructor(_maxSize) { - this._maxSize = _maxSize; - this._cache = /* @__PURE__ */ new Map(); - } - /** Get the current size of the cache */ - get size() { - return this._cache.size; - } - /** Get an entry or undefined if it was not in the cache. Re-inserts to update the recently used order */ - get(key) { - const value4 = this._cache.get(key); - if (value4 === void 0) { - return void 0; - } - this._cache.delete(key); - this._cache.set(key, value4); - return value4; - } - /** Insert an entry and evict an older entry if we've reached maxSize */ - set(key, value4) { - if (this._cache.size >= this._maxSize) { - this._cache.delete(this._cache.keys().next().value); - } - this._cache.set(key, value4); - } - /** Remove an entry and return the entry if it was in the cache */ - remove(key) { - const value4 = this._cache.get(key); - if (value4) { - this._cache.delete(key); - } - return value4; - } - /** Clear all entries */ - clear() { - this._cache.clear(); - } - /** Get all the keys */ - keys() { - return Array.from(this._cache.keys()); - } - /** Get all the values */ - values() { - const values = []; - this._cache.forEach((value4) => values.push(value4)); - return values; - } -} -function vercelWaitUntil(task) { - const vercelRequestContextGlobal = ( - // @ts-expect-error This is not typed - GLOBAL_OBJ[Symbol.for("@vercel/request-context")] - ); - const ctx = vercelRequestContextGlobal && vercelRequestContextGlobal.get && vercelRequestContextGlobal.get() ? vercelRequestContextGlobal.get() : {}; - if (ctx && ctx.waitUntil) { - ctx.waitUntil(task); - } -} -__name(vercelWaitUntil, "vercelWaitUntil"); -function escapeStringForRegex(regexString) { - return regexString.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); -} -__name(escapeStringForRegex, "escapeStringForRegex"); -const WINDOW$6 = GLOBAL_OBJ; -function supportsHistory() { - const chromeVar = WINDOW$6.chrome; - const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime; - const hasHistoryApi = "history" in WINDOW$6 && !!WINDOW$6.history.pushState && !!WINDOW$6.history.replaceState; - return !isChromePackagedApp && hasHistoryApi; -} -__name(supportsHistory, "supportsHistory"); -function _nullishCoalesce(lhs, rhsFn) { - return lhs != null ? lhs : rhsFn(); -} -__name(_nullishCoalesce, "_nullishCoalesce"); -async function _asyncNullishCoalesce(lhs, rhsFn) { - return _nullishCoalesce(lhs, rhsFn); -} -__name(_asyncNullishCoalesce, "_asyncNullishCoalesce"); -async function _asyncOptionalChain(ops) { - let lastAccessLHS = void 0; - let value4 = ops[0]; - let i2 = 1; - while (i2 < ops.length) { - const op = ops[i2]; - const fn = ops[i2 + 1]; - i2 += 2; - if ((op === "optionalAccess" || op === "optionalCall") && value4 == null) { - return; - } - if (op === "access" || op === "optionalAccess") { - lastAccessLHS = value4; - value4 = await fn(value4); - } else if (op === "call" || op === "optionalCall") { - value4 = await fn((...args) => value4.call(lastAccessLHS, ...args)); - lastAccessLHS = void 0; - } - } - return value4; -} -__name(_asyncOptionalChain, "_asyncOptionalChain"); -async function _asyncOptionalChainDelete(ops) { - const result = await _asyncOptionalChain(ops); - return result == null ? true : result; -} -__name(_asyncOptionalChainDelete, "_asyncOptionalChainDelete"); -function _optionalChain(ops) { - let lastAccessLHS = void 0; - let value4 = ops[0]; - let i2 = 1; - while (i2 < ops.length) { - const op = ops[i2]; - const fn = ops[i2 + 1]; - i2 += 2; - if ((op === "optionalAccess" || op === "optionalCall") && value4 == null) { - return; - } - if (op === "access" || op === "optionalAccess") { - lastAccessLHS = value4; - value4 = fn(value4); - } else if (op === "call" || op === "optionalCall") { - value4 = fn((...args) => value4.call(lastAccessLHS, ...args)); - lastAccessLHS = void 0; - } - } - return value4; -} -__name(_optionalChain, "_optionalChain"); -function _optionalChainDelete(ops) { - const result = _optionalChain(ops); - return result == null ? true : result; -} -__name(_optionalChainDelete, "_optionalChainDelete"); -const WINDOW$5 = GLOBAL_OBJ; -let ignoreOnError = 0; -function shouldIgnoreOnError() { - return ignoreOnError > 0; -} -__name(shouldIgnoreOnError, "shouldIgnoreOnError"); -function ignoreNextOnError() { - ignoreOnError++; - setTimeout(() => { - ignoreOnError--; - }); -} -__name(ignoreNextOnError, "ignoreNextOnError"); -function wrap$1(fn, options4 = {}) { - function isFunction2(fn2) { - return typeof fn2 === "function"; - } - __name(isFunction2, "isFunction"); - if (!isFunction2(fn)) { - return fn; - } - try { - const wrapper = fn.__sentry_wrapped__; - if (wrapper) { - if (typeof wrapper === "function") { - return wrapper; - } else { - return fn; - } - } - if (getOriginalFunction(fn)) { - return fn; - } - } catch (e2) { - return fn; - } - const sentryWrapped = /* @__PURE__ */ __name(function(...args) { - try { - const wrappedArguments = args.map((arg) => wrap$1(arg, options4)); - return fn.apply(this, wrappedArguments); - } catch (ex) { - ignoreNextOnError(); - withScope((scope) => { - scope.addEventProcessor((event) => { - if (options4.mechanism) { - addExceptionTypeValue(event, void 0, void 0); - addExceptionMechanism(event, options4.mechanism); - } - event.extra = { - ...event.extra, - arguments: args - }; - return event; - }); - captureException(ex); - }); - throw ex; - } - }, "sentryWrapped"); - try { - for (const property in fn) { - if (Object.prototype.hasOwnProperty.call(fn, property)) { - sentryWrapped[property] = fn[property]; - } - } - } catch (e2) { - } - markFunctionWrapped(sentryWrapped, fn); - addNonEnumerableProperty(fn, "__sentry_wrapped__", sentryWrapped); - try { - const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, "name"); - if (descriptor.configurable) { - Object.defineProperty(sentryWrapped, "name", { - get() { - return fn.name; - } - }); - } - } catch (e3) { - } - return sentryWrapped; -} -__name(wrap$1, "wrap$1"); -const DEBUG_BUILD$4 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; -function exceptionFromError(stackParser, ex) { - const frames = parseStackFrames(stackParser, ex); - const exception = { - type: extractType(ex), - value: extractMessage(ex) - }; - if (frames.length) { - exception.stacktrace = { frames }; - } - if (exception.type === void 0 && exception.value === "") { - exception.value = "Unrecoverable error caught"; - } - return exception; -} -__name(exceptionFromError, "exceptionFromError"); -function eventFromPlainObject(stackParser, exception, syntheticException, isUnhandledRejection) { - const client = getClient(); - const normalizeDepth = client && client.getOptions().normalizeDepth; - const errorFromProp = getErrorPropertyFromObject(exception); - const extra = { - __serialized__: normalizeToSize(exception, normalizeDepth) - }; - if (errorFromProp) { - return { - exception: { - values: [exceptionFromError(stackParser, errorFromProp)] - }, - extra - }; - } - const event = { - exception: { - values: [ - { - type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? "UnhandledRejection" : "Error", - value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }) - } - ] - }, - extra - }; - if (syntheticException) { - const frames = parseStackFrames(stackParser, syntheticException); - if (frames.length) { - event.exception.values[0].stacktrace = { frames }; - } - } - return event; -} -__name(eventFromPlainObject, "eventFromPlainObject"); -function eventFromError(stackParser, ex) { - return { - exception: { - values: [exceptionFromError(stackParser, ex)] - } - }; -} -__name(eventFromError, "eventFromError"); -function parseStackFrames(stackParser, ex) { - const stacktrace = ex.stacktrace || ex.stack || ""; - const skipLines = getSkipFirstStackStringLines(ex); - const framesToPop = getPopFirstTopFrames(ex); - try { - return stackParser(stacktrace, skipLines, framesToPop); - } catch (e2) { - } - return []; -} -__name(parseStackFrames, "parseStackFrames"); -const reactMinifiedRegexp = /Minified React error #\d+;/i; -function getSkipFirstStackStringLines(ex) { - if (ex && reactMinifiedRegexp.test(ex.message)) { - return 1; - } - return 0; -} -__name(getSkipFirstStackStringLines, "getSkipFirstStackStringLines"); -function getPopFirstTopFrames(ex) { - if (typeof ex.framesToPop === "number") { - return ex.framesToPop; - } - return 0; -} -__name(getPopFirstTopFrames, "getPopFirstTopFrames"); -function isWebAssemblyException(exception) { - if (typeof WebAssembly !== "undefined" && typeof WebAssembly.Exception !== "undefined") { - return exception instanceof WebAssembly.Exception; - } else { - return false; - } -} -__name(isWebAssemblyException, "isWebAssemblyException"); -function extractType(ex) { - const name2 = ex && ex.name; - if (!name2 && isWebAssemblyException(ex)) { - const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2; - return hasTypeInMessage ? ex.message[0] : "WebAssembly.Exception"; - } - return name2; -} -__name(extractType, "extractType"); -function extractMessage(ex) { - const message3 = ex && ex.message; - if (!message3) { - return "No error message"; - } - if (message3.error && typeof message3.error.message === "string") { - return message3.error.message; - } - if (isWebAssemblyException(ex) && Array.isArray(ex.message) && ex.message.length == 2) { - return ex.message[1]; - } - return message3; -} -__name(extractMessage, "extractMessage"); -function eventFromException(stackParser, exception, hint, attachStacktrace) { - const syntheticException = hint && hint.syntheticException || void 0; - const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace); - addExceptionMechanism(event); - event.level = "error"; - if (hint && hint.event_id) { - event.event_id = hint.event_id; - } - return resolvedSyncPromise(event); -} -__name(eventFromException, "eventFromException"); -function eventFromMessage(stackParser, message3, level = "info", hint, attachStacktrace) { - const syntheticException = hint && hint.syntheticException || void 0; - const event = eventFromString(stackParser, message3, syntheticException, attachStacktrace); - event.level = level; - if (hint && hint.event_id) { - event.event_id = hint.event_id; - } - return resolvedSyncPromise(event); -} -__name(eventFromMessage, "eventFromMessage"); -function eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace, isUnhandledRejection) { - let event; - if (isErrorEvent$2(exception) && exception.error) { - const errorEvent = exception; - return eventFromError(stackParser, errorEvent.error); - } - if (isDOMError(exception) || isDOMException(exception)) { - const domException = exception; - if ("stack" in exception) { - event = eventFromError(stackParser, exception); - } else { - const name2 = domException.name || (isDOMError(domException) ? "DOMError" : "DOMException"); - const message3 = domException.message ? `${name2}: ${domException.message}` : name2; - event = eventFromString(stackParser, message3, syntheticException, attachStacktrace); - addExceptionTypeValue(event, message3); - } - if ("code" in domException) { - event.tags = { ...event.tags, "DOMException.code": `${domException.code}` }; - } - return event; - } - if (isError(exception)) { - return eventFromError(stackParser, exception); - } - if (isPlainObject$5(exception) || isEvent(exception)) { - const objectException = exception; - event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection); - addExceptionMechanism(event, { - synthetic: true - }); - return event; - } - event = eventFromString(stackParser, exception, syntheticException, attachStacktrace); - addExceptionTypeValue(event, `${exception}`, void 0); - addExceptionMechanism(event, { - synthetic: true - }); - return event; -} -__name(eventFromUnknownInput, "eventFromUnknownInput"); -function eventFromString(stackParser, message3, syntheticException, attachStacktrace) { - const event = {}; - if (attachStacktrace && syntheticException) { - const frames = parseStackFrames(stackParser, syntheticException); - if (frames.length) { - event.exception = { - values: [{ value: message3, stacktrace: { frames } }] - }; - } - addExceptionMechanism(event, { synthetic: true }); - } - if (isParameterizedString(message3)) { - const { __sentry_template_string__, __sentry_template_values__ } = message3; - event.logentry = { - message: __sentry_template_string__, - params: __sentry_template_values__ - }; - return event; - } - event.message = message3; - return event; -} -__name(eventFromString, "eventFromString"); -function getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }) { - const keys2 = extractExceptionKeysForMessage(exception); - const captureType = isUnhandledRejection ? "promise rejection" : "exception"; - if (isErrorEvent$2(exception)) { - return `Event \`ErrorEvent\` captured as ${captureType} with message \`${exception.message}\``; - } - if (isEvent(exception)) { - const className = getObjectClassName(exception); - return `Event \`${className}\` (type=${exception.type}) captured as ${captureType}`; - } - return `Object captured as ${captureType} with keys: ${keys2}`; -} -__name(getNonErrorObjectExceptionValue, "getNonErrorObjectExceptionValue"); -function getObjectClassName(obj) { - try { - const prototype2 = Object.getPrototypeOf(obj); - return prototype2 ? prototype2.constructor.name : void 0; - } catch (e2) { - } -} -__name(getObjectClassName, "getObjectClassName"); -function getErrorPropertyFromObject(obj) { - for (const prop2 in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop2)) { - const value4 = obj[prop2]; - if (value4 instanceof Error) { - return value4; - } - } - } - return void 0; -} -__name(getErrorPropertyFromObject, "getErrorPropertyFromObject"); -function createUserFeedbackEnvelope(feedback, { - metadata, - tunnel, - dsn -}) { - const headers = { - event_id: feedback.event_id, - sent_at: (/* @__PURE__ */ new Date()).toISOString(), - ...metadata && metadata.sdk && { - sdk: { - name: metadata.sdk.name, - version: metadata.sdk.version - } - }, - ...!!tunnel && !!dsn && { dsn: dsnToString(dsn) } - }; - const item3 = createUserFeedbackEnvelopeItem(feedback); - return createEnvelope(headers, [item3]); -} -__name(createUserFeedbackEnvelope, "createUserFeedbackEnvelope"); -function createUserFeedbackEnvelopeItem(feedback) { - const feedbackHeaders = { - type: "user_report" - }; - return [feedbackHeaders, feedback]; -} -__name(createUserFeedbackEnvelopeItem, "createUserFeedbackEnvelopeItem"); -class BrowserClient extends BaseClient { - static { - __name(this, "BrowserClient"); - } - /** - * Creates a new Browser SDK instance. - * - * @param options Configuration options for this SDK. - */ - constructor(options4) { - const opts = { - // We default this to true, as it is the safer scenario - parentSpanIsAlwaysRootSpan: true, - ...options4 - }; - const sdkSource = WINDOW$5.SENTRY_SDK_SOURCE || getSDKSource(); - applySdkMetadata(opts, "browser", ["browser"], sdkSource); - super(opts); - if (opts.sendClientReports && WINDOW$5.document) { - WINDOW$5.document.addEventListener("visibilitychange", () => { - if (WINDOW$5.document.visibilityState === "hidden") { - this._flushOutcomes(); - } - }); - } - } - /** - * @inheritDoc - */ - eventFromException(exception, hint) { - return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace); - } - /** - * @inheritDoc - */ - eventFromMessage(message3, level = "info", hint) { - return eventFromMessage(this._options.stackParser, message3, level, hint, this._options.attachStacktrace); - } - /** - * Sends user feedback to Sentry. - * - * @deprecated Use `captureFeedback` instead. - */ - captureUserFeedback(feedback) { - if (!this._isEnabled()) { - DEBUG_BUILD$4 && logger$2.warn("SDK not enabled, will not capture user feedback."); - return; - } - const envelope = createUserFeedbackEnvelope(feedback, { - metadata: this.getSdkMetadata(), - dsn: this.getDsn(), - tunnel: this.getOptions().tunnel - }); - this.sendEnvelope(envelope); - } - /** - * @inheritDoc - */ - _prepareEvent(event, hint, scope) { - event.platform = event.platform || "javascript"; - return super._prepareEvent(event, hint, scope); - } -} -const DEBUG_BUILD$3 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; -const getRating = /* @__PURE__ */ __name((value4, thresholds) => { - if (value4 > thresholds[1]) { - return "poor"; - } - if (value4 > thresholds[0]) { - return "needs-improvement"; - } - return "good"; -}, "getRating"); -const bindReporter = /* @__PURE__ */ __name((callback, metric, thresholds, reportAllChanges) => { - let prevValue; - let delta2; - return (forceReport) => { - if (metric.value >= 0) { - if (forceReport || reportAllChanges) { - delta2 = metric.value - (prevValue || 0); - if (delta2 || prevValue === void 0) { - prevValue = metric.value; - metric.delta = delta2; - metric.rating = getRating(metric.value, thresholds); - callback(metric); - } - } - } - }; -}, "bindReporter"); -const WINDOW$4 = GLOBAL_OBJ; -const generateUniqueID = /* @__PURE__ */ __name(() => { - return `v4-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`; -}, "generateUniqueID"); -const getNavigationEntry = /* @__PURE__ */ __name((checkResponseStart = true) => { - const navigationEntry = WINDOW$4.performance && WINDOW$4.performance.getEntriesByType && WINDOW$4.performance.getEntriesByType("navigation")[0]; - if ( - // sentry-specific change: - // We don't want to check for responseStart for our own use of `getNavigationEntry` - !checkResponseStart || navigationEntry && navigationEntry.responseStart > 0 && navigationEntry.responseStart < performance.now() - ) { - return navigationEntry; - } -}, "getNavigationEntry"); -const getActivationStart = /* @__PURE__ */ __name(() => { - const navEntry = getNavigationEntry(); - return navEntry && navEntry.activationStart || 0; -}, "getActivationStart"); -const initMetric = /* @__PURE__ */ __name((name2, value4) => { - const navEntry = getNavigationEntry(); - let navigationType = "navigate"; - if (navEntry) { - if (WINDOW$4.document && WINDOW$4.document.prerendering || getActivationStart() > 0) { - navigationType = "prerender"; - } else if (WINDOW$4.document && WINDOW$4.document.wasDiscarded) { - navigationType = "restore"; - } else if (navEntry.type) { - navigationType = navEntry.type.replace(/_/g, "-"); - } - } - const entries = []; - return { - name: name2, - value: typeof value4 === "undefined" ? -1 : value4, - rating: "good", - // If needed, will be updated when reported. `const` to keep the type from widening to `string`. - delta: 0, - entries, - id: generateUniqueID(), - navigationType - }; -}, "initMetric"); -const observe = /* @__PURE__ */ __name((type, callback, opts) => { - try { - if (PerformanceObserver.supportedEntryTypes.includes(type)) { - const po2 = new PerformanceObserver((list2) => { - Promise.resolve().then(() => { - callback(list2.getEntries()); - }); - }); - po2.observe( - Object.assign( - { - type, - buffered: true - }, - opts || {} - ) - ); - return po2; - } - } catch (e2) { - } - return; -}, "observe"); -const onHidden = /* @__PURE__ */ __name((cb) => { - const onHiddenOrPageHide = /* @__PURE__ */ __name((event) => { - if (event.type === "pagehide" || WINDOW$4.document && WINDOW$4.document.visibilityState === "hidden") { - cb(event); - } - }, "onHiddenOrPageHide"); - if (WINDOW$4.document) { - addEventListener("visibilitychange", onHiddenOrPageHide, true); - addEventListener("pagehide", onHiddenOrPageHide, true); - } -}, "onHidden"); -const runOnce = /* @__PURE__ */ __name((cb) => { - let called = false; - return () => { - if (!called) { - cb(); - called = true; - } - }; -}, "runOnce"); -let firstHiddenTime = -1; -const initHiddenTime = /* @__PURE__ */ __name(() => { - return WINDOW$4.document.visibilityState === "hidden" && !WINDOW$4.document.prerendering ? 0 : Infinity; -}, "initHiddenTime"); -const onVisibilityUpdate = /* @__PURE__ */ __name((event) => { - if (WINDOW$4.document.visibilityState === "hidden" && firstHiddenTime > -1) { - firstHiddenTime = event.type === "visibilitychange" ? event.timeStamp : 0; - removeChangeListeners(); - } -}, "onVisibilityUpdate"); -const addChangeListeners = /* @__PURE__ */ __name(() => { - addEventListener("visibilitychange", onVisibilityUpdate, true); - addEventListener("prerenderingchange", onVisibilityUpdate, true); -}, "addChangeListeners"); -const removeChangeListeners = /* @__PURE__ */ __name(() => { - removeEventListener("visibilitychange", onVisibilityUpdate, true); - removeEventListener("prerenderingchange", onVisibilityUpdate, true); -}, "removeChangeListeners"); -const getVisibilityWatcher = /* @__PURE__ */ __name(() => { - if (WINDOW$4.document && firstHiddenTime < 0) { - firstHiddenTime = initHiddenTime(); - addChangeListeners(); - } - return { - get firstHiddenTime() { - return firstHiddenTime; - } - }; -}, "getVisibilityWatcher"); -const whenActivated = /* @__PURE__ */ __name((callback) => { - if (WINDOW$4.document && WINDOW$4.document.prerendering) { - addEventListener("prerenderingchange", () => callback(), true); - } else { - callback(); - } -}, "whenActivated"); -const FCPThresholds = [1800, 3e3]; -const onFCP = /* @__PURE__ */ __name((onReport, opts = {}) => { - whenActivated(() => { - const visibilityWatcher = getVisibilityWatcher(); - const metric = initMetric("FCP"); - let report; - const handleEntries = /* @__PURE__ */ __name((entries) => { - entries.forEach((entry) => { - if (entry.name === "first-contentful-paint") { - po2.disconnect(); - if (entry.startTime < visibilityWatcher.firstHiddenTime) { - metric.value = Math.max(entry.startTime - getActivationStart(), 0); - metric.entries.push(entry); - report(true); - } - } - }); - }, "handleEntries"); - const po2 = observe("paint", handleEntries); - if (po2) { - report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges); - } - }); -}, "onFCP"); -const CLSThresholds = [0.1, 0.25]; -const onCLS = /* @__PURE__ */ __name((onReport, opts = {}) => { - onFCP( - runOnce(() => { - const metric = initMetric("CLS", 0); - let report; - let sessionValue = 0; - let sessionEntries = []; - const handleEntries = /* @__PURE__ */ __name((entries) => { - entries.forEach((entry) => { - if (!entry.hadRecentInput) { - const firstSessionEntry = sessionEntries[0]; - const lastSessionEntry = sessionEntries[sessionEntries.length - 1]; - if (sessionValue && firstSessionEntry && lastSessionEntry && entry.startTime - lastSessionEntry.startTime < 1e3 && entry.startTime - firstSessionEntry.startTime < 5e3) { - sessionValue += entry.value; - sessionEntries.push(entry); - } else { - sessionValue = entry.value; - sessionEntries = [entry]; - } - } - }); - if (sessionValue > metric.value) { - metric.value = sessionValue; - metric.entries = sessionEntries; - report(); - } - }, "handleEntries"); - const po2 = observe("layout-shift", handleEntries); - if (po2) { - report = bindReporter(onReport, metric, CLSThresholds, opts.reportAllChanges); - onHidden(() => { - handleEntries(po2.takeRecords()); - report(true); - }); - setTimeout(report, 0); - } - }) - ); -}, "onCLS"); -const FIDThresholds = [100, 300]; -const onFID = /* @__PURE__ */ __name((onReport, opts = {}) => { - whenActivated(() => { - const visibilityWatcher = getVisibilityWatcher(); - const metric = initMetric("FID"); - let report; - const handleEntry = /* @__PURE__ */ __name((entry) => { - if (entry.startTime < visibilityWatcher.firstHiddenTime) { - metric.value = entry.processingStart - entry.startTime; - metric.entries.push(entry); - report(true); - } - }, "handleEntry"); - const handleEntries = /* @__PURE__ */ __name((entries) => { - entries.forEach(handleEntry); - }, "handleEntries"); - const po2 = observe("first-input", handleEntries); - report = bindReporter(onReport, metric, FIDThresholds, opts.reportAllChanges); - if (po2) { - onHidden( - runOnce(() => { - handleEntries(po2.takeRecords()); - po2.disconnect(); - }) - ); - } - }); -}, "onFID"); -let interactionCountEstimate = 0; -let minKnownInteractionId = Infinity; -let maxKnownInteractionId = 0; -const updateEstimate = /* @__PURE__ */ __name((entries) => { - entries.forEach((e2) => { - if (e2.interactionId) { - minKnownInteractionId = Math.min(minKnownInteractionId, e2.interactionId); - maxKnownInteractionId = Math.max(maxKnownInteractionId, e2.interactionId); - interactionCountEstimate = maxKnownInteractionId ? (maxKnownInteractionId - minKnownInteractionId) / 7 + 1 : 0; - } - }); -}, "updateEstimate"); -let po; -const getInteractionCount = /* @__PURE__ */ __name(() => { - return po ? interactionCountEstimate : performance.interactionCount || 0; -}, "getInteractionCount"); -const initInteractionCountPolyfill = /* @__PURE__ */ __name(() => { - if ("interactionCount" in performance || po) return; - po = observe("event", updateEstimate, { - type: "event", - buffered: true, - durationThreshold: 0 - }); -}, "initInteractionCountPolyfill"); -const longestInteractionList = []; -const longestInteractionMap = /* @__PURE__ */ new Map(); -const DEFAULT_DURATION_THRESHOLD = 40; -let prevInteractionCount = 0; -const getInteractionCountForNavigation = /* @__PURE__ */ __name(() => { - return getInteractionCount() - prevInteractionCount; -}, "getInteractionCountForNavigation"); -const estimateP98LongestInteraction = /* @__PURE__ */ __name(() => { - const candidateInteractionIndex = Math.min( - longestInteractionList.length - 1, - Math.floor(getInteractionCountForNavigation() / 50) - ); - return longestInteractionList[candidateInteractionIndex]; -}, "estimateP98LongestInteraction"); -const MAX_INTERACTIONS_TO_CONSIDER = 10; -const entryPreProcessingCallbacks = []; -const processInteractionEntry = /* @__PURE__ */ __name((entry) => { - entryPreProcessingCallbacks.forEach((cb) => cb(entry)); - if (!(entry.interactionId || entry.entryType === "first-input")) return; - const minLongestInteraction = longestInteractionList[longestInteractionList.length - 1]; - const existingInteraction = longestInteractionMap.get(entry.interactionId); - if (existingInteraction || longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER || minLongestInteraction && entry.duration > minLongestInteraction.latency) { - if (existingInteraction) { - if (entry.duration > existingInteraction.latency) { - existingInteraction.entries = [entry]; - existingInteraction.latency = entry.duration; - } else if (entry.duration === existingInteraction.latency && entry.startTime === (existingInteraction.entries[0] && existingInteraction.entries[0].startTime)) { - existingInteraction.entries.push(entry); - } - } else { - const interaction = { - id: entry.interactionId, - latency: entry.duration, - entries: [entry] - }; - longestInteractionMap.set(interaction.id, interaction); - longestInteractionList.push(interaction); - } - longestInteractionList.sort((a2, b2) => b2.latency - a2.latency); - if (longestInteractionList.length > MAX_INTERACTIONS_TO_CONSIDER) { - longestInteractionList.splice(MAX_INTERACTIONS_TO_CONSIDER).forEach((i2) => longestInteractionMap.delete(i2.id)); - } - } -}, "processInteractionEntry"); -const whenIdle = /* @__PURE__ */ __name((cb) => { - const rIC = WINDOW$4.requestIdleCallback || WINDOW$4.setTimeout; - let handle = -1; - cb = runOnce(cb); - if (WINDOW$4.document && WINDOW$4.document.visibilityState === "hidden") { - cb(); - } else { - handle = rIC(cb); - onHidden(cb); - } - return handle; -}, "whenIdle"); -const INPThresholds = [200, 500]; -const onINP = /* @__PURE__ */ __name((onReport, opts = {}) => { - if (!("PerformanceEventTiming" in WINDOW$4 && "interactionId" in PerformanceEventTiming.prototype)) { - return; - } - whenActivated(() => { - initInteractionCountPolyfill(); - const metric = initMetric("INP"); - let report; - const handleEntries = /* @__PURE__ */ __name((entries) => { - whenIdle(() => { - entries.forEach(processInteractionEntry); - const inp = estimateP98LongestInteraction(); - if (inp && inp.latency !== metric.value) { - metric.value = inp.latency; - metric.entries = inp.entries; - report(); - } - }); - }, "handleEntries"); - const po2 = observe("event", handleEntries, { - // Event Timing entries have their durations rounded to the nearest 8ms, - // so a duration of 40ms would be any event that spans 2.5 or more frames - // at 60Hz. This threshold is chosen to strike a balance between usefulness - // and performance. Running this callback for any interaction that spans - // just one or two frames is likely not worth the insight that could be - // gained. - durationThreshold: opts.durationThreshold != null ? opts.durationThreshold : DEFAULT_DURATION_THRESHOLD - }); - report = bindReporter(onReport, metric, INPThresholds, opts.reportAllChanges); - if (po2) { - po2.observe({ type: "first-input", buffered: true }); - onHidden(() => { - handleEntries(po2.takeRecords()); - report(true); - }); - } - }); -}, "onINP"); -const LCPThresholds = [2500, 4e3]; -const reportedMetricIDs = {}; -const onLCP = /* @__PURE__ */ __name((onReport, opts = {}) => { - whenActivated(() => { - const visibilityWatcher = getVisibilityWatcher(); - const metric = initMetric("LCP"); - let report; - const handleEntries = /* @__PURE__ */ __name((entries) => { - if (!opts.reportAllChanges) { - entries = entries.slice(-1); - } - entries.forEach((entry) => { - if (entry.startTime < visibilityWatcher.firstHiddenTime) { - metric.value = Math.max(entry.startTime - getActivationStart(), 0); - metric.entries = [entry]; - report(); - } - }); - }, "handleEntries"); - const po2 = observe("largest-contentful-paint", handleEntries); - if (po2) { - report = bindReporter(onReport, metric, LCPThresholds, opts.reportAllChanges); - const stopListening = runOnce(() => { - if (!reportedMetricIDs[metric.id]) { - handleEntries(po2.takeRecords()); - po2.disconnect(); - reportedMetricIDs[metric.id] = true; - report(true); - } - }); - ["keydown", "click"].forEach((type) => { - if (WINDOW$4.document) { - addEventListener(type, () => whenIdle(stopListening), { - once: true, - capture: true - }); - } - }); - onHidden(stopListening); - } - }); -}, "onLCP"); -const TTFBThresholds = [800, 1800]; -const whenReady = /* @__PURE__ */ __name((callback) => { - if (WINDOW$4.document && WINDOW$4.document.prerendering) { - whenActivated(() => whenReady(callback)); - } else if (WINDOW$4.document && WINDOW$4.document.readyState !== "complete") { - addEventListener("load", () => whenReady(callback), true); - } else { - setTimeout(callback, 0); - } -}, "whenReady"); -const onTTFB = /* @__PURE__ */ __name((onReport, opts = {}) => { - const metric = initMetric("TTFB"); - const report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges); - whenReady(() => { - const navigationEntry = getNavigationEntry(); - if (navigationEntry) { - metric.value = Math.max(navigationEntry.responseStart - getActivationStart(), 0); - metric.entries = [navigationEntry]; - report(true); - } - }); -}, "onTTFB"); -const handlers$3 = {}; -const instrumented = {}; -let _previousCls; -let _previousFid; -let _previousLcp; -let _previousTtfb; -let _previousInp; -function addClsInstrumentationHandler(callback, stopOnCallback = false) { - return addMetricObserver("cls", callback, instrumentCls, _previousCls, stopOnCallback); -} -__name(addClsInstrumentationHandler, "addClsInstrumentationHandler"); -function addLcpInstrumentationHandler(callback, stopOnCallback = false) { - return addMetricObserver("lcp", callback, instrumentLcp, _previousLcp, stopOnCallback); -} -__name(addLcpInstrumentationHandler, "addLcpInstrumentationHandler"); -function addFidInstrumentationHandler(callback) { - return addMetricObserver("fid", callback, instrumentFid, _previousFid); -} -__name(addFidInstrumentationHandler, "addFidInstrumentationHandler"); -function addTtfbInstrumentationHandler(callback) { - return addMetricObserver("ttfb", callback, instrumentTtfb, _previousTtfb); -} -__name(addTtfbInstrumentationHandler, "addTtfbInstrumentationHandler"); -function addInpInstrumentationHandler(callback) { - return addMetricObserver("inp", callback, instrumentInp, _previousInp); -} -__name(addInpInstrumentationHandler, "addInpInstrumentationHandler"); -function addPerformanceInstrumentationHandler(type, callback) { - addHandler(type, callback); - if (!instrumented[type]) { - instrumentPerformanceObserver(type); - instrumented[type] = true; - } - return getCleanupCallback(type, callback); -} -__name(addPerformanceInstrumentationHandler, "addPerformanceInstrumentationHandler"); -function triggerHandlers(type, data26) { - const typeHandlers = handlers$3[type]; - if (!typeHandlers || !typeHandlers.length) { - return; - } - for (const handler10 of typeHandlers) { - try { - handler10(data26); - } catch (e2) { - DEBUG_BUILD$3 && logger$2.error( - `Error while triggering instrumentation handler. -Type: ${type} -Name: ${getFunctionName(handler10)} -Error:`, - e2 - ); - } - } -} -__name(triggerHandlers, "triggerHandlers"); -function instrumentCls() { - return onCLS( - (metric) => { - triggerHandlers("cls", { - metric - }); - _previousCls = metric; - }, - // We want the callback to be called whenever the CLS value updates. - // By default, the callback is only called when the tab goes to the background. - { reportAllChanges: true } - ); -} -__name(instrumentCls, "instrumentCls"); -function instrumentFid() { - return onFID((metric) => { - triggerHandlers("fid", { - metric - }); - _previousFid = metric; - }); -} -__name(instrumentFid, "instrumentFid"); -function instrumentLcp() { - return onLCP( - (metric) => { - triggerHandlers("lcp", { - metric - }); - _previousLcp = metric; - }, - // We want the callback to be called whenever the LCP value updates. - // By default, the callback is only called when the tab goes to the background. - { reportAllChanges: true } - ); -} -__name(instrumentLcp, "instrumentLcp"); -function instrumentTtfb() { - return onTTFB((metric) => { - triggerHandlers("ttfb", { - metric - }); - _previousTtfb = metric; - }); -} -__name(instrumentTtfb, "instrumentTtfb"); -function instrumentInp() { - return onINP((metric) => { - triggerHandlers("inp", { - metric - }); - _previousInp = metric; - }); -} -__name(instrumentInp, "instrumentInp"); -function addMetricObserver(type, callback, instrumentFn, previousValue, stopOnCallback = false) { - addHandler(type, callback); - let stopListening; - if (!instrumented[type]) { - stopListening = instrumentFn(); - instrumented[type] = true; - } - if (previousValue) { - callback({ metric: previousValue }); - } - return getCleanupCallback(type, callback, stopOnCallback ? stopListening : void 0); -} -__name(addMetricObserver, "addMetricObserver"); -function instrumentPerformanceObserver(type) { - const options4 = {}; - if (type === "event") { - options4.durationThreshold = 0; - } - observe( - type, - (entries) => { - triggerHandlers(type, { entries }); - }, - options4 - ); -} -__name(instrumentPerformanceObserver, "instrumentPerformanceObserver"); -function addHandler(type, handler10) { - handlers$3[type] = handlers$3[type] || []; - handlers$3[type].push(handler10); -} -__name(addHandler, "addHandler"); -function getCleanupCallback(type, callback, stopListening) { - return () => { - if (stopListening) { - stopListening(); - } - const typeHandlers = handlers$3[type]; - if (!typeHandlers) { - return; - } - const index2 = typeHandlers.indexOf(callback); - if (index2 !== -1) { - typeHandlers.splice(index2, 1); - } - }; -} -__name(getCleanupCallback, "getCleanupCallback"); -function isPerformanceEventTiming(entry) { - return "duration" in entry; -} -__name(isPerformanceEventTiming, "isPerformanceEventTiming"); -function isMeasurementValue(value4) { - return typeof value4 === "number" && isFinite(value4); -} -__name(isMeasurementValue, "isMeasurementValue"); -function startAndEndSpan(parentSpan, startTimeInSeconds, endTime, { ...ctx }) { - const parentStartTime = spanToJSON(parentSpan).start_timestamp; - if (parentStartTime && parentStartTime > startTimeInSeconds) { - if (typeof parentSpan.updateStartTime === "function") { - parentSpan.updateStartTime(startTimeInSeconds); - } - } - return withActiveSpan(parentSpan, () => { - const span = startInactiveSpan({ - startTime: startTimeInSeconds, - ...ctx - }); - if (span) { - span.end(endTime); - } - return span; - }); -} -__name(startAndEndSpan, "startAndEndSpan"); -function startStandaloneWebVitalSpan(options4) { - const client = getClient(); - if (!client) { - return; - } - const { name: name2, transaction, attributes: passedAttributes, startTime } = options4; - const { release, environment } = client.getOptions(); - const replay = client.getIntegrationByName("Replay"); - const replayId = replay && replay.getReplayId(); - const scope = getCurrentScope$1(); - const user = scope.getUser(); - const userDisplay = user !== void 0 ? user.email || user.id || user.ip_address : void 0; - let profileId; - try { - profileId = scope.getScopeData().contexts.profile.profile_id; - } catch (e2) { - } - const attributes = { - release, - environment, - user: userDisplay || void 0, - profile_id: profileId || void 0, - replay_id: replayId || void 0, - transaction, - // Web vital score calculation relies on the user agent to account for different - // browsers setting different thresholds for what is considered a good/meh/bad value. - // For example: Chrome vs. Chrome Mobile - "user_agent.original": WINDOW$4.navigator && WINDOW$4.navigator.userAgent, - ...passedAttributes - }; - return startInactiveSpan({ - name: name2, - attributes, - startTime, - experimental: { - standalone: true - } - }); -} -__name(startStandaloneWebVitalSpan, "startStandaloneWebVitalSpan"); -function getBrowserPerformanceAPI() { - return WINDOW$4 && WINDOW$4.addEventListener && WINDOW$4.performance; -} -__name(getBrowserPerformanceAPI, "getBrowserPerformanceAPI"); -function msToSec(time) { - return time / 1e3; -} -__name(msToSec, "msToSec"); -function extractNetworkProtocol(nextHopProtocol) { - let name2 = "unknown"; - let version2 = "unknown"; - let _name = ""; - for (const char of nextHopProtocol) { - if (char === "/") { - [name2, version2] = nextHopProtocol.split("/"); - break; - } - if (!isNaN(Number(char))) { - name2 = _name === "h" ? "http" : _name; - version2 = nextHopProtocol.split(_name)[1]; - break; - } - _name += char; - } - if (_name === nextHopProtocol) { - name2 = _name; - } - return { name: name2, version: version2 }; -} -__name(extractNetworkProtocol, "extractNetworkProtocol"); -function trackClsAsStandaloneSpan() { - let standaloneCLsValue = 0; - let standaloneClsEntry; - let pageloadSpanId; - if (!supportsLayoutShift()) { - return; - } - let sentSpan = false; - function _collectClsOnce() { - if (sentSpan) { - return; - } - sentSpan = true; - if (pageloadSpanId) { - sendStandaloneClsSpan(standaloneCLsValue, standaloneClsEntry, pageloadSpanId); - } - cleanupClsHandler(); - } - __name(_collectClsOnce, "_collectClsOnce"); - const cleanupClsHandler = addClsInstrumentationHandler(({ metric }) => { - const entry = metric.entries[metric.entries.length - 1]; - if (!entry) { - return; - } - standaloneCLsValue = metric.value; - standaloneClsEntry = entry; - }, true); - onHidden(() => { - _collectClsOnce(); - }); - setTimeout(() => { - const client = getClient(); - if (!client) { - return; - } - const unsubscribeStartNavigation = client.on("startNavigationSpan", () => { - _collectClsOnce(); - unsubscribeStartNavigation && unsubscribeStartNavigation(); - }); - const activeSpan = getActiveSpan(); - const rootSpan = activeSpan && getRootSpan(activeSpan); - const spanJSON = rootSpan && spanToJSON(rootSpan); - if (spanJSON && spanJSON.op === "pageload") { - pageloadSpanId = rootSpan.spanContext().spanId; - } - }, 0); -} -__name(trackClsAsStandaloneSpan, "trackClsAsStandaloneSpan"); -function sendStandaloneClsSpan(clsValue, entry, pageloadSpanId) { - DEBUG_BUILD$3 && logger$2.log(`Sending CLS span (${clsValue})`); - const startTime = msToSec((browserPerformanceTimeOrigin || 0) + (entry && entry.startTime || 0)); - const routeName = getCurrentScope$1().getScopeData().transactionName; - const name2 = entry ? htmlTreeAsString(entry.sources[0] && entry.sources[0].node) : "Layout shift"; - const attributes = dropUndefinedKeys({ - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.browser.cls", - [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "ui.webvital.cls", - [SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: entry && entry.duration || 0, - // attach the pageload span id to the CLS span so that we can link them in the UI - "sentry.pageload.span_id": pageloadSpanId - }); - const span = startStandaloneWebVitalSpan({ - name: name2, - transaction: routeName, - attributes, - startTime - }); - if (span) { - span.addEvent("cls", { - [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: "", - [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: clsValue - }); - span.end(startTime); - } -} -__name(sendStandaloneClsSpan, "sendStandaloneClsSpan"); -function supportsLayoutShift() { - try { - return PerformanceObserver.supportedEntryTypes.includes("layout-shift"); - } catch (e2) { - return false; - } -} -__name(supportsLayoutShift, "supportsLayoutShift"); -const MAX_INT_AS_BYTES = 2147483647; -let _performanceCursor = 0; -let _measurements = {}; -let _lcpEntry; -let _clsEntry; -function startTrackingWebVitals({ recordClsStandaloneSpans }) { - const performance2 = getBrowserPerformanceAPI(); - if (performance2 && browserPerformanceTimeOrigin) { - if (performance2.mark) { - WINDOW$4.performance.mark("sentry-tracing-init"); - } - const fidCleanupCallback = _trackFID(); - const lcpCleanupCallback = _trackLCP(); - const ttfbCleanupCallback = _trackTtfb(); - const clsCleanupCallback = recordClsStandaloneSpans ? trackClsAsStandaloneSpan() : _trackCLS(); - return () => { - fidCleanupCallback(); - lcpCleanupCallback(); - ttfbCleanupCallback(); - clsCleanupCallback && clsCleanupCallback(); - }; - } - return () => void 0; -} -__name(startTrackingWebVitals, "startTrackingWebVitals"); -function startTrackingLongTasks() { - addPerformanceInstrumentationHandler("longtask", ({ entries }) => { - const parent = getActiveSpan(); - if (!parent) { - return; - } - const { op: parentOp, start_timestamp: parentStartTimestamp } = spanToJSON(parent); - for (const entry of entries) { - const startTime = msToSec(browserPerformanceTimeOrigin + entry.startTime); - const duration = msToSec(entry.duration); - if (parentOp === "navigation" && parentStartTimestamp && startTime < parentStartTimestamp) { - continue; - } - startAndEndSpan(parent, startTime, startTime + duration, { - name: "Main UI thread blocked", - op: "ui.long-task", - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" - } - }); - } - }); -} -__name(startTrackingLongTasks, "startTrackingLongTasks"); -function startTrackingLongAnimationFrames() { - const observer = new PerformanceObserver((list2) => { - const parent = getActiveSpan(); - if (!parent) { - return; - } - for (const entry of list2.getEntries()) { - if (!entry.scripts[0]) { - continue; - } - const startTime = msToSec(browserPerformanceTimeOrigin + entry.startTime); - const { start_timestamp: parentStartTimestamp, op: parentOp } = spanToJSON(parent); - if (parentOp === "navigation" && parentStartTimestamp && startTime < parentStartTimestamp) { - continue; - } - const duration = msToSec(entry.duration); - const attributes = { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" - }; - const initialScript = entry.scripts[0]; - const { invoker, invokerType, sourceURL, sourceFunctionName, sourceCharPosition } = initialScript; - attributes["browser.script.invoker"] = invoker; - attributes["browser.script.invoker_type"] = invokerType; - if (sourceURL) { - attributes["code.filepath"] = sourceURL; - } - if (sourceFunctionName) { - attributes["code.function"] = sourceFunctionName; - } - if (sourceCharPosition !== -1) { - attributes["browser.script.source_char_position"] = sourceCharPosition; - } - startAndEndSpan(parent, startTime, startTime + duration, { - name: "Main UI thread blocked", - op: "ui.long-animation-frame", - attributes - }); - } - }); - observer.observe({ type: "long-animation-frame", buffered: true }); -} -__name(startTrackingLongAnimationFrames, "startTrackingLongAnimationFrames"); -function startTrackingInteractions() { - addPerformanceInstrumentationHandler("event", ({ entries }) => { - const parent = getActiveSpan(); - if (!parent) { - return; - } - for (const entry of entries) { - if (entry.name === "click") { - const startTime = msToSec(browserPerformanceTimeOrigin + entry.startTime); - const duration = msToSec(entry.duration); - const spanOptions = { - name: htmlTreeAsString(entry.target), - op: `ui.interaction.${entry.name}`, - startTime, - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" - } - }; - const componentName = getComponentName$1(entry.target); - if (componentName) { - spanOptions.attributes["ui.component_name"] = componentName; - } - startAndEndSpan(parent, startTime, startTime + duration, spanOptions); - } - } - }); -} -__name(startTrackingInteractions, "startTrackingInteractions"); -function _trackCLS() { - return addClsInstrumentationHandler(({ metric }) => { - const entry = metric.entries[metric.entries.length - 1]; - if (!entry) { - return; - } - _measurements["cls"] = { value: metric.value, unit: "" }; - _clsEntry = entry; - }, true); -} -__name(_trackCLS, "_trackCLS"); -function _trackLCP() { - return addLcpInstrumentationHandler(({ metric }) => { - const entry = metric.entries[metric.entries.length - 1]; - if (!entry) { - return; - } - _measurements["lcp"] = { value: metric.value, unit: "millisecond" }; - _lcpEntry = entry; - }, true); -} -__name(_trackLCP, "_trackLCP"); -function _trackFID() { - return addFidInstrumentationHandler(({ metric }) => { - const entry = metric.entries[metric.entries.length - 1]; - if (!entry) { - return; - } - const timeOrigin = msToSec(browserPerformanceTimeOrigin); - const startTime = msToSec(entry.startTime); - _measurements["fid"] = { value: metric.value, unit: "millisecond" }; - _measurements["mark.fid"] = { value: timeOrigin + startTime, unit: "second" }; - }); -} -__name(_trackFID, "_trackFID"); -function _trackTtfb() { - return addTtfbInstrumentationHandler(({ metric }) => { - const entry = metric.entries[metric.entries.length - 1]; - if (!entry) { - return; - } - _measurements["ttfb"] = { value: metric.value, unit: "millisecond" }; - }); -} -__name(_trackTtfb, "_trackTtfb"); -function addPerformanceEntries(span, options4) { - const performance2 = getBrowserPerformanceAPI(); - if (!performance2 || !performance2.getEntries || !browserPerformanceTimeOrigin) { - return; - } - const timeOrigin = msToSec(browserPerformanceTimeOrigin); - const performanceEntries = performance2.getEntries(); - const { op, start_timestamp: transactionStartTime } = spanToJSON(span); - performanceEntries.slice(_performanceCursor).forEach((entry) => { - const startTime = msToSec(entry.startTime); - const duration = msToSec( - // Inexplicably, Chrome sometimes emits a negative duration. We need to work around this. - // There is a SO post attempting to explain this, but it leaves one with open questions: https://stackoverflow.com/questions/23191918/peformance-getentries-and-negative-duration-display - // The way we clamp the value is probably not accurate, since we have observed this happen for things that may take a while to load, like for example the replay worker. - // TODO: Investigate why this happens and how to properly mitigate. For now, this is a workaround to prevent transactions being dropped due to negative duration spans. - Math.max(0, entry.duration) - ); - if (op === "navigation" && transactionStartTime && timeOrigin + startTime < transactionStartTime) { - return; - } - switch (entry.entryType) { - case "navigation": { - _addNavigationSpans(span, entry, timeOrigin); - break; - } - case "mark": - case "paint": - case "measure": { - _addMeasureSpans(span, entry, startTime, duration, timeOrigin); - const firstHidden = getVisibilityWatcher(); - const shouldRecord = entry.startTime < firstHidden.firstHiddenTime; - if (entry.name === "first-paint" && shouldRecord) { - _measurements["fp"] = { value: entry.startTime, unit: "millisecond" }; - } - if (entry.name === "first-contentful-paint" && shouldRecord) { - _measurements["fcp"] = { value: entry.startTime, unit: "millisecond" }; - } - break; - } - case "resource": { - _addResourceSpans(span, entry, entry.name, startTime, duration, timeOrigin); - break; - } - } - }); - _performanceCursor = Math.max(performanceEntries.length - 1, 0); - _trackNavigator(span); - if (op === "pageload") { - _addTtfbRequestTimeToMeasurements(_measurements); - const fidMark = _measurements["mark.fid"]; - if (fidMark && _measurements["fid"]) { - startAndEndSpan(span, fidMark.value, fidMark.value + msToSec(_measurements["fid"].value), { - name: "first input delay", - op: "ui.action", - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" - } - }); - delete _measurements["mark.fid"]; - } - if (!("fcp" in _measurements) || !options4.recordClsOnPageloadSpan) { - delete _measurements.cls; - } - Object.entries(_measurements).forEach(([measurementName, measurement]) => { - setMeasurement(measurementName, measurement.value, measurement.unit); - }); - span.setAttribute("performance.timeOrigin", timeOrigin); - span.setAttribute("performance.activationStart", getActivationStart()); - _setWebVitalAttributes(span); - } - _lcpEntry = void 0; - _clsEntry = void 0; - _measurements = {}; -} -__name(addPerformanceEntries, "addPerformanceEntries"); -function _addMeasureSpans(span, entry, startTime, duration, timeOrigin) { - const navEntry = getNavigationEntry(false); - const requestTime = msToSec(navEntry ? navEntry.requestStart : 0); - const measureStartTimestamp = timeOrigin + Math.max(startTime, requestTime); - const startTimeStamp = timeOrigin + startTime; - const measureEndTimestamp = startTimeStamp + duration; - const attributes = { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.resource.browser.metrics" - }; - if (measureStartTimestamp !== startTimeStamp) { - attributes["sentry.browser.measure_happened_before_request"] = true; - attributes["sentry.browser.measure_start_time"] = measureStartTimestamp; - } - startAndEndSpan(span, measureStartTimestamp, measureEndTimestamp, { - name: entry.name, - op: entry.entryType, - attributes - }); - return measureStartTimestamp; -} -__name(_addMeasureSpans, "_addMeasureSpans"); -function _addNavigationSpans(span, entry, timeOrigin) { - ["unloadEvent", "redirect", "domContentLoadedEvent", "loadEvent", "connect"].forEach((event) => { - _addPerformanceNavigationTiming(span, entry, event, timeOrigin); - }); - _addPerformanceNavigationTiming(span, entry, "secureConnection", timeOrigin, "TLS/SSL"); - _addPerformanceNavigationTiming(span, entry, "fetch", timeOrigin, "cache"); - _addPerformanceNavigationTiming(span, entry, "domainLookup", timeOrigin, "DNS"); - _addRequest(span, entry, timeOrigin); -} -__name(_addNavigationSpans, "_addNavigationSpans"); -function _addPerformanceNavigationTiming(span, entry, event, timeOrigin, name2 = event) { - const eventEnd = _getEndPropertyNameForNavigationTiming(event); - const end = entry[eventEnd]; - const start2 = entry[`${event}Start`]; - if (!start2 || !end) { - return; - } - startAndEndSpan(span, timeOrigin + msToSec(start2), timeOrigin + msToSec(end), { - op: `browser.${name2}`, - name: entry.name, - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" - } - }); -} -__name(_addPerformanceNavigationTiming, "_addPerformanceNavigationTiming"); -function _getEndPropertyNameForNavigationTiming(event) { - if (event === "secureConnection") { - return "connectEnd"; - } - if (event === "fetch") { - return "domainLookupStart"; - } - return `${event}End`; -} -__name(_getEndPropertyNameForNavigationTiming, "_getEndPropertyNameForNavigationTiming"); -function _addRequest(span, entry, timeOrigin) { - const requestStartTimestamp = timeOrigin + msToSec(entry.requestStart); - const responseEndTimestamp = timeOrigin + msToSec(entry.responseEnd); - const responseStartTimestamp = timeOrigin + msToSec(entry.responseStart); - if (entry.responseEnd) { - startAndEndSpan(span, requestStartTimestamp, responseEndTimestamp, { - op: "browser.request", - name: entry.name, - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" - } - }); - startAndEndSpan(span, responseStartTimestamp, responseEndTimestamp, { - op: "browser.response", - name: entry.name, - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" - } - }); - } -} -__name(_addRequest, "_addRequest"); -function _addResourceSpans(span, entry, resourceUrl, startTime, duration, timeOrigin) { - if (entry.initiatorType === "xmlhttprequest" || entry.initiatorType === "fetch") { - return; - } - const parsedUrl = parseUrl$1(resourceUrl); - const attributes = { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.resource.browser.metrics" - }; - setResourceEntrySizeData(attributes, entry, "transferSize", "http.response_transfer_size"); - setResourceEntrySizeData(attributes, entry, "encodedBodySize", "http.response_content_length"); - setResourceEntrySizeData(attributes, entry, "decodedBodySize", "http.decoded_response_content_length"); - const deliveryType = entry.deliveryType; - if (deliveryType != null) { - attributes["http.response_delivery_type"] = deliveryType; - } - const renderBlockingStatus = entry.renderBlockingStatus; - if (renderBlockingStatus) { - attributes["resource.render_blocking_status"] = renderBlockingStatus; - } - if (parsedUrl.protocol) { - attributes["url.scheme"] = parsedUrl.protocol.split(":").pop(); - } - if (parsedUrl.host) { - attributes["server.address"] = parsedUrl.host; - } - attributes["url.same_origin"] = resourceUrl.includes(WINDOW$4.location.origin); - const { name: name2, version: version2 } = extractNetworkProtocol(entry.nextHopProtocol); - attributes["network.protocol.name"] = name2; - attributes["network.protocol.version"] = version2; - const startTimestamp = timeOrigin + startTime; - const endTimestamp = startTimestamp + duration; - startAndEndSpan(span, startTimestamp, endTimestamp, { - name: resourceUrl.replace(WINDOW$4.location.origin, ""), - op: entry.initiatorType ? `resource.${entry.initiatorType}` : "resource.other", - attributes - }); -} -__name(_addResourceSpans, "_addResourceSpans"); -function _trackNavigator(span) { - const navigator2 = WINDOW$4.navigator; - if (!navigator2) { - return; - } - const connection = navigator2.connection; - if (connection) { - if (connection.effectiveType) { - span.setAttribute("effectiveConnectionType", connection.effectiveType); - } - if (connection.type) { - span.setAttribute("connectionType", connection.type); - } - if (isMeasurementValue(connection.rtt)) { - _measurements["connection.rtt"] = { value: connection.rtt, unit: "millisecond" }; - } - } - if (isMeasurementValue(navigator2.deviceMemory)) { - span.setAttribute("deviceMemory", `${navigator2.deviceMemory} GB`); - } - if (isMeasurementValue(navigator2.hardwareConcurrency)) { - span.setAttribute("hardwareConcurrency", String(navigator2.hardwareConcurrency)); - } -} -__name(_trackNavigator, "_trackNavigator"); -function _setWebVitalAttributes(span) { - if (_lcpEntry) { - if (_lcpEntry.element) { - span.setAttribute("lcp.element", htmlTreeAsString(_lcpEntry.element)); - } - if (_lcpEntry.id) { - span.setAttribute("lcp.id", _lcpEntry.id); - } - if (_lcpEntry.url) { - span.setAttribute("lcp.url", _lcpEntry.url.trim().slice(0, 200)); - } - if (_lcpEntry.loadTime != null) { - span.setAttribute("lcp.loadTime", _lcpEntry.loadTime); - } - if (_lcpEntry.renderTime != null) { - span.setAttribute("lcp.renderTime", _lcpEntry.renderTime); - } - span.setAttribute("lcp.size", _lcpEntry.size); - } - if (_clsEntry && _clsEntry.sources) { - _clsEntry.sources.forEach( - (source, index2) => span.setAttribute(`cls.source.${index2 + 1}`, htmlTreeAsString(source.node)) - ); - } -} -__name(_setWebVitalAttributes, "_setWebVitalAttributes"); -function setResourceEntrySizeData(attributes, entry, key, dataKey) { - const entryVal = entry[key]; - if (entryVal != null && entryVal < MAX_INT_AS_BYTES) { - attributes[dataKey] = entryVal; - } -} -__name(setResourceEntrySizeData, "setResourceEntrySizeData"); -function _addTtfbRequestTimeToMeasurements(_measurements2) { - const navEntry = getNavigationEntry(false); - if (!navEntry) { - return; - } - const { responseStart, requestStart } = navEntry; - if (requestStart <= responseStart) { - _measurements2["ttfb.requestTime"] = { - value: responseStart - requestStart, - unit: "millisecond" - }; - } -} -__name(_addTtfbRequestTimeToMeasurements, "_addTtfbRequestTimeToMeasurements"); -const DEBOUNCE_DURATION = 1e3; -let debounceTimerID; -let lastCapturedEventType; -let lastCapturedEventTargetId; -function addClickKeypressInstrumentationHandler(handler10) { - const type = "dom"; - addHandler$1(type, handler10); - maybeInstrument(type, instrumentDOM); -} -__name(addClickKeypressInstrumentationHandler, "addClickKeypressInstrumentationHandler"); -function instrumentDOM() { - if (!WINDOW$4.document) { - return; - } - const triggerDOMHandler = triggerHandlers$1.bind(null, "dom"); - const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true); - WINDOW$4.document.addEventListener("click", globalDOMEventHandler, false); - WINDOW$4.document.addEventListener("keypress", globalDOMEventHandler, false); - ["EventTarget", "Node"].forEach((target2) => { - const globalObject = WINDOW$4; - const targetObj = globalObject[target2]; - const proto = targetObj && targetObj.prototype; - if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty("addEventListener")) { - return; - } - fill(proto, "addEventListener", function(originalAddEventListener) { - return function(type, listener, options4) { - if (type === "click" || type == "keypress") { - try { - const handlers2 = this.__sentry_instrumentation_handlers__ = this.__sentry_instrumentation_handlers__ || {}; - const handlerForType = handlers2[type] = handlers2[type] || { refCount: 0 }; - if (!handlerForType.handler) { - const handler10 = makeDOMEventHandler(triggerDOMHandler); - handlerForType.handler = handler10; - originalAddEventListener.call(this, type, handler10, options4); - } - handlerForType.refCount++; - } catch (e2) { - } - } - return originalAddEventListener.call(this, type, listener, options4); - }; - }); - fill( - proto, - "removeEventListener", - function(originalRemoveEventListener) { - return function(type, listener, options4) { - if (type === "click" || type == "keypress") { - try { - const handlers2 = this.__sentry_instrumentation_handlers__ || {}; - const handlerForType = handlers2[type]; - if (handlerForType) { - handlerForType.refCount--; - if (handlerForType.refCount <= 0) { - originalRemoveEventListener.call(this, type, handlerForType.handler, options4); - handlerForType.handler = void 0; - delete handlers2[type]; - } - if (Object.keys(handlers2).length === 0) { - delete this.__sentry_instrumentation_handlers__; - } - } - } catch (e2) { - } - } - return originalRemoveEventListener.call(this, type, listener, options4); - }; - } - ); - }); -} -__name(instrumentDOM, "instrumentDOM"); -function isSimilarToLastCapturedEvent(event) { - if (event.type !== lastCapturedEventType) { - return false; - } - try { - if (!event.target || event.target._sentryId !== lastCapturedEventTargetId) { - return false; - } - } catch (e2) { - } - return true; -} -__name(isSimilarToLastCapturedEvent, "isSimilarToLastCapturedEvent"); -function shouldSkipDOMEvent(eventType, target2) { - if (eventType !== "keypress") { - return false; - } - if (!target2 || !target2.tagName) { - return true; - } - if (target2.tagName === "INPUT" || target2.tagName === "TEXTAREA" || target2.isContentEditable) { - return false; - } - return true; -} -__name(shouldSkipDOMEvent, "shouldSkipDOMEvent"); -function makeDOMEventHandler(handler10, globalListener = false) { - return (event) => { - if (!event || event["_sentryCaptured"]) { - return; - } - const target2 = getEventTarget$1(event); - if (shouldSkipDOMEvent(event.type, target2)) { - return; - } - addNonEnumerableProperty(event, "_sentryCaptured", true); - if (target2 && !target2._sentryId) { - addNonEnumerableProperty(target2, "_sentryId", uuid4()); - } - const name2 = event.type === "keypress" ? "input" : event.type; - if (!isSimilarToLastCapturedEvent(event)) { - const handlerData = { event, name: name2, global: globalListener }; - handler10(handlerData); - lastCapturedEventType = event.type; - lastCapturedEventTargetId = target2 ? target2._sentryId : void 0; - } - clearTimeout(debounceTimerID); - debounceTimerID = WINDOW$4.setTimeout(() => { - lastCapturedEventTargetId = void 0; - lastCapturedEventType = void 0; - }, DEBOUNCE_DURATION); - }; -} -__name(makeDOMEventHandler, "makeDOMEventHandler"); -function getEventTarget$1(event) { - try { - return event.target; - } catch (e2) { - return null; - } -} -__name(getEventTarget$1, "getEventTarget$1"); -let lastHref; -function addHistoryInstrumentationHandler(handler10) { - const type = "history"; - addHandler$1(type, handler10); - maybeInstrument(type, instrumentHistory); -} -__name(addHistoryInstrumentationHandler, "addHistoryInstrumentationHandler"); -function instrumentHistory() { - if (!supportsHistory()) { - return; - } - const oldOnPopState = WINDOW$4.onpopstate; - WINDOW$4.onpopstate = function(...args) { - const to = WINDOW$4.location.href; - const from2 = lastHref; - lastHref = to; - const handlerData = { from: from2, to }; - triggerHandlers$1("history", handlerData); - if (oldOnPopState) { - try { - return oldOnPopState.apply(this, args); - } catch (_oO) { - } - } - }; - function historyReplacementFunction(originalHistoryFunction) { - return function(...args) { - const url = args.length > 2 ? args[2] : void 0; - if (url) { - const from2 = lastHref; - const to = String(url); - lastHref = to; - const handlerData = { from: from2, to }; - triggerHandlers$1("history", handlerData); - } - return originalHistoryFunction.apply(this, args); - }; - } - __name(historyReplacementFunction, "historyReplacementFunction"); - fill(WINDOW$4.history, "pushState", historyReplacementFunction); - fill(WINDOW$4.history, "replaceState", historyReplacementFunction); -} -__name(instrumentHistory, "instrumentHistory"); -const cachedImplementations$3 = {}; -function getNativeImplementation(name2) { - const cached = cachedImplementations$3[name2]; - if (cached) { - return cached; - } - let impl = WINDOW$4[name2]; - if (isNativeFunction(impl)) { - return cachedImplementations$3[name2] = impl.bind(WINDOW$4); - } - const document2 = WINDOW$4.document; - if (document2 && typeof document2.createElement === "function") { - try { - const sandbox = document2.createElement("iframe"); - sandbox.hidden = true; - document2.head.appendChild(sandbox); - const contentWindow = sandbox.contentWindow; - if (contentWindow && contentWindow[name2]) { - impl = contentWindow[name2]; - } - document2.head.removeChild(sandbox); - } catch (e2) { - DEBUG_BUILD$3 && logger$2.warn(`Could not create sandbox iframe for ${name2} check, bailing to window.${name2}: `, e2); - } - } - if (!impl) { - return impl; - } - return cachedImplementations$3[name2] = impl.bind(WINDOW$4); -} -__name(getNativeImplementation, "getNativeImplementation"); -function clearCachedImplementation(name2) { - cachedImplementations$3[name2] = void 0; -} -__name(clearCachedImplementation, "clearCachedImplementation"); -function fetch$1(...rest) { - return getNativeImplementation("fetch")(...rest); -} -__name(fetch$1, "fetch$1"); -function setTimeout$3(...rest) { - return getNativeImplementation("setTimeout")(...rest); -} -__name(setTimeout$3, "setTimeout$3"); -const SENTRY_XHR_DATA_KEY = "__sentry_xhr_v3__"; -function addXhrInstrumentationHandler(handler10) { - const type = "xhr"; - addHandler$1(type, handler10); - maybeInstrument(type, instrumentXHR); -} -__name(addXhrInstrumentationHandler, "addXhrInstrumentationHandler"); -function instrumentXHR() { - if (!WINDOW$4.XMLHttpRequest) { - return; - } - const xhrproto = XMLHttpRequest.prototype; - xhrproto.open = new Proxy(xhrproto.open, { - apply(originalOpen, xhrOpenThisArg, xhrOpenArgArray) { - const virtualError = new Error(); - const startTimestamp = timestampInSeconds() * 1e3; - const method = isString$a(xhrOpenArgArray[0]) ? xhrOpenArgArray[0].toUpperCase() : void 0; - const url = parseUrl(xhrOpenArgArray[1]); - if (!method || !url) { - return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray); - } - xhrOpenThisArg[SENTRY_XHR_DATA_KEY] = { - method, - url, - request_headers: {} - }; - if (method === "POST" && url.match(/sentry_key/)) { - xhrOpenThisArg.__sentry_own_request__ = true; - } - const onreadystatechangeHandler = /* @__PURE__ */ __name(() => { - const xhrInfo = xhrOpenThisArg[SENTRY_XHR_DATA_KEY]; - if (!xhrInfo) { - return; - } - if (xhrOpenThisArg.readyState === 4) { - try { - xhrInfo.status_code = xhrOpenThisArg.status; - } catch (e2) { - } - const handlerData = { - endTimestamp: timestampInSeconds() * 1e3, - startTimestamp, - xhr: xhrOpenThisArg, - virtualError - }; - triggerHandlers$1("xhr", handlerData); - } - }, "onreadystatechangeHandler"); - if ("onreadystatechange" in xhrOpenThisArg && typeof xhrOpenThisArg.onreadystatechange === "function") { - xhrOpenThisArg.onreadystatechange = new Proxy(xhrOpenThisArg.onreadystatechange, { - apply(originalOnreadystatechange, onreadystatechangeThisArg, onreadystatechangeArgArray) { - onreadystatechangeHandler(); - return originalOnreadystatechange.apply(onreadystatechangeThisArg, onreadystatechangeArgArray); - } - }); - } else { - xhrOpenThisArg.addEventListener("readystatechange", onreadystatechangeHandler); - } - xhrOpenThisArg.setRequestHeader = new Proxy(xhrOpenThisArg.setRequestHeader, { - apply(originalSetRequestHeader, setRequestHeaderThisArg, setRequestHeaderArgArray) { - const [header3, value4] = setRequestHeaderArgArray; - const xhrInfo = setRequestHeaderThisArg[SENTRY_XHR_DATA_KEY]; - if (xhrInfo && isString$a(header3) && isString$a(value4)) { - xhrInfo.request_headers[header3.toLowerCase()] = value4; - } - return originalSetRequestHeader.apply(setRequestHeaderThisArg, setRequestHeaderArgArray); - } - }); - return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray); - } - }); - xhrproto.send = new Proxy(xhrproto.send, { - apply(originalSend, sendThisArg, sendArgArray) { - const sentryXhrData = sendThisArg[SENTRY_XHR_DATA_KEY]; - if (!sentryXhrData) { - return originalSend.apply(sendThisArg, sendArgArray); - } - if (sendArgArray[0] !== void 0) { - sentryXhrData.body = sendArgArray[0]; - } - const handlerData = { - startTimestamp: timestampInSeconds() * 1e3, - xhr: sendThisArg - }; - triggerHandlers$1("xhr", handlerData); - return originalSend.apply(sendThisArg, sendArgArray); - } - }); -} -__name(instrumentXHR, "instrumentXHR"); -function parseUrl(url) { - if (isString$a(url)) { - return url; - } - try { - return url.toString(); - } catch (e2) { - } - return void 0; -} -__name(parseUrl, "parseUrl"); -const LAST_INTERACTIONS = []; -const INTERACTIONS_SPAN_MAP = /* @__PURE__ */ new Map(); -function startTrackingINP() { - const performance2 = getBrowserPerformanceAPI(); - if (performance2 && browserPerformanceTimeOrigin) { - const inpCallback = _trackINP(); - return () => { - inpCallback(); - }; - } - return () => void 0; -} -__name(startTrackingINP, "startTrackingINP"); -const INP_ENTRY_MAP = { - click: "click", - pointerdown: "click", - pointerup: "click", - mousedown: "click", - mouseup: "click", - touchstart: "click", - touchend: "click", - mouseover: "hover", - mouseout: "hover", - mouseenter: "hover", - mouseleave: "hover", - pointerover: "hover", - pointerout: "hover", - pointerenter: "hover", - pointerleave: "hover", - dragstart: "drag", - dragend: "drag", - drag: "drag", - dragenter: "drag", - dragleave: "drag", - dragover: "drag", - drop: "drag", - keydown: "press", - keyup: "press", - keypress: "press", - input: "press" -}; -function _trackINP() { - return addInpInstrumentationHandler(({ metric }) => { - if (metric.value == void 0) { - return; - } - const entry = metric.entries.find((entry2) => entry2.duration === metric.value && INP_ENTRY_MAP[entry2.name]); - if (!entry) { - return; - } - const { interactionId } = entry; - const interactionType = INP_ENTRY_MAP[entry.name]; - const startTime = msToSec(browserPerformanceTimeOrigin + entry.startTime); - const duration = msToSec(metric.value); - const activeSpan = getActiveSpan(); - const rootSpan = activeSpan ? getRootSpan(activeSpan) : void 0; - const cachedSpan = interactionId != null ? INTERACTIONS_SPAN_MAP.get(interactionId) : void 0; - const spanToUse = cachedSpan || rootSpan; - const routeName = spanToUse ? spanToJSON(spanToUse).description : getCurrentScope$1().getScopeData().transactionName; - const name2 = htmlTreeAsString(entry.target); - const attributes = dropUndefinedKeys({ - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.browser.inp", - [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `ui.interaction.${interactionType}`, - [SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: entry.duration - }); - const span = startStandaloneWebVitalSpan({ - name: name2, - transaction: routeName, - attributes, - startTime - }); - if (span) { - span.addEvent("inp", { - [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: "millisecond", - [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: metric.value - }); - span.end(startTime + duration); - } - }); -} -__name(_trackINP, "_trackINP"); -function registerInpInteractionListener(_latestRoute) { - const handleEntries = /* @__PURE__ */ __name(({ entries }) => { - const activeSpan = getActiveSpan(); - const activeRootSpan = activeSpan && getRootSpan(activeSpan); - entries.forEach((entry) => { - if (!isPerformanceEventTiming(entry) || !activeRootSpan) { - return; - } - const interactionId = entry.interactionId; - if (interactionId == null) { - return; - } - if (INTERACTIONS_SPAN_MAP.has(interactionId)) { - return; - } - if (LAST_INTERACTIONS.length > 10) { - const last = LAST_INTERACTIONS.shift(); - INTERACTIONS_SPAN_MAP.delete(last); - } - LAST_INTERACTIONS.push(interactionId); - INTERACTIONS_SPAN_MAP.set(interactionId, activeRootSpan); - }); - }, "handleEntries"); - addPerformanceInstrumentationHandler("event", handleEntries); - addPerformanceInstrumentationHandler("first-input", handleEntries); -} -__name(registerInpInteractionListener, "registerInpInteractionListener"); -function makeFetchTransport(options4, nativeFetch = getNativeImplementation("fetch")) { - let pendingBodySize = 0; - let pendingCount = 0; - function makeRequest(request) { - const requestSize = request.body.length; - pendingBodySize += requestSize; - pendingCount++; - const requestOptions = { - body: request.body, - method: "POST", - referrerPolicy: "origin", - headers: options4.headers, - // Outgoing requests are usually cancelled when navigating to a different page, causing a "TypeError: Failed to - // fetch" error and sending a "network_error" client-outcome - in Chrome, the request status shows "(cancelled)". - // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're - // frequently sending events right before the user is switching pages (eg. when finishing navigation transactions). - // Gotchas: - // - `keepalive` isn't supported by Firefox - // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch): - // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error. - // We will therefore only activate the flag when we're below that limit. - // There is also a limit of requests that can be open at the same time, so we also limit this to 15 - // See https://github.com/getsentry/sentry-javascript/pull/7553 for details - keepalive: pendingBodySize <= 6e4 && pendingCount < 15, - ...options4.fetchOptions - }; - if (!nativeFetch) { - clearCachedImplementation("fetch"); - return rejectedSyncPromise("No fetch implementation available"); - } - try { - return nativeFetch(options4.url, requestOptions).then((response) => { - pendingBodySize -= requestSize; - pendingCount--; - return { - statusCode: response.status, - headers: { - "x-sentry-rate-limits": response.headers.get("X-Sentry-Rate-Limits"), - "retry-after": response.headers.get("Retry-After") - } - }; - }); - } catch (e2) { - clearCachedImplementation("fetch"); - pendingBodySize -= requestSize; - pendingCount--; - return rejectedSyncPromise(e2); - } - } - __name(makeRequest, "makeRequest"); - return createTransport(options4, makeRequest); -} -__name(makeFetchTransport, "makeFetchTransport"); -const OPERA10_PRIORITY = 10; -const OPERA11_PRIORITY = 20; -const CHROME_PRIORITY = 30; -const WINJS_PRIORITY = 40; -const GECKO_PRIORITY = 50; -function createFrame(filename, func, lineno, colno) { - const frame = { - filename, - function: func === "" ? UNKNOWN_FUNCTION : func, - in_app: true - // All browser frames are considered in_app - }; - if (lineno !== void 0) { - frame.lineno = lineno; - } - if (colno !== void 0) { - frame.colno = colno; - } - return frame; -} -__name(createFrame, "createFrame"); -const chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i; -const chromeRegex = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; -const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/; -const chromeStackParserFn = /* @__PURE__ */ __name((line) => { - const noFnParts = chromeRegexNoFnName.exec(line); - if (noFnParts) { - const [, filename, line2, col] = noFnParts; - return createFrame(filename, UNKNOWN_FUNCTION, +line2, +col); - } - const parts2 = chromeRegex.exec(line); - if (parts2) { - const isEval = parts2[2] && parts2[2].indexOf("eval") === 0; - if (isEval) { - const subMatch = chromeEvalRegex.exec(parts2[2]); - if (subMatch) { - parts2[2] = subMatch[1]; - parts2[3] = subMatch[2]; - parts2[4] = subMatch[3]; - } - } - const [func, filename] = extractSafariExtensionDetails(parts2[1] || UNKNOWN_FUNCTION, parts2[2]); - return createFrame(filename, func, parts2[3] ? +parts2[3] : void 0, parts2[4] ? +parts2[4] : void 0); - } - return; -}, "chromeStackParserFn"); -const chromeStackLineParser = [CHROME_PRIORITY, chromeStackParserFn]; -const geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i; -const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; -const gecko$1 = /* @__PURE__ */ __name((line) => { - const parts2 = geckoREgex.exec(line); - if (parts2) { - const isEval = parts2[3] && parts2[3].indexOf(" > eval") > -1; - if (isEval) { - const subMatch = geckoEvalRegex.exec(parts2[3]); - if (subMatch) { - parts2[1] = parts2[1] || "eval"; - parts2[3] = subMatch[1]; - parts2[4] = subMatch[2]; - parts2[5] = ""; - } - } - let filename = parts2[3]; - let func = parts2[1] || UNKNOWN_FUNCTION; - [func, filename] = extractSafariExtensionDetails(func, filename); - return createFrame(filename, func, parts2[4] ? +parts2[4] : void 0, parts2[5] ? +parts2[5] : void 0); - } - return; -}, "gecko$1"); -const geckoStackLineParser = [GECKO_PRIORITY, gecko$1]; -const winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i; -const winjs = /* @__PURE__ */ __name((line) => { - const parts2 = winjsRegex.exec(line); - return parts2 ? createFrame(parts2[2], parts2[1] || UNKNOWN_FUNCTION, +parts2[3], parts2[4] ? +parts2[4] : void 0) : void 0; -}, "winjs"); -const winjsStackLineParser = [WINJS_PRIORITY, winjs]; -const opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i; -const opera10 = /* @__PURE__ */ __name((line) => { - const parts2 = opera10Regex.exec(line); - return parts2 ? createFrame(parts2[2], parts2[3] || UNKNOWN_FUNCTION, +parts2[1]) : void 0; -}, "opera10"); -const opera10StackLineParser = [OPERA10_PRIORITY, opera10]; -const opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\(.*\))? in (.*):\s*$/i; -const opera11 = /* @__PURE__ */ __name((line) => { - const parts2 = opera11Regex.exec(line); - return parts2 ? createFrame(parts2[5], parts2[3] || parts2[4] || UNKNOWN_FUNCTION, +parts2[1], +parts2[2]) : void 0; -}, "opera11"); -const opera11StackLineParser = [OPERA11_PRIORITY, opera11]; -const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser]; -const defaultStackParser = createStackParser(...defaultStackLineParsers); -const extractSafariExtensionDetails = /* @__PURE__ */ __name((func, filename) => { - const isSafariExtension = func.indexOf("safari-extension") !== -1; - const isSafariWebExtension = func.indexOf("safari-web-extension") !== -1; - return isSafariExtension || isSafariWebExtension ? [ - func.indexOf("@") !== -1 ? func.split("@")[0] : UNKNOWN_FUNCTION, - isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}` - ] : [func, filename]; -}, "extractSafariExtensionDetails"); -const MAX_ALLOWED_STRING_LENGTH = 1024; -const INTEGRATION_NAME$a = "Breadcrumbs"; -const _breadcrumbsIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const _options = { - console: true, - dom: true, - fetch: true, - history: true, - sentry: true, - xhr: true, - ...options4 - }; - return { - name: INTEGRATION_NAME$a, - setup(client) { - if (_options.console) { - addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client)); - } - if (_options.dom) { - addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom)); - } - if (_options.xhr) { - addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client)); - } - if (_options.fetch) { - addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client)); - } - if (_options.history) { - addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client)); - } - if (_options.sentry) { - client.on("beforeSendEvent", _getSentryBreadcrumbHandler(client)); - } - } - }; -}, "_breadcrumbsIntegration"); -const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration); -function _getSentryBreadcrumbHandler(client) { - return /* @__PURE__ */ __name(function addSentryBreadcrumb(event) { - if (getClient() !== client) { - return; - } - addBreadcrumb( - { - category: `sentry.${event.type === "transaction" ? "transaction" : "event"}`, - event_id: event.event_id, - level: event.level, - message: getEventDescription(event) - }, - { - event - } - ); - }, "addSentryBreadcrumb"); -} -__name(_getSentryBreadcrumbHandler, "_getSentryBreadcrumbHandler"); -function _getDomBreadcrumbHandler(client, dom) { - return /* @__PURE__ */ __name(function _innerDomBreadcrumb(handlerData) { - if (getClient() !== client) { - return; - } - let target2; - let componentName; - let keyAttrs = typeof dom === "object" ? dom.serializeAttribute : void 0; - let maxStringLength = typeof dom === "object" && typeof dom.maxStringLength === "number" ? dom.maxStringLength : void 0; - if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) { - DEBUG_BUILD$4 && logger$2.warn( - `\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.` - ); - maxStringLength = MAX_ALLOWED_STRING_LENGTH; - } - if (typeof keyAttrs === "string") { - keyAttrs = [keyAttrs]; - } - try { - const event = handlerData.event; - const element = _isEvent(event) ? event.target : event; - target2 = htmlTreeAsString(element, { keyAttrs, maxStringLength }); - componentName = getComponentName$1(element); - } catch (e2) { - target2 = ""; - } - if (target2.length === 0) { - return; - } - const breadcrumb = { - category: `ui.${handlerData.name}`, - message: target2 - }; - if (componentName) { - breadcrumb.data = { "ui.component_name": componentName }; - } - addBreadcrumb(breadcrumb, { - event: handlerData.event, - name: handlerData.name, - global: handlerData.global - }); - }, "_innerDomBreadcrumb"); -} -__name(_getDomBreadcrumbHandler, "_getDomBreadcrumbHandler"); -function _getConsoleBreadcrumbHandler(client) { - return /* @__PURE__ */ __name(function _consoleBreadcrumb(handlerData) { - if (getClient() !== client) { - return; - } - const breadcrumb = { - category: "console", - data: { - arguments: handlerData.args, - logger: "console" - }, - level: severityLevelFromString(handlerData.level), - message: safeJoin(handlerData.args, " ") - }; - if (handlerData.level === "assert") { - if (handlerData.args[0] === false) { - breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), " ") || "console.assert"}`; - breadcrumb.data.arguments = handlerData.args.slice(1); - } else { - return; - } - } - addBreadcrumb(breadcrumb, { - input: handlerData.args, - level: handlerData.level - }); - }, "_consoleBreadcrumb"); -} -__name(_getConsoleBreadcrumbHandler, "_getConsoleBreadcrumbHandler"); -function _getXhrBreadcrumbHandler(client) { - return /* @__PURE__ */ __name(function _xhrBreadcrumb(handlerData) { - if (getClient() !== client) { - return; - } - const { startTimestamp, endTimestamp } = handlerData; - const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY]; - if (!startTimestamp || !endTimestamp || !sentryXhrData) { - return; - } - const { method, url, status_code, body } = sentryXhrData; - const data26 = { - method, - url, - status_code - }; - const hint = { - xhr: handlerData.xhr, - input: body, - startTimestamp, - endTimestamp - }; - const level = getBreadcrumbLogLevelFromHttpStatusCode(status_code); - addBreadcrumb( - { - category: "xhr", - data: data26, - type: "http", - level - }, - hint - ); - }, "_xhrBreadcrumb"); -} -__name(_getXhrBreadcrumbHandler, "_getXhrBreadcrumbHandler"); -function _getFetchBreadcrumbHandler(client) { - return /* @__PURE__ */ __name(function _fetchBreadcrumb(handlerData) { - if (getClient() !== client) { - return; - } - const { startTimestamp, endTimestamp } = handlerData; - if (!endTimestamp) { - return; - } - if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === "POST") { - return; - } - if (handlerData.error) { - const data26 = handlerData.fetchData; - const hint = { - data: handlerData.error, - input: handlerData.args, - startTimestamp, - endTimestamp - }; - addBreadcrumb( - { - category: "fetch", - data: data26, - level: "error", - type: "http" - }, - hint - ); - } else { - const response = handlerData.response; - const data26 = { - ...handlerData.fetchData, - status_code: response && response.status - }; - const hint = { - input: handlerData.args, - response, - startTimestamp, - endTimestamp - }; - const level = getBreadcrumbLogLevelFromHttpStatusCode(data26.status_code); - addBreadcrumb( - { - category: "fetch", - data: data26, - type: "http", - level - }, - hint - ); - } - }, "_fetchBreadcrumb"); -} -__name(_getFetchBreadcrumbHandler, "_getFetchBreadcrumbHandler"); -function _getHistoryBreadcrumbHandler(client) { - return /* @__PURE__ */ __name(function _historyBreadcrumb(handlerData) { - if (getClient() !== client) { - return; - } - let from2 = handlerData.from; - let to = handlerData.to; - const parsedLoc = parseUrl$1(WINDOW$5.location.href); - let parsedFrom = from2 ? parseUrl$1(from2) : void 0; - const parsedTo = parseUrl$1(to); - if (!parsedFrom || !parsedFrom.path) { - parsedFrom = parsedLoc; - } - if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) { - to = parsedTo.relative; - } - if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) { - from2 = parsedFrom.relative; - } - addBreadcrumb({ - category: "navigation", - data: { - from: from2, - to - } - }); - }, "_historyBreadcrumb"); -} -__name(_getHistoryBreadcrumbHandler, "_getHistoryBreadcrumbHandler"); -function _isEvent(event) { - return !!event && !!event.target; -} -__name(_isEvent, "_isEvent"); -const DEFAULT_EVENT_TARGET = [ - "EventTarget", - "Window", - "Node", - "ApplicationCache", - "AudioTrackList", - "BroadcastChannel", - "ChannelMergerNode", - "CryptoOperation", - "EventSource", - "FileReader", - "HTMLUnknownElement", - "IDBDatabase", - "IDBRequest", - "IDBTransaction", - "KeyOperation", - "MediaController", - "MessagePort", - "ModalWindow", - "Notification", - "SVGElementInstance", - "Screen", - "SharedWorker", - "TextTrack", - "TextTrackCue", - "TextTrackList", - "WebSocket", - "WebSocketWorker", - "Worker", - "XMLHttpRequest", - "XMLHttpRequestEventTarget", - "XMLHttpRequestUpload" -]; -const INTEGRATION_NAME$9 = "BrowserApiErrors"; -const _browserApiErrorsIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const _options = { - XMLHttpRequest: true, - eventTarget: true, - requestAnimationFrame: true, - setInterval: true, - setTimeout: true, - ...options4 - }; - return { - name: INTEGRATION_NAME$9, - // TODO: This currently only works for the first client this is setup - // We may want to adjust this to check for client etc. - setupOnce() { - if (_options.setTimeout) { - fill(WINDOW$5, "setTimeout", _wrapTimeFunction); - } - if (_options.setInterval) { - fill(WINDOW$5, "setInterval", _wrapTimeFunction); - } - if (_options.requestAnimationFrame) { - fill(WINDOW$5, "requestAnimationFrame", _wrapRAF); - } - if (_options.XMLHttpRequest && "XMLHttpRequest" in WINDOW$5) { - fill(XMLHttpRequest.prototype, "send", _wrapXHR$1); - } - const eventTargetOption = _options.eventTarget; - if (eventTargetOption) { - const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET; - eventTarget.forEach(_wrapEventTarget); - } - } - }; -}, "_browserApiErrorsIntegration"); -const browserApiErrorsIntegration = defineIntegration(_browserApiErrorsIntegration); -function _wrapTimeFunction(original) { - return function(...args) { - const originalCallback = args[0]; - args[0] = wrap$1(originalCallback, { - mechanism: { - data: { function: getFunctionName(original) }, - handled: false, - type: "instrument" - } - }); - return original.apply(this, args); - }; -} -__name(_wrapTimeFunction, "_wrapTimeFunction"); -function _wrapRAF(original) { - return function(callback) { - return original.apply(this, [ - wrap$1(callback, { - mechanism: { - data: { - function: "requestAnimationFrame", - handler: getFunctionName(original) - }, - handled: false, - type: "instrument" - } - }) - ]); - }; -} -__name(_wrapRAF, "_wrapRAF"); -function _wrapXHR$1(originalSend) { - return function(...args) { - const xhr = this; - const xmlHttpRequestProps = ["onload", "onerror", "onprogress", "onreadystatechange"]; - xmlHttpRequestProps.forEach((prop2) => { - if (prop2 in xhr && typeof xhr[prop2] === "function") { - fill(xhr, prop2, function(original) { - const wrapOptions = { - mechanism: { - data: { - function: prop2, - handler: getFunctionName(original) - }, - handled: false, - type: "instrument" - } - }; - const originalFunction = getOriginalFunction(original); - if (originalFunction) { - wrapOptions.mechanism.data.handler = getFunctionName(originalFunction); - } - return wrap$1(original, wrapOptions); - }); - } - }); - return originalSend.apply(this, args); - }; -} -__name(_wrapXHR$1, "_wrapXHR$1"); -function _wrapEventTarget(target2) { - const globalObject = WINDOW$5; - const targetObj = globalObject[target2]; - const proto = targetObj && targetObj.prototype; - if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty("addEventListener")) { - return; - } - fill(proto, "addEventListener", function(original) { - return function(eventName, fn, options4) { - try { - if (isEventListenerObject(fn)) { - fn.handleEvent = wrap$1(fn.handleEvent, { - mechanism: { - data: { - function: "handleEvent", - handler: getFunctionName(fn), - target: target2 - }, - handled: false, - type: "instrument" - } - }); - } - } catch (e2) { - } - return original.apply(this, [ - eventName, - wrap$1(fn, { - mechanism: { - data: { - function: "addEventListener", - handler: getFunctionName(fn), - target: target2 - }, - handled: false, - type: "instrument" - } - }), - options4 - ]); - }; - }); - fill(proto, "removeEventListener", function(originalRemoveEventListener) { - return function(eventName, fn, options4) { - try { - const originalEventHandler = fn.__sentry_wrapped__; - if (originalEventHandler) { - originalRemoveEventListener.call(this, eventName, originalEventHandler, options4); - } - } catch (e2) { - } - return originalRemoveEventListener.call(this, eventName, fn, options4); - }; - }); -} -__name(_wrapEventTarget, "_wrapEventTarget"); -function isEventListenerObject(obj) { - return typeof obj.handleEvent === "function"; -} -__name(isEventListenerObject, "isEventListenerObject"); -const browserSessionIntegration = defineIntegration(() => { - return { - name: "BrowserSession", - setupOnce() { - if (typeof WINDOW$5.document === "undefined") { - DEBUG_BUILD$4 && logger$2.warn("Using the `browserSessionIntegration` in non-browser environments is not supported."); - return; - } - startSession({ ignoreDuration: true }); - captureSession(); - addHistoryInstrumentationHandler(({ from: from2, to }) => { - if (from2 !== void 0 && from2 !== to) { - startSession({ ignoreDuration: true }); - captureSession(); - } - }); - } - }; -}); -const INTEGRATION_NAME$8 = "GlobalHandlers"; -const _globalHandlersIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const _options = { - onerror: true, - onunhandledrejection: true, - ...options4 - }; - return { - name: INTEGRATION_NAME$8, - setupOnce() { - Error.stackTraceLimit = 50; - }, - setup(client) { - if (_options.onerror) { - _installGlobalOnErrorHandler(client); - globalHandlerLog("onerror"); - } - if (_options.onunhandledrejection) { - _installGlobalOnUnhandledRejectionHandler(client); - globalHandlerLog("onunhandledrejection"); - } - } - }; -}, "_globalHandlersIntegration"); -const globalHandlersIntegration = defineIntegration(_globalHandlersIntegration); -function _installGlobalOnErrorHandler(client) { - addGlobalErrorInstrumentationHandler((data26) => { - const { stackParser, attachStacktrace } = getOptions(); - if (getClient() !== client || shouldIgnoreOnError()) { - return; - } - const { msg, url, line, column, error: error2 } = data26; - const event = _enhanceEventWithInitialFrame( - eventFromUnknownInput(stackParser, error2 || msg, void 0, attachStacktrace, false), - url, - line, - column - ); - event.level = "error"; - captureEvent(event, { - originalException: error2, - mechanism: { - handled: false, - type: "onerror" - } - }); - }); -} -__name(_installGlobalOnErrorHandler, "_installGlobalOnErrorHandler"); -function _installGlobalOnUnhandledRejectionHandler(client) { - addGlobalUnhandledRejectionInstrumentationHandler((e2) => { - const { stackParser, attachStacktrace } = getOptions(); - if (getClient() !== client || shouldIgnoreOnError()) { - return; - } - const error2 = _getUnhandledRejectionError(e2); - const event = isPrimitive(error2) ? _eventFromRejectionWithPrimitive(error2) : eventFromUnknownInput(stackParser, error2, void 0, attachStacktrace, true); - event.level = "error"; - captureEvent(event, { - originalException: error2, - mechanism: { - handled: false, - type: "onunhandledrejection" - } - }); - }); -} -__name(_installGlobalOnUnhandledRejectionHandler, "_installGlobalOnUnhandledRejectionHandler"); -function _getUnhandledRejectionError(error2) { - if (isPrimitive(error2)) { - return error2; - } - try { - if ("reason" in error2) { - return error2.reason; - } - if ("detail" in error2 && "reason" in error2.detail) { - return error2.detail.reason; - } - } catch (e2) { - } - return error2; -} -__name(_getUnhandledRejectionError, "_getUnhandledRejectionError"); -function _eventFromRejectionWithPrimitive(reason) { - return { - exception: { - values: [ - { - type: "UnhandledRejection", - // String() is needed because the Primitive type includes symbols (which can't be automatically stringified) - value: `Non-Error promise rejection captured with value: ${String(reason)}` - } - ] - } - }; -} -__name(_eventFromRejectionWithPrimitive, "_eventFromRejectionWithPrimitive"); -function _enhanceEventWithInitialFrame(event, url, line, column) { - const e2 = event.exception = event.exception || {}; - const ev = e2.values = e2.values || []; - const ev0 = ev[0] = ev[0] || {}; - const ev0s = ev0.stacktrace = ev0.stacktrace || {}; - const ev0sf = ev0s.frames = ev0s.frames || []; - const colno = column; - const lineno = line; - const filename = isString$a(url) && url.length > 0 ? url : getLocationHref(); - if (ev0sf.length === 0) { - ev0sf.push({ - colno, - filename, - function: UNKNOWN_FUNCTION, - in_app: true, - lineno - }); - } - return event; -} -__name(_enhanceEventWithInitialFrame, "_enhanceEventWithInitialFrame"); -function globalHandlerLog(type) { - DEBUG_BUILD$4 && logger$2.log(`Global Handler attached: ${type}`); -} -__name(globalHandlerLog, "globalHandlerLog"); -function getOptions() { - const client = getClient(); - const options4 = client && client.getOptions() || { - stackParser: /* @__PURE__ */ __name(() => [], "stackParser"), - attachStacktrace: false - }; - return options4; -} -__name(getOptions, "getOptions"); -const httpContextIntegration = defineIntegration(() => { - return { - name: "HttpContext", - preprocessEvent(event) { - if (!WINDOW$5.navigator && !WINDOW$5.location && !WINDOW$5.document) { - return; - } - const url = event.request && event.request.url || WINDOW$5.location && WINDOW$5.location.href; - const { referrer } = WINDOW$5.document || {}; - const { userAgent } = WINDOW$5.navigator || {}; - const headers = { - ...event.request && event.request.headers, - ...referrer && { Referer: referrer }, - ...userAgent && { "User-Agent": userAgent } - }; - const request = { ...event.request, ...url && { url }, headers }; - event.request = request; - } - }; -}); -const DEFAULT_KEY = "cause"; -const DEFAULT_LIMIT = 5; -const INTEGRATION_NAME$7 = "LinkedErrors"; -const _linkedErrorsIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const limit = options4.limit || DEFAULT_LIMIT; - const key = options4.key || DEFAULT_KEY; - return { - name: INTEGRATION_NAME$7, - preprocessEvent(event, hint, client) { - const options5 = client.getOptions(); - applyAggregateErrorsToEvent( - // This differs from the LinkedErrors integration in core by using a different exceptionFromError function - exceptionFromError, - options5.stackParser, - options5.maxValueLength, - key, - limit, - event, - hint - ); - } - }; -}, "_linkedErrorsIntegration"); -const linkedErrorsIntegration = defineIntegration(_linkedErrorsIntegration); -function getDefaultIntegrations(options4) { - const integrations = [ - inboundFiltersIntegration(), - functionToStringIntegration(), - browserApiErrorsIntegration(), - breadcrumbsIntegration(), - globalHandlersIntegration(), - linkedErrorsIntegration(), - dedupeIntegration(), - httpContextIntegration() - ]; - if (options4.autoSessionTracking !== false) { - integrations.push(browserSessionIntegration()); - } - return integrations; -} -__name(getDefaultIntegrations, "getDefaultIntegrations"); -function applyDefaultOptions(optionsArg = {}) { - const defaultOptions2 = { - defaultIntegrations: getDefaultIntegrations(optionsArg), - release: typeof __SENTRY_RELEASE__ === "string" ? __SENTRY_RELEASE__ : WINDOW$5.SENTRY_RELEASE && WINDOW$5.SENTRY_RELEASE.id ? WINDOW$5.SENTRY_RELEASE.id : void 0, - autoSessionTracking: true, - sendClientReports: true - }; - if (optionsArg.defaultIntegrations == null) { - delete optionsArg.defaultIntegrations; - } - return { ...defaultOptions2, ...optionsArg }; -} -__name(applyDefaultOptions, "applyDefaultOptions"); -function shouldShowBrowserExtensionError() { - const windowWithMaybeExtension = typeof WINDOW$5.window !== "undefined" && WINDOW$5; - if (!windowWithMaybeExtension) { - return false; - } - const extensionKey = windowWithMaybeExtension.chrome ? "chrome" : "browser"; - const extensionObject = windowWithMaybeExtension[extensionKey]; - const runtimeId = extensionObject && extensionObject.runtime && extensionObject.runtime.id; - const href = WINDOW$5.location && WINDOW$5.location.href || ""; - const extensionProtocols = ["chrome-extension:", "moz-extension:", "ms-browser-extension:", "safari-web-extension:"]; - const isDedicatedExtensionPage = !!runtimeId && WINDOW$5 === WINDOW$5.top && extensionProtocols.some((protocol) => href.startsWith(`${protocol}//`)); - const isNWjs = typeof windowWithMaybeExtension.nw !== "undefined"; - return !!runtimeId && !isDedicatedExtensionPage && !isNWjs; -} -__name(shouldShowBrowserExtensionError, "shouldShowBrowserExtensionError"); -function init$4(browserOptions = {}) { - const options4 = applyDefaultOptions(browserOptions); - if (!options4.skipBrowserExtensionCheck && shouldShowBrowserExtensionError()) { - consoleSandbox(() => { - console.error( - "[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/" - ); - }); - return; - } - if (DEBUG_BUILD$4) { - if (!supportsFetch()) { - logger$2.warn( - "No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill." - ); - } - } - const clientOptions = { - ...options4, - stackParser: stackParserFromStackParserOptions(options4.stackParser || defaultStackParser), - integrations: getIntegrationsToSetup(options4), - transport: options4.transport || makeFetchTransport - }; - return initAndBind(BrowserClient, clientOptions); -} -__name(init$4, "init$4"); -function showReportDialog(options4 = {}) { - if (!WINDOW$5.document) { - DEBUG_BUILD$4 && logger$2.error("Global document not defined in showReportDialog call"); - return; - } - const scope = getCurrentScope$1(); - const client = scope.getClient(); - const dsn = client && client.getDsn(); - if (!dsn) { - DEBUG_BUILD$4 && logger$2.error("DSN not configured for showReportDialog call"); - return; - } - if (scope) { - options4.user = { - ...scope.getUser(), - ...options4.user - }; - } - if (!options4.eventId) { - const eventId = lastEventId(); - if (eventId) { - options4.eventId = eventId; - } - } - const script2 = WINDOW$5.document.createElement("script"); - script2.async = true; - script2.crossOrigin = "anonymous"; - script2.src = getReportDialogEndpoint(dsn, options4); - if (options4.onLoad) { - script2.onload = options4.onLoad; - } - const { onClose } = options4; - if (onClose) { - const reportDialogClosedMessageHandler = /* @__PURE__ */ __name((event) => { - if (event.data === "__sentry_reportdialog_closed__") { - try { - onClose(); - } finally { - WINDOW$5.removeEventListener("message", reportDialogClosedMessageHandler); - } - } - }, "reportDialogClosedMessageHandler"); - WINDOW$5.addEventListener("message", reportDialogClosedMessageHandler); - } - const injectionPoint = WINDOW$5.document.head || WINDOW$5.document.body; - if (injectionPoint) { - injectionPoint.appendChild(script2); - } else { - DEBUG_BUILD$4 && logger$2.error("Not injecting report dialog. No injection point found in HTML"); - } -} -__name(showReportDialog, "showReportDialog"); -function forceLoad() { -} -__name(forceLoad, "forceLoad"); -function onLoad(callback) { - callback(); -} -__name(onLoad, "onLoad"); -function captureUserFeedback(feedback) { - const client = getClient(); - if (client) { - client.captureUserFeedback(feedback); - } -} -__name(captureUserFeedback, "captureUserFeedback"); -const LazyLoadableIntegrations = { - replayIntegration: "replay", - replayCanvasIntegration: "replay-canvas", - feedbackIntegration: "feedback", - feedbackModalIntegration: "feedback-modal", - feedbackScreenshotIntegration: "feedback-screenshot", - captureConsoleIntegration: "captureconsole", - contextLinesIntegration: "contextlines", - linkedErrorsIntegration: "linkederrors", - debugIntegration: "debug", - dedupeIntegration: "dedupe", - extraErrorDataIntegration: "extraerrordata", - httpClientIntegration: "httpclient", - reportingObserverIntegration: "reportingobserver", - rewriteFramesIntegration: "rewriteframes", - sessionTimingIntegration: "sessiontiming", - browserProfilingIntegration: "browserprofiling", - moduleMetadataIntegration: "modulemetadata" -}; -const WindowWithMaybeIntegration = WINDOW$5; -async function lazyLoadIntegration(name2, scriptNonce) { - const bundle = LazyLoadableIntegrations[name2]; - const sentryOnWindow = WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {}; - if (!bundle) { - throw new Error(`Cannot lazy load integration: ${name2}`); - } - const existing = sentryOnWindow[name2]; - if (typeof existing === "function" && !("_isShim" in existing)) { - return existing; - } - const url = getScriptURL(bundle); - const script2 = WINDOW$5.document.createElement("script"); - script2.src = url; - script2.crossOrigin = "anonymous"; - script2.referrerPolicy = "origin"; - if (scriptNonce) { - script2.setAttribute("nonce", scriptNonce); - } - const waitForLoad = new Promise((resolve2, reject3) => { - script2.addEventListener("load", () => resolve2()); - script2.addEventListener("error", reject3); - }); - const currentScript = WINDOW$5.document.currentScript; - const parent = WINDOW$5.document.body || WINDOW$5.document.head || currentScript && currentScript.parentElement; - if (parent) { - parent.appendChild(script2); - } else { - throw new Error(`Could not find parent element to insert lazy-loaded ${name2} script`); - } - try { - await waitForLoad; - } catch (e2) { - throw new Error(`Error when loading integration: ${name2}`); - } - const integrationFn = sentryOnWindow[name2]; - if (typeof integrationFn !== "function") { - throw new Error(`Could not load integration: ${name2}`); - } - return integrationFn; -} -__name(lazyLoadIntegration, "lazyLoadIntegration"); -function getScriptURL(bundle) { - const client = getClient(); - const options4 = client && client.getOptions(); - const baseURL = options4 && options4.cdnBaseUrl || "https://browser.sentry-cdn.com"; - return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString(); -} -__name(getScriptURL, "getScriptURL"); -const WINDOW$3 = GLOBAL_OBJ; -const INTEGRATION_NAME$6 = "ReportingObserver"; -const SETUP_CLIENTS = /* @__PURE__ */ new WeakMap(); -const _reportingObserverIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const types = options4.types || ["crash", "deprecation", "intervention"]; - function handler10(reports) { - if (!SETUP_CLIENTS.has(getClient())) { - return; - } - for (const report of reports) { - withScope((scope) => { - scope.setExtra("url", report.url); - const label5 = `ReportingObserver [${report.type}]`; - let details = "No details available"; - if (report.body) { - const plainBody = {}; - for (const prop2 in report.body) { - plainBody[prop2] = report.body[prop2]; - } - scope.setExtra("body", plainBody); - if (report.type === "crash") { - const body = report.body; - details = [body.crashId || "", body.reason || ""].join(" ").trim() || details; - } else { - const body = report.body; - details = body.message || details; - } - } - captureMessage(`${label5}: ${details}`); - }); - } - } - __name(handler10, "handler"); - return { - name: INTEGRATION_NAME$6, - setupOnce() { - if (!supportsReportingObserver()) { - return; - } - const observer = new WINDOW$3.ReportingObserver( - handler10, - { - buffered: true, - types - } - ); - observer.observe(); - }, - setup(client) { - SETUP_CLIENTS.set(client, true); - } - }; -}, "_reportingObserverIntegration"); -const reportingObserverIntegration = defineIntegration(_reportingObserverIntegration); -const INTEGRATION_NAME$5 = "HttpClient"; -const _httpClientIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const _options = { - failedRequestStatusCodes: [[500, 599]], - failedRequestTargets: [/.*/], - ...options4 - }; - return { - name: INTEGRATION_NAME$5, - setup(client) { - _wrapFetch(client, _options); - _wrapXHR(client, _options); - } - }; -}, "_httpClientIntegration"); -const httpClientIntegration = defineIntegration(_httpClientIntegration); -function _fetchResponseHandler(options4, requestInfo, response, requestInit, error2) { - if (_shouldCaptureResponse(options4, response.status, response.url)) { - const request = _getRequest(requestInfo, requestInit); - let requestHeaders, responseHeaders, requestCookies, responseCookies; - if (_shouldSendDefaultPii()) { - [requestHeaders, requestCookies] = _parseCookieHeaders("Cookie", request); - [responseHeaders, responseCookies] = _parseCookieHeaders("Set-Cookie", response); - } - const event = _createEvent({ - url: request.url, - method: request.method, - status: response.status, - requestHeaders, - responseHeaders, - requestCookies, - responseCookies, - error: error2 - }); - captureEvent(event); - } -} -__name(_fetchResponseHandler, "_fetchResponseHandler"); -function _parseCookieHeaders(cookieHeader, obj) { - const headers = _extractFetchHeaders(obj.headers); - let cookies2; - try { - const cookieString = headers[cookieHeader] || headers[cookieHeader.toLowerCase()] || void 0; - if (cookieString) { - cookies2 = _parseCookieString(cookieString); - } - } catch (e2) { - } - return [headers, cookies2]; -} -__name(_parseCookieHeaders, "_parseCookieHeaders"); -function _xhrResponseHandler(options4, xhr, method, headers, error2) { - if (_shouldCaptureResponse(options4, xhr.status, xhr.responseURL)) { - let requestHeaders, responseCookies, responseHeaders; - if (_shouldSendDefaultPii()) { - try { - const cookieString = xhr.getResponseHeader("Set-Cookie") || xhr.getResponseHeader("set-cookie") || void 0; - if (cookieString) { - responseCookies = _parseCookieString(cookieString); - } - } catch (e3) { - } - try { - responseHeaders = _getXHRResponseHeaders(xhr); - } catch (e4) { - } - requestHeaders = headers; - } - const event = _createEvent({ - url: xhr.responseURL, - method, - status: xhr.status, - requestHeaders, - // Can't access request cookies from XHR - responseHeaders, - responseCookies, - error: error2 - }); - captureEvent(event); - } -} -__name(_xhrResponseHandler, "_xhrResponseHandler"); -function _getResponseSizeFromHeaders(headers) { - if (headers) { - const contentLength = headers["Content-Length"] || headers["content-length"]; - if (contentLength) { - return parseInt(contentLength, 10); - } - } - return void 0; -} -__name(_getResponseSizeFromHeaders, "_getResponseSizeFromHeaders"); -function _parseCookieString(cookieString) { - return cookieString.split("; ").reduce((acc, cookie) => { - const [key, value4] = cookie.split("="); - if (key && value4) { - acc[key] = value4; - } - return acc; - }, {}); -} -__name(_parseCookieString, "_parseCookieString"); -function _extractFetchHeaders(headers) { - const result = {}; - headers.forEach((value4, key) => { - result[key] = value4; - }); - return result; -} -__name(_extractFetchHeaders, "_extractFetchHeaders"); -function _getXHRResponseHeaders(xhr) { - const headers = xhr.getAllResponseHeaders(); - if (!headers) { - return {}; - } - return headers.split("\r\n").reduce((acc, line) => { - const [key, value4] = line.split(": "); - if (key && value4) { - acc[key] = value4; - } - return acc; - }, {}); -} -__name(_getXHRResponseHeaders, "_getXHRResponseHeaders"); -function _isInGivenRequestTargets(failedRequestTargets, target2) { - return failedRequestTargets.some((givenRequestTarget) => { - if (typeof givenRequestTarget === "string") { - return target2.includes(givenRequestTarget); - } - return givenRequestTarget.test(target2); - }); -} -__name(_isInGivenRequestTargets, "_isInGivenRequestTargets"); -function _isInGivenStatusRanges(failedRequestStatusCodes, status) { - return failedRequestStatusCodes.some((range2) => { - if (typeof range2 === "number") { - return range2 === status; - } - return status >= range2[0] && status <= range2[1]; - }); -} -__name(_isInGivenStatusRanges, "_isInGivenStatusRanges"); -function _wrapFetch(client, options4) { - if (!supportsNativeFetch()) { - return; - } - addFetchInstrumentationHandler((handlerData) => { - if (getClient() !== client) { - return; - } - const { response, args, error: error2, virtualError } = handlerData; - const [requestInfo, requestInit] = args; - if (!response) { - return; - } - _fetchResponseHandler(options4, requestInfo, response, requestInit, error2 || virtualError); - }, false); -} -__name(_wrapFetch, "_wrapFetch"); -function _wrapXHR(client, options4) { - if (!("XMLHttpRequest" in GLOBAL_OBJ)) { - return; - } - addXhrInstrumentationHandler((handlerData) => { - if (getClient() !== client) { - return; - } - const { error: error2, virtualError } = handlerData; - const xhr = handlerData.xhr; - const sentryXhrData = xhr[SENTRY_XHR_DATA_KEY]; - if (!sentryXhrData) { - return; - } - const { method, request_headers: headers } = sentryXhrData; - try { - _xhrResponseHandler(options4, xhr, method, headers, error2 || virtualError); - } catch (e2) { - DEBUG_BUILD$4 && logger$2.warn("Error while extracting response event form XHR response", e2); - } - }); -} -__name(_wrapXHR, "_wrapXHR"); -function _shouldCaptureResponse(options4, status, url) { - return _isInGivenStatusRanges(options4.failedRequestStatusCodes, status) && _isInGivenRequestTargets(options4.failedRequestTargets, url) && !isSentryRequestUrl(url, getClient()); -} -__name(_shouldCaptureResponse, "_shouldCaptureResponse"); -function _createEvent(data26) { - const client = getClient(); - const virtualStackTrace = client && data26.error && data26.error instanceof Error ? data26.error.stack : void 0; - const stack2 = virtualStackTrace && client ? client.getOptions().stackParser(virtualStackTrace, 0, 1) : void 0; - const message3 = `HTTP Client Error with status code: ${data26.status}`; - const event = { - message: message3, - exception: { - values: [ - { - type: "Error", - value: message3, - stacktrace: stack2 ? { frames: stack2 } : void 0 - } - ] - }, - request: { - url: data26.url, - method: data26.method, - headers: data26.requestHeaders, - cookies: data26.requestCookies - }, - contexts: { - response: { - status_code: data26.status, - headers: data26.responseHeaders, - cookies: data26.responseCookies, - body_size: _getResponseSizeFromHeaders(data26.responseHeaders) - } - } - }; - addExceptionMechanism(event, { - type: "http.client", - handled: false - }); - return event; -} -__name(_createEvent, "_createEvent"); -function _getRequest(requestInfo, requestInit) { - if (!requestInit && requestInfo instanceof Request) { - return requestInfo; - } - if (requestInfo instanceof Request && requestInfo.bodyUsed) { - return requestInfo; - } - return new Request(requestInfo, requestInit); -} -__name(_getRequest, "_getRequest"); -function _shouldSendDefaultPii() { - const client = getClient(); - return client ? Boolean(client.getOptions().sendDefaultPii) : false; -} -__name(_shouldSendDefaultPii, "_shouldSendDefaultPii"); -const WINDOW$2 = GLOBAL_OBJ; -const DEFAULT_LINES_OF_CONTEXT = 7; -const INTEGRATION_NAME$4 = "ContextLines"; -const _contextLinesIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const contextLines = options4.frameContextLines != null ? options4.frameContextLines : DEFAULT_LINES_OF_CONTEXT; - return { - name: INTEGRATION_NAME$4, - processEvent(event) { - return addSourceContext(event, contextLines); - } - }; -}, "_contextLinesIntegration"); -const contextLinesIntegration = defineIntegration(_contextLinesIntegration); -function addSourceContext(event, contextLines) { - const doc2 = WINDOW$2.document; - const htmlFilename = WINDOW$2.location && stripUrlQueryAndFragment(WINDOW$2.location.href); - if (!doc2 || !htmlFilename) { - return event; - } - const exceptions = event.exception && event.exception.values; - if (!exceptions || !exceptions.length) { - return event; - } - const html = doc2.documentElement.innerHTML; - if (!html) { - return event; - } - const htmlLines = ["", "", ...html.split("\n"), ""]; - exceptions.forEach((exception) => { - const stacktrace = exception.stacktrace; - if (stacktrace && stacktrace.frames) { - stacktrace.frames = stacktrace.frames.map( - (frame) => applySourceContextToFrame(frame, htmlLines, htmlFilename, contextLines) - ); - } - }); - return event; -} -__name(addSourceContext, "addSourceContext"); -function applySourceContextToFrame(frame, htmlLines, htmlFilename, linesOfContext) { - if (frame.filename !== htmlFilename || !frame.lineno || !htmlLines.length) { - return frame; - } - addContextToFrame(htmlLines, frame, linesOfContext); - return frame; -} -__name(applySourceContextToFrame, "applySourceContextToFrame"); -const WINDOW$1 = GLOBAL_OBJ; -const REPLAY_SESSION_KEY = "sentryReplaySession"; -const REPLAY_EVENT_NAME = "replay_event"; -const UNABLE_TO_SEND_REPLAY = "Unable to send Replay"; -const SESSION_IDLE_PAUSE_DURATION = 3e5; -const SESSION_IDLE_EXPIRE_DURATION = 9e5; -const DEFAULT_FLUSH_MIN_DELAY = 5e3; -const DEFAULT_FLUSH_MAX_DELAY = 5500; -const BUFFER_CHECKOUT_TIME = 6e4; -const RETRY_BASE_INTERVAL = 5e3; -const RETRY_MAX_COUNT = 3; -const NETWORK_BODY_MAX_SIZE = 15e4; -const CONSOLE_ARG_MAX_SIZE = 5e3; -const SLOW_CLICK_THRESHOLD = 3e3; -const SLOW_CLICK_SCROLL_TIMEOUT = 300; -const REPLAY_MAX_EVENT_BUFFER_SIZE = 2e7; -const MIN_REPLAY_DURATION = 4999; -const MIN_REPLAY_DURATION_LIMIT = 15e3; -const MAX_REPLAY_DURATION = 36e5; -function _nullishCoalesce$1(lhs, rhsFn) { - if (lhs != null) { - return lhs; - } else { - return rhsFn(); - } -} -__name(_nullishCoalesce$1, "_nullishCoalesce$1"); -function _optionalChain$5(ops) { - let lastAccessLHS = void 0; - let value4 = ops[0]; - let i2 = 1; - while (i2 < ops.length) { - const op = ops[i2]; - const fn = ops[i2 + 1]; - i2 += 2; - if ((op === "optionalAccess" || op === "optionalCall") && value4 == null) { - return void 0; - } - if (op === "access" || op === "optionalAccess") { - lastAccessLHS = value4; - value4 = fn(value4); - } else if (op === "call" || op === "optionalCall") { - value4 = fn((...args) => value4.call(lastAccessLHS, ...args)); - lastAccessLHS = void 0; - } - } - return value4; -} -__name(_optionalChain$5, "_optionalChain$5"); -var NodeType$3; -(function(NodeType3) { - NodeType3[NodeType3["Document"] = 0] = "Document"; - NodeType3[NodeType3["DocumentType"] = 1] = "DocumentType"; - NodeType3[NodeType3["Element"] = 2] = "Element"; - NodeType3[NodeType3["Text"] = 3] = "Text"; - NodeType3[NodeType3["CDATA"] = 4] = "CDATA"; - NodeType3[NodeType3["Comment"] = 5] = "Comment"; -})(NodeType$3 || (NodeType$3 = {})); -function isElement$1(n2) { - return n2.nodeType === n2.ELEMENT_NODE; -} -__name(isElement$1, "isElement$1"); -function isShadowRoot(n2) { - const host = _optionalChain$5([n2, "optionalAccess", (_2) => _2.host]); - return Boolean(_optionalChain$5([host, "optionalAccess", (_2) => _2.shadowRoot]) === n2); -} -__name(isShadowRoot, "isShadowRoot"); -function isNativeShadowDom(shadowRoot) { - return Object.prototype.toString.call(shadowRoot) === "[object ShadowRoot]"; -} -__name(isNativeShadowDom, "isNativeShadowDom"); -function fixBrowserCompatibilityIssuesInCSS(cssText) { - if (cssText.includes(" background-clip: text;") && !cssText.includes(" -webkit-background-clip: text;")) { - cssText = cssText.replace(/\sbackground-clip:\s*text;/g, " -webkit-background-clip: text; background-clip: text;"); - } - return cssText; -} -__name(fixBrowserCompatibilityIssuesInCSS, "fixBrowserCompatibilityIssuesInCSS"); -function escapeImportStatement(rule) { - const { cssText } = rule; - if (cssText.split('"').length < 3) - return cssText; - const statement = ["@import", `url(${JSON.stringify(rule.href)})`]; - if (rule.layerName === "") { - statement.push(`layer`); - } else if (rule.layerName) { - statement.push(`layer(${rule.layerName})`); - } - if (rule.supportsText) { - statement.push(`supports(${rule.supportsText})`); - } - if (rule.media.length) { - statement.push(rule.media.mediaText); - } - return statement.join(" ") + ";"; -} -__name(escapeImportStatement, "escapeImportStatement"); -function stringifyStylesheet(s2) { - try { - const rules = s2.rules || s2.cssRules; - return rules ? fixBrowserCompatibilityIssuesInCSS(Array.from(rules, stringifyRule).join("")) : null; - } catch (error2) { - return null; - } -} -__name(stringifyStylesheet, "stringifyStylesheet"); -function fixAllCssProperty(rule) { - let styles = ""; - for (let i2 = 0; i2 < rule.style.length; i2++) { - const styleDeclaration = rule.style; - const attribute2 = styleDeclaration[i2]; - const isImportant = styleDeclaration.getPropertyPriority(attribute2); - styles += `${attribute2}:${styleDeclaration.getPropertyValue(attribute2)}${isImportant ? ` !important` : ""};`; - } - return `${rule.selectorText} { ${styles} }`; -} -__name(fixAllCssProperty, "fixAllCssProperty"); -function stringifyRule(rule) { - let importStringified; - if (isCSSImportRule(rule)) { - try { - importStringified = stringifyStylesheet(rule.styleSheet) || escapeImportStatement(rule); - } catch (error2) { - } - } else if (isCSSStyleRule(rule)) { - let cssText = rule.cssText; - const needsSafariColonFix = rule.selectorText.includes(":"); - const needsAllFix = typeof rule.style["all"] === "string" && rule.style["all"]; - if (needsAllFix) { - cssText = fixAllCssProperty(rule); - } - if (needsSafariColonFix) { - cssText = fixSafariColons(cssText); - } - if (needsSafariColonFix || needsAllFix) { - return cssText; - } - } - return importStringified || rule.cssText; -} -__name(stringifyRule, "stringifyRule"); -function fixSafariColons(cssStringified) { - const regex2 = /(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm; - return cssStringified.replace(regex2, "$1\\$2"); -} -__name(fixSafariColons, "fixSafariColons"); -function isCSSImportRule(rule) { - return "styleSheet" in rule; -} -__name(isCSSImportRule, "isCSSImportRule"); -function isCSSStyleRule(rule) { - return "selectorText" in rule; -} -__name(isCSSStyleRule, "isCSSStyleRule"); -class Mirror { - static { - __name(this, "Mirror"); - } - constructor() { - this.idNodeMap = /* @__PURE__ */ new Map(); - this.nodeMetaMap = /* @__PURE__ */ new WeakMap(); - } - getId(n2) { - if (!n2) - return -1; - const id3 = _optionalChain$5([this, "access", (_3) => _3.getMeta, "call", (_4) => _4(n2), "optionalAccess", (_5) => _5.id]); - return _nullishCoalesce$1(id3, () => -1); - } - getNode(id3) { - return this.idNodeMap.get(id3) || null; - } - getIds() { - return Array.from(this.idNodeMap.keys()); - } - getMeta(n2) { - return this.nodeMetaMap.get(n2) || null; - } - removeNodeFromMap(n2) { - const id3 = this.getId(n2); - this.idNodeMap.delete(id3); - if (n2.childNodes) { - n2.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode)); - } - } - has(id3) { - return this.idNodeMap.has(id3); - } - hasNode(node3) { - return this.nodeMetaMap.has(node3); - } - add(n2, meta) { - const id3 = meta.id; - this.idNodeMap.set(id3, n2); - this.nodeMetaMap.set(n2, meta); - } - replace(id3, n2) { - const oldNode = this.getNode(id3); - if (oldNode) { - const meta = this.nodeMetaMap.get(oldNode); - if (meta) - this.nodeMetaMap.set(n2, meta); - } - this.idNodeMap.set(id3, n2); - } - reset() { - this.idNodeMap = /* @__PURE__ */ new Map(); - this.nodeMetaMap = /* @__PURE__ */ new WeakMap(); - } -} -function createMirror() { - return new Mirror(); -} -__name(createMirror, "createMirror"); -function shouldMaskInput({ maskInputOptions, tagName, type }) { - if (tagName === "OPTION") { - tagName = "SELECT"; - } - return Boolean(maskInputOptions[tagName.toLowerCase()] || type && maskInputOptions[type] || type === "password" || tagName === "INPUT" && !type && maskInputOptions["text"]); -} -__name(shouldMaskInput, "shouldMaskInput"); -function maskInputValue({ isMasked: isMasked2, element, value: value4, maskInputFn }) { - let text2 = value4 || ""; - if (!isMasked2) { - return text2; - } - if (maskInputFn) { - text2 = maskInputFn(text2, element); - } - return "*".repeat(text2.length); -} -__name(maskInputValue, "maskInputValue"); -function toLowerCase(str) { - return str.toLowerCase(); -} -__name(toLowerCase, "toLowerCase"); -function toUpperCase(str) { - return str.toUpperCase(); -} -__name(toUpperCase, "toUpperCase"); -const ORIGINAL_ATTRIBUTE_NAME = "__rrweb_original__"; -function is2DCanvasBlank(canvas2) { - const ctx = canvas2.getContext("2d"); - if (!ctx) - return true; - const chunkSize = 50; - for (let x2 = 0; x2 < canvas2.width; x2 += chunkSize) { - for (let y2 = 0; y2 < canvas2.height; y2 += chunkSize) { - const getImageData = ctx.getImageData; - const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData ? getImageData[ORIGINAL_ATTRIBUTE_NAME] : getImageData; - const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x2, y2, Math.min(chunkSize, canvas2.width - x2), Math.min(chunkSize, canvas2.height - y2)).data.buffer); - if (pixelBuffer.some((pixel) => pixel !== 0)) - return false; - } - } - return true; -} -__name(is2DCanvasBlank, "is2DCanvasBlank"); -function getInputType(element) { - const type = element.type; - return element.hasAttribute("data-rr-is-password") ? "password" : type ? toLowerCase(type) : null; -} -__name(getInputType, "getInputType"); -function getInputValue(el, tagName, type) { - if (tagName === "INPUT" && (type === "radio" || type === "checkbox")) { - return el.getAttribute("value") || ""; - } - return el.value; -} -__name(getInputValue, "getInputValue"); -function extractFileExtension(path, baseURL) { - let url; - try { - url = new URL(path, _nullishCoalesce$1(baseURL, () => window.location.href)); - } catch (err) { - return null; - } - const regex2 = /\.([0-9a-z]+)(?:$)/i; - const match3 = url.pathname.match(regex2); - return _nullishCoalesce$1(_optionalChain$5([match3, "optionalAccess", (_6) => _6[1]]), () => null); -} -__name(extractFileExtension, "extractFileExtension"); -const cachedImplementations$1 = {}; -function getImplementation$1(name2) { - const cached = cachedImplementations$1[name2]; - if (cached) { - return cached; - } - const document2 = window.document; - let impl = window[name2]; - if (document2 && typeof document2.createElement === "function") { - try { - const sandbox = document2.createElement("iframe"); - sandbox.hidden = true; - document2.head.appendChild(sandbox); - const contentWindow = sandbox.contentWindow; - if (contentWindow && contentWindow[name2]) { - impl = contentWindow[name2]; - } - document2.head.removeChild(sandbox); - } catch (e2) { - } - } - return cachedImplementations$1[name2] = impl.bind(window); -} -__name(getImplementation$1, "getImplementation$1"); -function setTimeout$2(...rest) { - return getImplementation$1("setTimeout")(...rest); -} -__name(setTimeout$2, "setTimeout$2"); -function clearTimeout$2(...rest) { - return getImplementation$1("clearTimeout")(...rest); -} -__name(clearTimeout$2, "clearTimeout$2"); -function getIframeContentDocument(iframe) { - try { - return iframe.contentDocument; - } catch (e2) { - } -} -__name(getIframeContentDocument, "getIframeContentDocument"); -let _id$2 = 1; -const tagNameRegex = new RegExp("[^a-z0-9-_:]"); -const IGNORED_NODE = -2; -function genId() { - return _id$2++; -} -__name(genId, "genId"); -function getValidTagName(element) { - if (element instanceof HTMLFormElement) { - return "form"; - } - const processedTagName = toLowerCase(element.tagName); - if (tagNameRegex.test(processedTagName)) { - return "div"; - } - return processedTagName; -} -__name(getValidTagName, "getValidTagName"); -function extractOrigin(url) { - let origin2 = ""; - if (url.indexOf("//") > -1) { - origin2 = url.split("/").slice(0, 3).join("/"); - } else { - origin2 = url.split("/")[0]; - } - origin2 = origin2.split("?")[0]; - return origin2; -} -__name(extractOrigin, "extractOrigin"); -let canvasService; -let canvasCtx; -const URL_IN_CSS_REF = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm; -const URL_PROTOCOL_MATCH = /^(?:[a-z+]+:)?\/\//i; -const URL_WWW_MATCH = /^www\..*/i; -const DATA_URI = /^(data:)([^,]*),(.*)/i; -function absoluteToStylesheet(cssText, href) { - return (cssText || "").replace(URL_IN_CSS_REF, (origin2, quote1, path1, quote2, path2, path3) => { - const filePath = path1 || path2 || path3; - const maybeQuote = quote1 || quote2 || ""; - if (!filePath) { - return origin2; - } - if (URL_PROTOCOL_MATCH.test(filePath) || URL_WWW_MATCH.test(filePath)) { - return `url(${maybeQuote}${filePath}${maybeQuote})`; - } - if (DATA_URI.test(filePath)) { - return `url(${maybeQuote}${filePath}${maybeQuote})`; - } - if (filePath[0] === "/") { - return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`; - } - const stack2 = href.split("/"); - const parts2 = filePath.split("/"); - stack2.pop(); - for (const part of parts2) { - if (part === ".") { - continue; - } else if (part === "..") { - stack2.pop(); - } else { - stack2.push(part); - } - } - return `url(${maybeQuote}${stack2.join("/")}${maybeQuote})`; - }); -} -__name(absoluteToStylesheet, "absoluteToStylesheet"); -const SRCSET_NOT_SPACES = /^[^ \t\n\r\u000c]+/; -const SRCSET_COMMAS_OR_SPACES = /^[, \t\n\r\u000c]+/; -function getAbsoluteSrcsetString(doc2, attributeValue) { - if (attributeValue.trim() === "") { - return attributeValue; - } - let pos = 0; - function collectCharacters(regEx) { - let chars2; - const match3 = regEx.exec(attributeValue.substring(pos)); - if (match3) { - chars2 = match3[0]; - pos += chars2.length; - return chars2; - } - return ""; - } - __name(collectCharacters, "collectCharacters"); - const output = []; - while (true) { - collectCharacters(SRCSET_COMMAS_OR_SPACES); - if (pos >= attributeValue.length) { - break; - } - let url = collectCharacters(SRCSET_NOT_SPACES); - if (url.slice(-1) === ",") { - url = absoluteToDoc(doc2, url.substring(0, url.length - 1)); - output.push(url); - } else { - let descriptorsStr = ""; - url = absoluteToDoc(doc2, url); - let inParens = false; - while (true) { - const c2 = attributeValue.charAt(pos); - if (c2 === "") { - output.push((url + descriptorsStr).trim()); - break; - } else if (!inParens) { - if (c2 === ",") { - pos += 1; - output.push((url + descriptorsStr).trim()); - break; - } else if (c2 === "(") { - inParens = true; - } - } else { - if (c2 === ")") { - inParens = false; - } - } - descriptorsStr += c2; - pos += 1; - } - } - } - return output.join(", "); -} -__name(getAbsoluteSrcsetString, "getAbsoluteSrcsetString"); -const cachedDocument = /* @__PURE__ */ new WeakMap(); -function absoluteToDoc(doc2, attributeValue) { - if (!attributeValue || attributeValue.trim() === "") { - return attributeValue; - } - return getHref(doc2, attributeValue); -} -__name(absoluteToDoc, "absoluteToDoc"); -function isSVGElement(el) { - return Boolean(el.tagName === "svg" || el.ownerSVGElement); -} -__name(isSVGElement, "isSVGElement"); -function getHref(doc2, customHref) { - let a2 = cachedDocument.get(doc2); - if (!a2) { - a2 = doc2.createElement("a"); - cachedDocument.set(doc2, a2); - } - if (!customHref) { - customHref = ""; - } else if (customHref.startsWith("blob:") || customHref.startsWith("data:")) { - return customHref; - } - a2.setAttribute("href", customHref); - return a2.href; -} -__name(getHref, "getHref"); -function transformAttribute(doc2, tagName, name2, value4, element, maskAttributeFn) { - if (!value4) { - return value4; - } - if (name2 === "src" || name2 === "href" && !(tagName === "use" && value4[0] === "#")) { - return absoluteToDoc(doc2, value4); - } else if (name2 === "xlink:href" && value4[0] !== "#") { - return absoluteToDoc(doc2, value4); - } else if (name2 === "background" && (tagName === "table" || tagName === "td" || tagName === "th")) { - return absoluteToDoc(doc2, value4); - } else if (name2 === "srcset") { - return getAbsoluteSrcsetString(doc2, value4); - } else if (name2 === "style") { - return absoluteToStylesheet(value4, getHref(doc2)); - } else if (tagName === "object" && name2 === "data") { - return absoluteToDoc(doc2, value4); - } - if (typeof maskAttributeFn === "function") { - return maskAttributeFn(name2, value4, element); - } - return value4; -} -__name(transformAttribute, "transformAttribute"); -function ignoreAttribute(tagName, name2, _value) { - return (tagName === "video" || tagName === "audio") && name2 === "autoplay"; -} -__name(ignoreAttribute, "ignoreAttribute"); -function _isBlockedElement(element, blockClass, blockSelector, unblockSelector) { - try { - if (unblockSelector && element.matches(unblockSelector)) { - return false; - } - if (typeof blockClass === "string") { - if (element.classList.contains(blockClass)) { - return true; - } - } else { - for (let eIndex = element.classList.length; eIndex--; ) { - const className = element.classList[eIndex]; - if (blockClass.test(className)) { - return true; - } - } - } - if (blockSelector) { - return element.matches(blockSelector); - } - } catch (e2) { - } - return false; -} -__name(_isBlockedElement, "_isBlockedElement"); -function elementClassMatchesRegex$1(el, regex2) { - for (let eIndex = el.classList.length; eIndex--; ) { - const className = el.classList[eIndex]; - if (regex2.test(className)) { - return true; - } - } - return false; -} -__name(elementClassMatchesRegex$1, "elementClassMatchesRegex$1"); -function distanceToMatch$1(node3, matchPredicate, limit = Infinity, distance2 = 0) { - if (!node3) - return -1; - if (node3.nodeType !== node3.ELEMENT_NODE) - return -1; - if (distance2 > limit) - return -1; - if (matchPredicate(node3)) - return distance2; - return distanceToMatch$1(node3.parentNode, matchPredicate, limit, distance2 + 1); -} -__name(distanceToMatch$1, "distanceToMatch$1"); -function createMatchPredicate$1(className, selector) { - return (node3) => { - const el = node3; - if (el === null) - return false; - try { - if (className) { - if (typeof className === "string") { - if (el.matches(`.${className}`)) - return true; - } else if (elementClassMatchesRegex$1(el, className)) { - return true; - } - } - if (selector && el.matches(selector)) - return true; - return false; - } catch (e2) { - return false; - } - }; -} -__name(createMatchPredicate$1, "createMatchPredicate$1"); -function needMaskingText(node3, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText) { - try { - const el = node3.nodeType === node3.ELEMENT_NODE ? node3 : node3.parentElement; - if (el === null) - return false; - if (el.tagName === "INPUT") { - const autocomplete = el.getAttribute("autocomplete"); - const disallowedAutocompleteValues = [ - "current-password", - "new-password", - "cc-number", - "cc-exp", - "cc-exp-month", - "cc-exp-year", - "cc-csc" - ]; - if (disallowedAutocompleteValues.includes(autocomplete)) { - return true; - } - } - let maskDistance = -1; - let unmaskDistance = -1; - if (maskAllText) { - unmaskDistance = distanceToMatch$1(el, createMatchPredicate$1(unmaskTextClass, unmaskTextSelector)); - if (unmaskDistance < 0) { - return true; - } - maskDistance = distanceToMatch$1(el, createMatchPredicate$1(maskTextClass, maskTextSelector), unmaskDistance >= 0 ? unmaskDistance : Infinity); - } else { - maskDistance = distanceToMatch$1(el, createMatchPredicate$1(maskTextClass, maskTextSelector)); - if (maskDistance < 0) { - return false; - } - unmaskDistance = distanceToMatch$1(el, createMatchPredicate$1(unmaskTextClass, unmaskTextSelector), maskDistance >= 0 ? maskDistance : Infinity); - } - return maskDistance >= 0 ? unmaskDistance >= 0 ? maskDistance <= unmaskDistance : true : unmaskDistance >= 0 ? false : !!maskAllText; - } catch (e2) { - } - return !!maskAllText; -} -__name(needMaskingText, "needMaskingText"); -function onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) { - const win = iframeEl.contentWindow; - if (!win) { - return; - } - let fired = false; - let readyState; - try { - readyState = win.document.readyState; - } catch (error2) { - return; - } - if (readyState !== "complete") { - const timer = setTimeout$2(() => { - if (!fired) { - listener(); - fired = true; - } - }, iframeLoadTimeout); - iframeEl.addEventListener("load", () => { - clearTimeout$2(timer); - fired = true; - listener(); - }); - return; - } - const blankUrl = "about:blank"; - if (win.location.href !== blankUrl || iframeEl.src === blankUrl || iframeEl.src === "") { - setTimeout$2(listener, 0); - return iframeEl.addEventListener("load", listener); - } - iframeEl.addEventListener("load", listener); -} -__name(onceIframeLoaded, "onceIframeLoaded"); -function onceStylesheetLoaded(link2, listener, styleSheetLoadTimeout) { - let fired = false; - let styleSheetLoaded; - try { - styleSheetLoaded = link2.sheet; - } catch (error2) { - return; - } - if (styleSheetLoaded) - return; - const timer = setTimeout$2(() => { - if (!fired) { - listener(); - fired = true; - } - }, styleSheetLoadTimeout); - link2.addEventListener("load", () => { - clearTimeout$2(timer); - fired = true; - listener(); - }); -} -__name(onceStylesheetLoaded, "onceStylesheetLoaded"); -function serializeNode(n2, options4) { - const { doc: doc2, mirror: mirror2, blockClass, blockSelector, unblockSelector, maskAllText, maskAttributeFn, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false } = options4; - const rootId = getRootId(doc2, mirror2); - switch (n2.nodeType) { - case n2.DOCUMENT_NODE: - if (n2.compatMode !== "CSS1Compat") { - return { - type: NodeType$3.Document, - childNodes: [], - compatMode: n2.compatMode - }; - } else { - return { - type: NodeType$3.Document, - childNodes: [] - }; - } - case n2.DOCUMENT_TYPE_NODE: - return { - type: NodeType$3.DocumentType, - name: n2.name, - publicId: n2.publicId, - systemId: n2.systemId, - rootId - }; - case n2.ELEMENT_NODE: - return serializeElementNode(n2, { - doc: doc2, - blockClass, - blockSelector, - unblockSelector, - inlineStylesheet, - maskAttributeFn, - maskInputOptions, - maskInputFn, - dataURLOptions, - inlineImages, - recordCanvas, - keepIframeSrcFn, - newlyAddedElement, - rootId, - maskAllText, - maskTextClass, - unmaskTextClass, - maskTextSelector, - unmaskTextSelector - }); - case n2.TEXT_NODE: - return serializeTextNode(n2, { - doc: doc2, - maskAllText, - maskTextClass, - unmaskTextClass, - maskTextSelector, - unmaskTextSelector, - maskTextFn, - maskInputOptions, - maskInputFn, - rootId - }); - case n2.CDATA_SECTION_NODE: - return { - type: NodeType$3.CDATA, - textContent: "", - rootId - }; - case n2.COMMENT_NODE: - return { - type: NodeType$3.Comment, - textContent: n2.textContent || "", - rootId - }; - default: - return false; - } -} -__name(serializeNode, "serializeNode"); -function getRootId(doc2, mirror2) { - if (!mirror2.hasNode(doc2)) - return void 0; - const docId = mirror2.getId(doc2); - return docId === 1 ? void 0 : docId; -} -__name(getRootId, "getRootId"); -function serializeTextNode(n2, options4) { - const { maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, maskTextFn, maskInputOptions, maskInputFn, rootId } = options4; - const parentTagName = n2.parentNode && n2.parentNode.tagName; - let textContent = n2.textContent; - const isStyle = parentTagName === "STYLE" ? true : void 0; - const isScript = parentTagName === "SCRIPT" ? true : void 0; - const isTextarea = parentTagName === "TEXTAREA" ? true : void 0; - if (isStyle && textContent) { - try { - if (n2.nextSibling || n2.previousSibling) { - } else if (_optionalChain$5([n2, "access", (_7) => _7.parentNode, "access", (_8) => _8.sheet, "optionalAccess", (_9) => _9.cssRules])) { - textContent = stringifyStylesheet(n2.parentNode.sheet); - } - } catch (err) { - console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n2); - } - textContent = absoluteToStylesheet(textContent, getHref(options4.doc)); - } - if (isScript) { - textContent = "SCRIPT_PLACEHOLDER"; - } - const forceMask = needMaskingText(n2, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText); - if (!isStyle && !isScript && !isTextarea && textContent && forceMask) { - textContent = maskTextFn ? maskTextFn(textContent, n2.parentElement) : textContent.replace(/[\S]/g, "*"); - } - if (isTextarea && textContent && (maskInputOptions.textarea || forceMask)) { - textContent = maskInputFn ? maskInputFn(textContent, n2.parentNode) : textContent.replace(/[\S]/g, "*"); - } - if (parentTagName === "OPTION" && textContent) { - const isInputMasked = shouldMaskInput({ - type: null, - tagName: parentTagName, - maskInputOptions - }); - textContent = maskInputValue({ - isMasked: needMaskingText(n2, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked), - element: n2, - value: textContent, - maskInputFn - }); - } - return { - type: NodeType$3.Text, - textContent: textContent || "", - isStyle, - rootId - }; -} -__name(serializeTextNode, "serializeTextNode"); -function serializeElementNode(n2, options4) { - const { doc: doc2, blockClass, blockSelector, unblockSelector, inlineStylesheet, maskInputOptions = {}, maskAttributeFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, rootId, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector } = options4; - const needBlock = _isBlockedElement(n2, blockClass, blockSelector, unblockSelector); - const tagName = getValidTagName(n2); - let attributes = {}; - const len = n2.attributes.length; - for (let i2 = 0; i2 < len; i2++) { - const attr = n2.attributes[i2]; - if (attr.name && !ignoreAttribute(tagName, attr.name, attr.value)) { - attributes[attr.name] = transformAttribute(doc2, tagName, toLowerCase(attr.name), attr.value, n2, maskAttributeFn); - } - } - if (tagName === "link" && inlineStylesheet) { - const stylesheet = Array.from(doc2.styleSheets).find((s2) => { - return s2.href === n2.href; - }); - let cssText = null; - if (stylesheet) { - cssText = stringifyStylesheet(stylesheet); - } - if (cssText) { - attributes.rel = null; - attributes.href = null; - attributes.crossorigin = null; - attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href); - } - } - if (tagName === "style" && n2.sheet && !(n2.innerText || n2.textContent || "").trim().length) { - const cssText = stringifyStylesheet(n2.sheet); - if (cssText) { - attributes._cssText = absoluteToStylesheet(cssText, getHref(doc2)); - } - } - if (tagName === "input" || tagName === "textarea" || tagName === "select" || tagName === "option") { - const el = n2; - const type = getInputType(el); - const value4 = getInputValue(el, toUpperCase(tagName), type); - const checked4 = el.checked; - if (type !== "submit" && type !== "button" && value4) { - const forceMask = needMaskingText(el, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, shouldMaskInput({ - type, - tagName: toUpperCase(tagName), - maskInputOptions - })); - attributes.value = maskInputValue({ - isMasked: forceMask, - element: el, - value: value4, - maskInputFn - }); - } - if (checked4) { - attributes.checked = checked4; - } - } - if (tagName === "option") { - if (n2.selected && !maskInputOptions["select"]) { - attributes.selected = true; - } else { - delete attributes.selected; - } - } - if (tagName === "canvas" && recordCanvas) { - if (n2.__context === "2d") { - if (!is2DCanvasBlank(n2)) { - attributes.rr_dataURL = n2.toDataURL(dataURLOptions.type, dataURLOptions.quality); - } - } else if (!("__context" in n2)) { - const canvasDataURL = n2.toDataURL(dataURLOptions.type, dataURLOptions.quality); - const blankCanvas = doc2.createElement("canvas"); - blankCanvas.width = n2.width; - blankCanvas.height = n2.height; - const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality); - if (canvasDataURL !== blankCanvasDataURL) { - attributes.rr_dataURL = canvasDataURL; - } - } - } - if (tagName === "img" && inlineImages) { - if (!canvasService) { - canvasService = doc2.createElement("canvas"); - canvasCtx = canvasService.getContext("2d"); - } - const image2 = n2; - const imageSrc = image2.currentSrc || image2.getAttribute("src") || ""; - const priorCrossOrigin = image2.crossOrigin; - const recordInlineImage = /* @__PURE__ */ __name(() => { - image2.removeEventListener("load", recordInlineImage); - try { - canvasService.width = image2.naturalWidth; - canvasService.height = image2.naturalHeight; - canvasCtx.drawImage(image2, 0, 0); - attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality); - } catch (err) { - if (image2.crossOrigin !== "anonymous") { - image2.crossOrigin = "anonymous"; - if (image2.complete && image2.naturalWidth !== 0) - recordInlineImage(); - else - image2.addEventListener("load", recordInlineImage); - return; - } else { - console.warn(`Cannot inline img src=${imageSrc}! Error: ${err}`); - } - } - if (image2.crossOrigin === "anonymous") { - priorCrossOrigin ? attributes.crossOrigin = priorCrossOrigin : image2.removeAttribute("crossorigin"); - } - }, "recordInlineImage"); - if (image2.complete && image2.naturalWidth !== 0) - recordInlineImage(); - else - image2.addEventListener("load", recordInlineImage); - } - if (tagName === "audio" || tagName === "video") { - attributes.rr_mediaState = n2.paused ? "paused" : "played"; - attributes.rr_mediaCurrentTime = n2.currentTime; - } - if (!newlyAddedElement) { - if (n2.scrollLeft) { - attributes.rr_scrollLeft = n2.scrollLeft; - } - if (n2.scrollTop) { - attributes.rr_scrollTop = n2.scrollTop; - } - } - if (needBlock) { - const { width: width2, height } = n2.getBoundingClientRect(); - attributes = { - class: attributes.class, - rr_width: `${width2}px`, - rr_height: `${height}px` - }; - } - if (tagName === "iframe" && !keepIframeSrcFn(attributes.src)) { - if (!needBlock && !getIframeContentDocument(n2)) { - attributes.rr_src = attributes.src; - } - delete attributes.src; - } - let isCustomElement; - try { - if (customElements.get(tagName)) - isCustomElement = true; - } catch (e2) { - } - return { - type: NodeType$3.Element, - tagName, - attributes, - childNodes: [], - isSVG: isSVGElement(n2) || void 0, - needBlock, - rootId, - isCustom: isCustomElement - }; -} -__name(serializeElementNode, "serializeElementNode"); -function lowerIfExists(maybeAttr) { - if (maybeAttr === void 0 || maybeAttr === null) { - return ""; - } else { - return maybeAttr.toLowerCase(); - } -} -__name(lowerIfExists, "lowerIfExists"); -function slimDOMExcluded(sn, slimDOMOptions) { - if (slimDOMOptions.comment && sn.type === NodeType$3.Comment) { - return true; - } else if (sn.type === NodeType$3.Element) { - if (slimDOMOptions.script && (sn.tagName === "script" || sn.tagName === "link" && (sn.attributes.rel === "preload" || sn.attributes.rel === "modulepreload") || sn.tagName === "link" && sn.attributes.rel === "prefetch" && typeof sn.attributes.href === "string" && extractFileExtension(sn.attributes.href) === "js")) { - return true; - } else if (slimDOMOptions.headFavicon && (sn.tagName === "link" && sn.attributes.rel === "shortcut icon" || sn.tagName === "meta" && (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) || lowerIfExists(sn.attributes.name) === "application-name" || lowerIfExists(sn.attributes.rel) === "icon" || lowerIfExists(sn.attributes.rel) === "apple-touch-icon" || lowerIfExists(sn.attributes.rel) === "shortcut icon"))) { - return true; - } else if (sn.tagName === "meta") { - if (slimDOMOptions.headMetaDescKeywords && lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) { - return true; - } else if (slimDOMOptions.headMetaSocial && (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) || lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) || lowerIfExists(sn.attributes.name) === "pinterest")) { - return true; - } else if (slimDOMOptions.headMetaRobots && (lowerIfExists(sn.attributes.name) === "robots" || lowerIfExists(sn.attributes.name) === "googlebot" || lowerIfExists(sn.attributes.name) === "bingbot")) { - return true; - } else if (slimDOMOptions.headMetaHttpEquiv && sn.attributes["http-equiv"] !== void 0) { - return true; - } else if (slimDOMOptions.headMetaAuthorship && (lowerIfExists(sn.attributes.name) === "author" || lowerIfExists(sn.attributes.name) === "generator" || lowerIfExists(sn.attributes.name) === "framework" || lowerIfExists(sn.attributes.name) === "publisher" || lowerIfExists(sn.attributes.name) === "progid" || lowerIfExists(sn.attributes.property).match(/^article:/) || lowerIfExists(sn.attributes.property).match(/^product:/))) { - return true; - } else if (slimDOMOptions.headMetaVerification && (lowerIfExists(sn.attributes.name) === "google-site-verification" || lowerIfExists(sn.attributes.name) === "yandex-verification" || lowerIfExists(sn.attributes.name) === "csrf-token" || lowerIfExists(sn.attributes.name) === "p:domain_verify" || lowerIfExists(sn.attributes.name) === "verify-v1" || lowerIfExists(sn.attributes.name) === "verification" || lowerIfExists(sn.attributes.name) === "shopify-checkout-api-token")) { - return true; - } - } - } - return false; -} -__name(slimDOMExcluded, "slimDOMExcluded"); -function serializeNodeWithId(n2, options4) { - const { doc: doc2, mirror: mirror2, blockClass, blockSelector, unblockSelector, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputOptions = {}, maskAttributeFn, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5e3, onStylesheetLoad, stylesheetLoadTimeout = 5e3, keepIframeSrcFn = /* @__PURE__ */ __name(() => false, "keepIframeSrcFn"), newlyAddedElement = false } = options4; - let { preserveWhiteSpace = true } = options4; - const _serializedNode = serializeNode(n2, { - doc: doc2, - mirror: mirror2, - blockClass, - blockSelector, - maskAllText, - unblockSelector, - maskTextClass, - unmaskTextClass, - maskTextSelector, - unmaskTextSelector, - inlineStylesheet, - maskInputOptions, - maskAttributeFn, - maskTextFn, - maskInputFn, - dataURLOptions, - inlineImages, - recordCanvas, - keepIframeSrcFn, - newlyAddedElement - }); - if (!_serializedNode) { - console.warn(n2, "not serialized"); - return null; - } - let id3; - if (mirror2.hasNode(n2)) { - id3 = mirror2.getId(n2); - } else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$3.Text && !_serializedNode.isStyle && !_serializedNode.textContent.replace(/^\s+|\s+$/gm, "").length) { - id3 = IGNORED_NODE; - } else { - id3 = genId(); - } - const serializedNode = Object.assign(_serializedNode, { id: id3 }); - mirror2.add(n2, serializedNode); - if (id3 === IGNORED_NODE) { - return null; - } - if (onSerialize) { - onSerialize(n2); - } - let recordChild = !skipChild; - if (serializedNode.type === NodeType$3.Element) { - recordChild = recordChild && !serializedNode.needBlock; - delete serializedNode.needBlock; - const shadowRoot = n2.shadowRoot; - if (shadowRoot && isNativeShadowDom(shadowRoot)) - serializedNode.isShadowHost = true; - } - if ((serializedNode.type === NodeType$3.Document || serializedNode.type === NodeType$3.Element) && recordChild) { - if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$3.Element && serializedNode.tagName === "head") { - preserveWhiteSpace = false; - } - const bypassOptions = { - doc: doc2, - mirror: mirror2, - blockClass, - blockSelector, - maskAllText, - unblockSelector, - maskTextClass, - unmaskTextClass, - maskTextSelector, - unmaskTextSelector, - skipChild, - inlineStylesheet, - maskInputOptions, - maskAttributeFn, - maskTextFn, - maskInputFn, - slimDOMOptions, - dataURLOptions, - inlineImages, - recordCanvas, - preserveWhiteSpace, - onSerialize, - onIframeLoad, - iframeLoadTimeout, - onStylesheetLoad, - stylesheetLoadTimeout, - keepIframeSrcFn - }; - for (const childN of Array.from(n2.childNodes)) { - const serializedChildNode = serializeNodeWithId(childN, bypassOptions); - if (serializedChildNode) { - serializedNode.childNodes.push(serializedChildNode); - } - } - if (isElement$1(n2) && n2.shadowRoot) { - for (const childN of Array.from(n2.shadowRoot.childNodes)) { - const serializedChildNode = serializeNodeWithId(childN, bypassOptions); - if (serializedChildNode) { - isNativeShadowDom(n2.shadowRoot) && (serializedChildNode.isShadow = true); - serializedNode.childNodes.push(serializedChildNode); - } - } - } - } - if (n2.parentNode && isShadowRoot(n2.parentNode) && isNativeShadowDom(n2.parentNode)) { - serializedNode.isShadow = true; - } - if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "iframe") { - onceIframeLoaded(n2, () => { - const iframeDoc = getIframeContentDocument(n2); - if (iframeDoc && onIframeLoad) { - const serializedIframeNode = serializeNodeWithId(iframeDoc, { - doc: iframeDoc, - mirror: mirror2, - blockClass, - blockSelector, - unblockSelector, - maskAllText, - maskTextClass, - unmaskTextClass, - maskTextSelector, - unmaskTextSelector, - skipChild: false, - inlineStylesheet, - maskInputOptions, - maskAttributeFn, - maskTextFn, - maskInputFn, - slimDOMOptions, - dataURLOptions, - inlineImages, - recordCanvas, - preserveWhiteSpace, - onSerialize, - onIframeLoad, - iframeLoadTimeout, - onStylesheetLoad, - stylesheetLoadTimeout, - keepIframeSrcFn - }); - if (serializedIframeNode) { - onIframeLoad(n2, serializedIframeNode); - } - } - }, iframeLoadTimeout); - } - if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "link" && typeof serializedNode.attributes.rel === "string" && (serializedNode.attributes.rel === "stylesheet" || serializedNode.attributes.rel === "preload" && typeof serializedNode.attributes.href === "string" && extractFileExtension(serializedNode.attributes.href) === "css")) { - onceStylesheetLoaded(n2, () => { - if (onStylesheetLoad) { - const serializedLinkNode = serializeNodeWithId(n2, { - doc: doc2, - mirror: mirror2, - blockClass, - blockSelector, - unblockSelector, - maskAllText, - maskTextClass, - unmaskTextClass, - maskTextSelector, - unmaskTextSelector, - skipChild: false, - inlineStylesheet, - maskInputOptions, - maskAttributeFn, - maskTextFn, - maskInputFn, - slimDOMOptions, - dataURLOptions, - inlineImages, - recordCanvas, - preserveWhiteSpace, - onSerialize, - onIframeLoad, - iframeLoadTimeout, - onStylesheetLoad, - stylesheetLoadTimeout, - keepIframeSrcFn - }); - if (serializedLinkNode) { - onStylesheetLoad(n2, serializedLinkNode); - } - } - }, stylesheetLoadTimeout); - } - return serializedNode; -} -__name(serializeNodeWithId, "serializeNodeWithId"); -function snapshot(n2, options4) { - const { mirror: mirror2 = new Mirror(), blockClass = "rr-block", blockSelector = null, unblockSelector = null, maskAllText = false, maskTextClass = "rr-mask", unmaskTextClass = null, maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskAllInputs = false, maskAttributeFn, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, onStylesheetLoad, stylesheetLoadTimeout, keepIframeSrcFn = /* @__PURE__ */ __name(() => false, "keepIframeSrcFn") } = options4 || {}; - const maskInputOptions = maskAllInputs === true ? { - color: true, - date: true, - "datetime-local": true, - email: true, - month: true, - number: true, - range: true, - search: true, - tel: true, - text: true, - time: true, - url: true, - week: true, - textarea: true, - select: true - } : maskAllInputs === false ? {} : maskAllInputs; - const slimDOMOptions = slimDOM === true || slimDOM === "all" ? { - script: true, - comment: true, - headFavicon: true, - headWhitespace: true, - headMetaDescKeywords: slimDOM === "all", - headMetaSocial: true, - headMetaRobots: true, - headMetaHttpEquiv: true, - headMetaAuthorship: true, - headMetaVerification: true - } : slimDOM === false ? {} : slimDOM; - return serializeNodeWithId(n2, { - doc: n2, - mirror: mirror2, - blockClass, - blockSelector, - unblockSelector, - maskAllText, - maskTextClass, - unmaskTextClass, - maskTextSelector, - unmaskTextSelector, - skipChild: false, - inlineStylesheet, - maskInputOptions, - maskAttributeFn, - maskTextFn, - maskInputFn, - slimDOMOptions, - dataURLOptions, - inlineImages, - recordCanvas, - preserveWhiteSpace, - onSerialize, - onIframeLoad, - iframeLoadTimeout, - onStylesheetLoad, - stylesheetLoadTimeout, - keepIframeSrcFn, - newlyAddedElement: false - }); -} -__name(snapshot, "snapshot"); -function _optionalChain$4(ops) { - let lastAccessLHS = void 0; - let value4 = ops[0]; - let i2 = 1; - while (i2 < ops.length) { - const op = ops[i2]; - const fn = ops[i2 + 1]; - i2 += 2; - if ((op === "optionalAccess" || op === "optionalCall") && value4 == null) { - return void 0; - } - if (op === "access" || op === "optionalAccess") { - lastAccessLHS = value4; - value4 = fn(value4); - } else if (op === "call" || op === "optionalCall") { - value4 = fn((...args) => value4.call(lastAccessLHS, ...args)); - lastAccessLHS = void 0; - } - } - return value4; -} -__name(_optionalChain$4, "_optionalChain$4"); -function on(type, fn, target2 = document) { - const options4 = { capture: true, passive: true }; - target2.addEventListener(type, fn, options4); - return () => target2.removeEventListener(type, fn, options4); -} -__name(on, "on"); -const DEPARTED_MIRROR_ACCESS_WARNING$1 = "Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording."; -let _mirror$1 = { - map: {}, - getId() { - console.error(DEPARTED_MIRROR_ACCESS_WARNING$1); - return -1; - }, - getNode() { - console.error(DEPARTED_MIRROR_ACCESS_WARNING$1); - return null; - }, - removeNodeFromMap() { - console.error(DEPARTED_MIRROR_ACCESS_WARNING$1); - }, - has() { - console.error(DEPARTED_MIRROR_ACCESS_WARNING$1); - return false; - }, - reset() { - console.error(DEPARTED_MIRROR_ACCESS_WARNING$1); - } -}; -if (typeof window !== "undefined" && window.Proxy && window.Reflect) { - _mirror$1 = new Proxy(_mirror$1, { - get(target2, prop2, receiver) { - if (prop2 === "map") { - console.error(DEPARTED_MIRROR_ACCESS_WARNING$1); - } - return Reflect.get(target2, prop2, receiver); - } - }); -} -function throttle$1(func, wait, options4 = {}) { - let timeout = null; - let previous = 0; - return function(...args) { - const now2 = Date.now(); - if (!previous && options4.leading === false) { - previous = now2; - } - const remaining = wait - (now2 - previous); - const context = this; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout$1(timeout); - timeout = null; - } - previous = now2; - func.apply(context, args); - } else if (!timeout && options4.trailing !== false) { - timeout = setTimeout$1$1(() => { - previous = options4.leading === false ? 0 : Date.now(); - timeout = null; - func.apply(context, args); - }, remaining); - } - }; -} -__name(throttle$1, "throttle$1"); -function hookSetter$1(target2, key, d2, isRevoked, win = window) { - const original = win.Object.getOwnPropertyDescriptor(target2, key); - win.Object.defineProperty(target2, key, isRevoked ? d2 : { - set(value4) { - setTimeout$1$1(() => { - d2.set.call(this, value4); - }, 0); - if (original && original.set) { - original.set.call(this, value4); - } - } - }); - return () => hookSetter$1(target2, key, original || {}, true); -} -__name(hookSetter$1, "hookSetter$1"); -function patch$2(source, name2, replacement) { - try { - if (!(name2 in source)) { - return () => { - }; - } - const original = source[name2]; - const wrapped = replacement(original); - if (typeof wrapped === "function") { - wrapped.prototype = wrapped.prototype || {}; - Object.defineProperties(wrapped, { - __rrweb_original__: { - enumerable: false, - value: original - } - }); - } - source[name2] = wrapped; - return () => { - source[name2] = original; - }; - } catch (e2) { - return () => { - }; - } -} -__name(patch$2, "patch$2"); -let nowTimestamp = Date.now; -if (!/[1-9][0-9]{12}/.test(Date.now().toString())) { - nowTimestamp = /* @__PURE__ */ __name(() => (/* @__PURE__ */ new Date()).getTime(), "nowTimestamp"); -} -function getWindowScroll(win) { - const doc2 = win.document; - return { - left: doc2.scrollingElement ? doc2.scrollingElement.scrollLeft : win.pageXOffset !== void 0 ? win.pageXOffset : _optionalChain$4([doc2, "optionalAccess", (_2) => _2.documentElement, "access", (_2) => _2.scrollLeft]) || _optionalChain$4([doc2, "optionalAccess", (_3) => _3.body, "optionalAccess", (_4) => _4.parentElement, "optionalAccess", (_5) => _5.scrollLeft]) || _optionalChain$4([doc2, "optionalAccess", (_6) => _6.body, "optionalAccess", (_7) => _7.scrollLeft]) || 0, - top: doc2.scrollingElement ? doc2.scrollingElement.scrollTop : win.pageYOffset !== void 0 ? win.pageYOffset : _optionalChain$4([doc2, "optionalAccess", (_8) => _8.documentElement, "access", (_9) => _9.scrollTop]) || _optionalChain$4([doc2, "optionalAccess", (_10) => _10.body, "optionalAccess", (_11) => _11.parentElement, "optionalAccess", (_12) => _12.scrollTop]) || _optionalChain$4([doc2, "optionalAccess", (_13) => _13.body, "optionalAccess", (_14) => _14.scrollTop]) || 0 - }; -} -__name(getWindowScroll, "getWindowScroll"); -function getWindowHeight() { - return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body && document.body.clientHeight; -} -__name(getWindowHeight, "getWindowHeight"); -function getWindowWidth() { - return window.innerWidth || document.documentElement && document.documentElement.clientWidth || document.body && document.body.clientWidth; -} -__name(getWindowWidth, "getWindowWidth"); -function closestElementOfNode$1(node3) { - if (!node3) { - return null; - } - const el = node3.nodeType === node3.ELEMENT_NODE ? node3 : node3.parentElement; - return el; -} -__name(closestElementOfNode$1, "closestElementOfNode$1"); -function isBlocked$1(node3, blockClass, blockSelector, unblockSelector, checkAncestors) { - if (!node3) { - return false; - } - const el = closestElementOfNode$1(node3); - if (!el) { - return false; - } - const blockedPredicate = createMatchPredicate$1(blockClass, blockSelector); - if (!checkAncestors) { - const isUnblocked = unblockSelector && el.matches(unblockSelector); - return blockedPredicate(el) && !isUnblocked; - } - const blockDistance = distanceToMatch$1(el, blockedPredicate); - let unblockDistance = -1; - if (blockDistance < 0) { - return false; - } - if (unblockSelector) { - unblockDistance = distanceToMatch$1(el, createMatchPredicate$1(null, unblockSelector)); - } - if (blockDistance > -1 && unblockDistance < 0) { - return true; - } - return blockDistance < unblockDistance; -} -__name(isBlocked$1, "isBlocked$1"); -function isSerialized(n2, mirror2) { - return mirror2.getId(n2) !== -1; -} -__name(isSerialized, "isSerialized"); -function isIgnored(n2, mirror2) { - return mirror2.getId(n2) === IGNORED_NODE; -} -__name(isIgnored, "isIgnored"); -function isAncestorRemoved(target2, mirror2) { - if (isShadowRoot(target2)) { - return false; - } - const id3 = mirror2.getId(target2); - if (!mirror2.has(id3)) { - return true; - } - if (target2.parentNode && target2.parentNode.nodeType === target2.DOCUMENT_NODE) { - return false; - } - if (!target2.parentNode) { - return true; - } - return isAncestorRemoved(target2.parentNode, mirror2); -} -__name(isAncestorRemoved, "isAncestorRemoved"); -function legacy_isTouchEvent(event) { - return Boolean(event.changedTouches); -} -__name(legacy_isTouchEvent, "legacy_isTouchEvent"); -function polyfill(win = window) { - if ("NodeList" in win && !win.NodeList.prototype.forEach) { - win.NodeList.prototype.forEach = Array.prototype.forEach; - } - if ("DOMTokenList" in win && !win.DOMTokenList.prototype.forEach) { - win.DOMTokenList.prototype.forEach = Array.prototype.forEach; - } - if (!Node.prototype.contains) { - Node.prototype.contains = (...args) => { - let node3 = args[0]; - if (!(0 in args)) { - throw new TypeError("1 argument is required"); - } - do { - if (this === node3) { - return true; - } - } while (node3 = node3 && node3.parentNode); - return false; - }; - } -} -__name(polyfill, "polyfill"); -function isSerializedIframe(n2, mirror2) { - return Boolean(n2.nodeName === "IFRAME" && mirror2.getMeta(n2)); -} -__name(isSerializedIframe, "isSerializedIframe"); -function isSerializedStylesheet(n2, mirror2) { - return Boolean(n2.nodeName === "LINK" && n2.nodeType === n2.ELEMENT_NODE && n2.getAttribute && n2.getAttribute("rel") === "stylesheet" && mirror2.getMeta(n2)); -} -__name(isSerializedStylesheet, "isSerializedStylesheet"); -function hasShadowRoot(n2) { - return Boolean(_optionalChain$4([n2, "optionalAccess", (_18) => _18.shadowRoot])); -} -__name(hasShadowRoot, "hasShadowRoot"); -class StyleSheetMirror { - static { - __name(this, "StyleSheetMirror"); - } - constructor() { - this.id = 1; - this.styleIDMap = /* @__PURE__ */ new WeakMap(); - this.idStyleMap = /* @__PURE__ */ new Map(); - } - getId(stylesheet) { - return _nullishCoalesce(this.styleIDMap.get(stylesheet), () => -1); - } - has(stylesheet) { - return this.styleIDMap.has(stylesheet); - } - add(stylesheet, id3) { - if (this.has(stylesheet)) - return this.getId(stylesheet); - let newId; - if (id3 === void 0) { - newId = this.id++; - } else - newId = id3; - this.styleIDMap.set(stylesheet, newId); - this.idStyleMap.set(newId, stylesheet); - return newId; - } - getStyle(id3) { - return this.idStyleMap.get(id3) || null; - } - reset() { - this.styleIDMap = /* @__PURE__ */ new WeakMap(); - this.idStyleMap = /* @__PURE__ */ new Map(); - this.id = 1; - } - generateId() { - return this.id++; - } -} -function getShadowHost(n2) { - let shadowHost = null; - if (_optionalChain$4([n2, "access", (_19) => _19.getRootNode, "optionalCall", (_20) => _20(), "optionalAccess", (_21) => _21.nodeType]) === Node.DOCUMENT_FRAGMENT_NODE && n2.getRootNode().host) - shadowHost = n2.getRootNode().host; - return shadowHost; -} -__name(getShadowHost, "getShadowHost"); -function getRootShadowHost(n2) { - let rootShadowHost = n2; - let shadowHost; - while (shadowHost = getShadowHost(rootShadowHost)) - rootShadowHost = shadowHost; - return rootShadowHost; -} -__name(getRootShadowHost, "getRootShadowHost"); -function shadowHostInDom(n2) { - const doc2 = n2.ownerDocument; - if (!doc2) - return false; - const shadowHost = getRootShadowHost(n2); - return doc2.contains(shadowHost); -} -__name(shadowHostInDom, "shadowHostInDom"); -function inDom(n2) { - const doc2 = n2.ownerDocument; - if (!doc2) - return false; - return doc2.contains(n2) || shadowHostInDom(n2); -} -__name(inDom, "inDom"); -const cachedImplementations$2 = {}; -function getImplementation$2(name2) { - const cached = cachedImplementations$2[name2]; - if (cached) { - return cached; - } - const document2 = window.document; - let impl = window[name2]; - if (document2 && typeof document2.createElement === "function") { - try { - const sandbox = document2.createElement("iframe"); - sandbox.hidden = true; - document2.head.appendChild(sandbox); - const contentWindow = sandbox.contentWindow; - if (contentWindow && contentWindow[name2]) { - impl = contentWindow[name2]; - } - document2.head.removeChild(sandbox); - } catch (e2) { - } - } - return cachedImplementations$2[name2] = impl.bind(window); -} -__name(getImplementation$2, "getImplementation$2"); -function onRequestAnimationFrame$1(...rest) { - return getImplementation$2("requestAnimationFrame")(...rest); -} -__name(onRequestAnimationFrame$1, "onRequestAnimationFrame$1"); -function setTimeout$1$1(...rest) { - return getImplementation$2("setTimeout")(...rest); -} -__name(setTimeout$1$1, "setTimeout$1$1"); -function clearTimeout$1(...rest) { - return getImplementation$2("clearTimeout")(...rest); -} -__name(clearTimeout$1, "clearTimeout$1"); -var EventType = /* @__PURE__ */ ((EventType2) => { - EventType2[EventType2["DomContentLoaded"] = 0] = "DomContentLoaded"; - EventType2[EventType2["Load"] = 1] = "Load"; - EventType2[EventType2["FullSnapshot"] = 2] = "FullSnapshot"; - EventType2[EventType2["IncrementalSnapshot"] = 3] = "IncrementalSnapshot"; - EventType2[EventType2["Meta"] = 4] = "Meta"; - EventType2[EventType2["Custom"] = 5] = "Custom"; - EventType2[EventType2["Plugin"] = 6] = "Plugin"; - return EventType2; -})(EventType || {}); -var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => { - IncrementalSource2[IncrementalSource2["Mutation"] = 0] = "Mutation"; - IncrementalSource2[IncrementalSource2["MouseMove"] = 1] = "MouseMove"; - IncrementalSource2[IncrementalSource2["MouseInteraction"] = 2] = "MouseInteraction"; - IncrementalSource2[IncrementalSource2["Scroll"] = 3] = "Scroll"; - IncrementalSource2[IncrementalSource2["ViewportResize"] = 4] = "ViewportResize"; - IncrementalSource2[IncrementalSource2["Input"] = 5] = "Input"; - IncrementalSource2[IncrementalSource2["TouchMove"] = 6] = "TouchMove"; - IncrementalSource2[IncrementalSource2["MediaInteraction"] = 7] = "MediaInteraction"; - IncrementalSource2[IncrementalSource2["StyleSheetRule"] = 8] = "StyleSheetRule"; - IncrementalSource2[IncrementalSource2["CanvasMutation"] = 9] = "CanvasMutation"; - IncrementalSource2[IncrementalSource2["Font"] = 10] = "Font"; - IncrementalSource2[IncrementalSource2["Log"] = 11] = "Log"; - IncrementalSource2[IncrementalSource2["Drag"] = 12] = "Drag"; - IncrementalSource2[IncrementalSource2["StyleDeclaration"] = 13] = "StyleDeclaration"; - IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection"; - IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet"; - IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement"; - return IncrementalSource2; -})(IncrementalSource || {}); -var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => { - MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp"; - MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown"; - MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click"; - MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu"; - MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick"; - MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus"; - MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur"; - MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart"; - MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed"; - MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd"; - MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel"; - return MouseInteractions2; -})(MouseInteractions || {}); -var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => { - PointerTypes2[PointerTypes2["Mouse"] = 0] = "Mouse"; - PointerTypes2[PointerTypes2["Pen"] = 1] = "Pen"; - PointerTypes2[PointerTypes2["Touch"] = 2] = "Touch"; - return PointerTypes2; -})(PointerTypes || {}); -var NodeType$1$1; -(function(NodeType3) { - NodeType3[NodeType3["Document"] = 0] = "Document"; - NodeType3[NodeType3["DocumentType"] = 1] = "DocumentType"; - NodeType3[NodeType3["Element"] = 2] = "Element"; - NodeType3[NodeType3["Text"] = 3] = "Text"; - NodeType3[NodeType3["CDATA"] = 4] = "CDATA"; - NodeType3[NodeType3["Comment"] = 5] = "Comment"; -})(NodeType$1$1 || (NodeType$1$1 = {})); -var NodeType$2$1; -(function(NodeType3) { - NodeType3[NodeType3["PLACEHOLDER"] = 0] = "PLACEHOLDER"; - NodeType3[NodeType3["ELEMENT_NODE"] = 1] = "ELEMENT_NODE"; - NodeType3[NodeType3["ATTRIBUTE_NODE"] = 2] = "ATTRIBUTE_NODE"; - NodeType3[NodeType3["TEXT_NODE"] = 3] = "TEXT_NODE"; - NodeType3[NodeType3["CDATA_SECTION_NODE"] = 4] = "CDATA_SECTION_NODE"; - NodeType3[NodeType3["ENTITY_REFERENCE_NODE"] = 5] = "ENTITY_REFERENCE_NODE"; - NodeType3[NodeType3["ENTITY_NODE"] = 6] = "ENTITY_NODE"; - NodeType3[NodeType3["PROCESSING_INSTRUCTION_NODE"] = 7] = "PROCESSING_INSTRUCTION_NODE"; - NodeType3[NodeType3["COMMENT_NODE"] = 8] = "COMMENT_NODE"; - NodeType3[NodeType3["DOCUMENT_NODE"] = 9] = "DOCUMENT_NODE"; - NodeType3[NodeType3["DOCUMENT_TYPE_NODE"] = 10] = "DOCUMENT_TYPE_NODE"; - NodeType3[NodeType3["DOCUMENT_FRAGMENT_NODE"] = 11] = "DOCUMENT_FRAGMENT_NODE"; -})(NodeType$2$1 || (NodeType$2$1 = {})); -function getIFrameContentDocument(iframe) { - try { - return iframe.contentDocument; - } catch (e2) { - } -} -__name(getIFrameContentDocument, "getIFrameContentDocument"); -function getIFrameContentWindow(iframe) { - try { - return iframe.contentWindow; - } catch (e2) { - } -} -__name(getIFrameContentWindow, "getIFrameContentWindow"); -function _optionalChain$3(ops) { - let lastAccessLHS = void 0; - let value4 = ops[0]; - let i2 = 1; - while (i2 < ops.length) { - const op = ops[i2]; - const fn = ops[i2 + 1]; - i2 += 2; - if ((op === "optionalAccess" || op === "optionalCall") && value4 == null) { - return void 0; - } - if (op === "access" || op === "optionalAccess") { - lastAccessLHS = value4; - value4 = fn(value4); - } else if (op === "call" || op === "optionalCall") { - value4 = fn((...args) => value4.call(lastAccessLHS, ...args)); - lastAccessLHS = void 0; - } - } - return value4; -} -__name(_optionalChain$3, "_optionalChain$3"); -function isNodeInLinkedList(n2) { - return "__ln" in n2; -} -__name(isNodeInLinkedList, "isNodeInLinkedList"); -class DoubleLinkedList { - static { - __name(this, "DoubleLinkedList"); - } - constructor() { - this.length = 0; - this.head = null; - this.tail = null; - } - get(position3) { - if (position3 >= this.length) { - throw new Error("Position outside of list range"); - } - let current = this.head; - for (let index2 = 0; index2 < position3; index2++) { - current = _optionalChain$3([current, "optionalAccess", (_2) => _2.next]) || null; - } - return current; - } - addNode(n2) { - const node3 = { - value: n2, - previous: null, - next: null - }; - n2.__ln = node3; - if (n2.previousSibling && isNodeInLinkedList(n2.previousSibling)) { - const current = n2.previousSibling.__ln.next; - node3.next = current; - node3.previous = n2.previousSibling.__ln; - n2.previousSibling.__ln.next = node3; - if (current) { - current.previous = node3; - } - } else if (n2.nextSibling && isNodeInLinkedList(n2.nextSibling) && n2.nextSibling.__ln.previous) { - const current = n2.nextSibling.__ln.previous; - node3.previous = current; - node3.next = n2.nextSibling.__ln; - n2.nextSibling.__ln.previous = node3; - if (current) { - current.next = node3; - } - } else { - if (this.head) { - this.head.previous = node3; - } - node3.next = this.head; - this.head = node3; - } - if (node3.next === null) { - this.tail = node3; - } - this.length++; - } - removeNode(n2) { - const current = n2.__ln; - if (!this.head) { - return; - } - if (!current.previous) { - this.head = current.next; - if (this.head) { - this.head.previous = null; - } else { - this.tail = null; - } - } else { - current.previous.next = current.next; - if (current.next) { - current.next.previous = current.previous; - } else { - this.tail = current.previous; - } - } - if (n2.__ln) { - delete n2.__ln; - } - this.length--; - } -} -const moveKey = /* @__PURE__ */ __name((id3, parentId) => `${id3}@${parentId}`, "moveKey"); -class MutationBuffer { - static { - __name(this, "MutationBuffer"); - } - constructor() { - this.frozen = false; - this.locked = false; - this.texts = []; - this.attributes = []; - this.attributeMap = /* @__PURE__ */ new WeakMap(); - this.removes = []; - this.mapRemoves = []; - this.movedMap = {}; - this.addedSet = /* @__PURE__ */ new Set(); - this.movedSet = /* @__PURE__ */ new Set(); - this.droppedSet = /* @__PURE__ */ new Set(); - this.processMutations = (mutations) => { - mutations.forEach(this.processMutation); - this.emit(); - }; - this.emit = () => { - if (this.frozen || this.locked) { - return; - } - const adds = []; - const addedIds = /* @__PURE__ */ new Set(); - const addList = new DoubleLinkedList(); - const getNextId = /* @__PURE__ */ __name((n2) => { - let ns = n2; - let nextId = IGNORED_NODE; - while (nextId === IGNORED_NODE) { - ns = ns && ns.nextSibling; - nextId = ns && this.mirror.getId(ns); - } - return nextId; - }, "getNextId"); - const pushAdd = /* @__PURE__ */ __name((n2) => { - if (!n2.parentNode || !inDom(n2)) { - return; - } - const parentId = isShadowRoot(n2.parentNode) ? this.mirror.getId(getShadowHost(n2)) : this.mirror.getId(n2.parentNode); - const nextId = getNextId(n2); - if (parentId === -1 || nextId === -1) { - return addList.addNode(n2); - } - const sn = serializeNodeWithId(n2, { - doc: this.doc, - mirror: this.mirror, - blockClass: this.blockClass, - blockSelector: this.blockSelector, - maskAllText: this.maskAllText, - unblockSelector: this.unblockSelector, - maskTextClass: this.maskTextClass, - unmaskTextClass: this.unmaskTextClass, - maskTextSelector: this.maskTextSelector, - unmaskTextSelector: this.unmaskTextSelector, - skipChild: true, - newlyAddedElement: true, - inlineStylesheet: this.inlineStylesheet, - maskInputOptions: this.maskInputOptions, - maskAttributeFn: this.maskAttributeFn, - maskTextFn: this.maskTextFn, - maskInputFn: this.maskInputFn, - slimDOMOptions: this.slimDOMOptions, - dataURLOptions: this.dataURLOptions, - recordCanvas: this.recordCanvas, - inlineImages: this.inlineImages, - onSerialize: /* @__PURE__ */ __name((currentN) => { - if (isSerializedIframe(currentN, this.mirror) && !isBlocked$1(currentN, this.blockClass, this.blockSelector, this.unblockSelector, false)) { - this.iframeManager.addIframe(currentN); - } - if (isSerializedStylesheet(currentN, this.mirror)) { - this.stylesheetManager.trackLinkElement(currentN); - } - if (hasShadowRoot(n2)) { - this.shadowDomManager.addShadowRoot(n2.shadowRoot, this.doc); - } - }, "onSerialize"), - onIframeLoad: /* @__PURE__ */ __name((iframe, childSn) => { - if (isBlocked$1(iframe, this.blockClass, this.blockSelector, this.unblockSelector, false)) { - return; - } - this.iframeManager.attachIframe(iframe, childSn); - if (iframe.contentWindow) { - this.canvasManager.addWindow(iframe.contentWindow); - } - this.shadowDomManager.observeAttachShadow(iframe); - }, "onIframeLoad"), - onStylesheetLoad: /* @__PURE__ */ __name((link2, childSn) => { - this.stylesheetManager.attachLinkElement(link2, childSn); - }, "onStylesheetLoad") - }); - if (sn) { - adds.push({ - parentId, - nextId, - node: sn - }); - addedIds.add(sn.id); - } - }, "pushAdd"); - while (this.mapRemoves.length) { - this.mirror.removeNodeFromMap(this.mapRemoves.shift()); - } - for (const n2 of this.movedSet) { - if (isParentRemoved(this.removes, n2, this.mirror) && !this.movedSet.has(n2.parentNode)) { - continue; - } - pushAdd(n2); - } - for (const n2 of this.addedSet) { - if (!isAncestorInSet(this.droppedSet, n2) && !isParentRemoved(this.removes, n2, this.mirror)) { - pushAdd(n2); - } else if (isAncestorInSet(this.movedSet, n2)) { - pushAdd(n2); - } else { - this.droppedSet.add(n2); - } - } - let candidate = null; - while (addList.length) { - let node3 = null; - if (candidate) { - const parentId = this.mirror.getId(candidate.value.parentNode); - const nextId = getNextId(candidate.value); - if (parentId !== -1 && nextId !== -1) { - node3 = candidate; - } - } - if (!node3) { - let tailNode = addList.tail; - while (tailNode) { - const _node = tailNode; - tailNode = tailNode.previous; - if (_node) { - const parentId = this.mirror.getId(_node.value.parentNode); - const nextId = getNextId(_node.value); - if (nextId === -1) - continue; - else if (parentId !== -1) { - node3 = _node; - break; - } else { - const unhandledNode = _node.value; - if (unhandledNode.parentNode && unhandledNode.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { - const shadowHost = unhandledNode.parentNode.host; - const parentId2 = this.mirror.getId(shadowHost); - if (parentId2 !== -1) { - node3 = _node; - break; - } - } - } - } - } - } - if (!node3) { - while (addList.head) { - addList.removeNode(addList.head.value); - } - break; - } - candidate = node3.previous; - addList.removeNode(node3.value); - pushAdd(node3.value); - } - const payload = { - texts: this.texts.map((text2) => ({ - id: this.mirror.getId(text2.node), - value: text2.value - })).filter((text2) => !addedIds.has(text2.id)).filter((text2) => this.mirror.has(text2.id)), - attributes: this.attributes.map((attribute2) => { - const { attributes } = attribute2; - if (typeof attributes.style === "string") { - const diffAsStr = JSON.stringify(attribute2.styleDiff); - const unchangedAsStr = JSON.stringify(attribute2._unchangedStyles); - if (diffAsStr.length < attributes.style.length) { - if ((diffAsStr + unchangedAsStr).split("var(").length === attributes.style.split("var(").length) { - attributes.style = attribute2.styleDiff; - } - } - } - return { - id: this.mirror.getId(attribute2.node), - attributes - }; - }).filter((attribute2) => !addedIds.has(attribute2.id)).filter((attribute2) => this.mirror.has(attribute2.id)), - removes: this.removes, - adds - }; - if (!payload.texts.length && !payload.attributes.length && !payload.removes.length && !payload.adds.length) { - return; - } - this.texts = []; - this.attributes = []; - this.attributeMap = /* @__PURE__ */ new WeakMap(); - this.removes = []; - this.addedSet = /* @__PURE__ */ new Set(); - this.movedSet = /* @__PURE__ */ new Set(); - this.droppedSet = /* @__PURE__ */ new Set(); - this.movedMap = {}; - this.mutationCb(payload); - }; - this.processMutation = (m2) => { - if (isIgnored(m2.target, this.mirror)) { - return; - } - switch (m2.type) { - case "characterData": { - const value4 = m2.target.textContent; - if (!isBlocked$1(m2.target, this.blockClass, this.blockSelector, this.unblockSelector, false) && value4 !== m2.oldValue) { - this.texts.push({ - value: needMaskingText(m2.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextClass, this.unmaskTextSelector, this.maskAllText) && value4 ? this.maskTextFn ? this.maskTextFn(value4, closestElementOfNode$1(m2.target)) : value4.replace(/[\S]/g, "*") : value4, - node: m2.target - }); - } - break; - } - case "attributes": { - const target2 = m2.target; - let attributeName = m2.attributeName; - let value4 = m2.target.getAttribute(attributeName); - if (attributeName === "value") { - const type = getInputType(target2); - const tagName = target2.tagName; - value4 = getInputValue(target2, tagName, type); - const isInputMasked = shouldMaskInput({ - maskInputOptions: this.maskInputOptions, - tagName, - type - }); - const forceMask = needMaskingText(m2.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextClass, this.unmaskTextSelector, isInputMasked); - value4 = maskInputValue({ - isMasked: forceMask, - element: target2, - value: value4, - maskInputFn: this.maskInputFn - }); - } - if (isBlocked$1(m2.target, this.blockClass, this.blockSelector, this.unblockSelector, false) || value4 === m2.oldValue) { - return; - } - let item3 = this.attributeMap.get(m2.target); - if (target2.tagName === "IFRAME" && attributeName === "src" && !this.keepIframeSrcFn(value4)) { - const iframeDoc = getIFrameContentDocument(target2); - if (!iframeDoc) { - attributeName = "rr_src"; - } else { - return; - } - } - if (!item3) { - item3 = { - node: m2.target, - attributes: {}, - styleDiff: {}, - _unchangedStyles: {} - }; - this.attributes.push(item3); - this.attributeMap.set(m2.target, item3); - } - if (attributeName === "type" && target2.tagName === "INPUT" && (m2.oldValue || "").toLowerCase() === "password") { - target2.setAttribute("data-rr-is-password", "true"); - } - if (!ignoreAttribute(target2.tagName, attributeName)) { - item3.attributes[attributeName] = transformAttribute(this.doc, toLowerCase(target2.tagName), toLowerCase(attributeName), value4, target2, this.maskAttributeFn); - if (attributeName === "style") { - if (!this.unattachedDoc) { - try { - this.unattachedDoc = document.implementation.createHTMLDocument(); - } catch (e2) { - this.unattachedDoc = this.doc; - } - } - const old = this.unattachedDoc.createElement("span"); - if (m2.oldValue) { - old.setAttribute("style", m2.oldValue); - } - for (const pname of Array.from(target2.style)) { - const newValue2 = target2.style.getPropertyValue(pname); - const newPriority = target2.style.getPropertyPriority(pname); - if (newValue2 !== old.style.getPropertyValue(pname) || newPriority !== old.style.getPropertyPriority(pname)) { - if (newPriority === "") { - item3.styleDiff[pname] = newValue2; - } else { - item3.styleDiff[pname] = [newValue2, newPriority]; - } - } else { - item3._unchangedStyles[pname] = [newValue2, newPriority]; - } - } - for (const pname of Array.from(old.style)) { - if (target2.style.getPropertyValue(pname) === "") { - item3.styleDiff[pname] = false; - } - } - } - } - break; - } - case "childList": { - if (isBlocked$1(m2.target, this.blockClass, this.blockSelector, this.unblockSelector, true)) { - return; - } - m2.addedNodes.forEach((n2) => this.genAdds(n2, m2.target)); - m2.removedNodes.forEach((n2) => { - const nodeId = this.mirror.getId(n2); - const parentId = isShadowRoot(m2.target) ? this.mirror.getId(m2.target.host) : this.mirror.getId(m2.target); - if (isBlocked$1(m2.target, this.blockClass, this.blockSelector, this.unblockSelector, false) || isIgnored(n2, this.mirror) || !isSerialized(n2, this.mirror)) { - return; - } - if (this.addedSet.has(n2)) { - deepDelete(this.addedSet, n2); - this.droppedSet.add(n2); - } else if (this.addedSet.has(m2.target) && nodeId === -1) ; - else if (isAncestorRemoved(m2.target, this.mirror)) ; - else if (this.movedSet.has(n2) && this.movedMap[moveKey(nodeId, parentId)]) { - deepDelete(this.movedSet, n2); - } else { - this.removes.push({ - parentId, - id: nodeId, - isShadow: isShadowRoot(m2.target) && isNativeShadowDom(m2.target) ? true : void 0 - }); - } - this.mapRemoves.push(n2); - }); - break; - } - } - }; - this.genAdds = (n2, target2) => { - if (this.processedNodeManager.inOtherBuffer(n2, this)) - return; - if (this.addedSet.has(n2) || this.movedSet.has(n2)) - return; - if (this.mirror.hasNode(n2)) { - if (isIgnored(n2, this.mirror)) { - return; - } - this.movedSet.add(n2); - let targetId = null; - if (target2 && this.mirror.hasNode(target2)) { - targetId = this.mirror.getId(target2); - } - if (targetId && targetId !== -1) { - this.movedMap[moveKey(this.mirror.getId(n2), targetId)] = true; - } - } else { - this.addedSet.add(n2); - this.droppedSet.delete(n2); - } - if (!isBlocked$1(n2, this.blockClass, this.blockSelector, this.unblockSelector, false)) { - n2.childNodes.forEach((childN) => this.genAdds(childN)); - if (hasShadowRoot(n2)) { - n2.shadowRoot.childNodes.forEach((childN) => { - this.processedNodeManager.add(childN, this); - this.genAdds(childN, n2); - }); - } - } - }; - } - init(options4) { - [ - "mutationCb", - "blockClass", - "blockSelector", - "unblockSelector", - "maskAllText", - "maskTextClass", - "unmaskTextClass", - "maskTextSelector", - "unmaskTextSelector", - "inlineStylesheet", - "maskInputOptions", - "maskAttributeFn", - "maskTextFn", - "maskInputFn", - "keepIframeSrcFn", - "recordCanvas", - "inlineImages", - "slimDOMOptions", - "dataURLOptions", - "doc", - "mirror", - "iframeManager", - "stylesheetManager", - "shadowDomManager", - "canvasManager", - "processedNodeManager" - ].forEach((key) => { - this[key] = options4[key]; - }); - } - freeze() { - this.frozen = true; - this.canvasManager.freeze(); - } - unfreeze() { - this.frozen = false; - this.canvasManager.unfreeze(); - this.emit(); - } - isFrozen() { - return this.frozen; - } - lock() { - this.locked = true; - this.canvasManager.lock(); - } - unlock() { - this.locked = false; - this.canvasManager.unlock(); - this.emit(); - } - reset() { - this.shadowDomManager.reset(); - this.canvasManager.reset(); - } -} -function deepDelete(addsSet, n2) { - addsSet.delete(n2); - n2.childNodes.forEach((childN) => deepDelete(addsSet, childN)); -} -__name(deepDelete, "deepDelete"); -function isParentRemoved(removes, n2, mirror2) { - if (removes.length === 0) - return false; - return _isParentRemoved(removes, n2, mirror2); -} -__name(isParentRemoved, "isParentRemoved"); -function _isParentRemoved(removes, n2, mirror2) { - let node3 = n2.parentNode; - while (node3) { - const parentId = mirror2.getId(node3); - if (removes.some((r2) => r2.id === parentId)) { - return true; - } - node3 = node3.parentNode; - } - return false; -} -__name(_isParentRemoved, "_isParentRemoved"); -function isAncestorInSet(set4, n2) { - if (set4.size === 0) - return false; - return _isAncestorInSet(set4, n2); -} -__name(isAncestorInSet, "isAncestorInSet"); -function _isAncestorInSet(set4, n2) { - const { parentNode: parentNode2 } = n2; - if (!parentNode2) { - return false; - } - if (set4.has(parentNode2)) { - return true; - } - return _isAncestorInSet(set4, parentNode2); -} -__name(_isAncestorInSet, "_isAncestorInSet"); -let errorHandler$1; -function registerErrorHandler$1(handler10) { - errorHandler$1 = handler10; -} -__name(registerErrorHandler$1, "registerErrorHandler$1"); -function unregisterErrorHandler() { - errorHandler$1 = void 0; -} -__name(unregisterErrorHandler, "unregisterErrorHandler"); -const callbackWrapper$1 = /* @__PURE__ */ __name((cb) => { - if (!errorHandler$1) { - return cb; - } - const rrwebWrapped = /* @__PURE__ */ __name((...rest) => { - try { - return cb(...rest); - } catch (error2) { - if (errorHandler$1 && errorHandler$1(error2) === true) { - return () => { - }; - } - throw error2; - } - }, "rrwebWrapped"); - return rrwebWrapped; -}, "callbackWrapper$1"); -function _optionalChain$2(ops) { - let lastAccessLHS = void 0; - let value4 = ops[0]; - let i2 = 1; - while (i2 < ops.length) { - const op = ops[i2]; - const fn = ops[i2 + 1]; - i2 += 2; - if ((op === "optionalAccess" || op === "optionalCall") && value4 == null) { - return void 0; - } - if (op === "access" || op === "optionalAccess") { - lastAccessLHS = value4; - value4 = fn(value4); - } else if (op === "call" || op === "optionalCall") { - value4 = fn((...args) => value4.call(lastAccessLHS, ...args)); - lastAccessLHS = void 0; - } - } - return value4; -} -__name(_optionalChain$2, "_optionalChain$2"); -const mutationBuffers = []; -function getEventTarget(event) { - try { - if ("composedPath" in event) { - const path = event.composedPath(); - if (path.length) { - return path[0]; - } - } else if ("path" in event && event.path.length) { - return event.path[0]; - } - } catch (e2) { - } - return event && event.target; -} -__name(getEventTarget, "getEventTarget"); -function initMutationObserver(options4, rootEl) { - const mutationBuffer = new MutationBuffer(); - mutationBuffers.push(mutationBuffer); - mutationBuffer.init(options4); - let mutationObserverCtor = window.MutationObserver || window.__rrMutationObserver; - const angularZoneSymbol = _optionalChain$2([window, "optionalAccess", (_2) => _2.Zone, "optionalAccess", (_2) => _2.__symbol__, "optionalCall", (_3) => _3("MutationObserver")]); - if (angularZoneSymbol && window[angularZoneSymbol]) { - mutationObserverCtor = window[angularZoneSymbol]; - } - const observer = new mutationObserverCtor(callbackWrapper$1((mutations) => { - if (options4.onMutation && options4.onMutation(mutations) === false) { - return; - } - mutationBuffer.processMutations.bind(mutationBuffer)(mutations); - })); - observer.observe(rootEl, { - attributes: true, - attributeOldValue: true, - characterData: true, - characterDataOldValue: true, - childList: true, - subtree: true - }); - return observer; -} -__name(initMutationObserver, "initMutationObserver"); -function initMoveObserver({ mousemoveCb, sampling, doc: doc2, mirror: mirror2 }) { - if (sampling.mousemove === false) { - return () => { - }; - } - const threshold = typeof sampling.mousemove === "number" ? sampling.mousemove : 50; - const callbackThreshold = typeof sampling.mousemoveCallback === "number" ? sampling.mousemoveCallback : 500; - let positions = []; - let timeBaseline; - const wrappedCb = throttle$1(callbackWrapper$1((source) => { - const totalOffset = Date.now() - timeBaseline; - mousemoveCb(positions.map((p2) => { - p2.timeOffset -= totalOffset; - return p2; - }), source); - positions = []; - timeBaseline = null; - }), callbackThreshold); - const updatePosition = callbackWrapper$1(throttle$1(callbackWrapper$1((evt) => { - const target2 = getEventTarget(evt); - const { clientX, clientY } = legacy_isTouchEvent(evt) ? evt.changedTouches[0] : evt; - if (!timeBaseline) { - timeBaseline = nowTimestamp(); - } - positions.push({ - x: clientX, - y: clientY, - id: mirror2.getId(target2), - timeOffset: nowTimestamp() - timeBaseline - }); - wrappedCb(typeof DragEvent !== "undefined" && evt instanceof DragEvent ? IncrementalSource.Drag : evt instanceof MouseEvent ? IncrementalSource.MouseMove : IncrementalSource.TouchMove); - }), threshold, { - trailing: false - })); - const handlers2 = [ - on("mousemove", updatePosition, doc2), - on("touchmove", updatePosition, doc2), - on("drag", updatePosition, doc2) - ]; - return callbackWrapper$1(() => { - handlers2.forEach((h2) => h2()); - }); -} -__name(initMoveObserver, "initMoveObserver"); -function initMouseInteractionObserver({ mouseInteractionCb, doc: doc2, mirror: mirror2, blockClass, blockSelector, unblockSelector, sampling }) { - if (sampling.mouseInteraction === false) { - return () => { - }; - } - const disableMap = sampling.mouseInteraction === true || sampling.mouseInteraction === void 0 ? {} : sampling.mouseInteraction; - const handlers2 = []; - let currentPointerType = null; - const getHandler = /* @__PURE__ */ __name((eventKey) => { - return (event) => { - const target2 = getEventTarget(event); - if (isBlocked$1(target2, blockClass, blockSelector, unblockSelector, true)) { - return; - } - let pointerType = null; - let thisEventKey = eventKey; - if ("pointerType" in event) { - switch (event.pointerType) { - case "mouse": - pointerType = PointerTypes.Mouse; - break; - case "touch": - pointerType = PointerTypes.Touch; - break; - case "pen": - pointerType = PointerTypes.Pen; - break; - } - if (pointerType === PointerTypes.Touch) { - if (MouseInteractions[eventKey] === MouseInteractions.MouseDown) { - thisEventKey = "TouchStart"; - } else if (MouseInteractions[eventKey] === MouseInteractions.MouseUp) { - thisEventKey = "TouchEnd"; - } - } else if (pointerType === PointerTypes.Pen) ; - } else if (legacy_isTouchEvent(event)) { - pointerType = PointerTypes.Touch; - } - if (pointerType !== null) { - currentPointerType = pointerType; - if (thisEventKey.startsWith("Touch") && pointerType === PointerTypes.Touch || thisEventKey.startsWith("Mouse") && pointerType === PointerTypes.Mouse) { - pointerType = null; - } - } else if (MouseInteractions[eventKey] === MouseInteractions.Click) { - pointerType = currentPointerType; - currentPointerType = null; - } - const e2 = legacy_isTouchEvent(event) ? event.changedTouches[0] : event; - if (!e2) { - return; - } - const id3 = mirror2.getId(target2); - const { clientX, clientY } = e2; - callbackWrapper$1(mouseInteractionCb)({ - type: MouseInteractions[thisEventKey], - id: id3, - x: clientX, - y: clientY, - ...pointerType !== null && { pointerType } - }); - }; - }, "getHandler"); - Object.keys(MouseInteractions).filter((key) => Number.isNaN(Number(key)) && !key.endsWith("_Departed") && disableMap[key] !== false).forEach((eventKey) => { - let eventName = toLowerCase(eventKey); - const handler10 = getHandler(eventKey); - if (window.PointerEvent) { - switch (MouseInteractions[eventKey]) { - case MouseInteractions.MouseDown: - case MouseInteractions.MouseUp: - eventName = eventName.replace("mouse", "pointer"); - break; - case MouseInteractions.TouchStart: - case MouseInteractions.TouchEnd: - return; - } - } - handlers2.push(on(eventName, handler10, doc2)); - }); - return callbackWrapper$1(() => { - handlers2.forEach((h2) => h2()); - }); -} -__name(initMouseInteractionObserver, "initMouseInteractionObserver"); -function initScrollObserver({ scrollCb, doc: doc2, mirror: mirror2, blockClass, blockSelector, unblockSelector, sampling }) { - const updatePosition = callbackWrapper$1(throttle$1(callbackWrapper$1((evt) => { - const target2 = getEventTarget(evt); - if (!target2 || isBlocked$1(target2, blockClass, blockSelector, unblockSelector, true)) { - return; - } - const id3 = mirror2.getId(target2); - if (target2 === doc2 && doc2.defaultView) { - const scrollLeftTop = getWindowScroll(doc2.defaultView); - scrollCb({ - id: id3, - x: scrollLeftTop.left, - y: scrollLeftTop.top - }); - } else { - scrollCb({ - id: id3, - x: target2.scrollLeft, - y: target2.scrollTop - }); - } - }), sampling.scroll || 100)); - return on("scroll", updatePosition, doc2); -} -__name(initScrollObserver, "initScrollObserver"); -function initViewportResizeObserver({ viewportResizeCb }, { win }) { - let lastH = -1; - let lastW = -1; - const updateDimension = callbackWrapper$1(throttle$1(callbackWrapper$1(() => { - const height = getWindowHeight(); - const width2 = getWindowWidth(); - if (lastH !== height || lastW !== width2) { - viewportResizeCb({ - width: Number(width2), - height: Number(height) - }); - lastH = height; - lastW = width2; - } - }), 200)); - return on("resize", updateDimension, win); -} -__name(initViewportResizeObserver, "initViewportResizeObserver"); -const INPUT_TAGS = ["INPUT", "TEXTAREA", "SELECT"]; -const lastInputValueMap = /* @__PURE__ */ new WeakMap(); -function initInputObserver({ inputCb, doc: doc2, mirror: mirror2, blockClass, blockSelector, unblockSelector, ignoreClass, ignoreSelector, maskInputOptions, maskInputFn, sampling, userTriggeredOnInput, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector }) { - function eventHandler(event) { - let target2 = getEventTarget(event); - const userTriggered = event.isTrusted; - const tagName = target2 && toUpperCase(target2.tagName); - if (tagName === "OPTION") - target2 = target2.parentElement; - if (!target2 || !tagName || INPUT_TAGS.indexOf(tagName) < 0 || isBlocked$1(target2, blockClass, blockSelector, unblockSelector, true)) { - return; - } - const el = target2; - if (el.classList.contains(ignoreClass) || ignoreSelector && el.matches(ignoreSelector)) { - return; - } - const type = getInputType(target2); - let text2 = getInputValue(el, tagName, type); - let isChecked2 = false; - const isInputMasked = shouldMaskInput({ - maskInputOptions, - tagName, - type - }); - const forceMask = needMaskingText(target2, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked); - if (type === "radio" || type === "checkbox") { - isChecked2 = target2.checked; - } - text2 = maskInputValue({ - isMasked: forceMask, - element: target2, - value: text2, - maskInputFn - }); - cbWithDedup(target2, userTriggeredOnInput ? { text: text2, isChecked: isChecked2, userTriggered } : { text: text2, isChecked: isChecked2 }); - const name2 = target2.name; - if (type === "radio" && name2 && isChecked2) { - doc2.querySelectorAll(`input[type="radio"][name="${name2}"]`).forEach((el2) => { - if (el2 !== target2) { - const text3 = maskInputValue({ - isMasked: forceMask, - element: el2, - value: getInputValue(el2, tagName, type), - maskInputFn - }); - cbWithDedup(el2, userTriggeredOnInput ? { text: text3, isChecked: !isChecked2, userTriggered: false } : { text: text3, isChecked: !isChecked2 }); - } - }); - } - } - __name(eventHandler, "eventHandler"); - function cbWithDedup(target2, v2) { - const lastInputValue = lastInputValueMap.get(target2); - if (!lastInputValue || lastInputValue.text !== v2.text || lastInputValue.isChecked !== v2.isChecked) { - lastInputValueMap.set(target2, v2); - const id3 = mirror2.getId(target2); - callbackWrapper$1(inputCb)({ - ...v2, - id: id3 - }); - } - } - __name(cbWithDedup, "cbWithDedup"); - const events2 = sampling.input === "last" ? ["change"] : ["input", "change"]; - const handlers2 = events2.map((eventName) => on(eventName, callbackWrapper$1(eventHandler), doc2)); - const currentWindow = doc2.defaultView; - if (!currentWindow) { - return () => { - handlers2.forEach((h2) => h2()); - }; - } - const propertyDescriptor = currentWindow.Object.getOwnPropertyDescriptor(currentWindow.HTMLInputElement.prototype, "value"); - const hookProperties = [ - [currentWindow.HTMLInputElement.prototype, "value"], - [currentWindow.HTMLInputElement.prototype, "checked"], - [currentWindow.HTMLSelectElement.prototype, "value"], - [currentWindow.HTMLTextAreaElement.prototype, "value"], - [currentWindow.HTMLSelectElement.prototype, "selectedIndex"], - [currentWindow.HTMLOptionElement.prototype, "selected"] - ]; - if (propertyDescriptor && propertyDescriptor.set) { - handlers2.push(...hookProperties.map((p2) => hookSetter$1(p2[0], p2[1], { - set() { - callbackWrapper$1(eventHandler)({ - target: this, - isTrusted: false - }); - } - }, false, currentWindow))); - } - return callbackWrapper$1(() => { - handlers2.forEach((h2) => h2()); - }); -} -__name(initInputObserver, "initInputObserver"); -function getNestedCSSRulePositions(rule) { - const positions = []; - function recurse(childRule, pos) { - if (hasNestedCSSRule("CSSGroupingRule") && childRule.parentRule instanceof CSSGroupingRule || hasNestedCSSRule("CSSMediaRule") && childRule.parentRule instanceof CSSMediaRule || hasNestedCSSRule("CSSSupportsRule") && childRule.parentRule instanceof CSSSupportsRule || hasNestedCSSRule("CSSConditionRule") && childRule.parentRule instanceof CSSConditionRule) { - const rules = Array.from(childRule.parentRule.cssRules); - const index2 = rules.indexOf(childRule); - pos.unshift(index2); - } else if (childRule.parentStyleSheet) { - const rules = Array.from(childRule.parentStyleSheet.cssRules); - const index2 = rules.indexOf(childRule); - pos.unshift(index2); - } - return pos; - } - __name(recurse, "recurse"); - return recurse(rule, positions); -} -__name(getNestedCSSRulePositions, "getNestedCSSRulePositions"); -function getIdAndStyleId(sheet, mirror2, styleMirror) { - let id3, styleId; - if (!sheet) - return {}; - if (sheet.ownerNode) - id3 = mirror2.getId(sheet.ownerNode); - else - styleId = styleMirror.getId(sheet); - return { - styleId, - id: id3 - }; -} -__name(getIdAndStyleId, "getIdAndStyleId"); -function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetManager }, { win }) { - if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) { - return () => { - }; - } - const insertRule = win.CSSStyleSheet.prototype.insertRule; - win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, { - apply: callbackWrapper$1((target2, thisArg, argumentsList) => { - const [rule, index2] = argumentsList; - const { id: id3, styleId } = getIdAndStyleId(thisArg, mirror2, stylesheetManager.styleMirror); - if (id3 && id3 !== -1 || styleId && styleId !== -1) { - styleSheetRuleCb({ - id: id3, - styleId, - adds: [{ rule, index: index2 }] - }); - } - return target2.apply(thisArg, argumentsList); - }) - }); - const deleteRule = win.CSSStyleSheet.prototype.deleteRule; - win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, { - apply: callbackWrapper$1((target2, thisArg, argumentsList) => { - const [index2] = argumentsList; - const { id: id3, styleId } = getIdAndStyleId(thisArg, mirror2, stylesheetManager.styleMirror); - if (id3 && id3 !== -1 || styleId && styleId !== -1) { - styleSheetRuleCb({ - id: id3, - styleId, - removes: [{ index: index2 }] - }); - } - return target2.apply(thisArg, argumentsList); - }) - }); - let replace2; - if (win.CSSStyleSheet.prototype.replace) { - replace2 = win.CSSStyleSheet.prototype.replace; - win.CSSStyleSheet.prototype.replace = new Proxy(replace2, { - apply: callbackWrapper$1((target2, thisArg, argumentsList) => { - const [text2] = argumentsList; - const { id: id3, styleId } = getIdAndStyleId(thisArg, mirror2, stylesheetManager.styleMirror); - if (id3 && id3 !== -1 || styleId && styleId !== -1) { - styleSheetRuleCb({ - id: id3, - styleId, - replace: text2 - }); - } - return target2.apply(thisArg, argumentsList); - }) - }); - } - let replaceSync; - if (win.CSSStyleSheet.prototype.replaceSync) { - replaceSync = win.CSSStyleSheet.prototype.replaceSync; - win.CSSStyleSheet.prototype.replaceSync = new Proxy(replaceSync, { - apply: callbackWrapper$1((target2, thisArg, argumentsList) => { - const [text2] = argumentsList; - const { id: id3, styleId } = getIdAndStyleId(thisArg, mirror2, stylesheetManager.styleMirror); - if (id3 && id3 !== -1 || styleId && styleId !== -1) { - styleSheetRuleCb({ - id: id3, - styleId, - replaceSync: text2 - }); - } - return target2.apply(thisArg, argumentsList); - }) - }); - } - const supportedNestedCSSRuleTypes = {}; - if (canMonkeyPatchNestedCSSRule("CSSGroupingRule")) { - supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule; - } else { - if (canMonkeyPatchNestedCSSRule("CSSMediaRule")) { - supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule; - } - if (canMonkeyPatchNestedCSSRule("CSSConditionRule")) { - supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule; - } - if (canMonkeyPatchNestedCSSRule("CSSSupportsRule")) { - supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule; - } - } - const unmodifiedFunctions = {}; - Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => { - unmodifiedFunctions[typeKey] = { - insertRule: type.prototype.insertRule, - deleteRule: type.prototype.deleteRule - }; - type.prototype.insertRule = new Proxy(unmodifiedFunctions[typeKey].insertRule, { - apply: callbackWrapper$1((target2, thisArg, argumentsList) => { - const [rule, index2] = argumentsList; - const { id: id3, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror2, stylesheetManager.styleMirror); - if (id3 && id3 !== -1 || styleId && styleId !== -1) { - styleSheetRuleCb({ - id: id3, - styleId, - adds: [ - { - rule, - index: [ - ...getNestedCSSRulePositions(thisArg), - index2 || 0 - ] - } - ] - }); - } - return target2.apply(thisArg, argumentsList); - }) - }); - type.prototype.deleteRule = new Proxy(unmodifiedFunctions[typeKey].deleteRule, { - apply: callbackWrapper$1((target2, thisArg, argumentsList) => { - const [index2] = argumentsList; - const { id: id3, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror2, stylesheetManager.styleMirror); - if (id3 && id3 !== -1 || styleId && styleId !== -1) { - styleSheetRuleCb({ - id: id3, - styleId, - removes: [ - { index: [...getNestedCSSRulePositions(thisArg), index2] } - ] - }); - } - return target2.apply(thisArg, argumentsList); - }) - }); - }); - return callbackWrapper$1(() => { - win.CSSStyleSheet.prototype.insertRule = insertRule; - win.CSSStyleSheet.prototype.deleteRule = deleteRule; - replace2 && (win.CSSStyleSheet.prototype.replace = replace2); - replaceSync && (win.CSSStyleSheet.prototype.replaceSync = replaceSync); - Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => { - type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule; - type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule; - }); - }); -} -__name(initStyleSheetObserver, "initStyleSheetObserver"); -function initAdoptedStyleSheetObserver({ mirror: mirror2, stylesheetManager }, host) { - let hostId = null; - if (host.nodeName === "#document") - hostId = mirror2.getId(host); - else - hostId = mirror2.getId(host.host); - const patchTarget = host.nodeName === "#document" ? _optionalChain$2([host, "access", (_4) => _4.defaultView, "optionalAccess", (_5) => _5.Document]) : _optionalChain$2([host, "access", (_6) => _6.ownerDocument, "optionalAccess", (_7) => _7.defaultView, "optionalAccess", (_8) => _8.ShadowRoot]); - const originalPropertyDescriptor = _optionalChain$2([patchTarget, "optionalAccess", (_9) => _9.prototype]) ? Object.getOwnPropertyDescriptor(_optionalChain$2([patchTarget, "optionalAccess", (_10) => _10.prototype]), "adoptedStyleSheets") : void 0; - if (hostId === null || hostId === -1 || !patchTarget || !originalPropertyDescriptor) - return () => { - }; - Object.defineProperty(host, "adoptedStyleSheets", { - configurable: originalPropertyDescriptor.configurable, - enumerable: originalPropertyDescriptor.enumerable, - get() { - return _optionalChain$2([originalPropertyDescriptor, "access", (_11) => _11.get, "optionalAccess", (_12) => _12.call, "call", (_13) => _13(this)]); - }, - set(sheets) { - const result = _optionalChain$2([originalPropertyDescriptor, "access", (_14) => _14.set, "optionalAccess", (_15) => _15.call, "call", (_16) => _16(this, sheets)]); - if (hostId !== null && hostId !== -1) { - try { - stylesheetManager.adoptStyleSheets(sheets, hostId); - } catch (e2) { - } - } - return result; - } - }); - return callbackWrapper$1(() => { - Object.defineProperty(host, "adoptedStyleSheets", { - configurable: originalPropertyDescriptor.configurable, - enumerable: originalPropertyDescriptor.enumerable, - get: originalPropertyDescriptor.get, - set: originalPropertyDescriptor.set - }); - }); -} -__name(initAdoptedStyleSheetObserver, "initAdoptedStyleSheetObserver"); -function initStyleDeclarationObserver({ styleDeclarationCb, mirror: mirror2, ignoreCSSAttributes, stylesheetManager }, { win }) { - const setProperty2 = win.CSSStyleDeclaration.prototype.setProperty; - win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty2, { - apply: callbackWrapper$1((target2, thisArg, argumentsList) => { - const [property, value4, priority] = argumentsList; - if (ignoreCSSAttributes.has(property)) { - return setProperty2.apply(thisArg, [property, value4, priority]); - } - const { id: id3, styleId } = getIdAndStyleId(_optionalChain$2([thisArg, "access", (_17) => _17.parentRule, "optionalAccess", (_18) => _18.parentStyleSheet]), mirror2, stylesheetManager.styleMirror); - if (id3 && id3 !== -1 || styleId && styleId !== -1) { - styleDeclarationCb({ - id: id3, - styleId, - set: { - property, - value: value4, - priority - }, - index: getNestedCSSRulePositions(thisArg.parentRule) - }); - } - return target2.apply(thisArg, argumentsList); - }) - }); - const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty; - win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, { - apply: callbackWrapper$1((target2, thisArg, argumentsList) => { - const [property] = argumentsList; - if (ignoreCSSAttributes.has(property)) { - return removeProperty.apply(thisArg, [property]); - } - const { id: id3, styleId } = getIdAndStyleId(_optionalChain$2([thisArg, "access", (_19) => _19.parentRule, "optionalAccess", (_20) => _20.parentStyleSheet]), mirror2, stylesheetManager.styleMirror); - if (id3 && id3 !== -1 || styleId && styleId !== -1) { - styleDeclarationCb({ - id: id3, - styleId, - remove: { - property - }, - index: getNestedCSSRulePositions(thisArg.parentRule) - }); - } - return target2.apply(thisArg, argumentsList); - }) - }); - return callbackWrapper$1(() => { - win.CSSStyleDeclaration.prototype.setProperty = setProperty2; - win.CSSStyleDeclaration.prototype.removeProperty = removeProperty; - }); -} -__name(initStyleDeclarationObserver, "initStyleDeclarationObserver"); -function initMediaInteractionObserver({ mediaInteractionCb, blockClass, blockSelector, unblockSelector, mirror: mirror2, sampling, doc: doc2 }) { - const handler10 = callbackWrapper$1((type) => throttle$1(callbackWrapper$1((event) => { - const target2 = getEventTarget(event); - if (!target2 || isBlocked$1(target2, blockClass, blockSelector, unblockSelector, true)) { - return; - } - const { currentTime, volume, muted, playbackRate } = target2; - mediaInteractionCb({ - type, - id: mirror2.getId(target2), - currentTime, - volume, - muted, - playbackRate - }); - }), sampling.media || 500)); - const handlers2 = [ - on("play", handler10(0), doc2), - on("pause", handler10(1), doc2), - on("seeked", handler10(2), doc2), - on("volumechange", handler10(3), doc2), - on("ratechange", handler10(4), doc2) - ]; - return callbackWrapper$1(() => { - handlers2.forEach((h2) => h2()); - }); -} -__name(initMediaInteractionObserver, "initMediaInteractionObserver"); -function initFontObserver({ fontCb, doc: doc2 }) { - const win = doc2.defaultView; - if (!win) { - return () => { - }; - } - const handlers2 = []; - const fontMap = /* @__PURE__ */ new WeakMap(); - const originalFontFace = win.FontFace; - win.FontFace = /* @__PURE__ */ __name(function FontFace(family, source, descriptors2) { - const fontFace = new originalFontFace(family, source, descriptors2); - fontMap.set(fontFace, { - family, - buffer: typeof source !== "string", - descriptors: descriptors2, - fontSource: typeof source === "string" ? source : JSON.stringify(Array.from(new Uint8Array(source))) - }); - return fontFace; - }, "FontFace"); - const restoreHandler = patch$2(doc2.fonts, "add", function(original) { - return function(fontFace) { - setTimeout$1$1(callbackWrapper$1(() => { - const p2 = fontMap.get(fontFace); - if (p2) { - fontCb(p2); - fontMap.delete(fontFace); - } - }), 0); - return original.apply(this, [fontFace]); - }; - }); - handlers2.push(() => { - win.FontFace = originalFontFace; - }); - handlers2.push(restoreHandler); - return callbackWrapper$1(() => { - handlers2.forEach((h2) => h2()); - }); -} -__name(initFontObserver, "initFontObserver"); -function initSelectionObserver(param) { - const { doc: doc2, mirror: mirror2, blockClass, blockSelector, unblockSelector, selectionCb } = param; - let collapsed2 = true; - const updateSelection2 = callbackWrapper$1(() => { - const selection = doc2.getSelection(); - if (!selection || collapsed2 && _optionalChain$2([selection, "optionalAccess", (_21) => _21.isCollapsed])) - return; - collapsed2 = selection.isCollapsed || false; - const ranges = []; - const count = selection.rangeCount || 0; - for (let i2 = 0; i2 < count; i2++) { - const range2 = selection.getRangeAt(i2); - const { startContainer, startOffset, endContainer, endOffset } = range2; - const blocked2 = isBlocked$1(startContainer, blockClass, blockSelector, unblockSelector, true) || isBlocked$1(endContainer, blockClass, blockSelector, unblockSelector, true); - if (blocked2) - continue; - ranges.push({ - start: mirror2.getId(startContainer), - startOffset, - end: mirror2.getId(endContainer), - endOffset - }); - } - selectionCb({ ranges }); - }); - updateSelection2(); - return on("selectionchange", updateSelection2); -} -__name(initSelectionObserver, "initSelectionObserver"); -function initCustomElementObserver({ doc: doc2, customElementCb }) { - const win = doc2.defaultView; - if (!win || !win.customElements) - return () => { - }; - const restoreHandler = patch$2(win.customElements, "define", function(original) { - return function(name2, constructor, options4) { - try { - customElementCb({ - define: { - name: name2 - } - }); - } catch (e2) { - } - return original.apply(this, [name2, constructor, options4]); - }; - }); - return restoreHandler; -} -__name(initCustomElementObserver, "initCustomElementObserver"); -function initObservers(o2, _hooks = {}) { - const currentWindow = o2.doc.defaultView; - if (!currentWindow) { - return () => { - }; - } - let mutationObserver; - if (o2.recordDOM) { - mutationObserver = initMutationObserver(o2, o2.doc); - } - const mousemoveHandler = initMoveObserver(o2); - const mouseInteractionHandler = initMouseInteractionObserver(o2); - const scrollHandler = initScrollObserver(o2); - const viewportResizeHandler = initViewportResizeObserver(o2, { - win: currentWindow - }); - const inputHandler = initInputObserver(o2); - const mediaInteractionHandler = initMediaInteractionObserver(o2); - let styleSheetObserver = /* @__PURE__ */ __name(() => { - }, "styleSheetObserver"); - let adoptedStyleSheetObserver = /* @__PURE__ */ __name(() => { - }, "adoptedStyleSheetObserver"); - let styleDeclarationObserver = /* @__PURE__ */ __name(() => { - }, "styleDeclarationObserver"); - let fontObserver = /* @__PURE__ */ __name(() => { - }, "fontObserver"); - if (o2.recordDOM) { - styleSheetObserver = initStyleSheetObserver(o2, { win: currentWindow }); - adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o2, o2.doc); - styleDeclarationObserver = initStyleDeclarationObserver(o2, { - win: currentWindow - }); - if (o2.collectFonts) { - fontObserver = initFontObserver(o2); - } - } - const selectionObserver = initSelectionObserver(o2); - const customElementObserver = initCustomElementObserver(o2); - const pluginHandlers = []; - for (const plugin of o2.plugins) { - pluginHandlers.push(plugin.observer(plugin.callback, currentWindow, plugin.options)); - } - return callbackWrapper$1(() => { - mutationBuffers.forEach((b2) => b2.reset()); - _optionalChain$2([mutationObserver, "optionalAccess", (_22) => _22.disconnect, "call", (_23) => _23()]); - mousemoveHandler(); - mouseInteractionHandler(); - scrollHandler(); - viewportResizeHandler(); - inputHandler(); - mediaInteractionHandler(); - styleSheetObserver(); - adoptedStyleSheetObserver(); - styleDeclarationObserver(); - fontObserver(); - selectionObserver(); - customElementObserver(); - pluginHandlers.forEach((h2) => h2()); - }); -} -__name(initObservers, "initObservers"); -function hasNestedCSSRule(prop2) { - return typeof window[prop2] !== "undefined"; -} -__name(hasNestedCSSRule, "hasNestedCSSRule"); -function canMonkeyPatchNestedCSSRule(prop2) { - return Boolean(typeof window[prop2] !== "undefined" && window[prop2].prototype && "insertRule" in window[prop2].prototype && "deleteRule" in window[prop2].prototype); -} -__name(canMonkeyPatchNestedCSSRule, "canMonkeyPatchNestedCSSRule"); -class CrossOriginIframeMirror { - static { - __name(this, "CrossOriginIframeMirror"); - } - constructor(generateIdFn) { - this.generateIdFn = generateIdFn; - this.iframeIdToRemoteIdMap = /* @__PURE__ */ new WeakMap(); - this.iframeRemoteIdToIdMap = /* @__PURE__ */ new WeakMap(); - } - getId(iframe, remoteId, idToRemoteMap, remoteToIdMap) { - const idToRemoteIdMap = idToRemoteMap || this.getIdToRemoteIdMap(iframe); - const remoteIdToIdMap = remoteToIdMap || this.getRemoteIdToIdMap(iframe); - let id3 = idToRemoteIdMap.get(remoteId); - if (!id3) { - id3 = this.generateIdFn(); - idToRemoteIdMap.set(remoteId, id3); - remoteIdToIdMap.set(id3, remoteId); - } - return id3; - } - getIds(iframe, remoteId) { - const idToRemoteIdMap = this.getIdToRemoteIdMap(iframe); - const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe); - return remoteId.map((id3) => this.getId(iframe, id3, idToRemoteIdMap, remoteIdToIdMap)); - } - getRemoteId(iframe, id3, map3) { - const remoteIdToIdMap = map3 || this.getRemoteIdToIdMap(iframe); - if (typeof id3 !== "number") - return id3; - const remoteId = remoteIdToIdMap.get(id3); - if (!remoteId) - return -1; - return remoteId; - } - getRemoteIds(iframe, ids) { - const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe); - return ids.map((id3) => this.getRemoteId(iframe, id3, remoteIdToIdMap)); - } - reset(iframe) { - if (!iframe) { - this.iframeIdToRemoteIdMap = /* @__PURE__ */ new WeakMap(); - this.iframeRemoteIdToIdMap = /* @__PURE__ */ new WeakMap(); - return; - } - this.iframeIdToRemoteIdMap.delete(iframe); - this.iframeRemoteIdToIdMap.delete(iframe); - } - getIdToRemoteIdMap(iframe) { - let idToRemoteIdMap = this.iframeIdToRemoteIdMap.get(iframe); - if (!idToRemoteIdMap) { - idToRemoteIdMap = /* @__PURE__ */ new Map(); - this.iframeIdToRemoteIdMap.set(iframe, idToRemoteIdMap); - } - return idToRemoteIdMap; - } - getRemoteIdToIdMap(iframe) { - let remoteIdToIdMap = this.iframeRemoteIdToIdMap.get(iframe); - if (!remoteIdToIdMap) { - remoteIdToIdMap = /* @__PURE__ */ new Map(); - this.iframeRemoteIdToIdMap.set(iframe, remoteIdToIdMap); - } - return remoteIdToIdMap; - } -} -function _optionalChain$1(ops) { - let lastAccessLHS = void 0; - let value4 = ops[0]; - let i2 = 1; - while (i2 < ops.length) { - const op = ops[i2]; - const fn = ops[i2 + 1]; - i2 += 2; - if ((op === "optionalAccess" || op === "optionalCall") && value4 == null) { - return void 0; - } - if (op === "access" || op === "optionalAccess") { - lastAccessLHS = value4; - value4 = fn(value4); - } else if (op === "call" || op === "optionalCall") { - value4 = fn((...args) => value4.call(lastAccessLHS, ...args)); - lastAccessLHS = void 0; - } - } - return value4; -} -__name(_optionalChain$1, "_optionalChain$1"); -class IframeManagerNoop { - static { - __name(this, "IframeManagerNoop"); - } - constructor() { - this.crossOriginIframeMirror = new CrossOriginIframeMirror(genId); - this.crossOriginIframeRootIdMap = /* @__PURE__ */ new WeakMap(); - } - addIframe() { - } - addLoadListener() { - } - attachIframe() { - } -} -class IframeManager { - static { - __name(this, "IframeManager"); - } - constructor(options4) { - this.iframes = /* @__PURE__ */ new WeakMap(); - this.crossOriginIframeMap = /* @__PURE__ */ new WeakMap(); - this.crossOriginIframeMirror = new CrossOriginIframeMirror(genId); - this.crossOriginIframeRootIdMap = /* @__PURE__ */ new WeakMap(); - this.mutationCb = options4.mutationCb; - this.wrappedEmit = options4.wrappedEmit; - this.stylesheetManager = options4.stylesheetManager; - this.recordCrossOriginIframes = options4.recordCrossOriginIframes; - this.crossOriginIframeStyleMirror = new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)); - this.mirror = options4.mirror; - if (this.recordCrossOriginIframes) { - window.addEventListener("message", this.handleMessage.bind(this)); - } - } - addIframe(iframeEl) { - this.iframes.set(iframeEl, true); - if (iframeEl.contentWindow) - this.crossOriginIframeMap.set(iframeEl.contentWindow, iframeEl); - } - addLoadListener(cb) { - this.loadListener = cb; - } - attachIframe(iframeEl, childSn) { - this.mutationCb({ - adds: [ - { - parentId: this.mirror.getId(iframeEl), - nextId: null, - node: childSn - } - ], - removes: [], - texts: [], - attributes: [], - isAttachIframe: true - }); - _optionalChain$1([this, "access", (_2) => _2.loadListener, "optionalCall", (_2) => _2(iframeEl)]); - const iframeDoc = getIFrameContentDocument(iframeEl); - if (iframeDoc && iframeDoc.adoptedStyleSheets && iframeDoc.adoptedStyleSheets.length > 0) - this.stylesheetManager.adoptStyleSheets(iframeDoc.adoptedStyleSheets, this.mirror.getId(iframeDoc)); - } - handleMessage(message3) { - const crossOriginMessageEvent = message3; - if (crossOriginMessageEvent.data.type !== "rrweb" || crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin) - return; - const iframeSourceWindow = message3.source; - if (!iframeSourceWindow) - return; - const iframeEl = this.crossOriginIframeMap.get(message3.source); - if (!iframeEl) - return; - const transformedEvent = this.transformCrossOriginEvent(iframeEl, crossOriginMessageEvent.data.event); - if (transformedEvent) - this.wrappedEmit(transformedEvent, crossOriginMessageEvent.data.isCheckout); - } - transformCrossOriginEvent(iframeEl, e2) { - switch (e2.type) { - case EventType.FullSnapshot: { - this.crossOriginIframeMirror.reset(iframeEl); - this.crossOriginIframeStyleMirror.reset(iframeEl); - this.replaceIdOnNode(e2.data.node, iframeEl); - const rootId = e2.data.node.id; - this.crossOriginIframeRootIdMap.set(iframeEl, rootId); - this.patchRootIdOnNode(e2.data.node, rootId); - return { - timestamp: e2.timestamp, - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.Mutation, - adds: [ - { - parentId: this.mirror.getId(iframeEl), - nextId: null, - node: e2.data.node - } - ], - removes: [], - texts: [], - attributes: [], - isAttachIframe: true - } - }; - } - case EventType.Meta: - case EventType.Load: - case EventType.DomContentLoaded: { - return false; - } - case EventType.Plugin: { - return e2; - } - case EventType.Custom: { - this.replaceIds(e2.data.payload, iframeEl, ["id", "parentId", "previousId", "nextId"]); - return e2; - } - case EventType.IncrementalSnapshot: { - switch (e2.data.source) { - case IncrementalSource.Mutation: { - e2.data.adds.forEach((n2) => { - this.replaceIds(n2, iframeEl, [ - "parentId", - "nextId", - "previousId" - ]); - this.replaceIdOnNode(n2.node, iframeEl); - const rootId = this.crossOriginIframeRootIdMap.get(iframeEl); - rootId && this.patchRootIdOnNode(n2.node, rootId); - }); - e2.data.removes.forEach((n2) => { - this.replaceIds(n2, iframeEl, ["parentId", "id"]); - }); - e2.data.attributes.forEach((n2) => { - this.replaceIds(n2, iframeEl, ["id"]); - }); - e2.data.texts.forEach((n2) => { - this.replaceIds(n2, iframeEl, ["id"]); - }); - return e2; - } - case IncrementalSource.Drag: - case IncrementalSource.TouchMove: - case IncrementalSource.MouseMove: { - e2.data.positions.forEach((p2) => { - this.replaceIds(p2, iframeEl, ["id"]); - }); - return e2; - } - case IncrementalSource.ViewportResize: { - return false; - } - case IncrementalSource.MediaInteraction: - case IncrementalSource.MouseInteraction: - case IncrementalSource.Scroll: - case IncrementalSource.CanvasMutation: - case IncrementalSource.Input: { - this.replaceIds(e2.data, iframeEl, ["id"]); - return e2; - } - case IncrementalSource.StyleSheetRule: - case IncrementalSource.StyleDeclaration: { - this.replaceIds(e2.data, iframeEl, ["id"]); - this.replaceStyleIds(e2.data, iframeEl, ["styleId"]); - return e2; - } - case IncrementalSource.Font: { - return e2; - } - case IncrementalSource.Selection: { - e2.data.ranges.forEach((range2) => { - this.replaceIds(range2, iframeEl, ["start", "end"]); - }); - return e2; - } - case IncrementalSource.AdoptedStyleSheet: { - this.replaceIds(e2.data, iframeEl, ["id"]); - this.replaceStyleIds(e2.data, iframeEl, ["styleIds"]); - _optionalChain$1([e2, "access", (_3) => _3.data, "access", (_4) => _4.styles, "optionalAccess", (_5) => _5.forEach, "call", (_6) => _6((style2) => { - this.replaceStyleIds(style2, iframeEl, ["styleId"]); - })]); - return e2; - } - } - } - } - return false; - } - replace(iframeMirror, obj, iframeEl, keys2) { - for (const key of keys2) { - if (!Array.isArray(obj[key]) && typeof obj[key] !== "number") - continue; - if (Array.isArray(obj[key])) { - obj[key] = iframeMirror.getIds(iframeEl, obj[key]); - } else { - obj[key] = iframeMirror.getId(iframeEl, obj[key]); - } - } - return obj; - } - replaceIds(obj, iframeEl, keys2) { - return this.replace(this.crossOriginIframeMirror, obj, iframeEl, keys2); - } - replaceStyleIds(obj, iframeEl, keys2) { - return this.replace(this.crossOriginIframeStyleMirror, obj, iframeEl, keys2); - } - replaceIdOnNode(node3, iframeEl) { - this.replaceIds(node3, iframeEl, ["id", "rootId"]); - if ("childNodes" in node3) { - node3.childNodes.forEach((child) => { - this.replaceIdOnNode(child, iframeEl); - }); - } - } - patchRootIdOnNode(node3, rootId) { - if (node3.type !== NodeType$3.Document && !node3.rootId) - node3.rootId = rootId; - if ("childNodes" in node3) { - node3.childNodes.forEach((child) => { - this.patchRootIdOnNode(child, rootId); - }); - } - } -} -class ShadowDomManagerNoop { - static { - __name(this, "ShadowDomManagerNoop"); - } - init() { - } - addShadowRoot() { - } - observeAttachShadow() { - } - reset() { - } -} -class ShadowDomManager { - static { - __name(this, "ShadowDomManager"); - } - constructor(options4) { - this.shadowDoms = /* @__PURE__ */ new WeakSet(); - this.restoreHandlers = []; - this.mutationCb = options4.mutationCb; - this.scrollCb = options4.scrollCb; - this.bypassOptions = options4.bypassOptions; - this.mirror = options4.mirror; - this.init(); - } - init() { - this.reset(); - this.patchAttachShadow(Element, document); - } - addShadowRoot(shadowRoot, doc2) { - if (!isNativeShadowDom(shadowRoot)) - return; - if (this.shadowDoms.has(shadowRoot)) - return; - this.shadowDoms.add(shadowRoot); - this.bypassOptions.canvasManager.addShadowRoot(shadowRoot); - const observer = initMutationObserver({ - ...this.bypassOptions, - doc: doc2, - mutationCb: this.mutationCb, - mirror: this.mirror, - shadowDomManager: this - }, shadowRoot); - this.restoreHandlers.push(() => observer.disconnect()); - this.restoreHandlers.push(initScrollObserver({ - ...this.bypassOptions, - scrollCb: this.scrollCb, - doc: shadowRoot, - mirror: this.mirror - })); - setTimeout$1$1(() => { - if (shadowRoot.adoptedStyleSheets && shadowRoot.adoptedStyleSheets.length > 0) - this.bypassOptions.stylesheetManager.adoptStyleSheets(shadowRoot.adoptedStyleSheets, this.mirror.getId(shadowRoot.host)); - this.restoreHandlers.push(initAdoptedStyleSheetObserver({ - mirror: this.mirror, - stylesheetManager: this.bypassOptions.stylesheetManager - }, shadowRoot)); - }, 0); - } - observeAttachShadow(iframeElement) { - const iframeDoc = getIFrameContentDocument(iframeElement); - const iframeWindow = getIFrameContentWindow(iframeElement); - if (!iframeDoc || !iframeWindow) - return; - this.patchAttachShadow(iframeWindow.Element, iframeDoc); - } - patchAttachShadow(element, doc2) { - const manager = this; - this.restoreHandlers.push(patch$2(element.prototype, "attachShadow", function(original) { - return function(option3) { - const shadowRoot = original.call(this, option3); - if (this.shadowRoot && inDom(this)) - manager.addShadowRoot(this.shadowRoot, doc2); - return shadowRoot; - }; - })); - } - reset() { - this.restoreHandlers.forEach((handler10) => { - try { - handler10(); - } catch (e2) { - } - }); - this.restoreHandlers = []; - this.shadowDoms = /* @__PURE__ */ new WeakSet(); - this.bypassOptions.canvasManager.resetShadowRoots(); - } -} -class CanvasManagerNoop { - static { - __name(this, "CanvasManagerNoop"); - } - reset() { - } - freeze() { - } - unfreeze() { - } - lock() { - } - unlock() { - } - snapshot() { - } - addWindow() { - } - addShadowRoot() { - } - resetShadowRoots() { - } -} -class StylesheetManager { - static { - __name(this, "StylesheetManager"); - } - constructor(options4) { - this.trackedLinkElements = /* @__PURE__ */ new WeakSet(); - this.styleMirror = new StyleSheetMirror(); - this.mutationCb = options4.mutationCb; - this.adoptedStyleSheetCb = options4.adoptedStyleSheetCb; - } - attachLinkElement(linkEl, childSn) { - if ("_cssText" in childSn.attributes) - this.mutationCb({ - adds: [], - removes: [], - texts: [], - attributes: [ - { - id: childSn.id, - attributes: childSn.attributes - } - ] - }); - this.trackLinkElement(linkEl); - } - trackLinkElement(linkEl) { - if (this.trackedLinkElements.has(linkEl)) - return; - this.trackedLinkElements.add(linkEl); - this.trackStylesheetInLinkElement(linkEl); - } - adoptStyleSheets(sheets, hostId) { - if (sheets.length === 0) - return; - const adoptedStyleSheetData = { - id: hostId, - styleIds: [] - }; - const styles = []; - for (const sheet of sheets) { - let styleId; - if (!this.styleMirror.has(sheet)) { - styleId = this.styleMirror.add(sheet); - styles.push({ - styleId, - rules: Array.from(sheet.rules || CSSRule, (r2, index2) => ({ - rule: stringifyRule(r2), - index: index2 - })) - }); - } else - styleId = this.styleMirror.getId(sheet); - adoptedStyleSheetData.styleIds.push(styleId); - } - if (styles.length > 0) - adoptedStyleSheetData.styles = styles; - this.adoptedStyleSheetCb(adoptedStyleSheetData); - } - reset() { - this.styleMirror.reset(); - this.trackedLinkElements = /* @__PURE__ */ new WeakSet(); - } - trackStylesheetInLinkElement(linkEl) { - } -} -class ProcessedNodeManager { - static { - __name(this, "ProcessedNodeManager"); - } - constructor() { - this.nodeMap = /* @__PURE__ */ new WeakMap(); - this.active = false; - } - inOtherBuffer(node3, thisBuffer) { - const buffers = this.nodeMap.get(node3); - return buffers && Array.from(buffers).some((buffer2) => buffer2 !== thisBuffer); - } - add(node3, buffer2) { - if (!this.active) { - this.active = true; - onRequestAnimationFrame$1(() => { - this.nodeMap = /* @__PURE__ */ new WeakMap(); - this.active = false; - }); - } - this.nodeMap.set(node3, (this.nodeMap.get(node3) || /* @__PURE__ */ new Set()).add(buffer2)); - } - destroy() { - } -} -let wrappedEmit; -let _takeFullSnapshot; -try { - if (Array.from([1], (x2) => x2 * 2)[0] !== 2) { - const cleanFrame = document.createElement("iframe"); - document.body.appendChild(cleanFrame); - Array.from = _optionalChain([cleanFrame, "access", (_2) => _2.contentWindow, "optionalAccess", (_2) => _2.Array, "access", (_3) => _3.from]) || Array.from; - document.body.removeChild(cleanFrame); - } -} catch (err) { - console.debug("Unable to override Array.from", err); -} -const mirror = createMirror(); -function record(options4 = {}) { - const { emit: emit2, checkoutEveryNms, checkoutEveryNth, blockClass = "rr-block", blockSelector = null, unblockSelector = null, ignoreClass = "rr-ignore", ignoreSelector = null, maskAllText = false, maskTextClass = "rr-mask", unmaskTextClass = null, maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskAttributeFn, maskInputFn, maskTextFn, maxCanvasSize = null, packFn, sampling = {}, dataURLOptions = {}, mousemoveWait, recordDOM = true, recordCanvas = false, recordCrossOriginIframes = false, recordAfter = options4.recordAfter === "DOMContentLoaded" ? options4.recordAfter : "load", userTriggeredOnInput = false, collectFonts = false, inlineImages = false, plugins, keepIframeSrcFn = /* @__PURE__ */ __name(() => false, "keepIframeSrcFn"), ignoreCSSAttributes = /* @__PURE__ */ new Set([]), errorHandler: errorHandler2, onMutation, getCanvasManager } = options4; - registerErrorHandler$1(errorHandler2); - const inEmittingFrame = recordCrossOriginIframes ? window.parent === window : true; - let passEmitsToParent = false; - if (!inEmittingFrame) { - try { - if (window.parent.document) { - passEmitsToParent = false; - } - } catch (e2) { - passEmitsToParent = true; - } - } - if (inEmittingFrame && !emit2) { - throw new Error("emit function is required"); - } - if (!inEmittingFrame && !passEmitsToParent) { - return () => { - }; - } - if (mousemoveWait !== void 0 && sampling.mousemove === void 0) { - sampling.mousemove = mousemoveWait; - } - mirror.reset(); - const maskInputOptions = maskAllInputs === true ? { - color: true, - date: true, - "datetime-local": true, - email: true, - month: true, - number: true, - range: true, - search: true, - tel: true, - text: true, - time: true, - url: true, - week: true, - textarea: true, - select: true, - radio: true, - checkbox: true - } : _maskInputOptions !== void 0 ? _maskInputOptions : {}; - const slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === "all" ? { - script: true, - comment: true, - headFavicon: true, - headWhitespace: true, - headMetaSocial: true, - headMetaRobots: true, - headMetaHttpEquiv: true, - headMetaVerification: true, - headMetaAuthorship: _slimDOMOptions === "all", - headMetaDescKeywords: _slimDOMOptions === "all" - } : _slimDOMOptions ? _slimDOMOptions : {}; - polyfill(); - let lastFullSnapshotEvent; - let incrementalSnapshotCount = 0; - const eventProcessor = /* @__PURE__ */ __name((e2) => { - for (const plugin of plugins || []) { - if (plugin.eventProcessor) { - e2 = plugin.eventProcessor(e2); - } - } - if (packFn && !passEmitsToParent) { - e2 = packFn(e2); - } - return e2; - }, "eventProcessor"); - wrappedEmit = /* @__PURE__ */ __name((r2, isCheckout) => { - const e2 = r2; - e2.timestamp = nowTimestamp(); - if (_optionalChain([mutationBuffers, "access", (_4) => _4[0], "optionalAccess", (_5) => _5.isFrozen, "call", (_6) => _6()]) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) { - mutationBuffers.forEach((buf) => buf.unfreeze()); - } - if (inEmittingFrame) { - _optionalChain([emit2, "optionalCall", (_7) => _7(eventProcessor(e2), isCheckout)]); - } else if (passEmitsToParent) { - const message3 = { - type: "rrweb", - event: eventProcessor(e2), - origin: window.location.origin, - isCheckout - }; - window.parent.postMessage(message3, "*"); - } - if (e2.type === EventType.FullSnapshot) { - lastFullSnapshotEvent = e2; - incrementalSnapshotCount = 0; - } else if (e2.type === EventType.IncrementalSnapshot) { - if (e2.data.source === IncrementalSource.Mutation && e2.data.isAttachIframe) { - return; - } - incrementalSnapshotCount++; - const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth; - const exceedTime = checkoutEveryNms && lastFullSnapshotEvent && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms; - if (exceedCount || exceedTime) { - takeFullSnapshot2(true); - } - } - }, "wrappedEmit"); - const wrappedMutationEmit = /* @__PURE__ */ __name((m2) => { - wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.Mutation, - ...m2 - } - }); - }, "wrappedMutationEmit"); - const wrappedScrollEmit = /* @__PURE__ */ __name((p2) => wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.Scroll, - ...p2 - } - }), "wrappedScrollEmit"); - const wrappedCanvasMutationEmit = /* @__PURE__ */ __name((p2) => wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.CanvasMutation, - ...p2 - } - }), "wrappedCanvasMutationEmit"); - const wrappedAdoptedStyleSheetEmit = /* @__PURE__ */ __name((a2) => wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.AdoptedStyleSheet, - ...a2 - } - }), "wrappedAdoptedStyleSheetEmit"); - const stylesheetManager = new StylesheetManager({ - mutationCb: wrappedMutationEmit, - adoptedStyleSheetCb: wrappedAdoptedStyleSheetEmit - }); - const iframeManager = typeof __RRWEB_EXCLUDE_IFRAME__ === "boolean" && __RRWEB_EXCLUDE_IFRAME__ ? new IframeManagerNoop() : new IframeManager({ - mirror, - mutationCb: wrappedMutationEmit, - stylesheetManager, - recordCrossOriginIframes, - wrappedEmit - }); - for (const plugin of plugins || []) { - if (plugin.getMirror) - plugin.getMirror({ - nodeMirror: mirror, - crossOriginIframeMirror: iframeManager.crossOriginIframeMirror, - crossOriginIframeStyleMirror: iframeManager.crossOriginIframeStyleMirror - }); - } - const processedNodeManager = new ProcessedNodeManager(); - const canvasManager = _getCanvasManager(getCanvasManager, { - mirror, - win: window, - mutationCb: /* @__PURE__ */ __name((p2) => wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.CanvasMutation, - ...p2 - } - }), "mutationCb"), - recordCanvas, - blockClass, - blockSelector, - unblockSelector, - maxCanvasSize, - sampling: sampling["canvas"], - dataURLOptions, - errorHandler: errorHandler2 - }); - const shadowDomManager = typeof __RRWEB_EXCLUDE_SHADOW_DOM__ === "boolean" && __RRWEB_EXCLUDE_SHADOW_DOM__ ? new ShadowDomManagerNoop() : new ShadowDomManager({ - mutationCb: wrappedMutationEmit, - scrollCb: wrappedScrollEmit, - bypassOptions: { - onMutation, - blockClass, - blockSelector, - unblockSelector, - maskAllText, - maskTextClass, - unmaskTextClass, - maskTextSelector, - unmaskTextSelector, - inlineStylesheet, - maskInputOptions, - dataURLOptions, - maskAttributeFn, - maskTextFn, - maskInputFn, - recordCanvas, - inlineImages, - sampling, - slimDOMOptions, - iframeManager, - stylesheetManager, - canvasManager, - keepIframeSrcFn, - processedNodeManager - }, - mirror - }); - const takeFullSnapshot2 = /* @__PURE__ */ __name((isCheckout = false) => { - if (!recordDOM) { - return; - } - wrappedEmit({ - type: EventType.Meta, - data: { - href: window.location.href, - width: getWindowWidth(), - height: getWindowHeight() - } - }, isCheckout); - stylesheetManager.reset(); - shadowDomManager.init(); - mutationBuffers.forEach((buf) => buf.lock()); - const node3 = snapshot(document, { - mirror, - blockClass, - blockSelector, - unblockSelector, - maskAllText, - maskTextClass, - unmaskTextClass, - maskTextSelector, - unmaskTextSelector, - inlineStylesheet, - maskAllInputs: maskInputOptions, - maskAttributeFn, - maskInputFn, - maskTextFn, - slimDOM: slimDOMOptions, - dataURLOptions, - recordCanvas, - inlineImages, - onSerialize: /* @__PURE__ */ __name((n2) => { - if (isSerializedIframe(n2, mirror)) { - iframeManager.addIframe(n2); - } - if (isSerializedStylesheet(n2, mirror)) { - stylesheetManager.trackLinkElement(n2); - } - if (hasShadowRoot(n2)) { - shadowDomManager.addShadowRoot(n2.shadowRoot, document); - } - }, "onSerialize"), - onIframeLoad: /* @__PURE__ */ __name((iframe, childSn) => { - iframeManager.attachIframe(iframe, childSn); - if (iframe.contentWindow) { - canvasManager.addWindow(iframe.contentWindow); - } - shadowDomManager.observeAttachShadow(iframe); - }, "onIframeLoad"), - onStylesheetLoad: /* @__PURE__ */ __name((linkEl, childSn) => { - stylesheetManager.attachLinkElement(linkEl, childSn); - }, "onStylesheetLoad"), - keepIframeSrcFn - }); - if (!node3) { - return console.warn("Failed to snapshot the document"); - } - wrappedEmit({ - type: EventType.FullSnapshot, - data: { - node: node3, - initialOffset: getWindowScroll(window) - } - }); - mutationBuffers.forEach((buf) => buf.unlock()); - if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0) - stylesheetManager.adoptStyleSheets(document.adoptedStyleSheets, mirror.getId(document)); - }, "takeFullSnapshot"); - _takeFullSnapshot = takeFullSnapshot2; - try { - const handlers2 = []; - const observe2 = /* @__PURE__ */ __name((doc2) => { - return callbackWrapper$1(initObservers)({ - onMutation, - mutationCb: wrappedMutationEmit, - mousemoveCb: /* @__PURE__ */ __name((positions, source) => wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source, - positions - } - }), "mousemoveCb"), - mouseInteractionCb: /* @__PURE__ */ __name((d2) => wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.MouseInteraction, - ...d2 - } - }), "mouseInteractionCb"), - scrollCb: wrappedScrollEmit, - viewportResizeCb: /* @__PURE__ */ __name((d2) => wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.ViewportResize, - ...d2 - } - }), "viewportResizeCb"), - inputCb: /* @__PURE__ */ __name((v2) => wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.Input, - ...v2 - } - }), "inputCb"), - mediaInteractionCb: /* @__PURE__ */ __name((p2) => wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.MediaInteraction, - ...p2 - } - }), "mediaInteractionCb"), - styleSheetRuleCb: /* @__PURE__ */ __name((r2) => wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.StyleSheetRule, - ...r2 - } - }), "styleSheetRuleCb"), - styleDeclarationCb: /* @__PURE__ */ __name((r2) => wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.StyleDeclaration, - ...r2 - } - }), "styleDeclarationCb"), - canvasMutationCb: wrappedCanvasMutationEmit, - fontCb: /* @__PURE__ */ __name((p2) => wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.Font, - ...p2 - } - }), "fontCb"), - selectionCb: /* @__PURE__ */ __name((p2) => { - wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.Selection, - ...p2 - } - }); - }, "selectionCb"), - customElementCb: /* @__PURE__ */ __name((c2) => { - wrappedEmit({ - type: EventType.IncrementalSnapshot, - data: { - source: IncrementalSource.CustomElement, - ...c2 - } - }); - }, "customElementCb"), - blockClass, - ignoreClass, - ignoreSelector, - maskAllText, - maskTextClass, - unmaskTextClass, - maskTextSelector, - unmaskTextSelector, - maskInputOptions, - inlineStylesheet, - sampling, - recordDOM, - recordCanvas, - inlineImages, - userTriggeredOnInput, - collectFonts, - doc: doc2, - maskAttributeFn, - maskInputFn, - maskTextFn, - keepIframeSrcFn, - blockSelector, - unblockSelector, - slimDOMOptions, - dataURLOptions, - mirror, - iframeManager, - stylesheetManager, - shadowDomManager, - processedNodeManager, - canvasManager, - ignoreCSSAttributes, - plugins: _optionalChain([ - plugins, - "optionalAccess", - (_8) => _8.filter, - "call", - (_9) => _9((p2) => p2.observer), - "optionalAccess", - (_10) => _10.map, - "call", - (_11) => _11((p2) => ({ - observer: p2.observer, - options: p2.options, - callback: /* @__PURE__ */ __name((payload) => wrappedEmit({ - type: EventType.Plugin, - data: { - plugin: p2.name, - payload - } - }), "callback") - })) - ]) || [] - }, {}); - }, "observe"); - iframeManager.addLoadListener((iframeEl) => { - try { - handlers2.push(observe2(iframeEl.contentDocument)); - } catch (error2) { - console.warn(error2); - } - }); - const init3 = /* @__PURE__ */ __name(() => { - takeFullSnapshot2(); - handlers2.push(observe2(document)); - }, "init"); - if (document.readyState === "interactive" || document.readyState === "complete") { - init3(); - } else { - handlers2.push(on("DOMContentLoaded", () => { - wrappedEmit({ - type: EventType.DomContentLoaded, - data: {} - }); - if (recordAfter === "DOMContentLoaded") - init3(); - })); - handlers2.push(on("load", () => { - wrappedEmit({ - type: EventType.Load, - data: {} - }); - if (recordAfter === "load") - init3(); - }, window)); - } - return () => { - handlers2.forEach((h2) => h2()); - processedNodeManager.destroy(); - _takeFullSnapshot = void 0; - unregisterErrorHandler(); - }; - } catch (error2) { - console.warn(error2); - } -} -__name(record, "record"); -function takeFullSnapshot(isCheckout) { - if (!_takeFullSnapshot) { - throw new Error("please take full snapshot after start recording"); - } - _takeFullSnapshot(isCheckout); -} -__name(takeFullSnapshot, "takeFullSnapshot"); -record.mirror = mirror; -record.takeFullSnapshot = takeFullSnapshot; -function _getCanvasManager(getCanvasManagerFn, options4) { - try { - return getCanvasManagerFn ? getCanvasManagerFn(options4) : new CanvasManagerNoop(); - } catch (e2) { - console.warn("Unable to initialize CanvasManager"); - return new CanvasManagerNoop(); - } -} -__name(_getCanvasManager, "_getCanvasManager"); -const ReplayEventTypeIncrementalSnapshot = 3; -const ReplayEventTypeCustom = 5; -function timestampToMs(timestamp2) { - const isMs = timestamp2 > 9999999999; - return isMs ? timestamp2 : timestamp2 * 1e3; -} -__name(timestampToMs, "timestampToMs"); -function timestampToS(timestamp2) { - const isMs = timestamp2 > 9999999999; - return isMs ? timestamp2 / 1e3 : timestamp2; -} -__name(timestampToS, "timestampToS"); -function addBreadcrumbEvent(replay, breadcrumb) { - if (breadcrumb.category === "sentry.transaction") { - return; - } - if (["ui.click", "ui.input"].includes(breadcrumb.category)) { - replay.triggerUserActivity(); - } else { - replay.checkAndHandleExpiredSession(); - } - replay.addUpdate(() => { - replay.throttledAddEvent({ - type: EventType.Custom, - // TODO: We were converting from ms to seconds for breadcrumbs, spans, - // but maybe we should just keep them as milliseconds - timestamp: (breadcrumb.timestamp || 0) * 1e3, - data: { - tag: "breadcrumb", - // normalize to max. 10 depth and 1_000 properties per object - payload: normalize$3(breadcrumb, 10, 1e3) - } - }); - return breadcrumb.category === "console"; - }); -} -__name(addBreadcrumbEvent, "addBreadcrumbEvent"); -const INTERACTIVE_SELECTOR = "button,a"; -function getClosestInteractive(element) { - const closestInteractive = element.closest(INTERACTIVE_SELECTOR); - return closestInteractive || element; -} -__name(getClosestInteractive, "getClosestInteractive"); -function getClickTargetNode(event) { - const target2 = getTargetNode(event); - if (!target2 || !(target2 instanceof Element)) { - return target2; - } - return getClosestInteractive(target2); -} -__name(getClickTargetNode, "getClickTargetNode"); -function getTargetNode(event) { - if (isEventWithTarget(event)) { - return event.target; - } - return event; -} -__name(getTargetNode, "getTargetNode"); -function isEventWithTarget(event) { - return typeof event === "object" && !!event && "target" in event; -} -__name(isEventWithTarget, "isEventWithTarget"); -let handlers$2; -function onWindowOpen(cb) { - if (!handlers$2) { - handlers$2 = []; - monkeyPatchWindowOpen(); - } - handlers$2.push(cb); - return () => { - const pos = handlers$2 ? handlers$2.indexOf(cb) : -1; - if (pos > -1) { - handlers$2.splice(pos, 1); - } - }; -} -__name(onWindowOpen, "onWindowOpen"); -function monkeyPatchWindowOpen() { - fill(WINDOW$1, "open", function(originalWindowOpen) { - return function(...args) { - if (handlers$2) { - try { - handlers$2.forEach((handler10) => handler10()); - } catch (e2) { - } - } - return originalWindowOpen.apply(WINDOW$1, args); - }; - }); -} -__name(monkeyPatchWindowOpen, "monkeyPatchWindowOpen"); -const IncrementalMutationSources = /* @__PURE__ */ new Set([ - IncrementalSource.Mutation, - IncrementalSource.StyleSheetRule, - IncrementalSource.StyleDeclaration, - IncrementalSource.AdoptedStyleSheet, - IncrementalSource.CanvasMutation, - IncrementalSource.Selection, - IncrementalSource.MediaInteraction -]); -function handleClick$1(clickDetector, clickBreadcrumb, node3) { - clickDetector.handleClick(clickBreadcrumb, node3); -} -__name(handleClick$1, "handleClick$1"); -class ClickDetector { - static { - __name(this, "ClickDetector"); - } - // protected for testing - constructor(replay, slowClickConfig, _addBreadcrumbEvent = addBreadcrumbEvent) { - this._lastMutation = 0; - this._lastScroll = 0; - this._clicks = []; - this._timeout = slowClickConfig.timeout / 1e3; - this._threshold = slowClickConfig.threshold / 1e3; - this._scrollTimeout = slowClickConfig.scrollTimeout / 1e3; - this._replay = replay; - this._ignoreSelector = slowClickConfig.ignoreSelector; - this._addBreadcrumbEvent = _addBreadcrumbEvent; - } - /** Register click detection handlers on mutation or scroll. */ - addListeners() { - const cleanupWindowOpen = onWindowOpen(() => { - this._lastMutation = nowInSeconds(); - }); - this._teardown = () => { - cleanupWindowOpen(); - this._clicks = []; - this._lastMutation = 0; - this._lastScroll = 0; - }; - } - /** Clean up listeners. */ - removeListeners() { - if (this._teardown) { - this._teardown(); - } - if (this._checkClickTimeout) { - clearTimeout(this._checkClickTimeout); - } - } - /** @inheritDoc */ - handleClick(breadcrumb, node3) { - if (ignoreElement(node3, this._ignoreSelector) || !isClickBreadcrumb(breadcrumb)) { - return; - } - const newClick = { - timestamp: timestampToS(breadcrumb.timestamp), - clickBreadcrumb: breadcrumb, - // Set this to 0 so we know it originates from the click breadcrumb - clickCount: 0, - node: node3 - }; - if (this._clicks.some((click2) => click2.node === newClick.node && Math.abs(click2.timestamp - newClick.timestamp) < 1)) { - return; - } - this._clicks.push(newClick); - if (this._clicks.length === 1) { - this._scheduleCheckClicks(); - } - } - /** @inheritDoc */ - registerMutation(timestamp2 = Date.now()) { - this._lastMutation = timestampToS(timestamp2); - } - /** @inheritDoc */ - registerScroll(timestamp2 = Date.now()) { - this._lastScroll = timestampToS(timestamp2); - } - /** @inheritDoc */ - registerClick(element) { - const node3 = getClosestInteractive(element); - this._handleMultiClick(node3); - } - /** Count multiple clicks on elements. */ - _handleMultiClick(node3) { - this._getClicks(node3).forEach((click2) => { - click2.clickCount++; - }); - } - /** Get all pending clicks for a given node. */ - _getClicks(node3) { - return this._clicks.filter((click2) => click2.node === node3); - } - /** Check the clicks that happened. */ - _checkClicks() { - const timedOutClicks = []; - const now2 = nowInSeconds(); - this._clicks.forEach((click2) => { - if (!click2.mutationAfter && this._lastMutation) { - click2.mutationAfter = click2.timestamp <= this._lastMutation ? this._lastMutation - click2.timestamp : void 0; - } - if (!click2.scrollAfter && this._lastScroll) { - click2.scrollAfter = click2.timestamp <= this._lastScroll ? this._lastScroll - click2.timestamp : void 0; - } - if (click2.timestamp + this._timeout <= now2) { - timedOutClicks.push(click2); - } - }); - for (const click2 of timedOutClicks) { - const pos = this._clicks.indexOf(click2); - if (pos > -1) { - this._generateBreadcrumbs(click2); - this._clicks.splice(pos, 1); - } - } - if (this._clicks.length) { - this._scheduleCheckClicks(); - } - } - /** Generate matching breadcrumb(s) for the click. */ - _generateBreadcrumbs(click2) { - const replay = this._replay; - const hadScroll = click2.scrollAfter && click2.scrollAfter <= this._scrollTimeout; - const hadMutation = click2.mutationAfter && click2.mutationAfter <= this._threshold; - const isSlowClick = !hadScroll && !hadMutation; - const { clickCount, clickBreadcrumb } = click2; - if (isSlowClick) { - const timeAfterClickMs = Math.min(click2.mutationAfter || this._timeout, this._timeout) * 1e3; - const endReason = timeAfterClickMs < this._timeout * 1e3 ? "mutation" : "timeout"; - const breadcrumb = { - type: "default", - message: clickBreadcrumb.message, - timestamp: clickBreadcrumb.timestamp, - category: "ui.slowClickDetected", - data: { - ...clickBreadcrumb.data, - url: WINDOW$1.location.href, - route: replay.getCurrentRoute(), - timeAfterClickMs, - endReason, - // If clickCount === 0, it means multiClick was not correctly captured here - // - we still want to send 1 in this case - clickCount: clickCount || 1 - } - }; - this._addBreadcrumbEvent(replay, breadcrumb); - return; - } - if (clickCount > 1) { - const breadcrumb = { - type: "default", - message: clickBreadcrumb.message, - timestamp: clickBreadcrumb.timestamp, - category: "ui.multiClick", - data: { - ...clickBreadcrumb.data, - url: WINDOW$1.location.href, - route: replay.getCurrentRoute(), - clickCount, - metric: true - } - }; - this._addBreadcrumbEvent(replay, breadcrumb); - } - } - /** Schedule to check current clicks. */ - _scheduleCheckClicks() { - if (this._checkClickTimeout) { - clearTimeout(this._checkClickTimeout); - } - this._checkClickTimeout = setTimeout$3(() => this._checkClicks(), 1e3); - } -} -const SLOW_CLICK_TAGS = ["A", "BUTTON", "INPUT"]; -function ignoreElement(node3, ignoreSelector) { - if (!SLOW_CLICK_TAGS.includes(node3.tagName)) { - return true; - } - if (node3.tagName === "INPUT" && !["submit", "button"].includes(node3.getAttribute("type") || "")) { - return true; - } - if (node3.tagName === "A" && (node3.hasAttribute("download") || node3.hasAttribute("target") && node3.getAttribute("target") !== "_self")) { - return true; - } - if (ignoreSelector && node3.matches(ignoreSelector)) { - return true; - } - return false; -} -__name(ignoreElement, "ignoreElement"); -function isClickBreadcrumb(breadcrumb) { - return !!(breadcrumb.data && typeof breadcrumb.data.nodeId === "number" && breadcrumb.timestamp); -} -__name(isClickBreadcrumb, "isClickBreadcrumb"); -function nowInSeconds() { - return Date.now() / 1e3; -} -__name(nowInSeconds, "nowInSeconds"); -function updateClickDetectorForRecordingEvent(clickDetector, event) { - try { - if (!isIncrementalEvent(event)) { - return; - } - const { source } = event.data; - if (IncrementalMutationSources.has(source)) { - clickDetector.registerMutation(event.timestamp); - } - if (source === IncrementalSource.Scroll) { - clickDetector.registerScroll(event.timestamp); - } - if (isIncrementalMouseInteraction(event)) { - const { type, id: id3 } = event.data; - const node3 = record.mirror.getNode(id3); - if (node3 instanceof HTMLElement && type === MouseInteractions.Click) { - clickDetector.registerClick(node3); - } - } - } catch (e2) { - } -} -__name(updateClickDetectorForRecordingEvent, "updateClickDetectorForRecordingEvent"); -function isIncrementalEvent(event) { - return event.type === ReplayEventTypeIncrementalSnapshot; -} -__name(isIncrementalEvent, "isIncrementalEvent"); -function isIncrementalMouseInteraction(event) { - return event.data.source === IncrementalSource.MouseInteraction; -} -__name(isIncrementalMouseInteraction, "isIncrementalMouseInteraction"); -function createBreadcrumb(breadcrumb) { - return { - timestamp: Date.now() / 1e3, - type: "default", - ...breadcrumb - }; -} -__name(createBreadcrumb, "createBreadcrumb"); -var NodeType$4; -(function(NodeType3) { - NodeType3[NodeType3["Document"] = 0] = "Document"; - NodeType3[NodeType3["DocumentType"] = 1] = "DocumentType"; - NodeType3[NodeType3["Element"] = 2] = "Element"; - NodeType3[NodeType3["Text"] = 3] = "Text"; - NodeType3[NodeType3["CDATA"] = 4] = "CDATA"; - NodeType3[NodeType3["Comment"] = 5] = "Comment"; -})(NodeType$4 || (NodeType$4 = {})); -const ATTRIBUTES_TO_RECORD = /* @__PURE__ */ new Set([ - "id", - "class", - "aria-label", - "role", - "name", - "alt", - "title", - "data-test-id", - "data-testid", - "disabled", - "aria-disabled", - "data-sentry-component" -]); -function getAttributesToRecord(attributes) { - const obj = {}; - if (!attributes["data-sentry-component"] && attributes["data-sentry-element"]) { - attributes["data-sentry-component"] = attributes["data-sentry-element"]; - } - for (const key in attributes) { - if (ATTRIBUTES_TO_RECORD.has(key)) { - let normalizedKey = key; - if (key === "data-testid" || key === "data-test-id") { - normalizedKey = "testId"; - } - obj[normalizedKey] = attributes[key]; - } - } - return obj; -} -__name(getAttributesToRecord, "getAttributesToRecord"); -const handleDomListener = /* @__PURE__ */ __name((replay) => { - return (handlerData) => { - if (!replay.isEnabled()) { - return; - } - const result = handleDom(handlerData); - if (!result) { - return; - } - const isClick = handlerData.name === "click"; - const event = isClick ? handlerData.event : void 0; - if (isClick && replay.clickDetector && event && event.target && !event.altKey && !event.metaKey && !event.ctrlKey && !event.shiftKey) { - handleClick$1( - replay.clickDetector, - result, - getClickTargetNode(handlerData.event) - ); - } - addBreadcrumbEvent(replay, result); - }; -}, "handleDomListener"); -function getBaseDomBreadcrumb(target2, message3) { - const nodeId = record.mirror.getId(target2); - const node3 = nodeId && record.mirror.getNode(nodeId); - const meta = node3 && record.mirror.getMeta(node3); - const element = meta && isElement$2(meta) ? meta : null; - return { - message: message3, - data: element ? { - nodeId, - node: { - id: nodeId, - tagName: element.tagName, - textContent: Array.from(element.childNodes).map((node4) => node4.type === NodeType$4.Text && node4.textContent).filter(Boolean).map((text2) => text2.trim()).join(""), - attributes: getAttributesToRecord(element.attributes) - } - } : {} - }; -} -__name(getBaseDomBreadcrumb, "getBaseDomBreadcrumb"); -function handleDom(handlerData) { - const { target: target2, message: message3 } = getDomTarget(handlerData); - return createBreadcrumb({ - category: `ui.${handlerData.name}`, - ...getBaseDomBreadcrumb(target2, message3) - }); -} -__name(handleDom, "handleDom"); -function getDomTarget(handlerData) { - const isClick = handlerData.name === "click"; - let message3; - let target2 = null; - try { - target2 = isClick ? getClickTargetNode(handlerData.event) : getTargetNode(handlerData.event); - message3 = htmlTreeAsString(target2, { maxStringLength: 200 }) || ""; - } catch (e2) { - message3 = ""; - } - return { target: target2, message: message3 }; -} -__name(getDomTarget, "getDomTarget"); -function isElement$2(node3) { - return node3.type === NodeType$4.Element; -} -__name(isElement$2, "isElement$2"); -function handleKeyboardEvent(replay, event) { - if (!replay.isEnabled()) { - return; - } - replay.updateUserActivity(); - const breadcrumb = getKeyboardBreadcrumb(event); - if (!breadcrumb) { - return; - } - addBreadcrumbEvent(replay, breadcrumb); -} -__name(handleKeyboardEvent, "handleKeyboardEvent"); -function getKeyboardBreadcrumb(event) { - const { metaKey, shiftKey, ctrlKey, altKey, key, target: target2 } = event; - if (!target2 || isInputElement(target2) || !key) { - return null; - } - const hasModifierKey = metaKey || ctrlKey || altKey; - const isCharacterKey = key.length === 1; - if (!hasModifierKey && isCharacterKey) { - return null; - } - const message3 = htmlTreeAsString(target2, { maxStringLength: 200 }) || ""; - const baseBreadcrumb = getBaseDomBreadcrumb(target2, message3); - return createBreadcrumb({ - category: "ui.keyDown", - message: message3, - data: { - ...baseBreadcrumb.data, - metaKey, - shiftKey, - ctrlKey, - altKey, - key - } - }); -} -__name(getKeyboardBreadcrumb, "getKeyboardBreadcrumb"); -function isInputElement(target2) { - return target2.tagName === "INPUT" || target2.tagName === "TEXTAREA" || target2.isContentEditable; -} -__name(isInputElement, "isInputElement"); -const ENTRY_TYPES = { - // @ts-expect-error TODO: entry type does not fit the create* functions entry type - resource: createResourceEntry, - paint: createPaintEntry, - // @ts-expect-error TODO: entry type does not fit the create* functions entry type - navigation: createNavigationEntry -}; -function webVitalHandler(getter, replay) { - return ({ metric }) => void replay.replayPerformanceEntries.push(getter(metric)); -} -__name(webVitalHandler, "webVitalHandler"); -function createPerformanceEntries(entries) { - return entries.map(createPerformanceEntry).filter(Boolean); -} -__name(createPerformanceEntries, "createPerformanceEntries"); -function createPerformanceEntry(entry) { - const entryType = ENTRY_TYPES[entry.entryType]; - if (!entryType) { - return null; - } - return entryType(entry); -} -__name(createPerformanceEntry, "createPerformanceEntry"); -function getAbsoluteTime$1(time) { - return ((browserPerformanceTimeOrigin || WINDOW$1.performance.timeOrigin) + time) / 1e3; -} -__name(getAbsoluteTime$1, "getAbsoluteTime$1"); -function createPaintEntry(entry) { - const { duration, entryType, name: name2, startTime } = entry; - const start2 = getAbsoluteTime$1(startTime); - return { - type: entryType, - name: name2, - start: start2, - end: start2 + duration, - data: void 0 - }; -} -__name(createPaintEntry, "createPaintEntry"); -function createNavigationEntry(entry) { - const { - entryType, - name: name2, - decodedBodySize, - duration, - domComplete, - encodedBodySize, - domContentLoadedEventStart, - domContentLoadedEventEnd, - domInteractive, - loadEventStart, - loadEventEnd, - redirectCount, - startTime, - transferSize, - type - } = entry; - if (duration === 0) { - return null; - } - return { - type: `${entryType}.${type}`, - start: getAbsoluteTime$1(startTime), - end: getAbsoluteTime$1(domComplete), - name: name2, - data: { - size: transferSize, - decodedBodySize, - encodedBodySize, - duration, - domInteractive, - domContentLoadedEventStart, - domContentLoadedEventEnd, - loadEventStart, - loadEventEnd, - domComplete, - redirectCount - } - }; -} -__name(createNavigationEntry, "createNavigationEntry"); -function createResourceEntry(entry) { - const { - entryType, - initiatorType, - name: name2, - responseEnd, - startTime, - decodedBodySize, - encodedBodySize, - responseStatus, - transferSize - } = entry; - if (["fetch", "xmlhttprequest"].includes(initiatorType)) { - return null; - } - return { - type: `${entryType}.${initiatorType}`, - start: getAbsoluteTime$1(startTime), - end: getAbsoluteTime$1(responseEnd), - name: name2, - data: { - size: transferSize, - statusCode: responseStatus, - decodedBodySize, - encodedBodySize - } - }; -} -__name(createResourceEntry, "createResourceEntry"); -function getLargestContentfulPaint(metric) { - const lastEntry = metric.entries[metric.entries.length - 1]; - const node3 = lastEntry && lastEntry.element ? [lastEntry.element] : void 0; - return getWebVital(metric, "largest-contentful-paint", node3); -} -__name(getLargestContentfulPaint, "getLargestContentfulPaint"); -function isLayoutShift(entry) { - return entry.sources !== void 0; -} -__name(isLayoutShift, "isLayoutShift"); -function getCumulativeLayoutShift(metric) { - const layoutShifts = []; - const nodes = []; - for (const entry of metric.entries) { - if (isLayoutShift(entry)) { - const nodeIds = []; - for (const source of entry.sources) { - if (source.node) { - nodes.push(source.node); - const nodeId = record.mirror.getId(source.node); - if (nodeId) { - nodeIds.push(nodeId); - } - } - } - layoutShifts.push({ value: entry.value, nodeIds: nodeIds.length ? nodeIds : void 0 }); - } - } - return getWebVital(metric, "cumulative-layout-shift", nodes, layoutShifts); -} -__name(getCumulativeLayoutShift, "getCumulativeLayoutShift"); -function getFirstInputDelay(metric) { - const lastEntry = metric.entries[metric.entries.length - 1]; - const node3 = lastEntry && lastEntry.target ? [lastEntry.target] : void 0; - return getWebVital(metric, "first-input-delay", node3); -} -__name(getFirstInputDelay, "getFirstInputDelay"); -function getInteractionToNextPaint(metric) { - const lastEntry = metric.entries[metric.entries.length - 1]; - const node3 = lastEntry && lastEntry.target ? [lastEntry.target] : void 0; - return getWebVital(metric, "interaction-to-next-paint", node3); -} -__name(getInteractionToNextPaint, "getInteractionToNextPaint"); -function getWebVital(metric, name2, nodes, attributions) { - const value4 = metric.value; - const rating = metric.rating; - const end = getAbsoluteTime$1(value4); - return { - type: "web-vital", - name: name2, - start: end, - end, - data: { - value: value4, - size: value4, - rating, - nodeIds: nodes ? nodes.map((node3) => record.mirror.getId(node3)) : void 0, - attributions - } - }; -} -__name(getWebVital, "getWebVital"); -function setupPerformanceObserver(replay) { - function addPerformanceEntry(entry) { - if (!replay.performanceEntries.includes(entry)) { - replay.performanceEntries.push(entry); - } - } - __name(addPerformanceEntry, "addPerformanceEntry"); - function onEntries({ entries }) { - entries.forEach(addPerformanceEntry); - } - __name(onEntries, "onEntries"); - const clearCallbacks = []; - ["navigation", "paint", "resource"].forEach((type) => { - clearCallbacks.push(addPerformanceInstrumentationHandler(type, onEntries)); - }); - clearCallbacks.push( - addLcpInstrumentationHandler(webVitalHandler(getLargestContentfulPaint, replay)), - addClsInstrumentationHandler(webVitalHandler(getCumulativeLayoutShift, replay)), - addFidInstrumentationHandler(webVitalHandler(getFirstInputDelay, replay)), - addInpInstrumentationHandler(webVitalHandler(getInteractionToNextPaint, replay)) - ); - return () => { - clearCallbacks.forEach((clearCallback) => clearCallback()); - }; -} -__name(setupPerformanceObserver, "setupPerformanceObserver"); -const DEBUG_BUILD$2 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; -const r$3 = `var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a>h]=l}else for(o=new n(i),a=0;a>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],a=0;ad&&(d=o[a].s);var g=new n(d+1),w=A(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<e))break;p+=m-(1<>=y;p>0;){var M=o[a].s;g[M]=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e>>8;t=r},d:function(){return~t}}},L=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},O=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=C[s-1],M=y>>13,E=8191&y,z=(1<7e3||q>24576)&&(N>423||!w)){p=U(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;Pnt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},j=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},q=function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&j(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}},B=function(t){return 10+(t.filename?t.filename.length+1:0)},G=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(O(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();var H=function(){function t(t,n){this.c=L(),this.v=1,G.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),G.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=O(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=L();i.p(n.dictionary),j(t,2,i.d())}}(r,this.o),this.v=0),n&&j(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),J="undefined"!=typeof TextEncoder&&new TextEncoder,K="undefined"!=typeof TextDecoder&&new TextDecoder;try{K.decode(F,{stream:!0})}catch(t){}var N=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(P(t),this.d=n||!1)},t}();function P(n,r){if(J)return J.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),a=0,s=function(t){i[a++]=t},o=0;oi.length){var f=new t(a+8+(e-o<<1));f.set(i),i=f}var h=n.charCodeAt(o);h<128||r?s(h):h<2048?(s(192|h>>6),s(128|63&h)):h>55295&&h<57344?(s(240|(h=65536+(1047552&h)|1023&n.charCodeAt(++o))>>18),s(128|h>>12&63),s(128|h>>6&63),s(128|63&h)):(s(224|h>>12),s(128|h>>6&63),s(128|63&h))}return b(i,0,a)}function Q(t){return function(t,n){n||(n={});var r=S(),e=t.length;r.p(t);var i=O(t,n,B(n),8),a=i.length;return q(i,n),j(i,a-8,r.d()),j(i,a-4,e),i}(P(t))}const R=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n{this._deflatedData.push(t)},this.stream=new N(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},V={clear:()=>{R.clear()},addEvent:t=>R.addEvent(t),finish:()=>R.finish(),compress:t=>Q(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in V&&"function"==typeof V[n])try{const t=V[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});`; -function e$1() { - const e2 = new Blob([r$3]); - return URL.createObjectURL(e2); -} -__name(e$1, "e$1"); -const CONSOLE_LEVELS = ["info", "warn", "error", "log"]; -const PREFIX$1 = "[Replay] "; -function _addBreadcrumb(message3, level = "info") { - addBreadcrumb( - { - category: "console", - data: { - logger: "replay" - }, - level, - message: `${PREFIX$1}${message3}` - }, - { level } - ); -} -__name(_addBreadcrumb, "_addBreadcrumb"); -function makeReplayLogger() { - let _capture = false; - let _trace = false; - const _logger = { - exception: /* @__PURE__ */ __name(() => void 0, "exception"), - infoTick: /* @__PURE__ */ __name(() => void 0, "infoTick"), - setConfig: /* @__PURE__ */ __name((opts) => { - _capture = opts.captureExceptions; - _trace = opts.traceInternals; - }, "setConfig") - }; - if (DEBUG_BUILD$2) { - CONSOLE_LEVELS.forEach((name2) => { - _logger[name2] = (...args) => { - logger$2[name2](PREFIX$1, ...args); - if (_trace) { - _addBreadcrumb(args.join(""), severityLevelFromString(name2)); - } - }; - }); - _logger.exception = (error2, ...message3) => { - if (message3.length && _logger.error) { - _logger.error(...message3); - } - logger$2.error(PREFIX$1, error2); - if (_capture) { - captureException(error2); - } else if (_trace) { - _addBreadcrumb(error2, "error"); - } - }; - _logger.infoTick = (...args) => { - logger$2.info(PREFIX$1, ...args); - if (_trace) { - setTimeout(() => _addBreadcrumb(args[0]), 0); - } - }; - } else { - CONSOLE_LEVELS.forEach((name2) => { - _logger[name2] = () => void 0; - }); - } - return _logger; -} -__name(makeReplayLogger, "makeReplayLogger"); -const logger$1 = makeReplayLogger(); -class EventBufferSizeExceededError extends Error { - static { - __name(this, "EventBufferSizeExceededError"); - } - constructor() { - super(`Event buffer exceeded maximum size of ${REPLAY_MAX_EVENT_BUFFER_SIZE}.`); - } -} -class EventBufferArray { - static { - __name(this, "EventBufferArray"); - } - /** All the events that are buffered to be sent. */ - /** @inheritdoc */ - /** @inheritdoc */ - constructor() { - this.events = []; - this._totalSize = 0; - this.hasCheckout = false; - this.waitForCheckout = false; - } - /** @inheritdoc */ - get hasEvents() { - return this.events.length > 0; - } - /** @inheritdoc */ - get type() { - return "sync"; - } - /** @inheritdoc */ - destroy() { - this.events = []; - } - /** @inheritdoc */ - async addEvent(event) { - const eventSize = JSON.stringify(event).length; - this._totalSize += eventSize; - if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) { - throw new EventBufferSizeExceededError(); - } - this.events.push(event); - } - /** @inheritdoc */ - finish() { - return new Promise((resolve2) => { - const eventsRet = this.events; - this.clear(); - resolve2(JSON.stringify(eventsRet)); - }); - } - /** @inheritdoc */ - clear() { - this.events = []; - this._totalSize = 0; - this.hasCheckout = false; - } - /** @inheritdoc */ - getEarliestTimestamp() { - const timestamp2 = this.events.map((event) => event.timestamp).sort()[0]; - if (!timestamp2) { - return null; - } - return timestampToMs(timestamp2); - } -} -class WorkerHandler { - static { - __name(this, "WorkerHandler"); - } - constructor(worker) { - this._worker = worker; - this._id = 0; - } - /** - * Ensure the worker is ready (or not). - * This will either resolve when the worker is ready, or reject if an error occurred. - */ - ensureReady() { - if (this._ensureReadyPromise) { - return this._ensureReadyPromise; - } - this._ensureReadyPromise = new Promise((resolve2, reject3) => { - this._worker.addEventListener( - "message", - ({ data: data26 }) => { - if (data26.success) { - resolve2(); - } else { - reject3(); - } - }, - { once: true } - ); - this._worker.addEventListener( - "error", - (error2) => { - reject3(error2); - }, - { once: true } - ); - }); - return this._ensureReadyPromise; - } - /** - * Destroy the worker. - */ - destroy() { - DEBUG_BUILD$2 && logger$1.info("Destroying compression worker"); - this._worker.terminate(); - } - /** - * Post message to worker and wait for response before resolving promise. - */ - postMessage(method, arg) { - const id3 = this._getAndIncrementId(); - return new Promise((resolve2, reject3) => { - const listener = /* @__PURE__ */ __name(({ data: data26 }) => { - const response = data26; - if (response.method !== method) { - return; - } - if (response.id !== id3) { - return; - } - this._worker.removeEventListener("message", listener); - if (!response.success) { - DEBUG_BUILD$2 && logger$1.error("Error in compression worker: ", response.response); - reject3(new Error("Error in compression worker")); - return; - } - resolve2(response.response); - }, "listener"); - this._worker.addEventListener("message", listener); - this._worker.postMessage({ id: id3, method, arg }); - }); - } - /** Get the current ID and increment it for the next call. */ - _getAndIncrementId() { - return this._id++; - } -} -class EventBufferCompressionWorker { - static { - __name(this, "EventBufferCompressionWorker"); - } - /** @inheritdoc */ - /** @inheritdoc */ - constructor(worker) { - this._worker = new WorkerHandler(worker); - this._earliestTimestamp = null; - this._totalSize = 0; - this.hasCheckout = false; - this.waitForCheckout = false; - } - /** @inheritdoc */ - get hasEvents() { - return !!this._earliestTimestamp; - } - /** @inheritdoc */ - get type() { - return "worker"; - } - /** - * Ensure the worker is ready (or not). - * This will either resolve when the worker is ready, or reject if an error occurred. - */ - ensureReady() { - return this._worker.ensureReady(); - } - /** - * Destroy the event buffer. - */ - destroy() { - this._worker.destroy(); - } - /** - * Add an event to the event buffer. - * - * Returns true if event was successfully received and processed by worker. - */ - addEvent(event) { - const timestamp2 = timestampToMs(event.timestamp); - if (!this._earliestTimestamp || timestamp2 < this._earliestTimestamp) { - this._earliestTimestamp = timestamp2; - } - const data26 = JSON.stringify(event); - this._totalSize += data26.length; - if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) { - return Promise.reject(new EventBufferSizeExceededError()); - } - return this._sendEventToWorker(data26); - } - /** - * Finish the event buffer and return the compressed data. - */ - finish() { - return this._finishRequest(); - } - /** @inheritdoc */ - clear() { - this._earliestTimestamp = null; - this._totalSize = 0; - this.hasCheckout = false; - this._worker.postMessage("clear").then(null, (e2) => { - DEBUG_BUILD$2 && logger$1.exception(e2, 'Sending "clear" message to worker failed', e2); - }); - } - /** @inheritdoc */ - getEarliestTimestamp() { - return this._earliestTimestamp; - } - /** - * Send the event to the worker. - */ - _sendEventToWorker(data26) { - return this._worker.postMessage("addEvent", data26); - } - /** - * Finish the request and return the compressed data from the worker. - */ - async _finishRequest() { - const response = await this._worker.postMessage("finish"); - this._earliestTimestamp = null; - this._totalSize = 0; - return response; - } -} -class EventBufferProxy { - static { - __name(this, "EventBufferProxy"); - } - constructor(worker) { - this._fallback = new EventBufferArray(); - this._compression = new EventBufferCompressionWorker(worker); - this._used = this._fallback; - this._ensureWorkerIsLoadedPromise = this._ensureWorkerIsLoaded(); - } - /** @inheritdoc */ - get waitForCheckout() { - return this._used.waitForCheckout; - } - /** @inheritdoc */ - get type() { - return this._used.type; - } - /** @inheritDoc */ - get hasEvents() { - return this._used.hasEvents; - } - /** @inheritdoc */ - get hasCheckout() { - return this._used.hasCheckout; - } - /** @inheritdoc */ - set hasCheckout(value4) { - this._used.hasCheckout = value4; - } - /** @inheritdoc */ - // eslint-disable-next-line @typescript-eslint/adjacent-overload-signatures - set waitForCheckout(value4) { - this._used.waitForCheckout = value4; - } - /** @inheritDoc */ - destroy() { - this._fallback.destroy(); - this._compression.destroy(); - } - /** @inheritdoc */ - clear() { - return this._used.clear(); - } - /** @inheritdoc */ - getEarliestTimestamp() { - return this._used.getEarliestTimestamp(); - } - /** - * Add an event to the event buffer. - * - * Returns true if event was successfully added. - */ - addEvent(event) { - return this._used.addEvent(event); - } - /** @inheritDoc */ - async finish() { - await this.ensureWorkerIsLoaded(); - return this._used.finish(); - } - /** Ensure the worker has loaded. */ - ensureWorkerIsLoaded() { - return this._ensureWorkerIsLoadedPromise; - } - /** Actually check if the worker has been loaded. */ - async _ensureWorkerIsLoaded() { - try { - await this._compression.ensureReady(); - } catch (error2) { - DEBUG_BUILD$2 && logger$1.exception(error2, "Failed to load the compression worker, falling back to simple buffer"); - return; - } - await this._switchToCompressionWorker(); - } - /** Switch the used buffer to the compression worker. */ - async _switchToCompressionWorker() { - const { events: events2, hasCheckout, waitForCheckout } = this._fallback; - const addEventPromises = []; - for (const event of events2) { - addEventPromises.push(this._compression.addEvent(event)); - } - this._compression.hasCheckout = hasCheckout; - this._compression.waitForCheckout = waitForCheckout; - this._used = this._compression; - try { - await Promise.all(addEventPromises); - this._fallback.clear(); - } catch (error2) { - DEBUG_BUILD$2 && logger$1.exception(error2, "Failed to add events when switching buffers."); - } - } -} -function createEventBuffer({ - useCompression, - workerUrl: customWorkerUrl -}) { - if (useCompression && // eslint-disable-next-line no-restricted-globals - window.Worker) { - const worker = _loadWorker(customWorkerUrl); - if (worker) { - return worker; - } - } - DEBUG_BUILD$2 && logger$1.info("Using simple buffer"); - return new EventBufferArray(); -} -__name(createEventBuffer, "createEventBuffer"); -function _loadWorker(customWorkerUrl) { - try { - const workerUrl = customWorkerUrl || _getWorkerUrl(); - if (!workerUrl) { - return; - } - DEBUG_BUILD$2 && logger$1.info(`Using compression worker${customWorkerUrl ? ` from ${customWorkerUrl}` : ""}`); - const worker = new Worker(workerUrl); - return new EventBufferProxy(worker); - } catch (error2) { - DEBUG_BUILD$2 && logger$1.exception(error2, "Failed to create compression worker"); - } -} -__name(_loadWorker, "_loadWorker"); -function _getWorkerUrl() { - if (typeof __SENTRY_EXCLUDE_REPLAY_WORKER__ === "undefined" || !__SENTRY_EXCLUDE_REPLAY_WORKER__) { - return e$1(); - } - return ""; -} -__name(_getWorkerUrl, "_getWorkerUrl"); -function hasSessionStorage() { - try { - return "sessionStorage" in WINDOW$1 && !!WINDOW$1.sessionStorage; - } catch (e2) { - return false; - } -} -__name(hasSessionStorage, "hasSessionStorage"); -function clearSession(replay) { - deleteSession(); - replay.session = void 0; -} -__name(clearSession, "clearSession"); -function deleteSession() { - if (!hasSessionStorage()) { - return; - } - try { - WINDOW$1.sessionStorage.removeItem(REPLAY_SESSION_KEY); - } catch (e2) { - } -} -__name(deleteSession, "deleteSession"); -function isSampled(sampleRate) { - if (sampleRate === void 0) { - return false; - } - return Math.random() < sampleRate; -} -__name(isSampled, "isSampled"); -function makeSession(session) { - const now2 = Date.now(); - const id3 = session.id || uuid4(); - const started = session.started || now2; - const lastActivity = session.lastActivity || now2; - const segmentId = session.segmentId || 0; - const sampled = session.sampled; - const previousSessionId = session.previousSessionId; - return { - id: id3, - started, - lastActivity, - segmentId, - sampled, - previousSessionId - }; -} -__name(makeSession, "makeSession"); -function saveSession(session) { - if (!hasSessionStorage()) { - return; - } - try { - WINDOW$1.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session)); - } catch (e2) { - } -} -__name(saveSession, "saveSession"); -function getSessionSampleType(sessionSampleRate, allowBuffering) { - return isSampled(sessionSampleRate) ? "session" : allowBuffering ? "buffer" : false; -} -__name(getSessionSampleType, "getSessionSampleType"); -function createSession({ sessionSampleRate, allowBuffering, stickySession = false }, { previousSessionId } = {}) { - const sampled = getSessionSampleType(sessionSampleRate, allowBuffering); - const session = makeSession({ - sampled, - previousSessionId - }); - if (stickySession) { - saveSession(session); - } - return session; -} -__name(createSession, "createSession"); -function fetchSession() { - if (!hasSessionStorage()) { - return null; - } - try { - const sessionStringFromStorage = WINDOW$1.sessionStorage.getItem(REPLAY_SESSION_KEY); - if (!sessionStringFromStorage) { - return null; - } - const sessionObj = JSON.parse(sessionStringFromStorage); - DEBUG_BUILD$2 && logger$1.infoTick("Loading existing session"); - return makeSession(sessionObj); - } catch (e2) { - return null; - } -} -__name(fetchSession, "fetchSession"); -function isExpired(initialTime, expiry, targetTime = +/* @__PURE__ */ new Date()) { - if (initialTime === null || expiry === void 0 || expiry < 0) { - return true; - } - if (expiry === 0) { - return false; - } - return initialTime + expiry <= targetTime; -} -__name(isExpired, "isExpired"); -function isSessionExpired(session, { - maxReplayDuration, - sessionIdleExpire, - targetTime = Date.now() -}) { - return ( - // First, check that maximum session length has not been exceeded - isExpired(session.started, maxReplayDuration, targetTime) || // check that the idle timeout has not been exceeded (i.e. user has - // performed an action within the last `sessionIdleExpire` ms) - isExpired(session.lastActivity, sessionIdleExpire, targetTime) - ); -} -__name(isSessionExpired, "isSessionExpired"); -function shouldRefreshSession(session, { sessionIdleExpire, maxReplayDuration }) { - if (!isSessionExpired(session, { sessionIdleExpire, maxReplayDuration })) { - return false; - } - if (session.sampled === "buffer" && session.segmentId === 0) { - return false; - } - return true; -} -__name(shouldRefreshSession, "shouldRefreshSession"); -function loadOrCreateSession({ - sessionIdleExpire, - maxReplayDuration, - previousSessionId -}, sessionOptions) { - const existingSession = sessionOptions.stickySession && fetchSession(); - if (!existingSession) { - DEBUG_BUILD$2 && logger$1.infoTick("Creating new session"); - return createSession(sessionOptions, { previousSessionId }); - } - if (!shouldRefreshSession(existingSession, { sessionIdleExpire, maxReplayDuration })) { - return existingSession; - } - DEBUG_BUILD$2 && logger$1.infoTick("Session in sessionStorage is expired, creating new one..."); - return createSession(sessionOptions, { previousSessionId: existingSession.id }); -} -__name(loadOrCreateSession, "loadOrCreateSession"); -function isCustomEvent(event) { - return event.type === EventType.Custom; -} -__name(isCustomEvent, "isCustomEvent"); -function addEventSync(replay, event, isCheckout) { - if (!shouldAddEvent(replay, event)) { - return false; - } - _addEvent(replay, event, isCheckout); - return true; -} -__name(addEventSync, "addEventSync"); -function addEvent(replay, event, isCheckout) { - if (!shouldAddEvent(replay, event)) { - return Promise.resolve(null); - } - return _addEvent(replay, event, isCheckout); -} -__name(addEvent, "addEvent"); -async function _addEvent(replay, event, isCheckout) { - const { eventBuffer } = replay; - if (!eventBuffer || eventBuffer.waitForCheckout && !isCheckout) { - return null; - } - const isBufferMode = replay.recordingMode === "buffer"; - try { - if (isCheckout && isBufferMode) { - eventBuffer.clear(); - } - if (isCheckout) { - eventBuffer.hasCheckout = true; - eventBuffer.waitForCheckout = false; - } - const replayOptions = replay.getOptions(); - const eventAfterPossibleCallback = maybeApplyCallback(event, replayOptions.beforeAddRecordingEvent); - if (!eventAfterPossibleCallback) { - return; - } - return await eventBuffer.addEvent(eventAfterPossibleCallback); - } catch (error2) { - const isExceeded = error2 && error2 instanceof EventBufferSizeExceededError; - const reason = isExceeded ? "addEventSizeExceeded" : "addEvent"; - if (isExceeded && isBufferMode) { - eventBuffer.clear(); - eventBuffer.waitForCheckout = true; - return null; - } - replay.handleException(error2); - await replay.stop({ reason }); - const client = getClient(); - if (client) { - client.recordDroppedEvent("internal_sdk_error", "replay"); - } - } -} -__name(_addEvent, "_addEvent"); -function shouldAddEvent(replay, event) { - if (!replay.eventBuffer || replay.isPaused() || !replay.isEnabled()) { - return false; - } - const timestampInMs = timestampToMs(event.timestamp); - if (timestampInMs + replay.timeouts.sessionIdlePause < Date.now()) { - return false; - } - if (timestampInMs > replay.getContext().initialTimestamp + replay.getOptions().maxReplayDuration) { - DEBUG_BUILD$2 && logger$1.infoTick(`Skipping event with timestamp ${timestampInMs} because it is after maxReplayDuration`); - return false; - } - return true; -} -__name(shouldAddEvent, "shouldAddEvent"); -function maybeApplyCallback(event, callback) { - try { - if (typeof callback === "function" && isCustomEvent(event)) { - return callback(event); - } - } catch (error2) { - DEBUG_BUILD$2 && logger$1.exception(error2, "An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."); - return null; - } - return event; -} -__name(maybeApplyCallback, "maybeApplyCallback"); -function isErrorEvent(event) { - return !event.type; -} -__name(isErrorEvent, "isErrorEvent"); -function isTransactionEvent(event) { - return event.type === "transaction"; -} -__name(isTransactionEvent, "isTransactionEvent"); -function isReplayEvent(event) { - return event.type === "replay_event"; -} -__name(isReplayEvent, "isReplayEvent"); -function isFeedbackEvent(event) { - return event.type === "feedback"; -} -__name(isFeedbackEvent, "isFeedbackEvent"); -function handleAfterSendEvent(replay) { - return (event, sendResponse) => { - if (!replay.isEnabled() || !isErrorEvent(event) && !isTransactionEvent(event)) { - return; - } - const statusCode = sendResponse && sendResponse.statusCode; - if (!statusCode || statusCode < 200 || statusCode >= 300) { - return; - } - if (isTransactionEvent(event)) { - handleTransactionEvent(replay, event); - return; - } - handleErrorEvent(replay, event); - }; -} -__name(handleAfterSendEvent, "handleAfterSendEvent"); -function handleTransactionEvent(replay, event) { - const replayContext = replay.getContext(); - if (event.contexts && event.contexts.trace && event.contexts.trace.trace_id && replayContext.traceIds.size < 100) { - replayContext.traceIds.add(event.contexts.trace.trace_id); - } -} -__name(handleTransactionEvent, "handleTransactionEvent"); -function handleErrorEvent(replay, event) { - const replayContext = replay.getContext(); - if (event.event_id && replayContext.errorIds.size < 100) { - replayContext.errorIds.add(event.event_id); - } - if (replay.recordingMode !== "buffer" || !event.tags || !event.tags.replayId) { - return; - } - const { beforeErrorSampling } = replay.getOptions(); - if (typeof beforeErrorSampling === "function" && !beforeErrorSampling(event)) { - return; - } - setTimeout$3(async () => { - try { - await replay.sendBufferedReplayOrFlush(); - } catch (err) { - replay.handleException(err); - } - }); -} -__name(handleErrorEvent, "handleErrorEvent"); -function handleBeforeSendEvent(replay) { - return (event) => { - if (!replay.isEnabled() || !isErrorEvent(event)) { - return; - } - handleHydrationError(replay, event); - }; -} -__name(handleBeforeSendEvent, "handleBeforeSendEvent"); -function handleHydrationError(replay, event) { - const exceptionValue = event.exception && event.exception.values && event.exception.values[0] && event.exception.values[0].value; - if (typeof exceptionValue !== "string") { - return; - } - if ( - // Only matches errors in production builds of react-dom - // Example https://reactjs.org/docs/error-decoder.html?invariant=423 - // With newer React versions, the messages changed to a different website https://react.dev/errors/418 - exceptionValue.match( - /(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/ - ) || // Development builds of react-dom - // Error 1: Hydration failed because the initial UI does not match what was rendered on the server. - // Error 2: Text content does not match server-rendered HTML. Warning: Text content did not match. - exceptionValue.match(/(does not match server-rendered HTML|Hydration failed because)/i) - ) { - const breadcrumb = createBreadcrumb({ - category: "replay.hydrate-error", - data: { - url: getLocationHref() - } - }); - addBreadcrumbEvent(replay, breadcrumb); - } -} -__name(handleHydrationError, "handleHydrationError"); -function handleBreadcrumbs(replay) { - const client = getClient(); - if (!client) { - return; - } - client.on("beforeAddBreadcrumb", (breadcrumb) => beforeAddBreadcrumb(replay, breadcrumb)); -} -__name(handleBreadcrumbs, "handleBreadcrumbs"); -function beforeAddBreadcrumb(replay, breadcrumb) { - if (!replay.isEnabled() || !isBreadcrumbWithCategory(breadcrumb)) { - return; - } - const result = normalizeBreadcrumb(breadcrumb); - if (result) { - addBreadcrumbEvent(replay, result); - } -} -__name(beforeAddBreadcrumb, "beforeAddBreadcrumb"); -function normalizeBreadcrumb(breadcrumb) { - if (!isBreadcrumbWithCategory(breadcrumb) || [ - // fetch & xhr are handled separately,in handleNetworkBreadcrumbs - "fetch", - "xhr", - // These two are breadcrumbs for emitted sentry events, we don't care about them - "sentry.event", - "sentry.transaction" - ].includes(breadcrumb.category) || // We capture UI breadcrumbs separately - breadcrumb.category.startsWith("ui.")) { - return null; - } - if (breadcrumb.category === "console") { - return normalizeConsoleBreadcrumb(breadcrumb); - } - return createBreadcrumb(breadcrumb); -} -__name(normalizeBreadcrumb, "normalizeBreadcrumb"); -function normalizeConsoleBreadcrumb(breadcrumb) { - const args = breadcrumb.data && breadcrumb.data.arguments; - if (!Array.isArray(args) || args.length === 0) { - return createBreadcrumb(breadcrumb); - } - let isTruncated = false; - const normalizedArgs = args.map((arg) => { - if (!arg) { - return arg; - } - if (typeof arg === "string") { - if (arg.length > CONSOLE_ARG_MAX_SIZE) { - isTruncated = true; - return `${arg.slice(0, CONSOLE_ARG_MAX_SIZE)}…`; - } - return arg; - } - if (typeof arg === "object") { - try { - const normalizedArg = normalize$3(arg, 7); - const stringified = JSON.stringify(normalizedArg); - if (stringified.length > CONSOLE_ARG_MAX_SIZE) { - isTruncated = true; - return `${JSON.stringify(normalizedArg, null, 2).slice(0, CONSOLE_ARG_MAX_SIZE)}…`; - } - return normalizedArg; - } catch (e2) { - } - } - return arg; - }); - return createBreadcrumb({ - ...breadcrumb, - data: { - ...breadcrumb.data, - arguments: normalizedArgs, - ...isTruncated ? { _meta: { warnings: ["CONSOLE_ARG_TRUNCATED"] } } : {} - } - }); -} -__name(normalizeConsoleBreadcrumb, "normalizeConsoleBreadcrumb"); -function isBreadcrumbWithCategory(breadcrumb) { - return !!breadcrumb.category; -} -__name(isBreadcrumbWithCategory, "isBreadcrumbWithCategory"); -function isRrwebError(event, hint) { - if (event.type || !event.exception || !event.exception.values || !event.exception.values.length) { - return false; - } - if (hint.originalException && hint.originalException.__rrweb__) { - return true; - } - return false; -} -__name(isRrwebError, "isRrwebError"); -function resetReplayIdOnDynamicSamplingContext() { - const dsc = getCurrentScope$1().getPropagationContext().dsc; - if (dsc) { - delete dsc.replay_id; - } - const activeSpan = getActiveSpan(); - if (activeSpan) { - const dsc2 = getDynamicSamplingContextFromSpan(activeSpan); - delete dsc2.replay_id; - } -} -__name(resetReplayIdOnDynamicSamplingContext, "resetReplayIdOnDynamicSamplingContext"); -function addFeedbackBreadcrumb(replay, event) { - replay.triggerUserActivity(); - replay.addUpdate(() => { - if (!event.timestamp) { - return true; - } - replay.throttledAddEvent({ - type: EventType.Custom, - timestamp: event.timestamp * 1e3, - data: { - tag: "breadcrumb", - payload: { - timestamp: event.timestamp, - type: "default", - category: "sentry.feedback", - data: { - feedbackId: event.event_id - } - } - } - }); - return false; - }); -} -__name(addFeedbackBreadcrumb, "addFeedbackBreadcrumb"); -function shouldSampleForBufferEvent(replay, event) { - if (replay.recordingMode !== "buffer") { - return false; - } - if (event.message === UNABLE_TO_SEND_REPLAY) { - return false; - } - if (!event.exception || event.type) { - return false; - } - return isSampled(replay.getOptions().errorSampleRate); -} -__name(shouldSampleForBufferEvent, "shouldSampleForBufferEvent"); -function handleGlobalEventListener(replay) { - return Object.assign( - (event, hint) => { - if (!replay.isEnabled() || replay.isPaused()) { - return event; - } - if (isReplayEvent(event)) { - delete event.breadcrumbs; - return event; - } - if (!isErrorEvent(event) && !isTransactionEvent(event) && !isFeedbackEvent(event)) { - return event; - } - const isSessionActive = replay.checkAndHandleExpiredSession(); - if (!isSessionActive) { - resetReplayIdOnDynamicSamplingContext(); - return event; - } - if (isFeedbackEvent(event)) { - replay.flush(); - event.contexts.feedback.replay_id = replay.getSessionId(); - addFeedbackBreadcrumb(replay, event); - return event; - } - if (isRrwebError(event, hint) && !replay.getOptions()._experiments.captureExceptions) { - DEBUG_BUILD$2 && logger$1.log("Ignoring error from rrweb internals", event); - return null; - } - const isErrorEventSampled = shouldSampleForBufferEvent(replay, event); - const shouldTagReplayId = isErrorEventSampled || replay.recordingMode === "session"; - if (shouldTagReplayId) { - event.tags = { ...event.tags, replayId: replay.getSessionId() }; - } - return event; - }, - { id: "Replay" } - ); -} -__name(handleGlobalEventListener, "handleGlobalEventListener"); -function createPerformanceSpans(replay, entries) { - return entries.map(({ type, start: start2, end, name: name2, data: data26 }) => { - const response = replay.throttledAddEvent({ - type: EventType.Custom, - timestamp: start2, - data: { - tag: "performanceSpan", - payload: { - op: type, - description: name2, - startTimestamp: start2, - endTimestamp: end, - data: data26 - } - } - }); - return typeof response === "string" ? Promise.resolve(null) : response; - }); -} -__name(createPerformanceSpans, "createPerformanceSpans"); -function handleHistory(handlerData) { - const { from: from2, to } = handlerData; - const now2 = Date.now() / 1e3; - return { - type: "navigation.push", - start: now2, - end: now2, - name: to, - data: { - previous: from2 - } - }; -} -__name(handleHistory, "handleHistory"); -function handleHistorySpanListener(replay) { - return (handlerData) => { - if (!replay.isEnabled()) { - return; - } - const result = handleHistory(handlerData); - if (result === null) { - return; - } - replay.getContext().urls.push(result.name); - replay.triggerUserActivity(); - replay.addUpdate(() => { - createPerformanceSpans(replay, [result]); - return false; - }); - }; -} -__name(handleHistorySpanListener, "handleHistorySpanListener"); -function shouldFilterRequest(replay, url) { - if (DEBUG_BUILD$2 && replay.getOptions()._experiments.traceInternals) { - return false; - } - return isSentryRequestUrl(url, getClient()); -} -__name(shouldFilterRequest, "shouldFilterRequest"); -function addNetworkBreadcrumb(replay, result) { - if (!replay.isEnabled()) { - return; - } - if (result === null) { - return; - } - if (shouldFilterRequest(replay, result.name)) { - return; - } - replay.addUpdate(() => { - createPerformanceSpans(replay, [result]); - return true; - }); -} -__name(addNetworkBreadcrumb, "addNetworkBreadcrumb"); -function getBodySize(body) { - if (!body) { - return void 0; - } - const textEncoder = new TextEncoder(); - try { - if (typeof body === "string") { - return textEncoder.encode(body).length; - } - if (body instanceof URLSearchParams) { - return textEncoder.encode(body.toString()).length; - } - if (body instanceof FormData) { - const formDataStr = _serializeFormData(body); - return textEncoder.encode(formDataStr).length; - } - if (body instanceof Blob) { - return body.size; - } - if (body instanceof ArrayBuffer) { - return body.byteLength; - } - } catch (e2) { - } - return void 0; -} -__name(getBodySize, "getBodySize"); -function parseContentLengthHeader(header3) { - if (!header3) { - return void 0; - } - const size = parseInt(header3, 10); - return isNaN(size) ? void 0 : size; -} -__name(parseContentLengthHeader, "parseContentLengthHeader"); -function getBodyString(body) { - try { - if (typeof body === "string") { - return [body]; - } - if (body instanceof URLSearchParams) { - return [body.toString()]; - } - if (body instanceof FormData) { - return [_serializeFormData(body)]; - } - if (!body) { - return [void 0]; - } - } catch (error2) { - DEBUG_BUILD$2 && logger$1.exception(error2, "Failed to serialize body", body); - return [void 0, "BODY_PARSE_ERROR"]; - } - DEBUG_BUILD$2 && logger$1.info("Skipping network body because of body type", body); - return [void 0, "UNPARSEABLE_BODY_TYPE"]; -} -__name(getBodyString, "getBodyString"); -function mergeWarning(info, warning) { - if (!info) { - return { - headers: {}, - size: void 0, - _meta: { - warnings: [warning] - } - }; - } - const newMeta = { ...info._meta }; - const existingWarnings = newMeta.warnings || []; - newMeta.warnings = [...existingWarnings, warning]; - info._meta = newMeta; - return info; -} -__name(mergeWarning, "mergeWarning"); -function makeNetworkReplayBreadcrumb(type, data26) { - if (!data26) { - return null; - } - const { startTimestamp, endTimestamp, url, method, statusCode, request, response } = data26; - const result = { - type, - start: startTimestamp / 1e3, - end: endTimestamp / 1e3, - name: url, - data: dropUndefinedKeys({ - method, - statusCode, - request, - response - }) - }; - return result; -} -__name(makeNetworkReplayBreadcrumb, "makeNetworkReplayBreadcrumb"); -function buildSkippedNetworkRequestOrResponse(bodySize) { - return { - headers: {}, - size: bodySize, - _meta: { - warnings: ["URL_SKIPPED"] - } - }; -} -__name(buildSkippedNetworkRequestOrResponse, "buildSkippedNetworkRequestOrResponse"); -function buildNetworkRequestOrResponse(headers, bodySize, body) { - if (!bodySize && Object.keys(headers).length === 0) { - return void 0; - } - if (!bodySize) { - return { - headers - }; - } - if (!body) { - return { - headers, - size: bodySize - }; - } - const info = { - headers, - size: bodySize - }; - const { body: normalizedBody, warnings } = normalizeNetworkBody(body); - info.body = normalizedBody; - if (warnings && warnings.length > 0) { - info._meta = { - warnings - }; - } - return info; -} -__name(buildNetworkRequestOrResponse, "buildNetworkRequestOrResponse"); -function getAllowedHeaders(headers, allowedHeaders) { - return Object.entries(headers).reduce((filteredHeaders, [key, value4]) => { - const normalizedKey = key.toLowerCase(); - if (allowedHeaders.includes(normalizedKey) && headers[key]) { - filteredHeaders[normalizedKey] = value4; - } - return filteredHeaders; - }, {}); -} -__name(getAllowedHeaders, "getAllowedHeaders"); -function _serializeFormData(formData) { - return new URLSearchParams(formData).toString(); -} -__name(_serializeFormData, "_serializeFormData"); -function normalizeNetworkBody(body) { - if (!body || typeof body !== "string") { - return { - body - }; - } - const exceedsSizeLimit = body.length > NETWORK_BODY_MAX_SIZE; - const isProbablyJson = _strIsProbablyJson(body); - if (exceedsSizeLimit) { - const truncatedBody = body.slice(0, NETWORK_BODY_MAX_SIZE); - if (isProbablyJson) { - return { - body: truncatedBody, - warnings: ["MAYBE_JSON_TRUNCATED"] - }; - } - return { - body: `${truncatedBody}…`, - warnings: ["TEXT_TRUNCATED"] - }; - } - if (isProbablyJson) { - try { - const jsonBody = JSON.parse(body); - return { - body: jsonBody - }; - } catch (e2) { - } - } - return { - body - }; -} -__name(normalizeNetworkBody, "normalizeNetworkBody"); -function _strIsProbablyJson(str) { - const first2 = str[0]; - const last = str[str.length - 1]; - return first2 === "[" && last === "]" || first2 === "{" && last === "}"; -} -__name(_strIsProbablyJson, "_strIsProbablyJson"); -function urlMatches(url, urls) { - const fullUrl = getFullUrl(url); - return stringMatchesSomePattern(fullUrl, urls); -} -__name(urlMatches, "urlMatches"); -function getFullUrl(url, baseURI = WINDOW$1.document.baseURI) { - if (url.startsWith("http://") || url.startsWith("https://") || url.startsWith(WINDOW$1.location.origin)) { - return url; - } - const fixedUrl = new URL(url, baseURI); - if (fixedUrl.origin !== new URL(baseURI).origin) { - return url; - } - const fullUrl = fixedUrl.href; - if (!url.endsWith("/") && fullUrl.endsWith("/")) { - return fullUrl.slice(0, -1); - } - return fullUrl; -} -__name(getFullUrl, "getFullUrl"); -async function captureFetchBreadcrumbToReplay(breadcrumb, hint, options4) { - try { - const data26 = await _prepareFetchData(breadcrumb, hint, options4); - const result = makeNetworkReplayBreadcrumb("resource.fetch", data26); - addNetworkBreadcrumb(options4.replay, result); - } catch (error2) { - DEBUG_BUILD$2 && logger$1.exception(error2, "Failed to capture fetch breadcrumb"); - } -} -__name(captureFetchBreadcrumbToReplay, "captureFetchBreadcrumbToReplay"); -function enrichFetchBreadcrumb(breadcrumb, hint) { - const { input, response } = hint; - const body = input ? _getFetchRequestArgBody(input) : void 0; - const reqSize = getBodySize(body); - const resSize = response ? parseContentLengthHeader(response.headers.get("content-length")) : void 0; - if (reqSize !== void 0) { - breadcrumb.data.request_body_size = reqSize; - } - if (resSize !== void 0) { - breadcrumb.data.response_body_size = resSize; - } -} -__name(enrichFetchBreadcrumb, "enrichFetchBreadcrumb"); -async function _prepareFetchData(breadcrumb, hint, options4) { - const now2 = Date.now(); - const { startTimestamp = now2, endTimestamp = now2 } = hint; - const { - url, - method, - status_code: statusCode = 0, - request_body_size: requestBodySize, - response_body_size: responseBodySize - } = breadcrumb.data; - const captureDetails = urlMatches(url, options4.networkDetailAllowUrls) && !urlMatches(url, options4.networkDetailDenyUrls); - const request = captureDetails ? _getRequestInfo(options4, hint.input, requestBodySize) : buildSkippedNetworkRequestOrResponse(requestBodySize); - const response = await _getResponseInfo(captureDetails, options4, hint.response, responseBodySize); - return { - startTimestamp, - endTimestamp, - url, - method, - statusCode, - request, - response - }; -} -__name(_prepareFetchData, "_prepareFetchData"); -function _getRequestInfo({ networkCaptureBodies, networkRequestHeaders }, input, requestBodySize) { - const headers = input ? getRequestHeaders(input, networkRequestHeaders) : {}; - if (!networkCaptureBodies) { - return buildNetworkRequestOrResponse(headers, requestBodySize, void 0); - } - const requestBody = _getFetchRequestArgBody(input); - const [bodyStr, warning] = getBodyString(requestBody); - const data26 = buildNetworkRequestOrResponse(headers, requestBodySize, bodyStr); - if (warning) { - return mergeWarning(data26, warning); - } - return data26; -} -__name(_getRequestInfo, "_getRequestInfo"); -async function _getResponseInfo(captureDetails, { - networkCaptureBodies, - networkResponseHeaders -}, response, responseBodySize) { - if (!captureDetails && responseBodySize !== void 0) { - return buildSkippedNetworkRequestOrResponse(responseBodySize); - } - const headers = response ? getAllHeaders(response.headers, networkResponseHeaders) : {}; - if (!response || !networkCaptureBodies && responseBodySize !== void 0) { - return buildNetworkRequestOrResponse(headers, responseBodySize, void 0); - } - const [bodyText, warning] = await _parseFetchResponseBody(response); - const result = getResponseData(bodyText, { - networkCaptureBodies, - responseBodySize, - captureDetails, - headers - }); - if (warning) { - return mergeWarning(result, warning); - } - return result; -} -__name(_getResponseInfo, "_getResponseInfo"); -function getResponseData(bodyText, { - networkCaptureBodies, - responseBodySize, - captureDetails, - headers -}) { - try { - const size = bodyText && bodyText.length && responseBodySize === void 0 ? getBodySize(bodyText) : responseBodySize; - if (!captureDetails) { - return buildSkippedNetworkRequestOrResponse(size); - } - if (networkCaptureBodies) { - return buildNetworkRequestOrResponse(headers, size, bodyText); - } - return buildNetworkRequestOrResponse(headers, size, void 0); - } catch (error2) { - DEBUG_BUILD$2 && logger$1.exception(error2, "Failed to serialize response body"); - return buildNetworkRequestOrResponse(headers, responseBodySize, void 0); - } -} -__name(getResponseData, "getResponseData"); -async function _parseFetchResponseBody(response) { - const res = _tryCloneResponse(response); - if (!res) { - return [void 0, "BODY_PARSE_ERROR"]; - } - try { - const text2 = await _tryGetResponseText(res); - return [text2]; - } catch (error2) { - if (error2 instanceof Error && error2.message.indexOf("Timeout") > -1) { - DEBUG_BUILD$2 && logger$1.warn("Parsing text body from response timed out"); - return [void 0, "BODY_PARSE_TIMEOUT"]; - } - DEBUG_BUILD$2 && logger$1.exception(error2, "Failed to get text body from response"); - return [void 0, "BODY_PARSE_ERROR"]; - } -} -__name(_parseFetchResponseBody, "_parseFetchResponseBody"); -function _getFetchRequestArgBody(fetchArgs = []) { - if (fetchArgs.length !== 2 || typeof fetchArgs[1] !== "object") { - return void 0; - } - return fetchArgs[1].body; -} -__name(_getFetchRequestArgBody, "_getFetchRequestArgBody"); -function getAllHeaders(headers, allowedHeaders) { - const allHeaders = {}; - allowedHeaders.forEach((header3) => { - if (headers.get(header3)) { - allHeaders[header3] = headers.get(header3); - } - }); - return allHeaders; -} -__name(getAllHeaders, "getAllHeaders"); -function getRequestHeaders(fetchArgs, allowedHeaders) { - if (fetchArgs.length === 1 && typeof fetchArgs[0] !== "string") { - return getHeadersFromOptions(fetchArgs[0], allowedHeaders); - } - if (fetchArgs.length === 2) { - return getHeadersFromOptions(fetchArgs[1], allowedHeaders); - } - return {}; -} -__name(getRequestHeaders, "getRequestHeaders"); -function getHeadersFromOptions(input, allowedHeaders) { - if (!input) { - return {}; - } - const headers = input.headers; - if (!headers) { - return {}; - } - if (headers instanceof Headers) { - return getAllHeaders(headers, allowedHeaders); - } - if (Array.isArray(headers)) { - return {}; - } - return getAllowedHeaders(headers, allowedHeaders); -} -__name(getHeadersFromOptions, "getHeadersFromOptions"); -function _tryCloneResponse(response) { - try { - return response.clone(); - } catch (error2) { - DEBUG_BUILD$2 && logger$1.exception(error2, "Failed to clone response body"); - } -} -__name(_tryCloneResponse, "_tryCloneResponse"); -function _tryGetResponseText(response) { - return new Promise((resolve2, reject3) => { - const timeout = setTimeout$3(() => reject3(new Error("Timeout while trying to read response body")), 500); - _getResponseText(response).then( - (txt) => resolve2(txt), - (reason) => reject3(reason) - ).finally(() => clearTimeout(timeout)); - }); -} -__name(_tryGetResponseText, "_tryGetResponseText"); -async function _getResponseText(response) { - return await response.text(); -} -__name(_getResponseText, "_getResponseText"); -async function captureXhrBreadcrumbToReplay(breadcrumb, hint, options4) { - try { - const data26 = _prepareXhrData(breadcrumb, hint, options4); - const result = makeNetworkReplayBreadcrumb("resource.xhr", data26); - addNetworkBreadcrumb(options4.replay, result); - } catch (error2) { - DEBUG_BUILD$2 && logger$1.exception(error2, "Failed to capture xhr breadcrumb"); - } -} -__name(captureXhrBreadcrumbToReplay, "captureXhrBreadcrumbToReplay"); -function enrichXhrBreadcrumb(breadcrumb, hint) { - const { xhr, input } = hint; - if (!xhr) { - return; - } - const reqSize = getBodySize(input); - const resSize = xhr.getResponseHeader("content-length") ? parseContentLengthHeader(xhr.getResponseHeader("content-length")) : _getBodySize(xhr.response, xhr.responseType); - if (reqSize !== void 0) { - breadcrumb.data.request_body_size = reqSize; - } - if (resSize !== void 0) { - breadcrumb.data.response_body_size = resSize; - } -} -__name(enrichXhrBreadcrumb, "enrichXhrBreadcrumb"); -function _prepareXhrData(breadcrumb, hint, options4) { - const now2 = Date.now(); - const { startTimestamp = now2, endTimestamp = now2, input, xhr } = hint; - const { - url, - method, - status_code: statusCode = 0, - request_body_size: requestBodySize, - response_body_size: responseBodySize - } = breadcrumb.data; - if (!url) { - return null; - } - if (!xhr || !urlMatches(url, options4.networkDetailAllowUrls) || urlMatches(url, options4.networkDetailDenyUrls)) { - const request2 = buildSkippedNetworkRequestOrResponse(requestBodySize); - const response2 = buildSkippedNetworkRequestOrResponse(responseBodySize); - return { - startTimestamp, - endTimestamp, - url, - method, - statusCode, - request: request2, - response: response2 - }; - } - const xhrInfo = xhr[SENTRY_XHR_DATA_KEY]; - const networkRequestHeaders = xhrInfo ? getAllowedHeaders(xhrInfo.request_headers, options4.networkRequestHeaders) : {}; - const networkResponseHeaders = getAllowedHeaders(getResponseHeaders(xhr), options4.networkResponseHeaders); - const [requestBody, requestWarning] = options4.networkCaptureBodies ? getBodyString(input) : [void 0]; - const [responseBody, responseWarning] = options4.networkCaptureBodies ? _getXhrResponseBody(xhr) : [void 0]; - const request = buildNetworkRequestOrResponse(networkRequestHeaders, requestBodySize, requestBody); - const response = buildNetworkRequestOrResponse(networkResponseHeaders, responseBodySize, responseBody); - return { - startTimestamp, - endTimestamp, - url, - method, - statusCode, - request: requestWarning ? mergeWarning(request, requestWarning) : request, - response: responseWarning ? mergeWarning(response, responseWarning) : response - }; -} -__name(_prepareXhrData, "_prepareXhrData"); -function getResponseHeaders(xhr) { - const headers = xhr.getAllResponseHeaders(); - if (!headers) { - return {}; - } - return headers.split("\r\n").reduce((acc, line) => { - const [key, value4] = line.split(": "); - if (value4) { - acc[key.toLowerCase()] = value4; - } - return acc; - }, {}); -} -__name(getResponseHeaders, "getResponseHeaders"); -function _getXhrResponseBody(xhr) { - const errors2 = []; - try { - return [xhr.responseText]; - } catch (e2) { - errors2.push(e2); - } - try { - return _parseXhrResponse(xhr.response, xhr.responseType); - } catch (e2) { - errors2.push(e2); - } - DEBUG_BUILD$2 && logger$1.warn("Failed to get xhr response body", ...errors2); - return [void 0]; -} -__name(_getXhrResponseBody, "_getXhrResponseBody"); -function _parseXhrResponse(body, responseType) { - try { - if (typeof body === "string") { - return [body]; - } - if (body instanceof Document) { - return [body.body.outerHTML]; - } - if (responseType === "json" && body && typeof body === "object") { - return [JSON.stringify(body)]; - } - if (!body) { - return [void 0]; - } - } catch (error2) { - DEBUG_BUILD$2 && logger$1.exception(error2, "Failed to serialize body", body); - return [void 0, "BODY_PARSE_ERROR"]; - } - DEBUG_BUILD$2 && logger$1.info("Skipping network body because of body type", body); - return [void 0, "UNPARSEABLE_BODY_TYPE"]; -} -__name(_parseXhrResponse, "_parseXhrResponse"); -function _getBodySize(body, responseType) { - try { - const bodyStr = responseType === "json" && body && typeof body === "object" ? JSON.stringify(body) : body; - return getBodySize(bodyStr); - } catch (e2) { - return void 0; - } -} -__name(_getBodySize, "_getBodySize"); -function handleNetworkBreadcrumbs(replay) { - const client = getClient(); - try { - const { - networkDetailAllowUrls, - networkDetailDenyUrls, - networkCaptureBodies, - networkRequestHeaders, - networkResponseHeaders - } = replay.getOptions(); - const options4 = { - replay, - networkDetailAllowUrls, - networkDetailDenyUrls, - networkCaptureBodies, - networkRequestHeaders, - networkResponseHeaders - }; - if (client) { - client.on("beforeAddBreadcrumb", (breadcrumb, hint) => beforeAddNetworkBreadcrumb(options4, breadcrumb, hint)); - } - } catch (e2) { - } -} -__name(handleNetworkBreadcrumbs, "handleNetworkBreadcrumbs"); -function beforeAddNetworkBreadcrumb(options4, breadcrumb, hint) { - if (!breadcrumb.data) { - return; - } - try { - if (_isXhrBreadcrumb(breadcrumb) && _isXhrHint(hint)) { - enrichXhrBreadcrumb(breadcrumb, hint); - captureXhrBreadcrumbToReplay(breadcrumb, hint, options4); - } - if (_isFetchBreadcrumb(breadcrumb) && _isFetchHint(hint)) { - enrichFetchBreadcrumb(breadcrumb, hint); - captureFetchBreadcrumbToReplay(breadcrumb, hint, options4); - } - } catch (e2) { - DEBUG_BUILD$2 && logger$1.exception(e2, "Error when enriching network breadcrumb"); - } -} -__name(beforeAddNetworkBreadcrumb, "beforeAddNetworkBreadcrumb"); -function _isXhrBreadcrumb(breadcrumb) { - return breadcrumb.category === "xhr"; -} -__name(_isXhrBreadcrumb, "_isXhrBreadcrumb"); -function _isFetchBreadcrumb(breadcrumb) { - return breadcrumb.category === "fetch"; -} -__name(_isFetchBreadcrumb, "_isFetchBreadcrumb"); -function _isXhrHint(hint) { - return hint && hint.xhr; -} -__name(_isXhrHint, "_isXhrHint"); -function _isFetchHint(hint) { - return hint && hint.response; -} -__name(_isFetchHint, "_isFetchHint"); -function addGlobalListeners(replay) { - const client = getClient(); - addClickKeypressInstrumentationHandler(handleDomListener(replay)); - addHistoryInstrumentationHandler(handleHistorySpanListener(replay)); - handleBreadcrumbs(replay); - handleNetworkBreadcrumbs(replay); - const eventProcessor = handleGlobalEventListener(replay); - addEventProcessor(eventProcessor); - if (client) { - client.on("beforeSendEvent", handleBeforeSendEvent(replay)); - client.on("afterSendEvent", handleAfterSendEvent(replay)); - client.on("createDsc", (dsc) => { - const replayId = replay.getSessionId(); - if (replayId && replay.isEnabled() && replay.recordingMode === "session") { - const isSessionActive = replay.checkAndHandleExpiredSession(); - if (isSessionActive) { - dsc.replay_id = replayId; - } - } - }); - client.on("spanStart", (span) => { - replay.lastActiveSpan = span; - }); - client.on("spanEnd", (span) => { - replay.lastActiveSpan = span; - }); - client.on("beforeSendFeedback", (feedbackEvent, options4) => { - const replayId = replay.getSessionId(); - if (options4 && options4.includeReplay && replay.isEnabled() && replayId) { - if (feedbackEvent.contexts && feedbackEvent.contexts.feedback) { - feedbackEvent.contexts.feedback.replay_id = replayId; - } - } - }); - } -} -__name(addGlobalListeners, "addGlobalListeners"); -async function addMemoryEntry(replay) { - try { - return Promise.all( - createPerformanceSpans(replay, [ - // @ts-expect-error memory doesn't exist on type Performance as the API is non-standard (we check that it exists above) - createMemoryEntry(WINDOW$1.performance.memory) - ]) - ); - } catch (error2) { - return []; - } -} -__name(addMemoryEntry, "addMemoryEntry"); -function createMemoryEntry(memoryEntry) { - const { jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize } = memoryEntry; - const time = Date.now() / 1e3; - return { - type: "memory", - name: "memory", - start: time, - end: time, - data: { - memory: { - jsHeapSizeLimit, - totalJSHeapSize, - usedJSHeapSize - } - } - }; -} -__name(createMemoryEntry, "createMemoryEntry"); -function debounce(func, wait, options4) { - let callbackReturnValue; - let timerId; - let maxTimerId; - const maxWait = options4 && options4.maxWait ? Math.max(options4.maxWait, wait) : 0; - function invokeFunc() { - cancelTimers(); - callbackReturnValue = func(); - return callbackReturnValue; - } - __name(invokeFunc, "invokeFunc"); - function cancelTimers() { - timerId !== void 0 && clearTimeout(timerId); - maxTimerId !== void 0 && clearTimeout(maxTimerId); - timerId = maxTimerId = void 0; - } - __name(cancelTimers, "cancelTimers"); - function flush2() { - if (timerId !== void 0 || maxTimerId !== void 0) { - return invokeFunc(); - } - return callbackReturnValue; - } - __name(flush2, "flush"); - function debounced() { - if (timerId) { - clearTimeout(timerId); - } - timerId = setTimeout$3(invokeFunc, wait); - if (maxWait && maxTimerId === void 0) { - maxTimerId = setTimeout$3(invokeFunc, maxWait); - } - return callbackReturnValue; - } - __name(debounced, "debounced"); - debounced.cancel = cancelTimers; - debounced.flush = flush2; - return debounced; -} -__name(debounce, "debounce"); -const NAVIGATOR$1 = GLOBAL_OBJ.navigator; -function getRecordingSamplingOptions() { - if (/iPhone|iPad|iPod/i.test(NAVIGATOR$1 && NAVIGATOR$1.userAgent || "") || /Macintosh/i.test(NAVIGATOR$1 && NAVIGATOR$1.userAgent || "") && NAVIGATOR$1 && NAVIGATOR$1.maxTouchPoints && NAVIGATOR$1.maxTouchPoints > 1) { - return { - sampling: { - mousemove: false - } - }; - } - return {}; -} -__name(getRecordingSamplingOptions, "getRecordingSamplingOptions"); -function getHandleRecordingEmit(replay) { - let hadFirstEvent = false; - return (event, _isCheckout) => { - if (!replay.checkAndHandleExpiredSession()) { - DEBUG_BUILD$2 && logger$1.warn("Received replay event after session expired."); - return; - } - const isCheckout = _isCheckout || !hadFirstEvent; - hadFirstEvent = true; - if (replay.clickDetector) { - updateClickDetectorForRecordingEvent(replay.clickDetector, event); - } - replay.addUpdate(() => { - if (replay.recordingMode === "buffer" && isCheckout) { - replay.setInitialState(); - } - if (!addEventSync(replay, event, isCheckout)) { - return true; - } - if (!isCheckout) { - return false; - } - const session = replay.session; - addSettingsEvent(replay, isCheckout); - if (replay.recordingMode === "buffer" && session && replay.eventBuffer) { - const earliestEvent = replay.eventBuffer.getEarliestTimestamp(); - if (earliestEvent) { - DEBUG_BUILD$2 && logger$1.info(`Updating session start time to earliest event in buffer to ${new Date(earliestEvent)}`); - session.started = earliestEvent; - if (replay.getOptions().stickySession) { - saveSession(session); - } - } - } - if (session && session.previousSessionId) { - return true; - } - if (replay.recordingMode === "session") { - void replay.flush(); - } - return true; - }); - }; -} -__name(getHandleRecordingEmit, "getHandleRecordingEmit"); -function createOptionsEvent(replay) { - const options4 = replay.getOptions(); - return { - type: EventType.Custom, - timestamp: Date.now(), - data: { - tag: "options", - payload: { - shouldRecordCanvas: replay.isRecordingCanvas(), - sessionSampleRate: options4.sessionSampleRate, - errorSampleRate: options4.errorSampleRate, - useCompressionOption: options4.useCompression, - blockAllMedia: options4.blockAllMedia, - maskAllText: options4.maskAllText, - maskAllInputs: options4.maskAllInputs, - useCompression: replay.eventBuffer ? replay.eventBuffer.type === "worker" : false, - networkDetailHasUrls: options4.networkDetailAllowUrls.length > 0, - networkCaptureBodies: options4.networkCaptureBodies, - networkRequestHasHeaders: options4.networkRequestHeaders.length > 0, - networkResponseHasHeaders: options4.networkResponseHeaders.length > 0 - } - } - }; -} -__name(createOptionsEvent, "createOptionsEvent"); -function addSettingsEvent(replay, isCheckout) { - if (!isCheckout || !replay.session || replay.session.segmentId !== 0) { - return; - } - addEventSync(replay, createOptionsEvent(replay), false); -} -__name(addSettingsEvent, "addSettingsEvent"); -function createReplayEnvelope(replayEvent, recordingData, dsn, tunnel) { - return createEnvelope( - createEventEnvelopeHeaders(replayEvent, getSdkMetadataForEnvelopeHeader(replayEvent), tunnel, dsn), - [ - [{ type: "replay_event" }, replayEvent], - [ - { - type: "replay_recording", - // If string then we need to encode to UTF8, otherwise will have - // wrong size. TextEncoder has similar browser support to - // MutationObserver, although it does not accept IE11. - length: typeof recordingData === "string" ? new TextEncoder().encode(recordingData).length : recordingData.length - }, - recordingData - ] - ] - ); -} -__name(createReplayEnvelope, "createReplayEnvelope"); -function prepareRecordingData({ - recordingData, - headers -}) { - let payloadWithSequence; - const replayHeaders = `${JSON.stringify(headers)} -`; - if (typeof recordingData === "string") { - payloadWithSequence = `${replayHeaders}${recordingData}`; - } else { - const enc = new TextEncoder(); - const sequence = enc.encode(replayHeaders); - payloadWithSequence = new Uint8Array(sequence.length + recordingData.length); - payloadWithSequence.set(sequence); - payloadWithSequence.set(recordingData, sequence.length); - } - return payloadWithSequence; -} -__name(prepareRecordingData, "prepareRecordingData"); -async function prepareReplayEvent({ - client, - scope, - replayId: event_id, - event -}) { - const integrations = typeof client._integrations === "object" && client._integrations !== null && !Array.isArray(client._integrations) ? Object.keys(client._integrations) : void 0; - const eventHint = { event_id, integrations }; - client.emit("preprocessEvent", event, eventHint); - const preparedEvent = await prepareEvent( - client.getOptions(), - event, - eventHint, - scope, - client, - getIsolationScope() - ); - if (!preparedEvent) { - return null; - } - preparedEvent.platform = preparedEvent.platform || "javascript"; - const metadata = client.getSdkMetadata(); - const { name: name2, version: version2 } = metadata && metadata.sdk || {}; - preparedEvent.sdk = { - ...preparedEvent.sdk, - name: name2 || "sentry.javascript.unknown", - version: version2 || "0.0.0" - }; - return preparedEvent; -} -__name(prepareReplayEvent, "prepareReplayEvent"); -async function sendReplayRequest({ - recordingData, - replayId, - segmentId: segment_id, - eventContext, - timestamp: timestamp2, - session -}) { - const preparedRecordingData = prepareRecordingData({ - recordingData, - headers: { - segment_id - } - }); - const { urls, errorIds, traceIds, initialTimestamp } = eventContext; - const client = getClient(); - const scope = getCurrentScope$1(); - const transport = client && client.getTransport(); - const dsn = client && client.getDsn(); - if (!client || !transport || !dsn || !session.sampled) { - return resolvedSyncPromise({}); - } - const baseEvent = { - type: REPLAY_EVENT_NAME, - replay_start_timestamp: initialTimestamp / 1e3, - timestamp: timestamp2 / 1e3, - error_ids: errorIds, - trace_ids: traceIds, - urls, - replay_id: replayId, - segment_id, - replay_type: session.sampled - }; - const replayEvent = await prepareReplayEvent({ scope, client, replayId, event: baseEvent }); - if (!replayEvent) { - client.recordDroppedEvent("event_processor", "replay", baseEvent); - DEBUG_BUILD$2 && logger$1.info("An event processor returned `null`, will not send event."); - return resolvedSyncPromise({}); - } - delete replayEvent.sdkProcessingMetadata; - const envelope = createReplayEnvelope(replayEvent, preparedRecordingData, dsn, client.getOptions().tunnel); - let response; - try { - response = await transport.send(envelope); - } catch (err) { - const error2 = new Error(UNABLE_TO_SEND_REPLAY); - try { - error2.cause = err; - } catch (e2) { - } - throw error2; - } - if (typeof response.statusCode === "number" && (response.statusCode < 200 || response.statusCode >= 300)) { - throw new TransportStatusCodeError(response.statusCode); - } - const rateLimits = updateRateLimits({}, response); - if (isRateLimited(rateLimits, "replay")) { - throw new RateLimitError(rateLimits); - } - return response; -} -__name(sendReplayRequest, "sendReplayRequest"); -class TransportStatusCodeError extends Error { - static { - __name(this, "TransportStatusCodeError"); - } - constructor(statusCode) { - super(`Transport returned status code ${statusCode}`); - } -} -class RateLimitError extends Error { - static { - __name(this, "RateLimitError"); - } - constructor(rateLimits) { - super("Rate limit hit"); - this.rateLimits = rateLimits; - } -} -async function sendReplay(replayData, retryConfig = { - count: 0, - interval: RETRY_BASE_INTERVAL -}) { - const { recordingData, onError } = replayData; - if (!recordingData.length) { - return; - } - try { - await sendReplayRequest(replayData); - return true; - } catch (err) { - if (err instanceof TransportStatusCodeError || err instanceof RateLimitError) { - throw err; - } - setContext("Replays", { - _retryCount: retryConfig.count - }); - if (onError) { - onError(err); - } - if (retryConfig.count >= RETRY_MAX_COUNT) { - const error2 = new Error(`${UNABLE_TO_SEND_REPLAY} - max retries exceeded`); - try { - error2.cause = err; - } catch (e2) { - } - throw error2; - } - retryConfig.interval *= ++retryConfig.count; - return new Promise((resolve2, reject3) => { - setTimeout$3(async () => { - try { - await sendReplay(replayData, retryConfig); - resolve2(true); - } catch (err2) { - reject3(err2); - } - }, retryConfig.interval); - }); - } -} -__name(sendReplay, "sendReplay"); -const THROTTLED = "__THROTTLED"; -const SKIPPED = "__SKIPPED"; -function throttle$2(fn, maxCount, durationSeconds) { - const counter = /* @__PURE__ */ new Map(); - const _cleanup = /* @__PURE__ */ __name((now2) => { - const threshold = now2 - durationSeconds; - counter.forEach((_value, key) => { - if (key < threshold) { - counter.delete(key); - } - }); - }, "_cleanup"); - const _getTotalCount = /* @__PURE__ */ __name(() => { - return [...counter.values()].reduce((a2, b2) => a2 + b2, 0); - }, "_getTotalCount"); - let isThrottled = false; - return (...rest) => { - const now2 = Math.floor(Date.now() / 1e3); - _cleanup(now2); - if (_getTotalCount() >= maxCount) { - const wasThrottled = isThrottled; - isThrottled = true; - return wasThrottled ? SKIPPED : THROTTLED; - } - isThrottled = false; - const count = counter.get(now2) || 0; - counter.set(now2, count + 1); - return fn(...rest); - }; -} -__name(throttle$2, "throttle$2"); -class ReplayContainer { - static { - __name(this, "ReplayContainer"); - } - /** - * Recording can happen in one of two modes: - * - session: Record the whole session, sending it continuously - * - buffer: Always keep the last 60s of recording, requires: - * - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs - * - or calling `flush()` to send the replay - */ - /** - * The current or last active span. - * This is only available when performance is enabled. - */ - /** - * These are here so we can overwrite them in tests etc. - * @hidden - */ - /** The replay has to be manually started, because no sample rate (neither session or error) was provided. */ - /** - * Options to pass to `rrweb.record()` - */ - /** - * Timestamp of the last user activity. This lives across sessions. - */ - /** - * Is the integration currently active? - */ - /** - * Paused is a state where: - * - DOM Recording is not listening at all - * - Nothing will be added to event buffer (e.g. core SDK events) - */ - /** - * Have we attached listeners to the core SDK? - * Note we have to track this as there is no way to remove instrumentation handlers. - */ - /** - * Function to stop recording - */ - /** - * Internal use for canvas recording options - */ - constructor({ - options: options4, - recordingOptions - }) { - ReplayContainer.prototype.__init.call(this); - ReplayContainer.prototype.__init2.call(this); - ReplayContainer.prototype.__init3.call(this); - ReplayContainer.prototype.__init4.call(this); - ReplayContainer.prototype.__init5.call(this); - ReplayContainer.prototype.__init6.call(this); - this.eventBuffer = null; - this.performanceEntries = []; - this.replayPerformanceEntries = []; - this.recordingMode = "session"; - this.timeouts = { - sessionIdlePause: SESSION_IDLE_PAUSE_DURATION, - sessionIdleExpire: SESSION_IDLE_EXPIRE_DURATION - }; - this._lastActivity = Date.now(); - this._isEnabled = false; - this._isPaused = false; - this._requiresManualStart = false; - this._hasInitializedCoreListeners = false; - this._context = { - errorIds: /* @__PURE__ */ new Set(), - traceIds: /* @__PURE__ */ new Set(), - urls: [], - initialTimestamp: Date.now(), - initialUrl: "" - }; - this._recordingOptions = recordingOptions; - this._options = options4; - this._debouncedFlush = debounce(() => this._flush(), this._options.flushMinDelay, { - maxWait: this._options.flushMaxDelay - }); - this._throttledAddEvent = throttle$2( - (event, isCheckout) => addEvent(this, event, isCheckout), - // Max 300 events... - 300, - // ... per 5s - 5 - ); - const { slowClickTimeout, slowClickIgnoreSelectors } = this.getOptions(); - const slowClickConfig = slowClickTimeout ? { - threshold: Math.min(SLOW_CLICK_THRESHOLD, slowClickTimeout), - timeout: slowClickTimeout, - scrollTimeout: SLOW_CLICK_SCROLL_TIMEOUT, - ignoreSelector: slowClickIgnoreSelectors ? slowClickIgnoreSelectors.join(",") : "" - } : void 0; - if (slowClickConfig) { - this.clickDetector = new ClickDetector(this, slowClickConfig); - } - if (DEBUG_BUILD$2) { - const experiments = options4._experiments; - logger$1.setConfig({ - captureExceptions: !!experiments.captureExceptions, - traceInternals: !!experiments.traceInternals - }); - } - } - /** Get the event context. */ - getContext() { - return this._context; - } - /** If recording is currently enabled. */ - isEnabled() { - return this._isEnabled; - } - /** If recording is currently paused. */ - isPaused() { - return this._isPaused; - } - /** - * Determine if canvas recording is enabled - */ - isRecordingCanvas() { - return Boolean(this._canvas); - } - /** Get the replay integration options. */ - getOptions() { - return this._options; - } - /** A wrapper to conditionally capture exceptions. */ - handleException(error2) { - DEBUG_BUILD$2 && logger$1.exception(error2); - if (this._options.onError) { - this._options.onError(error2); - } - } - /** - * Initializes the plugin based on sampling configuration. Should not be - * called outside of constructor. - */ - initializeSampling(previousSessionId) { - const { errorSampleRate, sessionSampleRate } = this._options; - const requiresManualStart = errorSampleRate <= 0 && sessionSampleRate <= 0; - this._requiresManualStart = requiresManualStart; - if (requiresManualStart) { - return; - } - this._initializeSessionForSampling(previousSessionId); - if (!this.session) { - DEBUG_BUILD$2 && logger$1.exception(new Error("Unable to initialize and create session")); - return; - } - if (this.session.sampled === false) { - return; - } - this.recordingMode = this.session.sampled === "buffer" && this.session.segmentId === 0 ? "buffer" : "session"; - DEBUG_BUILD$2 && logger$1.infoTick(`Starting replay in ${this.recordingMode} mode`); - this._initializeRecording(); - } - /** - * Start a replay regardless of sampling rate. Calling this will always - * create a new session. Will log a message if replay is already in progress. - * - * Creates or loads a session, attaches listeners to varying events (DOM, - * _performanceObserver, Recording, Sentry SDK, etc) - */ - start() { - if (this._isEnabled && this.recordingMode === "session") { - DEBUG_BUILD$2 && logger$1.info("Recording is already in progress"); - return; - } - if (this._isEnabled && this.recordingMode === "buffer") { - DEBUG_BUILD$2 && logger$1.info("Buffering is in progress, call `flush()` to save the replay"); - return; - } - DEBUG_BUILD$2 && logger$1.infoTick("Starting replay in session mode"); - this._updateUserActivity(); - const session = loadOrCreateSession( - { - maxReplayDuration: this._options.maxReplayDuration, - sessionIdleExpire: this.timeouts.sessionIdleExpire - }, - { - stickySession: this._options.stickySession, - // This is intentional: create a new session-based replay when calling `start()` - sessionSampleRate: 1, - allowBuffering: false - } - ); - this.session = session; - this._initializeRecording(); - } - /** - * Start replay buffering. Buffers until `flush()` is called or, if - * `replaysOnErrorSampleRate` > 0, an error occurs. - */ - startBuffering() { - if (this._isEnabled) { - DEBUG_BUILD$2 && logger$1.info("Buffering is in progress, call `flush()` to save the replay"); - return; - } - DEBUG_BUILD$2 && logger$1.infoTick("Starting replay in buffer mode"); - const session = loadOrCreateSession( - { - sessionIdleExpire: this.timeouts.sessionIdleExpire, - maxReplayDuration: this._options.maxReplayDuration - }, - { - stickySession: this._options.stickySession, - sessionSampleRate: 0, - allowBuffering: true - } - ); - this.session = session; - this.recordingMode = "buffer"; - this._initializeRecording(); - } - /** - * Start recording. - * - * Note that this will cause a new DOM checkout - */ - startRecording() { - try { - const canvasOptions = this._canvas; - this._stopRecording = record({ - ...this._recordingOptions, - // When running in error sampling mode, we need to overwrite `checkoutEveryNms` - // Without this, it would record forever, until an error happens, which we don't want - // instead, we'll always keep the last 60 seconds of replay before an error happened - ...this.recordingMode === "buffer" ? { checkoutEveryNms: BUFFER_CHECKOUT_TIME } : ( - // Otherwise, use experimental option w/ min checkout time of 6 minutes - // This is to improve playback seeking as there could potentially be - // less mutations to process in the worse cases. - // - // checkout by "N" events is probably ideal, but means we have less - // control about the number of checkouts we make (which generally - // increases replay size) - this._options._experiments.continuousCheckout && { - // Minimum checkout time is 6 minutes - checkoutEveryNms: Math.max(36e4, this._options._experiments.continuousCheckout) - } - ), - emit: getHandleRecordingEmit(this), - ...getRecordingSamplingOptions(), - onMutation: this._onMutationHandler, - ...canvasOptions ? { - recordCanvas: canvasOptions.recordCanvas, - getCanvasManager: canvasOptions.getCanvasManager, - sampling: canvasOptions.sampling, - dataURLOptions: canvasOptions.dataURLOptions - } : {} - }); - } catch (err) { - this.handleException(err); - } - } - /** - * Stops the recording, if it was running. - * - * Returns true if it was previously stopped, or is now stopped, - * otherwise false. - */ - stopRecording() { - try { - if (this._stopRecording) { - this._stopRecording(); - this._stopRecording = void 0; - } - return true; - } catch (err) { - this.handleException(err); - return false; - } - } - /** - * Currently, this needs to be manually called (e.g. for tests). Sentry SDK - * does not support a teardown - */ - async stop({ forceFlush = false, reason } = {}) { - if (!this._isEnabled) { - return; - } - this._isEnabled = false; - try { - DEBUG_BUILD$2 && logger$1.info(`Stopping Replay${reason ? ` triggered by ${reason}` : ""}`); - resetReplayIdOnDynamicSamplingContext(); - this._removeListeners(); - this.stopRecording(); - this._debouncedFlush.cancel(); - if (forceFlush) { - await this._flush({ force: true }); - } - this.eventBuffer && this.eventBuffer.destroy(); - this.eventBuffer = null; - clearSession(this); - } catch (err) { - this.handleException(err); - } - } - /** - * Pause some replay functionality. See comments for `_isPaused`. - * This differs from stop as this only stops DOM recording, it is - * not as thorough of a shutdown as `stop()`. - */ - pause() { - if (this._isPaused) { - return; - } - this._isPaused = true; - this.stopRecording(); - DEBUG_BUILD$2 && logger$1.info("Pausing replay"); - } - /** - * Resumes recording, see notes for `pause(). - * - * Note that calling `startRecording()` here will cause a - * new DOM checkout.` - */ - resume() { - if (!this._isPaused || !this._checkSession()) { - return; - } - this._isPaused = false; - this.startRecording(); - DEBUG_BUILD$2 && logger$1.info("Resuming replay"); - } - /** - * If not in "session" recording mode, flush event buffer which will create a new replay. - * Unless `continueRecording` is false, the replay will continue to record and - * behave as a "session"-based replay. - * - * Otherwise, queue up a flush. - */ - async sendBufferedReplayOrFlush({ continueRecording = true } = {}) { - if (this.recordingMode === "session") { - return this.flushImmediate(); - } - const activityTime = Date.now(); - DEBUG_BUILD$2 && logger$1.info("Converting buffer to session"); - await this.flushImmediate(); - const hasStoppedRecording = this.stopRecording(); - if (!continueRecording || !hasStoppedRecording) { - return; - } - if (this.recordingMode === "session") { - return; - } - this.recordingMode = "session"; - if (this.session) { - this._updateUserActivity(activityTime); - this._updateSessionActivity(activityTime); - this._maybeSaveSession(); - } - this.startRecording(); - } - /** - * We want to batch uploads of replay events. Save events only if - * `` milliseconds have elapsed since the last event - * *OR* if `` milliseconds have elapsed. - * - * Accepts a callback to perform side-effects and returns true to stop batch - * processing and hand back control to caller. - */ - addUpdate(cb) { - const cbResult = cb(); - if (this.recordingMode === "buffer") { - return; - } - if (cbResult === true) { - return; - } - this._debouncedFlush(); - } - /** - * Updates the user activity timestamp and resumes recording. This should be - * called in an event handler for a user action that we consider as the user - * being "active" (e.g. a mouse click). - */ - triggerUserActivity() { - this._updateUserActivity(); - if (!this._stopRecording) { - if (!this._checkSession()) { - return; - } - this.resume(); - return; - } - this.checkAndHandleExpiredSession(); - this._updateSessionActivity(); - } - /** - * Updates the user activity timestamp *without* resuming - * recording. Some user events (e.g. keydown) can be create - * low-value replays that only contain the keypress as a - * breadcrumb. Instead this would require other events to - * create a new replay after a session has expired. - */ - updateUserActivity() { - this._updateUserActivity(); - this._updateSessionActivity(); - } - /** - * Only flush if `this.recordingMode === 'session'` - */ - conditionalFlush() { - if (this.recordingMode === "buffer") { - return Promise.resolve(); - } - return this.flushImmediate(); - } - /** - * Flush using debounce flush - */ - flush() { - return this._debouncedFlush(); - } - /** - * Always flush via `_debouncedFlush` so that we do not have flushes triggered - * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be - * cases of multiple flushes happening closely together. - */ - flushImmediate() { - this._debouncedFlush(); - return this._debouncedFlush.flush(); - } - /** - * Cancels queued up flushes. - */ - cancelFlush() { - this._debouncedFlush.cancel(); - } - /** Get the current session (=replay) ID */ - getSessionId() { - return this.session && this.session.id; - } - /** - * Checks if recording should be stopped due to user inactivity. Otherwise - * check if session is expired and create a new session if so. Triggers a new - * full snapshot on new session. - * - * Returns true if session is not expired, false otherwise. - * @hidden - */ - checkAndHandleExpiredSession() { - if (this._lastActivity && isExpired(this._lastActivity, this.timeouts.sessionIdlePause) && this.session && this.session.sampled === "session") { - this.pause(); - return; - } - if (!this._checkSession()) { - return false; - } - return true; - } - /** - * Capture some initial state that can change throughout the lifespan of the - * replay. This is required because otherwise they would be captured at the - * first flush. - */ - setInitialState() { - const urlPath = `${WINDOW$1.location.pathname}${WINDOW$1.location.hash}${WINDOW$1.location.search}`; - const url = `${WINDOW$1.location.origin}${urlPath}`; - this.performanceEntries = []; - this.replayPerformanceEntries = []; - this._clearContext(); - this._context.initialUrl = url; - this._context.initialTimestamp = Date.now(); - this._context.urls.push(url); - } - /** - * Add a breadcrumb event, that may be throttled. - * If it was throttled, we add a custom breadcrumb to indicate that. - */ - throttledAddEvent(event, isCheckout) { - const res = this._throttledAddEvent(event, isCheckout); - if (res === THROTTLED) { - const breadcrumb = createBreadcrumb({ - category: "replay.throttled" - }); - this.addUpdate(() => { - return !addEventSync(this, { - type: ReplayEventTypeCustom, - timestamp: breadcrumb.timestamp || 0, - data: { - tag: "breadcrumb", - payload: breadcrumb, - metric: true - } - }); - }); - } - return res; - } - /** - * This will get the parametrized route name of the current page. - * This is only available if performance is enabled, and if an instrumented router is used. - */ - getCurrentRoute() { - const lastActiveSpan = this.lastActiveSpan || getActiveSpan(); - const lastRootSpan = lastActiveSpan && getRootSpan(lastActiveSpan); - const attributes = lastRootSpan && spanToJSON(lastRootSpan).data || {}; - const source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; - if (!lastRootSpan || !source || !["route", "custom"].includes(source)) { - return void 0; - } - return spanToJSON(lastRootSpan).description; - } - /** - * Initialize and start all listeners to varying events (DOM, - * Performance Observer, Recording, Sentry SDK, etc) - */ - _initializeRecording() { - this.setInitialState(); - this._updateSessionActivity(); - this.eventBuffer = createEventBuffer({ - useCompression: this._options.useCompression, - workerUrl: this._options.workerUrl - }); - this._removeListeners(); - this._addListeners(); - this._isEnabled = true; - this._isPaused = false; - this.startRecording(); - } - /** - * Loads (or refreshes) the current session. - */ - _initializeSessionForSampling(previousSessionId) { - const allowBuffering = this._options.errorSampleRate > 0; - const session = loadOrCreateSession( - { - sessionIdleExpire: this.timeouts.sessionIdleExpire, - maxReplayDuration: this._options.maxReplayDuration, - previousSessionId - }, - { - stickySession: this._options.stickySession, - sessionSampleRate: this._options.sessionSampleRate, - allowBuffering - } - ); - this.session = session; - } - /** - * Checks and potentially refreshes the current session. - * Returns false if session is not recorded. - */ - _checkSession() { - if (!this.session) { - return false; - } - const currentSession = this.session; - if (shouldRefreshSession(currentSession, { - sessionIdleExpire: this.timeouts.sessionIdleExpire, - maxReplayDuration: this._options.maxReplayDuration - })) { - this._refreshSession(currentSession); - return false; - } - return true; - } - /** - * Refresh a session with a new one. - * This stops the current session (without forcing a flush, as that would never work since we are expired), - * and then does a new sampling based on the refreshed session. - */ - async _refreshSession(session) { - if (!this._isEnabled) { - return; - } - await this.stop({ reason: "refresh session" }); - this.initializeSampling(session.id); - } - /** - * Adds listeners to record events for the replay - */ - _addListeners() { - try { - WINDOW$1.document.addEventListener("visibilitychange", this._handleVisibilityChange); - WINDOW$1.addEventListener("blur", this._handleWindowBlur); - WINDOW$1.addEventListener("focus", this._handleWindowFocus); - WINDOW$1.addEventListener("keydown", this._handleKeyboardEvent); - if (this.clickDetector) { - this.clickDetector.addListeners(); - } - if (!this._hasInitializedCoreListeners) { - addGlobalListeners(this); - this._hasInitializedCoreListeners = true; - } - } catch (err) { - this.handleException(err); - } - this._performanceCleanupCallback = setupPerformanceObserver(this); - } - /** - * Cleans up listeners that were created in `_addListeners` - */ - _removeListeners() { - try { - WINDOW$1.document.removeEventListener("visibilitychange", this._handleVisibilityChange); - WINDOW$1.removeEventListener("blur", this._handleWindowBlur); - WINDOW$1.removeEventListener("focus", this._handleWindowFocus); - WINDOW$1.removeEventListener("keydown", this._handleKeyboardEvent); - if (this.clickDetector) { - this.clickDetector.removeListeners(); - } - if (this._performanceCleanupCallback) { - this._performanceCleanupCallback(); - } - } catch (err) { - this.handleException(err); - } - } - /** - * Handle when visibility of the page content changes. Opening a new tab will - * cause the state to change to hidden because of content of current page will - * be hidden. Likewise, moving a different window to cover the contents of the - * page will also trigger a change to a hidden state. - */ - __init() { - this._handleVisibilityChange = () => { - if (WINDOW$1.document.visibilityState === "visible") { - this._doChangeToForegroundTasks(); - } else { - this._doChangeToBackgroundTasks(); - } - }; - } - /** - * Handle when page is blurred - */ - __init2() { - this._handleWindowBlur = () => { - const breadcrumb = createBreadcrumb({ - category: "ui.blur" - }); - this._doChangeToBackgroundTasks(breadcrumb); - }; - } - /** - * Handle when page is focused - */ - __init3() { - this._handleWindowFocus = () => { - const breadcrumb = createBreadcrumb({ - category: "ui.focus" - }); - this._doChangeToForegroundTasks(breadcrumb); - }; - } - /** Ensure page remains active when a key is pressed. */ - __init4() { - this._handleKeyboardEvent = (event) => { - handleKeyboardEvent(this, event); - }; - } - /** - * Tasks to run when we consider a page to be hidden (via blurring and/or visibility) - */ - _doChangeToBackgroundTasks(breadcrumb) { - if (!this.session) { - return; - } - const expired = isSessionExpired(this.session, { - maxReplayDuration: this._options.maxReplayDuration, - sessionIdleExpire: this.timeouts.sessionIdleExpire - }); - if (expired) { - return; - } - if (breadcrumb) { - this._createCustomBreadcrumb(breadcrumb); - } - void this.conditionalFlush(); - } - /** - * Tasks to run when we consider a page to be visible (via focus and/or visibility) - */ - _doChangeToForegroundTasks(breadcrumb) { - if (!this.session) { - return; - } - const isSessionActive = this.checkAndHandleExpiredSession(); - if (!isSessionActive) { - DEBUG_BUILD$2 && logger$1.info("Document has become active, but session has expired"); - return; - } - if (breadcrumb) { - this._createCustomBreadcrumb(breadcrumb); - } - } - /** - * Update user activity (across session lifespans) - */ - _updateUserActivity(_lastActivity = Date.now()) { - this._lastActivity = _lastActivity; - } - /** - * Updates the session's last activity timestamp - */ - _updateSessionActivity(_lastActivity = Date.now()) { - if (this.session) { - this.session.lastActivity = _lastActivity; - this._maybeSaveSession(); - } - } - /** - * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb - */ - _createCustomBreadcrumb(breadcrumb) { - this.addUpdate(() => { - this.throttledAddEvent({ - type: EventType.Custom, - timestamp: breadcrumb.timestamp || 0, - data: { - tag: "breadcrumb", - payload: breadcrumb - } - }); - }); - } - /** - * Observed performance events are added to `this.performanceEntries`. These - * are included in the replay event before it is finished and sent to Sentry. - */ - _addPerformanceEntries() { - let performanceEntries = createPerformanceEntries(this.performanceEntries).concat(this.replayPerformanceEntries); - this.performanceEntries = []; - this.replayPerformanceEntries = []; - if (this._requiresManualStart) { - const initialTimestampInSeconds = this._context.initialTimestamp / 1e3; - performanceEntries = performanceEntries.filter((entry) => entry.start >= initialTimestampInSeconds); - } - return Promise.all(createPerformanceSpans(this, performanceEntries)); - } - /** - * Clear _context - */ - _clearContext() { - this._context.errorIds.clear(); - this._context.traceIds.clear(); - this._context.urls = []; - } - /** Update the initial timestamp based on the buffer content. */ - _updateInitialTimestampFromEventBuffer() { - const { session, eventBuffer } = this; - if (!session || !eventBuffer || this._requiresManualStart) { - return; - } - if (session.segmentId) { - return; - } - const earliestEvent = eventBuffer.getEarliestTimestamp(); - if (earliestEvent && earliestEvent < this._context.initialTimestamp) { - this._context.initialTimestamp = earliestEvent; - } - } - /** - * Return and clear _context - */ - _popEventContext() { - const _context = { - initialTimestamp: this._context.initialTimestamp, - initialUrl: this._context.initialUrl, - errorIds: Array.from(this._context.errorIds), - traceIds: Array.from(this._context.traceIds), - urls: this._context.urls - }; - this._clearContext(); - return _context; - } - /** - * Flushes replay event buffer to Sentry. - * - * Performance events are only added right before flushing - this is - * due to the buffered performance observer events. - * - * Should never be called directly, only by `flush` - */ - async _runFlush() { - const replayId = this.getSessionId(); - if (!this.session || !this.eventBuffer || !replayId) { - DEBUG_BUILD$2 && logger$1.error("No session or eventBuffer found to flush."); - return; - } - await this._addPerformanceEntries(); - if (!this.eventBuffer || !this.eventBuffer.hasEvents) { - return; - } - await addMemoryEntry(this); - if (!this.eventBuffer) { - return; - } - if (replayId !== this.getSessionId()) { - return; - } - try { - this._updateInitialTimestampFromEventBuffer(); - const timestamp2 = Date.now(); - if (timestamp2 - this._context.initialTimestamp > this._options.maxReplayDuration + 3e4) { - throw new Error("Session is too long, not sending replay"); - } - const eventContext = this._popEventContext(); - const segmentId = this.session.segmentId++; - this._maybeSaveSession(); - const recordingData = await this.eventBuffer.finish(); - await sendReplay({ - replayId, - recordingData, - segmentId, - eventContext, - session: this.session, - timestamp: timestamp2, - onError: /* @__PURE__ */ __name((err) => this.handleException(err), "onError") - }); - } catch (err) { - this.handleException(err); - this.stop({ reason: "sendReplay" }); - const client = getClient(); - if (client) { - const dropReason = err instanceof RateLimitError ? "ratelimit_backoff" : "send_error"; - client.recordDroppedEvent(dropReason, "replay"); - } - } - } - /** - * Flush recording data to Sentry. Creates a lock so that only a single flush - * can be active at a time. Do not call this directly. - */ - __init5() { - this._flush = async ({ - force = false - } = {}) => { - if (!this._isEnabled && !force) { - return; - } - if (!this.checkAndHandleExpiredSession()) { - DEBUG_BUILD$2 && logger$1.error("Attempting to finish replay event after session expired."); - return; - } - if (!this.session) { - return; - } - const start2 = this.session.started; - const now2 = Date.now(); - const duration = now2 - start2; - this._debouncedFlush.cancel(); - const tooShort = duration < this._options.minReplayDuration; - const tooLong = duration > this._options.maxReplayDuration + 5e3; - if (tooShort || tooLong) { - DEBUG_BUILD$2 && logger$1.info( - `Session duration (${Math.floor(duration / 1e3)}s) is too ${tooShort ? "short" : "long"}, not sending replay.` - ); - if (tooShort) { - this._debouncedFlush(); - } - return; - } - const eventBuffer = this.eventBuffer; - if (eventBuffer && this.session.segmentId === 0 && !eventBuffer.hasCheckout) { - DEBUG_BUILD$2 && logger$1.info("Flushing initial segment without checkout."); - } - const _flushInProgress = !!this._flushLock; - if (!this._flushLock) { - this._flushLock = this._runFlush(); - } - try { - await this._flushLock; - } catch (err) { - this.handleException(err); - } finally { - this._flushLock = void 0; - if (_flushInProgress) { - this._debouncedFlush(); - } - } - }; - } - /** Save the session, if it is sticky */ - _maybeSaveSession() { - if (this.session && this._options.stickySession) { - saveSession(this.session); - } - } - /** Handler for rrweb.record.onMutation */ - __init6() { - this._onMutationHandler = (mutations) => { - const count = mutations.length; - const mutationLimit = this._options.mutationLimit; - const mutationBreadcrumbLimit = this._options.mutationBreadcrumbLimit; - const overMutationLimit = mutationLimit && count > mutationLimit; - if (count > mutationBreadcrumbLimit || overMutationLimit) { - const breadcrumb = createBreadcrumb({ - category: "replay.mutations", - data: { - count, - limit: overMutationLimit - } - }); - this._createCustomBreadcrumb(breadcrumb); - } - if (overMutationLimit) { - this.stop({ reason: "mutationLimit", forceFlush: this.recordingMode === "session" }); - return false; - } - return true; - }; - } -} -function getOption(selectors, defaultSelectors) { - return [ - ...selectors, - // sentry defaults - ...defaultSelectors - ].join(","); -} -__name(getOption, "getOption"); -function getPrivacyOptions({ mask: mask3, unmask, block: block3, unblock: unblock2, ignore }) { - const defaultBlockedElements = ["base", "iframe[srcdoc]:not([src])"]; - const maskSelector = getOption(mask3, [".sentry-mask", "[data-sentry-mask]"]); - const unmaskSelector = getOption(unmask, []); - const options4 = { - // We are making the decision to make text and input selectors the same - maskTextSelector: maskSelector, - unmaskTextSelector: unmaskSelector, - blockSelector: getOption(block3, [".sentry-block", "[data-sentry-block]", ...defaultBlockedElements]), - unblockSelector: getOption(unblock2, []), - ignoreSelector: getOption(ignore, [".sentry-ignore", "[data-sentry-ignore]", 'input[type="file"]']) - }; - return options4; -} -__name(getPrivacyOptions, "getPrivacyOptions"); -function maskAttribute({ - el, - key, - maskAttributes, - maskAllText, - privacyOptions, - value: value4 -}) { - if (!maskAllText) { - return value4; - } - if (privacyOptions.unmaskTextSelector && el.matches(privacyOptions.unmaskTextSelector)) { - return value4; - } - if (maskAttributes.includes(key) || // Need to mask `value` attribute for `` if it's a button-like - // type - key === "value" && el.tagName === "INPUT" && ["submit", "button"].includes(el.getAttribute("type") || "")) { - return value4.replace(/[\S]/g, "*"); - } - return value4; -} -__name(maskAttribute, "maskAttribute"); -const MEDIA_SELECTORS = 'img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]'; -const DEFAULT_NETWORK_HEADERS = ["content-length", "content-type", "accept"]; -let _initialized = false; -const replayIntegration = /* @__PURE__ */ __name((options4) => { - return new Replay(options4); -}, "replayIntegration"); -class Replay { - static { - __name(this, "Replay"); - } - /** - * @inheritDoc - */ - static __initStatic() { - this.id = "Replay"; - } - /** - * @inheritDoc - */ - /** - * Options to pass to `rrweb.record()` - */ - /** - * Initial options passed to the replay integration, merged with default values. - * Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they - * can only be finally set when setupOnce() is called. - * - * @private - */ - constructor({ - flushMinDelay = DEFAULT_FLUSH_MIN_DELAY, - flushMaxDelay = DEFAULT_FLUSH_MAX_DELAY, - minReplayDuration = MIN_REPLAY_DURATION, - maxReplayDuration = MAX_REPLAY_DURATION, - stickySession = true, - useCompression = true, - workerUrl, - _experiments = {}, - maskAllText = true, - maskAllInputs = true, - blockAllMedia = true, - mutationBreadcrumbLimit = 750, - mutationLimit = 1e4, - slowClickTimeout = 7e3, - slowClickIgnoreSelectors = [], - networkDetailAllowUrls = [], - networkDetailDenyUrls = [], - networkCaptureBodies = true, - networkRequestHeaders = [], - networkResponseHeaders = [], - mask: mask3 = [], - maskAttributes = ["title", "placeholder"], - unmask = [], - block: block3 = [], - unblock: unblock2 = [], - ignore = [], - maskFn, - beforeAddRecordingEvent, - beforeErrorSampling, - onError - } = {}) { - this.name = Replay.id; - const privacyOptions = getPrivacyOptions({ - mask: mask3, - unmask, - block: block3, - unblock: unblock2, - ignore - }); - this._recordingOptions = { - maskAllInputs, - maskAllText, - maskInputOptions: { password: true }, - maskTextFn: maskFn, - maskInputFn: maskFn, - maskAttributeFn: /* @__PURE__ */ __name((key, value4, el) => maskAttribute({ - maskAttributes, - maskAllText, - privacyOptions, - key, - value: value4, - el - }), "maskAttributeFn"), - ...privacyOptions, - // Our defaults - slimDOMOptions: "all", - inlineStylesheet: true, - // Disable inline images as it will increase segment/replay size - inlineImages: false, - // collect fonts, but be aware that `sentry.io` needs to be an allowed - // origin for playback - collectFonts: true, - errorHandler: /* @__PURE__ */ __name((err) => { - try { - err.__rrweb__ = true; - } catch (error2) { - } - }, "errorHandler") - }; - this._initialOptions = { - flushMinDelay, - flushMaxDelay, - minReplayDuration: Math.min(minReplayDuration, MIN_REPLAY_DURATION_LIMIT), - maxReplayDuration: Math.min(maxReplayDuration, MAX_REPLAY_DURATION), - stickySession, - useCompression, - workerUrl, - blockAllMedia, - maskAllInputs, - maskAllText, - mutationBreadcrumbLimit, - mutationLimit, - slowClickTimeout, - slowClickIgnoreSelectors, - networkDetailAllowUrls, - networkDetailDenyUrls, - networkCaptureBodies, - networkRequestHeaders: _getMergedNetworkHeaders(networkRequestHeaders), - networkResponseHeaders: _getMergedNetworkHeaders(networkResponseHeaders), - beforeAddRecordingEvent, - beforeErrorSampling, - onError, - _experiments - }; - if (this._initialOptions.blockAllMedia) { - this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector ? MEDIA_SELECTORS : `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`; - } - if (this._isInitialized && isBrowser$1()) { - throw new Error("Multiple Sentry Session Replay instances are not supported"); - } - this._isInitialized = true; - } - /** If replay has already been initialized */ - get _isInitialized() { - return _initialized; - } - /** Update _isInitialized */ - set _isInitialized(value4) { - _initialized = value4; - } - /** - * Setup and initialize replay container - */ - afterAllSetup(client) { - if (!isBrowser$1() || this._replay) { - return; - } - this._setup(client); - this._initialize(client); - } - /** - * Start a replay regardless of sampling rate. Calling this will always - * create a new session. Will log a message if replay is already in progress. - * - * Creates or loads a session, attaches listeners to varying events (DOM, - * PerformanceObserver, Recording, Sentry SDK, etc) - */ - start() { - if (!this._replay) { - return; - } - this._replay.start(); - } - /** - * Start replay buffering. Buffers until `flush()` is called or, if - * `replaysOnErrorSampleRate` > 0, until an error occurs. - */ - startBuffering() { - if (!this._replay) { - return; - } - this._replay.startBuffering(); - } - /** - * Currently, this needs to be manually called (e.g. for tests). Sentry SDK - * does not support a teardown - */ - stop() { - if (!this._replay) { - return Promise.resolve(); - } - return this._replay.stop({ forceFlush: this._replay.recordingMode === "session" }); - } - /** - * If not in "session" recording mode, flush event buffer which will create a new replay. - * If replay is not enabled, a new session replay is started. - * Unless `continueRecording` is false, the replay will continue to record and - * behave as a "session"-based replay. - * - * Otherwise, queue up a flush. - */ - flush(options4) { - if (!this._replay) { - return Promise.resolve(); - } - if (!this._replay.isEnabled()) { - this._replay.start(); - return Promise.resolve(); - } - return this._replay.sendBufferedReplayOrFlush(options4); - } - /** - * Get the current session ID. - */ - getReplayId() { - if (!this._replay || !this._replay.isEnabled()) { - return; - } - return this._replay.getSessionId(); - } - /** - * Get the current recording mode. This can be either `session` or `buffer`. - * - * `session`: Recording the whole session, sending it continuously - * `buffer`: Always keeping the last 60s of recording, requires: - * - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs - * - or calling `flush()` to send the replay - */ - getRecordingMode() { - if (!this._replay || !this._replay.isEnabled()) { - return; - } - return this._replay.recordingMode; - } - /** - * Initializes replay. - */ - _initialize(client) { - if (!this._replay) { - return; - } - this._maybeLoadFromReplayCanvasIntegration(client); - this._replay.initializeSampling(); - } - /** Setup the integration. */ - _setup(client) { - const finalOptions = loadReplayOptionsFromClient(this._initialOptions, client); - this._replay = new ReplayContainer({ - options: finalOptions, - recordingOptions: this._recordingOptions - }); - } - /** Get canvas options from ReplayCanvas integration, if it is also added. */ - _maybeLoadFromReplayCanvasIntegration(client) { - try { - const canvasIntegration = client.getIntegrationByName("ReplayCanvas"); - if (!canvasIntegration) { - return; - } - this._replay["_canvas"] = canvasIntegration.getOptions(); - } catch (e2) { - } - } -} -Replay.__initStatic(); -function loadReplayOptionsFromClient(initialOptions, client) { - const opt = client.getOptions(); - const finalOptions = { - sessionSampleRate: 0, - errorSampleRate: 0, - ...dropUndefinedKeys(initialOptions) - }; - const replaysSessionSampleRate = parseSampleRate(opt.replaysSessionSampleRate); - const replaysOnErrorSampleRate = parseSampleRate(opt.replaysOnErrorSampleRate); - if (replaysSessionSampleRate == null && replaysOnErrorSampleRate == null) { - consoleSandbox(() => { - console.warn( - "Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set." - ); - }); - } - if (replaysSessionSampleRate != null) { - finalOptions.sessionSampleRate = replaysSessionSampleRate; - } - if (replaysOnErrorSampleRate != null) { - finalOptions.errorSampleRate = replaysOnErrorSampleRate; - } - return finalOptions; -} -__name(loadReplayOptionsFromClient, "loadReplayOptionsFromClient"); -function _getMergedNetworkHeaders(headers) { - return [...DEFAULT_NETWORK_HEADERS, ...headers.map((header3) => header3.toLowerCase())]; -} -__name(_getMergedNetworkHeaders, "_getMergedNetworkHeaders"); -function getReplay() { - const client = getClient(); - return client && client.getIntegrationByName("Replay"); -} -__name(getReplay, "getReplay"); -var NodeType$2; -(function(NodeType3) { - NodeType3[NodeType3["Document"] = 0] = "Document"; - NodeType3[NodeType3["DocumentType"] = 1] = "DocumentType"; - NodeType3[NodeType3["Element"] = 2] = "Element"; - NodeType3[NodeType3["Text"] = 3] = "Text"; - NodeType3[NodeType3["CDATA"] = 4] = "CDATA"; - NodeType3[NodeType3["Comment"] = 5] = "Comment"; -})(NodeType$2 || (NodeType$2 = {})); -function elementClassMatchesRegex(el, regex2) { - for (let eIndex = el.classList.length; eIndex--; ) { - const className = el.classList[eIndex]; - if (regex2.test(className)) { - return true; - } - } - return false; -} -__name(elementClassMatchesRegex, "elementClassMatchesRegex"); -function distanceToMatch(node3, matchPredicate, limit = Infinity, distance2 = 0) { - if (!node3) - return -1; - if (node3.nodeType !== node3.ELEMENT_NODE) - return -1; - if (distance2 > limit) - return -1; - if (matchPredicate(node3)) - return distance2; - return distanceToMatch(node3.parentNode, matchPredicate, limit, distance2 + 1); -} -__name(distanceToMatch, "distanceToMatch"); -function createMatchPredicate(className, selector) { - return (node3) => { - const el = node3; - if (el === null) - return false; - try { - if (className) { - if (typeof className === "string") { - if (el.matches(`.${className}`)) - return true; - } else if (elementClassMatchesRegex(el, className)) { - return true; - } - } - if (selector && el.matches(selector)) - return true; - return false; - } catch (e2) { - return false; - } - }; -} -__name(createMatchPredicate, "createMatchPredicate"); -const DEPARTED_MIRROR_ACCESS_WARNING = "Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording."; -let _mirror = { - map: {}, - getId() { - console.error(DEPARTED_MIRROR_ACCESS_WARNING); - return -1; - }, - getNode() { - console.error(DEPARTED_MIRROR_ACCESS_WARNING); - return null; - }, - removeNodeFromMap() { - console.error(DEPARTED_MIRROR_ACCESS_WARNING); - }, - has() { - console.error(DEPARTED_MIRROR_ACCESS_WARNING); - return false; - }, - reset() { - console.error(DEPARTED_MIRROR_ACCESS_WARNING); - } -}; -if (typeof window !== "undefined" && window.Proxy && window.Reflect) { - _mirror = new Proxy(_mirror, { - get(target2, prop2, receiver) { - if (prop2 === "map") { - console.error(DEPARTED_MIRROR_ACCESS_WARNING); - } - return Reflect.get(target2, prop2, receiver); - } - }); -} -function hookSetter(target2, key, d2, isRevoked, win = window) { - const original = win.Object.getOwnPropertyDescriptor(target2, key); - win.Object.defineProperty(target2, key, isRevoked ? d2 : { - set(value4) { - setTimeout$1(() => { - d2.set.call(this, value4); - }, 0); - if (original && original.set) { - original.set.call(this, value4); - } - } - }); - return () => hookSetter(target2, key, original || {}, true); -} -__name(hookSetter, "hookSetter"); -function patch$1(source, name2, replacement) { - try { - if (!(name2 in source)) { - return () => { - }; - } - const original = source[name2]; - const wrapped = replacement(original); - if (typeof wrapped === "function") { - wrapped.prototype = wrapped.prototype || {}; - Object.defineProperties(wrapped, { - __rrweb_original__: { - enumerable: false, - value: original - } - }); - } - source[name2] = wrapped; - return () => { - source[name2] = original; - }; - } catch (e2) { - return () => { - }; - } -} -__name(patch$1, "patch$1"); -if (!/[1-9][0-9]{12}/.test(Date.now().toString())) ; -function closestElementOfNode(node3) { - if (!node3) { - return null; - } - const el = node3.nodeType === node3.ELEMENT_NODE ? node3 : node3.parentElement; - return el; -} -__name(closestElementOfNode, "closestElementOfNode"); -function isBlocked(node3, blockClass, blockSelector, unblockSelector, checkAncestors) { - if (!node3) { - return false; - } - const el = closestElementOfNode(node3); - if (!el) { - return false; - } - const blockedPredicate = createMatchPredicate(blockClass, blockSelector); - const blockDistance = distanceToMatch(el, blockedPredicate); - let unblockDistance = -1; - if (blockDistance < 0) { - return false; - } - if (unblockSelector) { - unblockDistance = distanceToMatch(el, createMatchPredicate(null, unblockSelector)); - } - if (blockDistance > -1 && unblockDistance < 0) { - return true; - } - return blockDistance < unblockDistance; -} -__name(isBlocked, "isBlocked"); -const cachedImplementations = {}; -function getImplementation(name2) { - const cached = cachedImplementations[name2]; - if (cached) { - return cached; - } - const document2 = window.document; - let impl = window[name2]; - if (document2 && typeof document2.createElement === "function") { - try { - const sandbox = document2.createElement("iframe"); - sandbox.hidden = true; - document2.head.appendChild(sandbox); - const contentWindow = sandbox.contentWindow; - if (contentWindow && contentWindow[name2]) { - impl = contentWindow[name2]; - } - document2.head.removeChild(sandbox); - } catch (e2) { - } - } - return cachedImplementations[name2] = impl.bind(window); -} -__name(getImplementation, "getImplementation"); -function onRequestAnimationFrame(...rest) { - return getImplementation("requestAnimationFrame")(...rest); -} -__name(onRequestAnimationFrame, "onRequestAnimationFrame"); -function setTimeout$1(...rest) { - return getImplementation("setTimeout")(...rest); -} -__name(setTimeout$1, "setTimeout$1"); -var CanvasContext = /* @__PURE__ */ ((CanvasContext2) => { - CanvasContext2[CanvasContext2["2D"] = 0] = "2D"; - CanvasContext2[CanvasContext2["WebGL"] = 1] = "WebGL"; - CanvasContext2[CanvasContext2["WebGL2"] = 2] = "WebGL2"; - return CanvasContext2; -})(CanvasContext || {}); -let errorHandler; -function registerErrorHandler(handler10) { - errorHandler = handler10; -} -__name(registerErrorHandler, "registerErrorHandler"); -const callbackWrapper = /* @__PURE__ */ __name((cb) => { - if (!errorHandler) { - return cb; - } - const rrwebWrapped = /* @__PURE__ */ __name((...rest) => { - try { - return cb(...rest); - } catch (error2) { - if (errorHandler && errorHandler(error2) === true) { - return () => { - }; - } - throw error2; - } - }, "rrwebWrapped"); - return rrwebWrapped; -}, "callbackWrapper"); -var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256); -for (var i$3 = 0; i$3 < chars.length; i$3++) { - lookup[chars.charCodeAt(i$3)] = i$3; -} -var encode$6 = /* @__PURE__ */ __name(function(arraybuffer) { - var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = ""; - for (i2 = 0; i2 < len; i2 += 3) { - base64 += chars[bytes[i2] >> 2]; - base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4]; - base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6]; - base64 += chars[bytes[i2 + 2] & 63]; - } - if (len % 3 === 2) { - base64 = base64.substring(0, base64.length - 1) + "="; - } else if (len % 3 === 1) { - base64 = base64.substring(0, base64.length - 2) + "=="; - } - return base64; -}, "encode$6"); -const canvasVarMap = /* @__PURE__ */ new Map(); -function variableListFor(ctx, ctor) { - let contextMap = canvasVarMap.get(ctx); - if (!contextMap) { - contextMap = /* @__PURE__ */ new Map(); - canvasVarMap.set(ctx, contextMap); - } - if (!contextMap.has(ctor)) { - contextMap.set(ctor, []); - } - return contextMap.get(ctor); -} -__name(variableListFor, "variableListFor"); -const saveWebGLVar = /* @__PURE__ */ __name((value4, win, ctx) => { - if (!value4 || !(isInstanceOfWebGLObject(value4, win) || typeof value4 === "object")) - return; - const name2 = value4.constructor.name; - const list2 = variableListFor(ctx, name2); - let index2 = list2.indexOf(value4); - if (index2 === -1) { - index2 = list2.length; - list2.push(value4); - } - return index2; -}, "saveWebGLVar"); -function serializeArg(value4, win, ctx) { - if (value4 instanceof Array) { - return value4.map((arg) => serializeArg(arg, win, ctx)); - } else if (value4 === null) { - return value4; - } else if (value4 instanceof Float32Array || value4 instanceof Float64Array || value4 instanceof Int32Array || value4 instanceof Uint32Array || value4 instanceof Uint8Array || value4 instanceof Uint16Array || value4 instanceof Int16Array || value4 instanceof Int8Array || value4 instanceof Uint8ClampedArray) { - const name2 = value4.constructor.name; - return { - rr_type: name2, - args: [Object.values(value4)] - }; - } else if (value4 instanceof ArrayBuffer) { - const name2 = value4.constructor.name; - const base64 = encode$6(value4); - return { - rr_type: name2, - base64 - }; - } else if (value4 instanceof DataView) { - const name2 = value4.constructor.name; - return { - rr_type: name2, - args: [ - serializeArg(value4.buffer, win, ctx), - value4.byteOffset, - value4.byteLength - ] - }; - } else if (value4 instanceof HTMLImageElement) { - const name2 = value4.constructor.name; - const { src } = value4; - return { - rr_type: name2, - src - }; - } else if (value4 instanceof HTMLCanvasElement) { - const name2 = "HTMLImageElement"; - const src = value4.toDataURL(); - return { - rr_type: name2, - src - }; - } else if (value4 instanceof ImageData) { - const name2 = value4.constructor.name; - return { - rr_type: name2, - args: [serializeArg(value4.data, win, ctx), value4.width, value4.height] - }; - } else if (isInstanceOfWebGLObject(value4, win) || typeof value4 === "object") { - const name2 = value4.constructor.name; - const index2 = saveWebGLVar(value4, win, ctx); - return { - rr_type: name2, - index: index2 - }; - } - return value4; -} -__name(serializeArg, "serializeArg"); -const serializeArgs = /* @__PURE__ */ __name((args, win, ctx) => { - return args.map((arg) => serializeArg(arg, win, ctx)); -}, "serializeArgs"); -const isInstanceOfWebGLObject = /* @__PURE__ */ __name((value4, win) => { - const webGLConstructorNames = [ - "WebGLActiveInfo", - "WebGLBuffer", - "WebGLFramebuffer", - "WebGLProgram", - "WebGLRenderbuffer", - "WebGLShader", - "WebGLShaderPrecisionFormat", - "WebGLTexture", - "WebGLUniformLocation", - "WebGLVertexArrayObject", - "WebGLVertexArrayObjectOES" - ]; - const supportedWebGLConstructorNames = webGLConstructorNames.filter((name2) => typeof win[name2] === "function"); - return Boolean(supportedWebGLConstructorNames.find((name2) => value4 instanceof win[name2])); -}, "isInstanceOfWebGLObject"); -function initCanvas2DMutationObserver(cb, win, blockClass, blockSelector, unblockSelector) { - const handlers2 = []; - const props2D = Object.getOwnPropertyNames(win.CanvasRenderingContext2D.prototype); - for (const prop2 of props2D) { - try { - if (typeof win.CanvasRenderingContext2D.prototype[prop2] !== "function") { - continue; - } - const restoreHandler = patch$1(win.CanvasRenderingContext2D.prototype, prop2, function(original) { - return function(...args) { - if (!isBlocked(this.canvas, blockClass, blockSelector, unblockSelector, true)) { - setTimeout$1(() => { - const recordArgs = serializeArgs(args, win, this); - cb(this.canvas, { - type: CanvasContext["2D"], - property: prop2, - args: recordArgs - }); - }, 0); - } - return original.apply(this, args); - }; - }); - handlers2.push(restoreHandler); - } catch (e2) { - const hookHandler = hookSetter(win.CanvasRenderingContext2D.prototype, prop2, { - set(v2) { - cb(this.canvas, { - type: CanvasContext["2D"], - property: prop2, - args: [v2], - setter: true - }); - } - }); - handlers2.push(hookHandler); - } - } - return () => { - handlers2.forEach((h2) => h2()); - }; -} -__name(initCanvas2DMutationObserver, "initCanvas2DMutationObserver"); -function getNormalizedContextName(contextType) { - return contextType === "experimental-webgl" ? "webgl" : contextType; -} -__name(getNormalizedContextName, "getNormalizedContextName"); -function initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, setPreserveDrawingBufferToTrue) { - const handlers2 = []; - try { - const restoreHandler = patch$1(win.HTMLCanvasElement.prototype, "getContext", function(original) { - return function(contextType, ...args) { - if (!isBlocked(this, blockClass, blockSelector, unblockSelector, true)) { - const ctxName = getNormalizedContextName(contextType); - if (!("__context" in this)) - this.__context = ctxName; - if (setPreserveDrawingBufferToTrue && ["webgl", "webgl2"].includes(ctxName)) { - if (args[0] && typeof args[0] === "object") { - const contextAttributes = args[0]; - if (!contextAttributes.preserveDrawingBuffer) { - contextAttributes.preserveDrawingBuffer = true; - } - } else { - args.splice(0, 1, { - preserveDrawingBuffer: true - }); - } - } - } - return original.apply(this, [contextType, ...args]); - }; - }); - handlers2.push(restoreHandler); - } catch (e2) { - console.error("failed to patch HTMLCanvasElement.prototype.getContext"); - } - return () => { - handlers2.forEach((h2) => h2()); - }; -} -__name(initCanvasContextObserver, "initCanvasContextObserver"); -function patchGLPrototype(prototype2, type, cb, blockClass, blockSelector, unblockSelector, mirror2, win) { - const handlers2 = []; - const props = Object.getOwnPropertyNames(prototype2); - for (const prop2 of props) { - if ([ - "isContextLost", - "canvas", - "drawingBufferWidth", - "drawingBufferHeight" - ].includes(prop2)) { - continue; - } - try { - if (typeof prototype2[prop2] !== "function") { - continue; - } - const restoreHandler = patch$1(prototype2, prop2, function(original) { - return function(...args) { - const result = original.apply(this, args); - saveWebGLVar(result, win, this); - if ("tagName" in this.canvas && !isBlocked(this.canvas, blockClass, blockSelector, unblockSelector, true)) { - const recordArgs = serializeArgs(args, win, this); - const mutation = { - type, - property: prop2, - args: recordArgs - }; - cb(this.canvas, mutation); - } - return result; - }; - }); - handlers2.push(restoreHandler); - } catch (e2) { - const hookHandler = hookSetter(prototype2, prop2, { - set(v2) { - cb(this.canvas, { - type, - property: prop2, - args: [v2], - setter: true - }); - } - }); - handlers2.push(hookHandler); - } - } - return handlers2; -} -__name(patchGLPrototype, "patchGLPrototype"); -function initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector, unblockSelector, mirror2) { - const handlers2 = []; - handlers2.push(...patchGLPrototype(win.WebGLRenderingContext.prototype, CanvasContext.WebGL, cb, blockClass, blockSelector, unblockSelector, mirror2, win)); - if (typeof win.WebGL2RenderingContext !== "undefined") { - handlers2.push(...patchGLPrototype(win.WebGL2RenderingContext.prototype, CanvasContext.WebGL2, cb, blockClass, blockSelector, unblockSelector, mirror2, win)); - } - return () => { - handlers2.forEach((h2) => h2()); - }; -} -__name(initCanvasWebGLMutationObserver, "initCanvasWebGLMutationObserver"); -var r$2 = `for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};`; -function t$2() { - const t2 = new Blob([r$2]); - return URL.createObjectURL(t2); -} -__name(t$2, "t$2"); -class CanvasManager { - static { - __name(this, "CanvasManager"); - } - reset() { - this.pendingCanvasMutations.clear(); - this.restoreHandlers.forEach((handler10) => { - try { - handler10(); - } catch (e2) { - } - }); - this.restoreHandlers = []; - this.windowsSet = /* @__PURE__ */ new WeakSet(); - this.windows = []; - this.shadowDoms = /* @__PURE__ */ new Set(); - _optionalChain([this, "access", (_2) => _2.worker, "optionalAccess", (_2) => _2.terminate, "call", (_3) => _3()]); - this.worker = null; - this.snapshotInProgressMap = /* @__PURE__ */ new Map(); - } - freeze() { - this.frozen = true; - } - unfreeze() { - this.frozen = false; - } - lock() { - this.locked = true; - } - unlock() { - this.locked = false; - } - constructor(options4) { - this.pendingCanvasMutations = /* @__PURE__ */ new Map(); - this.rafStamps = { latestId: 0, invokeId: null }; - this.shadowDoms = /* @__PURE__ */ new Set(); - this.windowsSet = /* @__PURE__ */ new WeakSet(); - this.windows = []; - this.restoreHandlers = []; - this.frozen = false; - this.locked = false; - this.snapshotInProgressMap = /* @__PURE__ */ new Map(); - this.worker = null; - this.processMutation = (target2, mutation) => { - const newFrame = this.rafStamps.invokeId && this.rafStamps.latestId !== this.rafStamps.invokeId; - if (newFrame || !this.rafStamps.invokeId) - this.rafStamps.invokeId = this.rafStamps.latestId; - if (!this.pendingCanvasMutations.has(target2)) { - this.pendingCanvasMutations.set(target2, []); - } - this.pendingCanvasMutations.get(target2).push(mutation); - }; - const { sampling = "all", win, blockClass, blockSelector, unblockSelector, maxCanvasSize, recordCanvas, dataURLOptions, errorHandler: errorHandler2 } = options4; - this.mutationCb = options4.mutationCb; - this.mirror = options4.mirror; - this.options = options4; - if (errorHandler2) { - registerErrorHandler(errorHandler2); - } - if (recordCanvas && typeof sampling === "number" || options4.enableManualSnapshot) { - this.worker = this.initFPSWorker(); - } - this.addWindow(win); - if (options4.enableManualSnapshot) { - return; - } - callbackWrapper(() => { - if (recordCanvas && sampling === "all") { - this.startRAFTimestamping(); - this.startPendingCanvasMutationFlusher(); - } - if (recordCanvas && typeof sampling === "number") { - this.initCanvasFPSObserver(sampling, blockClass, blockSelector, unblockSelector, maxCanvasSize, { - dataURLOptions - }); - } - })(); - } - addWindow(win) { - const { sampling = "all", blockClass, blockSelector, unblockSelector, recordCanvas, enableManualSnapshot } = this.options; - if (this.windowsSet.has(win)) - return; - if (enableManualSnapshot) { - this.windowsSet.add(win); - this.windows.push(new WeakRef(win)); - return; - } - callbackWrapper(() => { - if (recordCanvas && sampling === "all") { - this.initCanvasMutationObserver(win, blockClass, blockSelector, unblockSelector); - } - if (recordCanvas && typeof sampling === "number") { - const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, true); - this.restoreHandlers.push(() => { - canvasContextReset(); - }); - } - })(); - this.windowsSet.add(win); - this.windows.push(new WeakRef(win)); - } - addShadowRoot(shadowRoot) { - this.shadowDoms.add(new WeakRef(shadowRoot)); - } - resetShadowRoots() { - this.shadowDoms = /* @__PURE__ */ new Set(); - } - initFPSWorker() { - const worker = new Worker(t$2()); - worker.onmessage = (e2) => { - const data26 = e2.data; - const { id: id3 } = data26; - this.snapshotInProgressMap.set(id3, false); - if (!("base64" in data26)) - return; - const { base64, type, width: width2, height } = data26; - this.mutationCb({ - id: id3, - type: CanvasContext["2D"], - commands: [ - { - property: "clearRect", - args: [0, 0, width2, height] - }, - { - property: "drawImage", - args: [ - { - rr_type: "ImageBitmap", - args: [ - { - rr_type: "Blob", - data: [{ rr_type: "ArrayBuffer", base64 }], - type - } - ] - }, - 0, - 0, - width2, - height - ] - } - ] - }); - }; - return worker; - } - initCanvasFPSObserver(fps, blockClass, blockSelector, unblockSelector, maxCanvasSize, options4) { - const rafId = this.takeSnapshot(false, fps, blockClass, blockSelector, unblockSelector, maxCanvasSize, options4.dataURLOptions); - this.restoreHandlers.push(() => { - cancelAnimationFrame(rafId); - }); - } - initCanvasMutationObserver(win, blockClass, blockSelector, unblockSelector) { - const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector, false); - const canvas2DReset = initCanvas2DMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector); - const canvasWebGL1and2Reset = initCanvasWebGLMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror); - this.restoreHandlers.push(() => { - canvasContextReset(); - canvas2DReset(); - canvasWebGL1and2Reset(); - }); - } - snapshot(canvasElement) { - const { options: options4 } = this; - const rafId = this.takeSnapshot(true, options4.sampling === "all" ? 2 : options4.sampling || 2, options4.blockClass, options4.blockSelector, options4.unblockSelector, options4.maxCanvasSize, options4.dataURLOptions, canvasElement); - this.restoreHandlers.push(() => { - cancelAnimationFrame(rafId); - }); - } - takeSnapshot(isManualSnapshot, fps, blockClass, blockSelector, unblockSelector, maxCanvasSize, dataURLOptions, canvasElement) { - const timeBetweenSnapshots = 1e3 / fps; - let lastSnapshotTime = 0; - let rafId; - const getCanvas = /* @__PURE__ */ __name((canvasElement2) => { - if (canvasElement2) { - return [canvasElement2]; - } - const matchedCanvas = []; - const searchCanvas = /* @__PURE__ */ __name((root29) => { - root29.querySelectorAll("canvas").forEach((canvas2) => { - if (!isBlocked(canvas2, blockClass, blockSelector, unblockSelector)) { - matchedCanvas.push(canvas2); - } - }); - }, "searchCanvas"); - for (const item3 of this.windows) { - const window2 = item3.deref(); - if (window2) { - searchCanvas(window2.document); - } - } - for (const item3 of this.shadowDoms) { - const shadowRoot = item3.deref(); - if (shadowRoot) { - searchCanvas(shadowRoot); - } - } - return matchedCanvas; - }, "getCanvas"); - const takeCanvasSnapshots = /* @__PURE__ */ __name((timestamp2) => { - if (!this.windows.length) { - return; - } - if (lastSnapshotTime && timestamp2 - lastSnapshotTime < timeBetweenSnapshots) { - rafId = onRequestAnimationFrame(takeCanvasSnapshots); - return; - } - lastSnapshotTime = timestamp2; - getCanvas(canvasElement).forEach((canvas2) => { - if (!this.mirror.hasNode(canvas2)) { - return; - } - const id3 = this.mirror.getId(canvas2); - if (this.snapshotInProgressMap.get(id3)) - return; - if (!canvas2.width || !canvas2.height) - return; - this.snapshotInProgressMap.set(id3, true); - if (!isManualSnapshot && ["webgl", "webgl2"].includes(canvas2.__context)) { - const context = canvas2.getContext(canvas2.__context); - if (_optionalChain([context, "optionalAccess", (_4) => _4.getContextAttributes, "call", (_5) => _5(), "optionalAccess", (_6) => _6.preserveDrawingBuffer]) === false) { - context.clear(context.COLOR_BUFFER_BIT); - } - } - createImageBitmap(canvas2).then((bitmap) => { - _optionalChain([this, "access", (_7) => _7.worker, "optionalAccess", (_8) => _8.postMessage, "call", (_9) => _9({ - id: id3, - bitmap, - width: canvas2.width, - height: canvas2.height, - dataURLOptions, - maxCanvasSize - }, [bitmap])]); - }).catch((error2) => { - callbackWrapper(() => { - throw error2; - })(); - }); - }); - if (!isManualSnapshot) { - rafId = onRequestAnimationFrame(takeCanvasSnapshots); - } - }, "takeCanvasSnapshots"); - rafId = onRequestAnimationFrame(takeCanvasSnapshots); - return rafId; - } - startPendingCanvasMutationFlusher() { - onRequestAnimationFrame(() => this.flushPendingCanvasMutations()); - } - startRAFTimestamping() { - const setLatestRAFTimestamp = /* @__PURE__ */ __name((timestamp2) => { - this.rafStamps.latestId = timestamp2; - onRequestAnimationFrame(setLatestRAFTimestamp); - }, "setLatestRAFTimestamp"); - onRequestAnimationFrame(setLatestRAFTimestamp); - } - flushPendingCanvasMutations() { - this.pendingCanvasMutations.forEach((values, canvas2) => { - const id3 = this.mirror.getId(canvas2); - this.flushPendingCanvasMutationFor(canvas2, id3); - }); - onRequestAnimationFrame(() => this.flushPendingCanvasMutations()); - } - flushPendingCanvasMutationFor(canvas2, id3) { - if (this.frozen || this.locked) { - return; - } - const valuesWithType = this.pendingCanvasMutations.get(canvas2); - if (!valuesWithType || id3 === -1) - return; - const values = valuesWithType.map((value4) => { - const { type: type2, ...rest } = value4; - return rest; - }); - const { type } = valuesWithType[0]; - this.mutationCb({ id: id3, type, commands: values }); - this.pendingCanvasMutations.delete(canvas2); - } -} -const CANVAS_QUALITY = { - low: { - sampling: { - canvas: 1 - }, - dataURLOptions: { - type: "image/webp", - quality: 0.25 - } - }, - medium: { - sampling: { - canvas: 2 - }, - dataURLOptions: { - type: "image/webp", - quality: 0.4 - } - }, - high: { - sampling: { - canvas: 4 - }, - dataURLOptions: { - type: "image/webp", - quality: 0.5 - } - } -}; -const INTEGRATION_NAME$3 = "ReplayCanvas"; -const DEFAULT_MAX_CANVAS_SIZE = 1280; -const _replayCanvasIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const [maxCanvasWidth, maxCanvasHeight] = options4.maxCanvasSize || []; - const _canvasOptions = { - quality: options4.quality || "medium", - enableManualSnapshot: options4.enableManualSnapshot, - maxCanvasSize: [ - maxCanvasWidth ? Math.min(maxCanvasWidth, DEFAULT_MAX_CANVAS_SIZE) : DEFAULT_MAX_CANVAS_SIZE, - maxCanvasHeight ? Math.min(maxCanvasHeight, DEFAULT_MAX_CANVAS_SIZE) : DEFAULT_MAX_CANVAS_SIZE - ] - }; - let canvasManagerResolve; - const _canvasManager = new Promise((resolve2) => canvasManagerResolve = resolve2); - return { - name: INTEGRATION_NAME$3, - getOptions() { - const { quality, enableManualSnapshot, maxCanvasSize } = _canvasOptions; - return { - enableManualSnapshot, - recordCanvas: true, - getCanvasManager: /* @__PURE__ */ __name((getCanvasManagerOptions) => { - const manager = new CanvasManager({ - ...getCanvasManagerOptions, - enableManualSnapshot, - maxCanvasSize, - errorHandler: /* @__PURE__ */ __name((err) => { - try { - if (typeof err === "object") { - err.__rrweb__ = true; - } - } catch (error2) { - } - }, "errorHandler") - }); - canvasManagerResolve(manager); - return manager; - }, "getCanvasManager"), - ...CANVAS_QUALITY[quality || "medium"] || CANVAS_QUALITY.medium - }; - }, - async snapshot(canvasElement) { - const canvasManager = await _canvasManager; - canvasManager.snapshot(canvasElement); - } - }; -}, "_replayCanvasIntegration"); -const replayCanvasIntegration = defineIntegration( - _replayCanvasIntegration -); -const WINDOW = GLOBAL_OBJ; -const DOCUMENT = WINDOW.document; -const NAVIGATOR = WINDOW.navigator; -const TRIGGER_LABEL = "Report a Bug"; -const CANCEL_BUTTON_LABEL = "Cancel"; -const SUBMIT_BUTTON_LABEL = "Send Bug Report"; -const CONFIRM_BUTTON_LABEL = "Confirm"; -const FORM_TITLE = "Report a Bug"; -const EMAIL_PLACEHOLDER = "your.email@example.org"; -const EMAIL_LABEL = "Email"; -const MESSAGE_PLACEHOLDER = "What's the bug? What did you expect?"; -const MESSAGE_LABEL = "Description"; -const NAME_PLACEHOLDER = "Your Name"; -const NAME_LABEL = "Name"; -const SUCCESS_MESSAGE_TEXT = "Thank you for your report!"; -const IS_REQUIRED_LABEL = "(required)"; -const ADD_SCREENSHOT_LABEL = "Add a screenshot"; -const REMOVE_SCREENSHOT_LABEL = "Remove screenshot"; -const FEEDBACK_WIDGET_SOURCE = "widget"; -const FEEDBACK_API_SOURCE = "api"; -const SUCCESS_MESSAGE_TIMEOUT = 5e3; -const sendFeedback = /* @__PURE__ */ __name((params, hint = { includeReplay: true }) => { - if (!params.message) { - throw new Error("Unable to submit feedback with empty message"); - } - const client = getClient(); - if (!client) { - throw new Error("No client setup, cannot send feedback."); - } - if (params.tags && Object.keys(params.tags).length) { - getCurrentScope$1().setTags(params.tags); - } - const eventId = captureFeedback( - { - source: FEEDBACK_API_SOURCE, - url: getLocationHref(), - ...params - }, - hint - ); - return new Promise((resolve2, reject3) => { - const timeout = setTimeout(() => reject3("Unable to determine if Feedback was correctly sent."), 5e3); - const cleanup = client.on("afterSendEvent", (event, response) => { - if (event.event_id !== eventId) { - return; - } - clearTimeout(timeout); - cleanup(); - if (response && typeof response.statusCode === "number" && response.statusCode >= 200 && response.statusCode < 300) { - return resolve2(eventId); - } - if (response && typeof response.statusCode === "number" && response.statusCode === 0) { - return reject3( - "Unable to send Feedback. This is because of network issues, or because you are using an ad-blocker." - ); - } - if (response && typeof response.statusCode === "number" && response.statusCode === 403) { - return reject3( - "Unable to send Feedback. This could be because this domain is not in your list of allowed domains." - ); - } - return reject3( - "Unable to send Feedback. This could be because of network issues, or because you are using an ad-blocker" - ); - }); - }); -}, "sendFeedback"); -const DEBUG_BUILD$1 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; -function isScreenshotSupported() { - if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(NAVIGATOR.userAgent)) { - return false; - } - if (/Macintosh/i.test(NAVIGATOR.userAgent) && NAVIGATOR.maxTouchPoints && NAVIGATOR.maxTouchPoints > 1) { - return false; - } - if (!isSecureContext) { - return false; - } - return true; -} -__name(isScreenshotSupported, "isScreenshotSupported"); -function mergeOptions$2(defaultOptions2, optionOverrides) { - return { - ...defaultOptions2, - ...optionOverrides, - tags: { - ...defaultOptions2.tags, - ...optionOverrides.tags - }, - onFormOpen: /* @__PURE__ */ __name(() => { - optionOverrides.onFormOpen && optionOverrides.onFormOpen(); - defaultOptions2.onFormOpen && defaultOptions2.onFormOpen(); - }, "onFormOpen"), - onFormClose: /* @__PURE__ */ __name(() => { - optionOverrides.onFormClose && optionOverrides.onFormClose(); - defaultOptions2.onFormClose && defaultOptions2.onFormClose(); - }, "onFormClose"), - onSubmitSuccess: /* @__PURE__ */ __name((data26) => { - optionOverrides.onSubmitSuccess && optionOverrides.onSubmitSuccess(data26); - defaultOptions2.onSubmitSuccess && defaultOptions2.onSubmitSuccess(data26); - }, "onSubmitSuccess"), - onSubmitError: /* @__PURE__ */ __name((error2) => { - optionOverrides.onSubmitError && optionOverrides.onSubmitError(error2); - defaultOptions2.onSubmitError && defaultOptions2.onSubmitError(error2); - }, "onSubmitError"), - onFormSubmitted: /* @__PURE__ */ __name(() => { - optionOverrides.onFormSubmitted && optionOverrides.onFormSubmitted(); - defaultOptions2.onFormSubmitted && defaultOptions2.onFormSubmitted(); - }, "onFormSubmitted"), - themeDark: { - ...defaultOptions2.themeDark, - ...optionOverrides.themeDark - }, - themeLight: { - ...defaultOptions2.themeLight, - ...optionOverrides.themeLight - } - }; -} -__name(mergeOptions$2, "mergeOptions$2"); -function createActorStyles(styleNonce) { - const style2 = DOCUMENT.createElement("style"); - style2.textContent = ` -.widget__actor { - position: fixed; - z-index: var(--z-index); - margin: var(--page-margin); - inset: var(--actor-inset); - - display: flex; - align-items: center; - gap: 8px; - padding: 16px; - - font-family: inherit; - font-size: var(--font-size); - font-weight: 600; - line-height: 1.14em; - text-decoration: none; - - background: var(--actor-background, var(--background)); - border-radius: var(--actor-border-radius, 1.7em/50%); - border: var(--actor-border, var(--border)); - box-shadow: var(--actor-box-shadow, var(--box-shadow)); - color: var(--actor-color, var(--foreground)); - fill: var(--actor-color, var(--foreground)); - cursor: pointer; - opacity: 1; - transition: transform 0.2s ease-in-out; - transform: translate(0, 0) scale(1); -} -.widget__actor[aria-hidden="true"] { - opacity: 0; - pointer-events: none; - visibility: hidden; - transform: translate(0, 16px) scale(0.98); -} - -.widget__actor:hover { - background: var(--actor-hover-background, var(--background)); - filter: var(--interactive-filter); -} - -.widget__actor svg { - width: 1.14em; - height: 1.14em; -} - -@media (max-width: 600px) { - .widget__actor span { - display: none; - } -} -`; - if (styleNonce) { - style2.setAttribute("nonce", styleNonce); - } - return style2; -} -__name(createActorStyles, "createActorStyles"); -function setAttributesNS(el, attributes) { - Object.entries(attributes).forEach(([key, val]) => { - el.setAttributeNS(null, key, val); - }); - return el; -} -__name(setAttributesNS, "setAttributesNS"); -const SIZE$1 = 20; -const XMLNS$2 = "http://www.w3.org/2000/svg"; -function FeedbackIcon() { - const createElementNS = /* @__PURE__ */ __name((tagName) => WINDOW.document.createElementNS(XMLNS$2, tagName), "createElementNS"); - const svg = setAttributesNS(createElementNS("svg"), { - width: `${SIZE$1}`, - height: `${SIZE$1}`, - viewBox: `0 0 ${SIZE$1} ${SIZE$1}`, - fill: "var(--actor-color, var(--foreground))" - }); - const g2 = setAttributesNS(createElementNS("g"), { - clipPath: "url(#clip0_57_80)" - }); - const path = setAttributesNS(createElementNS("path"), { - ["fill-rule"]: "evenodd", - ["clip-rule"]: "evenodd", - d: "M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z" - }); - svg.appendChild(g2).appendChild(path); - const speakerDefs = createElementNS("defs"); - const speakerClipPathDef = setAttributesNS(createElementNS("clipPath"), { - id: "clip0_57_80" - }); - const speakerRect = setAttributesNS(createElementNS("rect"), { - width: `${SIZE$1}`, - height: `${SIZE$1}`, - fill: "white" - }); - speakerClipPathDef.appendChild(speakerRect); - speakerDefs.appendChild(speakerClipPathDef); - svg.appendChild(speakerDefs).appendChild(speakerClipPathDef).appendChild(speakerRect); - return svg; -} -__name(FeedbackIcon, "FeedbackIcon"); -function Actor({ triggerLabel, triggerAriaLabel, shadow, styleNonce }) { - const el = DOCUMENT.createElement("button"); - el.type = "button"; - el.className = "widget__actor"; - el.ariaHidden = "false"; - el.ariaLabel = triggerAriaLabel || triggerLabel || TRIGGER_LABEL; - el.appendChild(FeedbackIcon()); - if (triggerLabel) { - const label5 = DOCUMENT.createElement("span"); - label5.appendChild(DOCUMENT.createTextNode(triggerLabel)); - el.appendChild(label5); - } - const style2 = createActorStyles(styleNonce); - return { - el, - appendToDom() { - shadow.appendChild(style2); - shadow.appendChild(el); - }, - removeFromDom() { - shadow.removeChild(el); - shadow.removeChild(style2); - }, - show() { - el.ariaHidden = "false"; - }, - hide() { - el.ariaHidden = "true"; - } - }; -} -__name(Actor, "Actor"); -const PURPLE = "rgba(88, 74, 192, 1)"; -const DEFAULT_LIGHT = { - foreground: "#2b2233", - background: "#ffffff", - accentForeground: "white", - accentBackground: PURPLE, - successColor: "#268d75", - errorColor: "#df3338", - border: "1.5px solid rgba(41, 35, 47, 0.13)", - boxShadow: "0px 4px 24px 0px rgba(43, 34, 51, 0.12)", - outline: "1px auto var(--accent-background)", - interactiveFilter: "brightness(95%)" -}; -const DEFAULT_DARK = { - foreground: "#ebe6ef", - background: "#29232f", - accentForeground: "white", - accentBackground: PURPLE, - successColor: "#2da98c", - errorColor: "#f55459", - border: "1.5px solid rgba(235, 230, 239, 0.15)", - boxShadow: "0px 4px 24px 0px rgba(43, 34, 51, 0.12)", - outline: "1px auto var(--accent-background)", - interactiveFilter: "brightness(150%)" -}; -function getThemedCssVariables(theme42) { - return ` - --foreground: ${theme42.foreground}; - --background: ${theme42.background}; - --accent-foreground: ${theme42.accentForeground}; - --accent-background: ${theme42.accentBackground}; - --success-color: ${theme42.successColor}; - --error-color: ${theme42.errorColor}; - --border: ${theme42.border}; - --box-shadow: ${theme42.boxShadow}; - --outline: ${theme42.outline}; - --interactive-filter: ${theme42.interactiveFilter}; - `; -} -__name(getThemedCssVariables, "getThemedCssVariables"); -function createMainStyles({ - colorScheme, - themeDark, - themeLight, - styleNonce -}) { - const style2 = DOCUMENT.createElement("style"); - style2.textContent = ` -:host { - --font-family: system-ui, 'Helvetica Neue', Arial, sans-serif; - --font-size: 14px; - --z-index: 100000; - - --page-margin: 16px; - --inset: auto 0 0 auto; - --actor-inset: var(--inset); - - font-family: var(--font-family); - font-size: var(--font-size); - - ${colorScheme !== "system" ? "color-scheme: only light;" : ""} - - ${getThemedCssVariables( - colorScheme === "dark" ? { ...DEFAULT_DARK, ...themeDark } : { ...DEFAULT_LIGHT, ...themeLight } - )} -} - -${colorScheme === "system" ? ` -@media (prefers-color-scheme: dark) { - :host { - ${getThemedCssVariables({ ...DEFAULT_DARK, ...themeDark })} - } -}` : ""} -} -`; - if (styleNonce) { - style2.setAttribute("nonce", styleNonce); - } - return style2; -} -__name(createMainStyles, "createMainStyles"); -const buildFeedbackIntegration = /* @__PURE__ */ __name(({ - lazyLoadIntegration: lazyLoadIntegration2, - getModalIntegration, - getScreenshotIntegration -}) => { - const feedbackIntegration = /* @__PURE__ */ __name(({ - // FeedbackGeneralConfiguration - id: id3 = "sentry-feedback", - autoInject = true, - showBranding = true, - isEmailRequired = false, - isNameRequired = false, - showEmail = true, - showName = true, - enableScreenshot = true, - useSentryUser = { - email: "email", - name: "username" - }, - tags, - styleNonce, - scriptNonce, - // FeedbackThemeConfiguration - colorScheme = "system", - themeLight = {}, - themeDark = {}, - // FeedbackTextConfiguration - addScreenshotButtonLabel = ADD_SCREENSHOT_LABEL, - cancelButtonLabel = CANCEL_BUTTON_LABEL, - confirmButtonLabel = CONFIRM_BUTTON_LABEL, - emailLabel = EMAIL_LABEL, - emailPlaceholder = EMAIL_PLACEHOLDER, - formTitle = FORM_TITLE, - isRequiredLabel = IS_REQUIRED_LABEL, - messageLabel = MESSAGE_LABEL, - messagePlaceholder = MESSAGE_PLACEHOLDER, - nameLabel = NAME_LABEL, - namePlaceholder = NAME_PLACEHOLDER, - removeScreenshotButtonLabel = REMOVE_SCREENSHOT_LABEL, - submitButtonLabel = SUBMIT_BUTTON_LABEL, - successMessageText = SUCCESS_MESSAGE_TEXT, - triggerLabel = TRIGGER_LABEL, - triggerAriaLabel = "", - // FeedbackCallbacks - onFormOpen, - onFormClose, - onSubmitSuccess, - onSubmitError, - onFormSubmitted - } = {}) => { - const _options = { - id: id3, - autoInject, - showBranding, - isEmailRequired, - isNameRequired, - showEmail, - showName, - enableScreenshot, - useSentryUser, - tags, - styleNonce, - scriptNonce, - colorScheme, - themeDark, - themeLight, - triggerLabel, - triggerAriaLabel, - cancelButtonLabel, - submitButtonLabel, - confirmButtonLabel, - formTitle, - emailLabel, - emailPlaceholder, - messageLabel, - messagePlaceholder, - nameLabel, - namePlaceholder, - successMessageText, - isRequiredLabel, - addScreenshotButtonLabel, - removeScreenshotButtonLabel, - onFormClose, - onFormOpen, - onSubmitError, - onSubmitSuccess, - onFormSubmitted - }; - let _shadow = null; - let _subscriptions = []; - const _createShadow = /* @__PURE__ */ __name((options4) => { - if (!_shadow) { - const host = DOCUMENT.createElement("div"); - host.id = String(options4.id); - DOCUMENT.body.appendChild(host); - _shadow = host.attachShadow({ mode: "open" }); - _shadow.appendChild(createMainStyles(options4)); - } - return _shadow; - }, "_createShadow"); - const _loadAndRenderDialog = /* @__PURE__ */ __name(async (options4) => { - const screenshotRequired = options4.enableScreenshot && isScreenshotSupported(); - let modalIntegration; - let screenshotIntegration; - try { - const modalIntegrationFn = getModalIntegration ? getModalIntegration() : await lazyLoadIntegration2("feedbackModalIntegration", scriptNonce); - modalIntegration = modalIntegrationFn(); - addIntegration(modalIntegration); - } catch (e2) { - DEBUG_BUILD$1 && logger$2.error( - "[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`." - ); - throw new Error("[Feedback] Missing feedback modal integration!"); - } - try { - const screenshotIntegrationFn = screenshotRequired ? getScreenshotIntegration ? getScreenshotIntegration() : await lazyLoadIntegration2("feedbackScreenshotIntegration", scriptNonce) : void 0; - if (screenshotIntegrationFn) { - screenshotIntegration = screenshotIntegrationFn(); - addIntegration(screenshotIntegration); - } - } catch (e2) { - DEBUG_BUILD$1 && logger$2.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots."); - } - const dialog = modalIntegration.createDialog({ - options: { - ...options4, - onFormClose: /* @__PURE__ */ __name(() => { - dialog && dialog.close(); - options4.onFormClose && options4.onFormClose(); - }, "onFormClose"), - onFormSubmitted: /* @__PURE__ */ __name(() => { - dialog && dialog.close(); - options4.onFormSubmitted && options4.onFormSubmitted(); - }, "onFormSubmitted") - }, - screenshotIntegration, - sendFeedback, - shadow: _createShadow(options4) - }); - return dialog; - }, "_loadAndRenderDialog"); - const _attachTo = /* @__PURE__ */ __name((el, optionOverrides = {}) => { - const mergedOptions = mergeOptions$2(_options, optionOverrides); - const targetEl = typeof el === "string" ? DOCUMENT.querySelector(el) : typeof el.addEventListener === "function" ? el : null; - if (!targetEl) { - DEBUG_BUILD$1 && logger$2.error("[Feedback] Unable to attach to target element"); - throw new Error("Unable to attach to target element"); - } - let dialog = null; - const handleClick2 = /* @__PURE__ */ __name(async () => { - if (!dialog) { - dialog = await _loadAndRenderDialog({ - ...mergedOptions, - onFormSubmitted: /* @__PURE__ */ __name(() => { - dialog && dialog.removeFromDom(); - mergedOptions.onFormSubmitted && mergedOptions.onFormSubmitted(); - }, "onFormSubmitted") - }); - } - dialog.appendToDom(); - dialog.open(); - }, "handleClick"); - targetEl.addEventListener("click", handleClick2); - const unsubscribe = /* @__PURE__ */ __name(() => { - _subscriptions = _subscriptions.filter((sub) => sub !== unsubscribe); - dialog && dialog.removeFromDom(); - dialog = null; - targetEl.removeEventListener("click", handleClick2); - }, "unsubscribe"); - _subscriptions.push(unsubscribe); - return unsubscribe; - }, "_attachTo"); - const _createActor = /* @__PURE__ */ __name((optionOverrides = {}) => { - const mergedOptions = mergeOptions$2(_options, optionOverrides); - const shadow = _createShadow(mergedOptions); - const actor = Actor({ - triggerLabel: mergedOptions.triggerLabel, - triggerAriaLabel: mergedOptions.triggerAriaLabel, - shadow, - styleNonce - }); - _attachTo(actor.el, { - ...mergedOptions, - onFormOpen() { - actor.hide(); - }, - onFormClose() { - actor.show(); - }, - onFormSubmitted() { - actor.show(); - } - }); - return actor; - }, "_createActor"); - return { - name: "Feedback", - setupOnce() { - if (!isBrowser$1() || !_options.autoInject) { - return; - } - if (DOCUMENT.readyState === "loading") { - DOCUMENT.addEventListener("DOMContentLoaded", () => _createActor().appendToDom()); - } else { - _createActor().appendToDom(); - } - }, - /** - * Adds click listener to the element to open a feedback dialog - * - * The returned function can be used to remove the click listener - */ - attachTo: _attachTo, - /** - * Creates a new widget which is composed of a Button which triggers a Dialog. - * Accepts partial options to override any options passed to constructor. - */ - createWidget(optionOverrides = {}) { - const actor = _createActor(mergeOptions$2(_options, optionOverrides)); - actor.appendToDom(); - return actor; - }, - /** - * Creates a new Form which you can - * Accepts partial options to override any options passed to constructor. - */ - async createForm(optionOverrides = {}) { - return _loadAndRenderDialog(mergeOptions$2(_options, optionOverrides)); - }, - /** - * Removes the Feedback integration (including host, shadow DOM, and all widgets) - */ - remove() { - if (_shadow) { - _shadow.parentElement && _shadow.parentElement.remove(); - _shadow = null; - } - _subscriptions.forEach((sub) => sub()); - _subscriptions = []; - } - }; - }, "feedbackIntegration"); - return feedbackIntegration; -}, "buildFeedbackIntegration"); -function getFeedback() { - const client = getClient(); - return client && client.getIntegrationByName("Feedback"); -} -__name(getFeedback, "getFeedback"); -var n, l$1, u$1, i$1, o$1, r$1, f$1, c$1 = {}, s$1 = [], a$1 = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, h$1 = Array.isArray; -function v$1(n2, l2) { - for (var u2 in l2) n2[u2] = l2[u2]; - return n2; -} -__name(v$1, "v$1"); -function p$1(n2) { - var l2 = n2.parentNode; - l2 && l2.removeChild(n2); -} -__name(p$1, "p$1"); -function y$1(l2, u2, t2) { - var i2, o2, r2, f2 = {}; - for (r2 in u2) "key" == r2 ? i2 = u2[r2] : "ref" == r2 ? o2 = u2[r2] : f2[r2] = u2[r2]; - if (arguments.length > 2 && (f2.children = arguments.length > 3 ? n.call(arguments, 2) : t2), "function" == typeof l2 && null != l2.defaultProps) for (r2 in l2.defaultProps) void 0 === f2[r2] && (f2[r2] = l2.defaultProps[r2]); - return d$1(l2, f2, i2, o2, null); -} -__name(y$1, "y$1"); -function d$1(n2, t2, i2, o2, r2) { - var f2 = { type: n2, props: t2, key: i2, ref: o2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: null == r2 ? ++u$1 : r2, __i: -1, __u: 0 }; - return null == r2 && null != l$1.vnode && l$1.vnode(f2), f2; -} -__name(d$1, "d$1"); -function g$1$1(n2) { - return n2.children; -} -__name(g$1$1, "g$1$1"); -function b$1(n2, l2) { - this.props = n2, this.context = l2; -} -__name(b$1, "b$1"); -function m$1(n2, l2) { - if (null == l2) return n2.__ ? m$1(n2.__, n2.__i + 1) : null; - for (var u2; l2 < n2.__k.length; l2++) if (null != (u2 = n2.__k[l2]) && null != u2.__e) return u2.__e; - return "function" == typeof n2.type ? m$1(n2) : null; -} -__name(m$1, "m$1"); -function w$1(n2, u2, t2) { - var i2, o2 = n2.__v, r2 = o2.__e, f2 = n2.__P; - if (f2) return (i2 = v$1({}, o2)).__v = o2.__v + 1, l$1.vnode && l$1.vnode(i2), M(f2, i2, o2, n2.__n, void 0 !== f2.ownerSVGElement, 32 & o2.__u ? [r2] : null, u2, null == r2 ? m$1(o2) : r2, !!(32 & o2.__u), t2), i2.__.__k[i2.__i] = i2, i2.__d = void 0, i2.__e != r2 && k$1(i2), i2; -} -__name(w$1, "w$1"); -function k$1(n2) { - var l2, u2; - if (null != (n2 = n2.__) && null != n2.__c) { - for (n2.__e = n2.__c.base = null, l2 = 0; l2 < n2.__k.length; l2++) if (null != (u2 = n2.__k[l2]) && null != u2.__e) { - n2.__e = n2.__c.base = u2.__e; - break; - } - return k$1(n2); - } -} -__name(k$1, "k$1"); -function x$1(n2) { - (!n2.__d && (n2.__d = true) && i$1.push(n2) && !C$1.__r++ || o$1 !== l$1.debounceRendering) && ((o$1 = l$1.debounceRendering) || r$1)(C$1); -} -__name(x$1, "x$1"); -function C$1() { - var n2, u2, t2, o2 = [], r2 = []; - for (i$1.sort(f$1); n2 = i$1.shift(); ) n2.__d && (t2 = i$1.length, u2 = w$1(n2, o2, r2) || u2, 0 === t2 || i$1.length > t2 ? (j$1(o2, u2, r2), r2.length = o2.length = 0, u2 = void 0, i$1.sort(f$1)) : u2 && l$1.__c && l$1.__c(u2, s$1)); - u2 && j$1(o2, u2, r2), C$1.__r = 0; -} -__name(C$1, "C$1"); -function P$1$1(n2, l2, u2, t2, i2, o2, r2, f2, e2, a2, h2) { - var v2, p2, y2, d2, _2, g2 = t2 && t2.__k || s$1, b2 = l2.length; - for (u2.__d = e2, S(u2, l2, g2), e2 = u2.__d, v2 = 0; v2 < b2; v2++) null != (y2 = u2.__k[v2]) && "boolean" != typeof y2 && "function" != typeof y2 && (p2 = -1 === y2.__i ? c$1 : g2[y2.__i] || c$1, y2.__i = v2, M(n2, y2, p2, i2, o2, r2, f2, e2, a2, h2), d2 = y2.__e, y2.ref && p2.ref != y2.ref && (p2.ref && N(p2.ref, null, y2), h2.push(y2.ref, y2.__c || d2, y2)), null == _2 && null != d2 && (_2 = d2), 65536 & y2.__u || p2.__k === y2.__k ? e2 = $(y2, e2, n2) : "function" == typeof y2.type && void 0 !== y2.__d ? e2 = y2.__d : d2 && (e2 = d2.nextSibling), y2.__d = void 0, y2.__u &= -196609); - u2.__d = e2, u2.__e = _2; -} -__name(P$1$1, "P$1$1"); -function S(n2, l2, u2) { - var t2, i2, o2, r2, f2, e2 = l2.length, c2 = u2.length, s2 = c2, a2 = 0; - for (n2.__k = [], t2 = 0; t2 < e2; t2++) null != (i2 = n2.__k[t2] = null == (i2 = l2[t2]) || "boolean" == typeof i2 || "function" == typeof i2 ? null : "string" == typeof i2 || "number" == typeof i2 || "bigint" == typeof i2 || i2.constructor == String ? d$1(null, i2, null, null, i2) : h$1(i2) ? d$1(g$1$1, { children: i2 }, null, null, null) : void 0 === i2.constructor && i2.__b > 0 ? d$1(i2.type, i2.props, i2.key, i2.ref ? i2.ref : null, i2.__v) : i2) ? (i2.__ = n2, i2.__b = n2.__b + 1, f2 = I(i2, u2, r2 = t2 + a2, s2), i2.__i = f2, o2 = null, -1 !== f2 && (s2--, (o2 = u2[f2]) && (o2.__u |= 131072)), null == o2 || null === o2.__v ? (-1 == f2 && a2--, "function" != typeof i2.type && (i2.__u |= 65536)) : f2 !== r2 && (f2 === r2 + 1 ? a2++ : f2 > r2 ? s2 > e2 - r2 ? a2 += f2 - r2 : a2-- : a2 = f2 < r2 && f2 == r2 - 1 ? f2 - r2 : 0, f2 !== t2 + a2 && (i2.__u |= 65536))) : (o2 = u2[t2]) && null == o2.key && o2.__e && (o2.__e == n2.__d && (n2.__d = m$1(o2)), O(o2, o2, false), u2[t2] = null, s2--); - if (s2) for (t2 = 0; t2 < c2; t2++) null != (o2 = u2[t2]) && 0 == (131072 & o2.__u) && (o2.__e == n2.__d && (n2.__d = m$1(o2)), O(o2, o2)); -} -__name(S, "S"); -function $(n2, l2, u2) { - var t2, i2; - if ("function" == typeof n2.type) { - for (t2 = n2.__k, i2 = 0; t2 && i2 < t2.length; i2++) t2[i2] && (t2[i2].__ = n2, l2 = $(t2[i2], l2, u2)); - return l2; - } - n2.__e != l2 && (u2.insertBefore(n2.__e, l2 || null), l2 = n2.__e); - do { - l2 = l2 && l2.nextSibling; - } while (null != l2 && 8 === l2.nodeType); - return l2; -} -__name($, "$"); -function I(n2, l2, u2, t2) { - var i2 = n2.key, o2 = n2.type, r2 = u2 - 1, f2 = u2 + 1, e2 = l2[u2]; - if (null === e2 || e2 && i2 == e2.key && o2 === e2.type) return u2; - if (t2 > (null != e2 && 0 == (131072 & e2.__u) ? 1 : 0)) for (; r2 >= 0 || f2 < l2.length; ) { - if (r2 >= 0) { - if ((e2 = l2[r2]) && 0 == (131072 & e2.__u) && i2 == e2.key && o2 === e2.type) return r2; - r2--; - } - if (f2 < l2.length) { - if ((e2 = l2[f2]) && 0 == (131072 & e2.__u) && i2 == e2.key && o2 === e2.type) return f2; - f2++; - } - } - return -1; -} -__name(I, "I"); -function T$1(n2, l2, u2) { - "-" === l2[0] ? n2.setProperty(l2, null == u2 ? "" : u2) : n2[l2] = null == u2 ? "" : "number" != typeof u2 || a$1.test(l2) ? u2 : u2 + "px"; -} -__name(T$1, "T$1"); -function A$1(n2, l2, u2, t2, i2) { - var o2; - n: if ("style" === l2) if ("string" == typeof u2) n2.style.cssText = u2; - else { - if ("string" == typeof t2 && (n2.style.cssText = t2 = ""), t2) for (l2 in t2) u2 && l2 in u2 || T$1(n2.style, l2, ""); - if (u2) for (l2 in u2) t2 && u2[l2] === t2[l2] || T$1(n2.style, l2, u2[l2]); - } - else if ("o" === l2[0] && "n" === l2[1]) o2 = l2 !== (l2 = l2.replace(/(PointerCapture)$|Capture$/i, "$1")), l2 = l2.toLowerCase() in n2 ? l2.toLowerCase().slice(2) : l2.slice(2), n2.l || (n2.l = {}), n2.l[l2 + o2] = u2, u2 ? t2 ? u2.u = t2.u : (u2.u = Date.now(), n2.addEventListener(l2, o2 ? L : D$1, o2)) : n2.removeEventListener(l2, o2 ? L : D$1, o2); - else { - if (i2) l2 = l2.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s"); - else if ("width" !== l2 && "height" !== l2 && "href" !== l2 && "list" !== l2 && "form" !== l2 && "tabIndex" !== l2 && "download" !== l2 && "rowSpan" !== l2 && "colSpan" !== l2 && "role" !== l2 && l2 in n2) try { - n2[l2] = null == u2 ? "" : u2; - break n; - } catch (n3) { - } - "function" == typeof u2 || (null == u2 || false === u2 && "-" !== l2[4] ? n2.removeAttribute(l2) : n2.setAttribute(l2, u2)); - } -} -__name(A$1, "A$1"); -function D$1(n2) { - if (this.l) { - var u2 = this.l[n2.type + false]; - if (n2.t) { - if (n2.t <= u2.u) return; - } else n2.t = Date.now(); - return u2(l$1.event ? l$1.event(n2) : n2); - } -} -__name(D$1, "D$1"); -function L(n2) { - if (this.l) return this.l[n2.type + true](l$1.event ? l$1.event(n2) : n2); -} -__name(L, "L"); -function M(n2, u2, t2, i2, o2, r2, f2, e2, c2, s2) { - var a2, p2, y2, d2, _2, m2, w2, k2, x2, C2, S2, $2, H, I2, T2, A2 = u2.type; - if (void 0 !== u2.constructor) return null; - 128 & t2.__u && (c2 = !!(32 & t2.__u), r2 = [e2 = u2.__e = t2.__e]), (a2 = l$1.__b) && a2(u2); - n: if ("function" == typeof A2) try { - if (k2 = u2.props, x2 = (a2 = A2.contextType) && i2[a2.__c], C2 = a2 ? x2 ? x2.props.value : a2.__ : i2, t2.__c ? w2 = (p2 = u2.__c = t2.__c).__ = p2.__E : ("prototype" in A2 && A2.prototype.render ? u2.__c = p2 = new A2(k2, C2) : (u2.__c = p2 = new b$1(k2, C2), p2.constructor = A2, p2.render = q$1), x2 && x2.sub(p2), p2.props = k2, p2.state || (p2.state = {}), p2.context = C2, p2.__n = i2, y2 = p2.__d = true, p2.__h = [], p2._sb = []), null == p2.__s && (p2.__s = p2.state), null != A2.getDerivedStateFromProps && (p2.__s == p2.state && (p2.__s = v$1({}, p2.__s)), v$1(p2.__s, A2.getDerivedStateFromProps(k2, p2.__s))), d2 = p2.props, _2 = p2.state, p2.__v = u2, y2) null == A2.getDerivedStateFromProps && null != p2.componentWillMount && p2.componentWillMount(), null != p2.componentDidMount && p2.__h.push(p2.componentDidMount); - else { - if (null == A2.getDerivedStateFromProps && k2 !== d2 && null != p2.componentWillReceiveProps && p2.componentWillReceiveProps(k2, C2), !p2.__e && (null != p2.shouldComponentUpdate && false === p2.shouldComponentUpdate(k2, p2.__s, C2) || u2.__v === t2.__v)) { - for (u2.__v !== t2.__v && (p2.props = k2, p2.state = p2.__s, p2.__d = false), u2.__e = t2.__e, u2.__k = t2.__k, u2.__k.forEach(function(n3) { - n3 && (n3.__ = u2); - }), S2 = 0; S2 < p2._sb.length; S2++) p2.__h.push(p2._sb[S2]); - p2._sb = [], p2.__h.length && f2.push(p2); - break n; - } - null != p2.componentWillUpdate && p2.componentWillUpdate(k2, p2.__s, C2), null != p2.componentDidUpdate && p2.__h.push(function() { - p2.componentDidUpdate(d2, _2, m2); - }); - } - if (p2.context = C2, p2.props = k2, p2.__P = n2, p2.__e = false, $2 = l$1.__r, H = 0, "prototype" in A2 && A2.prototype.render) { - for (p2.state = p2.__s, p2.__d = false, $2 && $2(u2), a2 = p2.render(p2.props, p2.state, p2.context), I2 = 0; I2 < p2._sb.length; I2++) p2.__h.push(p2._sb[I2]); - p2._sb = []; - } else do { - p2.__d = false, $2 && $2(u2), a2 = p2.render(p2.props, p2.state, p2.context), p2.state = p2.__s; - } while (p2.__d && ++H < 25); - p2.state = p2.__s, null != p2.getChildContext && (i2 = v$1(v$1({}, i2), p2.getChildContext())), y2 || null == p2.getSnapshotBeforeUpdate || (m2 = p2.getSnapshotBeforeUpdate(d2, _2)), P$1$1(n2, h$1(T2 = null != a2 && a2.type === g$1$1 && null == a2.key ? a2.props.children : a2) ? T2 : [T2], u2, t2, i2, o2, r2, f2, e2, c2, s2), p2.base = u2.__e, u2.__u &= -161, p2.__h.length && f2.push(p2), w2 && (p2.__E = p2.__ = null); - } catch (n3) { - u2.__v = null, c2 || null != r2 ? (u2.__e = e2, u2.__u |= c2 ? 160 : 32, r2[r2.indexOf(e2)] = null) : (u2.__e = t2.__e, u2.__k = t2.__k), l$1.__e(n3, u2, t2); - } - else null == r2 && u2.__v === t2.__v ? (u2.__k = t2.__k, u2.__e = t2.__e) : u2.__e = z$1(t2.__e, u2, t2, i2, o2, r2, f2, c2, s2); - (a2 = l$1.diffed) && a2(u2); -} -__name(M, "M"); -function j$1(n2, u2, t2) { - for (var i2 = 0; i2 < t2.length; i2++) N(t2[i2], t2[++i2], t2[++i2]); - l$1.__c && l$1.__c(u2, n2), n2.some(function(u3) { - try { - n2 = u3.__h, u3.__h = [], n2.some(function(n3) { - n3.call(u3); - }); - } catch (n3) { - l$1.__e(n3, u3.__v); - } - }); -} -__name(j$1, "j$1"); -function z$1(l2, u2, t2, i2, o2, r2, f2, e2, s2) { - var a2, v2, y2, d2, _2, g2, b2, w2 = t2.props, k2 = u2.props, x2 = u2.type; - if ("svg" === x2 && (o2 = true), null != r2) { - for (a2 = 0; a2 < r2.length; a2++) if ((_2 = r2[a2]) && "setAttribute" in _2 == !!x2 && (x2 ? _2.localName === x2 : 3 === _2.nodeType)) { - l2 = _2, r2[a2] = null; - break; - } - } - if (null == l2) { - if (null === x2) return document.createTextNode(k2); - l2 = o2 ? document.createElementNS("http://www.w3.org/2000/svg", x2) : document.createElement(x2, k2.is && k2), r2 = null, e2 = false; - } - if (null === x2) w2 === k2 || e2 && l2.data === k2 || (l2.data = k2); - else { - if (r2 = r2 && n.call(l2.childNodes), w2 = t2.props || c$1, !e2 && null != r2) for (w2 = {}, a2 = 0; a2 < l2.attributes.length; a2++) w2[(_2 = l2.attributes[a2]).name] = _2.value; - for (a2 in w2) _2 = w2[a2], "children" == a2 || ("dangerouslySetInnerHTML" == a2 ? y2 = _2 : "key" === a2 || a2 in k2 || A$1(l2, a2, null, _2, o2)); - for (a2 in k2) _2 = k2[a2], "children" == a2 ? d2 = _2 : "dangerouslySetInnerHTML" == a2 ? v2 = _2 : "value" == a2 ? g2 = _2 : "checked" == a2 ? b2 = _2 : "key" === a2 || e2 && "function" != typeof _2 || w2[a2] === _2 || A$1(l2, a2, _2, w2[a2], o2); - if (v2) e2 || y2 && (v2.__html === y2.__html || v2.__html === l2.innerHTML) || (l2.innerHTML = v2.__html), u2.__k = []; - else if (y2 && (l2.innerHTML = ""), P$1$1(l2, h$1(d2) ? d2 : [d2], u2, t2, i2, o2 && "foreignObject" !== x2, r2, f2, r2 ? r2[0] : t2.__k && m$1(t2, 0), e2, s2), null != r2) for (a2 = r2.length; a2--; ) null != r2[a2] && p$1(r2[a2]); - e2 || (a2 = "value", void 0 !== g2 && (g2 !== l2[a2] || "progress" === x2 && !g2 || "option" === x2 && g2 !== w2[a2]) && A$1(l2, a2, g2, w2[a2], false), a2 = "checked", void 0 !== b2 && b2 !== l2[a2] && A$1(l2, a2, b2, w2[a2], false)); - } - return l2; -} -__name(z$1, "z$1"); -function N(n2, u2, t2) { - try { - "function" == typeof n2 ? n2(u2) : n2.current = u2; - } catch (n3) { - l$1.__e(n3, t2); - } -} -__name(N, "N"); -function O(n2, u2, t2) { - var i2, o2; - if (l$1.unmount && l$1.unmount(n2), (i2 = n2.ref) && (i2.current && i2.current !== n2.__e || N(i2, null, u2)), null != (i2 = n2.__c)) { - if (i2.componentWillUnmount) try { - i2.componentWillUnmount(); - } catch (n3) { - l$1.__e(n3, u2); - } - i2.base = i2.__P = null, n2.__c = void 0; - } - if (i2 = n2.__k) for (o2 = 0; o2 < i2.length; o2++) i2[o2] && O(i2[o2], u2, t2 || "function" != typeof n2.type); - t2 || null == n2.__e || p$1(n2.__e), n2.__ = n2.__e = n2.__d = void 0; -} -__name(O, "O"); -function q$1(n2, l2, u2) { - return this.constructor(n2, u2); -} -__name(q$1, "q$1"); -function B$1(u2, t2, i2) { - var o2, r2, f2, e2; - l$1.__ && l$1.__(u2, t2), r2 = (o2 = "function" == typeof i2) ? null : t2.__k, f2 = [], e2 = [], M(t2, u2 = (!o2 && i2 || t2).__k = y$1(g$1$1, null, [u2]), r2 || c$1, c$1, void 0 !== t2.ownerSVGElement, !o2 && i2 ? [i2] : r2 ? null : t2.firstChild ? n.call(t2.childNodes) : null, f2, !o2 && i2 ? i2 : r2 ? r2.__e : t2.firstChild, o2, e2), u2.__d = void 0, j$1(f2, u2, e2); -} -__name(B$1, "B$1"); -n = s$1.slice, l$1 = { __e: /* @__PURE__ */ __name(function(n2, l2, u2, t2) { - for (var i2, o2, r2; l2 = l2.__; ) if ((i2 = l2.__c) && !i2.__) try { - if ((o2 = i2.constructor) && null != o2.getDerivedStateFromError && (i2.setState(o2.getDerivedStateFromError(n2)), r2 = i2.__d), null != i2.componentDidCatch && (i2.componentDidCatch(n2, t2 || {}), r2 = i2.__d), r2) return i2.__E = i2; - } catch (l3) { - n2 = l3; - } - throw n2; -}, "__e") }, u$1 = 0, b$1.prototype.setState = function(n2, l2) { - var u2; - u2 = null != this.__s && this.__s !== this.state ? this.__s : this.__s = v$1({}, this.state), "function" == typeof n2 && (n2 = n2(v$1({}, u2), this.props)), n2 && v$1(u2, n2), null != n2 && this.__v && (l2 && this._sb.push(l2), x$1(this)); -}, b$1.prototype.forceUpdate = function(n2) { - this.__v && (this.__e = true, n2 && this.__h.push(n2), x$1(this)); -}, b$1.prototype.render = g$1$1, i$1 = [], r$1 = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, f$1 = /* @__PURE__ */ __name(function(n2, l2) { - return n2.__v.__b - l2.__v.__b; -}, "f$1"), C$1.__r = 0; -var t$1, r, u, i$2, o = 0, f = [], c = [], e = l$1, a = e.__b, v = e.__r, l = e.diffed, m = e.__c, s = e.unmount, d = e.__; -function h$2(n2, t2) { - e.__h && e.__h(r, n2, o || t2), o = 0; - var u2 = r.__H || (r.__H = { __: [], __h: [] }); - return n2 >= u2.__.length && u2.__.push({ __V: c }), u2.__[n2]; -} -__name(h$2, "h$2"); -function p$2(n2) { - return o = 1, y(D, n2); -} -__name(p$2, "p$2"); -function y(n2, u2, i2) { - var o2 = h$2(t$1++, 2); - if (o2.t = n2, !o2.__c && (o2.__ = [i2 ? i2(u2) : D(void 0, u2), function(n3) { - var t2 = o2.__N ? o2.__N[0] : o2.__[0], r2 = o2.t(t2, n3); - t2 !== r2 && (o2.__N = [r2, o2.__[1]], o2.__c.setState({})); - }], o2.__c = r, !r.u)) { - var f2 = /* @__PURE__ */ __name(function(n3, t2, r2) { - if (!o2.__c.__H) return true; - var u3 = o2.__c.__H.__.filter(function(n4) { - return !!n4.__c; - }); - if (u3.every(function(n4) { - return !n4.__N; - })) return !c2 || c2.call(this, n3, t2, r2); - var i3 = false; - return u3.forEach(function(n4) { - if (n4.__N) { - var t3 = n4.__[0]; - n4.__ = n4.__N, n4.__N = void 0, t3 !== n4.__[0] && (i3 = true); - } - }), !(!i3 && o2.__c.props === n3) && (!c2 || c2.call(this, n3, t2, r2)); - }, "f"); - r.u = true; - var c2 = r.shouldComponentUpdate, e2 = r.componentWillUpdate; - r.componentWillUpdate = function(n3, t2, r2) { - if (this.__e) { - var u3 = c2; - c2 = void 0, f2(n3, t2, r2), c2 = u3; - } - e2 && e2.call(this, n3, t2, r2); - }, r.shouldComponentUpdate = f2; - } - return o2.__N || o2.__; -} -__name(y, "y"); -function _$1(n2, u2) { - var i2 = h$2(t$1++, 3); - !e.__s && C(i2.__H, u2) && (i2.__ = n2, i2.i = u2, r.__H.__h.push(i2)); -} -__name(_$1, "_$1"); -function A(n2, u2) { - var i2 = h$2(t$1++, 4); - !e.__s && C(i2.__H, u2) && (i2.__ = n2, i2.i = u2, r.__h.push(i2)); -} -__name(A, "A"); -function F(n2) { - return o = 5, q(function() { - return { current: n2 }; - }, []); -} -__name(F, "F"); -function T(n2, t2, r2) { - o = 6, A(function() { - return "function" == typeof n2 ? (n2(t2()), function() { - return n2(null); - }) : n2 ? (n2.current = t2(), function() { - return n2.current = null; - }) : void 0; - }, null == r2 ? r2 : r2.concat(n2)); -} -__name(T, "T"); -function q(n2, r2) { - var u2 = h$2(t$1++, 7); - return C(u2.__H, r2) ? (u2.__V = n2(), u2.i = r2, u2.__h = n2, u2.__V) : u2.__; -} -__name(q, "q"); -function x(n2, t2) { - return o = 8, q(function() { - return n2; - }, t2); -} -__name(x, "x"); -function P$2(n2) { - var u2 = r.context[n2.__c], i2 = h$2(t$1++, 9); - return i2.c = n2, u2 ? (null == i2.__ && (i2.__ = true, u2.sub(r)), u2.props.value) : n2.__; -} -__name(P$2, "P$2"); -function V(n2, t2) { - e.useDebugValue && e.useDebugValue(t2 ? t2(n2) : n2); -} -__name(V, "V"); -function b(n2) { - var u2 = h$2(t$1++, 10), i2 = p$2(); - return u2.__ = n2, r.componentDidCatch || (r.componentDidCatch = function(n3, t2) { - u2.__ && u2.__(n3, t2), i2[1](n3); - }), [i2[0], function() { - i2[1](void 0); - }]; -} -__name(b, "b"); -function g$6() { - var n2 = h$2(t$1++, 11); - if (!n2.__) { - for (var u2 = r.__v; null !== u2 && !u2.__m && null !== u2.__; ) u2 = u2.__; - var i2 = u2.__m || (u2.__m = [0, 0]); - n2.__ = "P" + i2[0] + "-" + i2[1]++; - } - return n2.__; -} -__name(g$6, "g$6"); -function j() { - for (var n2; n2 = f.shift(); ) if (n2.__P && n2.__H) try { - n2.__H.__h.forEach(z$2), n2.__H.__h.forEach(B), n2.__H.__h = []; - } catch (t2) { - n2.__H.__h = [], e.__e(t2, n2.__v); - } -} -__name(j, "j"); -e.__b = function(n2) { - r = null, a && a(n2); -}, e.__ = function(n2, t2) { - t2.__k && t2.__k.__m && (n2.__m = t2.__k.__m), d && d(n2, t2); -}, e.__r = function(n2) { - v && v(n2), t$1 = 0; - var i2 = (r = n2.__c).__H; - i2 && (u === r ? (i2.__h = [], r.__h = [], i2.__.forEach(function(n3) { - n3.__N && (n3.__ = n3.__N), n3.__V = c, n3.__N = n3.i = void 0; - })) : (i2.__h.forEach(z$2), i2.__h.forEach(B), i2.__h = [], t$1 = 0)), u = r; -}, e.diffed = function(n2) { - l && l(n2); - var t2 = n2.__c; - t2 && t2.__H && (t2.__H.__h.length && (1 !== f.push(t2) && i$2 === e.requestAnimationFrame || ((i$2 = e.requestAnimationFrame) || w)(j)), t2.__H.__.forEach(function(n3) { - n3.i && (n3.__H = n3.i), n3.__V !== c && (n3.__ = n3.__V), n3.i = void 0, n3.__V = c; - })), u = r = null; -}, e.__c = function(n2, t2) { - t2.some(function(n3) { - try { - n3.__h.forEach(z$2), n3.__h = n3.__h.filter(function(n4) { - return !n4.__ || B(n4); - }); - } catch (r2) { - t2.some(function(n4) { - n4.__h && (n4.__h = []); - }), t2 = [], e.__e(r2, n3.__v); - } - }), m && m(n2, t2); -}, e.unmount = function(n2) { - s && s(n2); - var t2, r2 = n2.__c; - r2 && r2.__H && (r2.__H.__.forEach(function(n3) { - try { - z$2(n3); - } catch (n4) { - t2 = n4; - } - }), r2.__H = void 0, t2 && e.__e(t2, r2.__v)); -}; -var k = "function" == typeof requestAnimationFrame; -function w(n2) { - var t2, r2 = /* @__PURE__ */ __name(function() { - clearTimeout(u2), k && cancelAnimationFrame(t2), setTimeout(n2); - }, "r"), u2 = setTimeout(r2, 100); - k && (t2 = requestAnimationFrame(r2)); -} -__name(w, "w"); -function z$2(n2) { - var t2 = r, u2 = n2.__c; - "function" == typeof u2 && (n2.__c = void 0, u2()), r = t2; -} -__name(z$2, "z$2"); -function B(n2) { - var t2 = r; - n2.__c = n2.__(), r = t2; -} -__name(B, "B"); -function C(n2, t2) { - return !n2 || n2.length !== t2.length || t2.some(function(t3, r2) { - return t3 !== n2[r2]; - }); -} -__name(C, "C"); -function D(n2, t2) { - return "function" == typeof t2 ? t2(n2) : t2; -} -__name(D, "D"); -const hooks = { - __proto__: null, - useCallback: x, - useContext: P$2, - useDebugValue: V, - useEffect: _$1, - useErrorBoundary: b, - useId: g$6, - useImperativeHandle: T, - useLayoutEffect: A, - useMemo: q, - useReducer: y, - useRef: F, - useState: p$2 -}; -const XMLNS$1 = "http://www.w3.org/2000/svg"; -function SentryLogo() { - const createElementNS = /* @__PURE__ */ __name((tagName) => DOCUMENT.createElementNS(XMLNS$1, tagName), "createElementNS"); - const svg = setAttributesNS(createElementNS("svg"), { - width: "32", - height: "30", - viewBox: "0 0 72 66", - fill: "inherit" - }); - const path = setAttributesNS(createElementNS("path"), { - transform: "translate(11, 11)", - d: "M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z" - }); - svg.appendChild(path); - return svg; -} -__name(SentryLogo, "SentryLogo"); -function DialogHeader({ options: options4 }) { - const logoHtml = q(() => ({ __html: SentryLogo().outerHTML }), []); - return y$1( - "h2", - { class: "dialog__header" }, - y$1("span", { class: "dialog__title" }, options4.formTitle), - options4.showBranding ? y$1( - "a", - { - class: "brand-link", - target: "_blank", - href: "https://sentry.io/welcome/", - title: "Powered by Sentry", - rel: "noopener noreferrer", - dangerouslySetInnerHTML: logoHtml - } - ) : null - ); -} -__name(DialogHeader, "DialogHeader"); -function getMissingFields(feedback, props) { - const emptyFields = []; - if (props.isNameRequired && !feedback.name) { - emptyFields.push(props.nameLabel); - } - if (props.isEmailRequired && !feedback.email) { - emptyFields.push(props.emailLabel); - } - if (!feedback.message) { - emptyFields.push(props.messageLabel); - } - return emptyFields; -} -__name(getMissingFields, "getMissingFields"); -function retrieveStringValue(formData, key) { - const value4 = formData.get(key); - if (typeof value4 === "string") { - return value4.trim(); - } - return ""; -} -__name(retrieveStringValue, "retrieveStringValue"); -function Form({ - options: options4, - defaultEmail, - defaultName, - onFormClose, - onSubmit, - onSubmitSuccess, - onSubmitError, - showEmail, - showName, - screenshotInput -}) { - const { - tags, - addScreenshotButtonLabel, - removeScreenshotButtonLabel, - cancelButtonLabel, - emailLabel, - emailPlaceholder, - isEmailRequired, - isNameRequired, - messageLabel, - messagePlaceholder, - nameLabel, - namePlaceholder, - submitButtonLabel, - isRequiredLabel - } = options4; - const [error2, setError] = p$2(null); - const [showScreenshotInput, setShowScreenshotInput] = p$2(false); - const ScreenshotInputComponent = screenshotInput && screenshotInput.input; - const [screenshotError, setScreenshotError] = p$2(null); - const onScreenshotError = x((error3) => { - setScreenshotError(error3); - setShowScreenshotInput(false); - }, []); - const hasAllRequiredFields = x( - (data26) => { - const missingFields = getMissingFields(data26, { - emailLabel, - isEmailRequired, - isNameRequired, - messageLabel, - nameLabel - }); - if (missingFields.length > 0) { - setError(`Please enter in the following required fields: ${missingFields.join(", ")}`); - } else { - setError(null); - } - return missingFields.length === 0; - }, - [emailLabel, isEmailRequired, isNameRequired, messageLabel, nameLabel] - ); - const handleSubmit = x( - async (e2) => { - try { - e2.preventDefault(); - if (!(e2.target instanceof HTMLFormElement)) { - return; - } - const formData = new FormData(e2.target); - const attachment = await (screenshotInput && showScreenshotInput ? screenshotInput.value() : void 0); - const data26 = { - name: retrieveStringValue(formData, "name"), - email: retrieveStringValue(formData, "email"), - message: retrieveStringValue(formData, "message"), - attachments: attachment ? [attachment] : void 0 - }; - if (!hasAllRequiredFields(data26)) { - return; - } - try { - await onSubmit( - { - name: data26.name, - email: data26.email, - message: data26.message, - source: FEEDBACK_WIDGET_SOURCE, - tags - }, - { attachments: data26.attachments } - ); - onSubmitSuccess(data26); - } catch (error3) { - DEBUG_BUILD$1 && logger$2.error(error3); - setError(error3); - onSubmitError(error3); - } - } catch (e22) { - } - }, - [screenshotInput && showScreenshotInput, onSubmitSuccess, onSubmitError] - ); - return y$1( - "form", - { class: "form", onSubmit: handleSubmit }, - ScreenshotInputComponent && showScreenshotInput ? y$1(ScreenshotInputComponent, { onError: onScreenshotError }) : null, - y$1( - "div", - { class: "form__right", "data-sentry-feedback": true }, - y$1( - "div", - { class: "form__top" }, - error2 ? y$1("div", { class: "form__error-container" }, error2) : null, - showName ? y$1( - "label", - { for: "name", class: "form__label" }, - y$1(LabelText, { label: nameLabel, isRequiredLabel, isRequired: isNameRequired }), - y$1( - "input", - { - class: "form__input", - defaultValue: defaultName, - id: "name", - name: "name", - placeholder: namePlaceholder, - required: isNameRequired, - type: "text" - } - ) - ) : y$1("input", { "aria-hidden": true, value: defaultName, name: "name", type: "hidden" }), - showEmail ? y$1( - "label", - { for: "email", class: "form__label" }, - y$1(LabelText, { label: emailLabel, isRequiredLabel, isRequired: isEmailRequired }), - y$1( - "input", - { - class: "form__input", - defaultValue: defaultEmail, - id: "email", - name: "email", - placeholder: emailPlaceholder, - required: isEmailRequired, - type: "email" - } - ) - ) : y$1("input", { "aria-hidden": true, value: defaultEmail, name: "email", type: "hidden" }), - y$1( - "label", - { for: "message", class: "form__label" }, - y$1(LabelText, { label: messageLabel, isRequiredLabel, isRequired: true }), - y$1( - "textarea", - { - autoFocus: true, - class: "form__input form__input--textarea", - id: "message", - name: "message", - placeholder: messagePlaceholder, - required: true, - rows: 5 - } - ) - ), - ScreenshotInputComponent ? y$1( - "label", - { for: "screenshot", class: "form__label" }, - y$1( - "button", - { - class: "btn btn--default", - type: "button", - onClick: /* @__PURE__ */ __name(() => { - setScreenshotError(null); - setShowScreenshotInput((prev2) => !prev2); - }, "onClick") - }, - showScreenshotInput ? removeScreenshotButtonLabel : addScreenshotButtonLabel - ), - screenshotError ? y$1("div", { class: "form__error-container" }, screenshotError.message) : null - ) : null - ), - y$1( - "div", - { class: "btn-group" }, - y$1( - "button", - { class: "btn btn--primary", type: "submit" }, - submitButtonLabel - ), - y$1( - "button", - { class: "btn btn--default", type: "button", onClick: onFormClose }, - cancelButtonLabel - ) - ) - ) - ); -} -__name(Form, "Form"); -function LabelText({ - label: label5, - isRequired, - isRequiredLabel -}) { - return y$1( - "span", - { class: "form__label__text" }, - label5, - isRequired && y$1("span", { class: "form__label__text--required" }, isRequiredLabel) - ); -} -__name(LabelText, "LabelText"); -const WIDTH = 16; -const HEIGHT = 17; -const XMLNS = "http://www.w3.org/2000/svg"; -function SuccessIcon() { - const createElementNS = /* @__PURE__ */ __name((tagName) => WINDOW.document.createElementNS(XMLNS, tagName), "createElementNS"); - const svg = setAttributesNS(createElementNS("svg"), { - width: `${WIDTH}`, - height: `${HEIGHT}`, - viewBox: `0 0 ${WIDTH} ${HEIGHT}`, - fill: "inherit" - }); - const g2 = setAttributesNS(createElementNS("g"), { - clipPath: "url(#clip0_57_156)" - }); - const path2 = setAttributesNS(createElementNS("path"), { - ["fill-rule"]: "evenodd", - ["clip-rule"]: "evenodd", - d: "M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z" - }); - const path = setAttributesNS(createElementNS("path"), { - d: "M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z" - }); - svg.appendChild(g2).append(path, path2); - const speakerDefs = createElementNS("defs"); - const speakerClipPathDef = setAttributesNS(createElementNS("clipPath"), { - id: "clip0_57_156" - }); - const speakerRect = setAttributesNS(createElementNS("rect"), { - width: `${WIDTH}`, - height: `${WIDTH}`, - fill: "white", - transform: "translate(0 0.5)" - }); - speakerClipPathDef.appendChild(speakerRect); - speakerDefs.appendChild(speakerClipPathDef); - svg.appendChild(speakerDefs).appendChild(speakerClipPathDef).appendChild(speakerRect); - return svg; -} -__name(SuccessIcon, "SuccessIcon"); -function Dialog({ open: open2, onFormSubmitted, ...props }) { - const options4 = props.options; - const successIconHtml = q(() => ({ __html: SuccessIcon().outerHTML }), []); - const [timeoutId, setTimeoutId] = p$2(null); - const handleOnSuccessClick = x(() => { - if (timeoutId) { - clearTimeout(timeoutId); - setTimeoutId(null); - } - onFormSubmitted(); - }, [timeoutId]); - const onSubmitSuccess = x( - (data26) => { - props.onSubmitSuccess(data26); - setTimeoutId( - setTimeout(() => { - onFormSubmitted(); - setTimeoutId(null); - }, SUCCESS_MESSAGE_TIMEOUT) - ); - }, - [onFormSubmitted] - ); - return y$1( - g$1$1, - null, - timeoutId ? y$1( - "div", - { class: "success__position", onClick: handleOnSuccessClick }, - y$1( - "div", - { class: "success__content" }, - options4.successMessageText, - y$1("span", { class: "success__icon", dangerouslySetInnerHTML: successIconHtml }) - ) - ) : y$1( - "dialog", - { class: "dialog", onClick: options4.onFormClose, open: open2 }, - y$1( - "div", - { class: "dialog__position" }, - y$1( - "div", - { - class: "dialog__content", - onClick: /* @__PURE__ */ __name((e2) => { - e2.stopPropagation(); - }, "onClick") - }, - y$1(DialogHeader, { options: options4 }), - y$1(Form, { ...props, onSubmitSuccess }) - ) - ) - ) - ); -} -__name(Dialog, "Dialog"); -const DIALOG = ` -.dialog { - position: fixed; - z-index: var(--z-index); - margin: 0; - inset: 0; - - display: flex; - align-items: center; - justify-content: center; - padding: 0; - height: 100vh; - width: 100vw; - - color: var(--dialog-color, var(--foreground)); - fill: var(--dialog-color, var(--foreground)); - line-height: 1.75em; - - background-color: rgba(0, 0, 0, 0.05); - border: none; - inset: 0; - opacity: 1; - transition: opacity 0.2s ease-in-out; -} - -.dialog__position { - position: fixed; - z-index: var(--z-index); - inset: var(--dialog-inset); - padding: var(--page-margin); - display: flex; - max-height: calc(100vh - (2 * var(--page-margin))); -} -@media (max-width: 600px) { - .dialog__position { - inset: var(--page-margin); - padding: 0; - } -} - -.dialog__position:has(.editor) { - inset: var(--page-margin); - padding: 0; -} - -.dialog:not([open]) { - opacity: 0; - pointer-events: none; - visibility: hidden; -} -.dialog:not([open]) .dialog__content { - transform: translate(0, -16px) scale(0.98); -} - -.dialog__content { - display: flex; - flex-direction: column; - gap: 16px; - padding: var(--dialog-padding, 24px); - max-width: 100%; - width: 100%; - max-height: 100%; - overflow: auto; - - background: var(--dialog-background, var(--background)); - border-radius: var(--dialog-border-radius, 20px); - border: var(--dialog-border, var(--border)); - box-shadow: var(--dialog-box-shadow, var(--box-shadow)); - transform: translate(0, 0) scale(1); - transition: transform 0.2s ease-in-out; -} - -`; -const DIALOG_HEADER = ` -.dialog__header { - display: flex; - gap: 4px; - justify-content: space-between; - font-weight: var(--dialog-header-weight, 600); - margin: 0; -} -.dialog__title { - align-self: center; - width: var(--form-width, 272px); -} - -@media (max-width: 600px) { - .dialog__title { - width: auto; - } -} - -.dialog__position:has(.editor) .dialog__title { - width: auto; -} - - -.brand-link { - display: inline-flex; -} -.brand-link:focus-visible { - outline: var(--outline); -} -`; -const FORM = ` -.form { - display: flex; - overflow: auto; - flex-direction: row; - gap: 16px; - flex: 1 0; -} - -.form__right { - flex: 0 0 auto; - display: flex; - overflow: auto; - flex-direction: column; - justify-content: space-between; - gap: 20px; - width: var(--form-width, 100%); -} - -.dialog__position:has(.editor) .form__right { - width: var(--form-width, 272px); -} - -.form__top { - display: flex; - flex-direction: column; - gap: 8px; -} - -.form__error-container { - color: var(--error-color); - fill: var(--error-color); -} - -.form__label { - display: flex; - flex-direction: column; - gap: 4px; - margin: 0px; -} - -.form__label__text { - display: flex; - gap: 4px; - align-items: center; -} - -.form__label__text--required { - font-size: 0.85em; -} - -.form__input { - font-family: inherit; - line-height: inherit; - background: transparent; - box-sizing: border-box; - border: var(--input-border, var(--border)); - border-radius: var(--input-border-radius, 6px); - color: var(--input-color, inherit); - fill: var(--input-color, inherit); - font-size: var(--input-font-size, inherit); - font-weight: var(--input-font-weight, 500); - padding: 6px 12px; -} - -.form__input::placeholder { - opacity: 0.65; - color: var(--input-placeholder-color, inherit); - filter: var(--interactive-filter); -} - -.form__input:focus-visible { - outline: var(--input-focus-outline, var(--outline)); -} - -.form__input--textarea { - font-family: inherit; - resize: vertical; -} - -.error { - color: var(--error-color); - fill: var(--error-color); -} -`; -const BUTTON = ` -.btn-group { - display: grid; - gap: 8px; -} - -.btn { - line-height: inherit; - border: var(--button-border, var(--border)); - border-radius: var(--button-border-radius, 6px); - cursor: pointer; - font-family: inherit; - font-size: var(--button-font-size, inherit); - font-weight: var(--button-font-weight, 600); - padding: var(--button-padding, 6px 16px); -} -.btn[disabled] { - opacity: 0.6; - pointer-events: none; -} - -.btn--primary { - color: var(--button-primary-color, var(--accent-foreground)); - fill: var(--button-primary-color, var(--accent-foreground)); - background: var(--button-primary-background, var(--accent-background)); - border: var(--button-primary-border, var(--border)); - border-radius: var(--button-primary-border-radius, 6px); - font-weight: var(--button-primary-font-weight, 500); -} -.btn--primary:hover { - color: var(--button-primary-hover-color, var(--accent-foreground)); - fill: var(--button-primary-hover-color, var(--accent-foreground)); - background: var(--button-primary-hover-background, var(--accent-background)); - filter: var(--interactive-filter); -} -.btn--primary:focus-visible { - background: var(--button-primary-hover-background, var(--accent-background)); - filter: var(--interactive-filter); - outline: var(--button-primary-focus-outline, var(--outline)); -} - -.btn--default { - color: var(--button-color, var(--foreground)); - fill: var(--button-color, var(--foreground)); - background: var(--button-background, var(--background)); - border: var(--button-border, var(--border)); - border-radius: var(--button-border-radius, 6px); - font-weight: var(--button-font-weight, 500); -} -.btn--default:hover { - color: var(--button-color, var(--foreground)); - fill: var(--button-color, var(--foreground)); - background: var(--button-hover-background, var(--background)); - filter: var(--interactive-filter); -} -.btn--default:focus-visible { - background: var(--button-hover-background, var(--background)); - filter: var(--interactive-filter); - outline: var(--button-focus-outline, var(--outline)); -} -`; -const SUCCESS = ` -.success__position { - position: fixed; - inset: var(--dialog-inset); - padding: var(--page-margin); - z-index: var(--z-index); -} -.success__content { - background: var(--success-background, var(--background)); - border: var(--success-border, var(--border)); - border-radius: var(--success-border-radius, 1.7em/50%); - box-shadow: var(--success-box-shadow, var(--box-shadow)); - font-weight: var(--success-font-weight, 600); - color: var(--success-color); - fill: var(--success-color); - padding: 12px 24px; - line-height: 1.75em; - - display: grid; - align-items: center; - grid-auto-flow: column; - gap: 6px; - cursor: default; -} - -.success__icon { - display: flex; -} -`; -function createDialogStyles(styleNonce) { - const style2 = DOCUMENT.createElement("style"); - style2.textContent = ` -:host { - --dialog-inset: var(--inset); -} - -${DIALOG} -${DIALOG_HEADER} -${FORM} -${BUTTON} -${SUCCESS} -`; - if (styleNonce) { - style2.setAttribute("nonce", styleNonce); - } - return style2; -} -__name(createDialogStyles, "createDialogStyles"); -function getUser() { - const currentUser = getCurrentScope$1().getUser(); - const isolationUser = getIsolationScope().getUser(); - const globalUser = getGlobalScope().getUser(); - if (currentUser && Object.keys(currentUser).length) { - return currentUser; - } - if (isolationUser && Object.keys(isolationUser).length) { - return isolationUser; - } - return globalUser; -} -__name(getUser, "getUser"); -const feedbackModalIntegration = /* @__PURE__ */ __name(() => { - return { - name: "FeedbackModal", - // eslint-disable-next-line @typescript-eslint/no-empty-function - setupOnce() { - }, - createDialog: /* @__PURE__ */ __name(({ options: options4, screenshotIntegration, sendFeedback: sendFeedback2, shadow }) => { - const shadowRoot = shadow; - const userKey = options4.useSentryUser; - const user = getUser(); - const el = DOCUMENT.createElement("div"); - const style2 = createDialogStyles(options4.styleNonce); - let originalOverflow = ""; - const dialog = { - get el() { - return el; - }, - appendToDom() { - if (!shadowRoot.contains(style2) && !shadowRoot.contains(el)) { - shadowRoot.appendChild(style2); - shadowRoot.appendChild(el); - } - }, - removeFromDom() { - shadowRoot.removeChild(el); - shadowRoot.removeChild(style2); - DOCUMENT.body.style.overflow = originalOverflow; - }, - open() { - renderContent(true); - options4.onFormOpen && options4.onFormOpen(); - originalOverflow = DOCUMENT.body.style.overflow; - DOCUMENT.body.style.overflow = "hidden"; - }, - close() { - renderContent(false); - DOCUMENT.body.style.overflow = originalOverflow; - } - }; - const screenshotInput = screenshotIntegration && screenshotIntegration.createInput({ h: y$1, hooks, dialog, options: options4 }); - const renderContent = /* @__PURE__ */ __name((open2) => { - B$1( - y$1( - Dialog, - { - options: options4, - screenshotInput, - showName: options4.showName || options4.isNameRequired, - showEmail: options4.showEmail || options4.isEmailRequired, - defaultName: userKey && user && user[userKey.name] || "", - defaultEmail: userKey && user && user[userKey.email] || "", - onFormClose: /* @__PURE__ */ __name(() => { - renderContent(false); - options4.onFormClose && options4.onFormClose(); - }, "onFormClose"), - onSubmit: sendFeedback2, - onSubmitSuccess: /* @__PURE__ */ __name((data26) => { - renderContent(false); - options4.onSubmitSuccess && options4.onSubmitSuccess(data26); - }, "onSubmitSuccess"), - onSubmitError: /* @__PURE__ */ __name((error2) => { - options4.onSubmitError && options4.onSubmitError(error2); - }, "onSubmitError"), - onFormSubmitted: /* @__PURE__ */ __name(() => { - options4.onFormSubmitted && options4.onFormSubmitted(); - }, "onFormSubmitted"), - open: open2 - } - ), - el - ); - }, "renderContent"); - return dialog; - }, "createDialog") - }; -}, "feedbackModalIntegration"); -function CropCornerFactory({ - h: h2 - // eslint-disable-line @typescript-eslint/no-unused-vars -}) { - return /* @__PURE__ */ __name(function CropCorner({ - top, - left, - corner, - onGrabButton - }) { - return h2( - "button", - { - class: `editor__crop-corner editor__crop-corner--${corner} `, - style: { - top, - left - }, - onMouseDown: /* @__PURE__ */ __name((e2) => { - e2.preventDefault(); - onGrabButton(e2, corner); - }, "onMouseDown"), - onClick: /* @__PURE__ */ __name((e2) => { - e2.preventDefault(); - }, "onClick") - } - ); - }, "CropCorner"); -} -__name(CropCornerFactory, "CropCornerFactory"); -function createScreenshotInputStyles(styleNonce) { - const style2 = DOCUMENT.createElement("style"); - const surface200 = "#1A141F"; - const gray100 = "#302735"; - style2.textContent = ` -.editor { - padding: 10px; - padding-top: 65px; - padding-bottom: 65px; - flex-grow: 1; - - background-color: ${surface200}; - background-image: repeating-linear-gradient( - -145deg, - transparent, - transparent 8px, - ${surface200} 8px, - ${surface200} 11px - ), - repeating-linear-gradient( - -45deg, - transparent, - transparent 15px, - ${gray100} 15px, - ${gray100} 16px - ); -} - -.editor__canvas-container { - width: 100%; - height: 100%; - position: relative; - display: flex; - align-items: center; - justify-content: center; -} - -.editor__canvas-container canvas { - object-fit: contain; - position: relative; -} - -.editor__crop-btn-group { - padding: 8px; - gap: 8px; - border-radius: var(--menu-border-radius, 6px); - background: var(--button-primary-background, var(--background)); - width: 175px; - position: absolute; -} - -.editor__crop-corner { - width: 30px; - height: 30px; - position: absolute; - background: none; - border: 3px solid #ffffff; -} - -.editor__crop-corner--top-left { - cursor: nwse-resize; - border-right: none; - border-bottom: none; -} -.editor__crop-corner--top-right { - cursor: nesw-resize; - border-left: none; - border-bottom: none; -} -.editor__crop-corner--bottom-left { - cursor: nesw-resize; - border-right: none; - border-top: none; -} -.editor__crop-corner--bottom-right { - cursor: nwse-resize; - border-left: none; - border-top: none; -} -`; - if (styleNonce) { - style2.setAttribute("nonce", styleNonce); - } - return style2; -} -__name(createScreenshotInputStyles, "createScreenshotInputStyles"); -function useTakeScreenshotFactory({ hooks: hooks2 }) { - return /* @__PURE__ */ __name(function useTakeScreenshot({ onBeforeScreenshot, onScreenshot, onAfterScreenshot, onError }) { - hooks2.useEffect(() => { - const takeScreenshot = /* @__PURE__ */ __name(async () => { - onBeforeScreenshot(); - const stream = await NAVIGATOR.mediaDevices.getDisplayMedia({ - video: { - width: WINDOW.innerWidth * WINDOW.devicePixelRatio, - height: WINDOW.innerHeight * WINDOW.devicePixelRatio - }, - audio: false, - // @ts-expect-error experimental flags: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia#prefercurrenttab - monitorTypeSurfaces: "exclude", - preferCurrentTab: true, - selfBrowserSurface: "include", - surfaceSwitching: "exclude" - }); - const video = DOCUMENT.createElement("video"); - await new Promise((resolve2, reject3) => { - video.srcObject = stream; - video.onloadedmetadata = () => { - onScreenshot(video); - stream.getTracks().forEach((track2) => track2.stop()); - resolve2(); - }; - video.play().catch(reject3); - }); - onAfterScreenshot(); - }, "takeScreenshot"); - takeScreenshot().catch(onError); - }, []); - }, "useTakeScreenshot"); -} -__name(useTakeScreenshotFactory, "useTakeScreenshotFactory"); -const CROP_BUTTON_SIZE = 30; -const CROP_BUTTON_BORDER = 3; -const CROP_BUTTON_OFFSET = CROP_BUTTON_SIZE + CROP_BUTTON_BORDER; -const DPI = WINDOW.devicePixelRatio; -const constructRect = /* @__PURE__ */ __name((box) => { - return { - x: Math.min(box.startX, box.endX), - y: Math.min(box.startY, box.endY), - width: Math.abs(box.startX - box.endX), - height: Math.abs(box.startY - box.endY) - }; -}, "constructRect"); -const getContainedSize = /* @__PURE__ */ __name((img) => { - const imgClientHeight = img.clientHeight; - const imgClientWidth = img.clientWidth; - const ratio = img.width / img.height; - let width2 = imgClientHeight * ratio; - let height = imgClientHeight; - if (width2 > imgClientWidth) { - width2 = imgClientWidth; - height = imgClientWidth / ratio; - } - const x2 = (imgClientWidth - width2) / 2; - const y2 = (imgClientHeight - height) / 2; - return { startX: x2, startY: y2, endX: width2 + x2, endY: height + y2 }; -}, "getContainedSize"); -function ScreenshotEditorFactory({ - h: h2, - hooks: hooks2, - imageBuffer, - dialog, - options: options4 -}) { - const useTakeScreenshot = useTakeScreenshotFactory({ hooks: hooks2 }); - return /* @__PURE__ */ __name(function ScreenshotEditor({ onError }) { - const styles = hooks2.useMemo(() => ({ __html: createScreenshotInputStyles(options4.styleNonce).innerText }), []); - const CropCorner = CropCornerFactory({ h: h2 }); - const canvasContainerRef = hooks2.useRef(null); - const cropContainerRef = hooks2.useRef(null); - const croppingRef = hooks2.useRef(null); - const [croppingRect, setCroppingRect] = hooks2.useState({ startX: 0, startY: 0, endX: 0, endY: 0 }); - const [confirmCrop, setConfirmCrop] = hooks2.useState(false); - const [isResizing, setIsResizing] = hooks2.useState(false); - hooks2.useEffect(() => { - WINDOW.addEventListener("resize", resizeCropper, false); - }, []); - function resizeCropper() { - const cropper = croppingRef.current; - const imageDimensions = constructRect(getContainedSize(imageBuffer)); - if (cropper) { - cropper.width = imageDimensions.width * DPI; - cropper.height = imageDimensions.height * DPI; - cropper.style.width = `${imageDimensions.width}px`; - cropper.style.height = `${imageDimensions.height}px`; - const ctx = cropper.getContext("2d"); - if (ctx) { - ctx.scale(DPI, DPI); - } - } - const cropButton = cropContainerRef.current; - if (cropButton) { - cropButton.style.width = `${imageDimensions.width}px`; - cropButton.style.height = `${imageDimensions.height}px`; - } - setCroppingRect({ startX: 0, startY: 0, endX: imageDimensions.width, endY: imageDimensions.height }); - } - __name(resizeCropper, "resizeCropper"); - hooks2.useEffect(() => { - const cropper = croppingRef.current; - if (!cropper) { - return; - } - const ctx = cropper.getContext("2d"); - if (!ctx) { - return; - } - const imageDimensions = constructRect(getContainedSize(imageBuffer)); - const croppingBox = constructRect(croppingRect); - ctx.clearRect(0, 0, imageDimensions.width, imageDimensions.height); - ctx.fillStyle = "rgba(0, 0, 0, 0.5)"; - ctx.fillRect(0, 0, imageDimensions.width, imageDimensions.height); - ctx.clearRect(croppingBox.x, croppingBox.y, croppingBox.width, croppingBox.height); - ctx.strokeStyle = "#ffffff"; - ctx.lineWidth = 3; - ctx.strokeRect(croppingBox.x + 1, croppingBox.y + 1, croppingBox.width - 2, croppingBox.height - 2); - ctx.strokeStyle = "#000000"; - ctx.lineWidth = 1; - ctx.strokeRect(croppingBox.x + 3, croppingBox.y + 3, croppingBox.width - 6, croppingBox.height - 6); - }, [croppingRect]); - function onGrabButton(e2, corner) { - setConfirmCrop(false); - setIsResizing(true); - const handleMouseMove2 = makeHandleMouseMove(corner); - const handleMouseUp = /* @__PURE__ */ __name(() => { - DOCUMENT.removeEventListener("mousemove", handleMouseMove2); - DOCUMENT.removeEventListener("mouseup", handleMouseUp); - setConfirmCrop(true); - setIsResizing(false); - }, "handleMouseUp"); - DOCUMENT.addEventListener("mouseup", handleMouseUp); - DOCUMENT.addEventListener("mousemove", handleMouseMove2); - } - __name(onGrabButton, "onGrabButton"); - const makeHandleMouseMove = hooks2.useCallback((corner) => { - return function(e2) { - if (!croppingRef.current) { - return; - } - const cropCanvas = croppingRef.current; - const cropBoundingRect = cropCanvas.getBoundingClientRect(); - const mouseX = e2.clientX - cropBoundingRect.x; - const mouseY = e2.clientY - cropBoundingRect.y; - switch (corner) { - case "top-left": - setCroppingRect((prev2) => ({ - ...prev2, - startX: Math.min(Math.max(0, mouseX), prev2.endX - CROP_BUTTON_OFFSET), - startY: Math.min(Math.max(0, mouseY), prev2.endY - CROP_BUTTON_OFFSET) - })); - break; - case "top-right": - setCroppingRect((prev2) => ({ - ...prev2, - endX: Math.max(Math.min(mouseX, cropCanvas.width / DPI), prev2.startX + CROP_BUTTON_OFFSET), - startY: Math.min(Math.max(0, mouseY), prev2.endY - CROP_BUTTON_OFFSET) - })); - break; - case "bottom-left": - setCroppingRect((prev2) => ({ - ...prev2, - startX: Math.min(Math.max(0, mouseX), prev2.endX - CROP_BUTTON_OFFSET), - endY: Math.max(Math.min(mouseY, cropCanvas.height / DPI), prev2.startY + CROP_BUTTON_OFFSET) - })); - break; - case "bottom-right": - setCroppingRect((prev2) => ({ - ...prev2, - endX: Math.max(Math.min(mouseX, cropCanvas.width / DPI), prev2.startX + CROP_BUTTON_OFFSET), - endY: Math.max(Math.min(mouseY, cropCanvas.height / DPI), prev2.startY + CROP_BUTTON_OFFSET) - })); - break; - } - }; - }, []); - const initialPositionRef = hooks2.useRef({ initialX: 0, initialY: 0 }); - function onDragStart2(e2) { - if (isResizing) return; - initialPositionRef.current = { initialX: e2.clientX, initialY: e2.clientY }; - const handleMouseMove2 = /* @__PURE__ */ __name((moveEvent) => { - const cropCanvas = croppingRef.current; - if (!cropCanvas) return; - const deltaX = moveEvent.clientX - initialPositionRef.current.initialX; - const deltaY = moveEvent.clientY - initialPositionRef.current.initialY; - setCroppingRect((prev2) => { - const newStartX = Math.max( - 0, - Math.min(prev2.startX + deltaX, cropCanvas.width / DPI - (prev2.endX - prev2.startX)) - ); - const newStartY = Math.max( - 0, - Math.min(prev2.startY + deltaY, cropCanvas.height / DPI - (prev2.endY - prev2.startY)) - ); - const newEndX = newStartX + (prev2.endX - prev2.startX); - const newEndY = newStartY + (prev2.endY - prev2.startY); - initialPositionRef.current.initialX = moveEvent.clientX; - initialPositionRef.current.initialY = moveEvent.clientY; - return { - startX: newStartX, - startY: newStartY, - endX: newEndX, - endY: newEndY - }; - }); - }, "handleMouseMove"); - const handleMouseUp = /* @__PURE__ */ __name(() => { - DOCUMENT.removeEventListener("mousemove", handleMouseMove2); - DOCUMENT.removeEventListener("mouseup", handleMouseUp); - }, "handleMouseUp"); - DOCUMENT.addEventListener("mousemove", handleMouseMove2); - DOCUMENT.addEventListener("mouseup", handleMouseUp); - } - __name(onDragStart2, "onDragStart"); - function submit() { - const cutoutCanvas = DOCUMENT.createElement("canvas"); - const imageBox = constructRect(getContainedSize(imageBuffer)); - const croppingBox = constructRect(croppingRect); - cutoutCanvas.width = croppingBox.width * DPI; - cutoutCanvas.height = croppingBox.height * DPI; - const cutoutCtx = cutoutCanvas.getContext("2d"); - if (cutoutCtx && imageBuffer) { - cutoutCtx.drawImage( - imageBuffer, - croppingBox.x / imageBox.width * imageBuffer.width, - croppingBox.y / imageBox.height * imageBuffer.height, - croppingBox.width / imageBox.width * imageBuffer.width, - croppingBox.height / imageBox.height * imageBuffer.height, - 0, - 0, - cutoutCanvas.width, - cutoutCanvas.height - ); - } - const ctx = imageBuffer.getContext("2d"); - if (ctx) { - ctx.clearRect(0, 0, imageBuffer.width, imageBuffer.height); - imageBuffer.width = cutoutCanvas.width; - imageBuffer.height = cutoutCanvas.height; - imageBuffer.style.width = `${croppingBox.width}px`; - imageBuffer.style.height = `${croppingBox.height}px`; - ctx.drawImage(cutoutCanvas, 0, 0); - resizeCropper(); - } - } - __name(submit, "submit"); - useTakeScreenshot({ - onBeforeScreenshot: hooks2.useCallback(() => { - dialog.el.style.display = "none"; - }, []), - onScreenshot: hooks2.useCallback( - (imageSource) => { - const context = imageBuffer.getContext("2d"); - if (!context) { - throw new Error("Could not get canvas context"); - } - imageBuffer.width = imageSource.videoWidth; - imageBuffer.height = imageSource.videoHeight; - imageBuffer.style.width = "100%"; - imageBuffer.style.height = "100%"; - context.drawImage(imageSource, 0, 0); - }, - [imageBuffer] - ), - onAfterScreenshot: hooks2.useCallback(() => { - dialog.el.style.display = "block"; - const container = canvasContainerRef.current; - container && container.appendChild(imageBuffer); - resizeCropper(); - }, []), - onError: hooks2.useCallback((error2) => { - dialog.el.style.display = "block"; - onError(error2); - }, []) - }); - return h2( - "div", - { class: "editor" }, - h2("style", { nonce: options4.styleNonce, dangerouslySetInnerHTML: styles }), - h2( - "div", - { class: "editor__canvas-container", ref: canvasContainerRef }, - h2( - "div", - { class: "editor__crop-container", style: { position: "absolute", zIndex: 1 }, ref: cropContainerRef }, - h2( - "canvas", - { - onMouseDown: onDragStart2, - style: { position: "absolute", cursor: confirmCrop ? "move" : "auto" }, - ref: croppingRef - } - ), - h2( - CropCorner, - { - left: croppingRect.startX - CROP_BUTTON_BORDER, - top: croppingRect.startY - CROP_BUTTON_BORDER, - onGrabButton, - corner: "top-left" - } - ), - h2( - CropCorner, - { - left: croppingRect.endX - CROP_BUTTON_SIZE + CROP_BUTTON_BORDER, - top: croppingRect.startY - CROP_BUTTON_BORDER, - onGrabButton, - corner: "top-right" - } - ), - h2( - CropCorner, - { - left: croppingRect.startX - CROP_BUTTON_BORDER, - top: croppingRect.endY - CROP_BUTTON_SIZE + CROP_BUTTON_BORDER, - onGrabButton, - corner: "bottom-left" - } - ), - h2( - CropCorner, - { - left: croppingRect.endX - CROP_BUTTON_SIZE + CROP_BUTTON_BORDER, - top: croppingRect.endY - CROP_BUTTON_SIZE + CROP_BUTTON_BORDER, - onGrabButton, - corner: "bottom-right" - } - ), - h2( - "div", - { - style: { - left: Math.max(0, croppingRect.endX - 191), - top: Math.max(0, croppingRect.endY + 8), - display: confirmCrop ? "flex" : "none" - }, - class: "editor__crop-btn-group" - }, - h2( - "button", - { - onClick: /* @__PURE__ */ __name((e2) => { - e2.preventDefault(); - if (croppingRef.current) { - setCroppingRect({ - startX: 0, - startY: 0, - endX: croppingRef.current.width / DPI, - endY: croppingRef.current.height / DPI - }); - } - setConfirmCrop(false); - }, "onClick"), - class: "btn btn--default" - }, - options4.cancelButtonLabel - ), - h2( - "button", - { - onClick: /* @__PURE__ */ __name((e2) => { - e2.preventDefault(); - submit(); - setConfirmCrop(false); - }, "onClick"), - class: "btn btn--primary" - }, - options4.confirmButtonLabel - ) - ) - ) - ) - ); - }, "ScreenshotEditor"); -} -__name(ScreenshotEditorFactory, "ScreenshotEditorFactory"); -const feedbackScreenshotIntegration = /* @__PURE__ */ __name(() => { - return { - name: "FeedbackScreenshot", - // eslint-disable-next-line @typescript-eslint/no-empty-function - setupOnce() { - }, - createInput: /* @__PURE__ */ __name(({ h: h2, hooks: hooks2, dialog, options: options4 }) => { - const imageBuffer = DOCUMENT.createElement("canvas"); - return { - input: ScreenshotEditorFactory({ - h: h2, - hooks: hooks2, - imageBuffer, - dialog, - options: options4 - }), - // eslint-disable-line @typescript-eslint/no-explicit-any - value: /* @__PURE__ */ __name(async () => { - const blob = await new Promise((resolve2) => { - imageBuffer.toBlob(resolve2, "image/png"); - }); - if (blob) { - const data26 = new Uint8Array(await blob.arrayBuffer()); - const attachment = { - data: data26, - filename: "screenshot.png", - contentType: "application/png" - // attachmentType?: string; - }; - return attachment; - } - return void 0; - }, "value") - }; - }, "createInput") - }; -}, "feedbackScreenshotIntegration"); -const feedbackAsyncIntegration = buildFeedbackIntegration({ - lazyLoadIntegration -}); -const feedbackSyncIntegration = buildFeedbackIntegration({ - getModalIntegration: /* @__PURE__ */ __name(() => feedbackModalIntegration, "getModalIntegration"), - getScreenshotIntegration: /* @__PURE__ */ __name(() => feedbackScreenshotIntegration, "getScreenshotIntegration") -}); -function increment(name2, value4 = 1, data26) { - metrics$1.increment(BrowserMetricsAggregator, name2, value4, data26); -} -__name(increment, "increment"); -function distribution(name2, value4, data26) { - metrics$1.distribution(BrowserMetricsAggregator, name2, value4, data26); -} -__name(distribution, "distribution"); -function set$2(name2, value4, data26) { - metrics$1.set(BrowserMetricsAggregator, name2, value4, data26); -} -__name(set$2, "set$2"); -function gauge(name2, value4, data26) { - metrics$1.gauge(BrowserMetricsAggregator, name2, value4, data26); -} -__name(gauge, "gauge"); -function timing(name2, value4, unit = "second", data26) { - return metrics$1.timing(BrowserMetricsAggregator, name2, value4, unit, data26); -} -__name(timing, "timing"); -const metrics = { - increment, - distribution, - set: set$2, - gauge, - timing -}; -const responseToSpanId = /* @__PURE__ */ new WeakMap(); -const spanIdToEndTimestamp = /* @__PURE__ */ new Map(); -const defaultRequestInstrumentationOptions = { - traceFetch: true, - traceXHR: true, - enableHTTPTimings: true, - trackFetchStreamPerformance: false -}; -function instrumentOutgoingRequests(client, _options) { - const { - traceFetch, - traceXHR, - trackFetchStreamPerformance, - shouldCreateSpanForRequest, - enableHTTPTimings, - tracePropagationTargets - } = { - traceFetch: defaultRequestInstrumentationOptions.traceFetch, - traceXHR: defaultRequestInstrumentationOptions.traceXHR, - trackFetchStreamPerformance: defaultRequestInstrumentationOptions.trackFetchStreamPerformance, - ..._options - }; - const shouldCreateSpan = typeof shouldCreateSpanForRequest === "function" ? shouldCreateSpanForRequest : (_2) => true; - const shouldAttachHeadersWithTargets = /* @__PURE__ */ __name((url) => shouldAttachHeaders(url, tracePropagationTargets), "shouldAttachHeadersWithTargets"); - const spans = {}; - if (traceFetch) { - client.addEventProcessor((event) => { - if (event.type === "transaction" && event.spans) { - event.spans.forEach((span) => { - if (span.op === "http.client") { - const updatedTimestamp = spanIdToEndTimestamp.get(span.span_id); - if (updatedTimestamp) { - span.timestamp = updatedTimestamp / 1e3; - spanIdToEndTimestamp.delete(span.span_id); - } - } - }); - } - return event; - }); - if (trackFetchStreamPerformance) { - addFetchEndInstrumentationHandler((handlerData) => { - if (handlerData.response) { - const span = responseToSpanId.get(handlerData.response); - if (span && handlerData.endTimestamp) { - spanIdToEndTimestamp.set(span, handlerData.endTimestamp); - } - } - }); - } - addFetchInstrumentationHandler((handlerData) => { - const createdSpan = instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans); - if (handlerData.response && handlerData.fetchData.__span) { - responseToSpanId.set(handlerData.response, handlerData.fetchData.__span); - } - if (createdSpan) { - const fullUrl = getFullURL(handlerData.fetchData.url); - const host = fullUrl ? parseUrl$1(fullUrl).host : void 0; - createdSpan.setAttributes({ - "http.url": fullUrl, - "server.address": host - }); - } - if (enableHTTPTimings && createdSpan) { - addHTTPTimings(createdSpan); - } - }); - } - if (traceXHR) { - addXhrInstrumentationHandler((handlerData) => { - const createdSpan = xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans); - if (enableHTTPTimings && createdSpan) { - addHTTPTimings(createdSpan); - } - }); - } -} -__name(instrumentOutgoingRequests, "instrumentOutgoingRequests"); -function isPerformanceResourceTiming(entry) { - return entry.entryType === "resource" && "initiatorType" in entry && typeof entry.nextHopProtocol === "string" && (entry.initiatorType === "fetch" || entry.initiatorType === "xmlhttprequest"); -} -__name(isPerformanceResourceTiming, "isPerformanceResourceTiming"); -function addHTTPTimings(span) { - const { url } = spanToJSON(span).data || {}; - if (!url || typeof url !== "string") { - return; - } - const cleanup = addPerformanceInstrumentationHandler("resource", ({ entries }) => { - entries.forEach((entry) => { - if (isPerformanceResourceTiming(entry) && entry.name.endsWith(url)) { - const spanData = resourceTimingEntryToSpanData(entry); - spanData.forEach((data26) => span.setAttribute(...data26)); - setTimeout(cleanup); - } - }); - }); -} -__name(addHTTPTimings, "addHTTPTimings"); -function getAbsoluteTime(time = 0) { - return ((browserPerformanceTimeOrigin || performance.timeOrigin) + time) / 1e3; -} -__name(getAbsoluteTime, "getAbsoluteTime"); -function resourceTimingEntryToSpanData(resourceTiming) { - const { name: name2, version: version2 } = extractNetworkProtocol(resourceTiming.nextHopProtocol); - const timingSpanData = []; - timingSpanData.push(["network.protocol.version", version2], ["network.protocol.name", name2]); - if (!browserPerformanceTimeOrigin) { - return timingSpanData; - } - return [ - ...timingSpanData, - ["http.request.redirect_start", getAbsoluteTime(resourceTiming.redirectStart)], - ["http.request.fetch_start", getAbsoluteTime(resourceTiming.fetchStart)], - ["http.request.domain_lookup_start", getAbsoluteTime(resourceTiming.domainLookupStart)], - ["http.request.domain_lookup_end", getAbsoluteTime(resourceTiming.domainLookupEnd)], - ["http.request.connect_start", getAbsoluteTime(resourceTiming.connectStart)], - ["http.request.secure_connection_start", getAbsoluteTime(resourceTiming.secureConnectionStart)], - ["http.request.connection_end", getAbsoluteTime(resourceTiming.connectEnd)], - ["http.request.request_start", getAbsoluteTime(resourceTiming.requestStart)], - ["http.request.response_start", getAbsoluteTime(resourceTiming.responseStart)], - ["http.request.response_end", getAbsoluteTime(resourceTiming.responseEnd)] - ]; -} -__name(resourceTimingEntryToSpanData, "resourceTimingEntryToSpanData"); -function shouldAttachHeaders(targetUrl, tracePropagationTargets) { - const href = WINDOW$5.location && WINDOW$5.location.href; - if (!href) { - const isRelativeSameOriginRequest = !!targetUrl.match(/^\/(?!\/)/); - if (!tracePropagationTargets) { - return isRelativeSameOriginRequest; - } else { - return stringMatchesSomePattern(targetUrl, tracePropagationTargets); - } - } else { - let resolvedUrl; - let currentOrigin; - try { - resolvedUrl = new URL(targetUrl, href); - currentOrigin = new URL(href).origin; - } catch (e2) { - return false; - } - const isSameOriginRequest = resolvedUrl.origin === currentOrigin; - if (!tracePropagationTargets) { - return isSameOriginRequest; - } else { - return stringMatchesSomePattern(resolvedUrl.toString(), tracePropagationTargets) || isSameOriginRequest && stringMatchesSomePattern(resolvedUrl.pathname, tracePropagationTargets); - } - } -} -__name(shouldAttachHeaders, "shouldAttachHeaders"); -function xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeaders2, spans) { - const xhr = handlerData.xhr; - const sentryXhrData = xhr && xhr[SENTRY_XHR_DATA_KEY]; - if (!xhr || xhr.__sentry_own_request__ || !sentryXhrData) { - return void 0; - } - const shouldCreateSpanResult = hasTracingEnabled() && shouldCreateSpan(sentryXhrData.url); - if (handlerData.endTimestamp && shouldCreateSpanResult) { - const spanId = xhr.__sentry_xhr_span_id__; - if (!spanId) return; - const span2 = spans[spanId]; - if (span2 && sentryXhrData.status_code !== void 0) { - setHttpStatus(span2, sentryXhrData.status_code); - span2.end(); - delete spans[spanId]; - } - return void 0; - } - const fullUrl = getFullURL(sentryXhrData.url); - const host = fullUrl ? parseUrl$1(fullUrl).host : void 0; - const hasParent = !!getActiveSpan(); - const span = shouldCreateSpanResult && hasParent ? startInactiveSpan({ - name: `${sentryXhrData.method} ${sentryXhrData.url}`, - attributes: { - type: "xhr", - "http.method": sentryXhrData.method, - "http.url": fullUrl, - url: sentryXhrData.url, - "server.address": host, - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.browser", - [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.client" - } - }) : new SentryNonRecordingSpan(); - xhr.__sentry_xhr_span_id__ = span.spanContext().spanId; - spans[xhr.__sentry_xhr_span_id__] = span; - if (shouldAttachHeaders2(sentryXhrData.url)) { - addTracingHeadersToXhrRequest( - xhr, - // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction), - // we do not want to use the span as base for the trace headers, - // which means that the headers will be generated from the scope and the sampling decision is deferred - hasTracingEnabled() && hasParent ? span : void 0 - ); - } - return span; -} -__name(xhrCallback, "xhrCallback"); -function addTracingHeadersToXhrRequest(xhr, span) { - const { "sentry-trace": sentryTrace, baggage } = getTraceData({ span }); - if (sentryTrace) { - setHeaderOnXhr(xhr, sentryTrace, baggage); - } -} -__name(addTracingHeadersToXhrRequest, "addTracingHeadersToXhrRequest"); -function setHeaderOnXhr(xhr, sentryTraceHeader, sentryBaggageHeader) { - try { - xhr.setRequestHeader("sentry-trace", sentryTraceHeader); - if (sentryBaggageHeader) { - xhr.setRequestHeader("baggage", sentryBaggageHeader); - } - } catch (_2) { - } -} -__name(setHeaderOnXhr, "setHeaderOnXhr"); -function getFullURL(url) { - try { - const parsed = new URL(url, WINDOW$5.location.origin); - return parsed.href; - } catch (e2) { - return void 0; - } -} -__name(getFullURL, "getFullURL"); -function registerBackgroundTabDetection() { - if (WINDOW$5 && WINDOW$5.document) { - WINDOW$5.document.addEventListener("visibilitychange", () => { - const activeSpan = getActiveSpan(); - if (!activeSpan) { - return; - } - const rootSpan = getRootSpan(activeSpan); - if (WINDOW$5.document.hidden && rootSpan) { - const cancelledStatus = "cancelled"; - const { op, status } = spanToJSON(rootSpan); - if (DEBUG_BUILD$4) { - logger$2.log(`[Tracing] Transaction: ${cancelledStatus} -> since tab moved to the background, op: ${op}`); - } - if (!status) { - rootSpan.setStatus({ code: SPAN_STATUS_ERROR, message: cancelledStatus }); - } - rootSpan.setAttribute("sentry.cancellation_reason", "document.hidden"); - rootSpan.end(); - } - }); - } else { - DEBUG_BUILD$4 && logger$2.warn("[Tracing] Could not set up background tab detection due to lack of global document"); - } -} -__name(registerBackgroundTabDetection, "registerBackgroundTabDetection"); -const BROWSER_TRACING_INTEGRATION_ID = "BrowserTracing"; -const DEFAULT_BROWSER_TRACING_OPTIONS = { - ...TRACING_DEFAULTS, - instrumentNavigation: true, - instrumentPageLoad: true, - markBackgroundSpan: true, - enableLongTask: true, - enableLongAnimationFrame: true, - enableInp: true, - _experiments: {}, - ...defaultRequestInstrumentationOptions -}; -const browserTracingIntegration$1 = /* @__PURE__ */ __name((_options = {}) => { - registerSpanErrorInstrumentation(); - const { - enableInp, - enableLongTask, - enableLongAnimationFrame, - _experiments: { enableInteractions, enableStandaloneClsSpans }, - beforeStartSpan, - idleTimeout, - finalTimeout, - childSpanTimeout, - markBackgroundSpan, - traceFetch, - traceXHR, - trackFetchStreamPerformance, - shouldCreateSpanForRequest, - enableHTTPTimings, - instrumentPageLoad, - instrumentNavigation - } = { - ...DEFAULT_BROWSER_TRACING_OPTIONS, - ..._options - }; - const _collectWebVitals = startTrackingWebVitals({ recordClsStandaloneSpans: enableStandaloneClsSpans || false }); - if (enableInp) { - startTrackingINP(); - } - if (enableLongAnimationFrame && GLOBAL_OBJ.PerformanceObserver && PerformanceObserver.supportedEntryTypes && PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")) { - startTrackingLongAnimationFrames(); - } else if (enableLongTask) { - startTrackingLongTasks(); - } - if (enableInteractions) { - startTrackingInteractions(); - } - const latestRoute = { - name: void 0, - source: void 0 - }; - function _createRouteSpan(client, startSpanOptions) { - const isPageloadTransaction = startSpanOptions.op === "pageload"; - const finalStartSpanOptions = beforeStartSpan ? beforeStartSpan(startSpanOptions) : startSpanOptions; - const attributes = finalStartSpanOptions.attributes || {}; - if (startSpanOptions.name !== finalStartSpanOptions.name) { - attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = "custom"; - finalStartSpanOptions.attributes = attributes; - } - latestRoute.name = finalStartSpanOptions.name; - latestRoute.source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; - const idleSpan = startIdleSpan(finalStartSpanOptions, { - idleTimeout, - finalTimeout, - childSpanTimeout, - // should wait for finish signal if it's a pageload transaction - disableAutoFinish: isPageloadTransaction, - beforeSpanEnd: /* @__PURE__ */ __name((span) => { - _collectWebVitals(); - addPerformanceEntries(span, { recordClsOnPageloadSpan: !enableStandaloneClsSpans }); - }, "beforeSpanEnd") - }); - function emitFinish() { - if (["interactive", "complete"].includes(WINDOW$5.document.readyState)) { - client.emit("idleSpanEnableAutoFinish", idleSpan); - } - } - __name(emitFinish, "emitFinish"); - if (isPageloadTransaction && WINDOW$5.document) { - WINDOW$5.document.addEventListener("readystatechange", () => { - emitFinish(); - }); - emitFinish(); - } - return idleSpan; - } - __name(_createRouteSpan, "_createRouteSpan"); - return { - name: BROWSER_TRACING_INTEGRATION_ID, - afterAllSetup(client) { - let activeSpan; - let startingUrl = WINDOW$5.location && WINDOW$5.location.href; - function maybeEndActiveSpan() { - if (activeSpan && !spanToJSON(activeSpan).timestamp) { - DEBUG_BUILD$4 && logger$2.log(`[Tracing] Finishing current active span with op: ${spanToJSON(activeSpan).op}`); - activeSpan.end(); - } - } - __name(maybeEndActiveSpan, "maybeEndActiveSpan"); - client.on("startNavigationSpan", (startSpanOptions) => { - if (getClient() !== client) { - return; - } - maybeEndActiveSpan(); - activeSpan = _createRouteSpan(client, { - op: "navigation", - ...startSpanOptions - }); - }); - client.on("startPageLoadSpan", (startSpanOptions, traceOptions = {}) => { - if (getClient() !== client) { - return; - } - maybeEndActiveSpan(); - const sentryTrace = traceOptions.sentryTrace || getMetaContent("sentry-trace"); - const baggage = traceOptions.baggage || getMetaContent("baggage"); - const propagationContext = propagationContextFromHeaders(sentryTrace, baggage); - getCurrentScope$1().setPropagationContext(propagationContext); - activeSpan = _createRouteSpan(client, { - op: "pageload", - ...startSpanOptions - }); - }); - client.on("spanEnd", (span) => { - const op = spanToJSON(span).op; - if (span !== getRootSpan(span) || op !== "navigation" && op !== "pageload") { - return; - } - const scope = getCurrentScope$1(); - const oldPropagationContext = scope.getPropagationContext(); - scope.setPropagationContext({ - ...oldPropagationContext, - sampled: oldPropagationContext.sampled !== void 0 ? oldPropagationContext.sampled : spanIsSampled(span), - dsc: oldPropagationContext.dsc || getDynamicSamplingContextFromSpan(span) - }); - }); - if (WINDOW$5.location) { - if (instrumentPageLoad) { - startBrowserTracingPageLoadSpan(client, { - name: WINDOW$5.location.pathname, - // pageload should always start at timeOrigin (and needs to be in s, not ms) - startTime: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1e3 : void 0, - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url", - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.pageload.browser" - } - }); - } - if (instrumentNavigation) { - addHistoryInstrumentationHandler(({ to, from: from2 }) => { - if (from2 === void 0 && startingUrl && startingUrl.indexOf(to) !== -1) { - startingUrl = void 0; - return; - } - if (from2 !== to) { - startingUrl = void 0; - startBrowserTracingNavigationSpan(client, { - name: WINDOW$5.location.pathname, - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url", - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.navigation.browser" - } - }); - } - }); - } - } - if (markBackgroundSpan) { - registerBackgroundTabDetection(); - } - if (enableInteractions) { - registerInteractionListener(idleTimeout, finalTimeout, childSpanTimeout, latestRoute); - } - if (enableInp) { - registerInpInteractionListener(); - } - instrumentOutgoingRequests(client, { - traceFetch, - traceXHR, - trackFetchStreamPerformance, - tracePropagationTargets: client.getOptions().tracePropagationTargets, - shouldCreateSpanForRequest, - enableHTTPTimings - }); - } - }; -}, "browserTracingIntegration$1"); -function startBrowserTracingPageLoadSpan(client, spanOptions, traceOptions) { - client.emit("startPageLoadSpan", spanOptions, traceOptions); - getCurrentScope$1().setTransactionName(spanOptions.name); - const span = getActiveSpan(); - const op = span && spanToJSON(span).op; - return op === "pageload" ? span : void 0; -} -__name(startBrowserTracingPageLoadSpan, "startBrowserTracingPageLoadSpan"); -function startBrowserTracingNavigationSpan(client, spanOptions) { - getIsolationScope().setPropagationContext({ traceId: generateTraceId() }); - getCurrentScope$1().setPropagationContext({ traceId: generateTraceId() }); - client.emit("startNavigationSpan", spanOptions); - getCurrentScope$1().setTransactionName(spanOptions.name); - const span = getActiveSpan(); - const op = span && spanToJSON(span).op; - return op === "navigation" ? span : void 0; -} -__name(startBrowserTracingNavigationSpan, "startBrowserTracingNavigationSpan"); -function getMetaContent(metaName) { - const metaTag = getDomElement(`meta[name=${metaName}]`); - return metaTag ? metaTag.getAttribute("content") : void 0; -} -__name(getMetaContent, "getMetaContent"); -function registerInteractionListener(idleTimeout, finalTimeout, childSpanTimeout, latestRoute) { - let inflightInteractionSpan; - const registerInteractionTransaction = /* @__PURE__ */ __name(() => { - const op = "ui.action.click"; - const activeSpan = getActiveSpan(); - const rootSpan = activeSpan && getRootSpan(activeSpan); - if (rootSpan) { - const currentRootSpanOp = spanToJSON(rootSpan).op; - if (["navigation", "pageload"].includes(currentRootSpanOp)) { - DEBUG_BUILD$4 && logger$2.warn(`[Tracing] Did not create ${op} span because a pageload or navigation span is in progress.`); - return void 0; - } - } - if (inflightInteractionSpan) { - inflightInteractionSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, "interactionInterrupted"); - inflightInteractionSpan.end(); - inflightInteractionSpan = void 0; - } - if (!latestRoute.name) { - DEBUG_BUILD$4 && logger$2.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`); - return void 0; - } - inflightInteractionSpan = startIdleSpan( - { - name: latestRoute.name, - op, - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || "url" - } - }, - { - idleTimeout, - finalTimeout, - childSpanTimeout - } - ); - }, "registerInteractionTransaction"); - if (WINDOW$5.document) { - addEventListener("click", registerInteractionTransaction, { once: false, capture: true }); - } -} -__name(registerInteractionListener, "registerInteractionListener"); -function promisifyRequest(request) { - return new Promise((resolve2, reject3) => { - request.oncomplete = request.onsuccess = () => resolve2(request.result); - request.onabort = request.onerror = () => reject3(request.error); - }); -} -__name(promisifyRequest, "promisifyRequest"); -function createStore(dbName, storeName) { - const request = indexedDB.open(dbName); - request.onupgradeneeded = () => request.result.createObjectStore(storeName); - const dbp = promisifyRequest(request); - return (callback) => dbp.then((db) => callback(db.transaction(storeName, "readwrite").objectStore(storeName))); -} -__name(createStore, "createStore"); -function keys$7(store) { - return promisifyRequest(store.getAllKeys()); -} -__name(keys$7, "keys$7"); -function push(store, value4, maxQueueSize) { - return store((store2) => { - return keys$7(store2).then((keys2) => { - if (keys2.length >= maxQueueSize) { - return; - } - store2.put(value4, Math.max(...keys2, 0) + 1); - return promisifyRequest(store2.transaction); - }); - }); -} -__name(push, "push"); -function unshift(store, value4, maxQueueSize) { - return store((store2) => { - return keys$7(store2).then((keys2) => { - if (keys2.length >= maxQueueSize) { - return; - } - store2.put(value4, Math.min(...keys2, 0) - 1); - return promisifyRequest(store2.transaction); - }); - }); -} -__name(unshift, "unshift"); -function shift$1(store) { - return store((store2) => { - return keys$7(store2).then((keys2) => { - const firstKey = keys2[0]; - if (firstKey == null) { - return void 0; - } - return promisifyRequest(store2.get(firstKey)).then((value4) => { - store2.delete(firstKey); - return promisifyRequest(store2.transaction).then(() => value4); - }); - }); - }); -} -__name(shift$1, "shift$1"); -function createIndexedDbStore(options4) { - let store; - function getStore() { - if (store == void 0) { - store = createStore(options4.dbName || "sentry-offline", options4.storeName || "queue"); - } - return store; - } - __name(getStore, "getStore"); - return { - push: /* @__PURE__ */ __name(async (env) => { - try { - const serialized = await serializeEnvelope(env); - await push(getStore(), serialized, options4.maxQueueSize || 30); - } catch (_2) { - } - }, "push"), - unshift: /* @__PURE__ */ __name(async (env) => { - try { - const serialized = await serializeEnvelope(env); - await unshift(getStore(), serialized, options4.maxQueueSize || 30); - } catch (_2) { - } - }, "unshift"), - shift: /* @__PURE__ */ __name(async () => { - try { - const deserialized = await shift$1(getStore()); - if (deserialized) { - return parseEnvelope(deserialized); - } - } catch (_2) { - } - return void 0; - }, "shift") - }; -} -__name(createIndexedDbStore, "createIndexedDbStore"); -function makeIndexedDbOfflineTransport(createTransport2) { - return (options4) => { - const transport = createTransport2({ ...options4, createStore: createIndexedDbStore }); - WINDOW$5.addEventListener("online", async (_2) => { - await transport.flush(); - }); - return transport; - }; -} -__name(makeIndexedDbOfflineTransport, "makeIndexedDbOfflineTransport"); -function makeBrowserOfflineTransport(createTransport2 = makeFetchTransport) { - return makeIndexedDbOfflineTransport(makeOfflineTransport(createTransport2)); -} -__name(makeBrowserOfflineTransport, "makeBrowserOfflineTransport"); -const MS_TO_NS = 1e6; -const THREAD_ID_STRING = String(0); -const THREAD_NAME = "main"; -let OS_PLATFORM = ""; -let OS_PLATFORM_VERSION = ""; -let OS_ARCH = ""; -let OS_BROWSER = WINDOW$5.navigator && WINDOW$5.navigator.userAgent || ""; -let OS_MODEL = ""; -const OS_LOCALE = WINDOW$5.navigator && WINDOW$5.navigator.language || WINDOW$5.navigator && WINDOW$5.navigator.languages && WINDOW$5.navigator.languages[0] || ""; -function isUserAgentData(data26) { - return typeof data26 === "object" && data26 !== null && "getHighEntropyValues" in data26; -} -__name(isUserAgentData, "isUserAgentData"); -const userAgentData = WINDOW$5.navigator && WINDOW$5.navigator.userAgentData; -if (isUserAgentData(userAgentData)) { - userAgentData.getHighEntropyValues(["architecture", "model", "platform", "platformVersion", "fullVersionList"]).then((ua) => { - OS_PLATFORM = ua.platform || ""; - OS_ARCH = ua.architecture || ""; - OS_MODEL = ua.model || ""; - OS_PLATFORM_VERSION = ua.platformVersion || ""; - if (ua.fullVersionList && ua.fullVersionList.length > 0) { - const firstUa = ua.fullVersionList[ua.fullVersionList.length - 1]; - OS_BROWSER = `${firstUa.brand} ${firstUa.version}`; - } - }).catch((e2) => void 0); -} -function isProcessedJSSelfProfile(profile) { - return !("thread_metadata" in profile); -} -__name(isProcessedJSSelfProfile, "isProcessedJSSelfProfile"); -function enrichWithThreadInformation(profile) { - if (!isProcessedJSSelfProfile(profile)) { - return profile; - } - return convertJSSelfProfileToSampledFormat(profile); -} -__name(enrichWithThreadInformation, "enrichWithThreadInformation"); -function getTraceId(event) { - const traceId = event && event.contexts && event.contexts["trace"] && event.contexts["trace"]["trace_id"]; - if (typeof traceId === "string" && traceId.length !== 32) { - if (DEBUG_BUILD$4) { - logger$2.log(`[Profiling] Invalid traceId: ${traceId} on profiled event`); - } - } - if (typeof traceId !== "string") { - return ""; - } - return traceId; -} -__name(getTraceId, "getTraceId"); -function createProfilePayload(profile_id, start_timestamp, processed_profile, event) { - if (event.type !== "transaction") { - throw new TypeError("Profiling events may only be attached to transactions, this should never occur."); - } - if (processed_profile === void 0 || processed_profile === null) { - throw new TypeError( - `Cannot construct profiling event envelope without a valid profile. Got ${processed_profile} instead.` - ); - } - const traceId = getTraceId(event); - const enrichedThreadProfile = enrichWithThreadInformation(processed_profile); - const transactionStartMs = start_timestamp ? start_timestamp : typeof event.start_timestamp === "number" ? event.start_timestamp * 1e3 : timestampInSeconds() * 1e3; - const transactionEndMs = typeof event.timestamp === "number" ? event.timestamp * 1e3 : timestampInSeconds() * 1e3; - const profile = { - event_id: profile_id, - timestamp: new Date(transactionStartMs).toISOString(), - platform: "javascript", - version: "1", - release: event.release || "", - environment: event.environment || DEFAULT_ENVIRONMENT, - runtime: { - name: "javascript", - version: WINDOW$5.navigator.userAgent - }, - os: { - name: OS_PLATFORM, - version: OS_PLATFORM_VERSION, - build_number: OS_BROWSER - }, - device: { - locale: OS_LOCALE, - model: OS_MODEL, - manufacturer: OS_BROWSER, - architecture: OS_ARCH, - is_emulator: false - }, - debug_meta: { - images: applyDebugMetadata(processed_profile.resources) - }, - profile: enrichedThreadProfile, - transactions: [ - { - name: event.transaction || "", - id: event.event_id || uuid4(), - trace_id: traceId, - active_thread_id: THREAD_ID_STRING, - relative_start_ns: "0", - relative_end_ns: ((transactionEndMs - transactionStartMs) * 1e6).toFixed(0) - } - ] - }; - return profile; -} -__name(createProfilePayload, "createProfilePayload"); -function isAutomatedPageLoadSpan(span) { - return spanToJSON(span).op === "pageload"; -} -__name(isAutomatedPageLoadSpan, "isAutomatedPageLoadSpan"); -function convertJSSelfProfileToSampledFormat(input) { - let EMPTY_STACK_ID = void 0; - let STACK_ID = 0; - const profile = { - samples: [], - stacks: [], - frames: [], - thread_metadata: { - [THREAD_ID_STRING]: { name: THREAD_NAME } - } - }; - const firstSample = input.samples[0]; - if (!firstSample) { - return profile; - } - const start2 = firstSample.timestamp; - const origin2 = typeof performance.timeOrigin === "number" ? performance.timeOrigin : browserPerformanceTimeOrigin || 0; - const adjustForOriginChange = origin2 - (browserPerformanceTimeOrigin || origin2); - input.samples.forEach((jsSample, i2) => { - if (jsSample.stackId === void 0) { - if (EMPTY_STACK_ID === void 0) { - EMPTY_STACK_ID = STACK_ID; - profile.stacks[EMPTY_STACK_ID] = []; - STACK_ID++; - } - profile["samples"][i2] = { - // convert ms timestamp to ns - elapsed_since_start_ns: ((jsSample.timestamp + adjustForOriginChange - start2) * MS_TO_NS).toFixed(0), - stack_id: EMPTY_STACK_ID, - thread_id: THREAD_ID_STRING - }; - return; - } - let stackTop = input.stacks[jsSample.stackId]; - const stack2 = []; - while (stackTop) { - stack2.push(stackTop.frameId); - const frame = input.frames[stackTop.frameId]; - if (frame && profile.frames[stackTop.frameId] === void 0) { - profile.frames[stackTop.frameId] = { - function: frame.name, - abs_path: typeof frame.resourceId === "number" ? input.resources[frame.resourceId] : void 0, - lineno: frame.line, - colno: frame.column - }; - } - stackTop = stackTop.parentId === void 0 ? void 0 : input.stacks[stackTop.parentId]; - } - const sample = { - // convert ms timestamp to ns - elapsed_since_start_ns: ((jsSample.timestamp + adjustForOriginChange - start2) * MS_TO_NS).toFixed(0), - stack_id: STACK_ID, - thread_id: THREAD_ID_STRING - }; - profile["stacks"][STACK_ID] = stack2; - profile["samples"][i2] = sample; - STACK_ID++; - }); - return profile; -} -__name(convertJSSelfProfileToSampledFormat, "convertJSSelfProfileToSampledFormat"); -function addProfilesToEnvelope(envelope, profiles) { - if (!profiles.length) { - return envelope; - } - for (const profile of profiles) { - envelope[1].push([{ type: "profile" }, profile]); - } - return envelope; -} -__name(addProfilesToEnvelope, "addProfilesToEnvelope"); -function findProfiledTransactionsFromEnvelope(envelope) { - const events2 = []; - forEachEnvelopeItem(envelope, (item3, type) => { - if (type !== "transaction") { - return; - } - for (let j2 = 1; j2 < item3.length; j2++) { - const event = item3[j2]; - if (event && event.contexts && event.contexts["profile"] && event.contexts["profile"]["profile_id"]) { - events2.push(item3[j2]); - } - } - }); - return events2; -} -__name(findProfiledTransactionsFromEnvelope, "findProfiledTransactionsFromEnvelope"); -function applyDebugMetadata(resource_paths) { - const client = getClient(); - const options4 = client && client.getOptions(); - const stackParser = options4 && options4.stackParser; - if (!stackParser) { - return []; - } - return getDebugImagesForResources(stackParser, resource_paths); -} -__name(applyDebugMetadata, "applyDebugMetadata"); -function isValidSampleRate(rate) { - if (typeof rate !== "number" && typeof rate !== "boolean" || typeof rate === "number" && isNaN(rate)) { - DEBUG_BUILD$4 && logger$2.warn( - `[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify( - rate - )} of type ${JSON.stringify(typeof rate)}.` - ); - return false; - } - if (rate === true || rate === false) { - return true; - } - if (rate < 0 || rate > 1) { - DEBUG_BUILD$4 && logger$2.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${rate}.`); - return false; - } - return true; -} -__name(isValidSampleRate, "isValidSampleRate"); -function isValidProfile(profile) { - if (profile.samples.length < 2) { - if (DEBUG_BUILD$4) { - logger$2.log("[Profiling] Discarding profile because it contains less than 2 samples"); - } - return false; - } - if (!profile.frames.length) { - if (DEBUG_BUILD$4) { - logger$2.log("[Profiling] Discarding profile because it contains no frames"); - } - return false; - } - return true; -} -__name(isValidProfile, "isValidProfile"); -let PROFILING_CONSTRUCTOR_FAILED = false; -const MAX_PROFILE_DURATION_MS = 3e4; -function isJSProfilerSupported(maybeProfiler) { - return typeof maybeProfiler === "function"; -} -__name(isJSProfilerSupported, "isJSProfilerSupported"); -function startJSSelfProfile() { - const JSProfilerConstructor = WINDOW$5.Profiler; - if (!isJSProfilerSupported(JSProfilerConstructor)) { - if (DEBUG_BUILD$4) { - logger$2.log( - "[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object." - ); - } - return; - } - const samplingIntervalMS = 10; - const maxSamples = Math.floor(MAX_PROFILE_DURATION_MS / samplingIntervalMS); - try { - return new JSProfilerConstructor({ sampleInterval: samplingIntervalMS, maxBufferSize: maxSamples }); - } catch (e2) { - if (DEBUG_BUILD$4) { - logger$2.log( - "[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header." - ); - logger$2.log("[Profiling] Disabling profiling for current user session."); - } - PROFILING_CONSTRUCTOR_FAILED = true; - } - return; -} -__name(startJSSelfProfile, "startJSSelfProfile"); -function shouldProfileSpan(span) { - if (PROFILING_CONSTRUCTOR_FAILED) { - if (DEBUG_BUILD$4) { - logger$2.log("[Profiling] Profiling has been disabled for the duration of the current user session."); - } - return false; - } - if (!span.isRecording()) { - if (DEBUG_BUILD$4) { - logger$2.log("[Profiling] Discarding profile because transaction was not sampled."); - } - return false; - } - const client = getClient(); - const options4 = client && client.getOptions(); - if (!options4) { - DEBUG_BUILD$4 && logger$2.log("[Profiling] Profiling disabled, no options found."); - return false; - } - const profilesSampleRate = options4.profilesSampleRate; - if (!isValidSampleRate(profilesSampleRate)) { - DEBUG_BUILD$4 && logger$2.warn("[Profiling] Discarding profile because of invalid sample rate."); - return false; - } - if (!profilesSampleRate) { - DEBUG_BUILD$4 && logger$2.log( - "[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0" - ); - return false; - } - const sampled = profilesSampleRate === true ? true : Math.random() < profilesSampleRate; - if (!sampled) { - DEBUG_BUILD$4 && logger$2.log( - `[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number( - profilesSampleRate - )})` - ); - return false; - } - return true; -} -__name(shouldProfileSpan, "shouldProfileSpan"); -function createProfilingEvent(profile_id, start_timestamp, profile, event) { - if (!isValidProfile(profile)) { - return null; - } - return createProfilePayload(profile_id, start_timestamp, profile, event); -} -__name(createProfilingEvent, "createProfilingEvent"); -const PROFILE_MAP = /* @__PURE__ */ new Map(); -function getActiveProfilesCount() { - return PROFILE_MAP.size; -} -__name(getActiveProfilesCount, "getActiveProfilesCount"); -function takeProfileFromGlobalCache(profile_id) { - const profile = PROFILE_MAP.get(profile_id); - if (profile) { - PROFILE_MAP.delete(profile_id); - } - return profile; -} -__name(takeProfileFromGlobalCache, "takeProfileFromGlobalCache"); -function addProfileToGlobalCache(profile_id, profile) { - PROFILE_MAP.set(profile_id, profile); - if (PROFILE_MAP.size > 30) { - const last = PROFILE_MAP.keys().next().value; - PROFILE_MAP.delete(last); - } -} -__name(addProfileToGlobalCache, "addProfileToGlobalCache"); -function startProfileForSpan(span) { - let startTimestamp; - if (isAutomatedPageLoadSpan(span)) { - startTimestamp = timestampInSeconds() * 1e3; - } - const profiler2 = startJSSelfProfile(); - if (!profiler2) { - return; - } - if (DEBUG_BUILD$4) { - logger$2.log(`[Profiling] started profiling span: ${spanToJSON(span).description}`); - } - const profileId = uuid4(); - getCurrentScope$1().setContext("profile", { - profile_id: profileId, - start_timestamp: startTimestamp - }); - async function onProfileHandler() { - if (!span) { - return; - } - if (!profiler2) { - return; - } - return profiler2.stop().then((profile) => { - if (maxDurationTimeoutID) { - WINDOW$5.clearTimeout(maxDurationTimeoutID); - maxDurationTimeoutID = void 0; - } - if (DEBUG_BUILD$4) { - logger$2.log(`[Profiling] stopped profiling of span: ${spanToJSON(span).description}`); - } - if (!profile) { - if (DEBUG_BUILD$4) { - logger$2.log( - `[Profiling] profiler returned null profile for: ${spanToJSON(span).description}`, - "this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started" - ); - } - return; - } - addProfileToGlobalCache(profileId, profile); - }).catch((error2) => { - if (DEBUG_BUILD$4) { - logger$2.log("[Profiling] error while stopping profiler:", error2); - } - }); - } - __name(onProfileHandler, "onProfileHandler"); - let maxDurationTimeoutID = WINDOW$5.setTimeout(() => { - if (DEBUG_BUILD$4) { - logger$2.log("[Profiling] max profile duration elapsed, stopping profiling for:", spanToJSON(span).description); - } - onProfileHandler(); - }, MAX_PROFILE_DURATION_MS); - const originalEnd = span.end.bind(span); - function profilingWrappedSpanEnd() { - if (!span) { - return originalEnd(); - } - void onProfileHandler().then( - () => { - originalEnd(); - }, - () => { - originalEnd(); - } - ); - return span; - } - __name(profilingWrappedSpanEnd, "profilingWrappedSpanEnd"); - span.end = profilingWrappedSpanEnd; -} -__name(startProfileForSpan, "startProfileForSpan"); -const INTEGRATION_NAME$2 = "BrowserProfiling"; -const _browserProfilingIntegration = /* @__PURE__ */ __name(() => { - return { - name: INTEGRATION_NAME$2, - setup(client) { - const activeSpan = getActiveSpan(); - const rootSpan = activeSpan && getRootSpan(activeSpan); - if (rootSpan && isAutomatedPageLoadSpan(rootSpan)) { - if (shouldProfileSpan(rootSpan)) { - startProfileForSpan(rootSpan); - } - } - client.on("spanStart", (span) => { - if (span === getRootSpan(span) && shouldProfileSpan(span)) { - startProfileForSpan(span); - } - }); - client.on("beforeEnvelope", (envelope) => { - if (!getActiveProfilesCount()) { - return; - } - const profiledTransactionEvents = findProfiledTransactionsFromEnvelope(envelope); - if (!profiledTransactionEvents.length) { - return; - } - const profilesToAddToEnvelope = []; - for (const profiledTransaction of profiledTransactionEvents) { - const context = profiledTransaction && profiledTransaction.contexts; - const profile_id = context && context["profile"] && context["profile"]["profile_id"]; - const start_timestamp = context && context["profile"] && context["profile"]["start_timestamp"]; - if (typeof profile_id !== "string") { - DEBUG_BUILD$4 && logger$2.log("[Profiling] cannot find profile for a span without a profile context"); - continue; - } - if (!profile_id) { - DEBUG_BUILD$4 && logger$2.log("[Profiling] cannot find profile for a span without a profile context"); - continue; - } - if (context && context["profile"]) { - delete context.profile; - } - const profile = takeProfileFromGlobalCache(profile_id); - if (!profile) { - DEBUG_BUILD$4 && logger$2.log(`[Profiling] Could not retrieve profile for span: ${profile_id}`); - continue; - } - const profileEvent = createProfilingEvent( - profile_id, - start_timestamp, - profile, - profiledTransaction - ); - if (profileEvent) { - profilesToAddToEnvelope.push(profileEvent); - } - } - addProfilesToEnvelope(envelope, profilesToAddToEnvelope); - }); - } - }; -}, "_browserProfilingIntegration"); -const browserProfilingIntegration = defineIntegration(_browserProfilingIntegration); -const INTEGRATION_NAME$1 = "SpotlightBrowser"; -const _spotlightIntegration = /* @__PURE__ */ __name((options4 = {}) => { - const sidecarUrl = options4.sidecarUrl || "http://localhost:8969/stream"; - return { - name: INTEGRATION_NAME$1, - setup: /* @__PURE__ */ __name(() => { - DEBUG_BUILD$4 && logger$2.log("Using Sidecar URL", sidecarUrl); - }, "setup"), - // We don't want to send interaction transactions/root spans created from - // clicks within Spotlight to Sentry. Neither do we want them to be sent to - // spotlight. - processEvent: /* @__PURE__ */ __name((event) => isSpotlightInteraction(event) ? null : event, "processEvent"), - afterAllSetup: /* @__PURE__ */ __name((client) => { - setupSidecarForwarding(client, sidecarUrl); - }, "afterAllSetup") - }; -}, "_spotlightIntegration"); -function setupSidecarForwarding(client, sidecarUrl) { - const makeFetch = getNativeImplementation("fetch"); - let failCount = 0; - client.on("beforeEnvelope", (envelope) => { - if (failCount > 3) { - logger$2.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:", failCount); - return; - } - makeFetch(sidecarUrl, { - method: "POST", - body: serializeEnvelope(envelope), - headers: { - "Content-Type": "application/x-sentry-envelope" - }, - mode: "cors" - }).then( - (res) => { - if (res.status >= 200 && res.status < 400) { - failCount = 0; - } - }, - (err) => { - failCount++; - logger$2.error( - "Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/", - err - ); - } - ); - }); -} -__name(setupSidecarForwarding, "setupSidecarForwarding"); -const spotlightBrowserIntegration = defineIntegration(_spotlightIntegration); -function isSpotlightInteraction(event) { - return Boolean( - event.type === "transaction" && event.spans && event.contexts && event.contexts.trace && event.contexts.trace.op === "ui.action.click" && event.spans.some(({ description }) => description && description.includes("#sentry-spotlight")) - ); -} -__name(isSpotlightInteraction, "isSpotlightInteraction"); -const FLAG_BUFFER_SIZE = 100; -function copyFlagsFromScopeToEvent(event) { - const scope = getCurrentScope$1(); - const flagContext = scope.getScopeData().contexts.flags; - const flagBuffer = flagContext ? flagContext.values : []; - if (!flagBuffer.length) { - return event; - } - if (event.contexts === void 0) { - event.contexts = {}; - } - event.contexts.flags = { values: [...flagBuffer] }; - return event; -} -__name(copyFlagsFromScopeToEvent, "copyFlagsFromScopeToEvent"); -function insertFlagToScope(name2, value4, maxSize = FLAG_BUFFER_SIZE) { - const scopeContexts = getCurrentScope$1().getScopeData().contexts; - if (!scopeContexts.flags) { - scopeContexts.flags = { values: [] }; - } - const flags = scopeContexts.flags.values; - insertToFlagBuffer(flags, name2, value4, maxSize); -} -__name(insertFlagToScope, "insertFlagToScope"); -function insertToFlagBuffer(flags, name2, value4, maxSize) { - if (typeof value4 !== "boolean") { - return; - } - if (flags.length > maxSize) { - DEBUG_BUILD$4 && logger$2.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${maxSize}`); - return; - } - const index2 = flags.findIndex((f2) => f2.flag === name2); - if (index2 !== -1) { - flags.splice(index2, 1); - } - if (flags.length === maxSize) { - flags.shift(); - } - flags.push({ - flag: name2, - result: value4 - }); -} -__name(insertToFlagBuffer, "insertToFlagBuffer"); -const featureFlagsIntegration = defineIntegration(() => { - return { - name: "FeatureFlags", - processEvent(event, _hint, _client) { - return copyFlagsFromScopeToEvent(event); - }, - addFeatureFlag(name2, value4) { - insertFlagToScope(name2, value4); - } - }; -}); -const launchDarklyIntegration = defineIntegration(() => { - return { - name: "LaunchDarkly", - processEvent(event, _hint, _client) { - return copyFlagsFromScopeToEvent(event); - } - }; -}); -function buildLaunchDarklyFlagUsedHandler() { - return { - name: "sentry-flag-auditor", - type: "flag-used", - synchronous: true, - /** - * Handle a flag evaluation by storing its name and value on the current scope. - */ - method: /* @__PURE__ */ __name((flagKey, flagDetail, _context) => { - insertFlagToScope(flagKey, flagDetail.value); - }, "method") - }; -} -__name(buildLaunchDarklyFlagUsedHandler, "buildLaunchDarklyFlagUsedHandler"); -const openFeatureIntegration = defineIntegration(() => { - return { - name: "OpenFeature", - processEvent(event, _hint, _client) { - return copyFlagsFromScopeToEvent(event); - } - }; -}); -class OpenFeatureIntegrationHook { - static { - __name(this, "OpenFeatureIntegrationHook"); - } - /** - * Successful evaluation result. - */ - after(_hookContext, evaluationDetails) { - insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value); - } - /** - * On error evaluation result. - */ - error(hookContext, _error, _hookHints) { - insertFlagToScope(hookContext.flagKey, hookContext.defaultValue); - } -} -const unleashIntegration = defineIntegration( - ({ unleashClientClass }) => { - return { - name: "Unleash", - processEvent(event, _hint, _client) { - return copyFlagsFromScopeToEvent(event); - }, - setupOnce() { - const unleashClientPrototype = unleashClientClass.prototype; - fill(unleashClientPrototype, "isEnabled", _wrappedIsEnabled); - } - }; - } -); -function _wrappedIsEnabled(original) { - return function(...args) { - const toggleName = args[0]; - const result = original.apply(this, args); - if (typeof toggleName === "string" && typeof result === "boolean") { - insertFlagToScope(toggleName, result); - } else if (DEBUG_BUILD$4) { - logger$2.error( - `[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${toggleName} (${typeof toggleName}), result: ${result} (${typeof result})` - ); - } - return result; - }; -} -__name(_wrappedIsEnabled, "_wrappedIsEnabled"); -const statsigIntegration = defineIntegration( - ({ featureFlagClient: statsigClient }) => { - return { - name: "Statsig", - processEvent(event, _hint, _client) { - return copyFlagsFromScopeToEvent(event); - }, - setup() { - statsigClient.on("gate_evaluation", (event) => { - insertFlagToScope(event.gate.name, event.gate.value); - }); - } - }; - } -); -const DEFAULT_HOOKS = ["activate", "mount", "update"]; -const DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; -const classifyRE$1 = /(?:^|[-_])(\w)/g; -const classify$1 = /* @__PURE__ */ __name((str) => str.replace(classifyRE$1, (c2) => c2.toUpperCase()).replace(/[-_]/g, ""), "classify$1"); -const ROOT_COMPONENT_NAME = ""; -const ANONYMOUS_COMPONENT_NAME = ""; -const repeat = /* @__PURE__ */ __name((str, n2) => { - return str.repeat(n2); -}, "repeat"); -const formatComponentName$1 = /* @__PURE__ */ __name((vm, includeFile) => { - if (!vm) { - return ANONYMOUS_COMPONENT_NAME; - } - if (vm.$root === vm) { - return ROOT_COMPONENT_NAME; - } - if (!vm.$options) { - return ANONYMOUS_COMPONENT_NAME; - } - const options4 = vm.$options; - let name2 = options4.name || options4._componentTag || options4.__name; - const file = options4.__file; - if (!name2 && file) { - const match3 = file.match(/([^/\\]+)\.vue$/); - if (match3) { - name2 = match3[1]; - } - } - return (name2 ? `<${classify$1(name2)}>` : ANONYMOUS_COMPONENT_NAME) + (file && includeFile !== false ? ` at ${file}` : ""); -}, "formatComponentName$1"); -const generateComponentTrace = /* @__PURE__ */ __name((vm) => { - if (vm && (vm._isVue || vm.__isVue) && vm.$parent) { - const tree = []; - let currentRecursiveSequence = 0; - while (vm) { - if (tree.length > 0) { - const last = tree[tree.length - 1]; - if (last.constructor === vm.constructor) { - currentRecursiveSequence++; - vm = vm.$parent; - continue; - } else if (currentRecursiveSequence > 0) { - tree[tree.length - 1] = [last, currentRecursiveSequence]; - currentRecursiveSequence = 0; - } - } - tree.push(vm); - vm = vm.$parent; - } - const formattedTree = tree.map( - (vm2, i2) => `${(i2 === 0 ? "---> " : repeat(" ", 5 + i2 * 2)) + (Array.isArray(vm2) ? `${formatComponentName$1(vm2[0])}... (${vm2[1]} recursive calls)` : formatComponentName$1(vm2))}` - ).join("\n"); - return ` - -found in - -${formattedTree}`; - } - return ` - -(found in ${formatComponentName$1(vm)})`; -}, "generateComponentTrace"); -const attachErrorHandler = /* @__PURE__ */ __name((app2, options4) => { - const { errorHandler: originalErrorHandler, warnHandler, silent } = app2.config; - app2.config.errorHandler = (error2, vm, lifecycleHook) => { - const componentName = formatComponentName$1(vm, false); - const trace = vm ? generateComponentTrace(vm) : ""; - const metadata = { - componentName, - lifecycleHook, - trace - }; - if (options4.attachProps && vm) { - if (vm.$options && vm.$options.propsData) { - metadata.propsData = vm.$options.propsData; - } else if (vm.$props) { - metadata.propsData = vm.$props; - } - } - setTimeout(() => { - captureException(error2, { - captureContext: { contexts: { vue: metadata } }, - mechanism: { handled: !!originalErrorHandler, type: "vue" } - }); - }); - if (typeof originalErrorHandler === "function" && app2.config.errorHandler) { - originalErrorHandler.call(app2, error2, vm, lifecycleHook); - } - if (!originalErrorHandler) { - throw error2; - } else if (options4.logErrors) { - const hasConsole = typeof console !== "undefined"; - const message3 = `Error in ${lifecycleHook}: "${error2 && error2.toString()}"`; - if (warnHandler) { - warnHandler.call(null, message3, vm, trace); - } else if (hasConsole && !silent) { - consoleSandbox(() => { - console.error(`[Vue warn]: ${message3}${trace}`); - }); - } - } - }; -}, "attachErrorHandler"); -const VUE_OP = "ui.vue"; -const HOOKS = { - activate: ["activated", "deactivated"], - create: ["beforeCreate", "created"], - // Vue 3 - unmount: ["beforeUnmount", "unmounted"], - // Vue 2 - destroy: ["beforeDestroy", "destroyed"], - mount: ["beforeMount", "mounted"], - update: ["beforeUpdate", "updated"] -}; -function finishRootSpan(vm, timestamp2, timeout) { - if (vm.$_sentryRootSpanTimer) { - clearTimeout(vm.$_sentryRootSpanTimer); - } - vm.$_sentryRootSpanTimer = setTimeout(() => { - if (vm.$root && vm.$root.$_sentryRootSpan) { - vm.$root.$_sentryRootSpan.end(timestamp2); - vm.$root.$_sentryRootSpan = void 0; - } - }, timeout); -} -__name(finishRootSpan, "finishRootSpan"); -function findTrackComponent(trackComponents, formattedName) { - function extractComponentName(name2) { - return name2.replace(/^<([^\s]*)>(?: at [^\s]*)?$/, "$1"); - } - __name(extractComponentName, "extractComponentName"); - const isMatched = trackComponents.some((compo) => { - return extractComponentName(formattedName) === extractComponentName(compo); - }); - return isMatched; -} -__name(findTrackComponent, "findTrackComponent"); -const createTracingMixins = /* @__PURE__ */ __name((options4) => { - const hooks2 = (options4.hooks || []).concat(DEFAULT_HOOKS).filter((value4, index2, self2) => self2.indexOf(value4) === index2); - const mixins = {}; - for (const operation of hooks2) { - const internalHooks = HOOKS[operation]; - if (!internalHooks) { - DEBUG_BUILD && logger$2.warn(`Unknown hook: ${operation}`); - continue; - } - for (const internalHook of internalHooks) { - mixins[internalHook] = function() { - const isRoot = this.$root === this; - if (isRoot) { - this.$_sentryRootSpan = this.$_sentryRootSpan || startInactiveSpan({ - name: "Application Render", - op: `${VUE_OP}.render`, - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.vue" - }, - onlyIfParent: true - }); - } - const name2 = formatComponentName$1(this, false); - const shouldTrack2 = Array.isArray(options4.trackComponents) ? findTrackComponent(options4.trackComponents, name2) : options4.trackComponents; - if (!isRoot && !shouldTrack2) { - return; - } - this.$_sentrySpans = this.$_sentrySpans || {}; - if (internalHook == internalHooks[0]) { - const activeSpan = this.$root && this.$root.$_sentryRootSpan || getActiveSpan(); - if (activeSpan) { - const oldSpan = this.$_sentrySpans[operation]; - if (oldSpan) { - oldSpan.end(); - } - this.$_sentrySpans[operation] = startInactiveSpan({ - name: `Vue ${name2}`, - op: `${VUE_OP}.${operation}`, - attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.vue" - }, - // UI spans should only be created if there is an active root span (transaction) - onlyIfParent: true - }); - } - } else { - const span = this.$_sentrySpans[operation]; - if (!span) return; - span.end(); - finishRootSpan(this, timestampInSeconds(), options4.timeout); - } - }; - } - } - return mixins; -}, "createTracingMixins"); -const globalWithVue = GLOBAL_OBJ; -const DEFAULT_CONFIG = { - Vue: globalWithVue.Vue, - attachProps: true, - logErrors: true, - attachErrorHandler: true, - hooks: DEFAULT_HOOKS, - timeout: 2e3, - trackComponents: false -}; -const INTEGRATION_NAME = "Vue"; -const vueIntegration = defineIntegration((integrationOptions = {}) => { - return { - name: INTEGRATION_NAME, - setup(client) { - const options4 = { ...DEFAULT_CONFIG, ...client.getOptions(), ...integrationOptions }; - if (!options4.Vue && !options4.app) { - consoleSandbox(() => { - console.warn( - "[@sentry/vue]: Misconfigured SDK. Vue specific errors will not be captured. Update your `Sentry.init` call with an appropriate config option: `app` (Application Instance - Vue 3) or `Vue` (Vue Constructor - Vue 2)." - ); - }); - return; - } - if (options4.app) { - const apps = Array.isArray(options4.app) ? options4.app : [options4.app]; - apps.forEach((app2) => vueInit(app2, options4)); - } else if (options4.Vue) { - vueInit(options4.Vue, options4); - } - } - }; -}); -const vueInit = /* @__PURE__ */ __name((app2, options4) => { - if (DEBUG_BUILD) { - const appWithInstance = app2; - const isMounted = appWithInstance._instance && appWithInstance._instance.isMounted; - if (isMounted === true) { - consoleSandbox(() => { - console.warn( - "[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`." - ); - }); - } - } - if (options4.attachErrorHandler) { - attachErrorHandler(app2, options4); - } - if (hasTracingEnabled(options4)) { - app2.mixin( - createTracingMixins({ - ...options4, - // eslint-disable-next-line deprecation/deprecation - ...options4.tracingOptions - }) - ); - } -}, "vueInit"); -function init$3(config2 = {}) { - const options4 = { - _metadata: { - sdk: { - name: "sentry.javascript.vue", - packages: [ - { - name: "npm:@sentry/vue", - version: SDK_VERSION - } - ], - version: SDK_VERSION - } - }, - defaultIntegrations: [...getDefaultIntegrations(config2), vueIntegration()], - ...config2 - }; - return init$4(options4); -} -__name(init$3, "init$3"); -function instrumentVueRouter(router2, options4, startNavigationSpanFn) { - let isFirstPageLoad = true; - router2.onError((error2) => captureException(error2, { mechanism: { handled: false } })); - router2.beforeEach((to, from2, next2) => { - const isPageLoadNavigation = from2.name == null && from2.matched.length === 0 || from2.name === void 0 && isFirstPageLoad; - if (isFirstPageLoad) { - isFirstPageLoad = false; - } - const attributes = { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.navigation.vue" - }; - for (const key of Object.keys(to.params)) { - attributes[`params.${key}`] = to.params[key]; - } - for (const key of Object.keys(to.query)) { - const value4 = to.query[key]; - if (value4) { - attributes[`query.${key}`] = value4; - } - } - let spanName = to.path; - let transactionSource = "url"; - if (to.name && options4.routeLabel !== "path") { - spanName = to.name.toString(); - transactionSource = "custom"; - } else if (to.matched.length > 0) { - const lastIndex2 = to.matched.length - 1; - spanName = to.matched[lastIndex2].path; - transactionSource = "route"; - } - getCurrentScope$1().setTransactionName(spanName); - if (options4.instrumentPageLoad && isPageLoadNavigation) { - const activeRootSpan = getActiveRootSpan(); - if (activeRootSpan) { - const existingAttributes = spanToJSON(activeRootSpan).data || {}; - if (existingAttributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] !== "custom") { - activeRootSpan.updateName(spanName); - activeRootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, transactionSource); - } - activeRootSpan.setAttributes({ - ...attributes, - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.pageload.vue" - }); - } - } - if (options4.instrumentNavigation && !isPageLoadNavigation) { - attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = transactionSource; - attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = "auto.navigation.vue"; - startNavigationSpanFn({ - name: spanName, - op: "navigation", - attributes - }); - } - if (next2) { - next2(); - } - }); -} -__name(instrumentVueRouter, "instrumentVueRouter"); -function getActiveRootSpan() { - const span = getActiveSpan(); - const rootSpan = span && getRootSpan(span); - if (!rootSpan) { - return void 0; - } - const op = spanToJSON(rootSpan).op; - return op === "navigation" || op === "pageload" ? rootSpan : void 0; -} -__name(getActiveRootSpan, "getActiveRootSpan"); -function browserTracingIntegration(options4 = {}) { - if (!options4.router) { - return browserTracingIntegration$1(options4); - } - const integration = browserTracingIntegration$1({ - ...options4, - instrumentNavigation: false - }); - const { router: router2, instrumentNavigation = true, instrumentPageLoad = true, routeLabel = "name" } = options4; - return { - ...integration, - afterAllSetup(client) { - integration.afterAllSetup(client); - const startNavigationSpan = /* @__PURE__ */ __name((options5) => { - startBrowserTracingNavigationSpan(client, options5); - }, "startNavigationSpan"); - instrumentVueRouter(router2, { routeLabel, instrumentNavigation, instrumentPageLoad }, startNavigationSpan); - } - }; -} -__name(browserTracingIntegration, "browserTracingIntegration"); -const createSentryPiniaPlugin = /* @__PURE__ */ __name((options4 = { - attachPiniaState: true, - addBreadcrumbs: true, - actionTransformer: /* @__PURE__ */ __name((action) => action, "actionTransformer"), - stateTransformer: /* @__PURE__ */ __name((state) => state, "stateTransformer") -}) => { - const plugin = /* @__PURE__ */ __name(({ store }) => { - options4.attachPiniaState !== false && getGlobalScope().addEventProcessor((event, hint) => { - try { - const timestamp2 = (/* @__PURE__ */ new Date()).toTimeString().split(" ")[0]; - const filename = `pinia_state_${store.$id}_${timestamp2}.json`; - hint.attachments = [ - ...hint.attachments || [], - { - filename, - data: JSON.stringify(store.$state) - } - ]; - } catch (_2) { - } - return event; - }); - store.$onAction((context) => { - context.after(() => { - const transformedActionName = options4.actionTransformer ? options4.actionTransformer(context.name) : context.name; - if (typeof transformedActionName !== "undefined" && transformedActionName !== null && options4.addBreadcrumbs !== false) { - addBreadcrumb({ - category: "action", - message: transformedActionName, - level: "info" - }); - } - const transformedState = options4.stateTransformer ? options4.stateTransformer(store.$state) : store.$state; - const scope = getCurrentScope$1(); - const currentState = scope.getScopeData().contexts.state; - if (typeof transformedState !== "undefined" && transformedState !== null) { - const client = getClient(); - const options5 = client && client.getOptions(); - const normalizationDepth = options5 && options5.normalizeDepth || 3; - const piniaStateContext = { type: "pinia", value: transformedState }; - const newState = { - ...currentState || {}, - state: piniaStateContext - }; - addNonEnumerableProperty( - newState, - "__sentry_override_normalization_depth__", - 3 + // 3 layers for `state.value.transformedState - normalizationDepth - // rest for the actual state - ); - scope.setContext("state", newState); - } else { - scope.setContext("state", { - ...currentState || {}, - state: { type: "pinia", value: "undefined" } - }); - } - }); - }); - }, "plugin"); - return plugin; -}, "createSentryPiniaPlugin"); -/** -* @vue/shared v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/ -/*! #__NO_SIDE_EFFECTS__ */ -// @__NO_SIDE_EFFECTS__ -function makeMap(str) { - const map3 = /* @__PURE__ */ Object.create(null); - for (const key of str.split(",")) map3[key] = 1; - return (val) => val in map3; -} -__name(makeMap, "makeMap"); -const EMPTY_OBJ = false ? Object.freeze({}) : {}; -const EMPTY_ARR = false ? Object.freeze([]) : []; -const NOOP = /* @__PURE__ */ __name(() => { -}, "NOOP"); -const NO = /* @__PURE__ */ __name(() => false, "NO"); -const isOn = /* @__PURE__ */ __name((key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter -(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97), "isOn"); -const isModelListener = /* @__PURE__ */ __name((key) => key.startsWith("onUpdate:"), "isModelListener"); -const extend$1 = Object.assign; -const remove$1 = /* @__PURE__ */ __name((arr, el) => { - const i2 = arr.indexOf(el); - if (i2 > -1) { - arr.splice(i2, 1); - } -}, "remove$1"); -const hasOwnProperty$d = Object.prototype.hasOwnProperty; -const hasOwn$3 = /* @__PURE__ */ __name((val, key) => hasOwnProperty$d.call(val, key), "hasOwn$3"); -const isArray$9 = Array.isArray; -const isMap$3 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Map]", "isMap$3"); -const isSet$3 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Set]", "isSet$3"); -const isDate$2 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Date]", "isDate$2"); -const isRegExp$5 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object RegExp]", "isRegExp$5"); -const isFunction$a = /* @__PURE__ */ __name((val) => typeof val === "function", "isFunction$a"); -const isString$9 = /* @__PURE__ */ __name((val) => typeof val === "string", "isString$9"); -const isSymbol$1 = /* @__PURE__ */ __name((val) => typeof val === "symbol", "isSymbol$1"); -const isObject$e = /* @__PURE__ */ __name((val) => val !== null && typeof val === "object", "isObject$e"); -const isPromise$1 = /* @__PURE__ */ __name((val) => { - return (isObject$e(val) || isFunction$a(val)) && isFunction$a(val.then) && isFunction$a(val.catch); -}, "isPromise$1"); -const objectToString$3 = Object.prototype.toString; -const toTypeString$1 = /* @__PURE__ */ __name((value4) => objectToString$3.call(value4), "toTypeString$1"); -const toRawType = /* @__PURE__ */ __name((value4) => { - return toTypeString$1(value4).slice(8, -1); -}, "toRawType"); -const isPlainObject$4 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Object]", "isPlainObject$4"); -const isIntegerKey = /* @__PURE__ */ __name((key) => isString$9(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key, "isIntegerKey"); -const isReservedProp = /* @__PURE__ */ makeMap( - // the leading comma is intentional so empty string "" is also included - ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" -); -const isBuiltInDirective = /* @__PURE__ */ makeMap( - "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" -); -const cacheStringFunction$1 = /* @__PURE__ */ __name((fn) => { - const cache2 = /* @__PURE__ */ Object.create(null); - return (str) => { - const hit = cache2[str]; - return hit || (cache2[str] = fn(str)); - }; -}, "cacheStringFunction$1"); -const camelizeRE$1 = /-(\w)/g; -const camelize$1 = cacheStringFunction$1( - (str) => { - return str.replace(camelizeRE$1, (_2, c2) => c2 ? c2.toUpperCase() : ""); - } -); -const hyphenateRE$1 = /\B([A-Z])/g; -const hyphenate$1 = cacheStringFunction$1( - (str) => str.replace(hyphenateRE$1, "-$1").toLowerCase() -); -const capitalize$1 = cacheStringFunction$1((str) => { - return str.charAt(0).toUpperCase() + str.slice(1); -}); -const toHandlerKey = cacheStringFunction$1( - (str) => { - const s2 = str ? `on${capitalize$1(str)}` : ``; - return s2; - } -); -const hasChanged = /* @__PURE__ */ __name((value4, oldValue) => !Object.is(value4, oldValue), "hasChanged"); -const invokeArrayFns = /* @__PURE__ */ __name((fns, ...arg) => { - for (let i2 = 0; i2 < fns.length; i2++) { - fns[i2](...arg); - } -}, "invokeArrayFns"); -const def = /* @__PURE__ */ __name((obj, key, value4, writable = false) => { - Object.defineProperty(obj, key, { - configurable: true, - enumerable: false, - writable, - value: value4 - }); -}, "def"); -const looseToNumber = /* @__PURE__ */ __name((val) => { - const n2 = parseFloat(val); - return isNaN(n2) ? val : n2; -}, "looseToNumber"); -const toNumber = /* @__PURE__ */ __name((val) => { - const n2 = isString$9(val) ? Number(val) : NaN; - return isNaN(n2) ? val : n2; -}, "toNumber"); -let _globalThis$1; -const getGlobalThis$1 = /* @__PURE__ */ __name(() => { - return _globalThis$1 || (_globalThis$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); -}, "getGlobalThis$1"); -const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/; -function genPropsAccessExp(name2) { - return identRE.test(name2) ? `__props.${name2}` : `__props[${JSON.stringify(name2)}]`; -} -__name(genPropsAccessExp, "genPropsAccessExp"); -function genCacheKey(source, options4) { - return source + JSON.stringify( - options4, - (_2, val) => typeof val === "function" ? val.toString() : val - ); -} -__name(genCacheKey, "genCacheKey"); -const PatchFlags = { - "TEXT": 1, - "1": "TEXT", - "CLASS": 2, - "2": "CLASS", - "STYLE": 4, - "4": "STYLE", - "PROPS": 8, - "8": "PROPS", - "FULL_PROPS": 16, - "16": "FULL_PROPS", - "NEED_HYDRATION": 32, - "32": "NEED_HYDRATION", - "STABLE_FRAGMENT": 64, - "64": "STABLE_FRAGMENT", - "KEYED_FRAGMENT": 128, - "128": "KEYED_FRAGMENT", - "UNKEYED_FRAGMENT": 256, - "256": "UNKEYED_FRAGMENT", - "NEED_PATCH": 512, - "512": "NEED_PATCH", - "DYNAMIC_SLOTS": 1024, - "1024": "DYNAMIC_SLOTS", - "DEV_ROOT_FRAGMENT": 2048, - "2048": "DEV_ROOT_FRAGMENT", - "CACHED": -1, - "-1": "CACHED", - "BAIL": -2, - "-2": "BAIL" -}; -const PatchFlagNames = { - [1]: `TEXT`, - [2]: `CLASS`, - [4]: `STYLE`, - [8]: `PROPS`, - [16]: `FULL_PROPS`, - [32]: `NEED_HYDRATION`, - [64]: `STABLE_FRAGMENT`, - [128]: `KEYED_FRAGMENT`, - [256]: `UNKEYED_FRAGMENT`, - [512]: `NEED_PATCH`, - [1024]: `DYNAMIC_SLOTS`, - [2048]: `DEV_ROOT_FRAGMENT`, - [-1]: `HOISTED`, - [-2]: `BAIL` -}; -const ShapeFlags = { - "ELEMENT": 1, - "1": "ELEMENT", - "FUNCTIONAL_COMPONENT": 2, - "2": "FUNCTIONAL_COMPONENT", - "STATEFUL_COMPONENT": 4, - "4": "STATEFUL_COMPONENT", - "TEXT_CHILDREN": 8, - "8": "TEXT_CHILDREN", - "ARRAY_CHILDREN": 16, - "16": "ARRAY_CHILDREN", - "SLOTS_CHILDREN": 32, - "32": "SLOTS_CHILDREN", - "TELEPORT": 64, - "64": "TELEPORT", - "SUSPENSE": 128, - "128": "SUSPENSE", - "COMPONENT_SHOULD_KEEP_ALIVE": 256, - "256": "COMPONENT_SHOULD_KEEP_ALIVE", - "COMPONENT_KEPT_ALIVE": 512, - "512": "COMPONENT_KEPT_ALIVE", - "COMPONENT": 6, - "6": "COMPONENT" -}; -const SlotFlags = { - "STABLE": 1, - "1": "STABLE", - "DYNAMIC": 2, - "2": "DYNAMIC", - "FORWARDED": 3, - "3": "FORWARDED" -}; -const slotFlagsText = { - [1]: "STABLE", - [2]: "DYNAMIC", - [3]: "FORWARDED" -}; -const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol"; -const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED); -const isGloballyWhitelisted = isGloballyAllowed; -const range = 2; -function generateCodeFrame$1(source, start2 = 0, end = source.length) { - start2 = Math.max(0, Math.min(start2, source.length)); - end = Math.max(0, Math.min(end, source.length)); - if (start2 > end) return ""; - let lines = source.split(/(\r?\n)/); - const newlineSequences = lines.filter((_2, idx) => idx % 2 === 1); - lines = lines.filter((_2, idx) => idx % 2 === 0); - let count = 0; - const res = []; - for (let i2 = 0; i2 < lines.length; i2++) { - count += lines[i2].length + (newlineSequences[i2] && newlineSequences[i2].length || 0); - if (count >= start2) { - for (let j2 = i2 - range; j2 <= i2 + range || end > count; j2++) { - if (j2 < 0 || j2 >= lines.length) continue; - const line = j2 + 1; - res.push( - `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j2]}` - ); - const lineLength = lines[j2].length; - const newLineSeqLength = newlineSequences[j2] && newlineSequences[j2].length || 0; - if (j2 === i2) { - const pad = start2 - (count - (lineLength + newLineSeqLength)); - const length = Math.max( - 1, - end > count ? lineLength - pad : end - start2 - ); - res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); - } else if (j2 > i2) { - if (end > count) { - const length = Math.max(Math.min(end - count, lineLength), 1); - res.push(` | ` + "^".repeat(length)); - } - count += lineLength + newLineSeqLength; - } - } - break; - } - } - return res.join("\n"); -} -__name(generateCodeFrame$1, "generateCodeFrame$1"); -function normalizeStyle(value4) { - if (isArray$9(value4)) { - const res = {}; - for (let i2 = 0; i2 < value4.length; i2++) { - const item3 = value4[i2]; - const normalized = isString$9(item3) ? parseStringStyle(item3) : normalizeStyle(item3); - if (normalized) { - for (const key in normalized) { - res[key] = normalized[key]; - } - } - } - return res; - } else if (isString$9(value4) || isObject$e(value4)) { - return value4; - } -} -__name(normalizeStyle, "normalizeStyle"); -const listDelimiterRE = /;(?![^(]*\))/g; -const propertyDelimiterRE = /:([^]+)/; -const styleCommentRE = /\/\*[^]*?\*\//g; -function parseStringStyle(cssText) { - const ret = {}; - cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item3) => { - if (item3) { - const tmp = item3.split(propertyDelimiterRE); - tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); - } - }); - return ret; -} -__name(parseStringStyle, "parseStringStyle"); -function stringifyStyle(styles) { - if (!styles) return ""; - if (isString$9(styles)) return styles; - let ret = ""; - for (const key in styles) { - const value4 = styles[key]; - if (isString$9(value4) || typeof value4 === "number") { - const normalizedKey = key.startsWith(`--`) ? key : hyphenate$1(key); - ret += `${normalizedKey}:${value4};`; - } - } - return ret; -} -__name(stringifyStyle, "stringifyStyle"); -function normalizeClass(value4) { - let res = ""; - if (isString$9(value4)) { - res = value4; - } else if (isArray$9(value4)) { - for (let i2 = 0; i2 < value4.length; i2++) { - const normalized = normalizeClass(value4[i2]); - if (normalized) { - res += normalized + " "; - } - } - } else if (isObject$e(value4)) { - for (const name2 in value4) { - if (value4[name2]) { - res += name2 + " "; - } - } - } - return res.trim(); -} -__name(normalizeClass, "normalizeClass"); -function normalizeProps(props) { - if (!props) return null; - let { class: klass, style: style2 } = props; - if (klass && !isString$9(klass)) { - props.class = normalizeClass(klass); - } - if (style2) { - props.style = normalizeStyle(style2); - } - return props; -} -__name(normalizeProps, "normalizeProps"); -const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; -const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; -const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; -const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; -const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); -const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); -const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); -const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); -const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; -const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); -const isBooleanAttr = /* @__PURE__ */ makeMap( - specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` -); -function includeBooleanAttr(value4) { - return !!value4 || value4 === ""; -} -__name(includeBooleanAttr, "includeBooleanAttr"); -const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; -const attrValidationCache = {}; -function isSSRSafeAttrName(name2) { - if (attrValidationCache.hasOwnProperty(name2)) { - return attrValidationCache[name2]; - } - const isUnsafe = unsafeAttrCharRE.test(name2); - if (isUnsafe) { - console.error(`unsafe attribute name: ${name2}`); - } - return attrValidationCache[name2] = !isUnsafe; -} -__name(isSSRSafeAttrName, "isSSRSafeAttrName"); -const propsToAttrMap = { - acceptCharset: "accept-charset", - className: "class", - htmlFor: "for", - httpEquiv: "http-equiv" -}; -const isKnownHtmlAttr = /* @__PURE__ */ makeMap( - `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` -); -const isKnownSvgAttr = /* @__PURE__ */ makeMap( - `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` -); -const isKnownMathMLAttr = /* @__PURE__ */ makeMap( - `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns` -); -function isRenderableAttrValue(value4) { - if (value4 == null) { - return false; - } - const type = typeof value4; - return type === "string" || type === "number" || type === "boolean"; -} -__name(isRenderableAttrValue, "isRenderableAttrValue"); -const escapeRE$4 = /["'&<>]/; -function escapeHtml$3(string) { - const str = "" + string; - const match3 = escapeRE$4.exec(str); - if (!match3) { - return str; - } - let html = ""; - let escaped; - let index2; - let lastIndex2 = 0; - for (index2 = match3.index; index2 < str.length; index2++) { - switch (str.charCodeAt(index2)) { - case 34: - escaped = """; - break; - case 38: - escaped = "&"; - break; - case 39: - escaped = "'"; - break; - case 60: - escaped = "<"; - break; - case 62: - escaped = ">"; - break; - default: - continue; - } - if (lastIndex2 !== index2) { - html += str.slice(lastIndex2, index2); - } - lastIndex2 = index2 + 1; - html += escaped; - } - return lastIndex2 !== index2 ? html + str.slice(lastIndex2, index2) : html; -} -__name(escapeHtml$3, "escapeHtml$3"); -const commentStripRE = /^-?>||--!>|?@[\\\]^`{|}~]/g; -function getEscapedCssVarName(key, doubleEscape) { - return key.replace( - cssVarNameEscapeSymbolsRE, - (s2) => doubleEscape ? s2 === '"' ? '\\\\\\"' : `\\\\${s2}` : `\\${s2}` - ); -} -__name(getEscapedCssVarName, "getEscapedCssVarName"); -function looseCompareArrays(a2, b2) { - if (a2.length !== b2.length) return false; - let equal = true; - for (let i2 = 0; equal && i2 < a2.length; i2++) { - equal = looseEqual(a2[i2], b2[i2]); - } - return equal; -} -__name(looseCompareArrays, "looseCompareArrays"); -function looseEqual(a2, b2) { - if (a2 === b2) return true; - let aValidType = isDate$2(a2); - let bValidType = isDate$2(b2); - if (aValidType || bValidType) { - return aValidType && bValidType ? a2.getTime() === b2.getTime() : false; - } - aValidType = isSymbol$1(a2); - bValidType = isSymbol$1(b2); - if (aValidType || bValidType) { - return a2 === b2; - } - aValidType = isArray$9(a2); - bValidType = isArray$9(b2); - if (aValidType || bValidType) { - return aValidType && bValidType ? looseCompareArrays(a2, b2) : false; - } - aValidType = isObject$e(a2); - bValidType = isObject$e(b2); - if (aValidType || bValidType) { - if (!aValidType || !bValidType) { - return false; - } - const aKeysCount = Object.keys(a2).length; - const bKeysCount = Object.keys(b2).length; - if (aKeysCount !== bKeysCount) { - return false; - } - for (const key in a2) { - const aHasKey = a2.hasOwnProperty(key); - const bHasKey = b2.hasOwnProperty(key); - if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a2[key], b2[key])) { - return false; - } - } - } - return String(a2) === String(b2); -} -__name(looseEqual, "looseEqual"); -function looseIndexOf(arr, val) { - return arr.findIndex((item3) => looseEqual(item3, val)); -} -__name(looseIndexOf, "looseIndexOf"); -const isRef$1 = /* @__PURE__ */ __name((val) => { - return !!(val && val["__v_isRef"] === true); -}, "isRef$1"); -const toDisplayString$1 = /* @__PURE__ */ __name((val) => { - return isString$9(val) ? val : val == null ? "" : isArray$9(val) || isObject$e(val) && (val.toString === objectToString$3 || !isFunction$a(val.toString)) ? isRef$1(val) ? toDisplayString$1(val.value) : JSON.stringify(val, replacer, 2) : String(val); -}, "toDisplayString$1"); -const replacer = /* @__PURE__ */ __name((_key, val) => { - if (isRef$1(val)) { - return replacer(_key, val.value); - } else if (isMap$3(val)) { - return { - [`Map(${val.size})`]: [...val.entries()].reduce( - (entries, [key, val2], i2) => { - entries[stringifySymbol(key, i2) + " =>"] = val2; - return entries; - }, - {} - ) - }; - } else if (isSet$3(val)) { - return { - [`Set(${val.size})`]: [...val.values()].map((v2) => stringifySymbol(v2)) - }; - } else if (isSymbol$1(val)) { - return stringifySymbol(val); - } else if (isObject$e(val) && !isArray$9(val) && !isPlainObject$4(val)) { - return String(val); - } - return val; -}, "replacer"); -const stringifySymbol = /* @__PURE__ */ __name((v2, i2 = "") => { - var _a2; - return ( - // Symbol.description in es2019+ so we need to cast here to pass - // the lib: es2016 check - isSymbol$1(v2) ? `Symbol(${(_a2 = v2.description) != null ? _a2 : i2})` : v2 - ); -}, "stringifySymbol"); -/** -* @vue/reactivity v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/ -function warn$4(msg, ...args) { - console.warn(`[Vue warn] ${msg}`, ...args); -} -__name(warn$4, "warn$4"); -let activeEffectScope; -class EffectScope { - static { - __name(this, "EffectScope"); - } - constructor(detached = false) { - this.detached = detached; - this._active = true; - this.effects = []; - this.cleanups = []; - this._isPaused = false; - this.parent = activeEffectScope; - if (!detached && activeEffectScope) { - this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( - this - ) - 1; - } - } - get active() { - return this._active; - } - pause() { - if (this._active) { - this._isPaused = true; - let i2, l2; - if (this.scopes) { - for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) { - this.scopes[i2].pause(); - } - } - for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) { - this.effects[i2].pause(); - } - } - } - /** - * Resumes the effect scope, including all child scopes and effects. - */ - resume() { - if (this._active) { - if (this._isPaused) { - this._isPaused = false; - let i2, l2; - if (this.scopes) { - for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) { - this.scopes[i2].resume(); - } - } - for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) { - this.effects[i2].resume(); - } - } - } - } - run(fn) { - if (this._active) { - const currentEffectScope = activeEffectScope; - try { - activeEffectScope = this; - return fn(); - } finally { - activeEffectScope = currentEffectScope; - } - } else if (false) { - warn$4(`cannot run an inactive effect scope.`); - } - } - /** - * This should only be called on non-detached scopes - * @internal - */ - on() { - activeEffectScope = this; - } - /** - * This should only be called on non-detached scopes - * @internal - */ - off() { - activeEffectScope = this.parent; - } - stop(fromParent) { - if (this._active) { - this._active = false; - let i2, l2; - for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) { - this.effects[i2].stop(); - } - this.effects.length = 0; - for (i2 = 0, l2 = this.cleanups.length; i2 < l2; i2++) { - this.cleanups[i2](); - } - this.cleanups.length = 0; - if (this.scopes) { - for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) { - this.scopes[i2].stop(true); - } - this.scopes.length = 0; - } - if (!this.detached && this.parent && !fromParent) { - const last = this.parent.scopes.pop(); - if (last && last !== this) { - this.parent.scopes[this.index] = last; - last.index = this.index; - } - } - this.parent = void 0; - } - } -} -function effectScope(detached) { - return new EffectScope(detached); -} -__name(effectScope, "effectScope"); -function getCurrentScope() { - return activeEffectScope; -} -__name(getCurrentScope, "getCurrentScope"); -function onScopeDispose(fn, failSilently = false) { - if (activeEffectScope) { - activeEffectScope.cleanups.push(fn); - } else if (false) { - warn$4( - `onScopeDispose() is called when there is no active effect scope to be associated with.` - ); - } -} -__name(onScopeDispose, "onScopeDispose"); -let activeSub; -const EffectFlags = { - "ACTIVE": 1, - "1": "ACTIVE", - "RUNNING": 2, - "2": "RUNNING", - "TRACKING": 4, - "4": "TRACKING", - "NOTIFIED": 8, - "8": "NOTIFIED", - "DIRTY": 16, - "16": "DIRTY", - "ALLOW_RECURSE": 32, - "32": "ALLOW_RECURSE", - "PAUSED": 64, - "64": "PAUSED" -}; -const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); -class ReactiveEffect { - static { - __name(this, "ReactiveEffect"); - } - constructor(fn) { - this.fn = fn; - this.deps = void 0; - this.depsTail = void 0; - this.flags = 1 | 4; - this.next = void 0; - this.cleanup = void 0; - this.scheduler = void 0; - if (activeEffectScope && activeEffectScope.active) { - activeEffectScope.effects.push(this); - } - } - pause() { - this.flags |= 64; - } - resume() { - if (this.flags & 64) { - this.flags &= ~64; - if (pausedQueueEffects.has(this)) { - pausedQueueEffects.delete(this); - this.trigger(); - } - } - } - /** - * @internal - */ - notify() { - if (this.flags & 2 && !(this.flags & 32)) { - return; - } - if (!(this.flags & 8)) { - batch(this); - } - } - run() { - if (!(this.flags & 1)) { - return this.fn(); - } - this.flags |= 2; - cleanupEffect(this); - prepareDeps(this); - const prevEffect = activeSub; - const prevShouldTrack = shouldTrack; - activeSub = this; - shouldTrack = true; - try { - return this.fn(); - } finally { - if (false) { - warn$4( - "Active effect was not restored correctly - this is likely a Vue internal bug." - ); - } - cleanupDeps(this); - activeSub = prevEffect; - shouldTrack = prevShouldTrack; - this.flags &= ~2; - } - } - stop() { - if (this.flags & 1) { - for (let link2 = this.deps; link2; link2 = link2.nextDep) { - removeSub(link2); - } - this.deps = this.depsTail = void 0; - cleanupEffect(this); - this.onStop && this.onStop(); - this.flags &= ~1; - } - } - trigger() { - if (this.flags & 64) { - pausedQueueEffects.add(this); - } else if (this.scheduler) { - this.scheduler(); - } else { - this.runIfDirty(); - } - } - /** - * @internal - */ - runIfDirty() { - if (isDirty$1(this)) { - this.run(); - } - } - get dirty() { - return isDirty$1(this); - } -} -let batchDepth = 0; -let batchedSub; -let batchedComputed; -function batch(sub, isComputed2 = false) { - sub.flags |= 8; - if (isComputed2) { - sub.next = batchedComputed; - batchedComputed = sub; - return; - } - sub.next = batchedSub; - batchedSub = sub; -} -__name(batch, "batch"); -function startBatch() { - batchDepth++; -} -__name(startBatch, "startBatch"); -function endBatch() { - if (--batchDepth > 0) { - return; - } - if (batchedComputed) { - let e2 = batchedComputed; - batchedComputed = void 0; - while (e2) { - const next2 = e2.next; - e2.next = void 0; - e2.flags &= ~8; - e2 = next2; - } - } - let error2; - while (batchedSub) { - let e2 = batchedSub; - batchedSub = void 0; - while (e2) { - const next2 = e2.next; - e2.next = void 0; - e2.flags &= ~8; - if (e2.flags & 1) { - try { - ; - e2.trigger(); - } catch (err) { - if (!error2) error2 = err; - } - } - e2 = next2; - } - } - if (error2) throw error2; -} -__name(endBatch, "endBatch"); -function prepareDeps(sub) { - for (let link2 = sub.deps; link2; link2 = link2.nextDep) { - link2.version = -1; - link2.prevActiveLink = link2.dep.activeLink; - link2.dep.activeLink = link2; - } -} -__name(prepareDeps, "prepareDeps"); -function cleanupDeps(sub) { - let head; - let tail = sub.depsTail; - let link2 = tail; - while (link2) { - const prev2 = link2.prevDep; - if (link2.version === -1) { - if (link2 === tail) tail = prev2; - removeSub(link2); - removeDep(link2); - } else { - head = link2; - } - link2.dep.activeLink = link2.prevActiveLink; - link2.prevActiveLink = void 0; - link2 = prev2; - } - sub.deps = head; - sub.depsTail = tail; -} -__name(cleanupDeps, "cleanupDeps"); -function isDirty$1(sub) { - for (let link2 = sub.deps; link2; link2 = link2.nextDep) { - if (link2.dep.version !== link2.version || link2.dep.computed && (refreshComputed(link2.dep.computed) || link2.dep.version !== link2.version)) { - return true; - } - } - if (sub._dirty) { - return true; - } - return false; -} -__name(isDirty$1, "isDirty$1"); -function refreshComputed(computed2) { - if (computed2.flags & 4 && !(computed2.flags & 16)) { - return; - } - computed2.flags &= ~16; - if (computed2.globalVersion === globalVersion) { - return; - } - computed2.globalVersion = globalVersion; - const dep = computed2.dep; - computed2.flags |= 2; - if (dep.version > 0 && !computed2.isSSR && computed2.deps && !isDirty$1(computed2)) { - computed2.flags &= ~2; - return; - } - const prevSub = activeSub; - const prevShouldTrack = shouldTrack; - activeSub = computed2; - shouldTrack = true; - try { - prepareDeps(computed2); - const value4 = computed2.fn(computed2._value); - if (dep.version === 0 || hasChanged(value4, computed2._value)) { - computed2._value = value4; - dep.version++; - } - } catch (err) { - dep.version++; - throw err; - } finally { - activeSub = prevSub; - shouldTrack = prevShouldTrack; - cleanupDeps(computed2); - computed2.flags &= ~2; - } -} -__name(refreshComputed, "refreshComputed"); -function removeSub(link2, soft = false) { - const { dep, prevSub, nextSub } = link2; - if (prevSub) { - prevSub.nextSub = nextSub; - link2.prevSub = void 0; - } - if (nextSub) { - nextSub.prevSub = prevSub; - link2.nextSub = void 0; - } - if (false) { - dep.subsHead = nextSub; - } - if (dep.subs === link2) { - dep.subs = prevSub; - if (!prevSub && dep.computed) { - dep.computed.flags &= ~4; - for (let l2 = dep.computed.deps; l2; l2 = l2.nextDep) { - removeSub(l2, true); - } - } - } - if (!soft && !--dep.sc && dep.map) { - dep.map.delete(dep.key); - } -} -__name(removeSub, "removeSub"); -function removeDep(link2) { - const { prevDep, nextDep } = link2; - if (prevDep) { - prevDep.nextDep = nextDep; - link2.prevDep = void 0; - } - if (nextDep) { - nextDep.prevDep = prevDep; - link2.nextDep = void 0; - } -} -__name(removeDep, "removeDep"); -function effect(fn, options4) { - if (fn.effect instanceof ReactiveEffect) { - fn = fn.effect.fn; - } - const e2 = new ReactiveEffect(fn); - if (options4) { - extend$1(e2, options4); - } - try { - e2.run(); - } catch (err) { - e2.stop(); - throw err; - } - const runner = e2.run.bind(e2); - runner.effect = e2; - return runner; -} -__name(effect, "effect"); -function stop(runner) { - runner.effect.stop(); -} -__name(stop, "stop"); -let shouldTrack = true; -const trackStack = []; -function pauseTracking() { - trackStack.push(shouldTrack); - shouldTrack = false; -} -__name(pauseTracking, "pauseTracking"); -function enableTracking() { - trackStack.push(shouldTrack); - shouldTrack = true; -} -__name(enableTracking, "enableTracking"); -function resetTracking() { - const last = trackStack.pop(); - shouldTrack = last === void 0 ? true : last; -} -__name(resetTracking, "resetTracking"); -function onEffectCleanup(fn, failSilently = false) { - if (activeSub instanceof ReactiveEffect) { - activeSub.cleanup = fn; - } else if (false) { - warn$4( - `onEffectCleanup() was called when there was no active effect to associate with.` - ); - } -} -__name(onEffectCleanup, "onEffectCleanup"); -function cleanupEffect(e2) { - const { cleanup } = e2; - e2.cleanup = void 0; - if (cleanup) { - const prevSub = activeSub; - activeSub = void 0; - try { - cleanup(); - } finally { - activeSub = prevSub; - } - } -} -__name(cleanupEffect, "cleanupEffect"); -let globalVersion = 0; -let Link$3 = class Link2 { - static { - __name(this, "Link"); - } - constructor(sub, dep) { - this.sub = sub; - this.dep = dep; - this.version = dep.version; - this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; - } -}; -class Dep { - static { - __name(this, "Dep"); - } - constructor(computed2) { - this.computed = computed2; - this.version = 0; - this.activeLink = void 0; - this.subs = void 0; - this.map = void 0; - this.key = void 0; - this.sc = 0; - if (false) { - this.subsHead = void 0; - } - } - track(debugInfo) { - if (!activeSub || !shouldTrack || activeSub === this.computed) { - return; - } - let link2 = this.activeLink; - if (link2 === void 0 || link2.sub !== activeSub) { - link2 = this.activeLink = new Link$3(activeSub, this); - if (!activeSub.deps) { - activeSub.deps = activeSub.depsTail = link2; - } else { - link2.prevDep = activeSub.depsTail; - activeSub.depsTail.nextDep = link2; - activeSub.depsTail = link2; - } - addSub(link2); - } else if (link2.version === -1) { - link2.version = this.version; - if (link2.nextDep) { - const next2 = link2.nextDep; - next2.prevDep = link2.prevDep; - if (link2.prevDep) { - link2.prevDep.nextDep = next2; - } - link2.prevDep = activeSub.depsTail; - link2.nextDep = void 0; - activeSub.depsTail.nextDep = link2; - activeSub.depsTail = link2; - if (activeSub.deps === link2) { - activeSub.deps = next2; - } - } - } - if (false) { - activeSub.onTrack( - extend$1( - { - effect: activeSub - }, - debugInfo - ) - ); - } - return link2; - } - trigger(debugInfo) { - this.version++; - globalVersion++; - this.notify(debugInfo); - } - notify(debugInfo) { - startBatch(); - try { - if (false) { - for (let head = this.subsHead; head; head = head.nextSub) { - if (head.sub.onTrigger && !(head.sub.flags & 8)) { - head.sub.onTrigger( - extend$1( - { - effect: head.sub - }, - debugInfo - ) - ); - } - } - } - for (let link2 = this.subs; link2; link2 = link2.prevSub) { - if (link2.sub.notify()) { - ; - link2.sub.dep.notify(); - } - } - } finally { - endBatch(); - } - } -} -function addSub(link2) { - link2.dep.sc++; - if (link2.sub.flags & 4) { - const computed2 = link2.dep.computed; - if (computed2 && !link2.dep.subs) { - computed2.flags |= 4 | 16; - for (let l2 = computed2.deps; l2; l2 = l2.nextDep) { - addSub(l2); - } - } - const currentTail = link2.dep.subs; - if (currentTail !== link2) { - link2.prevSub = currentTail; - if (currentTail) currentTail.nextSub = link2; - } - if (false) { - link2.dep.subsHead = link2; - } - link2.dep.subs = link2; - } -} -__name(addSub, "addSub"); -const targetMap = /* @__PURE__ */ new WeakMap(); -const ITERATE_KEY = Symbol( - false ? "Object iterate" : "" -); -const MAP_KEY_ITERATE_KEY = Symbol( - false ? "Map keys iterate" : "" -); -const ARRAY_ITERATE_KEY = Symbol( - false ? "Array iterate" : "" -); -function track(target2, type, key) { - if (shouldTrack && activeSub) { - let depsMap = targetMap.get(target2); - if (!depsMap) { - targetMap.set(target2, depsMap = /* @__PURE__ */ new Map()); - } - let dep = depsMap.get(key); - if (!dep) { - depsMap.set(key, dep = new Dep()); - dep.map = depsMap; - dep.key = key; - } - if (false) { - dep.track({ - target: target2, - type, - key - }); - } else { - dep.track(); - } - } -} -__name(track, "track"); -function trigger(target2, type, key, newValue2, oldValue, oldTarget) { - const depsMap = targetMap.get(target2); - if (!depsMap) { - globalVersion++; - return; - } - const run2 = /* @__PURE__ */ __name((dep) => { - if (dep) { - if (false) { - dep.trigger({ - target: target2, - type, - key, - newValue: newValue2, - oldValue, - oldTarget - }); - } else { - dep.trigger(); - } - } - }, "run"); - startBatch(); - if (type === "clear") { - depsMap.forEach(run2); - } else { - const targetIsArray = isArray$9(target2); - const isArrayIndex = targetIsArray && isIntegerKey(key); - if (targetIsArray && key === "length") { - const newLength = Number(newValue2); - depsMap.forEach((dep, key2) => { - if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol$1(key2) && key2 >= newLength) { - run2(dep); - } - }); - } else { - if (key !== void 0 || depsMap.has(void 0)) { - run2(depsMap.get(key)); - } - if (isArrayIndex) { - run2(depsMap.get(ARRAY_ITERATE_KEY)); - } - switch (type) { - case "add": - if (!targetIsArray) { - run2(depsMap.get(ITERATE_KEY)); - if (isMap$3(target2)) { - run2(depsMap.get(MAP_KEY_ITERATE_KEY)); - } - } else if (isArrayIndex) { - run2(depsMap.get("length")); - } - break; - case "delete": - if (!targetIsArray) { - run2(depsMap.get(ITERATE_KEY)); - if (isMap$3(target2)) { - run2(depsMap.get(MAP_KEY_ITERATE_KEY)); - } - } - break; - case "set": - if (isMap$3(target2)) { - run2(depsMap.get(ITERATE_KEY)); - } - break; - } - } - } - endBatch(); -} -__name(trigger, "trigger"); -function getDepFromReactive(object, key) { - const depMap = targetMap.get(object); - return depMap && depMap.get(key); -} -__name(getDepFromReactive, "getDepFromReactive"); -function reactiveReadArray(array) { - const raw = toRaw(array); - if (raw === array) return raw; - track(raw, "iterate", ARRAY_ITERATE_KEY); - return isShallow(array) ? raw : raw.map(toReactive$1); -} -__name(reactiveReadArray, "reactiveReadArray"); -function shallowReadArray(arr) { - track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); - return arr; -} -__name(shallowReadArray, "shallowReadArray"); -const arrayInstrumentations = { - __proto__: null, - [Symbol.iterator]() { - return iterator(this, Symbol.iterator, toReactive$1); - }, - concat(...args) { - return reactiveReadArray(this).concat( - ...args.map((x2) => isArray$9(x2) ? reactiveReadArray(x2) : x2) - ); - }, - entries() { - return iterator(this, "entries", (value4) => { - value4[1] = toReactive$1(value4[1]); - return value4; - }); - }, - every(fn, thisArg) { - return apply$2(this, "every", fn, thisArg, void 0, arguments); - }, - filter(fn, thisArg) { - return apply$2(this, "filter", fn, thisArg, (v2) => v2.map(toReactive$1), arguments); - }, - find(fn, thisArg) { - return apply$2(this, "find", fn, thisArg, toReactive$1, arguments); - }, - findIndex(fn, thisArg) { - return apply$2(this, "findIndex", fn, thisArg, void 0, arguments); - }, - findLast(fn, thisArg) { - return apply$2(this, "findLast", fn, thisArg, toReactive$1, arguments); - }, - findLastIndex(fn, thisArg) { - return apply$2(this, "findLastIndex", fn, thisArg, void 0, arguments); - }, - // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement - forEach(fn, thisArg) { - return apply$2(this, "forEach", fn, thisArg, void 0, arguments); - }, - includes(...args) { - return searchProxy(this, "includes", args); - }, - indexOf(...args) { - return searchProxy(this, "indexOf", args); - }, - join(separator) { - return reactiveReadArray(this).join(separator); - }, - // keys() iterator only reads `length`, no optimisation required - lastIndexOf(...args) { - return searchProxy(this, "lastIndexOf", args); - }, - map(fn, thisArg) { - return apply$2(this, "map", fn, thisArg, void 0, arguments); - }, - pop() { - return noTracking(this, "pop"); - }, - push(...args) { - return noTracking(this, "push", args); - }, - reduce(fn, ...args) { - return reduce(this, "reduce", fn, args); - }, - reduceRight(fn, ...args) { - return reduce(this, "reduceRight", fn, args); - }, - shift() { - return noTracking(this, "shift"); - }, - // slice could use ARRAY_ITERATE but also seems to beg for range tracking - some(fn, thisArg) { - return apply$2(this, "some", fn, thisArg, void 0, arguments); - }, - splice(...args) { - return noTracking(this, "splice", args); - }, - toReversed() { - return reactiveReadArray(this).toReversed(); - }, - toSorted(comparer) { - return reactiveReadArray(this).toSorted(comparer); - }, - toSpliced(...args) { - return reactiveReadArray(this).toSpliced(...args); - }, - unshift(...args) { - return noTracking(this, "unshift", args); - }, - values() { - return iterator(this, "values", toReactive$1); - } -}; -function iterator(self2, method, wrapValue) { - const arr = shallowReadArray(self2); - const iter = arr[method](); - if (arr !== self2 && !isShallow(self2)) { - iter._next = iter.next; - iter.next = () => { - const result = iter._next(); - if (result.value) { - result.value = wrapValue(result.value); - } - return result; - }; - } - return iter; -} -__name(iterator, "iterator"); -const arrayProto$1 = Array.prototype; -function apply$2(self2, method, fn, thisArg, wrappedRetFn, args) { - const arr = shallowReadArray(self2); - const needsWrap = arr !== self2 && !isShallow(self2); - const methodFn = arr[method]; - if (methodFn !== arrayProto$1[method]) { - const result2 = methodFn.apply(self2, args); - return needsWrap ? toReactive$1(result2) : result2; - } - let wrappedFn = fn; - if (arr !== self2) { - if (needsWrap) { - wrappedFn = /* @__PURE__ */ __name(function(item3, index2) { - return fn.call(this, toReactive$1(item3), index2, self2); - }, "wrappedFn"); - } else if (fn.length > 2) { - wrappedFn = /* @__PURE__ */ __name(function(item3, index2) { - return fn.call(this, item3, index2, self2); - }, "wrappedFn"); - } - } - const result = methodFn.call(arr, wrappedFn, thisArg); - return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; -} -__name(apply$2, "apply$2"); -function reduce(self2, method, fn, args) { - const arr = shallowReadArray(self2); - let wrappedFn = fn; - if (arr !== self2) { - if (!isShallow(self2)) { - wrappedFn = /* @__PURE__ */ __name(function(acc, item3, index2) { - return fn.call(this, acc, toReactive$1(item3), index2, self2); - }, "wrappedFn"); - } else if (fn.length > 3) { - wrappedFn = /* @__PURE__ */ __name(function(acc, item3, index2) { - return fn.call(this, acc, item3, index2, self2); - }, "wrappedFn"); - } - } - return arr[method](wrappedFn, ...args); -} -__name(reduce, "reduce"); -function searchProxy(self2, method, args) { - const arr = toRaw(self2); - track(arr, "iterate", ARRAY_ITERATE_KEY); - const res = arr[method](...args); - if ((res === -1 || res === false) && isProxy(args[0])) { - args[0] = toRaw(args[0]); - return arr[method](...args); - } - return res; -} -__name(searchProxy, "searchProxy"); -function noTracking(self2, method, args = []) { - pauseTracking(); - startBatch(); - const res = toRaw(self2)[method].apply(self2, args); - endBatch(); - resetTracking(); - return res; -} -__name(noTracking, "noTracking"); -const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); -const builtInSymbols = new Set( - /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol$1) -); -function hasOwnProperty$c(key) { - if (!isSymbol$1(key)) key = String(key); - const obj = toRaw(this); - track(obj, "has", key); - return obj.hasOwnProperty(key); -} -__name(hasOwnProperty$c, "hasOwnProperty$c"); -class BaseReactiveHandler { - static { - __name(this, "BaseReactiveHandler"); - } - constructor(_isReadonly = false, _isShallow = false) { - this._isReadonly = _isReadonly; - this._isShallow = _isShallow; - } - get(target2, key, receiver) { - if (key === "__v_skip") return target2["__v_skip"]; - const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; - if (key === "__v_isReactive") { - return !isReadonly2; - } else if (key === "__v_isReadonly") { - return isReadonly2; - } else if (key === "__v_isShallow") { - return isShallow2; - } else if (key === "__v_raw") { - if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target2) || // receiver is not the reactive proxy, but has the same prototype - // this means the receiver is a user proxy of the reactive proxy - Object.getPrototypeOf(target2) === Object.getPrototypeOf(receiver)) { - return target2; - } - return; - } - const targetIsArray = isArray$9(target2); - if (!isReadonly2) { - let fn; - if (targetIsArray && (fn = arrayInstrumentations[key])) { - return fn; - } - if (key === "hasOwnProperty") { - return hasOwnProperty$c; - } - } - const res = Reflect.get( - target2, - key, - // if this is a proxy wrapping a ref, return methods using the raw ref - // as receiver so that we don't have to call `toRaw` on the ref in all - // its class methods - isRef(target2) ? target2 : receiver - ); - if (isSymbol$1(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { - return res; - } - if (!isReadonly2) { - track(target2, "get", key); - } - if (isShallow2) { - return res; - } - if (isRef(res)) { - return targetIsArray && isIntegerKey(key) ? res : res.value; - } - if (isObject$e(res)) { - return isReadonly2 ? readonly(res) : reactive(res); - } - return res; - } -} -class MutableReactiveHandler extends BaseReactiveHandler { - static { - __name(this, "MutableReactiveHandler"); - } - constructor(isShallow2 = false) { - super(false, isShallow2); - } - set(target2, key, value4, receiver) { - let oldValue = target2[key]; - if (!this._isShallow) { - const isOldValueReadonly = isReadonly(oldValue); - if (!isShallow(value4) && !isReadonly(value4)) { - oldValue = toRaw(oldValue); - value4 = toRaw(value4); - } - if (!isArray$9(target2) && isRef(oldValue) && !isRef(value4)) { - if (isOldValueReadonly) { - return false; - } else { - oldValue.value = value4; - return true; - } - } - } - const hadKey = isArray$9(target2) && isIntegerKey(key) ? Number(key) < target2.length : hasOwn$3(target2, key); - const result = Reflect.set( - target2, - key, - value4, - isRef(target2) ? target2 : receiver - ); - if (target2 === toRaw(receiver)) { - if (!hadKey) { - trigger(target2, "add", key, value4); - } else if (hasChanged(value4, oldValue)) { - trigger(target2, "set", key, value4, oldValue); - } - } - return result; - } - deleteProperty(target2, key) { - const hadKey = hasOwn$3(target2, key); - const oldValue = target2[key]; - const result = Reflect.deleteProperty(target2, key); - if (result && hadKey) { - trigger(target2, "delete", key, void 0, oldValue); - } - return result; - } - has(target2, key) { - const result = Reflect.has(target2, key); - if (!isSymbol$1(key) || !builtInSymbols.has(key)) { - track(target2, "has", key); - } - return result; - } - ownKeys(target2) { - track( - target2, - "iterate", - isArray$9(target2) ? "length" : ITERATE_KEY - ); - return Reflect.ownKeys(target2); - } -} -class ReadonlyReactiveHandler extends BaseReactiveHandler { - static { - __name(this, "ReadonlyReactiveHandler"); - } - constructor(isShallow2 = false) { - super(true, isShallow2); - } - set(target2, key) { - if (false) { - warn$4( - `Set operation on key "${String(key)}" failed: target is readonly.`, - target2 - ); - } - return true; - } - deleteProperty(target2, key) { - if (false) { - warn$4( - `Delete operation on key "${String(key)}" failed: target is readonly.`, - target2 - ); - } - return true; - } -} -const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); -const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); -const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); -const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); -const toShallow = /* @__PURE__ */ __name((value4) => value4, "toShallow"); -const getProto = /* @__PURE__ */ __name((v2) => Reflect.getPrototypeOf(v2), "getProto"); -function createIterableMethod(method, isReadonly2, isShallow2) { - return function(...args) { - const target2 = this["__v_raw"]; - const rawTarget = toRaw(target2); - const targetIsMap = isMap$3(rawTarget); - const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; - const isKeyOnly = method === "keys" && targetIsMap; - const innerIterator = target2[method](...args); - const wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive$1; - !isReadonly2 && track( - rawTarget, - "iterate", - isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY - ); - return { - // iterator protocol - next() { - const { value: value4, done } = innerIterator.next(); - return done ? { value: value4, done } : { - value: isPair ? [wrap2(value4[0]), wrap2(value4[1])] : wrap2(value4), - done - }; - }, - // iterable protocol - [Symbol.iterator]() { - return this; - } - }; - }; -} -__name(createIterableMethod, "createIterableMethod"); -function createReadonlyMethod(type) { - return function(...args) { - if (false) { - const key = args[0] ? `on key "${args[0]}" ` : ``; - warn$4( - `${capitalize$1(type)} operation ${key}failed: target is readonly.`, - toRaw(this) - ); - } - return type === "delete" ? false : type === "clear" ? void 0 : this; - }; -} -__name(createReadonlyMethod, "createReadonlyMethod"); -function createInstrumentations(readonly2, shallow) { - const instrumentations = { - get(key) { - const target2 = this["__v_raw"]; - const rawTarget = toRaw(target2); - const rawKey = toRaw(key); - if (!readonly2) { - if (hasChanged(key, rawKey)) { - track(rawTarget, "get", key); - } - track(rawTarget, "get", rawKey); - } - const { has: has2 } = getProto(rawTarget); - const wrap2 = shallow ? toShallow : readonly2 ? toReadonly : toReactive$1; - if (has2.call(rawTarget, key)) { - return wrap2(target2.get(key)); - } else if (has2.call(rawTarget, rawKey)) { - return wrap2(target2.get(rawKey)); - } else if (target2 !== rawTarget) { - target2.get(key); - } - }, - get size() { - const target2 = this["__v_raw"]; - !readonly2 && track(toRaw(target2), "iterate", ITERATE_KEY); - return Reflect.get(target2, "size", target2); - }, - has(key) { - const target2 = this["__v_raw"]; - const rawTarget = toRaw(target2); - const rawKey = toRaw(key); - if (!readonly2) { - if (hasChanged(key, rawKey)) { - track(rawTarget, "has", key); - } - track(rawTarget, "has", rawKey); - } - return key === rawKey ? target2.has(key) : target2.has(key) || target2.has(rawKey); - }, - forEach(callback, thisArg) { - const observed = this; - const target2 = observed["__v_raw"]; - const rawTarget = toRaw(target2); - const wrap2 = shallow ? toShallow : readonly2 ? toReadonly : toReactive$1; - !readonly2 && track(rawTarget, "iterate", ITERATE_KEY); - return target2.forEach((value4, key) => { - return callback.call(thisArg, wrap2(value4), wrap2(key), observed); - }); - } - }; - extend$1( - instrumentations, - readonly2 ? { - add: createReadonlyMethod("add"), - set: createReadonlyMethod("set"), - delete: createReadonlyMethod("delete"), - clear: createReadonlyMethod("clear") - } : { - add(value4) { - if (!shallow && !isShallow(value4) && !isReadonly(value4)) { - value4 = toRaw(value4); - } - const target2 = toRaw(this); - const proto = getProto(target2); - const hadKey = proto.has.call(target2, value4); - if (!hadKey) { - target2.add(value4); - trigger(target2, "add", value4, value4); - } - return this; - }, - set(key, value4) { - if (!shallow && !isShallow(value4) && !isReadonly(value4)) { - value4 = toRaw(value4); - } - const target2 = toRaw(this); - const { has: has2, get: get3 } = getProto(target2); - let hadKey = has2.call(target2, key); - if (!hadKey) { - key = toRaw(key); - hadKey = has2.call(target2, key); - } else if (false) { - checkIdentityKeys(target2, has2, key); - } - const oldValue = get3.call(target2, key); - target2.set(key, value4); - if (!hadKey) { - trigger(target2, "add", key, value4); - } else if (hasChanged(value4, oldValue)) { - trigger(target2, "set", key, value4, oldValue); - } - return this; - }, - delete(key) { - const target2 = toRaw(this); - const { has: has2, get: get3 } = getProto(target2); - let hadKey = has2.call(target2, key); - if (!hadKey) { - key = toRaw(key); - hadKey = has2.call(target2, key); - } else if (false) { - checkIdentityKeys(target2, has2, key); - } - const oldValue = get3 ? get3.call(target2, key) : void 0; - const result = target2.delete(key); - if (hadKey) { - trigger(target2, "delete", key, void 0, oldValue); - } - return result; - }, - clear() { - const target2 = toRaw(this); - const hadItems = target2.size !== 0; - const oldTarget = false ? isMap$3(target2) ? new Map(target2) : new Set(target2) : void 0; - const result = target2.clear(); - if (hadItems) { - trigger( - target2, - "clear", - void 0, - void 0, - oldTarget - ); - } - return result; - } - } - ); - const iteratorMethods = [ - "keys", - "values", - "entries", - Symbol.iterator - ]; - iteratorMethods.forEach((method) => { - instrumentations[method] = createIterableMethod(method, readonly2, shallow); - }); - return instrumentations; -} -__name(createInstrumentations, "createInstrumentations"); -function createInstrumentationGetter(isReadonly2, shallow) { - const instrumentations = createInstrumentations(isReadonly2, shallow); - return (target2, key, receiver) => { - if (key === "__v_isReactive") { - return !isReadonly2; - } else if (key === "__v_isReadonly") { - return isReadonly2; - } else if (key === "__v_raw") { - return target2; - } - return Reflect.get( - hasOwn$3(instrumentations, key) && key in target2 ? instrumentations : target2, - key, - receiver - ); - }; -} -__name(createInstrumentationGetter, "createInstrumentationGetter"); -const mutableCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(false, false) -}; -const shallowCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(false, true) -}; -const readonlyCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(true, false) -}; -const shallowReadonlyCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(true, true) -}; -function checkIdentityKeys(target2, has2, key) { - const rawKey = toRaw(key); - if (rawKey !== key && has2.call(target2, rawKey)) { - const type = toRawType(target2); - warn$4( - `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` - ); - } -} -__name(checkIdentityKeys, "checkIdentityKeys"); -const reactiveMap = /* @__PURE__ */ new WeakMap(); -const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); -const readonlyMap = /* @__PURE__ */ new WeakMap(); -const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); -function targetTypeMap(rawType) { - switch (rawType) { - case "Object": - case "Array": - return 1; - case "Map": - case "Set": - case "WeakMap": - case "WeakSet": - return 2; - default: - return 0; - } -} -__name(targetTypeMap, "targetTypeMap"); -function getTargetType(value4) { - return value4["__v_skip"] || !Object.isExtensible(value4) ? 0 : targetTypeMap(toRawType(value4)); -} -__name(getTargetType, "getTargetType"); -function reactive(target2) { - if (isReadonly(target2)) { - return target2; - } - return createReactiveObject( - target2, - false, - mutableHandlers, - mutableCollectionHandlers, - reactiveMap - ); -} -__name(reactive, "reactive"); -function shallowReactive(target2) { - return createReactiveObject( - target2, - false, - shallowReactiveHandlers, - shallowCollectionHandlers, - shallowReactiveMap - ); -} -__name(shallowReactive, "shallowReactive"); -function readonly(target2) { - return createReactiveObject( - target2, - true, - readonlyHandlers, - readonlyCollectionHandlers, - readonlyMap - ); -} -__name(readonly, "readonly"); -function shallowReadonly(target2) { - return createReactiveObject( - target2, - true, - shallowReadonlyHandlers, - shallowReadonlyCollectionHandlers, - shallowReadonlyMap - ); -} -__name(shallowReadonly, "shallowReadonly"); -function createReactiveObject(target2, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { - if (!isObject$e(target2)) { - if (false) { - warn$4( - `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( - target2 - )}` - ); - } - return target2; - } - if (target2["__v_raw"] && !(isReadonly2 && target2["__v_isReactive"])) { - return target2; - } - const existingProxy = proxyMap.get(target2); - if (existingProxy) { - return existingProxy; - } - const targetType = getTargetType(target2); - if (targetType === 0) { - return target2; - } - const proxy = new Proxy( - target2, - targetType === 2 ? collectionHandlers : baseHandlers - ); - proxyMap.set(target2, proxy); - return proxy; -} -__name(createReactiveObject, "createReactiveObject"); -function isReactive(value4) { - if (isReadonly(value4)) { - return isReactive(value4["__v_raw"]); - } - return !!(value4 && value4["__v_isReactive"]); -} -__name(isReactive, "isReactive"); -function isReadonly(value4) { - return !!(value4 && value4["__v_isReadonly"]); -} -__name(isReadonly, "isReadonly"); -function isShallow(value4) { - return !!(value4 && value4["__v_isShallow"]); -} -__name(isShallow, "isShallow"); -function isProxy(value4) { - return value4 ? !!value4["__v_raw"] : false; -} -__name(isProxy, "isProxy"); -function toRaw(observed) { - const raw = observed && observed["__v_raw"]; - return raw ? toRaw(raw) : observed; -} -__name(toRaw, "toRaw"); -function markRaw(value4) { - if (!hasOwn$3(value4, "__v_skip") && Object.isExtensible(value4)) { - def(value4, "__v_skip", true); - } - return value4; -} -__name(markRaw, "markRaw"); -const toReactive$1 = /* @__PURE__ */ __name((value4) => isObject$e(value4) ? reactive(value4) : value4, "toReactive$1"); -const toReadonly = /* @__PURE__ */ __name((value4) => isObject$e(value4) ? readonly(value4) : value4, "toReadonly"); -function isRef(r2) { - return r2 ? r2["__v_isRef"] === true : false; -} -__name(isRef, "isRef"); -function ref(value4) { - return createRef(value4, false); -} -__name(ref, "ref"); -function shallowRef(value4) { - return createRef(value4, true); -} -__name(shallowRef, "shallowRef"); -function createRef(rawValue, shallow) { - if (isRef(rawValue)) { - return rawValue; - } - return new RefImpl(rawValue, shallow); -} -__name(createRef, "createRef"); -class RefImpl { - static { - __name(this, "RefImpl"); - } - constructor(value4, isShallow2) { - this.dep = new Dep(); - this["__v_isRef"] = true; - this["__v_isShallow"] = false; - this._rawValue = isShallow2 ? value4 : toRaw(value4); - this._value = isShallow2 ? value4 : toReactive$1(value4); - this["__v_isShallow"] = isShallow2; - } - get value() { - if (false) { - this.dep.track({ - target: this, - type: "get", - key: "value" - }); - } else { - this.dep.track(); - } - return this._value; - } - set value(newValue2) { - const oldValue = this._rawValue; - const useDirectValue = this["__v_isShallow"] || isShallow(newValue2) || isReadonly(newValue2); - newValue2 = useDirectValue ? newValue2 : toRaw(newValue2); - if (hasChanged(newValue2, oldValue)) { - this._rawValue = newValue2; - this._value = useDirectValue ? newValue2 : toReactive$1(newValue2); - if (false) { - this.dep.trigger({ - target: this, - type: "set", - key: "value", - newValue: newValue2, - oldValue - }); - } else { - this.dep.trigger(); - } - } - } -} -function triggerRef(ref2) { - if (ref2.dep) { - if (false) { - ref2.dep.trigger({ - target: ref2, - type: "set", - key: "value", - newValue: ref2._value - }); - } else { - ref2.dep.trigger(); - } - } -} -__name(triggerRef, "triggerRef"); -function unref(ref2) { - return isRef(ref2) ? ref2.value : ref2; -} -__name(unref, "unref"); -function toValue$1(source) { - return isFunction$a(source) ? source() : unref(source); -} -__name(toValue$1, "toValue$1"); -const shallowUnwrapHandlers = { - get: /* @__PURE__ */ __name((target2, key, receiver) => key === "__v_raw" ? target2 : unref(Reflect.get(target2, key, receiver)), "get"), - set: /* @__PURE__ */ __name((target2, key, value4, receiver) => { - const oldValue = target2[key]; - if (isRef(oldValue) && !isRef(value4)) { - oldValue.value = value4; - return true; - } else { - return Reflect.set(target2, key, value4, receiver); - } - }, "set") -}; -function proxyRefs(objectWithRefs) { - return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); -} -__name(proxyRefs, "proxyRefs"); -class CustomRefImpl { - static { - __name(this, "CustomRefImpl"); - } - constructor(factory) { - this["__v_isRef"] = true; - this._value = void 0; - const dep = this.dep = new Dep(); - const { get: get3, set: set4 } = factory(dep.track.bind(dep), dep.trigger.bind(dep)); - this._get = get3; - this._set = set4; - } - get value() { - return this._value = this._get(); - } - set value(newVal) { - this._set(newVal); - } -} -function customRef(factory) { - return new CustomRefImpl(factory); -} -__name(customRef, "customRef"); -function toRefs$1(object) { - if (false) { - warn$4(`toRefs() expects a reactive object but received a plain one.`); - } - const ret = isArray$9(object) ? new Array(object.length) : {}; - for (const key in object) { - ret[key] = propertyToRef(object, key); - } - return ret; -} -__name(toRefs$1, "toRefs$1"); -class ObjectRefImpl { - static { - __name(this, "ObjectRefImpl"); - } - constructor(_object, _key, _defaultValue) { - this._object = _object; - this._key = _key; - this._defaultValue = _defaultValue; - this["__v_isRef"] = true; - this._value = void 0; - } - get value() { - const val = this._object[this._key]; - return this._value = val === void 0 ? this._defaultValue : val; - } - set value(newVal) { - this._object[this._key] = newVal; - } - get dep() { - return getDepFromReactive(toRaw(this._object), this._key); - } -} -class GetterRefImpl { - static { - __name(this, "GetterRefImpl"); - } - constructor(_getter) { - this._getter = _getter; - this["__v_isRef"] = true; - this["__v_isReadonly"] = true; - this._value = void 0; - } - get value() { - return this._value = this._getter(); - } -} -function toRef$1(source, key, defaultValue2) { - if (isRef(source)) { - return source; - } else if (isFunction$a(source)) { - return new GetterRefImpl(source); - } else if (isObject$e(source) && arguments.length > 1) { - return propertyToRef(source, key, defaultValue2); - } else { - return ref(source); - } -} -__name(toRef$1, "toRef$1"); -function propertyToRef(source, key, defaultValue2) { - const val = source[key]; - return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue2); -} -__name(propertyToRef, "propertyToRef"); -class ComputedRefImpl { - static { - __name(this, "ComputedRefImpl"); - } - constructor(fn, setter, isSSR) { - this.fn = fn; - this.setter = setter; - this._value = void 0; - this.dep = new Dep(this); - this.__v_isRef = true; - this.deps = void 0; - this.depsTail = void 0; - this.flags = 16; - this.globalVersion = globalVersion - 1; - this.next = void 0; - this.effect = this; - this["__v_isReadonly"] = !setter; - this.isSSR = isSSR; - } - /** - * @internal - */ - notify() { - this.flags |= 16; - if (!(this.flags & 8) && // avoid infinite self recursion - activeSub !== this) { - batch(this, true); - return true; - } else if (false) ; - } - get value() { - const link2 = false ? this.dep.track({ - target: this, - type: "get", - key: "value" - }) : this.dep.track(); - refreshComputed(this); - if (link2) { - link2.version = this.dep.version; - } - return this._value; - } - set value(newValue2) { - if (this.setter) { - this.setter(newValue2); - } else if (false) { - warn$4("Write operation failed: computed value is readonly"); - } - } -} -function computed$1(getterOrOptions, debugOptions, isSSR = false) { - let getter; - let setter; - if (isFunction$a(getterOrOptions)) { - getter = getterOrOptions; - } else { - getter = getterOrOptions.get; - setter = getterOrOptions.set; - } - const cRef = new ComputedRefImpl(getter, setter, isSSR); - if (false) { - cRef.onTrack = debugOptions.onTrack; - cRef.onTrigger = debugOptions.onTrigger; - } - return cRef; -} -__name(computed$1, "computed$1"); -const TrackOpTypes = { - "GET": "get", - "HAS": "has", - "ITERATE": "iterate" -}; -const TriggerOpTypes = { - "SET": "set", - "ADD": "add", - "DELETE": "delete", - "CLEAR": "clear" -}; -const ReactiveFlags = { - "SKIP": "__v_skip", - "IS_REACTIVE": "__v_isReactive", - "IS_READONLY": "__v_isReadonly", - "IS_SHALLOW": "__v_isShallow", - "RAW": "__v_raw", - "IS_REF": "__v_isRef" -}; -const WatchErrorCodes = { - "WATCH_GETTER": 2, - "2": "WATCH_GETTER", - "WATCH_CALLBACK": 3, - "3": "WATCH_CALLBACK", - "WATCH_CLEANUP": 4, - "4": "WATCH_CLEANUP" -}; -const INITIAL_WATCHER_VALUE = {}; -const cleanupMap = /* @__PURE__ */ new WeakMap(); -let activeWatcher = void 0; -function getCurrentWatcher() { - return activeWatcher; -} -__name(getCurrentWatcher, "getCurrentWatcher"); -function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { - if (owner) { - let cleanups = cleanupMap.get(owner); - if (!cleanups) cleanupMap.set(owner, cleanups = []); - cleanups.push(cleanupFn); - } else if (false) { - warn$4( - `onWatcherCleanup() was called when there was no active watcher to associate with.` - ); - } -} -__name(onWatcherCleanup, "onWatcherCleanup"); -function watch$1(source, cb, options4 = EMPTY_OBJ) { - const { immediate, deep, once: once2, scheduler, augmentJob, call } = options4; - const warnInvalidSource = /* @__PURE__ */ __name((s2) => { - (options4.onWarn || warn$4)( - `Invalid watch source: `, - s2, - `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` - ); - }, "warnInvalidSource"); - const reactiveGetter = /* @__PURE__ */ __name((source2) => { - if (deep) return source2; - if (isShallow(source2) || deep === false || deep === 0) - return traverse(source2, 1); - return traverse(source2); - }, "reactiveGetter"); - let effect2; - let getter; - let cleanup; - let boundCleanup; - let forceTrigger = false; - let isMultiSource = false; - if (isRef(source)) { - getter = /* @__PURE__ */ __name(() => source.value, "getter"); - forceTrigger = isShallow(source); - } else if (isReactive(source)) { - getter = /* @__PURE__ */ __name(() => reactiveGetter(source), "getter"); - forceTrigger = true; - } else if (isArray$9(source)) { - isMultiSource = true; - forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2)); - getter = /* @__PURE__ */ __name(() => source.map((s2) => { - if (isRef(s2)) { - return s2.value; - } else if (isReactive(s2)) { - return reactiveGetter(s2); - } else if (isFunction$a(s2)) { - return call ? call(s2, 2) : s2(); - } else { - } - }), "getter"); - } else if (isFunction$a(source)) { - if (cb) { - getter = call ? () => call(source, 2) : source; - } else { - getter = /* @__PURE__ */ __name(() => { - if (cleanup) { - pauseTracking(); - try { - cleanup(); - } finally { - resetTracking(); - } - } - const currentEffect = activeWatcher; - activeWatcher = effect2; - try { - return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); - } finally { - activeWatcher = currentEffect; - } - }, "getter"); - } - } else { - getter = NOOP; - } - if (cb && deep) { - const baseGetter = getter; - const depth = deep === true ? Infinity : deep; - getter = /* @__PURE__ */ __name(() => traverse(baseGetter(), depth), "getter"); - } - const scope = getCurrentScope(); - const watchHandle = /* @__PURE__ */ __name(() => { - effect2.stop(); - if (scope && scope.active) { - remove$1(scope.effects, effect2); - } - }, "watchHandle"); - if (once2 && cb) { - const _cb = cb; - cb = /* @__PURE__ */ __name((...args) => { - _cb(...args); - watchHandle(); - }, "cb"); - } - let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; - const job = /* @__PURE__ */ __name((immediateFirstRun) => { - if (!(effect2.flags & 1) || !effect2.dirty && !immediateFirstRun) { - return; - } - if (cb) { - const newValue2 = effect2.run(); - if (deep || forceTrigger || (isMultiSource ? newValue2.some((v2, i2) => hasChanged(v2, oldValue[i2])) : hasChanged(newValue2, oldValue))) { - if (cleanup) { - cleanup(); - } - const currentWatcher = activeWatcher; - activeWatcher = effect2; - try { - const args = [ - newValue2, - // pass undefined as the old value when it's changed for the first time - oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, - boundCleanup - ]; - call ? call(cb, 3, args) : ( - // @ts-expect-error - cb(...args) - ); - oldValue = newValue2; - } finally { - activeWatcher = currentWatcher; - } - } - } else { - effect2.run(); - } - }, "job"); - if (augmentJob) { - augmentJob(job); - } - effect2 = new ReactiveEffect(getter); - effect2.scheduler = scheduler ? () => scheduler(job, false) : job; - boundCleanup = /* @__PURE__ */ __name((fn) => onWatcherCleanup(fn, false, effect2), "boundCleanup"); - cleanup = effect2.onStop = () => { - const cleanups = cleanupMap.get(effect2); - if (cleanups) { - if (call) { - call(cleanups, 4); - } else { - for (const cleanup2 of cleanups) cleanup2(); - } - cleanupMap.delete(effect2); - } - }; - if (false) { - effect2.onTrack = options4.onTrack; - effect2.onTrigger = options4.onTrigger; - } - if (cb) { - if (immediate) { - job(true); - } else { - oldValue = effect2.run(); - } - } else if (scheduler) { - scheduler(job.bind(null, true), true); - } else { - effect2.run(); - } - watchHandle.pause = effect2.pause.bind(effect2); - watchHandle.resume = effect2.resume.bind(effect2); - watchHandle.stop = watchHandle; - return watchHandle; -} -__name(watch$1, "watch$1"); -function traverse(value4, depth = Infinity, seen2) { - if (depth <= 0 || !isObject$e(value4) || value4["__v_skip"]) { - return value4; - } - seen2 = seen2 || /* @__PURE__ */ new Set(); - if (seen2.has(value4)) { - return value4; - } - seen2.add(value4); - depth--; - if (isRef(value4)) { - traverse(value4.value, depth, seen2); - } else if (isArray$9(value4)) { - for (let i2 = 0; i2 < value4.length; i2++) { - traverse(value4[i2], depth, seen2); - } - } else if (isSet$3(value4) || isMap$3(value4)) { - value4.forEach((v2) => { - traverse(v2, depth, seen2); - }); - } else if (isPlainObject$4(value4)) { - for (const key in value4) { - traverse(value4[key], depth, seen2); - } - for (const key of Object.getOwnPropertySymbols(value4)) { - if (Object.prototype.propertyIsEnumerable.call(value4, key)) { - traverse(value4[key], depth, seen2); - } - } - } - return value4; -} -__name(traverse, "traverse"); -/** -* @vue/runtime-core v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/ -const stack = []; -function pushWarningContext(vnode) { - stack.push(vnode); -} -__name(pushWarningContext, "pushWarningContext"); -function popWarningContext() { - stack.pop(); -} -__name(popWarningContext, "popWarningContext"); -let isWarning = false; -function warn$1$1(msg, ...args) { - if (isWarning) return; - isWarning = true; - pauseTracking(); - const instance = stack.length ? stack[stack.length - 1].component : null; - const appWarnHandler = instance && instance.appContext.config.warnHandler; - const trace = getComponentTrace(); - if (appWarnHandler) { - callWithErrorHandling( - appWarnHandler, - instance, - 11, - [ - // eslint-disable-next-line no-restricted-syntax - msg + args.map((a2) => { - var _a2, _b; - return (_b = (_a2 = a2.toString) == null ? void 0 : _a2.call(a2)) != null ? _b : JSON.stringify(a2); - }).join(""), - instance && instance.proxy, - trace.map( - ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` - ).join("\n"), - trace - ] - ); - } else { - const warnArgs = [`[Vue warn]: ${msg}`, ...args]; - if (trace.length && // avoid spamming console during tests - true) { - warnArgs.push(` -`, ...formatTrace(trace)); - } - console.warn(...warnArgs); - } - resetTracking(); - isWarning = false; -} -__name(warn$1$1, "warn$1$1"); -function getComponentTrace() { - let currentVNode = stack[stack.length - 1]; - if (!currentVNode) { - return []; - } - const normalizedStack = []; - while (currentVNode) { - const last = normalizedStack[0]; - if (last && last.vnode === currentVNode) { - last.recurseCount++; - } else { - normalizedStack.push({ - vnode: currentVNode, - recurseCount: 0 - }); - } - const parentInstance = currentVNode.component && currentVNode.component.parent; - currentVNode = parentInstance && parentInstance.vnode; - } - return normalizedStack; -} -__name(getComponentTrace, "getComponentTrace"); -function formatTrace(trace) { - const logs = []; - trace.forEach((entry, i2) => { - logs.push(...i2 === 0 ? [] : [` -`], ...formatTraceEntry(entry)); - }); - return logs; -} -__name(formatTrace, "formatTrace"); -function formatTraceEntry({ vnode, recurseCount }) { - const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; - const isRoot = vnode.component ? vnode.component.parent == null : false; - const open2 = ` at <${formatComponentName( - vnode.component, - vnode.type, - isRoot - )}`; - const close5 = `>` + postfix; - return vnode.props ? [open2, ...formatProps(vnode.props), close5] : [open2 + close5]; -} -__name(formatTraceEntry, "formatTraceEntry"); -function formatProps(props) { - const res = []; - const keys2 = Object.keys(props); - keys2.slice(0, 3).forEach((key) => { - res.push(...formatProp(key, props[key])); - }); - if (keys2.length > 3) { - res.push(` ...`); - } - return res; -} -__name(formatProps, "formatProps"); -function formatProp(key, value4, raw) { - if (isString$9(value4)) { - value4 = JSON.stringify(value4); - return raw ? value4 : [`${key}=${value4}`]; - } else if (typeof value4 === "number" || typeof value4 === "boolean" || value4 == null) { - return raw ? value4 : [`${key}=${value4}`]; - } else if (isRef(value4)) { - value4 = formatProp(key, toRaw(value4.value), true); - return raw ? value4 : [`${key}=Ref<`, value4, `>`]; - } else if (isFunction$a(value4)) { - return [`${key}=fn${value4.name ? `<${value4.name}>` : ``}`]; - } else { - value4 = toRaw(value4); - return raw ? value4 : [`${key}=`, value4]; - } -} -__name(formatProp, "formatProp"); -function assertNumber(val, type) { - if (true) return; - if (val === void 0) { - return; - } else if (typeof val !== "number") { - warn$1$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`); - } else if (isNaN(val)) { - warn$1$1(`${type} is NaN - the duration expression might be incorrect.`); - } -} -__name(assertNumber, "assertNumber"); -const ErrorCodes = { - "SETUP_FUNCTION": 0, - "0": "SETUP_FUNCTION", - "RENDER_FUNCTION": 1, - "1": "RENDER_FUNCTION", - "NATIVE_EVENT_HANDLER": 5, - "5": "NATIVE_EVENT_HANDLER", - "COMPONENT_EVENT_HANDLER": 6, - "6": "COMPONENT_EVENT_HANDLER", - "VNODE_HOOK": 7, - "7": "VNODE_HOOK", - "DIRECTIVE_HOOK": 8, - "8": "DIRECTIVE_HOOK", - "TRANSITION_HOOK": 9, - "9": "TRANSITION_HOOK", - "APP_ERROR_HANDLER": 10, - "10": "APP_ERROR_HANDLER", - "APP_WARN_HANDLER": 11, - "11": "APP_WARN_HANDLER", - "FUNCTION_REF": 12, - "12": "FUNCTION_REF", - "ASYNC_COMPONENT_LOADER": 13, - "13": "ASYNC_COMPONENT_LOADER", - "SCHEDULER": 14, - "14": "SCHEDULER", - "COMPONENT_UPDATE": 15, - "15": "COMPONENT_UPDATE", - "APP_UNMOUNT_CLEANUP": 16, - "16": "APP_UNMOUNT_CLEANUP" -}; -const ErrorTypeStrings$1 = { - ["sp"]: "serverPrefetch hook", - ["bc"]: "beforeCreate hook", - ["c"]: "created hook", - ["bm"]: "beforeMount hook", - ["m"]: "mounted hook", - ["bu"]: "beforeUpdate hook", - ["u"]: "updated", - ["bum"]: "beforeUnmount hook", - ["um"]: "unmounted hook", - ["a"]: "activated hook", - ["da"]: "deactivated hook", - ["ec"]: "errorCaptured hook", - ["rtc"]: "renderTracked hook", - ["rtg"]: "renderTriggered hook", - [0]: "setup function", - [1]: "render function", - [2]: "watcher getter", - [3]: "watcher callback", - [4]: "watcher cleanup function", - [5]: "native event handler", - [6]: "component event handler", - [7]: "vnode hook", - [8]: "directive hook", - [9]: "transition hook", - [10]: "app errorHandler", - [11]: "app warnHandler", - [12]: "ref function", - [13]: "async component loader", - [14]: "scheduler flush", - [15]: "component update", - [16]: "app unmount cleanup function" -}; -function callWithErrorHandling(fn, instance, type, args) { - try { - return args ? fn(...args) : fn(); - } catch (err) { - handleError(err, instance, type); - } -} -__name(callWithErrorHandling, "callWithErrorHandling"); -function callWithAsyncErrorHandling(fn, instance, type, args) { - if (isFunction$a(fn)) { - const res = callWithErrorHandling(fn, instance, type, args); - if (res && isPromise$1(res)) { - res.catch((err) => { - handleError(err, instance, type); - }); - } - return res; - } - if (isArray$9(fn)) { - const values = []; - for (let i2 = 0; i2 < fn.length; i2++) { - values.push(callWithAsyncErrorHandling(fn[i2], instance, type, args)); - } - return values; - } else if (false) { - warn$1$1( - `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}` - ); - } -} -__name(callWithAsyncErrorHandling, "callWithAsyncErrorHandling"); -function handleError(err, instance, type, throwInDev = true) { - const contextVNode = instance ? instance.vnode : null; - const { errorHandler: errorHandler2, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; - if (instance) { - let cur = instance.parent; - const exposedInstance = instance.proxy; - const errorInfo = false ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`; - while (cur) { - const errorCapturedHooks = cur.ec; - if (errorCapturedHooks) { - for (let i2 = 0; i2 < errorCapturedHooks.length; i2++) { - if (errorCapturedHooks[i2](err, exposedInstance, errorInfo) === false) { - return; - } - } - } - cur = cur.parent; - } - if (errorHandler2) { - pauseTracking(); - callWithErrorHandling(errorHandler2, null, 10, [ - err, - exposedInstance, - errorInfo - ]); - resetTracking(); - return; - } - } - logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); -} -__name(handleError, "handleError"); -function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { - if (false) { - const info = ErrorTypeStrings$1[type]; - if (contextVNode) { - pushWarningContext(contextVNode); - } - warn$1$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); - if (contextVNode) { - popWarningContext(); - } - if (throwInDev) { - throw err; - } else { - console.error(err); - } - } else if (throwInProd) { - throw err; - } else { - console.error(err); - } -} -__name(logError, "logError"); -const queue = []; -let flushIndex = -1; -const pendingPostFlushCbs = []; -let activePostFlushCbs = null; -let postFlushIndex = 0; -const resolvedPromise = /* @__PURE__ */ Promise.resolve(); -let currentFlushPromise = null; -const RECURSION_LIMIT = 100; -function nextTick(fn) { - const p2 = currentFlushPromise || resolvedPromise; - return fn ? p2.then(this ? fn.bind(this) : fn) : p2; -} -__name(nextTick, "nextTick"); -function findInsertionIndex$1(id3) { - let start2 = flushIndex + 1; - let end = queue.length; - while (start2 < end) { - const middle = start2 + end >>> 1; - const middleJob = queue[middle]; - const middleJobId = getId(middleJob); - if (middleJobId < id3 || middleJobId === id3 && middleJob.flags & 2) { - start2 = middle + 1; - } else { - end = middle; - } - } - return start2; -} -__name(findInsertionIndex$1, "findInsertionIndex$1"); -function queueJob(job) { - if (!(job.flags & 1)) { - const jobId = getId(job); - const lastJob = queue[queue.length - 1]; - if (!lastJob || // fast path when the job id is larger than the tail - !(job.flags & 2) && jobId >= getId(lastJob)) { - queue.push(job); - } else { - queue.splice(findInsertionIndex$1(jobId), 0, job); - } - job.flags |= 1; - queueFlush(); - } -} -__name(queueJob, "queueJob"); -function queueFlush() { - if (!currentFlushPromise) { - currentFlushPromise = resolvedPromise.then(flushJobs); - } -} -__name(queueFlush, "queueFlush"); -function queuePostFlushCb(cb) { - if (!isArray$9(cb)) { - if (activePostFlushCbs && cb.id === -1) { - activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); - } else if (!(cb.flags & 1)) { - pendingPostFlushCbs.push(cb); - cb.flags |= 1; - } - } else { - pendingPostFlushCbs.push(...cb); - } - queueFlush(); -} -__name(queuePostFlushCb, "queuePostFlushCb"); -function flushPreFlushCbs(instance, seen2, i2 = flushIndex + 1) { - if (false) { - seen2 = seen2 || /* @__PURE__ */ new Map(); - } - for (; i2 < queue.length; i2++) { - const cb = queue[i2]; - if (cb && cb.flags & 2) { - if (instance && cb.id !== instance.uid) { - continue; - } - if (false) { - continue; - } - queue.splice(i2, 1); - i2--; - if (cb.flags & 4) { - cb.flags &= ~1; - } - cb(); - if (!(cb.flags & 4)) { - cb.flags &= ~1; - } - } - } -} -__name(flushPreFlushCbs, "flushPreFlushCbs"); -function flushPostFlushCbs(seen2) { - if (pendingPostFlushCbs.length) { - const deduped = [...new Set(pendingPostFlushCbs)].sort( - (a2, b2) => getId(a2) - getId(b2) - ); - pendingPostFlushCbs.length = 0; - if (activePostFlushCbs) { - activePostFlushCbs.push(...deduped); - return; - } - activePostFlushCbs = deduped; - if (false) { - seen2 = seen2 || /* @__PURE__ */ new Map(); - } - for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { - const cb = activePostFlushCbs[postFlushIndex]; - if (false) { - continue; - } - if (cb.flags & 4) { - cb.flags &= ~1; - } - if (!(cb.flags & 8)) cb(); - cb.flags &= ~1; - } - activePostFlushCbs = null; - postFlushIndex = 0; - } -} -__name(flushPostFlushCbs, "flushPostFlushCbs"); -const getId = /* @__PURE__ */ __name((job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id, "getId"); -function flushJobs(seen2) { - if (false) { - seen2 = seen2 || /* @__PURE__ */ new Map(); - } - const check = false ? (job) => checkRecursiveUpdates(seen2, job) : NOOP; - try { - for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { - const job = queue[flushIndex]; - if (job && !(job.flags & 8)) { - if (false) { - continue; - } - if (job.flags & 4) { - job.flags &= ~1; - } - callWithErrorHandling( - job, - job.i, - job.i ? 15 : 14 - ); - if (!(job.flags & 4)) { - job.flags &= ~1; - } - } - } - } finally { - for (; flushIndex < queue.length; flushIndex++) { - const job = queue[flushIndex]; - if (job) { - job.flags &= ~1; - } - } - flushIndex = -1; - queue.length = 0; - flushPostFlushCbs(seen2); - currentFlushPromise = null; - if (queue.length || pendingPostFlushCbs.length) { - flushJobs(seen2); - } - } -} -__name(flushJobs, "flushJobs"); -function checkRecursiveUpdates(seen2, fn) { - const count = seen2.get(fn) || 0; - if (count > RECURSION_LIMIT) { - const instance = fn.i; - const componentName = instance && getComponentName(instance.type); - handleError( - `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, - null, - 10 - ); - return true; - } - seen2.set(fn, count + 1); - return false; -} -__name(checkRecursiveUpdates, "checkRecursiveUpdates"); -let isHmrUpdating = false; -const hmrDirtyComponents = /* @__PURE__ */ new Map(); -if (false) { - getGlobalThis$1().__VUE_HMR_RUNTIME__ = { - createRecord: tryWrap(createRecord), - rerender: tryWrap(rerender), - reload: tryWrap(reload) - }; -} -const map$1 = /* @__PURE__ */ new Map(); -function registerHMR(instance) { - const id3 = instance.type.__hmrId; - let record2 = map$1.get(id3); - if (!record2) { - createRecord(id3, instance.type); - record2 = map$1.get(id3); - } - record2.instances.add(instance); -} -__name(registerHMR, "registerHMR"); -function unregisterHMR(instance) { - map$1.get(instance.type.__hmrId).instances.delete(instance); -} -__name(unregisterHMR, "unregisterHMR"); -function createRecord(id3, initialDef) { - if (map$1.has(id3)) { - return false; - } - map$1.set(id3, { - initialDef: normalizeClassComponent(initialDef), - instances: /* @__PURE__ */ new Set() - }); - return true; -} -__name(createRecord, "createRecord"); -function normalizeClassComponent(component) { - return isClassComponent(component) ? component.__vccOpts : component; -} -__name(normalizeClassComponent, "normalizeClassComponent"); -function rerender(id3, newRender) { - const record2 = map$1.get(id3); - if (!record2) { - return; - } - record2.initialDef.render = newRender; - [...record2.instances].forEach((instance) => { - if (newRender) { - instance.render = newRender; - normalizeClassComponent(instance.type).render = newRender; - } - instance.renderCache = []; - isHmrUpdating = true; - instance.update(); - isHmrUpdating = false; - }); -} -__name(rerender, "rerender"); -function reload(id3, newComp) { - const record2 = map$1.get(id3); - if (!record2) return; - newComp = normalizeClassComponent(newComp); - updateComponentDef(record2.initialDef, newComp); - const instances = [...record2.instances]; - for (let i2 = 0; i2 < instances.length; i2++) { - const instance = instances[i2]; - const oldComp = normalizeClassComponent(instance.type); - let dirtyInstances = hmrDirtyComponents.get(oldComp); - if (!dirtyInstances) { - if (oldComp !== record2.initialDef) { - updateComponentDef(oldComp, newComp); - } - hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); - } - dirtyInstances.add(instance); - instance.appContext.propsCache.delete(instance.type); - instance.appContext.emitsCache.delete(instance.type); - instance.appContext.optionsCache.delete(instance.type); - if (instance.ceReload) { - dirtyInstances.add(instance); - instance.ceReload(newComp.styles); - dirtyInstances.delete(instance); - } else if (instance.parent) { - queueJob(() => { - isHmrUpdating = true; - instance.parent.update(); - isHmrUpdating = false; - dirtyInstances.delete(instance); - }); - } else if (instance.appContext.reload) { - instance.appContext.reload(); - } else if (typeof window !== "undefined") { - window.location.reload(); - } else { - console.warn( - "[HMR] Root or manually mounted instance modified. Full reload required." - ); - } - if (instance.root.ce && instance !== instance.root) { - instance.root.ce._removeChildStyle(oldComp); - } - } - queuePostFlushCb(() => { - hmrDirtyComponents.clear(); - }); -} -__name(reload, "reload"); -function updateComponentDef(oldComp, newComp) { - extend$1(oldComp, newComp); - for (const key in oldComp) { - if (key !== "__file" && !(key in newComp)) { - delete oldComp[key]; - } - } -} -__name(updateComponentDef, "updateComponentDef"); -function tryWrap(fn) { - return (id3, arg) => { - try { - return fn(id3, arg); - } catch (e2) { - console.error(e2); - console.warn( - `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` - ); - } - }; -} -__name(tryWrap, "tryWrap"); -let devtools$1; -let buffer = []; -let devtoolsNotInstalled = false; -function emit$1(event, ...args) { - if (devtools$1) { - devtools$1.emit(event, ...args); - } else if (!devtoolsNotInstalled) { - buffer.push({ event, args }); - } -} -__name(emit$1, "emit$1"); -function setDevtoolsHook$1(hook, target2) { - var _a2, _b; - devtools$1 = hook; - if (devtools$1) { - devtools$1.enabled = true; - buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); - buffer = []; - } else if ( - // handle late devtools injection - only do this if we are in an actual - // browser environment to avoid the timer handle stalling test runner exit - // (#4815) - typeof window !== "undefined" && // some envs mock window but not fully - window.HTMLElement && // also exclude jsdom - // eslint-disable-next-line no-restricted-syntax - !((_b = (_a2 = window.navigator) == null ? void 0 : _a2.userAgent) == null ? void 0 : _b.includes("jsdom")) - ) { - const replay = target2.__VUE_DEVTOOLS_HOOK_REPLAY__ = target2.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; - replay.push((newHook) => { - setDevtoolsHook$1(newHook, target2); - }); - setTimeout(() => { - if (!devtools$1) { - target2.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; - devtoolsNotInstalled = true; - buffer = []; - } - }, 3e3); - } else { - devtoolsNotInstalled = true; - buffer = []; - } -} -__name(setDevtoolsHook$1, "setDevtoolsHook$1"); -function devtoolsInitApp(app2, version2) { - emit$1("app:init", app2, version2, { - Fragment: Fragment$1, - Text: Text$4, - Comment, - Static - }); -} -__name(devtoolsInitApp, "devtoolsInitApp"); -function devtoolsUnmountApp(app2) { - emit$1("app:unmount", app2); -} -__name(devtoolsUnmountApp, "devtoolsUnmountApp"); -const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook( - "component:added" - /* COMPONENT_ADDED */ -); -const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook( - "component:updated" - /* COMPONENT_UPDATED */ -); -const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( - "component:removed" - /* COMPONENT_REMOVED */ -); -const devtoolsComponentRemoved = /* @__PURE__ */ __name((component) => { - if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered - !devtools$1.cleanupBuffer(component)) { - _devtoolsComponentRemoved(component); - } -}, "devtoolsComponentRemoved"); -/*! #__NO_SIDE_EFFECTS__ */ -// @__NO_SIDE_EFFECTS__ -function createDevtoolsComponentHook(hook) { - return (component) => { - emit$1( - hook, - component.appContext.app, - component.uid, - component.parent ? component.parent.uid : void 0, - component - ); - }; -} -__name(createDevtoolsComponentHook, "createDevtoolsComponentHook"); -const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook( - "perf:start" - /* PERFORMANCE_START */ -); -const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook( - "perf:end" - /* PERFORMANCE_END */ -); -function createDevtoolsPerformanceHook(hook) { - return (component, type, time) => { - emit$1(hook, component.appContext.app, component.uid, component, type, time); - }; -} -__name(createDevtoolsPerformanceHook, "createDevtoolsPerformanceHook"); -function devtoolsComponentEmit(component, event, params) { - emit$1( - "component:emit", - component.appContext.app, - component, - event, - params - ); -} -__name(devtoolsComponentEmit, "devtoolsComponentEmit"); -let currentRenderingInstance = null; -let currentScopeId = null; -function setCurrentRenderingInstance(instance) { - const prev2 = currentRenderingInstance; - currentRenderingInstance = instance; - currentScopeId = instance && instance.type.__scopeId || null; - return prev2; -} -__name(setCurrentRenderingInstance, "setCurrentRenderingInstance"); -function pushScopeId(id3) { - currentScopeId = id3; -} -__name(pushScopeId, "pushScopeId"); -function popScopeId() { - currentScopeId = null; -} -__name(popScopeId, "popScopeId"); -const withScopeId = /* @__PURE__ */ __name((_id2) => withCtx, "withScopeId"); -function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { - if (!ctx) return fn; - if (fn._n) { - return fn; - } - const renderFnWithContext = /* @__PURE__ */ __name((...args) => { - if (renderFnWithContext._d) { - setBlockTracking(-1); - } - const prevInstance = setCurrentRenderingInstance(ctx); - let res; - try { - res = fn(...args); - } finally { - setCurrentRenderingInstance(prevInstance); - if (renderFnWithContext._d) { - setBlockTracking(1); - } - } - if (false) { - devtoolsComponentUpdated(ctx); - } - return res; - }, "renderFnWithContext"); - renderFnWithContext._n = true; - renderFnWithContext._c = true; - renderFnWithContext._d = true; - return renderFnWithContext; -} -__name(withCtx, "withCtx"); -function validateDirectiveName(name2) { - if (isBuiltInDirective(name2)) { - warn$1$1("Do not use built-in directive ids as custom directive id: " + name2); - } -} -__name(validateDirectiveName, "validateDirectiveName"); -function withDirectives(vnode, directives) { - if (currentRenderingInstance === null) { - return vnode; - } - const instance = getComponentPublicInstance(currentRenderingInstance); - const bindings = vnode.dirs || (vnode.dirs = []); - for (let i2 = 0; i2 < directives.length; i2++) { - let [dir, value4, arg, modifiers2 = EMPTY_OBJ] = directives[i2]; - if (dir) { - if (isFunction$a(dir)) { - dir = { - mounted: dir, - updated: dir - }; - } - if (dir.deep) { - traverse(value4); - } - bindings.push({ - dir, - instance, - value: value4, - oldValue: void 0, - arg, - modifiers: modifiers2 - }); - } - } - return vnode; -} -__name(withDirectives, "withDirectives"); -function invokeDirectiveHook(vnode, prevVNode, instance, name2) { - const bindings = vnode.dirs; - const oldBindings = prevVNode && prevVNode.dirs; - for (let i2 = 0; i2 < bindings.length; i2++) { - const binding = bindings[i2]; - if (oldBindings) { - binding.oldValue = oldBindings[i2].value; - } - let hook = binding.dir[name2]; - if (hook) { - pauseTracking(); - callWithAsyncErrorHandling(hook, instance, 8, [ - vnode.el, - binding, - vnode, - prevVNode - ]); - resetTracking(); - } - } -} -__name(invokeDirectiveHook, "invokeDirectiveHook"); -const TeleportEndKey = Symbol("_vte"); -const isTeleport = /* @__PURE__ */ __name((type) => type.__isTeleport, "isTeleport"); -const isTeleportDisabled = /* @__PURE__ */ __name((props) => props && (props.disabled || props.disabled === ""), "isTeleportDisabled"); -const isTeleportDeferred = /* @__PURE__ */ __name((props) => props && (props.defer || props.defer === ""), "isTeleportDeferred"); -const isTargetSVG = /* @__PURE__ */ __name((target2) => typeof SVGElement !== "undefined" && target2 instanceof SVGElement, "isTargetSVG"); -const isTargetMathML = /* @__PURE__ */ __name((target2) => typeof MathMLElement === "function" && target2 instanceof MathMLElement, "isTargetMathML"); -const resolveTarget = /* @__PURE__ */ __name((props, select) => { - const targetSelector = props && props.to; - if (isString$9(targetSelector)) { - if (!select) { - return null; - } else { - const target2 = select(targetSelector); - if (false) { - warn$1$1( - `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.` - ); - } - return target2; - } - } else { - if (false) { - warn$1$1(`Invalid Teleport target: ${targetSelector}`); - } - return targetSelector; - } -}, "resolveTarget"); -const TeleportImpl = { - name: "Teleport", - __isTeleport: true, - process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { - const { - mc: mountChildren, - pc: patchChildren, - pbc: patchBlockChildren, - o: { insert: insert2, querySelector, createText, createComment } - } = internals; - const disabled2 = isTeleportDisabled(n2.props); - let { shapeFlag, children, dynamicChildren } = n2; - if (false) { - optimized = false; - dynamicChildren = null; - } - if (n1 == null) { - const placeholder = n2.el = false ? createComment("teleport start") : createText(""); - const mainAnchor = n2.anchor = false ? createComment("teleport end") : createText(""); - insert2(placeholder, container, anchor); - insert2(mainAnchor, container, anchor); - const mount2 = /* @__PURE__ */ __name((container2, anchor2) => { - if (shapeFlag & 16) { - if (parentComponent && parentComponent.isCE) { - parentComponent.ce._teleportTarget = container2; - } - mountChildren( - children, - container2, - anchor2, - parentComponent, - parentSuspense, - namespace, - slotScopeIds, - optimized - ); - } - }, "mount"); - const mountToTarget = /* @__PURE__ */ __name(() => { - const target2 = n2.target = resolveTarget(n2.props, querySelector); - const targetAnchor = prepareAnchor(target2, n2, createText, insert2); - if (target2) { - if (namespace !== "svg" && isTargetSVG(target2)) { - namespace = "svg"; - } else if (namespace !== "mathml" && isTargetMathML(target2)) { - namespace = "mathml"; - } - if (!disabled2) { - mount2(target2, targetAnchor); - updateCssVars(n2, false); - } - } else if (false) { - warn$1$1( - "Invalid Teleport target on mount:", - target2, - `(${typeof target2})` - ); - } - }, "mountToTarget"); - if (disabled2) { - mount2(container, mainAnchor); - updateCssVars(n2, true); - } - if (isTeleportDeferred(n2.props)) { - queuePostRenderEffect(() => { - mountToTarget(); - n2.el.__isMounted = true; - }, parentSuspense); - } else { - mountToTarget(); - } - } else { - if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) { - queuePostRenderEffect(() => { - TeleportImpl.process( - n1, - n2, - container, - anchor, - parentComponent, - parentSuspense, - namespace, - slotScopeIds, - optimized, - internals - ); - delete n1.el.__isMounted; - }, parentSuspense); - return; - } - n2.el = n1.el; - n2.targetStart = n1.targetStart; - const mainAnchor = n2.anchor = n1.anchor; - const target2 = n2.target = n1.target; - const targetAnchor = n2.targetAnchor = n1.targetAnchor; - const wasDisabled = isTeleportDisabled(n1.props); - const currentContainer = wasDisabled ? container : target2; - const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; - if (namespace === "svg" || isTargetSVG(target2)) { - namespace = "svg"; - } else if (namespace === "mathml" || isTargetMathML(target2)) { - namespace = "mathml"; - } - if (dynamicChildren) { - patchBlockChildren( - n1.dynamicChildren, - dynamicChildren, - currentContainer, - parentComponent, - parentSuspense, - namespace, - slotScopeIds - ); - traverseStaticChildren(n1, n2, true); - } else if (!optimized) { - patchChildren( - n1, - n2, - currentContainer, - currentAnchor, - parentComponent, - parentSuspense, - namespace, - slotScopeIds, - false - ); - } - if (disabled2) { - if (!wasDisabled) { - moveTeleport( - n2, - container, - mainAnchor, - internals, - 1 - ); - } else { - if (n2.props && n1.props && n2.props.to !== n1.props.to) { - n2.props.to = n1.props.to; - } - } - } else { - if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { - const nextTarget = n2.target = resolveTarget( - n2.props, - querySelector - ); - if (nextTarget) { - moveTeleport( - n2, - nextTarget, - null, - internals, - 0 - ); - } else if (false) { - warn$1$1( - "Invalid Teleport target on update:", - target2, - `(${typeof target2})` - ); - } - } else if (wasDisabled) { - moveTeleport( - n2, - target2, - targetAnchor, - internals, - 1 - ); - } - } - updateCssVars(n2, disabled2); - } - }, - remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) { - const { - shapeFlag, - children, - anchor, - targetStart, - targetAnchor, - target: target2, - props - } = vnode; - if (target2) { - hostRemove(targetStart); - hostRemove(targetAnchor); - } - doRemove && hostRemove(anchor); - if (shapeFlag & 16) { - const shouldRemove = doRemove || !isTeleportDisabled(props); - for (let i2 = 0; i2 < children.length; i2++) { - const child = children[i2]; - unmount( - child, - parentComponent, - parentSuspense, - shouldRemove, - !!child.dynamicChildren - ); - } - } - }, - move: moveTeleport, - hydrate: hydrateTeleport -}; -function moveTeleport(vnode, container, parentAnchor, { o: { insert: insert2 }, m: move }, moveType = 2) { - if (moveType === 0) { - insert2(vnode.targetAnchor, container, parentAnchor); - } - const { el, anchor, shapeFlag, children, props } = vnode; - const isReorder = moveType === 2; - if (isReorder) { - insert2(el, container, parentAnchor); - } - if (!isReorder || isTeleportDisabled(props)) { - if (shapeFlag & 16) { - for (let i2 = 0; i2 < children.length; i2++) { - move( - children[i2], - container, - parentAnchor, - 2 - ); - } - } - } - if (isReorder) { - insert2(anchor, container, parentAnchor); - } -} -__name(moveTeleport, "moveTeleport"); -function hydrateTeleport(node3, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { - o: { nextSibling, parentNode: parentNode2, querySelector, insert: insert2, createText } -}, hydrateChildren) { - const target2 = vnode.target = resolveTarget( - vnode.props, - querySelector - ); - if (target2) { - const disabled2 = isTeleportDisabled(vnode.props); - const targetNode = target2._lpa || target2.firstChild; - if (vnode.shapeFlag & 16) { - if (disabled2) { - vnode.anchor = hydrateChildren( - nextSibling(node3), - vnode, - parentNode2(node3), - parentComponent, - parentSuspense, - slotScopeIds, - optimized - ); - vnode.targetStart = targetNode; - vnode.targetAnchor = targetNode && nextSibling(targetNode); - } else { - vnode.anchor = nextSibling(node3); - let targetAnchor = targetNode; - while (targetAnchor) { - if (targetAnchor && targetAnchor.nodeType === 8) { - if (targetAnchor.data === "teleport start anchor") { - vnode.targetStart = targetAnchor; - } else if (targetAnchor.data === "teleport anchor") { - vnode.targetAnchor = targetAnchor; - target2._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); - break; - } - } - targetAnchor = nextSibling(targetAnchor); - } - if (!vnode.targetAnchor) { - prepareAnchor(target2, vnode, createText, insert2); - } - hydrateChildren( - targetNode && nextSibling(targetNode), - vnode, - target2, - parentComponent, - parentSuspense, - slotScopeIds, - optimized - ); - } - } - updateCssVars(vnode, disabled2); - } - return vnode.anchor && nextSibling(vnode.anchor); -} -__name(hydrateTeleport, "hydrateTeleport"); -const Teleport = TeleportImpl; -function updateCssVars(vnode, isDisabled) { - const ctx = vnode.ctx; - if (ctx && ctx.ut) { - let node3, anchor; - if (isDisabled) { - node3 = vnode.el; - anchor = vnode.anchor; - } else { - node3 = vnode.targetStart; - anchor = vnode.targetAnchor; - } - while (node3 && node3 !== anchor) { - if (node3.nodeType === 1) node3.setAttribute("data-v-owner", ctx.uid); - node3 = node3.nextSibling; - } - ctx.ut(); - } -} -__name(updateCssVars, "updateCssVars"); -function prepareAnchor(target2, vnode, createText, insert2) { - const targetStart = vnode.targetStart = createText(""); - const targetAnchor = vnode.targetAnchor = createText(""); - targetStart[TeleportEndKey] = targetAnchor; - if (target2) { - insert2(targetStart, target2); - insert2(targetAnchor, target2); - } - return targetAnchor; -} -__name(prepareAnchor, "prepareAnchor"); -const leaveCbKey = Symbol("_leaveCb"); -const enterCbKey$1 = Symbol("_enterCb"); -function useTransitionState() { - const state = { - isMounted: false, - isLeaving: false, - isUnmounting: false, - leavingVNodes: /* @__PURE__ */ new Map() - }; - onMounted(() => { - state.isMounted = true; - }); - onBeforeUnmount(() => { - state.isUnmounting = true; - }); - return state; -} -__name(useTransitionState, "useTransitionState"); -const TransitionHookValidator = [Function, Array]; -const BaseTransitionPropsValidators = { - mode: String, - appear: Boolean, - persisted: Boolean, - // enter - onBeforeEnter: TransitionHookValidator, - onEnter: TransitionHookValidator, - onAfterEnter: TransitionHookValidator, - onEnterCancelled: TransitionHookValidator, - // leave - onBeforeLeave: TransitionHookValidator, - onLeave: TransitionHookValidator, - onAfterLeave: TransitionHookValidator, - onLeaveCancelled: TransitionHookValidator, - // appear - onBeforeAppear: TransitionHookValidator, - onAppear: TransitionHookValidator, - onAfterAppear: TransitionHookValidator, - onAppearCancelled: TransitionHookValidator -}; -const recursiveGetSubtree = /* @__PURE__ */ __name((instance) => { - const subTree = instance.subTree; - return subTree.component ? recursiveGetSubtree(subTree.component) : subTree; -}, "recursiveGetSubtree"); -const BaseTransitionImpl = { - name: `BaseTransition`, - props: BaseTransitionPropsValidators, - setup(props, { slots }) { - const instance = getCurrentInstance(); - const state = useTransitionState(); - return () => { - const children = slots.default && getTransitionRawChildren(slots.default(), true); - if (!children || !children.length) { - return; - } - const child = findNonCommentChild(children); - const rawProps = toRaw(props); - const { mode: mode2 } = rawProps; - if (false) { - warn$1$1(`invalid mode: ${mode2}`); - } - if (state.isLeaving) { - return emptyPlaceholder(child); - } - const innerChild = getInnerChild$1(child); - if (!innerChild) { - return emptyPlaceholder(child); - } - let enterHooks = resolveTransitionHooks( - innerChild, - rawProps, - state, - instance, - // #11061, ensure enterHooks is fresh after clone - (hooks2) => enterHooks = hooks2 - ); - if (innerChild.type !== Comment) { - setTransitionHooks(innerChild, enterHooks); - } - let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree); - if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) { - let leavingHooks = resolveTransitionHooks( - oldInnerChild, - rawProps, - state, - instance - ); - setTransitionHooks(oldInnerChild, leavingHooks); - if (mode2 === "out-in" && innerChild.type !== Comment) { - state.isLeaving = true; - leavingHooks.afterLeave = () => { - state.isLeaving = false; - if (!(instance.job.flags & 8)) { - instance.update(); - } - delete leavingHooks.afterLeave; - oldInnerChild = void 0; - }; - return emptyPlaceholder(child); - } else if (mode2 === "in-out" && innerChild.type !== Comment) { - leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { - const leavingVNodesCache = getLeavingNodesForType( - state, - oldInnerChild - ); - leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; - el[leaveCbKey] = () => { - earlyRemove(); - el[leaveCbKey] = void 0; - delete enterHooks.delayedLeave; - oldInnerChild = void 0; - }; - enterHooks.delayedLeave = () => { - delayedLeave(); - delete enterHooks.delayedLeave; - oldInnerChild = void 0; - }; - }; - } else { - oldInnerChild = void 0; - } - } else if (oldInnerChild) { - oldInnerChild = void 0; - } - return child; - }; - } -}; -function findNonCommentChild(children) { - let child = children[0]; - if (children.length > 1) { - let hasFound = false; - for (const c2 of children) { - if (c2.type !== Comment) { - if (false) { - warn$1$1( - " can only be used on a single element or component. Use for lists." - ); - break; - } - child = c2; - hasFound = true; - if (true) break; - } - } - } - return child; -} -__name(findNonCommentChild, "findNonCommentChild"); -const BaseTransition = BaseTransitionImpl; -function getLeavingNodesForType(state, vnode) { - const { leavingVNodes } = state; - let leavingVNodesCache = leavingVNodes.get(vnode.type); - if (!leavingVNodesCache) { - leavingVNodesCache = /* @__PURE__ */ Object.create(null); - leavingVNodes.set(vnode.type, leavingVNodesCache); - } - return leavingVNodesCache; -} -__name(getLeavingNodesForType, "getLeavingNodesForType"); -function resolveTransitionHooks(vnode, props, state, instance, postClone) { - const { - appear, - mode: mode2, - persisted = false, - onBeforeEnter: onBeforeEnter2, - onEnter: onEnter7, - onAfterEnter: onAfterEnter4, - onEnterCancelled, - onBeforeLeave: onBeforeLeave3, - onLeave: onLeave5, - onAfterLeave: onAfterLeave6, - onLeaveCancelled, - onBeforeAppear, - onAppear, - onAfterAppear, - onAppearCancelled - } = props; - const key = String(vnode.key); - const leavingVNodesCache = getLeavingNodesForType(state, vnode); - const callHook2 = /* @__PURE__ */ __name((hook, args) => { - hook && callWithAsyncErrorHandling( - hook, - instance, - 9, - args - ); - }, "callHook2"); - const callAsyncHook = /* @__PURE__ */ __name((hook, args) => { - const done = args[1]; - callHook2(hook, args); - if (isArray$9(hook)) { - if (hook.every((hook2) => hook2.length <= 1)) done(); - } else if (hook.length <= 1) { - done(); - } - }, "callAsyncHook"); - const hooks2 = { - mode: mode2, - persisted, - beforeEnter(el) { - let hook = onBeforeEnter2; - if (!state.isMounted) { - if (appear) { - hook = onBeforeAppear || onBeforeEnter2; - } else { - return; - } - } - if (el[leaveCbKey]) { - el[leaveCbKey]( - true - /* cancelled */ - ); - } - const leavingVNode = leavingVNodesCache[key]; - if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { - leavingVNode.el[leaveCbKey](); - } - callHook2(hook, [el]); - }, - enter(el) { - let hook = onEnter7; - let afterHook = onAfterEnter4; - let cancelHook = onEnterCancelled; - if (!state.isMounted) { - if (appear) { - hook = onAppear || onEnter7; - afterHook = onAfterAppear || onAfterEnter4; - cancelHook = onAppearCancelled || onEnterCancelled; - } else { - return; - } - } - let called = false; - const done = el[enterCbKey$1] = (cancelled) => { - if (called) return; - called = true; - if (cancelled) { - callHook2(cancelHook, [el]); - } else { - callHook2(afterHook, [el]); - } - if (hooks2.delayedLeave) { - hooks2.delayedLeave(); - } - el[enterCbKey$1] = void 0; - }; - if (hook) { - callAsyncHook(hook, [el, done]); - } else { - done(); - } - }, - leave(el, remove22) { - const key2 = String(vnode.key); - if (el[enterCbKey$1]) { - el[enterCbKey$1]( - true - /* cancelled */ - ); - } - if (state.isUnmounting) { - return remove22(); - } - callHook2(onBeforeLeave3, [el]); - let called = false; - const done = el[leaveCbKey] = (cancelled) => { - if (called) return; - called = true; - remove22(); - if (cancelled) { - callHook2(onLeaveCancelled, [el]); - } else { - callHook2(onAfterLeave6, [el]); - } - el[leaveCbKey] = void 0; - if (leavingVNodesCache[key2] === vnode) { - delete leavingVNodesCache[key2]; - } - }; - leavingVNodesCache[key2] = vnode; - if (onLeave5) { - callAsyncHook(onLeave5, [el, done]); - } else { - done(); - } - }, - clone(vnode2) { - const hooks22 = resolveTransitionHooks( - vnode2, - props, - state, - instance, - postClone - ); - if (postClone) postClone(hooks22); - return hooks22; - } - }; - return hooks2; -} -__name(resolveTransitionHooks, "resolveTransitionHooks"); -function emptyPlaceholder(vnode) { - if (isKeepAlive(vnode)) { - vnode = cloneVNode(vnode); - vnode.children = null; - return vnode; - } -} -__name(emptyPlaceholder, "emptyPlaceholder"); -function getInnerChild$1(vnode) { - if (!isKeepAlive(vnode)) { - if (isTeleport(vnode.type) && vnode.children) { - return findNonCommentChild(vnode.children); - } - return vnode; - } - if (false) { - return vnode.component.subTree; - } - const { shapeFlag, children } = vnode; - if (children) { - if (shapeFlag & 16) { - return children[0]; - } - if (shapeFlag & 32 && isFunction$a(children.default)) { - return children.default(); - } - } -} -__name(getInnerChild$1, "getInnerChild$1"); -function setTransitionHooks(vnode, hooks2) { - if (vnode.shapeFlag & 6 && vnode.component) { - vnode.transition = hooks2; - setTransitionHooks(vnode.component.subTree, hooks2); - } else if (vnode.shapeFlag & 128) { - vnode.ssContent.transition = hooks2.clone(vnode.ssContent); - vnode.ssFallback.transition = hooks2.clone(vnode.ssFallback); - } else { - vnode.transition = hooks2; - } -} -__name(setTransitionHooks, "setTransitionHooks"); -function getTransitionRawChildren(children, keepComment = false, parentKey) { - let ret = []; - let keyedFragmentCount = 0; - for (let i2 = 0; i2 < children.length; i2++) { - let child = children[i2]; - const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i2); - if (child.type === Fragment$1) { - if (child.patchFlag & 128) keyedFragmentCount++; - ret = ret.concat( - getTransitionRawChildren(child.children, keepComment, key) - ); - } else if (keepComment || child.type !== Comment) { - ret.push(key != null ? cloneVNode(child, { key }) : child); - } - } - if (keyedFragmentCount > 1) { - for (let i2 = 0; i2 < ret.length; i2++) { - ret[i2].patchFlag = -2; - } - } - return ret; -} -__name(getTransitionRawChildren, "getTransitionRawChildren"); -/*! #__NO_SIDE_EFFECTS__ */ -// @__NO_SIDE_EFFECTS__ -function defineComponent(options4, extraOptions) { - return isFunction$a(options4) ? ( - // #8236: extend call and options.name access are considered side-effects - // by Rollup, so we have to wrap it in a pure-annotated IIFE. - /* @__PURE__ */ (() => extend$1({ name: options4.name }, extraOptions, { setup: options4 }))() - ) : options4; -} -__name(defineComponent, "defineComponent"); -function useId() { - const i2 = getCurrentInstance(); - if (i2) { - return (i2.appContext.config.idPrefix || "v") + "-" + i2.ids[0] + i2.ids[1]++; - } else if (false) { - warn$1$1( - `useId() is called when there is no active component instance to be associated with.` - ); - } - return ""; -} -__name(useId, "useId"); -function markAsyncBoundary(instance) { - instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; -} -__name(markAsyncBoundary, "markAsyncBoundary"); -const knownTemplateRefs = /* @__PURE__ */ new WeakSet(); -function useTemplateRef(key) { - const i2 = getCurrentInstance(); - const r2 = shallowRef(null); - if (i2) { - const refs = i2.refs === EMPTY_OBJ ? i2.refs = {} : i2.refs; - let desc; - if (false) { - warn$1$1(`useTemplateRef('${key}') already exists.`); - } else { - Object.defineProperty(refs, key, { - enumerable: true, - get: /* @__PURE__ */ __name(() => r2.value, "get"), - set: /* @__PURE__ */ __name((val) => r2.value = val, "set") - }); - } - } else if (false) { - warn$1$1( - `useTemplateRef() is called when there is no active component instance to be associated with.` - ); - } - const ret = false ? readonly(r2) : r2; - if (false) { - knownTemplateRefs.add(ret); - } - return ret; -} -__name(useTemplateRef, "useTemplateRef"); -function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { - if (isArray$9(rawRef)) { - rawRef.forEach( - (r2, i2) => setRef( - r2, - oldRawRef && (isArray$9(oldRawRef) ? oldRawRef[i2] : oldRawRef), - parentSuspense, - vnode, - isUnmount - ) - ); - return; - } - if (isAsyncWrapper(vnode) && !isUnmount) { - if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { - setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); - } - return; - } - const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; - const value4 = isUnmount ? null : refValue; - const { i: owner, r: ref3 } = rawRef; - if (false) { - warn$1$1( - `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` - ); - return; - } - const oldRef = oldRawRef && oldRawRef.r; - const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; - const setupState = owner.setupState; - const rawSetupState = toRaw(setupState); - const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => { - if (false) { - if (hasOwn$3(rawSetupState, key) && !isRef(rawSetupState[key])) { - warn$1$1( - `Template ref "${key}" used on a non-ref value. It will not work in the production build.` - ); - } - if (knownTemplateRefs.has(rawSetupState[key])) { - return false; - } - } - return hasOwn$3(rawSetupState, key); - }; - if (oldRef != null && oldRef !== ref3) { - if (isString$9(oldRef)) { - refs[oldRef] = null; - if (canSetSetupRef(oldRef)) { - setupState[oldRef] = null; - } - } else if (isRef(oldRef)) { - oldRef.value = null; - } - } - if (isFunction$a(ref3)) { - callWithErrorHandling(ref3, owner, 12, [value4, refs]); - } else { - const _isString = isString$9(ref3); - const _isRef = isRef(ref3); - if (_isString || _isRef) { - const doSet = /* @__PURE__ */ __name(() => { - if (rawRef.f) { - const existing = _isString ? canSetSetupRef(ref3) ? setupState[ref3] : refs[ref3] : ref3.value; - if (isUnmount) { - isArray$9(existing) && remove$1(existing, refValue); - } else { - if (!isArray$9(existing)) { - if (_isString) { - refs[ref3] = [refValue]; - if (canSetSetupRef(ref3)) { - setupState[ref3] = refs[ref3]; - } - } else { - ref3.value = [refValue]; - if (rawRef.k) refs[rawRef.k] = ref3.value; - } - } else if (!existing.includes(refValue)) { - existing.push(refValue); - } - } - } else if (_isString) { - refs[ref3] = value4; - if (canSetSetupRef(ref3)) { - setupState[ref3] = value4; - } - } else if (_isRef) { - ref3.value = value4; - if (rawRef.k) refs[rawRef.k] = value4; - } else if (false) { - warn$1$1("Invalid template ref type:", ref3, `(${typeof ref3})`); - } - }, "doSet"); - if (value4) { - doSet.id = -1; - queuePostRenderEffect(doSet, parentSuspense); - } else { - doSet(); - } - } else if (false) { - warn$1$1("Invalid template ref type:", ref3, `(${typeof ref3})`); - } - } -} -__name(setRef, "setRef"); -let hasLoggedMismatchError = false; -const logMismatchError = /* @__PURE__ */ __name(() => { - if (hasLoggedMismatchError) { - return; - } - console.error("Hydration completed but contains mismatches."); - hasLoggedMismatchError = true; -}, "logMismatchError"); -const isSVGContainer = /* @__PURE__ */ __name((container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject", "isSVGContainer"); -const isMathMLContainer = /* @__PURE__ */ __name((container) => container.namespaceURI.includes("MathML"), "isMathMLContainer"); -const getContainerType = /* @__PURE__ */ __name((container) => { - if (container.nodeType !== 1) return void 0; - if (isSVGContainer(container)) return "svg"; - if (isMathMLContainer(container)) return "mathml"; - return void 0; -}, "getContainerType"); -const isComment = /* @__PURE__ */ __name((node3) => node3.nodeType === 8, "isComment"); -function createHydrationFunctions(rendererInternals) { - const { - mt: mountComponent, - p: patch2, - o: { - patchProp: patchProp2, - createText, - nextSibling, - parentNode: parentNode2, - remove: remove22, - insert: insert2, - createComment - } - } = rendererInternals; - const hydrate2 = /* @__PURE__ */ __name((vnode, container) => { - if (!container.hasChildNodes()) { - patch2(null, vnode, container); - flushPostFlushCbs(); - container._vnode = vnode; - return; - } - hydrateNode(container.firstChild, vnode, null, null, null); - flushPostFlushCbs(); - container._vnode = vnode; - }, "hydrate"); - const hydrateNode = /* @__PURE__ */ __name((node3, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { - optimized = optimized || !!vnode.dynamicChildren; - const isFragmentStart = isComment(node3) && node3.data === "["; - const onMismatch = /* @__PURE__ */ __name(() => handleMismatch( - node3, - vnode, - parentComponent, - parentSuspense, - slotScopeIds, - isFragmentStart - ), "onMismatch"); - const { type, ref: ref3, shapeFlag, patchFlag } = vnode; - let domType = node3.nodeType; - vnode.el = node3; - if (false) { - def(node3, "__vnode", vnode, true); - def(node3, "__vueParentComponent", parentComponent, true); - } - if (patchFlag === -2) { - optimized = false; - vnode.dynamicChildren = null; - } - let nextNode = null; - switch (type) { - case Text$4: - if (domType !== 3) { - if (vnode.children === "") { - insert2(vnode.el = createText(""), parentNode2(node3), node3); - nextNode = node3; - } else { - nextNode = onMismatch(); - } - } else { - if (node3.data !== vnode.children) { - logMismatchError(); - node3.data = vnode.children; - } - nextNode = nextSibling(node3); - } - break; - case Comment: - if (isTemplateNode(node3)) { - nextNode = nextSibling(node3); - replaceNode( - vnode.el = node3.content.firstChild, - node3, - parentComponent - ); - } else if (domType !== 8 || isFragmentStart) { - nextNode = onMismatch(); - } else { - nextNode = nextSibling(node3); - } - break; - case Static: - if (isFragmentStart) { - node3 = nextSibling(node3); - domType = node3.nodeType; - } - if (domType === 1 || domType === 3) { - nextNode = node3; - const needToAdoptContent = !vnode.children.length; - for (let i2 = 0; i2 < vnode.staticCount; i2++) { - if (needToAdoptContent) - vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; - if (i2 === vnode.staticCount - 1) { - vnode.anchor = nextNode; - } - nextNode = nextSibling(nextNode); - } - return isFragmentStart ? nextSibling(nextNode) : nextNode; - } else { - onMismatch(); - } - break; - case Fragment$1: - if (!isFragmentStart) { - nextNode = onMismatch(); - } else { - nextNode = hydrateFragment( - node3, - vnode, - parentComponent, - parentSuspense, - slotScopeIds, - optimized - ); - } - break; - default: - if (shapeFlag & 1) { - if ((domType !== 1 || vnode.type.toLowerCase() !== node3.tagName.toLowerCase()) && !isTemplateNode(node3)) { - nextNode = onMismatch(); - } else { - nextNode = hydrateElement( - node3, - vnode, - parentComponent, - parentSuspense, - slotScopeIds, - optimized - ); - } - } else if (shapeFlag & 6) { - vnode.slotScopeIds = slotScopeIds; - const container = parentNode2(node3); - if (isFragmentStart) { - nextNode = locateClosingAnchor(node3); - } else if (isComment(node3) && node3.data === "teleport start") { - nextNode = locateClosingAnchor(node3, node3.data, "teleport end"); - } else { - nextNode = nextSibling(node3); - } - mountComponent( - vnode, - container, - null, - parentComponent, - parentSuspense, - getContainerType(container), - optimized - ); - if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) { - let subTree; - if (isFragmentStart) { - subTree = createVNode(Fragment$1); - subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; - } else { - subTree = node3.nodeType === 3 ? createTextVNode("") : createVNode("div"); - } - subTree.el = node3; - vnode.component.subTree = subTree; - } - } else if (shapeFlag & 64) { - if (domType !== 8) { - nextNode = onMismatch(); - } else { - nextNode = vnode.type.hydrate( - node3, - vnode, - parentComponent, - parentSuspense, - slotScopeIds, - optimized, - rendererInternals, - hydrateChildren - ); - } - } else if (shapeFlag & 128) { - nextNode = vnode.type.hydrate( - node3, - vnode, - parentComponent, - parentSuspense, - getContainerType(parentNode2(node3)), - slotScopeIds, - optimized, - rendererInternals, - hydrateNode - ); - } else if (false) { - warn$1$1("Invalid HostVNode type:", type, `(${typeof type})`); - } - } - if (ref3 != null) { - setRef(ref3, null, parentSuspense, vnode); - } - return nextNode; - }, "hydrateNode"); - const hydrateElement = /* @__PURE__ */ __name((el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { - optimized = optimized || !!vnode.dynamicChildren; - const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode; - const forcePatch = type === "input" || type === "option"; - if (forcePatch || patchFlag !== -1) { - if (dirs) { - invokeDirectiveHook(vnode, null, parentComponent, "created"); - } - let needCallTransitionHooks = false; - if (isTemplateNode(el)) { - needCallTransitionHooks = needTransition( - null, - // no need check parentSuspense in hydration - transition - ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; - const content2 = el.content.firstChild; - if (needCallTransitionHooks) { - transition.beforeEnter(content2); - } - replaceNode(content2, el, parentComponent); - vnode.el = el = content2; - } - if (shapeFlag & 16 && // skip if element has innerHTML / textContent - !(props && (props.innerHTML || props.textContent))) { - let next2 = hydrateChildren( - el.firstChild, - vnode, - el, - parentComponent, - parentSuspense, - slotScopeIds, - optimized - ); - let hasWarned2 = false; - while (next2) { - if (!isMismatchAllowed( - el, - 1 - /* CHILDREN */ - )) { - if (false) { - warn$1$1( - `Hydration children mismatch on`, - el, - ` -Server rendered element contains more child nodes than client vdom.` - ); - hasWarned2 = true; - } - logMismatchError(); - } - const cur = next2; - next2 = next2.nextSibling; - remove22(cur); - } - } else if (shapeFlag & 8) { - let clientText = vnode.children; - if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) { - clientText = clientText.slice(1); - } - if (el.textContent !== clientText) { - if (!isMismatchAllowed( - el, - 0 - /* TEXT */ - )) { - logMismatchError(); - } - el.textContent = vnode.children; - } - } - if (props) { - if (forcePatch || !optimized || patchFlag & (16 | 32)) { - const isCustomElement = el.tagName.includes("-"); - for (const key in props) { - if (false) { - logMismatchError(); - } - if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers - key[0] === "." || isCustomElement) { - patchProp2(el, key, null, props[key], void 0, parentComponent); - } - } - } else if (props.onClick) { - patchProp2( - el, - "onClick", - null, - props.onClick, - void 0, - parentComponent - ); - } else if (patchFlag & 4 && isReactive(props.style)) { - for (const key in props.style) props.style[key]; - } - } - let vnodeHooks; - if (vnodeHooks = props && props.onVnodeBeforeMount) { - invokeVNodeHook(vnodeHooks, parentComponent, vnode); - } - if (dirs) { - invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); - } - if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { - queueEffectWithSuspense(() => { - vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); - needCallTransitionHooks && transition.enter(el); - dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); - }, parentSuspense); - } - } - return el.nextSibling; - }, "hydrateElement"); - const hydrateChildren = /* @__PURE__ */ __name((node3, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { - optimized = optimized || !!parentVNode.dynamicChildren; - const children = parentVNode.children; - const l2 = children.length; - let hasWarned2 = false; - for (let i2 = 0; i2 < l2; i2++) { - const vnode = optimized ? children[i2] : children[i2] = normalizeVNode(children[i2]); - const isText = vnode.type === Text$4; - if (node3) { - if (isText && !optimized) { - if (i2 + 1 < l2 && normalizeVNode(children[i2 + 1]).type === Text$4) { - insert2( - createText( - node3.data.slice(vnode.children.length) - ), - container, - nextSibling(node3) - ); - node3.data = vnode.children; - } - } - node3 = hydrateNode( - node3, - vnode, - parentComponent, - parentSuspense, - slotScopeIds, - optimized - ); - } else if (isText && !vnode.children) { - insert2(vnode.el = createText(""), container); - } else { - if (!isMismatchAllowed( - container, - 1 - /* CHILDREN */ - )) { - if (false) { - warn$1$1( - `Hydration children mismatch on`, - container, - ` -Server rendered element contains fewer child nodes than client vdom.` - ); - hasWarned2 = true; - } - logMismatchError(); - } - patch2( - null, - vnode, - container, - null, - parentComponent, - parentSuspense, - getContainerType(container), - slotScopeIds - ); - } - } - return node3; - }, "hydrateChildren"); - const hydrateFragment = /* @__PURE__ */ __name((node3, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { - const { slotScopeIds: fragmentSlotScopeIds } = vnode; - if (fragmentSlotScopeIds) { - slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; - } - const container = parentNode2(node3); - const next2 = hydrateChildren( - nextSibling(node3), - vnode, - container, - parentComponent, - parentSuspense, - slotScopeIds, - optimized - ); - if (next2 && isComment(next2) && next2.data === "]") { - return nextSibling(vnode.anchor = next2); - } else { - logMismatchError(); - insert2(vnode.anchor = createComment(`]`), container, next2); - return next2; - } - }, "hydrateFragment"); - const handleMismatch = /* @__PURE__ */ __name((node3, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment2) => { - if (!isMismatchAllowed( - node3.parentElement, - 1 - /* CHILDREN */ - )) { - logMismatchError(); - } - vnode.el = null; - if (isFragment2) { - const end = locateClosingAnchor(node3); - while (true) { - const next22 = nextSibling(node3); - if (next22 && next22 !== end) { - remove22(next22); - } else { - break; - } - } - } - const next2 = nextSibling(node3); - const container = parentNode2(node3); - remove22(node3); - patch2( - null, - vnode, - container, - next2, - parentComponent, - parentSuspense, - getContainerType(container), - slotScopeIds - ); - if (parentComponent) { - parentComponent.vnode.el = vnode.el; - updateHOCHostEl(parentComponent, vnode.el); - } - return next2; - }, "handleMismatch"); - const locateClosingAnchor = /* @__PURE__ */ __name((node3, open2 = "[", close5 = "]") => { - let match3 = 0; - while (node3) { - node3 = nextSibling(node3); - if (node3 && isComment(node3)) { - if (node3.data === open2) match3++; - if (node3.data === close5) { - if (match3 === 0) { - return nextSibling(node3); - } else { - match3--; - } - } - } - } - return node3; - }, "locateClosingAnchor"); - const replaceNode = /* @__PURE__ */ __name((newNode, oldNode, parentComponent) => { - const parentNode22 = oldNode.parentNode; - if (parentNode22) { - parentNode22.replaceChild(newNode, oldNode); - } - let parent = parentComponent; - while (parent) { - if (parent.vnode.el === oldNode) { - parent.vnode.el = parent.subTree.el = newNode; - } - parent = parent.parent; - } - }, "replaceNode"); - const isTemplateNode = /* @__PURE__ */ __name((node3) => { - return node3.nodeType === 1 && node3.tagName === "TEMPLATE"; - }, "isTemplateNode"); - return [hydrate2, hydrateNode]; -} -__name(createHydrationFunctions, "createHydrationFunctions"); -function propHasMismatch(el, key, clientValue, vnode, instance) { - let mismatchType; - let mismatchKey; - let actual; - let expected; - if (key === "class") { - actual = el.getAttribute("class"); - expected = normalizeClass(clientValue); - if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { - mismatchType = 2; - mismatchKey = `class`; - } - } else if (key === "style") { - actual = el.getAttribute("style") || ""; - expected = isString$9(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue)); - const actualMap = toStyleMap(actual); - const expectedMap = toStyleMap(expected); - if (vnode.dirs) { - for (const { dir, value: value4 } of vnode.dirs) { - if (dir.name === "show" && !value4) { - expectedMap.set("display", "none"); - } - } - } - if (instance) { - resolveCssVars(instance, vnode, expectedMap); - } - if (!isMapEqual(actualMap, expectedMap)) { - mismatchType = 3; - mismatchKey = "style"; - } - } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) { - if (isBooleanAttr(key)) { - actual = el.hasAttribute(key); - expected = includeBooleanAttr(clientValue); - } else if (clientValue == null) { - actual = el.hasAttribute(key); - expected = false; - } else { - if (el.hasAttribute(key)) { - actual = el.getAttribute(key); - } else if (key === "value" && el.tagName === "TEXTAREA") { - actual = el.value; - } else { - actual = false; - } - expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false; - } - if (actual !== expected) { - mismatchType = 4; - mismatchKey = key; - } - } - if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) { - const format2 = /* @__PURE__ */ __name((v2) => v2 === false ? `(not rendered)` : `${mismatchKey}="${v2}"`, "format"); - const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`; - const postSegment = ` - - rendered on server: ${format2(actual)} - - expected on client: ${format2(expected)} - Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. - You should fix the source of the mismatch.`; - { - warn$1$1(preSegment, el, postSegment); - } - return true; - } - return false; -} -__name(propHasMismatch, "propHasMismatch"); -function toClassSet(str) { - return new Set(str.trim().split(/\s+/)); -} -__name(toClassSet, "toClassSet"); -function isSetEqual(a2, b2) { - if (a2.size !== b2.size) { - return false; - } - for (const s2 of a2) { - if (!b2.has(s2)) { - return false; - } - } - return true; -} -__name(isSetEqual, "isSetEqual"); -function toStyleMap(str) { - const styleMap = /* @__PURE__ */ new Map(); - for (const item3 of str.split(";")) { - let [key, value4] = item3.split(":"); - key = key.trim(); - value4 = value4 && value4.trim(); - if (key && value4) { - styleMap.set(key, value4); - } - } - return styleMap; -} -__name(toStyleMap, "toStyleMap"); -function isMapEqual(a2, b2) { - if (a2.size !== b2.size) { - return false; - } - for (const [key, value4] of a2) { - if (value4 !== b2.get(key)) { - return false; - } - } - return true; -} -__name(isMapEqual, "isMapEqual"); -function resolveCssVars(instance, vnode, expectedMap) { - const root29 = instance.subTree; - if (instance.getCssVars && (vnode === root29 || root29 && root29.type === Fragment$1 && root29.children.includes(vnode))) { - const cssVars = instance.getCssVars(); - for (const key in cssVars) { - expectedMap.set( - `--${getEscapedCssVarName(key, false)}`, - String(cssVars[key]) - ); - } - } - if (vnode === root29 && instance.parent) { - resolveCssVars(instance.parent, instance.vnode, expectedMap); - } -} -__name(resolveCssVars, "resolveCssVars"); -const allowMismatchAttr = "data-allow-mismatch"; -const MismatchTypeString = { - [ - 0 - /* TEXT */ - ]: "text", - [ - 1 - /* CHILDREN */ - ]: "children", - [ - 2 - /* CLASS */ - ]: "class", - [ - 3 - /* STYLE */ - ]: "style", - [ - 4 - /* ATTRIBUTE */ - ]: "attribute" -}; -function isMismatchAllowed(el, allowedType) { - if (allowedType === 0 || allowedType === 1) { - while (el && !el.hasAttribute(allowMismatchAttr)) { - el = el.parentElement; - } - } - const allowedAttr = el && el.getAttribute(allowMismatchAttr); - if (allowedAttr == null) { - return false; - } else if (allowedAttr === "") { - return true; - } else { - const list2 = allowedAttr.split(","); - if (allowedType === 0 && list2.includes("children")) { - return true; - } - return allowedAttr.split(",").includes(MismatchTypeString[allowedType]); - } -} -__name(isMismatchAllowed, "isMismatchAllowed"); -const requestIdleCallback$1 = getGlobalThis$1().requestIdleCallback || ((cb) => setTimeout(cb, 1)); -const cancelIdleCallback$1 = getGlobalThis$1().cancelIdleCallback || ((id3) => clearTimeout(id3)); -const hydrateOnIdle = /* @__PURE__ */ __name((timeout = 1e4) => (hydrate2) => { - const id3 = requestIdleCallback$1(hydrate2, { timeout }); - return () => cancelIdleCallback$1(id3); -}, "hydrateOnIdle"); -function elementIsVisibleInViewport(el) { - const { top, left, bottom, right } = el.getBoundingClientRect(); - const { innerHeight: innerHeight2, innerWidth } = window; - return (top > 0 && top < innerHeight2 || bottom > 0 && bottom < innerHeight2) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth); -} -__name(elementIsVisibleInViewport, "elementIsVisibleInViewport"); -const hydrateOnVisible = /* @__PURE__ */ __name((opts) => (hydrate2, forEach3) => { - const ob = new IntersectionObserver((entries) => { - for (const e2 of entries) { - if (!e2.isIntersecting) continue; - ob.disconnect(); - hydrate2(); - break; - } - }, opts); - forEach3((el) => { - if (!(el instanceof Element)) return; - if (elementIsVisibleInViewport(el)) { - hydrate2(); - ob.disconnect(); - return false; - } - ob.observe(el); - }); - return () => ob.disconnect(); -}, "hydrateOnVisible"); -const hydrateOnMediaQuery = /* @__PURE__ */ __name((query) => (hydrate2) => { - if (query) { - const mql = matchMedia(query); - if (mql.matches) { - hydrate2(); - } else { - mql.addEventListener("change", hydrate2, { once: true }); - return () => mql.removeEventListener("change", hydrate2); - } - } -}, "hydrateOnMediaQuery"); -const hydrateOnInteraction = /* @__PURE__ */ __name((interactions = []) => (hydrate2, forEach3) => { - if (isString$9(interactions)) interactions = [interactions]; - let hasHydrated = false; - const doHydrate = /* @__PURE__ */ __name((e2) => { - if (!hasHydrated) { - hasHydrated = true; - teardown(); - hydrate2(); - e2.target.dispatchEvent(new e2.constructor(e2.type, e2)); - } - }, "doHydrate"); - const teardown = /* @__PURE__ */ __name(() => { - forEach3((el) => { - for (const i2 of interactions) { - el.removeEventListener(i2, doHydrate); - } - }); - }, "teardown"); - forEach3((el) => { - for (const i2 of interactions) { - el.addEventListener(i2, doHydrate, { once: true }); - } - }); - return teardown; -}, "hydrateOnInteraction"); -function forEachElement(node3, cb) { - if (isComment(node3) && node3.data === "[") { - let depth = 1; - let next2 = node3.nextSibling; - while (next2) { - if (next2.nodeType === 1) { - const result = cb(next2); - if (result === false) { - break; - } - } else if (isComment(next2)) { - if (next2.data === "]") { - if (--depth === 0) break; - } else if (next2.data === "[") { - depth++; - } - } - next2 = next2.nextSibling; - } - } else { - cb(node3); - } -} -__name(forEachElement, "forEachElement"); -const isAsyncWrapper = /* @__PURE__ */ __name((i2) => !!i2.type.__asyncLoader, "isAsyncWrapper"); -/*! #__NO_SIDE_EFFECTS__ */ -// @__NO_SIDE_EFFECTS__ -function defineAsyncComponent(source) { - if (isFunction$a(source)) { - source = { loader: source }; - } - const { - loader, - loadingComponent, - errorComponent, - delay = 200, - hydrate: hydrateStrategy, - timeout, - // undefined = never times out - suspensible = true, - onError: userOnError - } = source; - let pendingRequest = null; - let resolvedComp; - let retries = 0; - const retry = /* @__PURE__ */ __name(() => { - retries++; - pendingRequest = null; - return load2(); - }, "retry"); - const load2 = /* @__PURE__ */ __name(() => { - let thisRequest; - return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { - err = err instanceof Error ? err : new Error(String(err)); - if (userOnError) { - return new Promise((resolve2, reject3) => { - const userRetry = /* @__PURE__ */ __name(() => resolve2(retry()), "userRetry"); - const userFail = /* @__PURE__ */ __name(() => reject3(err), "userFail"); - userOnError(err, userRetry, userFail, retries + 1); - }); - } else { - throw err; - } - }).then((comp) => { - if (thisRequest !== pendingRequest && pendingRequest) { - return pendingRequest; - } - if (false) { - warn$1$1( - `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` - ); - } - if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { - comp = comp.default; - } - if (false) { - throw new Error(`Invalid async component load result: ${comp}`); - } - resolvedComp = comp; - return comp; - })); - }, "load"); - return /* @__PURE__ */ defineComponent({ - name: "AsyncComponentWrapper", - __asyncLoader: load2, - __asyncHydrate(el, instance, hydrate2) { - const doHydrate = hydrateStrategy ? () => { - const teardown = hydrateStrategy( - hydrate2, - (cb) => forEachElement(el, cb) - ); - if (teardown) { - (instance.bum || (instance.bum = [])).push(teardown); - } - } : hydrate2; - if (resolvedComp) { - doHydrate(); - } else { - load2().then(() => !instance.isUnmounted && doHydrate()); - } - }, - get __asyncResolved() { - return resolvedComp; - }, - setup() { - const instance = currentInstance; - markAsyncBoundary(instance); - if (resolvedComp) { - return () => createInnerComp(resolvedComp, instance); - } - const onError = /* @__PURE__ */ __name((err) => { - pendingRequest = null; - handleError( - err, - instance, - 13, - !errorComponent - ); - }, "onError"); - if (suspensible && instance.suspense || isInSSRComponentSetup) { - return load2().then((comp) => { - return () => createInnerComp(comp, instance); - }).catch((err) => { - onError(err); - return () => errorComponent ? createVNode(errorComponent, { - error: err - }) : null; - }); - } - const loaded = ref(false); - const error2 = ref(); - const delayed = ref(!!delay); - if (delay) { - setTimeout(() => { - delayed.value = false; - }, delay); - } - if (timeout != null) { - setTimeout(() => { - if (!loaded.value && !error2.value) { - const err = new Error( - `Async component timed out after ${timeout}ms.` - ); - onError(err); - error2.value = err; - } - }, timeout); - } - load2().then(() => { - loaded.value = true; - if (instance.parent && isKeepAlive(instance.parent.vnode)) { - instance.parent.update(); - } - }).catch((err) => { - onError(err); - error2.value = err; - }); - return () => { - if (loaded.value && resolvedComp) { - return createInnerComp(resolvedComp, instance); - } else if (error2.value && errorComponent) { - return createVNode(errorComponent, { - error: error2.value - }); - } else if (loadingComponent && !delayed.value) { - return createVNode(loadingComponent); - } - }; - } - }); -} -__name(defineAsyncComponent, "defineAsyncComponent"); -function createInnerComp(comp, parent) { - const { ref: ref22, props, children, ce } = parent.vnode; - const vnode = createVNode(comp, props, children); - vnode.ref = ref22; - vnode.ce = ce; - delete parent.vnode.ce; - return vnode; -} -__name(createInnerComp, "createInnerComp"); -const isKeepAlive = /* @__PURE__ */ __name((vnode) => vnode.type.__isKeepAlive, "isKeepAlive"); -const KeepAliveImpl = { - name: `KeepAlive`, - // Marker for special handling inside the renderer. We are not using a === - // check directly on KeepAlive in the renderer, because importing it directly - // would prevent it from being tree-shaken. - __isKeepAlive: true, - props: { - include: [String, RegExp, Array], - exclude: [String, RegExp, Array], - max: [String, Number] - }, - setup(props, { slots }) { - const instance = getCurrentInstance(); - const sharedContext = instance.ctx; - if (!sharedContext.renderer) { - return () => { - const children = slots.default && slots.default(); - return children && children.length === 1 ? children[0] : children; - }; - } - const cache2 = /* @__PURE__ */ new Map(); - const keys2 = /* @__PURE__ */ new Set(); - let current = null; - if (false) { - instance.__v_cache = cache2; - } - const parentSuspense = instance.suspense; - const { - renderer: { - p: patch2, - m: move, - um: _unmount, - o: { createElement: createElement2 } - } - } = sharedContext; - const storageContainer = createElement2("div"); - sharedContext.activate = (vnode, container, anchor, namespace, optimized) => { - const instance2 = vnode.component; - move(vnode, container, anchor, 0, parentSuspense); - patch2( - instance2.vnode, - vnode, - container, - anchor, - instance2, - parentSuspense, - namespace, - vnode.slotScopeIds, - optimized - ); - queuePostRenderEffect(() => { - instance2.isDeactivated = false; - if (instance2.a) { - invokeArrayFns(instance2.a); - } - const vnodeHook = vnode.props && vnode.props.onVnodeMounted; - if (vnodeHook) { - invokeVNodeHook(vnodeHook, instance2.parent, vnode); - } - }, parentSuspense); - if (false) { - devtoolsComponentAdded(instance2); - } - }; - sharedContext.deactivate = (vnode) => { - const instance2 = vnode.component; - invalidateMount(instance2.m); - invalidateMount(instance2.a); - move(vnode, storageContainer, null, 1, parentSuspense); - queuePostRenderEffect(() => { - if (instance2.da) { - invokeArrayFns(instance2.da); - } - const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; - if (vnodeHook) { - invokeVNodeHook(vnodeHook, instance2.parent, vnode); - } - instance2.isDeactivated = true; - }, parentSuspense); - if (false) { - devtoolsComponentAdded(instance2); - } - }; - function unmount(vnode) { - resetShapeFlag(vnode); - _unmount(vnode, instance, parentSuspense, true); - } - __name(unmount, "unmount"); - function pruneCache(filter4) { - cache2.forEach((vnode, key) => { - const name2 = getComponentName(vnode.type); - if (name2 && !filter4(name2)) { - pruneCacheEntry(key); - } - }); - } - __name(pruneCache, "pruneCache"); - function pruneCacheEntry(key) { - const cached = cache2.get(key); - if (cached && (!current || !isSameVNodeType(cached, current))) { - unmount(cached); - } else if (current) { - resetShapeFlag(current); - } - cache2.delete(key); - keys2.delete(key); - } - __name(pruneCacheEntry, "pruneCacheEntry"); - watch( - () => [props.include, props.exclude], - ([include, exclude]) => { - include && pruneCache((name2) => matches$1(include, name2)); - exclude && pruneCache((name2) => !matches$1(exclude, name2)); - }, - // prune post-render after `current` has been updated - { flush: "post", deep: true } - ); - let pendingCacheKey = null; - const cacheSubtree = /* @__PURE__ */ __name(() => { - if (pendingCacheKey != null) { - if (isSuspense(instance.subTree.type)) { - queuePostRenderEffect(() => { - cache2.set(pendingCacheKey, getInnerChild(instance.subTree)); - }, instance.subTree.suspense); - } else { - cache2.set(pendingCacheKey, getInnerChild(instance.subTree)); - } - } - }, "cacheSubtree"); - onMounted(cacheSubtree); - onUpdated(cacheSubtree); - onBeforeUnmount(() => { - cache2.forEach((cached) => { - const { subTree, suspense } = instance; - const vnode = getInnerChild(subTree); - if (cached.type === vnode.type && cached.key === vnode.key) { - resetShapeFlag(vnode); - const da = vnode.component.da; - da && queuePostRenderEffect(da, suspense); - return; - } - unmount(cached); - }); - }); - return () => { - pendingCacheKey = null; - if (!slots.default) { - return current = null; - } - const children = slots.default(); - const rawVNode = children[0]; - if (children.length > 1) { - if (false) { - warn$1$1(`KeepAlive should contain exactly one component child.`); - } - current = null; - return children; - } else if (!isVNode$1(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { - current = null; - return rawVNode; - } - let vnode = getInnerChild(rawVNode); - if (vnode.type === Comment) { - current = null; - return vnode; - } - const comp = vnode.type; - const name2 = getComponentName( - isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp - ); - const { include, exclude, max } = props; - if (include && (!name2 || !matches$1(include, name2)) || exclude && name2 && matches$1(exclude, name2)) { - vnode.shapeFlag &= ~256; - current = vnode; - return rawVNode; - } - const key = vnode.key == null ? comp : vnode.key; - const cachedVNode = cache2.get(key); - if (vnode.el) { - vnode = cloneVNode(vnode); - if (rawVNode.shapeFlag & 128) { - rawVNode.ssContent = vnode; - } - } - pendingCacheKey = key; - if (cachedVNode) { - vnode.el = cachedVNode.el; - vnode.component = cachedVNode.component; - if (vnode.transition) { - setTransitionHooks(vnode, vnode.transition); - } - vnode.shapeFlag |= 512; - keys2.delete(key); - keys2.add(key); - } else { - keys2.add(key); - if (max && keys2.size > parseInt(max, 10)) { - pruneCacheEntry(keys2.values().next().value); - } - } - vnode.shapeFlag |= 256; - current = vnode; - return isSuspense(rawVNode.type) ? rawVNode : vnode; - }; - } -}; -const KeepAlive = KeepAliveImpl; -function matches$1(pattern, name2) { - if (isArray$9(pattern)) { - return pattern.some((p2) => matches$1(p2, name2)); - } else if (isString$9(pattern)) { - return pattern.split(",").includes(name2); - } else if (isRegExp$5(pattern)) { - pattern.lastIndex = 0; - return pattern.test(name2); - } - return false; -} -__name(matches$1, "matches$1"); -function onActivated(hook, target2) { - registerKeepAliveHook(hook, "a", target2); -} -__name(onActivated, "onActivated"); -function onDeactivated(hook, target2) { - registerKeepAliveHook(hook, "da", target2); -} -__name(onDeactivated, "onDeactivated"); -function registerKeepAliveHook(hook, type, target2 = currentInstance) { - const wrappedHook = hook.__wdc || (hook.__wdc = () => { - let current = target2; - while (current) { - if (current.isDeactivated) { - return; - } - current = current.parent; - } - return hook(); - }); - injectHook(type, wrappedHook, target2); - if (target2) { - let current = target2.parent; - while (current && current.parent) { - if (isKeepAlive(current.parent.vnode)) { - injectToKeepAliveRoot(wrappedHook, type, target2, current); - } - current = current.parent; - } - } -} -__name(registerKeepAliveHook, "registerKeepAliveHook"); -function injectToKeepAliveRoot(hook, type, target2, keepAliveRoot) { - const injected = injectHook( - type, - hook, - keepAliveRoot, - true - /* prepend */ - ); - onUnmounted(() => { - remove$1(keepAliveRoot[type], injected); - }, target2); -} -__name(injectToKeepAliveRoot, "injectToKeepAliveRoot"); -function resetShapeFlag(vnode) { - vnode.shapeFlag &= ~256; - vnode.shapeFlag &= ~512; -} -__name(resetShapeFlag, "resetShapeFlag"); -function getInnerChild(vnode) { - return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; -} -__name(getInnerChild, "getInnerChild"); -function injectHook(type, hook, target2 = currentInstance, prepend2 = false) { - if (target2) { - const hooks2 = target2[type] || (target2[type] = []); - const wrappedHook = hook.__weh || (hook.__weh = (...args) => { - pauseTracking(); - const reset2 = setCurrentInstance(target2); - const res = callWithAsyncErrorHandling(hook, target2, type, args); - reset2(); - resetTracking(); - return res; - }); - if (prepend2) { - hooks2.unshift(wrappedHook); - } else { - hooks2.push(wrappedHook); - } - return wrappedHook; - } else if (false) { - const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, "")); - warn$1$1( - `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` - ); - } -} -__name(injectHook, "injectHook"); -const createHook = /* @__PURE__ */ __name((lifecycle2) => (hook, target2 = currentInstance) => { - if (!isInSSRComponentSetup || lifecycle2 === "sp") { - injectHook(lifecycle2, (...args) => hook(...args), target2); - } -}, "createHook"); -const onBeforeMount = createHook("bm"); -const onMounted = createHook("m"); -const onBeforeUpdate = createHook( - "bu" -); -const onUpdated = createHook("u"); -const onBeforeUnmount = createHook( - "bum" -); -const onUnmounted = createHook("um"); -const onServerPrefetch = createHook( - "sp" -); -const onRenderTriggered = createHook("rtg"); -const onRenderTracked = createHook("rtc"); -function onErrorCaptured(hook, target2 = currentInstance) { - injectHook("ec", hook, target2); -} -__name(onErrorCaptured, "onErrorCaptured"); -const COMPONENTS = "components"; -const DIRECTIVES = "directives"; -function resolveComponent(name2, maybeSelfReference) { - return resolveAsset(COMPONENTS, name2, true, maybeSelfReference) || name2; -} -__name(resolveComponent, "resolveComponent"); -const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); -function resolveDynamicComponent(component) { - if (isString$9(component)) { - return resolveAsset(COMPONENTS, component, false) || component; - } else { - return component || NULL_DYNAMIC_COMPONENT; - } -} -__name(resolveDynamicComponent, "resolveDynamicComponent"); -function resolveDirective(name2) { - return resolveAsset(DIRECTIVES, name2); -} -__name(resolveDirective, "resolveDirective"); -function resolveAsset(type, name2, warnMissing = true, maybeSelfReference = false) { - const instance = currentRenderingInstance || currentInstance; - if (instance) { - const Component = instance.type; - if (type === COMPONENTS) { - const selfName = getComponentName( - Component, - false - ); - if (selfName && (selfName === name2 || selfName === camelize$1(name2) || selfName === capitalize$1(camelize$1(name2)))) { - return Component; - } - } - const res = ( - // local registration - // check instance[type] first which is resolved for options API - resolve(instance[type] || Component[type], name2) || // global registration - resolve(instance.appContext[type], name2) - ); - if (!res && maybeSelfReference) { - return Component; - } - if (false) { - const extra = type === COMPONENTS ? ` -If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; - warn$1$1(`Failed to resolve ${type.slice(0, -1)}: ${name2}${extra}`); - } - return res; - } else if (false) { - warn$1$1( - `resolve${capitalize$1(type.slice(0, -1))} can only be used in render() or setup().` - ); - } -} -__name(resolveAsset, "resolveAsset"); -function resolve(registry, name2) { - return registry && (registry[name2] || registry[camelize$1(name2)] || registry[capitalize$1(camelize$1(name2))]); -} -__name(resolve, "resolve"); -function renderList(source, renderItem, cache2, index2) { - let ret; - const cached = cache2 && cache2[index2]; - const sourceIsArray = isArray$9(source); - if (sourceIsArray || isString$9(source)) { - const sourceIsReactiveArray = sourceIsArray && isReactive(source); - let needsWrap = false; - if (sourceIsReactiveArray) { - needsWrap = !isShallow(source); - source = shallowReadArray(source); - } - ret = new Array(source.length); - for (let i2 = 0, l2 = source.length; i2 < l2; i2++) { - ret[i2] = renderItem( - needsWrap ? toReactive$1(source[i2]) : source[i2], - i2, - void 0, - cached && cached[i2] - ); - } - } else if (typeof source === "number") { - if (false) { - warn$1$1(`The v-for range expect an integer value but got ${source}.`); - } - ret = new Array(source); - for (let i2 = 0; i2 < source; i2++) { - ret[i2] = renderItem(i2 + 1, i2, void 0, cached && cached[i2]); - } - } else if (isObject$e(source)) { - if (source[Symbol.iterator]) { - ret = Array.from( - source, - (item3, i2) => renderItem(item3, i2, void 0, cached && cached[i2]) - ); - } else { - const keys2 = Object.keys(source); - ret = new Array(keys2.length); - for (let i2 = 0, l2 = keys2.length; i2 < l2; i2++) { - const key = keys2[i2]; - ret[i2] = renderItem(source[key], key, i2, cached && cached[i2]); - } - } - } else { - ret = []; - } - if (cache2) { - cache2[index2] = ret; - } - return ret; -} -__name(renderList, "renderList"); -function createSlots(slots, dynamicSlots) { - for (let i2 = 0; i2 < dynamicSlots.length; i2++) { - const slot = dynamicSlots[i2]; - if (isArray$9(slot)) { - for (let j2 = 0; j2 < slot.length; j2++) { - slots[slot[j2].name] = slot[j2].fn; - } - } else if (slot) { - slots[slot.name] = slot.key ? (...args) => { - const res = slot.fn(...args); - if (res) res.key = slot.key; - return res; - } : slot.fn; - } - } - return slots; -} -__name(createSlots, "createSlots"); -function renderSlot(slots, name2, props = {}, fallback, noSlotted) { - if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) { - if (name2 !== "default") props.name = name2; - return openBlock(), createBlock( - Fragment$1, - null, - [createVNode("slot", props, fallback && fallback())], - 64 - ); - } - let slot = slots[name2]; - if (false) { - warn$1$1( - `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.` - ); - slot = /* @__PURE__ */ __name(() => [], "slot"); - } - if (slot && slot._c) { - slot._d = false; - } - openBlock(); - const validSlotContent = slot && ensureValidVNode(slot(props)); - const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch - // key attached in the `createSlots` helper, respect that - validSlotContent && validSlotContent.key; - const rendered = createBlock( - Fragment$1, - { - key: (slotKey && !isSymbol$1(slotKey) ? slotKey : `_${name2}`) + // #7256 force differentiate fallback content from actual content - (!validSlotContent && fallback ? "_fb" : "") - }, - validSlotContent || (fallback ? fallback() : []), - validSlotContent && slots._ === 1 ? 64 : -2 - ); - if (!noSlotted && rendered.scopeId) { - rendered.slotScopeIds = [rendered.scopeId + "-s"]; - } - if (slot && slot._c) { - slot._d = true; - } - return rendered; -} -__name(renderSlot, "renderSlot"); -function ensureValidVNode(vnodes) { - return vnodes.some((child) => { - if (!isVNode$1(child)) return true; - if (child.type === Comment) return false; - if (child.type === Fragment$1 && !ensureValidVNode(child.children)) - return false; - return true; - }) ? vnodes : null; -} -__name(ensureValidVNode, "ensureValidVNode"); -function toHandlers(obj, preserveCaseIfNecessary) { - const ret = {}; - if (false) { - warn$1$1(`v-on with no argument expects an object value.`); - return ret; - } - for (const key in obj) { - ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key]; - } - return ret; -} -__name(toHandlers, "toHandlers"); -const getPublicInstance = /* @__PURE__ */ __name((i2) => { - if (!i2) return null; - if (isStatefulComponent(i2)) return getComponentPublicInstance(i2); - return getPublicInstance(i2.parent); -}, "getPublicInstance"); -const publicPropertiesMap = ( - // Move PURE marker to new line to workaround compiler discarding it - // due to type annotation - /* @__PURE__ */ extend$1(/* @__PURE__ */ Object.create(null), { - $: /* @__PURE__ */ __name((i2) => i2, "$"), - $el: /* @__PURE__ */ __name((i2) => i2.vnode.el, "$el"), - $data: /* @__PURE__ */ __name((i2) => i2.data, "$data"), - $props: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.props) : i2.props, "$props"), - $attrs: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.attrs) : i2.attrs, "$attrs"), - $slots: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.slots) : i2.slots, "$slots"), - $refs: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.refs) : i2.refs, "$refs"), - $parent: /* @__PURE__ */ __name((i2) => getPublicInstance(i2.parent), "$parent"), - $root: /* @__PURE__ */ __name((i2) => getPublicInstance(i2.root), "$root"), - $host: /* @__PURE__ */ __name((i2) => i2.ce, "$host"), - $emit: /* @__PURE__ */ __name((i2) => i2.emit, "$emit"), - $options: /* @__PURE__ */ __name((i2) => true ? resolveMergedOptions(i2) : i2.type, "$options"), - $forceUpdate: /* @__PURE__ */ __name((i2) => i2.f || (i2.f = () => { - queueJob(i2.update); - }), "$forceUpdate"), - $nextTick: /* @__PURE__ */ __name((i2) => i2.n || (i2.n = nextTick.bind(i2.proxy)), "$nextTick"), - $watch: /* @__PURE__ */ __name((i2) => true ? instanceWatch.bind(i2) : NOOP, "$watch") - }) -); -const isReservedPrefix = /* @__PURE__ */ __name((key) => key === "_" || key === "$", "isReservedPrefix"); -const hasSetupBinding = /* @__PURE__ */ __name((state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$3(state, key), "hasSetupBinding"); -const PublicInstanceProxyHandlers = { - get({ _: instance }, key) { - if (key === "__v_skip") { - return true; - } - const { ctx, setupState, data: data26, props, accessCache, type, appContext } = instance; - if (false) { - return true; - } - let normalizedProps; - if (key[0] !== "$") { - const n2 = accessCache[key]; - if (n2 !== void 0) { - switch (n2) { - case 1: - return setupState[key]; - case 2: - return data26[key]; - case 4: - return ctx[key]; - case 3: - return props[key]; - } - } else if (hasSetupBinding(setupState, key)) { - accessCache[key] = 1; - return setupState[key]; - } else if (data26 !== EMPTY_OBJ && hasOwn$3(data26, key)) { - accessCache[key] = 2; - return data26[key]; - } else if ( - // only cache other properties when instance has declared (thus stable) - // props - (normalizedProps = instance.propsOptions[0]) && hasOwn$3(normalizedProps, key) - ) { - accessCache[key] = 3; - return props[key]; - } else if (ctx !== EMPTY_OBJ && hasOwn$3(ctx, key)) { - accessCache[key] = 4; - return ctx[key]; - } else if (shouldCacheAccess) { - accessCache[key] = 0; - } - } - const publicGetter = publicPropertiesMap[key]; - let cssModule, globalProperties; - if (publicGetter) { - if (key === "$attrs") { - track(instance.attrs, "get", ""); - } else if (false) { - track(instance, "get", key); - } - return publicGetter(instance); - } else if ( - // css module (injected by vue-loader) - (cssModule = type.__cssModules) && (cssModule = cssModule[key]) - ) { - return cssModule; - } else if (ctx !== EMPTY_OBJ && hasOwn$3(ctx, key)) { - accessCache[key] = 4; - return ctx[key]; - } else if ( - // global properties - globalProperties = appContext.config.globalProperties, hasOwn$3(globalProperties, key) - ) { - { - return globalProperties[key]; - } - } else if (false) { - if (data26 !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$3(data26, key)) { - warn$1$1( - `Property ${JSON.stringify( - key - )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` - ); - } else if (instance === currentRenderingInstance) { - warn$1$1( - `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` - ); - } - } - }, - set({ _: instance }, key, value4) { - const { data: data26, setupState, ctx } = instance; - if (hasSetupBinding(setupState, key)) { - setupState[key] = value4; - return true; - } else if (false) { - warn$1$1(`Cannot mutate \n\n\n","export default {\n app_title: 'ComfyUI',\n app_version: __COMFYUI_FRONTEND_VERSION__\n}\n","/*!\n * shared v9.14.1\n * (c) 2024 kazuya kawaguchi\n * Released under the MIT License.\n */\n/**\n * Original Utilities\n * written by kazuya kawaguchi\n */\nconst inBrowser = typeof window !== 'undefined';\nlet mark;\nlet measure;\nif ((process.env.NODE_ENV !== 'production')) {\n const perf = inBrowser && window.performance;\n if (perf &&\n perf.mark &&\n perf.measure &&\n perf.clearMarks &&\n // @ts-ignore browser compat\n perf.clearMeasures) {\n mark = (tag) => {\n perf.mark(tag);\n };\n measure = (name, startTag, endTag) => {\n perf.measure(name, startTag, endTag);\n perf.clearMarks(startTag);\n perf.clearMarks(endTag);\n };\n }\n}\nconst RE_ARGS = /\\{([0-9a-zA-Z]+)\\}/g;\n/* eslint-disable */\nfunction format(message, ...args) {\n if (args.length === 1 && isObject(args[0])) {\n args = args[0];\n }\n if (!args || !args.hasOwnProperty) {\n args = {};\n }\n return message.replace(RE_ARGS, (match, identifier) => {\n return args.hasOwnProperty(identifier) ? args[identifier] : '';\n });\n}\nconst makeSymbol = (name, shareable = false) => !shareable ? Symbol(name) : Symbol.for(name);\nconst generateFormatCacheKey = (locale, key, source) => friendlyJSONstringify({ l: locale, k: key, s: source });\nconst friendlyJSONstringify = (json) => JSON.stringify(json)\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n .replace(/\\u0027/g, '\\\\u0027');\nconst isNumber = (val) => typeof val === 'number' && isFinite(val);\nconst isDate = (val) => toTypeString(val) === '[object Date]';\nconst isRegExp = (val) => toTypeString(val) === '[object RegExp]';\nconst isEmptyObject = (val) => isPlainObject(val) && Object.keys(val).length === 0;\nconst assign = Object.assign;\nlet _globalThis;\nconst getGlobalThis = () => {\n // prettier-ignore\n return (_globalThis ||\n (_globalThis =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {}));\n};\nfunction escapeHtml(rawText) {\n return rawText\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn(obj, key) {\n return hasOwnProperty.call(obj, key);\n}\n/* eslint-enable */\n/**\n * Useful Utilities By Evan you\n * Modified by kazuya kawaguchi\n * MIT License\n * https://github.com/vuejs/vue-next/blob/master/packages/shared/src/index.ts\n * https://github.com/vuejs/vue-next/blob/master/packages/shared/src/codeframe.ts\n */\nconst isArray = Array.isArray;\nconst isFunction = (val) => typeof val === 'function';\nconst isString = (val) => typeof val === 'string';\nconst isBoolean = (val) => typeof val === 'boolean';\nconst isSymbol = (val) => typeof val === 'symbol';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isObject = (val) => val !== null && typeof val === 'object';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isPromise = (val) => {\n return isObject(val) && isFunction(val.then) && isFunction(val.catch);\n};\nconst objectToString = Object.prototype.toString;\nconst toTypeString = (value) => objectToString.call(value);\nconst isPlainObject = (val) => {\n if (!isObject(val))\n return false;\n const proto = Object.getPrototypeOf(val);\n return proto === null || proto.constructor === Object;\n};\n// for converting list and named values to displayed strings.\nconst toDisplayString = (val) => {\n return val == null\n ? ''\n : isArray(val) || (isPlainObject(val) && val.toString === objectToString)\n ? JSON.stringify(val, null, 2)\n : String(val);\n};\nfunction join(items, separator = '') {\n return items.reduce((str, item, index) => (index === 0 ? str + item : str + separator + item), '');\n}\nconst RANGE = 2;\nfunction generateCodeFrame(source, start = 0, end = source.length) {\n const lines = source.split(/\\r?\\n/);\n let count = 0;\n const res = [];\n for (let i = 0; i < lines.length; i++) {\n count += lines[i].length + 1;\n if (count >= start) {\n for (let j = i - RANGE; j <= i + RANGE || end > count; j++) {\n if (j < 0 || j >= lines.length)\n continue;\n const line = j + 1;\n res.push(`${line}${' '.repeat(3 - String(line).length)}| ${lines[j]}`);\n const lineLength = lines[j].length;\n if (j === i) {\n // push underline\n const pad = start - (count - lineLength) + 1;\n const length = Math.max(1, end > count ? lineLength - pad : end - start);\n res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));\n }\n else if (j > i) {\n if (end > count) {\n const length = Math.max(Math.min(end - count, lineLength), 1);\n res.push(` | ` + '^'.repeat(length));\n }\n count += lineLength + 1;\n }\n }\n break;\n }\n }\n return res.join('\\n');\n}\nfunction incrementer(code) {\n let current = code;\n return () => ++current;\n}\n\nfunction warn(msg, err) {\n if (typeof console !== 'undefined') {\n console.warn(`[intlify] ` + msg);\n /* istanbul ignore if */\n if (err) {\n console.warn(err.stack);\n }\n }\n}\nconst hasWarned = {};\nfunction warnOnce(msg) {\n if (!hasWarned[msg]) {\n hasWarned[msg] = true;\n warn(msg);\n }\n}\n\n/**\n * Event emitter, forked from the below:\n * - original repository url: https://github.com/developit/mitt\n * - code url: https://github.com/developit/mitt/blob/master/src/index.ts\n * - author: Jason Miller (https://github.com/developit)\n * - license: MIT\n */\n/**\n * Create a event emitter\n *\n * @returns An event emitter\n */\nfunction createEmitter() {\n const events = new Map();\n const emitter = {\n events,\n on(event, handler) {\n const handlers = events.get(event);\n const added = handlers && handlers.push(handler);\n if (!added) {\n events.set(event, [handler]);\n }\n },\n off(event, handler) {\n const handlers = events.get(event);\n if (handlers) {\n handlers.splice(handlers.indexOf(handler) >>> 0, 1);\n }\n },\n emit(event, payload) {\n (events.get(event) || [])\n .slice()\n .map(handler => handler(payload));\n (events.get('*') || [])\n .slice()\n .map(handler => handler(event, payload));\n }\n };\n return emitter;\n}\n\nconst isNotObjectOrIsArray = (val) => !isObject(val) || isArray(val);\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\nfunction deepCopy(src, des) {\n // src and des should both be objects, and none of them can be a array\n if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {\n throw new Error('Invalid value');\n }\n const stack = [{ src, des }];\n while (stack.length) {\n const { src, des } = stack.pop();\n // using `Object.keys` which skips prototype properties\n Object.keys(src).forEach(key => {\n // if src[key] is an object/array, set des[key]\n // to empty object/array to prevent setting by reference\n if (isObject(src[key]) && !isObject(des[key])) {\n des[key] = Array.isArray(src[key]) ? [] : {};\n }\n if (isNotObjectOrIsArray(des[key]) || isNotObjectOrIsArray(src[key])) {\n // replace with src[key] when:\n // src[key] or des[key] is not an object, or\n // src[key] or des[key] is an array\n des[key] = src[key];\n }\n else {\n // src[key] and des[key] are both objects, merge them\n stack.push({ src: src[key], des: des[key] });\n }\n });\n }\n}\n\nexport { assign, createEmitter, deepCopy, escapeHtml, format, friendlyJSONstringify, generateCodeFrame, generateFormatCacheKey, getGlobalThis, hasOwn, inBrowser, incrementer, isArray, isBoolean, isDate, isEmptyObject, isFunction, isNumber, isObject, isPlainObject, isPromise, isRegExp, isString, isSymbol, join, makeSymbol, mark, measure, objectToString, toDisplayString, toTypeString, warn, warnOnce };\n","/*!\n * message-compiler v9.14.1\n * (c) 2024 kazuya kawaguchi\n * Released under the MIT License.\n */\nconst LOCATION_STUB = {\n start: { line: 1, column: 1, offset: 0 },\n end: { line: 1, column: 1, offset: 0 }\n};\nfunction createPosition(line, column, offset) {\n return { line, column, offset };\n}\nfunction createLocation(start, end, source) {\n const loc = { start, end };\n if (source != null) {\n loc.source = source;\n }\n return loc;\n}\n\n/**\n * Original Utilities\n * written by kazuya kawaguchi\n */\nconst RE_ARGS = /\\{([0-9a-zA-Z]+)\\}/g;\n/* eslint-disable */\nfunction format(message, ...args) {\n if (args.length === 1 && isObject(args[0])) {\n args = args[0];\n }\n if (!args || !args.hasOwnProperty) {\n args = {};\n }\n return message.replace(RE_ARGS, (match, identifier) => {\n return args.hasOwnProperty(identifier) ? args[identifier] : '';\n });\n}\nconst assign = Object.assign;\nconst isString = (val) => typeof val === 'string';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isObject = (val) => val !== null && typeof val === 'object';\nfunction join(items, separator = '') {\n return items.reduce((str, item, index) => (index === 0 ? str + item : str + separator + item), '');\n}\n\nconst CompileWarnCodes = {\n USE_MODULO_SYNTAX: 1,\n __EXTEND_POINT__: 2\n};\n/** @internal */\nconst warnMessages = {\n [CompileWarnCodes.USE_MODULO_SYNTAX]: `Use modulo before '{{0}}'.`\n};\nfunction createCompileWarn(code, loc, ...args) {\n const msg = format(warnMessages[code] || '', ...(args || [])) ;\n const message = { message: String(msg), code };\n if (loc) {\n message.location = loc;\n }\n return message;\n}\n\nconst CompileErrorCodes = {\n // tokenizer error codes\n EXPECTED_TOKEN: 1,\n INVALID_TOKEN_IN_PLACEHOLDER: 2,\n UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,\n UNKNOWN_ESCAPE_SEQUENCE: 4,\n INVALID_UNICODE_ESCAPE_SEQUENCE: 5,\n UNBALANCED_CLOSING_BRACE: 6,\n UNTERMINATED_CLOSING_BRACE: 7,\n EMPTY_PLACEHOLDER: 8,\n NOT_ALLOW_NEST_PLACEHOLDER: 9,\n INVALID_LINKED_FORMAT: 10,\n // parser error codes\n MUST_HAVE_MESSAGES_IN_PLURAL: 11,\n UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,\n UNEXPECTED_EMPTY_LINKED_KEY: 13,\n UNEXPECTED_LEXICAL_ANALYSIS: 14,\n // generator error codes\n UNHANDLED_CODEGEN_NODE_TYPE: 15,\n // minifier error codes\n UNHANDLED_MINIFIER_NODE_TYPE: 16,\n // Special value for higher-order compilers to pick up the last code\n // to avoid collision of error codes. This should always be kept as the last\n // item.\n __EXTEND_POINT__: 17\n};\n/** @internal */\nconst errorMessages = {\n // tokenizer error messages\n [CompileErrorCodes.EXPECTED_TOKEN]: `Expected token: '{0}'`,\n [CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]: `Invalid token in placeholder: '{0}'`,\n [CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: `Unterminated single quote in placeholder`,\n [CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]: `Unknown escape sequence: \\\\{0}`,\n [CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]: `Invalid unicode escape sequence: {0}`,\n [CompileErrorCodes.UNBALANCED_CLOSING_BRACE]: `Unbalanced closing brace`,\n [CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]: `Unterminated closing brace`,\n [CompileErrorCodes.EMPTY_PLACEHOLDER]: `Empty placeholder`,\n [CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]: `Not allowed nest placeholder`,\n [CompileErrorCodes.INVALID_LINKED_FORMAT]: `Invalid linked format`,\n // parser error messages\n [CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]: `Plural must have messages`,\n [CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]: `Unexpected empty linked modifier`,\n [CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]: `Unexpected empty linked key`,\n [CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]: `Unexpected lexical analysis in token: '{0}'`,\n // generator error messages\n [CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE]: `unhandled codegen node type: '{0}'`,\n // minimizer error messages\n [CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE]: `unhandled mimifier node type: '{0}'`\n};\nfunction createCompileError(code, loc, options = {}) {\n const { domain, messages, args } = options;\n const msg = format((messages || errorMessages)[code] || '', ...(args || []))\n ;\n const error = new SyntaxError(String(msg));\n error.code = code;\n if (loc) {\n error.location = loc;\n }\n error.domain = domain;\n return error;\n}\n/** @internal */\nfunction defaultOnError(error) {\n throw error;\n}\n\n// eslint-disable-next-line no-useless-escape\nconst RE_HTML_TAG = /<\\/?[\\w\\s=\"/.':;#-\\/]+>/;\nconst detectHtmlTag = (source) => RE_HTML_TAG.test(source);\n\nconst CHAR_SP = ' ';\nconst CHAR_CR = '\\r';\nconst CHAR_LF = '\\n';\nconst CHAR_LS = String.fromCharCode(0x2028);\nconst CHAR_PS = String.fromCharCode(0x2029);\nfunction createScanner(str) {\n const _buf = str;\n let _index = 0;\n let _line = 1;\n let _column = 1;\n let _peekOffset = 0;\n const isCRLF = (index) => _buf[index] === CHAR_CR && _buf[index + 1] === CHAR_LF;\n const isLF = (index) => _buf[index] === CHAR_LF;\n const isPS = (index) => _buf[index] === CHAR_PS;\n const isLS = (index) => _buf[index] === CHAR_LS;\n const isLineEnd = (index) => isCRLF(index) || isLF(index) || isPS(index) || isLS(index);\n const index = () => _index;\n const line = () => _line;\n const column = () => _column;\n const peekOffset = () => _peekOffset;\n const charAt = (offset) => isCRLF(offset) || isPS(offset) || isLS(offset) ? CHAR_LF : _buf[offset];\n const currentChar = () => charAt(_index);\n const currentPeek = () => charAt(_index + _peekOffset);\n function next() {\n _peekOffset = 0;\n if (isLineEnd(_index)) {\n _line++;\n _column = 0;\n }\n if (isCRLF(_index)) {\n _index++;\n }\n _index++;\n _column++;\n return _buf[_index];\n }\n function peek() {\n if (isCRLF(_index + _peekOffset)) {\n _peekOffset++;\n }\n _peekOffset++;\n return _buf[_index + _peekOffset];\n }\n function reset() {\n _index = 0;\n _line = 1;\n _column = 1;\n _peekOffset = 0;\n }\n function resetPeek(offset = 0) {\n _peekOffset = offset;\n }\n function skipToPeek() {\n const target = _index + _peekOffset;\n // eslint-disable-next-line no-unmodified-loop-condition\n while (target !== _index) {\n next();\n }\n _peekOffset = 0;\n }\n return {\n index,\n line,\n column,\n peekOffset,\n charAt,\n currentChar,\n currentPeek,\n next,\n peek,\n reset,\n resetPeek,\n skipToPeek\n };\n}\n\nconst EOF = undefined;\nconst DOT = '.';\nconst LITERAL_DELIMITER = \"'\";\nconst ERROR_DOMAIN$3 = 'tokenizer';\nfunction createTokenizer(source, options = {}) {\n const location = options.location !== false;\n const _scnr = createScanner(source);\n const currentOffset = () => _scnr.index();\n const currentPosition = () => createPosition(_scnr.line(), _scnr.column(), _scnr.index());\n const _initLoc = currentPosition();\n const _initOffset = currentOffset();\n const _context = {\n currentType: 14 /* TokenTypes.EOF */,\n offset: _initOffset,\n startLoc: _initLoc,\n endLoc: _initLoc,\n lastType: 14 /* TokenTypes.EOF */,\n lastOffset: _initOffset,\n lastStartLoc: _initLoc,\n lastEndLoc: _initLoc,\n braceNest: 0,\n inLinked: false,\n text: ''\n };\n const context = () => _context;\n const { onError } = options;\n function emitError(code, pos, offset, ...args) {\n const ctx = context();\n pos.column += offset;\n pos.offset += offset;\n if (onError) {\n const loc = location ? createLocation(ctx.startLoc, pos) : null;\n const err = createCompileError(code, loc, {\n domain: ERROR_DOMAIN$3,\n args\n });\n onError(err);\n }\n }\n function getToken(context, type, value) {\n context.endLoc = currentPosition();\n context.currentType = type;\n const token = { type };\n if (location) {\n token.loc = createLocation(context.startLoc, context.endLoc);\n }\n if (value != null) {\n token.value = value;\n }\n return token;\n }\n const getEndToken = (context) => getToken(context, 14 /* TokenTypes.EOF */);\n function eat(scnr, ch) {\n if (scnr.currentChar() === ch) {\n scnr.next();\n return ch;\n }\n else {\n emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch);\n return '';\n }\n }\n function peekSpaces(scnr) {\n let buf = '';\n while (scnr.currentPeek() === CHAR_SP || scnr.currentPeek() === CHAR_LF) {\n buf += scnr.currentPeek();\n scnr.peek();\n }\n return buf;\n }\n function skipSpaces(scnr) {\n const buf = peekSpaces(scnr);\n scnr.skipToPeek();\n return buf;\n }\n function isIdentifierStart(ch) {\n if (ch === EOF) {\n return false;\n }\n const cc = ch.charCodeAt(0);\n return ((cc >= 97 && cc <= 122) || // a-z\n (cc >= 65 && cc <= 90) || // A-Z\n cc === 95 // _\n );\n }\n function isNumberStart(ch) {\n if (ch === EOF) {\n return false;\n }\n const cc = ch.charCodeAt(0);\n return cc >= 48 && cc <= 57; // 0-9\n }\n function isNamedIdentifierStart(scnr, context) {\n const { currentType } = context;\n if (currentType !== 2 /* TokenTypes.BraceLeft */) {\n return false;\n }\n peekSpaces(scnr);\n const ret = isIdentifierStart(scnr.currentPeek());\n scnr.resetPeek();\n return ret;\n }\n function isListIdentifierStart(scnr, context) {\n const { currentType } = context;\n if (currentType !== 2 /* TokenTypes.BraceLeft */) {\n return false;\n }\n peekSpaces(scnr);\n const ch = scnr.currentPeek() === '-' ? scnr.peek() : scnr.currentPeek();\n const ret = isNumberStart(ch);\n scnr.resetPeek();\n return ret;\n }\n function isLiteralStart(scnr, context) {\n const { currentType } = context;\n if (currentType !== 2 /* TokenTypes.BraceLeft */) {\n return false;\n }\n peekSpaces(scnr);\n const ret = scnr.currentPeek() === LITERAL_DELIMITER;\n scnr.resetPeek();\n return ret;\n }\n function isLinkedDotStart(scnr, context) {\n const { currentType } = context;\n if (currentType !== 8 /* TokenTypes.LinkedAlias */) {\n return false;\n }\n peekSpaces(scnr);\n const ret = scnr.currentPeek() === \".\" /* TokenChars.LinkedDot */;\n scnr.resetPeek();\n return ret;\n }\n function isLinkedModifierStart(scnr, context) {\n const { currentType } = context;\n if (currentType !== 9 /* TokenTypes.LinkedDot */) {\n return false;\n }\n peekSpaces(scnr);\n const ret = isIdentifierStart(scnr.currentPeek());\n scnr.resetPeek();\n return ret;\n }\n function isLinkedDelimiterStart(scnr, context) {\n const { currentType } = context;\n if (!(currentType === 8 /* TokenTypes.LinkedAlias */ ||\n currentType === 12 /* TokenTypes.LinkedModifier */)) {\n return false;\n }\n peekSpaces(scnr);\n const ret = scnr.currentPeek() === \":\" /* TokenChars.LinkedDelimiter */;\n scnr.resetPeek();\n return ret;\n }\n function isLinkedReferStart(scnr, context) {\n const { currentType } = context;\n if (currentType !== 10 /* TokenTypes.LinkedDelimiter */) {\n return false;\n }\n const fn = () => {\n const ch = scnr.currentPeek();\n if (ch === \"{\" /* TokenChars.BraceLeft */) {\n return isIdentifierStart(scnr.peek());\n }\n else if (ch === \"@\" /* TokenChars.LinkedAlias */ ||\n ch === \"%\" /* TokenChars.Modulo */ ||\n ch === \"|\" /* TokenChars.Pipe */ ||\n ch === \":\" /* TokenChars.LinkedDelimiter */ ||\n ch === \".\" /* TokenChars.LinkedDot */ ||\n ch === CHAR_SP ||\n !ch) {\n return false;\n }\n else if (ch === CHAR_LF) {\n scnr.peek();\n return fn();\n }\n else {\n // other characters\n return isTextStart(scnr, false);\n }\n };\n const ret = fn();\n scnr.resetPeek();\n return ret;\n }\n function isPluralStart(scnr) {\n peekSpaces(scnr);\n const ret = scnr.currentPeek() === \"|\" /* TokenChars.Pipe */;\n scnr.resetPeek();\n return ret;\n }\n function detectModuloStart(scnr) {\n const spaces = peekSpaces(scnr);\n const ret = scnr.currentPeek() === \"%\" /* TokenChars.Modulo */ &&\n scnr.peek() === \"{\" /* TokenChars.BraceLeft */;\n scnr.resetPeek();\n return {\n isModulo: ret,\n hasSpace: spaces.length > 0\n };\n }\n function isTextStart(scnr, reset = true) {\n const fn = (hasSpace = false, prev = '', detectModulo = false) => {\n const ch = scnr.currentPeek();\n if (ch === \"{\" /* TokenChars.BraceLeft */) {\n return prev === \"%\" /* TokenChars.Modulo */ ? false : hasSpace;\n }\n else if (ch === \"@\" /* TokenChars.LinkedAlias */ || !ch) {\n return prev === \"%\" /* TokenChars.Modulo */ ? true : hasSpace;\n }\n else if (ch === \"%\" /* TokenChars.Modulo */) {\n scnr.peek();\n return fn(hasSpace, \"%\" /* TokenChars.Modulo */, true);\n }\n else if (ch === \"|\" /* TokenChars.Pipe */) {\n return prev === \"%\" /* TokenChars.Modulo */ || detectModulo\n ? true\n : !(prev === CHAR_SP || prev === CHAR_LF);\n }\n else if (ch === CHAR_SP) {\n scnr.peek();\n return fn(true, CHAR_SP, detectModulo);\n }\n else if (ch === CHAR_LF) {\n scnr.peek();\n return fn(true, CHAR_LF, detectModulo);\n }\n else {\n return true;\n }\n };\n const ret = fn();\n reset && scnr.resetPeek();\n return ret;\n }\n function takeChar(scnr, fn) {\n const ch = scnr.currentChar();\n if (ch === EOF) {\n return EOF;\n }\n if (fn(ch)) {\n scnr.next();\n return ch;\n }\n return null;\n }\n function isIdentifier(ch) {\n const cc = ch.charCodeAt(0);\n return ((cc >= 97 && cc <= 122) || // a-z\n (cc >= 65 && cc <= 90) || // A-Z\n (cc >= 48 && cc <= 57) || // 0-9\n cc === 95 || // _\n cc === 36 // $\n );\n }\n function takeIdentifierChar(scnr) {\n return takeChar(scnr, isIdentifier);\n }\n function isNamedIdentifier(ch) {\n const cc = ch.charCodeAt(0);\n return ((cc >= 97 && cc <= 122) || // a-z\n (cc >= 65 && cc <= 90) || // A-Z\n (cc >= 48 && cc <= 57) || // 0-9\n cc === 95 || // _\n cc === 36 || // $\n cc === 45 // -\n );\n }\n function takeNamedIdentifierChar(scnr) {\n return takeChar(scnr, isNamedIdentifier);\n }\n function isDigit(ch) {\n const cc = ch.charCodeAt(0);\n return cc >= 48 && cc <= 57; // 0-9\n }\n function takeDigit(scnr) {\n return takeChar(scnr, isDigit);\n }\n function isHexDigit(ch) {\n const cc = ch.charCodeAt(0);\n return ((cc >= 48 && cc <= 57) || // 0-9\n (cc >= 65 && cc <= 70) || // A-F\n (cc >= 97 && cc <= 102)); // a-f\n }\n function takeHexDigit(scnr) {\n return takeChar(scnr, isHexDigit);\n }\n function getDigits(scnr) {\n let ch = '';\n let num = '';\n while ((ch = takeDigit(scnr))) {\n num += ch;\n }\n return num;\n }\n function readModulo(scnr) {\n skipSpaces(scnr);\n const ch = scnr.currentChar();\n if (ch !== \"%\" /* TokenChars.Modulo */) {\n emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch);\n }\n scnr.next();\n return \"%\" /* TokenChars.Modulo */;\n }\n function readText(scnr) {\n let buf = '';\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const ch = scnr.currentChar();\n if (ch === \"{\" /* TokenChars.BraceLeft */ ||\n ch === \"}\" /* TokenChars.BraceRight */ ||\n ch === \"@\" /* TokenChars.LinkedAlias */ ||\n ch === \"|\" /* TokenChars.Pipe */ ||\n !ch) {\n break;\n }\n else if (ch === \"%\" /* TokenChars.Modulo */) {\n if (isTextStart(scnr)) {\n buf += ch;\n scnr.next();\n }\n else {\n break;\n }\n }\n else if (ch === CHAR_SP || ch === CHAR_LF) {\n if (isTextStart(scnr)) {\n buf += ch;\n scnr.next();\n }\n else if (isPluralStart(scnr)) {\n break;\n }\n else {\n buf += ch;\n scnr.next();\n }\n }\n else {\n buf += ch;\n scnr.next();\n }\n }\n return buf;\n }\n function readNamedIdentifier(scnr) {\n skipSpaces(scnr);\n let ch = '';\n let name = '';\n while ((ch = takeNamedIdentifierChar(scnr))) {\n name += ch;\n }\n if (scnr.currentChar() === EOF) {\n emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);\n }\n return name;\n }\n function readListIdentifier(scnr) {\n skipSpaces(scnr);\n let value = '';\n if (scnr.currentChar() === '-') {\n scnr.next();\n value += `-${getDigits(scnr)}`;\n }\n else {\n value += getDigits(scnr);\n }\n if (scnr.currentChar() === EOF) {\n emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);\n }\n return value;\n }\n function isLiteral(ch) {\n return ch !== LITERAL_DELIMITER && ch !== CHAR_LF;\n }\n function readLiteral(scnr) {\n skipSpaces(scnr);\n // eslint-disable-next-line no-useless-escape\n eat(scnr, `\\'`);\n let ch = '';\n let literal = '';\n while ((ch = takeChar(scnr, isLiteral))) {\n if (ch === '\\\\') {\n literal += readEscapeSequence(scnr);\n }\n else {\n literal += ch;\n }\n }\n const current = scnr.currentChar();\n if (current === CHAR_LF || current === EOF) {\n emitError(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, currentPosition(), 0);\n // TODO: Is it correct really?\n if (current === CHAR_LF) {\n scnr.next();\n // eslint-disable-next-line no-useless-escape\n eat(scnr, `\\'`);\n }\n return literal;\n }\n // eslint-disable-next-line no-useless-escape\n eat(scnr, `\\'`);\n return literal;\n }\n function readEscapeSequence(scnr) {\n const ch = scnr.currentChar();\n switch (ch) {\n case '\\\\':\n case `\\'`: // eslint-disable-line no-useless-escape\n scnr.next();\n return `\\\\${ch}`;\n case 'u':\n return readUnicodeEscapeSequence(scnr, ch, 4);\n case 'U':\n return readUnicodeEscapeSequence(scnr, ch, 6);\n default:\n emitError(CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE, currentPosition(), 0, ch);\n return '';\n }\n }\n function readUnicodeEscapeSequence(scnr, unicode, digits) {\n eat(scnr, unicode);\n let sequence = '';\n for (let i = 0; i < digits; i++) {\n const ch = takeHexDigit(scnr);\n if (!ch) {\n emitError(CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE, currentPosition(), 0, `\\\\${unicode}${sequence}${scnr.currentChar()}`);\n break;\n }\n sequence += ch;\n }\n return `\\\\${unicode}${sequence}`;\n }\n function isInvalidIdentifier(ch) {\n return (ch !== \"{\" /* TokenChars.BraceLeft */ &&\n ch !== \"}\" /* TokenChars.BraceRight */ &&\n ch !== CHAR_SP &&\n ch !== CHAR_LF);\n }\n function readInvalidIdentifier(scnr) {\n skipSpaces(scnr);\n let ch = '';\n let identifiers = '';\n while ((ch = takeChar(scnr, isInvalidIdentifier))) {\n identifiers += ch;\n }\n return identifiers;\n }\n function readLinkedModifier(scnr) {\n let ch = '';\n let name = '';\n while ((ch = takeIdentifierChar(scnr))) {\n name += ch;\n }\n return name;\n }\n function readLinkedRefer(scnr) {\n const fn = (buf) => {\n const ch = scnr.currentChar();\n if (ch === \"{\" /* TokenChars.BraceLeft */ ||\n ch === \"%\" /* TokenChars.Modulo */ ||\n ch === \"@\" /* TokenChars.LinkedAlias */ ||\n ch === \"|\" /* TokenChars.Pipe */ ||\n ch === \"(\" /* TokenChars.ParenLeft */ ||\n ch === \")\" /* TokenChars.ParenRight */ ||\n !ch) {\n return buf;\n }\n else if (ch === CHAR_SP) {\n return buf;\n }\n else if (ch === CHAR_LF || ch === DOT) {\n buf += ch;\n scnr.next();\n return fn(buf);\n }\n else {\n buf += ch;\n scnr.next();\n return fn(buf);\n }\n };\n return fn('');\n }\n function readPlural(scnr) {\n skipSpaces(scnr);\n const plural = eat(scnr, \"|\" /* TokenChars.Pipe */);\n skipSpaces(scnr);\n return plural;\n }\n // TODO: We need refactoring of token parsing ...\n function readTokenInPlaceholder(scnr, context) {\n let token = null;\n const ch = scnr.currentChar();\n switch (ch) {\n case \"{\" /* TokenChars.BraceLeft */:\n if (context.braceNest >= 1) {\n emitError(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER, currentPosition(), 0);\n }\n scnr.next();\n token = getToken(context, 2 /* TokenTypes.BraceLeft */, \"{\" /* TokenChars.BraceLeft */);\n skipSpaces(scnr);\n context.braceNest++;\n return token;\n case \"}\" /* TokenChars.BraceRight */:\n if (context.braceNest > 0 &&\n context.currentType === 2 /* TokenTypes.BraceLeft */) {\n emitError(CompileErrorCodes.EMPTY_PLACEHOLDER, currentPosition(), 0);\n }\n scnr.next();\n token = getToken(context, 3 /* TokenTypes.BraceRight */, \"}\" /* TokenChars.BraceRight */);\n context.braceNest--;\n context.braceNest > 0 && skipSpaces(scnr);\n if (context.inLinked && context.braceNest === 0) {\n context.inLinked = false;\n }\n return token;\n case \"@\" /* TokenChars.LinkedAlias */:\n if (context.braceNest > 0) {\n emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);\n }\n token = readTokenInLinked(scnr, context) || getEndToken(context);\n context.braceNest = 0;\n return token;\n default: {\n let validNamedIdentifier = true;\n let validListIdentifier = true;\n let validLiteral = true;\n if (isPluralStart(scnr)) {\n if (context.braceNest > 0) {\n emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);\n }\n token = getToken(context, 1 /* TokenTypes.Pipe */, readPlural(scnr));\n // reset\n context.braceNest = 0;\n context.inLinked = false;\n return token;\n }\n if (context.braceNest > 0 &&\n (context.currentType === 5 /* TokenTypes.Named */ ||\n context.currentType === 6 /* TokenTypes.List */ ||\n context.currentType === 7 /* TokenTypes.Literal */)) {\n emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);\n context.braceNest = 0;\n return readToken(scnr, context);\n }\n if ((validNamedIdentifier = isNamedIdentifierStart(scnr, context))) {\n token = getToken(context, 5 /* TokenTypes.Named */, readNamedIdentifier(scnr));\n skipSpaces(scnr);\n return token;\n }\n if ((validListIdentifier = isListIdentifierStart(scnr, context))) {\n token = getToken(context, 6 /* TokenTypes.List */, readListIdentifier(scnr));\n skipSpaces(scnr);\n return token;\n }\n if ((validLiteral = isLiteralStart(scnr, context))) {\n token = getToken(context, 7 /* TokenTypes.Literal */, readLiteral(scnr));\n skipSpaces(scnr);\n return token;\n }\n if (!validNamedIdentifier && !validListIdentifier && !validLiteral) {\n // TODO: we should be re-designed invalid cases, when we will extend message syntax near the future ...\n token = getToken(context, 13 /* TokenTypes.InvalidPlace */, readInvalidIdentifier(scnr));\n emitError(CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER, currentPosition(), 0, token.value);\n skipSpaces(scnr);\n return token;\n }\n break;\n }\n }\n return token;\n }\n // TODO: We need refactoring of token parsing ...\n function readTokenInLinked(scnr, context) {\n const { currentType } = context;\n let token = null;\n const ch = scnr.currentChar();\n if ((currentType === 8 /* TokenTypes.LinkedAlias */ ||\n currentType === 9 /* TokenTypes.LinkedDot */ ||\n currentType === 12 /* TokenTypes.LinkedModifier */ ||\n currentType === 10 /* TokenTypes.LinkedDelimiter */) &&\n (ch === CHAR_LF || ch === CHAR_SP)) {\n emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);\n }\n switch (ch) {\n case \"@\" /* TokenChars.LinkedAlias */:\n scnr.next();\n token = getToken(context, 8 /* TokenTypes.LinkedAlias */, \"@\" /* TokenChars.LinkedAlias */);\n context.inLinked = true;\n return token;\n case \".\" /* TokenChars.LinkedDot */:\n skipSpaces(scnr);\n scnr.next();\n return getToken(context, 9 /* TokenTypes.LinkedDot */, \".\" /* TokenChars.LinkedDot */);\n case \":\" /* TokenChars.LinkedDelimiter */:\n skipSpaces(scnr);\n scnr.next();\n return getToken(context, 10 /* TokenTypes.LinkedDelimiter */, \":\" /* TokenChars.LinkedDelimiter */);\n default:\n if (isPluralStart(scnr)) {\n token = getToken(context, 1 /* TokenTypes.Pipe */, readPlural(scnr));\n // reset\n context.braceNest = 0;\n context.inLinked = false;\n return token;\n }\n if (isLinkedDotStart(scnr, context) ||\n isLinkedDelimiterStart(scnr, context)) {\n skipSpaces(scnr);\n return readTokenInLinked(scnr, context);\n }\n if (isLinkedModifierStart(scnr, context)) {\n skipSpaces(scnr);\n return getToken(context, 12 /* TokenTypes.LinkedModifier */, readLinkedModifier(scnr));\n }\n if (isLinkedReferStart(scnr, context)) {\n skipSpaces(scnr);\n if (ch === \"{\" /* TokenChars.BraceLeft */) {\n // scan the placeholder\n return readTokenInPlaceholder(scnr, context) || token;\n }\n else {\n return getToken(context, 11 /* TokenTypes.LinkedKey */, readLinkedRefer(scnr));\n }\n }\n if (currentType === 8 /* TokenTypes.LinkedAlias */) {\n emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);\n }\n context.braceNest = 0;\n context.inLinked = false;\n return readToken(scnr, context);\n }\n }\n // TODO: We need refactoring of token parsing ...\n function readToken(scnr, context) {\n let token = { type: 14 /* TokenTypes.EOF */ };\n if (context.braceNest > 0) {\n return readTokenInPlaceholder(scnr, context) || getEndToken(context);\n }\n if (context.inLinked) {\n return readTokenInLinked(scnr, context) || getEndToken(context);\n }\n const ch = scnr.currentChar();\n switch (ch) {\n case \"{\" /* TokenChars.BraceLeft */:\n return readTokenInPlaceholder(scnr, context) || getEndToken(context);\n case \"}\" /* TokenChars.BraceRight */:\n emitError(CompileErrorCodes.UNBALANCED_CLOSING_BRACE, currentPosition(), 0);\n scnr.next();\n return getToken(context, 3 /* TokenTypes.BraceRight */, \"}\" /* TokenChars.BraceRight */);\n case \"@\" /* TokenChars.LinkedAlias */:\n return readTokenInLinked(scnr, context) || getEndToken(context);\n default: {\n if (isPluralStart(scnr)) {\n token = getToken(context, 1 /* TokenTypes.Pipe */, readPlural(scnr));\n // reset\n context.braceNest = 0;\n context.inLinked = false;\n return token;\n }\n const { isModulo, hasSpace } = detectModuloStart(scnr);\n if (isModulo) {\n return hasSpace\n ? getToken(context, 0 /* TokenTypes.Text */, readText(scnr))\n : getToken(context, 4 /* TokenTypes.Modulo */, readModulo(scnr));\n }\n if (isTextStart(scnr)) {\n return getToken(context, 0 /* TokenTypes.Text */, readText(scnr));\n }\n break;\n }\n }\n return token;\n }\n function nextToken() {\n const { currentType, offset, startLoc, endLoc } = _context;\n _context.lastType = currentType;\n _context.lastOffset = offset;\n _context.lastStartLoc = startLoc;\n _context.lastEndLoc = endLoc;\n _context.offset = currentOffset();\n _context.startLoc = currentPosition();\n if (_scnr.currentChar() === EOF) {\n return getToken(_context, 14 /* TokenTypes.EOF */);\n }\n return readToken(_scnr, _context);\n }\n return {\n nextToken,\n currentOffset,\n currentPosition,\n context\n };\n}\n\nconst ERROR_DOMAIN$2 = 'parser';\n// Backslash backslash, backslash quote, uHHHH, UHHHHHH.\nconst KNOWN_ESCAPES = /(?:\\\\\\\\|\\\\'|\\\\u([0-9a-fA-F]{4})|\\\\U([0-9a-fA-F]{6}))/g;\nfunction fromEscapeSequence(match, codePoint4, codePoint6) {\n switch (match) {\n case `\\\\\\\\`:\n return `\\\\`;\n // eslint-disable-next-line no-useless-escape\n case `\\\\\\'`:\n // eslint-disable-next-line no-useless-escape\n return `\\'`;\n default: {\n const codePoint = parseInt(codePoint4 || codePoint6, 16);\n if (codePoint <= 0xd7ff || codePoint >= 0xe000) {\n return String.fromCodePoint(codePoint);\n }\n // invalid ...\n // Replace them with U+FFFD REPLACEMENT CHARACTER.\n return '�';\n }\n }\n}\nfunction createParser(options = {}) {\n const location = options.location !== false;\n const { onError, onWarn } = options;\n function emitError(tokenzer, code, start, offset, ...args) {\n const end = tokenzer.currentPosition();\n end.offset += offset;\n end.column += offset;\n if (onError) {\n const loc = location ? createLocation(start, end) : null;\n const err = createCompileError(code, loc, {\n domain: ERROR_DOMAIN$2,\n args\n });\n onError(err);\n }\n }\n function emitWarn(tokenzer, code, start, offset, ...args) {\n const end = tokenzer.currentPosition();\n end.offset += offset;\n end.column += offset;\n if (onWarn) {\n const loc = location ? createLocation(start, end) : null;\n onWarn(createCompileWarn(code, loc, args));\n }\n }\n function startNode(type, offset, loc) {\n const node = { type };\n if (location) {\n node.start = offset;\n node.end = offset;\n node.loc = { start: loc, end: loc };\n }\n return node;\n }\n function endNode(node, offset, pos, type) {\n if (type) {\n node.type = type;\n }\n if (location) {\n node.end = offset;\n if (node.loc) {\n node.loc.end = pos;\n }\n }\n }\n function parseText(tokenizer, value) {\n const context = tokenizer.context();\n const node = startNode(3 /* NodeTypes.Text */, context.offset, context.startLoc);\n node.value = value;\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\n return node;\n }\n function parseList(tokenizer, index) {\n const context = tokenizer.context();\n const { lastOffset: offset, lastStartLoc: loc } = context; // get brace left loc\n const node = startNode(5 /* NodeTypes.List */, offset, loc);\n node.index = parseInt(index, 10);\n tokenizer.nextToken(); // skip brach right\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\n return node;\n }\n function parseNamed(tokenizer, key, modulo) {\n const context = tokenizer.context();\n const { lastOffset: offset, lastStartLoc: loc } = context; // get brace left loc\n const node = startNode(4 /* NodeTypes.Named */, offset, loc);\n node.key = key;\n if (modulo === true) {\n node.modulo = true;\n }\n tokenizer.nextToken(); // skip brach right\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\n return node;\n }\n function parseLiteral(tokenizer, value) {\n const context = tokenizer.context();\n const { lastOffset: offset, lastStartLoc: loc } = context; // get brace left loc\n const node = startNode(9 /* NodeTypes.Literal */, offset, loc);\n node.value = value.replace(KNOWN_ESCAPES, fromEscapeSequence);\n tokenizer.nextToken(); // skip brach right\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\n return node;\n }\n function parseLinkedModifier(tokenizer) {\n const token = tokenizer.nextToken();\n const context = tokenizer.context();\n const { lastOffset: offset, lastStartLoc: loc } = context; // get linked dot loc\n const node = startNode(8 /* NodeTypes.LinkedModifier */, offset, loc);\n if (token.type !== 12 /* TokenTypes.LinkedModifier */) {\n // empty modifier\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER, context.lastStartLoc, 0);\n node.value = '';\n endNode(node, offset, loc);\n return {\n nextConsumeToken: token,\n node\n };\n }\n // check token\n if (token.value == null) {\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));\n }\n node.value = token.value || '';\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\n return {\n node\n };\n }\n function parseLinkedKey(tokenizer, value) {\n const context = tokenizer.context();\n const node = startNode(7 /* NodeTypes.LinkedKey */, context.offset, context.startLoc);\n node.value = value;\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\n return node;\n }\n function parseLinked(tokenizer) {\n const context = tokenizer.context();\n const linkedNode = startNode(6 /* NodeTypes.Linked */, context.offset, context.startLoc);\n let token = tokenizer.nextToken();\n if (token.type === 9 /* TokenTypes.LinkedDot */) {\n const parsed = parseLinkedModifier(tokenizer);\n linkedNode.modifier = parsed.node;\n token = parsed.nextConsumeToken || tokenizer.nextToken();\n }\n // asset check token\n if (token.type !== 10 /* TokenTypes.LinkedDelimiter */) {\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));\n }\n token = tokenizer.nextToken();\n // skip brace left\n if (token.type === 2 /* TokenTypes.BraceLeft */) {\n token = tokenizer.nextToken();\n }\n switch (token.type) {\n case 11 /* TokenTypes.LinkedKey */:\n if (token.value == null) {\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));\n }\n linkedNode.key = parseLinkedKey(tokenizer, token.value || '');\n break;\n case 5 /* TokenTypes.Named */:\n if (token.value == null) {\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));\n }\n linkedNode.key = parseNamed(tokenizer, token.value || '');\n break;\n case 6 /* TokenTypes.List */:\n if (token.value == null) {\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));\n }\n linkedNode.key = parseList(tokenizer, token.value || '');\n break;\n case 7 /* TokenTypes.Literal */:\n if (token.value == null) {\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));\n }\n linkedNode.key = parseLiteral(tokenizer, token.value || '');\n break;\n default: {\n // empty key\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY, context.lastStartLoc, 0);\n const nextContext = tokenizer.context();\n const emptyLinkedKeyNode = startNode(7 /* NodeTypes.LinkedKey */, nextContext.offset, nextContext.startLoc);\n emptyLinkedKeyNode.value = '';\n endNode(emptyLinkedKeyNode, nextContext.offset, nextContext.startLoc);\n linkedNode.key = emptyLinkedKeyNode;\n endNode(linkedNode, nextContext.offset, nextContext.startLoc);\n return {\n nextConsumeToken: token,\n node: linkedNode\n };\n }\n }\n endNode(linkedNode, tokenizer.currentOffset(), tokenizer.currentPosition());\n return {\n node: linkedNode\n };\n }\n function parseMessage(tokenizer) {\n const context = tokenizer.context();\n const startOffset = context.currentType === 1 /* TokenTypes.Pipe */\n ? tokenizer.currentOffset()\n : context.offset;\n const startLoc = context.currentType === 1 /* TokenTypes.Pipe */\n ? context.endLoc\n : context.startLoc;\n const node = startNode(2 /* NodeTypes.Message */, startOffset, startLoc);\n node.items = [];\n let nextToken = null;\n let modulo = null;\n do {\n const token = nextToken || tokenizer.nextToken();\n nextToken = null;\n switch (token.type) {\n case 0 /* TokenTypes.Text */:\n if (token.value == null) {\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));\n }\n node.items.push(parseText(tokenizer, token.value || ''));\n break;\n case 6 /* TokenTypes.List */:\n if (token.value == null) {\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));\n }\n node.items.push(parseList(tokenizer, token.value || ''));\n break;\n case 4 /* TokenTypes.Modulo */:\n modulo = true;\n break;\n case 5 /* TokenTypes.Named */:\n if (token.value == null) {\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));\n }\n node.items.push(parseNamed(tokenizer, token.value || '', !!modulo));\n if (modulo) {\n emitWarn(tokenizer, CompileWarnCodes.USE_MODULO_SYNTAX, context.lastStartLoc, 0, getTokenCaption(token));\n modulo = null;\n }\n break;\n case 7 /* TokenTypes.Literal */:\n if (token.value == null) {\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));\n }\n node.items.push(parseLiteral(tokenizer, token.value || ''));\n break;\n case 8 /* TokenTypes.LinkedAlias */: {\n const parsed = parseLinked(tokenizer);\n node.items.push(parsed.node);\n nextToken = parsed.nextConsumeToken || null;\n break;\n }\n }\n } while (context.currentType !== 14 /* TokenTypes.EOF */ &&\n context.currentType !== 1 /* TokenTypes.Pipe */);\n // adjust message node loc\n const endOffset = context.currentType === 1 /* TokenTypes.Pipe */\n ? context.lastOffset\n : tokenizer.currentOffset();\n const endLoc = context.currentType === 1 /* TokenTypes.Pipe */\n ? context.lastEndLoc\n : tokenizer.currentPosition();\n endNode(node, endOffset, endLoc);\n return node;\n }\n function parsePlural(tokenizer, offset, loc, msgNode) {\n const context = tokenizer.context();\n let hasEmptyMessage = msgNode.items.length === 0;\n const node = startNode(1 /* NodeTypes.Plural */, offset, loc);\n node.cases = [];\n node.cases.push(msgNode);\n do {\n const msg = parseMessage(tokenizer);\n if (!hasEmptyMessage) {\n hasEmptyMessage = msg.items.length === 0;\n }\n node.cases.push(msg);\n } while (context.currentType !== 14 /* TokenTypes.EOF */);\n if (hasEmptyMessage) {\n emitError(tokenizer, CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL, loc, 0);\n }\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\n return node;\n }\n function parseResource(tokenizer) {\n const context = tokenizer.context();\n const { offset, startLoc } = context;\n const msgNode = parseMessage(tokenizer);\n if (context.currentType === 14 /* TokenTypes.EOF */) {\n return msgNode;\n }\n else {\n return parsePlural(tokenizer, offset, startLoc, msgNode);\n }\n }\n function parse(source) {\n const tokenizer = createTokenizer(source, assign({}, options));\n const context = tokenizer.context();\n const node = startNode(0 /* NodeTypes.Resource */, context.offset, context.startLoc);\n if (location && node.loc) {\n node.loc.source = source;\n }\n node.body = parseResource(tokenizer);\n if (options.onCacheKey) {\n node.cacheKey = options.onCacheKey(source);\n }\n // assert whether achieved to EOF\n if (context.currentType !== 14 /* TokenTypes.EOF */) {\n emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, source[context.offset] || '');\n }\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\n return node;\n }\n return { parse };\n}\nfunction getTokenCaption(token) {\n if (token.type === 14 /* TokenTypes.EOF */) {\n return 'EOF';\n }\n const name = (token.value || '').replace(/\\r?\\n/gu, '\\\\n');\n return name.length > 10 ? name.slice(0, 9) + '…' : name;\n}\n\nfunction createTransformer(ast, options = {} // eslint-disable-line\n) {\n const _context = {\n ast,\n helpers: new Set()\n };\n const context = () => _context;\n const helper = (name) => {\n _context.helpers.add(name);\n return name;\n };\n return { context, helper };\n}\nfunction traverseNodes(nodes, transformer) {\n for (let i = 0; i < nodes.length; i++) {\n traverseNode(nodes[i], transformer);\n }\n}\nfunction traverseNode(node, transformer) {\n // TODO: if we need pre-hook of transform, should be implemented to here\n switch (node.type) {\n case 1 /* NodeTypes.Plural */:\n traverseNodes(node.cases, transformer);\n transformer.helper(\"plural\" /* HelperNameMap.PLURAL */);\n break;\n case 2 /* NodeTypes.Message */:\n traverseNodes(node.items, transformer);\n break;\n case 6 /* NodeTypes.Linked */: {\n const linked = node;\n traverseNode(linked.key, transformer);\n transformer.helper(\"linked\" /* HelperNameMap.LINKED */);\n transformer.helper(\"type\" /* HelperNameMap.TYPE */);\n break;\n }\n case 5 /* NodeTypes.List */:\n transformer.helper(\"interpolate\" /* HelperNameMap.INTERPOLATE */);\n transformer.helper(\"list\" /* HelperNameMap.LIST */);\n break;\n case 4 /* NodeTypes.Named */:\n transformer.helper(\"interpolate\" /* HelperNameMap.INTERPOLATE */);\n transformer.helper(\"named\" /* HelperNameMap.NAMED */);\n break;\n }\n // TODO: if we need post-hook of transform, should be implemented to here\n}\n// transform AST\nfunction transform(ast, options = {} // eslint-disable-line\n) {\n const transformer = createTransformer(ast);\n transformer.helper(\"normalize\" /* HelperNameMap.NORMALIZE */);\n // traverse\n ast.body && traverseNode(ast.body, transformer);\n // set meta information\n const context = transformer.context();\n ast.helpers = Array.from(context.helpers);\n}\n\nfunction optimize(ast) {\n const body = ast.body;\n if (body.type === 2 /* NodeTypes.Message */) {\n optimizeMessageNode(body);\n }\n else {\n body.cases.forEach(c => optimizeMessageNode(c));\n }\n return ast;\n}\nfunction optimizeMessageNode(message) {\n if (message.items.length === 1) {\n const item = message.items[0];\n if (item.type === 3 /* NodeTypes.Text */ || item.type === 9 /* NodeTypes.Literal */) {\n message.static = item.value;\n delete item.value; // optimization for size\n }\n }\n else {\n const values = [];\n for (let i = 0; i < message.items.length; i++) {\n const item = message.items[i];\n if (!(item.type === 3 /* NodeTypes.Text */ || item.type === 9 /* NodeTypes.Literal */)) {\n break;\n }\n if (item.value == null) {\n break;\n }\n values.push(item.value);\n }\n if (values.length === message.items.length) {\n message.static = join(values);\n for (let i = 0; i < message.items.length; i++) {\n const item = message.items[i];\n if (item.type === 3 /* NodeTypes.Text */ || item.type === 9 /* NodeTypes.Literal */) {\n delete item.value; // optimization for size\n }\n }\n }\n }\n}\n\nconst ERROR_DOMAIN$1 = 'minifier';\n/* eslint-disable @typescript-eslint/no-explicit-any */\nfunction minify(node) {\n node.t = node.type;\n switch (node.type) {\n case 0 /* NodeTypes.Resource */: {\n const resource = node;\n minify(resource.body);\n resource.b = resource.body;\n delete resource.body;\n break;\n }\n case 1 /* NodeTypes.Plural */: {\n const plural = node;\n const cases = plural.cases;\n for (let i = 0; i < cases.length; i++) {\n minify(cases[i]);\n }\n plural.c = cases;\n delete plural.cases;\n break;\n }\n case 2 /* NodeTypes.Message */: {\n const message = node;\n const items = message.items;\n for (let i = 0; i < items.length; i++) {\n minify(items[i]);\n }\n message.i = items;\n delete message.items;\n if (message.static) {\n message.s = message.static;\n delete message.static;\n }\n break;\n }\n case 3 /* NodeTypes.Text */:\n case 9 /* NodeTypes.Literal */:\n case 8 /* NodeTypes.LinkedModifier */:\n case 7 /* NodeTypes.LinkedKey */: {\n const valueNode = node;\n if (valueNode.value) {\n valueNode.v = valueNode.value;\n delete valueNode.value;\n }\n break;\n }\n case 6 /* NodeTypes.Linked */: {\n const linked = node;\n minify(linked.key);\n linked.k = linked.key;\n delete linked.key;\n if (linked.modifier) {\n minify(linked.modifier);\n linked.m = linked.modifier;\n delete linked.modifier;\n }\n break;\n }\n case 5 /* NodeTypes.List */: {\n const list = node;\n list.i = list.index;\n delete list.index;\n break;\n }\n case 4 /* NodeTypes.Named */: {\n const named = node;\n named.k = named.key;\n delete named.key;\n break;\n }\n default:\n {\n throw createCompileError(CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE, null, {\n domain: ERROR_DOMAIN$1,\n args: [node.type]\n });\n }\n }\n delete node.type;\n}\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\n// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// \nconst ERROR_DOMAIN = 'parser';\nfunction createCodeGenerator(ast, options) {\n const { sourceMap, filename, breakLineCode, needIndent: _needIndent } = options;\n const location = options.location !== false;\n const _context = {\n filename,\n code: '',\n column: 1,\n line: 1,\n offset: 0,\n map: undefined,\n breakLineCode,\n needIndent: _needIndent,\n indentLevel: 0\n };\n if (location && ast.loc) {\n _context.source = ast.loc.source;\n }\n const context = () => _context;\n function push(code, node) {\n _context.code += code;\n }\n function _newline(n, withBreakLine = true) {\n const _breakLineCode = withBreakLine ? breakLineCode : '';\n push(_needIndent ? _breakLineCode + ` `.repeat(n) : _breakLineCode);\n }\n function indent(withNewLine = true) {\n const level = ++_context.indentLevel;\n withNewLine && _newline(level);\n }\n function deindent(withNewLine = true) {\n const level = --_context.indentLevel;\n withNewLine && _newline(level);\n }\n function newline() {\n _newline(_context.indentLevel);\n }\n const helper = (key) => `_${key}`;\n const needIndent = () => _context.needIndent;\n return {\n context,\n push,\n indent,\n deindent,\n newline,\n helper,\n needIndent\n };\n}\nfunction generateLinkedNode(generator, node) {\n const { helper } = generator;\n generator.push(`${helper(\"linked\" /* HelperNameMap.LINKED */)}(`);\n generateNode(generator, node.key);\n if (node.modifier) {\n generator.push(`, `);\n generateNode(generator, node.modifier);\n generator.push(`, _type`);\n }\n else {\n generator.push(`, undefined, _type`);\n }\n generator.push(`)`);\n}\nfunction generateMessageNode(generator, node) {\n const { helper, needIndent } = generator;\n generator.push(`${helper(\"normalize\" /* HelperNameMap.NORMALIZE */)}([`);\n generator.indent(needIndent());\n const length = node.items.length;\n for (let i = 0; i < length; i++) {\n generateNode(generator, node.items[i]);\n if (i === length - 1) {\n break;\n }\n generator.push(', ');\n }\n generator.deindent(needIndent());\n generator.push('])');\n}\nfunction generatePluralNode(generator, node) {\n const { helper, needIndent } = generator;\n if (node.cases.length > 1) {\n generator.push(`${helper(\"plural\" /* HelperNameMap.PLURAL */)}([`);\n generator.indent(needIndent());\n const length = node.cases.length;\n for (let i = 0; i < length; i++) {\n generateNode(generator, node.cases[i]);\n if (i === length - 1) {\n break;\n }\n generator.push(', ');\n }\n generator.deindent(needIndent());\n generator.push(`])`);\n }\n}\nfunction generateResource(generator, node) {\n if (node.body) {\n generateNode(generator, node.body);\n }\n else {\n generator.push('null');\n }\n}\nfunction generateNode(generator, node) {\n const { helper } = generator;\n switch (node.type) {\n case 0 /* NodeTypes.Resource */:\n generateResource(generator, node);\n break;\n case 1 /* NodeTypes.Plural */:\n generatePluralNode(generator, node);\n break;\n case 2 /* NodeTypes.Message */:\n generateMessageNode(generator, node);\n break;\n case 6 /* NodeTypes.Linked */:\n generateLinkedNode(generator, node);\n break;\n case 8 /* NodeTypes.LinkedModifier */:\n generator.push(JSON.stringify(node.value), node);\n break;\n case 7 /* NodeTypes.LinkedKey */:\n generator.push(JSON.stringify(node.value), node);\n break;\n case 5 /* NodeTypes.List */:\n generator.push(`${helper(\"interpolate\" /* HelperNameMap.INTERPOLATE */)}(${helper(\"list\" /* HelperNameMap.LIST */)}(${node.index}))`, node);\n break;\n case 4 /* NodeTypes.Named */:\n generator.push(`${helper(\"interpolate\" /* HelperNameMap.INTERPOLATE */)}(${helper(\"named\" /* HelperNameMap.NAMED */)}(${JSON.stringify(node.key)}))`, node);\n break;\n case 9 /* NodeTypes.Literal */:\n generator.push(JSON.stringify(node.value), node);\n break;\n case 3 /* NodeTypes.Text */:\n generator.push(JSON.stringify(node.value), node);\n break;\n default:\n {\n throw createCompileError(CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE, null, {\n domain: ERROR_DOMAIN,\n args: [node.type]\n });\n }\n }\n}\n// generate code from AST\nconst generate = (ast, options = {} // eslint-disable-line\n) => {\n const mode = isString(options.mode) ? options.mode : 'normal';\n const filename = isString(options.filename)\n ? options.filename\n : 'message.intl';\n const sourceMap = !!options.sourceMap;\n // prettier-ignore\n const breakLineCode = options.breakLineCode != null\n ? options.breakLineCode\n : mode === 'arrow'\n ? ';'\n : '\\n';\n const needIndent = options.needIndent ? options.needIndent : mode !== 'arrow';\n const helpers = ast.helpers || [];\n const generator = createCodeGenerator(ast, {\n mode,\n filename,\n sourceMap,\n breakLineCode,\n needIndent\n });\n generator.push(mode === 'normal' ? `function __msg__ (ctx) {` : `(ctx) => {`);\n generator.indent(needIndent);\n if (helpers.length > 0) {\n generator.push(`const { ${join(helpers.map(s => `${s}: _${s}`), ', ')} } = ctx`);\n generator.newline();\n }\n generator.push(`return `);\n generateNode(generator, ast);\n generator.deindent(needIndent);\n generator.push(`}`);\n delete ast.helpers;\n const { code, map } = generator.context();\n return {\n ast,\n code,\n map: map ? map.toJSON() : undefined // eslint-disable-line @typescript-eslint/no-explicit-any\n };\n};\n\nfunction baseCompile(source, options = {}) {\n const assignedOptions = assign({}, options);\n const jit = !!assignedOptions.jit;\n const enalbeMinify = !!assignedOptions.minify;\n const enambeOptimize = assignedOptions.optimize == null ? true : assignedOptions.optimize;\n // parse source codes\n const parser = createParser(assignedOptions);\n const ast = parser.parse(source);\n if (!jit) {\n // transform ASTs\n transform(ast, assignedOptions);\n // generate javascript codes\n return generate(ast, assignedOptions);\n }\n else {\n // optimize ASTs\n enambeOptimize && optimize(ast);\n // minimize ASTs\n enalbeMinify && minify(ast);\n // In JIT mode, no ast transform, no code generation.\n return { ast, code: '' };\n }\n}\n\nexport { CompileErrorCodes, CompileWarnCodes, ERROR_DOMAIN$2 as ERROR_DOMAIN, LOCATION_STUB, baseCompile, createCompileError, createCompileWarn, createLocation, createParser, createPosition, defaultOnError, detectHtmlTag, errorMessages, warnMessages };\n","/*!\n * core-base v9.14.1\n * (c) 2024 kazuya kawaguchi\n * Released under the MIT License.\n */\nimport { getGlobalThis, isObject, isFunction, isString, isNumber, isPlainObject, assign, join, toDisplayString, isArray, incrementer, format as format$1, isPromise, isBoolean, warn, isRegExp, warnOnce, escapeHtml, inBrowser, mark, measure, isEmptyObject, generateCodeFrame, generateFormatCacheKey, isDate } from '@intlify/shared';\nimport { CompileWarnCodes, CompileErrorCodes, createCompileError, detectHtmlTag, defaultOnError, baseCompile as baseCompile$1 } from '@intlify/message-compiler';\nexport { CompileErrorCodes, createCompileError } from '@intlify/message-compiler';\n\n/**\n * This is only called in esm-bundler builds.\n * istanbul-ignore-next\n */\nfunction initFeatureFlags() {\n if (typeof __INTLIFY_PROD_DEVTOOLS__ !== 'boolean') {\n getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;\n }\n if (typeof __INTLIFY_JIT_COMPILATION__ !== 'boolean') {\n getGlobalThis().__INTLIFY_JIT_COMPILATION__ = false;\n }\n if (typeof __INTLIFY_DROP_MESSAGE_COMPILER__ !== 'boolean') {\n getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__ = false;\n }\n}\n\nconst pathStateMachine = [];\npathStateMachine[0 /* States.BEFORE_PATH */] = {\n [\"w\" /* PathCharTypes.WORKSPACE */]: [0 /* States.BEFORE_PATH */],\n [\"i\" /* PathCharTypes.IDENT */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],\n [\"[\" /* PathCharTypes.LEFT_BRACKET */]: [4 /* States.IN_SUB_PATH */],\n [\"o\" /* PathCharTypes.END_OF_FAIL */]: [7 /* States.AFTER_PATH */]\n};\npathStateMachine[1 /* States.IN_PATH */] = {\n [\"w\" /* PathCharTypes.WORKSPACE */]: [1 /* States.IN_PATH */],\n [\".\" /* PathCharTypes.DOT */]: [2 /* States.BEFORE_IDENT */],\n [\"[\" /* PathCharTypes.LEFT_BRACKET */]: [4 /* States.IN_SUB_PATH */],\n [\"o\" /* PathCharTypes.END_OF_FAIL */]: [7 /* States.AFTER_PATH */]\n};\npathStateMachine[2 /* States.BEFORE_IDENT */] = {\n [\"w\" /* PathCharTypes.WORKSPACE */]: [2 /* States.BEFORE_IDENT */],\n [\"i\" /* PathCharTypes.IDENT */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],\n [\"0\" /* PathCharTypes.ZERO */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */]\n};\npathStateMachine[3 /* States.IN_IDENT */] = {\n [\"i\" /* PathCharTypes.IDENT */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],\n [\"0\" /* PathCharTypes.ZERO */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],\n [\"w\" /* PathCharTypes.WORKSPACE */]: [1 /* States.IN_PATH */, 1 /* Actions.PUSH */],\n [\".\" /* PathCharTypes.DOT */]: [2 /* States.BEFORE_IDENT */, 1 /* Actions.PUSH */],\n [\"[\" /* PathCharTypes.LEFT_BRACKET */]: [4 /* States.IN_SUB_PATH */, 1 /* Actions.PUSH */],\n [\"o\" /* PathCharTypes.END_OF_FAIL */]: [7 /* States.AFTER_PATH */, 1 /* Actions.PUSH */]\n};\npathStateMachine[4 /* States.IN_SUB_PATH */] = {\n [\"'\" /* PathCharTypes.SINGLE_QUOTE */]: [5 /* States.IN_SINGLE_QUOTE */, 0 /* Actions.APPEND */],\n [\"\\\"\" /* PathCharTypes.DOUBLE_QUOTE */]: [6 /* States.IN_DOUBLE_QUOTE */, 0 /* Actions.APPEND */],\n [\"[\" /* PathCharTypes.LEFT_BRACKET */]: [\n 4 /* States.IN_SUB_PATH */,\n 2 /* Actions.INC_SUB_PATH_DEPTH */\n ],\n [\"]\" /* PathCharTypes.RIGHT_BRACKET */]: [1 /* States.IN_PATH */, 3 /* Actions.PUSH_SUB_PATH */],\n [\"o\" /* PathCharTypes.END_OF_FAIL */]: 8 /* States.ERROR */,\n [\"l\" /* PathCharTypes.ELSE */]: [4 /* States.IN_SUB_PATH */, 0 /* Actions.APPEND */]\n};\npathStateMachine[5 /* States.IN_SINGLE_QUOTE */] = {\n [\"'\" /* PathCharTypes.SINGLE_QUOTE */]: [4 /* States.IN_SUB_PATH */, 0 /* Actions.APPEND */],\n [\"o\" /* PathCharTypes.END_OF_FAIL */]: 8 /* States.ERROR */,\n [\"l\" /* PathCharTypes.ELSE */]: [5 /* States.IN_SINGLE_QUOTE */, 0 /* Actions.APPEND */]\n};\npathStateMachine[6 /* States.IN_DOUBLE_QUOTE */] = {\n [\"\\\"\" /* PathCharTypes.DOUBLE_QUOTE */]: [4 /* States.IN_SUB_PATH */, 0 /* Actions.APPEND */],\n [\"o\" /* PathCharTypes.END_OF_FAIL */]: 8 /* States.ERROR */,\n [\"l\" /* PathCharTypes.ELSE */]: [6 /* States.IN_DOUBLE_QUOTE */, 0 /* Actions.APPEND */]\n};\n/**\n * Check if an expression is a literal value.\n */\nconst literalValueRE = /^\\s?(?:true|false|-?[\\d.]+|'[^']*'|\"[^\"]*\")\\s?$/;\nfunction isLiteral(exp) {\n return literalValueRE.test(exp);\n}\n/**\n * Strip quotes from a string\n */\nfunction stripQuotes(str) {\n const a = str.charCodeAt(0);\n const b = str.charCodeAt(str.length - 1);\n return a === b && (a === 0x22 || a === 0x27) ? str.slice(1, -1) : str;\n}\n/**\n * Determine the type of a character in a keypath.\n */\nfunction getPathCharType(ch) {\n if (ch === undefined || ch === null) {\n return \"o\" /* PathCharTypes.END_OF_FAIL */;\n }\n const code = ch.charCodeAt(0);\n switch (code) {\n case 0x5b: // [\n case 0x5d: // ]\n case 0x2e: // .\n case 0x22: // \"\n case 0x27: // '\n return ch;\n case 0x5f: // _\n case 0x24: // $\n case 0x2d: // -\n return \"i\" /* PathCharTypes.IDENT */;\n case 0x09: // Tab (HT)\n case 0x0a: // Newline (LF)\n case 0x0d: // Return (CR)\n case 0xa0: // No-break space (NBSP)\n case 0xfeff: // Byte Order Mark (BOM)\n case 0x2028: // Line Separator (LS)\n case 0x2029: // Paragraph Separator (PS)\n return \"w\" /* PathCharTypes.WORKSPACE */;\n }\n return \"i\" /* PathCharTypes.IDENT */;\n}\n/**\n * Format a subPath, return its plain form if it is\n * a literal string or number. Otherwise prepend the\n * dynamic indicator (*).\n */\nfunction formatSubPath(path) {\n const trimmed = path.trim();\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(parseInt(path))) {\n return false;\n }\n return isLiteral(trimmed)\n ? stripQuotes(trimmed)\n : \"*\" /* PathCharTypes.ASTARISK */ + trimmed;\n}\n/**\n * Parse a string path into an array of segments\n */\nfunction parse(path) {\n const keys = [];\n let index = -1;\n let mode = 0 /* States.BEFORE_PATH */;\n let subPathDepth = 0;\n let c;\n let key; // eslint-disable-line\n let newChar;\n let type;\n let transition;\n let action;\n let typeMap;\n const actions = [];\n actions[0 /* Actions.APPEND */] = () => {\n if (key === undefined) {\n key = newChar;\n }\n else {\n key += newChar;\n }\n };\n actions[1 /* Actions.PUSH */] = () => {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n actions[2 /* Actions.INC_SUB_PATH_DEPTH */] = () => {\n actions[0 /* Actions.APPEND */]();\n subPathDepth++;\n };\n actions[3 /* Actions.PUSH_SUB_PATH */] = () => {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = 4 /* States.IN_SUB_PATH */;\n actions[0 /* Actions.APPEND */]();\n }\n else {\n subPathDepth = 0;\n if (key === undefined) {\n return false;\n }\n key = formatSubPath(key);\n if (key === false) {\n return false;\n }\n else {\n actions[1 /* Actions.PUSH */]();\n }\n }\n };\n function maybeUnescapeQuote() {\n const nextChar = path[index + 1];\n if ((mode === 5 /* States.IN_SINGLE_QUOTE */ &&\n nextChar === \"'\" /* PathCharTypes.SINGLE_QUOTE */) ||\n (mode === 6 /* States.IN_DOUBLE_QUOTE */ &&\n nextChar === \"\\\"\" /* PathCharTypes.DOUBLE_QUOTE */)) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[0 /* Actions.APPEND */]();\n return true;\n }\n }\n while (mode !== null) {\n index++;\n c = path[index];\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue;\n }\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap[\"l\" /* PathCharTypes.ELSE */] || 8 /* States.ERROR */;\n // check parse error\n if (transition === 8 /* States.ERROR */) {\n return;\n }\n mode = transition[0];\n if (transition[1] !== undefined) {\n action = actions[transition[1]];\n if (action) {\n newChar = c;\n if (action() === false) {\n return;\n }\n }\n }\n // check parse finish\n if (mode === 7 /* States.AFTER_PATH */) {\n return keys;\n }\n }\n}\n// path token cache\nconst cache = new Map();\n/**\n * key-value message resolver\n *\n * @remarks\n * Resolves messages with the key-value structure. Note that messages with a hierarchical structure such as objects cannot be resolved\n *\n * @param obj - A target object to be resolved with path\n * @param path - A {@link Path | path} to resolve the value of message\n *\n * @returns A resolved {@link PathValue | path value}\n *\n * @VueI18nGeneral\n */\nfunction resolveWithKeyValue(obj, path) {\n return isObject(obj) ? obj[path] : null;\n}\n/**\n * message resolver\n *\n * @remarks\n * Resolves messages. messages with a hierarchical structure such as objects can be resolved. This resolver is used in VueI18n as default.\n *\n * @param obj - A target object to be resolved with path\n * @param path - A {@link Path | path} to resolve the value of message\n *\n * @returns A resolved {@link PathValue | path value}\n *\n * @VueI18nGeneral\n */\nfunction resolveValue(obj, path) {\n // check object\n if (!isObject(obj)) {\n return null;\n }\n // parse path\n let hit = cache.get(path);\n if (!hit) {\n hit = parse(path);\n if (hit) {\n cache.set(path, hit);\n }\n }\n // check hit\n if (!hit) {\n return null;\n }\n // resolve path value\n const len = hit.length;\n let last = obj;\n let i = 0;\n while (i < len) {\n const val = last[hit[i]];\n if (val === undefined) {\n return null;\n }\n if (isFunction(last)) {\n return null;\n }\n last = val;\n i++;\n }\n return last;\n}\n\nconst DEFAULT_MODIFIER = (str) => str;\nconst DEFAULT_MESSAGE = (ctx) => ''; // eslint-disable-line\nconst DEFAULT_MESSAGE_DATA_TYPE = 'text';\nconst DEFAULT_NORMALIZE = (values) => values.length === 0 ? '' : join(values);\nconst DEFAULT_INTERPOLATE = toDisplayString;\nfunction pluralDefault(choice, choicesLength) {\n choice = Math.abs(choice);\n if (choicesLength === 2) {\n // prettier-ignore\n return choice\n ? choice > 1\n ? 1\n : 0\n : 1;\n }\n return choice ? Math.min(choice, 2) : 0;\n}\nfunction getPluralIndex(options) {\n // prettier-ignore\n const index = isNumber(options.pluralIndex)\n ? options.pluralIndex\n : -1;\n // prettier-ignore\n return options.named && (isNumber(options.named.count) || isNumber(options.named.n))\n ? isNumber(options.named.count)\n ? options.named.count\n : isNumber(options.named.n)\n ? options.named.n\n : index\n : index;\n}\nfunction normalizeNamed(pluralIndex, props) {\n if (!props.count) {\n props.count = pluralIndex;\n }\n if (!props.n) {\n props.n = pluralIndex;\n }\n}\nfunction createMessageContext(options = {}) {\n const locale = options.locale;\n const pluralIndex = getPluralIndex(options);\n const pluralRule = isObject(options.pluralRules) &&\n isString(locale) &&\n isFunction(options.pluralRules[locale])\n ? options.pluralRules[locale]\n : pluralDefault;\n const orgPluralRule = isObject(options.pluralRules) &&\n isString(locale) &&\n isFunction(options.pluralRules[locale])\n ? pluralDefault\n : undefined;\n const plural = (messages) => {\n return messages[pluralRule(pluralIndex, messages.length, orgPluralRule)];\n };\n const _list = options.list || [];\n const list = (index) => _list[index];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _named = options.named || {};\n isNumber(options.pluralIndex) && normalizeNamed(pluralIndex, _named);\n const named = (key) => _named[key];\n function message(key) {\n // prettier-ignore\n const msg = isFunction(options.messages)\n ? options.messages(key)\n : isObject(options.messages)\n ? options.messages[key]\n : false;\n return !msg\n ? options.parent\n ? options.parent.message(key) // resolve from parent messages\n : DEFAULT_MESSAGE\n : msg;\n }\n const _modifier = (name) => options.modifiers\n ? options.modifiers[name]\n : DEFAULT_MODIFIER;\n const normalize = isPlainObject(options.processor) && isFunction(options.processor.normalize)\n ? options.processor.normalize\n : DEFAULT_NORMALIZE;\n const interpolate = isPlainObject(options.processor) &&\n isFunction(options.processor.interpolate)\n ? options.processor.interpolate\n : DEFAULT_INTERPOLATE;\n const type = isPlainObject(options.processor) && isString(options.processor.type)\n ? options.processor.type\n : DEFAULT_MESSAGE_DATA_TYPE;\n const linked = (key, ...args) => {\n const [arg1, arg2] = args;\n let type = 'text';\n let modifier = '';\n if (args.length === 1) {\n if (isObject(arg1)) {\n modifier = arg1.modifier || modifier;\n type = arg1.type || type;\n }\n else if (isString(arg1)) {\n modifier = arg1 || modifier;\n }\n }\n else if (args.length === 2) {\n if (isString(arg1)) {\n modifier = arg1 || modifier;\n }\n if (isString(arg2)) {\n type = arg2 || type;\n }\n }\n const ret = message(key)(ctx);\n const msg = \n // The message in vnode resolved with linked are returned as an array by processor.nomalize\n type === 'vnode' && isArray(ret) && modifier\n ? ret[0]\n : ret;\n return modifier ? _modifier(modifier)(msg, type) : msg;\n };\n const ctx = {\n [\"list\" /* HelperNameMap.LIST */]: list,\n [\"named\" /* HelperNameMap.NAMED */]: named,\n [\"plural\" /* HelperNameMap.PLURAL */]: plural,\n [\"linked\" /* HelperNameMap.LINKED */]: linked,\n [\"message\" /* HelperNameMap.MESSAGE */]: message,\n [\"type\" /* HelperNameMap.TYPE */]: type,\n [\"interpolate\" /* HelperNameMap.INTERPOLATE */]: interpolate,\n [\"normalize\" /* HelperNameMap.NORMALIZE */]: normalize,\n [\"values\" /* HelperNameMap.VALUES */]: assign({}, _list, _named)\n };\n return ctx;\n}\n\nlet devtools = null;\nfunction setDevToolsHook(hook) {\n devtools = hook;\n}\nfunction getDevToolsHook() {\n return devtools;\n}\nfunction initI18nDevTools(i18n, version, meta) {\n // TODO: queue if devtools is undefined\n devtools &&\n devtools.emit(\"i18n:init\" /* IntlifyDevToolsHooks.I18nInit */, {\n timestamp: Date.now(),\n i18n,\n version,\n meta\n });\n}\nconst translateDevTools = /* #__PURE__*/ createDevToolsHook(\"function:translate\" /* IntlifyDevToolsHooks.FunctionTranslate */);\nfunction createDevToolsHook(hook) {\n return (payloads) => devtools && devtools.emit(hook, payloads);\n}\n\nconst code$1 = CompileWarnCodes.__EXTEND_POINT__;\nconst inc$1 = incrementer(code$1);\nconst CoreWarnCodes = {\n NOT_FOUND_KEY: code$1, // 2\n FALLBACK_TO_TRANSLATE: inc$1(), // 3\n CANNOT_FORMAT_NUMBER: inc$1(), // 4\n FALLBACK_TO_NUMBER_FORMAT: inc$1(), // 5\n CANNOT_FORMAT_DATE: inc$1(), // 6\n FALLBACK_TO_DATE_FORMAT: inc$1(), // 7\n EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: inc$1(), // 8\n __EXTEND_POINT__: inc$1() // 9\n};\n/** @internal */\nconst warnMessages = {\n [CoreWarnCodes.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale messages.`,\n [CoreWarnCodes.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,\n [CoreWarnCodes.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,\n [CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,\n [CoreWarnCodes.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,\n [CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,\n [CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]: `This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future.`\n};\nfunction getWarnMessage(code, ...args) {\n return format$1(warnMessages[code], ...args);\n}\n\nconst code = CompileErrorCodes.__EXTEND_POINT__;\nconst inc = incrementer(code);\nconst CoreErrorCodes = {\n INVALID_ARGUMENT: code, // 17\n INVALID_DATE_ARGUMENT: inc(), // 18\n INVALID_ISO_DATE_ARGUMENT: inc(), // 19\n NOT_SUPPORT_NON_STRING_MESSAGE: inc(), // 20\n NOT_SUPPORT_LOCALE_PROMISE_VALUE: inc(), // 21\n NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: inc(), // 22\n NOT_SUPPORT_LOCALE_TYPE: inc(), // 23\n __EXTEND_POINT__: inc() // 24\n};\nfunction createCoreError(code) {\n return createCompileError(code, null, (process.env.NODE_ENV !== 'production') ? { messages: errorMessages } : undefined);\n}\n/** @internal */\nconst errorMessages = {\n [CoreErrorCodes.INVALID_ARGUMENT]: 'Invalid arguments',\n [CoreErrorCodes.INVALID_DATE_ARGUMENT]: 'The date provided is an invalid Date object.' +\n 'Make sure your Date represents a valid date.',\n [CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT]: 'The argument provided is not a valid ISO date string',\n [CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE]: 'Not support non-string message',\n [CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE]: 'cannot support promise value',\n [CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]: 'cannot support async function',\n [CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE]: 'cannot support locale type'\n};\n\n/** @internal */\nfunction getLocale(context, options) {\n return options.locale != null\n ? resolveLocale(options.locale)\n : resolveLocale(context.locale);\n}\nlet _resolveLocale;\n/** @internal */\nfunction resolveLocale(locale) {\n if (isString(locale)) {\n return locale;\n }\n else {\n if (isFunction(locale)) {\n if (locale.resolvedOnce && _resolveLocale != null) {\n return _resolveLocale;\n }\n else if (locale.constructor.name === 'Function') {\n const resolve = locale();\n if (isPromise(resolve)) {\n throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE);\n }\n return (_resolveLocale = resolve);\n }\n else {\n throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);\n }\n }\n else {\n throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE);\n }\n }\n}\n/**\n * Fallback with simple implemenation\n *\n * @remarks\n * A fallback locale function implemented with a simple fallback algorithm.\n *\n * Basically, it returns the value as specified in the `fallbackLocale` props, and is processed with the fallback inside intlify.\n *\n * @param ctx - A {@link CoreContext | context}\n * @param fallback - A {@link FallbackLocale | fallback locale}\n * @param start - A starting {@link Locale | locale}\n *\n * @returns Fallback locales\n *\n * @VueI18nGeneral\n */\nfunction fallbackWithSimple(ctx, fallback, start // eslint-disable-line @typescript-eslint/no-unused-vars\n) {\n // prettier-ignore\n return [...new Set([\n start,\n ...(isArray(fallback)\n ? fallback\n : isObject(fallback)\n ? Object.keys(fallback)\n : isString(fallback)\n ? [fallback]\n : [start])\n ])];\n}\n/**\n * Fallback with locale chain\n *\n * @remarks\n * A fallback locale function implemented with a fallback chain algorithm. It's used in VueI18n as default.\n *\n * @param ctx - A {@link CoreContext | context}\n * @param fallback - A {@link FallbackLocale | fallback locale}\n * @param start - A starting {@link Locale | locale}\n *\n * @returns Fallback locales\n *\n * @VueI18nSee [Fallbacking](../guide/essentials/fallback)\n *\n * @VueI18nGeneral\n */\nfunction fallbackWithLocaleChain(ctx, fallback, start) {\n const startLocale = isString(start) ? start : DEFAULT_LOCALE;\n const context = ctx;\n if (!context.__localeChainCache) {\n context.__localeChainCache = new Map();\n }\n let chain = context.__localeChainCache.get(startLocale);\n if (!chain) {\n chain = [];\n // first block defined by start\n let block = [start];\n // while any intervening block found\n while (isArray(block)) {\n block = appendBlockToChain(chain, block, fallback);\n }\n // prettier-ignore\n // last block defined by default\n const defaults = isArray(fallback) || !isPlainObject(fallback)\n ? fallback\n : fallback['default']\n ? fallback['default']\n : null;\n // convert defaults to array\n block = isString(defaults) ? [defaults] : defaults;\n if (isArray(block)) {\n appendBlockToChain(chain, block, false);\n }\n context.__localeChainCache.set(startLocale, chain);\n }\n return chain;\n}\nfunction appendBlockToChain(chain, block, blocks) {\n let follow = true;\n for (let i = 0; i < block.length && isBoolean(follow); i++) {\n const locale = block[i];\n if (isString(locale)) {\n follow = appendLocaleToChain(chain, block[i], blocks);\n }\n }\n return follow;\n}\nfunction appendLocaleToChain(chain, locale, blocks) {\n let follow;\n const tokens = locale.split('-');\n do {\n const target = tokens.join('-');\n follow = appendItemToChain(chain, target, blocks);\n tokens.splice(-1, 1);\n } while (tokens.length && follow === true);\n return follow;\n}\nfunction appendItemToChain(chain, target, blocks) {\n let follow = false;\n if (!chain.includes(target)) {\n follow = true;\n if (target) {\n follow = target[target.length - 1] !== '!';\n const locale = target.replace(/!/g, '');\n chain.push(locale);\n if ((isArray(blocks) || isPlainObject(blocks)) &&\n blocks[locale] // eslint-disable-line @typescript-eslint/no-explicit-any\n ) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n follow = blocks[locale];\n }\n }\n }\n return follow;\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Intlify core-base version\n * @internal\n */\nconst VERSION = '9.14.1';\nconst NOT_REOSLVED = -1;\nconst DEFAULT_LOCALE = 'en-US';\nconst MISSING_RESOLVE_VALUE = '';\nconst capitalize = (str) => `${str.charAt(0).toLocaleUpperCase()}${str.substr(1)}`;\nfunction getDefaultLinkedModifiers() {\n return {\n upper: (val, type) => {\n // prettier-ignore\n return type === 'text' && isString(val)\n ? val.toUpperCase()\n : type === 'vnode' && isObject(val) && '__v_isVNode' in val\n ? val.children.toUpperCase()\n : val;\n },\n lower: (val, type) => {\n // prettier-ignore\n return type === 'text' && isString(val)\n ? val.toLowerCase()\n : type === 'vnode' && isObject(val) && '__v_isVNode' in val\n ? val.children.toLowerCase()\n : val;\n },\n capitalize: (val, type) => {\n // prettier-ignore\n return (type === 'text' && isString(val)\n ? capitalize(val)\n : type === 'vnode' && isObject(val) && '__v_isVNode' in val\n ? capitalize(val.children)\n : val);\n }\n };\n}\nlet _compiler;\nfunction registerMessageCompiler(compiler) {\n _compiler = compiler;\n}\nlet _resolver;\n/**\n * Register the message resolver\n *\n * @param resolver - A {@link MessageResolver} function\n *\n * @VueI18nGeneral\n */\nfunction registerMessageResolver(resolver) {\n _resolver = resolver;\n}\nlet _fallbacker;\n/**\n * Register the locale fallbacker\n *\n * @param fallbacker - A {@link LocaleFallbacker} function\n *\n * @VueI18nGeneral\n */\nfunction registerLocaleFallbacker(fallbacker) {\n _fallbacker = fallbacker;\n}\n// Additional Meta for Intlify DevTools\nlet _additionalMeta = null;\n/* #__NO_SIDE_EFFECTS__ */\nconst setAdditionalMeta = (meta) => {\n _additionalMeta = meta;\n};\n/* #__NO_SIDE_EFFECTS__ */\nconst getAdditionalMeta = () => _additionalMeta;\nlet _fallbackContext = null;\nconst setFallbackContext = (context) => {\n _fallbackContext = context;\n};\nconst getFallbackContext = () => _fallbackContext;\n// ID for CoreContext\nlet _cid = 0;\nfunction createCoreContext(options = {}) {\n // setup options\n const onWarn = isFunction(options.onWarn) ? options.onWarn : warn;\n const version = isString(options.version) ? options.version : VERSION;\n const locale = isString(options.locale) || isFunction(options.locale)\n ? options.locale\n : DEFAULT_LOCALE;\n const _locale = isFunction(locale) ? DEFAULT_LOCALE : locale;\n const fallbackLocale = isArray(options.fallbackLocale) ||\n isPlainObject(options.fallbackLocale) ||\n isString(options.fallbackLocale) ||\n options.fallbackLocale === false\n ? options.fallbackLocale\n : _locale;\n const messages = isPlainObject(options.messages)\n ? options.messages\n : { [_locale]: {} };\n const datetimeFormats = isPlainObject(options.datetimeFormats)\n ? options.datetimeFormats\n : { [_locale]: {} }\n ;\n const numberFormats = isPlainObject(options.numberFormats)\n ? options.numberFormats\n : { [_locale]: {} }\n ;\n const modifiers = assign({}, options.modifiers || {}, getDefaultLinkedModifiers());\n const pluralRules = options.pluralRules || {};\n const missing = isFunction(options.missing) ? options.missing : null;\n const missingWarn = isBoolean(options.missingWarn) || isRegExp(options.missingWarn)\n ? options.missingWarn\n : true;\n const fallbackWarn = isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn)\n ? options.fallbackWarn\n : true;\n const fallbackFormat = !!options.fallbackFormat;\n const unresolving = !!options.unresolving;\n const postTranslation = isFunction(options.postTranslation)\n ? options.postTranslation\n : null;\n const processor = isPlainObject(options.processor) ? options.processor : null;\n const warnHtmlMessage = isBoolean(options.warnHtmlMessage)\n ? options.warnHtmlMessage\n : true;\n const escapeParameter = !!options.escapeParameter;\n const messageCompiler = isFunction(options.messageCompiler)\n ? options.messageCompiler\n : _compiler;\n if ((process.env.NODE_ENV !== 'production') &&\n !false &&\n !false &&\n isFunction(options.messageCompiler)) {\n warnOnce(getWarnMessage(CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));\n }\n const messageResolver = isFunction(options.messageResolver)\n ? options.messageResolver\n : _resolver || resolveWithKeyValue;\n const localeFallbacker = isFunction(options.localeFallbacker)\n ? options.localeFallbacker\n : _fallbacker || fallbackWithSimple;\n const fallbackContext = isObject(options.fallbackContext)\n ? options.fallbackContext\n : undefined;\n // setup internal options\n const internalOptions = options;\n const __datetimeFormatters = isObject(internalOptions.__datetimeFormatters)\n ? internalOptions.__datetimeFormatters\n : new Map()\n ;\n const __numberFormatters = isObject(internalOptions.__numberFormatters)\n ? internalOptions.__numberFormatters\n : new Map()\n ;\n const __meta = isObject(internalOptions.__meta) ? internalOptions.__meta : {};\n _cid++;\n const context = {\n version,\n cid: _cid,\n locale,\n fallbackLocale,\n messages,\n modifiers,\n pluralRules,\n missing,\n missingWarn,\n fallbackWarn,\n fallbackFormat,\n unresolving,\n postTranslation,\n processor,\n warnHtmlMessage,\n escapeParameter,\n messageCompiler,\n messageResolver,\n localeFallbacker,\n fallbackContext,\n onWarn,\n __meta\n };\n {\n context.datetimeFormats = datetimeFormats;\n context.numberFormats = numberFormats;\n context.__datetimeFormatters = __datetimeFormatters;\n context.__numberFormatters = __numberFormatters;\n }\n // for vue-devtools timeline event\n if ((process.env.NODE_ENV !== 'production')) {\n context.__v_emitter =\n internalOptions.__v_emitter != null\n ? internalOptions.__v_emitter\n : undefined;\n }\n // NOTE: experimental !!\n if ((process.env.NODE_ENV !== 'production') || __INTLIFY_PROD_DEVTOOLS__) {\n initI18nDevTools(context, version, __meta);\n }\n return context;\n}\n/** @internal */\nfunction isTranslateFallbackWarn(fallback, key) {\n return fallback instanceof RegExp ? fallback.test(key) : fallback;\n}\n/** @internal */\nfunction isTranslateMissingWarn(missing, key) {\n return missing instanceof RegExp ? missing.test(key) : missing;\n}\n/** @internal */\nfunction handleMissing(context, key, locale, missingWarn, type) {\n const { missing, onWarn } = context;\n // for vue-devtools timeline event\n if ((process.env.NODE_ENV !== 'production')) {\n const emitter = context.__v_emitter;\n if (emitter) {\n emitter.emit(\"missing\" /* VueDevToolsTimelineEvents.MISSING */, {\n locale,\n key,\n type,\n groupId: `${type}:${key}`\n });\n }\n }\n if (missing !== null) {\n const ret = missing(context, locale, key, type);\n return isString(ret) ? ret : key;\n }\n else {\n if ((process.env.NODE_ENV !== 'production') && isTranslateMissingWarn(missingWarn, key)) {\n onWarn(getWarnMessage(CoreWarnCodes.NOT_FOUND_KEY, { key, locale }));\n }\n return key;\n }\n}\n/** @internal */\nfunction updateFallbackLocale(ctx, locale, fallback) {\n const context = ctx;\n context.__localeChainCache = new Map();\n ctx.localeFallbacker(ctx, fallback, locale);\n}\n/** @internal */\nfunction isAlmostSameLocale(locale, compareLocale) {\n if (locale === compareLocale)\n return false;\n return locale.split('-')[0] === compareLocale.split('-')[0];\n}\n/** @internal */\nfunction isImplicitFallback(targetLocale, locales) {\n const index = locales.indexOf(targetLocale);\n if (index === -1) {\n return false;\n }\n for (let i = index + 1; i < locales.length; i++) {\n if (isAlmostSameLocale(targetLocale, locales[i])) {\n return true;\n }\n }\n return false;\n}\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nfunction format(ast) {\n const msg = (ctx) => formatParts(ctx, ast);\n return msg;\n}\nfunction formatParts(ctx, ast) {\n const body = ast.b || ast.body;\n if ((body.t || body.type) === 1 /* NodeTypes.Plural */) {\n const plural = body;\n const cases = plural.c || plural.cases;\n return ctx.plural(cases.reduce((messages, c) => [\n ...messages,\n formatMessageParts(ctx, c)\n ], []));\n }\n else {\n return formatMessageParts(ctx, body);\n }\n}\nfunction formatMessageParts(ctx, node) {\n const _static = node.s || node.static;\n if (_static) {\n return ctx.type === 'text'\n ? _static\n : ctx.normalize([_static]);\n }\n else {\n const messages = (node.i || node.items).reduce((acm, c) => [...acm, formatMessagePart(ctx, c)], []);\n return ctx.normalize(messages);\n }\n}\nfunction formatMessagePart(ctx, node) {\n const type = node.t || node.type;\n switch (type) {\n case 3 /* NodeTypes.Text */: {\n const text = node;\n return (text.v || text.value);\n }\n case 9 /* NodeTypes.Literal */: {\n const literal = node;\n return (literal.v || literal.value);\n }\n case 4 /* NodeTypes.Named */: {\n const named = node;\n return ctx.interpolate(ctx.named(named.k || named.key));\n }\n case 5 /* NodeTypes.List */: {\n const list = node;\n return ctx.interpolate(ctx.list(list.i != null ? list.i : list.index));\n }\n case 6 /* NodeTypes.Linked */: {\n const linked = node;\n const modifier = linked.m || linked.modifier;\n return ctx.linked(formatMessagePart(ctx, linked.k || linked.key), modifier ? formatMessagePart(ctx, modifier) : undefined, ctx.type);\n }\n case 7 /* NodeTypes.LinkedKey */: {\n const linkedKey = node;\n return (linkedKey.v || linkedKey.value);\n }\n case 8 /* NodeTypes.LinkedModifier */: {\n const linkedModifier = node;\n return (linkedModifier.v || linkedModifier.value);\n }\n default:\n throw new Error(`unhandled node type on format message part: ${type}`);\n }\n}\n\nconst WARN_MESSAGE = `Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.`;\nfunction checkHtmlMessage(source, warnHtmlMessage) {\n if (warnHtmlMessage && detectHtmlTag(source)) {\n warn(format$1(WARN_MESSAGE, { source }));\n }\n}\nconst defaultOnCacheKey = (message) => message;\nlet compileCache = Object.create(null);\nfunction onCompileWarn(_warn) {\n if (_warn.code === CompileWarnCodes.USE_MODULO_SYNTAX) {\n warn(`The use of named interpolation with modulo syntax is deprecated. ` +\n `It will be removed in v10.\\n` +\n `reference: https://vue-i18n.intlify.dev/guide/essentials/syntax#rails-i18n-format \\n` +\n `(message compiler warning message: ${_warn.message})`);\n }\n}\nfunction clearCompileCache() {\n compileCache = Object.create(null);\n}\nconst isMessageAST = (val) => isObject(val) &&\n (val.t === 0 || val.type === 0) &&\n ('b' in val || 'body' in val);\nfunction baseCompile(message, options = {}) {\n // error detecting on compile\n let detectError = false;\n const onError = options.onError || defaultOnError;\n options.onError = (err) => {\n detectError = true;\n onError(err);\n };\n // compile with mesasge-compiler\n return { ...baseCompile$1(message, options), detectError };\n}\n/* #__NO_SIDE_EFFECTS__ */\nconst compileToFunction = (message, context) => {\n if (!isString(message)) {\n throw createCoreError(CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE);\n }\n // set onWarn\n if ((process.env.NODE_ENV !== 'production')) {\n context.onWarn = onCompileWarn;\n }\n {\n // check HTML message\n const warnHtmlMessage = isBoolean(context.warnHtmlMessage)\n ? context.warnHtmlMessage\n : true;\n (process.env.NODE_ENV !== 'production') && checkHtmlMessage(message, warnHtmlMessage);\n // check caches\n const onCacheKey = context.onCacheKey || defaultOnCacheKey;\n const cacheKey = onCacheKey(message);\n const cached = compileCache[cacheKey];\n if (cached) {\n return cached;\n }\n // compile\n const { code, detectError } = baseCompile(message, context);\n // evaluate function\n const msg = new Function(`return ${code}`)();\n // if occurred compile error, don't cache\n return !detectError\n ? (compileCache[cacheKey] = msg)\n : msg;\n }\n};\nfunction compile(message, context) {\n // set onWarn\n if ((process.env.NODE_ENV !== 'production')) {\n context.onWarn = onCompileWarn;\n }\n if (((__INTLIFY_JIT_COMPILATION__ && !__INTLIFY_DROP_MESSAGE_COMPILER__)) &&\n isString(message)) {\n // check HTML message\n const warnHtmlMessage = isBoolean(context.warnHtmlMessage)\n ? context.warnHtmlMessage\n : true;\n (process.env.NODE_ENV !== 'production') && checkHtmlMessage(message, warnHtmlMessage);\n // check caches\n const onCacheKey = context.onCacheKey || defaultOnCacheKey;\n const cacheKey = onCacheKey(message);\n const cached = compileCache[cacheKey];\n if (cached) {\n return cached;\n }\n // compile with JIT mode\n const { ast, detectError } = baseCompile(message, {\n ...context,\n location: (process.env.NODE_ENV !== 'production'),\n jit: true\n });\n // compose message function from AST\n const msg = format(ast);\n // if occurred compile error, don't cache\n return !detectError\n ? (compileCache[cacheKey] = msg)\n : msg;\n }\n else {\n if ((process.env.NODE_ENV !== 'production') && !isMessageAST(message)) {\n warn(`the message that is resolve with key '${context.key}' is not supported for jit compilation`);\n return (() => message);\n }\n // AST case (passed from bundler)\n const cacheKey = message.cacheKey;\n if (cacheKey) {\n const cached = compileCache[cacheKey];\n if (cached) {\n return cached;\n }\n // compose message function from message (AST)\n return (compileCache[cacheKey] =\n format(message));\n }\n else {\n return format(message);\n }\n }\n}\n\nconst NOOP_MESSAGE_FUNCTION = () => '';\nconst isMessageFunction = (val) => isFunction(val);\n// implementation of `translate` function\nfunction translate(context, ...args) {\n const { fallbackFormat, postTranslation, unresolving, messageCompiler, fallbackLocale, messages } = context;\n const [key, options] = parseTranslateArgs(...args);\n const missingWarn = isBoolean(options.missingWarn)\n ? options.missingWarn\n : context.missingWarn;\n const fallbackWarn = isBoolean(options.fallbackWarn)\n ? options.fallbackWarn\n : context.fallbackWarn;\n const escapeParameter = isBoolean(options.escapeParameter)\n ? options.escapeParameter\n : context.escapeParameter;\n const resolvedMessage = !!options.resolvedMessage;\n // prettier-ignore\n const defaultMsgOrKey = isString(options.default) || isBoolean(options.default) // default by function option\n ? !isBoolean(options.default)\n ? options.default\n : (!messageCompiler ? () => key : key)\n : fallbackFormat // default by `fallbackFormat` option\n ? (!messageCompiler ? () => key : key)\n : '';\n const enableDefaultMsg = fallbackFormat || defaultMsgOrKey !== '';\n const locale = getLocale(context, options);\n // escape params\n escapeParameter && escapeParams(options);\n // resolve message format\n // eslint-disable-next-line prefer-const\n let [formatScope, targetLocale, message] = !resolvedMessage\n ? resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn)\n : [\n key,\n locale,\n messages[locale] || {}\n ];\n // NOTE:\n // Fix to work around `ssrTransfrom` bug in Vite.\n // https://github.com/vitejs/vite/issues/4306\n // To get around this, use temporary variables.\n // https://github.com/nuxt/framework/issues/1461#issuecomment-954606243\n let format = formatScope;\n // if you use default message, set it as message format!\n let cacheBaseKey = key;\n if (!resolvedMessage &&\n !(isString(format) ||\n isMessageAST(format) ||\n isMessageFunction(format))) {\n if (enableDefaultMsg) {\n format = defaultMsgOrKey;\n cacheBaseKey = format;\n }\n }\n // checking message format and target locale\n if (!resolvedMessage &&\n (!(isString(format) ||\n isMessageAST(format) ||\n isMessageFunction(format)) ||\n !isString(targetLocale))) {\n return unresolving ? NOT_REOSLVED : key;\n }\n // TODO: refactor\n if ((process.env.NODE_ENV !== 'production') && isString(format) && context.messageCompiler == null) {\n warn(`The message format compilation is not supported in this build. ` +\n `Because message compiler isn't included. ` +\n `You need to pre-compilation all message format. ` +\n `So translate function return '${key}'.`);\n return key;\n }\n // setup compile error detecting\n let occurred = false;\n const onError = () => {\n occurred = true;\n };\n // compile message format\n const msg = !isMessageFunction(format)\n ? compileMessageFormat(context, key, targetLocale, format, cacheBaseKey, onError)\n : format;\n // if occurred compile error, return the message format\n if (occurred) {\n return format;\n }\n // evaluate message with context\n const ctxOptions = getMessageContextOptions(context, targetLocale, message, options);\n const msgContext = createMessageContext(ctxOptions);\n const messaged = evaluateMessage(context, msg, msgContext);\n // if use post translation option, proceed it with handler\n const ret = postTranslation\n ? postTranslation(messaged, key)\n : messaged;\n // NOTE: experimental !!\n if ((process.env.NODE_ENV !== 'production') || __INTLIFY_PROD_DEVTOOLS__) {\n // prettier-ignore\n const payloads = {\n timestamp: Date.now(),\n key: isString(key)\n ? key\n : isMessageFunction(format)\n ? format.key\n : '',\n locale: targetLocale || (isMessageFunction(format)\n ? format.locale\n : ''),\n format: isString(format)\n ? format\n : isMessageFunction(format)\n ? format.source\n : '',\n message: ret\n };\n payloads.meta = assign({}, context.__meta, getAdditionalMeta() || {});\n translateDevTools(payloads);\n }\n return ret;\n}\nfunction escapeParams(options) {\n if (isArray(options.list)) {\n options.list = options.list.map(item => isString(item) ? escapeHtml(item) : item);\n }\n else if (isObject(options.named)) {\n Object.keys(options.named).forEach(key => {\n if (isString(options.named[key])) {\n options.named[key] = escapeHtml(options.named[key]);\n }\n });\n }\n}\nfunction resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) {\n const { messages, onWarn, messageResolver: resolveValue, localeFallbacker } = context;\n const locales = localeFallbacker(context, fallbackLocale, locale); // eslint-disable-line @typescript-eslint/no-explicit-any\n let message = {};\n let targetLocale;\n let format = null;\n let from = locale;\n let to = null;\n const type = 'translate';\n for (let i = 0; i < locales.length; i++) {\n targetLocale = to = locales[i];\n if ((process.env.NODE_ENV !== 'production') &&\n locale !== targetLocale &&\n !isAlmostSameLocale(locale, targetLocale) &&\n isTranslateFallbackWarn(fallbackWarn, key)) {\n onWarn(getWarnMessage(CoreWarnCodes.FALLBACK_TO_TRANSLATE, {\n key,\n target: targetLocale\n }));\n }\n // for vue-devtools timeline event\n if ((process.env.NODE_ENV !== 'production') && locale !== targetLocale) {\n const emitter = context.__v_emitter;\n if (emitter) {\n emitter.emit(\"fallback\" /* VueDevToolsTimelineEvents.FALBACK */, {\n type,\n key,\n from,\n to,\n groupId: `${type}:${key}`\n });\n }\n }\n message =\n messages[targetLocale] || {};\n // for vue-devtools timeline event\n let start = null;\n let startTag;\n let endTag;\n if ((process.env.NODE_ENV !== 'production') && inBrowser) {\n start = window.performance.now();\n startTag = 'intlify-message-resolve-start';\n endTag = 'intlify-message-resolve-end';\n mark && mark(startTag);\n }\n if ((format = resolveValue(message, key)) === null) {\n // if null, resolve with object key path\n format = message[key]; // eslint-disable-line @typescript-eslint/no-explicit-any\n }\n // for vue-devtools timeline event\n if ((process.env.NODE_ENV !== 'production') && inBrowser) {\n const end = window.performance.now();\n const emitter = context.__v_emitter;\n if (emitter && start && format) {\n emitter.emit(\"message-resolve\" /* VueDevToolsTimelineEvents.MESSAGE_RESOLVE */, {\n type: \"message-resolve\" /* VueDevToolsTimelineEvents.MESSAGE_RESOLVE */,\n key,\n message: format,\n time: end - start,\n groupId: `${type}:${key}`\n });\n }\n if (startTag && endTag && mark && measure) {\n mark(endTag);\n measure('intlify message resolve', startTag, endTag);\n }\n }\n if (isString(format) || isMessageAST(format) || isMessageFunction(format)) {\n break;\n }\n if (!isImplicitFallback(targetLocale, locales)) {\n const missingRet = handleMissing(context, // eslint-disable-line @typescript-eslint/no-explicit-any\n key, targetLocale, missingWarn, type);\n if (missingRet !== key) {\n format = missingRet;\n }\n }\n from = to;\n }\n return [format, targetLocale, message];\n}\nfunction compileMessageFormat(context, key, targetLocale, format, cacheBaseKey, onError) {\n const { messageCompiler, warnHtmlMessage } = context;\n if (isMessageFunction(format)) {\n const msg = format;\n msg.locale = msg.locale || targetLocale;\n msg.key = msg.key || key;\n return msg;\n }\n if (messageCompiler == null) {\n const msg = (() => format);\n msg.locale = targetLocale;\n msg.key = key;\n return msg;\n }\n // for vue-devtools timeline event\n let start = null;\n let startTag;\n let endTag;\n if ((process.env.NODE_ENV !== 'production') && inBrowser) {\n start = window.performance.now();\n startTag = 'intlify-message-compilation-start';\n endTag = 'intlify-message-compilation-end';\n mark && mark(startTag);\n }\n const msg = messageCompiler(format, getCompileContext(context, targetLocale, cacheBaseKey, format, warnHtmlMessage, onError));\n // for vue-devtools timeline event\n if ((process.env.NODE_ENV !== 'production') && inBrowser) {\n const end = window.performance.now();\n const emitter = context.__v_emitter;\n if (emitter && start) {\n emitter.emit(\"message-compilation\" /* VueDevToolsTimelineEvents.MESSAGE_COMPILATION */, {\n type: \"message-compilation\" /* VueDevToolsTimelineEvents.MESSAGE_COMPILATION */,\n message: format,\n time: end - start,\n groupId: `${'translate'}:${key}`\n });\n }\n if (startTag && endTag && mark && measure) {\n mark(endTag);\n measure('intlify message compilation', startTag, endTag);\n }\n }\n msg.locale = targetLocale;\n msg.key = key;\n msg.source = format;\n return msg;\n}\nfunction evaluateMessage(context, msg, msgCtx) {\n // for vue-devtools timeline event\n let start = null;\n let startTag;\n let endTag;\n if ((process.env.NODE_ENV !== 'production') && inBrowser) {\n start = window.performance.now();\n startTag = 'intlify-message-evaluation-start';\n endTag = 'intlify-message-evaluation-end';\n mark && mark(startTag);\n }\n const messaged = msg(msgCtx);\n // for vue-devtools timeline event\n if ((process.env.NODE_ENV !== 'production') && inBrowser) {\n const end = window.performance.now();\n const emitter = context.__v_emitter;\n if (emitter && start) {\n emitter.emit(\"message-evaluation\" /* VueDevToolsTimelineEvents.MESSAGE_EVALUATION */, {\n type: \"message-evaluation\" /* VueDevToolsTimelineEvents.MESSAGE_EVALUATION */,\n value: messaged,\n time: end - start,\n groupId: `${'translate'}:${msg.key}`\n });\n }\n if (startTag && endTag && mark && measure) {\n mark(endTag);\n measure('intlify message evaluation', startTag, endTag);\n }\n }\n return messaged;\n}\n/** @internal */\nfunction parseTranslateArgs(...args) {\n const [arg1, arg2, arg3] = args;\n const options = {};\n if (!isString(arg1) &&\n !isNumber(arg1) &&\n !isMessageFunction(arg1) &&\n !isMessageAST(arg1)) {\n throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);\n }\n // prettier-ignore\n const key = isNumber(arg1)\n ? String(arg1)\n : isMessageFunction(arg1)\n ? arg1\n : arg1;\n if (isNumber(arg2)) {\n options.plural = arg2;\n }\n else if (isString(arg2)) {\n options.default = arg2;\n }\n else if (isPlainObject(arg2) && !isEmptyObject(arg2)) {\n options.named = arg2;\n }\n else if (isArray(arg2)) {\n options.list = arg2;\n }\n if (isNumber(arg3)) {\n options.plural = arg3;\n }\n else if (isString(arg3)) {\n options.default = arg3;\n }\n else if (isPlainObject(arg3)) {\n assign(options, arg3);\n }\n return [key, options];\n}\nfunction getCompileContext(context, locale, key, source, warnHtmlMessage, onError) {\n return {\n locale,\n key,\n warnHtmlMessage,\n onError: (err) => {\n onError && onError(err);\n if ((process.env.NODE_ENV !== 'production')) {\n const _source = getSourceForCodeFrame(source);\n const message = `Message compilation error: ${err.message}`;\n const codeFrame = err.location &&\n _source &&\n generateCodeFrame(_source, err.location.start.offset, err.location.end.offset);\n const emitter = context.__v_emitter;\n if (emitter && _source) {\n emitter.emit(\"compile-error\" /* VueDevToolsTimelineEvents.COMPILE_ERROR */, {\n message: _source,\n error: err.message,\n start: err.location && err.location.start.offset,\n end: err.location && err.location.end.offset,\n groupId: `${'translate'}:${key}`\n });\n }\n console.error(codeFrame ? `${message}\\n${codeFrame}` : message);\n }\n else {\n throw err;\n }\n },\n onCacheKey: (source) => generateFormatCacheKey(locale, key, source)\n };\n}\nfunction getSourceForCodeFrame(source) {\n if (isString(source)) {\n return source;\n }\n else {\n if (source.loc && source.loc.source) {\n return source.loc.source;\n }\n }\n}\nfunction getMessageContextOptions(context, locale, message, options) {\n const { modifiers, pluralRules, messageResolver: resolveValue, fallbackLocale, fallbackWarn, missingWarn, fallbackContext } = context;\n const resolveMessage = (key) => {\n let val = resolveValue(message, key);\n // fallback to root context\n if (val == null && fallbackContext) {\n const [, , message] = resolveMessageFormat(fallbackContext, key, locale, fallbackLocale, fallbackWarn, missingWarn);\n val = resolveValue(message, key);\n }\n if (isString(val) || isMessageAST(val)) {\n let occurred = false;\n const onError = () => {\n occurred = true;\n };\n const msg = compileMessageFormat(context, key, locale, val, key, onError);\n return !occurred\n ? msg\n : NOOP_MESSAGE_FUNCTION;\n }\n else if (isMessageFunction(val)) {\n return val;\n }\n else {\n // TODO: should be implemented warning message\n return NOOP_MESSAGE_FUNCTION;\n }\n };\n const ctxOptions = {\n locale,\n modifiers,\n pluralRules,\n messages: resolveMessage\n };\n if (context.processor) {\n ctxOptions.processor = context.processor;\n }\n if (options.list) {\n ctxOptions.list = options.list;\n }\n if (options.named) {\n ctxOptions.named = options.named;\n }\n if (isNumber(options.plural)) {\n ctxOptions.pluralIndex = options.plural;\n }\n return ctxOptions;\n}\n\nconst intlDefined = typeof Intl !== 'undefined';\nconst Availabilities = {\n dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== 'undefined',\n numberFormat: intlDefined && typeof Intl.NumberFormat !== 'undefined'\n};\n\n// implementation of `datetime` function\nfunction datetime(context, ...args) {\n const { datetimeFormats, unresolving, fallbackLocale, onWarn, localeFallbacker } = context;\n const { __datetimeFormatters } = context;\n if ((process.env.NODE_ENV !== 'production') && !Availabilities.dateTimeFormat) {\n onWarn(getWarnMessage(CoreWarnCodes.CANNOT_FORMAT_DATE));\n return MISSING_RESOLVE_VALUE;\n }\n const [key, value, options, overrides] = parseDateTimeArgs(...args);\n const missingWarn = isBoolean(options.missingWarn)\n ? options.missingWarn\n : context.missingWarn;\n const fallbackWarn = isBoolean(options.fallbackWarn)\n ? options.fallbackWarn\n : context.fallbackWarn;\n const part = !!options.part;\n const locale = getLocale(context, options);\n const locales = localeFallbacker(context, // eslint-disable-line @typescript-eslint/no-explicit-any\n fallbackLocale, locale);\n if (!isString(key) || key === '') {\n return new Intl.DateTimeFormat(locale, overrides).format(value);\n }\n // resolve format\n let datetimeFormat = {};\n let targetLocale;\n let format = null;\n let from = locale;\n let to = null;\n const type = 'datetime format';\n for (let i = 0; i < locales.length; i++) {\n targetLocale = to = locales[i];\n if ((process.env.NODE_ENV !== 'production') &&\n locale !== targetLocale &&\n isTranslateFallbackWarn(fallbackWarn, key)) {\n onWarn(getWarnMessage(CoreWarnCodes.FALLBACK_TO_DATE_FORMAT, {\n key,\n target: targetLocale\n }));\n }\n // for vue-devtools timeline event\n if ((process.env.NODE_ENV !== 'production') && locale !== targetLocale) {\n const emitter = context.__v_emitter;\n if (emitter) {\n emitter.emit(\"fallback\" /* VueDevToolsTimelineEvents.FALBACK */, {\n type,\n key,\n from,\n to,\n groupId: `${type}:${key}`\n });\n }\n }\n datetimeFormat =\n datetimeFormats[targetLocale] || {};\n format = datetimeFormat[key];\n if (isPlainObject(format))\n break;\n handleMissing(context, key, targetLocale, missingWarn, type); // eslint-disable-line @typescript-eslint/no-explicit-any\n from = to;\n }\n // checking format and target locale\n if (!isPlainObject(format) || !isString(targetLocale)) {\n return unresolving ? NOT_REOSLVED : key;\n }\n let id = `${targetLocale}__${key}`;\n if (!isEmptyObject(overrides)) {\n id = `${id}__${JSON.stringify(overrides)}`;\n }\n let formatter = __datetimeFormatters.get(id);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(targetLocale, assign({}, format, overrides));\n __datetimeFormatters.set(id, formatter);\n }\n return !part ? formatter.format(value) : formatter.formatToParts(value);\n}\n/** @internal */\nconst DATETIME_FORMAT_OPTIONS_KEYS = [\n 'localeMatcher',\n 'weekday',\n 'era',\n 'year',\n 'month',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'timeZoneName',\n 'formatMatcher',\n 'hour12',\n 'timeZone',\n 'dateStyle',\n 'timeStyle',\n 'calendar',\n 'dayPeriod',\n 'numberingSystem',\n 'hourCycle',\n 'fractionalSecondDigits'\n];\n/** @internal */\nfunction parseDateTimeArgs(...args) {\n const [arg1, arg2, arg3, arg4] = args;\n const options = {};\n let overrides = {};\n let value;\n if (isString(arg1)) {\n // Only allow ISO strings - other date formats are often supported,\n // but may cause different results in different browsers.\n const matches = arg1.match(/(\\d{4}-\\d{2}-\\d{2})(T|\\s)?(.*)/);\n if (!matches) {\n throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);\n }\n // Some browsers can not parse the iso datetime separated by space,\n // this is a compromise solution by replace the 'T'/' ' with 'T'\n const dateTime = matches[3]\n ? matches[3].trim().startsWith('T')\n ? `${matches[1].trim()}${matches[3].trim()}`\n : `${matches[1].trim()}T${matches[3].trim()}`\n : matches[1].trim();\n value = new Date(dateTime);\n try {\n // This will fail if the date is not valid\n value.toISOString();\n }\n catch (e) {\n throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);\n }\n }\n else if (isDate(arg1)) {\n if (isNaN(arg1.getTime())) {\n throw createCoreError(CoreErrorCodes.INVALID_DATE_ARGUMENT);\n }\n value = arg1;\n }\n else if (isNumber(arg1)) {\n value = arg1;\n }\n else {\n throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);\n }\n if (isString(arg2)) {\n options.key = arg2;\n }\n else if (isPlainObject(arg2)) {\n Object.keys(arg2).forEach(key => {\n if (DATETIME_FORMAT_OPTIONS_KEYS.includes(key)) {\n overrides[key] = arg2[key];\n }\n else {\n options[key] = arg2[key];\n }\n });\n }\n if (isString(arg3)) {\n options.locale = arg3;\n }\n else if (isPlainObject(arg3)) {\n overrides = arg3;\n }\n if (isPlainObject(arg4)) {\n overrides = arg4;\n }\n return [options.key || '', value, options, overrides];\n}\n/** @internal */\nfunction clearDateTimeFormat(ctx, locale, format) {\n const context = ctx;\n for (const key in format) {\n const id = `${locale}__${key}`;\n if (!context.__datetimeFormatters.has(id)) {\n continue;\n }\n context.__datetimeFormatters.delete(id);\n }\n}\n\n// implementation of `number` function\nfunction number(context, ...args) {\n const { numberFormats, unresolving, fallbackLocale, onWarn, localeFallbacker } = context;\n const { __numberFormatters } = context;\n if ((process.env.NODE_ENV !== 'production') && !Availabilities.numberFormat) {\n onWarn(getWarnMessage(CoreWarnCodes.CANNOT_FORMAT_NUMBER));\n return MISSING_RESOLVE_VALUE;\n }\n const [key, value, options, overrides] = parseNumberArgs(...args);\n const missingWarn = isBoolean(options.missingWarn)\n ? options.missingWarn\n : context.missingWarn;\n const fallbackWarn = isBoolean(options.fallbackWarn)\n ? options.fallbackWarn\n : context.fallbackWarn;\n const part = !!options.part;\n const locale = getLocale(context, options);\n const locales = localeFallbacker(context, // eslint-disable-line @typescript-eslint/no-explicit-any\n fallbackLocale, locale);\n if (!isString(key) || key === '') {\n return new Intl.NumberFormat(locale, overrides).format(value);\n }\n // resolve format\n let numberFormat = {};\n let targetLocale;\n let format = null;\n let from = locale;\n let to = null;\n const type = 'number format';\n for (let i = 0; i < locales.length; i++) {\n targetLocale = to = locales[i];\n if ((process.env.NODE_ENV !== 'production') &&\n locale !== targetLocale &&\n isTranslateFallbackWarn(fallbackWarn, key)) {\n onWarn(getWarnMessage(CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT, {\n key,\n target: targetLocale\n }));\n }\n // for vue-devtools timeline event\n if ((process.env.NODE_ENV !== 'production') && locale !== targetLocale) {\n const emitter = context.__v_emitter;\n if (emitter) {\n emitter.emit(\"fallback\" /* VueDevToolsTimelineEvents.FALBACK */, {\n type,\n key,\n from,\n to,\n groupId: `${type}:${key}`\n });\n }\n }\n numberFormat =\n numberFormats[targetLocale] || {};\n format = numberFormat[key];\n if (isPlainObject(format))\n break;\n handleMissing(context, key, targetLocale, missingWarn, type); // eslint-disable-line @typescript-eslint/no-explicit-any\n from = to;\n }\n // checking format and target locale\n if (!isPlainObject(format) || !isString(targetLocale)) {\n return unresolving ? NOT_REOSLVED : key;\n }\n let id = `${targetLocale}__${key}`;\n if (!isEmptyObject(overrides)) {\n id = `${id}__${JSON.stringify(overrides)}`;\n }\n let formatter = __numberFormatters.get(id);\n if (!formatter) {\n formatter = new Intl.NumberFormat(targetLocale, assign({}, format, overrides));\n __numberFormatters.set(id, formatter);\n }\n return !part ? formatter.format(value) : formatter.formatToParts(value);\n}\n/** @internal */\nconst NUMBER_FORMAT_OPTIONS_KEYS = [\n 'localeMatcher',\n 'style',\n 'currency',\n 'currencyDisplay',\n 'currencySign',\n 'useGrouping',\n 'minimumIntegerDigits',\n 'minimumFractionDigits',\n 'maximumFractionDigits',\n 'minimumSignificantDigits',\n 'maximumSignificantDigits',\n 'compactDisplay',\n 'notation',\n 'signDisplay',\n 'unit',\n 'unitDisplay',\n 'roundingMode',\n 'roundingPriority',\n 'roundingIncrement',\n 'trailingZeroDisplay'\n];\n/** @internal */\nfunction parseNumberArgs(...args) {\n const [arg1, arg2, arg3, arg4] = args;\n const options = {};\n let overrides = {};\n if (!isNumber(arg1)) {\n throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT);\n }\n const value = arg1;\n if (isString(arg2)) {\n options.key = arg2;\n }\n else if (isPlainObject(arg2)) {\n Object.keys(arg2).forEach(key => {\n if (NUMBER_FORMAT_OPTIONS_KEYS.includes(key)) {\n overrides[key] = arg2[key];\n }\n else {\n options[key] = arg2[key];\n }\n });\n }\n if (isString(arg3)) {\n options.locale = arg3;\n }\n else if (isPlainObject(arg3)) {\n overrides = arg3;\n }\n if (isPlainObject(arg4)) {\n overrides = arg4;\n }\n return [options.key || '', value, options, overrides];\n}\n/** @internal */\nfunction clearNumberFormat(ctx, locale, format) {\n const context = ctx;\n for (const key in format) {\n const id = `${locale}__${key}`;\n if (!context.__numberFormatters.has(id)) {\n continue;\n }\n context.__numberFormatters.delete(id);\n }\n}\n\n{\n initFeatureFlags();\n}\n\nexport { CoreErrorCodes, CoreWarnCodes, DATETIME_FORMAT_OPTIONS_KEYS, DEFAULT_LOCALE, DEFAULT_MESSAGE_DATA_TYPE, MISSING_RESOLVE_VALUE, NOT_REOSLVED, NUMBER_FORMAT_OPTIONS_KEYS, VERSION, clearCompileCache, clearDateTimeFormat, clearNumberFormat, compile, compileToFunction, createCoreContext, createCoreError, createMessageContext, datetime, fallbackWithLocaleChain, fallbackWithSimple, getAdditionalMeta, getDevToolsHook, getFallbackContext, getLocale, getWarnMessage, handleMissing, initI18nDevTools, isAlmostSameLocale, isImplicitFallback, isMessageAST, isMessageFunction, isTranslateFallbackWarn, isTranslateMissingWarn, number, parse, parseDateTimeArgs, parseNumberArgs, parseTranslateArgs, registerLocaleFallbacker, registerMessageCompiler, registerMessageResolver, resolveLocale, resolveValue, resolveWithKeyValue, setAdditionalMeta, setDevToolsHook, setFallbackContext, translate, translateDevTools, updateFallbackLocale };\n","/*!\n * vue-i18n v9.14.1\n * (c) 2024 kazuya kawaguchi\n * Released under the MIT License.\n */\nimport { getGlobalThis, incrementer, format, makeSymbol, isPlainObject, isArray, deepCopy, isString, hasOwn, isObject, warn, warnOnce, isBoolean, isRegExp, isFunction, inBrowser, assign, isNumber, createEmitter, isEmptyObject } from '@intlify/shared';\nimport { CoreWarnCodes, CoreErrorCodes, createCompileError, DEFAULT_LOCALE, updateFallbackLocale, setFallbackContext, createCoreContext, clearDateTimeFormat, clearNumberFormat, setAdditionalMeta, getFallbackContext, NOT_REOSLVED, isTranslateFallbackWarn, isTranslateMissingWarn, parseTranslateArgs, translate, MISSING_RESOLVE_VALUE, parseDateTimeArgs, datetime, parseNumberArgs, number, isMessageAST, isMessageFunction, fallbackWithLocaleChain, NUMBER_FORMAT_OPTIONS_KEYS, DATETIME_FORMAT_OPTIONS_KEYS, registerMessageCompiler, compile, compileToFunction, registerMessageResolver, resolveValue, registerLocaleFallbacker, setDevToolsHook } from '@intlify/core-base';\nimport { createVNode, Text, computed, watch, getCurrentInstance, ref, shallowRef, Fragment, defineComponent, h, effectScope, inject, onMounted, onUnmounted, onBeforeMount, isRef } from 'vue';\nimport { setupDevtoolsPlugin } from '@vue/devtools-api';\n\n/**\n * Vue I18n Version\n *\n * @remarks\n * Semver format. Same format as the package.json `version` field.\n *\n * @VueI18nGeneral\n */\nconst VERSION = '9.14.1';\n/**\n * This is only called in esm-bundler builds.\n * istanbul-ignore-next\n */\nfunction initFeatureFlags() {\n if (typeof __VUE_I18N_FULL_INSTALL__ !== 'boolean') {\n getGlobalThis().__VUE_I18N_FULL_INSTALL__ = true;\n }\n if (typeof __VUE_I18N_LEGACY_API__ !== 'boolean') {\n getGlobalThis().__VUE_I18N_LEGACY_API__ = true;\n }\n if (typeof __INTLIFY_JIT_COMPILATION__ !== 'boolean') {\n getGlobalThis().__INTLIFY_JIT_COMPILATION__ = false;\n }\n if (typeof __INTLIFY_DROP_MESSAGE_COMPILER__ !== 'boolean') {\n getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__ = false;\n }\n if (typeof __INTLIFY_PROD_DEVTOOLS__ !== 'boolean') {\n getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;\n }\n}\n\nconst code$1 = CoreWarnCodes.__EXTEND_POINT__;\nconst inc$1 = incrementer(code$1);\nconst I18nWarnCodes = {\n FALLBACK_TO_ROOT: code$1, // 9\n NOT_SUPPORTED_PRESERVE: inc$1(), // 10\n NOT_SUPPORTED_FORMATTER: inc$1(), // 11\n NOT_SUPPORTED_PRESERVE_DIRECTIVE: inc$1(), // 12\n NOT_SUPPORTED_GET_CHOICE_INDEX: inc$1(), // 13\n COMPONENT_NAME_LEGACY_COMPATIBLE: inc$1(), // 14\n NOT_FOUND_PARENT_SCOPE: inc$1(), // 15\n IGNORE_OBJ_FLATTEN: inc$1(), // 16\n NOTICE_DROP_ALLOW_COMPOSITION: inc$1(), // 17\n NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG: inc$1() // 18\n};\nconst warnMessages = {\n [I18nWarnCodes.FALLBACK_TO_ROOT]: `Fall back to {type} '{key}' with root locale.`,\n [I18nWarnCodes.NOT_SUPPORTED_PRESERVE]: `Not supported 'preserve'.`,\n [I18nWarnCodes.NOT_SUPPORTED_FORMATTER]: `Not supported 'formatter'.`,\n [I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE]: `Not supported 'preserveDirectiveContent'.`,\n [I18nWarnCodes.NOT_SUPPORTED_GET_CHOICE_INDEX]: `Not supported 'getChoiceIndex'.`,\n [I18nWarnCodes.COMPONENT_NAME_LEGACY_COMPATIBLE]: `Component name legacy compatible: '{name}' -> 'i18n'`,\n [I18nWarnCodes.NOT_FOUND_PARENT_SCOPE]: `Not found parent scope. use the global scope.`,\n [I18nWarnCodes.IGNORE_OBJ_FLATTEN]: `Ignore object flatten: '{key}' key has an string value`,\n [I18nWarnCodes.NOTICE_DROP_ALLOW_COMPOSITION]: `'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze`,\n [I18nWarnCodes.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]: `'translateExistCompatible' option will be dropped in the next major version.`\n};\nfunction getWarnMessage(code, ...args) {\n return format(warnMessages[code], ...args);\n}\n\nconst code = CoreErrorCodes.__EXTEND_POINT__;\nconst inc = incrementer(code);\nconst I18nErrorCodes = {\n // composer module errors\n UNEXPECTED_RETURN_TYPE: code, // 24\n // legacy module errors\n INVALID_ARGUMENT: inc(), // 25\n // i18n module errors\n MUST_BE_CALL_SETUP_TOP: inc(), // 26\n NOT_INSTALLED: inc(), // 27\n NOT_AVAILABLE_IN_LEGACY_MODE: inc(), // 28\n // directive module errors\n REQUIRED_VALUE: inc(), // 29\n INVALID_VALUE: inc(), // 30\n // vue-devtools errors\n CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: inc(), // 31\n NOT_INSTALLED_WITH_PROVIDE: inc(), // 32\n // unexpected error\n UNEXPECTED_ERROR: inc(), // 33\n // not compatible legacy vue-i18n constructor\n NOT_COMPATIBLE_LEGACY_VUE_I18N: inc(), // 34\n // bridge support vue 2.x only\n BRIDGE_SUPPORT_VUE_2_ONLY: inc(), // 35\n // need to define `i18n` option in `allowComposition: true` and `useScope: 'local' at `useI18n``\n MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION: inc(), // 36\n // Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly\n NOT_AVAILABLE_COMPOSITION_IN_LEGACY: inc(), // 37\n // for enhancement\n __EXTEND_POINT__: inc() // 38\n};\nfunction createI18nError(code, ...args) {\n return createCompileError(code, null, (process.env.NODE_ENV !== 'production') ? { messages: errorMessages, args } : undefined);\n}\nconst errorMessages = {\n [I18nErrorCodes.UNEXPECTED_RETURN_TYPE]: 'Unexpected return type in composer',\n [I18nErrorCodes.INVALID_ARGUMENT]: 'Invalid argument',\n [I18nErrorCodes.MUST_BE_CALL_SETUP_TOP]: 'Must be called at the top of a `setup` function',\n [I18nErrorCodes.NOT_INSTALLED]: 'Need to install with `app.use` function',\n [I18nErrorCodes.UNEXPECTED_ERROR]: 'Unexpected error',\n [I18nErrorCodes.NOT_AVAILABLE_IN_LEGACY_MODE]: 'Not available in legacy mode',\n [I18nErrorCodes.REQUIRED_VALUE]: `Required in value: {0}`,\n [I18nErrorCodes.INVALID_VALUE]: `Invalid value`,\n [I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]: `Cannot setup vue-devtools plugin`,\n [I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE]: 'Need to install with `provide` function',\n [I18nErrorCodes.NOT_COMPATIBLE_LEGACY_VUE_I18N]: 'Not compatible legacy VueI18n.',\n [I18nErrorCodes.BRIDGE_SUPPORT_VUE_2_ONLY]: 'vue-i18n-bridge support Vue 2.x only',\n [I18nErrorCodes.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]: 'Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode',\n [I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]: 'Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly'\n};\n\nconst TranslateVNodeSymbol = \n/* #__PURE__*/ makeSymbol('__translateVNode');\nconst DatetimePartsSymbol = /* #__PURE__*/ makeSymbol('__datetimeParts');\nconst NumberPartsSymbol = /* #__PURE__*/ makeSymbol('__numberParts');\nconst EnableEmitter = /* #__PURE__*/ makeSymbol('__enableEmitter');\nconst DisableEmitter = /* #__PURE__*/ makeSymbol('__disableEmitter');\nconst SetPluralRulesSymbol = makeSymbol('__setPluralRules');\nmakeSymbol('__intlifyMeta');\nconst InejctWithOptionSymbol = \n/* #__PURE__*/ makeSymbol('__injectWithOption');\nconst DisposeSymbol = /* #__PURE__*/ makeSymbol('__dispose');\nconst __VUE_I18N_BRIDGE__ = '__VUE_I18N_BRIDGE__';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Transform flat json in obj to normal json in obj\n */\nfunction handleFlatJson(obj) {\n // check obj\n if (!isObject(obj)) {\n return obj;\n }\n for (const key in obj) {\n // check key\n if (!hasOwn(obj, key)) {\n continue;\n }\n // handle for normal json\n if (!key.includes('.')) {\n // recursive process value if value is also a object\n if (isObject(obj[key])) {\n handleFlatJson(obj[key]);\n }\n }\n // handle for flat json, transform to normal json\n else {\n // go to the last object\n const subKeys = key.split('.');\n const lastIndex = subKeys.length - 1;\n let currentObj = obj;\n let hasStringValue = false;\n for (let i = 0; i < lastIndex; i++) {\n if (!(subKeys[i] in currentObj)) {\n currentObj[subKeys[i]] = {};\n }\n if (!isObject(currentObj[subKeys[i]])) {\n (process.env.NODE_ENV !== 'production') &&\n warn(getWarnMessage(I18nWarnCodes.IGNORE_OBJ_FLATTEN, {\n key: subKeys[i]\n }));\n hasStringValue = true;\n break;\n }\n currentObj = currentObj[subKeys[i]];\n }\n // update last object value, delete old property\n if (!hasStringValue) {\n currentObj[subKeys[lastIndex]] = obj[key];\n delete obj[key];\n }\n // recursive process value if value is also a object\n if (isObject(currentObj[subKeys[lastIndex]])) {\n handleFlatJson(currentObj[subKeys[lastIndex]]);\n }\n }\n }\n return obj;\n}\nfunction getLocaleMessages(locale, options) {\n const { messages, __i18n, messageResolver, flatJson } = options;\n // prettier-ignore\n const ret = (isPlainObject(messages)\n ? messages\n : isArray(__i18n)\n ? {}\n : { [locale]: {} });\n // merge locale messages of i18n custom block\n if (isArray(__i18n)) {\n __i18n.forEach(custom => {\n if ('locale' in custom && 'resource' in custom) {\n const { locale, resource } = custom;\n if (locale) {\n ret[locale] = ret[locale] || {};\n deepCopy(resource, ret[locale]);\n }\n else {\n deepCopy(resource, ret);\n }\n }\n else {\n isString(custom) && deepCopy(JSON.parse(custom), ret);\n }\n });\n }\n // handle messages for flat json\n if (messageResolver == null && flatJson) {\n for (const key in ret) {\n if (hasOwn(ret, key)) {\n handleFlatJson(ret[key]);\n }\n }\n }\n return ret;\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getComponentOptions(instance) {\n return instance.type ;\n}\nfunction adjustI18nResources(gl, options, componentOptions // eslint-disable-line @typescript-eslint/no-explicit-any\n) {\n let messages = isObject(options.messages) ? options.messages : {};\n if ('__i18nGlobal' in componentOptions) {\n messages = getLocaleMessages(gl.locale.value, {\n messages,\n __i18n: componentOptions.__i18nGlobal\n });\n }\n // merge locale messages\n const locales = Object.keys(messages);\n if (locales.length) {\n locales.forEach(locale => {\n gl.mergeLocaleMessage(locale, messages[locale]);\n });\n }\n {\n // merge datetime formats\n if (isObject(options.datetimeFormats)) {\n const locales = Object.keys(options.datetimeFormats);\n if (locales.length) {\n locales.forEach(locale => {\n gl.mergeDateTimeFormat(locale, options.datetimeFormats[locale]);\n });\n }\n }\n // merge number formats\n if (isObject(options.numberFormats)) {\n const locales = Object.keys(options.numberFormats);\n if (locales.length) {\n locales.forEach(locale => {\n gl.mergeNumberFormat(locale, options.numberFormats[locale]);\n });\n }\n }\n }\n}\nfunction createTextNode(key) {\n return createVNode(Text, null, key, 0)\n ;\n}\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n// extend VNode interface\nconst DEVTOOLS_META = '__INTLIFY_META__';\nconst NOOP_RETURN_ARRAY = () => [];\nconst NOOP_RETURN_FALSE = () => false;\nlet composerID = 0;\nfunction defineCoreMissingHandler(missing) {\n return ((ctx, locale, key, type) => {\n return missing(locale, key, getCurrentInstance() || undefined, type);\n });\n}\n// for Intlify DevTools\n/* #__NO_SIDE_EFFECTS__ */\nconst getMetaInfo = () => {\n const instance = getCurrentInstance();\n let meta = null; // eslint-disable-line @typescript-eslint/no-explicit-any\n return instance && (meta = getComponentOptions(instance)[DEVTOOLS_META])\n ? { [DEVTOOLS_META]: meta } // eslint-disable-line @typescript-eslint/no-explicit-any\n : null;\n};\n/**\n * Create composer interface factory\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction createComposer(options = {}, VueI18nLegacy) {\n const { __root, __injectWithOption } = options;\n const _isGlobal = __root === undefined;\n const flatJson = options.flatJson;\n const _ref = inBrowser ? ref : shallowRef;\n const translateExistCompatible = !!options.translateExistCompatible;\n if ((process.env.NODE_ENV !== 'production')) {\n if (translateExistCompatible && !false) {\n warnOnce(getWarnMessage(I18nWarnCodes.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));\n }\n }\n let _inheritLocale = isBoolean(options.inheritLocale)\n ? options.inheritLocale\n : true;\n const _locale = _ref(\n // prettier-ignore\n __root && _inheritLocale\n ? __root.locale.value\n : isString(options.locale)\n ? options.locale\n : DEFAULT_LOCALE);\n const _fallbackLocale = _ref(\n // prettier-ignore\n __root && _inheritLocale\n ? __root.fallbackLocale.value\n : isString(options.fallbackLocale) ||\n isArray(options.fallbackLocale) ||\n isPlainObject(options.fallbackLocale) ||\n options.fallbackLocale === false\n ? options.fallbackLocale\n : _locale.value);\n const _messages = _ref(getLocaleMessages(_locale.value, options));\n // prettier-ignore\n const _datetimeFormats = _ref(isPlainObject(options.datetimeFormats)\n ? options.datetimeFormats\n : { [_locale.value]: {} })\n ;\n // prettier-ignore\n const _numberFormats = _ref(isPlainObject(options.numberFormats)\n ? options.numberFormats\n : { [_locale.value]: {} })\n ;\n // warning suppress options\n // prettier-ignore\n let _missingWarn = __root\n ? __root.missingWarn\n : isBoolean(options.missingWarn) || isRegExp(options.missingWarn)\n ? options.missingWarn\n : true;\n // prettier-ignore\n let _fallbackWarn = __root\n ? __root.fallbackWarn\n : isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn)\n ? options.fallbackWarn\n : true;\n // prettier-ignore\n let _fallbackRoot = __root\n ? __root.fallbackRoot\n : isBoolean(options.fallbackRoot)\n ? options.fallbackRoot\n : true;\n // configure fall back to root\n let _fallbackFormat = !!options.fallbackFormat;\n // runtime missing\n let _missing = isFunction(options.missing) ? options.missing : null;\n let _runtimeMissing = isFunction(options.missing)\n ? defineCoreMissingHandler(options.missing)\n : null;\n // postTranslation handler\n let _postTranslation = isFunction(options.postTranslation)\n ? options.postTranslation\n : null;\n // prettier-ignore\n let _warnHtmlMessage = __root\n ? __root.warnHtmlMessage\n : isBoolean(options.warnHtmlMessage)\n ? options.warnHtmlMessage\n : true;\n let _escapeParameter = !!options.escapeParameter;\n // custom linked modifiers\n // prettier-ignore\n const _modifiers = __root\n ? __root.modifiers\n : isPlainObject(options.modifiers)\n ? options.modifiers\n : {};\n // pluralRules\n let _pluralRules = options.pluralRules || (__root && __root.pluralRules);\n // runtime context\n // eslint-disable-next-line prefer-const\n let _context;\n const getCoreContext = () => {\n _isGlobal && setFallbackContext(null);\n const ctxOptions = {\n version: VERSION,\n locale: _locale.value,\n fallbackLocale: _fallbackLocale.value,\n messages: _messages.value,\n modifiers: _modifiers,\n pluralRules: _pluralRules,\n missing: _runtimeMissing === null ? undefined : _runtimeMissing,\n missingWarn: _missingWarn,\n fallbackWarn: _fallbackWarn,\n fallbackFormat: _fallbackFormat,\n unresolving: true,\n postTranslation: _postTranslation === null ? undefined : _postTranslation,\n warnHtmlMessage: _warnHtmlMessage,\n escapeParameter: _escapeParameter,\n messageResolver: options.messageResolver,\n messageCompiler: options.messageCompiler,\n __meta: { framework: 'vue' }\n };\n {\n ctxOptions.datetimeFormats = _datetimeFormats.value;\n ctxOptions.numberFormats = _numberFormats.value;\n ctxOptions.__datetimeFormatters = isPlainObject(_context)\n ? _context.__datetimeFormatters\n : undefined;\n ctxOptions.__numberFormatters = isPlainObject(_context)\n ? _context.__numberFormatters\n : undefined;\n }\n if ((process.env.NODE_ENV !== 'production')) {\n ctxOptions.__v_emitter = isPlainObject(_context)\n ? _context.__v_emitter\n : undefined;\n }\n const ctx = createCoreContext(ctxOptions);\n _isGlobal && setFallbackContext(ctx);\n return ctx;\n };\n _context = getCoreContext();\n updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);\n // track reactivity\n function trackReactivityValues() {\n return [\n _locale.value,\n _fallbackLocale.value,\n _messages.value,\n _datetimeFormats.value,\n _numberFormats.value\n ]\n ;\n }\n // locale\n const locale = computed({\n get: () => _locale.value,\n set: val => {\n _locale.value = val;\n _context.locale = _locale.value;\n }\n });\n // fallbackLocale\n const fallbackLocale = computed({\n get: () => _fallbackLocale.value,\n set: val => {\n _fallbackLocale.value = val;\n _context.fallbackLocale = _fallbackLocale.value;\n updateFallbackLocale(_context, _locale.value, val);\n }\n });\n // messages\n const messages = computed(() => _messages.value);\n // datetimeFormats\n const datetimeFormats = /* #__PURE__*/ computed(() => _datetimeFormats.value);\n // numberFormats\n const numberFormats = /* #__PURE__*/ computed(() => _numberFormats.value);\n // getPostTranslationHandler\n function getPostTranslationHandler() {\n return isFunction(_postTranslation) ? _postTranslation : null;\n }\n // setPostTranslationHandler\n function setPostTranslationHandler(handler) {\n _postTranslation = handler;\n _context.postTranslation = handler;\n }\n // getMissingHandler\n function getMissingHandler() {\n return _missing;\n }\n // setMissingHandler\n function setMissingHandler(handler) {\n if (handler !== null) {\n _runtimeMissing = defineCoreMissingHandler(handler);\n }\n _missing = handler;\n _context.missing = _runtimeMissing;\n }\n function isResolvedTranslateMessage(type, arg // eslint-disable-line @typescript-eslint/no-explicit-any\n ) {\n return type !== 'translate' || !arg.resolvedMessage;\n }\n const wrapWithDeps = (fn, argumentParser, warnType, fallbackSuccess, fallbackFail, successCondition) => {\n trackReactivityValues(); // track reactive dependency\n // NOTE: experimental !!\n let ret;\n try {\n if ((process.env.NODE_ENV !== 'production') || __INTLIFY_PROD_DEVTOOLS__) {\n setAdditionalMeta(getMetaInfo());\n }\n if (!_isGlobal) {\n _context.fallbackContext = __root\n ? getFallbackContext()\n : undefined;\n }\n ret = fn(_context);\n }\n finally {\n if ((process.env.NODE_ENV !== 'production') || __INTLIFY_PROD_DEVTOOLS__) {\n setAdditionalMeta(null);\n }\n if (!_isGlobal) {\n _context.fallbackContext = undefined;\n }\n }\n if ((warnType !== 'translate exists' && // for not `te` (e.g `t`)\n isNumber(ret) &&\n ret === NOT_REOSLVED) ||\n (warnType === 'translate exists' && !ret) // for `te`\n ) {\n const [key, arg2] = argumentParser();\n if ((process.env.NODE_ENV !== 'production') &&\n __root &&\n isString(key) &&\n isResolvedTranslateMessage(warnType, arg2)) {\n if (_fallbackRoot &&\n (isTranslateFallbackWarn(_fallbackWarn, key) ||\n isTranslateMissingWarn(_missingWarn, key))) {\n warn(getWarnMessage(I18nWarnCodes.FALLBACK_TO_ROOT, {\n key,\n type: warnType\n }));\n }\n // for vue-devtools timeline event\n if ((process.env.NODE_ENV !== 'production')) {\n const { __v_emitter: emitter } = _context;\n if (emitter && _fallbackRoot) {\n emitter.emit(\"fallback\" /* VueDevToolsTimelineEvents.FALBACK */, {\n type: warnType,\n key,\n to: 'global',\n groupId: `${warnType}:${key}`\n });\n }\n }\n }\n return __root && _fallbackRoot\n ? fallbackSuccess(__root)\n : fallbackFail(key);\n }\n else if (successCondition(ret)) {\n return ret;\n }\n else {\n /* istanbul ignore next */\n throw createI18nError(I18nErrorCodes.UNEXPECTED_RETURN_TYPE);\n }\n };\n // t\n function t(...args) {\n return wrapWithDeps(context => Reflect.apply(translate, null, [context, ...args]), () => parseTranslateArgs(...args), 'translate', root => Reflect.apply(root.t, root, [...args]), key => key, val => isString(val));\n }\n // rt\n function rt(...args) {\n const [arg1, arg2, arg3] = args;\n if (arg3 && !isObject(arg3)) {\n throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);\n }\n return t(...[arg1, arg2, assign({ resolvedMessage: true }, arg3 || {})]);\n }\n // d\n function d(...args) {\n return wrapWithDeps(context => Reflect.apply(datetime, null, [context, ...args]), () => parseDateTimeArgs(...args), 'datetime format', root => Reflect.apply(root.d, root, [...args]), () => MISSING_RESOLVE_VALUE, val => isString(val));\n }\n // n\n function n(...args) {\n return wrapWithDeps(context => Reflect.apply(number, null, [context, ...args]), () => parseNumberArgs(...args), 'number format', root => Reflect.apply(root.n, root, [...args]), () => MISSING_RESOLVE_VALUE, val => isString(val));\n }\n // for custom processor\n function normalize(values) {\n return values.map(val => isString(val) || isNumber(val) || isBoolean(val)\n ? createTextNode(String(val))\n : val);\n }\n const interpolate = (val) => val;\n const processor = {\n normalize,\n interpolate,\n type: 'vnode'\n };\n // translateVNode, using for `i18n-t` component\n function translateVNode(...args) {\n return wrapWithDeps(context => {\n let ret;\n const _context = context;\n try {\n _context.processor = processor;\n ret = Reflect.apply(translate, null, [_context, ...args]);\n }\n finally {\n _context.processor = null;\n }\n return ret;\n }, () => parseTranslateArgs(...args), 'translate', \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n root => root[TranslateVNodeSymbol](...args), key => [createTextNode(key)], val => isArray(val));\n }\n // numberParts, using for `i18n-n` component\n function numberParts(...args) {\n return wrapWithDeps(context => Reflect.apply(number, null, [context, ...args]), () => parseNumberArgs(...args), 'number format', \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n root => root[NumberPartsSymbol](...args), NOOP_RETURN_ARRAY, val => isString(val) || isArray(val));\n }\n // datetimeParts, using for `i18n-d` component\n function datetimeParts(...args) {\n return wrapWithDeps(context => Reflect.apply(datetime, null, [context, ...args]), () => parseDateTimeArgs(...args), 'datetime format', \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n root => root[DatetimePartsSymbol](...args), NOOP_RETURN_ARRAY, val => isString(val) || isArray(val));\n }\n function setPluralRules(rules) {\n _pluralRules = rules;\n _context.pluralRules = _pluralRules;\n }\n // te\n function te(key, locale) {\n return wrapWithDeps(() => {\n if (!key) {\n return false;\n }\n const targetLocale = isString(locale) ? locale : _locale.value;\n const message = getLocaleMessage(targetLocale);\n const resolved = _context.messageResolver(message, key);\n return !translateExistCompatible\n ? isMessageAST(resolved) ||\n isMessageFunction(resolved) ||\n isString(resolved)\n : resolved != null;\n }, () => [key], 'translate exists', root => {\n return Reflect.apply(root.te, root, [key, locale]);\n }, NOOP_RETURN_FALSE, val => isBoolean(val));\n }\n function resolveMessages(key) {\n let messages = null;\n const locales = fallbackWithLocaleChain(_context, _fallbackLocale.value, _locale.value);\n for (let i = 0; i < locales.length; i++) {\n const targetLocaleMessages = _messages.value[locales[i]] || {};\n const messageValue = _context.messageResolver(targetLocaleMessages, key);\n if (messageValue != null) {\n messages = messageValue;\n break;\n }\n }\n return messages;\n }\n // tm\n function tm(key) {\n const messages = resolveMessages(key);\n // prettier-ignore\n return messages != null\n ? messages\n : __root\n ? __root.tm(key) || {}\n : {};\n }\n // getLocaleMessage\n function getLocaleMessage(locale) {\n return (_messages.value[locale] || {});\n }\n // setLocaleMessage\n function setLocaleMessage(locale, message) {\n if (flatJson) {\n const _message = { [locale]: message };\n for (const key in _message) {\n if (hasOwn(_message, key)) {\n handleFlatJson(_message[key]);\n }\n }\n message = _message[locale];\n }\n _messages.value[locale] = message;\n _context.messages = _messages.value;\n }\n // mergeLocaleMessage\n function mergeLocaleMessage(locale, message) {\n _messages.value[locale] = _messages.value[locale] || {};\n const _message = { [locale]: message };\n if (flatJson) {\n for (const key in _message) {\n if (hasOwn(_message, key)) {\n handleFlatJson(_message[key]);\n }\n }\n }\n message = _message[locale];\n deepCopy(message, _messages.value[locale]);\n _context.messages = _messages.value;\n }\n // getDateTimeFormat\n function getDateTimeFormat(locale) {\n return _datetimeFormats.value[locale] || {};\n }\n // setDateTimeFormat\n function setDateTimeFormat(locale, format) {\n _datetimeFormats.value[locale] = format;\n _context.datetimeFormats = _datetimeFormats.value;\n clearDateTimeFormat(_context, locale, format);\n }\n // mergeDateTimeFormat\n function mergeDateTimeFormat(locale, format) {\n _datetimeFormats.value[locale] = assign(_datetimeFormats.value[locale] || {}, format);\n _context.datetimeFormats = _datetimeFormats.value;\n clearDateTimeFormat(_context, locale, format);\n }\n // getNumberFormat\n function getNumberFormat(locale) {\n return _numberFormats.value[locale] || {};\n }\n // setNumberFormat\n function setNumberFormat(locale, format) {\n _numberFormats.value[locale] = format;\n _context.numberFormats = _numberFormats.value;\n clearNumberFormat(_context, locale, format);\n }\n // mergeNumberFormat\n function mergeNumberFormat(locale, format) {\n _numberFormats.value[locale] = assign(_numberFormats.value[locale] || {}, format);\n _context.numberFormats = _numberFormats.value;\n clearNumberFormat(_context, locale, format);\n }\n // for debug\n composerID++;\n // watch root locale & fallbackLocale\n if (__root && inBrowser) {\n watch(__root.locale, (val) => {\n if (_inheritLocale) {\n _locale.value = val;\n _context.locale = val;\n updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);\n }\n });\n watch(__root.fallbackLocale, (val) => {\n if (_inheritLocale) {\n _fallbackLocale.value = val;\n _context.fallbackLocale = val;\n updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);\n }\n });\n }\n // define basic composition API!\n const composer = {\n id: composerID,\n locale,\n fallbackLocale,\n get inheritLocale() {\n return _inheritLocale;\n },\n set inheritLocale(val) {\n _inheritLocale = val;\n if (val && __root) {\n _locale.value = __root.locale.value;\n _fallbackLocale.value = __root.fallbackLocale.value;\n updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);\n }\n },\n get availableLocales() {\n return Object.keys(_messages.value).sort();\n },\n messages,\n get modifiers() {\n return _modifiers;\n },\n get pluralRules() {\n return _pluralRules || {};\n },\n get isGlobal() {\n return _isGlobal;\n },\n get missingWarn() {\n return _missingWarn;\n },\n set missingWarn(val) {\n _missingWarn = val;\n _context.missingWarn = _missingWarn;\n },\n get fallbackWarn() {\n return _fallbackWarn;\n },\n set fallbackWarn(val) {\n _fallbackWarn = val;\n _context.fallbackWarn = _fallbackWarn;\n },\n get fallbackRoot() {\n return _fallbackRoot;\n },\n set fallbackRoot(val) {\n _fallbackRoot = val;\n },\n get fallbackFormat() {\n return _fallbackFormat;\n },\n set fallbackFormat(val) {\n _fallbackFormat = val;\n _context.fallbackFormat = _fallbackFormat;\n },\n get warnHtmlMessage() {\n return _warnHtmlMessage;\n },\n set warnHtmlMessage(val) {\n _warnHtmlMessage = val;\n _context.warnHtmlMessage = val;\n },\n get escapeParameter() {\n return _escapeParameter;\n },\n set escapeParameter(val) {\n _escapeParameter = val;\n _context.escapeParameter = val;\n },\n t,\n getLocaleMessage,\n setLocaleMessage,\n mergeLocaleMessage,\n getPostTranslationHandler,\n setPostTranslationHandler,\n getMissingHandler,\n setMissingHandler,\n [SetPluralRulesSymbol]: setPluralRules\n };\n {\n composer.datetimeFormats = datetimeFormats;\n composer.numberFormats = numberFormats;\n composer.rt = rt;\n composer.te = te;\n composer.tm = tm;\n composer.d = d;\n composer.n = n;\n composer.getDateTimeFormat = getDateTimeFormat;\n composer.setDateTimeFormat = setDateTimeFormat;\n composer.mergeDateTimeFormat = mergeDateTimeFormat;\n composer.getNumberFormat = getNumberFormat;\n composer.setNumberFormat = setNumberFormat;\n composer.mergeNumberFormat = mergeNumberFormat;\n composer[InejctWithOptionSymbol] = __injectWithOption;\n composer[TranslateVNodeSymbol] = translateVNode;\n composer[DatetimePartsSymbol] = datetimeParts;\n composer[NumberPartsSymbol] = numberParts;\n }\n // for vue-devtools timeline event\n if ((process.env.NODE_ENV !== 'production')) {\n composer[EnableEmitter] = (emitter) => {\n _context.__v_emitter = emitter;\n };\n composer[DisableEmitter] = () => {\n _context.__v_emitter = undefined;\n };\n }\n return composer;\n}\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Convert to I18n Composer Options from VueI18n Options\n *\n * @internal\n */\nfunction convertComposerOptions(options) {\n const locale = isString(options.locale) ? options.locale : DEFAULT_LOCALE;\n const fallbackLocale = isString(options.fallbackLocale) ||\n isArray(options.fallbackLocale) ||\n isPlainObject(options.fallbackLocale) ||\n options.fallbackLocale === false\n ? options.fallbackLocale\n : locale;\n const missing = isFunction(options.missing) ? options.missing : undefined;\n const missingWarn = isBoolean(options.silentTranslationWarn) ||\n isRegExp(options.silentTranslationWarn)\n ? !options.silentTranslationWarn\n : true;\n const fallbackWarn = isBoolean(options.silentFallbackWarn) ||\n isRegExp(options.silentFallbackWarn)\n ? !options.silentFallbackWarn\n : true;\n const fallbackRoot = isBoolean(options.fallbackRoot)\n ? options.fallbackRoot\n : true;\n const fallbackFormat = !!options.formatFallbackMessages;\n const modifiers = isPlainObject(options.modifiers) ? options.modifiers : {};\n const pluralizationRules = options.pluralizationRules;\n const postTranslation = isFunction(options.postTranslation)\n ? options.postTranslation\n : undefined;\n const warnHtmlMessage = isString(options.warnHtmlInMessage)\n ? options.warnHtmlInMessage !== 'off'\n : true;\n const escapeParameter = !!options.escapeParameterHtml;\n const inheritLocale = isBoolean(options.sync) ? options.sync : true;\n if ((process.env.NODE_ENV !== 'production') && options.formatter) {\n warn(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_FORMATTER));\n }\n if ((process.env.NODE_ENV !== 'production') && options.preserveDirectiveContent) {\n warn(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE));\n }\n let messages = options.messages;\n if (isPlainObject(options.sharedMessages)) {\n const sharedMessages = options.sharedMessages;\n const locales = Object.keys(sharedMessages);\n messages = locales.reduce((messages, locale) => {\n const message = messages[locale] || (messages[locale] = {});\n assign(message, sharedMessages[locale]);\n return messages;\n }, (messages || {}));\n }\n const { __i18n, __root, __injectWithOption } = options;\n const datetimeFormats = options.datetimeFormats;\n const numberFormats = options.numberFormats;\n const flatJson = options.flatJson;\n const translateExistCompatible = options\n .translateExistCompatible;\n return {\n locale,\n fallbackLocale,\n messages,\n flatJson,\n datetimeFormats,\n numberFormats,\n missing,\n missingWarn,\n fallbackWarn,\n fallbackRoot,\n fallbackFormat,\n modifiers,\n pluralRules: pluralizationRules,\n postTranslation,\n warnHtmlMessage,\n escapeParameter,\n messageResolver: options.messageResolver,\n inheritLocale,\n translateExistCompatible,\n __i18n,\n __root,\n __injectWithOption\n };\n}\n/**\n * create VueI18n interface factory\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction createVueI18n(options = {}, VueI18nLegacy) {\n {\n const composer = createComposer(convertComposerOptions(options));\n const { __extender } = options;\n // defines VueI18n\n const vueI18n = {\n // id\n id: composer.id,\n // locale\n get locale() {\n return composer.locale.value;\n },\n set locale(val) {\n composer.locale.value = val;\n },\n // fallbackLocale\n get fallbackLocale() {\n return composer.fallbackLocale.value;\n },\n set fallbackLocale(val) {\n composer.fallbackLocale.value = val;\n },\n // messages\n get messages() {\n return composer.messages.value;\n },\n // datetimeFormats\n get datetimeFormats() {\n return composer.datetimeFormats.value;\n },\n // numberFormats\n get numberFormats() {\n return composer.numberFormats.value;\n },\n // availableLocales\n get availableLocales() {\n return composer.availableLocales;\n },\n // formatter\n get formatter() {\n (process.env.NODE_ENV !== 'production') && warn(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_FORMATTER));\n // dummy\n return {\n interpolate() {\n return [];\n }\n };\n },\n set formatter(val) {\n (process.env.NODE_ENV !== 'production') && warn(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_FORMATTER));\n },\n // missing\n get missing() {\n return composer.getMissingHandler();\n },\n set missing(handler) {\n composer.setMissingHandler(handler);\n },\n // silentTranslationWarn\n get silentTranslationWarn() {\n return isBoolean(composer.missingWarn)\n ? !composer.missingWarn\n : composer.missingWarn;\n },\n set silentTranslationWarn(val) {\n composer.missingWarn = isBoolean(val) ? !val : val;\n },\n // silentFallbackWarn\n get silentFallbackWarn() {\n return isBoolean(composer.fallbackWarn)\n ? !composer.fallbackWarn\n : composer.fallbackWarn;\n },\n set silentFallbackWarn(val) {\n composer.fallbackWarn = isBoolean(val) ? !val : val;\n },\n // modifiers\n get modifiers() {\n return composer.modifiers;\n },\n // formatFallbackMessages\n get formatFallbackMessages() {\n return composer.fallbackFormat;\n },\n set formatFallbackMessages(val) {\n composer.fallbackFormat = val;\n },\n // postTranslation\n get postTranslation() {\n return composer.getPostTranslationHandler();\n },\n set postTranslation(handler) {\n composer.setPostTranslationHandler(handler);\n },\n // sync\n get sync() {\n return composer.inheritLocale;\n },\n set sync(val) {\n composer.inheritLocale = val;\n },\n // warnInHtmlMessage\n get warnHtmlInMessage() {\n return composer.warnHtmlMessage ? 'warn' : 'off';\n },\n set warnHtmlInMessage(val) {\n composer.warnHtmlMessage = val !== 'off';\n },\n // escapeParameterHtml\n get escapeParameterHtml() {\n return composer.escapeParameter;\n },\n set escapeParameterHtml(val) {\n composer.escapeParameter = val;\n },\n // preserveDirectiveContent\n get preserveDirectiveContent() {\n (process.env.NODE_ENV !== 'production') &&\n warn(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE));\n return true;\n },\n set preserveDirectiveContent(val) {\n (process.env.NODE_ENV !== 'production') &&\n warn(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE));\n },\n // pluralizationRules\n get pluralizationRules() {\n return composer.pluralRules || {};\n },\n // for internal\n __composer: composer,\n // t\n t(...args) {\n const [arg1, arg2, arg3] = args;\n const options = {};\n let list = null;\n let named = null;\n if (!isString(arg1)) {\n throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);\n }\n const key = arg1;\n if (isString(arg2)) {\n options.locale = arg2;\n }\n else if (isArray(arg2)) {\n list = arg2;\n }\n else if (isPlainObject(arg2)) {\n named = arg2;\n }\n if (isArray(arg3)) {\n list = arg3;\n }\n else if (isPlainObject(arg3)) {\n named = arg3;\n }\n // return composer.t(key, (list || named || {}) as any, options)\n return Reflect.apply(composer.t, composer, [\n key,\n (list || named || {}),\n options\n ]);\n },\n rt(...args) {\n return Reflect.apply(composer.rt, composer, [...args]);\n },\n // tc\n tc(...args) {\n const [arg1, arg2, arg3] = args;\n const options = { plural: 1 };\n let list = null;\n let named = null;\n if (!isString(arg1)) {\n throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);\n }\n const key = arg1;\n if (isString(arg2)) {\n options.locale = arg2;\n }\n else if (isNumber(arg2)) {\n options.plural = arg2;\n }\n else if (isArray(arg2)) {\n list = arg2;\n }\n else if (isPlainObject(arg2)) {\n named = arg2;\n }\n if (isString(arg3)) {\n options.locale = arg3;\n }\n else if (isArray(arg3)) {\n list = arg3;\n }\n else if (isPlainObject(arg3)) {\n named = arg3;\n }\n // return composer.t(key, (list || named || {}) as any, options)\n return Reflect.apply(composer.t, composer, [\n key,\n (list || named || {}),\n options\n ]);\n },\n // te\n te(key, locale) {\n return composer.te(key, locale);\n },\n // tm\n tm(key) {\n return composer.tm(key);\n },\n // getLocaleMessage\n getLocaleMessage(locale) {\n return composer.getLocaleMessage(locale);\n },\n // setLocaleMessage\n setLocaleMessage(locale, message) {\n composer.setLocaleMessage(locale, message);\n },\n // mergeLocaleMessage\n mergeLocaleMessage(locale, message) {\n composer.mergeLocaleMessage(locale, message);\n },\n // d\n d(...args) {\n return Reflect.apply(composer.d, composer, [...args]);\n },\n // getDateTimeFormat\n getDateTimeFormat(locale) {\n return composer.getDateTimeFormat(locale);\n },\n // setDateTimeFormat\n setDateTimeFormat(locale, format) {\n composer.setDateTimeFormat(locale, format);\n },\n // mergeDateTimeFormat\n mergeDateTimeFormat(locale, format) {\n composer.mergeDateTimeFormat(locale, format);\n },\n // n\n n(...args) {\n return Reflect.apply(composer.n, composer, [...args]);\n },\n // getNumberFormat\n getNumberFormat(locale) {\n return composer.getNumberFormat(locale);\n },\n // setNumberFormat\n setNumberFormat(locale, format) {\n composer.setNumberFormat(locale, format);\n },\n // mergeNumberFormat\n mergeNumberFormat(locale, format) {\n composer.mergeNumberFormat(locale, format);\n },\n // getChoiceIndex\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getChoiceIndex(choice, choicesLength) {\n (process.env.NODE_ENV !== 'production') &&\n warn(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_GET_CHOICE_INDEX));\n return -1;\n }\n };\n vueI18n.__extender = __extender;\n // for vue-devtools timeline event\n if ((process.env.NODE_ENV !== 'production')) {\n vueI18n.__enableEmitter = (emitter) => {\n const __composer = composer;\n __composer[EnableEmitter] && __composer[EnableEmitter](emitter);\n };\n vueI18n.__disableEmitter = () => {\n const __composer = composer;\n __composer[DisableEmitter] && __composer[DisableEmitter]();\n };\n }\n return vueI18n;\n }\n}\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nconst baseFormatProps = {\n tag: {\n type: [String, Object]\n },\n locale: {\n type: String\n },\n scope: {\n type: String,\n // NOTE: avoid https://github.com/microsoft/rushstack/issues/1050\n validator: (val /* ComponentI18nScope */) => val === 'parent' || val === 'global',\n default: 'parent' /* ComponentI18nScope */\n },\n i18n: {\n type: Object\n }\n};\n\nfunction getInterpolateArg(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n{ slots }, // SetupContext,\nkeys) {\n if (keys.length === 1 && keys[0] === 'default') {\n // default slot with list\n const ret = slots.default ? slots.default() : [];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return ret.reduce((slot, current) => {\n return [\n ...slot,\n // prettier-ignore\n ...(current.type === Fragment ? current.children : [current]\n )\n ];\n }, []);\n }\n else {\n // named slots\n return keys.reduce((arg, key) => {\n const slot = slots[key];\n if (slot) {\n arg[key] = slot();\n }\n return arg;\n }, {});\n }\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getFragmentableTag(tag) {\n return Fragment ;\n}\n\nconst TranslationImpl = /*#__PURE__*/ defineComponent({\n /* eslint-disable */\n name: 'i18n-t',\n props: assign({\n keypath: {\n type: String,\n required: true\n },\n plural: {\n type: [Number, String],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n validator: (val) => isNumber(val) || !isNaN(val)\n }\n }, baseFormatProps),\n /* eslint-enable */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setup(props, context) {\n const { slots, attrs } = context;\n // NOTE: avoid https://github.com/microsoft/rushstack/issues/1050\n const i18n = props.i18n ||\n useI18n({\n useScope: props.scope,\n __useComponent: true\n });\n return () => {\n const keys = Object.keys(slots).filter(key => key !== '_');\n const options = {};\n if (props.locale) {\n options.locale = props.locale;\n }\n if (props.plural !== undefined) {\n options.plural = isString(props.plural) ? +props.plural : props.plural;\n }\n const arg = getInterpolateArg(context, keys);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const children = i18n[TranslateVNodeSymbol](props.keypath, arg, options);\n const assignedAttrs = assign({}, attrs);\n const tag = isString(props.tag) || isObject(props.tag)\n ? props.tag\n : getFragmentableTag();\n return h(tag, assignedAttrs, children);\n };\n }\n});\n/**\n * export the public type for h/tsx inference\n * also to avoid inline import() in generated d.ts files\n */\n/**\n * Translation Component\n *\n * @remarks\n * See the following items for property about details\n *\n * @VueI18nSee [TranslationProps](component#translationprops)\n * @VueI18nSee [BaseFormatProps](component#baseformatprops)\n * @VueI18nSee [Component Interpolation](../guide/advanced/component)\n *\n * @example\n * ```html\n *
\n * \n * \n * {{ $t('tos') }}\n * \n * \n *
\n * ```\n * ```js\n * import { createApp } from 'vue'\n * import { createI18n } from 'vue-i18n'\n *\n * const messages = {\n * en: {\n * tos: 'Term of Service',\n * term: 'I accept xxx {0}.'\n * },\n * ja: {\n * tos: '利用規約',\n * term: '私は xxx の{0}に同意します。'\n * }\n * }\n *\n * const i18n = createI18n({\n * locale: 'en',\n * messages\n * })\n *\n * const app = createApp({\n * data: {\n * url: '/term'\n * }\n * }).use(i18n).mount('#app')\n * ```\n *\n * @VueI18nComponent\n */\nconst Translation = TranslationImpl;\nconst I18nT = Translation;\n\nfunction isVNode(target) {\n return isArray(target) && !isString(target[0]);\n}\nfunction renderFormatter(props, context, slotKeys, partFormatter) {\n const { slots, attrs } = context;\n return () => {\n const options = { part: true };\n let overrides = {};\n if (props.locale) {\n options.locale = props.locale;\n }\n if (isString(props.format)) {\n options.key = props.format;\n }\n else if (isObject(props.format)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isString(props.format.key)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n options.key = props.format.key;\n }\n // Filter out number format options only\n overrides = Object.keys(props.format).reduce((options, prop) => {\n return slotKeys.includes(prop)\n ? assign({}, options, { [prop]: props.format[prop] }) // eslint-disable-line @typescript-eslint/no-explicit-any\n : options;\n }, {});\n }\n const parts = partFormatter(...[props.value, options, overrides]);\n let children = [options.key];\n if (isArray(parts)) {\n children = parts.map((part, index) => {\n const slot = slots[part.type];\n const node = slot\n ? slot({ [part.type]: part.value, index, parts })\n : [part.value];\n if (isVNode(node)) {\n node[0].key = `${part.type}-${index}`;\n }\n return node;\n });\n }\n else if (isString(parts)) {\n children = [parts];\n }\n const assignedAttrs = assign({}, attrs);\n const tag = isString(props.tag) || isObject(props.tag)\n ? props.tag\n : getFragmentableTag();\n return h(tag, assignedAttrs, children);\n };\n}\n\nconst NumberFormatImpl = /*#__PURE__*/ defineComponent({\n /* eslint-disable */\n name: 'i18n-n',\n props: assign({\n value: {\n type: Number,\n required: true\n },\n format: {\n type: [String, Object]\n }\n }, baseFormatProps),\n /* eslint-enable */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setup(props, context) {\n const i18n = props.i18n ||\n useI18n({\n useScope: props.scope,\n __useComponent: true\n });\n return renderFormatter(props, context, NUMBER_FORMAT_OPTIONS_KEYS, (...args) => \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n i18n[NumberPartsSymbol](...args));\n }\n});\n/**\n * export the public type for h/tsx inference\n * also to avoid inline import() in generated d.ts files\n */\n/**\n * Number Format Component\n *\n * @remarks\n * See the following items for property about details\n *\n * @VueI18nSee [FormattableProps](component#formattableprops)\n * @VueI18nSee [BaseFormatProps](component#baseformatprops)\n * @VueI18nSee [Custom Formatting](../guide/essentials/number#custom-formatting)\n *\n * @VueI18nDanger\n * Not supported IE, due to no support `Intl.NumberFormat#formatToParts` in [IE](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatToParts)\n *\n * If you want to use it, you need to use [polyfill](https://github.com/formatjs/formatjs/tree/main/packages/intl-numberformat)\n *\n * @VueI18nComponent\n */\nconst NumberFormat = NumberFormatImpl;\nconst I18nN = NumberFormat;\n\nconst DatetimeFormatImpl = /* #__PURE__*/ defineComponent({\n /* eslint-disable */\n name: 'i18n-d',\n props: assign({\n value: {\n type: [Number, Date],\n required: true\n },\n format: {\n type: [String, Object]\n }\n }, baseFormatProps),\n /* eslint-enable */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setup(props, context) {\n const i18n = props.i18n ||\n useI18n({\n useScope: props.scope,\n __useComponent: true\n });\n return renderFormatter(props, context, DATETIME_FORMAT_OPTIONS_KEYS, (...args) => \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n i18n[DatetimePartsSymbol](...args));\n }\n});\n/**\n * Datetime Format Component\n *\n * @remarks\n * See the following items for property about details\n *\n * @VueI18nSee [FormattableProps](component#formattableprops)\n * @VueI18nSee [BaseFormatProps](component#baseformatprops)\n * @VueI18nSee [Custom Formatting](../guide/essentials/datetime#custom-formatting)\n *\n * @VueI18nDanger\n * Not supported IE, due to no support `Intl.DateTimeFormat#formatToParts` in [IE](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts)\n *\n * If you want to use it, you need to use [polyfill](https://github.com/formatjs/formatjs/tree/main/packages/intl-datetimeformat)\n *\n * @VueI18nComponent\n */\nconst DatetimeFormat = DatetimeFormatImpl;\nconst I18nD = DatetimeFormat;\n\nfunction getComposer$2(i18n, instance) {\n const i18nInternal = i18n;\n if (i18n.mode === 'composition') {\n return (i18nInternal.__getInstance(instance) || i18n.global);\n }\n else {\n const vueI18n = i18nInternal.__getInstance(instance);\n return vueI18n != null\n ? vueI18n.__composer\n : i18n.global.__composer;\n }\n}\nfunction vTDirective(i18n) {\n const _process = (binding) => {\n const { instance, modifiers, value } = binding;\n /* istanbul ignore if */\n if (!instance || !instance.$) {\n throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);\n }\n const composer = getComposer$2(i18n, instance.$);\n if ((process.env.NODE_ENV !== 'production') && modifiers.preserve) {\n warn(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE));\n }\n const parsedValue = parseValue(value);\n return [\n Reflect.apply(composer.t, composer, [...makeParams(parsedValue)]),\n composer\n ];\n };\n const register = (el, binding) => {\n const [textContent, composer] = _process(binding);\n if (inBrowser && i18n.global === composer) {\n // global scope only\n el.__i18nWatcher = watch(composer.locale, () => {\n binding.instance && binding.instance.$forceUpdate();\n });\n }\n el.__composer = composer;\n el.textContent = textContent;\n };\n const unregister = (el) => {\n if (inBrowser && el.__i18nWatcher) {\n el.__i18nWatcher();\n el.__i18nWatcher = undefined;\n delete el.__i18nWatcher;\n }\n if (el.__composer) {\n el.__composer = undefined;\n delete el.__composer;\n }\n };\n const update = (el, { value }) => {\n if (el.__composer) {\n const composer = el.__composer;\n const parsedValue = parseValue(value);\n el.textContent = Reflect.apply(composer.t, composer, [\n ...makeParams(parsedValue)\n ]);\n }\n };\n const getSSRProps = (binding) => {\n const [textContent] = _process(binding);\n return { textContent };\n };\n return {\n created: register,\n unmounted: unregister,\n beforeUpdate: update,\n getSSRProps\n };\n}\nfunction parseValue(value) {\n if (isString(value)) {\n return { path: value };\n }\n else if (isPlainObject(value)) {\n if (!('path' in value)) {\n throw createI18nError(I18nErrorCodes.REQUIRED_VALUE, 'path');\n }\n return value;\n }\n else {\n throw createI18nError(I18nErrorCodes.INVALID_VALUE);\n }\n}\nfunction makeParams(value) {\n const { path, locale, args, choice, plural } = value;\n const options = {};\n const named = args || {};\n if (isString(locale)) {\n options.locale = locale;\n }\n if (isNumber(choice)) {\n options.plural = choice;\n }\n if (isNumber(plural)) {\n options.plural = plural;\n }\n return [path, named, options];\n}\n\nfunction apply(app, i18n, ...options) {\n const pluginOptions = isPlainObject(options[0])\n ? options[0]\n : {};\n const useI18nComponentName = !!pluginOptions.useI18nComponentName;\n const globalInstall = isBoolean(pluginOptions.globalInstall)\n ? pluginOptions.globalInstall\n : true;\n if ((process.env.NODE_ENV !== 'production') && globalInstall && useI18nComponentName) {\n warn(getWarnMessage(I18nWarnCodes.COMPONENT_NAME_LEGACY_COMPATIBLE, {\n name: Translation.name\n }));\n }\n if (globalInstall) {\n [!useI18nComponentName ? Translation.name : 'i18n', 'I18nT'].forEach(name => app.component(name, Translation));\n [NumberFormat.name, 'I18nN'].forEach(name => app.component(name, NumberFormat));\n [DatetimeFormat.name, 'I18nD'].forEach(name => app.component(name, DatetimeFormat));\n }\n // install directive\n {\n app.directive('t', vTDirective(i18n));\n }\n}\n\nconst VueDevToolsLabels = {\n [\"vue-devtools-plugin-vue-i18n\" /* VueDevToolsIDs.PLUGIN */]: 'Vue I18n devtools',\n [\"vue-i18n-resource-inspector\" /* VueDevToolsIDs.CUSTOM_INSPECTOR */]: 'I18n Resources',\n [\"vue-i18n-timeline\" /* VueDevToolsIDs.TIMELINE */]: 'Vue I18n'\n};\nconst VueDevToolsPlaceholders = {\n [\"vue-i18n-resource-inspector\" /* VueDevToolsIDs.CUSTOM_INSPECTOR */]: 'Search for scopes ...'\n};\nconst VueDevToolsTimelineColors = {\n [\"vue-i18n-timeline\" /* VueDevToolsIDs.TIMELINE */]: 0xffcd19\n};\n\nconst VUE_I18N_COMPONENT_TYPES = 'vue-i18n: composer properties';\nlet devtoolsApi;\nasync function enableDevTools(app, i18n) {\n return new Promise((resolve, reject) => {\n try {\n setupDevtoolsPlugin({\n id: \"vue-devtools-plugin-vue-i18n\" /* VueDevToolsIDs.PLUGIN */,\n label: VueDevToolsLabels[\"vue-devtools-plugin-vue-i18n\" /* VueDevToolsIDs.PLUGIN */],\n packageName: 'vue-i18n',\n homepage: 'https://vue-i18n.intlify.dev',\n logo: 'https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png',\n componentStateTypes: [VUE_I18N_COMPONENT_TYPES],\n app: app // eslint-disable-line @typescript-eslint/no-explicit-any\n }, api => {\n devtoolsApi = api;\n api.on.visitComponentTree(({ componentInstance, treeNode }) => {\n updateComponentTreeTags(componentInstance, treeNode, i18n);\n });\n api.on.inspectComponent(({ componentInstance, instanceData }) => {\n if (componentInstance.vnode.el &&\n componentInstance.vnode.el.__VUE_I18N__ &&\n instanceData) {\n if (i18n.mode === 'legacy') {\n // ignore global scope on legacy mode\n if (componentInstance.vnode.el.__VUE_I18N__ !==\n i18n.global.__composer) {\n inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);\n }\n }\n else {\n inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);\n }\n }\n });\n api.addInspector({\n id: \"vue-i18n-resource-inspector\" /* VueDevToolsIDs.CUSTOM_INSPECTOR */,\n label: VueDevToolsLabels[\"vue-i18n-resource-inspector\" /* VueDevToolsIDs.CUSTOM_INSPECTOR */],\n icon: 'language',\n treeFilterPlaceholder: VueDevToolsPlaceholders[\"vue-i18n-resource-inspector\" /* VueDevToolsIDs.CUSTOM_INSPECTOR */]\n });\n api.on.getInspectorTree(payload => {\n if (payload.app === app &&\n payload.inspectorId === \"vue-i18n-resource-inspector\" /* VueDevToolsIDs.CUSTOM_INSPECTOR */) {\n registerScope(payload, i18n);\n }\n });\n const roots = new Map();\n api.on.getInspectorState(async (payload) => {\n if (payload.app === app &&\n payload.inspectorId === \"vue-i18n-resource-inspector\" /* VueDevToolsIDs.CUSTOM_INSPECTOR */) {\n api.unhighlightElement();\n inspectScope(payload, i18n);\n if (payload.nodeId === 'global') {\n if (!roots.has(payload.app)) {\n const [root] = await api.getComponentInstances(payload.app);\n roots.set(payload.app, root);\n }\n api.highlightElement(roots.get(payload.app));\n }\n else {\n const instance = getComponentInstance(payload.nodeId, i18n);\n instance && api.highlightElement(instance);\n }\n }\n });\n api.on.editInspectorState(payload => {\n if (payload.app === app &&\n payload.inspectorId === \"vue-i18n-resource-inspector\" /* VueDevToolsIDs.CUSTOM_INSPECTOR */) {\n editScope(payload, i18n);\n }\n });\n api.addTimelineLayer({\n id: \"vue-i18n-timeline\" /* VueDevToolsIDs.TIMELINE */,\n label: VueDevToolsLabels[\"vue-i18n-timeline\" /* VueDevToolsIDs.TIMELINE */],\n color: VueDevToolsTimelineColors[\"vue-i18n-timeline\" /* VueDevToolsIDs.TIMELINE */]\n });\n resolve(true);\n });\n }\n catch (e) {\n console.error(e);\n reject(false);\n }\n });\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getI18nScopeLable(instance) {\n return (instance.type.name ||\n instance.type.displayName ||\n instance.type.__file ||\n 'Anonymous');\n}\nfunction updateComponentTreeTags(instance, // eslint-disable-line @typescript-eslint/no-explicit-any\ntreeNode, i18n) {\n // prettier-ignore\n const global = i18n.mode === 'composition'\n ? i18n.global\n : i18n.global.__composer;\n if (instance && instance.vnode.el && instance.vnode.el.__VUE_I18N__) {\n // add custom tags local scope only\n if (instance.vnode.el.__VUE_I18N__ !== global) {\n const tag = {\n label: `i18n (${getI18nScopeLable(instance)} Scope)`,\n textColor: 0x000000,\n backgroundColor: 0xffcd19\n };\n treeNode.tags.push(tag);\n }\n }\n}\nfunction inspectComposer(instanceData, composer) {\n const type = VUE_I18N_COMPONENT_TYPES;\n instanceData.state.push({\n type,\n key: 'locale',\n editable: true,\n value: composer.locale.value\n });\n instanceData.state.push({\n type,\n key: 'availableLocales',\n editable: false,\n value: composer.availableLocales\n });\n instanceData.state.push({\n type,\n key: 'fallbackLocale',\n editable: true,\n value: composer.fallbackLocale.value\n });\n instanceData.state.push({\n type,\n key: 'inheritLocale',\n editable: true,\n value: composer.inheritLocale\n });\n instanceData.state.push({\n type,\n key: 'messages',\n editable: false,\n value: getLocaleMessageValue(composer.messages.value)\n });\n {\n instanceData.state.push({\n type,\n key: 'datetimeFormats',\n editable: false,\n value: composer.datetimeFormats.value\n });\n instanceData.state.push({\n type,\n key: 'numberFormats',\n editable: false,\n value: composer.numberFormats.value\n });\n }\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getLocaleMessageValue(messages) {\n const value = {};\n Object.keys(messages).forEach((key) => {\n const v = messages[key];\n if (isFunction(v) && 'source' in v) {\n value[key] = getMessageFunctionDetails(v);\n }\n else if (isMessageAST(v) && v.loc && v.loc.source) {\n value[key] = v.loc.source;\n }\n else if (isObject(v)) {\n value[key] = getLocaleMessageValue(v);\n }\n else {\n value[key] = v;\n }\n });\n return value;\n}\nconst ESC = {\n '<': '<',\n '>': '>',\n '\"': '"',\n '&': '&'\n};\nfunction escape(s) {\n return s.replace(/[<>\"&]/g, escapeChar);\n}\nfunction escapeChar(a) {\n return ESC[a] || a;\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getMessageFunctionDetails(func) {\n const argString = func.source ? `(\"${escape(func.source)}\")` : `(?)`;\n return {\n _custom: {\n type: 'function',\n display: `ƒ ${argString}`\n }\n };\n}\nfunction registerScope(payload, i18n) {\n payload.rootNodes.push({\n id: 'global',\n label: 'Global Scope'\n });\n // prettier-ignore\n const global = i18n.mode === 'composition'\n ? i18n.global\n : i18n.global.__composer;\n for (const [keyInstance, instance] of i18n.__instances) {\n // prettier-ignore\n const composer = i18n.mode === 'composition'\n ? instance\n : instance.__composer;\n if (global === composer) {\n continue;\n }\n payload.rootNodes.push({\n id: composer.id.toString(),\n label: `${getI18nScopeLable(keyInstance)} Scope`\n });\n }\n}\nfunction getComponentInstance(nodeId, i18n) {\n let instance = null;\n if (nodeId !== 'global') {\n for (const [component, composer] of i18n.__instances.entries()) {\n if (composer.id.toString() === nodeId) {\n instance = component;\n break;\n }\n }\n }\n return instance;\n}\nfunction getComposer$1(nodeId, i18n) {\n if (nodeId === 'global') {\n return i18n.mode === 'composition'\n ? i18n.global\n : i18n.global.__composer;\n }\n else {\n const instance = Array.from(i18n.__instances.values()).find(item => item.id.toString() === nodeId);\n if (instance) {\n return i18n.mode === 'composition'\n ? instance\n : instance.__composer;\n }\n else {\n return null;\n }\n }\n}\nfunction inspectScope(payload, i18n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n) {\n const composer = getComposer$1(payload.nodeId, i18n);\n if (composer) {\n // TODO:\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n payload.state = makeScopeInspectState(composer);\n }\n return null;\n}\nfunction makeScopeInspectState(composer) {\n const state = {};\n const localeType = 'Locale related info';\n const localeStates = [\n {\n type: localeType,\n key: 'locale',\n editable: true,\n value: composer.locale.value\n },\n {\n type: localeType,\n key: 'fallbackLocale',\n editable: true,\n value: composer.fallbackLocale.value\n },\n {\n type: localeType,\n key: 'availableLocales',\n editable: false,\n value: composer.availableLocales\n },\n {\n type: localeType,\n key: 'inheritLocale',\n editable: true,\n value: composer.inheritLocale\n }\n ];\n state[localeType] = localeStates;\n const localeMessagesType = 'Locale messages info';\n const localeMessagesStates = [\n {\n type: localeMessagesType,\n key: 'messages',\n editable: false,\n value: getLocaleMessageValue(composer.messages.value)\n }\n ];\n state[localeMessagesType] = localeMessagesStates;\n {\n const datetimeFormatsType = 'Datetime formats info';\n const datetimeFormatsStates = [\n {\n type: datetimeFormatsType,\n key: 'datetimeFormats',\n editable: false,\n value: composer.datetimeFormats.value\n }\n ];\n state[datetimeFormatsType] = datetimeFormatsStates;\n const numberFormatsType = 'Datetime formats info';\n const numberFormatsStates = [\n {\n type: numberFormatsType,\n key: 'numberFormats',\n editable: false,\n value: composer.numberFormats.value\n }\n ];\n state[numberFormatsType] = numberFormatsStates;\n }\n return state;\n}\nfunction addTimelineEvent(event, payload) {\n if (devtoolsApi) {\n let groupId;\n if (payload && 'groupId' in payload) {\n groupId = payload.groupId;\n delete payload.groupId;\n }\n devtoolsApi.addTimelineEvent({\n layerId: \"vue-i18n-timeline\" /* VueDevToolsIDs.TIMELINE */,\n event: {\n title: event,\n groupId,\n time: Date.now(),\n meta: {},\n data: payload || {},\n logType: event === \"compile-error\" /* VueDevToolsTimelineEvents.COMPILE_ERROR */\n ? 'error'\n : event === \"fallback\" /* VueDevToolsTimelineEvents.FALBACK */ ||\n event === \"missing\" /* VueDevToolsTimelineEvents.MISSING */\n ? 'warning'\n : 'default'\n }\n });\n }\n}\nfunction editScope(payload, i18n) {\n const composer = getComposer$1(payload.nodeId, i18n);\n if (composer) {\n const [field] = payload.path;\n if (field === 'locale' && isString(payload.state.value)) {\n composer.locale.value = payload.state.value;\n }\n else if (field === 'fallbackLocale' &&\n (isString(payload.state.value) ||\n isArray(payload.state.value) ||\n isObject(payload.state.value))) {\n composer.fallbackLocale.value = payload.state.value;\n }\n else if (field === 'inheritLocale' && isBoolean(payload.state.value)) {\n composer.inheritLocale = payload.state.value;\n }\n }\n}\n\n/**\n * Supports compatibility for legacy vue-i18n APIs\n * This mixin is used when we use vue-i18n@v9.x or later\n */\nfunction defineMixin(vuei18n, composer, i18n) {\n return {\n beforeCreate() {\n const instance = getCurrentInstance();\n /* istanbul ignore if */\n if (!instance) {\n throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);\n }\n const options = this.$options;\n if (options.i18n) {\n const optionsI18n = options.i18n;\n if (options.__i18n) {\n optionsI18n.__i18n = options.__i18n;\n }\n optionsI18n.__root = composer;\n if (this === this.$root) {\n // merge option and gttach global\n this.$i18n = mergeToGlobal(vuei18n, optionsI18n);\n }\n else {\n optionsI18n.__injectWithOption = true;\n optionsI18n.__extender = i18n.__vueI18nExtend;\n // atttach local VueI18n instance\n this.$i18n = createVueI18n(optionsI18n);\n // extend VueI18n instance\n const _vueI18n = this.$i18n;\n if (_vueI18n.__extender) {\n _vueI18n.__disposer = _vueI18n.__extender(this.$i18n);\n }\n }\n }\n else if (options.__i18n) {\n if (this === this.$root) {\n // merge option and gttach global\n this.$i18n = mergeToGlobal(vuei18n, options);\n }\n else {\n // atttach local VueI18n instance\n this.$i18n = createVueI18n({\n __i18n: options.__i18n,\n __injectWithOption: true,\n __extender: i18n.__vueI18nExtend,\n __root: composer\n });\n // extend VueI18n instance\n const _vueI18n = this.$i18n;\n if (_vueI18n.__extender) {\n _vueI18n.__disposer = _vueI18n.__extender(this.$i18n);\n }\n }\n }\n else {\n // attach global VueI18n instance\n this.$i18n = vuei18n;\n }\n if (options.__i18nGlobal) {\n adjustI18nResources(composer, options, options);\n }\n // defines vue-i18n legacy APIs\n this.$t = (...args) => this.$i18n.t(...args);\n this.$rt = (...args) => this.$i18n.rt(...args);\n this.$tc = (...args) => this.$i18n.tc(...args);\n this.$te = (key, locale) => this.$i18n.te(key, locale);\n this.$d = (...args) => this.$i18n.d(...args);\n this.$n = (...args) => this.$i18n.n(...args);\n this.$tm = (key) => this.$i18n.tm(key);\n i18n.__setInstance(instance, this.$i18n);\n },\n mounted() {\n /* istanbul ignore if */\n if (((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) &&\n !false &&\n this.$el &&\n this.$i18n) {\n const _vueI18n = this.$i18n;\n this.$el.__VUE_I18N__ = _vueI18n.__composer;\n const emitter = (this.__v_emitter =\n createEmitter());\n _vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);\n emitter.on('*', addTimelineEvent);\n }\n },\n unmounted() {\n const instance = getCurrentInstance();\n /* istanbul ignore if */\n if (!instance) {\n throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);\n }\n const _vueI18n = this.$i18n;\n /* istanbul ignore if */\n if (((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) &&\n !false &&\n this.$el &&\n this.$el.__VUE_I18N__) {\n if (this.__v_emitter) {\n this.__v_emitter.off('*', addTimelineEvent);\n delete this.__v_emitter;\n }\n if (this.$i18n) {\n _vueI18n.__disableEmitter && _vueI18n.__disableEmitter();\n delete this.$el.__VUE_I18N__;\n }\n }\n delete this.$t;\n delete this.$rt;\n delete this.$tc;\n delete this.$te;\n delete this.$d;\n delete this.$n;\n delete this.$tm;\n if (_vueI18n.__disposer) {\n _vueI18n.__disposer();\n delete _vueI18n.__disposer;\n delete _vueI18n.__extender;\n }\n i18n.__deleteInstance(instance);\n delete this.$i18n;\n }\n };\n}\nfunction mergeToGlobal(g, options) {\n g.locale = options.locale || g.locale;\n g.fallbackLocale = options.fallbackLocale || g.fallbackLocale;\n g.missing = options.missing || g.missing;\n g.silentTranslationWarn =\n options.silentTranslationWarn || g.silentFallbackWarn;\n g.silentFallbackWarn = options.silentFallbackWarn || g.silentFallbackWarn;\n g.formatFallbackMessages =\n options.formatFallbackMessages || g.formatFallbackMessages;\n g.postTranslation = options.postTranslation || g.postTranslation;\n g.warnHtmlInMessage = options.warnHtmlInMessage || g.warnHtmlInMessage;\n g.escapeParameterHtml = options.escapeParameterHtml || g.escapeParameterHtml;\n g.sync = options.sync || g.sync;\n g.__composer[SetPluralRulesSymbol](options.pluralizationRules || g.pluralizationRules);\n const messages = getLocaleMessages(g.locale, {\n messages: options.messages,\n __i18n: options.__i18n\n });\n Object.keys(messages).forEach(locale => g.mergeLocaleMessage(locale, messages[locale]));\n if (options.datetimeFormats) {\n Object.keys(options.datetimeFormats).forEach(locale => g.mergeDateTimeFormat(locale, options.datetimeFormats[locale]));\n }\n if (options.numberFormats) {\n Object.keys(options.numberFormats).forEach(locale => g.mergeNumberFormat(locale, options.numberFormats[locale]));\n }\n return g;\n}\n\n/**\n * Injection key for {@link useI18n}\n *\n * @remarks\n * The global injection key for I18n instances with `useI18n`. this injection key is used in Web Components.\n * Specify the i18n instance created by {@link createI18n} together with `provide` function.\n *\n * @VueI18nGeneral\n */\nconst I18nInjectionKey = \n/* #__PURE__*/ makeSymbol('global-vue-i18n');\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\nfunction createI18n(options = {}, VueI18nLegacy) {\n // prettier-ignore\n const __legacyMode = __VUE_I18N_LEGACY_API__ && isBoolean(options.legacy)\n ? options.legacy\n : __VUE_I18N_LEGACY_API__;\n // prettier-ignore\n const __globalInjection = isBoolean(options.globalInjection)\n ? options.globalInjection\n : true;\n // prettier-ignore\n const __allowComposition = __VUE_I18N_LEGACY_API__ && __legacyMode\n ? !!options.allowComposition\n : true;\n const __instances = new Map();\n const [globalScope, __global] = createGlobal(options, __legacyMode);\n const symbol = /* #__PURE__*/ makeSymbol((process.env.NODE_ENV !== 'production') ? 'vue-i18n' : '');\n if ((process.env.NODE_ENV !== 'production')) {\n if (__legacyMode && __allowComposition && !false) {\n warn(getWarnMessage(I18nWarnCodes.NOTICE_DROP_ALLOW_COMPOSITION));\n }\n }\n function __getInstance(component) {\n return __instances.get(component) || null;\n }\n function __setInstance(component, instance) {\n __instances.set(component, instance);\n }\n function __deleteInstance(component) {\n __instances.delete(component);\n }\n {\n const i18n = {\n // mode\n get mode() {\n return __VUE_I18N_LEGACY_API__ && __legacyMode\n ? 'legacy'\n : 'composition';\n },\n // allowComposition\n get allowComposition() {\n return __allowComposition;\n },\n // install plugin\n async install(app, ...options) {\n if (((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) &&\n !false) {\n app.__VUE_I18N__ = i18n;\n }\n // setup global provider\n app.__VUE_I18N_SYMBOL__ = symbol;\n app.provide(app.__VUE_I18N_SYMBOL__, i18n);\n // set composer & vuei18n extend hook options from plugin options\n if (isPlainObject(options[0])) {\n const opts = options[0];\n i18n.__composerExtend =\n opts.__composerExtend;\n i18n.__vueI18nExtend =\n opts.__vueI18nExtend;\n }\n // global method and properties injection for Composition API\n let globalReleaseHandler = null;\n if (!__legacyMode && __globalInjection) {\n globalReleaseHandler = injectGlobalFields(app, i18n.global);\n }\n // install built-in components and directive\n if (__VUE_I18N_FULL_INSTALL__) {\n apply(app, i18n, ...options);\n }\n // setup mixin for Legacy API\n if (__VUE_I18N_LEGACY_API__ && __legacyMode) {\n app.mixin(defineMixin(__global, __global.__composer, i18n));\n }\n // release global scope\n const unmountApp = app.unmount;\n app.unmount = () => {\n globalReleaseHandler && globalReleaseHandler();\n i18n.dispose();\n unmountApp();\n };\n // setup vue-devtools plugin\n if (((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) && !false) {\n const ret = await enableDevTools(app, i18n);\n if (!ret) {\n throw createI18nError(I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);\n }\n const emitter = createEmitter();\n if (__legacyMode) {\n const _vueI18n = __global;\n _vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _composer = __global;\n _composer[EnableEmitter] && _composer[EnableEmitter](emitter);\n }\n emitter.on('*', addTimelineEvent);\n }\n },\n // global accessor\n get global() {\n return __global;\n },\n dispose() {\n globalScope.stop();\n },\n // @internal\n __instances,\n // @internal\n __getInstance,\n // @internal\n __setInstance,\n // @internal\n __deleteInstance\n };\n return i18n;\n }\n}\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction useI18n(options = {}) {\n const instance = getCurrentInstance();\n if (instance == null) {\n throw createI18nError(I18nErrorCodes.MUST_BE_CALL_SETUP_TOP);\n }\n if (!instance.isCE &&\n instance.appContext.app != null &&\n !instance.appContext.app.__VUE_I18N_SYMBOL__) {\n throw createI18nError(I18nErrorCodes.NOT_INSTALLED);\n }\n const i18n = getI18nInstance(instance);\n const gl = getGlobalComposer(i18n);\n const componentOptions = getComponentOptions(instance);\n const scope = getScope(options, componentOptions);\n if (__VUE_I18N_LEGACY_API__) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (i18n.mode === 'legacy' && !options.__useComponent) {\n if (!i18n.allowComposition) {\n throw createI18nError(I18nErrorCodes.NOT_AVAILABLE_IN_LEGACY_MODE);\n }\n return useI18nForLegacy(instance, scope, gl, options);\n }\n }\n if (scope === 'global') {\n adjustI18nResources(gl, options, componentOptions);\n return gl;\n }\n if (scope === 'parent') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let composer = getComposer(i18n, instance, options.__useComponent);\n if (composer == null) {\n if ((process.env.NODE_ENV !== 'production')) {\n warn(getWarnMessage(I18nWarnCodes.NOT_FOUND_PARENT_SCOPE));\n }\n composer = gl;\n }\n return composer;\n }\n const i18nInternal = i18n;\n let composer = i18nInternal.__getInstance(instance);\n if (composer == null) {\n const composerOptions = assign({}, options);\n if ('__i18n' in componentOptions) {\n composerOptions.__i18n = componentOptions.__i18n;\n }\n if (gl) {\n composerOptions.__root = gl;\n }\n composer = createComposer(composerOptions);\n if (i18nInternal.__composerExtend) {\n composer[DisposeSymbol] =\n i18nInternal.__composerExtend(composer);\n }\n setupLifeCycle(i18nInternal, instance, composer);\n i18nInternal.__setInstance(instance, composer);\n }\n return composer;\n}\n/**\n * Cast to VueI18n legacy compatible type\n *\n * @remarks\n * This API is provided only with [vue-i18n-bridge](https://vue-i18n.intlify.dev/guide/migration/ways.html#what-is-vue-i18n-bridge).\n *\n * The purpose of this function is to convert an {@link I18n} instance created with {@link createI18n | createI18n(legacy: true)} into a `vue-i18n@v8.x` compatible instance of `new VueI18n` in a TypeScript environment.\n *\n * @param i18n - An instance of {@link I18n}\n * @returns A i18n instance which is casted to {@link VueI18n} type\n *\n * @VueI18nTip\n * :new: provided by **vue-i18n-bridge only**\n *\n * @VueI18nGeneral\n */\n/* #__NO_SIDE_EFFECTS__ */\nconst castToVueI18n = (i18n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n) => {\n if (!(__VUE_I18N_BRIDGE__ in i18n)) {\n throw createI18nError(I18nErrorCodes.NOT_COMPATIBLE_LEGACY_VUE_I18N);\n }\n return i18n;\n};\nfunction createGlobal(options, legacyMode, VueI18nLegacy // eslint-disable-line @typescript-eslint/no-explicit-any\n) {\n const scope = effectScope();\n {\n const obj = __VUE_I18N_LEGACY_API__ && legacyMode\n ? scope.run(() => createVueI18n(options))\n : scope.run(() => createComposer(options));\n if (obj == null) {\n throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);\n }\n return [scope, obj];\n }\n}\nfunction getI18nInstance(instance) {\n {\n const i18n = inject(!instance.isCE\n ? instance.appContext.app.__VUE_I18N_SYMBOL__\n : I18nInjectionKey);\n /* istanbul ignore if */\n if (!i18n) {\n throw createI18nError(!instance.isCE\n ? I18nErrorCodes.UNEXPECTED_ERROR\n : I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE);\n }\n return i18n;\n }\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getScope(options, componentOptions) {\n // prettier-ignore\n return isEmptyObject(options)\n ? ('__i18n' in componentOptions)\n ? 'local'\n : 'global'\n : !options.useScope\n ? 'local'\n : options.useScope;\n}\nfunction getGlobalComposer(i18n) {\n // prettier-ignore\n return i18n.mode === 'composition'\n ? i18n.global\n : i18n.global.__composer\n ;\n}\nfunction getComposer(i18n, target, useComponent = false) {\n let composer = null;\n const root = target.root;\n let current = getParentComponentInstance(target, useComponent);\n while (current != null) {\n const i18nInternal = i18n;\n if (i18n.mode === 'composition') {\n composer = i18nInternal.__getInstance(current);\n }\n else {\n if (__VUE_I18N_LEGACY_API__) {\n const vueI18n = i18nInternal.__getInstance(current);\n if (vueI18n != null) {\n composer = vueI18n\n .__composer;\n if (useComponent &&\n composer &&\n !composer[InejctWithOptionSymbol] // eslint-disable-line @typescript-eslint/no-explicit-any\n ) {\n composer = null;\n }\n }\n }\n }\n if (composer != null) {\n break;\n }\n if (root === current) {\n break;\n }\n current = current.parent;\n }\n return composer;\n}\nfunction getParentComponentInstance(target, useComponent = false) {\n if (target == null) {\n return null;\n }\n {\n // if `useComponent: true` will be specified, we get lexical scope owner instance for use-case slots\n return !useComponent\n ? target.parent\n : target.vnode.ctx || target.parent; // eslint-disable-line @typescript-eslint/no-explicit-any\n }\n}\nfunction setupLifeCycle(i18n, target, composer) {\n let emitter = null;\n {\n onMounted(() => {\n // inject composer instance to DOM for intlify-devtools\n if (((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) &&\n !false &&\n target.vnode.el) {\n target.vnode.el.__VUE_I18N__ = composer;\n emitter = createEmitter();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _composer = composer;\n _composer[EnableEmitter] && _composer[EnableEmitter](emitter);\n emitter.on('*', addTimelineEvent);\n }\n }, target);\n onUnmounted(() => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const _composer = composer;\n // remove composer instance from DOM for intlify-devtools\n if (((process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__) &&\n !false &&\n target.vnode.el &&\n target.vnode.el.__VUE_I18N__) {\n emitter && emitter.off('*', addTimelineEvent);\n _composer[DisableEmitter] && _composer[DisableEmitter]();\n delete target.vnode.el.__VUE_I18N__;\n }\n i18n.__deleteInstance(target);\n // dispose extended resources\n const dispose = _composer[DisposeSymbol];\n if (dispose) {\n dispose();\n delete _composer[DisposeSymbol];\n }\n }, target);\n }\n}\nfunction useI18nForLegacy(instance, scope, root, options = {} // eslint-disable-line @typescript-eslint/no-explicit-any\n) {\n const isLocalScope = scope === 'local';\n const _composer = shallowRef(null);\n if (isLocalScope &&\n instance.proxy &&\n !(instance.proxy.$options.i18n || instance.proxy.$options.__i18n)) {\n throw createI18nError(I18nErrorCodes.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);\n }\n const _inheritLocale = isBoolean(options.inheritLocale)\n ? options.inheritLocale\n : !isString(options.locale);\n const _locale = ref(\n // prettier-ignore\n !isLocalScope || _inheritLocale\n ? root.locale.value\n : isString(options.locale)\n ? options.locale\n : DEFAULT_LOCALE);\n const _fallbackLocale = ref(\n // prettier-ignore\n !isLocalScope || _inheritLocale\n ? root.fallbackLocale.value\n : isString(options.fallbackLocale) ||\n isArray(options.fallbackLocale) ||\n isPlainObject(options.fallbackLocale) ||\n options.fallbackLocale === false\n ? options.fallbackLocale\n : _locale.value);\n const _messages = ref(getLocaleMessages(_locale.value, options));\n // prettier-ignore\n const _datetimeFormats = ref(isPlainObject(options.datetimeFormats)\n ? options.datetimeFormats\n : { [_locale.value]: {} });\n // prettier-ignore\n const _numberFormats = ref(isPlainObject(options.numberFormats)\n ? options.numberFormats\n : { [_locale.value]: {} });\n // prettier-ignore\n const _missingWarn = isLocalScope\n ? root.missingWarn\n : isBoolean(options.missingWarn) || isRegExp(options.missingWarn)\n ? options.missingWarn\n : true;\n // prettier-ignore\n const _fallbackWarn = isLocalScope\n ? root.fallbackWarn\n : isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn)\n ? options.fallbackWarn\n : true;\n // prettier-ignore\n const _fallbackRoot = isLocalScope\n ? root.fallbackRoot\n : isBoolean(options.fallbackRoot)\n ? options.fallbackRoot\n : true;\n // configure fall back to root\n const _fallbackFormat = !!options.fallbackFormat;\n // runtime missing\n const _missing = isFunction(options.missing) ? options.missing : null;\n // postTranslation handler\n const _postTranslation = isFunction(options.postTranslation)\n ? options.postTranslation\n : null;\n // prettier-ignore\n const _warnHtmlMessage = isLocalScope\n ? root.warnHtmlMessage\n : isBoolean(options.warnHtmlMessage)\n ? options.warnHtmlMessage\n : true;\n const _escapeParameter = !!options.escapeParameter;\n // prettier-ignore\n const _modifiers = isLocalScope\n ? root.modifiers\n : isPlainObject(options.modifiers)\n ? options.modifiers\n : {};\n // pluralRules\n const _pluralRules = options.pluralRules || (isLocalScope && root.pluralRules);\n // track reactivity\n function trackReactivityValues() {\n return [\n _locale.value,\n _fallbackLocale.value,\n _messages.value,\n _datetimeFormats.value,\n _numberFormats.value\n ];\n }\n // locale\n const locale = computed({\n get: () => {\n return _composer.value ? _composer.value.locale.value : _locale.value;\n },\n set: val => {\n if (_composer.value) {\n _composer.value.locale.value = val;\n }\n _locale.value = val;\n }\n });\n // fallbackLocale\n const fallbackLocale = computed({\n get: () => {\n return _composer.value\n ? _composer.value.fallbackLocale.value\n : _fallbackLocale.value;\n },\n set: val => {\n if (_composer.value) {\n _composer.value.fallbackLocale.value = val;\n }\n _fallbackLocale.value = val;\n }\n });\n // messages\n const messages = computed(() => {\n if (_composer.value) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return _composer.value.messages.value;\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return _messages.value;\n }\n });\n const datetimeFormats = computed(() => _datetimeFormats.value);\n const numberFormats = computed(() => _numberFormats.value);\n function getPostTranslationHandler() {\n return _composer.value\n ? _composer.value.getPostTranslationHandler()\n : _postTranslation;\n }\n function setPostTranslationHandler(handler) {\n if (_composer.value) {\n _composer.value.setPostTranslationHandler(handler);\n }\n }\n function getMissingHandler() {\n return _composer.value ? _composer.value.getMissingHandler() : _missing;\n }\n function setMissingHandler(handler) {\n if (_composer.value) {\n _composer.value.setMissingHandler(handler);\n }\n }\n function warpWithDeps(fn) {\n trackReactivityValues();\n return fn();\n }\n function t(...args) {\n return _composer.value\n ? warpWithDeps(() => Reflect.apply(_composer.value.t, null, [...args]))\n : warpWithDeps(() => '');\n }\n function rt(...args) {\n return _composer.value\n ? Reflect.apply(_composer.value.rt, null, [...args])\n : '';\n }\n function d(...args) {\n return _composer.value\n ? warpWithDeps(() => Reflect.apply(_composer.value.d, null, [...args]))\n : warpWithDeps(() => '');\n }\n function n(...args) {\n return _composer.value\n ? warpWithDeps(() => Reflect.apply(_composer.value.n, null, [...args]))\n : warpWithDeps(() => '');\n }\n function tm(key) {\n return _composer.value ? _composer.value.tm(key) : {};\n }\n function te(key, locale) {\n return _composer.value ? _composer.value.te(key, locale) : false;\n }\n function getLocaleMessage(locale) {\n return _composer.value ? _composer.value.getLocaleMessage(locale) : {};\n }\n function setLocaleMessage(locale, message) {\n if (_composer.value) {\n _composer.value.setLocaleMessage(locale, message);\n _messages.value[locale] = message;\n }\n }\n function mergeLocaleMessage(locale, message) {\n if (_composer.value) {\n _composer.value.mergeLocaleMessage(locale, message);\n }\n }\n function getDateTimeFormat(locale) {\n return _composer.value ? _composer.value.getDateTimeFormat(locale) : {};\n }\n function setDateTimeFormat(locale, format) {\n if (_composer.value) {\n _composer.value.setDateTimeFormat(locale, format);\n _datetimeFormats.value[locale] = format;\n }\n }\n function mergeDateTimeFormat(locale, format) {\n if (_composer.value) {\n _composer.value.mergeDateTimeFormat(locale, format);\n }\n }\n function getNumberFormat(locale) {\n return _composer.value ? _composer.value.getNumberFormat(locale) : {};\n }\n function setNumberFormat(locale, format) {\n if (_composer.value) {\n _composer.value.setNumberFormat(locale, format);\n _numberFormats.value[locale] = format;\n }\n }\n function mergeNumberFormat(locale, format) {\n if (_composer.value) {\n _composer.value.mergeNumberFormat(locale, format);\n }\n }\n const wrapper = {\n get id() {\n return _composer.value ? _composer.value.id : -1;\n },\n locale,\n fallbackLocale,\n messages,\n datetimeFormats,\n numberFormats,\n get inheritLocale() {\n return _composer.value ? _composer.value.inheritLocale : _inheritLocale;\n },\n set inheritLocale(val) {\n if (_composer.value) {\n _composer.value.inheritLocale = val;\n }\n },\n get availableLocales() {\n return _composer.value\n ? _composer.value.availableLocales\n : Object.keys(_messages.value);\n },\n get modifiers() {\n return (_composer.value ? _composer.value.modifiers : _modifiers);\n },\n get pluralRules() {\n return (_composer.value ? _composer.value.pluralRules : _pluralRules);\n },\n get isGlobal() {\n return _composer.value ? _composer.value.isGlobal : false;\n },\n get missingWarn() {\n return _composer.value ? _composer.value.missingWarn : _missingWarn;\n },\n set missingWarn(val) {\n if (_composer.value) {\n _composer.value.missingWarn = val;\n }\n },\n get fallbackWarn() {\n return _composer.value ? _composer.value.fallbackWarn : _fallbackWarn;\n },\n set fallbackWarn(val) {\n if (_composer.value) {\n _composer.value.missingWarn = val;\n }\n },\n get fallbackRoot() {\n return _composer.value ? _composer.value.fallbackRoot : _fallbackRoot;\n },\n set fallbackRoot(val) {\n if (_composer.value) {\n _composer.value.fallbackRoot = val;\n }\n },\n get fallbackFormat() {\n return _composer.value ? _composer.value.fallbackFormat : _fallbackFormat;\n },\n set fallbackFormat(val) {\n if (_composer.value) {\n _composer.value.fallbackFormat = val;\n }\n },\n get warnHtmlMessage() {\n return _composer.value\n ? _composer.value.warnHtmlMessage\n : _warnHtmlMessage;\n },\n set warnHtmlMessage(val) {\n if (_composer.value) {\n _composer.value.warnHtmlMessage = val;\n }\n },\n get escapeParameter() {\n return _composer.value\n ? _composer.value.escapeParameter\n : _escapeParameter;\n },\n set escapeParameter(val) {\n if (_composer.value) {\n _composer.value.escapeParameter = val;\n }\n },\n t,\n getPostTranslationHandler,\n setPostTranslationHandler,\n getMissingHandler,\n setMissingHandler,\n rt,\n d,\n n,\n tm,\n te,\n getLocaleMessage,\n setLocaleMessage,\n mergeLocaleMessage,\n getDateTimeFormat,\n setDateTimeFormat,\n mergeDateTimeFormat,\n getNumberFormat,\n setNumberFormat,\n mergeNumberFormat\n };\n function sync(composer) {\n composer.locale.value = _locale.value;\n composer.fallbackLocale.value = _fallbackLocale.value;\n Object.keys(_messages.value).forEach(locale => {\n composer.mergeLocaleMessage(locale, _messages.value[locale]);\n });\n Object.keys(_datetimeFormats.value).forEach(locale => {\n composer.mergeDateTimeFormat(locale, _datetimeFormats.value[locale]);\n });\n Object.keys(_numberFormats.value).forEach(locale => {\n composer.mergeNumberFormat(locale, _numberFormats.value[locale]);\n });\n composer.escapeParameter = _escapeParameter;\n composer.fallbackFormat = _fallbackFormat;\n composer.fallbackRoot = _fallbackRoot;\n composer.fallbackWarn = _fallbackWarn;\n composer.missingWarn = _missingWarn;\n composer.warnHtmlMessage = _warnHtmlMessage;\n }\n onBeforeMount(() => {\n if (instance.proxy == null || instance.proxy.$i18n == null) {\n throw createI18nError(I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const composer = (_composer.value = instance.proxy.$i18n\n .__composer);\n if (scope === 'global') {\n _locale.value = composer.locale.value;\n _fallbackLocale.value = composer.fallbackLocale.value;\n _messages.value = composer.messages.value;\n _datetimeFormats.value = composer.datetimeFormats.value;\n _numberFormats.value = composer.numberFormats.value;\n }\n else if (isLocalScope) {\n sync(composer);\n }\n });\n return wrapper;\n}\nconst globalExportProps = [\n 'locale',\n 'fallbackLocale',\n 'availableLocales'\n];\nconst globalExportMethods = ['t', 'rt', 'd', 'n', 'tm', 'te']\n ;\nfunction injectGlobalFields(app, composer) {\n const i18n = Object.create(null);\n globalExportProps.forEach(prop => {\n const desc = Object.getOwnPropertyDescriptor(composer, prop);\n if (!desc) {\n throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);\n }\n const wrap = isRef(desc.value) // check computed props\n ? {\n get() {\n return desc.value.value;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n set(val) {\n desc.value.value = val;\n }\n }\n : {\n get() {\n return desc.get && desc.get();\n }\n };\n Object.defineProperty(i18n, prop, wrap);\n });\n app.config.globalProperties.$i18n = i18n;\n globalExportMethods.forEach(method => {\n const desc = Object.getOwnPropertyDescriptor(composer, method);\n if (!desc || !desc.value) {\n throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);\n }\n Object.defineProperty(app.config.globalProperties, `$${method}`, desc);\n });\n const dispose = () => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n delete app.config.globalProperties.$i18n;\n globalExportMethods.forEach(method => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n delete app.config.globalProperties[`$${method}`];\n });\n };\n return dispose;\n}\n\n{\n initFeatureFlags();\n}\n// register message compiler at vue-i18n\nif (__INTLIFY_JIT_COMPILATION__) {\n registerMessageCompiler(compile);\n}\nelse {\n registerMessageCompiler(compileToFunction);\n}\n// register message resolver at vue-i18n\nregisterMessageResolver(resolveValue);\n// register fallback locale at vue-i18n\nregisterLocaleFallbacker(fallbackWithLocaleChain);\n// NOTE: experimental !!\nif ((process.env.NODE_ENV !== 'production') || __INTLIFY_PROD_DEVTOOLS__) {\n const target = getGlobalThis();\n target.__INTLIFY__ = true;\n setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);\n}\nif ((process.env.NODE_ENV !== 'production')) ;\n\nexport { DatetimeFormat, I18nD, I18nInjectionKey, I18nN, I18nT, NumberFormat, Translation, VERSION, castToVueI18n, createI18n, useI18n, vTDirective };\n","import { createI18n } from 'vue-i18n'\n\nimport enCommands from './locales/en/commands.json'\nimport en from './locales/en/main.json'\nimport enNodes from './locales/en/nodeDefs.json'\nimport enSettings from './locales/en/settings.json'\nimport frCommands from './locales/fr/commands.json'\nimport fr from './locales/fr/main.json'\nimport frNodes from './locales/fr/nodeDefs.json'\nimport frSettings from './locales/fr/settings.json'\nimport jaCommands from './locales/ja/commands.json'\nimport ja from './locales/ja/main.json'\nimport jaNodes from './locales/ja/nodeDefs.json'\nimport jaSettings from './locales/ja/settings.json'\nimport koCommands from './locales/ko/commands.json'\nimport ko from './locales/ko/main.json'\nimport koNodes from './locales/ko/nodeDefs.json'\nimport koSettings from './locales/ko/settings.json'\nimport ruCommands from './locales/ru/commands.json'\nimport ru from './locales/ru/main.json'\nimport ruNodes from './locales/ru/nodeDefs.json'\nimport ruSettings from './locales/ru/settings.json'\nimport zhCommands from './locales/zh/commands.json'\nimport zh from './locales/zh/main.json'\nimport zhNodes from './locales/zh/nodeDefs.json'\nimport zhSettings from './locales/zh/settings.json'\n\nfunction buildLocale(main: M, nodes: N, commands: C, settings: S) {\n return {\n ...main,\n nodeDefs: nodes,\n commands: commands,\n settings: settings\n }\n}\n\nconst messages = {\n en: buildLocale(en, enNodes, enCommands, enSettings),\n zh: buildLocale(zh, zhNodes, zhCommands, zhSettings),\n ru: buildLocale(ru, ruNodes, ruCommands, ruSettings),\n ja: buildLocale(ja, jaNodes, jaCommands, jaSettings),\n ko: buildLocale(ko, koNodes, koCommands, koSettings),\n fr: buildLocale(fr, frNodes, frCommands, frSettings)\n}\n\nexport const i18n = createI18n({\n // Must set `false`, as Vue I18n Legacy API is for Vue 2\n legacy: false,\n locale: navigator.language.split('-')[0] || 'en',\n fallbackLocale: 'en',\n messages,\n // Ignore warnings for locale options as each option is in its own language.\n // e.g. \"English\", \"中文\", \"Русский\", \"日本語\", \"한국어\", \"Français\"\n missingWarn: /^(?!settings\\.Comfy_Locale\\.options\\.).+/,\n fallbackWarn: /^(?!settings\\.Comfy_Locale\\.options\\.).+/\n})\n\n/** Convenience shorthand: i18n.global */\nexport const { t, te } = i18n.global\n\n/**\n * Safe translation function that returns the fallback message if the key is not found.\n *\n * @param key - The key to translate.\n * @param fallbackMessage - The fallback message to use if the key is not found.\n */\nexport function st(key: string, fallbackMessage: string) {\n return te(key) ? t(key) : fallbackMessage\n}\n","// Within Vue component context, you can directly call useToast().add()\n// instead of going through the store.\n// The store is useful when you need to call it from outside the Vue component context.\nimport { defineStore } from 'pinia'\nimport type { ToastMessageOptions } from 'primevue/toast'\nimport { ref } from 'vue'\n\nexport const useToastStore = defineStore('toast', () => {\n const messagesToAdd = ref([])\n const messagesToRemove = ref([])\n const removeAllRequested = ref(false)\n\n function add(message: ToastMessageOptions) {\n messagesToAdd.value = [...messagesToAdd.value, message]\n }\n\n function remove(message: ToastMessageOptions) {\n messagesToRemove.value = [...messagesToRemove.value, message]\n }\n\n function removeAll() {\n removeAllRequested.value = true\n }\n\n function addAlert(message: string) {\n add({ severity: 'warn', summary: 'Alert', detail: message })\n }\n\n return {\n messagesToAdd,\n messagesToRemove,\n removeAllRequested,\n\n add,\n remove,\n removeAll,\n addAlert\n }\n})\n","import { t } from '@/i18n'\nimport { useToastStore } from '@/stores/toastStore'\n\nexport function useErrorHandling() {\n const toast = useToastStore()\n\n const toastErrorHandler = (error: any) => {\n toast.add({\n severity: 'error',\n summary: t('g.error'),\n detail: error.message\n })\n }\n\n const wrapWithErrorHandling =\n (\n action: (...args: TArgs) => TReturn,\n errorHandler?: (error: any) => void,\n finallyHandler?: () => void\n ) =>\n (...args: TArgs): TReturn | undefined => {\n try {\n return action(...args)\n } catch (e) {\n ;(errorHandler ?? toastErrorHandler)(e)\n } finally {\n finallyHandler?.()\n }\n }\n\n const wrapWithErrorHandlingAsync =\n (\n action: (...args: TArgs) => Promise | TReturn,\n errorHandler?: (error: any) => void,\n finallyHandler?: () => void\n ) =>\n async (...args: TArgs): Promise => {\n try {\n return await action(...args)\n } catch (e) {\n ;(errorHandler ?? toastErrorHandler)(e)\n } finally {\n finallyHandler?.()\n }\n }\n\n return { wrapWithErrorHandling, wrapWithErrorHandlingAsync }\n}\n","/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

' + func(text) + '

';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '

fred, barney, & pebbles

'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '\n\n\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-divider-horizontal {\\n display: flex;\\n width: 100%;\\n position: relative;\\n align-items: center;\\n margin: \".concat(dt('divider.horizontal.margin'), \";\\n padding: \").concat(dt('divider.horizontal.padding'), \";\\n}\\n\\n.p-divider-horizontal:before {\\n position: absolute;\\n display: block;\\n inset-block-start: 50%;\\n inset-inline-start: 0;\\n width: 100%;\\n content: \\\"\\\";\\n border-block-start: 1px solid \").concat(dt('divider.border.color'), \";\\n}\\n\\n.p-divider-horizontal .p-divider-content {\\n padding: \").concat(dt('divider.horizontal.content.padding'), \";\\n}\\n\\n.p-divider-vertical {\\n min-height: 100%;\\n display: flex;\\n position: relative;\\n justify-content: center;\\n margin: \").concat(dt('divider.vertical.margin'), \";\\n padding: \").concat(dt('divider.vertical.padding'), \";\\n}\\n\\n.p-divider-vertical:before {\\n position: absolute;\\n display: block;\\n inset-block-start: 0;\\n inset-inline-start: 50%;\\n height: 100%;\\n content: \\\"\\\";\\n border-inline-start: 1px solid \").concat(dt('divider.border.color'), \";\\n}\\n\\n.p-divider.p-divider-vertical .p-divider-content {\\n padding: \").concat(dt('divider.vertical.content.padding'), \";\\n}\\n\\n.p-divider-content {\\n z-index: 1;\\n background: \").concat(dt('divider.content.background'), \";\\n color: \").concat(dt('divider.content.color'), \";\\n}\\n\\n.p-divider-solid.p-divider-horizontal:before {\\n border-block-start-style: solid;\\n}\\n\\n.p-divider-solid.p-divider-vertical:before {\\n border-inline-start-style: solid;\\n}\\n\\n.p-divider-dashed.p-divider-horizontal:before {\\n border-block-start-style: dashed;\\n}\\n\\n.p-divider-dashed.p-divider-vertical:before {\\n border-inline-start-style: dashed;\\n}\\n\\n.p-divider-dotted.p-divider-horizontal:before {\\n border-block-start-style: dotted;\\n}\\n\\n.p-divider-dotted.p-divider-vertical:before {\\n border-inline-start-style: dotted;\\n}\\n\\n.p-divider-left:dir(rtl),\\n.p-divider-right:dir(rtl) {\\n flex-direction: row-reverse;\\n}\\n\");\n};\n\n/* Position */\nvar inlineStyles = {\n root: function root(_ref2) {\n var props = _ref2.props;\n return {\n justifyContent: props.layout === 'horizontal' ? props.align === 'center' || props.align === null ? 'center' : props.align === 'left' ? 'flex-start' : props.align === 'right' ? 'flex-end' : null : null,\n alignItems: props.layout === 'vertical' ? props.align === 'center' || props.align === null ? 'center' : props.align === 'top' ? 'flex-start' : props.align === 'bottom' ? 'flex-end' : null : null\n };\n }\n};\nvar classes = {\n root: function root(_ref3) {\n var props = _ref3.props;\n return ['p-divider p-component', 'p-divider-' + props.layout, 'p-divider-' + props.type, {\n 'p-divider-left': props.layout === 'horizontal' && (!props.align || props.align === 'left')\n }, {\n 'p-divider-center': props.layout === 'horizontal' && props.align === 'center'\n }, {\n 'p-divider-right': props.layout === 'horizontal' && props.align === 'right'\n }, {\n 'p-divider-top': props.layout === 'vertical' && props.align === 'top'\n }, {\n 'p-divider-center': props.layout === 'vertical' && (!props.align || props.align === 'center')\n }, {\n 'p-divider-bottom': props.layout === 'vertical' && props.align === 'bottom'\n }];\n },\n content: 'p-divider-content'\n};\nvar DividerStyle = BaseStyle.extend({\n name: 'divider',\n theme: theme,\n classes: classes,\n inlineStyles: inlineStyles\n});\n\nexport { DividerStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseComponent from '@primevue/core/basecomponent';\nimport DividerStyle from 'primevue/divider/style';\nimport { openBlock, createElementBlock, mergeProps, renderSlot, createCommentVNode } from 'vue';\n\nvar script$1 = {\n name: 'BaseDivider',\n \"extends\": BaseComponent,\n props: {\n align: {\n type: String,\n \"default\": null\n },\n layout: {\n type: String,\n \"default\": 'horizontal'\n },\n type: {\n type: String,\n \"default\": 'solid'\n }\n },\n style: DividerStyle,\n provide: function provide() {\n return {\n $pcDivider: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'Divider',\n \"extends\": script$1,\n inheritAttrs: false\n};\n\nvar _hoisted_1 = [\"aria-orientation\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root'),\n style: _ctx.sx('root'),\n role: \"separator\",\n \"aria-orientation\": _ctx.layout\n }, _ctx.ptmi('root')), [_ctx.$slots[\"default\"] ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('content')\n }, _ctx.ptm('content')), [renderSlot(_ctx.$slots, \"default\")], 16)) : createCommentVNode(\"\", true)], 16, _hoisted_1);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-scrollpanel-content-container {\\n overflow: hidden;\\n width: 100%;\\n height: 100%;\\n position: relative;\\n z-index: 1;\\n float: left;\\n}\\n\\n.p-scrollpanel-content {\\n height: calc(100% + calc(2 * \".concat(dt('scrollpanel.bar.size'), \"));\\n width: calc(100% + calc(2 * \").concat(dt('scrollpanel.bar.size'), \"));\\n padding-inline: 0 calc(2 * \").concat(dt('scrollpanel.bar.size'), \");\\n padding-block: 0 calc(2 * \").concat(dt('scrollpanel.bar.size'), \");\\n position: relative;\\n overflow: auto;\\n box-sizing: border-box;\\n scrollbar-width: none;\\n}\\n\\n.p-scrollpanel-content::-webkit-scrollbar {\\n display: none;\\n}\\n\\n.p-scrollpanel-bar {\\n position: relative;\\n border-radius: \").concat(dt('scrollpanel.bar.border.radius'), \";\\n z-index: 2;\\n cursor: pointer;\\n opacity: 0;\\n outline-color: transparent;\\n background: \").concat(dt('scrollpanel.bar.background'), \";\\n border: 0 none;\\n transition: outline-color \").concat(dt('scrollpanel.transition.duration'), \", opacity \").concat(dt('scrollpanel.transition.duration'), \";\\n}\\n\\n.p-scrollpanel-bar:focus-visible {\\n box-shadow: \").concat(dt('scrollpanel.bar.focus.ring.shadow'), \";\\n outline: \").concat(dt('scrollpanel.barfocus.ring.width'), \" \").concat(dt('scrollpanel.bar.focus.ring.style'), \" \").concat(dt('scrollpanel.bar.focus.ring.color'), \";\\n outline-offset: \").concat(dt('scrollpanel.barfocus.ring.offset'), \";\\n}\\n\\n.p-scrollpanel-bar-y {\\n width: \").concat(dt('scrollpanel.bar.size'), \";\\n inset-block-start: 0;\\n}\\n\\n.p-scrollpanel-bar-x {\\n height: \").concat(dt('scrollpanel.bar.size'), \";\\n inset-block-end: 0;\\n}\\n\\n.p-scrollpanel-hidden {\\n visibility: hidden;\\n}\\n\\n.p-scrollpanel:hover .p-scrollpanel-bar,\\n.p-scrollpanel:active .p-scrollpanel-bar {\\n opacity: 1;\\n}\\n\\n.p-scrollpanel-grabbed {\\n user-select: none;\\n}\\n\");\n};\nvar classes = {\n root: 'p-scrollpanel p-component',\n contentContainer: 'p-scrollpanel-content-container',\n content: 'p-scrollpanel-content',\n barX: 'p-scrollpanel-bar p-scrollpanel-bar-x',\n barY: 'p-scrollpanel-bar p-scrollpanel-bar-y'\n};\nvar ScrollPanelStyle = BaseStyle.extend({\n name: 'scrollpanel',\n theme: theme,\n classes: classes\n});\n\nexport { ScrollPanelStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { getHeight, addClass, removeClass } from '@primeuix/utils/dom';\nimport { UniqueComponentId } from '@primevue/core/utils';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport ScrollPanelStyle from 'primevue/scrollpanel/style';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode, renderSlot } from 'vue';\n\nvar script$1 = {\n name: 'BaseScrollPanel',\n \"extends\": BaseComponent,\n props: {\n step: {\n type: Number,\n \"default\": 5\n }\n },\n style: ScrollPanelStyle,\n provide: function provide() {\n return {\n $pcScrollPanel: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'ScrollPanel',\n \"extends\": script$1,\n inheritAttrs: false,\n initialized: false,\n documentResizeListener: null,\n documentMouseMoveListener: null,\n documentMouseUpListener: null,\n frame: null,\n scrollXRatio: null,\n scrollYRatio: null,\n isXBarClicked: false,\n isYBarClicked: false,\n lastPageX: null,\n lastPageY: null,\n timer: null,\n outsideClickListener: null,\n data: function data() {\n return {\n id: this.$attrs.id,\n orientation: 'vertical',\n lastScrollTop: 0,\n lastScrollLeft: 0\n };\n },\n watch: {\n '$attrs.id': function $attrsId(newValue) {\n this.id = newValue || UniqueComponentId();\n }\n },\n mounted: function mounted() {\n this.id = this.id || UniqueComponentId();\n if (this.$el.offsetParent) {\n this.initialize();\n }\n },\n updated: function updated() {\n if (!this.initialized && this.$el.offsetParent) {\n this.initialize();\n }\n },\n beforeUnmount: function beforeUnmount() {\n this.unbindDocumentResizeListener();\n if (this.frame) {\n window.cancelAnimationFrame(this.frame);\n }\n },\n methods: {\n initialize: function initialize() {\n this.moveBar();\n this.bindDocumentResizeListener();\n this.calculateContainerHeight();\n },\n calculateContainerHeight: function calculateContainerHeight() {\n var containerStyles = getComputedStyle(this.$el),\n xBarStyles = getComputedStyle(this.$refs.xBar),\n pureContainerHeight = getHeight(this.$el) - parseInt(xBarStyles['height'], 10);\n if (containerStyles['max-height'] !== 'none' && pureContainerHeight === 0) {\n if (this.$refs.content.offsetHeight + parseInt(xBarStyles['height'], 10) > parseInt(containerStyles['max-height'], 10)) {\n this.$el.style.height = containerStyles['max-height'];\n } else {\n this.$el.style.height = this.$refs.content.offsetHeight + parseFloat(containerStyles.paddingTop) + parseFloat(containerStyles.paddingBottom) + parseFloat(containerStyles.borderTopWidth) + parseFloat(containerStyles.borderBottomWidth) + 'px';\n }\n }\n },\n moveBar: function moveBar() {\n var _this = this;\n if (this.$refs.content) {\n /* horizontal scroll */\n var totalWidth = this.$refs.content.scrollWidth;\n var ownWidth = this.$refs.content.clientWidth;\n var bottom = (this.$el.clientHeight - this.$refs.xBar.clientHeight) * -1;\n this.scrollXRatio = ownWidth / totalWidth;\n\n /* vertical scroll */\n var totalHeight = this.$refs.content.scrollHeight;\n var ownHeight = this.$refs.content.clientHeight;\n var right = (this.$el.clientWidth - this.$refs.yBar.clientWidth) * -1;\n this.scrollYRatio = ownHeight / totalHeight;\n this.frame = this.requestAnimationFrame(function () {\n if (_this.$refs.xBar) {\n if (_this.scrollXRatio >= 1) {\n _this.$refs.xBar.setAttribute('data-p-scrollpanel-hidden', 'true');\n !_this.isUnstyled && addClass(_this.$refs.xBar, 'p-scrollpanel-hidden');\n } else {\n _this.$refs.xBar.setAttribute('data-p-scrollpanel-hidden', 'false');\n !_this.isUnstyled && removeClass(_this.$refs.xBar, 'p-scrollpanel-hidden');\n _this.$refs.xBar.style.cssText = 'width:' + Math.max(_this.scrollXRatio * 100, 10) + '%; inset-inline-start:' + Math.abs(_this.$refs.content.scrollLeft) / totalWidth * 100 + '%;bottom:' + bottom + 'px;';\n }\n }\n if (_this.$refs.yBar) {\n if (_this.scrollYRatio >= 1) {\n _this.$refs.yBar.setAttribute('data-p-scrollpanel-hidden', 'true');\n !_this.isUnstyled && addClass(_this.$refs.yBar, 'p-scrollpanel-hidden');\n } else {\n _this.$refs.yBar.setAttribute('data-p-scrollpanel-hidden', 'false');\n !_this.isUnstyled && removeClass(_this.$refs.yBar, 'p-scrollpanel-hidden');\n _this.$refs.yBar.style.cssText = 'height:' + Math.max(_this.scrollYRatio * 100, 10) + '%; top: calc(' + _this.$refs.content.scrollTop / totalHeight * 100 + '% - ' + _this.$refs.xBar.clientHeight + 'px); inset-inline-end:' + right + 'px;';\n }\n }\n });\n }\n },\n onYBarMouseDown: function onYBarMouseDown(e) {\n this.isYBarClicked = true;\n this.$refs.yBar.focus();\n this.lastPageY = e.pageY;\n this.$refs.yBar.setAttribute('data-p-scrollpanel-grabbed', 'true');\n !this.isUnstyled && addClass(this.$refs.yBar, 'p-scrollpanel-grabbed');\n document.body.setAttribute('data-p-scrollpanel-grabbed', 'true');\n !this.isUnstyled && addClass(document.body, 'p-scrollpanel-grabbed');\n this.bindDocumentMouseListeners();\n e.preventDefault();\n },\n onXBarMouseDown: function onXBarMouseDown(e) {\n this.isXBarClicked = true;\n this.$refs.xBar.focus();\n this.lastPageX = e.pageX;\n this.$refs.yBar.setAttribute('data-p-scrollpanel-grabbed', 'false');\n !this.isUnstyled && addClass(this.$refs.xBar, 'p-scrollpanel-grabbed');\n document.body.setAttribute('data-p-scrollpanel-grabbed', 'false');\n !this.isUnstyled && addClass(document.body, 'p-scrollpanel-grabbed');\n this.bindDocumentMouseListeners();\n e.preventDefault();\n },\n onScroll: function onScroll(event) {\n if (this.lastScrollLeft !== event.target.scrollLeft) {\n this.lastScrollLeft = event.target.scrollLeft;\n this.orientation = 'horizontal';\n } else if (this.lastScrollTop !== event.target.scrollTop) {\n this.lastScrollTop = event.target.scrollTop;\n this.orientation = 'vertical';\n }\n this.moveBar();\n },\n onKeyDown: function onKeyDown(event) {\n if (this.orientation === 'vertical') {\n switch (event.code) {\n case 'ArrowDown':\n {\n this.setTimer('scrollTop', this.step);\n event.preventDefault();\n break;\n }\n case 'ArrowUp':\n {\n this.setTimer('scrollTop', this.step * -1);\n event.preventDefault();\n break;\n }\n case 'ArrowLeft':\n case 'ArrowRight':\n {\n event.preventDefault();\n break;\n }\n }\n } else if (this.orientation === 'horizontal') {\n switch (event.code) {\n case 'ArrowRight':\n {\n this.setTimer('scrollLeft', this.step);\n event.preventDefault();\n break;\n }\n case 'ArrowLeft':\n {\n this.setTimer('scrollLeft', this.step * -1);\n event.preventDefault();\n break;\n }\n case 'ArrowDown':\n case 'ArrowUp':\n {\n event.preventDefault();\n break;\n }\n }\n }\n },\n onKeyUp: function onKeyUp() {\n this.clearTimer();\n },\n repeat: function repeat(bar, step) {\n this.$refs.content[bar] += step;\n this.moveBar();\n },\n setTimer: function setTimer(bar, step) {\n var _this2 = this;\n this.clearTimer();\n this.timer = setTimeout(function () {\n _this2.repeat(bar, step);\n }, 40);\n },\n clearTimer: function clearTimer() {\n if (this.timer) {\n clearTimeout(this.timer);\n }\n },\n onDocumentMouseMove: function onDocumentMouseMove(e) {\n if (this.isXBarClicked) {\n this.onMouseMoveForXBar(e);\n } else if (this.isYBarClicked) {\n this.onMouseMoveForYBar(e);\n } else {\n this.onMouseMoveForXBar(e);\n this.onMouseMoveForYBar(e);\n }\n },\n onMouseMoveForXBar: function onMouseMoveForXBar(e) {\n var _this3 = this;\n var deltaX = e.pageX - this.lastPageX;\n this.lastPageX = e.pageX;\n this.frame = this.requestAnimationFrame(function () {\n _this3.$refs.content.scrollLeft += deltaX / _this3.scrollXRatio;\n });\n },\n onMouseMoveForYBar: function onMouseMoveForYBar(e) {\n var _this4 = this;\n var deltaY = e.pageY - this.lastPageY;\n this.lastPageY = e.pageY;\n this.frame = this.requestAnimationFrame(function () {\n _this4.$refs.content.scrollTop += deltaY / _this4.scrollYRatio;\n });\n },\n onFocus: function onFocus(event) {\n if (this.$refs.xBar.isSameNode(event.target)) {\n this.orientation = 'horizontal';\n } else if (this.$refs.yBar.isSameNode(event.target)) {\n this.orientation = 'vertical';\n }\n },\n onBlur: function onBlur() {\n if (this.orientation === 'horizontal') {\n this.orientation = 'vertical';\n }\n },\n onDocumentMouseUp: function onDocumentMouseUp() {\n this.$refs.yBar.setAttribute('data-p-scrollpanel-grabbed', 'false');\n !this.isUnstyled && removeClass(this.$refs.yBar, 'p-scrollpanel-grabbed');\n this.$refs.xBar.setAttribute('data-p-scrollpanel-grabbed', 'false');\n !this.isUnstyled && removeClass(this.$refs.xBar, 'p-scrollpanel-grabbed');\n document.body.setAttribute('data-p-scrollpanel-grabbed', 'false');\n !this.isUnstyled && removeClass(document.body, 'p-scrollpanel-grabbed');\n this.unbindDocumentMouseListeners();\n this.isXBarClicked = false;\n this.isYBarClicked = false;\n },\n requestAnimationFrame: function requestAnimationFrame(f) {\n var frame = window.requestAnimationFrame || this.timeoutFrame;\n return frame(f);\n },\n refresh: function refresh() {\n this.moveBar();\n },\n scrollTop: function scrollTop(_scrollTop) {\n var scrollableHeight = this.$refs.content.scrollHeight - this.$refs.content.clientHeight;\n _scrollTop = _scrollTop > scrollableHeight ? scrollableHeight : _scrollTop > 0 ? _scrollTop : 0;\n this.$refs.content.scrollTop = _scrollTop;\n },\n timeoutFrame: function timeoutFrame(fn) {\n setTimeout(fn, 0);\n },\n bindDocumentMouseListeners: function bindDocumentMouseListeners() {\n var _this5 = this;\n if (!this.documentMouseMoveListener) {\n this.documentMouseMoveListener = function (e) {\n _this5.onDocumentMouseMove(e);\n };\n document.addEventListener('mousemove', this.documentMouseMoveListener);\n }\n if (!this.documentMouseUpListener) {\n this.documentMouseUpListener = function (e) {\n _this5.onDocumentMouseUp(e);\n };\n document.addEventListener('mouseup', this.documentMouseUpListener);\n }\n },\n unbindDocumentMouseListeners: function unbindDocumentMouseListeners() {\n if (this.documentMouseMoveListener) {\n document.removeEventListener('mousemove', this.documentMouseMoveListener);\n this.documentMouseMoveListener = null;\n }\n if (this.documentMouseUpListener) {\n document.removeEventListener('mouseup', this.documentMouseUpListener);\n this.documentMouseUpListener = null;\n }\n },\n bindDocumentResizeListener: function bindDocumentResizeListener() {\n var _this6 = this;\n if (!this.documentResizeListener) {\n this.documentResizeListener = function () {\n _this6.moveBar();\n };\n window.addEventListener('resize', this.documentResizeListener);\n }\n },\n unbindDocumentResizeListener: function unbindDocumentResizeListener() {\n if (this.documentResizeListener) {\n window.removeEventListener('resize', this.documentResizeListener);\n this.documentResizeListener = null;\n }\n }\n },\n computed: {\n contentId: function contentId() {\n return this.id + '_content';\n }\n }\n};\n\nvar _hoisted_1 = [\"id\"];\nvar _hoisted_2 = [\"aria-controls\", \"aria-valuenow\"];\nvar _hoisted_3 = [\"aria-controls\", \"aria-valuenow\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), [createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('contentContainer')\n }, _ctx.ptm('contentContainer')), [createElementVNode(\"div\", mergeProps({\n ref: \"content\",\n id: $options.contentId,\n \"class\": _ctx.cx('content'),\n onScroll: _cache[0] || (_cache[0] = function () {\n return $options.onScroll && $options.onScroll.apply($options, arguments);\n }),\n onMouseenter: _cache[1] || (_cache[1] = function () {\n return $options.moveBar && $options.moveBar.apply($options, arguments);\n })\n }, _ctx.ptm('content')), [renderSlot(_ctx.$slots, \"default\")], 16, _hoisted_1)], 16), createElementVNode(\"div\", mergeProps({\n ref: \"xBar\",\n \"class\": _ctx.cx('barx'),\n tabindex: \"0\",\n role: \"scrollbar\",\n \"aria-orientation\": \"horizontal\",\n \"aria-controls\": $options.contentId,\n \"aria-valuenow\": $data.lastScrollLeft,\n onMousedown: _cache[2] || (_cache[2] = function () {\n return $options.onXBarMouseDown && $options.onXBarMouseDown.apply($options, arguments);\n }),\n onKeydown: _cache[3] || (_cache[3] = function ($event) {\n return $options.onKeyDown($event);\n }),\n onKeyup: _cache[4] || (_cache[4] = function () {\n return $options.onKeyUp && $options.onKeyUp.apply($options, arguments);\n }),\n onFocus: _cache[5] || (_cache[5] = function () {\n return $options.onFocus && $options.onFocus.apply($options, arguments);\n }),\n onBlur: _cache[6] || (_cache[6] = function () {\n return $options.onBlur && $options.onBlur.apply($options, arguments);\n })\n }, _ctx.ptm('barx'), {\n \"data-pc-group-section\": \"bar\"\n }), null, 16, _hoisted_2), createElementVNode(\"div\", mergeProps({\n ref: \"yBar\",\n \"class\": _ctx.cx('bary'),\n tabindex: \"0\",\n role: \"scrollbar\",\n \"aria-orientation\": \"vertical\",\n \"aria-controls\": $options.contentId,\n \"aria-valuenow\": $data.lastScrollTop,\n onMousedown: _cache[7] || (_cache[7] = function () {\n return $options.onYBarMouseDown && $options.onYBarMouseDown.apply($options, arguments);\n }),\n onKeydown: _cache[8] || (_cache[8] = function ($event) {\n return $options.onKeyDown($event);\n }),\n onKeyup: _cache[9] || (_cache[9] = function () {\n return $options.onKeyUp && $options.onKeyUp.apply($options, arguments);\n }),\n onFocus: _cache[10] || (_cache[10] = function () {\n return $options.onFocus && $options.onFocus.apply($options, arguments);\n })\n }, _ctx.ptm('bary'), {\n \"data-pc-group-section\": \"bar\"\n }), null, 16, _hoisted_3)], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-card {\\n background: \".concat(dt('card.background'), \";\\n color: \").concat(dt('card.color'), \";\\n box-shadow: \").concat(dt('card.shadow'), \";\\n border-radius: \").concat(dt('card.border.radius'), \";\\n display: flex;\\n flex-direction: column;\\n}\\n\\n.p-card-caption {\\n display: flex;\\n flex-direction: column;\\n gap: \").concat(dt('card.caption.gap'), \";\\n}\\n\\n.p-card-body {\\n padding: \").concat(dt('card.body.padding'), \";\\n display: flex;\\n flex-direction: column;\\n gap: \").concat(dt('card.body.gap'), \";\\n}\\n\\n.p-card-title {\\n font-size: \").concat(dt('card.title.font.size'), \";\\n font-weight: \").concat(dt('card.title.font.weight'), \";\\n}\\n\\n.p-card-subtitle {\\n color: \").concat(dt('card.subtitle.color'), \";\\n}\\n\");\n};\nvar classes = {\n root: 'p-card p-component',\n header: 'p-card-header',\n body: 'p-card-body',\n caption: 'p-card-caption',\n title: 'p-card-title',\n subtitle: 'p-card-subtitle',\n content: 'p-card-content',\n footer: 'p-card-footer'\n};\nvar CardStyle = BaseStyle.extend({\n name: 'card',\n theme: theme,\n classes: classes\n});\n\nexport { CardStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseComponent from '@primevue/core/basecomponent';\nimport CardStyle from 'primevue/card/style';\nimport { openBlock, createElementBlock, mergeProps, renderSlot, createCommentVNode, createElementVNode } from 'vue';\n\nvar script$1 = {\n name: 'BaseCard',\n \"extends\": BaseComponent,\n style: CardStyle,\n provide: function provide() {\n return {\n $pcCard: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'Card',\n \"extends\": script$1,\n inheritAttrs: false\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), [_ctx.$slots.header ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('header')\n }, _ctx.ptm('header')), [renderSlot(_ctx.$slots, \"header\")], 16)) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('body')\n }, _ctx.ptm('body')), [_ctx.$slots.title || _ctx.$slots.subtitle ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('caption')\n }, _ctx.ptm('caption')), [_ctx.$slots.title ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('title')\n }, _ctx.ptm('title')), [renderSlot(_ctx.$slots, \"title\")], 16)) : createCommentVNode(\"\", true), _ctx.$slots.subtitle ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('subtitle')\n }, _ctx.ptm('subtitle')), [renderSlot(_ctx.$slots, \"subtitle\")], 16)) : createCommentVNode(\"\", true)], 16)) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('content')\n }, _ctx.ptm('content')), [renderSlot(_ctx.$slots, \"content\")], 16), _ctx.$slots.footer ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('footer')\n }, _ctx.ptm('footer')), [renderSlot(_ctx.$slots, \"footer\")], 16)) : createCommentVNode(\"\", true)], 16)], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","\n\n\n\n\n","\n\n\n","import { useClipboard } from '@vueuse/core'\nimport { useToast } from 'primevue/usetoast'\n\nimport { t } from '@/i18n'\n\nexport function useCopyToClipboard() {\n const { copy, isSupported } = useClipboard()\n const toast = useToast()\n\n const copyToClipboard = async (text: string) => {\n if (isSupported) {\n try {\n await copy(text)\n toast.add({\n severity: 'success',\n summary: t('g.success'),\n detail: t('clipboard.successMessage'),\n life: 3000\n })\n } catch (err) {\n toast.add({\n severity: 'error',\n summary: t('g.error'),\n detail: t('clipboard.errorMessage')\n })\n }\n } else {\n toast.add({\n severity: 'error',\n summary: t('g.error'),\n detail: t('clipboard.errorNotSupported')\n })\n }\n }\n\n return {\n copyToClipboard\n }\n}\n","import { resolve, isArray, mergeKeys, isNotEmpty } from '@primeuix/utils';\nimport { reactive, computed, getCurrentInstance, onMounted, nextTick, mergeProps, watch, toValue } from 'vue';\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _regeneratorRuntime() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction tryOnMounted(fn) {\n var sync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n if (getCurrentInstance()) onMounted(fn);else if (sync) fn();else nextTick(fn);\n}\nvar useForm = function useForm() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var states = reactive({});\n var fields = reactive({});\n var valid = computed(function () {\n return Object.values(states).every(function (field) {\n return !field.invalid;\n });\n });\n var getInitialState = function getInitialState(field, initialValue) {\n var _options$initialValue;\n return {\n value: initialValue !== null && initialValue !== void 0 ? initialValue : (_options$initialValue = options.initialValues) === null || _options$initialValue === void 0 ? void 0 : _options$initialValue[field],\n touched: false,\n dirty: false,\n pristine: true,\n valid: true,\n invalid: false,\n error: null,\n errors: []\n };\n };\n var isFieldValidate = function isFieldValidate(field, validateOn) {\n var value = resolve(validateOn, field);\n return value === true || isArray(value) && value.includes(field);\n };\n var validateOn = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(option, defaultValue) {\n var _options$option;\n var results, fieldArr;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n results = {};\n if (!isArray(options[option])) {\n _context.next = 7;\n break;\n }\n _context.next = 4;\n return validate(options[option]);\n case 4:\n results = _context.sent;\n _context.next = 12;\n break;\n case 7:\n _context.t0 = (_options$option = options[option]) !== null && _options$option !== void 0 ? _options$option : defaultValue;\n if (!_context.t0) {\n _context.next = 12;\n break;\n }\n _context.next = 11;\n return validate();\n case 11:\n results = _context.sent;\n case 12:\n fieldArr = Object.keys(fields).filter(function (field) {\n var _fields$field;\n return (_fields$field = fields[field]) === null || _fields$field === void 0 || (_fields$field = _fields$field.options) === null || _fields$field === void 0 ? void 0 : _fields$field[option];\n }) || [];\n _context.t1 = isNotEmpty(fieldArr);\n if (!_context.t1) {\n _context.next = 18;\n break;\n }\n _context.next = 17;\n return validate(fieldArr);\n case 17:\n results = _context.sent;\n case 18:\n return _context.abrupt(\"return\", results);\n case 19:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function validateOn(_x, _x2) {\n return _ref.apply(this, arguments);\n };\n }();\n var validateFieldOn = function validateFieldOn(field, fieldOptions, option, defaultValue) {\n var _fieldOptions$option, _options$option2;\n ((_fieldOptions$option = fieldOptions === null || fieldOptions === void 0 ? void 0 : fieldOptions[option]) !== null && _fieldOptions$option !== void 0 ? _fieldOptions$option : isFieldValidate(field, (_options$option2 = options[option]) !== null && _options$option2 !== void 0 ? _options$option2 : defaultValue)) && validate(field);\n };\n var defineField = function defineField(field, fieldOptions) {\n var _resolve;\n states[field] || (states[field] = getInitialState(field, fieldOptions === null || fieldOptions === void 0 ? void 0 : fieldOptions.initialValue));\n var props = mergeProps((_resolve = resolve(fieldOptions, states[field])) === null || _resolve === void 0 ? void 0 : _resolve.props, resolve(fieldOptions === null || fieldOptions === void 0 ? void 0 : fieldOptions.props, states[field]), {\n name: field,\n onBlur: function onBlur() {\n states[field].touched = true;\n validateFieldOn(field, fieldOptions, 'validateOnBlur');\n },\n onInput: function onInput(event) {\n states[field].value = event.hasOwnProperty('value') ? event.value : event.target.value;\n },\n onChange: function onChange(event) {\n states[field].value = event.hasOwnProperty('value') ? event.value : event.target.type === 'checkbox' || event.target.type === 'radio' ? event.target.checked : event.target.value;\n },\n onInvalid: function onInvalid(errors) {\n var _errors$;\n states[field].invalid = true;\n states[field].errors = errors;\n states[field].error = (_errors$ = errors === null || errors === void 0 ? void 0 : errors[0]) !== null && _errors$ !== void 0 ? _errors$ : null;\n }\n });\n fields[field] = {\n props: props,\n states: states[field],\n options: fieldOptions\n };\n watch(function () {\n return states[field].value;\n }, function (newValue, oldValue) {\n if (states[field].pristine) {\n states[field].pristine = false;\n }\n if (newValue !== oldValue) {\n states[field].dirty = true;\n }\n validateFieldOn(field, fieldOptions, 'validateOnValueUpdate', true);\n });\n return [states[field], props];\n };\n var handleSubmit = function handleSubmit(callback) {\n return /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {\n var results;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return validateOn('validateOnSubmit', true);\n case 2:\n results = _context2.sent;\n return _context2.abrupt(\"return\", callback(_objectSpread({\n originalEvent: event,\n valid: toValue(valid),\n states: toValue(states),\n reset: reset\n }, results)));\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n return function (_x3) {\n return _ref2.apply(this, arguments);\n };\n }();\n };\n var validate = /*#__PURE__*/function () {\n var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(field) {\n var _yield$options$resolv, _options$resolver, _result, _result$errors;\n var resolverOptions, result, flattenFields, _i, _Object$entries, _Object$entries$_i, fieldName, fieldInst, _fieldInst$options, _result$errors$fieldN, _errors$2, fieldResolver, _yield$fieldResolver, fieldValue, fieldResult, errors;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n resolverOptions = Object.entries(states).reduce(function (acc, _ref4) {\n var _ref5 = _slicedToArray(_ref4, 2),\n key = _ref5[0],\n val = _ref5[1];\n acc.names.push(key);\n acc.values[key] = val.value;\n return acc;\n }, {\n names: [],\n values: {}\n });\n _context3.next = 3;\n return (_options$resolver = options.resolver) === null || _options$resolver === void 0 ? void 0 : _options$resolver.call(options, resolverOptions);\n case 3:\n _context3.t1 = _yield$options$resolv = _context3.sent;\n _context3.t0 = _context3.t1 !== null;\n if (!_context3.t0) {\n _context3.next = 7;\n break;\n }\n _context3.t0 = _yield$options$resolv !== void 0;\n case 7:\n if (!_context3.t0) {\n _context3.next = 11;\n break;\n }\n _context3.t2 = _yield$options$resolv;\n _context3.next = 12;\n break;\n case 11:\n _context3.t2 = {};\n case 12:\n result = _context3.t2;\n (_result$errors = (_result = result).errors) !== null && _result$errors !== void 0 ? _result$errors : _result.errors = {};\n flattenFields = [field].flat();\n _i = 0, _Object$entries = Object.entries(fields);\n case 16:\n if (!(_i < _Object$entries.length)) {\n _context3.next = 44;\n break;\n }\n _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), fieldName = _Object$entries$_i[0], fieldInst = _Object$entries$_i[1];\n if (!(flattenFields.includes(fieldName) || !field)) {\n _context3.next = 41;\n break;\n }\n fieldResolver = (_fieldInst$options = fieldInst.options) === null || _fieldInst$options === void 0 ? void 0 : _fieldInst$options.resolver;\n if (!fieldResolver) {\n _context3.next = 36;\n break;\n }\n fieldValue = fieldInst.states.value;\n _context3.next = 24;\n return fieldResolver({\n values: fieldValue,\n value: fieldValue,\n name: fieldName\n });\n case 24:\n _context3.t4 = _yield$fieldResolver = _context3.sent;\n _context3.t3 = _context3.t4 !== null;\n if (!_context3.t3) {\n _context3.next = 28;\n break;\n }\n _context3.t3 = _yield$fieldResolver !== void 0;\n case 28:\n if (!_context3.t3) {\n _context3.next = 32;\n break;\n }\n _context3.t5 = _yield$fieldResolver;\n _context3.next = 33;\n break;\n case 32:\n _context3.t5 = {};\n case 33:\n fieldResult = _context3.t5;\n isArray(fieldResult.errors) && (fieldResult.errors = _defineProperty({}, fieldName, fieldResult.errors));\n result = mergeKeys(result, fieldResult);\n case 36:\n errors = (_result$errors$fieldN = result.errors[fieldName]) !== null && _result$errors$fieldN !== void 0 ? _result$errors$fieldN : []; //const value = result.values?.[fieldName] ?? states[sField].value;\n states[fieldName].invalid = errors.length > 0;\n states[fieldName].valid = !states[fieldName].invalid;\n states[fieldName].errors = errors;\n states[fieldName].error = (_errors$2 = errors === null || errors === void 0 ? void 0 : errors[0]) !== null && _errors$2 !== void 0 ? _errors$2 : null;\n //states[fieldName].value = value;\n case 41:\n _i++;\n _context3.next = 16;\n break;\n case 44:\n return _context3.abrupt(\"return\", result);\n case 45:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n return function validate(_x4) {\n return _ref3.apply(this, arguments);\n };\n }();\n var reset = function reset() {\n Object.keys(states).forEach(function (field) {\n var _fields$field2;\n return fields[field].states = states[field] = getInitialState(field, (_fields$field2 = fields[field]) === null || _fields$field2 === void 0 || (_fields$field2 = _fields$field2.options) === null || _fields$field2 === void 0 ? void 0 : _fields$field2.initialValue);\n });\n };\n var validateOnMounted = function validateOnMounted() {\n validateOn('validateOnMount');\n };\n tryOnMounted(validateOnMounted);\n return {\n defineField: defineField,\n handleSubmit: handleSubmit,\n validate: validate,\n reset: reset,\n valid: valid,\n states: states,\n fields: fields\n };\n};\n\nexport { useForm };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar classes = {\n root: 'p-form p-component'\n};\nvar FormStyle = BaseStyle.extend({\n name: 'form',\n classes: classes\n});\n\nexport { FormStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { omit } from '@primeuix/utils';\nimport { useForm } from '@primevue/forms/useform';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport FormStyle from '@primevue/forms/form/style';\nimport { openBlock, createElementBlock, mergeProps, withModifiers, renderSlot } from 'vue';\n\nvar script$1 = {\n name: 'BaseForm',\n \"extends\": BaseComponent,\n style: FormStyle,\n props: {\n resolver: {\n type: Function,\n \"default\": null\n },\n initialValues: {\n type: Object,\n \"default\": null\n },\n validateOnValueUpdate: {\n type: [Boolean, Array],\n \"default\": true\n },\n validateOnBlur: {\n type: [Boolean, Array],\n \"default\": false\n },\n validateOnMount: {\n type: [Boolean, Array],\n \"default\": false\n },\n validateOnSubmit: {\n type: [Boolean, Array],\n \"default\": true\n }\n },\n provide: function provide() {\n return {\n $pcForm: this,\n $parentInstance: this\n };\n }\n};\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nvar script = {\n name: 'Form',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['submit'],\n setup: function setup(props, _ref) {\n var emit = _ref.emit;\n var $form = useForm(props);\n var register = function register(field, options) {\n var _$form$defineField = $form.defineField(field, options),\n _$form$defineField2 = _slicedToArray(_$form$defineField, 2),\n fieldProps = _$form$defineField2[1];\n return fieldProps;\n };\n var onSubmit = $form.handleSubmit(function (e) {\n emit('submit', e);\n });\n return _objectSpread({\n register: register,\n onSubmit: onSubmit\n }, omit($form, ['handleSubmit']));\n }\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"form\", mergeProps({\n onSubmit: _cache[0] || (_cache[0] = withModifiers(function () {\n return $setup.onSubmit && $setup.onSubmit.apply($setup, arguments);\n }, [\"prevent\"])),\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), [renderSlot(_ctx.$slots, \"default\", mergeProps({\n register: $setup.register,\n valid: _ctx.valid,\n reset: _ctx.reset\n }, _ctx.states))], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar classes = {\n root: 'p-formfield p-component'\n};\nvar FormFieldStyle = BaseStyle.extend({\n name: 'formfield',\n classes: classes\n});\n\nexport { FormFieldStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseComponent from '@primevue/core/basecomponent';\nimport FormFieldStyle from '@primevue/forms/formfield/style';\nimport { openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, renderSlot } from 'vue';\n\nvar script$1 = {\n name: 'BaseFormField',\n \"extends\": BaseComponent,\n style: FormFieldStyle,\n props: {\n name: {\n type: String,\n \"default\": undefined\n },\n resolver: {\n type: Function,\n \"default\": undefined\n },\n initialValue: {\n type: null,\n \"default\": undefined\n },\n validateOnValueUpdate: {\n type: Boolean,\n \"default\": undefined\n },\n validateOnBlur: {\n type: Boolean,\n \"default\": undefined\n },\n validateOnMount: {\n type: Boolean,\n \"default\": undefined\n },\n validateOnSubmit: {\n type: Boolean,\n \"default\": undefined\n },\n as: {\n type: [String, Object],\n \"default\": 'DIV'\n },\n asChild: {\n type: Boolean,\n \"default\": false\n }\n },\n provide: function provide() {\n return {\n $pcFormField: this,\n $parentInstance: this\n };\n }\n};\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar script = {\n name: 'FormField',\n \"extends\": script$1,\n inheritAttrs: false,\n inject: {\n $pcForm: {\n \"default\": undefined\n }\n },\n watch: {\n formControl: {\n immediate: true,\n handler: function handler(newValue) {\n var _this$$pcForm, _this$$pcForm$registe;\n (_this$$pcForm = this.$pcForm) === null || _this$$pcForm === void 0 || (_this$$pcForm$registe = _this$$pcForm.register) === null || _this$$pcForm$registe === void 0 || _this$$pcForm$registe.call(_this$$pcForm, this.name, newValue);\n }\n }\n },\n computed: {\n formControl: function formControl() {\n return {\n name: this.name,\n resolver: this.resolver,\n initialValue: this.initialValue,\n validateOnValueUpdate: this.validateOnValueUpdate,\n validateOnBlur: this.validateOnBlur,\n validateOnMount: this.validateOnMount,\n validateOnSubmit: this.validateOnSubmit\n };\n },\n field: function field() {\n var _this$$pcForm2;\n return ((_this$$pcForm2 = this.$pcForm) === null || _this$$pcForm2 === void 0 || (_this$$pcForm2 = _this$$pcForm2.fields) === null || _this$$pcForm2 === void 0 ? void 0 : _this$$pcForm2[this.name]) || {};\n },\n fieldAttrs: function fieldAttrs() {\n return _objectSpread(_objectSpread({}, this.field.props), this.field.states);\n }\n }\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return !_ctx.asChild ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({\n key: 0,\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), {\n \"default\": withCtx(function () {\n return [renderSlot(_ctx.$slots, \"default\", mergeProps({\n props: $options.field.props\n }, $options.fieldAttrs))];\n }),\n _: 3\n }, 16, [\"class\"])) : renderSlot(_ctx.$slots, \"default\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('root'),\n props: $options.field.props\n }, $options.fieldAttrs));\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","// src/utils/index.ts\nimport { isObject } from \"@primeuix/utils/object\";\nvar toValues = (value, name) => {\n if (isObject(value) && value.hasOwnProperty(name)) {\n return value;\n }\n return name ? { [name]: value } : value;\n};\nexport {\n toValues\n};\n//# sourceMappingURL=index.mjs.map","// src/resolvers/zod/index.ts\nimport { toValues } from \"@primeuix/forms/utils\";\nimport { isNotEmpty } from \"@primeuix/utils/object\";\nvar zodResolver = (schema, schemaOptions, resolverOptions) => async ({ values, name }) => {\n const { sync = false, raw = false } = resolverOptions || {};\n try {\n const result = await schema[sync ? \"parse\" : \"parseAsync\"](values, schemaOptions);\n return {\n values: toValues(raw ? values : result, name),\n errors: {}\n };\n } catch (e) {\n if (Array.isArray(e?.errors)) {\n return {\n values: toValues(raw ? values : void 0, name),\n errors: e.errors.reduce((acc, error) => {\n const pathKey = isNotEmpty(error.path) ? error.path[0] : name;\n if (pathKey) {\n acc[pathKey] ||= [];\n acc[pathKey].push(error);\n }\n return acc;\n }, {})\n };\n }\n throw e;\n }\n};\nexport {\n zodResolver\n};\n//# sourceMappingURL=index.mjs.map","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys'),\n keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'CheckIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'MinusIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M13.2222 7.77778H0.777778C0.571498 7.77778 0.373667 7.69584 0.227806 7.54998C0.0819442 7.40412 0 7.20629 0 7.00001C0 6.79373 0.0819442 6.5959 0.227806 6.45003C0.373667 6.30417 0.571498 6.22223 0.777778 6.22223H13.2222C13.4285 6.22223 13.6263 6.30417 13.7722 6.45003C13.9181 6.5959 14 6.79373 14 7.00001C14 7.20629 13.9181 7.40412 13.7722 7.54998C13.6263 7.69584 13.4285 7.77778 13.2222 7.77778Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-checkbox {\\n position: relative;\\n display: inline-flex;\\n user-select: none;\\n vertical-align: bottom;\\n width: \".concat(dt('checkbox.width'), \";\\n height: \").concat(dt('checkbox.height'), \";\\n}\\n\\n.p-checkbox-input {\\n cursor: pointer;\\n appearance: none;\\n position: absolute;\\n inset-block-start: 0;\\n inset-inline-start: 0;\\n width: 100%;\\n height: 100%;\\n padding: 0;\\n margin: 0;\\n opacity: 0;\\n z-index: 1;\\n outline: 0 none;\\n border: 1px solid transparent;\\n border-radius: \").concat(dt('checkbox.border.radius'), \";\\n}\\n\\n.p-checkbox-box {\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n border-radius: \").concat(dt('checkbox.border.radius'), \";\\n border: 1px solid \").concat(dt('checkbox.border.color'), \";\\n background: \").concat(dt('checkbox.background'), \";\\n width: \").concat(dt('checkbox.width'), \";\\n height: \").concat(dt('checkbox.height'), \";\\n transition: background \").concat(dt('checkbox.transition.duration'), \", color \").concat(dt('checkbox.transition.duration'), \", border-color \").concat(dt('checkbox.transition.duration'), \", box-shadow \").concat(dt('checkbox.transition.duration'), \", outline-color \").concat(dt('checkbox.transition.duration'), \";\\n outline-color: transparent;\\n box-shadow: \").concat(dt('checkbox.shadow'), \";\\n}\\n\\n.p-checkbox-icon {\\n transition-duration: \").concat(dt('checkbox.transition.duration'), \";\\n color: \").concat(dt('checkbox.icon.color'), \";\\n font-size: \").concat(dt('checkbox.icon.size'), \";\\n width: \").concat(dt('checkbox.icon.size'), \";\\n height: \").concat(dt('checkbox.icon.size'), \";\\n}\\n\\n.p-checkbox:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {\\n border-color: \").concat(dt('checkbox.hover.border.color'), \";\\n}\\n\\n.p-checkbox-checked .p-checkbox-box {\\n border-color: \").concat(dt('checkbox.checked.border.color'), \";\\n background: \").concat(dt('checkbox.checked.background'), \";\\n}\\n\\n.p-checkbox-checked .p-checkbox-icon {\\n color: \").concat(dt('checkbox.icon.checked.color'), \";\\n}\\n\\n.p-checkbox-checked:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {\\n background: \").concat(dt('checkbox.checked.hover.background'), \";\\n border-color: \").concat(dt('checkbox.checked.hover.border.color'), \";\\n}\\n\\n.p-checkbox-checked:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-icon {\\n color: \").concat(dt('checkbox.icon.checked.hover.color'), \";\\n}\\n\\n.p-checkbox:not(.p-disabled):has(.p-checkbox-input:focus-visible) .p-checkbox-box {\\n border-color: \").concat(dt('checkbox.focus.border.color'), \";\\n box-shadow: \").concat(dt('checkbox.focus.ring.shadow'), \";\\n outline: \").concat(dt('checkbox.focus.ring.width'), \" \").concat(dt('checkbox.focus.ring.style'), \" \").concat(dt('checkbox.focus.ring.color'), \";\\n outline-offset: \").concat(dt('checkbox.focus.ring.offset'), \";\\n}\\n\\n.p-checkbox-checked:not(.p-disabled):has(.p-checkbox-input:focus-visible) .p-checkbox-box {\\n border-color: \").concat(dt('checkbox.checked.focus.border.color'), \";\\n}\\n\\n.p-checkbox.p-invalid > .p-checkbox-box {\\n border-color: \").concat(dt('checkbox.invalid.border.color'), \";\\n}\\n\\n.p-checkbox.p-variant-filled .p-checkbox-box {\\n background: \").concat(dt('checkbox.filled.background'), \";\\n}\\n\\n.p-checkbox-checked.p-variant-filled .p-checkbox-box {\\n background: \").concat(dt('checkbox.checked.background'), \";\\n}\\n\\n.p-checkbox-checked.p-variant-filled:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {\\n background: \").concat(dt('checkbox.checked.hover.background'), \";\\n}\\n\\n.p-checkbox.p-disabled {\\n opacity: 1;\\n}\\n\\n.p-checkbox.p-disabled .p-checkbox-box {\\n background: \").concat(dt('checkbox.disabled.background'), \";\\n border-color: \").concat(dt('checkbox.checked.disabled.border.color'), \";\\n}\\n\\n.p-checkbox.p-disabled .p-checkbox-box .p-checkbox-icon {\\n color: \").concat(dt('checkbox.icon.disabled.color'), \";\\n}\\n\\n.p-checkbox-sm,\\n.p-checkbox-sm .p-checkbox-box {\\n width: \").concat(dt('checkbox.sm.width'), \";\\n height: \").concat(dt('checkbox.sm.height'), \";\\n}\\n\\n.p-checkbox-sm .p-checkbox-icon {\\n font-size: \").concat(dt('checkbox.icon.sm.size'), \";\\n width: \").concat(dt('checkbox.icon.sm.size'), \";\\n height: \").concat(dt('checkbox.icon.sm.size'), \";\\n}\\n\\n.p-checkbox-lg,\\n.p-checkbox-lg .p-checkbox-box {\\n width: \").concat(dt('checkbox.lg.width'), \";\\n height: \").concat(dt('checkbox.lg.height'), \";\\n}\\n\\n.p-checkbox-lg .p-checkbox-icon {\\n font-size: \").concat(dt('checkbox.icon.lg.size'), \";\\n width: \").concat(dt('checkbox.icon.lg.size'), \";\\n height: \").concat(dt('checkbox.icon.lg.size'), \";\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var instance = _ref2.instance,\n props = _ref2.props;\n return ['p-checkbox p-component', {\n 'p-checkbox-checked': instance.checked,\n 'p-disabled': props.disabled,\n 'p-invalid': instance.$pcCheckboxGroup ? instance.$pcCheckboxGroup.$invalid : instance.$invalid,\n 'p-variant-filled': instance.$variant === 'filled',\n 'p-checkbox-sm p-inputfield-sm': props.size === 'small',\n 'p-checkbox-lg p-inputfield-lg': props.size === 'large'\n }];\n },\n box: 'p-checkbox-box',\n input: 'p-checkbox-input',\n icon: 'p-checkbox-icon'\n};\nvar CheckboxStyle = BaseStyle.extend({\n name: 'checkbox',\n theme: theme,\n classes: classes\n});\n\nexport { CheckboxStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { equals, contains } from '@primeuix/utils/object';\nimport CheckIcon from '@primevue/icons/check';\nimport MinusIcon from '@primevue/icons/minus';\nimport BaseInput from '@primevue/core/baseinput';\nimport CheckboxStyle from 'primevue/checkbox/style';\nimport { resolveComponent, openBlock, createElementBlock, mergeProps, createElementVNode, renderSlot, normalizeClass, createBlock, createCommentVNode } from 'vue';\n\nvar script$1 = {\n name: 'BaseCheckbox',\n \"extends\": BaseInput,\n props: {\n value: null,\n binary: Boolean,\n indeterminate: {\n type: Boolean,\n \"default\": false\n },\n trueValue: {\n type: null,\n \"default\": true\n },\n falseValue: {\n type: null,\n \"default\": false\n },\n readonly: {\n type: Boolean,\n \"default\": false\n },\n required: {\n type: Boolean,\n \"default\": false\n },\n tabindex: {\n type: Number,\n \"default\": null\n },\n inputId: {\n type: String,\n \"default\": null\n },\n inputClass: {\n type: [String, Object],\n \"default\": null\n },\n inputStyle: {\n type: Object,\n \"default\": null\n },\n ariaLabelledby: {\n type: String,\n \"default\": null\n },\n ariaLabel: {\n type: String,\n \"default\": null\n }\n },\n style: CheckboxStyle,\n provide: function provide() {\n return {\n $pcCheckbox: this,\n $parentInstance: this\n };\n }\n};\n\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nvar script = {\n name: 'Checkbox',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['change', 'focus', 'blur', 'update:indeterminate'],\n inject: {\n $pcCheckboxGroup: {\n \"default\": undefined\n }\n },\n data: function data() {\n return {\n d_indeterminate: this.indeterminate\n };\n },\n watch: {\n indeterminate: function indeterminate(newValue) {\n this.d_indeterminate = newValue;\n }\n },\n methods: {\n getPTOptions: function getPTOptions(key) {\n var _ptm = key === 'root' ? this.ptmi : this.ptm;\n return _ptm(key, {\n context: {\n checked: this.checked,\n indeterminate: this.d_indeterminate,\n disabled: this.disabled\n }\n });\n },\n onChange: function onChange(event) {\n var _this = this;\n if (!this.disabled && !this.readonly) {\n var value = this.$pcCheckboxGroup ? this.$pcCheckboxGroup.d_value : this.d_value;\n var newModelValue;\n if (this.binary) {\n newModelValue = this.d_indeterminate ? this.trueValue : this.checked ? this.falseValue : this.trueValue;\n } else {\n if (this.checked || this.d_indeterminate) newModelValue = value.filter(function (val) {\n return !equals(val, _this.value);\n });else newModelValue = value ? [].concat(_toConsumableArray(value), [this.value]) : [this.value];\n }\n if (this.d_indeterminate) {\n this.d_indeterminate = false;\n this.$emit('update:indeterminate', this.d_indeterminate);\n }\n this.$pcCheckboxGroup ? this.$pcCheckboxGroup.writeValue(newModelValue, event) : this.writeValue(newModelValue, event);\n this.$emit('change', event);\n }\n },\n onFocus: function onFocus(event) {\n this.$emit('focus', event);\n },\n onBlur: function onBlur(event) {\n var _this$formField$onBlu, _this$formField;\n this.$emit('blur', event);\n (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField, event);\n }\n },\n computed: {\n groupName: function groupName() {\n return this.$pcCheckboxGroup ? this.$pcCheckboxGroup.groupName : this.$formName;\n },\n checked: function checked() {\n var value = this.$pcCheckboxGroup ? this.$pcCheckboxGroup.d_value : this.d_value;\n return this.d_indeterminate ? false : this.binary ? value === this.trueValue : contains(this.value, value);\n }\n },\n components: {\n CheckIcon: CheckIcon,\n MinusIcon: MinusIcon\n }\n};\n\nvar _hoisted_1 = [\"data-p-checked\", \"data-p-indeterminate\", \"data-p-disabled\"];\nvar _hoisted_2 = [\"id\", \"value\", \"name\", \"checked\", \"tabindex\", \"disabled\", \"readonly\", \"required\", \"aria-labelledby\", \"aria-label\", \"aria-invalid\", \"aria-checked\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_CheckIcon = resolveComponent(\"CheckIcon\");\n var _component_MinusIcon = resolveComponent(\"MinusIcon\");\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root')\n }, $options.getPTOptions('root'), {\n \"data-p-checked\": $options.checked,\n \"data-p-indeterminate\": $data.d_indeterminate || undefined,\n \"data-p-disabled\": _ctx.disabled\n }), [createElementVNode(\"input\", mergeProps({\n id: _ctx.inputId,\n type: \"checkbox\",\n \"class\": [_ctx.cx('input'), _ctx.inputClass],\n style: _ctx.inputStyle,\n value: _ctx.value,\n name: $options.groupName,\n checked: $options.checked,\n tabindex: _ctx.tabindex,\n disabled: _ctx.disabled,\n readonly: _ctx.readonly,\n required: _ctx.required,\n \"aria-labelledby\": _ctx.ariaLabelledby,\n \"aria-label\": _ctx.ariaLabel,\n \"aria-invalid\": _ctx.invalid || undefined,\n \"aria-checked\": $data.d_indeterminate ? 'mixed' : undefined,\n onFocus: _cache[0] || (_cache[0] = function () {\n return $options.onFocus && $options.onFocus.apply($options, arguments);\n }),\n onBlur: _cache[1] || (_cache[1] = function () {\n return $options.onBlur && $options.onBlur.apply($options, arguments);\n }),\n onChange: _cache[2] || (_cache[2] = function () {\n return $options.onChange && $options.onChange.apply($options, arguments);\n })\n }, $options.getPTOptions('input')), null, 16, _hoisted_2), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('box')\n }, $options.getPTOptions('box')), [renderSlot(_ctx.$slots, \"icon\", {\n checked: $options.checked,\n indeterminate: $data.d_indeterminate,\n \"class\": normalizeClass(_ctx.cx('icon'))\n }, function () {\n return [$options.checked ? (openBlock(), createBlock(_component_CheckIcon, mergeProps({\n key: 0,\n \"class\": _ctx.cx('icon')\n }, $options.getPTOptions('icon')), null, 16, [\"class\"])) : $data.d_indeterminate ? (openBlock(), createBlock(_component_MinusIcon, mergeProps({\n key: 1,\n \"class\": _ctx.cx('icon')\n }, $options.getPTOptions('icon')), null, 16, [\"class\"])) : createCommentVNode(\"\", true)];\n })], 16)], 16, _hoisted_1);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-inputtext {\\n font-family: inherit;\\n font-feature-settings: inherit;\\n font-size: 1rem;\\n color: \".concat(dt('inputtext.color'), \";\\n background: \").concat(dt('inputtext.background'), \";\\n padding-block: \").concat(dt('inputtext.padding.y'), \";\\n padding-inline: \").concat(dt('inputtext.padding.x'), \";\\n border: 1px solid \").concat(dt('inputtext.border.color'), \";\\n transition: background \").concat(dt('inputtext.transition.duration'), \", color \").concat(dt('inputtext.transition.duration'), \", border-color \").concat(dt('inputtext.transition.duration'), \", outline-color \").concat(dt('inputtext.transition.duration'), \", box-shadow \").concat(dt('inputtext.transition.duration'), \";\\n appearance: none;\\n border-radius: \").concat(dt('inputtext.border.radius'), \";\\n outline-color: transparent;\\n box-shadow: \").concat(dt('inputtext.shadow'), \";\\n}\\n\\n.p-inputtext:enabled:hover {\\n border-color: \").concat(dt('inputtext.hover.border.color'), \";\\n}\\n\\n.p-inputtext:enabled:focus {\\n border-color: \").concat(dt('inputtext.focus.border.color'), \";\\n box-shadow: \").concat(dt('inputtext.focus.ring.shadow'), \";\\n outline: \").concat(dt('inputtext.focus.ring.width'), \" \").concat(dt('inputtext.focus.ring.style'), \" \").concat(dt('inputtext.focus.ring.color'), \";\\n outline-offset: \").concat(dt('inputtext.focus.ring.offset'), \";\\n}\\n\\n.p-inputtext.p-invalid {\\n border-color: \").concat(dt('inputtext.invalid.border.color'), \";\\n}\\n\\n.p-inputtext.p-variant-filled {\\n background: \").concat(dt('inputtext.filled.background'), \";\\n}\\n\\n.p-inputtext.p-variant-filled:enabled:hover {\\n background: \").concat(dt('inputtext.filled.hover.background'), \";\\n}\\n\\n.p-inputtext.p-variant-filled:enabled:focus {\\n background: \").concat(dt('inputtext.filled.focus.background'), \";\\n}\\n\\n.p-inputtext:disabled {\\n opacity: 1;\\n background: \").concat(dt('inputtext.disabled.background'), \";\\n color: \").concat(dt('inputtext.disabled.color'), \";\\n}\\n\\n.p-inputtext::placeholder {\\n color: \").concat(dt('inputtext.placeholder.color'), \";\\n}\\n\\n.p-inputtext.p-invalid::placeholder {\\n color: \").concat(dt('inputtext.invalid.placeholder.color'), \";\\n}\\n\\n.p-inputtext-sm {\\n font-size: \").concat(dt('inputtext.sm.font.size'), \";\\n padding-block: \").concat(dt('inputtext.sm.padding.y'), \";\\n padding-inline: \").concat(dt('inputtext.sm.padding.x'), \";\\n}\\n\\n.p-inputtext-lg {\\n font-size: \").concat(dt('inputtext.lg.font.size'), \";\\n padding-block: \").concat(dt('inputtext.lg.padding.y'), \";\\n padding-inline: \").concat(dt('inputtext.lg.padding.x'), \";\\n}\\n\\n.p-inputtext-fluid {\\n width: 100%;\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var instance = _ref2.instance,\n props = _ref2.props;\n return ['p-inputtext p-component', {\n 'p-filled': instance.$filled,\n 'p-inputtext-sm p-inputfield-sm': props.size === 'small',\n 'p-inputtext-lg p-inputfield-lg': props.size === 'large',\n 'p-invalid': instance.$invalid,\n 'p-variant-filled': instance.$variant === 'filled',\n 'p-inputtext-fluid': instance.$fluid\n }];\n }\n};\nvar InputTextStyle = BaseStyle.extend({\n name: 'inputtext',\n theme: theme,\n classes: classes\n});\n\nexport { InputTextStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { mergeProps, openBlock, createElementBlock } from 'vue';\nimport BaseInput from '@primevue/core/baseinput';\nimport InputTextStyle from 'primevue/inputtext/style';\n\nvar script$1 = {\n name: 'BaseInputText',\n \"extends\": BaseInput,\n style: InputTextStyle,\n provide: function provide() {\n return {\n $pcInputText: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'InputText',\n \"extends\": script$1,\n inheritAttrs: false,\n methods: {\n onInput: function onInput(event) {\n this.writeValue(event.target.value, event);\n }\n },\n computed: {\n attrs: function attrs() {\n return mergeProps(this.ptmi('root', {\n context: {\n filled: this.$filled,\n disabled: this.disabled\n }\n }), this.formField);\n }\n }\n};\n\nvar _hoisted_1 = [\"value\", \"disabled\", \"aria-invalid\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"input\", mergeProps({\n type: \"text\",\n \"class\": _ctx.cx('root'),\n value: _ctx.d_value,\n disabled: _ctx.disabled,\n \"aria-invalid\": _ctx.$invalid || undefined,\n onInput: _cache[0] || (_cache[0] = function () {\n return $options.onInput && $options.onInput.apply($options, arguments);\n })\n }, $options.attrs), null, 16, _hoisted_1);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'PlusIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M7.67742 6.32258V0.677419C7.67742 0.497757 7.60605 0.325452 7.47901 0.198411C7.35197 0.0713707 7.17966 0 7 0C6.82034 0 6.64803 0.0713707 6.52099 0.198411C6.39395 0.325452 6.32258 0.497757 6.32258 0.677419V6.32258H0.677419C0.497757 6.32258 0.325452 6.39395 0.198411 6.52099C0.0713707 6.64803 0 6.82034 0 7C0 7.17966 0.0713707 7.35197 0.198411 7.47901C0.325452 7.60605 0.497757 7.67742 0.677419 7.67742H6.32258V13.3226C6.32492 13.5015 6.39704 13.6725 6.52358 13.799C6.65012 13.9255 6.82106 13.9977 7 14C7.17966 14 7.35197 13.9286 7.47901 13.8016C7.60605 13.6745 7.67742 13.5022 7.67742 13.3226V7.67742H13.3226C13.5022 7.67742 13.6745 7.60605 13.8016 7.47901C13.9286 7.35197 14 7.17966 14 7C13.9977 6.82106 13.9255 6.65012 13.799 6.52358C13.6725 6.39704 13.5015 6.32492 13.3226 6.32258H7.67742Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-panel {\\n border: 1px solid \".concat(dt('panel.border.color'), \";\\n border-radius: \").concat(dt('panel.border.radius'), \";\\n background: \").concat(dt('panel.background'), \";\\n color: \").concat(dt('panel.color'), \";\\n}\\n\\n.p-panel-header {\\n display: flex;\\n justify-content: space-between;\\n align-items: center;\\n padding: \").concat(dt('panel.header.padding'), \";\\n background: \").concat(dt('panel.header.background'), \";\\n color: \").concat(dt('panel.header.color'), \";\\n border-style: solid;\\n border-width: \").concat(dt('panel.header.border.width'), \";\\n border-color: \").concat(dt('panel.header.border.color'), \";\\n border-radius: \").concat(dt('panel.header.border.radius'), \";\\n}\\n\\n.p-panel-toggleable .p-panel-header {\\n padding: \").concat(dt('panel.toggleable.header.padding'), \";\\n}\\n\\n.p-panel-title {\\n line-height: 1;\\n font-weight: \").concat(dt('panel.title.font.weight'), \";\\n}\\n\\n.p-panel-content {\\n padding: \").concat(dt('panel.content.padding'), \";\\n}\\n\\n.p-panel-footer {\\n padding: \").concat(dt('panel.footer.padding'), \";\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var props = _ref2.props;\n return ['p-panel p-component', {\n 'p-panel-toggleable': props.toggleable\n }];\n },\n header: 'p-panel-header',\n title: 'p-panel-title',\n headerActions: 'p-panel-header-actions',\n pcToggleButton: 'p-panel-toggle-button',\n contentContainer: 'p-panel-content-container',\n content: 'p-panel-content',\n footer: 'p-panel-footer'\n};\nvar PanelStyle = BaseStyle.extend({\n name: 'panel',\n theme: theme,\n classes: classes\n});\n\nexport { PanelStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { UniqueComponentId } from '@primevue/core/utils';\nimport MinusIcon from '@primevue/icons/minus';\nimport PlusIcon from '@primevue/icons/plus';\nimport Button from 'primevue/button';\nimport Ripple from 'primevue/ripple';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport PanelStyle from 'primevue/panel/style';\nimport { resolveComponent, openBlock, createElementBlock, mergeProps, createElementVNode, renderSlot, normalizeClass, toDisplayString, createCommentVNode, createBlock, withCtx, resolveDynamicComponent, createVNode, Transition, withDirectives, vShow } from 'vue';\n\nvar script$1 = {\n name: 'BasePanel',\n \"extends\": BaseComponent,\n props: {\n header: String,\n toggleable: Boolean,\n collapsed: Boolean,\n toggleButtonProps: {\n type: Object,\n \"default\": function _default() {\n return {\n severity: 'secondary',\n text: true,\n rounded: true\n };\n }\n }\n },\n style: PanelStyle,\n provide: function provide() {\n return {\n $pcPanel: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'Panel',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['update:collapsed', 'toggle'],\n data: function data() {\n return {\n id: this.$attrs.id,\n d_collapsed: this.collapsed\n };\n },\n watch: {\n '$attrs.id': function $attrsId(newValue) {\n this.id = newValue || UniqueComponentId();\n },\n collapsed: function collapsed(newValue) {\n this.d_collapsed = newValue;\n }\n },\n mounted: function mounted() {\n this.id = this.id || UniqueComponentId();\n },\n methods: {\n toggle: function toggle(event) {\n this.d_collapsed = !this.d_collapsed;\n this.$emit('update:collapsed', this.d_collapsed);\n this.$emit('toggle', {\n originalEvent: event,\n value: this.d_collapsed\n });\n },\n onKeyDown: function onKeyDown(event) {\n if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') {\n this.toggle(event);\n event.preventDefault();\n }\n }\n },\n computed: {\n buttonAriaLabel: function buttonAriaLabel() {\n return this.toggleButtonProps && this.toggleButtonProps.ariaLabel ? this.toggleButtonProps.ariaLabel : this.header;\n }\n },\n components: {\n PlusIcon: PlusIcon,\n MinusIcon: MinusIcon,\n Button: Button\n },\n directives: {\n ripple: Ripple\n }\n};\n\nvar _hoisted_1 = [\"id\"];\nvar _hoisted_2 = [\"id\", \"aria-labelledby\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_Button = resolveComponent(\"Button\");\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), [createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('header')\n }, _ctx.ptm('header')), [renderSlot(_ctx.$slots, \"header\", {\n id: $data.id + '_header',\n \"class\": normalizeClass(_ctx.cx('title'))\n }, function () {\n return [_ctx.header ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 0,\n id: $data.id + '_header',\n \"class\": _ctx.cx('title')\n }, _ctx.ptm('title')), toDisplayString(_ctx.header), 17, _hoisted_1)) : createCommentVNode(\"\", true)];\n }), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('headerActions')\n }, _ctx.ptm('headerActions')), [renderSlot(_ctx.$slots, \"icons\"), _ctx.toggleable ? (openBlock(), createBlock(_component_Button, mergeProps({\n key: 0,\n id: $data.id + '_header',\n \"class\": _ctx.cx('pcToggleButton'),\n \"aria-label\": $options.buttonAriaLabel,\n \"aria-controls\": $data.id + '_content',\n \"aria-expanded\": !$data.d_collapsed,\n unstyled: _ctx.unstyled,\n onClick: $options.toggle,\n onKeydown: $options.onKeyDown\n }, _ctx.toggleButtonProps, {\n pt: _ctx.ptm('pcToggleButton')\n }), {\n icon: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, _ctx.$slots.toggleicon ? 'toggleicon' : 'togglericon', {\n collapsed: $data.d_collapsed\n }, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent($data.d_collapsed ? 'PlusIcon' : 'MinusIcon'), mergeProps({\n \"class\": slotProps[\"class\"]\n }, _ctx.ptm('pcToggleButton')['icon']), null, 16, [\"class\"]))];\n })];\n }),\n _: 3\n }, 16, [\"id\", \"class\", \"aria-label\", \"aria-controls\", \"aria-expanded\", \"unstyled\", \"onClick\", \"onKeydown\", \"pt\"])) : createCommentVNode(\"\", true)], 16)], 16), createVNode(Transition, mergeProps({\n name: \"p-toggleable-content\"\n }, _ctx.ptm('transition')), {\n \"default\": withCtx(function () {\n return [withDirectives(createElementVNode(\"div\", mergeProps({\n id: $data.id + '_content',\n \"class\": _ctx.cx('contentContainer'),\n role: \"region\",\n \"aria-labelledby\": $data.id + '_header'\n }, _ctx.ptm('contentContainer')), [createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('content')\n }, _ctx.ptm('content')), [renderSlot(_ctx.$slots, \"default\")], 16), _ctx.$slots.footer ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('footer')\n }, _ctx.ptm('footer')), [renderSlot(_ctx.$slots, \"footer\")], 16)) : createCommentVNode(\"\", true)], 16, _hoisted_2), [[vShow, !$data.d_collapsed]])];\n }),\n _: 3\n }, 16)], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-textarea {\\n font-family: inherit;\\n font-feature-settings: inherit;\\n font-size: 1rem;\\n color: \".concat(dt('textarea.color'), \";\\n background: \").concat(dt('textarea.background'), \";\\n padding-block: \").concat(dt('textarea.padding.y'), \";\\n padding-inline: \").concat(dt('textarea.padding.x'), \";\\n border: 1px solid \").concat(dt('textarea.border.color'), \";\\n transition: background \").concat(dt('textarea.transition.duration'), \", color \").concat(dt('textarea.transition.duration'), \", border-color \").concat(dt('textarea.transition.duration'), \", outline-color \").concat(dt('textarea.transition.duration'), \", box-shadow \").concat(dt('textarea.transition.duration'), \";\\n appearance: none;\\n border-radius: \").concat(dt('textarea.border.radius'), \";\\n outline-color: transparent;\\n box-shadow: \").concat(dt('textarea.shadow'), \";\\n}\\n\\n.p-textarea:enabled:hover {\\n border-color: \").concat(dt('textarea.hover.border.color'), \";\\n}\\n\\n.p-textarea:enabled:focus {\\n border-color: \").concat(dt('textarea.focus.border.color'), \";\\n box-shadow: \").concat(dt('textarea.focus.ring.shadow'), \";\\n outline: \").concat(dt('textarea.focus.ring.width'), \" \").concat(dt('textarea.focus.ring.style'), \" \").concat(dt('textarea.focus.ring.color'), \";\\n outline-offset: \").concat(dt('textarea.focus.ring.offset'), \";\\n}\\n\\n.p-textarea.p-invalid {\\n border-color: \").concat(dt('textarea.invalid.border.color'), \";\\n}\\n\\n.p-textarea.p-variant-filled {\\n background: \").concat(dt('textarea.filled.background'), \";\\n}\\n\\n.p-textarea.p-variant-filled:enabled:focus {\\n background: \").concat(dt('textarea.filled.focus.background'), \";\\n}\\n\\n.p-textarea:disabled {\\n opacity: 1;\\n background: \").concat(dt('textarea.disabled.background'), \";\\n color: \").concat(dt('textarea.disabled.color'), \";\\n}\\n\\n.p-textarea::placeholder {\\n color: \").concat(dt('textarea.placeholder.color'), \";\\n}\\n\\n.p-textarea.p-invalid::placeholder {\\n color: \").concat(dt('textarea.invalid.placeholder.color'), \";\\n}\\n\\n.p-textarea-fluid {\\n width: 100%;\\n}\\n\\n.p-textarea-resizable {\\n overflow: hidden;\\n resize: none;\\n}\\n\\n.p-textarea-sm {\\n font-size: \").concat(dt('textarea.sm.font.size'), \";\\n padding-block: \").concat(dt('textarea.sm.padding.y'), \";\\n padding-inline: \").concat(dt('textarea.sm.padding.x'), \";\\n}\\n\\n.p-textarea-lg {\\n font-size: \").concat(dt('textarea.lg.font.size'), \";\\n padding-block: \").concat(dt('textarea.lg.padding.y'), \";\\n padding-inline: \").concat(dt('textarea.lg.padding.x'), \";\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var instance = _ref2.instance,\n props = _ref2.props;\n return ['p-textarea p-component', {\n 'p-filled': instance.$filled,\n 'p-textarea-resizable ': props.autoResize,\n 'p-textarea-sm p-inputfield-sm': props.size === 'small',\n 'p-textarea-lg p-inputfield-lg': props.size === 'large',\n 'p-invalid': instance.$invalid,\n 'p-variant-filled': instance.$variant === 'filled',\n 'p-textarea-fluid': instance.$fluid\n }];\n }\n};\nvar TextareaStyle = BaseStyle.extend({\n name: 'textarea',\n theme: theme,\n classes: classes\n});\n\nexport { TextareaStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { mergeProps, openBlock, createElementBlock } from 'vue';\nimport BaseInput from '@primevue/core/baseinput';\nimport TextareaStyle from 'primevue/textarea/style';\n\nvar script$1 = {\n name: 'BaseTextarea',\n \"extends\": BaseInput,\n props: {\n autoResize: Boolean\n },\n style: TextareaStyle,\n provide: function provide() {\n return {\n $pcTextarea: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'Textarea',\n \"extends\": script$1,\n inheritAttrs: false,\n observer: null,\n mounted: function mounted() {\n var _this = this;\n if (this.autoResize) {\n this.observer = new ResizeObserver(function () {\n _this.resize();\n });\n this.observer.observe(this.$el);\n }\n },\n updated: function updated() {\n if (this.autoResize) {\n this.resize();\n }\n },\n beforeUnmount: function beforeUnmount() {\n if (this.observer) {\n this.observer.disconnect();\n }\n },\n methods: {\n resize: function resize() {\n if (!this.$el.offsetParent) return;\n this.$el.style.height = 'auto';\n this.$el.style.height = this.$el.scrollHeight + 'px';\n if (parseFloat(this.$el.style.height) >= parseFloat(this.$el.style.maxHeight)) {\n this.$el.style.overflowY = 'scroll';\n this.$el.style.height = this.$el.style.maxHeight;\n } else {\n this.$el.style.overflow = 'hidden';\n }\n },\n onInput: function onInput(event) {\n if (this.autoResize) {\n this.resize();\n }\n this.writeValue(event.target.value, event);\n }\n },\n computed: {\n attrs: function attrs() {\n return mergeProps(this.ptmi('root', {\n context: {\n filled: this.$filled,\n disabled: this.disabled\n }\n }), this.formField);\n }\n }\n};\n\nvar _hoisted_1 = [\"value\", \"disabled\", \"aria-invalid\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"textarea\", mergeProps({\n \"class\": _ctx.cx('root'),\n value: _ctx.d_value,\n disabled: _ctx.disabled,\n \"aria-invalid\": _ctx.invalid || undefined,\n onInput: _cache[0] || (_cache[0] = function () {\n return $options.onInput && $options.onInput.apply($options, arguments);\n })\n }, $options.attrs), null, 16, _hoisted_1);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import { z } from 'zod'\n\nexport type DefaultField = 'Workflow' | 'Logs' | 'SystemStats' | 'Settings'\n\nexport interface ReportField {\n /**\n * The label of the field, shown next to the checkbox if the field is opt-in.\n */\n label: string\n\n /**\n * A unique identifier for the field, used internally as the key for this field's value.\n */\n value: string\n\n /**\n * The data associated with this field, sent as part of the report.\n */\n getData: () => unknown\n\n /**\n * Indicates whether the field requires explicit opt-in from the user\n * before its data is included in the report.\n */\n optIn: boolean\n}\n\nexport interface IssueReportPanelProps {\n /**\n * The type of error being reported. This is used to categorize the error.\n */\n errorType: string\n\n /**\n * Which of the default fields to include in the report.\n */\n defaultFields?: DefaultField[]\n\n /**\n * Additional fields to include in the report.\n */\n extraFields?: ReportField[]\n\n /**\n * Tags that will be added to the report. Tags are used to further categorize the error.\n */\n tags?: Record\n\n /**\n * The title displayed in the dialog.\n */\n title?: string\n}\n\nconst checkboxField = z.boolean().optional()\nexport const issueReportSchema = z\n .object({\n contactInfo: z.string().email().max(320).optional().or(z.literal('')),\n details: z.string().max(5_000).optional()\n })\n .catchall(checkboxField)\n .refine((data) => Object.values(data).some((value) => value), {\n path: ['details']\n })\nexport type IssueReportFormData = z.infer\n","\n\n\n","\n\n\n\n\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'BlankIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"rect\", {\n width: \"1\",\n height: \"1\",\n fill: \"currentColor\",\n \"fill-opacity\": \"0\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'SearchIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M2.67602 11.0265C3.6661 11.688 4.83011 12.0411 6.02086 12.0411C6.81149 12.0411 7.59438 11.8854 8.32483 11.5828C8.87005 11.357 9.37808 11.0526 9.83317 10.6803L12.9769 13.8241C13.0323 13.8801 13.0983 13.9245 13.171 13.9548C13.2438 13.985 13.3219 14.0003 13.4007 14C13.4795 14.0003 13.5575 13.985 13.6303 13.9548C13.7031 13.9245 13.7691 13.8801 13.8244 13.8241C13.9367 13.7116 13.9998 13.5592 13.9998 13.4003C13.9998 13.2414 13.9367 13.089 13.8244 12.9765L10.6807 9.8328C11.053 9.37773 11.3573 8.86972 11.5831 8.32452C11.8857 7.59408 12.0414 6.81119 12.0414 6.02056C12.0414 4.8298 11.6883 3.66579 11.0268 2.67572C10.3652 1.68564 9.42494 0.913972 8.32483 0.45829C7.22472 0.00260857 6.01418 -0.116618 4.84631 0.115686C3.67844 0.34799 2.60568 0.921393 1.76369 1.76338C0.921698 2.60537 0.348296 3.67813 0.115991 4.84601C-0.116313 6.01388 0.00291375 7.22441 0.458595 8.32452C0.914277 9.42464 1.68595 10.3649 2.67602 11.0265ZM3.35565 2.0158C4.14456 1.48867 5.07206 1.20731 6.02086 1.20731C7.29317 1.20731 8.51338 1.71274 9.41304 2.6124C10.3127 3.51206 10.8181 4.73226 10.8181 6.00457C10.8181 6.95337 10.5368 7.88088 10.0096 8.66978C9.48251 9.45868 8.73328 10.0736 7.85669 10.4367C6.98011 10.7997 6.01554 10.8947 5.08496 10.7096C4.15439 10.5245 3.2996 10.0676 2.62869 9.39674C1.95778 8.72583 1.50089 7.87104 1.31579 6.94046C1.13068 6.00989 1.22568 5.04532 1.58878 4.16874C1.95187 3.29215 2.56675 2.54292 3.35565 2.0158Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-iconfield {\\n position: relative;\\n}\\n\\n.p-inputicon {\\n position: absolute;\\n top: 50%;\\n margin-top: calc(-1 * (\".concat(dt('icon.size'), \" / 2));\\n color: \").concat(dt('iconfield.icon.color'), \";\\n line-height: 1;\\n}\\n\\n.p-iconfield .p-inputicon:first-child {\\n inset-inline-start: \").concat(dt('form.field.padding.x'), \";\\n}\\n\\n.p-iconfield .p-inputicon:last-child {\\n inset-inline-end: \").concat(dt('form.field.padding.x'), \";\\n}\\n\\n.p-iconfield .p-inputtext:not(:first-child) {\\n padding-inline-start: calc((\").concat(dt('form.field.padding.x'), \" * 2) + \").concat(dt('icon.size'), \");\\n}\\n\\n.p-iconfield .p-inputtext:not(:last-child) {\\n padding-inline-end: calc((\").concat(dt('form.field.padding.x'), \" * 2) + \").concat(dt('icon.size'), \");\\n}\\n\\n.p-iconfield:has(.p-inputfield-sm) .p-inputicon {\\n font-size: \").concat(dt('form.field.sm.font.size'), \";\\n width: \").concat(dt('form.field.sm.font.size'), \";\\n height: \").concat(dt('form.field.sm.font.size'), \";\\n margin-top: calc(-1 * (\").concat(dt('form.field.sm.font.size'), \" / 2));\\n}\\n\\n.p-iconfield:has(.p-inputfield-lg) .p-inputicon {\\n font-size: \").concat(dt('form.field.lg.font.size'), \";\\n width: \").concat(dt('form.field.lg.font.size'), \";\\n height: \").concat(dt('form.field.lg.font.size'), \";\\n margin-top: calc(-1 * (\").concat(dt('form.field.lg.font.size'), \" / 2));\\n}\\n\");\n};\nvar classes = {\n root: 'p-iconfield'\n};\nvar IconFieldStyle = BaseStyle.extend({\n name: 'iconfield',\n theme: theme,\n classes: classes\n});\n\nexport { IconFieldStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseComponent from '@primevue/core/basecomponent';\nimport IconFieldStyle from 'primevue/iconfield/style';\nimport { openBlock, createElementBlock, mergeProps, renderSlot } from 'vue';\n\nvar script$1 = {\n name: 'BaseIconField',\n \"extends\": BaseComponent,\n style: IconFieldStyle,\n provide: function provide() {\n return {\n $pcIconField: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'IconField',\n \"extends\": script$1,\n inheritAttrs: false\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), [renderSlot(_ctx.$slots, \"default\")], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar classes = {\n root: 'p-inputicon'\n};\nvar InputIconStyle = BaseStyle.extend({\n name: 'inputicon',\n classes: classes\n});\n\nexport { InputIconStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseComponent from '@primevue/core/basecomponent';\nimport InputIconStyle from 'primevue/inputicon/style';\nimport { openBlock, createElementBlock, mergeProps, renderSlot } from 'vue';\n\nvar script$1 = {\n name: 'BaseInputIcon',\n \"extends\": BaseComponent,\n style: InputIconStyle,\n props: {\n \"class\": null\n },\n provide: function provide() {\n return {\n $pcInputIcon: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'InputIcon',\n \"extends\": script$1,\n inheritAttrs: false,\n computed: {\n containerClass: function containerClass() {\n return [this.cx('root'), this[\"class\"]];\n }\n }\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"span\", mergeProps({\n \"class\": $options.containerClass\n }, _ctx.ptmi('root')), [renderSlot(_ctx.$slots, \"default\")], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-virtualscroller-loader {\\n background: \".concat(dt('virtualscroller.loader.mask.background'), \";\\n color: \").concat(dt('virtualscroller.loader.mask.color'), \";\\n}\\n\\n.p-virtualscroller-loading-icon {\\n font-size: \").concat(dt('virtualscroller.loader.icon.size'), \";\\n width: \").concat(dt('virtualscroller.loader.icon.size'), \";\\n height: \").concat(dt('virtualscroller.loader.icon.size'), \";\\n}\\n\");\n};\nvar css = \"\\n.p-virtualscroller {\\n position: relative;\\n overflow: auto;\\n contain: strict;\\n transform: translateZ(0);\\n will-change: scroll-position;\\n outline: 0 none;\\n}\\n\\n.p-virtualscroller-content {\\n position: absolute;\\n top: 0;\\n left: 0;\\n min-height: 100%;\\n min-width: 100%;\\n will-change: transform;\\n}\\n\\n.p-virtualscroller-spacer {\\n position: absolute;\\n top: 0;\\n left: 0;\\n height: 1px;\\n width: 1px;\\n transform-origin: 0 0;\\n pointer-events: none;\\n}\\n\\n.p-virtualscroller-loader {\\n position: sticky;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n}\\n\\n.p-virtualscroller-loader-mask {\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\\n\\n.p-virtualscroller-horizontal > .p-virtualscroller-content {\\n display: flex;\\n}\\n\\n.p-virtualscroller-inline .p-virtualscroller-content {\\n position: static;\\n}\\n\";\nvar VirtualScrollerStyle = BaseStyle.extend({\n name: 'virtualscroller',\n css: css,\n theme: theme\n});\n\nexport { VirtualScrollerStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { isVisible, getWidth, getHeight, findSingle } from '@primeuix/utils/dom';\nimport SpinnerIcon from '@primevue/icons/spinner';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport VirtualScrollerStyle from 'primevue/virtualscroller/style';\nimport { resolveComponent, openBlock, createElementBlock, mergeProps, renderSlot, createElementVNode, Fragment, renderList, createCommentVNode, createVNode } from 'vue';\n\nvar script$1 = {\n name: 'BaseVirtualScroller',\n \"extends\": BaseComponent,\n props: {\n id: {\n type: String,\n \"default\": null\n },\n style: null,\n \"class\": null,\n items: {\n type: Array,\n \"default\": null\n },\n itemSize: {\n type: [Number, Array],\n \"default\": 0\n },\n scrollHeight: null,\n scrollWidth: null,\n orientation: {\n type: String,\n \"default\": 'vertical'\n },\n numToleratedItems: {\n type: Number,\n \"default\": null\n },\n delay: {\n type: Number,\n \"default\": 0\n },\n resizeDelay: {\n type: Number,\n \"default\": 10\n },\n lazy: {\n type: Boolean,\n \"default\": false\n },\n disabled: {\n type: Boolean,\n \"default\": false\n },\n loaderDisabled: {\n type: Boolean,\n \"default\": false\n },\n columns: {\n type: Array,\n \"default\": null\n },\n loading: {\n type: Boolean,\n \"default\": false\n },\n showSpacer: {\n type: Boolean,\n \"default\": true\n },\n showLoader: {\n type: Boolean,\n \"default\": false\n },\n tabindex: {\n type: Number,\n \"default\": 0\n },\n inline: {\n type: Boolean,\n \"default\": false\n },\n step: {\n type: Number,\n \"default\": 0\n },\n appendOnly: {\n type: Boolean,\n \"default\": false\n },\n autoSize: {\n type: Boolean,\n \"default\": false\n }\n },\n style: VirtualScrollerStyle,\n provide: function provide() {\n return {\n $pcVirtualScroller: this,\n $parentInstance: this\n };\n },\n beforeMount: function beforeMount() {\n var _this$$primevueConfig;\n VirtualScrollerStyle.loadCSS({\n nonce: (_this$$primevueConfig = this.$primevueConfig) === null || _this$$primevueConfig === void 0 || (_this$$primevueConfig = _this$$primevueConfig.csp) === null || _this$$primevueConfig === void 0 ? void 0 : _this$$primevueConfig.nonce\n });\n }\n};\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar script = {\n name: 'VirtualScroller',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['update:numToleratedItems', 'scroll', 'scroll-index-change', 'lazy-load'],\n data: function data() {\n var both = this.isBoth();\n return {\n first: both ? {\n rows: 0,\n cols: 0\n } : 0,\n last: both ? {\n rows: 0,\n cols: 0\n } : 0,\n page: both ? {\n rows: 0,\n cols: 0\n } : 0,\n numItemsInViewport: both ? {\n rows: 0,\n cols: 0\n } : 0,\n lastScrollPos: both ? {\n top: 0,\n left: 0\n } : 0,\n d_numToleratedItems: this.numToleratedItems,\n d_loading: this.loading,\n loaderArr: [],\n spacerStyle: {},\n contentStyle: {}\n };\n },\n element: null,\n content: null,\n lastScrollPos: null,\n scrollTimeout: null,\n resizeTimeout: null,\n defaultWidth: 0,\n defaultHeight: 0,\n defaultContentWidth: 0,\n defaultContentHeight: 0,\n isRangeChanged: false,\n lazyLoadState: {},\n resizeListener: null,\n initialized: false,\n watch: {\n numToleratedItems: function numToleratedItems(newValue) {\n this.d_numToleratedItems = newValue;\n },\n loading: function loading(newValue, oldValue) {\n if (this.lazy && newValue !== oldValue && newValue !== this.d_loading) {\n this.d_loading = newValue;\n }\n },\n items: function items(newValue, oldValue) {\n if (!oldValue || oldValue.length !== (newValue || []).length) {\n this.init();\n this.calculateAutoSize();\n }\n },\n itemSize: function itemSize() {\n this.init();\n this.calculateAutoSize();\n },\n orientation: function orientation() {\n this.lastScrollPos = this.isBoth() ? {\n top: 0,\n left: 0\n } : 0;\n },\n scrollHeight: function scrollHeight() {\n this.init();\n this.calculateAutoSize();\n },\n scrollWidth: function scrollWidth() {\n this.init();\n this.calculateAutoSize();\n }\n },\n mounted: function mounted() {\n this.viewInit();\n this.lastScrollPos = this.isBoth() ? {\n top: 0,\n left: 0\n } : 0;\n this.lazyLoadState = this.lazyLoadState || {};\n },\n updated: function updated() {\n !this.initialized && this.viewInit();\n },\n unmounted: function unmounted() {\n this.unbindResizeListener();\n this.initialized = false;\n },\n methods: {\n viewInit: function viewInit() {\n if (isVisible(this.element)) {\n this.setContentEl(this.content);\n this.init();\n this.calculateAutoSize();\n this.bindResizeListener();\n this.defaultWidth = getWidth(this.element);\n this.defaultHeight = getHeight(this.element);\n this.defaultContentWidth = getWidth(this.content);\n this.defaultContentHeight = getHeight(this.content);\n this.initialized = true;\n }\n },\n init: function init() {\n if (!this.disabled) {\n this.setSize();\n this.calculateOptions();\n this.setSpacerSize();\n }\n },\n isVertical: function isVertical() {\n return this.orientation === 'vertical';\n },\n isHorizontal: function isHorizontal() {\n return this.orientation === 'horizontal';\n },\n isBoth: function isBoth() {\n return this.orientation === 'both';\n },\n scrollTo: function scrollTo(options) {\n //this.lastScrollPos = this.both ? { top: 0, left: 0 } : 0;\n this.element && this.element.scrollTo(options);\n },\n scrollToIndex: function scrollToIndex(index) {\n var _this = this;\n var behavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'auto';\n var both = this.isBoth();\n var horizontal = this.isHorizontal();\n var valid = both ? index.every(function (i) {\n return i > -1;\n }) : index > -1;\n if (valid) {\n var first = this.first;\n var _this$element = this.element,\n _this$element$scrollT = _this$element.scrollTop,\n scrollTop = _this$element$scrollT === void 0 ? 0 : _this$element$scrollT,\n _this$element$scrollL = _this$element.scrollLeft,\n scrollLeft = _this$element$scrollL === void 0 ? 0 : _this$element$scrollL;\n var _this$calculateNumIte = this.calculateNumItems(),\n numToleratedItems = _this$calculateNumIte.numToleratedItems;\n var contentPos = this.getContentPosition();\n var itemSize = this.itemSize;\n var calculateFirst = function calculateFirst() {\n var _index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var _numT = arguments.length > 1 ? arguments[1] : undefined;\n return _index <= _numT ? 0 : _index;\n };\n var calculateCoord = function calculateCoord(_first, _size, _cpos) {\n return _first * _size + _cpos;\n };\n var scrollTo = function scrollTo() {\n var left = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var top = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return _this.scrollTo({\n left: left,\n top: top,\n behavior: behavior\n });\n };\n var newFirst = both ? {\n rows: 0,\n cols: 0\n } : 0;\n var isRangeChanged = false,\n isScrollChanged = false;\n if (both) {\n newFirst = {\n rows: calculateFirst(index[0], numToleratedItems[0]),\n cols: calculateFirst(index[1], numToleratedItems[1])\n };\n scrollTo(calculateCoord(newFirst.cols, itemSize[1], contentPos.left), calculateCoord(newFirst.rows, itemSize[0], contentPos.top));\n isScrollChanged = this.lastScrollPos.top !== scrollTop || this.lastScrollPos.left !== scrollLeft;\n isRangeChanged = newFirst.rows !== first.rows || newFirst.cols !== first.cols;\n } else {\n newFirst = calculateFirst(index, numToleratedItems);\n horizontal ? scrollTo(calculateCoord(newFirst, itemSize, contentPos.left), scrollTop) : scrollTo(scrollLeft, calculateCoord(newFirst, itemSize, contentPos.top));\n isScrollChanged = this.lastScrollPos !== (horizontal ? scrollLeft : scrollTop);\n isRangeChanged = newFirst !== first;\n }\n this.isRangeChanged = isRangeChanged;\n isScrollChanged && (this.first = newFirst);\n }\n },\n scrollInView: function scrollInView(index, to) {\n var _this2 = this;\n var behavior = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'auto';\n if (to) {\n var both = this.isBoth();\n var horizontal = this.isHorizontal();\n var valid = both ? index.every(function (i) {\n return i > -1;\n }) : index > -1;\n if (valid) {\n var _this$getRenderedRang = this.getRenderedRange(),\n first = _this$getRenderedRang.first,\n viewport = _this$getRenderedRang.viewport;\n var scrollTo = function scrollTo() {\n var left = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var top = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return _this2.scrollTo({\n left: left,\n top: top,\n behavior: behavior\n });\n };\n var isToStart = to === 'to-start';\n var isToEnd = to === 'to-end';\n if (isToStart) {\n if (both) {\n if (viewport.first.rows - first.rows > index[0]) {\n scrollTo(viewport.first.cols * this.itemSize[1], (viewport.first.rows - 1) * this.itemSize[0]);\n } else if (viewport.first.cols - first.cols > index[1]) {\n scrollTo((viewport.first.cols - 1) * this.itemSize[1], viewport.first.rows * this.itemSize[0]);\n }\n } else {\n if (viewport.first - first > index) {\n var pos = (viewport.first - 1) * this.itemSize;\n horizontal ? scrollTo(pos, 0) : scrollTo(0, pos);\n }\n }\n } else if (isToEnd) {\n if (both) {\n if (viewport.last.rows - first.rows <= index[0] + 1) {\n scrollTo(viewport.first.cols * this.itemSize[1], (viewport.first.rows + 1) * this.itemSize[0]);\n } else if (viewport.last.cols - first.cols <= index[1] + 1) {\n scrollTo((viewport.first.cols + 1) * this.itemSize[1], viewport.first.rows * this.itemSize[0]);\n }\n } else {\n if (viewport.last - first <= index + 1) {\n var _pos2 = (viewport.first + 1) * this.itemSize;\n horizontal ? scrollTo(_pos2, 0) : scrollTo(0, _pos2);\n }\n }\n }\n }\n } else {\n this.scrollToIndex(index, behavior);\n }\n },\n getRenderedRange: function getRenderedRange() {\n var calculateFirstInViewport = function calculateFirstInViewport(_pos, _size) {\n return Math.floor(_pos / (_size || _pos));\n };\n var firstInViewport = this.first;\n var lastInViewport = 0;\n if (this.element) {\n var both = this.isBoth();\n var horizontal = this.isHorizontal();\n var _this$element2 = this.element,\n scrollTop = _this$element2.scrollTop,\n scrollLeft = _this$element2.scrollLeft;\n if (both) {\n firstInViewport = {\n rows: calculateFirstInViewport(scrollTop, this.itemSize[0]),\n cols: calculateFirstInViewport(scrollLeft, this.itemSize[1])\n };\n lastInViewport = {\n rows: firstInViewport.rows + this.numItemsInViewport.rows,\n cols: firstInViewport.cols + this.numItemsInViewport.cols\n };\n } else {\n var scrollPos = horizontal ? scrollLeft : scrollTop;\n firstInViewport = calculateFirstInViewport(scrollPos, this.itemSize);\n lastInViewport = firstInViewport + this.numItemsInViewport;\n }\n }\n return {\n first: this.first,\n last: this.last,\n viewport: {\n first: firstInViewport,\n last: lastInViewport\n }\n };\n },\n calculateNumItems: function calculateNumItems() {\n var both = this.isBoth();\n var horizontal = this.isHorizontal();\n var itemSize = this.itemSize;\n var contentPos = this.getContentPosition();\n var contentWidth = this.element ? this.element.offsetWidth - contentPos.left : 0;\n var contentHeight = this.element ? this.element.offsetHeight - contentPos.top : 0;\n var calculateNumItemsInViewport = function calculateNumItemsInViewport(_contentSize, _itemSize) {\n return Math.ceil(_contentSize / (_itemSize || _contentSize));\n };\n var calculateNumToleratedItems = function calculateNumToleratedItems(_numItems) {\n return Math.ceil(_numItems / 2);\n };\n var numItemsInViewport = both ? {\n rows: calculateNumItemsInViewport(contentHeight, itemSize[0]),\n cols: calculateNumItemsInViewport(contentWidth, itemSize[1])\n } : calculateNumItemsInViewport(horizontal ? contentWidth : contentHeight, itemSize);\n var numToleratedItems = this.d_numToleratedItems || (both ? [calculateNumToleratedItems(numItemsInViewport.rows), calculateNumToleratedItems(numItemsInViewport.cols)] : calculateNumToleratedItems(numItemsInViewport));\n return {\n numItemsInViewport: numItemsInViewport,\n numToleratedItems: numToleratedItems\n };\n },\n calculateOptions: function calculateOptions() {\n var _this3 = this;\n var both = this.isBoth();\n var first = this.first;\n var _this$calculateNumIte2 = this.calculateNumItems(),\n numItemsInViewport = _this$calculateNumIte2.numItemsInViewport,\n numToleratedItems = _this$calculateNumIte2.numToleratedItems;\n var calculateLast = function calculateLast(_first, _num, _numT) {\n var _isCols = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return _this3.getLast(_first + _num + (_first < _numT ? 2 : 3) * _numT, _isCols);\n };\n var last = both ? {\n rows: calculateLast(first.rows, numItemsInViewport.rows, numToleratedItems[0]),\n cols: calculateLast(first.cols, numItemsInViewport.cols, numToleratedItems[1], true)\n } : calculateLast(first, numItemsInViewport, numToleratedItems);\n this.last = last;\n this.numItemsInViewport = numItemsInViewport;\n this.d_numToleratedItems = numToleratedItems;\n this.$emit('update:numToleratedItems', this.d_numToleratedItems);\n if (this.showLoader) {\n this.loaderArr = both ? Array.from({\n length: numItemsInViewport.rows\n }).map(function () {\n return Array.from({\n length: numItemsInViewport.cols\n });\n }) : Array.from({\n length: numItemsInViewport\n });\n }\n if (this.lazy) {\n Promise.resolve().then(function () {\n var _this3$items;\n _this3.lazyLoadState = {\n first: _this3.step ? both ? {\n rows: 0,\n cols: first.cols\n } : 0 : first,\n last: Math.min(_this3.step ? _this3.step : last, ((_this3$items = _this3.items) === null || _this3$items === void 0 ? void 0 : _this3$items.length) || 0)\n };\n _this3.$emit('lazy-load', _this3.lazyLoadState);\n });\n }\n },\n calculateAutoSize: function calculateAutoSize() {\n var _this4 = this;\n if (this.autoSize && !this.d_loading) {\n Promise.resolve().then(function () {\n if (_this4.content) {\n var both = _this4.isBoth();\n var horizontal = _this4.isHorizontal();\n var vertical = _this4.isVertical();\n _this4.content.style.minHeight = _this4.content.style.minWidth = 'auto';\n _this4.content.style.position = 'relative';\n _this4.element.style.contain = 'none';\n\n /*const [contentWidth, contentHeight] = [getWidth(this.content), getHeight(this.content)];\n contentWidth !== this.defaultContentWidth && (this.element.style.width = '');\n contentHeight !== this.defaultContentHeight && (this.element.style.height = '');*/\n\n var _ref = [getWidth(_this4.element), getHeight(_this4.element)],\n width = _ref[0],\n height = _ref[1];\n (both || horizontal) && (_this4.element.style.width = width < _this4.defaultWidth ? width + 'px' : _this4.scrollWidth || _this4.defaultWidth + 'px');\n (both || vertical) && (_this4.element.style.height = height < _this4.defaultHeight ? height + 'px' : _this4.scrollHeight || _this4.defaultHeight + 'px');\n _this4.content.style.minHeight = _this4.content.style.minWidth = '';\n _this4.content.style.position = '';\n _this4.element.style.contain = '';\n }\n });\n }\n },\n getLast: function getLast() {\n var _ref2, _this$items;\n var last = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var isCols = arguments.length > 1 ? arguments[1] : undefined;\n return this.items ? Math.min(isCols ? ((_ref2 = this.columns || this.items[0]) === null || _ref2 === void 0 ? void 0 : _ref2.length) || 0 : ((_this$items = this.items) === null || _this$items === void 0 ? void 0 : _this$items.length) || 0, last) : 0;\n },\n getContentPosition: function getContentPosition() {\n if (this.content) {\n var style = getComputedStyle(this.content);\n var left = parseFloat(style.paddingLeft) + Math.max(parseFloat(style.left) || 0, 0);\n var right = parseFloat(style.paddingRight) + Math.max(parseFloat(style.right) || 0, 0);\n var top = parseFloat(style.paddingTop) + Math.max(parseFloat(style.top) || 0, 0);\n var bottom = parseFloat(style.paddingBottom) + Math.max(parseFloat(style.bottom) || 0, 0);\n return {\n left: left,\n right: right,\n top: top,\n bottom: bottom,\n x: left + right,\n y: top + bottom\n };\n }\n return {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n x: 0,\n y: 0\n };\n },\n setSize: function setSize() {\n var _this5 = this;\n if (this.element) {\n var both = this.isBoth();\n var horizontal = this.isHorizontal();\n var parentElement = this.element.parentElement;\n var width = this.scrollWidth || \"\".concat(this.element.offsetWidth || parentElement.offsetWidth, \"px\");\n var height = this.scrollHeight || \"\".concat(this.element.offsetHeight || parentElement.offsetHeight, \"px\");\n var setProp = function setProp(_name, _value) {\n return _this5.element.style[_name] = _value;\n };\n if (both || horizontal) {\n setProp('height', height);\n setProp('width', width);\n } else {\n setProp('height', height);\n }\n }\n },\n setSpacerSize: function setSpacerSize() {\n var _this6 = this;\n var items = this.items;\n if (items) {\n var both = this.isBoth();\n var horizontal = this.isHorizontal();\n var contentPos = this.getContentPosition();\n var setProp = function setProp(_name, _value, _size) {\n var _cpos = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n return _this6.spacerStyle = _objectSpread(_objectSpread({}, _this6.spacerStyle), _defineProperty({}, \"\".concat(_name), (_value || []).length * _size + _cpos + 'px'));\n };\n if (both) {\n setProp('height', items, this.itemSize[0], contentPos.y);\n setProp('width', this.columns || items[1], this.itemSize[1], contentPos.x);\n } else {\n horizontal ? setProp('width', this.columns || items, this.itemSize, contentPos.x) : setProp('height', items, this.itemSize, contentPos.y);\n }\n }\n },\n setContentPosition: function setContentPosition(pos) {\n var _this7 = this;\n if (this.content && !this.appendOnly) {\n var both = this.isBoth();\n var horizontal = this.isHorizontal();\n var first = pos ? pos.first : this.first;\n var calculateTranslateVal = function calculateTranslateVal(_first, _size) {\n return _first * _size;\n };\n var setTransform = function setTransform() {\n var _x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var _y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return _this7.contentStyle = _objectSpread(_objectSpread({}, _this7.contentStyle), {\n transform: \"translate3d(\".concat(_x, \"px, \").concat(_y, \"px, 0)\")\n });\n };\n if (both) {\n setTransform(calculateTranslateVal(first.cols, this.itemSize[1]), calculateTranslateVal(first.rows, this.itemSize[0]));\n } else {\n var translateVal = calculateTranslateVal(first, this.itemSize);\n horizontal ? setTransform(translateVal, 0) : setTransform(0, translateVal);\n }\n }\n },\n onScrollPositionChange: function onScrollPositionChange(event) {\n var _this8 = this;\n var target = event.target;\n var both = this.isBoth();\n var horizontal = this.isHorizontal();\n var contentPos = this.getContentPosition();\n var calculateScrollPos = function calculateScrollPos(_pos, _cpos) {\n return _pos ? _pos > _cpos ? _pos - _cpos : _pos : 0;\n };\n var calculateCurrentIndex = function calculateCurrentIndex(_pos, _size) {\n return Math.floor(_pos / (_size || _pos));\n };\n var calculateTriggerIndex = function calculateTriggerIndex(_currentIndex, _first, _last, _num, _numT, _isScrollDownOrRight) {\n return _currentIndex <= _numT ? _numT : _isScrollDownOrRight ? _last - _num - _numT : _first + _numT - 1;\n };\n var calculateFirst = function calculateFirst(_currentIndex, _triggerIndex, _first, _last, _num, _numT, _isScrollDownOrRight) {\n if (_currentIndex <= _numT) return 0;else return Math.max(0, _isScrollDownOrRight ? _currentIndex < _triggerIndex ? _first : _currentIndex - _numT : _currentIndex > _triggerIndex ? _first : _currentIndex - 2 * _numT);\n };\n var calculateLast = function calculateLast(_currentIndex, _first, _last, _num, _numT, _isCols) {\n var lastValue = _first + _num + 2 * _numT;\n if (_currentIndex >= _numT) {\n lastValue += _numT + 1;\n }\n return _this8.getLast(lastValue, _isCols);\n };\n var scrollTop = calculateScrollPos(target.scrollTop, contentPos.top);\n var scrollLeft = calculateScrollPos(target.scrollLeft, contentPos.left);\n var newFirst = both ? {\n rows: 0,\n cols: 0\n } : 0;\n var newLast = this.last;\n var isRangeChanged = false;\n var newScrollPos = this.lastScrollPos;\n if (both) {\n var isScrollDown = this.lastScrollPos.top <= scrollTop;\n var isScrollRight = this.lastScrollPos.left <= scrollLeft;\n if (!this.appendOnly || this.appendOnly && (isScrollDown || isScrollRight)) {\n var currentIndex = {\n rows: calculateCurrentIndex(scrollTop, this.itemSize[0]),\n cols: calculateCurrentIndex(scrollLeft, this.itemSize[1])\n };\n var triggerIndex = {\n rows: calculateTriggerIndex(currentIndex.rows, this.first.rows, this.last.rows, this.numItemsInViewport.rows, this.d_numToleratedItems[0], isScrollDown),\n cols: calculateTriggerIndex(currentIndex.cols, this.first.cols, this.last.cols, this.numItemsInViewport.cols, this.d_numToleratedItems[1], isScrollRight)\n };\n newFirst = {\n rows: calculateFirst(currentIndex.rows, triggerIndex.rows, this.first.rows, this.last.rows, this.numItemsInViewport.rows, this.d_numToleratedItems[0], isScrollDown),\n cols: calculateFirst(currentIndex.cols, triggerIndex.cols, this.first.cols, this.last.cols, this.numItemsInViewport.cols, this.d_numToleratedItems[1], isScrollRight)\n };\n newLast = {\n rows: calculateLast(currentIndex.rows, newFirst.rows, this.last.rows, this.numItemsInViewport.rows, this.d_numToleratedItems[0]),\n cols: calculateLast(currentIndex.cols, newFirst.cols, this.last.cols, this.numItemsInViewport.cols, this.d_numToleratedItems[1], true)\n };\n isRangeChanged = newFirst.rows !== this.first.rows || newLast.rows !== this.last.rows || newFirst.cols !== this.first.cols || newLast.cols !== this.last.cols || this.isRangeChanged;\n newScrollPos = {\n top: scrollTop,\n left: scrollLeft\n };\n }\n } else {\n var scrollPos = horizontal ? scrollLeft : scrollTop;\n var isScrollDownOrRight = this.lastScrollPos <= scrollPos;\n if (!this.appendOnly || this.appendOnly && isScrollDownOrRight) {\n var _currentIndex2 = calculateCurrentIndex(scrollPos, this.itemSize);\n var _triggerIndex2 = calculateTriggerIndex(_currentIndex2, this.first, this.last, this.numItemsInViewport, this.d_numToleratedItems, isScrollDownOrRight);\n newFirst = calculateFirst(_currentIndex2, _triggerIndex2, this.first, this.last, this.numItemsInViewport, this.d_numToleratedItems, isScrollDownOrRight);\n newLast = calculateLast(_currentIndex2, newFirst, this.last, this.numItemsInViewport, this.d_numToleratedItems);\n isRangeChanged = newFirst !== this.first || newLast !== this.last || this.isRangeChanged;\n newScrollPos = scrollPos;\n }\n }\n return {\n first: newFirst,\n last: newLast,\n isRangeChanged: isRangeChanged,\n scrollPos: newScrollPos\n };\n },\n onScrollChange: function onScrollChange(event) {\n var _this$onScrollPositio = this.onScrollPositionChange(event),\n first = _this$onScrollPositio.first,\n last = _this$onScrollPositio.last,\n isRangeChanged = _this$onScrollPositio.isRangeChanged,\n scrollPos = _this$onScrollPositio.scrollPos;\n if (isRangeChanged) {\n var newState = {\n first: first,\n last: last\n };\n this.setContentPosition(newState);\n this.first = first;\n this.last = last;\n this.lastScrollPos = scrollPos;\n this.$emit('scroll-index-change', newState);\n if (this.lazy && this.isPageChanged(first)) {\n var _this$items2, _this$items3;\n var lazyLoadState = {\n first: this.step ? Math.min(this.getPageByFirst(first) * this.step, (((_this$items2 = this.items) === null || _this$items2 === void 0 ? void 0 : _this$items2.length) || 0) - this.step) : first,\n last: Math.min(this.step ? (this.getPageByFirst(first) + 1) * this.step : last, ((_this$items3 = this.items) === null || _this$items3 === void 0 ? void 0 : _this$items3.length) || 0)\n };\n var isLazyStateChanged = this.lazyLoadState.first !== lazyLoadState.first || this.lazyLoadState.last !== lazyLoadState.last;\n isLazyStateChanged && this.$emit('lazy-load', lazyLoadState);\n this.lazyLoadState = lazyLoadState;\n }\n }\n },\n onScroll: function onScroll(event) {\n var _this9 = this;\n this.$emit('scroll', event);\n if (this.delay) {\n if (this.scrollTimeout) {\n clearTimeout(this.scrollTimeout);\n }\n if (this.isPageChanged()) {\n if (!this.d_loading && this.showLoader) {\n var _this$onScrollPositio2 = this.onScrollPositionChange(event),\n isRangeChanged = _this$onScrollPositio2.isRangeChanged;\n var changed = isRangeChanged || (this.step ? this.isPageChanged() : false);\n changed && (this.d_loading = true);\n }\n this.scrollTimeout = setTimeout(function () {\n _this9.onScrollChange(event);\n if (_this9.d_loading && _this9.showLoader && (!_this9.lazy || _this9.loading === undefined)) {\n _this9.d_loading = false;\n _this9.page = _this9.getPageByFirst();\n }\n }, this.delay);\n }\n } else {\n this.onScrollChange(event);\n }\n },\n onResize: function onResize() {\n var _this10 = this;\n if (this.resizeTimeout) {\n clearTimeout(this.resizeTimeout);\n }\n this.resizeTimeout = setTimeout(function () {\n if (isVisible(_this10.element)) {\n var both = _this10.isBoth();\n var vertical = _this10.isVertical();\n var horizontal = _this10.isHorizontal();\n var _ref3 = [getWidth(_this10.element), getHeight(_this10.element)],\n width = _ref3[0],\n height = _ref3[1];\n var isDiffWidth = width !== _this10.defaultWidth,\n isDiffHeight = height !== _this10.defaultHeight;\n var reinit = both ? isDiffWidth || isDiffHeight : horizontal ? isDiffWidth : vertical ? isDiffHeight : false;\n if (reinit) {\n _this10.d_numToleratedItems = _this10.numToleratedItems;\n _this10.defaultWidth = width;\n _this10.defaultHeight = height;\n _this10.defaultContentWidth = getWidth(_this10.content);\n _this10.defaultContentHeight = getHeight(_this10.content);\n _this10.init();\n }\n }\n }, this.resizeDelay);\n },\n bindResizeListener: function bindResizeListener() {\n if (!this.resizeListener) {\n this.resizeListener = this.onResize.bind(this);\n window.addEventListener('resize', this.resizeListener);\n window.addEventListener('orientationchange', this.resizeListener);\n }\n },\n unbindResizeListener: function unbindResizeListener() {\n if (this.resizeListener) {\n window.removeEventListener('resize', this.resizeListener);\n window.removeEventListener('orientationchange', this.resizeListener);\n this.resizeListener = null;\n }\n },\n getOptions: function getOptions(renderedIndex) {\n var count = (this.items || []).length;\n var index = this.isBoth() ? this.first.rows + renderedIndex : this.first + renderedIndex;\n return {\n index: index,\n count: count,\n first: index === 0,\n last: index === count - 1,\n even: index % 2 === 0,\n odd: index % 2 !== 0\n };\n },\n getLoaderOptions: function getLoaderOptions(index, extOptions) {\n var count = this.loaderArr.length;\n return _objectSpread({\n index: index,\n count: count,\n first: index === 0,\n last: index === count - 1,\n even: index % 2 === 0,\n odd: index % 2 !== 0\n }, extOptions);\n },\n getPageByFirst: function getPageByFirst(first) {\n return Math.floor(((first !== null && first !== void 0 ? first : this.first) + this.d_numToleratedItems * 4) / (this.step || 1));\n },\n isPageChanged: function isPageChanged(first) {\n return this.step && !this.lazy ? this.page !== this.getPageByFirst(first !== null && first !== void 0 ? first : this.first) : true;\n },\n setContentEl: function setContentEl(el) {\n this.content = el || this.content || findSingle(this.element, '[data-pc-section=\"content\"]');\n },\n elementRef: function elementRef(el) {\n this.element = el;\n },\n contentRef: function contentRef(el) {\n this.content = el;\n }\n },\n computed: {\n containerClass: function containerClass() {\n return ['p-virtualscroller', this[\"class\"], {\n 'p-virtualscroller-inline': this.inline,\n 'p-virtualscroller-both p-both-scroll': this.isBoth(),\n 'p-virtualscroller-horizontal p-horizontal-scroll': this.isHorizontal()\n }];\n },\n contentClass: function contentClass() {\n return ['p-virtualscroller-content', {\n 'p-virtualscroller-loading': this.d_loading\n }];\n },\n loaderClass: function loaderClass() {\n return ['p-virtualscroller-loader', {\n 'p-virtualscroller-loader-mask': !this.$slots.loader\n }];\n },\n loadedItems: function loadedItems() {\n var _this11 = this;\n if (this.items && !this.d_loading) {\n if (this.isBoth()) return this.items.slice(this.appendOnly ? 0 : this.first.rows, this.last.rows).map(function (item) {\n return _this11.columns ? item : item.slice(_this11.appendOnly ? 0 : _this11.first.cols, _this11.last.cols);\n });else if (this.isHorizontal() && this.columns) return this.items;else return this.items.slice(this.appendOnly ? 0 : this.first, this.last);\n }\n return [];\n },\n loadedRows: function loadedRows() {\n return this.d_loading ? this.loaderDisabled ? this.loaderArr : [] : this.loadedItems;\n },\n loadedColumns: function loadedColumns() {\n if (this.columns) {\n var both = this.isBoth();\n var horizontal = this.isHorizontal();\n if (both || horizontal) {\n return this.d_loading && this.loaderDisabled ? both ? this.loaderArr[0] : this.loaderArr : this.columns.slice(both ? this.first.cols : this.first, both ? this.last.cols : this.last);\n }\n }\n return this.columns;\n }\n },\n components: {\n SpinnerIcon: SpinnerIcon\n }\n};\n\nvar _hoisted_1 = [\"tabindex\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_SpinnerIcon = resolveComponent(\"SpinnerIcon\");\n return !_ctx.disabled ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n ref: $options.elementRef,\n \"class\": $options.containerClass,\n tabindex: _ctx.tabindex,\n style: _ctx.style,\n onScroll: _cache[0] || (_cache[0] = function () {\n return $options.onScroll && $options.onScroll.apply($options, arguments);\n })\n }, _ctx.ptmi('root')), [renderSlot(_ctx.$slots, \"content\", {\n styleClass: $options.contentClass,\n items: $options.loadedItems,\n getItemOptions: $options.getOptions,\n loading: $data.d_loading,\n getLoaderOptions: $options.getLoaderOptions,\n itemSize: _ctx.itemSize,\n rows: $options.loadedRows,\n columns: $options.loadedColumns,\n contentRef: $options.contentRef,\n spacerStyle: $data.spacerStyle,\n contentStyle: $data.contentStyle,\n vertical: $options.isVertical(),\n horizontal: $options.isHorizontal(),\n both: $options.isBoth()\n }, function () {\n return [createElementVNode(\"div\", mergeProps({\n ref: $options.contentRef,\n \"class\": $options.contentClass,\n style: $data.contentStyle\n }, _ctx.ptm('content')), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.loadedItems, function (item, index) {\n return renderSlot(_ctx.$slots, \"item\", {\n key: index,\n item: item,\n options: $options.getOptions(index)\n });\n }), 128))], 16)];\n }), _ctx.showSpacer ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": \"p-virtualscroller-spacer\",\n style: $data.spacerStyle\n }, _ctx.ptm('spacer')), null, 16)) : createCommentVNode(\"\", true), !_ctx.loaderDisabled && _ctx.showLoader && $data.d_loading ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 1,\n \"class\": $options.loaderClass\n }, _ctx.ptm('loader')), [_ctx.$slots && _ctx.$slots.loader ? (openBlock(true), createElementBlock(Fragment, {\n key: 0\n }, renderList($data.loaderArr, function (_, index) {\n return renderSlot(_ctx.$slots, \"loader\", {\n key: index,\n options: $options.getLoaderOptions(index, $options.isBoth() && {\n numCols: _ctx.d_numItemsInViewport.cols\n })\n });\n }), 128)) : createCommentVNode(\"\", true), renderSlot(_ctx.$slots, \"loadingicon\", {}, function () {\n return [createVNode(_component_SpinnerIcon, mergeProps({\n spin: \"\",\n \"class\": \"p-virtualscroller-loading-icon\"\n }, _ctx.ptm('loadingIcon')), null, 16)];\n })], 16)) : createCommentVNode(\"\", true)], 16, _hoisted_1)) : (openBlock(), createElementBlock(Fragment, {\n key: 1\n }, [renderSlot(_ctx.$slots, \"default\"), renderSlot(_ctx.$slots, \"content\", {\n items: _ctx.items,\n rows: _ctx.items,\n columns: $options.loadedColumns\n })], 64));\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-listbox {\\n background: \".concat(dt('listbox.background'), \";\\n color: \").concat(dt('listbox.color'), \";\\n border: 1px solid \").concat(dt('listbox.border.color'), \";\\n border-radius: \").concat(dt('listbox.border.radius'), \";\\n transition: background \").concat(dt('listbox.transition.duration'), \", color \").concat(dt('listbox.transition.duration'), \", border-color \").concat(dt('listbox.transition.duration'), \",\\n box-shadow \").concat(dt('listbox.transition.duration'), \", outline-color \").concat(dt('listbox.transition.duration'), \";\\n outline-color: transparent;\\n box-shadow: \").concat(dt('listbox.shadow'), \";\\n}\\n\\n.p-listbox.p-disabled {\\n opacity: 1;\\n background: \").concat(dt('listbox.disabled.background'), \";\\n color: \").concat(dt('listbox.disabled.color'), \";\\n}\\n\\n.p-listbox.p-disabled .p-listbox-option {\\n color: \").concat(dt('listbox.disabled.color'), \";\\n}\\n\\n.p-listbox.p-invalid {\\n border-color: \").concat(dt('listbox.invalid.border.color'), \";\\n}\\n\\n.p-listbox-header {\\n padding: \").concat(dt('listbox.list.header.padding'), \";\\n}\\n\\n.p-listbox-filter {\\n width: 100%;\\n}\\n\\n.p-listbox-list-container {\\n overflow: auto;\\n}\\n\\n.p-listbox-list {\\n list-style-type: none;\\n margin: 0;\\n padding: \").concat(dt('listbox.list.padding'), \";\\n outline: 0 none;\\n display: flex;\\n flex-direction: column;\\n gap: \").concat(dt('listbox.list.gap'), \";\\n}\\n\\n.p-listbox-option {\\n display: flex;\\n align-items: center;\\n cursor: pointer;\\n position: relative;\\n overflow: hidden;\\n padding: \").concat(dt('listbox.option.padding'), \";\\n border: 0 none;\\n border-radius: \").concat(dt('listbox.option.border.radius'), \";\\n color: \").concat(dt('listbox.option.color'), \";\\n transition: background \").concat(dt('listbox.transition.duration'), \", color \").concat(dt('listbox.transition.duration'), \", border-color \").concat(dt('listbox.transition.duration'), \",\\n box-shadow \").concat(dt('listbox.transition.duration'), \", outline-color \").concat(dt('listbox.transition.duration'), \";\\n}\\n\\n.p-listbox-striped li:nth-child(even of .p-listbox-option) {\\n background: \").concat(dt('listbox.option.striped.background'), \";\\n}\\n\\n.p-listbox .p-listbox-list .p-listbox-option.p-listbox-option-selected {\\n background: \").concat(dt('listbox.option.selected.background'), \";\\n color: \").concat(dt('listbox.option.selected.color'), \";\\n}\\n\\n.p-listbox:not(.p-disabled) .p-listbox-option.p-listbox-option-selected.p-focus {\\n background: \").concat(dt('listbox.option.selected.focus.background'), \";\\n color: \").concat(dt('listbox.option.selected.focus.color'), \";\\n}\\n\\n.p-listbox:not(.p-disabled) .p-listbox-option:not(.p-listbox-option-selected):not(.p-disabled).p-focus {\\n background: \").concat(dt('listbox.option.focus.background'), \";\\n color: \").concat(dt('listbox.option.focus.color'), \";\\n}\\n\\n.p-listbox:not(.p-disabled) .p-listbox-option:not(.p-listbox-option-selected):not(.p-disabled):hover {\\n background: \").concat(dt('listbox.option.focus.background'), \";\\n color: \").concat(dt('listbox.option.focus.color'), \";\\n}\\n\\n.p-listbox-option-check-icon {\\n position: relative;\\n margin-inline-start: \").concat(dt('listbox.checkmark.gutter.start'), \";\\n margin-inline-end: \").concat(dt('listbox.checkmark.gutter.end'), \";\\n color: \").concat(dt('listbox.checkmark.color'), \";\\n}\\n\\n.p-listbox-option-group {\\n margin: 0;\\n padding: \").concat(dt('listbox.option.group.padding'), \";\\n color: \").concat(dt('listbox.option.group.color'), \";\\n background: \").concat(dt('listbox.option.group.background'), \";\\n font-weight: \").concat(dt('listbox.option.group.font.weight'), \";\\n}\\n\\n.p-listbox-empty-message {\\n padding: \").concat(dt('listbox.empty.message.padding'), \";\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var instance = _ref2.instance,\n props = _ref2.props;\n return ['p-listbox p-component', {\n 'p-listbox-striped': props.striped,\n 'p-disabled': props.disabled,\n 'p-invalid': instance.$invalid\n }];\n },\n header: 'p-listbox-header',\n pcFilter: 'p-listbox-filter',\n listContainer: 'p-listbox-list-container',\n list: 'p-listbox-list',\n optionGroup: 'p-listbox-option-group',\n option: function option(_ref3) {\n var instance = _ref3.instance,\n props = _ref3.props,\n _option = _ref3.option,\n index = _ref3.index,\n getItemOptions = _ref3.getItemOptions;\n return ['p-listbox-option', {\n 'p-listbox-option-selected': instance.isSelected(_option) && props.highlightOnSelect,\n 'p-focus': instance.focusedOptionIndex === instance.getOptionIndex(index, getItemOptions),\n 'p-disabled': instance.isOptionDisabled(_option)\n }];\n },\n optionCheckIcon: 'p-listbox-option-check-icon',\n optionBlankIcon: 'p-listbox-option-blank-icon',\n emptyMessage: 'p-listbox-empty-message'\n};\nvar ListboxStyle = BaseStyle.extend({\n name: 'listbox',\n theme: theme,\n classes: classes\n});\n\nexport { ListboxStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { focus, getFirstFocusableElement, isElement, findSingle } from '@primeuix/utils/dom';\nimport { resolveFieldData, isPrintableCharacter, isNotEmpty, equals, findLastIndex } from '@primeuix/utils/object';\nimport { FilterService } from '@primevue/core/api';\nimport { UniqueComponentId } from '@primevue/core/utils';\nimport BlankIcon from '@primevue/icons/blank';\nimport CheckIcon from '@primevue/icons/check';\nimport SearchIcon from '@primevue/icons/search';\nimport IconField from 'primevue/iconfield';\nimport InputIcon from 'primevue/inputicon';\nimport InputText from 'primevue/inputtext';\nimport Ripple from 'primevue/ripple';\nimport VirtualScroller from 'primevue/virtualscroller';\nimport BaseEditableHolder from '@primevue/core/baseeditableholder';\nimport ListboxStyle from 'primevue/listbox/style';\nimport { resolveComponent, resolveDirective, openBlock, createElementBlock, mergeProps, createElementVNode, normalizeClass, renderSlot, createCommentVNode, createVNode, withCtx, createBlock, normalizeProps, toDisplayString, createSlots, Fragment, renderList, createTextVNode, withDirectives } from 'vue';\n\nvar script$1 = {\n name: 'BaseListbox',\n \"extends\": BaseEditableHolder,\n props: {\n options: Array,\n optionLabel: null,\n optionValue: null,\n optionDisabled: null,\n optionGroupLabel: null,\n optionGroupChildren: null,\n listStyle: null,\n scrollHeight: {\n type: String,\n \"default\": '14rem'\n },\n dataKey: null,\n multiple: {\n type: Boolean,\n \"default\": false\n },\n metaKeySelection: {\n type: Boolean,\n \"default\": false\n },\n filter: Boolean,\n filterPlaceholder: String,\n filterLocale: String,\n filterMatchMode: {\n type: String,\n \"default\": 'contains'\n },\n filterFields: {\n type: Array,\n \"default\": null\n },\n virtualScrollerOptions: {\n type: Object,\n \"default\": null\n },\n autoOptionFocus: {\n type: Boolean,\n \"default\": true\n },\n selectOnFocus: {\n type: Boolean,\n \"default\": false\n },\n focusOnHover: {\n type: Boolean,\n \"default\": true\n },\n highlightOnSelect: {\n type: Boolean,\n \"default\": true\n },\n checkmark: {\n type: Boolean,\n \"default\": false\n },\n filterMessage: {\n type: String,\n \"default\": null\n },\n selectionMessage: {\n type: String,\n \"default\": null\n },\n emptySelectionMessage: {\n type: String,\n \"default\": null\n },\n emptyFilterMessage: {\n type: String,\n \"default\": null\n },\n emptyMessage: {\n type: String,\n \"default\": null\n },\n filterIcon: {\n type: String,\n \"default\": undefined\n },\n striped: {\n type: Boolean,\n \"default\": false\n },\n tabindex: {\n type: Number,\n \"default\": 0\n },\n ariaLabel: {\n type: String,\n \"default\": null\n },\n ariaLabelledby: {\n type: String,\n \"default\": null\n }\n },\n style: ListboxStyle,\n provide: function provide() {\n return {\n $pcListbox: this,\n $parentInstance: this\n };\n }\n};\n\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nvar script = {\n name: 'Listbox',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['change', 'focus', 'blur', 'filter', 'item-dblclick', 'option-dblclick'],\n list: null,\n virtualScroller: null,\n optionTouched: false,\n startRangeIndex: -1,\n searchTimeout: null,\n searchValue: '',\n data: function data() {\n return {\n id: this.$attrs.id,\n filterValue: null,\n focused: false,\n focusedOptionIndex: -1\n };\n },\n watch: {\n '$attrs.id': function $attrsId(newValue) {\n this.id = newValue || UniqueComponentId();\n },\n options: function options() {\n this.autoUpdateModel();\n }\n },\n mounted: function mounted() {\n this.id = this.id || UniqueComponentId();\n this.autoUpdateModel();\n },\n methods: {\n getOptionIndex: function getOptionIndex(index, fn) {\n return this.virtualScrollerDisabled ? index : fn && fn(index)['index'];\n },\n getOptionLabel: function getOptionLabel(option) {\n return this.optionLabel ? resolveFieldData(option, this.optionLabel) : typeof option === 'string' ? option : null;\n },\n getOptionValue: function getOptionValue(option) {\n return this.optionValue ? resolveFieldData(option, this.optionValue) : option;\n },\n getOptionRenderKey: function getOptionRenderKey(option, index) {\n return (this.dataKey ? resolveFieldData(option, this.dataKey) : this.getOptionLabel(option)) + '_' + index;\n },\n getPTOptions: function getPTOptions(option, itemOptions, index, key) {\n return this.ptm(key, {\n context: {\n selected: this.isSelected(option),\n focused: this.focusedOptionIndex === this.getOptionIndex(index, itemOptions),\n disabled: this.isOptionDisabled(option)\n }\n });\n },\n isOptionDisabled: function isOptionDisabled(option) {\n return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false;\n },\n isOptionGroup: function isOptionGroup(option) {\n return this.optionGroupLabel && option.optionGroup && option.group;\n },\n getOptionGroupLabel: function getOptionGroupLabel(optionGroup) {\n return resolveFieldData(optionGroup, this.optionGroupLabel);\n },\n getOptionGroupChildren: function getOptionGroupChildren(optionGroup) {\n return resolveFieldData(optionGroup, this.optionGroupChildren);\n },\n getAriaPosInset: function getAriaPosInset(index) {\n var _this = this;\n return (this.optionGroupLabel ? index - this.visibleOptions.slice(0, index).filter(function (option) {\n return _this.isOptionGroup(option);\n }).length : index) + 1;\n },\n onFirstHiddenFocus: function onFirstHiddenFocus() {\n focus(this.list);\n var firstFocusableEl = getFirstFocusableElement(this.$el, ':not([data-p-hidden-focusable=\"true\"])');\n this.$refs.lastHiddenFocusableElement.tabIndex = isElement(firstFocusableEl) ? undefined : -1;\n this.$refs.firstHiddenFocusableElement.tabIndex = -1;\n },\n onLastHiddenFocus: function onLastHiddenFocus(event) {\n var relatedTarget = event.relatedTarget;\n if (relatedTarget === this.list) {\n var firstFocusableEl = getFirstFocusableElement(this.$el, ':not([data-p-hidden-focusable=\"true\"])');\n focus(firstFocusableEl);\n this.$refs.firstHiddenFocusableElement.tabIndex = undefined;\n } else {\n focus(this.$refs.firstHiddenFocusableElement);\n }\n this.$refs.lastHiddenFocusableElement.tabIndex = -1;\n },\n onFocusout: function onFocusout(event) {\n if (!this.$el.contains(event.relatedTarget) && this.$refs.lastHiddenFocusableElement && this.$refs.firstHiddenFocusableElement) {\n this.$refs.lastHiddenFocusableElement.tabIndex = this.$refs.firstHiddenFocusableElement.tabIndex = undefined;\n }\n },\n onListFocus: function onListFocus(event) {\n this.focused = true;\n this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : this.findSelectedOptionIndex();\n this.autoUpdateModel();\n this.$emit('focus', event);\n },\n onListBlur: function onListBlur(event) {\n this.focused = false;\n this.focusedOptionIndex = this.startRangeIndex = -1;\n this.searchValue = '';\n this.$emit('blur', event);\n },\n onListKeyDown: function onListKeyDown(event) {\n var _this2 = this;\n var metaKey = event.metaKey || event.ctrlKey;\n switch (event.code) {\n case 'ArrowDown':\n this.onArrowDownKey(event);\n break;\n case 'ArrowUp':\n this.onArrowUpKey(event);\n break;\n case 'Home':\n this.onHomeKey(event);\n break;\n case 'End':\n this.onEndKey(event);\n break;\n case 'PageDown':\n this.onPageDownKey(event);\n break;\n case 'PageUp':\n this.onPageUpKey(event);\n break;\n case 'Enter':\n case 'NumpadEnter':\n case 'Space':\n this.onSpaceKey(event);\n break;\n case 'Tab':\n //NOOP\n break;\n case 'ShiftLeft':\n case 'ShiftRight':\n this.onShiftKey(event);\n break;\n default:\n if (this.multiple && event.code === 'KeyA' && metaKey) {\n var value = this.visibleOptions.filter(function (option) {\n return _this2.isValidOption(option);\n }).map(function (option) {\n return _this2.getOptionValue(option);\n });\n this.updateModel(event, value);\n event.preventDefault();\n break;\n }\n if (!metaKey && isPrintableCharacter(event.key)) {\n this.searchOptions(event, event.key);\n event.preventDefault();\n }\n break;\n }\n },\n onOptionSelect: function onOptionSelect(event, option) {\n var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;\n if (this.disabled || this.isOptionDisabled(option)) {\n return;\n }\n this.multiple ? this.onOptionSelectMultiple(event, option) : this.onOptionSelectSingle(event, option);\n this.optionTouched = false;\n index !== -1 && (this.focusedOptionIndex = index);\n },\n onOptionMouseDown: function onOptionMouseDown(event, index) {\n this.changeFocusedOptionIndex(event, index);\n },\n onOptionMouseMove: function onOptionMouseMove(event, index) {\n if (this.focusOnHover && this.focused) {\n this.changeFocusedOptionIndex(event, index);\n }\n },\n onOptionTouchEnd: function onOptionTouchEnd() {\n if (this.disabled) {\n return;\n }\n this.optionTouched = true;\n },\n onOptionDblClick: function onOptionDblClick(event, item) {\n this.$emit('item-dblclick', {\n originalEvent: event,\n value: item\n });\n this.$emit('option-dblclick', {\n originalEvent: event,\n value: item\n });\n },\n onOptionSelectSingle: function onOptionSelectSingle(event, option) {\n var selected = this.isSelected(option);\n var valueChanged = false;\n var value = null;\n var metaSelection = this.optionTouched ? false : this.metaKeySelection;\n if (metaSelection) {\n var metaKey = event && (event.metaKey || event.ctrlKey);\n if (selected) {\n if (metaKey) {\n value = null;\n valueChanged = true;\n }\n } else {\n value = this.getOptionValue(option);\n valueChanged = true;\n }\n } else {\n value = selected ? null : this.getOptionValue(option);\n valueChanged = true;\n }\n if (valueChanged) {\n this.updateModel(event, value);\n }\n },\n onOptionSelectMultiple: function onOptionSelectMultiple(event, option) {\n var selected = this.isSelected(option);\n var value = null;\n var metaSelection = this.optionTouched ? false : this.metaKeySelection;\n if (metaSelection) {\n var metaKey = event.metaKey || event.ctrlKey;\n if (selected) {\n value = metaKey ? this.removeOption(option) : [this.getOptionValue(option)];\n } else {\n value = metaKey ? this.d_value || [] : [];\n value = [].concat(_toConsumableArray(value), [this.getOptionValue(option)]);\n }\n } else {\n value = selected ? this.removeOption(option) : [].concat(_toConsumableArray(this.d_value || []), [this.getOptionValue(option)]);\n }\n this.updateModel(event, value);\n },\n onOptionSelectRange: function onOptionSelectRange(event) {\n var _this3 = this;\n var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;\n start === -1 && (start = this.findNearestSelectedOptionIndex(end, true));\n end === -1 && (end = this.findNearestSelectedOptionIndex(start));\n if (start !== -1 && end !== -1) {\n var rangeStart = Math.min(start, end);\n var rangeEnd = Math.max(start, end);\n var value = this.visibleOptions.slice(rangeStart, rangeEnd + 1).filter(function (option) {\n return _this3.isValidOption(option);\n }).map(function (option) {\n return _this3.getOptionValue(option);\n });\n this.updateModel(event, value);\n }\n },\n onFilterChange: function onFilterChange(event) {\n this.$emit('filter', {\n originalEvent: event,\n value: event.target.value,\n filterValue: this.visibleOptions\n });\n this.focusedOptionIndex = this.startRangeIndex = -1;\n },\n onFilterBlur: function onFilterBlur() {\n this.focusedOptionIndex = this.startRangeIndex = -1;\n },\n onFilterKeyDown: function onFilterKeyDown(event) {\n switch (event.code) {\n case 'ArrowDown':\n this.onArrowDownKey(event);\n break;\n case 'ArrowUp':\n this.onArrowUpKey(event);\n break;\n case 'ArrowLeft':\n case 'ArrowRight':\n this.onArrowLeftKey(event, true);\n break;\n case 'Home':\n this.onHomeKey(event, true);\n break;\n case 'End':\n this.onEndKey(event, true);\n break;\n case 'Enter':\n case 'NumpadEnter':\n this.onEnterKey(event);\n break;\n case 'ShiftLeft':\n case 'ShiftRight':\n this.onShiftKey(event);\n break;\n }\n },\n onArrowDownKey: function onArrowDownKey(event) {\n var optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.findFirstFocusedOptionIndex();\n if (this.multiple && event.shiftKey) {\n this.onOptionSelectRange(event, this.startRangeIndex, optionIndex);\n }\n this.changeFocusedOptionIndex(event, optionIndex);\n event.preventDefault();\n },\n onArrowUpKey: function onArrowUpKey(event) {\n var optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex(this.focusedOptionIndex) : this.findLastFocusedOptionIndex();\n if (this.multiple && event.shiftKey) {\n this.onOptionSelectRange(event, optionIndex, this.startRangeIndex);\n }\n this.changeFocusedOptionIndex(event, optionIndex);\n event.preventDefault();\n },\n onArrowLeftKey: function onArrowLeftKey(event) {\n var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n pressedInInputText && (this.focusedOptionIndex = -1);\n },\n onHomeKey: function onHomeKey(event) {\n var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (pressedInInputText) {\n var target = event.currentTarget;\n if (event.shiftKey) {\n target.setSelectionRange(0, event.target.selectionStart);\n } else {\n target.setSelectionRange(0, 0);\n this.focusedOptionIndex = -1;\n }\n } else {\n var metaKey = event.metaKey || event.ctrlKey;\n var optionIndex = this.findFirstOptionIndex();\n if (this.multiple && event.shiftKey && metaKey) {\n this.onOptionSelectRange(event, optionIndex, this.startRangeIndex);\n }\n this.changeFocusedOptionIndex(event, optionIndex);\n }\n event.preventDefault();\n },\n onEndKey: function onEndKey(event) {\n var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (pressedInInputText) {\n var target = event.currentTarget;\n if (event.shiftKey) {\n target.setSelectionRange(event.target.selectionStart, target.value.length);\n } else {\n var len = target.value.length;\n target.setSelectionRange(len, len);\n this.focusedOptionIndex = -1;\n }\n } else {\n var metaKey = event.metaKey || event.ctrlKey;\n var optionIndex = this.findLastOptionIndex();\n if (this.multiple && event.shiftKey && metaKey) {\n this.onOptionSelectRange(event, this.startRangeIndex, optionIndex);\n }\n this.changeFocusedOptionIndex(event, optionIndex);\n }\n event.preventDefault();\n },\n onPageUpKey: function onPageUpKey(event) {\n this.scrollInView(0);\n event.preventDefault();\n },\n onPageDownKey: function onPageDownKey(event) {\n this.scrollInView(this.visibleOptions.length - 1);\n event.preventDefault();\n },\n onEnterKey: function onEnterKey(event) {\n if (this.focusedOptionIndex !== -1) {\n if (this.multiple && event.shiftKey) this.onOptionSelectRange(event, this.focusedOptionIndex);else this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);\n }\n },\n onSpaceKey: function onSpaceKey(event) {\n event.preventDefault();\n this.onEnterKey(event);\n },\n onShiftKey: function onShiftKey() {\n this.startRangeIndex = this.focusedOptionIndex;\n },\n isOptionMatched: function isOptionMatched(option) {\n var _this$getOptionLabel;\n return this.isValidOption(option) && typeof this.getOptionLabel(option) === 'string' && ((_this$getOptionLabel = this.getOptionLabel(option)) === null || _this$getOptionLabel === void 0 ? void 0 : _this$getOptionLabel.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)));\n },\n isValidOption: function isValidOption(option) {\n return isNotEmpty(option) && !(this.isOptionDisabled(option) || this.isOptionGroup(option));\n },\n isValidSelectedOption: function isValidSelectedOption(option) {\n return this.isValidOption(option) && this.isSelected(option);\n },\n isEquals: function isEquals(value1, value2) {\n return equals(value1, value2, this.equalityKey);\n },\n isSelected: function isSelected(option) {\n var _this4 = this;\n var optionValue = this.getOptionValue(option);\n if (this.multiple) return (this.d_value || []).some(function (value) {\n return _this4.isEquals(value, optionValue);\n });else return this.isEquals(this.d_value, optionValue);\n },\n findFirstOptionIndex: function findFirstOptionIndex() {\n var _this5 = this;\n return this.visibleOptions.findIndex(function (option) {\n return _this5.isValidOption(option);\n });\n },\n findLastOptionIndex: function findLastOptionIndex() {\n var _this6 = this;\n return findLastIndex(this.visibleOptions, function (option) {\n return _this6.isValidOption(option);\n });\n },\n findNextOptionIndex: function findNextOptionIndex(index) {\n var _this7 = this;\n var matchedOptionIndex = index < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index + 1).findIndex(function (option) {\n return _this7.isValidOption(option);\n }) : -1;\n return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;\n },\n findPrevOptionIndex: function findPrevOptionIndex(index) {\n var _this8 = this;\n var matchedOptionIndex = index > 0 ? findLastIndex(this.visibleOptions.slice(0, index), function (option) {\n return _this8.isValidOption(option);\n }) : -1;\n return matchedOptionIndex > -1 ? matchedOptionIndex : index;\n },\n findSelectedOptionIndex: function findSelectedOptionIndex() {\n var _this9 = this;\n if (this.$filled) {\n if (this.multiple) {\n var _loop = function _loop() {\n var value = _this9.d_value[index];\n var matchedOptionIndex = _this9.visibleOptions.findIndex(function (option) {\n return _this9.isValidSelectedOption(option) && _this9.isEquals(value, _this9.getOptionValue(option));\n });\n if (matchedOptionIndex > -1) return {\n v: matchedOptionIndex\n };\n },\n _ret;\n for (var index = this.d_value.length - 1; index >= 0; index--) {\n _ret = _loop();\n if (_ret) return _ret.v;\n }\n } else {\n return this.visibleOptions.findIndex(function (option) {\n return _this9.isValidSelectedOption(option);\n });\n }\n }\n return -1;\n },\n findFirstSelectedOptionIndex: function findFirstSelectedOptionIndex() {\n var _this10 = this;\n return this.$filled ? this.visibleOptions.findIndex(function (option) {\n return _this10.isValidSelectedOption(option);\n }) : -1;\n },\n findLastSelectedOptionIndex: function findLastSelectedOptionIndex() {\n var _this11 = this;\n return this.$filled ? findLastIndex(this.visibleOptions, function (option) {\n return _this11.isValidSelectedOption(option);\n }) : -1;\n },\n findNextSelectedOptionIndex: function findNextSelectedOptionIndex(index) {\n var _this12 = this;\n var matchedOptionIndex = this.$filled && index < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index + 1).findIndex(function (option) {\n return _this12.isValidSelectedOption(option);\n }) : -1;\n return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : -1;\n },\n findPrevSelectedOptionIndex: function findPrevSelectedOptionIndex(index) {\n var _this13 = this;\n var matchedOptionIndex = this.$filled && index > 0 ? findLastIndex(this.visibleOptions.slice(0, index), function (option) {\n return _this13.isValidSelectedOption(option);\n }) : -1;\n return matchedOptionIndex > -1 ? matchedOptionIndex : -1;\n },\n findNearestSelectedOptionIndex: function findNearestSelectedOptionIndex(index) {\n var firstCheckUp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var matchedOptionIndex = -1;\n if (this.$filled) {\n if (firstCheckUp) {\n matchedOptionIndex = this.findPrevSelectedOptionIndex(index);\n matchedOptionIndex = matchedOptionIndex === -1 ? this.findNextSelectedOptionIndex(index) : matchedOptionIndex;\n } else {\n matchedOptionIndex = this.findNextSelectedOptionIndex(index);\n matchedOptionIndex = matchedOptionIndex === -1 ? this.findPrevSelectedOptionIndex(index) : matchedOptionIndex;\n }\n }\n return matchedOptionIndex > -1 ? matchedOptionIndex : index;\n },\n findFirstFocusedOptionIndex: function findFirstFocusedOptionIndex() {\n var selectedIndex = this.findFirstSelectedOptionIndex();\n return selectedIndex < 0 ? this.findFirstOptionIndex() : selectedIndex;\n },\n findLastFocusedOptionIndex: function findLastFocusedOptionIndex() {\n var selectedIndex = this.findLastSelectedOptionIndex();\n return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex;\n },\n searchOptions: function searchOptions(event, _char) {\n var _this14 = this;\n this.searchValue = (this.searchValue || '') + _char;\n var optionIndex = -1;\n if (isNotEmpty(this.searchValue)) {\n if (this.focusedOptionIndex !== -1) {\n optionIndex = this.visibleOptions.slice(this.focusedOptionIndex).findIndex(function (option) {\n return _this14.isOptionMatched(option);\n });\n optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionIndex).findIndex(function (option) {\n return _this14.isOptionMatched(option);\n }) : optionIndex + this.focusedOptionIndex;\n } else {\n optionIndex = this.visibleOptions.findIndex(function (option) {\n return _this14.isOptionMatched(option);\n });\n }\n if (optionIndex === -1 && this.focusedOptionIndex === -1) {\n optionIndex = this.findFirstFocusedOptionIndex();\n }\n if (optionIndex !== -1) {\n this.changeFocusedOptionIndex(event, optionIndex);\n }\n }\n if (this.searchTimeout) {\n clearTimeout(this.searchTimeout);\n }\n this.searchTimeout = setTimeout(function () {\n _this14.searchValue = '';\n _this14.searchTimeout = null;\n }, 500);\n },\n removeOption: function removeOption(option) {\n var _this15 = this;\n return this.d_value.filter(function (val) {\n return !equals(val, _this15.getOptionValue(option), _this15.equalityKey);\n });\n },\n changeFocusedOptionIndex: function changeFocusedOptionIndex(event, index) {\n if (this.focusedOptionIndex !== index) {\n this.focusedOptionIndex = index;\n this.scrollInView();\n if (this.selectOnFocus && !this.multiple) {\n this.onOptionSelect(event, this.visibleOptions[index]);\n }\n }\n },\n scrollInView: function scrollInView() {\n var _this16 = this;\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;\n this.$nextTick(function () {\n var id = index !== -1 ? \"\".concat(_this16.id, \"_\").concat(index) : _this16.focusedOptionId;\n var element = findSingle(_this16.list, \"li[id=\\\"\".concat(id, \"\\\"]\"));\n if (element) {\n element.scrollIntoView && element.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n behavior: 'smooth'\n });\n } else if (!_this16.virtualScrollerDisabled) {\n _this16.virtualScroller && _this16.virtualScroller.scrollToIndex(index !== -1 ? index : _this16.focusedOptionIndex);\n }\n });\n },\n autoUpdateModel: function autoUpdateModel() {\n if (this.selectOnFocus && this.autoOptionFocus && !this.$filled && !this.multiple && this.focused) {\n this.focusedOptionIndex = this.findFirstFocusedOptionIndex();\n this.onOptionSelect(null, this.visibleOptions[this.focusedOptionIndex]);\n }\n },\n updateModel: function updateModel(event, value) {\n this.writeValue(value, event);\n this.$emit('change', {\n originalEvent: event,\n value: value\n });\n },\n listRef: function listRef(el, contentRef) {\n this.list = el;\n contentRef && contentRef(el); // For VirtualScroller\n },\n virtualScrollerRef: function virtualScrollerRef(el) {\n this.virtualScroller = el;\n }\n },\n computed: {\n optionsListFlat: function optionsListFlat() {\n return this.filterValue ? FilterService.filter(this.options, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale) : this.options;\n },\n optionsListGroup: function optionsListGroup() {\n var _this17 = this;\n var filteredOptions = [];\n (this.options || []).forEach(function (optionGroup) {\n var optionGroupChildren = _this17.getOptionGroupChildren(optionGroup) || [];\n var filteredChildren = _this17.filterValue ? FilterService.filter(optionGroupChildren, _this17.searchFields, _this17.filterValue, _this17.filterMatchMode, _this17.filterLocale) : optionGroupChildren;\n if (filteredChildren !== null && filteredChildren !== void 0 && filteredChildren.length) {\n filteredOptions.push.apply(filteredOptions, [{\n optionGroup: optionGroup,\n group: true\n }].concat(_toConsumableArray(filteredChildren)));\n }\n });\n return filteredOptions;\n },\n visibleOptions: function visibleOptions() {\n return this.optionGroupLabel ? this.optionsListGroup : this.optionsListFlat;\n },\n // @deprecated use $filled instead\n hasSelectedOption: function hasSelectedOption() {\n return isNotEmpty(this.d_value);\n },\n equalityKey: function equalityKey() {\n return this.optionValue ? null : this.dataKey;\n },\n searchFields: function searchFields() {\n return this.filterFields || [this.optionLabel];\n },\n filterResultMessageText: function filterResultMessageText() {\n return isNotEmpty(this.visibleOptions) ? this.filterMessageText.replaceAll('{0}', this.visibleOptions.length) : this.emptyFilterMessageText;\n },\n filterMessageText: function filterMessageText() {\n return this.filterMessage || this.$primevue.config.locale.searchMessage || '';\n },\n emptyFilterMessageText: function emptyFilterMessageText() {\n return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage || '';\n },\n emptyMessageText: function emptyMessageText() {\n return this.emptyMessage || this.$primevue.config.locale.emptyMessage || '';\n },\n selectionMessageText: function selectionMessageText() {\n return this.selectionMessage || this.$primevue.config.locale.selectionMessage || '';\n },\n emptySelectionMessageText: function emptySelectionMessageText() {\n return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || '';\n },\n selectedMessageText: function selectedMessageText() {\n return this.$filled ? this.selectionMessageText.replaceAll('{0}', this.multiple ? this.d_value.length : '1') : this.emptySelectionMessageText;\n },\n focusedOptionId: function focusedOptionId() {\n return this.focusedOptionIndex !== -1 ? \"\".concat(this.id, \"_\").concat(this.focusedOptionIndex) : null;\n },\n ariaSetSize: function ariaSetSize() {\n var _this18 = this;\n return this.visibleOptions.filter(function (option) {\n return !_this18.isOptionGroup(option);\n }).length;\n },\n virtualScrollerDisabled: function virtualScrollerDisabled() {\n return !this.virtualScrollerOptions;\n }\n },\n directives: {\n ripple: Ripple\n },\n components: {\n InputText: InputText,\n VirtualScroller: VirtualScroller,\n InputIcon: InputIcon,\n IconField: IconField,\n SearchIcon: SearchIcon,\n CheckIcon: CheckIcon,\n BlankIcon: BlankIcon\n }\n};\n\nvar _hoisted_1 = [\"id\"];\nvar _hoisted_2 = [\"tabindex\"];\nvar _hoisted_3 = [\"id\", \"aria-multiselectable\", \"aria-label\", \"aria-labelledby\", \"aria-activedescendant\", \"aria-disabled\"];\nvar _hoisted_4 = [\"id\"];\nvar _hoisted_5 = [\"id\", \"aria-label\", \"aria-selected\", \"aria-disabled\", \"aria-setsize\", \"aria-posinset\", \"onClick\", \"onMousedown\", \"onMousemove\", \"onDblclick\", \"data-p-selected\", \"data-p-focused\", \"data-p-disabled\"];\nvar _hoisted_6 = [\"tabindex\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_InputText = resolveComponent(\"InputText\");\n var _component_SearchIcon = resolveComponent(\"SearchIcon\");\n var _component_InputIcon = resolveComponent(\"InputIcon\");\n var _component_IconField = resolveComponent(\"IconField\");\n var _component_CheckIcon = resolveComponent(\"CheckIcon\");\n var _component_BlankIcon = resolveComponent(\"BlankIcon\");\n var _component_VirtualScroller = resolveComponent(\"VirtualScroller\");\n var _directive_ripple = resolveDirective(\"ripple\");\n return openBlock(), createElementBlock(\"div\", mergeProps({\n id: $data.id,\n \"class\": _ctx.cx('root'),\n onFocusout: _cache[7] || (_cache[7] = function () {\n return $options.onFocusout && $options.onFocusout.apply($options, arguments);\n })\n }, _ctx.ptmi('root')), [createElementVNode(\"span\", mergeProps({\n ref: \"firstHiddenFocusableElement\",\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n \"class\": \"p-hidden-accessible p-hidden-focusable\",\n tabindex: !_ctx.disabled ? _ctx.tabindex : -1,\n onFocus: _cache[0] || (_cache[0] = function () {\n return $options.onFirstHiddenFocus && $options.onFirstHiddenFocus.apply($options, arguments);\n })\n }, _ctx.ptm('hiddenFirstFocusableEl'), {\n \"data-p-hidden-accessible\": true,\n \"data-p-hidden-focusable\": true\n }), null, 16, _hoisted_2), _ctx.$slots.header ? (openBlock(), createElementBlock(\"div\", {\n key: 0,\n \"class\": normalizeClass(_ctx.cx('header'))\n }, [renderSlot(_ctx.$slots, \"header\", {\n value: _ctx.d_value,\n options: $options.visibleOptions\n })], 2)) : createCommentVNode(\"\", true), _ctx.filter ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('header')\n }, _ctx.ptm('header')), [createVNode(_component_IconField, {\n unstyled: _ctx.unstyled,\n pt: _ctx.ptm('pcFilterContainer')\n }, {\n \"default\": withCtx(function () {\n return [createVNode(_component_InputText, {\n modelValue: $data.filterValue,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = function ($event) {\n return $data.filterValue = $event;\n }),\n type: \"text\",\n \"class\": normalizeClass(_ctx.cx('pcFilter')),\n placeholder: _ctx.filterPlaceholder,\n role: \"searchbox\",\n autocomplete: \"off\",\n disabled: _ctx.disabled,\n unstyled: _ctx.unstyled,\n \"aria-owns\": $data.id + '_list',\n \"aria-activedescendant\": $options.focusedOptionId,\n tabindex: !_ctx.disabled && !$data.focused ? _ctx.tabindex : -1,\n onInput: $options.onFilterChange,\n onBlur: $options.onFilterBlur,\n onKeydown: $options.onFilterKeyDown,\n pt: _ctx.ptm('pcFilter')\n }, null, 8, [\"modelValue\", \"class\", \"placeholder\", \"disabled\", \"unstyled\", \"aria-owns\", \"aria-activedescendant\", \"tabindex\", \"onInput\", \"onBlur\", \"onKeydown\", \"pt\"]), createVNode(_component_InputIcon, {\n unstyled: _ctx.unstyled,\n pt: _ctx.ptm('pcFilterIconContainer')\n }, {\n \"default\": withCtx(function () {\n return [renderSlot(_ctx.$slots, \"filtericon\", {}, function () {\n return [_ctx.filterIcon ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 0,\n \"class\": _ctx.filterIcon\n }, _ctx.ptm('filterIcon')), null, 16)) : (openBlock(), createBlock(_component_SearchIcon, normalizeProps(mergeProps({\n key: 1\n }, _ctx.ptm('filterIcon'))), null, 16))];\n })];\n }),\n _: 3\n }, 8, [\"unstyled\", \"pt\"])];\n }),\n _: 3\n }, 8, [\"unstyled\", \"pt\"]), createElementVNode(\"span\", mergeProps({\n role: \"status\",\n \"aria-live\": \"polite\",\n \"class\": \"p-hidden-accessible\"\n }, _ctx.ptm('hiddenFilterResult'), {\n \"data-p-hidden-accessible\": true\n }), toDisplayString($options.filterResultMessageText), 17)], 16)) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('listContainer'),\n style: [{\n 'max-height': $options.virtualScrollerDisabled ? _ctx.scrollHeight : ''\n }, _ctx.listStyle]\n }, _ctx.ptm('listContainer')), [createVNode(_component_VirtualScroller, mergeProps({\n ref: $options.virtualScrollerRef\n }, _ctx.virtualScrollerOptions, {\n items: $options.visibleOptions,\n style: [{\n height: _ctx.scrollHeight\n }, _ctx.listStyle],\n tabindex: -1,\n disabled: $options.virtualScrollerDisabled,\n pt: _ctx.ptm('virtualScroller')\n }), createSlots({\n content: withCtx(function (_ref) {\n var styleClass = _ref.styleClass,\n contentRef = _ref.contentRef,\n items = _ref.items,\n getItemOptions = _ref.getItemOptions,\n contentStyle = _ref.contentStyle,\n itemSize = _ref.itemSize;\n return [createElementVNode(\"ul\", mergeProps({\n ref: function ref(el) {\n return $options.listRef(el, contentRef);\n },\n id: $data.id + '_list',\n \"class\": [_ctx.cx('list'), styleClass],\n style: contentStyle,\n tabindex: -1,\n role: \"listbox\",\n \"aria-multiselectable\": _ctx.multiple,\n \"aria-label\": _ctx.ariaLabel,\n \"aria-labelledby\": _ctx.ariaLabelledby,\n \"aria-activedescendant\": $data.focused ? $options.focusedOptionId : undefined,\n \"aria-disabled\": _ctx.disabled,\n onFocus: _cache[3] || (_cache[3] = function () {\n return $options.onListFocus && $options.onListFocus.apply($options, arguments);\n }),\n onBlur: _cache[4] || (_cache[4] = function () {\n return $options.onListBlur && $options.onListBlur.apply($options, arguments);\n }),\n onKeydown: _cache[5] || (_cache[5] = function () {\n return $options.onListKeyDown && $options.onListKeyDown.apply($options, arguments);\n })\n }, _ctx.ptm('list')), [(openBlock(true), createElementBlock(Fragment, null, renderList(items, function (option, i) {\n return openBlock(), createElementBlock(Fragment, {\n key: $options.getOptionRenderKey(option, $options.getOptionIndex(i, getItemOptions))\n }, [$options.isOptionGroup(option) ? (openBlock(), createElementBlock(\"li\", mergeProps({\n key: 0,\n id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),\n style: {\n height: itemSize ? itemSize + 'px' : undefined\n },\n \"class\": _ctx.cx('optionGroup'),\n role: \"option\",\n ref_for: true\n }, _ctx.ptm('optionGroup')), [renderSlot(_ctx.$slots, \"optiongroup\", {\n option: option.optionGroup,\n index: $options.getOptionIndex(i, getItemOptions)\n }, function () {\n return [createTextVNode(toDisplayString($options.getOptionGroupLabel(option.optionGroup)), 1)];\n })], 16, _hoisted_4)) : withDirectives((openBlock(), createElementBlock(\"li\", mergeProps({\n key: 1,\n id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),\n style: {\n height: itemSize ? itemSize + 'px' : undefined\n },\n \"class\": _ctx.cx('option', {\n option: option,\n index: i,\n getItemOptions: getItemOptions\n }),\n role: \"option\",\n \"aria-label\": $options.getOptionLabel(option),\n \"aria-selected\": $options.isSelected(option),\n \"aria-disabled\": $options.isOptionDisabled(option),\n \"aria-setsize\": $options.ariaSetSize,\n \"aria-posinset\": $options.getAriaPosInset($options.getOptionIndex(i, getItemOptions)),\n onClick: function onClick($event) {\n return $options.onOptionSelect($event, option, $options.getOptionIndex(i, getItemOptions));\n },\n onMousedown: function onMousedown($event) {\n return $options.onOptionMouseDown($event, $options.getOptionIndex(i, getItemOptions));\n },\n onMousemove: function onMousemove($event) {\n return $options.onOptionMouseMove($event, $options.getOptionIndex(i, getItemOptions));\n },\n onTouchend: _cache[2] || (_cache[2] = function ($event) {\n return $options.onOptionTouchEnd();\n }),\n onDblclick: function onDblclick($event) {\n return $options.onOptionDblClick($event, option);\n },\n ref_for: true\n }, $options.getPTOptions(option, getItemOptions, i, 'option'), {\n \"data-p-selected\": $options.isSelected(option),\n \"data-p-focused\": $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions),\n \"data-p-disabled\": $options.isOptionDisabled(option)\n }), [_ctx.checkmark ? (openBlock(), createElementBlock(Fragment, {\n key: 0\n }, [$options.isSelected(option) ? (openBlock(), createBlock(_component_CheckIcon, mergeProps({\n key: 0,\n \"class\": _ctx.cx('optionCheckIcon'),\n ref_for: true\n }, _ctx.ptm('optionCheckIcon')), null, 16, [\"class\"])) : (openBlock(), createBlock(_component_BlankIcon, mergeProps({\n key: 1,\n \"class\": _ctx.cx('optionBlankIcon'),\n ref_for: true\n }, _ctx.ptm('optionBlankIcon')), null, 16, [\"class\"]))], 64)) : createCommentVNode(\"\", true), renderSlot(_ctx.$slots, \"option\", {\n option: option,\n selected: $options.isSelected(option),\n index: $options.getOptionIndex(i, getItemOptions)\n }, function () {\n return [createTextVNode(toDisplayString($options.getOptionLabel(option)), 1)];\n })], 16, _hoisted_5)), [[_directive_ripple]])], 64);\n }), 128)), $data.filterValue && (!items || items && items.length === 0) ? (openBlock(), createElementBlock(\"li\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('emptyMessage'),\n role: \"option\"\n }, _ctx.ptm('emptyMessage')), [renderSlot(_ctx.$slots, \"emptyfilter\", {}, function () {\n return [createTextVNode(toDisplayString($options.emptyFilterMessageText), 1)];\n })], 16)) : !_ctx.options || _ctx.options && _ctx.options.length === 0 ? (openBlock(), createElementBlock(\"li\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('emptyMessage'),\n role: \"option\"\n }, _ctx.ptm('emptyMessage')), [renderSlot(_ctx.$slots, \"empty\", {}, function () {\n return [createTextVNode(toDisplayString($options.emptyMessageText), 1)];\n })], 16)) : createCommentVNode(\"\", true)], 16, _hoisted_3)];\n }),\n _: 2\n }, [_ctx.$slots.loader ? {\n name: \"loader\",\n fn: withCtx(function (_ref2) {\n var options = _ref2.options;\n return [renderSlot(_ctx.$slots, \"loader\", {\n options: options\n })];\n }),\n key: \"0\"\n } : undefined]), 1040, [\"items\", \"style\", \"disabled\", \"pt\"])], 16), renderSlot(_ctx.$slots, \"footer\", {\n value: _ctx.d_value,\n options: $options.visibleOptions\n }), !_ctx.options || _ctx.options && _ctx.options.length === 0 ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 2,\n role: \"status\",\n \"aria-live\": \"polite\",\n \"class\": \"p-hidden-accessible\"\n }, _ctx.ptm('hiddenEmptyMessage'), {\n \"data-p-hidden-accessible\": true\n }), toDisplayString($options.emptyMessageText), 17)) : createCommentVNode(\"\", true), createElementVNode(\"span\", mergeProps({\n role: \"status\",\n \"aria-live\": \"polite\",\n \"class\": \"p-hidden-accessible\"\n }, _ctx.ptm('hiddenSelectedMessage'), {\n \"data-p-hidden-accessible\": true\n }), toDisplayString($options.selectedMessageText), 17), createElementVNode(\"span\", mergeProps({\n ref: \"lastHiddenFocusableElement\",\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n \"class\": \"p-hidden-accessible p-hidden-focusable\",\n tabindex: !_ctx.disabled ? _ctx.tabindex : -1,\n onFocus: _cache[6] || (_cache[6] = function () {\n return $options.onLastHiddenFocus && $options.onLastHiddenFocus.apply($options, arguments);\n })\n }, _ctx.ptm('hiddenLastFocusableEl'), {\n \"data-p-hidden-accessible\": true,\n \"data-p-hidden-focusable\": true\n }), null, 16, _hoisted_6)], 16, _hoisted_1);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","\n\n\n\n\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-progressbar {\\n position: relative;\\n overflow: hidden;\\n height: \".concat(dt('progressbar.height'), \";\\n background: \").concat(dt('progressbar.background'), \";\\n border-radius: \").concat(dt('progressbar.border.radius'), \";\\n}\\n\\n.p-progressbar-value {\\n margin: 0;\\n background: \").concat(dt('progressbar.value.background'), \";\\n}\\n\\n.p-progressbar-label {\\n color: \").concat(dt('progressbar.label.color'), \";\\n font-size: \").concat(dt('progressbar.label.font.size'), \";\\n font-weight: \").concat(dt('progressbar.label.font.weight'), \";\\n}\\n\\n.p-progressbar-determinate .p-progressbar-value {\\n height: 100%;\\n width: 0%;\\n position: absolute;\\n display: none;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n overflow: hidden;\\n transition: width 1s ease-in-out;\\n}\\n\\n.p-progressbar-determinate .p-progressbar-label {\\n display: inline-flex;\\n}\\n\\n.p-progressbar-indeterminate .p-progressbar-value::before {\\n content: \\\"\\\";\\n position: absolute;\\n background: inherit;\\n inset-block-start: 0;\\n inset-inline-start: 0;\\n inset-block-end: 0;\\n will-change: inset-inline-start, inset-inline-end;\\n animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\\n}\\n\\n.p-progressbar-indeterminate .p-progressbar-value::after {\\n content: \\\"\\\";\\n position: absolute;\\n background: inherit;\\n inset-block-start: 0;\\n inset-inline-start: 0;\\n inset-block-end: 0;\\n will-change: inset-inline-start, inset-inline-end;\\n animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\\n animation-delay: 1.15s;\\n}\\n\\n@keyframes p-progressbar-indeterminate-anim {\\n 0% {\\n inset-inline-start: -35%;\\n inset-inline-end: 100%;\\n }\\n 60% {\\n inset-inline-start: 100%;\\n inset-inline-end: -90%;\\n }\\n 100% {\\n inset-inline-start: 100%;\\n inset-inline-end: -90%;\\n }\\n}\\n@-webkit-keyframes p-progressbar-indeterminate-anim {\\n 0% {\\n inset-inline-start: -35%;\\n inset-inline-end: 100%;\\n }\\n 60% {\\n inset-inline-start: 100%;\\n inset-inline-end: -90%;\\n }\\n 100% {\\n inset-inline-start: 100%;\\n inset-inline-end: -90%;\\n }\\n}\\n\\n@keyframes p-progressbar-indeterminate-anim-short {\\n 0% {\\n inset-inline-start: -200%;\\n inset-inline-end: 100%;\\n }\\n 60% {\\n inset-inline-start: 107%;\\n inset-inline-end: -8%;\\n }\\n 100% {\\n inset-inline-start: 107%;\\n inset-inline-end: -8%;\\n }\\n}\\n@-webkit-keyframes p-progressbar-indeterminate-anim-short {\\n 0% {\\n inset-inline-start: -200%;\\n inset-inline-end: 100%;\\n }\\n 60% {\\n inset-inline-start: 107%;\\n inset-inline-end: -8%;\\n }\\n 100% {\\n inset-inline-start: 107%;\\n inset-inline-end: -8%;\\n }\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var instance = _ref2.instance;\n return ['p-progressbar p-component', {\n 'p-progressbar-determinate': instance.determinate,\n 'p-progressbar-indeterminate': instance.indeterminate\n }];\n },\n value: 'p-progressbar-value',\n label: 'p-progressbar-label'\n};\nvar ProgressBarStyle = BaseStyle.extend({\n name: 'progressbar',\n theme: theme,\n classes: classes\n});\n\nexport { ProgressBarStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseComponent from '@primevue/core/basecomponent';\nimport ProgressBarStyle from 'primevue/progressbar/style';\nimport { openBlock, createElementBlock, mergeProps, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from 'vue';\n\nvar script$1 = {\n name: 'BaseProgressBar',\n \"extends\": BaseComponent,\n props: {\n value: {\n type: Number,\n \"default\": null\n },\n mode: {\n type: String,\n \"default\": 'determinate'\n },\n showValue: {\n type: Boolean,\n \"default\": true\n }\n },\n style: ProgressBarStyle,\n provide: function provide() {\n return {\n $pcProgressBar: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'ProgressBar',\n \"extends\": script$1,\n inheritAttrs: false,\n computed: {\n progressStyle: function progressStyle() {\n return {\n width: this.value + '%',\n display: 'flex'\n };\n },\n indeterminate: function indeterminate() {\n return this.mode === 'indeterminate';\n },\n determinate: function determinate() {\n return this.mode === 'determinate';\n }\n }\n};\n\nvar _hoisted_1 = [\"aria-valuenow\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n role: \"progressbar\",\n \"class\": _ctx.cx('root'),\n \"aria-valuemin\": \"0\",\n \"aria-valuenow\": _ctx.value,\n \"aria-valuemax\": \"100\"\n }, _ctx.ptmi('root')), [$options.determinate ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('value'),\n style: $options.progressStyle\n }, _ctx.ptm('value')), [_ctx.value != null && _ctx.value !== 0 && _ctx.showValue ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('label')\n }, _ctx.ptm('label')), [renderSlot(_ctx.$slots, \"default\", {}, function () {\n return [createTextVNode(toDisplayString(_ctx.value + '%'), 1)];\n })], 16)) : createCommentVNode(\"\", true)], 16)) : $options.indeterminate ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('value')\n }, _ctx.ptm('value')), null, 16)) : createCommentVNode(\"\", true)], 16, _hoisted_1);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import { onMounted, ref } from 'vue'\n\nexport function useDownload(url: string, fileName?: string) {\n const fileSize = ref(null)\n\n const fetchFileSize = async (): Promise => {\n try {\n const response = await fetch(url, { method: 'HEAD' })\n if (!response.ok) throw new Error('Failed to fetch file size')\n\n const size = response.headers.get('content-length')\n if (size) {\n return parseInt(size)\n } else {\n console.error('\"content-length\" header not found')\n return null\n }\n } catch (e) {\n console.error('Error fetching file size:', e)\n return null\n }\n }\n\n /**\n * Trigger browser download\n */\n const triggerBrowserDownload = () => {\n const link = document.createElement('a')\n link.href = url\n link.download = fileName || url.split('/').pop() || 'download'\n link.target = '_blank' // Opens in new tab if download attribute is not supported\n link.rel = 'noopener noreferrer' // Security best practice for _blank links\n link.click()\n }\n\n onMounted(async () => {\n fileSize.value = await fetchFileSize()\n })\n\n return {\n triggerBrowserDownload,\n fileSize\n }\n}\n","const IPC_CHANNELS = {\n LOADING_PROGRESS: \"loading-progress\",\n IS_PACKAGED: \"is-packaged\",\n RENDERER_READY: \"renderer-ready\",\n RESTART_APP: \"restart-app\",\n REINSTALL: \"reinstall\",\n QUIT: \"quit\",\n LOG_MESSAGE: \"log-message\",\n DOWNLOAD_PROGRESS: \"download-progress\",\n START_DOWNLOAD: \"start-download\",\n PAUSE_DOWNLOAD: \"pause-download\",\n RESUME_DOWNLOAD: \"resume-download\",\n CANCEL_DOWNLOAD: \"cancel-download\",\n DELETE_MODEL: \"delete-model\",\n GET_ALL_DOWNLOADS: \"get-all-downloads\",\n GET_ELECTRON_VERSION: \"get-electron-version\",\n GET_BASE_PATH: \"get-base-path\",\n SET_BASE_PATH: \"set-base-path\",\n GET_MODEL_CONFIG_PATH: \"get-model-config-path\",\n OPEN_PATH: \"open-path\",\n OPEN_LOGS_PATH: \"open-logs-path\",\n OPEN_DEV_TOOLS: \"open-dev-tools\",\n TERMINAL_WRITE: \"execute-terminal-command\",\n TERMINAL_RESIZE: \"resize-terminal\",\n TERMINAL_RESTORE: \"restore-terminal\",\n TERMINAL_ON_OUTPUT: \"terminal-output\",\n GET_SYSTEM_PATHS: \"get-system-paths\",\n VALIDATE_INSTALL_PATH: \"validate-install-path\",\n VALIDATE_COMFYUI_SOURCE: \"validate-comfyui-source\",\n SHOW_DIRECTORY_PICKER: \"show-directory-picker\",\n INSTALL_COMFYUI: \"install-comfyui\",\n CHANGE_THEME: \"change-theme\",\n SHOW_CONTEXT_MENU: \"show-context-menu\",\n RESTART_CORE: \"restart-core\",\n GET_GPU: \"get-gpu\",\n SET_WINDOW_STYLE: \"set-window-style\",\n GET_VALIDATION_STATE: \"get-validation-state\",\n VALIDATION_UPDATE: \"validation-update\",\n COMPLETE_VALIDATION: \"complete-validation\",\n CANCEL_VALIDATION: \"cancel-validation\",\n VALIDATE_INSTALLATION: \"start-validation\",\n UV_INSTALL_REQUIREMENTS: \"uv-install-requirements\",\n GET_WINDOW_STYLE: \"get-window-style\",\n TRACK_EVENT: \"track-event\",\n SET_METRICS_CONSENT: \"set-metrics-consent\",\n INCREMENT_USER_PROPERTY: \"increment-user-property\",\n UV_CLEAR_CACHE: \"uv-clear-cache\",\n UV_RESET_VENV: \"uv-delete-venv\",\n CAN_ACCESS_URL: \"can-access-url\",\n START_TROUBLESHOOTING: \"start-troubleshooting\"\n};\nvar ProgressStatus = /* @__PURE__ */ ((ProgressStatus2) => {\n ProgressStatus2[\"INITIAL_STATE\"] = \"initial-state\";\n ProgressStatus2[\"PYTHON_SETUP\"] = \"python-setup\";\n ProgressStatus2[\"STARTING_SERVER\"] = \"starting-server\";\n ProgressStatus2[\"READY\"] = \"ready\";\n ProgressStatus2[\"ERROR\"] = \"error\";\n return ProgressStatus2;\n})(ProgressStatus || {});\nconst ELECTRON_BRIDGE_API = \"electronAPI\";\nconst SENTRY_URL_ENDPOINT = \"https://942cadba58d247c9cab96f45221aa813@o4507954455314432.ingest.us.sentry.io/4508007940685824\";\nconst MigrationItems = [\n {\n id: \"user_files\",\n label: \"User Files\",\n description: \"Settings and user-created workflows\"\n },\n {\n id: \"models\",\n label: \"Models\",\n description: \"Reference model files from existing ComfyUI installations. (No copy)\"\n },\n {\n id: \"custom_nodes\",\n label: \"Custom Nodes\",\n description: \"Reinstall custom nodes from existing ComfyUI installations.\"\n }\n];\nconst DEFAULT_SERVER_ARGS = {\n listen: \"127.0.0.1\",\n port: \"8000\"\n};\nvar DownloadStatus = /* @__PURE__ */ ((DownloadStatus2) => {\n DownloadStatus2[\"PENDING\"] = \"pending\";\n DownloadStatus2[\"IN_PROGRESS\"] = \"in_progress\";\n DownloadStatus2[\"COMPLETED\"] = \"completed\";\n DownloadStatus2[\"PAUSED\"] = \"paused\";\n DownloadStatus2[\"ERROR\"] = \"error\";\n DownloadStatus2[\"CANCELLED\"] = \"cancelled\";\n return DownloadStatus2;\n})(DownloadStatus || {});\nconst CUDA_TORCH_URL = \"https://download.pytorch.org/whl/cu126\";\nconst NIGHTLY_CPU_TORCH_URL = \"https://download.pytorch.org/whl/nightly/cpu\";\nconst DEFAULT_PYPI_INDEX_URL = \"https://pypi.org/simple/\";\nexport {\n CUDA_TORCH_URL,\n DEFAULT_PYPI_INDEX_URL,\n DEFAULT_SERVER_ARGS,\n DownloadStatus,\n ELECTRON_BRIDGE_API,\n IPC_CHANNELS,\n MigrationItems,\n NIGHTLY_CPU_TORCH_URL,\n ProgressStatus,\n SENTRY_URL_ENDPOINT\n};\n","import {\n type DownloadState,\n DownloadStatus\n} from '@comfyorg/comfyui-electron-types'\nimport { defineStore } from 'pinia'\nimport { computed, ref } from 'vue'\n\nimport { electronAPI, isElectron } from '@/utils/envUtil'\n\nexport interface ElectronDownload\n extends Pick {\n progress?: number\n savePath?: string\n status?: DownloadStatus\n}\n\n/** Electron donwloads store handler */\nexport const useElectronDownloadStore = defineStore('downloads', () => {\n const downloads = ref([])\n const { DownloadManager } = electronAPI()\n\n const findByUrl = (url: string) =>\n downloads.value.find((download) => url === download.url)\n\n const initialize = async () => {\n if (isElectron()) {\n const allDownloads = await DownloadManager.getAllDownloads()\n\n for (const download of allDownloads) {\n downloads.value.push(download)\n }\n\n // ToDO: replace with ElectronDownload type\n DownloadManager.onDownloadProgress((data) => {\n if (!findByUrl(data.url)) {\n downloads.value.push(data)\n }\n\n const download = findByUrl(data.url)\n\n if (download) {\n download.progress = data.progress\n download.status = data.status\n download.filename = data.filename\n download.savePath = data.savePath\n }\n })\n }\n }\n\n void initialize()\n\n const start = ({\n url,\n savePath,\n filename\n }: {\n url: string\n savePath: string\n filename: string\n }) => DownloadManager.startDownload(url, savePath, filename)\n const pause = (url: string) => DownloadManager.pauseDownload(url)\n const resume = (url: string) => DownloadManager.resumeDownload(url)\n const cancel = (url: string) => DownloadManager.cancelDownload(url)\n\n return {\n downloads,\n start,\n pause,\n resume,\n cancel,\n findByUrl,\n initialize,\n inProgressDownloads: computed(() =>\n downloads.value.filter(\n ({ status }) => status !== DownloadStatus.COMPLETED\n )\n )\n }\n})\n","import { ResultItem } from '@/types/apiTypes'\n\nexport function formatCamelCase(str: string): string {\n // Check if the string is camel case\n const isCamelCase = /^([A-Z][a-z]*)+$/.test(str)\n\n if (!isCamelCase) {\n return str // Return original string if not camel case\n }\n\n // Split the string into words, keeping acronyms together\n const words = str.split(/(?=[A-Z][a-z])|\\d+/)\n\n // Process each word\n const processedWords = words.map((word) => {\n // If the word is all uppercase and longer than one character, it's likely an acronym\n if (word.length > 1 && word === word.toUpperCase()) {\n return word // Keep acronyms as is\n }\n // For other words, ensure the first letter is capitalized\n return word.charAt(0).toUpperCase() + word.slice(1)\n })\n\n // Join the words with spaces\n return processedWords.join(' ')\n}\n\nexport function appendJsonExt(path: string) {\n if (!path.toLowerCase().endsWith('.json')) {\n path += '.json'\n }\n return path\n}\n\nexport function trimJsonExt(path?: string) {\n return path?.replace(/\\.json$/, '')\n}\n\nexport function highlightQuery(text: string, query: string) {\n if (!query) return text\n const regex = new RegExp(`(${query})`, 'gi')\n return text.replace(regex, '$1')\n}\n\nexport function formatNumberWithSuffix(\n num: number,\n {\n precision = 1,\n roundToInt = false\n }: { precision?: number; roundToInt?: boolean } = {}\n): string {\n const suffixes = ['', 'k', 'm', 'b', 't']\n const absNum = Math.abs(num)\n\n if (absNum < 1000) {\n return roundToInt ? Math.round(num).toString() : num.toFixed(precision)\n }\n\n const exp = Math.min(Math.floor(Math.log10(absNum) / 3), suffixes.length - 1)\n const formattedNum = (num / Math.pow(1000, exp)).toFixed(precision)\n\n return `${formattedNum}${suffixes[exp]}`\n}\n\nexport function formatSize(value?: number) {\n if (value === null || value === undefined) {\n return '-'\n }\n\n const bytes = value\n if (bytes === 0) return '0 B'\n const k = 1024\n const sizes = ['B', 'KB', 'MB', 'GB']\n const i = Math.floor(Math.log(bytes) / Math.log(k))\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`\n}\n\n/**\n * Finds the common directory prefix between two paths\n * @example\n * findCommonPrefix('a/b/c', 'a/b/d') // returns 'a/b'\n * findCommonPrefix('x/y/z', 'a/b/c') // returns ''\n * findCommonPrefix('a/b/c', 'a/b/c/d') // returns 'a/b/c'\n */\nexport function findCommonPrefix(path1: string, path2: string): string {\n const parts1 = path1.split('/')\n const parts2 = path2.split('/')\n\n const commonParts: string[] = []\n for (let i = 0; i < Math.min(parts1.length, parts2.length); i++) {\n if (parts1[i] === parts2[i]) {\n commonParts.push(parts1[i])\n } else {\n break\n }\n }\n return commonParts.join('/')\n}\n\n/**\n * Returns various filename components.\n * Example:\n * - fullFilename: 'file.txt'\n * - filename: 'file'\n * - suffix: 'txt'\n */\nexport function getFilenameDetails(fullFilename: string) {\n if (fullFilename.includes('.')) {\n return {\n filename: fullFilename.split('.').slice(0, -1).join('.'),\n suffix: fullFilename.split('.').pop() ?? null\n }\n } else {\n return { filename: fullFilename, suffix: null }\n }\n}\n\n/**\n * Returns various path components.\n * Example:\n * - path: 'dir/file.txt'\n * - directory: 'dir'\n * - fullFilename: 'file.txt'\n * - filename: 'file'\n * - suffix: 'txt'\n */\nexport function getPathDetails(path: string) {\n const directory = path.split('/').slice(0, -1).join('/')\n const fullFilename = path.split('/').pop() ?? path\n return { directory, fullFilename, ...getFilenameDetails(fullFilename) }\n}\n\n/**\n * Normalizes a string to be used as an i18n key.\n * Replaces dots with underscores.\n */\nexport function normalizeI18nKey(key: string) {\n return key.replace(/\\./g, '_')\n}\n\n/**\n * Takes a dynamic prompt in the format {opt1|opt2|{optA|optB}|} and randomly replaces groups. Supports C style comments.\n * @param input The dynamic prompt to process\n * @returns\n */\nexport function processDynamicPrompt(input: string): string {\n /*\n * Strips C-style line and block comments from a string\n */\n function stripComments(str: string) {\n return str.replace(/\\/\\*[\\s\\S]*?\\*\\/|\\/\\/.*/g, '')\n }\n\n let i = 0\n let result = ''\n input = stripComments(input)\n\n const handleEscape = () => {\n const nextChar = input[i++]\n return '\\\\' + nextChar\n }\n\n function parseChoiceBlock() {\n // Parse the content inside {}\n const options: string[] = []\n let choice = ''\n let depth = 0\n\n while (i < input.length) {\n const char = input[i++]\n\n if (char === '\\\\') {\n choice += handleEscape()\n continue\n } else if (char === '{') {\n depth++\n } else if (char === '}') {\n if (!depth) break\n depth--\n } else if (char === '|') {\n if (!depth) {\n options.push(choice)\n choice = ''\n continue\n }\n }\n choice += char\n }\n\n options.push(choice)\n\n const chosenOption = options[Math.floor(Math.random() * options.length)]\n return processDynamicPrompt(chosenOption)\n }\n\n while (i < input.length) {\n const char = input[i++]\n if (char === '\\\\') {\n result += handleEscape()\n } else if (char === '{') {\n result += parseChoiceBlock()\n } else {\n result += char\n }\n }\n\n return result.replace(/\\\\([{}|])/g, '$1')\n}\n\nexport function isValidUrl(url: string): boolean {\n try {\n new URL(url)\n return true\n } catch {\n return false\n }\n}\nconst hasAnnotation = (filepath: string): boolean =>\n /\\[(input|output|temp)\\]/i.test(filepath)\n\nconst createAnnotation = (filepath: string, rootFolder = 'input'): string =>\n !hasAnnotation(filepath) && rootFolder !== 'input' ? ` [${rootFolder}]` : ''\n\nconst createPath = (filename: string, subfolder = ''): string =>\n subfolder ? `${subfolder}/${filename}` : filename\n\n/** Creates annotated filepath in format used by folder_paths.py */\nexport function createAnnotatedPath(\n item: string | ResultItem,\n options: { rootFolder?: string; subfolder?: string } = {}\n): string {\n const { rootFolder = 'input', subfolder } = options\n if (typeof item === 'string')\n return `${createPath(item, subfolder)}${createAnnotation(item, rootFolder)}`\n return `${createPath(item.filename ?? '', item.subfolder)}${item.type ? createAnnotation(item.type, rootFolder) : ''}`\n}\n\n/**\n * Parses a filepath into its filename and subfolder components.\n *\n * @example\n * parseFilePath('folder/file.txt') // → { filename: 'file.txt', subfolder: 'folder' }\n * parseFilePath('/folder/file.txt') // → { filename: 'file.txt', subfolder: 'folder' }\n * parseFilePath('file.txt') // → { filename: 'file.txt', subfolder: '' }\n * parseFilePath('folder//file.txt') // → { filename: 'file.txt', subfolder: 'folder' }\n *\n * @param filepath The filepath to parse\n * @returns Object containing filename and subfolder\n */\nexport function parseFilePath(filepath: string): {\n filename: string\n subfolder: string\n} {\n if (!filepath?.trim()) return { filename: '', subfolder: '' }\n\n const normalizedPath = filepath\n .replace(/[\\\\/]+/g, '/') // Normalize path separators\n .replace(/^\\//, '') // Remove leading slash\n .replace(/\\/$/, '') // Remove trailing slash\n\n const lastSlashIndex = normalizedPath.lastIndexOf('/')\n\n if (lastSlashIndex === -1) {\n return {\n filename: normalizedPath,\n subfolder: ''\n }\n }\n\n return {\n filename: normalizedPath.slice(lastSlashIndex + 1),\n subfolder: normalizedPath.slice(0, lastSlashIndex)\n }\n}\n","\n\n\n\n","\n\n\n\n","import type { TreeNode } from 'primevue/treenode'\n\nexport function buildTree(items: T[], key: (item: T) => string[]): TreeNode {\n const root: TreeNode = {\n key: 'root',\n label: 'root',\n children: []\n }\n\n const map: Record = {\n root: root\n }\n\n for (const item of items) {\n const keys = key(item)\n let parent = root\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i]\n // 'a/b/c/' represents an empty folder 'c' in folder 'b' in folder 'a'\n // 'a/b/c/' is split into ['a', 'b', 'c', '']\n if (k === '' && i === keys.length - 1) break\n\n const id = parent.key + '/' + k\n if (!map[id]) {\n const node: TreeNode = {\n key: id,\n label: k,\n leaf: false,\n children: []\n }\n map[id] = node\n parent.children?.push(node)\n }\n parent = map[id]\n }\n parent.leaf = keys[keys.length - 1] !== ''\n parent.data = item\n }\n return root\n}\n\nexport function flattenTree(tree: TreeNode): T[] {\n const result: T[] = []\n const stack: TreeNode[] = [tree]\n while (stack.length) {\n const node = stack.pop()!\n if (node.leaf && node.data) result.push(node.data)\n stack.push(...(node.children || []))\n }\n return result\n}\n\n/**\n * Sort the children of the node recursively.\n * @param node - The node to sort.\n * @param options - The options for sorting.\n * @param options.groupLeaf - Whether to group leaf nodes together.\n * @returns The sorted node.\n */\nexport function sortedTree(\n node: TreeNode,\n {\n groupLeaf = false\n }: {\n groupLeaf?: boolean\n } = {}\n): TreeNode {\n const newNode: TreeNode = {\n ...node\n }\n\n if (node.children) {\n if (groupLeaf) {\n // Split children into folders and files\n const folders = node.children.filter((child) => !child.leaf)\n const files = node.children.filter((child) => child.leaf)\n\n // Sort folders and files separately by label\n const sortedFolders = folders.sort((a, b) =>\n (a.label ?? '').localeCompare(b.label ?? '')\n )\n const sortedFiles = files.sort((a, b) =>\n (a.label ?? '').localeCompare(b.label ?? '')\n )\n\n // Recursively sort folder children\n newNode.children = [\n ...sortedFolders.map((folder) =>\n sortedTree(folder, { groupLeaf: true })\n ),\n ...sortedFiles\n ]\n } else {\n const sortedChildren = [...node.children].sort((a, b) =>\n (a.label ?? '').localeCompare(b.label ?? '')\n )\n newNode.children = [\n ...sortedChildren.map((child) =>\n sortedTree(child, { groupLeaf: false })\n )\n ]\n }\n }\n\n return newNode\n}\n\nexport const findNodeByKey = (root: TreeNode, key: string): TreeNode | null => {\n if (root.key === key) {\n return root\n }\n if (!root.children) {\n return null\n }\n for (const child of root.children) {\n const result = findNodeByKey(child, key)\n if (result) {\n return result\n }\n }\n return null\n}\n","import _ from 'lodash'\nimport { defineStore } from 'pinia'\nimport type { TreeNode } from 'primevue/treenode'\nimport { computed, ref } from 'vue'\n\nimport { api } from '@/scripts/api'\nimport { app } from '@/scripts/app'\nimport type { Settings } from '@/types/apiTypes'\nimport type { SettingParams } from '@/types/settingTypes'\nimport { buildTree } from '@/utils/treeUtil'\n\nexport const getSettingInfo = (setting: SettingParams) => {\n const parts = setting.category || setting.id.split('.')\n return {\n category: parts[0] ?? 'Other',\n subCategory: parts[1] ?? 'Other'\n }\n}\n\nexport interface SettingTreeNode extends TreeNode {\n data?: SettingParams\n}\n\nfunction tryMigrateDeprecatedValue(setting: SettingParams, value: any) {\n return setting?.migrateDeprecatedValue?.(value) ?? value\n}\n\nfunction onChange(setting: SettingParams, newValue: any, oldValue: any) {\n if (setting?.onChange) {\n setting.onChange(newValue, oldValue)\n }\n // Backward compatibility with old settings dialog.\n // Some extensions still listens event emitted by the old settings dialog.\n app.ui.settings.dispatchChange(setting.id, newValue, oldValue)\n}\n\nexport const useSettingStore = defineStore('setting', () => {\n const settingValues = ref>({})\n const settingsById = ref>({})\n\n const settingTree = computed(() => {\n const root = buildTree(\n Object.values(settingsById.value).filter(\n (setting: SettingParams) => setting.type !== 'hidden'\n ),\n (setting: SettingParams) => setting.category || setting.id.split('.')\n )\n\n const floatingSettings = (root.children ?? []).filter((node) => node.leaf)\n if (floatingSettings.length) {\n root.children = (root.children ?? []).filter((node) => !node.leaf)\n root.children.push({\n key: 'Other',\n label: 'Other',\n leaf: false,\n children: floatingSettings\n })\n }\n\n return root\n })\n\n /**\n * Check if a setting's value exists, i.e. if the user has set it manually.\n * @param key - The key of the setting to check.\n * @returns Whether the setting exists.\n */\n function exists(key: string) {\n return settingValues.value[key] !== undefined\n }\n\n /**\n * Set a setting value.\n * @param key - The key of the setting to set.\n * @param value - The value to set.\n */\n async function set(key: K, value: Settings[K]) {\n // Clone the incoming value to prevent external mutations\n const clonedValue = _.cloneDeep(value)\n const newValue = tryMigrateDeprecatedValue(\n settingsById.value[key],\n clonedValue\n )\n const oldValue = get(key)\n if (newValue === oldValue) return\n\n onChange(settingsById.value[key], newValue, oldValue)\n settingValues.value[key] = newValue\n await api.storeSetting(key, newValue)\n }\n\n /**\n * Get a setting value.\n * @param key - The key of the setting to get.\n * @returns The value of the setting.\n */\n function get(key: K): Settings[K] {\n // Clone the value when returning to prevent external mutations\n return _.cloneDeep(settingValues.value[key] ?? getDefaultValue(key))\n }\n\n /**\n * Get the default value of a setting.\n * @param key - The key of the setting to get.\n * @returns The default value of the setting.\n */\n function getDefaultValue(key: K): Settings[K] {\n const param = settingsById.value[key]\n return typeof param?.defaultValue === 'function'\n ? param.defaultValue()\n : param?.defaultValue\n }\n\n /**\n * Register a setting.\n * @param setting - The setting to register.\n */\n function addSetting(setting: SettingParams) {\n if (!setting.id) {\n throw new Error('Settings must have an ID')\n }\n if (setting.id in settingsById.value) {\n throw new Error(`Setting ${setting.id} must have a unique ID.`)\n }\n\n settingsById.value[setting.id] = setting\n\n if (settingValues.value[setting.id] !== undefined) {\n settingValues.value[setting.id] = tryMigrateDeprecatedValue(\n setting,\n settingValues.value[setting.id]\n )\n }\n onChange(setting, get(setting.id), undefined)\n }\n\n /*\n * Load setting values from server.\n * This needs to be called before any setting is registered.\n */\n async function loadSettingValues() {\n if (Object.keys(settingsById.value).length) {\n throw new Error(\n 'Setting values must be loaded before any setting is registered.'\n )\n }\n settingValues.value = await api.getSettings()\n }\n\n return {\n settingValues,\n settingsById,\n settingTree,\n addSetting,\n loadSettingValues,\n set,\n get,\n exists,\n getDefaultValue\n }\n})\n","\n\n\n\n\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-floatlabel {\\n display: block;\\n position: relative;\\n}\\n\\n.p-floatlabel label {\\n position: absolute;\\n pointer-events: none;\\n top: 50%;\\n transform: translateY(-50%);\\n transition-property: all;\\n transition-timing-function: ease;\\n line-height: 1;\\n font-weight: \".concat(dt('floatlabel.font.weight'), \";\\n inset-inline-start: \").concat(dt('floatlabel.position.x'), \";\\n color: \").concat(dt('floatlabel.color'), \";\\n transition-duration: \").concat(dt('floatlabel.transition.duration'), \";\\n}\\n\\n.p-floatlabel:has(.p-textarea) label {\\n top: \").concat(dt('floatlabel.position.y'), \";\\n transform: translateY(0);\\n}\\n\\n.p-floatlabel:has(.p-inputicon:first-child) label {\\n inset-inline-start: calc((\").concat(dt('form.field.padding.x'), \" * 2) + \").concat(dt('icon.size'), \");\\n}\\n\\n.p-floatlabel:has(.p-invalid) label {\\n color: \").concat(dt('floatlabel.invalid.color'), \";\\n}\\n\\n.p-floatlabel:has(input:focus) label,\\n.p-floatlabel:has(input.p-filled) label,\\n.p-floatlabel:has(input:-webkit-autofill) label,\\n.p-floatlabel:has(textarea:focus) label,\\n.p-floatlabel:has(textarea.p-filled) label,\\n.p-floatlabel:has(.p-inputwrapper-focus) label,\\n.p-floatlabel:has(.p-inputwrapper-filled) label {\\n top: \").concat(dt('floatlabel.over.active.top'), \";\\n transform: translateY(0);\\n font-size: \").concat(dt('floatlabel.active.font.size'), \";\\n font-weight: \").concat(dt('floatlabel.label.active.font.weight'), \";\\n}\\n\\n.p-floatlabel:has(input.p-filled) label,\\n.p-floatlabel:has(textarea.p-filled) label,\\n.p-floatlabel:has(.p-inputwrapper-filled) label {\\n color: \").concat(dt('floatlabel.active.color'), \";\\n}\\n\\n.p-floatlabel:has(input:focus) label,\\n.p-floatlabel:has(input:-webkit-autofill) label,\\n.p-floatlabel:has(textarea:focus) label,\\n.p-floatlabel:has(.p-inputwrapper-focus) label {\\n color: \").concat(dt('floatlabel.focus.color'), \";\\n}\\n\\n.p-floatlabel-in .p-inputtext,\\n.p-floatlabel-in .p-textarea,\\n.p-floatlabel-in .p-select-label,\\n.p-floatlabel-in .p-multiselect-label,\\n.p-floatlabel-in .p-autocomplete-input-multiple,\\n.p-floatlabel-in .p-cascadeselect-label,\\n.p-floatlabel-in .p-treeselect-label {\\n padding-block-start: \").concat(dt('floatlabel.in.input.padding.top'), \";\\n padding-block-end: \").concat(dt('floatlabel.in.input.padding.bottom'), \";\\n}\\n\\n.p-floatlabel-in:has(input:focus) label,\\n.p-floatlabel-in:has(input.p-filled) label,\\n.p-floatlabel-in:has(input:-webkit-autofill) label,\\n.p-floatlabel-in:has(textarea:focus) label,\\n.p-floatlabel-in:has(textarea.p-filled) label,\\n.p-floatlabel-in:has(.p-inputwrapper-focus) label,\\n.p-floatlabel-in:has(.p-inputwrapper-filled) label {\\n top: \").concat(dt('floatlabel.in.active.top'), \";\\n}\\n\\n.p-floatlabel-on:has(input:focus) label,\\n.p-floatlabel-on:has(input.p-filled) label,\\n.p-floatlabel-on:has(input:-webkit-autofill) label,\\n.p-floatlabel-on:has(textarea:focus) label,\\n.p-floatlabel-on:has(textarea.p-filled) label,\\n.p-floatlabel-on:has(.p-inputwrapper-focus) label,\\n.p-floatlabel-on:has(.p-inputwrapper-filled) label {\\n top: 0;\\n transform: translateY(-50%);\\n border-radius: \").concat(dt('floatlabel.on.border.radius'), \";\\n background: \").concat(dt('floatlabel.on.active.background'), \";\\n padding: \").concat(dt('floatlabel.on.active.padding'), \";\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n _ref2.instance;\n var props = _ref2.props;\n return ['p-floatlabel', {\n 'p-floatlabel-over': props.variant === 'over',\n 'p-floatlabel-on': props.variant === 'on',\n 'p-floatlabel-in': props.variant === 'in'\n }];\n }\n};\nvar FloatLabelStyle = BaseStyle.extend({\n name: 'floatlabel',\n theme: theme,\n classes: classes\n});\n\nexport { FloatLabelStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseComponent from '@primevue/core/basecomponent';\nimport FloatLabelStyle from 'primevue/floatlabel/style';\nimport { openBlock, createElementBlock, mergeProps, renderSlot } from 'vue';\n\nvar script$1 = {\n name: 'BaseFloatLabel',\n \"extends\": BaseComponent,\n props: {\n variant: {\n type: String,\n \"default\": 'over'\n }\n },\n style: FloatLabelStyle,\n provide: function provide() {\n return {\n $pcFloatLabel: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'FloatLabel',\n \"extends\": script$1,\n inheritAttrs: false\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"span\", mergeProps({\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), [renderSlot(_ctx.$slots, \"default\")], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","\n\n\n","import BaseStyle from '@primevue/core/base/style';\n\nvar classes = {\n root: 'p-tabpanels'\n};\nvar TabPanelsStyle = BaseStyle.extend({\n name: 'tabpanels',\n classes: classes\n});\n\nexport { TabPanelsStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseComponent from '@primevue/core/basecomponent';\nimport TabPanelsStyle from 'primevue/tabpanels/style';\nimport { openBlock, createElementBlock, mergeProps, renderSlot } from 'vue';\n\nvar script$1 = {\n name: 'BaseTabPanels',\n \"extends\": BaseComponent,\n props: {},\n style: TabPanelsStyle,\n provide: function provide() {\n return {\n $pcTabPanels: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'TabPanels',\n \"extends\": script$1,\n inheritAttrs: false\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root'),\n role: \"presentation\"\n }, _ctx.ptmi('root')), [renderSlot(_ctx.$slots, \"default\")], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-tabs {\\n display: flex;\\n flex-direction: column;\\n}\\n\\n.p-tablist {\\n display: flex;\\n position: relative;\\n}\\n\\n.p-tabs-scrollable > .p-tablist {\\n overflow: hidden;\\n}\\n\\n.p-tablist-viewport {\\n overflow-x: auto;\\n overflow-y: hidden;\\n scroll-behavior: smooth;\\n scrollbar-width: none;\\n overscroll-behavior: contain auto;\\n}\\n\\n.p-tablist-viewport::-webkit-scrollbar {\\n display: none;\\n}\\n\\n.p-tablist-tab-list {\\n position: relative;\\n display: flex;\\n background: \".concat(dt('tabs.tablist.background'), \";\\n border-style: solid;\\n border-color: \").concat(dt('tabs.tablist.border.color'), \";\\n border-width: \").concat(dt('tabs.tablist.border.width'), \";\\n}\\n\\n.p-tablist-content {\\n flex-grow: 1;\\n}\\n\\n.p-tablist-nav-button {\\n all: unset;\\n position: absolute !important;\\n flex-shrink: 0;\\n inset-block-start: 0;\\n z-index: 2;\\n height: 100%;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n background: \").concat(dt('tabs.nav.button.background'), \";\\n color: \").concat(dt('tabs.nav.button.color'), \";\\n width: \").concat(dt('tabs.nav.button.width'), \";\\n transition: color \").concat(dt('tabs.transition.duration'), \", outline-color \").concat(dt('tabs.transition.duration'), \", box-shadow \").concat(dt('tabs.transition.duration'), \";\\n box-shadow: \").concat(dt('tabs.nav.button.shadow'), \";\\n outline-color: transparent;\\n cursor: pointer;\\n}\\n\\n.p-tablist-nav-button:focus-visible {\\n z-index: 1;\\n box-shadow: \").concat(dt('tabs.nav.button.focus.ring.shadow'), \";\\n outline: \").concat(dt('tabs.nav.button.focus.ring.width'), \" \").concat(dt('tabs.nav.button.focus.ring.style'), \" \").concat(dt('tabs.nav.button.focus.ring.color'), \";\\n outline-offset: \").concat(dt('tabs.nav.button.focus.ring.offset'), \";\\n}\\n\\n.p-tablist-nav-button:hover {\\n color: \").concat(dt('tabs.nav.button.hover.color'), \";\\n}\\n\\n.p-tablist-prev-button {\\n inset-inline-start: 0;\\n}\\n\\n.p-tablist-next-button {\\n inset-inline-end: 0;\\n}\\n\\n.p-tablist-prev-button:dir(rtl),\\n.p-tablist-next-button:dir(rtl) {\\n transform: rotate(180deg);\\n}\\n\\n\\n.p-tab {\\n flex-shrink: 0;\\n cursor: pointer;\\n user-select: none;\\n position: relative;\\n border-style: solid;\\n white-space: nowrap;\\n background: \").concat(dt('tabs.tab.background'), \";\\n border-width: \").concat(dt('tabs.tab.border.width'), \";\\n border-color: \").concat(dt('tabs.tab.border.color'), \";\\n color: \").concat(dt('tabs.tab.color'), \";\\n padding: \").concat(dt('tabs.tab.padding'), \";\\n font-weight: \").concat(dt('tabs.tab.font.weight'), \";\\n transition: background \").concat(dt('tabs.transition.duration'), \", border-color \").concat(dt('tabs.transition.duration'), \", color \").concat(dt('tabs.transition.duration'), \", outline-color \").concat(dt('tabs.transition.duration'), \", box-shadow \").concat(dt('tabs.transition.duration'), \";\\n margin: \").concat(dt('tabs.tab.margin'), \";\\n outline-color: transparent;\\n}\\n\\n.p-tab:not(.p-disabled):focus-visible {\\n z-index: 1;\\n box-shadow: \").concat(dt('tabs.tab.focus.ring.shadow'), \";\\n outline: \").concat(dt('tabs.tab.focus.ring.width'), \" \").concat(dt('tabs.tab.focus.ring.style'), \" \").concat(dt('tabs.tab.focus.ring.color'), \";\\n outline-offset: \").concat(dt('tabs.tab.focus.ring.offset'), \";\\n}\\n\\n.p-tab:not(.p-tab-active):not(.p-disabled):hover {\\n background: \").concat(dt('tabs.tab.hover.background'), \";\\n border-color: \").concat(dt('tabs.tab.hover.border.color'), \";\\n color: \").concat(dt('tabs.tab.hover.color'), \";\\n}\\n\\n.p-tab-active {\\n background: \").concat(dt('tabs.tab.active.background'), \";\\n border-color: \").concat(dt('tabs.tab.active.border.color'), \";\\n color: \").concat(dt('tabs.tab.active.color'), \";\\n}\\n\\n.p-tabpanels {\\n background: \").concat(dt('tabs.tabpanel.background'), \";\\n color: \").concat(dt('tabs.tabpanel.color'), \";\\n padding: \").concat(dt('tabs.tabpanel.padding'), \";\\n outline: 0 none;\\n}\\n\\n.p-tabpanel:focus-visible {\\n box-shadow: \").concat(dt('tabs.tabpanel.focus.ring.shadow'), \";\\n outline: \").concat(dt('tabs.tabpanel.focus.ring.width'), \" \").concat(dt('tabs.tabpanel.focus.ring.style'), \" \").concat(dt('tabs.tabpanel.focus.ring.color'), \";\\n outline-offset: \").concat(dt('tabs.tabpanel.focus.ring.offset'), \";\\n}\\n\\n.p-tablist-active-bar {\\n z-index: 1;\\n display: block;\\n position: absolute;\\n inset-block-end: \").concat(dt('tabs.active.bar.bottom'), \";\\n height: \").concat(dt('tabs.active.bar.height'), \";\\n background: \").concat(dt('tabs.active.bar.background'), \";\\n transition: 250ms cubic-bezier(0.35, 0, 0.25, 1);\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var props = _ref2.props;\n return ['p-tabs p-component', {\n 'p-tabs-scrollable': props.scrollable\n }];\n }\n};\nvar TabsStyle = BaseStyle.extend({\n name: 'tabs',\n theme: theme,\n classes: classes\n});\n\nexport { TabsStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { UniqueComponentId } from '@primevue/core/utils';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport TabsStyle from 'primevue/tabs/style';\nimport { openBlock, createElementBlock, mergeProps, renderSlot } from 'vue';\n\nvar script$1 = {\n name: 'BaseTabs',\n \"extends\": BaseComponent,\n props: {\n value: {\n type: [String, Number],\n \"default\": undefined\n },\n lazy: {\n type: Boolean,\n \"default\": false\n },\n scrollable: {\n type: Boolean,\n \"default\": false\n },\n showNavigators: {\n type: Boolean,\n \"default\": true\n },\n tabindex: {\n type: Number,\n \"default\": 0\n },\n selectOnFocus: {\n type: Boolean,\n \"default\": false\n }\n },\n style: TabsStyle,\n provide: function provide() {\n return {\n $pcTabs: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'Tabs',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['update:value'],\n data: function data() {\n return {\n id: this.$attrs.id,\n d_value: this.value\n };\n },\n watch: {\n '$attrs.id': function $attrsId(newValue) {\n this.id = newValue || UniqueComponentId();\n },\n value: function value(newValue) {\n this.d_value = newValue;\n }\n },\n mounted: function mounted() {\n this.id = this.id || UniqueComponentId();\n },\n methods: {\n updateValue: function updateValue(newValue) {\n if (this.d_value !== newValue) {\n this.d_value = newValue;\n this.$emit('update:value', newValue);\n }\n },\n isVertical: function isVertical() {\n return this.orientation === 'vertical';\n }\n }\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), [renderSlot(_ctx.$slots, \"default\")], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'TimesCircleIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M7 14C5.61553 14 4.26215 13.5895 3.11101 12.8203C1.95987 12.0511 1.06266 10.9579 0.532846 9.67879C0.00303296 8.3997 -0.13559 6.99224 0.134506 5.63437C0.404603 4.2765 1.07129 3.02922 2.05026 2.05026C3.02922 1.07129 4.2765 0.404603 5.63437 0.134506C6.99224 -0.13559 8.3997 0.00303296 9.67879 0.532846C10.9579 1.06266 12.0511 1.95987 12.8203 3.11101C13.5895 4.26215 14 5.61553 14 7C14 8.85652 13.2625 10.637 11.9497 11.9497C10.637 13.2625 8.85652 14 7 14ZM7 1.16667C5.84628 1.16667 4.71846 1.50879 3.75918 2.14976C2.79989 2.79074 2.05222 3.70178 1.61071 4.76768C1.16919 5.83358 1.05367 7.00647 1.27876 8.13803C1.50384 9.26958 2.05941 10.309 2.87521 11.1248C3.69102 11.9406 4.73042 12.4962 5.86198 12.7212C6.99353 12.9463 8.16642 12.8308 9.23232 12.3893C10.2982 11.9478 11.2093 11.2001 11.8502 10.2408C12.4912 9.28154 12.8333 8.15373 12.8333 7C12.8333 5.45291 12.2188 3.96918 11.1248 2.87521C10.0308 1.78125 8.5471 1.16667 7 1.16667ZM4.66662 9.91668C4.58998 9.91704 4.51404 9.90209 4.44325 9.87271C4.37246 9.84333 4.30826 9.8001 4.2544 9.74557C4.14516 9.6362 4.0838 9.48793 4.0838 9.33335C4.0838 9.17876 4.14516 9.0305 4.2544 8.92113L6.17553 7L4.25443 5.07891C4.15139 4.96832 4.09529 4.82207 4.09796 4.67094C4.10063 4.51982 4.16185 4.37563 4.26872 4.26876C4.3756 4.16188 4.51979 4.10066 4.67091 4.09799C4.82204 4.09532 4.96829 4.15142 5.07887 4.25446L6.99997 6.17556L8.92106 4.25446C9.03164 4.15142 9.1779 4.09532 9.32903 4.09799C9.48015 4.10066 9.62434 4.16188 9.73121 4.26876C9.83809 4.37563 9.89931 4.51982 9.90198 4.67094C9.90464 4.82207 9.84855 4.96832 9.74551 5.07891L7.82441 7L9.74554 8.92113C9.85478 9.0305 9.91614 9.17876 9.91614 9.33335C9.91614 9.48793 9.85478 9.6362 9.74554 9.74557C9.69168 9.8001 9.62748 9.84333 9.55669 9.87271C9.4859 9.90209 9.40996 9.91704 9.33332 9.91668C9.25668 9.91704 9.18073 9.90209 9.10995 9.87271C9.03916 9.84333 8.97495 9.8001 8.9211 9.74557L6.99997 7.82444L5.07884 9.74557C5.02499 9.8001 4.96078 9.84333 4.88999 9.87271C4.81921 9.90209 4.74326 9.91704 4.66662 9.91668Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-chip {\\n display: inline-flex;\\n align-items: center;\\n background: \".concat(dt('chip.background'), \";\\n color: \").concat(dt('chip.color'), \";\\n border-radius: \").concat(dt('chip.border.radius'), \";\\n padding-block: \").concat(dt('chip.padding.y'), \";\\n padding-inline: \").concat(dt('chip.padding.x'), \";\\n gap: \").concat(dt('chip.gap'), \";\\n}\\n\\n.p-chip-icon {\\n color: \").concat(dt('chip.icon.color'), \";\\n font-size: \").concat(dt('chip.icon.font.size'), \";\\n width: \").concat(dt('chip.icon.size'), \";\\n height: \").concat(dt('chip.icon.size'), \";\\n}\\n\\n.p-chip-image {\\n border-radius: 50%;\\n width: \").concat(dt('chip.image.width'), \";\\n height: \").concat(dt('chip.image.height'), \";\\n margin-inline-start: calc(-1 * \").concat(dt('chip.padding.y'), \");\\n}\\n\\n.p-chip:has(.p-chip-remove-icon) {\\n padding-inline-end: \").concat(dt('chip.padding.y'), \";\\n}\\n\\n.p-chip:has(.p-chip-image) {\\n padding-block-start: calc(\").concat(dt('chip.padding.y'), \" / 2);\\n padding-block-end: calc(\").concat(dt('chip.padding.y'), \" / 2);\\n}\\n\\n.p-chip-remove-icon {\\n cursor: pointer;\\n font-size: \").concat(dt('chip.remove.icon.size'), \";\\n width: \").concat(dt('chip.remove.icon.size'), \";\\n height: \").concat(dt('chip.remove.icon.size'), \";\\n color: \").concat(dt('chip.remove.icon.color'), \";\\n border-radius: 50%;\\n transition: outline-color \").concat(dt('chip.transition.duration'), \", box-shadow \").concat(dt('chip.transition.duration'), \";\\n outline-color: transparent;\\n}\\n\\n.p-chip-remove-icon:focus-visible {\\n box-shadow: \").concat(dt('chip.remove.icon.focus.ring.shadow'), \";\\n outline: \").concat(dt('chip.remove.icon.focus.ring.width'), \" \").concat(dt('chip.remove.icon.focus.ring.style'), \" \").concat(dt('chip.remove.icon.focus.ring.color'), \";\\n outline-offset: \").concat(dt('chip.remove.icon.focus.ring.offset'), \";\\n}\\n\");\n};\nvar classes = {\n root: 'p-chip p-component',\n image: 'p-chip-image',\n icon: 'p-chip-icon',\n label: 'p-chip-label',\n removeIcon: 'p-chip-remove-icon'\n};\nvar ChipStyle = BaseStyle.extend({\n name: 'chip',\n theme: theme,\n classes: classes\n});\n\nexport { ChipStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import TimesCircleIcon from '@primevue/icons/timescircle';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport ChipStyle from 'primevue/chip/style';\nimport { openBlock, createElementBlock, mergeProps, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, toDisplayString } from 'vue';\n\nvar script$1 = {\n name: 'BaseChip',\n \"extends\": BaseComponent,\n props: {\n label: {\n type: String,\n \"default\": null\n },\n icon: {\n type: String,\n \"default\": null\n },\n image: {\n type: String,\n \"default\": null\n },\n removable: {\n type: Boolean,\n \"default\": false\n },\n removeIcon: {\n type: String,\n \"default\": undefined\n }\n },\n style: ChipStyle,\n provide: function provide() {\n return {\n $pcChip: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'Chip',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['remove'],\n data: function data() {\n return {\n visible: true\n };\n },\n methods: {\n onKeydown: function onKeydown(event) {\n if (event.key === 'Enter' || event.key === 'Backspace') {\n this.close(event);\n }\n },\n close: function close(event) {\n this.visible = false;\n this.$emit('remove', event);\n }\n },\n components: {\n TimesCircleIcon: TimesCircleIcon\n }\n};\n\nvar _hoisted_1 = [\"aria-label\"];\nvar _hoisted_2 = [\"src\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return $data.visible ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('root'),\n \"aria-label\": _ctx.label\n }, _ctx.ptmi('root')), [renderSlot(_ctx.$slots, \"default\", {}, function () {\n return [_ctx.image ? (openBlock(), createElementBlock(\"img\", mergeProps({\n key: 0,\n src: _ctx.image\n }, _ctx.ptm('image'), {\n \"class\": _ctx.cx('image')\n }), null, 16, _hoisted_2)) : _ctx.$slots.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.icon), mergeProps({\n key: 1,\n \"class\": _ctx.cx('icon')\n }, _ctx.ptm('icon')), null, 16, [\"class\"])) : _ctx.icon ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 2,\n \"class\": [_ctx.cx('icon'), _ctx.icon]\n }, _ctx.ptm('icon')), null, 16)) : createCommentVNode(\"\", true), _ctx.label ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 3,\n \"class\": _ctx.cx('label')\n }, _ctx.ptm('label')), toDisplayString(_ctx.label), 17)) : createCommentVNode(\"\", true)];\n }), _ctx.removable ? renderSlot(_ctx.$slots, \"removeicon\", {\n key: 0,\n removeCallback: $options.close,\n keydownCallback: $options.onKeydown\n }, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.removeIcon ? 'span' : 'TimesCircleIcon'), mergeProps({\n \"class\": [_ctx.cx('removeIcon'), _ctx.removeIcon],\n onClick: $options.close,\n onKeydown: $options.onKeydown\n }, _ctx.ptm('removeIcon')), null, 16, [\"class\", \"onClick\", \"onKeydown\"]))];\n }) : createCommentVNode(\"\", true)], 16, _hoisted_1)) : createCommentVNode(\"\", true);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","\n\n\n\n\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-tag {\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n background: \".concat(dt('tag.primary.background'), \";\\n color: \").concat(dt('tag.primary.color'), \";\\n font-size: \").concat(dt('tag.font.size'), \";\\n font-weight: \").concat(dt('tag.font.weight'), \";\\n padding: \").concat(dt('tag.padding'), \";\\n border-radius: \").concat(dt('tag.border.radius'), \";\\n gap: \").concat(dt('tag.gap'), \";\\n}\\n\\n.p-tag-icon {\\n font-size: \").concat(dt('tag.icon.size'), \";\\n width: \").concat(dt('tag.icon.size'), \";\\n height:\").concat(dt('tag.icon.size'), \";\\n}\\n\\n.p-tag-rounded {\\n border-radius: \").concat(dt('tag.rounded.border.radius'), \";\\n}\\n\\n.p-tag-success {\\n background: \").concat(dt('tag.success.background'), \";\\n color: \").concat(dt('tag.success.color'), \";\\n}\\n\\n.p-tag-info {\\n background: \").concat(dt('tag.info.background'), \";\\n color: \").concat(dt('tag.info.color'), \";\\n}\\n\\n.p-tag-warn {\\n background: \").concat(dt('tag.warn.background'), \";\\n color: \").concat(dt('tag.warn.color'), \";\\n}\\n\\n.p-tag-danger {\\n background: \").concat(dt('tag.danger.background'), \";\\n color: \").concat(dt('tag.danger.color'), \";\\n}\\n\\n.p-tag-secondary {\\n background: \").concat(dt('tag.secondary.background'), \";\\n color: \").concat(dt('tag.secondary.color'), \";\\n}\\n\\n.p-tag-contrast {\\n background: \").concat(dt('tag.contrast.background'), \";\\n color: \").concat(dt('tag.contrast.color'), \";\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var props = _ref2.props;\n return ['p-tag p-component', {\n 'p-tag-info': props.severity === 'info',\n 'p-tag-success': props.severity === 'success',\n 'p-tag-warn': props.severity === 'warn',\n 'p-tag-danger': props.severity === 'danger',\n 'p-tag-secondary': props.severity === 'secondary',\n 'p-tag-contrast': props.severity === 'contrast',\n 'p-tag-rounded': props.rounded\n }];\n },\n icon: 'p-tag-icon',\n label: 'p-tag-label'\n};\nvar TagStyle = BaseStyle.extend({\n name: 'tag',\n theme: theme,\n classes: classes\n});\n\nexport { TagStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseComponent from '@primevue/core/basecomponent';\nimport TagStyle from 'primevue/tag/style';\nimport { openBlock, createElementBlock, mergeProps, createBlock, resolveDynamicComponent, createCommentVNode, renderSlot, createElementVNode, toDisplayString } from 'vue';\n\nvar script$1 = {\n name: 'BaseTag',\n \"extends\": BaseComponent,\n props: {\n value: null,\n severity: null,\n rounded: Boolean,\n icon: String\n },\n style: TagStyle,\n provide: function provide() {\n return {\n $pcTag: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'Tag',\n \"extends\": script$1,\n inheritAttrs: false\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"span\", mergeProps({\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), [_ctx.$slots.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.$slots.icon), mergeProps({\n key: 0,\n \"class\": _ctx.cx('icon')\n }, _ctx.ptm('icon')), null, 16, [\"class\"])) : _ctx.icon ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 1,\n \"class\": [_ctx.cx('icon'), _ctx.icon]\n }, _ctx.ptm('icon')), null, 16)) : createCommentVNode(\"\", true), _ctx.value != null || _ctx.$slots[\"default\"] ? renderSlot(_ctx.$slots, \"default\", {\n key: 2\n }, function () {\n return [createElementVNode(\"span\", mergeProps({\n \"class\": _ctx.cx('label')\n }, _ctx.ptm('label')), toDisplayString(_ctx.value), 17)];\n }) : createCommentVNode(\"\", true)], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar classes = {\n root: function root(_ref) {\n var instance = _ref.instance;\n return ['p-tabpanel', {\n 'p-tabpanel-active': instance.active\n }];\n }\n};\nvar TabPanelStyle = BaseStyle.extend({\n name: 'tabpanel',\n classes: classes\n});\n\nexport { TabPanelStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { equals } from '@primeuix/utils/object';\nimport { mergeProps, renderSlot, openBlock, createElementBlock, Fragment, withDirectives, createBlock, resolveDynamicComponent, withCtx, vShow, createCommentVNode, normalizeClass } from 'vue';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport TabPanelStyle from 'primevue/tabpanel/style';\n\nvar script$1 = {\n name: 'BaseTabPanel',\n \"extends\": BaseComponent,\n props: {\n // in Tabs\n value: {\n type: [String, Number],\n \"default\": undefined\n },\n as: {\n type: [String, Object],\n \"default\": 'DIV'\n },\n asChild: {\n type: Boolean,\n \"default\": false\n },\n // in TabView\n header: null,\n headerStyle: null,\n headerClass: null,\n headerProps: null,\n headerActionProps: null,\n contentStyle: null,\n contentClass: null,\n contentProps: null,\n disabled: Boolean\n },\n style: TabPanelStyle,\n provide: function provide() {\n return {\n $pcTabPanel: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'TabPanel',\n \"extends\": script$1,\n inheritAttrs: false,\n inject: ['$pcTabs'],\n computed: {\n active: function active() {\n var _this$$pcTabs;\n return equals((_this$$pcTabs = this.$pcTabs) === null || _this$$pcTabs === void 0 ? void 0 : _this$$pcTabs.d_value, this.value);\n },\n id: function id() {\n var _this$$pcTabs2;\n return \"\".concat((_this$$pcTabs2 = this.$pcTabs) === null || _this$$pcTabs2 === void 0 ? void 0 : _this$$pcTabs2.id, \"_tabpanel_\").concat(this.value);\n },\n ariaLabelledby: function ariaLabelledby() {\n var _this$$pcTabs3;\n return \"\".concat((_this$$pcTabs3 = this.$pcTabs) === null || _this$$pcTabs3 === void 0 ? void 0 : _this$$pcTabs3.id, \"_tab_\").concat(this.value);\n },\n attrs: function attrs() {\n return mergeProps(this.a11yAttrs, this.ptmi('root', this.ptParams));\n },\n a11yAttrs: function a11yAttrs() {\n var _this$$pcTabs4;\n return {\n id: this.id,\n tabindex: (_this$$pcTabs4 = this.$pcTabs) === null || _this$$pcTabs4 === void 0 ? void 0 : _this$$pcTabs4.tabindex,\n role: 'tabpanel',\n 'aria-labelledby': this.ariaLabelledby,\n 'data-pc-name': 'tabpanel',\n 'data-p-active': this.active\n };\n },\n ptParams: function ptParams() {\n return {\n context: {\n active: this.active\n }\n };\n }\n }\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _$options$$pcTabs, _$options$$pcTabs2;\n return !$options.$pcTabs ? renderSlot(_ctx.$slots, \"default\", {\n key: 0\n }) : (openBlock(), createElementBlock(Fragment, {\n key: 1\n }, [!_ctx.asChild ? (openBlock(), createElementBlock(Fragment, {\n key: 0\n }, [((_$options$$pcTabs = $options.$pcTabs) !== null && _$options$$pcTabs !== void 0 && _$options$$pcTabs.lazy ? $options.active : true) ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(_ctx.as), mergeProps({\n key: 0,\n \"class\": _ctx.cx('root')\n }, $options.attrs), {\n \"default\": withCtx(function () {\n return [renderSlot(_ctx.$slots, \"default\")];\n }),\n _: 3\n }, 16, [\"class\"])), [[vShow, (_$options$$pcTabs2 = $options.$pcTabs) !== null && _$options$$pcTabs2 !== void 0 && _$options$$pcTabs2.lazy ? true : $options.active]]) : createCommentVNode(\"\", true)], 64)) : renderSlot(_ctx.$slots, \"default\", {\n key: 1,\n \"class\": normalizeClass(_ctx.cx('root')),\n active: $options.active,\n a11yAttrs: $options.a11yAttrs\n })], 64));\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'ChevronLeftIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M9.61296 13C9.50997 13.0005 9.40792 12.9804 9.3128 12.9409C9.21767 12.9014 9.13139 12.8433 9.05902 12.7701L3.83313 7.54416C3.68634 7.39718 3.60388 7.19795 3.60388 6.99022C3.60388 6.78249 3.68634 6.58325 3.83313 6.43628L9.05902 1.21039C9.20762 1.07192 9.40416 0.996539 9.60724 1.00012C9.81032 1.00371 10.0041 1.08597 10.1477 1.22959C10.2913 1.37322 10.3736 1.56698 10.3772 1.77005C10.3808 1.97313 10.3054 2.16968 10.1669 2.31827L5.49496 6.99022L10.1669 11.6622C10.3137 11.8091 10.3962 12.0084 10.3962 12.2161C10.3962 12.4238 10.3137 12.6231 10.1669 12.7701C10.0945 12.8433 10.0083 12.9014 9.91313 12.9409C9.81801 12.9804 9.71596 13.0005 9.61296 13Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'ChevronRightIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M4.38708 13C4.28408 13.0005 4.18203 12.9804 4.08691 12.9409C3.99178 12.9014 3.9055 12.8433 3.83313 12.7701C3.68634 12.6231 3.60388 12.4238 3.60388 12.2161C3.60388 12.0084 3.68634 11.8091 3.83313 11.6622L8.50507 6.99022L3.83313 2.31827C3.69467 2.16968 3.61928 1.97313 3.62287 1.77005C3.62645 1.56698 3.70872 1.37322 3.85234 1.22959C3.99596 1.08597 4.18972 1.00371 4.3928 1.00012C4.59588 0.996539 4.79242 1.07192 4.94102 1.21039L10.1669 6.43628C10.3137 6.58325 10.3962 6.78249 10.3962 6.99022C10.3962 7.19795 10.3137 7.39718 10.1669 7.54416L4.94102 12.7701C4.86865 12.8433 4.78237 12.9014 4.68724 12.9409C4.59212 12.9804 4.49007 13.0005 4.38708 13Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-tabview-tablist-container {\\n position: relative;\\n}\\n\\n.p-tabview-scrollable > .p-tabview-tablist-container {\\n overflow: hidden;\\n}\\n\\n.p-tabview-tablist-scroll-container {\\n overflow-x: auto;\\n overflow-y: hidden;\\n scroll-behavior: smooth;\\n scrollbar-width: none;\\n overscroll-behavior: contain auto;\\n}\\n\\n.p-tabview-tablist-scroll-container::-webkit-scrollbar {\\n display: none;\\n}\\n\\n.p-tabview-tablist {\\n display: flex;\\n margin: 0;\\n padding: 0;\\n list-style-type: none;\\n flex: 1 1 auto;\\n background: \".concat(dt('tabview.tab.list.background'), \";\\n border: 1px solid \").concat(dt('tabview.tab.list.border.color'), \";\\n border-width: 0 0 1px 0;\\n position: relative;\\n}\\n\\n.p-tabview-tab-header {\\n cursor: pointer;\\n user-select: none;\\n display: flex;\\n align-items: center;\\n text-decoration: none;\\n position: relative;\\n overflow: hidden;\\n border-style: solid;\\n border-width: 0 0 1px 0;\\n border-color: transparent transparent \").concat(dt('tabview.tab.border.color'), \" transparent;\\n color: \").concat(dt('tabview.tab.color'), \";\\n padding: 1rem 1.125rem;\\n font-weight: 600;\\n border-top-right-radius: \").concat(dt('border.radius.md'), \";\\n border-top-left-radius: \").concat(dt('border.radius.md'), \";\\n transition: color \").concat(dt('tabview.transition.duration'), \", outline-color \").concat(dt('tabview.transition.duration'), \";\\n margin: 0 0 -1px 0;\\n outline-color: transparent;\\n}\\n\\n.p-tabview-tablist-item:not(.p-disabled) .p-tabview-tab-header:focus-visible {\\n outline: \").concat(dt('focus.ring.width'), \" \").concat(dt('focus.ring.style'), \" \").concat(dt('focus.ring.color'), \";\\n outline-offset: -1px;\\n}\\n\\n.p-tabview-tablist-item:not(.p-highlight):not(.p-disabled):hover > .p-tabview-tab-header {\\n color: \").concat(dt('tabview.tab.hover.color'), \";\\n}\\n\\n.p-tabview-tablist-item.p-highlight > .p-tabview-tab-header {\\n color: \").concat(dt('tabview.tab.active.color'), \";\\n}\\n\\n.p-tabview-tab-title {\\n line-height: 1;\\n white-space: nowrap;\\n}\\n\\n.p-tabview-next-button,\\n.p-tabview-prev-button {\\n position: absolute;\\n top: 0;\\n margin: 0;\\n padding: 0;\\n z-index: 2;\\n height: 100%;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n background: \").concat(dt('tabview.nav.button.background'), \";\\n color: \").concat(dt('tabview.nav.button.color'), \";\\n width: 2.5rem;\\n border-radius: 0;\\n outline-color: transparent;\\n transition: color \").concat(dt('tabview.transition.duration'), \", outline-color \").concat(dt('tabview.transition.duration'), \";\\n box-shadow: \").concat(dt('tabview.nav.button.shadow'), \";\\n border: none;\\n cursor: pointer;\\n user-select: none;\\n}\\n\\n.p-tabview-next-button:focus-visible,\\n.p-tabview-prev-button:focus-visible {\\n outline: \").concat(dt('focus.ring.width'), \" \").concat(dt('focus.ring.style'), \" \").concat(dt('focus.ring.color'), \";\\n outline-offset: \").concat(dt('focus.ring.offset'), \";\\n}\\n\\n.p-tabview-next-button:hover,\\n.p-tabview-prev-button:hover {\\n color: \").concat(dt('tabview.nav.button.hover.color'), \";\\n}\\n\\n.p-tabview-prev-button {\\n left: 0;\\n}\\n\\n.p-tabview-next-button {\\n right: 0;\\n}\\n\\n.p-tabview-panels {\\n background: \").concat(dt('tabview.tab.panel.background'), \";\\n color: \").concat(dt('tabview.tab.panel.color'), \";\\n padding: 0.875rem 1.125rem 1.125rem 1.125rem;\\n}\\n\\n.p-tabview-ink-bar {\\n z-index: 1;\\n display: block;\\n position: absolute;\\n bottom: -1px;\\n height: 1px;\\n background: \").concat(dt('tabview.tab.active.border.color'), \";\\n transition: 250ms cubic-bezier(0.35, 0, 0.25, 1);\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var props = _ref2.props;\n return ['p-tabview p-component', {\n 'p-tabview-scrollable': props.scrollable\n }];\n },\n navContainer: 'p-tabview-tablist-container',\n prevButton: 'p-tabview-prev-button',\n navContent: 'p-tabview-tablist-scroll-container',\n nav: 'p-tabview-tablist',\n tab: {\n header: function header(_ref3) {\n var instance = _ref3.instance,\n tab = _ref3.tab,\n index = _ref3.index;\n return ['p-tabview-tablist-item', instance.getTabProp(tab, 'headerClass'), {\n 'p-tabview-tablist-item-active': instance.d_activeIndex === index,\n 'p-disabled': instance.getTabProp(tab, 'disabled')\n }];\n },\n headerAction: 'p-tabview-tab-header',\n headerTitle: 'p-tabview-tab-title',\n content: function content(_ref4) {\n var instance = _ref4.instance,\n tab = _ref4.tab;\n return ['p-tabview-panel', instance.getTabProp(tab, 'contentClass')];\n }\n },\n inkbar: 'p-tabview-ink-bar',\n nextButton: 'p-tabview-next-button',\n panelContainer: 'p-tabview-panels'\n};\nvar TabViewStyle = BaseStyle.extend({\n name: 'tabview',\n theme: theme,\n classes: classes\n});\n\nexport { TabViewStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { UniqueComponentId } from '@primevue/core/utils';\nimport { getWidth, getAttribute, findSingle, focus, getOffset } from '@primeuix/utils/dom';\nimport ChevronLeftIcon from '@primevue/icons/chevronleft';\nimport ChevronRightIcon from '@primevue/icons/chevronright';\nimport Ripple from 'primevue/ripple';\nimport { mergeProps, resolveDirective, openBlock, createElementBlock, createElementVNode, withDirectives, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, Fragment, renderList, toDisplayString, vShow } from 'vue';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport TabViewStyle from 'primevue/tabview/style';\n\nvar script$1 = {\n name: 'BaseTabView',\n \"extends\": BaseComponent,\n props: {\n activeIndex: {\n type: Number,\n \"default\": 0\n },\n lazy: {\n type: Boolean,\n \"default\": false\n },\n scrollable: {\n type: Boolean,\n \"default\": false\n },\n tabindex: {\n type: Number,\n \"default\": 0\n },\n selectOnFocus: {\n type: Boolean,\n \"default\": false\n },\n prevButtonProps: {\n type: null,\n \"default\": null\n },\n nextButtonProps: {\n type: null,\n \"default\": null\n },\n prevIcon: {\n type: String,\n \"default\": undefined\n },\n nextIcon: {\n type: String,\n \"default\": undefined\n }\n },\n style: TabViewStyle,\n provide: function provide() {\n return {\n $pcTabs: undefined,\n // Backwards compatible to prevent component from breaking\n $pcTabView: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'TabView',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['update:activeIndex', 'tab-change', 'tab-click'],\n data: function data() {\n return {\n id: this.$attrs.id,\n d_activeIndex: this.activeIndex,\n isPrevButtonDisabled: true,\n isNextButtonDisabled: false\n };\n },\n watch: {\n '$attrs.id': function $attrsId(newValue) {\n this.id = newValue || UniqueComponentId();\n },\n activeIndex: function activeIndex(newValue) {\n this.d_activeIndex = newValue;\n this.scrollInView({\n index: newValue\n });\n }\n },\n mounted: function mounted() {\n console.warn('Deprecated since v4. Use Tabs component instead.');\n this.id = this.id || UniqueComponentId();\n this.updateInkBar();\n this.scrollable && this.updateButtonState();\n },\n updated: function updated() {\n this.updateInkBar();\n this.scrollable && this.updateButtonState();\n },\n methods: {\n isTabPanel: function isTabPanel(child) {\n return child.type.name === 'TabPanel';\n },\n isTabActive: function isTabActive(index) {\n return this.d_activeIndex === index;\n },\n getTabProp: function getTabProp(tab, name) {\n return tab.props ? tab.props[name] : undefined;\n },\n getKey: function getKey(tab, index) {\n return this.getTabProp(tab, 'header') || index;\n },\n getTabHeaderActionId: function getTabHeaderActionId(index) {\n return \"\".concat(this.id, \"_\").concat(index, \"_header_action\");\n },\n getTabContentId: function getTabContentId(index) {\n return \"\".concat(this.id, \"_\").concat(index, \"_content\");\n },\n getTabPT: function getTabPT(tab, key, index) {\n var count = this.tabs.length;\n var tabMetaData = {\n props: tab.props,\n parent: {\n instance: this,\n props: this.$props,\n state: this.$data\n },\n context: {\n index: index,\n count: count,\n first: index === 0,\n last: index === count - 1,\n active: this.isTabActive(index)\n }\n };\n return mergeProps(this.ptm(\"tabpanel.\".concat(key), {\n tabpanel: tabMetaData\n }), this.ptm(\"tabpanel.\".concat(key), tabMetaData), this.ptmo(this.getTabProp(tab, 'pt'), key, tabMetaData));\n },\n onScroll: function onScroll(event) {\n this.scrollable && this.updateButtonState();\n event.preventDefault();\n },\n onPrevButtonClick: function onPrevButtonClick() {\n var content = this.$refs.content;\n var width = getWidth(content);\n var pos = content.scrollLeft - width;\n content.scrollLeft = pos <= 0 ? 0 : pos;\n },\n onNextButtonClick: function onNextButtonClick() {\n var content = this.$refs.content;\n var width = getWidth(content) - this.getVisibleButtonWidths();\n var pos = content.scrollLeft + width;\n var lastPos = content.scrollWidth - width;\n content.scrollLeft = pos >= lastPos ? lastPos : pos;\n },\n onTabClick: function onTabClick(event, tab, index) {\n this.changeActiveIndex(event, tab, index);\n this.$emit('tab-click', {\n originalEvent: event,\n index: index\n });\n },\n onTabKeyDown: function onTabKeyDown(event, tab, index) {\n switch (event.code) {\n case 'ArrowLeft':\n this.onTabArrowLeftKey(event);\n break;\n case 'ArrowRight':\n this.onTabArrowRightKey(event);\n break;\n case 'Home':\n this.onTabHomeKey(event);\n break;\n case 'End':\n this.onTabEndKey(event);\n break;\n case 'PageDown':\n this.onPageDownKey(event);\n break;\n case 'PageUp':\n this.onPageUpKey(event);\n break;\n case 'Enter':\n case 'NumpadEnter':\n case 'Space':\n this.onTabEnterKey(event, tab, index);\n break;\n }\n },\n onTabArrowRightKey: function onTabArrowRightKey(event) {\n var nextHeaderAction = this.findNextHeaderAction(event.target.parentElement);\n nextHeaderAction ? this.changeFocusedTab(event, nextHeaderAction) : this.onTabHomeKey(event);\n event.preventDefault();\n },\n onTabArrowLeftKey: function onTabArrowLeftKey(event) {\n var prevHeaderAction = this.findPrevHeaderAction(event.target.parentElement);\n prevHeaderAction ? this.changeFocusedTab(event, prevHeaderAction) : this.onTabEndKey(event);\n event.preventDefault();\n },\n onTabHomeKey: function onTabHomeKey(event) {\n var firstHeaderAction = this.findFirstHeaderAction();\n this.changeFocusedTab(event, firstHeaderAction);\n event.preventDefault();\n },\n onTabEndKey: function onTabEndKey(event) {\n var lastHeaderAction = this.findLastHeaderAction();\n this.changeFocusedTab(event, lastHeaderAction);\n event.preventDefault();\n },\n onPageDownKey: function onPageDownKey(event) {\n this.scrollInView({\n index: this.$refs.nav.children.length - 2\n });\n event.preventDefault();\n },\n onPageUpKey: function onPageUpKey(event) {\n this.scrollInView({\n index: 0\n });\n event.preventDefault();\n },\n onTabEnterKey: function onTabEnterKey(event, tab, index) {\n this.changeActiveIndex(event, tab, index);\n event.preventDefault();\n },\n findNextHeaderAction: function findNextHeaderAction(tabElement) {\n var selfCheck = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var headerElement = selfCheck ? tabElement : tabElement.nextElementSibling;\n return headerElement ? getAttribute(headerElement, 'data-p-disabled') || getAttribute(headerElement, 'data-pc-section') === 'inkbar' ? this.findNextHeaderAction(headerElement) : findSingle(headerElement, '[data-pc-section=\"headeraction\"]') : null;\n },\n findPrevHeaderAction: function findPrevHeaderAction(tabElement) {\n var selfCheck = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var headerElement = selfCheck ? tabElement : tabElement.previousElementSibling;\n return headerElement ? getAttribute(headerElement, 'data-p-disabled') || getAttribute(headerElement, 'data-pc-section') === 'inkbar' ? this.findPrevHeaderAction(headerElement) : findSingle(headerElement, '[data-pc-section=\"headeraction\"]') : null;\n },\n findFirstHeaderAction: function findFirstHeaderAction() {\n return this.findNextHeaderAction(this.$refs.nav.firstElementChild, true);\n },\n findLastHeaderAction: function findLastHeaderAction() {\n return this.findPrevHeaderAction(this.$refs.nav.lastElementChild, true);\n },\n changeActiveIndex: function changeActiveIndex(event, tab, index) {\n if (!this.getTabProp(tab, 'disabled') && this.d_activeIndex !== index) {\n this.d_activeIndex = index;\n this.$emit('update:activeIndex', index);\n this.$emit('tab-change', {\n originalEvent: event,\n index: index\n });\n this.scrollInView({\n index: index\n });\n }\n },\n changeFocusedTab: function changeFocusedTab(event, element) {\n if (element) {\n focus(element);\n this.scrollInView({\n element: element\n });\n if (this.selectOnFocus) {\n var index = parseInt(element.parentElement.dataset.pcIndex, 10);\n var tab = this.tabs[index];\n this.changeActiveIndex(event, tab, index);\n }\n }\n },\n scrollInView: function scrollInView(_ref) {\n var element = _ref.element,\n _ref$index = _ref.index,\n index = _ref$index === void 0 ? -1 : _ref$index;\n var currentElement = element || this.$refs.nav.children[index];\n if (currentElement) {\n currentElement.scrollIntoView && currentElement.scrollIntoView({\n block: 'nearest'\n });\n }\n },\n updateInkBar: function updateInkBar() {\n var tabHeader = this.$refs.nav.children[this.d_activeIndex];\n this.$refs.inkbar.style.width = getWidth(tabHeader) + 'px';\n this.$refs.inkbar.style.left = getOffset(tabHeader).left - getOffset(this.$refs.nav).left + 'px';\n },\n updateButtonState: function updateButtonState() {\n var content = this.$refs.content;\n var scrollLeft = content.scrollLeft,\n scrollWidth = content.scrollWidth;\n var width = getWidth(content);\n this.isPrevButtonDisabled = scrollLeft === 0;\n this.isNextButtonDisabled = parseInt(scrollLeft) === scrollWidth - width;\n },\n getVisibleButtonWidths: function getVisibleButtonWidths() {\n var _this$$refs = this.$refs,\n prevBtn = _this$$refs.prevBtn,\n nextBtn = _this$$refs.nextBtn;\n return [prevBtn, nextBtn].reduce(function (acc, el) {\n return el ? acc + getWidth(el) : acc;\n }, 0);\n }\n },\n computed: {\n tabs: function tabs() {\n var _this = this;\n return this.$slots[\"default\"]().reduce(function (tabs, child) {\n if (_this.isTabPanel(child)) {\n tabs.push(child);\n } else if (child.children && child.children instanceof Array) {\n child.children.forEach(function (nestedChild) {\n if (_this.isTabPanel(nestedChild)) {\n tabs.push(nestedChild);\n }\n });\n }\n return tabs;\n }, []);\n },\n prevButtonAriaLabel: function prevButtonAriaLabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.previous : undefined;\n },\n nextButtonAriaLabel: function nextButtonAriaLabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.next : undefined;\n }\n },\n directives: {\n ripple: Ripple\n },\n components: {\n ChevronLeftIcon: ChevronLeftIcon,\n ChevronRightIcon: ChevronRightIcon\n }\n};\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar _hoisted_1 = [\"tabindex\", \"aria-label\"];\nvar _hoisted_2 = [\"data-p-active\", \"data-p-disabled\", \"data-pc-index\"];\nvar _hoisted_3 = [\"id\", \"tabindex\", \"aria-disabled\", \"aria-selected\", \"aria-controls\", \"onClick\", \"onKeydown\"];\nvar _hoisted_4 = [\"tabindex\", \"aria-label\"];\nvar _hoisted_5 = [\"id\", \"aria-labelledby\", \"data-pc-index\", \"data-p-active\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _directive_ripple = resolveDirective(\"ripple\");\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root'),\n role: \"tablist\"\n }, _ctx.ptmi('root')), [createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('navContainer')\n }, _ctx.ptm('navContainer')), [_ctx.scrollable && !$data.isPrevButtonDisabled ? withDirectives((openBlock(), createElementBlock(\"button\", mergeProps({\n key: 0,\n ref: \"prevBtn\",\n type: \"button\",\n \"class\": _ctx.cx('prevButton'),\n tabindex: _ctx.tabindex,\n \"aria-label\": $options.prevButtonAriaLabel,\n onClick: _cache[0] || (_cache[0] = function () {\n return $options.onPrevButtonClick && $options.onPrevButtonClick.apply($options, arguments);\n })\n }, _objectSpread(_objectSpread({}, _ctx.prevButtonProps), _ctx.ptm('prevButton')), {\n \"data-pc-group-section\": \"navbutton\"\n }), [renderSlot(_ctx.$slots, \"previcon\", {}, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.prevIcon ? 'span' : 'ChevronLeftIcon'), mergeProps({\n \"aria-hidden\": \"true\",\n \"class\": _ctx.prevIcon\n }, _ctx.ptm('prevIcon')), null, 16, [\"class\"]))];\n })], 16, _hoisted_1)), [[_directive_ripple]]) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n ref: \"content\",\n \"class\": _ctx.cx('navContent'),\n onScroll: _cache[1] || (_cache[1] = function () {\n return $options.onScroll && $options.onScroll.apply($options, arguments);\n })\n }, _ctx.ptm('navContent')), [createElementVNode(\"ul\", mergeProps({\n ref: \"nav\",\n \"class\": _ctx.cx('nav')\n }, _ctx.ptm('nav')), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.tabs, function (tab, index) {\n return openBlock(), createElementBlock(\"li\", mergeProps({\n key: $options.getKey(tab, index),\n style: $options.getTabProp(tab, 'headerStyle'),\n \"class\": _ctx.cx('tab.header', {\n tab: tab,\n index: index\n }),\n role: \"presentation\",\n ref_for: true\n }, _objectSpread(_objectSpread(_objectSpread({}, $options.getTabProp(tab, 'headerProps')), $options.getTabPT(tab, 'root', index)), $options.getTabPT(tab, 'header', index)), {\n \"data-pc-name\": \"tabpanel\",\n \"data-p-active\": $data.d_activeIndex === index,\n \"data-p-disabled\": $options.getTabProp(tab, 'disabled'),\n \"data-pc-index\": index\n }), [withDirectives((openBlock(), createElementBlock(\"a\", mergeProps({\n id: $options.getTabHeaderActionId(index),\n \"class\": _ctx.cx('tab.headerAction'),\n tabindex: $options.getTabProp(tab, 'disabled') || !$options.isTabActive(index) ? -1 : _ctx.tabindex,\n role: \"tab\",\n \"aria-disabled\": $options.getTabProp(tab, 'disabled'),\n \"aria-selected\": $options.isTabActive(index),\n \"aria-controls\": $options.getTabContentId(index),\n onClick: function onClick($event) {\n return $options.onTabClick($event, tab, index);\n },\n onKeydown: function onKeydown($event) {\n return $options.onTabKeyDown($event, tab, index);\n },\n ref_for: true\n }, _objectSpread(_objectSpread({}, $options.getTabProp(tab, 'headerActionProps')), $options.getTabPT(tab, 'headerAction', index))), [tab.props && tab.props.header ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('tab.headerTitle'),\n ref_for: true\n }, $options.getTabPT(tab, 'headerTitle', index)), toDisplayString(tab.props.header), 17)) : createCommentVNode(\"\", true), tab.children && tab.children.header ? (openBlock(), createBlock(resolveDynamicComponent(tab.children.header), {\n key: 1\n })) : createCommentVNode(\"\", true)], 16, _hoisted_3)), [[_directive_ripple]])], 16, _hoisted_2);\n }), 128)), createElementVNode(\"li\", mergeProps({\n ref: \"inkbar\",\n \"class\": _ctx.cx('inkbar'),\n role: \"presentation\",\n \"aria-hidden\": \"true\"\n }, _ctx.ptm('inkbar')), null, 16)], 16)], 16), _ctx.scrollable && !$data.isNextButtonDisabled ? withDirectives((openBlock(), createElementBlock(\"button\", mergeProps({\n key: 1,\n ref: \"nextBtn\",\n type: \"button\",\n \"class\": _ctx.cx('nextButton'),\n tabindex: _ctx.tabindex,\n \"aria-label\": $options.nextButtonAriaLabel,\n onClick: _cache[2] || (_cache[2] = function () {\n return $options.onNextButtonClick && $options.onNextButtonClick.apply($options, arguments);\n })\n }, _objectSpread(_objectSpread({}, _ctx.nextButtonProps), _ctx.ptm('nextButton')), {\n \"data-pc-group-section\": \"navbutton\"\n }), [renderSlot(_ctx.$slots, \"nexticon\", {}, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.nextIcon ? 'span' : 'ChevronRightIcon'), mergeProps({\n \"aria-hidden\": \"true\",\n \"class\": _ctx.nextIcon\n }, _ctx.ptm('nextIcon')), null, 16, [\"class\"]))];\n })], 16, _hoisted_4)), [[_directive_ripple]]) : createCommentVNode(\"\", true)], 16), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('panelContainer')\n }, _ctx.ptm('panelContainer')), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.tabs, function (tab, index) {\n return openBlock(), createElementBlock(Fragment, {\n key: $options.getKey(tab, index)\n }, [(_ctx.lazy ? $options.isTabActive(index) : true) ? withDirectives((openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n id: $options.getTabContentId(index),\n style: $options.getTabProp(tab, 'contentStyle'),\n \"class\": _ctx.cx('tab.content', {\n tab: tab\n }),\n role: \"tabpanel\",\n \"aria-labelledby\": $options.getTabHeaderActionId(index),\n ref_for: true\n }, _objectSpread(_objectSpread(_objectSpread({}, $options.getTabProp(tab, 'contentProps')), $options.getTabPT(tab, 'root', index)), $options.getTabPT(tab, 'content', index)), {\n \"data-pc-name\": \"tabpanel\",\n \"data-pc-index\": index,\n \"data-p-active\": $data.d_activeIndex === index\n }), [(openBlock(), createBlock(resolveDynamicComponent(tab)))], 16, _hoisted_5)), [[vShow, _ctx.lazy ? true : $options.isTabActive(index)]]) : createCommentVNode(\"\", true)], 64);\n }), 128))], 16)], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","\n\n\n","\n\n\n","import { defineStore } from 'pinia'\nimport { computed, markRaw, ref } from 'vue'\n\nimport type { ComfyExtension } from '@/types/comfy'\n\n/**\n * These extensions are always active, even if they are disabled in the setting.\n */\nexport const ALWAYS_ENABLED_EXTENSIONS: readonly string[] = []\n\nexport const ALWAYS_DISABLED_EXTENSIONS: readonly string[] = [\n // pysssss.Locking is replaced by pin/unpin in ComfyUI core.\n // https://github.com/Comfy-Org/litegraph.js/pull/117\n 'pysssss.Locking',\n // pysssss.SnapToGrid is replaced by Comfy.Graph.AlwaysSnapToGrid in ComfyUI core.\n // pysssss.SnapToGrid tries to write global app.shiftDown state, which is no longer\n // allowed since v1.3.12.\n // https://github.com/Comfy-Org/ComfyUI_frontend/issues/1176\n 'pysssss.SnapToGrid'\n]\n\nexport const useExtensionStore = defineStore('extension', () => {\n // For legacy reasons, the name uniquely identifies an extension\n const extensionByName = ref>({})\n const extensions = computed(() => Object.values(extensionByName.value))\n // Not using computed because disable extension requires reloading of the page.\n // Dynamically update this list won't affect extensions that are already loaded.\n const disabledExtensionNames = ref>(new Set())\n\n // Disabled extension names that are currently not in the extension list.\n // If a node pack is disabled in the backend, we shouldn't remove the configuration\n // of the frontend extension disable list, in case the node pack is re-enabled.\n const inactiveDisabledExtensionNames = computed(() => {\n return Array.from(disabledExtensionNames.value).filter(\n (name) => !(name in extensionByName.value)\n )\n })\n\n const isExtensionEnabled = (name: string) =>\n !disabledExtensionNames.value.has(name)\n const enabledExtensions = computed(() => {\n return extensions.value.filter((ext) => isExtensionEnabled(ext.name))\n })\n\n function isExtensionReadOnly(name: string) {\n return (\n ALWAYS_DISABLED_EXTENSIONS.includes(name) ||\n ALWAYS_ENABLED_EXTENSIONS.includes(name)\n )\n }\n\n function registerExtension(extension: ComfyExtension) {\n if (!extension.name) {\n throw new Error(\"Extensions must have a 'name' property.\")\n }\n\n if (extensionByName.value[extension.name]) {\n throw new Error(`Extension named '${extension.name}' already registered.`)\n }\n\n if (disabledExtensionNames.value.has(extension.name)) {\n console.log(`Extension ${extension.name} is disabled.`)\n }\n\n extensionByName.value[extension.name] = markRaw(extension)\n }\n\n function loadDisabledExtensionNames(names: string[]) {\n disabledExtensionNames.value = new Set(names)\n for (const name of ALWAYS_DISABLED_EXTENSIONS) {\n disabledExtensionNames.value.add(name)\n }\n for (const name of ALWAYS_ENABLED_EXTENSIONS) {\n disabledExtensionNames.value.delete(name)\n }\n }\n\n /**\n * Core extensions are extensions that are defined in the core package.\n * See /extensions/core/index.ts for the list.\n */\n const coreExtensionNames = ref([])\n function captureCoreExtensions() {\n coreExtensionNames.value = extensions.value.map((ext) => ext.name)\n }\n\n function isCoreExtension(name: string) {\n return coreExtensionNames.value.includes(name)\n }\n\n const hasThirdPartyExtensions = computed(() => {\n return extensions.value.some((ext) => !isCoreExtension(ext.name))\n })\n\n return {\n extensions,\n enabledExtensions,\n inactiveDisabledExtensionNames,\n isExtensionEnabled,\n isExtensionReadOnly,\n registerExtension,\n loadDisabledExtensionNames,\n captureCoreExtensions,\n isCoreExtension,\n hasThirdPartyExtensions\n }\n})\n","import { defineStore } from 'pinia'\nimport { ref } from 'vue'\n\nimport { api } from '@/scripts/api'\nimport type { SystemStats } from '@/types/apiTypes'\n\nexport const useSystemStatsStore = defineStore('systemStats', () => {\n const systemStats = ref(null)\n const isLoading = ref(false)\n const error = ref(null)\n\n async function fetchSystemStats() {\n isLoading.value = true\n error.value = null\n\n try {\n systemStats.value = await api.getSystemStats()\n } catch (err) {\n error.value =\n err instanceof Error\n ? err.message\n : 'An error occurred while fetching system stats'\n console.error('Error fetching system stats:', err)\n } finally {\n isLoading.value = false\n }\n }\n\n return {\n systemStats,\n isLoading,\n error,\n fetchSystemStats\n }\n})\n","import { defineStore } from 'pinia'\nimport { computed } from 'vue'\n\nimport { AboutPageBadge } from '@/types/comfy'\nimport { electronAPI, isElectron } from '@/utils/envUtil'\n\nimport { useExtensionStore } from './extensionStore'\nimport { useSystemStatsStore } from './systemStatsStore'\n\nexport const useAboutPanelStore = defineStore('aboutPanel', () => {\n const frontendVersion = __COMFYUI_FRONTEND_VERSION__\n const extensionStore = useExtensionStore()\n const systemStatsStore = useSystemStatsStore()\n const coreVersion = computed(\n () => systemStatsStore?.systemStats?.system?.comfyui_version ?? ''\n )\n\n const coreBadges = computed(() => [\n // In electron, the ComfyUI is packaged without the git repo,\n // so the python server's API doesn't have the version info.\n {\n label: `ComfyUI ${\n isElectron()\n ? 'v' + electronAPI().getComfyUIVersion()\n : coreVersion.value\n }`,\n url: 'https://github.com/comfyanonymous/ComfyUI',\n icon: 'pi pi-github'\n },\n {\n label: `ComfyUI_frontend v${frontendVersion}`,\n url: 'https://github.com/Comfy-Org/ComfyUI_frontend',\n icon: 'pi pi-github'\n },\n {\n label: 'Discord',\n url: 'https://www.comfy.org/discord',\n icon: 'pi pi-discord'\n },\n { label: 'ComfyOrg', url: 'https://www.comfy.org/', icon: 'pi pi-globe' }\n ])\n\n const allBadges = computed(() => [\n ...coreBadges.value,\n ...extensionStore.extensions.flatMap((e) => e.aboutPageBadges ?? [])\n ])\n\n return {\n badges: allBadges\n }\n})\n","\n\n\n","\n\n\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'ChevronDownIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M7.01744 10.398C6.91269 10.3985 6.8089 10.378 6.71215 10.3379C6.61541 10.2977 6.52766 10.2386 6.45405 10.1641L1.13907 4.84913C1.03306 4.69404 0.985221 4.5065 1.00399 4.31958C1.02276 4.13266 1.10693 3.95838 1.24166 3.82747C1.37639 3.69655 1.55301 3.61742 1.74039 3.60402C1.92777 3.59062 2.11386 3.64382 2.26584 3.75424L7.01744 8.47394L11.769 3.75424C11.9189 3.65709 12.097 3.61306 12.2748 3.62921C12.4527 3.64535 12.6199 3.72073 12.7498 3.84328C12.8797 3.96582 12.9647 4.12842 12.9912 4.30502C13.0177 4.48162 12.9841 4.662 12.8958 4.81724L7.58083 10.1322C7.50996 10.2125 7.42344 10.2775 7.32656 10.3232C7.22968 10.3689 7.12449 10.3944 7.01744 10.398Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import { EventBus } from '@primeuix/utils/eventbus';\n\nvar OverlayEventBus = EventBus();\n\nexport { OverlayEventBus as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-select {\\n display: inline-flex;\\n cursor: pointer;\\n position: relative;\\n user-select: none;\\n background: \".concat(dt('select.background'), \";\\n border: 1px solid \").concat(dt('select.border.color'), \";\\n transition: background \").concat(dt('select.transition.duration'), \", color \").concat(dt('select.transition.duration'), \", border-color \").concat(dt('select.transition.duration'), \",\\n outline-color \").concat(dt('select.transition.duration'), \", box-shadow \").concat(dt('select.transition.duration'), \";\\n border-radius: \").concat(dt('select.border.radius'), \";\\n outline-color: transparent;\\n box-shadow: \").concat(dt('select.shadow'), \";\\n}\\n\\n.p-select:not(.p-disabled):hover {\\n border-color: \").concat(dt('select.hover.border.color'), \";\\n}\\n\\n.p-select:not(.p-disabled).p-focus {\\n border-color: \").concat(dt('select.focus.border.color'), \";\\n box-shadow: \").concat(dt('select.focus.ring.shadow'), \";\\n outline: \").concat(dt('select.focus.ring.width'), \" \").concat(dt('select.focus.ring.style'), \" \").concat(dt('select.focus.ring.color'), \";\\n outline-offset: \").concat(dt('select.focus.ring.offset'), \";\\n}\\n\\n.p-select.p-variant-filled {\\n background: \").concat(dt('select.filled.background'), \";\\n}\\n\\n.p-select.p-variant-filled:not(.p-disabled):hover {\\n background: \").concat(dt('select.filled.hover.background'), \";\\n}\\n\\n.p-select.p-variant-filled:not(.p-disabled).p-focus {\\n background: \").concat(dt('select.filled.focus.background'), \";\\n}\\n\\n.p-select.p-invalid {\\n border-color: \").concat(dt('select.invalid.border.color'), \";\\n}\\n\\n.p-select.p-disabled {\\n opacity: 1;\\n background: \").concat(dt('select.disabled.background'), \";\\n}\\n\\n.p-select-clear-icon {\\n position: absolute;\\n top: 50%;\\n margin-top: -0.5rem;\\n color: \").concat(dt('select.clear.icon.color'), \";\\n inset-inline-end: \").concat(dt('select.dropdown.width'), \";\\n}\\n\\n.p-select-dropdown {\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n flex-shrink: 0;\\n background: transparent;\\n color: \").concat(dt('select.dropdown.color'), \";\\n width: \").concat(dt('select.dropdown.width'), \";\\n border-start-end-radius: \").concat(dt('select.border.radius'), \";\\n border-end-end-radius: \").concat(dt('select.border.radius'), \";\\n}\\n\\n.p-select-label {\\n display: block;\\n white-space: nowrap;\\n overflow: hidden;\\n flex: 1 1 auto;\\n width: 1%;\\n padding: \").concat(dt('select.padding.y'), \" \").concat(dt('select.padding.x'), \";\\n text-overflow: ellipsis;\\n cursor: pointer;\\n color: \").concat(dt('select.color'), \";\\n background: transparent;\\n border: 0 none;\\n outline: 0 none;\\n}\\n\\n.p-select-label.p-placeholder {\\n color: \").concat(dt('select.placeholder.color'), \";\\n}\\n\\n.p-select.p-invalid .p-select-label.p-placeholder {\\n color: \").concat(dt('select.invalid.placeholder.color'), \";\\n}\\n\\n.p-select:has(.p-select-clear-icon) .p-select-label {\\n padding-inline-end: calc(1rem + \").concat(dt('select.padding.x'), \");\\n}\\n\\n.p-select.p-disabled .p-select-label {\\n color: \").concat(dt('select.disabled.color'), \";\\n}\\n\\n.p-select-label-empty {\\n overflow: hidden;\\n opacity: 0;\\n}\\n\\ninput.p-select-label {\\n cursor: default;\\n}\\n\\n.p-select .p-select-overlay {\\n min-width: 100%;\\n}\\n\\n.p-select-overlay {\\n position: absolute;\\n top: 0;\\n left: 0;\\n background: \").concat(dt('select.overlay.background'), \";\\n color: \").concat(dt('select.overlay.color'), \";\\n border: 1px solid \").concat(dt('select.overlay.border.color'), \";\\n border-radius: \").concat(dt('select.overlay.border.radius'), \";\\n box-shadow: \").concat(dt('select.overlay.shadow'), \";\\n}\\n\\n.p-select-header {\\n padding: \").concat(dt('select.list.header.padding'), \";\\n}\\n\\n.p-select-filter {\\n width: 100%;\\n}\\n\\n.p-select-list-container {\\n overflow: auto;\\n}\\n\\n.p-select-option-group {\\n cursor: auto;\\n margin: 0;\\n padding: \").concat(dt('select.option.group.padding'), \";\\n background: \").concat(dt('select.option.group.background'), \";\\n color: \").concat(dt('select.option.group.color'), \";\\n font-weight: \").concat(dt('select.option.group.font.weight'), \";\\n}\\n\\n.p-select-list {\\n margin: 0;\\n padding: 0;\\n list-style-type: none;\\n padding: \").concat(dt('select.list.padding'), \";\\n gap: \").concat(dt('select.list.gap'), \";\\n display: flex;\\n flex-direction: column;\\n}\\n\\n.p-select-option {\\n cursor: pointer;\\n font-weight: normal;\\n white-space: nowrap;\\n position: relative;\\n overflow: hidden;\\n display: flex;\\n align-items: center;\\n padding: \").concat(dt('select.option.padding'), \";\\n border: 0 none;\\n color: \").concat(dt('select.option.color'), \";\\n background: transparent;\\n transition: background \").concat(dt('select.transition.duration'), \", color \").concat(dt('select.transition.duration'), \", border-color \").concat(dt('select.transition.duration'), \",\\n box-shadow \").concat(dt('select.transition.duration'), \", outline-color \").concat(dt('select.transition.duration'), \";\\n border-radius: \").concat(dt('select.option.border.radius'), \";\\n}\\n\\n.p-select-option:not(.p-select-option-selected):not(.p-disabled).p-focus {\\n background: \").concat(dt('select.option.focus.background'), \";\\n color: \").concat(dt('select.option.focus.color'), \";\\n}\\n\\n.p-select-option.p-select-option-selected {\\n background: \").concat(dt('select.option.selected.background'), \";\\n color: \").concat(dt('select.option.selected.color'), \";\\n}\\n\\n.p-select-option.p-select-option-selected.p-focus {\\n background: \").concat(dt('select.option.selected.focus.background'), \";\\n color: \").concat(dt('select.option.selected.focus.color'), \";\\n}\\n\\n.p-select-option-check-icon {\\n position: relative;\\n margin-inline-start: \").concat(dt('select.checkmark.gutter.start'), \";\\n margin-inline-end: \").concat(dt('select.checkmark.gutter.end'), \";\\n color: \").concat(dt('select.checkmark.color'), \";\\n}\\n\\n.p-select-empty-message {\\n padding: \").concat(dt('select.empty.message.padding'), \";\\n}\\n\\n.p-select-fluid {\\n display: flex;\\n width: 100%;\\n}\\n\\n.p-select-sm .p-select-label {\\n font-size: \").concat(dt('select.sm.font.size'), \";\\n padding-block: \").concat(dt('select.sm.padding.y'), \";\\n padding-inline: \").concat(dt('select.sm.padding.x'), \";\\n}\\n\\n.p-select-sm .p-select-dropdown .p-icon {\\n font-size: \").concat(dt('select.sm.font.size'), \";\\n width: \").concat(dt('select.sm.font.size'), \";\\n height: \").concat(dt('select.sm.font.size'), \";\\n}\\n\\n.p-select-lg .p-select-label {\\n font-size: \").concat(dt('select.lg.font.size'), \";\\n padding-block: \").concat(dt('select.lg.padding.y'), \";\\n padding-inline: \").concat(dt('select.lg.padding.x'), \";\\n}\\n\\n.p-select-lg .p-select-dropdown .p-icon {\\n font-size: \").concat(dt('select.lg.font.size'), \";\\n width: \").concat(dt('select.lg.font.size'), \";\\n height: \").concat(dt('select.lg.font.size'), \";\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var instance = _ref2.instance,\n props = _ref2.props,\n state = _ref2.state;\n return ['p-select p-component p-inputwrapper', {\n 'p-disabled': props.disabled,\n 'p-invalid': instance.$invalid,\n 'p-variant-filled': instance.$variant === 'filled',\n 'p-focus': state.focused,\n 'p-inputwrapper-filled': instance.$filled,\n 'p-inputwrapper-focus': state.focused || state.overlayVisible,\n 'p-select-open': state.overlayVisible,\n 'p-select-fluid': instance.$fluid,\n 'p-select-sm p-inputfield-sm': props.size === 'small',\n 'p-select-lg p-inputfield-lg': props.size === 'large'\n }];\n },\n label: function label(_ref3) {\n var instance = _ref3.instance,\n props = _ref3.props;\n return ['p-select-label', {\n 'p-placeholder': !props.editable && instance.label === props.placeholder,\n 'p-select-label-empty': !props.editable && !instance.$slots['value'] && (instance.label === 'p-emptylabel' || instance.label.length === 0)\n }];\n },\n clearIcon: 'p-select-clear-icon',\n dropdown: 'p-select-dropdown',\n loadingicon: 'p-select-loading-icon',\n dropdownIcon: 'p-select-dropdown-icon',\n overlay: 'p-select-overlay p-component',\n header: 'p-select-header',\n pcFilter: 'p-select-filter',\n listContainer: 'p-select-list-container',\n list: 'p-select-list',\n optionGroup: 'p-select-option-group',\n optionGroupLabel: 'p-select-option-group-label',\n option: function option(_ref4) {\n var instance = _ref4.instance,\n props = _ref4.props,\n state = _ref4.state,\n _option = _ref4.option,\n focusedOption = _ref4.focusedOption;\n return ['p-select-option', {\n 'p-select-option-selected': instance.isSelected(_option) && props.highlightOnSelect,\n 'p-focus': state.focusedOptionIndex === focusedOption,\n 'p-disabled': instance.isOptionDisabled(_option)\n }];\n },\n optionLabel: 'p-select-option-label',\n optionCheckIcon: 'p-select-option-check-icon',\n optionBlankIcon: 'p-select-option-blank-icon',\n emptyMessage: 'p-select-empty-message'\n};\nvar SelectStyle = BaseStyle.extend({\n name: 'select',\n theme: theme,\n classes: classes\n});\n\nexport { SelectStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { focus, isAndroid, getFirstFocusableElement, getLastFocusableElement, addStyle, relativePosition, getOuterWidth, absolutePosition, isTouchDevice, isVisible, getFocusableElements, findSingle } from '@primeuix/utils/dom';\nimport { resolveFieldData, isPrintableCharacter, isNotEmpty, equals, findLastIndex } from '@primeuix/utils/object';\nimport { ZIndex } from '@primeuix/utils/zindex';\nimport { FilterService } from '@primevue/core/api';\nimport { UniqueComponentId, ConnectedOverlayScrollHandler } from '@primevue/core/utils';\nimport BlankIcon from '@primevue/icons/blank';\nimport CheckIcon from '@primevue/icons/check';\nimport ChevronDownIcon from '@primevue/icons/chevrondown';\nimport SearchIcon from '@primevue/icons/search';\nimport SpinnerIcon from '@primevue/icons/spinner';\nimport TimesIcon from '@primevue/icons/times';\nimport IconField from 'primevue/iconfield';\nimport InputIcon from 'primevue/inputicon';\nimport InputText from 'primevue/inputtext';\nimport OverlayEventBus from 'primevue/overlayeventbus';\nimport Portal from 'primevue/portal';\nimport Ripple from 'primevue/ripple';\nimport VirtualScroller from 'primevue/virtualscroller';\nimport BaseInput from '@primevue/core/baseinput';\nimport SelectStyle from 'primevue/select/style';\nimport { resolveComponent, resolveDirective, openBlock, createElementBlock, mergeProps, renderSlot, createTextVNode, toDisplayString, normalizeClass, createBlock, resolveDynamicComponent, createCommentVNode, createElementVNode, createVNode, withCtx, Transition, normalizeProps, createSlots, Fragment, renderList, withDirectives } from 'vue';\n\nvar script$1 = {\n name: 'BaseSelect',\n \"extends\": BaseInput,\n props: {\n options: Array,\n optionLabel: [String, Function],\n optionValue: [String, Function],\n optionDisabled: [String, Function],\n optionGroupLabel: [String, Function],\n optionGroupChildren: [String, Function],\n scrollHeight: {\n type: String,\n \"default\": '14rem'\n },\n filter: Boolean,\n filterPlaceholder: String,\n filterLocale: String,\n filterMatchMode: {\n type: String,\n \"default\": 'contains'\n },\n filterFields: {\n type: Array,\n \"default\": null\n },\n editable: Boolean,\n placeholder: {\n type: String,\n \"default\": null\n },\n dataKey: null,\n showClear: {\n type: Boolean,\n \"default\": false\n },\n inputId: {\n type: String,\n \"default\": null\n },\n inputClass: {\n type: [String, Object],\n \"default\": null\n },\n inputStyle: {\n type: Object,\n \"default\": null\n },\n labelId: {\n type: String,\n \"default\": null\n },\n labelClass: {\n type: [String, Object],\n \"default\": null\n },\n labelStyle: {\n type: Object,\n \"default\": null\n },\n panelClass: {\n type: [String, Object],\n \"default\": null\n },\n overlayStyle: {\n type: Object,\n \"default\": null\n },\n overlayClass: {\n type: [String, Object],\n \"default\": null\n },\n panelStyle: {\n type: Object,\n \"default\": null\n },\n appendTo: {\n type: [String, Object],\n \"default\": 'body'\n },\n loading: {\n type: Boolean,\n \"default\": false\n },\n clearIcon: {\n type: String,\n \"default\": undefined\n },\n dropdownIcon: {\n type: String,\n \"default\": undefined\n },\n filterIcon: {\n type: String,\n \"default\": undefined\n },\n loadingIcon: {\n type: String,\n \"default\": undefined\n },\n resetFilterOnHide: {\n type: Boolean,\n \"default\": false\n },\n resetFilterOnClear: {\n type: Boolean,\n \"default\": false\n },\n virtualScrollerOptions: {\n type: Object,\n \"default\": null\n },\n autoOptionFocus: {\n type: Boolean,\n \"default\": false\n },\n autoFilterFocus: {\n type: Boolean,\n \"default\": false\n },\n selectOnFocus: {\n type: Boolean,\n \"default\": false\n },\n focusOnHover: {\n type: Boolean,\n \"default\": true\n },\n highlightOnSelect: {\n type: Boolean,\n \"default\": true\n },\n checkmark: {\n type: Boolean,\n \"default\": false\n },\n filterMessage: {\n type: String,\n \"default\": null\n },\n selectionMessage: {\n type: String,\n \"default\": null\n },\n emptySelectionMessage: {\n type: String,\n \"default\": null\n },\n emptyFilterMessage: {\n type: String,\n \"default\": null\n },\n emptyMessage: {\n type: String,\n \"default\": null\n },\n tabindex: {\n type: Number,\n \"default\": 0\n },\n ariaLabel: {\n type: String,\n \"default\": null\n },\n ariaLabelledby: {\n type: String,\n \"default\": null\n }\n },\n style: SelectStyle,\n provide: function provide() {\n return {\n $pcSelect: this,\n $parentInstance: this\n };\n }\n};\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar script = {\n name: 'Select',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['change', 'focus', 'blur', 'before-show', 'before-hide', 'show', 'hide', 'filter'],\n outsideClickListener: null,\n scrollHandler: null,\n resizeListener: null,\n labelClickListener: null,\n overlay: null,\n list: null,\n virtualScroller: null,\n searchTimeout: null,\n searchValue: null,\n isModelValueChanged: false,\n data: function data() {\n return {\n id: this.$attrs.id,\n clicked: false,\n focused: false,\n focusedOptionIndex: -1,\n filterValue: null,\n overlayVisible: false\n };\n },\n watch: {\n '$attrs.id': function $attrsId(newValue) {\n this.id = newValue || UniqueComponentId();\n },\n modelValue: function modelValue() {\n this.isModelValueChanged = true;\n },\n options: function options() {\n this.autoUpdateModel();\n }\n },\n mounted: function mounted() {\n this.id = this.id || UniqueComponentId();\n this.autoUpdateModel();\n this.bindLabelClickListener();\n },\n updated: function updated() {\n if (this.overlayVisible && this.isModelValueChanged) {\n this.scrollInView(this.findSelectedOptionIndex());\n }\n this.isModelValueChanged = false;\n },\n beforeUnmount: function beforeUnmount() {\n this.unbindOutsideClickListener();\n this.unbindResizeListener();\n this.unbindLabelClickListener();\n if (this.scrollHandler) {\n this.scrollHandler.destroy();\n this.scrollHandler = null;\n }\n if (this.overlay) {\n ZIndex.clear(this.overlay);\n this.overlay = null;\n }\n },\n methods: {\n getOptionIndex: function getOptionIndex(index, fn) {\n return this.virtualScrollerDisabled ? index : fn && fn(index)['index'];\n },\n getOptionLabel: function getOptionLabel(option) {\n return this.optionLabel ? resolveFieldData(option, this.optionLabel) : option;\n },\n getOptionValue: function getOptionValue(option) {\n return this.optionValue ? resolveFieldData(option, this.optionValue) : option;\n },\n getOptionRenderKey: function getOptionRenderKey(option, index) {\n return (this.dataKey ? resolveFieldData(option, this.dataKey) : this.getOptionLabel(option)) + '_' + index;\n },\n getPTItemOptions: function getPTItemOptions(option, itemOptions, index, key) {\n return this.ptm(key, {\n context: {\n option: option,\n index: index,\n selected: this.isSelected(option),\n focused: this.focusedOptionIndex === this.getOptionIndex(index, itemOptions),\n disabled: this.isOptionDisabled(option)\n }\n });\n },\n isOptionDisabled: function isOptionDisabled(option) {\n return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false;\n },\n isOptionGroup: function isOptionGroup(option) {\n return this.optionGroupLabel && option.optionGroup && option.group;\n },\n getOptionGroupLabel: function getOptionGroupLabel(optionGroup) {\n return resolveFieldData(optionGroup, this.optionGroupLabel);\n },\n getOptionGroupChildren: function getOptionGroupChildren(optionGroup) {\n return resolveFieldData(optionGroup, this.optionGroupChildren);\n },\n getAriaPosInset: function getAriaPosInset(index) {\n var _this = this;\n return (this.optionGroupLabel ? index - this.visibleOptions.slice(0, index).filter(function (option) {\n return _this.isOptionGroup(option);\n }).length : index) + 1;\n },\n show: function show(isFocus) {\n this.$emit('before-show');\n this.overlayVisible = true;\n this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : this.editable ? -1 : this.findSelectedOptionIndex();\n isFocus && focus(this.$refs.focusInput);\n },\n hide: function hide(isFocus) {\n var _this2 = this;\n var _hide = function _hide() {\n _this2.$emit('before-hide');\n _this2.overlayVisible = false;\n _this2.clicked = false;\n _this2.focusedOptionIndex = -1;\n _this2.searchValue = '';\n _this2.resetFilterOnHide && (_this2.filterValue = null);\n isFocus && focus(_this2.$refs.focusInput);\n };\n setTimeout(function () {\n _hide();\n }, 0); // For ScreenReaders\n },\n onFocus: function onFocus(event) {\n if (this.disabled) {\n // For ScreenReaders\n return;\n }\n this.focused = true;\n if (this.overlayVisible) {\n this.focusedOptionIndex = this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : this.editable ? -1 : this.findSelectedOptionIndex();\n this.scrollInView(this.focusedOptionIndex);\n }\n this.$emit('focus', event);\n },\n onBlur: function onBlur(event) {\n var _this$formField$onBlu, _this$formField;\n this.focused = false;\n this.focusedOptionIndex = -1;\n this.searchValue = '';\n this.$emit('blur', event);\n (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField, event);\n },\n onKeyDown: function onKeyDown(event) {\n if (this.disabled || isAndroid()) {\n event.preventDefault();\n return;\n }\n var metaKey = event.metaKey || event.ctrlKey;\n switch (event.code) {\n case 'ArrowDown':\n this.onArrowDownKey(event);\n break;\n case 'ArrowUp':\n this.onArrowUpKey(event, this.editable);\n break;\n case 'ArrowLeft':\n case 'ArrowRight':\n this.onArrowLeftKey(event, this.editable);\n break;\n case 'Home':\n this.onHomeKey(event, this.editable);\n break;\n case 'End':\n this.onEndKey(event, this.editable);\n break;\n case 'PageDown':\n this.onPageDownKey(event);\n break;\n case 'PageUp':\n this.onPageUpKey(event);\n break;\n case 'Space':\n this.onSpaceKey(event, this.editable);\n break;\n case 'Enter':\n case 'NumpadEnter':\n this.onEnterKey(event);\n break;\n case 'Escape':\n this.onEscapeKey(event);\n break;\n case 'Tab':\n this.onTabKey(event);\n break;\n case 'Backspace':\n this.onBackspaceKey(event, this.editable);\n break;\n case 'ShiftLeft':\n case 'ShiftRight':\n //NOOP\n break;\n default:\n if (!metaKey && isPrintableCharacter(event.key)) {\n !this.overlayVisible && this.show();\n !this.editable && this.searchOptions(event, event.key);\n }\n break;\n }\n this.clicked = false;\n },\n onEditableInput: function onEditableInput(event) {\n var value = event.target.value;\n this.searchValue = '';\n var matched = this.searchOptions(event, value);\n !matched && (this.focusedOptionIndex = -1);\n this.updateModel(event, value);\n !this.overlayVisible && isNotEmpty(value) && this.show();\n },\n onContainerClick: function onContainerClick(event) {\n if (this.disabled || this.loading) {\n return;\n }\n if (event.target.tagName === 'INPUT' || event.target.getAttribute('data-pc-section') === 'clearicon' || event.target.closest('[data-pc-section=\"clearicon\"]')) {\n return;\n } else if (!this.overlay || !this.overlay.contains(event.target)) {\n this.overlayVisible ? this.hide(true) : this.show(true);\n }\n this.clicked = true;\n },\n onClearClick: function onClearClick(event) {\n this.updateModel(event, null);\n this.resetFilterOnClear && (this.filterValue = null);\n },\n onFirstHiddenFocus: function onFirstHiddenFocus(event) {\n var focusableEl = event.relatedTarget === this.$refs.focusInput ? getFirstFocusableElement(this.overlay, ':not([data-p-hidden-focusable=\"true\"])') : this.$refs.focusInput;\n focus(focusableEl);\n },\n onLastHiddenFocus: function onLastHiddenFocus(event) {\n var focusableEl = event.relatedTarget === this.$refs.focusInput ? getLastFocusableElement(this.overlay, ':not([data-p-hidden-focusable=\"true\"])') : this.$refs.focusInput;\n focus(focusableEl);\n },\n onOptionSelect: function onOptionSelect(event, option) {\n var isHide = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var value = this.getOptionValue(option);\n this.updateModel(event, value);\n isHide && this.hide(true);\n },\n onOptionMouseMove: function onOptionMouseMove(event, index) {\n if (this.focusOnHover) {\n this.changeFocusedOptionIndex(event, index);\n }\n },\n onFilterChange: function onFilterChange(event) {\n var value = event.target.value;\n this.filterValue = value;\n this.focusedOptionIndex = -1;\n this.$emit('filter', {\n originalEvent: event,\n value: value\n });\n !this.virtualScrollerDisabled && this.virtualScroller.scrollToIndex(0);\n },\n onFilterKeyDown: function onFilterKeyDown(event) {\n // Check if the event is part of a text composition process (e.g., for Asian languages).\n // If event.isComposing is true, it means the user is still composing text and the input is not finalized.\n if (event.isComposing) return;\n switch (event.code) {\n case 'ArrowDown':\n this.onArrowDownKey(event);\n break;\n case 'ArrowUp':\n this.onArrowUpKey(event, true);\n break;\n case 'ArrowLeft':\n case 'ArrowRight':\n this.onArrowLeftKey(event, true);\n break;\n case 'Home':\n this.onHomeKey(event, true);\n break;\n case 'End':\n this.onEndKey(event, true);\n break;\n case 'Enter':\n case 'NumpadEnter':\n this.onEnterKey(event);\n break;\n case 'Escape':\n this.onEscapeKey(event);\n break;\n case 'Tab':\n this.onTabKey(event, true);\n break;\n }\n },\n onFilterBlur: function onFilterBlur() {\n this.focusedOptionIndex = -1;\n },\n onFilterUpdated: function onFilterUpdated() {\n if (this.overlayVisible) {\n this.alignOverlay();\n }\n },\n onOverlayClick: function onOverlayClick(event) {\n OverlayEventBus.emit('overlay-click', {\n originalEvent: event,\n target: this.$el\n });\n },\n onOverlayKeyDown: function onOverlayKeyDown(event) {\n switch (event.code) {\n case 'Escape':\n this.onEscapeKey(event);\n break;\n }\n },\n onArrowDownKey: function onArrowDownKey(event) {\n if (!this.overlayVisible) {\n this.show();\n this.editable && this.changeFocusedOptionIndex(event, this.findSelectedOptionIndex());\n } else {\n var optionIndex = this.focusedOptionIndex !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex) : this.clicked ? this.findFirstOptionIndex() : this.findFirstFocusedOptionIndex();\n this.changeFocusedOptionIndex(event, optionIndex);\n }\n event.preventDefault();\n },\n onArrowUpKey: function onArrowUpKey(event) {\n var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (event.altKey && !pressedInInputText) {\n if (this.focusedOptionIndex !== -1) {\n this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);\n }\n this.overlayVisible && this.hide();\n event.preventDefault();\n } else {\n var optionIndex = this.focusedOptionIndex !== -1 ? this.findPrevOptionIndex(this.focusedOptionIndex) : this.clicked ? this.findLastOptionIndex() : this.findLastFocusedOptionIndex();\n this.changeFocusedOptionIndex(event, optionIndex);\n !this.overlayVisible && this.show();\n event.preventDefault();\n }\n },\n onArrowLeftKey: function onArrowLeftKey(event) {\n var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n pressedInInputText && (this.focusedOptionIndex = -1);\n },\n onHomeKey: function onHomeKey(event) {\n var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (pressedInInputText) {\n var target = event.currentTarget;\n if (event.shiftKey) {\n target.setSelectionRange(0, event.target.selectionStart);\n } else {\n target.setSelectionRange(0, 0);\n this.focusedOptionIndex = -1;\n }\n } else {\n this.changeFocusedOptionIndex(event, this.findFirstOptionIndex());\n !this.overlayVisible && this.show();\n }\n event.preventDefault();\n },\n onEndKey: function onEndKey(event) {\n var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (pressedInInputText) {\n var target = event.currentTarget;\n if (event.shiftKey) {\n target.setSelectionRange(event.target.selectionStart, target.value.length);\n } else {\n var len = target.value.length;\n target.setSelectionRange(len, len);\n this.focusedOptionIndex = -1;\n }\n } else {\n this.changeFocusedOptionIndex(event, this.findLastOptionIndex());\n !this.overlayVisible && this.show();\n }\n event.preventDefault();\n },\n onPageUpKey: function onPageUpKey(event) {\n this.scrollInView(0);\n event.preventDefault();\n },\n onPageDownKey: function onPageDownKey(event) {\n this.scrollInView(this.visibleOptions.length - 1);\n event.preventDefault();\n },\n onEnterKey: function onEnterKey(event) {\n if (!this.overlayVisible) {\n this.focusedOptionIndex = -1; // reset\n this.onArrowDownKey(event);\n } else {\n if (this.focusedOptionIndex !== -1) {\n this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);\n }\n this.hide();\n }\n event.preventDefault();\n },\n onSpaceKey: function onSpaceKey(event) {\n var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n !pressedInInputText && this.onEnterKey(event);\n },\n onEscapeKey: function onEscapeKey(event) {\n this.overlayVisible && this.hide(true);\n event.preventDefault();\n event.stopPropagation(); //@todo will be changed next versionss\n },\n onTabKey: function onTabKey(event) {\n var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (!pressedInInputText) {\n if (this.overlayVisible && this.hasFocusableElements()) {\n focus(this.$refs.firstHiddenFocusableElementOnOverlay);\n event.preventDefault();\n } else {\n if (this.focusedOptionIndex !== -1) {\n this.onOptionSelect(event, this.visibleOptions[this.focusedOptionIndex]);\n }\n this.overlayVisible && this.hide(this.filter);\n }\n }\n },\n onBackspaceKey: function onBackspaceKey(event) {\n var pressedInInputText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (pressedInInputText) {\n !this.overlayVisible && this.show();\n }\n },\n onOverlayEnter: function onOverlayEnter(el) {\n var _this3 = this;\n ZIndex.set('overlay', el, this.$primevue.config.zIndex.overlay);\n addStyle(el, {\n position: 'absolute',\n top: '0',\n left: '0'\n });\n this.alignOverlay();\n this.scrollInView();\n setTimeout(function () {\n _this3.autoFilterFocus && _this3.filter && focus(_this3.$refs.filterInput.$el);\n }, 1);\n },\n onOverlayAfterEnter: function onOverlayAfterEnter() {\n this.bindOutsideClickListener();\n this.bindScrollListener();\n this.bindResizeListener();\n this.$emit('show');\n },\n onOverlayLeave: function onOverlayLeave() {\n var _this4 = this;\n this.unbindOutsideClickListener();\n this.unbindScrollListener();\n this.unbindResizeListener();\n if (this.autoFilterFocus && this.filter && !this.editable) {\n this.$nextTick(function () {\n focus(_this4.$refs.filterInput.$el);\n });\n }\n this.$emit('hide');\n this.overlay = null;\n },\n onOverlayAfterLeave: function onOverlayAfterLeave(el) {\n ZIndex.clear(el);\n },\n alignOverlay: function alignOverlay() {\n if (this.appendTo === 'self') {\n relativePosition(this.overlay, this.$el);\n } else {\n this.overlay.style.minWidth = getOuterWidth(this.$el) + 'px';\n absolutePosition(this.overlay, this.$el);\n }\n },\n bindOutsideClickListener: function bindOutsideClickListener() {\n var _this5 = this;\n if (!this.outsideClickListener) {\n this.outsideClickListener = function (event) {\n if (_this5.overlayVisible && _this5.overlay && !_this5.$el.contains(event.target) && !_this5.overlay.contains(event.target)) {\n _this5.hide();\n }\n };\n document.addEventListener('click', this.outsideClickListener);\n }\n },\n unbindOutsideClickListener: function unbindOutsideClickListener() {\n if (this.outsideClickListener) {\n document.removeEventListener('click', this.outsideClickListener);\n this.outsideClickListener = null;\n }\n },\n bindScrollListener: function bindScrollListener() {\n var _this6 = this;\n if (!this.scrollHandler) {\n this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.container, function () {\n if (_this6.overlayVisible) {\n _this6.hide();\n }\n });\n }\n this.scrollHandler.bindScrollListener();\n },\n unbindScrollListener: function unbindScrollListener() {\n if (this.scrollHandler) {\n this.scrollHandler.unbindScrollListener();\n }\n },\n bindResizeListener: function bindResizeListener() {\n var _this7 = this;\n if (!this.resizeListener) {\n this.resizeListener = function () {\n if (_this7.overlayVisible && !isTouchDevice()) {\n _this7.hide();\n }\n };\n window.addEventListener('resize', this.resizeListener);\n }\n },\n unbindResizeListener: function unbindResizeListener() {\n if (this.resizeListener) {\n window.removeEventListener('resize', this.resizeListener);\n this.resizeListener = null;\n }\n },\n bindLabelClickListener: function bindLabelClickListener() {\n var _this8 = this;\n if (!this.editable && !this.labelClickListener) {\n var label = document.querySelector(\"label[for=\\\"\".concat(this.labelId, \"\\\"]\"));\n if (label && isVisible(label)) {\n this.labelClickListener = function () {\n focus(_this8.$refs.focusInput);\n };\n label.addEventListener('click', this.labelClickListener);\n }\n }\n },\n unbindLabelClickListener: function unbindLabelClickListener() {\n if (this.labelClickListener) {\n var label = document.querySelector(\"label[for=\\\"\".concat(this.labelId, \"\\\"]\"));\n if (label && isVisible(label)) {\n label.removeEventListener('click', this.labelClickListener);\n }\n }\n },\n hasFocusableElements: function hasFocusableElements() {\n return getFocusableElements(this.overlay, ':not([data-p-hidden-focusable=\"true\"])').length > 0;\n },\n isOptionMatched: function isOptionMatched(option) {\n var _this$getOptionLabel;\n return this.isValidOption(option) && typeof this.getOptionLabel(option) === 'string' && ((_this$getOptionLabel = this.getOptionLabel(option)) === null || _this$getOptionLabel === void 0 ? void 0 : _this$getOptionLabel.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)));\n },\n isValidOption: function isValidOption(option) {\n return isNotEmpty(option) && !(this.isOptionDisabled(option) || this.isOptionGroup(option));\n },\n isValidSelectedOption: function isValidSelectedOption(option) {\n return this.isValidOption(option) && this.isSelected(option);\n },\n isSelected: function isSelected(option) {\n return equals(this.d_value, this.getOptionValue(option), this.equalityKey);\n },\n findFirstOptionIndex: function findFirstOptionIndex() {\n var _this9 = this;\n return this.visibleOptions.findIndex(function (option) {\n return _this9.isValidOption(option);\n });\n },\n findLastOptionIndex: function findLastOptionIndex() {\n var _this10 = this;\n return findLastIndex(this.visibleOptions, function (option) {\n return _this10.isValidOption(option);\n });\n },\n findNextOptionIndex: function findNextOptionIndex(index) {\n var _this11 = this;\n var matchedOptionIndex = index < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index + 1).findIndex(function (option) {\n return _this11.isValidOption(option);\n }) : -1;\n return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;\n },\n findPrevOptionIndex: function findPrevOptionIndex(index) {\n var _this12 = this;\n var matchedOptionIndex = index > 0 ? findLastIndex(this.visibleOptions.slice(0, index), function (option) {\n return _this12.isValidOption(option);\n }) : -1;\n return matchedOptionIndex > -1 ? matchedOptionIndex : index;\n },\n findSelectedOptionIndex: function findSelectedOptionIndex() {\n var _this13 = this;\n return this.$filled ? this.visibleOptions.findIndex(function (option) {\n return _this13.isValidSelectedOption(option);\n }) : -1;\n },\n findFirstFocusedOptionIndex: function findFirstFocusedOptionIndex() {\n var selectedIndex = this.findSelectedOptionIndex();\n return selectedIndex < 0 ? this.findFirstOptionIndex() : selectedIndex;\n },\n findLastFocusedOptionIndex: function findLastFocusedOptionIndex() {\n var selectedIndex = this.findSelectedOptionIndex();\n return selectedIndex < 0 ? this.findLastOptionIndex() : selectedIndex;\n },\n searchOptions: function searchOptions(event, _char) {\n var _this14 = this;\n this.searchValue = (this.searchValue || '') + _char;\n var optionIndex = -1;\n var matched = false;\n if (isNotEmpty(this.searchValue)) {\n if (this.focusedOptionIndex !== -1) {\n optionIndex = this.visibleOptions.slice(this.focusedOptionIndex).findIndex(function (option) {\n return _this14.isOptionMatched(option);\n });\n optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionIndex).findIndex(function (option) {\n return _this14.isOptionMatched(option);\n }) : optionIndex + this.focusedOptionIndex;\n } else {\n optionIndex = this.visibleOptions.findIndex(function (option) {\n return _this14.isOptionMatched(option);\n });\n }\n if (optionIndex !== -1) {\n matched = true;\n }\n if (optionIndex === -1 && this.focusedOptionIndex === -1) {\n optionIndex = this.findFirstFocusedOptionIndex();\n }\n if (optionIndex !== -1) {\n this.changeFocusedOptionIndex(event, optionIndex);\n }\n }\n if (this.searchTimeout) {\n clearTimeout(this.searchTimeout);\n }\n this.searchTimeout = setTimeout(function () {\n _this14.searchValue = '';\n _this14.searchTimeout = null;\n }, 500);\n return matched;\n },\n changeFocusedOptionIndex: function changeFocusedOptionIndex(event, index) {\n if (this.focusedOptionIndex !== index) {\n this.focusedOptionIndex = index;\n this.scrollInView();\n if (this.selectOnFocus) {\n this.onOptionSelect(event, this.visibleOptions[index], false);\n }\n }\n },\n scrollInView: function scrollInView() {\n var _this15 = this;\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;\n this.$nextTick(function () {\n var id = index !== -1 ? \"\".concat(_this15.id, \"_\").concat(index) : _this15.focusedOptionId;\n var element = findSingle(_this15.list, \"li[id=\\\"\".concat(id, \"\\\"]\"));\n if (element) {\n element.scrollIntoView && element.scrollIntoView({\n block: 'nearest',\n inline: 'start'\n });\n } else if (!_this15.virtualScrollerDisabled) {\n _this15.virtualScroller && _this15.virtualScroller.scrollToIndex(index !== -1 ? index : _this15.focusedOptionIndex);\n }\n });\n },\n autoUpdateModel: function autoUpdateModel() {\n if (this.selectOnFocus && this.autoOptionFocus && !this.$filled) {\n this.focusedOptionIndex = this.findFirstFocusedOptionIndex();\n this.onOptionSelect(null, this.visibleOptions[this.focusedOptionIndex], false);\n }\n },\n updateModel: function updateModel(event, value) {\n this.writeValue(value, event);\n this.$emit('change', {\n originalEvent: event,\n value: value\n });\n },\n flatOptions: function flatOptions(options) {\n var _this16 = this;\n return (options || []).reduce(function (result, option, index) {\n result.push({\n optionGroup: option,\n group: true,\n index: index\n });\n var optionGroupChildren = _this16.getOptionGroupChildren(option);\n optionGroupChildren && optionGroupChildren.forEach(function (o) {\n return result.push(o);\n });\n return result;\n }, []);\n },\n overlayRef: function overlayRef(el) {\n this.overlay = el;\n },\n listRef: function listRef(el, contentRef) {\n this.list = el;\n contentRef && contentRef(el); // For VirtualScroller\n },\n virtualScrollerRef: function virtualScrollerRef(el) {\n this.virtualScroller = el;\n }\n },\n computed: {\n visibleOptions: function visibleOptions() {\n var _this17 = this;\n var options = this.optionGroupLabel ? this.flatOptions(this.options) : this.options || [];\n if (this.filterValue) {\n var filteredOptions = FilterService.filter(options, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);\n if (this.optionGroupLabel) {\n var optionGroups = this.options || [];\n var filtered = [];\n optionGroups.forEach(function (group) {\n var groupChildren = _this17.getOptionGroupChildren(group);\n var filteredItems = groupChildren.filter(function (item) {\n return filteredOptions.includes(item);\n });\n if (filteredItems.length > 0) filtered.push(_objectSpread(_objectSpread({}, group), {}, _defineProperty({}, typeof _this17.optionGroupChildren === 'string' ? _this17.optionGroupChildren : 'items', _toConsumableArray(filteredItems))));\n });\n return this.flatOptions(filtered);\n }\n return filteredOptions;\n }\n return options;\n },\n // @deprecated use $filled instead\n hasSelectedOption: function hasSelectedOption() {\n return this.$filled;\n },\n label: function label() {\n var selectedOptionIndex = this.findSelectedOptionIndex();\n return selectedOptionIndex !== -1 ? this.getOptionLabel(this.visibleOptions[selectedOptionIndex]) : this.placeholder || 'p-emptylabel';\n },\n editableInputValue: function editableInputValue() {\n var selectedOptionIndex = this.findSelectedOptionIndex();\n return selectedOptionIndex !== -1 ? this.getOptionLabel(this.visibleOptions[selectedOptionIndex]) : this.d_value || '';\n },\n equalityKey: function equalityKey() {\n return this.optionValue ? null : this.dataKey;\n },\n searchFields: function searchFields() {\n return this.filterFields || [this.optionLabel];\n },\n filterResultMessageText: function filterResultMessageText() {\n return isNotEmpty(this.visibleOptions) ? this.filterMessageText.replaceAll('{0}', this.visibleOptions.length) : this.emptyFilterMessageText;\n },\n filterMessageText: function filterMessageText() {\n return this.filterMessage || this.$primevue.config.locale.searchMessage || '';\n },\n emptyFilterMessageText: function emptyFilterMessageText() {\n return this.emptyFilterMessage || this.$primevue.config.locale.emptySearchMessage || this.$primevue.config.locale.emptyFilterMessage || '';\n },\n emptyMessageText: function emptyMessageText() {\n return this.emptyMessage || this.$primevue.config.locale.emptyMessage || '';\n },\n selectionMessageText: function selectionMessageText() {\n return this.selectionMessage || this.$primevue.config.locale.selectionMessage || '';\n },\n emptySelectionMessageText: function emptySelectionMessageText() {\n return this.emptySelectionMessage || this.$primevue.config.locale.emptySelectionMessage || '';\n },\n selectedMessageText: function selectedMessageText() {\n return this.$filled ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText;\n },\n focusedOptionId: function focusedOptionId() {\n return this.focusedOptionIndex !== -1 ? \"\".concat(this.id, \"_\").concat(this.focusedOptionIndex) : null;\n },\n ariaSetSize: function ariaSetSize() {\n var _this18 = this;\n return this.visibleOptions.filter(function (option) {\n return !_this18.isOptionGroup(option);\n }).length;\n },\n isClearIconVisible: function isClearIconVisible() {\n return this.showClear && this.d_value != null && isNotEmpty(this.options);\n },\n virtualScrollerDisabled: function virtualScrollerDisabled() {\n return !this.virtualScrollerOptions;\n }\n },\n directives: {\n ripple: Ripple\n },\n components: {\n InputText: InputText,\n VirtualScroller: VirtualScroller,\n Portal: Portal,\n InputIcon: InputIcon,\n IconField: IconField,\n TimesIcon: TimesIcon,\n ChevronDownIcon: ChevronDownIcon,\n SpinnerIcon: SpinnerIcon,\n SearchIcon: SearchIcon,\n CheckIcon: CheckIcon,\n BlankIcon: BlankIcon\n }\n};\n\nvar _hoisted_1 = [\"id\"];\nvar _hoisted_2 = [\"id\", \"value\", \"placeholder\", \"tabindex\", \"disabled\", \"aria-label\", \"aria-labelledby\", \"aria-expanded\", \"aria-controls\", \"aria-activedescendant\", \"aria-invalid\"];\nvar _hoisted_3 = [\"id\", \"tabindex\", \"aria-label\", \"aria-labelledby\", \"aria-expanded\", \"aria-controls\", \"aria-activedescendant\", \"aria-disabled\"];\nvar _hoisted_4 = [\"id\"];\nvar _hoisted_5 = [\"id\"];\nvar _hoisted_6 = [\"id\", \"aria-label\", \"aria-selected\", \"aria-disabled\", \"aria-setsize\", \"aria-posinset\", \"onClick\", \"onMousemove\", \"data-p-selected\", \"data-p-focused\", \"data-p-disabled\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_SpinnerIcon = resolveComponent(\"SpinnerIcon\");\n var _component_InputText = resolveComponent(\"InputText\");\n var _component_SearchIcon = resolveComponent(\"SearchIcon\");\n var _component_InputIcon = resolveComponent(\"InputIcon\");\n var _component_IconField = resolveComponent(\"IconField\");\n var _component_CheckIcon = resolveComponent(\"CheckIcon\");\n var _component_BlankIcon = resolveComponent(\"BlankIcon\");\n var _component_VirtualScroller = resolveComponent(\"VirtualScroller\");\n var _component_Portal = resolveComponent(\"Portal\");\n var _directive_ripple = resolveDirective(\"ripple\");\n return openBlock(), createElementBlock(\"div\", mergeProps({\n ref: \"container\",\n id: $data.id,\n \"class\": _ctx.cx('root'),\n onClick: _cache[11] || (_cache[11] = function () {\n return $options.onContainerClick && $options.onContainerClick.apply($options, arguments);\n })\n }, _ctx.ptmi('root')), [_ctx.editable ? (openBlock(), createElementBlock(\"input\", mergeProps({\n key: 0,\n ref: \"focusInput\",\n id: _ctx.labelId || _ctx.inputId,\n type: \"text\",\n \"class\": [_ctx.cx('label'), _ctx.inputClass, _ctx.labelClass],\n style: [_ctx.inputStyle, _ctx.labelStyle],\n value: $options.editableInputValue,\n placeholder: _ctx.placeholder,\n tabindex: !_ctx.disabled ? _ctx.tabindex : -1,\n disabled: _ctx.disabled,\n autocomplete: \"off\",\n role: \"combobox\",\n \"aria-label\": _ctx.ariaLabel,\n \"aria-labelledby\": _ctx.ariaLabelledby,\n \"aria-haspopup\": \"listbox\",\n \"aria-expanded\": $data.overlayVisible,\n \"aria-controls\": $data.id + '_list',\n \"aria-activedescendant\": $data.focused ? $options.focusedOptionId : undefined,\n \"aria-invalid\": _ctx.invalid || undefined,\n onFocus: _cache[0] || (_cache[0] = function () {\n return $options.onFocus && $options.onFocus.apply($options, arguments);\n }),\n onBlur: _cache[1] || (_cache[1] = function () {\n return $options.onBlur && $options.onBlur.apply($options, arguments);\n }),\n onKeydown: _cache[2] || (_cache[2] = function () {\n return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);\n }),\n onInput: _cache[3] || (_cache[3] = function () {\n return $options.onEditableInput && $options.onEditableInput.apply($options, arguments);\n })\n }, _ctx.ptm('label')), null, 16, _hoisted_2)) : (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 1,\n ref: \"focusInput\",\n id: _ctx.labelId || _ctx.inputId,\n \"class\": [_ctx.cx('label'), _ctx.inputClass, _ctx.labelClass],\n style: [_ctx.inputStyle, _ctx.labelStyle],\n tabindex: !_ctx.disabled ? _ctx.tabindex : -1,\n role: \"combobox\",\n \"aria-label\": _ctx.ariaLabel || ($options.label === 'p-emptylabel' ? undefined : $options.label),\n \"aria-labelledby\": _ctx.ariaLabelledby,\n \"aria-haspopup\": \"listbox\",\n \"aria-expanded\": $data.overlayVisible,\n \"aria-controls\": $data.id + '_list',\n \"aria-activedescendant\": $data.focused ? $options.focusedOptionId : undefined,\n \"aria-disabled\": _ctx.disabled,\n onFocus: _cache[4] || (_cache[4] = function () {\n return $options.onFocus && $options.onFocus.apply($options, arguments);\n }),\n onBlur: _cache[5] || (_cache[5] = function () {\n return $options.onBlur && $options.onBlur.apply($options, arguments);\n }),\n onKeydown: _cache[6] || (_cache[6] = function () {\n return $options.onKeyDown && $options.onKeyDown.apply($options, arguments);\n })\n }, _ctx.ptm('label')), [renderSlot(_ctx.$slots, \"value\", {\n value: _ctx.d_value,\n placeholder: _ctx.placeholder\n }, function () {\n var _$options$label;\n return [createTextVNode(toDisplayString($options.label === 'p-emptylabel' ? ' ' : (_$options$label = $options.label) !== null && _$options$label !== void 0 ? _$options$label : 'empty'), 1)];\n })], 16, _hoisted_3)), $options.isClearIconVisible ? renderSlot(_ctx.$slots, \"clearicon\", {\n key: 2,\n \"class\": normalizeClass(_ctx.cx('clearIcon')),\n clearCallback: $options.onClearClick\n }, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon ? 'i' : 'TimesIcon'), mergeProps({\n ref: \"clearIcon\",\n \"class\": [_ctx.cx('clearIcon'), _ctx.clearIcon],\n onClick: $options.onClearClick\n }, _ctx.ptm('clearIcon'), {\n \"data-pc-section\": \"clearicon\"\n }), null, 16, [\"class\", \"onClick\"]))];\n }) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('dropdown')\n }, _ctx.ptm('dropdown')), [_ctx.loading ? renderSlot(_ctx.$slots, \"loadingicon\", {\n key: 0,\n \"class\": normalizeClass(_ctx.cx('loadingIcon'))\n }, function () {\n return [_ctx.loadingIcon ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 0,\n \"class\": [_ctx.cx('loadingIcon'), 'pi-spin', _ctx.loadingIcon],\n \"aria-hidden\": \"true\"\n }, _ctx.ptm('loadingIcon')), null, 16)) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({\n key: 1,\n \"class\": _ctx.cx('loadingIcon'),\n spin: \"\",\n \"aria-hidden\": \"true\"\n }, _ctx.ptm('loadingIcon')), null, 16, [\"class\"]))];\n }) : renderSlot(_ctx.$slots, \"dropdownicon\", {\n key: 1,\n \"class\": normalizeClass(_ctx.cx('dropdownIcon'))\n }, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.dropdownIcon ? 'span' : 'ChevronDownIcon'), mergeProps({\n \"class\": [_ctx.cx('dropdownIcon'), _ctx.dropdownIcon],\n \"aria-hidden\": \"true\"\n }, _ctx.ptm('dropdownIcon')), null, 16, [\"class\"]))];\n })], 16), createVNode(_component_Portal, {\n appendTo: _ctx.appendTo\n }, {\n \"default\": withCtx(function () {\n return [createVNode(Transition, mergeProps({\n name: \"p-connected-overlay\",\n onEnter: $options.onOverlayEnter,\n onAfterEnter: $options.onOverlayAfterEnter,\n onLeave: $options.onOverlayLeave,\n onAfterLeave: $options.onOverlayAfterLeave\n }, _ctx.ptm('transition')), {\n \"default\": withCtx(function () {\n return [$data.overlayVisible ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n ref: $options.overlayRef,\n \"class\": [_ctx.cx('overlay'), _ctx.panelClass, _ctx.overlayClass],\n style: [_ctx.panelStyle, _ctx.overlayStyle],\n onClick: _cache[9] || (_cache[9] = function () {\n return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments);\n }),\n onKeydown: _cache[10] || (_cache[10] = function () {\n return $options.onOverlayKeyDown && $options.onOverlayKeyDown.apply($options, arguments);\n })\n }, _ctx.ptm('overlay')), [createElementVNode(\"span\", mergeProps({\n ref: \"firstHiddenFocusableElementOnOverlay\",\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n \"class\": \"p-hidden-accessible p-hidden-focusable\",\n tabindex: 0,\n onFocus: _cache[7] || (_cache[7] = function () {\n return $options.onFirstHiddenFocus && $options.onFirstHiddenFocus.apply($options, arguments);\n })\n }, _ctx.ptm('hiddenFirstFocusableEl'), {\n \"data-p-hidden-accessible\": true,\n \"data-p-hidden-focusable\": true\n }), null, 16), renderSlot(_ctx.$slots, \"header\", {\n value: _ctx.d_value,\n options: $options.visibleOptions\n }), _ctx.filter ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('header')\n }, _ctx.ptm('header')), [createVNode(_component_IconField, {\n unstyled: _ctx.unstyled,\n pt: _ctx.ptm('pcFilterContainer')\n }, {\n \"default\": withCtx(function () {\n return [createVNode(_component_InputText, {\n ref: \"filterInput\",\n type: \"text\",\n value: $data.filterValue,\n onVnodeMounted: $options.onFilterUpdated,\n onVnodeUpdated: $options.onFilterUpdated,\n \"class\": normalizeClass(_ctx.cx('pcFilter')),\n placeholder: _ctx.filterPlaceholder,\n variant: _ctx.variant,\n unstyled: _ctx.unstyled,\n role: \"searchbox\",\n autocomplete: \"off\",\n \"aria-owns\": $data.id + '_list',\n \"aria-activedescendant\": $options.focusedOptionId,\n onKeydown: $options.onFilterKeyDown,\n onBlur: $options.onFilterBlur,\n onInput: $options.onFilterChange,\n pt: _ctx.ptm('pcFilter')\n }, null, 8, [\"value\", \"onVnodeMounted\", \"onVnodeUpdated\", \"class\", \"placeholder\", \"variant\", \"unstyled\", \"aria-owns\", \"aria-activedescendant\", \"onKeydown\", \"onBlur\", \"onInput\", \"pt\"]), createVNode(_component_InputIcon, {\n unstyled: _ctx.unstyled,\n pt: _ctx.ptm('pcFilterIconContainer')\n }, {\n \"default\": withCtx(function () {\n return [renderSlot(_ctx.$slots, \"filtericon\", {}, function () {\n return [_ctx.filterIcon ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 0,\n \"class\": _ctx.filterIcon\n }, _ctx.ptm('filterIcon')), null, 16)) : (openBlock(), createBlock(_component_SearchIcon, normalizeProps(mergeProps({\n key: 1\n }, _ctx.ptm('filterIcon'))), null, 16))];\n })];\n }),\n _: 3\n }, 8, [\"unstyled\", \"pt\"])];\n }),\n _: 3\n }, 8, [\"unstyled\", \"pt\"]), createElementVNode(\"span\", mergeProps({\n role: \"status\",\n \"aria-live\": \"polite\",\n \"class\": \"p-hidden-accessible\"\n }, _ctx.ptm('hiddenFilterResult'), {\n \"data-p-hidden-accessible\": true\n }), toDisplayString($options.filterResultMessageText), 17)], 16)) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('listContainer'),\n style: {\n 'max-height': $options.virtualScrollerDisabled ? _ctx.scrollHeight : ''\n }\n }, _ctx.ptm('listContainer')), [createVNode(_component_VirtualScroller, mergeProps({\n ref: $options.virtualScrollerRef\n }, _ctx.virtualScrollerOptions, {\n items: $options.visibleOptions,\n style: {\n height: _ctx.scrollHeight\n },\n tabindex: -1,\n disabled: $options.virtualScrollerDisabled,\n pt: _ctx.ptm('virtualScroller')\n }), createSlots({\n content: withCtx(function (_ref) {\n var styleClass = _ref.styleClass,\n contentRef = _ref.contentRef,\n items = _ref.items,\n getItemOptions = _ref.getItemOptions,\n contentStyle = _ref.contentStyle,\n itemSize = _ref.itemSize;\n return [createElementVNode(\"ul\", mergeProps({\n ref: function ref(el) {\n return $options.listRef(el, contentRef);\n },\n id: $data.id + '_list',\n \"class\": [_ctx.cx('list'), styleClass],\n style: contentStyle,\n role: \"listbox\"\n }, _ctx.ptm('list')), [(openBlock(true), createElementBlock(Fragment, null, renderList(items, function (option, i) {\n return openBlock(), createElementBlock(Fragment, {\n key: $options.getOptionRenderKey(option, $options.getOptionIndex(i, getItemOptions))\n }, [$options.isOptionGroup(option) ? (openBlock(), createElementBlock(\"li\", mergeProps({\n key: 0,\n id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),\n style: {\n height: itemSize ? itemSize + 'px' : undefined\n },\n \"class\": _ctx.cx('optionGroup'),\n role: \"option\",\n ref_for: true\n }, _ctx.ptm('optionGroup')), [renderSlot(_ctx.$slots, \"optiongroup\", {\n option: option.optionGroup,\n index: $options.getOptionIndex(i, getItemOptions)\n }, function () {\n return [createElementVNode(\"span\", mergeProps({\n \"class\": _ctx.cx('optionGroupLabel'),\n ref_for: true\n }, _ctx.ptm('optionGroupLabel')), toDisplayString($options.getOptionGroupLabel(option.optionGroup)), 17)];\n })], 16, _hoisted_5)) : withDirectives((openBlock(), createElementBlock(\"li\", mergeProps({\n key: 1,\n id: $data.id + '_' + $options.getOptionIndex(i, getItemOptions),\n \"class\": _ctx.cx('option', {\n option: option,\n focusedOption: $options.getOptionIndex(i, getItemOptions)\n }),\n style: {\n height: itemSize ? itemSize + 'px' : undefined\n },\n role: \"option\",\n \"aria-label\": $options.getOptionLabel(option),\n \"aria-selected\": $options.isSelected(option),\n \"aria-disabled\": $options.isOptionDisabled(option),\n \"aria-setsize\": $options.ariaSetSize,\n \"aria-posinset\": $options.getAriaPosInset($options.getOptionIndex(i, getItemOptions)),\n onClick: function onClick($event) {\n return $options.onOptionSelect($event, option);\n },\n onMousemove: function onMousemove($event) {\n return $options.onOptionMouseMove($event, $options.getOptionIndex(i, getItemOptions));\n },\n \"data-p-selected\": $options.isSelected(option),\n \"data-p-focused\": $data.focusedOptionIndex === $options.getOptionIndex(i, getItemOptions),\n \"data-p-disabled\": $options.isOptionDisabled(option),\n ref_for: true\n }, $options.getPTItemOptions(option, getItemOptions, i, 'option')), [_ctx.checkmark ? (openBlock(), createElementBlock(Fragment, {\n key: 0\n }, [$options.isSelected(option) ? (openBlock(), createBlock(_component_CheckIcon, mergeProps({\n key: 0,\n \"class\": _ctx.cx('optionCheckIcon'),\n ref_for: true\n }, _ctx.ptm('optionCheckIcon')), null, 16, [\"class\"])) : (openBlock(), createBlock(_component_BlankIcon, mergeProps({\n key: 1,\n \"class\": _ctx.cx('optionBlankIcon'),\n ref_for: true\n }, _ctx.ptm('optionBlankIcon')), null, 16, [\"class\"]))], 64)) : createCommentVNode(\"\", true), renderSlot(_ctx.$slots, \"option\", {\n option: option,\n selected: $options.isSelected(option),\n index: $options.getOptionIndex(i, getItemOptions)\n }, function () {\n return [createElementVNode(\"span\", mergeProps({\n \"class\": _ctx.cx('optionLabel'),\n ref_for: true\n }, _ctx.ptm('optionLabel')), toDisplayString($options.getOptionLabel(option)), 17)];\n })], 16, _hoisted_6)), [[_directive_ripple]])], 64);\n }), 128)), $data.filterValue && (!items || items && items.length === 0) ? (openBlock(), createElementBlock(\"li\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('emptyMessage'),\n role: \"option\"\n }, _ctx.ptm('emptyMessage'), {\n \"data-p-hidden-accessible\": true\n }), [renderSlot(_ctx.$slots, \"emptyfilter\", {}, function () {\n return [createTextVNode(toDisplayString($options.emptyFilterMessageText), 1)];\n })], 16)) : !_ctx.options || _ctx.options && _ctx.options.length === 0 ? (openBlock(), createElementBlock(\"li\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('emptyMessage'),\n role: \"option\"\n }, _ctx.ptm('emptyMessage'), {\n \"data-p-hidden-accessible\": true\n }), [renderSlot(_ctx.$slots, \"empty\", {}, function () {\n return [createTextVNode(toDisplayString($options.emptyMessageText), 1)];\n })], 16)) : createCommentVNode(\"\", true)], 16, _hoisted_4)];\n }),\n _: 2\n }, [_ctx.$slots.loader ? {\n name: \"loader\",\n fn: withCtx(function (_ref2) {\n var options = _ref2.options;\n return [renderSlot(_ctx.$slots, \"loader\", {\n options: options\n })];\n }),\n key: \"0\"\n } : undefined]), 1040, [\"items\", \"style\", \"disabled\", \"pt\"])], 16), renderSlot(_ctx.$slots, \"footer\", {\n value: _ctx.d_value,\n options: $options.visibleOptions\n }), !_ctx.options || _ctx.options && _ctx.options.length === 0 ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 1,\n role: \"status\",\n \"aria-live\": \"polite\",\n \"class\": \"p-hidden-accessible\"\n }, _ctx.ptm('hiddenEmptyMessage'), {\n \"data-p-hidden-accessible\": true\n }), toDisplayString($options.emptyMessageText), 17)) : createCommentVNode(\"\", true), createElementVNode(\"span\", mergeProps({\n role: \"status\",\n \"aria-live\": \"polite\",\n \"class\": \"p-hidden-accessible\"\n }, _ctx.ptm('hiddenSelectedMessage'), {\n \"data-p-hidden-accessible\": true\n }), toDisplayString($options.selectedMessageText), 17), createElementVNode(\"span\", mergeProps({\n ref: \"lastHiddenFocusableElementOnOverlay\",\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n \"class\": \"p-hidden-accessible p-hidden-focusable\",\n tabindex: 0,\n onFocus: _cache[8] || (_cache[8] = function () {\n return $options.onLastHiddenFocus && $options.onLastHiddenFocus.apply($options, arguments);\n })\n }, _ctx.ptm('hiddenLastFocusableEl'), {\n \"data-p-hidden-accessible\": true,\n \"data-p-hidden-focusable\": true\n }), null, 16)], 16)) : createCommentVNode(\"\", true)];\n }),\n _: 3\n }, 16, [\"onEnter\", \"onAfterEnter\", \"onLeave\", \"onAfterLeave\"])];\n }),\n _: 3\n }, 8, [\"appendTo\"])], 16, _hoisted_1);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import arc from '@/assets/palettes/arc.json'\nimport dark from '@/assets/palettes/dark.json'\nimport github from '@/assets/palettes/github.json'\nimport light from '@/assets/palettes/light.json'\nimport nord from '@/assets/palettes/nord.json'\nimport solarized from '@/assets/palettes/solarized.json'\nimport type { ColorPalettes, CompletedPalette } from '@/types/colorPaletteTypes'\n\nexport const CORE_COLOR_PALETTES: ColorPalettes = {\n dark,\n light,\n solarized,\n arc,\n nord,\n github\n} as const\n\nexport const DEFAULT_COLOR_PALETTE: CompletedPalette = dark\nexport const DEFAULT_DARK_COLOR_PALETTE: CompletedPalette = dark\nexport const DEFAULT_LIGHT_COLOR_PALETTE: CompletedPalette = light\n","import { defineStore } from 'pinia'\nimport { computed, ref } from 'vue'\n\nimport {\n CORE_COLOR_PALETTES,\n DEFAULT_COLOR_PALETTE,\n DEFAULT_DARK_COLOR_PALETTE,\n DEFAULT_LIGHT_COLOR_PALETTE\n} from '@/constants/coreColorPalettes'\nimport type {\n ColorPalettes,\n CompletedPalette,\n Palette\n} from '@/types/colorPaletteTypes'\n\nexport const useColorPaletteStore = defineStore('colorPalette', () => {\n const customPalettes = ref({})\n const activePaletteId = ref(DEFAULT_COLOR_PALETTE.id)\n\n const palettesLookup = computed(() => ({\n ...CORE_COLOR_PALETTES,\n ...customPalettes.value\n }))\n\n const palettes = computed(() => Object.values(palettesLookup.value))\n const completedActivePalette = computed(() =>\n completePalette(palettesLookup.value[activePaletteId.value])\n )\n\n const addCustomPalette = (palette: Palette) => {\n if (palette.id in palettesLookup.value) {\n throw new Error(`Palette with id ${palette.id} already exists`)\n }\n\n customPalettes.value[palette.id] = palette\n activePaletteId.value = palette.id\n }\n\n const deleteCustomPalette = (id: string) => {\n if (!(id in customPalettes.value)) {\n throw new Error(`Palette with id ${id} does not exist`)\n }\n\n delete customPalettes.value[id]\n activePaletteId.value = CORE_COLOR_PALETTES.dark.id\n }\n\n const isCustomPalette = (id: string) => {\n return id in customPalettes.value\n }\n\n /**\n * Completes the palette with default values for missing colors.\n *\n * @param palette - The palette to complete.\n * @returns The completed palette.\n */\n const completePalette = (palette: Palette): CompletedPalette => {\n // Set comfy-menu-secondary-bg to comfy-menu-bg if not set\n if (\n palette.colors.comfy_base['comfy-menu-bg'] &&\n !palette.colors.comfy_base['comfy-menu-secondary-bg']\n ) {\n palette.colors.comfy_base['comfy-menu-secondary-bg'] =\n palette.colors.comfy_base['comfy-menu-bg']\n }\n\n const defaultPalette = palette.light_theme\n ? DEFAULT_LIGHT_COLOR_PALETTE\n : DEFAULT_DARK_COLOR_PALETTE\n\n return {\n ...palette,\n colors: {\n ...palette.colors,\n node_slot: {\n ...defaultPalette.colors.node_slot,\n ...palette.colors.node_slot\n },\n litegraph_base: {\n ...defaultPalette.colors.litegraph_base,\n ...palette.colors.litegraph_base\n },\n comfy_base: {\n ...defaultPalette.colors.comfy_base,\n ...palette.colors.comfy_base\n }\n }\n }\n }\n\n return {\n // State\n customPalettes,\n activePaletteId,\n\n // Getters\n palettesLookup,\n palettes,\n completedActivePalette,\n\n // Actions\n isCustomPalette,\n addCustomPalette,\n deleteCustomPalette,\n completePalette\n }\n})\n","\n\n\n","\n\n\n\n","\n\n\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'AngleDownIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M3.58659 4.5007C3.68513 4.50023 3.78277 4.51945 3.87379 4.55723C3.9648 4.59501 4.04735 4.65058 4.11659 4.7207L7.11659 7.7207L10.1166 4.7207C10.2619 4.65055 10.4259 4.62911 10.5843 4.65956C10.7427 4.69002 10.8871 4.77074 10.996 4.88976C11.1049 5.00877 11.1726 5.15973 11.1889 5.32022C11.2052 5.48072 11.1693 5.6422 11.0866 5.7807L7.58659 9.2807C7.44597 9.42115 7.25534 9.50004 7.05659 9.50004C6.85784 9.50004 6.66722 9.42115 6.52659 9.2807L3.02659 5.7807C2.88614 5.64007 2.80725 5.44945 2.80725 5.2507C2.80725 5.05195 2.88614 4.86132 3.02659 4.7207C3.09932 4.64685 3.18675 4.58911 3.28322 4.55121C3.37969 4.51331 3.48305 4.4961 3.58659 4.5007Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'AngleUpIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M10.4134 9.49931C10.3148 9.49977 10.2172 9.48055 10.1262 9.44278C10.0352 9.405 9.95263 9.34942 9.88338 9.27931L6.88338 6.27931L3.88338 9.27931C3.73811 9.34946 3.57409 9.3709 3.41567 9.34044C3.25724 9.30999 3.11286 9.22926 3.00395 9.11025C2.89504 8.99124 2.82741 8.84028 2.8111 8.67978C2.79478 8.51928 2.83065 8.35781 2.91338 8.21931L6.41338 4.71931C6.55401 4.57886 6.74463 4.49997 6.94338 4.49997C7.14213 4.49997 7.33276 4.57886 7.47338 4.71931L10.9734 8.21931C11.1138 8.35994 11.1927 8.55056 11.1927 8.74931C11.1927 8.94806 11.1138 9.13868 10.9734 9.27931C10.9007 9.35315 10.8132 9.41089 10.7168 9.44879C10.6203 9.48669 10.5169 9.5039 10.4134 9.49931Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-inputnumber {\\n display: inline-flex;\\n position: relative;\\n}\\n\\n.p-inputnumber-button {\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n flex: 0 0 auto;\\n cursor: pointer;\\n background: \".concat(dt('inputnumber.button.background'), \";\\n color: \").concat(dt('inputnumber.button.color'), \";\\n width: \").concat(dt('inputnumber.button.width'), \";\\n transition: background \").concat(dt('inputnumber.transition.duration'), \", color \").concat(dt('inputnumber.transition.duration'), \", border-color \").concat(dt('inputnumber.transition.duration'), \", outline-color \").concat(dt('inputnumber.transition.duration'), \";\\n}\\n\\n.p-inputnumber-button:hover {\\n background: \").concat(dt('inputnumber.button.hover.background'), \";\\n color: \").concat(dt('inputnumber.button.hover.color'), \";\\n}\\n\\n.p-inputnumber-button:active {\\n background: \").concat(dt('inputnumber.button.active.background'), \";\\n color: \").concat(dt('inputnumber.button.active.color'), \";\\n}\\n\\n.p-inputnumber-stacked .p-inputnumber-button {\\n position: relative;\\n border: 0 none;\\n}\\n\\n.p-inputnumber-stacked .p-inputnumber-button-group {\\n display: flex;\\n flex-direction: column;\\n position: absolute;\\n inset-block-start: 1px;\\n inset-inline-end: 1px;\\n height: calc(100% - 2px);\\n z-index: 1;\\n}\\n\\n.p-inputnumber-stacked .p-inputnumber-increment-button {\\n padding: 0;\\n border-start-end-radius: calc(\").concat(dt('inputnumber.button.border.radius'), \" - 1px);\\n}\\n\\n.p-inputnumber-stacked .p-inputnumber-decrement-button {\\n padding: 0;\\n border-end-end-radius: calc(\").concat(dt('inputnumber.button.border.radius'), \" - 1px);\\n}\\n\\n.p-inputnumber-stacked .p-inputnumber-button {\\n flex: 1 1 auto;\\n border: 0 none;\\n}\\n\\n.p-inputnumber-horizontal .p-inputnumber-button {\\n border: 1px solid \").concat(dt('inputnumber.button.border.color'), \";\\n}\\n\\n.p-inputnumber-horizontal .p-inputnumber-button:hover {\\n border-color: \").concat(dt('inputnumber.button.hover.border.color'), \";\\n}\\n\\n.p-inputnumber-horizontal .p-inputnumber-button:active {\\n border-color: \").concat(dt('inputnumber.button.active.border.color'), \";\\n}\\n\\n.p-inputnumber-horizontal .p-inputnumber-increment-button {\\n order: 3;\\n border-start-end-radius: \").concat(dt('inputnumber.button.border.radius'), \";\\n border-end-end-radius: \").concat(dt('inputnumber.button.border.radius'), \";\\n border-inline-start: 0 none;\\n}\\n\\n.p-inputnumber-horizontal .p-inputnumber-input {\\n order: 2;\\n border-radius: 0;\\n}\\n\\n.p-inputnumber-horizontal .p-inputnumber-decrement-button {\\n order: 1;\\n border-start-start-radius: \").concat(dt('inputnumber.button.border.radius'), \";\\n border-end-start-radius: \").concat(dt('inputnumber.button.border.radius'), \";\\n border-inline-end: 0 none;\\n}\\n\\n.p-floatlabel:has(.p-inputnumber-horizontal) label {\\n margin-inline-start: \").concat(dt('inputnumber.button.width'), \";\\n}\\n\\n.p-inputnumber-vertical {\\n flex-direction: column;\\n}\\n\\n.p-inputnumber-vertical .p-inputnumber-button {\\n border: 1px solid \").concat(dt('inputnumber.button.border.color'), \";\\n padding: \").concat(dt('inputnumber.button.vertical.padding'), \";\\n}\\n\\n.p-inputnumber-vertical .p-inputnumber-button:hover {\\n border-color: \").concat(dt('inputnumber.button.hover.border.color'), \";\\n}\\n\\n.p-inputnumber-vertical .p-inputnumber-button:active {\\n border-color: \").concat(dt('inputnumber.button.active.border.color'), \";\\n}\\n\\n.p-inputnumber-vertical .p-inputnumber-increment-button {\\n order: 1;\\n border-start-start-radius: \").concat(dt('inputnumber.button.border.radius'), \";\\n border-start-end-radius: \").concat(dt('inputnumber.button.border.radius'), \";\\n width: 100%;\\n border-block-end: 0 none;\\n}\\n\\n.p-inputnumber-vertical .p-inputnumber-input {\\n order: 2;\\n border-radius: 0;\\n text-align: center;\\n}\\n\\n.p-inputnumber-vertical .p-inputnumber-decrement-button {\\n order: 3;\\n border-end-start-radius: \").concat(dt('inputnumber.button.border.radius'), \";\\n border-end-end-radius: \").concat(dt('inputnumber.button.border.radius'), \";\\n width: 100%;\\n border-block-start: 0 none;\\n}\\n\\n.p-inputnumber-input {\\n flex: 1 1 auto;\\n}\\n\\n.p-inputnumber-fluid {\\n width: 100%;\\n}\\n\\n.p-inputnumber-fluid .p-inputnumber-input {\\n width: 1%;\\n}\\n\\n.p-inputnumber-fluid.p-inputnumber-vertical .p-inputnumber-input {\\n width: 100%;\\n}\\n\\n.p-inputnumber:has(.p-inputtext-sm) .p-inputnumber-button .p-icon {\\n font-size: \").concat(dt('form.field.sm.font.size'), \";\\n width: \").concat(dt('form.field.sm.font.size'), \";\\n height: \").concat(dt('form.field.sm.font.size'), \";\\n}\\n\\n.p-inputnumber:has(.p-inputtext-lg) .p-inputnumber-button .p-icon {\\n font-size: \").concat(dt('form.field.lg.font.size'), \";\\n width: \").concat(dt('form.field.lg.font.size'), \";\\n height: \").concat(dt('form.field.lg.font.size'), \";\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var instance = _ref2.instance,\n props = _ref2.props;\n return ['p-inputnumber p-component p-inputwrapper', {\n 'p-inputwrapper-filled': instance.$filled || props.allowEmpty === false,\n 'p-inputwrapper-focus': instance.focused,\n 'p-inputnumber-stacked': props.showButtons && props.buttonLayout === 'stacked',\n 'p-inputnumber-horizontal': props.showButtons && props.buttonLayout === 'horizontal',\n 'p-inputnumber-vertical': props.showButtons && props.buttonLayout === 'vertical',\n 'p-inputnumber-fluid': instance.$fluid\n }];\n },\n pcInputText: 'p-inputnumber-input',\n buttonGroup: 'p-inputnumber-button-group',\n incrementButton: function incrementButton(_ref3) {\n var instance = _ref3.instance,\n props = _ref3.props;\n return ['p-inputnumber-button p-inputnumber-increment-button', {\n 'p-disabled': props.showButtons && props.max !== null && instance.maxBoundry()\n }];\n },\n decrementButton: function decrementButton(_ref4) {\n var instance = _ref4.instance,\n props = _ref4.props;\n return ['p-inputnumber-button p-inputnumber-decrement-button', {\n 'p-disabled': props.showButtons && props.min !== null && instance.minBoundry()\n }];\n }\n};\nvar InputNumberStyle = BaseStyle.extend({\n name: 'inputnumber',\n theme: theme,\n classes: classes\n});\n\nexport { InputNumberStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { getSelection, clearSelection } from '@primeuix/utils/dom';\nimport { isNotEmpty } from '@primeuix/utils/object';\nimport AngleDownIcon from '@primevue/icons/angledown';\nimport AngleUpIcon from '@primevue/icons/angleup';\nimport InputText from 'primevue/inputtext';\nimport BaseInput from '@primevue/core/baseinput';\nimport InputNumberStyle from 'primevue/inputnumber/style';\nimport { resolveComponent, openBlock, createElementBlock, mergeProps, createVNode, normalizeClass, normalizeStyle, renderSlot, createElementVNode, toHandlers, createBlock, resolveDynamicComponent, createCommentVNode } from 'vue';\n\nvar script$1 = {\n name: 'BaseInputNumber',\n \"extends\": BaseInput,\n props: {\n format: {\n type: Boolean,\n \"default\": true\n },\n showButtons: {\n type: Boolean,\n \"default\": false\n },\n buttonLayout: {\n type: String,\n \"default\": 'stacked'\n },\n incrementButtonClass: {\n type: String,\n \"default\": null\n },\n decrementButtonClass: {\n type: String,\n \"default\": null\n },\n incrementButtonIcon: {\n type: String,\n \"default\": undefined\n },\n incrementIcon: {\n type: String,\n \"default\": undefined\n },\n decrementButtonIcon: {\n type: String,\n \"default\": undefined\n },\n decrementIcon: {\n type: String,\n \"default\": undefined\n },\n locale: {\n type: String,\n \"default\": undefined\n },\n localeMatcher: {\n type: String,\n \"default\": undefined\n },\n mode: {\n type: String,\n \"default\": 'decimal'\n },\n prefix: {\n type: String,\n \"default\": null\n },\n suffix: {\n type: String,\n \"default\": null\n },\n currency: {\n type: String,\n \"default\": undefined\n },\n currencyDisplay: {\n type: String,\n \"default\": undefined\n },\n useGrouping: {\n type: Boolean,\n \"default\": true\n },\n minFractionDigits: {\n type: Number,\n \"default\": undefined\n },\n maxFractionDigits: {\n type: Number,\n \"default\": undefined\n },\n roundingMode: {\n type: String,\n \"default\": 'halfExpand',\n validator: function validator(value) {\n return ['ceil', 'floor', 'expand', 'trunc', 'halfCeil', 'halfFloor', 'halfExpand', 'halfTrunc', 'halfEven'].includes(value);\n }\n },\n min: {\n type: Number,\n \"default\": null\n },\n max: {\n type: Number,\n \"default\": null\n },\n step: {\n type: Number,\n \"default\": 1\n },\n allowEmpty: {\n type: Boolean,\n \"default\": true\n },\n highlightOnFocus: {\n type: Boolean,\n \"default\": false\n },\n readonly: {\n type: Boolean,\n \"default\": false\n },\n placeholder: {\n type: String,\n \"default\": null\n },\n inputId: {\n type: String,\n \"default\": null\n },\n inputClass: {\n type: [String, Object],\n \"default\": null\n },\n inputStyle: {\n type: Object,\n \"default\": null\n },\n ariaLabelledby: {\n type: String,\n \"default\": null\n },\n ariaLabel: {\n type: String,\n \"default\": null\n }\n },\n style: InputNumberStyle,\n provide: function provide() {\n return {\n $pcInputNumber: this,\n $parentInstance: this\n };\n }\n};\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nvar script = {\n name: 'InputNumber',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['input', 'focus', 'blur'],\n inject: {\n $pcFluid: {\n \"default\": null\n }\n },\n numberFormat: null,\n _numeral: null,\n _decimal: null,\n _group: null,\n _minusSign: null,\n _currency: null,\n _suffix: null,\n _prefix: null,\n _index: null,\n groupChar: '',\n isSpecialChar: null,\n prefixChar: null,\n suffixChar: null,\n timer: null,\n data: function data() {\n return {\n // @deprecated\n d_modelValue: this.d_value,\n focused: false\n };\n },\n watch: {\n d_value: function d_value(newValue) {\n // @deprecated since v4.2.0\n this.d_modelValue = newValue;\n },\n locale: function locale(newValue, oldValue) {\n this.updateConstructParser(newValue, oldValue);\n },\n localeMatcher: function localeMatcher(newValue, oldValue) {\n this.updateConstructParser(newValue, oldValue);\n },\n mode: function mode(newValue, oldValue) {\n this.updateConstructParser(newValue, oldValue);\n },\n currency: function currency(newValue, oldValue) {\n this.updateConstructParser(newValue, oldValue);\n },\n currencyDisplay: function currencyDisplay(newValue, oldValue) {\n this.updateConstructParser(newValue, oldValue);\n },\n useGrouping: function useGrouping(newValue, oldValue) {\n this.updateConstructParser(newValue, oldValue);\n },\n minFractionDigits: function minFractionDigits(newValue, oldValue) {\n this.updateConstructParser(newValue, oldValue);\n },\n maxFractionDigits: function maxFractionDigits(newValue, oldValue) {\n this.updateConstructParser(newValue, oldValue);\n },\n suffix: function suffix(newValue, oldValue) {\n this.updateConstructParser(newValue, oldValue);\n },\n prefix: function prefix(newValue, oldValue) {\n this.updateConstructParser(newValue, oldValue);\n }\n },\n created: function created() {\n this.constructParser();\n },\n methods: {\n getOptions: function getOptions() {\n return {\n localeMatcher: this.localeMatcher,\n style: this.mode,\n currency: this.currency,\n currencyDisplay: this.currencyDisplay,\n useGrouping: this.useGrouping,\n minimumFractionDigits: this.minFractionDigits,\n maximumFractionDigits: this.maxFractionDigits,\n roundingMode: this.roundingMode\n };\n },\n constructParser: function constructParser() {\n this.numberFormat = new Intl.NumberFormat(this.locale, this.getOptions());\n var numerals = _toConsumableArray(new Intl.NumberFormat(this.locale, {\n useGrouping: false\n }).format(9876543210)).reverse();\n var index = new Map(numerals.map(function (d, i) {\n return [d, i];\n }));\n this._numeral = new RegExp(\"[\".concat(numerals.join(''), \"]\"), 'g');\n this._group = this.getGroupingExpression();\n this._minusSign = this.getMinusSignExpression();\n this._currency = this.getCurrencyExpression();\n this._decimal = this.getDecimalExpression();\n this._suffix = this.getSuffixExpression();\n this._prefix = this.getPrefixExpression();\n this._index = function (d) {\n return index.get(d);\n };\n },\n updateConstructParser: function updateConstructParser(newValue, oldValue) {\n if (newValue !== oldValue) {\n this.constructParser();\n }\n },\n escapeRegExp: function escapeRegExp(text) {\n return text.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n },\n getDecimalExpression: function getDecimalExpression() {\n var formatter = new Intl.NumberFormat(this.locale, _objectSpread(_objectSpread({}, this.getOptions()), {}, {\n useGrouping: false\n }));\n return new RegExp(\"[\".concat(formatter.format(1.1).replace(this._currency, '').trim().replace(this._numeral, ''), \"]\"), 'g');\n },\n getGroupingExpression: function getGroupingExpression() {\n var formatter = new Intl.NumberFormat(this.locale, {\n useGrouping: true\n });\n this.groupChar = formatter.format(1000000).trim().replace(this._numeral, '').charAt(0);\n return new RegExp(\"[\".concat(this.groupChar, \"]\"), 'g');\n },\n getMinusSignExpression: function getMinusSignExpression() {\n var formatter = new Intl.NumberFormat(this.locale, {\n useGrouping: false\n });\n return new RegExp(\"[\".concat(formatter.format(-1).trim().replace(this._numeral, ''), \"]\"), 'g');\n },\n getCurrencyExpression: function getCurrencyExpression() {\n if (this.currency) {\n var formatter = new Intl.NumberFormat(this.locale, {\n style: 'currency',\n currency: this.currency,\n currencyDisplay: this.currencyDisplay,\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n roundingMode: this.roundingMode\n });\n return new RegExp(\"[\".concat(formatter.format(1).replace(/\\s/g, '').replace(this._numeral, '').replace(this._group, ''), \"]\"), 'g');\n }\n return new RegExp(\"[]\", 'g');\n },\n getPrefixExpression: function getPrefixExpression() {\n if (this.prefix) {\n this.prefixChar = this.prefix;\n } else {\n var formatter = new Intl.NumberFormat(this.locale, {\n style: this.mode,\n currency: this.currency,\n currencyDisplay: this.currencyDisplay\n });\n this.prefixChar = formatter.format(1).split('1')[0];\n }\n return new RegExp(\"\".concat(this.escapeRegExp(this.prefixChar || '')), 'g');\n },\n getSuffixExpression: function getSuffixExpression() {\n if (this.suffix) {\n this.suffixChar = this.suffix;\n } else {\n var formatter = new Intl.NumberFormat(this.locale, {\n style: this.mode,\n currency: this.currency,\n currencyDisplay: this.currencyDisplay,\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n roundingMode: this.roundingMode\n });\n this.suffixChar = formatter.format(1).split('1')[1];\n }\n return new RegExp(\"\".concat(this.escapeRegExp(this.suffixChar || '')), 'g');\n },\n formatValue: function formatValue(value) {\n if (value != null) {\n if (value === '-') {\n // Minus sign\n return value;\n }\n if (this.format) {\n var formatter = new Intl.NumberFormat(this.locale, this.getOptions());\n var formattedValue = formatter.format(value);\n if (this.prefix) {\n formattedValue = this.prefix + formattedValue;\n }\n if (this.suffix) {\n formattedValue = formattedValue + this.suffix;\n }\n return formattedValue;\n }\n return value.toString();\n }\n return '';\n },\n parseValue: function parseValue(text) {\n var filteredText = text.replace(this._suffix, '').replace(this._prefix, '').trim().replace(/\\s/g, '').replace(this._currency, '').replace(this._group, '').replace(this._minusSign, '-').replace(this._decimal, '.').replace(this._numeral, this._index);\n if (filteredText) {\n if (filteredText === '-')\n // Minus sign\n return filteredText;\n var parsedValue = +filteredText;\n return isNaN(parsedValue) ? null : parsedValue;\n }\n return null;\n },\n repeat: function repeat(event, interval, dir) {\n var _this = this;\n if (this.readonly) {\n return;\n }\n var i = interval || 500;\n this.clearTimer();\n this.timer = setTimeout(function () {\n _this.repeat(event, 40, dir);\n }, i);\n this.spin(event, dir);\n },\n spin: function spin(event, dir) {\n if (this.$refs.input) {\n var step = this.step * dir;\n var currentValue = this.parseValue(this.$refs.input.$el.value) || 0;\n var newValue = this.validateValue(currentValue + step);\n this.updateInput(newValue, null, 'spin');\n this.updateModel(event, newValue);\n this.handleOnInput(event, currentValue, newValue);\n }\n },\n onUpButtonMouseDown: function onUpButtonMouseDown(event) {\n if (!this.disabled) {\n this.$refs.input.$el.focus();\n this.repeat(event, null, 1);\n event.preventDefault();\n }\n },\n onUpButtonMouseUp: function onUpButtonMouseUp() {\n if (!this.disabled) {\n this.clearTimer();\n }\n },\n onUpButtonMouseLeave: function onUpButtonMouseLeave() {\n if (!this.disabled) {\n this.clearTimer();\n }\n },\n onUpButtonKeyUp: function onUpButtonKeyUp() {\n if (!this.disabled) {\n this.clearTimer();\n }\n },\n onUpButtonKeyDown: function onUpButtonKeyDown(event) {\n if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {\n this.repeat(event, null, 1);\n }\n },\n onDownButtonMouseDown: function onDownButtonMouseDown(event) {\n if (!this.disabled) {\n this.$refs.input.$el.focus();\n this.repeat(event, null, -1);\n event.preventDefault();\n }\n },\n onDownButtonMouseUp: function onDownButtonMouseUp() {\n if (!this.disabled) {\n this.clearTimer();\n }\n },\n onDownButtonMouseLeave: function onDownButtonMouseLeave() {\n if (!this.disabled) {\n this.clearTimer();\n }\n },\n onDownButtonKeyUp: function onDownButtonKeyUp() {\n if (!this.disabled) {\n this.clearTimer();\n }\n },\n onDownButtonKeyDown: function onDownButtonKeyDown(event) {\n if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {\n this.repeat(event, null, -1);\n }\n },\n onUserInput: function onUserInput() {\n if (this.isSpecialChar) {\n this.$refs.input.$el.value = this.lastValue;\n }\n this.isSpecialChar = false;\n },\n onInputKeyDown: function onInputKeyDown(event) {\n if (this.readonly) {\n return;\n }\n if (event.altKey || event.ctrlKey || event.metaKey) {\n this.isSpecialChar = true;\n this.lastValue = this.$refs.input.$el.value;\n return;\n }\n this.lastValue = event.target.value;\n var selectionStart = event.target.selectionStart;\n var selectionEnd = event.target.selectionEnd;\n var selectionRange = selectionEnd - selectionStart;\n var inputValue = event.target.value;\n var newValueStr = null;\n var code = event.code || event.key;\n switch (code) {\n case 'ArrowUp':\n this.spin(event, 1);\n event.preventDefault();\n break;\n case 'ArrowDown':\n this.spin(event, -1);\n event.preventDefault();\n break;\n case 'ArrowLeft':\n if (selectionRange > 1) {\n var cursorPosition = this.isNumeralChar(inputValue.charAt(selectionStart)) ? selectionStart + 1 : selectionStart + 2;\n this.$refs.input.$el.setSelectionRange(cursorPosition, cursorPosition);\n } else if (!this.isNumeralChar(inputValue.charAt(selectionStart - 1))) {\n event.preventDefault();\n }\n break;\n case 'ArrowRight':\n if (selectionRange > 1) {\n var _cursorPosition = selectionEnd - 1;\n this.$refs.input.$el.setSelectionRange(_cursorPosition, _cursorPosition);\n } else if (!this.isNumeralChar(inputValue.charAt(selectionStart))) {\n event.preventDefault();\n }\n break;\n case 'Tab':\n case 'Enter':\n case 'NumpadEnter':\n newValueStr = this.validateValue(this.parseValue(inputValue));\n this.$refs.input.$el.value = this.formatValue(newValueStr);\n this.$refs.input.$el.setAttribute('aria-valuenow', newValueStr);\n this.updateModel(event, newValueStr);\n break;\n case 'Backspace':\n {\n event.preventDefault();\n if (selectionStart === selectionEnd) {\n var deleteChar = inputValue.charAt(selectionStart - 1);\n var _this$getDecimalCharI = this.getDecimalCharIndexes(inputValue),\n decimalCharIndex = _this$getDecimalCharI.decimalCharIndex,\n decimalCharIndexWithoutPrefix = _this$getDecimalCharI.decimalCharIndexWithoutPrefix;\n if (this.isNumeralChar(deleteChar)) {\n var decimalLength = this.getDecimalLength(inputValue);\n if (this._group.test(deleteChar)) {\n this._group.lastIndex = 0;\n newValueStr = inputValue.slice(0, selectionStart - 2) + inputValue.slice(selectionStart - 1);\n } else if (this._decimal.test(deleteChar)) {\n this._decimal.lastIndex = 0;\n if (decimalLength) {\n this.$refs.input.$el.setSelectionRange(selectionStart - 1, selectionStart - 1);\n } else {\n newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);\n }\n } else if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {\n var insertedText = this.isDecimalMode() && (this.minFractionDigits || 0) < decimalLength ? '' : '0';\n newValueStr = inputValue.slice(0, selectionStart - 1) + insertedText + inputValue.slice(selectionStart);\n } else if (decimalCharIndexWithoutPrefix === 1) {\n newValueStr = inputValue.slice(0, selectionStart - 1) + '0' + inputValue.slice(selectionStart);\n newValueStr = this.parseValue(newValueStr) > 0 ? newValueStr : '';\n } else {\n newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart);\n }\n }\n this.updateValue(event, newValueStr, null, 'delete-single');\n } else {\n newValueStr = this.deleteRange(inputValue, selectionStart, selectionEnd);\n this.updateValue(event, newValueStr, null, 'delete-range');\n }\n break;\n }\n case 'Delete':\n event.preventDefault();\n if (selectionStart === selectionEnd) {\n var _deleteChar = inputValue.charAt(selectionStart);\n var _this$getDecimalCharI2 = this.getDecimalCharIndexes(inputValue),\n _decimalCharIndex = _this$getDecimalCharI2.decimalCharIndex,\n _decimalCharIndexWithoutPrefix = _this$getDecimalCharI2.decimalCharIndexWithoutPrefix;\n if (this.isNumeralChar(_deleteChar)) {\n var _decimalLength = this.getDecimalLength(inputValue);\n if (this._group.test(_deleteChar)) {\n this._group.lastIndex = 0;\n newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 2);\n } else if (this._decimal.test(_deleteChar)) {\n this._decimal.lastIndex = 0;\n if (_decimalLength) {\n this.$refs.input.$el.setSelectionRange(selectionStart + 1, selectionStart + 1);\n } else {\n newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);\n }\n } else if (_decimalCharIndex > 0 && selectionStart > _decimalCharIndex) {\n var _insertedText = this.isDecimalMode() && (this.minFractionDigits || 0) < _decimalLength ? '' : '0';\n newValueStr = inputValue.slice(0, selectionStart) + _insertedText + inputValue.slice(selectionStart + 1);\n } else if (_decimalCharIndexWithoutPrefix === 1) {\n newValueStr = inputValue.slice(0, selectionStart) + '0' + inputValue.slice(selectionStart + 1);\n newValueStr = this.parseValue(newValueStr) > 0 ? newValueStr : '';\n } else {\n newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1);\n }\n }\n this.updateValue(event, newValueStr, null, 'delete-back-single');\n } else {\n newValueStr = this.deleteRange(inputValue, selectionStart, selectionEnd);\n this.updateValue(event, newValueStr, null, 'delete-range');\n }\n break;\n case 'Home':\n event.preventDefault();\n if (isNotEmpty(this.min)) {\n this.updateModel(event, this.min);\n }\n break;\n case 'End':\n event.preventDefault();\n if (isNotEmpty(this.max)) {\n this.updateModel(event, this.max);\n }\n break;\n }\n },\n onInputKeyPress: function onInputKeyPress(event) {\n if (this.readonly) {\n return;\n }\n var _char = event.key;\n var isDecimalSign = this.isDecimalSign(_char);\n var isMinusSign = this.isMinusSign(_char);\n if (event.code !== 'Enter') {\n event.preventDefault();\n }\n if (Number(_char) >= 0 && Number(_char) <= 9 || isMinusSign || isDecimalSign) {\n this.insert(event, _char, {\n isDecimalSign: isDecimalSign,\n isMinusSign: isMinusSign\n });\n }\n },\n onPaste: function onPaste(event) {\n event.preventDefault();\n var data = (event.clipboardData || window['clipboardData']).getData('Text');\n if (data) {\n var filteredData = this.parseValue(data);\n if (filteredData != null) {\n this.insert(event, filteredData.toString());\n }\n }\n },\n allowMinusSign: function allowMinusSign() {\n return this.min === null || this.min < 0;\n },\n isMinusSign: function isMinusSign(_char2) {\n if (this._minusSign.test(_char2) || _char2 === '-') {\n this._minusSign.lastIndex = 0;\n return true;\n }\n return false;\n },\n isDecimalSign: function isDecimalSign(_char3) {\n if (this._decimal.test(_char3)) {\n this._decimal.lastIndex = 0;\n return true;\n }\n return false;\n },\n isDecimalMode: function isDecimalMode() {\n return this.mode === 'decimal';\n },\n getDecimalCharIndexes: function getDecimalCharIndexes(val) {\n var decimalCharIndex = val.search(this._decimal);\n this._decimal.lastIndex = 0;\n var filteredVal = val.replace(this._prefix, '').trim().replace(/\\s/g, '').replace(this._currency, '');\n var decimalCharIndexWithoutPrefix = filteredVal.search(this._decimal);\n this._decimal.lastIndex = 0;\n return {\n decimalCharIndex: decimalCharIndex,\n decimalCharIndexWithoutPrefix: decimalCharIndexWithoutPrefix\n };\n },\n getCharIndexes: function getCharIndexes(val) {\n var decimalCharIndex = val.search(this._decimal);\n this._decimal.lastIndex = 0;\n var minusCharIndex = val.search(this._minusSign);\n this._minusSign.lastIndex = 0;\n var suffixCharIndex = val.search(this._suffix);\n this._suffix.lastIndex = 0;\n var currencyCharIndex = val.search(this._currency);\n this._currency.lastIndex = 0;\n return {\n decimalCharIndex: decimalCharIndex,\n minusCharIndex: minusCharIndex,\n suffixCharIndex: suffixCharIndex,\n currencyCharIndex: currencyCharIndex\n };\n },\n insert: function insert(event, text) {\n var sign = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n isDecimalSign: false,\n isMinusSign: false\n };\n var minusCharIndexOnText = text.search(this._minusSign);\n this._minusSign.lastIndex = 0;\n if (!this.allowMinusSign() && minusCharIndexOnText !== -1) {\n return;\n }\n var selectionStart = this.$refs.input.$el.selectionStart;\n var selectionEnd = this.$refs.input.$el.selectionEnd;\n var inputValue = this.$refs.input.$el.value.trim();\n var _this$getCharIndexes = this.getCharIndexes(inputValue),\n decimalCharIndex = _this$getCharIndexes.decimalCharIndex,\n minusCharIndex = _this$getCharIndexes.minusCharIndex,\n suffixCharIndex = _this$getCharIndexes.suffixCharIndex,\n currencyCharIndex = _this$getCharIndexes.currencyCharIndex;\n var newValueStr;\n if (sign.isMinusSign) {\n if (selectionStart === 0) {\n newValueStr = inputValue;\n if (minusCharIndex === -1 || selectionEnd !== 0) {\n newValueStr = this.insertText(inputValue, text, 0, selectionEnd);\n }\n this.updateValue(event, newValueStr, text, 'insert');\n }\n } else if (sign.isDecimalSign) {\n if (decimalCharIndex > 0 && selectionStart === decimalCharIndex) {\n this.updateValue(event, inputValue, text, 'insert');\n } else if (decimalCharIndex > selectionStart && decimalCharIndex < selectionEnd) {\n newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd);\n this.updateValue(event, newValueStr, text, 'insert');\n } else if (decimalCharIndex === -1 && this.maxFractionDigits) {\n newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd);\n this.updateValue(event, newValueStr, text, 'insert');\n }\n } else {\n var maxFractionDigits = this.numberFormat.resolvedOptions().maximumFractionDigits;\n var operation = selectionStart !== selectionEnd ? 'range-insert' : 'insert';\n if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) {\n if (selectionStart + text.length - (decimalCharIndex + 1) <= maxFractionDigits) {\n var charIndex = currencyCharIndex >= selectionStart ? currencyCharIndex - 1 : suffixCharIndex >= selectionStart ? suffixCharIndex : inputValue.length;\n newValueStr = inputValue.slice(0, selectionStart) + text + inputValue.slice(selectionStart + text.length, charIndex) + inputValue.slice(charIndex);\n this.updateValue(event, newValueStr, text, operation);\n }\n } else {\n newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd);\n this.updateValue(event, newValueStr, text, operation);\n }\n }\n },\n insertText: function insertText(value, text, start, end) {\n var textSplit = text === '.' ? text : text.split('.');\n if (textSplit.length === 2) {\n var decimalCharIndex = value.slice(start, end).search(this._decimal);\n this._decimal.lastIndex = 0;\n return decimalCharIndex > 0 ? value.slice(0, start) + this.formatValue(text) + value.slice(end) : this.formatValue(text) || value;\n } else if (end - start === value.length) {\n return this.formatValue(text);\n } else if (start === 0) {\n return text + value.slice(end);\n } else if (end === value.length) {\n return value.slice(0, start) + text;\n } else {\n return value.slice(0, start) + text + value.slice(end);\n }\n },\n deleteRange: function deleteRange(value, start, end) {\n var newValueStr;\n if (end - start === value.length) newValueStr = '';else if (start === 0) newValueStr = value.slice(end);else if (end === value.length) newValueStr = value.slice(0, start);else newValueStr = value.slice(0, start) + value.slice(end);\n return newValueStr;\n },\n initCursor: function initCursor() {\n var selectionStart = this.$refs.input.$el.selectionStart;\n var inputValue = this.$refs.input.$el.value;\n var valueLength = inputValue.length;\n var index = null;\n\n // remove prefix\n var prefixLength = (this.prefixChar || '').length;\n inputValue = inputValue.replace(this._prefix, '');\n selectionStart = selectionStart - prefixLength;\n var _char4 = inputValue.charAt(selectionStart);\n if (this.isNumeralChar(_char4)) {\n return selectionStart + prefixLength;\n }\n\n //left\n var i = selectionStart - 1;\n while (i >= 0) {\n _char4 = inputValue.charAt(i);\n if (this.isNumeralChar(_char4)) {\n index = i + prefixLength;\n break;\n } else {\n i--;\n }\n }\n if (index !== null) {\n this.$refs.input.$el.setSelectionRange(index + 1, index + 1);\n } else {\n i = selectionStart;\n while (i < valueLength) {\n _char4 = inputValue.charAt(i);\n if (this.isNumeralChar(_char4)) {\n index = i + prefixLength;\n break;\n } else {\n i++;\n }\n }\n if (index !== null) {\n this.$refs.input.$el.setSelectionRange(index, index);\n }\n }\n return index || 0;\n },\n onInputClick: function onInputClick() {\n var currentValue = this.$refs.input.$el.value;\n if (!this.readonly && currentValue !== getSelection()) {\n this.initCursor();\n }\n },\n isNumeralChar: function isNumeralChar(_char5) {\n if (_char5.length === 1 && (this._numeral.test(_char5) || this._decimal.test(_char5) || this._group.test(_char5) || this._minusSign.test(_char5))) {\n this.resetRegex();\n return true;\n }\n return false;\n },\n resetRegex: function resetRegex() {\n this._numeral.lastIndex = 0;\n this._decimal.lastIndex = 0;\n this._group.lastIndex = 0;\n this._minusSign.lastIndex = 0;\n },\n updateValue: function updateValue(event, valueStr, insertedValueStr, operation) {\n var currentValue = this.$refs.input.$el.value;\n var newValue = null;\n if (valueStr != null) {\n newValue = this.parseValue(valueStr);\n newValue = !newValue && !this.allowEmpty ? 0 : newValue;\n this.updateInput(newValue, insertedValueStr, operation, valueStr);\n this.handleOnInput(event, currentValue, newValue);\n }\n },\n handleOnInput: function handleOnInput(event, currentValue, newValue) {\n if (this.isValueChanged(currentValue, newValue)) {\n var _this$formField$onInp, _this$formField;\n this.$emit('input', {\n originalEvent: event,\n value: newValue,\n formattedValue: currentValue\n });\n (_this$formField$onInp = (_this$formField = this.formField).onInput) === null || _this$formField$onInp === void 0 || _this$formField$onInp.call(_this$formField, {\n originalEvent: event,\n value: newValue\n });\n }\n },\n isValueChanged: function isValueChanged(currentValue, newValue) {\n if (newValue === null && currentValue !== null) {\n return true;\n }\n if (newValue != null) {\n var parsedCurrentValue = typeof currentValue === 'string' ? this.parseValue(currentValue) : currentValue;\n return newValue !== parsedCurrentValue;\n }\n return false;\n },\n validateValue: function validateValue(value) {\n if (value === '-' || value == null) {\n return null;\n }\n if (this.min != null && value < this.min) {\n return this.min;\n }\n if (this.max != null && value > this.max) {\n return this.max;\n }\n return value;\n },\n updateInput: function updateInput(value, insertedValueStr, operation, valueStr) {\n insertedValueStr = insertedValueStr || '';\n var inputValue = this.$refs.input.$el.value;\n var newValue = this.formatValue(value);\n var currentLength = inputValue.length;\n if (newValue !== valueStr) {\n newValue = this.concatValues(newValue, valueStr);\n }\n if (currentLength === 0) {\n this.$refs.input.$el.value = newValue;\n this.$refs.input.$el.setSelectionRange(0, 0);\n var index = this.initCursor();\n var selectionEnd = index + insertedValueStr.length;\n this.$refs.input.$el.setSelectionRange(selectionEnd, selectionEnd);\n } else {\n var selectionStart = this.$refs.input.$el.selectionStart;\n var _selectionEnd = this.$refs.input.$el.selectionEnd;\n this.$refs.input.$el.value = newValue;\n var newLength = newValue.length;\n if (operation === 'range-insert') {\n var startValue = this.parseValue((inputValue || '').slice(0, selectionStart));\n var startValueStr = startValue !== null ? startValue.toString() : '';\n var startExpr = startValueStr.split('').join(\"(\".concat(this.groupChar, \")?\"));\n var sRegex = new RegExp(startExpr, 'g');\n sRegex.test(newValue);\n var tExpr = insertedValueStr.split('').join(\"(\".concat(this.groupChar, \")?\"));\n var tRegex = new RegExp(tExpr, 'g');\n tRegex.test(newValue.slice(sRegex.lastIndex));\n _selectionEnd = sRegex.lastIndex + tRegex.lastIndex;\n this.$refs.input.$el.setSelectionRange(_selectionEnd, _selectionEnd);\n } else if (newLength === currentLength) {\n if (operation === 'insert' || operation === 'delete-back-single') {\n this.$refs.input.$el.setSelectionRange(_selectionEnd + 1, _selectionEnd + 1);\n } else if (operation === 'delete-single') {\n this.$refs.input.$el.setSelectionRange(_selectionEnd - 1, _selectionEnd - 1);\n } else if (operation === 'delete-range' || operation === 'spin') {\n this.$refs.input.$el.setSelectionRange(_selectionEnd, _selectionEnd);\n }\n } else if (operation === 'delete-back-single') {\n var prevChar = inputValue.charAt(_selectionEnd - 1);\n var nextChar = inputValue.charAt(_selectionEnd);\n var diff = currentLength - newLength;\n var isGroupChar = this._group.test(nextChar);\n if (isGroupChar && diff === 1) {\n _selectionEnd += 1;\n } else if (!isGroupChar && this.isNumeralChar(prevChar)) {\n _selectionEnd += -1 * diff + 1;\n }\n this._group.lastIndex = 0;\n this.$refs.input.$el.setSelectionRange(_selectionEnd, _selectionEnd);\n } else if (inputValue === '-' && operation === 'insert') {\n this.$refs.input.$el.setSelectionRange(0, 0);\n var _index = this.initCursor();\n var _selectionEnd2 = _index + insertedValueStr.length + 1;\n this.$refs.input.$el.setSelectionRange(_selectionEnd2, _selectionEnd2);\n } else {\n _selectionEnd = _selectionEnd + (newLength - currentLength);\n this.$refs.input.$el.setSelectionRange(_selectionEnd, _selectionEnd);\n }\n }\n this.$refs.input.$el.setAttribute('aria-valuenow', value);\n },\n concatValues: function concatValues(val1, val2) {\n if (val1 && val2) {\n var decimalCharIndex = val2.search(this._decimal);\n this._decimal.lastIndex = 0;\n if (this.suffixChar) {\n return decimalCharIndex !== -1 ? val1.replace(this.suffixChar, '').split(this._decimal)[0] + val2.replace(this.suffixChar, '').slice(decimalCharIndex) + this.suffixChar : val1;\n } else {\n return decimalCharIndex !== -1 ? val1.split(this._decimal)[0] + val2.slice(decimalCharIndex) : val1;\n }\n }\n return val1;\n },\n getDecimalLength: function getDecimalLength(value) {\n if (value) {\n var valueSplit = value.split(this._decimal);\n if (valueSplit.length === 2) {\n return valueSplit[1].replace(this._suffix, '').trim().replace(/\\s/g, '').replace(this._currency, '').length;\n }\n }\n return 0;\n },\n updateModel: function updateModel(event, value) {\n this.writeValue(value, event);\n },\n onInputFocus: function onInputFocus(event) {\n this.focused = true;\n if (!this.disabled && !this.readonly && this.$refs.input.$el.value !== getSelection() && this.highlightOnFocus) {\n event.target.select();\n }\n this.$emit('focus', event);\n },\n onInputBlur: function onInputBlur(event) {\n var _this$formField$onBlu, _this$formField2;\n this.focused = false;\n var input = event.target;\n var newValue = this.validateValue(this.parseValue(input.value));\n this.$emit('blur', {\n originalEvent: event,\n value: input.value\n });\n (_this$formField$onBlu = (_this$formField2 = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField2, event);\n input.value = this.formatValue(newValue);\n input.setAttribute('aria-valuenow', newValue);\n this.updateModel(event, newValue);\n if (!this.disabled && !this.readonly && this.highlightOnFocus) {\n clearSelection();\n }\n },\n clearTimer: function clearTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n },\n maxBoundry: function maxBoundry() {\n return this.d_value >= this.max;\n },\n minBoundry: function minBoundry() {\n return this.d_value <= this.min;\n }\n },\n computed: {\n upButtonListeners: function upButtonListeners() {\n var _this2 = this;\n return {\n mousedown: function mousedown(event) {\n return _this2.onUpButtonMouseDown(event);\n },\n mouseup: function mouseup(event) {\n return _this2.onUpButtonMouseUp(event);\n },\n mouseleave: function mouseleave(event) {\n return _this2.onUpButtonMouseLeave(event);\n },\n keydown: function keydown(event) {\n return _this2.onUpButtonKeyDown(event);\n },\n keyup: function keyup(event) {\n return _this2.onUpButtonKeyUp(event);\n }\n };\n },\n downButtonListeners: function downButtonListeners() {\n var _this3 = this;\n return {\n mousedown: function mousedown(event) {\n return _this3.onDownButtonMouseDown(event);\n },\n mouseup: function mouseup(event) {\n return _this3.onDownButtonMouseUp(event);\n },\n mouseleave: function mouseleave(event) {\n return _this3.onDownButtonMouseLeave(event);\n },\n keydown: function keydown(event) {\n return _this3.onDownButtonKeyDown(event);\n },\n keyup: function keyup(event) {\n return _this3.onDownButtonKeyUp(event);\n }\n };\n },\n formattedValue: function formattedValue() {\n var val = !this.d_value && !this.allowEmpty ? 0 : this.d_value;\n return this.formatValue(val);\n },\n getFormatter: function getFormatter() {\n return this.numberFormat;\n }\n },\n components: {\n InputText: InputText,\n AngleUpIcon: AngleUpIcon,\n AngleDownIcon: AngleDownIcon\n }\n};\n\nvar _hoisted_1 = [\"disabled\"];\nvar _hoisted_2 = [\"disabled\"];\nvar _hoisted_3 = [\"disabled\"];\nvar _hoisted_4 = [\"disabled\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_InputText = resolveComponent(\"InputText\");\n return openBlock(), createElementBlock(\"span\", mergeProps({\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), [createVNode(_component_InputText, {\n ref: \"input\",\n id: _ctx.inputId,\n role: \"spinbutton\",\n \"class\": normalizeClass([_ctx.cx('pcInputText'), _ctx.inputClass]),\n style: normalizeStyle(_ctx.inputStyle),\n value: $options.formattedValue,\n \"aria-valuemin\": _ctx.min,\n \"aria-valuemax\": _ctx.max,\n \"aria-valuenow\": _ctx.d_value,\n inputmode: _ctx.mode === 'decimal' && !_ctx.minFractionDigits ? 'numeric' : 'decimal',\n disabled: _ctx.disabled,\n readonly: _ctx.readonly,\n placeholder: _ctx.placeholder,\n \"aria-labelledby\": _ctx.ariaLabelledby,\n \"aria-label\": _ctx.ariaLabel,\n size: _ctx.size,\n invalid: _ctx.invalid,\n variant: _ctx.variant,\n onInput: $options.onUserInput,\n onKeydown: $options.onInputKeyDown,\n onKeypress: $options.onInputKeyPress,\n onPaste: $options.onPaste,\n onClick: $options.onInputClick,\n onFocus: $options.onInputFocus,\n onBlur: $options.onInputBlur,\n pt: _ctx.ptm('pcInputText'),\n unstyled: _ctx.unstyled\n }, null, 8, [\"id\", \"class\", \"style\", \"value\", \"aria-valuemin\", \"aria-valuemax\", \"aria-valuenow\", \"inputmode\", \"disabled\", \"readonly\", \"placeholder\", \"aria-labelledby\", \"aria-label\", \"size\", \"invalid\", \"variant\", \"onInput\", \"onKeydown\", \"onKeypress\", \"onPaste\", \"onClick\", \"onFocus\", \"onBlur\", \"pt\", \"unstyled\"]), _ctx.showButtons && _ctx.buttonLayout === 'stacked' ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('buttonGroup')\n }, _ctx.ptm('buttonGroup')), [renderSlot(_ctx.$slots, \"incrementbutton\", {\n listeners: $options.upButtonListeners\n }, function () {\n return [createElementVNode(\"button\", mergeProps({\n \"class\": [_ctx.cx('incrementButton'), _ctx.incrementButtonClass]\n }, toHandlers($options.upButtonListeners, true), {\n disabled: _ctx.disabled,\n tabindex: -1,\n \"aria-hidden\": \"true\",\n type: \"button\"\n }, _ctx.ptm('incrementButton')), [renderSlot(_ctx.$slots, _ctx.$slots.incrementicon ? 'incrementicon' : 'incrementbuttonicon', {}, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.incrementIcon || _ctx.incrementButtonIcon ? 'span' : 'AngleUpIcon'), mergeProps({\n \"class\": [_ctx.incrementIcon, _ctx.incrementButtonIcon]\n }, _ctx.ptm('incrementIcon'), {\n \"data-pc-section\": \"incrementicon\"\n }), null, 16, [\"class\"]))];\n })], 16, _hoisted_1)];\n }), renderSlot(_ctx.$slots, \"decrementbutton\", {\n listeners: $options.downButtonListeners\n }, function () {\n return [createElementVNode(\"button\", mergeProps({\n \"class\": [_ctx.cx('decrementButton'), _ctx.decrementButtonClass]\n }, toHandlers($options.downButtonListeners, true), {\n disabled: _ctx.disabled,\n tabindex: -1,\n \"aria-hidden\": \"true\",\n type: \"button\"\n }, _ctx.ptm('decrementButton')), [renderSlot(_ctx.$slots, _ctx.$slots.decrementicon ? 'decrementicon' : 'decrementbuttonicon', {}, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.decrementIcon || _ctx.decrementButtonIcon ? 'span' : 'AngleDownIcon'), mergeProps({\n \"class\": [_ctx.decrementIcon, _ctx.decrementButtonIcon]\n }, _ctx.ptm('decrementIcon'), {\n \"data-pc-section\": \"decrementicon\"\n }), null, 16, [\"class\"]))];\n })], 16, _hoisted_2)];\n })], 16)) : createCommentVNode(\"\", true), renderSlot(_ctx.$slots, \"incrementbutton\", {\n listeners: $options.upButtonListeners\n }, function () {\n return [_ctx.showButtons && _ctx.buttonLayout !== 'stacked' ? (openBlock(), createElementBlock(\"button\", mergeProps({\n key: 0,\n \"class\": [_ctx.cx('incrementButton'), _ctx.incrementButtonClass]\n }, toHandlers($options.upButtonListeners, true), {\n disabled: _ctx.disabled,\n tabindex: -1,\n \"aria-hidden\": \"true\",\n type: \"button\"\n }, _ctx.ptm('incrementButton')), [renderSlot(_ctx.$slots, _ctx.$slots.incrementicon ? 'incrementicon' : 'incrementbuttonicon', {}, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.incrementIcon || _ctx.incrementButtonIcon ? 'span' : 'AngleUpIcon'), mergeProps({\n \"class\": [_ctx.incrementIcon, _ctx.incrementButtonIcon]\n }, _ctx.ptm('incrementIcon'), {\n \"data-pc-section\": \"incrementicon\"\n }), null, 16, [\"class\"]))];\n })], 16, _hoisted_3)) : createCommentVNode(\"\", true)];\n }), renderSlot(_ctx.$slots, \"decrementbutton\", {\n listeners: $options.downButtonListeners\n }, function () {\n return [_ctx.showButtons && _ctx.buttonLayout !== 'stacked' ? (openBlock(), createElementBlock(\"button\", mergeProps({\n key: 0,\n \"class\": [_ctx.cx('decrementButton'), _ctx.decrementButtonClass]\n }, toHandlers($options.downButtonListeners, true), {\n disabled: _ctx.disabled,\n tabindex: -1,\n \"aria-hidden\": \"true\",\n type: \"button\"\n }, _ctx.ptm('decrementButton')), [renderSlot(_ctx.$slots, _ctx.$slots.decrementicon ? 'decrementicon' : 'decrementbuttonicon', {}, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.decrementIcon || _ctx.decrementButtonIcon ? 'span' : 'AngleDownIcon'), mergeProps({\n \"class\": [_ctx.decrementIcon, _ctx.decrementButtonIcon]\n }, _ctx.ptm('decrementIcon'), {\n \"data-pc-section\": \"decrementicon\"\n }), null, 16, [\"class\"]))];\n })], 16, _hoisted_4)) : createCommentVNode(\"\", true)];\n })], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-toggleswitch {\\n display: inline-block;\\n width: \".concat(dt('toggleswitch.width'), \";\\n height: \").concat(dt('toggleswitch.height'), \";\\n}\\n\\n.p-toggleswitch-input {\\n cursor: pointer;\\n appearance: none;\\n position: absolute;\\n top: 0;\\n inset-inline-start: 0;\\n width: 100%;\\n height: 100%;\\n padding: 0;\\n margin: 0;\\n opacity: 0;\\n z-index: 1;\\n outline: 0 none;\\n border-radius: \").concat(dt('toggleswitch.border.radius'), \";\\n}\\n\\n.p-toggleswitch-slider {\\n cursor: pointer;\\n width: 100%;\\n height: 100%;\\n border-width: \").concat(dt('toggleswitch.border.width'), \";\\n border-style: solid;\\n border-color: \").concat(dt('toggleswitch.border.color'), \";\\n background: \").concat(dt('toggleswitch.background'), \";\\n transition: background \").concat(dt('toggleswitch.transition.duration'), \", color \").concat(dt('toggleswitch.transition.duration'), \", border-color \").concat(dt('toggleswitch.transition.duration'), \", outline-color \").concat(dt('toggleswitch.transition.duration'), \", box-shadow \").concat(dt('toggleswitch.transition.duration'), \";\\n border-radius: \").concat(dt('toggleswitch.border.radius'), \";\\n outline-color: transparent;\\n box-shadow: \").concat(dt('toggleswitch.shadow'), \";\\n}\\n\\n.p-toggleswitch-handle {\\n position: absolute;\\n top: 50%;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n background: \").concat(dt('toggleswitch.handle.background'), \";\\n color: \").concat(dt('toggleswitch.handle.color'), \";\\n width: \").concat(dt('toggleswitch.handle.size'), \";\\n height: \").concat(dt('toggleswitch.handle.size'), \";\\n inset-inline-start: \").concat(dt('toggleswitch.gap'), \";\\n margin-block-start: calc(-1 * calc(\").concat(dt('toggleswitch.handle.size'), \" / 2));\\n border-radius: \").concat(dt('toggleswitch.handle.border.radius'), \";\\n transition: background \").concat(dt('toggleswitch.transition.duration'), \", color \").concat(dt('toggleswitch.transition.duration'), \", inset-inline-start \").concat(dt('toggleswitch.slide.duration'), \", box-shadow \").concat(dt('toggleswitch.slide.duration'), \";\\n}\\n\\n.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-slider {\\n background: \").concat(dt('toggleswitch.checked.background'), \";\\n border-color: \").concat(dt('toggleswitch.checked.border.color'), \";\\n}\\n\\n.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-handle {\\n background: \").concat(dt('toggleswitch.handle.checked.background'), \";\\n color: \").concat(dt('toggleswitch.handle.checked.color'), \";\\n inset-inline-start: calc(\").concat(dt('toggleswitch.width'), \" - calc(\").concat(dt('toggleswitch.handle.size'), \" + \").concat(dt('toggleswitch.gap'), \"));\\n}\\n\\n.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-slider {\\n background: \").concat(dt('toggleswitch.hover.background'), \";\\n border-color: \").concat(dt('toggleswitch.hover.border.color'), \";\\n}\\n\\n.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-handle {\\n background: \").concat(dt('toggleswitch.handle.hover.background'), \";\\n color: \").concat(dt('toggleswitch.handle.hover.color'), \";\\n}\\n\\n.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover).p-toggleswitch-checked .p-toggleswitch-slider {\\n background: \").concat(dt('toggleswitch.checked.hover.background'), \";\\n border-color: \").concat(dt('toggleswitch.checked.hover.border.color'), \";\\n}\\n\\n.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover).p-toggleswitch-checked .p-toggleswitch-handle {\\n background: \").concat(dt('toggleswitch.handle.checked.hover.background'), \";\\n color: \").concat(dt('toggleswitch.handle.checked.hover.color'), \";\\n}\\n\\n.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:focus-visible) .p-toggleswitch-slider {\\n box-shadow: \").concat(dt('toggleswitch.focus.ring.shadow'), \";\\n outline: \").concat(dt('toggleswitch.focus.ring.width'), \" \").concat(dt('toggleswitch.focus.ring.style'), \" \").concat(dt('toggleswitch.focus.ring.color'), \";\\n outline-offset: \").concat(dt('toggleswitch.focus.ring.offset'), \";\\n}\\n\\n.p-toggleswitch.p-invalid > .p-toggleswitch-slider {\\n border-color: \").concat(dt('toggleswitch.invalid.border.color'), \";\\n}\\n\\n.p-toggleswitch.p-disabled {\\n opacity: 1;\\n}\\n\\n.p-toggleswitch.p-disabled .p-toggleswitch-slider {\\n background: \").concat(dt('toggleswitch.disabled.background'), \";\\n}\\n\\n.p-toggleswitch.p-disabled .p-toggleswitch-handle {\\n background: \").concat(dt('toggleswitch.handle.disabled.background'), \";\\n}\\n\");\n};\nvar inlineStyles = {\n root: {\n position: 'relative'\n }\n};\nvar classes = {\n root: function root(_ref2) {\n var instance = _ref2.instance,\n props = _ref2.props;\n return ['p-toggleswitch p-component', {\n 'p-toggleswitch-checked': instance.checked,\n 'p-disabled': props.disabled,\n 'p-invalid': instance.$invalid\n }];\n },\n input: 'p-toggleswitch-input',\n slider: 'p-toggleswitch-slider',\n handle: 'p-toggleswitch-handle'\n};\nvar ToggleSwitchStyle = BaseStyle.extend({\n name: 'toggleswitch',\n theme: theme,\n classes: classes,\n inlineStyles: inlineStyles\n});\n\nexport { ToggleSwitchStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseEditableHolder from '@primevue/core/baseeditableholder';\nimport ToggleSwitchStyle from 'primevue/toggleswitch/style';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode, renderSlot } from 'vue';\n\nvar script$1 = {\n name: 'BaseToggleSwitch',\n \"extends\": BaseEditableHolder,\n props: {\n trueValue: {\n type: null,\n \"default\": true\n },\n falseValue: {\n type: null,\n \"default\": false\n },\n readonly: {\n type: Boolean,\n \"default\": false\n },\n tabindex: {\n type: Number,\n \"default\": null\n },\n inputId: {\n type: String,\n \"default\": null\n },\n inputClass: {\n type: [String, Object],\n \"default\": null\n },\n inputStyle: {\n type: Object,\n \"default\": null\n },\n ariaLabelledby: {\n type: String,\n \"default\": null\n },\n ariaLabel: {\n type: String,\n \"default\": null\n }\n },\n style: ToggleSwitchStyle,\n provide: function provide() {\n return {\n $pcToggleSwitch: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'ToggleSwitch',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['change', 'focus', 'blur'],\n methods: {\n getPTOptions: function getPTOptions(key) {\n var _ptm = key === 'root' ? this.ptmi : this.ptm;\n return _ptm(key, {\n context: {\n checked: this.checked,\n disabled: this.disabled\n }\n });\n },\n onChange: function onChange(event) {\n if (!this.disabled && !this.readonly) {\n var newValue = this.checked ? this.falseValue : this.trueValue;\n this.writeValue(newValue, event);\n this.$emit('change', event);\n }\n },\n onFocus: function onFocus(event) {\n this.$emit('focus', event);\n },\n onBlur: function onBlur(event) {\n var _this$formField$onBlu, _this$formField;\n this.$emit('blur', event);\n (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField, event);\n }\n },\n computed: {\n checked: function checked() {\n return this.d_value === this.trueValue;\n }\n }\n};\n\nvar _hoisted_1 = [\"data-p-checked\", \"data-p-disabled\"];\nvar _hoisted_2 = [\"id\", \"checked\", \"tabindex\", \"disabled\", \"readonly\", \"aria-checked\", \"aria-labelledby\", \"aria-label\", \"aria-invalid\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root'),\n style: _ctx.sx('root')\n }, $options.getPTOptions('root'), {\n \"data-p-checked\": $options.checked,\n \"data-p-disabled\": _ctx.disabled\n }), [createElementVNode(\"input\", mergeProps({\n id: _ctx.inputId,\n type: \"checkbox\",\n role: \"switch\",\n \"class\": [_ctx.cx('input'), _ctx.inputClass],\n style: _ctx.inputStyle,\n checked: $options.checked,\n tabindex: _ctx.tabindex,\n disabled: _ctx.disabled,\n readonly: _ctx.readonly,\n \"aria-checked\": $options.checked,\n \"aria-labelledby\": _ctx.ariaLabelledby,\n \"aria-label\": _ctx.ariaLabel,\n \"aria-invalid\": _ctx.invalid || undefined,\n onFocus: _cache[0] || (_cache[0] = function () {\n return $options.onFocus && $options.onFocus.apply($options, arguments);\n }),\n onBlur: _cache[1] || (_cache[1] = function () {\n return $options.onBlur && $options.onBlur.apply($options, arguments);\n }),\n onChange: _cache[2] || (_cache[2] = function () {\n return $options.onChange && $options.onChange.apply($options, arguments);\n })\n }, $options.getPTOptions('input')), null, 16, _hoisted_2), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('slider')\n }, $options.getPTOptions('slider')), [createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('handle')\n }, $options.getPTOptions('handle')), [renderSlot(_ctx.$slots, \"handle\", {\n checked: $options.checked\n })], 16)], 16)], 16, _hoisted_1);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","\n\n\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-colorpicker {\\n display: inline-block;\\n position: relative;\\n}\\n\\n.p-colorpicker-dragging {\\n cursor: pointer;\\n}\\n\\n.p-colorpicker-preview {\\n width: \".concat(dt('colorpicker.preview.width'), \";\\n height: \").concat(dt('colorpicker.preview.height'), \";\\n padding: 0;\\n border: 0 none;\\n border-radius: \").concat(dt('colorpicker.preview.border.radius'), \";\\n transition: background \").concat(dt('colorpicker.transition.duration'), \", color \").concat(dt('colorpicker.transition.duration'), \", border-color \").concat(dt('colorpicker.transition.duration'), \", outline-color \").concat(dt('colorpicker.transition.duration'), \", box-shadow \").concat(dt('colorpicker.transition.duration'), \";\\n outline-color: transparent;\\n cursor: pointer;\\n}\\n\\n.p-colorpicker-preview:enabled:focus-visible {\\n border-color: \").concat(dt('colorpicker.preview.focus.border.color'), \";\\n box-shadow: \").concat(dt('colorpicker.preview.focus.ring.shadow'), \";\\n outline: \").concat(dt('colorpicker.preview.focus.ring.width'), \" \").concat(dt('colorpicker.preview.focus.ring.style'), \" \").concat(dt('colorpicker.preview.focus.ring.color'), \";\\n outline-offset: \").concat(dt('colorpicker.preview.focus.ring.offset'), \";\\n}\\n\\n.p-colorpicker-panel {\\n background: \").concat(dt('colorpicker.panel.background'), \";\\n border: 1px solid \").concat(dt('colorpicker.panel.border.color'), \";\\n border-radius: \").concat(dt('colorpicker.panel.border.radius'), \";\\n box-shadow: \").concat(dt('colorpicker.panel.shadow'), \";\\n width: 193px;\\n height: 166px;\\n position: absolute;\\n top: 0;\\n left: 0;\\n}\\n\\n.p-colorpicker-panel-inline {\\n box-shadow: none;\\n position: static;\\n}\\n\\n.p-colorpicker-content {\\n position: relative;\\n}\\n\\n.p-colorpicker-color-selector {\\n width: 150px;\\n height: 150px;\\n inset-block-start: 8px;\\n inset-inline-start: 8px;\\n position: absolute;\\n}\\n\\n.p-colorpicker-color-background {\\n width: 100%;\\n height: 100%;\\n background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 100%), linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%);\\n}\\n\\n.p-colorpicker-color-handle {\\n position: absolute;\\n inset-block-start: 0px;\\n inset-inline-start: 150px;\\n border-radius: 100%;\\n width: 10px;\\n height: 10px;\\n border-width: 1px;\\n border-style: solid;\\n margin: -5px 0 0 -5px;\\n cursor: pointer;\\n opacity: 0.85;\\n border-color: \").concat(dt('colorpicker.handle.color'), \";\\n}\\n\\n.p-colorpicker-hue {\\n width: 17px;\\n height: 150px;\\n inset-block-start: 8px;\\n inset-inline-start: 167px;\\n position: absolute;\\n opacity: 0.85;\\n background: linear-gradient(0deg,\\n red 0,\\n #ff0 17%,\\n #0f0 33%,\\n #0ff 50%,\\n #00f 67%,\\n #f0f 83%,\\n red);\\n}\\n\\n.p-colorpicker-hue-handle {\\n position: absolute;\\n inset-block-start: 150px;\\n inset-inline-start: 0px;\\n width: 21px;\\n margin-inline-start: -2px;\\n margin-block-start: -5px;\\n height: 10px;\\n border-width: 2px;\\n border-style: solid;\\n opacity: 0.85;\\n cursor: pointer;\\n border-color: \").concat(dt('colorpicker.handle.color'), \";\\n}\\n\");\n};\nvar classes = {\n root: 'p-colorpicker p-component',\n preview: function preview(_ref2) {\n var props = _ref2.props;\n return ['p-colorpicker-preview', {\n 'p-disabled': props.disabled\n }];\n },\n panel: function panel(_ref3) {\n var instance = _ref3.instance,\n props = _ref3.props;\n return ['p-colorpicker-panel', {\n 'p-colorpicker-panel-inline': props.inline,\n 'p-disabled': props.disabled,\n 'p-invalid': instance.$invalid\n }];\n },\n colorSelector: 'p-colorpicker-color-selector',\n colorBackground: 'p-colorpicker-color-background',\n colorHandle: 'p-colorpicker-color-handle',\n hue: 'p-colorpicker-hue',\n hueHandle: 'p-colorpicker-hue-handle'\n};\nvar ColorPickerStyle = BaseStyle.extend({\n name: 'colorpicker',\n theme: theme,\n classes: classes\n});\n\nexport { ColorPickerStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { relativePosition, absolutePosition, addClass, removeClass, isTouchDevice } from '@primeuix/utils/dom';\nimport { ZIndex } from '@primeuix/utils/zindex';\nimport { ConnectedOverlayScrollHandler } from '@primevue/core/utils';\nimport OverlayEventBus from 'primevue/overlayeventbus';\nimport Portal from 'primevue/portal';\nimport BaseEditableHolder from '@primevue/core/baseeditableholder';\nimport ColorPickerStyle from 'primevue/colorpicker/style';\nimport { resolveComponent, openBlock, createElementBlock, mergeProps, createCommentVNode, createVNode, withCtx, Transition, createElementVNode } from 'vue';\n\nvar script$1 = {\n name: 'BaseColorPicker',\n \"extends\": BaseEditableHolder,\n props: {\n defaultColor: {\n type: null,\n \"default\": 'ff0000'\n },\n inline: {\n type: Boolean,\n \"default\": false\n },\n format: {\n type: String,\n \"default\": 'hex'\n },\n tabindex: {\n type: String,\n \"default\": null\n },\n autoZIndex: {\n type: Boolean,\n \"default\": true\n },\n baseZIndex: {\n type: Number,\n \"default\": 0\n },\n appendTo: {\n type: [String, Object],\n \"default\": 'body'\n },\n inputId: {\n type: String,\n \"default\": null\n },\n panelClass: null,\n overlayClass: null\n },\n style: ColorPickerStyle,\n provide: function provide() {\n return {\n $pcColorPicker: this,\n $parentInstance: this\n };\n }\n};\n\nvar script = {\n name: 'ColorPicker',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['change', 'show', 'hide'],\n data: function data() {\n return {\n overlayVisible: false\n };\n },\n hsbValue: null,\n outsideClickListener: null,\n documentMouseMoveListener: null,\n documentMouseUpListener: null,\n scrollHandler: null,\n resizeListener: null,\n hueDragging: null,\n colorDragging: null,\n selfUpdate: null,\n picker: null,\n colorSelector: null,\n colorHandle: null,\n hueView: null,\n hueHandle: null,\n watch: {\n modelValue: {\n immediate: true,\n handler: function handler(newValue) {\n this.hsbValue = this.toHSB(newValue);\n if (this.selfUpdate) this.selfUpdate = false;else this.updateUI();\n }\n }\n },\n beforeUnmount: function beforeUnmount() {\n this.unbindOutsideClickListener();\n this.unbindDragListeners();\n this.unbindResizeListener();\n if (this.scrollHandler) {\n this.scrollHandler.destroy();\n this.scrollHandler = null;\n }\n if (this.picker && this.autoZIndex) {\n ZIndex.clear(this.picker);\n }\n this.clearRefs();\n },\n mounted: function mounted() {\n this.updateUI();\n },\n methods: {\n pickColor: function pickColor(event) {\n var rect = this.colorSelector.getBoundingClientRect();\n var top = rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0);\n var left = rect.left + document.body.scrollLeft;\n var saturation = Math.floor(100 * Math.max(0, Math.min(150, (event.pageX || event.changedTouches[0].pageX) - left)) / 150);\n var brightness = Math.floor(100 * (150 - Math.max(0, Math.min(150, (event.pageY || event.changedTouches[0].pageY) - top))) / 150);\n this.hsbValue = this.validateHSB({\n h: this.hsbValue.h,\n s: saturation,\n b: brightness\n });\n this.selfUpdate = true;\n this.updateColorHandle();\n this.updateInput();\n this.updateModel(event);\n },\n pickHue: function pickHue(event) {\n var top = this.hueView.getBoundingClientRect().top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0);\n this.hsbValue = this.validateHSB({\n h: Math.floor(360 * (150 - Math.max(0, Math.min(150, (event.pageY || event.changedTouches[0].pageY) - top))) / 150),\n s: 100,\n b: 100\n });\n this.selfUpdate = true;\n this.updateColorSelector();\n this.updateHue();\n this.updateModel(event);\n this.updateInput();\n },\n updateModel: function updateModel(event) {\n var value = this.d_value;\n switch (this.format) {\n case 'hex':\n value = this.HSBtoHEX(this.hsbValue);\n break;\n case 'rgb':\n value = this.HSBtoRGB(this.hsbValue);\n break;\n case 'hsb':\n value = this.hsbValue;\n break;\n }\n this.writeValue(value, event);\n this.$emit('change', {\n event: event,\n value: value\n });\n },\n updateColorSelector: function updateColorSelector() {\n if (this.colorSelector) {\n var hsbValue = this.validateHSB({\n h: this.hsbValue.h,\n s: 100,\n b: 100\n });\n this.colorSelector.style.backgroundColor = '#' + this.HSBtoHEX(hsbValue);\n }\n },\n updateColorHandle: function updateColorHandle() {\n if (this.colorHandle) {\n this.colorHandle.style.left = Math.floor(150 * this.hsbValue.s / 100) + 'px';\n this.colorHandle.style.top = Math.floor(150 * (100 - this.hsbValue.b) / 100) + 'px';\n }\n },\n updateHue: function updateHue() {\n if (this.hueHandle) {\n this.hueHandle.style.top = Math.floor(150 - 150 * this.hsbValue.h / 360) + 'px';\n }\n },\n updateInput: function updateInput() {\n if (this.$refs.input) {\n this.$refs.input.style.backgroundColor = '#' + this.HSBtoHEX(this.hsbValue);\n }\n },\n updateUI: function updateUI() {\n this.updateHue();\n this.updateColorHandle();\n this.updateInput();\n this.updateColorSelector();\n },\n validateHSB: function validateHSB(hsb) {\n return {\n h: Math.min(360, Math.max(0, hsb.h)),\n s: Math.min(100, Math.max(0, hsb.s)),\n b: Math.min(100, Math.max(0, hsb.b))\n };\n },\n validateRGB: function validateRGB(rgb) {\n return {\n r: Math.min(255, Math.max(0, rgb.r)),\n g: Math.min(255, Math.max(0, rgb.g)),\n b: Math.min(255, Math.max(0, rgb.b))\n };\n },\n validateHEX: function validateHEX(hex) {\n var len = 6 - hex.length;\n if (len > 0) {\n var o = [];\n for (var i = 0; i < len; i++) {\n o.push('0');\n }\n o.push(hex);\n hex = o.join('');\n }\n return hex;\n },\n HEXtoRGB: function HEXtoRGB(hex) {\n var hexValue = parseInt(hex.indexOf('#') > -1 ? hex.substring(1) : hex, 16);\n return {\n r: hexValue >> 16,\n g: (hexValue & 0x00ff00) >> 8,\n b: hexValue & 0x0000ff\n };\n },\n HEXtoHSB: function HEXtoHSB(hex) {\n return this.RGBtoHSB(this.HEXtoRGB(hex));\n },\n RGBtoHSB: function RGBtoHSB(rgb) {\n var hsb = {\n h: 0,\n s: 0,\n b: 0\n };\n var min = Math.min(rgb.r, rgb.g, rgb.b);\n var max = Math.max(rgb.r, rgb.g, rgb.b);\n var delta = max - min;\n hsb.b = max;\n hsb.s = max !== 0 ? 255 * delta / max : 0;\n if (hsb.s !== 0) {\n if (rgb.r === max) {\n hsb.h = (rgb.g - rgb.b) / delta;\n } else if (rgb.g === max) {\n hsb.h = 2 + (rgb.b - rgb.r) / delta;\n } else {\n hsb.h = 4 + (rgb.r - rgb.g) / delta;\n }\n } else {\n hsb.h = -1;\n }\n hsb.h *= 60;\n if (hsb.h < 0) {\n hsb.h += 360;\n }\n hsb.s *= 100 / 255;\n hsb.b *= 100 / 255;\n return hsb;\n },\n HSBtoRGB: function HSBtoRGB(hsb) {\n var rgb = {\n r: null,\n g: null,\n b: null\n };\n var h = Math.round(hsb.h);\n var s = Math.round(hsb.s * 255 / 100);\n var v = Math.round(hsb.b * 255 / 100);\n if (s === 0) {\n rgb = {\n r: v,\n g: v,\n b: v\n };\n } else {\n var t1 = v;\n var t2 = (255 - s) * v / 255;\n var t3 = (t1 - t2) * (h % 60) / 60;\n if (h === 360) h = 0;\n if (h < 60) {\n rgb.r = t1;\n rgb.b = t2;\n rgb.g = t2 + t3;\n } else if (h < 120) {\n rgb.g = t1;\n rgb.b = t2;\n rgb.r = t1 - t3;\n } else if (h < 180) {\n rgb.g = t1;\n rgb.r = t2;\n rgb.b = t2 + t3;\n } else if (h < 240) {\n rgb.b = t1;\n rgb.r = t2;\n rgb.g = t1 - t3;\n } else if (h < 300) {\n rgb.b = t1;\n rgb.g = t2;\n rgb.r = t2 + t3;\n } else if (h < 360) {\n rgb.r = t1;\n rgb.g = t2;\n rgb.b = t1 - t3;\n } else {\n rgb.r = 0;\n rgb.g = 0;\n rgb.b = 0;\n }\n }\n return {\n r: Math.round(rgb.r),\n g: Math.round(rgb.g),\n b: Math.round(rgb.b)\n };\n },\n RGBtoHEX: function RGBtoHEX(rgb) {\n var hex = [rgb.r.toString(16), rgb.g.toString(16), rgb.b.toString(16)];\n for (var key in hex) {\n if (hex[key].length === 1) {\n hex[key] = '0' + hex[key];\n }\n }\n return hex.join('');\n },\n HSBtoHEX: function HSBtoHEX(hsb) {\n return this.RGBtoHEX(this.HSBtoRGB(hsb));\n },\n toHSB: function toHSB(value) {\n var hsb;\n if (value) {\n switch (this.format) {\n case 'hex':\n hsb = this.HEXtoHSB(value);\n break;\n case 'rgb':\n hsb = this.RGBtoHSB(value);\n break;\n case 'hsb':\n hsb = value;\n break;\n }\n } else {\n hsb = this.HEXtoHSB(this.defaultColor);\n }\n return hsb;\n },\n onOverlayEnter: function onOverlayEnter(el) {\n this.updateUI();\n this.alignOverlay();\n this.bindOutsideClickListener();\n this.bindScrollListener();\n this.bindResizeListener();\n if (this.autoZIndex) {\n ZIndex.set('overlay', el, this.baseZIndex, this.$primevue.config.zIndex.overlay);\n }\n this.$emit('show');\n },\n onOverlayLeave: function onOverlayLeave() {\n this.unbindOutsideClickListener();\n this.unbindScrollListener();\n this.unbindResizeListener();\n this.clearRefs();\n this.$emit('hide');\n },\n onOverlayAfterLeave: function onOverlayAfterLeave(el) {\n if (this.autoZIndex) {\n ZIndex.clear(el);\n }\n },\n alignOverlay: function alignOverlay() {\n if (this.appendTo === 'self') relativePosition(this.picker, this.$refs.input);else absolutePosition(this.picker, this.$refs.input);\n },\n onInputClick: function onInputClick() {\n if (this.disabled) {\n return;\n }\n this.overlayVisible = !this.overlayVisible;\n },\n onInputKeydown: function onInputKeydown(event) {\n switch (event.code) {\n case 'Space':\n this.overlayVisible = !this.overlayVisible;\n event.preventDefault();\n break;\n case 'Escape':\n case 'Tab':\n this.overlayVisible = false;\n break;\n }\n },\n onInputBlur: function onInputBlur(event) {\n var _this$formField$onBlu, _this$formField;\n (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField);\n },\n onColorMousedown: function onColorMousedown(event) {\n if (this.disabled) {\n return;\n }\n this.bindDragListeners();\n this.onColorDragStart(event);\n },\n onColorDragStart: function onColorDragStart(event) {\n if (this.disabled) {\n return;\n }\n this.colorDragging = true;\n this.pickColor(event);\n this.$el.setAttribute('p-colorpicker-dragging', 'true');\n !this.isUnstyled && addClass(this.$el, 'p-colorpicker-dragging');\n event.preventDefault();\n },\n onDrag: function onDrag(event) {\n if (this.colorDragging) {\n this.pickColor(event);\n event.preventDefault();\n }\n if (this.hueDragging) {\n this.pickHue(event);\n event.preventDefault();\n }\n },\n onDragEnd: function onDragEnd() {\n this.colorDragging = false;\n this.hueDragging = false;\n this.$el.setAttribute('p-colorpicker-dragging', 'false');\n !this.isUnstyled && removeClass(this.$el, 'p-colorpicker-dragging');\n this.unbindDragListeners();\n },\n onHueMousedown: function onHueMousedown(event) {\n if (this.disabled) {\n return;\n }\n this.bindDragListeners();\n this.onHueDragStart(event);\n },\n onHueDragStart: function onHueDragStart(event) {\n if (this.disabled) {\n return;\n }\n this.hueDragging = true;\n this.pickHue(event);\n !this.isUnstyled && addClass(this.$el, 'p-colorpicker-dragging');\n },\n isInputClicked: function isInputClicked(event) {\n return this.$refs.input && this.$refs.input.isSameNode(event.target);\n },\n bindDragListeners: function bindDragListeners() {\n this.bindDocumentMouseMoveListener();\n this.bindDocumentMouseUpListener();\n },\n unbindDragListeners: function unbindDragListeners() {\n this.unbindDocumentMouseMoveListener();\n this.unbindDocumentMouseUpListener();\n },\n bindOutsideClickListener: function bindOutsideClickListener() {\n var _this = this;\n if (!this.outsideClickListener) {\n this.outsideClickListener = function (event) {\n if (_this.overlayVisible && _this.picker && !_this.picker.contains(event.target) && !_this.isInputClicked(event)) {\n _this.overlayVisible = false;\n }\n };\n document.addEventListener('click', this.outsideClickListener);\n }\n },\n unbindOutsideClickListener: function unbindOutsideClickListener() {\n if (this.outsideClickListener) {\n document.removeEventListener('click', this.outsideClickListener);\n this.outsideClickListener = null;\n }\n },\n bindScrollListener: function bindScrollListener() {\n var _this2 = this;\n if (!this.scrollHandler) {\n this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.container, function () {\n if (_this2.overlayVisible) {\n _this2.overlayVisible = false;\n }\n });\n }\n this.scrollHandler.bindScrollListener();\n },\n unbindScrollListener: function unbindScrollListener() {\n if (this.scrollHandler) {\n this.scrollHandler.unbindScrollListener();\n }\n },\n bindResizeListener: function bindResizeListener() {\n var _this3 = this;\n if (!this.resizeListener) {\n this.resizeListener = function () {\n if (_this3.overlayVisible && !isTouchDevice()) {\n _this3.overlayVisible = false;\n }\n };\n window.addEventListener('resize', this.resizeListener);\n }\n },\n unbindResizeListener: function unbindResizeListener() {\n if (this.resizeListener) {\n window.removeEventListener('resize', this.resizeListener);\n this.resizeListener = null;\n }\n },\n bindDocumentMouseMoveListener: function bindDocumentMouseMoveListener() {\n if (!this.documentMouseMoveListener) {\n this.documentMouseMoveListener = this.onDrag.bind(this);\n document.addEventListener('mousemove', this.documentMouseMoveListener);\n }\n },\n unbindDocumentMouseMoveListener: function unbindDocumentMouseMoveListener() {\n if (this.documentMouseMoveListener) {\n document.removeEventListener('mousemove', this.documentMouseMoveListener);\n this.documentMouseMoveListener = null;\n }\n },\n bindDocumentMouseUpListener: function bindDocumentMouseUpListener() {\n if (!this.documentMouseUpListener) {\n this.documentMouseUpListener = this.onDragEnd.bind(this);\n document.addEventListener('mouseup', this.documentMouseUpListener);\n }\n },\n unbindDocumentMouseUpListener: function unbindDocumentMouseUpListener() {\n if (this.documentMouseUpListener) {\n document.removeEventListener('mouseup', this.documentMouseUpListener);\n this.documentMouseUpListener = null;\n }\n },\n pickerRef: function pickerRef(el) {\n this.picker = el;\n },\n colorSelectorRef: function colorSelectorRef(el) {\n this.colorSelector = el;\n },\n colorHandleRef: function colorHandleRef(el) {\n this.colorHandle = el;\n },\n hueViewRef: function hueViewRef(el) {\n this.hueView = el;\n },\n hueHandleRef: function hueHandleRef(el) {\n this.hueHandle = el;\n },\n clearRefs: function clearRefs() {\n this.picker = null;\n this.colorSelector = null;\n this.colorHandle = null;\n this.hueView = null;\n this.hueHandle = null;\n },\n onOverlayClick: function onOverlayClick(event) {\n OverlayEventBus.emit('overlay-click', {\n originalEvent: event,\n target: this.$el\n });\n }\n },\n components: {\n Portal: Portal\n }\n};\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar _hoisted_1 = [\"id\", \"tabindex\", \"disabled\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_Portal = resolveComponent(\"Portal\");\n return openBlock(), createElementBlock(\"div\", mergeProps({\n ref: \"container\",\n \"class\": _ctx.cx('root')\n }, _ctx.ptmi('root')), [!_ctx.inline ? (openBlock(), createElementBlock(\"input\", mergeProps({\n key: 0,\n ref: \"input\",\n id: _ctx.inputId,\n type: \"text\",\n \"class\": _ctx.cx('preview'),\n readonly: \"\",\n tabindex: _ctx.tabindex,\n disabled: _ctx.disabled,\n onClick: _cache[0] || (_cache[0] = function () {\n return $options.onInputClick && $options.onInputClick.apply($options, arguments);\n }),\n onKeydown: _cache[1] || (_cache[1] = function () {\n return $options.onInputKeydown && $options.onInputKeydown.apply($options, arguments);\n }),\n onBlur: _cache[2] || (_cache[2] = function () {\n return $options.onInputBlur && $options.onInputBlur.apply($options, arguments);\n })\n }, _ctx.ptm('preview')), null, 16, _hoisted_1)) : createCommentVNode(\"\", true), createVNode(_component_Portal, {\n appendTo: _ctx.appendTo,\n disabled: _ctx.inline\n }, {\n \"default\": withCtx(function () {\n return [createVNode(Transition, mergeProps({\n name: \"p-connected-overlay\",\n onEnter: $options.onOverlayEnter,\n onLeave: $options.onOverlayLeave,\n onAfterLeave: $options.onOverlayAfterLeave\n }, _ctx.ptm('transition')), {\n \"default\": withCtx(function () {\n return [(_ctx.inline ? true : $data.overlayVisible) ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n ref: $options.pickerRef,\n \"class\": [_ctx.cx('panel'), _ctx.panelClass, _ctx.overlayClass],\n onClick: _cache[11] || (_cache[11] = function () {\n return $options.onOverlayClick && $options.onOverlayClick.apply($options, arguments);\n })\n }, _objectSpread(_objectSpread({}, _ctx.ptm('panel')), _ctx.ptm('overlay'))), [createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('content')\n }, _ctx.ptm('content')), [createElementVNode(\"div\", mergeProps({\n ref: $options.colorSelectorRef,\n \"class\": _ctx.cx('colorSelector'),\n onMousedown: _cache[3] || (_cache[3] = function ($event) {\n return $options.onColorMousedown($event);\n }),\n onTouchstart: _cache[4] || (_cache[4] = function ($event) {\n return $options.onColorDragStart($event);\n }),\n onTouchmove: _cache[5] || (_cache[5] = function ($event) {\n return $options.onDrag($event);\n }),\n onTouchend: _cache[6] || (_cache[6] = function ($event) {\n return $options.onDragEnd();\n })\n }, _ctx.ptm('colorSelector')), [createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('colorBackground')\n }, _ctx.ptm('colorBackground')), [createElementVNode(\"div\", mergeProps({\n ref: $options.colorHandleRef,\n \"class\": _ctx.cx('colorHandle')\n }, _ctx.ptm('colorHandle')), null, 16)], 16)], 16), createElementVNode(\"div\", mergeProps({\n ref: $options.hueViewRef,\n \"class\": _ctx.cx('hue'),\n onMousedown: _cache[7] || (_cache[7] = function ($event) {\n return $options.onHueMousedown($event);\n }),\n onTouchstart: _cache[8] || (_cache[8] = function ($event) {\n return $options.onHueDragStart($event);\n }),\n onTouchmove: _cache[9] || (_cache[9] = function ($event) {\n return $options.onDrag($event);\n }),\n onTouchend: _cache[10] || (_cache[10] = function ($event) {\n return $options.onDragEnd();\n })\n }, _ctx.ptm('hue')), [createElementVNode(\"div\", mergeProps({\n ref: $options.hueHandleRef,\n \"class\": _ctx.cx('hueHandle')\n }, _ctx.ptm('hueHandle')), null, 16)], 16)], 16)], 16)) : createCommentVNode(\"\", true)];\n }),\n _: 1\n }, 16, [\"onEnter\", \"onLeave\", \"onAfterLeave\"])];\n }),\n _: 1\n }, 8, [\"appendTo\", \"disabled\"])], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","\n\n\n","\n\n\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-slider {\\n position: relative;\\n background: \".concat(dt('slider.track.background'), \";\\n border-radius: \").concat(dt('slider.track.border.radius'), \";\\n}\\n\\n.p-slider-handle {\\n cursor: grab;\\n touch-action: none;\\n user-select: none;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n height: \").concat(dt('slider.handle.height'), \";\\n width: \").concat(dt('slider.handle.width'), \";\\n background: \").concat(dt('slider.handle.background'), \";\\n border-radius: \").concat(dt('slider.handle.border.radius'), \";\\n transition: background \").concat(dt('slider.transition.duration'), \", color \").concat(dt('slider.transition.duration'), \", border-color \").concat(dt('slider.transition.duration'), \", box-shadow \").concat(dt('slider.transition.duration'), \", outline-color \").concat(dt('slider.transition.duration'), \";\\n outline-color: transparent;\\n}\\n\\n.p-slider-handle::before {\\n content: \\\"\\\";\\n width: \").concat(dt('slider.handle.content.width'), \";\\n height: \").concat(dt('slider.handle.content.height'), \";\\n display: block;\\n background: \").concat(dt('slider.handle.content.background'), \";\\n border-radius: \").concat(dt('slider.handle.content.border.radius'), \";\\n box-shadow: \").concat(dt('slider.handle.content.shadow'), \";\\n transition: background \").concat(dt('slider.transition.duration'), \";\\n}\\n\\n.p-slider:not(.p-disabled) .p-slider-handle:hover {\\n background: \").concat(dt('slider.handle.hover.background'), \";\\n}\\n\\n.p-slider:not(.p-disabled) .p-slider-handle:hover::before {\\n background: \").concat(dt('slider.handle.content.hover.background'), \";\\n}\\n\\n.p-slider-handle:focus-visible {\\n box-shadow: \").concat(dt('slider.handle.focus.ring.shadow'), \";\\n outline: \").concat(dt('slider.handle.focus.ring.width'), \" \").concat(dt('slider.handle.focus.ring.style'), \" \").concat(dt('slider.handle.focus.ring.color'), \";\\n outline-offset: \").concat(dt('slider.handle.focus.ring.offset'), \";\\n}\\n\\n.p-slider-range {\\n display: block;\\n background: \").concat(dt('slider.range.background'), \";\\n border-radius: \").concat(dt('slider.border.radius'), \";\\n}\\n\\n.p-slider.p-slider-horizontal {\\n height: \").concat(dt('slider.track.size'), \";\\n}\\n\\n.p-slider-horizontal .p-slider-range {\\n inset-block-start: 0;\\n inset-inline-start: 0;\\n height: 100%;\\n}\\n\\n.p-slider-horizontal .p-slider-handle {\\n inset-block-start: 50%;\\n margin-block-start: calc(-1 * calc(\").concat(dt('slider.handle.height'), \" / 2));\\n margin-inline-start: calc(-1 * calc(\").concat(dt('slider.handle.width'), \" / 2));\\n}\\n\\n.p-slider-vertical {\\n min-height: 100px;\\n width: \").concat(dt('slider.track.size'), \";\\n}\\n\\n.p-slider-vertical .p-slider-handle {\\n inset-inline-start: 50%;\\n margin-inline-start: calc(-1 * calc(\").concat(dt('slider.handle.width'), \" / 2));\\n margin-block-end: calc(-1 * calc(\").concat(dt('slider.handle.height'), \" / 2));\\n}\\n\\n.p-slider-vertical .p-slider-range {\\n inset-block-end: 0;\\n inset-inline-start: 0;\\n width: 100%;\\n}\\n\");\n};\nvar inlineStyles = {\n handle: {\n position: 'absolute'\n },\n range: {\n position: 'absolute'\n }\n};\nvar classes = {\n root: function root(_ref2) {\n var instance = _ref2.instance,\n props = _ref2.props;\n return ['p-slider p-component', {\n 'p-disabled': props.disabled,\n 'p-invalid': instance.$invalid,\n 'p-slider-horizontal': props.orientation === 'horizontal',\n 'p-slider-vertical': props.orientation === 'vertical'\n }];\n },\n range: 'p-slider-range',\n handle: 'p-slider-handle'\n};\nvar SliderStyle = BaseStyle.extend({\n name: 'slider',\n theme: theme,\n classes: classes,\n inlineStyles: inlineStyles\n});\n\nexport { SliderStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { getWindowScrollLeft, getWindowScrollTop, isRTL, getAttribute } from '@primeuix/utils/dom';\nimport BaseEditableHolder from '@primevue/core/baseeditableholder';\nimport SliderStyle from 'primevue/slider/style';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode, createCommentVNode } from 'vue';\n\nvar script$1 = {\n name: 'BaseSlider',\n \"extends\": BaseEditableHolder,\n props: {\n min: {\n type: Number,\n \"default\": 0\n },\n max: {\n type: Number,\n \"default\": 100\n },\n orientation: {\n type: String,\n \"default\": 'horizontal'\n },\n step: {\n type: Number,\n \"default\": null\n },\n range: {\n type: Boolean,\n \"default\": false\n },\n tabindex: {\n type: Number,\n \"default\": 0\n },\n ariaLabelledby: {\n type: String,\n \"default\": null\n },\n ariaLabel: {\n type: String,\n \"default\": null\n }\n },\n style: SliderStyle,\n provide: function provide() {\n return {\n $pcSlider: this,\n $parentInstance: this\n };\n }\n};\n\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nvar script = {\n name: 'Slider',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['change', 'slideend'],\n dragging: false,\n handleIndex: null,\n initX: null,\n initY: null,\n barWidth: null,\n barHeight: null,\n dragListener: null,\n dragEndListener: null,\n beforeUnmount: function beforeUnmount() {\n this.unbindDragListeners();\n },\n methods: {\n updateDomData: function updateDomData() {\n var rect = this.$el.getBoundingClientRect();\n this.initX = rect.left + getWindowScrollLeft();\n this.initY = rect.top + getWindowScrollTop();\n this.barWidth = this.$el.offsetWidth;\n this.barHeight = this.$el.offsetHeight;\n },\n setValue: function setValue(event) {\n var handleValue;\n var pageX = event.touches ? event.touches[0].pageX : event.pageX;\n var pageY = event.touches ? event.touches[0].pageY : event.pageY;\n if (this.orientation === 'horizontal') {\n // @todo: Check this\n if (isRTL(this.$el)) {\n handleValue = (this.initX + this.barWidth - pageX) * 100 / this.barWidth;\n } else {\n handleValue = (pageX - this.initX) * 100 / this.barWidth;\n }\n } else {\n handleValue = (this.initY + this.barHeight - pageY) * 100 / this.barHeight;\n }\n var newValue = (this.max - this.min) * (handleValue / 100) + this.min;\n if (this.step) {\n var oldValue = this.range ? this.value[this.handleIndex] : this.value;\n var diff = newValue - oldValue;\n if (diff < 0) newValue = oldValue + Math.ceil(newValue / this.step - oldValue / this.step) * this.step;else if (diff > 0) newValue = oldValue + Math.floor(newValue / this.step - oldValue / this.step) * this.step;\n } else {\n newValue = Math.floor(newValue);\n }\n this.updateModel(event, newValue);\n },\n updateModel: function updateModel(event, value) {\n var newValue = parseFloat(value.toFixed(10));\n var modelValue;\n if (this.range) {\n modelValue = this.value ? _toConsumableArray(this.value) : [];\n if (this.handleIndex == 0) {\n if (newValue < this.min) newValue = this.min;else if (newValue >= this.max) newValue = this.max;\n modelValue[0] = newValue;\n } else {\n if (newValue > this.max) newValue = this.max;else if (newValue <= this.min) newValue = this.min;\n modelValue[1] = newValue;\n }\n } else {\n if (newValue < this.min) newValue = this.min;else if (newValue > this.max) newValue = this.max;\n modelValue = newValue;\n }\n this.writeValue(modelValue, event);\n this.$emit('change', modelValue);\n },\n onDragStart: function onDragStart(event, index) {\n if (this.disabled) {\n return;\n }\n this.$el.setAttribute('data-p-sliding', true);\n this.dragging = true;\n this.updateDomData();\n if (this.range && this.value[0] === this.max) {\n this.handleIndex = 0;\n } else {\n this.handleIndex = index;\n }\n event.currentTarget.focus();\n },\n onDrag: function onDrag(event) {\n if (this.dragging) {\n this.setValue(event);\n }\n },\n onDragEnd: function onDragEnd(event) {\n if (this.dragging) {\n this.dragging = false;\n this.$el.setAttribute('data-p-sliding', false);\n this.$emit('slideend', {\n originalEvent: event,\n value: this.value\n });\n }\n },\n onBarClick: function onBarClick(event) {\n if (this.disabled) {\n return;\n }\n if (getAttribute(event.target, 'data-pc-section') !== 'handle') {\n this.updateDomData();\n this.setValue(event);\n }\n },\n onMouseDown: function onMouseDown(event, index) {\n this.bindDragListeners();\n this.onDragStart(event, index);\n },\n onKeyDown: function onKeyDown(event, index) {\n this.handleIndex = index;\n switch (event.code) {\n case 'ArrowDown':\n case 'ArrowLeft':\n this.decrementValue(event, index);\n event.preventDefault();\n break;\n case 'ArrowUp':\n case 'ArrowRight':\n this.incrementValue(event, index);\n event.preventDefault();\n break;\n case 'PageDown':\n this.decrementValue(event, index, true);\n event.preventDefault();\n break;\n case 'PageUp':\n this.incrementValue(event, index, true);\n event.preventDefault();\n break;\n case 'Home':\n this.updateModel(event, this.min);\n event.preventDefault();\n break;\n case 'End':\n this.updateModel(event, this.max);\n event.preventDefault();\n break;\n }\n },\n onBlur: function onBlur(event, index) {\n var _this$formField$onBlu, _this$formField;\n (_this$formField$onBlu = (_this$formField = this.formField).onBlur) === null || _this$formField$onBlu === void 0 || _this$formField$onBlu.call(_this$formField, event);\n },\n decrementValue: function decrementValue(event, index) {\n var pageKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var newValue;\n if (this.range) {\n if (this.step) newValue = this.value[index] - this.step;else newValue = this.value[index] - 1;\n } else {\n if (this.step) newValue = this.value - this.step;else if (!this.step && pageKey) newValue = this.value - 10;else newValue = this.value - 1;\n }\n this.updateModel(event, newValue);\n event.preventDefault();\n },\n incrementValue: function incrementValue(event, index) {\n var pageKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var newValue;\n if (this.range) {\n if (this.step) newValue = this.value[index] + this.step;else newValue = this.value[index] + 1;\n } else {\n if (this.step) newValue = this.value + this.step;else if (!this.step && pageKey) newValue = this.value + 10;else newValue = this.value + 1;\n }\n this.updateModel(event, newValue);\n event.preventDefault();\n },\n bindDragListeners: function bindDragListeners() {\n if (!this.dragListener) {\n this.dragListener = this.onDrag.bind(this);\n document.addEventListener('mousemove', this.dragListener);\n }\n if (!this.dragEndListener) {\n this.dragEndListener = this.onDragEnd.bind(this);\n document.addEventListener('mouseup', this.dragEndListener);\n }\n },\n unbindDragListeners: function unbindDragListeners() {\n if (this.dragListener) {\n document.removeEventListener('mousemove', this.dragListener);\n this.dragListener = null;\n }\n if (this.dragEndListener) {\n document.removeEventListener('mouseup', this.dragEndListener);\n this.dragEndListener = null;\n }\n },\n rangeStyle: function rangeStyle() {\n if (this.range) {\n var rangeSliderWidth = this.rangeEndPosition > this.rangeStartPosition ? this.rangeEndPosition - this.rangeStartPosition : this.rangeStartPosition - this.rangeEndPosition;\n var rangeSliderPosition = this.rangeEndPosition > this.rangeStartPosition ? this.rangeStartPosition : this.rangeEndPosition;\n if (this.horizontal) {\n return {\n 'inset-inline-start': rangeSliderPosition + '%',\n width: rangeSliderWidth + '%'\n };\n } else {\n return {\n bottom: rangeSliderPosition + '%',\n height: rangeSliderWidth + '%'\n };\n }\n } else {\n if (this.horizontal) {\n return {\n width: this.handlePosition + '%'\n };\n } else {\n return {\n height: this.handlePosition + '%'\n };\n }\n }\n },\n handleStyle: function handleStyle() {\n if (this.horizontal) {\n return {\n 'inset-inline-start': this.handlePosition + '%'\n };\n } else {\n return {\n bottom: this.handlePosition + '%'\n };\n }\n },\n rangeStartHandleStyle: function rangeStartHandleStyle() {\n if (this.horizontal) {\n return {\n 'inset-inline-start': this.rangeStartPosition + '%'\n };\n } else {\n return {\n bottom: this.rangeStartPosition + '%'\n };\n }\n },\n rangeEndHandleStyle: function rangeEndHandleStyle() {\n if (this.horizontal) {\n return {\n 'inset-inline-start': this.rangeEndPosition + '%'\n };\n } else {\n return {\n bottom: this.rangeEndPosition + '%'\n };\n }\n }\n },\n computed: {\n value: function value() {\n var _this$d_value3;\n if (this.range) {\n var _this$d_value$, _this$d_value, _this$d_value$2, _this$d_value2;\n return [(_this$d_value$ = (_this$d_value = this.d_value) === null || _this$d_value === void 0 ? void 0 : _this$d_value[0]) !== null && _this$d_value$ !== void 0 ? _this$d_value$ : this.min, (_this$d_value$2 = (_this$d_value2 = this.d_value) === null || _this$d_value2 === void 0 ? void 0 : _this$d_value2[1]) !== null && _this$d_value$2 !== void 0 ? _this$d_value$2 : this.max];\n }\n return (_this$d_value3 = this.d_value) !== null && _this$d_value3 !== void 0 ? _this$d_value3 : this.min;\n },\n horizontal: function horizontal() {\n return this.orientation === 'horizontal';\n },\n vertical: function vertical() {\n return this.orientation === 'vertical';\n },\n handlePosition: function handlePosition() {\n if (this.value < this.min) return 0;else if (this.value > this.max) return 100;else return (this.value - this.min) * 100 / (this.max - this.min);\n },\n rangeStartPosition: function rangeStartPosition() {\n if (this.value && this.value[0] !== undefined) {\n if (this.value[0] < this.min) return 0;else return (this.value[0] - this.min) * 100 / (this.max - this.min);\n } else return 0;\n },\n rangeEndPosition: function rangeEndPosition() {\n if (this.value && this.value.length === 2 && this.value[1] !== undefined) {\n if (this.value[1] > this.max) return 100;else return (this.value[1] - this.min) * 100 / (this.max - this.min);\n } else return 100;\n }\n }\n};\n\nvar _hoisted_1 = [\"tabindex\", \"aria-valuemin\", \"aria-valuenow\", \"aria-valuemax\", \"aria-labelledby\", \"aria-label\", \"aria-orientation\"];\nvar _hoisted_2 = [\"tabindex\", \"aria-valuemin\", \"aria-valuenow\", \"aria-valuemax\", \"aria-labelledby\", \"aria-label\", \"aria-orientation\"];\nvar _hoisted_3 = [\"tabindex\", \"aria-valuemin\", \"aria-valuenow\", \"aria-valuemax\", \"aria-labelledby\", \"aria-label\", \"aria-orientation\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root'),\n onClick: _cache[18] || (_cache[18] = function () {\n return $options.onBarClick && $options.onBarClick.apply($options, arguments);\n })\n }, _ctx.ptmi('root'), {\n \"data-p-sliding\": false\n }), [createElementVNode(\"span\", mergeProps({\n \"class\": _ctx.cx('range'),\n style: [_ctx.sx('range'), $options.rangeStyle()]\n }, _ctx.ptm('range')), null, 16), !_ctx.range ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('handle'),\n style: [_ctx.sx('handle'), $options.handleStyle()],\n onTouchstartPassive: _cache[0] || (_cache[0] = function ($event) {\n return $options.onDragStart($event);\n }),\n onTouchmovePassive: _cache[1] || (_cache[1] = function ($event) {\n return $options.onDrag($event);\n }),\n onTouchend: _cache[2] || (_cache[2] = function ($event) {\n return $options.onDragEnd($event);\n }),\n onMousedown: _cache[3] || (_cache[3] = function ($event) {\n return $options.onMouseDown($event);\n }),\n onKeydown: _cache[4] || (_cache[4] = function ($event) {\n return $options.onKeyDown($event);\n }),\n onBlur: _cache[5] || (_cache[5] = function ($event) {\n return $options.onBlur($event);\n }),\n tabindex: _ctx.tabindex,\n role: \"slider\",\n \"aria-valuemin\": _ctx.min,\n \"aria-valuenow\": _ctx.d_value,\n \"aria-valuemax\": _ctx.max,\n \"aria-labelledby\": _ctx.ariaLabelledby,\n \"aria-label\": _ctx.ariaLabel,\n \"aria-orientation\": _ctx.orientation\n }, _ctx.ptm('handle')), null, 16, _hoisted_1)) : createCommentVNode(\"\", true), _ctx.range ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 1,\n \"class\": _ctx.cx('handle'),\n style: [_ctx.sx('handle'), $options.rangeStartHandleStyle()],\n onTouchstartPassive: _cache[6] || (_cache[6] = function ($event) {\n return $options.onDragStart($event, 0);\n }),\n onTouchmovePassive: _cache[7] || (_cache[7] = function ($event) {\n return $options.onDrag($event);\n }),\n onTouchend: _cache[8] || (_cache[8] = function ($event) {\n return $options.onDragEnd($event);\n }),\n onMousedown: _cache[9] || (_cache[9] = function ($event) {\n return $options.onMouseDown($event, 0);\n }),\n onKeydown: _cache[10] || (_cache[10] = function ($event) {\n return $options.onKeyDown($event, 0);\n }),\n onBlur: _cache[11] || (_cache[11] = function ($event) {\n return $options.onBlur($event, 0);\n }),\n tabindex: _ctx.tabindex,\n role: \"slider\",\n \"aria-valuemin\": _ctx.min,\n \"aria-valuenow\": _ctx.d_value ? _ctx.d_value[0] : null,\n \"aria-valuemax\": _ctx.max,\n \"aria-labelledby\": _ctx.ariaLabelledby,\n \"aria-label\": _ctx.ariaLabel,\n \"aria-orientation\": _ctx.orientation\n }, _ctx.ptm('startHandler')), null, 16, _hoisted_2)) : createCommentVNode(\"\", true), _ctx.range ? (openBlock(), createElementBlock(\"span\", mergeProps({\n key: 2,\n \"class\": _ctx.cx('handle'),\n style: [_ctx.sx('handle'), $options.rangeEndHandleStyle()],\n onTouchstartPassive: _cache[12] || (_cache[12] = function ($event) {\n return $options.onDragStart($event, 1);\n }),\n onTouchmovePassive: _cache[13] || (_cache[13] = function ($event) {\n return $options.onDrag($event);\n }),\n onTouchend: _cache[14] || (_cache[14] = function ($event) {\n return $options.onDragEnd($event);\n }),\n onMousedown: _cache[15] || (_cache[15] = function ($event) {\n return $options.onMouseDown($event, 1);\n }),\n onKeydown: _cache[16] || (_cache[16] = function ($event) {\n return $options.onKeyDown($event, 1);\n }),\n onBlur: _cache[17] || (_cache[17] = function ($event) {\n return $options.onBlur($event, 1);\n }),\n tabindex: _ctx.tabindex,\n role: \"slider\",\n \"aria-valuemin\": _ctx.min,\n \"aria-valuenow\": _ctx.d_value ? _ctx.d_value[1] : null,\n \"aria-valuemax\": _ctx.max,\n \"aria-labelledby\": _ctx.ariaLabelledby,\n \"aria-label\": _ctx.ariaLabel,\n \"aria-orientation\": _ctx.orientation\n }, _ctx.ptm('endHandler')), null, 16, _hoisted_3)) : createCommentVNode(\"\", true)], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","\n\n\n","import axios from 'axios'\n\nimport { electronAPI } from './envUtil'\nimport { isValidUrl } from './formatUtil'\n\nconst VALID_STATUS_CODES = [200, 201, 301, 302, 307, 308]\nexport const checkUrlReachable = async (url: string): Promise => {\n try {\n const response = await axios.head(url)\n // Additional check for successful response\n return VALID_STATUS_CODES.includes(response.status)\n } catch {\n return false\n }\n}\n\n/**\n * Check if a mirror is reachable from the electron App.\n * @param mirror - The mirror to check.\n * @returns True if the mirror is reachable, false otherwise.\n */\nexport const checkMirrorReachable = async (mirror: string) => {\n return (\n isValidUrl(mirror) && (await electronAPI().NetWork.canAccessUrl(mirror))\n )\n}\n\n/**\n * Checks if the user is likely in mainland China by:\n * 1. Checking navigator.language\n * 2. Testing connectivity to commonly blocked services\n * 3. Testing latency to China-specific domains\n */\nexport async function isInChina(): Promise {\n // Quick check based on language/locale\n const isChineseLocale = navigator.language.toLowerCase().startsWith('zh-cn')\n\n try {\n // Test connectivity to Google - commonly blocked in China\n const googleTest = await Promise.race([\n fetch('https://www.google.com', {\n mode: 'no-cors',\n cache: 'no-cache'\n }),\n new Promise((_, reject) => setTimeout(() => reject(), 2000))\n ])\n\n // If Google is accessible, user is likely not in China\n if (googleTest) {\n return false\n }\n } catch {\n // Google is not accessible - potential indicator of being in China\n if (isChineseLocale) {\n return true\n }\n\n // Additional check - test latency to a reliable Chinese domain\n try {\n const start = performance.now()\n await fetch('https://www.baidu.com', {\n mode: 'no-cors',\n cache: 'no-cache'\n })\n const latency = performance.now() - start\n\n // If Baidu responds quickly (<150ms), user is likely in China\n return latency < 150\n } catch {\n // If both tests fail, default to locale check\n return isChineseLocale\n }\n }\n\n return false\n}\n","export enum ValidationState {\n IDLE = 'IDLE',\n LOADING = 'LOADING',\n VALID = 'VALID',\n INVALID = 'INVALID'\n}\n\nexport const mergeValidationStates = (states: ValidationState[]) => {\n if (states.some((state) => state === ValidationState.INVALID)) {\n return ValidationState.INVALID\n }\n if (states.some((state) => state === ValidationState.LOADING)) {\n return ValidationState.LOADING\n }\n if (states.every((state) => state === ValidationState.VALID)) {\n return ValidationState.VALID\n }\n return ValidationState.IDLE\n}\n","\n\n\n","\n\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n\n\n","\n\n\n","import BaseIcon from '@primevue/icons/baseicon';\nimport { openBlock, createElementBlock, mergeProps, createElementVNode } from 'vue';\n\nvar script = {\n name: 'ChevronUpIcon',\n \"extends\": BaseIcon\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"svg\", mergeProps({\n width: \"14\",\n height: \"14\",\n viewBox: \"0 0 14 14\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, _ctx.pti()), _cache[0] || (_cache[0] = [createElementVNode(\"path\", {\n d: \"M12.2097 10.4113C12.1057 10.4118 12.0027 10.3915 11.9067 10.3516C11.8107 10.3118 11.7237 10.2532 11.6506 10.1792L6.93602 5.46461L2.22139 10.1476C2.07272 10.244 1.89599 10.2877 1.71953 10.2717C1.54307 10.2556 1.3771 10.1808 1.24822 10.0593C1.11933 9.93766 1.035 9.77633 1.00874 9.6011C0.982477 9.42587 1.0158 9.2469 1.10338 9.09287L6.37701 3.81923C6.52533 3.6711 6.72639 3.58789 6.93602 3.58789C7.14565 3.58789 7.3467 3.6711 7.49502 3.81923L12.7687 9.09287C12.9168 9.24119 13 9.44225 13 9.65187C13 9.8615 12.9168 10.0626 12.7687 10.2109C12.616 10.3487 12.4151 10.4207 12.2097 10.4113Z\",\n fill: \"currentColor\"\n }, null, -1)]), 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","import BaseStyle from '@primevue/core/base/style';\n\nvar theme = function theme(_ref) {\n var dt = _ref.dt;\n return \"\\n.p-carousel {\\n display: flex;\\n flex-direction: column;\\n}\\n\\n.p-carousel-content-container {\\n display: flex;\\n flex-direction: column;\\n overflow: auto;\\n}\\n\\n.p-carousel-content {\\n display: flex;\\n flex-direction: row;\\n gap: \".concat(dt('carousel.content.gap'), \";\\n}\\n\\n.p-carousel-content:dir(rtl) {\\n flex-direction: row-reverse;\\n}\\n\\n.p-carousel-viewport {\\n overflow: hidden;\\n width: 100%;\\n}\\n\\n.p-carousel-item-list {\\n display: flex;\\n flex-direction: row;\\n}\\n\\n.p-carousel-item-list:dir(rtl) {\\n flex-direction: row-reverse;\\n}\\n\\n.p-carousel-prev-button,\\n.p-carousel-next-button {\\n align-self: center;\\n flex-shrink: 0;\\n}\\n\\n.p-carousel-indicator-list {\\n display: flex;\\n flex-direction: row;\\n justify-content: center;\\n flex-wrap: wrap;\\n padding: \").concat(dt('carousel.indicator.list.padding'), \";\\n gap: \").concat(dt('carousel.indicator.list.gap'), \";\\n margin: 0;\\n list-style: none;\\n}\\n\\n.p-carousel-indicator-button {\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n background: \").concat(dt('carousel.indicator.background'), \";\\n width: \").concat(dt('carousel.indicator.width'), \";\\n height: \").concat(dt('carousel.indicator.height'), \";\\n border: 0 none;\\n transition: background \").concat(dt('carousel.transition.duration'), \", color \").concat(dt('carousel.transition.duration'), \", outline-color \").concat(dt('carousel.transition.duration'), \", box-shadow \").concat(dt('carousel.transition.duration'), \";\\n outline-color: transparent;\\n border-radius: \").concat(dt('carousel.indicator.border.radius'), \";\\n padding: 0;\\n margin: 0;\\n user-select: none;\\n cursor: pointer;\\n}\\n\\n.p-carousel-indicator-button:focus-visible {\\n box-shadow: \").concat(dt('carousel.indicator.focus.ring.shadow'), \";\\n outline: \").concat(dt('carousel.indicator.focus.ring.width'), \" \").concat(dt('carousel.indicator.focus.ring.style'), \" \").concat(dt('carousel.indicator.focus.ring.color'), \";\\n outline-offset: \").concat(dt('carousel.indicator.focus.ring.offset'), \";\\n}\\n\\n.p-carousel-indicator-button:hover {\\n background: \").concat(dt('carousel.indicator.hover.background'), \";\\n}\\n\\n.p-carousel-indicator-active .p-carousel-indicator-button {\\n background: \").concat(dt('carousel.indicator.active.background'), \";\\n}\\n\\n.p-carousel-vertical .p-carousel-content {\\n flex-direction: column;\\n}\\n\\n.p-carousel-vertical .p-carousel-item-list {\\n flex-direction: column;\\n height: 100%;\\n}\\n\\n.p-items-hidden .p-carousel-item {\\n visibility: hidden;\\n}\\n\\n.p-items-hidden .p-carousel-item.p-carousel-item-active {\\n visibility: visible;\\n}\\n\");\n};\nvar classes = {\n root: function root(_ref2) {\n var instance = _ref2.instance;\n return ['p-carousel p-component', {\n 'p-carousel-vertical': instance.isVertical(),\n 'p-carousel-horizontal': !instance.isVertical()\n }];\n },\n header: 'p-carousel-header',\n contentContainer: 'p-carousel-content-container',\n content: 'p-carousel-content',\n pcPrevButton: function pcPrevButton(_ref3) {\n var instance = _ref3.instance;\n return ['p-carousel-prev-button', {\n 'p-disabled': instance.backwardIsDisabled\n }];\n },\n viewport: 'p-carousel-viewport',\n itemList: 'p-carousel-item-list',\n itemClone: function itemClone(_ref4) {\n var index = _ref4.index,\n value = _ref4.value,\n totalShiftedItems = _ref4.totalShiftedItems,\n d_numVisible = _ref4.d_numVisible;\n return ['p-carousel-item p-carousel-item-clone', {\n 'p-carousel-item-active': totalShiftedItems * -1 === value.length + d_numVisible,\n 'p-carousel-item-start': index === 0,\n 'p-carousel-item-end': value.slice(-1 * d_numVisible).length - 1 === index\n }];\n },\n item: function item(_ref5) {\n var instance = _ref5.instance,\n index = _ref5.index;\n return ['p-carousel-item', {\n 'p-carousel-item-active': instance.firstIndex() <= index && instance.lastIndex() >= index,\n 'p-carousel-item-start': instance.firstIndex() === index,\n 'p-carousel-item-end': instance.lastIndex() === index\n }];\n },\n pcNextButton: function pcNextButton(_ref6) {\n var instance = _ref6.instance;\n return ['p-carousel-next-button', {\n 'p-disabled': instance.forwardIsDisabled\n }];\n },\n indicatorList: 'p-carousel-indicator-list',\n indicator: function indicator(_ref7) {\n var instance = _ref7.instance,\n index = _ref7.index;\n return ['p-carousel-indicator', {\n 'p-carousel-indicator-active': instance.d_page === index\n }];\n },\n indicatorButton: 'p-carousel-indicator-button',\n footer: 'p-carousel-footer'\n};\nvar CarouselStyle = BaseStyle.extend({\n name: 'carousel',\n theme: theme,\n classes: classes\n});\n\nexport { CarouselStyle as default };\n//# sourceMappingURL=index.mjs.map\n","import { removeClass, addClass, find, getAttribute, findSingle, setAttribute } from '@primeuix/utils/dom';\nimport { localeComparator, sort } from '@primeuix/utils/object';\nimport ChevronDownIcon from '@primevue/icons/chevrondown';\nimport ChevronLeftIcon from '@primevue/icons/chevronleft';\nimport ChevronRightIcon from '@primevue/icons/chevronright';\nimport ChevronUpIcon from '@primevue/icons/chevronup';\nimport Button from 'primevue/button';\nimport Ripple from 'primevue/ripple';\nimport BaseComponent from '@primevue/core/basecomponent';\nimport CarouselStyle from 'primevue/carousel/style';\nimport { resolveComponent, openBlock, createElementBlock, mergeProps, renderSlot, createCommentVNode, createElementVNode, createBlock, withCtx, resolveDynamicComponent, Fragment, renderList, createTextVNode, toDisplayString } from 'vue';\n\nvar script$1 = {\n name: 'BaseCarousel',\n \"extends\": BaseComponent,\n props: {\n value: null,\n page: {\n type: Number,\n \"default\": 0\n },\n numVisible: {\n type: Number,\n \"default\": 1\n },\n numScroll: {\n type: Number,\n \"default\": 1\n },\n responsiveOptions: Array,\n orientation: {\n type: String,\n \"default\": 'horizontal'\n },\n verticalViewPortHeight: {\n type: String,\n \"default\": '300px'\n },\n contentClass: String,\n containerClass: String,\n indicatorsContentClass: String,\n circular: {\n type: Boolean,\n \"default\": false\n },\n autoplayInterval: {\n type: Number,\n \"default\": 0\n },\n showNavigators: {\n type: Boolean,\n \"default\": true\n },\n showIndicators: {\n type: Boolean,\n \"default\": true\n },\n prevButtonProps: {\n type: Object,\n \"default\": function _default() {\n return {\n severity: 'secondary',\n text: true,\n rounded: true\n };\n }\n },\n nextButtonProps: {\n type: Object,\n \"default\": function _default() {\n return {\n severity: 'secondary',\n text: true,\n rounded: true\n };\n }\n }\n },\n style: CarouselStyle,\n provide: function provide() {\n return {\n $pcCarousel: this,\n $parentInstance: this\n };\n }\n};\n\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nvar script = {\n name: 'Carousel',\n \"extends\": script$1,\n inheritAttrs: false,\n emits: ['update:page'],\n isRemainingItemsAdded: false,\n data: function data() {\n return {\n remainingItems: 0,\n d_numVisible: this.numVisible,\n d_numScroll: this.numScroll,\n d_oldNumScroll: 0,\n d_oldNumVisible: 0,\n d_oldValue: null,\n d_page: this.page,\n totalShiftedItems: this.page * this.numScroll * -1,\n allowAutoplay: !!this.autoplayInterval,\n d_circular: this.circular || this.allowAutoplay,\n swipeThreshold: 20\n };\n },\n watch: {\n page: function page(newValue) {\n if (newValue > this.d_page) {\n this.navForward({}, newValue);\n } else if (newValue < this.d_page) {\n this.navBackward({}, newValue);\n }\n this.d_page = newValue;\n },\n circular: function circular(newValue) {\n this.d_circular = newValue;\n },\n numVisible: function numVisible(newValue, oldValue) {\n this.d_numVisible = newValue;\n this.d_oldNumVisible = oldValue;\n },\n numScroll: function numScroll(newValue, oldValue) {\n this.d_oldNumScroll = oldValue;\n this.d_numScroll = newValue;\n },\n value: function value(oldValue) {\n this.d_oldValue = oldValue;\n }\n },\n mounted: function mounted() {\n var stateChanged = false;\n this.createStyle();\n this.calculatePosition();\n if (this.responsiveOptions) {\n this.bindDocumentListeners();\n }\n if (this.isCircular()) {\n var totalShiftedItems = this.totalShiftedItems;\n if (this.d_page === 0) {\n totalShiftedItems = -1 * this.d_numVisible;\n } else if (totalShiftedItems === 0) {\n totalShiftedItems = -1 * this.value.length;\n if (this.remainingItems > 0) {\n this.isRemainingItemsAdded = true;\n }\n }\n if (totalShiftedItems !== this.totalShiftedItems) {\n this.totalShiftedItems = totalShiftedItems;\n stateChanged = true;\n }\n }\n if (!stateChanged && this.isAutoplay()) {\n this.startAutoplay();\n }\n },\n updated: function updated() {\n if (!this.empty) {\n var isCircular = this.isCircular();\n var stateChanged = false;\n var totalShiftedItems = this.totalShiftedItems;\n if (this.autoplayInterval) {\n this.stopAutoplay();\n }\n if (this.d_oldNumScroll !== this.d_numScroll || this.d_oldNumVisible !== this.d_numVisible || this.d_oldValue.length !== this.value.length) {\n this.remainingItems = (this.value.length - this.d_numVisible) % this.d_numScroll;\n var page = this.d_page;\n if (this.totalIndicators !== 0 && page >= this.totalIndicators) {\n page = this.totalIndicators - 1;\n this.$emit('update:page', page);\n this.d_page = page;\n stateChanged = true;\n }\n totalShiftedItems = page * this.d_numScroll * -1;\n if (isCircular) {\n totalShiftedItems -= this.d_numVisible;\n }\n if (page === this.totalIndicators - 1 && this.remainingItems > 0) {\n totalShiftedItems += -1 * this.remainingItems + this.d_numScroll;\n this.isRemainingItemsAdded = true;\n } else {\n this.isRemainingItemsAdded = false;\n }\n if (totalShiftedItems !== this.totalShiftedItems) {\n this.totalShiftedItems = totalShiftedItems;\n stateChanged = true;\n }\n this.d_oldNumScroll = this.d_numScroll;\n this.d_oldNumVisible = this.d_numVisible;\n this.d_oldValue = this.value;\n this.$refs.itemsContainer.style.transform = this.isVertical() ? \"translate3d(0, \".concat(totalShiftedItems * (100 / this.d_numVisible), \"%, 0)\") : \"translate3d(\".concat(totalShiftedItems * (100 / this.d_numVisible), \"%, 0, 0)\");\n }\n if (isCircular) {\n if (this.d_page === 0) {\n totalShiftedItems = -1 * this.d_numVisible;\n } else if (totalShiftedItems === 0) {\n totalShiftedItems = -1 * this.value.length;\n if (this.remainingItems > 0) {\n this.isRemainingItemsAdded = true;\n }\n }\n if (totalShiftedItems !== this.totalShiftedItems) {\n this.totalShiftedItems = totalShiftedItems;\n stateChanged = true;\n }\n }\n if (!stateChanged && this.isAutoplay()) {\n this.startAutoplay();\n }\n }\n },\n beforeUnmount: function beforeUnmount() {\n if (this.responsiveOptions) {\n this.unbindDocumentListeners();\n }\n if (this.autoplayInterval) {\n this.stopAutoplay();\n }\n },\n methods: {\n getIndicatorPTOptions: function getIndicatorPTOptions(key, index) {\n return this.ptm(key, {\n context: {\n highlighted: index === this.d_page\n }\n });\n },\n getItemPTOptions: function getItemPTOptions(key, index) {\n return this.ptm(key, {\n context: {\n index: index,\n active: this.firstIndex() <= index && this.lastIndex() >= index,\n start: this.firstIndex() === index,\n end: this.lastIndex() === index\n }\n });\n },\n step: function step(dir, page) {\n var totalShiftedItems = this.totalShiftedItems;\n var isCircular = this.isCircular();\n if (page != null) {\n totalShiftedItems = this.d_numScroll * page * -1;\n if (isCircular) {\n totalShiftedItems -= this.d_numVisible;\n }\n this.isRemainingItemsAdded = false;\n } else {\n totalShiftedItems += this.d_numScroll * dir;\n if (this.isRemainingItemsAdded) {\n totalShiftedItems += this.remainingItems - this.d_numScroll * dir;\n this.isRemainingItemsAdded = false;\n }\n var originalShiftedItems = isCircular ? totalShiftedItems + this.d_numVisible : totalShiftedItems;\n page = Math.abs(Math.floor(originalShiftedItems / this.d_numScroll));\n }\n if (isCircular && this.d_page === this.totalIndicators - 1 && dir === -1) {\n totalShiftedItems = -1 * (this.value.length + this.d_numVisible);\n page = 0;\n } else if (isCircular && this.d_page === 0 && dir === 1) {\n totalShiftedItems = 0;\n page = this.totalIndicators - 1;\n } else if (page === this.totalIndicators - 1 && this.remainingItems > 0) {\n totalShiftedItems += this.remainingItems * -1 - this.d_numScroll * dir;\n this.isRemainingItemsAdded = true;\n }\n if (this.$refs.itemsContainer) {\n !this.isUnstyled && removeClass(this.$refs.itemsContainer, 'p-items-hidden');\n this.$refs.itemsContainer.style.transform = this.isVertical() ? \"translate3d(0, \".concat(totalShiftedItems * (100 / this.d_numVisible), \"%, 0)\") : \"translate3d(\".concat(totalShiftedItems * (100 / this.d_numVisible), \"%, 0, 0)\");\n this.$refs.itemsContainer.style.transition = 'transform 500ms ease 0s';\n }\n this.totalShiftedItems = totalShiftedItems;\n this.$emit('update:page', page);\n this.d_page = page;\n },\n calculatePosition: function calculatePosition() {\n if (this.$refs.itemsContainer && this.responsiveOptions) {\n var windowWidth = window.innerWidth;\n var matchedResponsiveOptionsData = {\n numVisible: this.numVisible,\n numScroll: this.numScroll\n };\n for (var i = 0; i < this.responsiveOptions.length; i++) {\n var res = this.responsiveOptions[i];\n if (parseInt(res.breakpoint, 10) >= windowWidth) {\n matchedResponsiveOptionsData = res;\n }\n }\n if (this.d_numScroll !== matchedResponsiveOptionsData.numScroll) {\n var page = this.d_page;\n page = parseInt(page * this.d_numScroll / matchedResponsiveOptionsData.numScroll);\n this.totalShiftedItems = matchedResponsiveOptionsData.numScroll * page * -1;\n if (this.isCircular()) {\n this.totalShiftedItems -= matchedResponsiveOptionsData.numVisible;\n }\n this.d_numScroll = matchedResponsiveOptionsData.numScroll;\n this.$emit('update:page', page);\n this.d_page = page;\n }\n if (this.d_numVisible !== matchedResponsiveOptionsData.numVisible) {\n this.d_numVisible = matchedResponsiveOptionsData.numVisible;\n }\n }\n },\n navBackward: function navBackward(e, index) {\n if (this.d_circular || this.d_page !== 0) {\n this.step(1, index);\n }\n this.allowAutoplay = false;\n if (e.cancelable) {\n e.preventDefault();\n }\n },\n navForward: function navForward(e, index) {\n if (this.d_circular || this.d_page < this.totalIndicators - 1) {\n this.step(-1, index);\n }\n this.allowAutoplay = false;\n if (e.cancelable) {\n e.preventDefault();\n }\n },\n onIndicatorClick: function onIndicatorClick(e, index) {\n var page = this.d_page;\n if (index > page) {\n this.navForward(e, index);\n } else if (index < page) {\n this.navBackward(e, index);\n }\n },\n onTransitionEnd: function onTransitionEnd() {\n if (this.$refs.itemsContainer) {\n !this.isUnstyled && addClass(this.$refs.itemsContainer, 'p-items-hidden');\n this.$refs.itemsContainer.style.transition = '';\n if ((this.d_page === 0 || this.d_page === this.totalIndicators - 1) && this.isCircular()) {\n this.$refs.itemsContainer.style.transform = this.isVertical() ? \"translate3d(0, \".concat(this.totalShiftedItems * (100 / this.d_numVisible), \"%, 0)\") : \"translate3d(\".concat(this.totalShiftedItems * (100 / this.d_numVisible), \"%, 0, 0)\");\n }\n }\n },\n onTouchStart: function onTouchStart(e) {\n var touchobj = e.changedTouches[0];\n this.startPos = {\n x: touchobj.pageX,\n y: touchobj.pageY\n };\n },\n onTouchMove: function onTouchMove(e) {\n var touchobj = e.changedTouches[0];\n var diff = this.isVertical() ? touchobj.pageY - this.startPos.y : touchobj.pageX - this.startPos.x;\n if (Math.abs(diff) > this.swipeThreshold && e.cancelable) {\n e.preventDefault();\n }\n },\n onTouchEnd: function onTouchEnd(e) {\n var touchobj = e.changedTouches[0];\n if (this.isVertical()) {\n this.changePageOnTouch(e, touchobj.pageY - this.startPos.y);\n } else {\n this.changePageOnTouch(e, touchobj.pageX - this.startPos.x);\n }\n },\n changePageOnTouch: function changePageOnTouch(e, diff) {\n if (Math.abs(diff) > this.swipeThreshold) {\n if (diff < 0) {\n // left\n this.navForward(e);\n } else {\n // right\n this.navBackward(e);\n }\n }\n },\n onIndicatorKeydown: function onIndicatorKeydown(event) {\n switch (event.code) {\n case 'ArrowRight':\n this.onRightKey();\n break;\n case 'ArrowLeft':\n this.onLeftKey();\n break;\n case 'Home':\n this.onHomeKey();\n event.preventDefault();\n break;\n case 'End':\n this.onEndKey();\n event.preventDefault();\n break;\n case 'ArrowUp':\n case 'ArrowDown':\n case 'PageUp':\n case 'PageDown':\n event.preventDefault();\n break;\n case 'Tab':\n this.onTabKey();\n break;\n }\n },\n onRightKey: function onRightKey() {\n var indicators = _toConsumableArray(find(this.$refs.indicatorContent, '[data-pc-section=\"indicator\"]'));\n var activeIndex = this.findFocusedIndicatorIndex();\n this.changedFocusedIndicator(activeIndex, activeIndex + 1 === indicators.length ? indicators.length - 1 : activeIndex + 1);\n },\n onLeftKey: function onLeftKey() {\n var activeIndex = this.findFocusedIndicatorIndex();\n this.changedFocusedIndicator(activeIndex, activeIndex - 1 <= 0 ? 0 : activeIndex - 1);\n },\n onHomeKey: function onHomeKey() {\n var activeIndex = this.findFocusedIndicatorIndex();\n this.changedFocusedIndicator(activeIndex, 0);\n },\n onEndKey: function onEndKey() {\n var indicators = _toConsumableArray(find(this.$refs.indicatorContent, '[data-pc-section=\"indicator\"]'));\n var activeIndex = this.findFocusedIndicatorIndex();\n this.changedFocusedIndicator(activeIndex, indicators.length - 1);\n },\n onTabKey: function onTabKey() {\n var indicators = _toConsumableArray(find(this.$refs.indicatorContent, '[data-pc-section=\"indicator\"]'));\n var highlightedIndex = indicators.findIndex(function (ind) {\n return getAttribute(ind, 'data-p-active') === true;\n });\n var activeIndicator = findSingle(this.$refs.indicatorContent, '[data-pc-section=\"indicator\"] > button[tabindex=\"0\"]');\n var activeIndex = indicators.findIndex(function (ind) {\n return ind === activeIndicator.parentElement;\n });\n indicators[activeIndex].children[0].tabIndex = '-1';\n indicators[highlightedIndex].children[0].tabIndex = '0';\n },\n findFocusedIndicatorIndex: function findFocusedIndicatorIndex() {\n var indicators = _toConsumableArray(find(this.$refs.indicatorContent, '[data-pc-section=\"indicator\"]'));\n var activeIndicator = findSingle(this.$refs.indicatorContent, '[data-pc-section=\"indicator\"] > button[tabindex=\"0\"]');\n return indicators.findIndex(function (ind) {\n return ind === activeIndicator.parentElement;\n });\n },\n changedFocusedIndicator: function changedFocusedIndicator(prevInd, nextInd) {\n var indicators = _toConsumableArray(find(this.$refs.indicatorContent, '[data-pc-section=\"indicator\"]'));\n indicators[prevInd].children[0].tabIndex = '-1';\n indicators[nextInd].children[0].tabIndex = '0';\n indicators[nextInd].children[0].focus();\n },\n bindDocumentListeners: function bindDocumentListeners() {\n var _this = this;\n if (!this.documentResizeListener) {\n this.documentResizeListener = function (e) {\n _this.calculatePosition(e);\n };\n window.addEventListener('resize', this.documentResizeListener);\n }\n },\n unbindDocumentListeners: function unbindDocumentListeners() {\n if (this.documentResizeListener) {\n window.removeEventListener('resize', this.documentResizeListener);\n this.documentResizeListener = null;\n }\n },\n startAutoplay: function startAutoplay() {\n var _this2 = this;\n this.interval = setInterval(function () {\n if (_this2.d_page === _this2.totalIndicators - 1) {\n _this2.step(-1, 0);\n } else {\n _this2.step(-1, _this2.d_page + 1);\n }\n }, this.autoplayInterval);\n },\n stopAutoplay: function stopAutoplay() {\n if (this.interval) {\n clearInterval(this.interval);\n }\n },\n createStyle: function createStyle() {\n if (!this.carouselStyle) {\n var _this$$primevue;\n this.carouselStyle = document.createElement('style');\n this.carouselStyle.type = 'text/css';\n setAttribute(this.carouselStyle, 'nonce', (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce);\n document.body.appendChild(this.carouselStyle);\n }\n var innerHTML = \"\\n .p-carousel[\".concat(this.$attrSelector, \"] .p-carousel-item {\\n flex: 1 0 \").concat(100 / this.d_numVisible, \"%\\n }\\n \");\n if (this.responsiveOptions && !this.isUnstyled) {\n var _responsiveOptions = _toConsumableArray(this.responsiveOptions);\n var comparer = localeComparator();\n _responsiveOptions.sort(function (data1, data2) {\n var value1 = data1.breakpoint;\n var value2 = data2.breakpoint;\n return sort(value1, value2, -1, comparer);\n });\n for (var i = 0; i < _responsiveOptions.length; i++) {\n var res = _responsiveOptions[i];\n innerHTML += \"\\n @media screen and (max-width: \".concat(res.breakpoint, \") {\\n .p-carousel[\").concat(this.$attrSelector, \"] .p-carousel-item {\\n flex: 1 0 \").concat(100 / res.numVisible, \"%\\n }\\n }\\n \");\n }\n }\n this.carouselStyle.innerHTML = innerHTML;\n },\n isVertical: function isVertical() {\n return this.orientation === 'vertical';\n },\n hasValidItemCount: function hasValidItemCount() {\n return this.value && this.value.length > this.d_numVisible;\n },\n isCircular: function isCircular() {\n return this.hasValidItemCount() && this.d_circular;\n },\n isAutoplay: function isAutoplay() {\n return this.hasValidItemCount() && this.autoplayInterval && this.allowAutoplay;\n },\n firstIndex: function firstIndex() {\n return this.isCircular() ? -1 * (this.totalShiftedItems + this.d_numVisible) : this.totalShiftedItems * -1;\n },\n lastIndex: function lastIndex() {\n return this.firstIndex() + this.d_numVisible - 1;\n },\n ariaSlideNumber: function ariaSlideNumber(value) {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.slideNumber.replace(/{slideNumber}/g, value) : undefined;\n },\n ariaPageLabel: function ariaPageLabel(value) {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g, value) : undefined;\n }\n },\n computed: {\n totalIndicators: function totalIndicators() {\n return this.value ? Math.max(Math.ceil((this.value.length - this.d_numVisible) / this.d_numScroll) + 1, 0) : 0;\n },\n backwardIsDisabled: function backwardIsDisabled() {\n return this.value && (!this.circular || this.value.length < this.d_numVisible) && this.d_page === 0;\n },\n forwardIsDisabled: function forwardIsDisabled() {\n return this.value && (!this.circular || this.value.length < this.d_numVisible) && (this.d_page === this.totalIndicators - 1 || this.totalIndicators === 0);\n },\n ariaSlideLabel: function ariaSlideLabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.slide : undefined;\n },\n ariaPrevButtonLabel: function ariaPrevButtonLabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.prevPageLabel : undefined;\n },\n ariaNextButtonLabel: function ariaNextButtonLabel() {\n return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.nextPageLabel : undefined;\n },\n empty: function empty() {\n return !this.value || this.value.length === 0;\n },\n emptyMessageText: function emptyMessageText() {\n var _this$$primevue$confi;\n return ((_this$$primevue$confi = this.$primevue.config) === null || _this$$primevue$confi === void 0 || (_this$$primevue$confi = _this$$primevue$confi.locale) === null || _this$$primevue$confi === void 0 ? void 0 : _this$$primevue$confi.emptyMessage) || '';\n }\n },\n components: {\n Button: Button,\n ChevronRightIcon: ChevronRightIcon,\n ChevronDownIcon: ChevronDownIcon,\n ChevronLeftIcon: ChevronLeftIcon,\n ChevronUpIcon: ChevronUpIcon\n },\n directives: {\n ripple: Ripple\n }\n};\n\nvar _hoisted_1 = [\"aria-live\"];\nvar _hoisted_2 = [\"data-p-carousel-item-active\", \"data-p-carousel-item-start\", \"data-p-carousel-item-end\"];\nvar _hoisted_3 = [\"aria-hidden\", \"aria-label\", \"aria-roledescription\", \"data-p-carousel-item-active\", \"data-p-carousel-item-start\", \"data-p-carousel-item-end\"];\nvar _hoisted_4 = [\"data-p-active\"];\nvar _hoisted_5 = [\"tabindex\", \"aria-label\", \"aria-current\", \"onClick\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n var _component_Button = resolveComponent(\"Button\");\n return openBlock(), createElementBlock(\"div\", mergeProps({\n \"class\": _ctx.cx('root'),\n role: \"region\"\n }, _ctx.ptmi('root')), [_ctx.$slots.header ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 0,\n \"class\": _ctx.cx('header')\n }, _ctx.ptm('header')), [renderSlot(_ctx.$slots, \"header\")], 16)) : createCommentVNode(\"\", true), !$options.empty ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 1,\n \"class\": [_ctx.cx('contentContainer'), _ctx.containerClass]\n }, _ctx.ptm('contentContainer')), [createElementVNode(\"div\", mergeProps({\n \"class\": [_ctx.cx('content'), _ctx.contentClass],\n \"aria-live\": $data.allowAutoplay ? 'polite' : 'off'\n }, _ctx.ptm('content')), [_ctx.showNavigators ? (openBlock(), createBlock(_component_Button, mergeProps({\n key: 0,\n \"class\": _ctx.cx('pcPrevButton'),\n disabled: $options.backwardIsDisabled,\n \"aria-label\": $options.ariaPrevButtonLabel,\n unstyled: _ctx.unstyled,\n onClick: $options.navBackward\n }, _ctx.prevButtonProps, {\n pt: _ctx.ptm('pcPrevButton'),\n \"data-pc-group-section\": \"navigator\"\n }), {\n icon: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"previcon\", {}, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent($options.isVertical() ? 'ChevronUpIcon' : 'ChevronLeftIcon'), mergeProps({\n \"class\": slotProps.icon\n }, _ctx.ptm('pcPrevButton')['icon']), null, 16, [\"class\"]))];\n })];\n }),\n _: 3\n }, 16, [\"class\", \"disabled\", \"aria-label\", \"unstyled\", \"onClick\", \"pt\"])) : createCommentVNode(\"\", true), createElementVNode(\"div\", mergeProps({\n \"class\": _ctx.cx('viewport'),\n style: [{\n height: $options.isVertical() ? _ctx.verticalViewPortHeight : 'auto'\n }],\n onTouchend: _cache[1] || (_cache[1] = function () {\n return $options.onTouchEnd && $options.onTouchEnd.apply($options, arguments);\n }),\n onTouchstart: _cache[2] || (_cache[2] = function () {\n return $options.onTouchStart && $options.onTouchStart.apply($options, arguments);\n }),\n onTouchmove: _cache[3] || (_cache[3] = function () {\n return $options.onTouchMove && $options.onTouchMove.apply($options, arguments);\n })\n }, _ctx.ptm('viewport')), [createElementVNode(\"div\", mergeProps({\n ref: \"itemsContainer\",\n \"class\": _ctx.cx('itemList'),\n onTransitionend: _cache[0] || (_cache[0] = function () {\n return $options.onTransitionEnd && $options.onTransitionEnd.apply($options, arguments);\n })\n }, _ctx.ptm('itemList')), [$options.isCircular() ? (openBlock(true), createElementBlock(Fragment, {\n key: 0\n }, renderList(_ctx.value.slice(-1 * $data.d_numVisible), function (item, index) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n key: index + '_scloned',\n \"class\": _ctx.cx('itemClone', {\n index: index,\n value: _ctx.value,\n totalShiftedItems: $data.totalShiftedItems,\n d_numVisible: $data.d_numVisible\n }),\n ref_for: true\n }, _ctx.ptm('itemClone'), {\n \"data-p-carousel-item-active\": $data.totalShiftedItems * -1 === _ctx.value.length + $data.d_numVisible,\n \"data-p-carousel-item-start\": index === 0,\n \"data-p-carousel-item-end\": _ctx.value.slice(-1 * $data.d_numVisible).length - 1 === index\n }), [renderSlot(_ctx.$slots, \"item\", {\n data: item,\n index: index\n })], 16, _hoisted_2);\n }), 128)) : createCommentVNode(\"\", true), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.value, function (item, index) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n key: index,\n \"class\": _ctx.cx('item', {\n index: index\n }),\n role: \"group\",\n \"aria-hidden\": $options.firstIndex() > index || $options.lastIndex() < index ? true : undefined,\n \"aria-label\": $options.ariaSlideNumber(index),\n \"aria-roledescription\": $options.ariaSlideLabel,\n ref_for: true\n }, $options.getItemPTOptions('item', index), {\n \"data-p-carousel-item-active\": $options.firstIndex() <= index && $options.lastIndex() >= index,\n \"data-p-carousel-item-start\": $options.firstIndex() === index,\n \"data-p-carousel-item-end\": $options.lastIndex() === index\n }), [renderSlot(_ctx.$slots, \"item\", {\n data: item,\n index: index\n })], 16, _hoisted_3);\n }), 128)), $options.isCircular() ? (openBlock(true), createElementBlock(Fragment, {\n key: 1\n }, renderList(_ctx.value.slice(0, $data.d_numVisible), function (item, index) {\n return openBlock(), createElementBlock(\"div\", mergeProps({\n key: index + '_fcloned',\n \"class\": _ctx.cx('itemClone', {\n index: index,\n value: _ctx.value,\n totalShiftedItems: $data.totalShiftedItems,\n d_numVisible: $data.d_numVisible\n }),\n ref_for: true\n }, _ctx.ptm('itemClone')), [renderSlot(_ctx.$slots, \"item\", {\n data: item,\n index: index\n })], 16);\n }), 128)) : createCommentVNode(\"\", true)], 16)], 16), _ctx.showNavigators ? (openBlock(), createBlock(_component_Button, mergeProps({\n key: 1,\n \"class\": _ctx.cx('pcNextButton'),\n disabled: $options.forwardIsDisabled,\n \"aria-label\": $options.ariaNextButtonLabel,\n unstyled: _ctx.unstyled,\n onClick: $options.navForward\n }, _ctx.nextButtonProps, {\n pt: _ctx.ptm('pcNextButton'),\n \"data-pc-group-section\": \"navigator\"\n }), {\n icon: withCtx(function (slotProps) {\n return [renderSlot(_ctx.$slots, \"nexticon\", {}, function () {\n return [(openBlock(), createBlock(resolveDynamicComponent($options.isVertical() ? 'ChevronDownIcon' : 'ChevronRightIcon'), mergeProps({\n \"class\": slotProps[\"class\"]\n }, _ctx.ptm('pcNextButton')['icon']), null, 16, [\"class\"]))];\n })];\n }),\n _: 3\n }, 16, [\"class\", \"disabled\", \"aria-label\", \"unstyled\", \"onClick\", \"pt\"])) : createCommentVNode(\"\", true)], 16, _hoisted_1), $options.totalIndicators >= 0 && _ctx.showIndicators ? (openBlock(), createElementBlock(\"ul\", mergeProps({\n key: 0,\n ref: \"indicatorContent\",\n \"class\": [_ctx.cx('indicatorList'), _ctx.indicatorsContentClass],\n onKeydown: _cache[4] || (_cache[4] = function () {\n return $options.onIndicatorKeydown && $options.onIndicatorKeydown.apply($options, arguments);\n })\n }, _ctx.ptm('indicatorList')), [(openBlock(true), createElementBlock(Fragment, null, renderList($options.totalIndicators, function (indicator, i) {\n return openBlock(), createElementBlock(\"li\", mergeProps({\n key: 'p-carousel-indicator-' + i.toString(),\n \"class\": _ctx.cx('indicator', {\n index: i\n }),\n ref_for: true\n }, $options.getIndicatorPTOptions('indicator', i), {\n \"data-p-active\": $data.d_page === i\n }), [createElementVNode(\"button\", mergeProps({\n \"class\": _ctx.cx('indicatorButton'),\n type: \"button\",\n tabindex: $data.d_page === i ? '0' : '-1',\n \"aria-label\": $options.ariaPageLabel(i + 1),\n \"aria-current\": $data.d_page === i ? 'page' : undefined,\n onClick: function onClick($event) {\n return $options.onIndicatorClick($event, i);\n },\n ref_for: true\n }, $options.getIndicatorPTOptions('indicatorButton', i)), null, 16, _hoisted_5)], 16, _hoisted_4);\n }), 128))], 16)) : createCommentVNode(\"\", true)], 16)) : renderSlot(_ctx.$slots, \"empty\", {\n key: 2\n }, function () {\n return [createTextVNode(toDisplayString($options.emptyMessageText), 1)];\n }), _ctx.$slots.footer ? (openBlock(), createElementBlock(\"div\", mergeProps({\n key: 3,\n \"class\": _ctx.cx('footer')\n }, _ctx.ptm('footer')), [renderSlot(_ctx.$slots, \"footer\")], 16)) : createCommentVNode(\"\", true)], 16);\n}\n\nscript.render = render;\n\nexport { script as default };\n//# sourceMappingURL=index.mjs.map\n","\n\n\n\n\n","export const CORE_TEMPLATES = [\n {\n moduleName: 'default',\n title: 'Basics',\n type: 'image',\n templates: [\n {\n name: 'default',\n mediaType: 'image',\n mediaSubtype: 'png'\n },\n {\n name: 'image2image',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/img2img/'\n },\n {\n name: 'lora',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl: 'https://comfyanonymous.github.io/ComfyUI_examples/lora/'\n },\n {\n name: 'inpaint_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/inpaint/'\n },\n {\n name: 'inpain_model_outpainting',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/inpaint/#outpainting'\n },\n {\n name: 'embedding_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/textual_inversion_embeddings/'\n },\n {\n name: 'gligen_textbox_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl: 'https://comfyanonymous.github.io/ComfyUI_examples/gligen/'\n },\n {\n name: 'lora_multiple',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl: 'https://comfyanonymous.github.io/ComfyUI_examples/lora/'\n }\n ]\n },\n {\n moduleName: 'default',\n title: 'Flux',\n type: 'image',\n templates: [\n {\n name: 'flux_dev_checkpoint_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/flux/#flux-dev-1'\n },\n {\n name: 'flux_schnell',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/flux/#flux-schnell-1'\n },\n {\n name: 'flux_fill_inpaint_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/flux/#fill-inpainting-model'\n },\n {\n name: 'flux_fill_outpaint_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/flux/#fill-inpainting-model'\n },\n {\n name: 'flux_canny_model_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/flux/#canny-and-depth'\n },\n {\n name: 'flux_redux_model_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/flux/#redux'\n },\n {\n name: 'flux_depth_lora_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/flux/#canny-and-depth'\n }\n ]\n },\n {\n moduleName: 'default',\n title: 'ControlNet',\n type: 'image',\n templates: [\n {\n name: 'controlnet_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/controlnet/'\n },\n {\n name: '2_pass_pose_worship',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/controlnet/#pose-controlnet'\n },\n {\n name: 'depth_controlnet',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/controlnet/#t2i-adapter-vs-controlnets'\n },\n {\n name: 'depth_t2i_adapter',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/controlnet/#t2i-adapter-vs-controlnets'\n },\n {\n name: 'mixing_controlnets',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/controlnet/#mixing-controlnets'\n }\n ]\n },\n {\n moduleName: 'default',\n title: 'Upscaling',\n type: 'image',\n templates: [\n {\n name: 'upscale',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/2_pass_txt2img/'\n },\n {\n name: 'esrgan_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/upscale_models/'\n },\n {\n name: 'hiresfix_esrgan_workflow',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/2_pass_txt2img/#non-latent-upscaling'\n },\n {\n name: 'latent_upscale_different_prompt_model',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/2_pass_txt2img/#more-examples'\n }\n ]\n },\n {\n moduleName: 'default',\n title: 'Video',\n type: 'video',\n templates: [\n {\n name: 'image_to_video',\n mediaType: 'image',\n mediaSubtype: 'webp',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/video/#image-to-video'\n },\n {\n name: 'txt_to_image_to_video',\n mediaType: 'image',\n mediaSubtype: 'webp',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/video/#image-to-video'\n },\n {\n name: 'ltxv_image_to_video',\n mediaType: 'image',\n mediaSubtype: 'webp',\n tutorialUrl: 'https://comfyanonymous.github.io/ComfyUI_examples/ltxv/'\n },\n {\n name: 'ltxv_text_to_video',\n mediaType: 'image',\n mediaSubtype: 'webp',\n tutorialUrl: 'https://comfyanonymous.github.io/ComfyUI_examples/ltxv/'\n },\n {\n name: 'mochi_text_to_video_example',\n mediaType: 'image',\n mediaSubtype: 'webp',\n tutorialUrl: 'https://comfyanonymous.github.io/ComfyUI_examples/mochi/'\n },\n {\n name: 'hunyuan_video_text_to_video',\n mediaType: 'image',\n mediaSubtype: 'webp',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/hunyuan_video/'\n }\n ]\n },\n {\n moduleName: 'default',\n title: 'SD3.5',\n type: 'image',\n templates: [\n {\n name: 'sd3.5_simple_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/sd3/#sd35'\n },\n {\n name: 'sd3.5_large_canny_controlnet_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/sd3/#sd35-controlnets'\n },\n {\n name: 'sd3.5_large_depth',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/sd3/#sd35-controlnets'\n },\n {\n name: 'sd3.5_large_blur',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/sd3/#sd35-controlnets'\n }\n ]\n },\n {\n moduleName: 'default',\n title: 'SDXL',\n type: 'image',\n templates: [\n {\n name: 'sdxl_simple_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl: 'https://comfyanonymous.github.io/ComfyUI_examples/sdxl/'\n },\n {\n name: 'sdxl_refiner_prompt_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl: 'https://comfyanonymous.github.io/ComfyUI_examples/sdxl/'\n },\n {\n name: 'sdxl_revision_text_prompts',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/sdxl/#revision'\n },\n {\n name: 'sdxl_revision_zero_positive',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/sdxl/#revision'\n },\n {\n name: 'sdxlturbo_example',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/sdturbo/'\n }\n ]\n },\n {\n moduleName: 'default',\n title: 'Area Composition',\n type: 'image',\n templates: [\n {\n name: 'area_composition',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/area_composition/'\n },\n {\n name: 'area_composition_reversed',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/area_composition/'\n },\n {\n name: 'area_composition_square_area_for_subject',\n mediaType: 'image',\n mediaSubtype: 'png',\n tutorialUrl:\n 'https://comfyanonymous.github.io/ComfyUI_examples/area_composition/#increasing-consistency-of-images-with-area-composition'\n }\n ]\n },\n {\n moduleName: 'default',\n title: '3D',\n type: 'video',\n templates: [\n {\n name: 'stable_zero123_example',\n mediaType: 'image',\n mediaSubtype: 'webp',\n tutorialUrl: 'https://comfyanonymous.github.io/ComfyUI_examples/3d/'\n }\n ]\n },\n {\n moduleName: 'default',\n title: 'Audio',\n type: 'audio',\n templates: [\n {\n name: 'stable_audio_example',\n mediaType: 'audio',\n mediaSubtype: 'flac',\n tutorialUrl: 'https://comfyanonymous.github.io/ComfyUI_examples/audio/'\n }\n ]\n }\n]\n","import { groupBy } from 'lodash'\nimport { defineStore } from 'pinia'\nimport { computed, ref, shallowRef } from 'vue'\n\nimport { CORE_TEMPLATES } from '@/constants/coreTemplates'\nimport { api } from '@/scripts/api'\nimport type {\n TemplateGroup,\n WorkflowTemplates\n} from '@/types/workflowTemplateTypes'\n\nexport const useWorkflowTemplatesStore = defineStore(\n 'workflowTemplates',\n () => {\n const customTemplates = shallowRef<{ [moduleName: string]: string[] }>({})\n const isLoaded = ref(false)\n const defaultTemplate: WorkflowTemplates = CORE_TEMPLATES[0]\n\n const groupedTemplates = computed(() => {\n const allTemplates = [\n ...CORE_TEMPLATES,\n ...Object.entries(customTemplates.value).map(\n ([moduleName, templates]) => ({\n moduleName,\n title: moduleName,\n templates: templates.map((name) => ({\n name,\n mediaType: 'image',\n mediaSubtype: 'jpg'\n }))\n })\n )\n ]\n\n return Object.entries(\n groupBy(allTemplates, (t) =>\n t.moduleName === 'default' ? 'ComfyUI Examples' : 'Custom Nodes'\n )\n ).map(([label, modules]) => ({ label, modules }))\n })\n\n async function loadWorkflowTemplates() {\n try {\n if (!isLoaded.value) {\n customTemplates.value = await api.getWorkflowTemplates()\n isLoaded.value = true\n }\n } catch (error) {\n console.error('Error fetching workflow templates:', error)\n }\n }\n\n return {\n groupedTemplates,\n defaultTemplate,\n isLoaded,\n loadWorkflowTemplates\n }\n }\n)\n","\n\n\n\n\n","import ConfirmationDialogContent from '@/components/dialog/content/ConfirmationDialogContent.vue'\nimport ExecutionErrorDialogContent from '@/components/dialog/content/ExecutionErrorDialogContent.vue'\nimport IssueReportDialogContent from '@/components/dialog/content/IssueReportDialogContent.vue'\nimport LoadWorkflowWarning from '@/components/dialog/content/LoadWorkflowWarning.vue'\nimport MissingModelsWarning from '@/components/dialog/content/MissingModelsWarning.vue'\nimport PromptDialogContent from '@/components/dialog/content/PromptDialogContent.vue'\nimport SettingDialogContent from '@/components/dialog/content/SettingDialogContent.vue'\nimport SettingDialogHeader from '@/components/dialog/header/SettingDialogHeader.vue'\nimport TemplateWorkflowsContent from '@/components/templates/TemplateWorkflowsContent.vue'\nimport { t } from '@/i18n'\nimport { type ShowDialogOptions, useDialogStore } from '@/stores/dialogStore'\n\nexport type ConfirmationDialogType =\n | 'default'\n | 'overwrite'\n | 'delete'\n | 'dirtyClose'\n | 'reinstall'\n\nexport const useDialogService = () => {\n const dialogStore = useDialogStore()\n function showLoadWorkflowWarning(\n props: InstanceType['$props']\n ) {\n dialogStore.showDialog({\n key: 'global-load-workflow-warning',\n component: LoadWorkflowWarning,\n props\n })\n }\n\n function showMissingModelsWarning(\n props: InstanceType['$props']\n ) {\n dialogStore.showDialog({\n key: 'global-missing-models-warning',\n component: MissingModelsWarning,\n props\n })\n }\n\n function showSettingsDialog(\n panel?: 'about' | 'keybinding' | 'extension' | 'server-config'\n ) {\n const props = panel ? { props: { defaultPanel: panel } } : undefined\n\n dialogStore.showDialog({\n key: 'global-settings',\n headerComponent: SettingDialogHeader,\n component: SettingDialogContent,\n ...props\n })\n }\n\n function showAboutDialog() {\n dialogStore.showDialog({\n key: 'global-settings',\n headerComponent: SettingDialogHeader,\n component: SettingDialogContent,\n props: {\n defaultPanel: 'about'\n }\n })\n }\n\n function showExecutionErrorDialog(\n props: InstanceType['$props']\n ) {\n dialogStore.showDialog({\n key: 'global-execution-error',\n component: ExecutionErrorDialogContent,\n props\n })\n }\n\n function showTemplateWorkflowsDialog(\n props: InstanceType['$props'] = {}\n ) {\n dialogStore.showDialog({\n key: 'global-template-workflows',\n title: t('templateWorkflows.title'),\n component: TemplateWorkflowsContent,\n props\n })\n }\n\n function showIssueReportDialog(\n props: InstanceType['$props']\n ) {\n dialogStore.showDialog({\n key: 'global-issue-report',\n component: IssueReportDialogContent,\n props\n })\n }\n\n async function prompt({\n title,\n message,\n defaultValue = ''\n }: {\n title: string\n message: string\n defaultValue?: string\n }): Promise {\n return new Promise((resolve) => {\n dialogStore.showDialog({\n key: 'global-prompt',\n title,\n component: PromptDialogContent,\n props: {\n message,\n defaultValue,\n onConfirm: (value: string) => {\n resolve(value)\n }\n },\n dialogComponentProps: {\n onClose: () => {\n resolve(null)\n }\n }\n })\n })\n }\n\n /**\n * @returns `true` if the user confirms the dialog,\n * `false` if denied (e.g. no in yes/no/cancel), or\n * `null` if the dialog is cancelled or closed\n */\n async function confirm({\n title,\n message,\n type = 'default',\n itemList = [],\n hint\n }: {\n /** Dialog heading */\n title: string\n /** The main message body */\n message: string\n /** Pre-configured dialog type */\n type?: ConfirmationDialogType\n /** Displayed as an unordered list immediately below the message body */\n itemList?: string[]\n hint?: string\n }): Promise {\n return new Promise((resolve) => {\n const options: ShowDialogOptions = {\n key: 'global-prompt',\n title,\n component: ConfirmationDialogContent,\n props: {\n message,\n type,\n itemList,\n onConfirm: resolve,\n hint\n },\n dialogComponentProps: {\n onClose: () => resolve(null)\n }\n }\n\n dialogStore.showDialog(options)\n })\n }\n\n return {\n showLoadWorkflowWarning,\n showMissingModelsWarning,\n showSettingsDialog,\n showAboutDialog,\n showExecutionErrorDialog,\n showTemplateWorkflowsDialog,\n showIssueReportDialog,\n prompt,\n confirm\n }\n}\n","export const RESERVED_BY_TEXT_INPUT = new Set([\n 'Ctrl + a',\n 'Ctrl + c',\n 'Ctrl + v',\n 'Ctrl + x',\n 'Ctrl + z',\n 'Ctrl + y',\n 'Ctrl + p',\n 'Enter',\n 'Shift + Enter',\n 'Ctrl + Backspace',\n 'Ctrl + Delete',\n 'Home',\n 'Ctrl + Home',\n 'Ctrl + Shift + Home',\n 'End',\n 'Ctrl + End',\n 'Ctrl + Shift + End',\n 'PageUp',\n 'PageDown',\n 'Shift + PageUp',\n 'Shift + PageDown',\n 'ArrowLeft',\n 'Ctrl + ArrowLeft',\n 'Shift + ArrowLeft',\n 'Ctrl + Shift + ArrowLeft',\n 'ArrowRight',\n 'Ctrl + ArrowRight',\n 'Shift + ArrowRight',\n 'Ctrl + Shift + ArrowRight',\n 'ArrowUp',\n 'Shift + ArrowUp',\n 'ArrowDown',\n 'Shift + ArrowDown'\n])\n","import _ from 'lodash'\nimport { defineStore } from 'pinia'\nimport { Ref, computed, ref, toRaw } from 'vue'\n\nimport { RESERVED_BY_TEXT_INPUT } from '@/constants/reservedKeyCombos'\nimport { KeyCombo, Keybinding } from '@/types/keyBindingTypes'\n\nexport class KeybindingImpl implements Keybinding {\n commandId: string\n combo: KeyComboImpl\n targetElementId?: string\n\n constructor(obj: Keybinding) {\n this.commandId = obj.commandId\n this.combo = new KeyComboImpl(obj.combo)\n this.targetElementId = obj.targetElementId\n }\n\n equals(other: unknown): boolean {\n const raw = toRaw(other)\n\n return raw instanceof KeybindingImpl\n ? this.commandId === raw.commandId &&\n this.combo.equals(raw.combo) &&\n this.targetElementId === raw.targetElementId\n : false\n }\n}\n\nexport class KeyComboImpl implements KeyCombo {\n key: string\n // ctrl or meta(cmd on mac)\n ctrl: boolean\n alt: boolean\n shift: boolean\n\n constructor(obj: KeyCombo) {\n this.key = obj.key\n this.ctrl = obj.ctrl ?? false\n this.alt = obj.alt ?? false\n this.shift = obj.shift ?? false\n }\n\n static fromEvent(event: KeyboardEvent) {\n return new KeyComboImpl({\n key: event.key,\n ctrl: event.ctrlKey || event.metaKey,\n alt: event.altKey,\n shift: event.shiftKey\n })\n }\n\n equals(other: unknown): boolean {\n const raw = toRaw(other)\n\n return raw instanceof KeyComboImpl\n ? this.key.toUpperCase() === raw.key.toUpperCase() &&\n this.ctrl === raw.ctrl &&\n this.alt === raw.alt &&\n this.shift === raw.shift\n : false\n }\n\n serialize(): string {\n return `${this.key.toUpperCase()}:${this.ctrl}:${this.alt}:${this.shift}`\n }\n\n toString(): string {\n return this.getKeySequences().join(' + ')\n }\n\n get hasModifier(): boolean {\n return this.ctrl || this.alt || this.shift\n }\n\n get isModifier(): boolean {\n return ['Control', 'Meta', 'Alt', 'Shift'].includes(this.key)\n }\n\n get modifierCount(): number {\n const modifiers = [this.ctrl, this.alt, this.shift]\n return modifiers.reduce((acc, cur) => acc + Number(cur), 0)\n }\n\n get isShiftOnly(): boolean {\n return this.shift && this.modifierCount === 1\n }\n\n get isReservedByTextInput(): boolean {\n return (\n !this.hasModifier ||\n this.isShiftOnly ||\n RESERVED_BY_TEXT_INPUT.has(this.toString())\n )\n }\n\n getKeySequences(): string[] {\n const sequences: string[] = []\n if (this.ctrl) {\n sequences.push('Ctrl')\n }\n if (this.alt) {\n sequences.push('Alt')\n }\n if (this.shift) {\n sequences.push('Shift')\n }\n sequences.push(this.key)\n return sequences\n }\n}\n\nexport const useKeybindingStore = defineStore('keybinding', () => {\n /**\n * Default keybindings provided by core and extensions.\n */\n const defaultKeybindings = ref>({})\n /**\n * User-defined keybindings.\n */\n const userKeybindings = ref>({})\n /**\n * User-defined keybindings that unset default keybindings.\n */\n const userUnsetKeybindings = ref>({})\n\n /**\n * Get user-defined keybindings.\n */\n function getUserKeybindings() {\n return userKeybindings.value\n }\n\n /**\n * Get user-defined keybindings that unset default keybindings.\n */\n function getUserUnsetKeybindings() {\n return userUnsetKeybindings.value\n }\n\n const keybindingByKeyCombo = computed>(() => {\n const result: Record = {\n ...defaultKeybindings.value\n }\n\n for (const keybinding of Object.values(userUnsetKeybindings.value)) {\n const serializedCombo = keybinding.combo.serialize()\n if (result[serializedCombo]?.equals(keybinding)) {\n delete result[serializedCombo]\n }\n }\n\n return {\n ...result,\n ...userKeybindings.value\n }\n })\n\n const keybindings = computed(() =>\n Object.values(keybindingByKeyCombo.value)\n )\n\n function getKeybinding(combo: KeyComboImpl) {\n return keybindingByKeyCombo.value[combo.serialize()]\n }\n\n const keybindingsByCommandId = computed>(\n () => {\n return _.groupBy(keybindings.value, 'commandId')\n }\n )\n\n function getKeybindingsByCommandId(commandId: string) {\n return keybindingsByCommandId.value[commandId] ?? []\n }\n\n const defaultKeybindingsByCommandId = computed<\n Record\n >(() => {\n return _.groupBy(Object.values(defaultKeybindings.value), 'commandId')\n })\n\n function getKeybindingByCommandId(commandId: string) {\n return getKeybindingsByCommandId(commandId)[0]\n }\n\n function addKeybinding(\n target: Ref>,\n keybinding: KeybindingImpl,\n { existOk = false }: { existOk: boolean }\n ) {\n if (!existOk && keybinding.combo.serialize() in target.value) {\n throw new Error(\n `Keybinding on ${keybinding.combo} already exists on ${\n target.value[keybinding.combo.serialize()].commandId\n }`\n )\n }\n target.value[keybinding.combo.serialize()] = keybinding\n }\n\n function addDefaultKeybinding(keybinding: KeybindingImpl) {\n addKeybinding(defaultKeybindings, keybinding, { existOk: false })\n }\n\n function addUserKeybinding(keybinding: KeybindingImpl) {\n const defaultKeybinding =\n defaultKeybindings.value[keybinding.combo.serialize()]\n const userUnsetKeybinding =\n userUnsetKeybindings.value[keybinding.combo.serialize()]\n\n // User is adding back a keybinding that was an unsetted default keybinding.\n if (\n keybinding.equals(defaultKeybinding) &&\n keybinding.equals(userUnsetKeybinding)\n ) {\n delete userUnsetKeybindings.value[keybinding.combo.serialize()]\n return\n }\n\n // Unset keybinding on default keybinding if it exists and is not the same as userUnsetKeybinding\n if (defaultKeybinding && !defaultKeybinding.equals(userUnsetKeybinding)) {\n unsetKeybinding(defaultKeybinding)\n }\n\n addKeybinding(userKeybindings, keybinding, { existOk: true })\n }\n\n function unsetKeybinding(keybinding: KeybindingImpl) {\n const serializedCombo = keybinding.combo.serialize()\n if (!(serializedCombo in keybindingByKeyCombo.value)) {\n console.warn(\n `Trying to unset non-exist keybinding: ${JSON.stringify(keybinding)}`\n )\n return\n }\n\n if (userKeybindings.value[serializedCombo]?.equals(keybinding)) {\n delete userKeybindings.value[serializedCombo]\n return\n }\n\n if (defaultKeybindings.value[serializedCombo]?.equals(keybinding)) {\n addKeybinding(userUnsetKeybindings, keybinding, { existOk: false })\n return\n }\n\n console.warn(`Unset unknown keybinding: ${JSON.stringify(keybinding)}`)\n }\n\n /**\n * Update the keybinding on given command if it is different from the current keybinding.\n *\n * @returns true if the keybinding is updated, false otherwise.\n */\n function updateKeybindingOnCommand(keybinding: KeybindingImpl): boolean {\n const currentKeybinding = getKeybindingByCommandId(keybinding.commandId)\n if (currentKeybinding?.equals(keybinding)) {\n return false\n }\n if (currentKeybinding) {\n unsetKeybinding(currentKeybinding)\n }\n addUserKeybinding(keybinding)\n return true\n }\n\n function resetKeybindings() {\n userKeybindings.value = {}\n userUnsetKeybindings.value = {}\n }\n\n function isCommandKeybindingModified(commandId: string): boolean {\n const currentKeybinding: KeybindingImpl | undefined =\n getKeybindingByCommandId(commandId)\n const defaultKeybinding: KeybindingImpl | undefined =\n defaultKeybindingsByCommandId.value[commandId]?.[0]\n\n return !(\n (currentKeybinding === undefined && defaultKeybinding === undefined) ||\n currentKeybinding?.equals(defaultKeybinding)\n )\n }\n\n return {\n keybindings,\n getUserKeybindings,\n getUserUnsetKeybindings,\n getKeybinding,\n getKeybindingsByCommandId,\n getKeybindingByCommandId,\n addDefaultKeybinding,\n addUserKeybinding,\n unsetKeybinding,\n updateKeybindingOnCommand,\n resetKeybindings,\n isCommandKeybindingModified\n }\n})\n","import { defineStore } from 'pinia'\nimport { computed, ref } from 'vue'\n\nimport { useErrorHandling } from '@/composables/useErrorHandling'\nimport type { ComfyExtension } from '@/types/comfy'\n\nimport { type KeybindingImpl, useKeybindingStore } from './keybindingStore'\n\nexport interface ComfyCommand {\n id: string\n function: () => void | Promise\n\n label?: string | (() => string)\n icon?: string | (() => string)\n tooltip?: string | (() => string)\n /** Menubar item label, if different from command label */\n menubarLabel?: string | (() => string)\n versionAdded?: string\n /** If non-nullish, this command will prompt for confirmation. */\n confirmation?: string\n}\n\nexport class ComfyCommandImpl implements ComfyCommand {\n id: string\n function: () => void | Promise\n _label?: string | (() => string)\n _icon?: string | (() => string)\n _tooltip?: string | (() => string)\n _menubarLabel?: string | (() => string)\n versionAdded?: string\n confirmation?: string\n\n constructor(command: ComfyCommand) {\n this.id = command.id\n this.function = command.function\n this._label = command.label\n this._icon = command.icon\n this._tooltip = command.tooltip\n this._menubarLabel = command.menubarLabel ?? command.label\n this.versionAdded = command.versionAdded\n this.confirmation = command.confirmation\n }\n\n get label() {\n return typeof this._label === 'function' ? this._label() : this._label\n }\n\n get icon() {\n return typeof this._icon === 'function' ? this._icon() : this._icon\n }\n\n get tooltip() {\n return typeof this._tooltip === 'function' ? this._tooltip() : this._tooltip\n }\n\n get menubarLabel() {\n return typeof this._menubarLabel === 'function'\n ? this._menubarLabel()\n : this._menubarLabel\n }\n\n get keybinding(): KeybindingImpl | null {\n return useKeybindingStore().getKeybindingByCommandId(this.id)\n }\n}\n\nexport const useCommandStore = defineStore('command', () => {\n const commandsById = ref>({})\n const commands = computed(() => Object.values(commandsById.value))\n\n const registerCommand = (command: ComfyCommand) => {\n if (commandsById.value[command.id]) {\n console.warn(`Command ${command.id} already registered`)\n }\n commandsById.value[command.id] = new ComfyCommandImpl(command)\n }\n\n const registerCommands = (commands: ComfyCommand[]) => {\n for (const command of commands) {\n registerCommand(command)\n }\n }\n\n const getCommand = (command: string) => {\n return commandsById.value[command]\n }\n\n const { wrapWithErrorHandlingAsync } = useErrorHandling()\n const execute = async (\n commandId: string,\n errorHandler?: (error: any) => void\n ) => {\n const command = getCommand(commandId)\n if (command) {\n await wrapWithErrorHandlingAsync(command.function, errorHandler)()\n } else {\n throw new Error(`Command ${commandId} not found`)\n }\n }\n\n const isRegistered = (command: string) => {\n return !!commandsById.value[command]\n }\n\n const loadExtensionCommands = (extension: ComfyExtension) => {\n if (extension.commands) {\n for (const command of extension.commands) {\n registerCommand(command)\n }\n }\n }\n\n return {\n commands,\n execute,\n getCommand,\n registerCommand,\n registerCommands,\n isRegistered,\n loadExtensionCommands\n }\n})\n","export const CORE_MENU_COMMANDS = [\n [['Workflow'], ['Comfy.NewBlankWorkflow']],\n [['Workflow'], ['Comfy.OpenWorkflow', 'Comfy.BrowseTemplates']],\n [\n ['Workflow'],\n [\n 'Comfy.SaveWorkflow',\n 'Comfy.SaveWorkflowAs',\n 'Comfy.ExportWorkflow',\n 'Comfy.ExportWorkflowAPI'\n ]\n ],\n [['Edit'], ['Comfy.Undo', 'Comfy.Redo']],\n [['Edit'], ['Comfy.RefreshNodeDefinitions']],\n [['Edit'], ['Comfy.ClearWorkflow']],\n [['Edit'], ['Comfy.OpenClipspace']],\n [\n ['Help'],\n [\n 'Comfy.Help.OpenComfyUIIssues',\n 'Comfy.Help.OpenComfyUIDocs',\n 'Comfy.Help.OpenComfyOrgDiscord',\n 'Comfy.Help.OpenComfyUIForum'\n ]\n ],\n [['Help'], ['Comfy.Help.AboutComfyUI', 'Comfy.Feedback']]\n]\n","import { defineStore } from 'pinia'\nimport type { MenuItem } from 'primevue/menuitem'\nimport { ref } from 'vue'\n\nimport { CORE_MENU_COMMANDS } from '@/constants/coreMenuCommands'\nimport { ComfyExtension } from '@/types/comfy'\n\nimport { useCommandStore } from './commandStore'\n\nexport const useMenuItemStore = defineStore('menuItem', () => {\n const commandStore = useCommandStore()\n const menuItems = ref([])\n\n const registerMenuGroup = (path: string[], items: MenuItem[]) => {\n let currentLevel = menuItems.value\n\n // Traverse the path, creating nodes if necessary\n for (let i = 0; i < path.length; i++) {\n const segment = path[i]\n let found = currentLevel.find((item) => item.label === segment)\n\n if (!found) {\n // Create a new node if it doesn't exist\n found = {\n label: segment,\n items: []\n }\n currentLevel.push(found)\n }\n\n // Ensure the found item has an 'items' array\n if (!found.items) {\n found.items = []\n }\n\n // Move to the next level\n currentLevel = found.items\n }\n\n if (currentLevel.length > 0) {\n currentLevel.push({\n separator: true\n })\n }\n // Add the new items to the last level\n currentLevel.push(...items)\n }\n\n const registerCommands = (path: string[], commandIds: string[]) => {\n const items = commandIds\n .map((commandId) => commandStore.getCommand(commandId))\n .map(\n (command) =>\n ({\n command: () => commandStore.execute(command.id),\n label: command.menubarLabel,\n icon: command.icon,\n tooltip: command.tooltip,\n comfyCommand: command\n }) as MenuItem\n )\n registerMenuGroup(path, items)\n }\n\n const loadExtensionMenuCommands = (extension: ComfyExtension) => {\n if (!extension.menuCommands) {\n return\n }\n\n const extensionCommandIds = new Set(\n extension.commands?.map((command) => command.id) ?? []\n )\n extension.menuCommands.forEach((menuCommand) => {\n const commands = menuCommand.commands.filter((command) =>\n extensionCommandIds.has(command)\n )\n if (commands.length) {\n registerCommands(menuCommand.path, commands)\n }\n })\n }\n\n const registerCoreMenuCommands = () => {\n for (const [path, commands] of CORE_MENU_COMMANDS) {\n registerCommands(path, commands)\n }\n }\n\n return {\n menuItems,\n registerMenuGroup,\n registerCommands,\n loadExtensionMenuCommands,\n registerCoreMenuCommands\n }\n})\n","import type { LGraphNode } from '@comfyorg/litegraph'\n\nimport type { ComfyWidgetConstructor } from '@/scripts/widgets'\nimport type { InputSpec } from '@/types/apiTypes'\n\nexport const useBooleanWidget = () => {\n const widgetConstructor: ComfyWidgetConstructor = (\n node: LGraphNode,\n inputName: string,\n inputData: InputSpec\n ) => {\n const inputOptions = inputData[1]\n const defaultVal = inputOptions?.default ?? false\n const options = {\n on: inputOptions?.label_on,\n off: inputOptions?.label_off\n }\n\n return {\n widget: node.addWidget('toggle', inputName, defaultVal, () => {}, options)\n }\n }\n\n return widgetConstructor\n}\n","import { LGraphNode } from '@comfyorg/litegraph'\nimport { IWidget } from '@comfyorg/litegraph'\nimport axios from 'axios'\n\nimport type { InputSpec, RemoteWidgetConfig } from '@/types/apiTypes'\n\nconst MAX_RETRIES = 5\nconst TIMEOUT = 4096\n\nexport interface CacheEntry {\n data: T\n timestamp?: number\n error?: Error | null\n fetchPromise?: Promise\n controller?: AbortController\n lastErrorTime?: number\n retryCount?: number\n failed?: boolean\n}\n\nconst dataCache = new Map>()\n\nconst createCacheKey = (config: RemoteWidgetConfig): string => {\n const { route, query_params = {}, refresh = 0 } = config\n\n const paramsKey = Object.entries(query_params)\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([k, v]) => `${k}=${v}`)\n .join('&')\n\n return [route, `r=${refresh}`, paramsKey].join(';')\n}\n\nconst getBackoff = (retryCount: number) =>\n Math.min(1000 * Math.pow(2, retryCount), 512)\n\nconst isInitialized = (entry: CacheEntry | undefined) =>\n entry?.data && entry?.timestamp && entry.timestamp > 0\n\nconst isStale = (entry: CacheEntry | undefined, ttl: number) =>\n entry?.timestamp && Date.now() - entry.timestamp >= ttl\n\nconst isFetching = (entry: CacheEntry | undefined) =>\n entry?.fetchPromise !== undefined\n\nconst isFailed = (entry: CacheEntry | undefined) =>\n entry?.failed === true\n\nconst isBackingOff = (entry: CacheEntry | undefined) =>\n entry?.error &&\n entry?.lastErrorTime &&\n Date.now() - entry.lastErrorTime < getBackoff(entry.retryCount || 0)\n\nconst fetchData = async (\n config: RemoteWidgetConfig,\n controller: AbortController\n) => {\n const { route, response_key, query_params, timeout = TIMEOUT } = config\n const res = await axios.get(route, {\n params: query_params,\n signal: controller.signal,\n timeout\n })\n return response_key ? res.data[response_key] : res.data\n}\n\nexport function useRemoteWidget<\n T extends string | number | boolean | object\n>(options: {\n inputData: InputSpec\n defaultValue: T\n node: LGraphNode\n widget: IWidget\n}) {\n const { inputData, defaultValue, node, widget } = options\n const config: RemoteWidgetConfig = inputData[1].remote\n const { refresh = 0, max_retries = MAX_RETRIES } = config\n const isPermanent = refresh <= 0\n const cacheKey = createCacheKey(config)\n let isLoaded = false\n let refreshQueued = false\n\n const setSuccess = (entry: CacheEntry, data: T) => {\n entry.retryCount = 0\n entry.lastErrorTime = 0\n entry.error = null\n entry.timestamp = Date.now()\n entry.data = data ?? defaultValue\n }\n\n const setError = (entry: CacheEntry, error: Error | unknown) => {\n entry.retryCount = (entry.retryCount || 0) + 1\n entry.lastErrorTime = Date.now()\n entry.error = error instanceof Error ? error : new Error(String(error))\n entry.data ??= defaultValue\n entry.fetchPromise = undefined\n if (entry.retryCount >= max_retries) {\n setFailed(entry)\n }\n }\n\n const setFailed = (entry: CacheEntry) => {\n dataCache.set(cacheKey, {\n data: entry.data ?? defaultValue,\n failed: true\n })\n }\n\n const isFirstLoad = () => {\n return !isLoaded && isInitialized(dataCache.get(cacheKey))\n }\n\n const onFirstLoad = (data: T[]) => {\n isLoaded = true\n widget.value = data[0]\n widget.callback?.(widget.value)\n node.graph?.setDirtyCanvas(true)\n }\n\n const fetchValue = async () => {\n const entry = dataCache.get(cacheKey)\n\n if (isFailed(entry)) return entry!.data\n\n const isValid =\n isInitialized(entry) && (isPermanent || !isStale(entry, refresh))\n if (isValid || isBackingOff(entry) || isFetching(entry)) return entry!.data\n\n const currentEntry: CacheEntry = entry || { data: defaultValue }\n dataCache.set(cacheKey, currentEntry)\n\n try {\n currentEntry.controller = new AbortController()\n currentEntry.fetchPromise = fetchData(config, currentEntry.controller)\n const data = await currentEntry.fetchPromise\n\n setSuccess(currentEntry, data)\n return currentEntry.data\n } catch (err) {\n setError(currentEntry, err)\n return currentEntry.data\n } finally {\n currentEntry.fetchPromise = undefined\n currentEntry.controller = undefined\n }\n }\n\n const onRefresh = () => {\n if (config.control_after_refresh) {\n const data = getCachedValue()\n if (!Array.isArray(data)) return // control_after_refresh is only supported for array values\n\n switch (config.control_after_refresh) {\n case 'first':\n widget.value = data[0] ?? defaultValue\n break\n case 'last':\n widget.value = data.at(-1) ?? defaultValue\n break\n }\n widget.callback?.(widget.value)\n node.graph?.setDirtyCanvas(true)\n }\n }\n\n /**\n * Clear the widget's cached value, forcing a refresh on next access (e.g., a new render)\n */\n const clearCachedValue = () => {\n const entry = dataCache.get(cacheKey)\n if (!entry) return\n if (entry.fetchPromise) entry.controller?.abort() // Abort in-flight request\n dataCache.delete(cacheKey)\n }\n\n /**\n * Get the cached value of the widget without starting a new fetch.\n * @returns the most recently computed value of the widget.\n */\n function getCachedValue() {\n return dataCache.get(cacheKey)?.data as T\n }\n\n /**\n * Getter of the remote property of the widget (e.g., options.values, value, etc.).\n * Starts the fetch process then returns the cached value immediately.\n * @returns the most recent value of the widget.\n */\n function getValue(onFulfilled?: () => void) {\n fetchValue().then((data) => {\n if (isFirstLoad()) onFirstLoad(data)\n if (refreshQueued && data !== defaultValue) {\n onRefresh()\n refreshQueued = false\n }\n onFulfilled?.()\n })\n return getCachedValue() ?? defaultValue\n }\n\n /**\n * Force the widget to refresh its value\n */\n widget.refresh = function () {\n refreshQueued = true\n clearCachedValue()\n getValue()\n }\n\n /**\n * Add a refresh button to the node that, when clicked, will force the widget to refresh\n */\n function addRefreshButton() {\n node.addWidget('button', 'refresh', 'refresh', widget.refresh)\n }\n\n return {\n getCachedValue,\n getValue,\n refreshValue: widget.refresh,\n addRefreshButton,\n getCacheEntry: () => dataCache.get(cacheKey),\n\n cacheKey\n }\n}\n","import type { LGraphNode } from '@comfyorg/litegraph'\nimport type { IComboWidget } from '@comfyorg/litegraph/dist/types/widgets'\n\nimport { addValueControlWidgets } from '@/scripts/widgets'\nimport type { ComfyWidgetConstructor } from '@/scripts/widgets'\nimport { useWidgetStore } from '@/stores/widgetStore'\nimport type { InputSpec } from '@/types/apiTypes'\n\nimport { useRemoteWidget } from './useRemoteWidget'\n\nexport const useComboWidget = () => {\n const widgetConstructor: ComfyWidgetConstructor = (\n node: LGraphNode,\n inputName: string,\n inputData: InputSpec\n ) => {\n const widgetStore = useWidgetStore()\n const { remote, options } = inputData[1] || {}\n const defaultValue = widgetStore.getDefaultValue(inputData)\n\n const res = {\n widget: node.addWidget('combo', inputName, defaultValue, () => {}, {\n values: options ?? inputData[0]\n }) as IComboWidget\n }\n\n if (remote) {\n const remoteWidget = useRemoteWidget({\n inputData,\n defaultValue,\n node,\n widget: res.widget\n })\n if (remote.refresh_button) remoteWidget.addRefreshButton()\n\n const origOptions = res.widget.options\n res.widget.options = new Proxy(\n origOptions as Record,\n {\n get(target, prop: string | symbol) {\n if (prop !== 'values') return target[prop]\n return remoteWidget.getValue()\n }\n }\n )\n }\n\n if (inputData[1]?.control_after_generate) {\n res.widget.linkedWidgets = addValueControlWidgets(\n node,\n res.widget,\n undefined,\n undefined,\n inputData\n )\n }\n return res\n }\n\n return widgetConstructor\n}\n","import type { InputSpec } from '@/types/apiTypes'\n\nexport function getNumberDefaults(\n inputOptions: InputSpec[1],\n options: {\n defaultStep: number\n precision?: number\n enableRounding: boolean\n }\n) {\n const { defaultStep } = options\n const {\n default: defaultVal = 0,\n min = 0,\n max = 2048,\n step = defaultStep\n } = inputOptions\n // precision is the number of decimal places to show.\n // by default, display the the smallest number of decimal places such that changes of size step are visible.\n const { precision = Math.max(-Math.floor(Math.log10(step)), 0) } = options\n\n let round = inputOptions.round\n if (options.enableRounding && (round == undefined || round === true)) {\n // by default, round the value to those decimal places shown.\n round = Math.round(1000000 * Math.pow(0.1, precision)) / 1000000\n }\n\n return {\n val: defaultVal,\n config: { min, max, step: 10.0 * step, round, precision }\n }\n}\n","import type { LGraphNode } from '@comfyorg/litegraph'\nimport type { INumericWidget } from '@comfyorg/litegraph/dist/types/widgets'\n\nimport type { ComfyWidgetConstructor } from '@/scripts/widgets'\nimport { useSettingStore } from '@/stores/settingStore'\nimport type { InputSpec } from '@/types/apiTypes'\nimport { getNumberDefaults } from '@/utils/mathUtil'\n\nexport const useFloatWidget = () => {\n const widgetConstructor: ComfyWidgetConstructor = (\n node: LGraphNode,\n inputName: string,\n inputData: InputSpec\n ) => {\n // TODO: Move to outer scope to avoid re-initializing on every call\n // Blocked on ComfyWidgets lazy initialization.\n\n const settingStore = useSettingStore()\n const sliderEnabled = !settingStore.get('Comfy.DisableSliders')\n const inputOptions = inputData[1]\n\n const widgetType = sliderEnabled\n ? inputOptions?.display === 'slider'\n ? 'slider'\n : 'number'\n : 'number'\n\n const precision =\n settingStore.get('Comfy.FloatRoundingPrecision') || undefined\n const enableRounding = !settingStore.get('Comfy.DisableFloatRounding')\n\n const { val, config } = getNumberDefaults(inputOptions, {\n defaultStep: 0.5,\n precision,\n enableRounding\n })\n\n return {\n widget: node.addWidget(\n widgetType,\n inputName,\n val,\n function (this: INumericWidget, v: number) {\n if (config.round) {\n this.value =\n Math.round((v + Number.EPSILON) / config.round) * config.round\n if (this.value > config.max) this.value = config.max\n if (this.value < config.min) this.value = config.min\n } else {\n this.value = v\n }\n },\n config\n )\n }\n }\n\n return widgetConstructor\n}\n","import type { ColorOption } from '@comfyorg/litegraph'\nimport {\n LGraphGroup,\n LGraphNode,\n LiteGraph,\n isColorable\n} from '@comfyorg/litegraph'\nimport type { IComboWidget } from '@comfyorg/litegraph/dist/types/widgets'\nimport _ from 'lodash'\n\ntype ImageNode = LGraphNode & { imgs: HTMLImageElement[] | undefined }\ntype VideoNode = LGraphNode & {\n videoContainer: HTMLElement | undefined\n imgs: HTMLVideoElement[] | undefined\n}\n\nexport function isImageNode(node: LGraphNode | undefined): node is ImageNode {\n if (!node) return false\n return (\n node.previewMediaType === 'image' ||\n (node.previewMediaType !== 'video' && !!node.imgs?.length)\n )\n}\n\nexport function isVideoNode(node: LGraphNode | undefined): node is VideoNode {\n if (!node) return false\n return node.previewMediaType === 'video' || !!node.videoContainer\n}\n\nexport function addToComboValues(widget: IComboWidget, value: string) {\n if (!widget.options) widget.options = { values: [] }\n if (!widget.options.values) widget.options.values = []\n if (!widget.options.values.includes(value)) {\n widget.options.values.push(value)\n }\n}\n\nexport const isLGraphNode = (item: unknown): item is LGraphNode => {\n return item instanceof LGraphNode\n}\n\nexport const isLGraphGroup = (item: unknown): item is LGraphGroup => {\n return item instanceof LGraphGroup\n}\n\n/**\n * Get the color option of all canvas items if they are all the same.\n * @param items - The items to get the color option of.\n * @returns The color option of the item.\n */\nexport const getItemsColorOption = (items: unknown[]): ColorOption | null => {\n const validItems = _.filter(items, isColorable)\n if (_.isEmpty(validItems)) return null\n\n const colorOptions = _.map(validItems, (item) => item.getColorOption())\n\n return _.every(colorOptions, (option) =>\n _.isEqual(option, _.head(colorOptions))\n )\n ? _.head(colorOptions)!\n : null\n}\n\nexport function executeWidgetsCallback(\n nodes: LGraphNode[],\n callbackName: 'onRemove' | 'beforeQueued' | 'afterQueued'\n) {\n for (const node of nodes) {\n for (const widget of node.widgets ?? []) {\n widget[callbackName]?.()\n }\n }\n}\n\nexport function getImageTop(node: LGraphNode) {\n let shiftY: number\n if (node.imageOffset != null) {\n return node.imageOffset\n } else if (node.widgets?.length) {\n const w = node.widgets[node.widgets.length - 1]\n shiftY = w.last_y ?? 0\n if (w.computeSize) {\n shiftY += w.computeSize()[1] + 4\n } else if (w.computedHeight) {\n shiftY += w.computedHeight\n } else {\n shiftY += LiteGraph.NODE_WIDGET_HEIGHT + 4\n }\n } else {\n return node.computeSize()[1]\n }\n return shiftY\n}\n","import { LGraphNode } from '@comfyorg/litegraph'\nimport { defineStore } from 'pinia'\n\nimport { api } from '@/scripts/api'\nimport { ExecutedWsMessage, ResultItem } from '@/types/apiTypes'\nimport { parseFilePath } from '@/utils/formatUtil'\nimport { isVideoNode } from '@/utils/litegraphUtil'\n\nconst createOutputs = (\n filenames: string[],\n type: string\n): ExecutedWsMessage['output'] => {\n return {\n images: filenames.map((image) => ({ type, ...parseFilePath(image) }))\n }\n}\n\nconst getPreviewParam = (node: LGraphNode): string => {\n if (node.animatedImages || isVideoNode(node)) return ''\n return app.getPreviewFormatParam()\n}\n\nexport const useNodeOutputStore = defineStore('nodeOutput', () => {\n const getNodeId = (node: LGraphNode): string => node.id.toString()\n\n function getNodeOutputs(\n node: LGraphNode\n ): ExecutedWsMessage['output'] | undefined {\n return app.nodeOutputs[getNodeId(node)]\n }\n\n function getNodePreviews(node: LGraphNode): string[] | undefined {\n return app.nodePreviewImages[getNodeId(node)]\n }\n\n function getNodeImageUrls(node: LGraphNode): string[] | undefined {\n const previews = getNodePreviews(node)\n if (previews?.length) return previews\n\n const outputs = getNodeOutputs(node)\n if (!outputs?.images?.length) return\n\n const rand = app.getRandParam()\n const previewParam = getPreviewParam(node)\n\n return outputs.images.map((image) => {\n const imgUrlPart = new URLSearchParams(image)\n return api.apiURL(`/view?${imgUrlPart}${previewParam}${rand}`)\n })\n }\n\n function setNodeOutputs(\n node: LGraphNode,\n filenames: string | string[] | ResultItem,\n { folder = 'input' }: { folder?: string } = {}\n ) {\n if (!filenames || !node) return\n\n const nodeId = getNodeId(node)\n\n if (typeof filenames === 'string') {\n app.nodeOutputs[nodeId] = createOutputs([filenames], folder)\n } else if (!Array.isArray(filenames)) {\n app.nodeOutputs[nodeId] = filenames\n } else {\n const resultItems = createOutputs(filenames, folder)\n if (!resultItems?.images?.length) return\n app.nodeOutputs[nodeId] = resultItems\n }\n }\n\n return {\n getNodeOutputs,\n getNodeImageUrls,\n getNodePreviews,\n setNodeOutputs\n }\n})\n","import type { LGraphNode } from '@comfyorg/litegraph'\n\nimport { useNodeOutputStore } from '@/stores/imagePreviewStore'\n\nconst VIDEO_WIDGET_NAME = 'video-preview' as const\nconst VIDEO_DEFAULT_OPTIONS = {\n playsInline: true,\n controls: true,\n loop: true\n} as const\nconst MEDIA_LOAD_TIMEOUT = 8192 as const\nconst MAX_RETRIES = 1 as const\nconst VIDEO_PIXEL_OFFSET = 64 as const\n\ntype MediaElement = HTMLImageElement | HTMLVideoElement\n\ninterface NodePreviewOptions {\n loadElement: (url: string) => Promise\n onLoaded?: (elements: T[]) => void\n onFailedLoading?: () => void\n}\n\nconst createContainer = () => {\n const container = document.createElement('div')\n container.classList.add('comfy-img-preview')\n return container\n}\n\nconst createTimeout = (ms: number) =>\n new Promise((resolve) => setTimeout(() => resolve(null), ms))\n\nexport const useNodePreview = (\n node: LGraphNode,\n options: NodePreviewOptions\n) => {\n const { loadElement, onLoaded, onFailedLoading } = options\n const nodeOutputStore = useNodeOutputStore()\n\n const loadElementWithTimeout = async (\n url: string,\n retryCount = 0\n ): Promise => {\n const result = await Promise.race([\n loadElement(url),\n createTimeout(MEDIA_LOAD_TIMEOUT)\n ])\n\n if (result === null && retryCount < MAX_RETRIES) {\n return loadElementWithTimeout(url, retryCount + 1)\n }\n\n return result\n }\n\n const loadElements = async (urls: string[]) =>\n Promise.all(urls.map((url) => loadElementWithTimeout(url)))\n\n /**\n * Displays media element(s) on the node.\n */\n function showPreview() {\n if (node.isLoading) return\n\n const outputUrls = nodeOutputStore.getNodeImageUrls(node)\n if (!outputUrls?.length) return\n\n node.isLoading = true\n\n loadElements(outputUrls)\n .then((elements) => {\n const validElements = elements.filter(\n (el): el is NonNullable> => el !== null\n )\n if (validElements.length) {\n onLoaded?.(validElements)\n node.graph?.setDirtyCanvas(true)\n }\n })\n .catch(() => {\n onFailedLoading?.()\n })\n .finally(() => {\n node.isLoading = false\n })\n }\n\n return {\n showPreview\n }\n}\n\n/**\n * Attaches a preview image to a node.\n */\nexport const useNodeImage = (node: LGraphNode) => {\n node.previewMediaType = 'image'\n\n const loadElement = (url: string): Promise =>\n new Promise((resolve) => {\n const img = new Image()\n img.onload = () => resolve(img)\n img.onerror = () => resolve(null)\n img.src = url\n })\n\n const onLoaded = (elements: HTMLImageElement[]) => {\n node.imageIndex = null\n node.imgs = elements\n node.setSizeForImage?.()\n }\n\n return useNodePreview(node, {\n loadElement,\n onLoaded,\n onFailedLoading: () => {\n node.imgs = undefined\n }\n })\n}\n\n/**\n * Attaches a preview video to a node.\n */\nexport const useNodeVideo = (node: LGraphNode) => {\n node.previewMediaType = 'video'\n\n const loadElement = (url: string): Promise =>\n new Promise((resolve) => {\n const video = document.createElement('video')\n Object.assign(video, VIDEO_DEFAULT_OPTIONS)\n video.onloadeddata = () => resolve(video)\n video.onerror = () => resolve(null)\n video.src = url\n })\n\n const addVideoDomWidget = (container: HTMLElement) => {\n const hasWidget = node.widgets?.some((w) => w.name === VIDEO_WIDGET_NAME)\n if (!hasWidget) {\n node.addDOMWidget(VIDEO_WIDGET_NAME, 'video', container, {\n hideOnZoom: false,\n serialize: false\n })\n }\n }\n\n const onLoaded = (videoElements: HTMLVideoElement[]) => {\n const videoElement = videoElements[0]\n if (!videoElement) return\n\n if (!node.videoContainer) {\n node.videoContainer = createContainer()\n addVideoDomWidget(node.videoContainer)\n }\n\n node.videoContainer.replaceChildren(videoElement)\n node.imageOffset = VIDEO_PIXEL_OFFSET\n node.setSizeForImage?.(true)\n }\n\n return useNodePreview(node, {\n loadElement,\n onLoaded,\n onFailedLoading: () => {\n node.videoContainer = undefined\n }\n })\n}\n","import type { LGraphNode } from '@comfyorg/litegraph'\n\ntype DragHandler = (e: DragEvent) => boolean\ntype DropHandler = (files: File[]) => Promise\n\ninterface DragAndDropOptions {\n onDragOver?: DragHandler\n onDrop: DropHandler\n fileFilter?: (file: File) => boolean\n}\n\n/**\n * Adds drag and drop file handling to a node\n */\nexport const useNodeDragAndDrop = (\n node: LGraphNode,\n options: DragAndDropOptions\n) => {\n const { onDragOver, onDrop, fileFilter = () => true } = options\n\n const hasFiles = (items: DataTransferItemList) =>\n !!Array.from(items).find((f) => f.kind === 'file')\n\n const filterFiles = (files: FileList) => Array.from(files).filter(fileFilter)\n\n const hasValidFiles = (files: FileList) => filterFiles(files).length > 0\n\n const isDraggingFiles = (e: DragEvent | undefined) => {\n if (!e?.dataTransfer?.items) return false\n return onDragOver?.(e) ?? hasFiles(e.dataTransfer.items)\n }\n\n const isDraggingValidFiles = (e: DragEvent | undefined) => {\n if (!e?.dataTransfer?.files) return false\n return hasValidFiles(e.dataTransfer.files)\n }\n\n node.onDragOver = isDraggingFiles\n\n node.onDragDrop = function (e: DragEvent) {\n if (!isDraggingValidFiles(e)) return false\n\n const files = filterFiles(e.dataTransfer!.files)\n onDrop(files).then((results) => {\n if (!results?.length) return\n })\n return true\n }\n}\n","/**\n * Chain multiple callbacks together.\n *\n * @param originalCallback - The original callback to chain.\n * @param callbacks - The callbacks to chain.\n * @returns A new callback that chains the original callback with the callbacks.\n */\nexport const useChainCallback = void>(\n originalCallback: T | undefined,\n ...callbacks: ((...args: Parameters) => void)[]\n) => {\n return (...args: Parameters) => {\n originalCallback?.(...args)\n callbacks.forEach((callback) => callback(...args))\n }\n}\n","import type { LGraphNode } from '@comfyorg/litegraph'\n\nimport { useChainCallback } from '@/composables/functional/useChainCallback'\n\ninterface FileInputOptions {\n accept?: string\n allow_batch?: boolean\n fileFilter?: (file: File) => boolean\n onSelect: (files: File[]) => void\n}\n\n/**\n * Creates a file input for a node.\n */\nexport function useNodeFileInput(node: LGraphNode, options: FileInputOptions) {\n const {\n accept,\n allow_batch = false,\n fileFilter = () => true,\n onSelect\n } = options\n\n let fileInput: HTMLInputElement | null = document.createElement('input')\n fileInput.type = 'file'\n fileInput.accept = accept ?? '*'\n fileInput.multiple = allow_batch\n\n fileInput.onchange = () => {\n if (fileInput?.files?.length) {\n const files = Array.from(fileInput.files).filter(fileFilter)\n if (files.length) onSelect(files)\n }\n }\n\n node.onRemoved = useChainCallback(node.onRemoved, () => {\n if (fileInput) {\n fileInput.onchange = null\n fileInput = null\n }\n })\n\n return {\n openFileSelection: () => fileInput?.click()\n }\n}\n","import type { LGraphNode } from '@comfyorg/litegraph'\n\ntype PasteHandler = (files: File[]) => Promise\n\ninterface NodePasteOptions {\n onPaste: PasteHandler\n fileFilter?: (file: File) => boolean\n allow_batch?: boolean\n}\n\n/**\n * Adds paste handling to a node\n */\nexport const useNodePaste = (\n node: LGraphNode,\n options: NodePasteOptions\n) => {\n const { onPaste, fileFilter = () => true, allow_batch = false } = options\n\n node.pasteFiles = function (files: File[]) {\n const filteredFiles = Array.from(files).filter(fileFilter)\n if (!filteredFiles.length) return false\n\n const paste = allow_batch ? filteredFiles : filteredFiles.slice(0, 1)\n\n onPaste(paste).then((result) => {\n if (!result) return\n })\n return true\n }\n}\n","import type { LGraphNode } from '@comfyorg/litegraph'\n\nimport { useNodeDragAndDrop } from '@/composables/node/useNodeDragAndDrop'\nimport { useNodeFileInput } from '@/composables/node/useNodeFileInput'\nimport { useNodePaste } from '@/composables/node/useNodePaste'\nimport { api } from '@/scripts/api'\nimport { useToastStore } from '@/stores/toastStore'\n\nconst PASTED_IMAGE_EXPIRY_MS = 2000\n\nconst uploadFile = async (file: File, isPasted: boolean) => {\n const body = new FormData()\n body.append('image', file)\n if (isPasted) body.append('subfolder', 'pasted')\n\n const resp = await api.fetchApi('/upload/image', {\n method: 'POST',\n body\n })\n\n if (resp.status !== 200) {\n useToastStore().addAlert(resp.status + ' - ' + resp.statusText)\n return\n }\n\n const data = await resp.json()\n return data.subfolder ? `${data.subfolder}/${data.name}` : data.name\n}\n\ninterface ImageUploadOptions {\n fileFilter?: (file: File) => boolean\n onUploadComplete: (paths: string[]) => void\n allow_batch?: boolean\n /**\n * The file types to accept.\n * @example 'image/png,image/jpeg,image/webp,video/webm,video/mp4'\n */\n accept?: string\n}\n\n/**\n * Adds image upload to a node via drag & drop, paste, and file input.\n */\nexport const useNodeImageUpload = (\n node: LGraphNode,\n options: ImageUploadOptions\n) => {\n const { fileFilter, onUploadComplete, allow_batch, accept } = options\n\n const isPastedFile = (file: File): boolean =>\n file.name === 'image.png' &&\n file.lastModified - Date.now() < PASTED_IMAGE_EXPIRY_MS\n\n const handleUpload = async (file: File) => {\n try {\n const path = await uploadFile(file, isPastedFile(file))\n if (!path) return\n return path\n } catch (error) {\n useToastStore().addAlert(String(error))\n }\n }\n\n const handleUploadBatch = async (files: File[]) => {\n const paths = await Promise.all(files.map(handleUpload))\n const validPaths = paths.filter((p): p is string => !!p)\n if (validPaths.length) onUploadComplete(validPaths)\n return validPaths\n }\n\n // Handle drag & drop\n useNodeDragAndDrop(node, {\n fileFilter,\n onDrop: handleUploadBatch\n })\n\n // Handle paste\n useNodePaste(node, {\n fileFilter,\n allow_batch,\n onPaste: handleUploadBatch\n })\n\n // Handle file input\n const { openFileSelection } = useNodeFileInput(node, {\n fileFilter,\n allow_batch,\n accept,\n onSelect: handleUploadBatch\n })\n\n return { openFileSelection, handleUpload }\n}\n","/**\n * Creates a getter/setter pair that transforms values on access if they have changed.\n * Does not observe deep changes.\n *\n * @example\n * const { get, set } = useValueTransform(\n * items => items.map(formatPath)\n * )\n *\n * Object.defineProperty(obj, 'value', { get, set })\n */\nexport function useValueTransform(\n transform: (value: Internal) => External,\n initialValue: Internal\n) {\n let internalValue: Internal = initialValue\n let cachedValue: External = transform(initialValue)\n let isChanged = false\n\n return {\n get: () => {\n if (!isChanged) return cachedValue\n cachedValue = transform(internalValue)\n return cachedValue\n },\n set: (value: Internal) => {\n isChanged = true\n internalValue = value\n }\n }\n}\n","import type { LGraphNode } from '@comfyorg/litegraph'\nimport { IComboWidget } from '@comfyorg/litegraph/dist/types/widgets'\n\nimport { useNodeImage, useNodeVideo } from '@/composables/node/useNodeImage'\nimport { useNodeImageUpload } from '@/composables/node/useNodeImageUpload'\nimport { useValueTransform } from '@/composables/useValueTransform'\nimport type { ComfyWidgetConstructor } from '@/scripts/widgets'\nimport { useNodeOutputStore } from '@/stores/imagePreviewStore'\nimport type { ComfyApp } from '@/types'\nimport type { InputSpec, ResultItem } from '@/types/apiTypes'\nimport { createAnnotatedPath } from '@/utils/formatUtil'\nimport { addToComboValues } from '@/utils/litegraphUtil'\n\nconst ACCEPTED_IMAGE_TYPES = 'image/png,image/jpeg,image/webp'\nconst ACCEPTED_VIDEO_TYPES = 'video/webm,video/mp4'\n\ntype InternalFile = string | ResultItem\ntype InternalValue = InternalFile | InternalFile[]\ntype ExposedValue = string | string[]\n\nconst isImageFile = (file: File) => file.type.startsWith('image/')\nconst isVideoFile = (file: File) => file.type.startsWith('video/')\n\nconst findFileComboWidget = (node: LGraphNode, inputName: string) =>\n node.widgets!.find((w) => w.name === inputName) as IComboWidget & {\n value: ExposedValue\n }\n\nexport const useImageUploadWidget = () => {\n const widgetConstructor: ComfyWidgetConstructor = (\n node: LGraphNode,\n inputName: string,\n inputData: InputSpec,\n app: ComfyApp\n ) => {\n const inputOptions = inputData[1] ?? {}\n const { imageInputName, allow_batch, image_folder = 'input' } = inputOptions\n const nodeOutputStore = useNodeOutputStore()\n\n const isVideo = !!inputOptions.video_upload\n const accept = isVideo ? ACCEPTED_VIDEO_TYPES : ACCEPTED_IMAGE_TYPES\n const { showPreview } = isVideo ? useNodeVideo(node) : useNodeImage(node)\n\n const fileFilter = isVideo ? isVideoFile : isImageFile\n const fileComboWidget = findFileComboWidget(node, imageInputName)\n const initialFile = `${fileComboWidget.value}`\n const formatPath = (value: InternalFile) =>\n createAnnotatedPath(value, { rootFolder: image_folder })\n\n const transform = (internalValue: InternalValue): ExposedValue => {\n if (!internalValue) return initialFile\n if (Array.isArray(internalValue))\n return allow_batch\n ? internalValue.map(formatPath)\n : formatPath(internalValue[0])\n return formatPath(internalValue)\n }\n\n Object.defineProperty(\n fileComboWidget,\n 'value',\n useValueTransform(transform, initialFile)\n )\n\n // Setup file upload handling\n const { openFileSelection } = useNodeImageUpload(node, {\n allow_batch,\n fileFilter,\n accept,\n onUploadComplete: (output) => {\n output.forEach((path) => addToComboValues(fileComboWidget, path))\n // @ts-expect-error litegraph combo value type does not support arrays yet\n fileComboWidget.value = output\n fileComboWidget.callback?.(output)\n }\n })\n\n // Create the button widget for selecting the files\n const uploadWidget = node.addWidget(\n 'button',\n inputName,\n 'image',\n () => openFileSelection(),\n {\n serialize: false\n }\n )\n uploadWidget.label = 'choose file to upload'\n\n // TODO: Explain this?\n // @ts-expect-error LGraphNode.callback is not typed\n // Add our own callback to the combo widget to render an image when it changes\n const cb = node.callback\n fileComboWidget.callback = function (...args) {\n nodeOutputStore.setNodeOutputs(node, fileComboWidget.value)\n if (cb) return cb.apply(this, args)\n }\n\n // On load if we have a value then render the image\n // The value isnt set immediately so we need to wait a moment\n // No change callbacks seem to be fired on initial setting of the value\n requestAnimationFrame(() => {\n nodeOutputStore.setNodeOutputs(node, fileComboWidget.value)\n showPreview()\n })\n\n return { widget: uploadWidget }\n }\n\n return widgetConstructor\n}\n","import type { LGraphNode } from '@comfyorg/litegraph'\nimport type { INumericWidget } from '@comfyorg/litegraph/dist/types/widgets'\n\nimport type { ComfyApp } from '@/scripts/app'\nimport {\n type ComfyWidgetConstructor,\n addValueControlWidget\n} from '@/scripts/widgets'\nimport { useSettingStore } from '@/stores/settingStore'\nimport { InputSpec } from '@/types/apiTypes'\nimport { getNumberDefaults } from '@/utils/mathUtil'\n\nexport const useIntWidget = () => {\n const widgetConstructor: ComfyWidgetConstructor = (\n node: LGraphNode,\n inputName: string,\n inputData: InputSpec,\n app: ComfyApp,\n widgetName?: string\n ) => {\n const settingStore = useSettingStore()\n const sliderEnabled = !settingStore.get('Comfy.DisableSliders')\n const inputOptions = inputData[1]\n const widgetType = sliderEnabled\n ? inputOptions?.display === 'slider'\n ? 'slider'\n : 'number'\n : 'number'\n\n const { val, config } = getNumberDefaults(inputOptions, {\n defaultStep: 1,\n precision: 0,\n enableRounding: true\n })\n config.precision = 0\n\n const result = {\n widget: node.addWidget(\n widgetType,\n inputName,\n val,\n function (this: INumericWidget, v: number) {\n const s = (this.options.step ?? 1) / 10\n let sh = (this.options.min ?? 0) % s\n if (isNaN(sh)) {\n sh = 0\n }\n this.value = Math.round((v - sh) / s) * s + sh\n },\n config\n )\n }\n\n if (inputData[1]?.control_after_generate) {\n const seedControl = addValueControlWidget(\n node,\n result.widget,\n 'randomize',\n undefined,\n widgetName,\n inputData\n )\n result.widget.linkedWidgets = [seedControl]\n }\n\n return result\n }\n return widgetConstructor\n}\n","// ::- Persistent data structure representing an ordered mapping from\n// strings to values, with some convenient update methods.\nfunction OrderedMap(content) {\n this.content = content;\n}\n\nOrderedMap.prototype = {\n constructor: OrderedMap,\n\n find: function(key) {\n for (var i = 0; i < this.content.length; i += 2)\n if (this.content[i] === key) return i\n return -1\n },\n\n // :: (string) → ?any\n // Retrieve the value stored under `key`, or return undefined when\n // no such key exists.\n get: function(key) {\n var found = this.find(key);\n return found == -1 ? undefined : this.content[found + 1]\n },\n\n // :: (string, any, ?string) → OrderedMap\n // Create a new map by replacing the value of `key` with a new\n // value, or adding a binding to the end of the map. If `newKey` is\n // given, the key of the binding will be replaced with that key.\n update: function(key, value, newKey) {\n var self = newKey && newKey != key ? this.remove(newKey) : this;\n var found = self.find(key), content = self.content.slice();\n if (found == -1) {\n content.push(newKey || key, value);\n } else {\n content[found + 1] = value;\n if (newKey) content[found] = newKey;\n }\n return new OrderedMap(content)\n },\n\n // :: (string) → OrderedMap\n // Return a map with the given key removed, if it existed.\n remove: function(key) {\n var found = this.find(key);\n if (found == -1) return this\n var content = this.content.slice();\n content.splice(found, 2);\n return new OrderedMap(content)\n },\n\n // :: (string, any) → OrderedMap\n // Add a new key to the start of the map.\n addToStart: function(key, value) {\n return new OrderedMap([key, value].concat(this.remove(key).content))\n },\n\n // :: (string, any) → OrderedMap\n // Add a new key to the end of the map.\n addToEnd: function(key, value) {\n var content = this.remove(key).content.slice();\n content.push(key, value);\n return new OrderedMap(content)\n },\n\n // :: (string, string, any) → OrderedMap\n // Add a key after the given key. If `place` is not found, the new\n // key is added to the end.\n addBefore: function(place, key, value) {\n var without = this.remove(key), content = without.content.slice();\n var found = without.find(place);\n content.splice(found == -1 ? content.length : found, 0, key, value);\n return new OrderedMap(content)\n },\n\n // :: ((key: string, value: any))\n // Call the given function for each key/value pair in the map, in\n // order.\n forEach: function(f) {\n for (var i = 0; i < this.content.length; i += 2)\n f(this.content[i], this.content[i + 1]);\n },\n\n // :: (union) → OrderedMap\n // Create a new map by prepending the keys in this map that don't\n // appear in `map` before the keys in `map`.\n prepend: function(map) {\n map = OrderedMap.from(map);\n if (!map.size) return this\n return new OrderedMap(map.content.concat(this.subtract(map).content))\n },\n\n // :: (union) → OrderedMap\n // Create a new map by appending the keys in this map that don't\n // appear in `map` after the keys in `map`.\n append: function(map) {\n map = OrderedMap.from(map);\n if (!map.size) return this\n return new OrderedMap(this.subtract(map).content.concat(map.content))\n },\n\n // :: (union) → OrderedMap\n // Create a map containing all the keys in this map that don't\n // appear in `map`.\n subtract: function(map) {\n var result = this;\n map = OrderedMap.from(map);\n for (var i = 0; i < map.content.length; i += 2)\n result = result.remove(map.content[i]);\n return result\n },\n\n // :: () → Object\n // Turn ordered map into a plain object.\n toObject: function() {\n var result = {};\n this.forEach(function(key, value) { result[key] = value; });\n return result\n },\n\n // :: number\n // The amount of keys in this map.\n get size() {\n return this.content.length >> 1\n }\n};\n\n// :: (?union) → OrderedMap\n// Return a map with the given content. If null, create an empty\n// map. If given an ordered map, return that map itself. If given an\n// object, create a map from the object's properties.\nOrderedMap.from = function(value) {\n if (value instanceof OrderedMap) return value\n var content = [];\n if (value) for (var prop in value) content.push(prop, value[prop]);\n return new OrderedMap(content)\n};\n\nexport default OrderedMap;\n","import OrderedMap from 'orderedmap';\n\nfunction findDiffStart(a, b, pos) {\n for (let i = 0;; i++) {\n if (i == a.childCount || i == b.childCount)\n return a.childCount == b.childCount ? null : pos;\n let childA = a.child(i), childB = b.child(i);\n if (childA == childB) {\n pos += childA.nodeSize;\n continue;\n }\n if (!childA.sameMarkup(childB))\n return pos;\n if (childA.isText && childA.text != childB.text) {\n for (let j = 0; childA.text[j] == childB.text[j]; j++)\n pos++;\n return pos;\n }\n if (childA.content.size || childB.content.size) {\n let inner = findDiffStart(childA.content, childB.content, pos + 1);\n if (inner != null)\n return inner;\n }\n pos += childA.nodeSize;\n }\n}\nfunction findDiffEnd(a, b, posA, posB) {\n for (let iA = a.childCount, iB = b.childCount;;) {\n if (iA == 0 || iB == 0)\n return iA == iB ? null : { a: posA, b: posB };\n let childA = a.child(--iA), childB = b.child(--iB), size = childA.nodeSize;\n if (childA == childB) {\n posA -= size;\n posB -= size;\n continue;\n }\n if (!childA.sameMarkup(childB))\n return { a: posA, b: posB };\n if (childA.isText && childA.text != childB.text) {\n let same = 0, minSize = Math.min(childA.text.length, childB.text.length);\n while (same < minSize && childA.text[childA.text.length - same - 1] == childB.text[childB.text.length - same - 1]) {\n same++;\n posA--;\n posB--;\n }\n return { a: posA, b: posB };\n }\n if (childA.content.size || childB.content.size) {\n let inner = findDiffEnd(childA.content, childB.content, posA - 1, posB - 1);\n if (inner)\n return inner;\n }\n posA -= size;\n posB -= size;\n }\n}\n\n/**\nA fragment represents a node's collection of child nodes.\n\nLike nodes, fragments are persistent data structures, and you\nshould not mutate them or their content. Rather, you create new\ninstances whenever needed. The API tries to make this easy.\n*/\nclass Fragment {\n /**\n @internal\n */\n constructor(\n /**\n The child nodes in this fragment.\n */\n content, size) {\n this.content = content;\n this.size = size || 0;\n if (size == null)\n for (let i = 0; i < content.length; i++)\n this.size += content[i].nodeSize;\n }\n /**\n Invoke a callback for all descendant nodes between the given two\n positions (relative to start of this fragment). Doesn't descend\n into a node when the callback returns `false`.\n */\n nodesBetween(from, to, f, nodeStart = 0, parent) {\n for (let i = 0, pos = 0; pos < to; i++) {\n let child = this.content[i], end = pos + child.nodeSize;\n if (end > from && f(child, nodeStart + pos, parent || null, i) !== false && child.content.size) {\n let start = pos + 1;\n child.nodesBetween(Math.max(0, from - start), Math.min(child.content.size, to - start), f, nodeStart + start);\n }\n pos = end;\n }\n }\n /**\n Call the given callback for every descendant node. `pos` will be\n relative to the start of the fragment. The callback may return\n `false` to prevent traversal of a given node's children.\n */\n descendants(f) {\n this.nodesBetween(0, this.size, f);\n }\n /**\n Extract the text between `from` and `to`. See the same method on\n [`Node`](https://prosemirror.net/docs/ref/#model.Node.textBetween).\n */\n textBetween(from, to, blockSeparator, leafText) {\n let text = \"\", first = true;\n this.nodesBetween(from, to, (node, pos) => {\n let nodeText = node.isText ? node.text.slice(Math.max(from, pos) - pos, to - pos)\n : !node.isLeaf ? \"\"\n : leafText ? (typeof leafText === \"function\" ? leafText(node) : leafText)\n : node.type.spec.leafText ? node.type.spec.leafText(node)\n : \"\";\n if (node.isBlock && (node.isLeaf && nodeText || node.isTextblock) && blockSeparator) {\n if (first)\n first = false;\n else\n text += blockSeparator;\n }\n text += nodeText;\n }, 0);\n return text;\n }\n /**\n Create a new fragment containing the combined content of this\n fragment and the other.\n */\n append(other) {\n if (!other.size)\n return this;\n if (!this.size)\n return other;\n let last = this.lastChild, first = other.firstChild, content = this.content.slice(), i = 0;\n if (last.isText && last.sameMarkup(first)) {\n content[content.length - 1] = last.withText(last.text + first.text);\n i = 1;\n }\n for (; i < other.content.length; i++)\n content.push(other.content[i]);\n return new Fragment(content, this.size + other.size);\n }\n /**\n Cut out the sub-fragment between the two given positions.\n */\n cut(from, to = this.size) {\n if (from == 0 && to == this.size)\n return this;\n let result = [], size = 0;\n if (to > from)\n for (let i = 0, pos = 0; pos < to; i++) {\n let child = this.content[i], end = pos + child.nodeSize;\n if (end > from) {\n if (pos < from || end > to) {\n if (child.isText)\n child = child.cut(Math.max(0, from - pos), Math.min(child.text.length, to - pos));\n else\n child = child.cut(Math.max(0, from - pos - 1), Math.min(child.content.size, to - pos - 1));\n }\n result.push(child);\n size += child.nodeSize;\n }\n pos = end;\n }\n return new Fragment(result, size);\n }\n /**\n @internal\n */\n cutByIndex(from, to) {\n if (from == to)\n return Fragment.empty;\n if (from == 0 && to == this.content.length)\n return this;\n return new Fragment(this.content.slice(from, to));\n }\n /**\n Create a new fragment in which the node at the given index is\n replaced by the given node.\n */\n replaceChild(index, node) {\n let current = this.content[index];\n if (current == node)\n return this;\n let copy = this.content.slice();\n let size = this.size + node.nodeSize - current.nodeSize;\n copy[index] = node;\n return new Fragment(copy, size);\n }\n /**\n Create a new fragment by prepending the given node to this\n fragment.\n */\n addToStart(node) {\n return new Fragment([node].concat(this.content), this.size + node.nodeSize);\n }\n /**\n Create a new fragment by appending the given node to this\n fragment.\n */\n addToEnd(node) {\n return new Fragment(this.content.concat(node), this.size + node.nodeSize);\n }\n /**\n Compare this fragment to another one.\n */\n eq(other) {\n if (this.content.length != other.content.length)\n return false;\n for (let i = 0; i < this.content.length; i++)\n if (!this.content[i].eq(other.content[i]))\n return false;\n return true;\n }\n /**\n The first child of the fragment, or `null` if it is empty.\n */\n get firstChild() { return this.content.length ? this.content[0] : null; }\n /**\n The last child of the fragment, or `null` if it is empty.\n */\n get lastChild() { return this.content.length ? this.content[this.content.length - 1] : null; }\n /**\n The number of child nodes in this fragment.\n */\n get childCount() { return this.content.length; }\n /**\n Get the child node at the given index. Raise an error when the\n index is out of range.\n */\n child(index) {\n let found = this.content[index];\n if (!found)\n throw new RangeError(\"Index \" + index + \" out of range for \" + this);\n return found;\n }\n /**\n Get the child node at the given index, if it exists.\n */\n maybeChild(index) {\n return this.content[index] || null;\n }\n /**\n Call `f` for every child node, passing the node, its offset\n into this parent node, and its index.\n */\n forEach(f) {\n for (let i = 0, p = 0; i < this.content.length; i++) {\n let child = this.content[i];\n f(child, p, i);\n p += child.nodeSize;\n }\n }\n /**\n Find the first position at which this fragment and another\n fragment differ, or `null` if they are the same.\n */\n findDiffStart(other, pos = 0) {\n return findDiffStart(this, other, pos);\n }\n /**\n Find the first position, searching from the end, at which this\n fragment and the given fragment differ, or `null` if they are\n the same. Since this position will not be the same in both\n nodes, an object with two separate positions is returned.\n */\n findDiffEnd(other, pos = this.size, otherPos = other.size) {\n return findDiffEnd(this, other, pos, otherPos);\n }\n /**\n Find the index and inner offset corresponding to a given relative\n position in this fragment. The result object will be reused\n (overwritten) the next time the function is called. @internal\n */\n findIndex(pos, round = -1) {\n if (pos == 0)\n return retIndex(0, pos);\n if (pos == this.size)\n return retIndex(this.content.length, pos);\n if (pos > this.size || pos < 0)\n throw new RangeError(`Position ${pos} outside of fragment (${this})`);\n for (let i = 0, curPos = 0;; i++) {\n let cur = this.child(i), end = curPos + cur.nodeSize;\n if (end >= pos) {\n if (end == pos || round > 0)\n return retIndex(i + 1, end);\n return retIndex(i, curPos);\n }\n curPos = end;\n }\n }\n /**\n Return a debugging string that describes this fragment.\n */\n toString() { return \"<\" + this.toStringInner() + \">\"; }\n /**\n @internal\n */\n toStringInner() { return this.content.join(\", \"); }\n /**\n Create a JSON-serializeable representation of this fragment.\n */\n toJSON() {\n return this.content.length ? this.content.map(n => n.toJSON()) : null;\n }\n /**\n Deserialize a fragment from its JSON representation.\n */\n static fromJSON(schema, value) {\n if (!value)\n return Fragment.empty;\n if (!Array.isArray(value))\n throw new RangeError(\"Invalid input for Fragment.fromJSON\");\n return new Fragment(value.map(schema.nodeFromJSON));\n }\n /**\n Build a fragment from an array of nodes. Ensures that adjacent\n text nodes with the same marks are joined together.\n */\n static fromArray(array) {\n if (!array.length)\n return Fragment.empty;\n let joined, size = 0;\n for (let i = 0; i < array.length; i++) {\n let node = array[i];\n size += node.nodeSize;\n if (i && node.isText && array[i - 1].sameMarkup(node)) {\n if (!joined)\n joined = array.slice(0, i);\n joined[joined.length - 1] = node\n .withText(joined[joined.length - 1].text + node.text);\n }\n else if (joined) {\n joined.push(node);\n }\n }\n return new Fragment(joined || array, size);\n }\n /**\n Create a fragment from something that can be interpreted as a\n set of nodes. For `null`, it returns the empty fragment. For a\n fragment, the fragment itself. For a node or array of nodes, a\n fragment containing those nodes.\n */\n static from(nodes) {\n if (!nodes)\n return Fragment.empty;\n if (nodes instanceof Fragment)\n return nodes;\n if (Array.isArray(nodes))\n return this.fromArray(nodes);\n if (nodes.attrs)\n return new Fragment([nodes], nodes.nodeSize);\n throw new RangeError(\"Can not convert \" + nodes + \" to a Fragment\" +\n (nodes.nodesBetween ? \" (looks like multiple versions of prosemirror-model were loaded)\" : \"\"));\n }\n}\n/**\nAn empty fragment. Intended to be reused whenever a node doesn't\ncontain anything (rather than allocating a new empty fragment for\neach leaf node).\n*/\nFragment.empty = new Fragment([], 0);\nconst found = { index: 0, offset: 0 };\nfunction retIndex(index, offset) {\n found.index = index;\n found.offset = offset;\n return found;\n}\n\nfunction compareDeep(a, b) {\n if (a === b)\n return true;\n if (!(a && typeof a == \"object\") ||\n !(b && typeof b == \"object\"))\n return false;\n let array = Array.isArray(a);\n if (Array.isArray(b) != array)\n return false;\n if (array) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!compareDeep(a[i], b[i]))\n return false;\n }\n else {\n for (let p in a)\n if (!(p in b) || !compareDeep(a[p], b[p]))\n return false;\n for (let p in b)\n if (!(p in a))\n return false;\n }\n return true;\n}\n\n/**\nA mark is a piece of information that can be attached to a node,\nsuch as it being emphasized, in code font, or a link. It has a\ntype and optionally a set of attributes that provide further\ninformation (such as the target of the link). Marks are created\nthrough a `Schema`, which controls which types exist and which\nattributes they have.\n*/\nclass Mark {\n /**\n @internal\n */\n constructor(\n /**\n The type of this mark.\n */\n type, \n /**\n The attributes associated with this mark.\n */\n attrs) {\n this.type = type;\n this.attrs = attrs;\n }\n /**\n Given a set of marks, create a new set which contains this one as\n well, in the right position. If this mark is already in the set,\n the set itself is returned. If any marks that are set to be\n [exclusive](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) with this mark are present,\n those are replaced by this one.\n */\n addToSet(set) {\n let copy, placed = false;\n for (let i = 0; i < set.length; i++) {\n let other = set[i];\n if (this.eq(other))\n return set;\n if (this.type.excludes(other.type)) {\n if (!copy)\n copy = set.slice(0, i);\n }\n else if (other.type.excludes(this.type)) {\n return set;\n }\n else {\n if (!placed && other.type.rank > this.type.rank) {\n if (!copy)\n copy = set.slice(0, i);\n copy.push(this);\n placed = true;\n }\n if (copy)\n copy.push(other);\n }\n }\n if (!copy)\n copy = set.slice();\n if (!placed)\n copy.push(this);\n return copy;\n }\n /**\n Remove this mark from the given set, returning a new set. If this\n mark is not in the set, the set itself is returned.\n */\n removeFromSet(set) {\n for (let i = 0; i < set.length; i++)\n if (this.eq(set[i]))\n return set.slice(0, i).concat(set.slice(i + 1));\n return set;\n }\n /**\n Test whether this mark is in the given set of marks.\n */\n isInSet(set) {\n for (let i = 0; i < set.length; i++)\n if (this.eq(set[i]))\n return true;\n return false;\n }\n /**\n Test whether this mark has the same type and attributes as\n another mark.\n */\n eq(other) {\n return this == other ||\n (this.type == other.type && compareDeep(this.attrs, other.attrs));\n }\n /**\n Convert this mark to a JSON-serializeable representation.\n */\n toJSON() {\n let obj = { type: this.type.name };\n for (let _ in this.attrs) {\n obj.attrs = this.attrs;\n break;\n }\n return obj;\n }\n /**\n Deserialize a mark from JSON.\n */\n static fromJSON(schema, json) {\n if (!json)\n throw new RangeError(\"Invalid input for Mark.fromJSON\");\n let type = schema.marks[json.type];\n if (!type)\n throw new RangeError(`There is no mark type ${json.type} in this schema`);\n let mark = type.create(json.attrs);\n type.checkAttrs(mark.attrs);\n return mark;\n }\n /**\n Test whether two sets of marks are identical.\n */\n static sameSet(a, b) {\n if (a == b)\n return true;\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!a[i].eq(b[i]))\n return false;\n return true;\n }\n /**\n Create a properly sorted mark set from null, a single mark, or an\n unsorted array of marks.\n */\n static setFrom(marks) {\n if (!marks || Array.isArray(marks) && marks.length == 0)\n return Mark.none;\n if (marks instanceof Mark)\n return [marks];\n let copy = marks.slice();\n copy.sort((a, b) => a.type.rank - b.type.rank);\n return copy;\n }\n}\n/**\nThe empty set of marks.\n*/\nMark.none = [];\n\n/**\nError type raised by [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) when\ngiven an invalid replacement.\n*/\nclass ReplaceError extends Error {\n}\n/*\nReplaceError = function(this: any, message: string) {\n let err = Error.call(this, message)\n ;(err as any).__proto__ = ReplaceError.prototype\n return err\n} as any\n\nReplaceError.prototype = Object.create(Error.prototype)\nReplaceError.prototype.constructor = ReplaceError\nReplaceError.prototype.name = \"ReplaceError\"\n*/\n/**\nA slice represents a piece cut out of a larger document. It\nstores not only a fragment, but also the depth up to which nodes on\nboth side are ‘open’ (cut through).\n*/\nclass Slice {\n /**\n Create a slice. When specifying a non-zero open depth, you must\n make sure that there are nodes of at least that depth at the\n appropriate side of the fragment—i.e. if the fragment is an\n empty paragraph node, `openStart` and `openEnd` can't be greater\n than 1.\n \n It is not necessary for the content of open nodes to conform to\n the schema's content constraints, though it should be a valid\n start/end/middle for such a node, depending on which sides are\n open.\n */\n constructor(\n /**\n The slice's content.\n */\n content, \n /**\n The open depth at the start of the fragment.\n */\n openStart, \n /**\n The open depth at the end.\n */\n openEnd) {\n this.content = content;\n this.openStart = openStart;\n this.openEnd = openEnd;\n }\n /**\n The size this slice would add when inserted into a document.\n */\n get size() {\n return this.content.size - this.openStart - this.openEnd;\n }\n /**\n @internal\n */\n insertAt(pos, fragment) {\n let content = insertInto(this.content, pos + this.openStart, fragment);\n return content && new Slice(content, this.openStart, this.openEnd);\n }\n /**\n @internal\n */\n removeBetween(from, to) {\n return new Slice(removeRange(this.content, from + this.openStart, to + this.openStart), this.openStart, this.openEnd);\n }\n /**\n Tests whether this slice is equal to another slice.\n */\n eq(other) {\n return this.content.eq(other.content) && this.openStart == other.openStart && this.openEnd == other.openEnd;\n }\n /**\n @internal\n */\n toString() {\n return this.content + \"(\" + this.openStart + \",\" + this.openEnd + \")\";\n }\n /**\n Convert a slice to a JSON-serializable representation.\n */\n toJSON() {\n if (!this.content.size)\n return null;\n let json = { content: this.content.toJSON() };\n if (this.openStart > 0)\n json.openStart = this.openStart;\n if (this.openEnd > 0)\n json.openEnd = this.openEnd;\n return json;\n }\n /**\n Deserialize a slice from its JSON representation.\n */\n static fromJSON(schema, json) {\n if (!json)\n return Slice.empty;\n let openStart = json.openStart || 0, openEnd = json.openEnd || 0;\n if (typeof openStart != \"number\" || typeof openEnd != \"number\")\n throw new RangeError(\"Invalid input for Slice.fromJSON\");\n return new Slice(Fragment.fromJSON(schema, json.content), openStart, openEnd);\n }\n /**\n Create a slice from a fragment by taking the maximum possible\n open value on both side of the fragment.\n */\n static maxOpen(fragment, openIsolating = true) {\n let openStart = 0, openEnd = 0;\n for (let n = fragment.firstChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.firstChild)\n openStart++;\n for (let n = fragment.lastChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.lastChild)\n openEnd++;\n return new Slice(fragment, openStart, openEnd);\n }\n}\n/**\nThe empty slice.\n*/\nSlice.empty = new Slice(Fragment.empty, 0, 0);\nfunction removeRange(content, from, to) {\n let { index, offset } = content.findIndex(from), child = content.maybeChild(index);\n let { index: indexTo, offset: offsetTo } = content.findIndex(to);\n if (offset == from || child.isText) {\n if (offsetTo != to && !content.child(indexTo).isText)\n throw new RangeError(\"Removing non-flat range\");\n return content.cut(0, from).append(content.cut(to));\n }\n if (index != indexTo)\n throw new RangeError(\"Removing non-flat range\");\n return content.replaceChild(index, child.copy(removeRange(child.content, from - offset - 1, to - offset - 1)));\n}\nfunction insertInto(content, dist, insert, parent) {\n let { index, offset } = content.findIndex(dist), child = content.maybeChild(index);\n if (offset == dist || child.isText) {\n if (parent && !parent.canReplace(index, index, insert))\n return null;\n return content.cut(0, dist).append(insert).append(content.cut(dist));\n }\n let inner = insertInto(child.content, dist - offset - 1, insert);\n return inner && content.replaceChild(index, child.copy(inner));\n}\nfunction replace($from, $to, slice) {\n if (slice.openStart > $from.depth)\n throw new ReplaceError(\"Inserted content deeper than insertion position\");\n if ($from.depth - slice.openStart != $to.depth - slice.openEnd)\n throw new ReplaceError(\"Inconsistent open depths\");\n return replaceOuter($from, $to, slice, 0);\n}\nfunction replaceOuter($from, $to, slice, depth) {\n let index = $from.index(depth), node = $from.node(depth);\n if (index == $to.index(depth) && depth < $from.depth - slice.openStart) {\n let inner = replaceOuter($from, $to, slice, depth + 1);\n return node.copy(node.content.replaceChild(index, inner));\n }\n else if (!slice.content.size) {\n return close(node, replaceTwoWay($from, $to, depth));\n }\n else if (!slice.openStart && !slice.openEnd && $from.depth == depth && $to.depth == depth) { // Simple, flat case\n let parent = $from.parent, content = parent.content;\n return close(parent, content.cut(0, $from.parentOffset).append(slice.content).append(content.cut($to.parentOffset)));\n }\n else {\n let { start, end } = prepareSliceForReplace(slice, $from);\n return close(node, replaceThreeWay($from, start, end, $to, depth));\n }\n}\nfunction checkJoin(main, sub) {\n if (!sub.type.compatibleContent(main.type))\n throw new ReplaceError(\"Cannot join \" + sub.type.name + \" onto \" + main.type.name);\n}\nfunction joinable($before, $after, depth) {\n let node = $before.node(depth);\n checkJoin(node, $after.node(depth));\n return node;\n}\nfunction addNode(child, target) {\n let last = target.length - 1;\n if (last >= 0 && child.isText && child.sameMarkup(target[last]))\n target[last] = child.withText(target[last].text + child.text);\n else\n target.push(child);\n}\nfunction addRange($start, $end, depth, target) {\n let node = ($end || $start).node(depth);\n let startIndex = 0, endIndex = $end ? $end.index(depth) : node.childCount;\n if ($start) {\n startIndex = $start.index(depth);\n if ($start.depth > depth) {\n startIndex++;\n }\n else if ($start.textOffset) {\n addNode($start.nodeAfter, target);\n startIndex++;\n }\n }\n for (let i = startIndex; i < endIndex; i++)\n addNode(node.child(i), target);\n if ($end && $end.depth == depth && $end.textOffset)\n addNode($end.nodeBefore, target);\n}\nfunction close(node, content) {\n node.type.checkContent(content);\n return node.copy(content);\n}\nfunction replaceThreeWay($from, $start, $end, $to, depth) {\n let openStart = $from.depth > depth && joinable($from, $start, depth + 1);\n let openEnd = $to.depth > depth && joinable($end, $to, depth + 1);\n let content = [];\n addRange(null, $from, depth, content);\n if (openStart && openEnd && $start.index(depth) == $end.index(depth)) {\n checkJoin(openStart, openEnd);\n addNode(close(openStart, replaceThreeWay($from, $start, $end, $to, depth + 1)), content);\n }\n else {\n if (openStart)\n addNode(close(openStart, replaceTwoWay($from, $start, depth + 1)), content);\n addRange($start, $end, depth, content);\n if (openEnd)\n addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);\n }\n addRange($to, null, depth, content);\n return new Fragment(content);\n}\nfunction replaceTwoWay($from, $to, depth) {\n let content = [];\n addRange(null, $from, depth, content);\n if ($from.depth > depth) {\n let type = joinable($from, $to, depth + 1);\n addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);\n }\n addRange($to, null, depth, content);\n return new Fragment(content);\n}\nfunction prepareSliceForReplace(slice, $along) {\n let extra = $along.depth - slice.openStart, parent = $along.node(extra);\n let node = parent.copy(slice.content);\n for (let i = extra - 1; i >= 0; i--)\n node = $along.node(i).copy(Fragment.from(node));\n return { start: node.resolveNoCache(slice.openStart + extra),\n end: node.resolveNoCache(node.content.size - slice.openEnd - extra) };\n}\n\n/**\nYou can [_resolve_](https://prosemirror.net/docs/ref/#model.Node.resolve) a position to get more\ninformation about it. Objects of this class represent such a\nresolved position, providing various pieces of context\ninformation, and some helper methods.\n\nThroughout this interface, methods that take an optional `depth`\nparameter will interpret undefined as `this.depth` and negative\nnumbers as `this.depth + value`.\n*/\nclass ResolvedPos {\n /**\n @internal\n */\n constructor(\n /**\n The position that was resolved.\n */\n pos, \n /**\n @internal\n */\n path, \n /**\n The offset this position has into its parent node.\n */\n parentOffset) {\n this.pos = pos;\n this.path = path;\n this.parentOffset = parentOffset;\n this.depth = path.length / 3 - 1;\n }\n /**\n @internal\n */\n resolveDepth(val) {\n if (val == null)\n return this.depth;\n if (val < 0)\n return this.depth + val;\n return val;\n }\n /**\n The parent node that the position points into. Note that even if\n a position points into a text node, that node is not considered\n the parent—text nodes are ‘flat’ in this model, and have no content.\n */\n get parent() { return this.node(this.depth); }\n /**\n The root node in which the position was resolved.\n */\n get doc() { return this.node(0); }\n /**\n The ancestor node at the given level. `p.node(p.depth)` is the\n same as `p.parent`.\n */\n node(depth) { return this.path[this.resolveDepth(depth) * 3]; }\n /**\n The index into the ancestor at the given level. If this points\n at the 3rd node in the 2nd paragraph on the top level, for\n example, `p.index(0)` is 1 and `p.index(1)` is 2.\n */\n index(depth) { return this.path[this.resolveDepth(depth) * 3 + 1]; }\n /**\n The index pointing after this position into the ancestor at the\n given level.\n */\n indexAfter(depth) {\n depth = this.resolveDepth(depth);\n return this.index(depth) + (depth == this.depth && !this.textOffset ? 0 : 1);\n }\n /**\n The (absolute) position at the start of the node at the given\n level.\n */\n start(depth) {\n depth = this.resolveDepth(depth);\n return depth == 0 ? 0 : this.path[depth * 3 - 1] + 1;\n }\n /**\n The (absolute) position at the end of the node at the given\n level.\n */\n end(depth) {\n depth = this.resolveDepth(depth);\n return this.start(depth) + this.node(depth).content.size;\n }\n /**\n The (absolute) position directly before the wrapping node at the\n given level, or, when `depth` is `this.depth + 1`, the original\n position.\n */\n before(depth) {\n depth = this.resolveDepth(depth);\n if (!depth)\n throw new RangeError(\"There is no position before the top-level node\");\n return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1];\n }\n /**\n The (absolute) position directly after the wrapping node at the\n given level, or the original position when `depth` is `this.depth + 1`.\n */\n after(depth) {\n depth = this.resolveDepth(depth);\n if (!depth)\n throw new RangeError(\"There is no position after the top-level node\");\n return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1] + this.path[depth * 3].nodeSize;\n }\n /**\n When this position points into a text node, this returns the\n distance between the position and the start of the text node.\n Will be zero for positions that point between nodes.\n */\n get textOffset() { return this.pos - this.path[this.path.length - 1]; }\n /**\n Get the node directly after the position, if any. If the position\n points into a text node, only the part of that node after the\n position is returned.\n */\n get nodeAfter() {\n let parent = this.parent, index = this.index(this.depth);\n if (index == parent.childCount)\n return null;\n let dOff = this.pos - this.path[this.path.length - 1], child = parent.child(index);\n return dOff ? parent.child(index).cut(dOff) : child;\n }\n /**\n Get the node directly before the position, if any. If the\n position points into a text node, only the part of that node\n before the position is returned.\n */\n get nodeBefore() {\n let index = this.index(this.depth);\n let dOff = this.pos - this.path[this.path.length - 1];\n if (dOff)\n return this.parent.child(index).cut(0, dOff);\n return index == 0 ? null : this.parent.child(index - 1);\n }\n /**\n Get the position at the given index in the parent node at the\n given depth (which defaults to `this.depth`).\n */\n posAtIndex(index, depth) {\n depth = this.resolveDepth(depth);\n let node = this.path[depth * 3], pos = depth == 0 ? 0 : this.path[depth * 3 - 1] + 1;\n for (let i = 0; i < index; i++)\n pos += node.child(i).nodeSize;\n return pos;\n }\n /**\n Get the marks at this position, factoring in the surrounding\n marks' [`inclusive`](https://prosemirror.net/docs/ref/#model.MarkSpec.inclusive) property. If the\n position is at the start of a non-empty node, the marks of the\n node after it (if any) are returned.\n */\n marks() {\n let parent = this.parent, index = this.index();\n // In an empty parent, return the empty array\n if (parent.content.size == 0)\n return Mark.none;\n // When inside a text node, just return the text node's marks\n if (this.textOffset)\n return parent.child(index).marks;\n let main = parent.maybeChild(index - 1), other = parent.maybeChild(index);\n // If the `after` flag is true of there is no node before, make\n // the node after this position the main reference.\n if (!main) {\n let tmp = main;\n main = other;\n other = tmp;\n }\n // Use all marks in the main node, except those that have\n // `inclusive` set to false and are not present in the other node.\n let marks = main.marks;\n for (var i = 0; i < marks.length; i++)\n if (marks[i].type.spec.inclusive === false && (!other || !marks[i].isInSet(other.marks)))\n marks = marks[i--].removeFromSet(marks);\n return marks;\n }\n /**\n Get the marks after the current position, if any, except those\n that are non-inclusive and not present at position `$end`. This\n is mostly useful for getting the set of marks to preserve after a\n deletion. Will return `null` if this position is at the end of\n its parent node or its parent node isn't a textblock (in which\n case no marks should be preserved).\n */\n marksAcross($end) {\n let after = this.parent.maybeChild(this.index());\n if (!after || !after.isInline)\n return null;\n let marks = after.marks, next = $end.parent.maybeChild($end.index());\n for (var i = 0; i < marks.length; i++)\n if (marks[i].type.spec.inclusive === false && (!next || !marks[i].isInSet(next.marks)))\n marks = marks[i--].removeFromSet(marks);\n return marks;\n }\n /**\n The depth up to which this position and the given (non-resolved)\n position share the same parent nodes.\n */\n sharedDepth(pos) {\n for (let depth = this.depth; depth > 0; depth--)\n if (this.start(depth) <= pos && this.end(depth) >= pos)\n return depth;\n return 0;\n }\n /**\n Returns a range based on the place where this position and the\n given position diverge around block content. If both point into\n the same textblock, for example, a range around that textblock\n will be returned. If they point into different blocks, the range\n around those blocks in their shared ancestor is returned. You can\n pass in an optional predicate that will be called with a parent\n node to see if a range into that parent is acceptable.\n */\n blockRange(other = this, pred) {\n if (other.pos < this.pos)\n return other.blockRange(this);\n for (let d = this.depth - (this.parent.inlineContent || this.pos == other.pos ? 1 : 0); d >= 0; d--)\n if (other.pos <= this.end(d) && (!pred || pred(this.node(d))))\n return new NodeRange(this, other, d);\n return null;\n }\n /**\n Query whether the given position shares the same parent node.\n */\n sameParent(other) {\n return this.pos - this.parentOffset == other.pos - other.parentOffset;\n }\n /**\n Return the greater of this and the given position.\n */\n max(other) {\n return other.pos > this.pos ? other : this;\n }\n /**\n Return the smaller of this and the given position.\n */\n min(other) {\n return other.pos < this.pos ? other : this;\n }\n /**\n @internal\n */\n toString() {\n let str = \"\";\n for (let i = 1; i <= this.depth; i++)\n str += (str ? \"/\" : \"\") + this.node(i).type.name + \"_\" + this.index(i - 1);\n return str + \":\" + this.parentOffset;\n }\n /**\n @internal\n */\n static resolve(doc, pos) {\n if (!(pos >= 0 && pos <= doc.content.size))\n throw new RangeError(\"Position \" + pos + \" out of range\");\n let path = [];\n let start = 0, parentOffset = pos;\n for (let node = doc;;) {\n let { index, offset } = node.content.findIndex(parentOffset);\n let rem = parentOffset - offset;\n path.push(node, index, start + offset);\n if (!rem)\n break;\n node = node.child(index);\n if (node.isText)\n break;\n parentOffset = rem - 1;\n start += offset + 1;\n }\n return new ResolvedPos(pos, path, parentOffset);\n }\n /**\n @internal\n */\n static resolveCached(doc, pos) {\n let cache = resolveCache.get(doc);\n if (cache) {\n for (let i = 0; i < cache.elts.length; i++) {\n let elt = cache.elts[i];\n if (elt.pos == pos)\n return elt;\n }\n }\n else {\n resolveCache.set(doc, cache = new ResolveCache);\n }\n let result = cache.elts[cache.i] = ResolvedPos.resolve(doc, pos);\n cache.i = (cache.i + 1) % resolveCacheSize;\n return result;\n }\n}\nclass ResolveCache {\n constructor() {\n this.elts = [];\n this.i = 0;\n }\n}\nconst resolveCacheSize = 12, resolveCache = new WeakMap();\n/**\nRepresents a flat range of content, i.e. one that starts and\nends in the same node.\n*/\nclass NodeRange {\n /**\n Construct a node range. `$from` and `$to` should point into the\n same node until at least the given `depth`, since a node range\n denotes an adjacent set of nodes in a single parent node.\n */\n constructor(\n /**\n A resolved position along the start of the content. May have a\n `depth` greater than this object's `depth` property, since\n these are the positions that were used to compute the range,\n not re-resolved positions directly at its boundaries.\n */\n $from, \n /**\n A position along the end of the content. See\n caveat for [`$from`](https://prosemirror.net/docs/ref/#model.NodeRange.$from).\n */\n $to, \n /**\n The depth of the node that this range points into.\n */\n depth) {\n this.$from = $from;\n this.$to = $to;\n this.depth = depth;\n }\n /**\n The position at the start of the range.\n */\n get start() { return this.$from.before(this.depth + 1); }\n /**\n The position at the end of the range.\n */\n get end() { return this.$to.after(this.depth + 1); }\n /**\n The parent node that the range points into.\n */\n get parent() { return this.$from.node(this.depth); }\n /**\n The start index of the range in the parent node.\n */\n get startIndex() { return this.$from.index(this.depth); }\n /**\n The end index of the range in the parent node.\n */\n get endIndex() { return this.$to.indexAfter(this.depth); }\n}\n\nconst emptyAttrs = Object.create(null);\n/**\nThis class represents a node in the tree that makes up a\nProseMirror document. So a document is an instance of `Node`, with\nchildren that are also instances of `Node`.\n\nNodes are persistent data structures. Instead of changing them, you\ncreate new ones with the content you want. Old ones keep pointing\nat the old document shape. This is made cheaper by sharing\nstructure between the old and new data as much as possible, which a\ntree shape like this (without back pointers) makes easy.\n\n**Do not** directly mutate the properties of a `Node` object. See\n[the guide](/docs/guide/#doc) for more information.\n*/\nclass Node {\n /**\n @internal\n */\n constructor(\n /**\n The type of node that this is.\n */\n type, \n /**\n An object mapping attribute names to values. The kind of\n attributes allowed and required are\n [determined](https://prosemirror.net/docs/ref/#model.NodeSpec.attrs) by the node type.\n */\n attrs, \n // A fragment holding the node's children.\n content, \n /**\n The marks (things like whether it is emphasized or part of a\n link) applied to this node.\n */\n marks = Mark.none) {\n this.type = type;\n this.attrs = attrs;\n this.marks = marks;\n this.content = content || Fragment.empty;\n }\n /**\n The array of this node's child nodes.\n */\n get children() { return this.content.content; }\n /**\n The size of this node, as defined by the integer-based [indexing\n scheme](/docs/guide/#doc.indexing). For text nodes, this is the\n amount of characters. For other leaf nodes, it is one. For\n non-leaf nodes, it is the size of the content plus two (the\n start and end token).\n */\n get nodeSize() { return this.isLeaf ? 1 : 2 + this.content.size; }\n /**\n The number of children that the node has.\n */\n get childCount() { return this.content.childCount; }\n /**\n Get the child node at the given index. Raises an error when the\n index is out of range.\n */\n child(index) { return this.content.child(index); }\n /**\n Get the child node at the given index, if it exists.\n */\n maybeChild(index) { return this.content.maybeChild(index); }\n /**\n Call `f` for every child node, passing the node, its offset\n into this parent node, and its index.\n */\n forEach(f) { this.content.forEach(f); }\n /**\n Invoke a callback for all descendant nodes recursively between\n the given two positions that are relative to start of this\n node's content. The callback is invoked with the node, its\n position relative to the original node (method receiver),\n its parent node, and its child index. When the callback returns\n false for a given node, that node's children will not be\n recursed over. The last parameter can be used to specify a\n starting position to count from.\n */\n nodesBetween(from, to, f, startPos = 0) {\n this.content.nodesBetween(from, to, f, startPos, this);\n }\n /**\n Call the given callback for every descendant node. Doesn't\n descend into a node when the callback returns `false`.\n */\n descendants(f) {\n this.nodesBetween(0, this.content.size, f);\n }\n /**\n Concatenates all the text nodes found in this fragment and its\n children.\n */\n get textContent() {\n return (this.isLeaf && this.type.spec.leafText)\n ? this.type.spec.leafText(this)\n : this.textBetween(0, this.content.size, \"\");\n }\n /**\n Get all text between positions `from` and `to`. When\n `blockSeparator` is given, it will be inserted to separate text\n from different block nodes. If `leafText` is given, it'll be\n inserted for every non-text leaf node encountered, otherwise\n [`leafText`](https://prosemirror.net/docs/ref/#model.NodeSpec^leafText) will be used.\n */\n textBetween(from, to, blockSeparator, leafText) {\n return this.content.textBetween(from, to, blockSeparator, leafText);\n }\n /**\n Returns this node's first child, or `null` if there are no\n children.\n */\n get firstChild() { return this.content.firstChild; }\n /**\n Returns this node's last child, or `null` if there are no\n children.\n */\n get lastChild() { return this.content.lastChild; }\n /**\n Test whether two nodes represent the same piece of document.\n */\n eq(other) {\n return this == other || (this.sameMarkup(other) && this.content.eq(other.content));\n }\n /**\n Compare the markup (type, attributes, and marks) of this node to\n those of another. Returns `true` if both have the same markup.\n */\n sameMarkup(other) {\n return this.hasMarkup(other.type, other.attrs, other.marks);\n }\n /**\n Check whether this node's markup correspond to the given type,\n attributes, and marks.\n */\n hasMarkup(type, attrs, marks) {\n return this.type == type &&\n compareDeep(this.attrs, attrs || type.defaultAttrs || emptyAttrs) &&\n Mark.sameSet(this.marks, marks || Mark.none);\n }\n /**\n Create a new node with the same markup as this node, containing\n the given content (or empty, if no content is given).\n */\n copy(content = null) {\n if (content == this.content)\n return this;\n return new Node(this.type, this.attrs, content, this.marks);\n }\n /**\n Create a copy of this node, with the given set of marks instead\n of the node's own marks.\n */\n mark(marks) {\n return marks == this.marks ? this : new Node(this.type, this.attrs, this.content, marks);\n }\n /**\n Create a copy of this node with only the content between the\n given positions. If `to` is not given, it defaults to the end of\n the node.\n */\n cut(from, to = this.content.size) {\n if (from == 0 && to == this.content.size)\n return this;\n return this.copy(this.content.cut(from, to));\n }\n /**\n Cut out the part of the document between the given positions, and\n return it as a `Slice` object.\n */\n slice(from, to = this.content.size, includeParents = false) {\n if (from == to)\n return Slice.empty;\n let $from = this.resolve(from), $to = this.resolve(to);\n let depth = includeParents ? 0 : $from.sharedDepth(to);\n let start = $from.start(depth), node = $from.node(depth);\n let content = node.content.cut($from.pos - start, $to.pos - start);\n return new Slice(content, $from.depth - depth, $to.depth - depth);\n }\n /**\n Replace the part of the document between the given positions with\n the given slice. The slice must 'fit', meaning its open sides\n must be able to connect to the surrounding content, and its\n content nodes must be valid children for the node they are placed\n into. If any of this is violated, an error of type\n [`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.\n */\n replace(from, to, slice) {\n return replace(this.resolve(from), this.resolve(to), slice);\n }\n /**\n Find the node directly after the given position.\n */\n nodeAt(pos) {\n for (let node = this;;) {\n let { index, offset } = node.content.findIndex(pos);\n node = node.maybeChild(index);\n if (!node)\n return null;\n if (offset == pos || node.isText)\n return node;\n pos -= offset + 1;\n }\n }\n /**\n Find the (direct) child node after the given offset, if any,\n and return it along with its index and offset relative to this\n node.\n */\n childAfter(pos) {\n let { index, offset } = this.content.findIndex(pos);\n return { node: this.content.maybeChild(index), index, offset };\n }\n /**\n Find the (direct) child node before the given offset, if any,\n and return it along with its index and offset relative to this\n node.\n */\n childBefore(pos) {\n if (pos == 0)\n return { node: null, index: 0, offset: 0 };\n let { index, offset } = this.content.findIndex(pos);\n if (offset < pos)\n return { node: this.content.child(index), index, offset };\n let node = this.content.child(index - 1);\n return { node, index: index - 1, offset: offset - node.nodeSize };\n }\n /**\n Resolve the given position in the document, returning an\n [object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.\n */\n resolve(pos) { return ResolvedPos.resolveCached(this, pos); }\n /**\n @internal\n */\n resolveNoCache(pos) { return ResolvedPos.resolve(this, pos); }\n /**\n Test whether a given mark or mark type occurs in this document\n between the two given positions.\n */\n rangeHasMark(from, to, type) {\n let found = false;\n if (to > from)\n this.nodesBetween(from, to, node => {\n if (type.isInSet(node.marks))\n found = true;\n return !found;\n });\n return found;\n }\n /**\n True when this is a block (non-inline node)\n */\n get isBlock() { return this.type.isBlock; }\n /**\n True when this is a textblock node, a block node with inline\n content.\n */\n get isTextblock() { return this.type.isTextblock; }\n /**\n True when this node allows inline content.\n */\n get inlineContent() { return this.type.inlineContent; }\n /**\n True when this is an inline node (a text node or a node that can\n appear among text).\n */\n get isInline() { return this.type.isInline; }\n /**\n True when this is a text node.\n */\n get isText() { return this.type.isText; }\n /**\n True when this is a leaf node.\n */\n get isLeaf() { return this.type.isLeaf; }\n /**\n True when this is an atom, i.e. when it does not have directly\n editable content. This is usually the same as `isLeaf`, but can\n be configured with the [`atom` property](https://prosemirror.net/docs/ref/#model.NodeSpec.atom)\n on a node's spec (typically used when the node is displayed as\n an uneditable [node view](https://prosemirror.net/docs/ref/#view.NodeView)).\n */\n get isAtom() { return this.type.isAtom; }\n /**\n Return a string representation of this node for debugging\n purposes.\n */\n toString() {\n if (this.type.spec.toDebugString)\n return this.type.spec.toDebugString(this);\n let name = this.type.name;\n if (this.content.size)\n name += \"(\" + this.content.toStringInner() + \")\";\n return wrapMarks(this.marks, name);\n }\n /**\n Get the content match in this node at the given index.\n */\n contentMatchAt(index) {\n let match = this.type.contentMatch.matchFragment(this.content, 0, index);\n if (!match)\n throw new Error(\"Called contentMatchAt on a node with invalid content\");\n return match;\n }\n /**\n Test whether replacing the range between `from` and `to` (by\n child index) with the given replacement fragment (which defaults\n to the empty fragment) would leave the node's content valid. You\n can optionally pass `start` and `end` indices into the\n replacement fragment.\n */\n canReplace(from, to, replacement = Fragment.empty, start = 0, end = replacement.childCount) {\n let one = this.contentMatchAt(from).matchFragment(replacement, start, end);\n let two = one && one.matchFragment(this.content, to);\n if (!two || !two.validEnd)\n return false;\n for (let i = start; i < end; i++)\n if (!this.type.allowsMarks(replacement.child(i).marks))\n return false;\n return true;\n }\n /**\n Test whether replacing the range `from` to `to` (by index) with\n a node of the given type would leave the node's content valid.\n */\n canReplaceWith(from, to, type, marks) {\n if (marks && !this.type.allowsMarks(marks))\n return false;\n let start = this.contentMatchAt(from).matchType(type);\n let end = start && start.matchFragment(this.content, to);\n return end ? end.validEnd : false;\n }\n /**\n Test whether the given node's content could be appended to this\n node. If that node is empty, this will only return true if there\n is at least one node type that can appear in both nodes (to avoid\n merging completely incompatible nodes).\n */\n canAppend(other) {\n if (other.content.size)\n return this.canReplace(this.childCount, this.childCount, other.content);\n else\n return this.type.compatibleContent(other.type);\n }\n /**\n Check whether this node and its descendants conform to the\n schema, and raise an exception when they do not.\n */\n check() {\n this.type.checkContent(this.content);\n this.type.checkAttrs(this.attrs);\n let copy = Mark.none;\n for (let i = 0; i < this.marks.length; i++) {\n let mark = this.marks[i];\n mark.type.checkAttrs(mark.attrs);\n copy = mark.addToSet(copy);\n }\n if (!Mark.sameSet(copy, this.marks))\n throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(m => m.type.name)}`);\n this.content.forEach(node => node.check());\n }\n /**\n Return a JSON-serializeable representation of this node.\n */\n toJSON() {\n let obj = { type: this.type.name };\n for (let _ in this.attrs) {\n obj.attrs = this.attrs;\n break;\n }\n if (this.content.size)\n obj.content = this.content.toJSON();\n if (this.marks.length)\n obj.marks = this.marks.map(n => n.toJSON());\n return obj;\n }\n /**\n Deserialize a node from its JSON representation.\n */\n static fromJSON(schema, json) {\n if (!json)\n throw new RangeError(\"Invalid input for Node.fromJSON\");\n let marks = undefined;\n if (json.marks) {\n if (!Array.isArray(json.marks))\n throw new RangeError(\"Invalid mark data for Node.fromJSON\");\n marks = json.marks.map(schema.markFromJSON);\n }\n if (json.type == \"text\") {\n if (typeof json.text != \"string\")\n throw new RangeError(\"Invalid text node in JSON\");\n return schema.text(json.text, marks);\n }\n let content = Fragment.fromJSON(schema, json.content);\n let node = schema.nodeType(json.type).create(json.attrs, content, marks);\n node.type.checkAttrs(node.attrs);\n return node;\n }\n}\nNode.prototype.text = undefined;\nclass TextNode extends Node {\n /**\n @internal\n */\n constructor(type, attrs, content, marks) {\n super(type, attrs, null, marks);\n if (!content)\n throw new RangeError(\"Empty text nodes are not allowed\");\n this.text = content;\n }\n toString() {\n if (this.type.spec.toDebugString)\n return this.type.spec.toDebugString(this);\n return wrapMarks(this.marks, JSON.stringify(this.text));\n }\n get textContent() { return this.text; }\n textBetween(from, to) { return this.text.slice(from, to); }\n get nodeSize() { return this.text.length; }\n mark(marks) {\n return marks == this.marks ? this : new TextNode(this.type, this.attrs, this.text, marks);\n }\n withText(text) {\n if (text == this.text)\n return this;\n return new TextNode(this.type, this.attrs, text, this.marks);\n }\n cut(from = 0, to = this.text.length) {\n if (from == 0 && to == this.text.length)\n return this;\n return this.withText(this.text.slice(from, to));\n }\n eq(other) {\n return this.sameMarkup(other) && this.text == other.text;\n }\n toJSON() {\n let base = super.toJSON();\n base.text = this.text;\n return base;\n }\n}\nfunction wrapMarks(marks, str) {\n for (let i = marks.length - 1; i >= 0; i--)\n str = marks[i].type.name + \"(\" + str + \")\";\n return str;\n}\n\n/**\nInstances of this class represent a match state of a node type's\n[content expression](https://prosemirror.net/docs/ref/#model.NodeSpec.content), and can be used to\nfind out whether further content matches here, and whether a given\nposition is a valid end of the node.\n*/\nclass ContentMatch {\n /**\n @internal\n */\n constructor(\n /**\n True when this match state represents a valid end of the node.\n */\n validEnd) {\n this.validEnd = validEnd;\n /**\n @internal\n */\n this.next = [];\n /**\n @internal\n */\n this.wrapCache = [];\n }\n /**\n @internal\n */\n static parse(string, nodeTypes) {\n let stream = new TokenStream(string, nodeTypes);\n if (stream.next == null)\n return ContentMatch.empty;\n let expr = parseExpr(stream);\n if (stream.next)\n stream.err(\"Unexpected trailing text\");\n let match = dfa(nfa(expr));\n checkForDeadEnds(match, stream);\n return match;\n }\n /**\n Match a node type, returning a match after that node if\n successful.\n */\n matchType(type) {\n for (let i = 0; i < this.next.length; i++)\n if (this.next[i].type == type)\n return this.next[i].next;\n return null;\n }\n /**\n Try to match a fragment. Returns the resulting match when\n successful.\n */\n matchFragment(frag, start = 0, end = frag.childCount) {\n let cur = this;\n for (let i = start; cur && i < end; i++)\n cur = cur.matchType(frag.child(i).type);\n return cur;\n }\n /**\n @internal\n */\n get inlineContent() {\n return this.next.length != 0 && this.next[0].type.isInline;\n }\n /**\n Get the first matching node type at this match position that can\n be generated.\n */\n get defaultType() {\n for (let i = 0; i < this.next.length; i++) {\n let { type } = this.next[i];\n if (!(type.isText || type.hasRequiredAttrs()))\n return type;\n }\n return null;\n }\n /**\n @internal\n */\n compatible(other) {\n for (let i = 0; i < this.next.length; i++)\n for (let j = 0; j < other.next.length; j++)\n if (this.next[i].type == other.next[j].type)\n return true;\n return false;\n }\n /**\n Try to match the given fragment, and if that fails, see if it can\n be made to match by inserting nodes in front of it. When\n successful, return a fragment of inserted nodes (which may be\n empty if nothing had to be inserted). When `toEnd` is true, only\n return a fragment if the resulting match goes to the end of the\n content expression.\n */\n fillBefore(after, toEnd = false, startIndex = 0) {\n let seen = [this];\n function search(match, types) {\n let finished = match.matchFragment(after, startIndex);\n if (finished && (!toEnd || finished.validEnd))\n return Fragment.from(types.map(tp => tp.createAndFill()));\n for (let i = 0; i < match.next.length; i++) {\n let { type, next } = match.next[i];\n if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {\n seen.push(next);\n let found = search(next, types.concat(type));\n if (found)\n return found;\n }\n }\n return null;\n }\n return search(this, []);\n }\n /**\n Find a set of wrapping node types that would allow a node of the\n given type to appear at this position. The result may be empty\n (when it fits directly) and will be null when no such wrapping\n exists.\n */\n findWrapping(target) {\n for (let i = 0; i < this.wrapCache.length; i += 2)\n if (this.wrapCache[i] == target)\n return this.wrapCache[i + 1];\n let computed = this.computeWrapping(target);\n this.wrapCache.push(target, computed);\n return computed;\n }\n /**\n @internal\n */\n computeWrapping(target) {\n let seen = Object.create(null), active = [{ match: this, type: null, via: null }];\n while (active.length) {\n let current = active.shift(), match = current.match;\n if (match.matchType(target)) {\n let result = [];\n for (let obj = current; obj.type; obj = obj.via)\n result.push(obj.type);\n return result.reverse();\n }\n for (let i = 0; i < match.next.length; i++) {\n let { type, next } = match.next[i];\n if (!type.isLeaf && !type.hasRequiredAttrs() && !(type.name in seen) && (!current.type || next.validEnd)) {\n active.push({ match: type.contentMatch, type, via: current });\n seen[type.name] = true;\n }\n }\n }\n return null;\n }\n /**\n The number of outgoing edges this node has in the finite\n automaton that describes the content expression.\n */\n get edgeCount() {\n return this.next.length;\n }\n /**\n Get the _n_​th outgoing edge from this node in the finite\n automaton that describes the content expression.\n */\n edge(n) {\n if (n >= this.next.length)\n throw new RangeError(`There's no ${n}th edge in this content match`);\n return this.next[n];\n }\n /**\n @internal\n */\n toString() {\n let seen = [];\n function scan(m) {\n seen.push(m);\n for (let i = 0; i < m.next.length; i++)\n if (seen.indexOf(m.next[i].next) == -1)\n scan(m.next[i].next);\n }\n scan(this);\n return seen.map((m, i) => {\n let out = i + (m.validEnd ? \"*\" : \" \") + \" \";\n for (let i = 0; i < m.next.length; i++)\n out += (i ? \", \" : \"\") + m.next[i].type.name + \"->\" + seen.indexOf(m.next[i].next);\n return out;\n }).join(\"\\n\");\n }\n}\n/**\n@internal\n*/\nContentMatch.empty = new ContentMatch(true);\nclass TokenStream {\n constructor(string, nodeTypes) {\n this.string = string;\n this.nodeTypes = nodeTypes;\n this.inline = null;\n this.pos = 0;\n this.tokens = string.split(/\\s*(?=\\b|\\W|$)/);\n if (this.tokens[this.tokens.length - 1] == \"\")\n this.tokens.pop();\n if (this.tokens[0] == \"\")\n this.tokens.shift();\n }\n get next() { return this.tokens[this.pos]; }\n eat(tok) { return this.next == tok && (this.pos++ || true); }\n err(str) { throw new SyntaxError(str + \" (in content expression '\" + this.string + \"')\"); }\n}\nfunction parseExpr(stream) {\n let exprs = [];\n do {\n exprs.push(parseExprSeq(stream));\n } while (stream.eat(\"|\"));\n return exprs.length == 1 ? exprs[0] : { type: \"choice\", exprs };\n}\nfunction parseExprSeq(stream) {\n let exprs = [];\n do {\n exprs.push(parseExprSubscript(stream));\n } while (stream.next && stream.next != \")\" && stream.next != \"|\");\n return exprs.length == 1 ? exprs[0] : { type: \"seq\", exprs };\n}\nfunction parseExprSubscript(stream) {\n let expr = parseExprAtom(stream);\n for (;;) {\n if (stream.eat(\"+\"))\n expr = { type: \"plus\", expr };\n else if (stream.eat(\"*\"))\n expr = { type: \"star\", expr };\n else if (stream.eat(\"?\"))\n expr = { type: \"opt\", expr };\n else if (stream.eat(\"{\"))\n expr = parseExprRange(stream, expr);\n else\n break;\n }\n return expr;\n}\nfunction parseNum(stream) {\n if (/\\D/.test(stream.next))\n stream.err(\"Expected number, got '\" + stream.next + \"'\");\n let result = Number(stream.next);\n stream.pos++;\n return result;\n}\nfunction parseExprRange(stream, expr) {\n let min = parseNum(stream), max = min;\n if (stream.eat(\",\")) {\n if (stream.next != \"}\")\n max = parseNum(stream);\n else\n max = -1;\n }\n if (!stream.eat(\"}\"))\n stream.err(\"Unclosed braced range\");\n return { type: \"range\", min, max, expr };\n}\nfunction resolveName(stream, name) {\n let types = stream.nodeTypes, type = types[name];\n if (type)\n return [type];\n let result = [];\n for (let typeName in types) {\n let type = types[typeName];\n if (type.isInGroup(name))\n result.push(type);\n }\n if (result.length == 0)\n stream.err(\"No node type or group '\" + name + \"' found\");\n return result;\n}\nfunction parseExprAtom(stream) {\n if (stream.eat(\"(\")) {\n let expr = parseExpr(stream);\n if (!stream.eat(\")\"))\n stream.err(\"Missing closing paren\");\n return expr;\n }\n else if (!/\\W/.test(stream.next)) {\n let exprs = resolveName(stream, stream.next).map(type => {\n if (stream.inline == null)\n stream.inline = type.isInline;\n else if (stream.inline != type.isInline)\n stream.err(\"Mixing inline and block content\");\n return { type: \"name\", value: type };\n });\n stream.pos++;\n return exprs.length == 1 ? exprs[0] : { type: \"choice\", exprs };\n }\n else {\n stream.err(\"Unexpected token '\" + stream.next + \"'\");\n }\n}\n// Construct an NFA from an expression as returned by the parser. The\n// NFA is represented as an array of states, which are themselves\n// arrays of edges, which are `{term, to}` objects. The first state is\n// the entry state and the last node is the success state.\n//\n// Note that unlike typical NFAs, the edge ordering in this one is\n// significant, in that it is used to contruct filler content when\n// necessary.\nfunction nfa(expr) {\n let nfa = [[]];\n connect(compile(expr, 0), node());\n return nfa;\n function node() { return nfa.push([]) - 1; }\n function edge(from, to, term) {\n let edge = { term, to };\n nfa[from].push(edge);\n return edge;\n }\n function connect(edges, to) {\n edges.forEach(edge => edge.to = to);\n }\n function compile(expr, from) {\n if (expr.type == \"choice\") {\n return expr.exprs.reduce((out, expr) => out.concat(compile(expr, from)), []);\n }\n else if (expr.type == \"seq\") {\n for (let i = 0;; i++) {\n let next = compile(expr.exprs[i], from);\n if (i == expr.exprs.length - 1)\n return next;\n connect(next, from = node());\n }\n }\n else if (expr.type == \"star\") {\n let loop = node();\n edge(from, loop);\n connect(compile(expr.expr, loop), loop);\n return [edge(loop)];\n }\n else if (expr.type == \"plus\") {\n let loop = node();\n connect(compile(expr.expr, from), loop);\n connect(compile(expr.expr, loop), loop);\n return [edge(loop)];\n }\n else if (expr.type == \"opt\") {\n return [edge(from)].concat(compile(expr.expr, from));\n }\n else if (expr.type == \"range\") {\n let cur = from;\n for (let i = 0; i < expr.min; i++) {\n let next = node();\n connect(compile(expr.expr, cur), next);\n cur = next;\n }\n if (expr.max == -1) {\n connect(compile(expr.expr, cur), cur);\n }\n else {\n for (let i = expr.min; i < expr.max; i++) {\n let next = node();\n edge(cur, next);\n connect(compile(expr.expr, cur), next);\n cur = next;\n }\n }\n return [edge(cur)];\n }\n else if (expr.type == \"name\") {\n return [edge(from, undefined, expr.value)];\n }\n else {\n throw new Error(\"Unknown expr type\");\n }\n }\n}\nfunction cmp(a, b) { return b - a; }\n// Get the set of nodes reachable by null edges from `node`. Omit\n// nodes with only a single null-out-edge, since they may lead to\n// needless duplicated nodes.\nfunction nullFrom(nfa, node) {\n let result = [];\n scan(node);\n return result.sort(cmp);\n function scan(node) {\n let edges = nfa[node];\n if (edges.length == 1 && !edges[0].term)\n return scan(edges[0].to);\n result.push(node);\n for (let i = 0; i < edges.length; i++) {\n let { term, to } = edges[i];\n if (!term && result.indexOf(to) == -1)\n scan(to);\n }\n }\n}\n// Compiles an NFA as produced by `nfa` into a DFA, modeled as a set\n// of state objects (`ContentMatch` instances) with transitions\n// between them.\nfunction dfa(nfa) {\n let labeled = Object.create(null);\n return explore(nullFrom(nfa, 0));\n function explore(states) {\n let out = [];\n states.forEach(node => {\n nfa[node].forEach(({ term, to }) => {\n if (!term)\n return;\n let set;\n for (let i = 0; i < out.length; i++)\n if (out[i][0] == term)\n set = out[i][1];\n nullFrom(nfa, to).forEach(node => {\n if (!set)\n out.push([term, set = []]);\n if (set.indexOf(node) == -1)\n set.push(node);\n });\n });\n });\n let state = labeled[states.join(\",\")] = new ContentMatch(states.indexOf(nfa.length - 1) > -1);\n for (let i = 0; i < out.length; i++) {\n let states = out[i][1].sort(cmp);\n state.next.push({ type: out[i][0], next: labeled[states.join(\",\")] || explore(states) });\n }\n return state;\n }\n}\nfunction checkForDeadEnds(match, stream) {\n for (let i = 0, work = [match]; i < work.length; i++) {\n let state = work[i], dead = !state.validEnd, nodes = [];\n for (let j = 0; j < state.next.length; j++) {\n let { type, next } = state.next[j];\n nodes.push(type.name);\n if (dead && !(type.isText || type.hasRequiredAttrs()))\n dead = false;\n if (work.indexOf(next) == -1)\n work.push(next);\n }\n if (dead)\n stream.err(\"Only non-generatable nodes (\" + nodes.join(\", \") + \") in a required position (see https://prosemirror.net/docs/guide/#generatable)\");\n }\n}\n\n// For node types where all attrs have a default value (or which don't\n// have any attributes), build up a single reusable default attribute\n// object, and use it for all nodes that don't specify specific\n// attributes.\nfunction defaultAttrs(attrs) {\n let defaults = Object.create(null);\n for (let attrName in attrs) {\n let attr = attrs[attrName];\n if (!attr.hasDefault)\n return null;\n defaults[attrName] = attr.default;\n }\n return defaults;\n}\nfunction computeAttrs(attrs, value) {\n let built = Object.create(null);\n for (let name in attrs) {\n let given = value && value[name];\n if (given === undefined) {\n let attr = attrs[name];\n if (attr.hasDefault)\n given = attr.default;\n else\n throw new RangeError(\"No value supplied for attribute \" + name);\n }\n built[name] = given;\n }\n return built;\n}\nfunction checkAttrs(attrs, values, type, name) {\n for (let name in values)\n if (!(name in attrs))\n throw new RangeError(`Unsupported attribute ${name} for ${type} of type ${name}`);\n for (let name in attrs) {\n let attr = attrs[name];\n if (attr.validate)\n attr.validate(values[name]);\n }\n}\nfunction initAttrs(typeName, attrs) {\n let result = Object.create(null);\n if (attrs)\n for (let name in attrs)\n result[name] = new Attribute(typeName, name, attrs[name]);\n return result;\n}\n/**\nNode types are objects allocated once per `Schema` and used to\n[tag](https://prosemirror.net/docs/ref/#model.Node.type) `Node` instances. They contain information\nabout the node type, such as its name and what kind of node it\nrepresents.\n*/\nclass NodeType {\n /**\n @internal\n */\n constructor(\n /**\n The name the node type has in this schema.\n */\n name, \n /**\n A link back to the `Schema` the node type belongs to.\n */\n schema, \n /**\n The spec that this type is based on\n */\n spec) {\n this.name = name;\n this.schema = schema;\n this.spec = spec;\n /**\n The set of marks allowed in this node. `null` means all marks\n are allowed.\n */\n this.markSet = null;\n this.groups = spec.group ? spec.group.split(\" \") : [];\n this.attrs = initAttrs(name, spec.attrs);\n this.defaultAttrs = defaultAttrs(this.attrs);\n this.contentMatch = null;\n this.inlineContent = null;\n this.isBlock = !(spec.inline || name == \"text\");\n this.isText = name == \"text\";\n }\n /**\n True if this is an inline type.\n */\n get isInline() { return !this.isBlock; }\n /**\n True if this is a textblock type, a block that contains inline\n content.\n */\n get isTextblock() { return this.isBlock && this.inlineContent; }\n /**\n True for node types that allow no content.\n */\n get isLeaf() { return this.contentMatch == ContentMatch.empty; }\n /**\n True when this node is an atom, i.e. when it does not have\n directly editable content.\n */\n get isAtom() { return this.isLeaf || !!this.spec.atom; }\n /**\n Return true when this node type is part of the given\n [group](https://prosemirror.net/docs/ref/#model.NodeSpec.group).\n */\n isInGroup(group) {\n return this.groups.indexOf(group) > -1;\n }\n /**\n The node type's [whitespace](https://prosemirror.net/docs/ref/#model.NodeSpec.whitespace) option.\n */\n get whitespace() {\n return this.spec.whitespace || (this.spec.code ? \"pre\" : \"normal\");\n }\n /**\n Tells you whether this node type has any required attributes.\n */\n hasRequiredAttrs() {\n for (let n in this.attrs)\n if (this.attrs[n].isRequired)\n return true;\n return false;\n }\n /**\n Indicates whether this node allows some of the same content as\n the given node type.\n */\n compatibleContent(other) {\n return this == other || this.contentMatch.compatible(other.contentMatch);\n }\n /**\n @internal\n */\n computeAttrs(attrs) {\n if (!attrs && this.defaultAttrs)\n return this.defaultAttrs;\n else\n return computeAttrs(this.attrs, attrs);\n }\n /**\n Create a `Node` of this type. The given attributes are\n checked and defaulted (you can pass `null` to use the type's\n defaults entirely, if no required attributes exist). `content`\n may be a `Fragment`, a node, an array of nodes, or\n `null`. Similarly `marks` may be `null` to default to the empty\n set of marks.\n */\n create(attrs = null, content, marks) {\n if (this.isText)\n throw new Error(\"NodeType.create can't construct text nodes\");\n return new Node(this, this.computeAttrs(attrs), Fragment.from(content), Mark.setFrom(marks));\n }\n /**\n Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content\n against the node type's content restrictions, and throw an error\n if it doesn't match.\n */\n createChecked(attrs = null, content, marks) {\n content = Fragment.from(content);\n this.checkContent(content);\n return new Node(this, this.computeAttrs(attrs), content, Mark.setFrom(marks));\n }\n /**\n Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is\n necessary to add nodes to the start or end of the given fragment\n to make it fit the node. If no fitting wrapping can be found,\n return null. Note that, due to the fact that required nodes can\n always be created, this will always succeed if you pass null or\n `Fragment.empty` as content.\n */\n createAndFill(attrs = null, content, marks) {\n attrs = this.computeAttrs(attrs);\n content = Fragment.from(content);\n if (content.size) {\n let before = this.contentMatch.fillBefore(content);\n if (!before)\n return null;\n content = before.append(content);\n }\n let matched = this.contentMatch.matchFragment(content);\n let after = matched && matched.fillBefore(Fragment.empty, true);\n if (!after)\n return null;\n return new Node(this, attrs, content.append(after), Mark.setFrom(marks));\n }\n /**\n Returns true if the given fragment is valid content for this node\n type.\n */\n validContent(content) {\n let result = this.contentMatch.matchFragment(content);\n if (!result || !result.validEnd)\n return false;\n for (let i = 0; i < content.childCount; i++)\n if (!this.allowsMarks(content.child(i).marks))\n return false;\n return true;\n }\n /**\n Throws a RangeError if the given fragment is not valid content for this\n node type.\n @internal\n */\n checkContent(content) {\n if (!this.validContent(content))\n throw new RangeError(`Invalid content for node ${this.name}: ${content.toString().slice(0, 50)}`);\n }\n /**\n @internal\n */\n checkAttrs(attrs) {\n checkAttrs(this.attrs, attrs, \"node\", this.name);\n }\n /**\n Check whether the given mark type is allowed in this node.\n */\n allowsMarkType(markType) {\n return this.markSet == null || this.markSet.indexOf(markType) > -1;\n }\n /**\n Test whether the given set of marks are allowed in this node.\n */\n allowsMarks(marks) {\n if (this.markSet == null)\n return true;\n for (let i = 0; i < marks.length; i++)\n if (!this.allowsMarkType(marks[i].type))\n return false;\n return true;\n }\n /**\n Removes the marks that are not allowed in this node from the given set.\n */\n allowedMarks(marks) {\n if (this.markSet == null)\n return marks;\n let copy;\n for (let i = 0; i < marks.length; i++) {\n if (!this.allowsMarkType(marks[i].type)) {\n if (!copy)\n copy = marks.slice(0, i);\n }\n else if (copy) {\n copy.push(marks[i]);\n }\n }\n return !copy ? marks : copy.length ? copy : Mark.none;\n }\n /**\n @internal\n */\n static compile(nodes, schema) {\n let result = Object.create(null);\n nodes.forEach((name, spec) => result[name] = new NodeType(name, schema, spec));\n let topType = schema.spec.topNode || \"doc\";\n if (!result[topType])\n throw new RangeError(\"Schema is missing its top node type ('\" + topType + \"')\");\n if (!result.text)\n throw new RangeError(\"Every schema needs a 'text' type\");\n for (let _ in result.text.attrs)\n throw new RangeError(\"The text node type should not have attributes\");\n return result;\n }\n}\nfunction validateType(typeName, attrName, type) {\n let types = type.split(\"|\");\n return (value) => {\n let name = value === null ? \"null\" : typeof value;\n if (types.indexOf(name) < 0)\n throw new RangeError(`Expected value of type ${types} for attribute ${attrName} on type ${typeName}, got ${name}`);\n };\n}\n// Attribute descriptors\nclass Attribute {\n constructor(typeName, attrName, options) {\n this.hasDefault = Object.prototype.hasOwnProperty.call(options, \"default\");\n this.default = options.default;\n this.validate = typeof options.validate == \"string\" ? validateType(typeName, attrName, options.validate) : options.validate;\n }\n get isRequired() {\n return !this.hasDefault;\n }\n}\n// Marks\n/**\nLike nodes, marks (which are associated with nodes to signify\nthings like emphasis or being part of a link) are\n[tagged](https://prosemirror.net/docs/ref/#model.Mark.type) with type objects, which are\ninstantiated once per `Schema`.\n*/\nclass MarkType {\n /**\n @internal\n */\n constructor(\n /**\n The name of the mark type.\n */\n name, \n /**\n @internal\n */\n rank, \n /**\n The schema that this mark type instance is part of.\n */\n schema, \n /**\n The spec on which the type is based.\n */\n spec) {\n this.name = name;\n this.rank = rank;\n this.schema = schema;\n this.spec = spec;\n this.attrs = initAttrs(name, spec.attrs);\n this.excluded = null;\n let defaults = defaultAttrs(this.attrs);\n this.instance = defaults ? new Mark(this, defaults) : null;\n }\n /**\n Create a mark of this type. `attrs` may be `null` or an object\n containing only some of the mark's attributes. The others, if\n they have defaults, will be added.\n */\n create(attrs = null) {\n if (!attrs && this.instance)\n return this.instance;\n return new Mark(this, computeAttrs(this.attrs, attrs));\n }\n /**\n @internal\n */\n static compile(marks, schema) {\n let result = Object.create(null), rank = 0;\n marks.forEach((name, spec) => result[name] = new MarkType(name, rank++, schema, spec));\n return result;\n }\n /**\n When there is a mark of this type in the given set, a new set\n without it is returned. Otherwise, the input set is returned.\n */\n removeFromSet(set) {\n for (var i = 0; i < set.length; i++)\n if (set[i].type == this) {\n set = set.slice(0, i).concat(set.slice(i + 1));\n i--;\n }\n return set;\n }\n /**\n Tests whether there is a mark of this type in the given set.\n */\n isInSet(set) {\n for (let i = 0; i < set.length; i++)\n if (set[i].type == this)\n return set[i];\n }\n /**\n @internal\n */\n checkAttrs(attrs) {\n checkAttrs(this.attrs, attrs, \"mark\", this.name);\n }\n /**\n Queries whether a given mark type is\n [excluded](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) by this one.\n */\n excludes(other) {\n return this.excluded.indexOf(other) > -1;\n }\n}\n/**\nA document schema. Holds [node](https://prosemirror.net/docs/ref/#model.NodeType) and [mark\ntype](https://prosemirror.net/docs/ref/#model.MarkType) objects for the nodes and marks that may\noccur in conforming documents, and provides functionality for\ncreating and deserializing such documents.\n\nWhen given, the type parameters provide the names of the nodes and\nmarks in this schema.\n*/\nclass Schema {\n /**\n Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).\n */\n constructor(spec) {\n /**\n The [linebreak\n replacement](https://prosemirror.net/docs/ref/#model.NodeSpec.linebreakReplacement) node defined\n in this schema, if any.\n */\n this.linebreakReplacement = null;\n /**\n An object for storing whatever values modules may want to\n compute and cache per schema. (If you want to store something\n in it, try to use property names unlikely to clash.)\n */\n this.cached = Object.create(null);\n let instanceSpec = this.spec = {};\n for (let prop in spec)\n instanceSpec[prop] = spec[prop];\n instanceSpec.nodes = OrderedMap.from(spec.nodes),\n instanceSpec.marks = OrderedMap.from(spec.marks || {}),\n this.nodes = NodeType.compile(this.spec.nodes, this);\n this.marks = MarkType.compile(this.spec.marks, this);\n let contentExprCache = Object.create(null);\n for (let prop in this.nodes) {\n if (prop in this.marks)\n throw new RangeError(prop + \" can not be both a node and a mark\");\n let type = this.nodes[prop], contentExpr = type.spec.content || \"\", markExpr = type.spec.marks;\n type.contentMatch = contentExprCache[contentExpr] ||\n (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));\n type.inlineContent = type.contentMatch.inlineContent;\n if (type.spec.linebreakReplacement) {\n if (this.linebreakReplacement)\n throw new RangeError(\"Multiple linebreak nodes defined\");\n if (!type.isInline || !type.isLeaf)\n throw new RangeError(\"Linebreak replacement nodes must be inline leaf nodes\");\n this.linebreakReplacement = type;\n }\n type.markSet = markExpr == \"_\" ? null :\n markExpr ? gatherMarks(this, markExpr.split(\" \")) :\n markExpr == \"\" || !type.inlineContent ? [] : null;\n }\n for (let prop in this.marks) {\n let type = this.marks[prop], excl = type.spec.excludes;\n type.excluded = excl == null ? [type] : excl == \"\" ? [] : gatherMarks(this, excl.split(\" \"));\n }\n this.nodeFromJSON = this.nodeFromJSON.bind(this);\n this.markFromJSON = this.markFromJSON.bind(this);\n this.topNodeType = this.nodes[this.spec.topNode || \"doc\"];\n this.cached.wrappings = Object.create(null);\n }\n /**\n Create a node in this schema. The `type` may be a string or a\n `NodeType` instance. Attributes will be extended with defaults,\n `content` may be a `Fragment`, `null`, a `Node`, or an array of\n nodes.\n */\n node(type, attrs = null, content, marks) {\n if (typeof type == \"string\")\n type = this.nodeType(type);\n else if (!(type instanceof NodeType))\n throw new RangeError(\"Invalid node type: \" + type);\n else if (type.schema != this)\n throw new RangeError(\"Node type from different schema used (\" + type.name + \")\");\n return type.createChecked(attrs, content, marks);\n }\n /**\n Create a text node in the schema. Empty text nodes are not\n allowed.\n */\n text(text, marks) {\n let type = this.nodes.text;\n return new TextNode(type, type.defaultAttrs, text, Mark.setFrom(marks));\n }\n /**\n Create a mark with the given type and attributes.\n */\n mark(type, attrs) {\n if (typeof type == \"string\")\n type = this.marks[type];\n return type.create(attrs);\n }\n /**\n Deserialize a node from its JSON representation. This method is\n bound.\n */\n nodeFromJSON(json) {\n return Node.fromJSON(this, json);\n }\n /**\n Deserialize a mark from its JSON representation. This method is\n bound.\n */\n markFromJSON(json) {\n return Mark.fromJSON(this, json);\n }\n /**\n @internal\n */\n nodeType(name) {\n let found = this.nodes[name];\n if (!found)\n throw new RangeError(\"Unknown node type: \" + name);\n return found;\n }\n}\nfunction gatherMarks(schema, marks) {\n let found = [];\n for (let i = 0; i < marks.length; i++) {\n let name = marks[i], mark = schema.marks[name], ok = mark;\n if (mark) {\n found.push(mark);\n }\n else {\n for (let prop in schema.marks) {\n let mark = schema.marks[prop];\n if (name == \"_\" || (mark.spec.group && mark.spec.group.split(\" \").indexOf(name) > -1))\n found.push(ok = mark);\n }\n }\n if (!ok)\n throw new SyntaxError(\"Unknown mark type: '\" + marks[i] + \"'\");\n }\n return found;\n}\n\nfunction isTagRule(rule) { return rule.tag != null; }\nfunction isStyleRule(rule) { return rule.style != null; }\n/**\nA DOM parser represents a strategy for parsing DOM content into a\nProseMirror document conforming to a given schema. Its behavior is\ndefined by an array of [rules](https://prosemirror.net/docs/ref/#model.ParseRule).\n*/\nclass DOMParser {\n /**\n Create a parser that targets the given schema, using the given\n parsing rules.\n */\n constructor(\n /**\n The schema into which the parser parses.\n */\n schema, \n /**\n The set of [parse rules](https://prosemirror.net/docs/ref/#model.ParseRule) that the parser\n uses, in order of precedence.\n */\n rules) {\n this.schema = schema;\n this.rules = rules;\n /**\n @internal\n */\n this.tags = [];\n /**\n @internal\n */\n this.styles = [];\n let matchedStyles = this.matchedStyles = [];\n rules.forEach(rule => {\n if (isTagRule(rule)) {\n this.tags.push(rule);\n }\n else if (isStyleRule(rule)) {\n let prop = /[^=]*/.exec(rule.style)[0];\n if (matchedStyles.indexOf(prop) < 0)\n matchedStyles.push(prop);\n this.styles.push(rule);\n }\n });\n // Only normalize list elements when lists in the schema can't directly contain themselves\n this.normalizeLists = !this.tags.some(r => {\n if (!/^(ul|ol)\\b/.test(r.tag) || !r.node)\n return false;\n let node = schema.nodes[r.node];\n return node.contentMatch.matchType(node);\n });\n }\n /**\n Parse a document from the content of a DOM node.\n */\n parse(dom, options = {}) {\n let context = new ParseContext(this, options, false);\n context.addAll(dom, Mark.none, options.from, options.to);\n return context.finish();\n }\n /**\n Parses the content of the given DOM node, like\n [`parse`](https://prosemirror.net/docs/ref/#model.DOMParser.parse), and takes the same set of\n options. But unlike that method, which produces a whole node,\n this one returns a slice that is open at the sides, meaning that\n the schema constraints aren't applied to the start of nodes to\n the left of the input and the end of nodes at the end.\n */\n parseSlice(dom, options = {}) {\n let context = new ParseContext(this, options, true);\n context.addAll(dom, Mark.none, options.from, options.to);\n return Slice.maxOpen(context.finish());\n }\n /**\n @internal\n */\n matchTag(dom, context, after) {\n for (let i = after ? this.tags.indexOf(after) + 1 : 0; i < this.tags.length; i++) {\n let rule = this.tags[i];\n if (matches(dom, rule.tag) &&\n (rule.namespace === undefined || dom.namespaceURI == rule.namespace) &&\n (!rule.context || context.matchesContext(rule.context))) {\n if (rule.getAttrs) {\n let result = rule.getAttrs(dom);\n if (result === false)\n continue;\n rule.attrs = result || undefined;\n }\n return rule;\n }\n }\n }\n /**\n @internal\n */\n matchStyle(prop, value, context, after) {\n for (let i = after ? this.styles.indexOf(after) + 1 : 0; i < this.styles.length; i++) {\n let rule = this.styles[i], style = rule.style;\n if (style.indexOf(prop) != 0 ||\n rule.context && !context.matchesContext(rule.context) ||\n // Test that the style string either precisely matches the prop,\n // or has an '=' sign after the prop, followed by the given\n // value.\n style.length > prop.length &&\n (style.charCodeAt(prop.length) != 61 || style.slice(prop.length + 1) != value))\n continue;\n if (rule.getAttrs) {\n let result = rule.getAttrs(value);\n if (result === false)\n continue;\n rule.attrs = result || undefined;\n }\n return rule;\n }\n }\n /**\n @internal\n */\n static schemaRules(schema) {\n let result = [];\n function insert(rule) {\n let priority = rule.priority == null ? 50 : rule.priority, i = 0;\n for (; i < result.length; i++) {\n let next = result[i], nextPriority = next.priority == null ? 50 : next.priority;\n if (nextPriority < priority)\n break;\n }\n result.splice(i, 0, rule);\n }\n for (let name in schema.marks) {\n let rules = schema.marks[name].spec.parseDOM;\n if (rules)\n rules.forEach(rule => {\n insert(rule = copy(rule));\n if (!(rule.mark || rule.ignore || rule.clearMark))\n rule.mark = name;\n });\n }\n for (let name in schema.nodes) {\n let rules = schema.nodes[name].spec.parseDOM;\n if (rules)\n rules.forEach(rule => {\n insert(rule = copy(rule));\n if (!(rule.node || rule.ignore || rule.mark))\n rule.node = name;\n });\n }\n return result;\n }\n /**\n Construct a DOM parser using the parsing rules listed in a\n schema's [node specs](https://prosemirror.net/docs/ref/#model.NodeSpec.parseDOM), reordered by\n [priority](https://prosemirror.net/docs/ref/#model.ParseRule.priority).\n */\n static fromSchema(schema) {\n return schema.cached.domParser ||\n (schema.cached.domParser = new DOMParser(schema, DOMParser.schemaRules(schema)));\n }\n}\nconst blockTags = {\n address: true, article: true, aside: true, blockquote: true, canvas: true,\n dd: true, div: true, dl: true, fieldset: true, figcaption: true, figure: true,\n footer: true, form: true, h1: true, h2: true, h3: true, h4: true, h5: true,\n h6: true, header: true, hgroup: true, hr: true, li: true, noscript: true, ol: true,\n output: true, p: true, pre: true, section: true, table: true, tfoot: true, ul: true\n};\nconst ignoreTags = {\n head: true, noscript: true, object: true, script: true, style: true, title: true\n};\nconst listTags = { ol: true, ul: true };\n// Using a bitfield for node context options\nconst OPT_PRESERVE_WS = 1, OPT_PRESERVE_WS_FULL = 2, OPT_OPEN_LEFT = 4;\nfunction wsOptionsFor(type, preserveWhitespace, base) {\n if (preserveWhitespace != null)\n return (preserveWhitespace ? OPT_PRESERVE_WS : 0) |\n (preserveWhitespace === \"full\" ? OPT_PRESERVE_WS_FULL : 0);\n return type && type.whitespace == \"pre\" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base & ~OPT_OPEN_LEFT;\n}\nclass NodeContext {\n constructor(type, attrs, marks, solid, match, options) {\n this.type = type;\n this.attrs = attrs;\n this.marks = marks;\n this.solid = solid;\n this.options = options;\n this.content = [];\n // Marks applied to the node's children\n this.activeMarks = Mark.none;\n this.match = match || (options & OPT_OPEN_LEFT ? null : type.contentMatch);\n }\n findWrapping(node) {\n if (!this.match) {\n if (!this.type)\n return [];\n let fill = this.type.contentMatch.fillBefore(Fragment.from(node));\n if (fill) {\n this.match = this.type.contentMatch.matchFragment(fill);\n }\n else {\n let start = this.type.contentMatch, wrap;\n if (wrap = start.findWrapping(node.type)) {\n this.match = start;\n return wrap;\n }\n else {\n return null;\n }\n }\n }\n return this.match.findWrapping(node.type);\n }\n finish(openEnd) {\n if (!(this.options & OPT_PRESERVE_WS)) { // Strip trailing whitespace\n let last = this.content[this.content.length - 1], m;\n if (last && last.isText && (m = /[ \\t\\r\\n\\u000c]+$/.exec(last.text))) {\n let text = last;\n if (last.text.length == m[0].length)\n this.content.pop();\n else\n this.content[this.content.length - 1] = text.withText(text.text.slice(0, text.text.length - m[0].length));\n }\n }\n let content = Fragment.from(this.content);\n if (!openEnd && this.match)\n content = content.append(this.match.fillBefore(Fragment.empty, true));\n return this.type ? this.type.create(this.attrs, content, this.marks) : content;\n }\n inlineContext(node) {\n if (this.type)\n return this.type.inlineContent;\n if (this.content.length)\n return this.content[0].isInline;\n return node.parentNode && !blockTags.hasOwnProperty(node.parentNode.nodeName.toLowerCase());\n }\n}\nclass ParseContext {\n constructor(\n // The parser we are using.\n parser, \n // The options passed to this parse.\n options, isOpen) {\n this.parser = parser;\n this.options = options;\n this.isOpen = isOpen;\n this.open = 0;\n this.localPreserveWS = false;\n let topNode = options.topNode, topContext;\n let topOptions = wsOptionsFor(null, options.preserveWhitespace, 0) | (isOpen ? OPT_OPEN_LEFT : 0);\n if (topNode)\n topContext = new NodeContext(topNode.type, topNode.attrs, Mark.none, true, options.topMatch || topNode.type.contentMatch, topOptions);\n else if (isOpen)\n topContext = new NodeContext(null, null, Mark.none, true, null, topOptions);\n else\n topContext = new NodeContext(parser.schema.topNodeType, null, Mark.none, true, null, topOptions);\n this.nodes = [topContext];\n this.find = options.findPositions;\n this.needsBlock = false;\n }\n get top() {\n return this.nodes[this.open];\n }\n // Add a DOM node to the content. Text is inserted as text node,\n // otherwise, the node is passed to `addElement` or, if it has a\n // `style` attribute, `addElementWithStyles`.\n addDOM(dom, marks) {\n if (dom.nodeType == 3)\n this.addTextNode(dom, marks);\n else if (dom.nodeType == 1)\n this.addElement(dom, marks);\n }\n addTextNode(dom, marks) {\n let value = dom.nodeValue;\n let top = this.top, preserveWS = (top.options & OPT_PRESERVE_WS_FULL) ? \"full\"\n : this.localPreserveWS || (top.options & OPT_PRESERVE_WS) > 0;\n if (preserveWS === \"full\" ||\n top.inlineContext(dom) ||\n /[^ \\t\\r\\n\\u000c]/.test(value)) {\n if (!preserveWS) {\n value = value.replace(/[ \\t\\r\\n\\u000c]+/g, \" \");\n // If this starts with whitespace, and there is no node before it, or\n // a hard break, or a text node that ends with whitespace, strip the\n // leading space.\n if (/^[ \\t\\r\\n\\u000c]/.test(value) && this.open == this.nodes.length - 1) {\n let nodeBefore = top.content[top.content.length - 1];\n let domNodeBefore = dom.previousSibling;\n if (!nodeBefore ||\n (domNodeBefore && domNodeBefore.nodeName == 'BR') ||\n (nodeBefore.isText && /[ \\t\\r\\n\\u000c]$/.test(nodeBefore.text)))\n value = value.slice(1);\n }\n }\n else if (preserveWS !== \"full\") {\n value = value.replace(/\\r?\\n|\\r/g, \" \");\n }\n else {\n value = value.replace(/\\r\\n?/g, \"\\n\");\n }\n if (value)\n this.insertNode(this.parser.schema.text(value), marks);\n this.findInText(dom);\n }\n else {\n this.findInside(dom);\n }\n }\n // Try to find a handler for the given tag and use that to parse. If\n // none is found, the element's content nodes are added directly.\n addElement(dom, marks, matchAfter) {\n let outerWS = this.localPreserveWS, top = this.top;\n if (dom.tagName == \"PRE\" || /pre/.test(dom.style && dom.style.whiteSpace))\n this.localPreserveWS = true;\n let name = dom.nodeName.toLowerCase(), ruleID;\n if (listTags.hasOwnProperty(name) && this.parser.normalizeLists)\n normalizeList(dom);\n let rule = (this.options.ruleFromNode && this.options.ruleFromNode(dom)) ||\n (ruleID = this.parser.matchTag(dom, this, matchAfter));\n out: if (rule ? rule.ignore : ignoreTags.hasOwnProperty(name)) {\n this.findInside(dom);\n this.ignoreFallback(dom, marks);\n }\n else if (!rule || rule.skip || rule.closeParent) {\n if (rule && rule.closeParent)\n this.open = Math.max(0, this.open - 1);\n else if (rule && rule.skip.nodeType)\n dom = rule.skip;\n let sync, oldNeedsBlock = this.needsBlock;\n if (blockTags.hasOwnProperty(name)) {\n if (top.content.length && top.content[0].isInline && this.open) {\n this.open--;\n top = this.top;\n }\n sync = true;\n if (!top.type)\n this.needsBlock = true;\n }\n else if (!dom.firstChild) {\n this.leafFallback(dom, marks);\n break out;\n }\n let innerMarks = rule && rule.skip ? marks : this.readStyles(dom, marks);\n if (innerMarks)\n this.addAll(dom, innerMarks);\n if (sync)\n this.sync(top);\n this.needsBlock = oldNeedsBlock;\n }\n else {\n let innerMarks = this.readStyles(dom, marks);\n if (innerMarks)\n this.addElementByRule(dom, rule, innerMarks, rule.consuming === false ? ruleID : undefined);\n }\n this.localPreserveWS = outerWS;\n }\n // Called for leaf DOM nodes that would otherwise be ignored\n leafFallback(dom, marks) {\n if (dom.nodeName == \"BR\" && this.top.type && this.top.type.inlineContent)\n this.addTextNode(dom.ownerDocument.createTextNode(\"\\n\"), marks);\n }\n // Called for ignored nodes\n ignoreFallback(dom, marks) {\n // Ignored BR nodes should at least create an inline context\n if (dom.nodeName == \"BR\" && (!this.top.type || !this.top.type.inlineContent))\n this.findPlace(this.parser.schema.text(\"-\"), marks);\n }\n // Run any style parser associated with the node's styles. Either\n // return an updated array of marks, or null to indicate some of the\n // styles had a rule with `ignore` set.\n readStyles(dom, marks) {\n let styles = dom.style;\n // Because many properties will only show up in 'normalized' form\n // in `style.item` (i.e. text-decoration becomes\n // text-decoration-line, text-decoration-color, etc), we directly\n // query the styles mentioned in our rules instead of iterating\n // over the items.\n if (styles && styles.length)\n for (let i = 0; i < this.parser.matchedStyles.length; i++) {\n let name = this.parser.matchedStyles[i], value = styles.getPropertyValue(name);\n if (value)\n for (let after = undefined;;) {\n let rule = this.parser.matchStyle(name, value, this, after);\n if (!rule)\n break;\n if (rule.ignore)\n return null;\n if (rule.clearMark)\n marks = marks.filter(m => !rule.clearMark(m));\n else\n marks = marks.concat(this.parser.schema.marks[rule.mark].create(rule.attrs));\n if (rule.consuming === false)\n after = rule;\n else\n break;\n }\n }\n return marks;\n }\n // Look up a handler for the given node. If none are found, return\n // false. Otherwise, apply it, use its return value to drive the way\n // the node's content is wrapped, and return true.\n addElementByRule(dom, rule, marks, continueAfter) {\n let sync, nodeType;\n if (rule.node) {\n nodeType = this.parser.schema.nodes[rule.node];\n if (!nodeType.isLeaf) {\n let inner = this.enter(nodeType, rule.attrs || null, marks, rule.preserveWhitespace);\n if (inner) {\n sync = true;\n marks = inner;\n }\n }\n else if (!this.insertNode(nodeType.create(rule.attrs), marks)) {\n this.leafFallback(dom, marks);\n }\n }\n else {\n let markType = this.parser.schema.marks[rule.mark];\n marks = marks.concat(markType.create(rule.attrs));\n }\n let startIn = this.top;\n if (nodeType && nodeType.isLeaf) {\n this.findInside(dom);\n }\n else if (continueAfter) {\n this.addElement(dom, marks, continueAfter);\n }\n else if (rule.getContent) {\n this.findInside(dom);\n rule.getContent(dom, this.parser.schema).forEach(node => this.insertNode(node, marks));\n }\n else {\n let contentDOM = dom;\n if (typeof rule.contentElement == \"string\")\n contentDOM = dom.querySelector(rule.contentElement);\n else if (typeof rule.contentElement == \"function\")\n contentDOM = rule.contentElement(dom);\n else if (rule.contentElement)\n contentDOM = rule.contentElement;\n this.findAround(dom, contentDOM, true);\n this.addAll(contentDOM, marks);\n this.findAround(dom, contentDOM, false);\n }\n if (sync && this.sync(startIn))\n this.open--;\n }\n // Add all child nodes between `startIndex` and `endIndex` (or the\n // whole node, if not given). If `sync` is passed, use it to\n // synchronize after every block element.\n addAll(parent, marks, startIndex, endIndex) {\n let index = startIndex || 0;\n for (let dom = startIndex ? parent.childNodes[startIndex] : parent.firstChild, end = endIndex == null ? null : parent.childNodes[endIndex]; dom != end; dom = dom.nextSibling, ++index) {\n this.findAtPoint(parent, index);\n this.addDOM(dom, marks);\n }\n this.findAtPoint(parent, index);\n }\n // Try to find a way to fit the given node type into the current\n // context. May add intermediate wrappers and/or leave non-solid\n // nodes that we're in.\n findPlace(node, marks) {\n let route, sync;\n for (let depth = this.open; depth >= 0; depth--) {\n let cx = this.nodes[depth];\n let found = cx.findWrapping(node);\n if (found && (!route || route.length > found.length)) {\n route = found;\n sync = cx;\n if (!found.length)\n break;\n }\n if (cx.solid)\n break;\n }\n if (!route)\n return null;\n this.sync(sync);\n for (let i = 0; i < route.length; i++)\n marks = this.enterInner(route[i], null, marks, false);\n return marks;\n }\n // Try to insert the given node, adjusting the context when needed.\n insertNode(node, marks) {\n if (node.isInline && this.needsBlock && !this.top.type) {\n let block = this.textblockFromContext();\n if (block)\n marks = this.enterInner(block, null, marks);\n }\n let innerMarks = this.findPlace(node, marks);\n if (innerMarks) {\n this.closeExtra();\n let top = this.top;\n if (top.match)\n top.match = top.match.matchType(node.type);\n let nodeMarks = Mark.none;\n for (let m of innerMarks.concat(node.marks))\n if (top.type ? top.type.allowsMarkType(m.type) : markMayApply(m.type, node.type))\n nodeMarks = m.addToSet(nodeMarks);\n top.content.push(node.mark(nodeMarks));\n return true;\n }\n return false;\n }\n // Try to start a node of the given type, adjusting the context when\n // necessary.\n enter(type, attrs, marks, preserveWS) {\n let innerMarks = this.findPlace(type.create(attrs), marks);\n if (innerMarks)\n innerMarks = this.enterInner(type, attrs, marks, true, preserveWS);\n return innerMarks;\n }\n // Open a node of the given type\n enterInner(type, attrs, marks, solid = false, preserveWS) {\n this.closeExtra();\n let top = this.top;\n top.match = top.match && top.match.matchType(type);\n let options = wsOptionsFor(type, preserveWS, top.options);\n if ((top.options & OPT_OPEN_LEFT) && top.content.length == 0)\n options |= OPT_OPEN_LEFT;\n let applyMarks = Mark.none;\n marks = marks.filter(m => {\n if (top.type ? top.type.allowsMarkType(m.type) : markMayApply(m.type, type)) {\n applyMarks = m.addToSet(applyMarks);\n return false;\n }\n return true;\n });\n this.nodes.push(new NodeContext(type, attrs, applyMarks, solid, null, options));\n this.open++;\n return marks;\n }\n // Make sure all nodes above this.open are finished and added to\n // their parents\n closeExtra(openEnd = false) {\n let i = this.nodes.length - 1;\n if (i > this.open) {\n for (; i > this.open; i--)\n this.nodes[i - 1].content.push(this.nodes[i].finish(openEnd));\n this.nodes.length = this.open + 1;\n }\n }\n finish() {\n this.open = 0;\n this.closeExtra(this.isOpen);\n return this.nodes[0].finish(!!(this.isOpen || this.options.topOpen));\n }\n sync(to) {\n for (let i = this.open; i >= 0; i--) {\n if (this.nodes[i] == to) {\n this.open = i;\n return true;\n }\n else if (this.localPreserveWS) {\n this.nodes[i].options |= OPT_PRESERVE_WS;\n }\n }\n return false;\n }\n get currentPos() {\n this.closeExtra();\n let pos = 0;\n for (let i = this.open; i >= 0; i--) {\n let content = this.nodes[i].content;\n for (let j = content.length - 1; j >= 0; j--)\n pos += content[j].nodeSize;\n if (i)\n pos++;\n }\n return pos;\n }\n findAtPoint(parent, offset) {\n if (this.find)\n for (let i = 0; i < this.find.length; i++) {\n if (this.find[i].node == parent && this.find[i].offset == offset)\n this.find[i].pos = this.currentPos;\n }\n }\n findInside(parent) {\n if (this.find)\n for (let i = 0; i < this.find.length; i++) {\n if (this.find[i].pos == null && parent.nodeType == 1 && parent.contains(this.find[i].node))\n this.find[i].pos = this.currentPos;\n }\n }\n findAround(parent, content, before) {\n if (parent != content && this.find)\n for (let i = 0; i < this.find.length; i++) {\n if (this.find[i].pos == null && parent.nodeType == 1 && parent.contains(this.find[i].node)) {\n let pos = content.compareDocumentPosition(this.find[i].node);\n if (pos & (before ? 2 : 4))\n this.find[i].pos = this.currentPos;\n }\n }\n }\n findInText(textNode) {\n if (this.find)\n for (let i = 0; i < this.find.length; i++) {\n if (this.find[i].node == textNode)\n this.find[i].pos = this.currentPos - (textNode.nodeValue.length - this.find[i].offset);\n }\n }\n // Determines whether the given context string matches this context.\n matchesContext(context) {\n if (context.indexOf(\"|\") > -1)\n return context.split(/\\s*\\|\\s*/).some(this.matchesContext, this);\n let parts = context.split(\"/\");\n let option = this.options.context;\n let useRoot = !this.isOpen && (!option || option.parent.type == this.nodes[0].type);\n let minDepth = -(option ? option.depth + 1 : 0) + (useRoot ? 0 : 1);\n let match = (i, depth) => {\n for (; i >= 0; i--) {\n let part = parts[i];\n if (part == \"\") {\n if (i == parts.length - 1 || i == 0)\n continue;\n for (; depth >= minDepth; depth--)\n if (match(i - 1, depth))\n return true;\n return false;\n }\n else {\n let next = depth > 0 || (depth == 0 && useRoot) ? this.nodes[depth].type\n : option && depth >= minDepth ? option.node(depth - minDepth).type\n : null;\n if (!next || (next.name != part && !next.isInGroup(part)))\n return false;\n depth--;\n }\n }\n return true;\n };\n return match(parts.length - 1, this.open);\n }\n textblockFromContext() {\n let $context = this.options.context;\n if ($context)\n for (let d = $context.depth; d >= 0; d--) {\n let deflt = $context.node(d).contentMatchAt($context.indexAfter(d)).defaultType;\n if (deflt && deflt.isTextblock && deflt.defaultAttrs)\n return deflt;\n }\n for (let name in this.parser.schema.nodes) {\n let type = this.parser.schema.nodes[name];\n if (type.isTextblock && type.defaultAttrs)\n return type;\n }\n }\n}\n// Kludge to work around directly nested list nodes produced by some\n// tools and allowed by browsers to mean that the nested list is\n// actually part of the list item above it.\nfunction normalizeList(dom) {\n for (let child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {\n let name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null;\n if (name && listTags.hasOwnProperty(name) && prevItem) {\n prevItem.appendChild(child);\n child = prevItem;\n }\n else if (name == \"li\") {\n prevItem = child;\n }\n else if (name) {\n prevItem = null;\n }\n }\n}\n// Apply a CSS selector.\nfunction matches(dom, selector) {\n return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector);\n}\nfunction copy(obj) {\n let copy = {};\n for (let prop in obj)\n copy[prop] = obj[prop];\n return copy;\n}\n// Used when finding a mark at the top level of a fragment parse.\n// Checks whether it would be reasonable to apply a given mark type to\n// a given node, by looking at the way the mark occurs in the schema.\nfunction markMayApply(markType, nodeType) {\n let nodes = nodeType.schema.nodes;\n for (let name in nodes) {\n let parent = nodes[name];\n if (!parent.allowsMarkType(markType))\n continue;\n let seen = [], scan = (match) => {\n seen.push(match);\n for (let i = 0; i < match.edgeCount; i++) {\n let { type, next } = match.edge(i);\n if (type == nodeType)\n return true;\n if (seen.indexOf(next) < 0 && scan(next))\n return true;\n }\n };\n if (scan(parent.contentMatch))\n return true;\n }\n}\n\n/**\nA DOM serializer knows how to convert ProseMirror nodes and\nmarks of various types to DOM nodes.\n*/\nclass DOMSerializer {\n /**\n Create a serializer. `nodes` should map node names to functions\n that take a node and return a description of the corresponding\n DOM. `marks` does the same for mark names, but also gets an\n argument that tells it whether the mark's content is block or\n inline content (for typical use, it'll always be inline). A mark\n serializer may be `null` to indicate that marks of that type\n should not be serialized.\n */\n constructor(\n /**\n The node serialization functions.\n */\n nodes, \n /**\n The mark serialization functions.\n */\n marks) {\n this.nodes = nodes;\n this.marks = marks;\n }\n /**\n Serialize the content of this fragment to a DOM fragment. When\n not in the browser, the `document` option, containing a DOM\n document, should be passed so that the serializer can create\n nodes.\n */\n serializeFragment(fragment, options = {}, target) {\n if (!target)\n target = doc(options).createDocumentFragment();\n let top = target, active = [];\n fragment.forEach(node => {\n if (active.length || node.marks.length) {\n let keep = 0, rendered = 0;\n while (keep < active.length && rendered < node.marks.length) {\n let next = node.marks[rendered];\n if (!this.marks[next.type.name]) {\n rendered++;\n continue;\n }\n if (!next.eq(active[keep][0]) || next.type.spec.spanning === false)\n break;\n keep++;\n rendered++;\n }\n while (keep < active.length)\n top = active.pop()[1];\n while (rendered < node.marks.length) {\n let add = node.marks[rendered++];\n let markDOM = this.serializeMark(add, node.isInline, options);\n if (markDOM) {\n active.push([add, top]);\n top.appendChild(markDOM.dom);\n top = markDOM.contentDOM || markDOM.dom;\n }\n }\n }\n top.appendChild(this.serializeNodeInner(node, options));\n });\n return target;\n }\n /**\n @internal\n */\n serializeNodeInner(node, options) {\n let { dom, contentDOM } = renderSpec(doc(options), this.nodes[node.type.name](node), null, node.attrs);\n if (contentDOM) {\n if (node.isLeaf)\n throw new RangeError(\"Content hole not allowed in a leaf node spec\");\n this.serializeFragment(node.content, options, contentDOM);\n }\n return dom;\n }\n /**\n Serialize this node to a DOM node. This can be useful when you\n need to serialize a part of a document, as opposed to the whole\n document. To serialize a whole document, use\n [`serializeFragment`](https://prosemirror.net/docs/ref/#model.DOMSerializer.serializeFragment) on\n its [content](https://prosemirror.net/docs/ref/#model.Node.content).\n */\n serializeNode(node, options = {}) {\n let dom = this.serializeNodeInner(node, options);\n for (let i = node.marks.length - 1; i >= 0; i--) {\n let wrap = this.serializeMark(node.marks[i], node.isInline, options);\n if (wrap) {\n (wrap.contentDOM || wrap.dom).appendChild(dom);\n dom = wrap.dom;\n }\n }\n return dom;\n }\n /**\n @internal\n */\n serializeMark(mark, inline, options = {}) {\n let toDOM = this.marks[mark.type.name];\n return toDOM && renderSpec(doc(options), toDOM(mark, inline), null, mark.attrs);\n }\n static renderSpec(doc, structure, xmlNS = null, blockArraysIn) {\n return renderSpec(doc, structure, xmlNS, blockArraysIn);\n }\n /**\n Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)\n properties in a schema's node and mark specs.\n */\n static fromSchema(schema) {\n return schema.cached.domSerializer ||\n (schema.cached.domSerializer = new DOMSerializer(this.nodesFromSchema(schema), this.marksFromSchema(schema)));\n }\n /**\n Gather the serializers in a schema's node specs into an object.\n This can be useful as a base to build a custom serializer from.\n */\n static nodesFromSchema(schema) {\n let result = gatherToDOM(schema.nodes);\n if (!result.text)\n result.text = node => node.text;\n return result;\n }\n /**\n Gather the serializers in a schema's mark specs into an object.\n */\n static marksFromSchema(schema) {\n return gatherToDOM(schema.marks);\n }\n}\nfunction gatherToDOM(obj) {\n let result = {};\n for (let name in obj) {\n let toDOM = obj[name].spec.toDOM;\n if (toDOM)\n result[name] = toDOM;\n }\n return result;\n}\nfunction doc(options) {\n return options.document || window.document;\n}\nconst suspiciousAttributeCache = new WeakMap();\nfunction suspiciousAttributes(attrs) {\n let value = suspiciousAttributeCache.get(attrs);\n if (value === undefined)\n suspiciousAttributeCache.set(attrs, value = suspiciousAttributesInner(attrs));\n return value;\n}\nfunction suspiciousAttributesInner(attrs) {\n let result = null;\n function scan(value) {\n if (value && typeof value == \"object\") {\n if (Array.isArray(value)) {\n if (typeof value[0] == \"string\") {\n if (!result)\n result = [];\n result.push(value);\n }\n else {\n for (let i = 0; i < value.length; i++)\n scan(value[i]);\n }\n }\n else {\n for (let prop in value)\n scan(value[prop]);\n }\n }\n }\n scan(attrs);\n return result;\n}\nfunction renderSpec(doc, structure, xmlNS, blockArraysIn) {\n if (typeof structure == \"string\")\n return { dom: doc.createTextNode(structure) };\n if (structure.nodeType != null)\n return { dom: structure };\n if (structure.dom && structure.dom.nodeType != null)\n return structure;\n let tagName = structure[0], suspicious;\n if (typeof tagName != \"string\")\n throw new RangeError(\"Invalid array passed to renderSpec\");\n if (blockArraysIn && (suspicious = suspiciousAttributes(blockArraysIn)) &&\n suspicious.indexOf(structure) > -1)\n throw new RangeError(\"Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.\");\n let space = tagName.indexOf(\" \");\n if (space > 0) {\n xmlNS = tagName.slice(0, space);\n tagName = tagName.slice(space + 1);\n }\n let contentDOM;\n let dom = (xmlNS ? doc.createElementNS(xmlNS, tagName) : doc.createElement(tagName));\n let attrs = structure[1], start = 1;\n if (attrs && typeof attrs == \"object\" && attrs.nodeType == null && !Array.isArray(attrs)) {\n start = 2;\n for (let name in attrs)\n if (attrs[name] != null) {\n let space = name.indexOf(\" \");\n if (space > 0)\n dom.setAttributeNS(name.slice(0, space), name.slice(space + 1), attrs[name]);\n else\n dom.setAttribute(name, attrs[name]);\n }\n }\n for (let i = start; i < structure.length; i++) {\n let child = structure[i];\n if (child === 0) {\n if (i < structure.length - 1 || i > start)\n throw new RangeError(\"Content hole must be the only child of its parent node\");\n return { dom, contentDOM: dom };\n }\n else {\n let { dom: inner, contentDOM: innerContent } = renderSpec(doc, child, xmlNS, blockArraysIn);\n dom.appendChild(inner);\n if (innerContent) {\n if (contentDOM)\n throw new RangeError(\"Multiple content holes\");\n contentDOM = innerContent;\n }\n }\n }\n return { dom, contentDOM };\n}\n\nexport { ContentMatch, DOMParser, DOMSerializer, Fragment, Mark, MarkType, Node, NodeRange, NodeType, ReplaceError, ResolvedPos, Schema, Slice };\n","import { ReplaceError, Slice, Fragment, MarkType, Mark } from 'prosemirror-model';\n\n// Recovery values encode a range index and an offset. They are\n// represented as numbers, because tons of them will be created when\n// mapping, for example, a large number of decorations. The number's\n// lower 16 bits provide the index, the remaining bits the offset.\n//\n// Note: We intentionally don't use bit shift operators to en- and\n// decode these, since those clip to 32 bits, which we might in rare\n// cases want to overflow. A 64-bit float can represent 48-bit\n// integers precisely.\nconst lower16 = 0xffff;\nconst factor16 = Math.pow(2, 16);\nfunction makeRecover(index, offset) { return index + offset * factor16; }\nfunction recoverIndex(value) { return value & lower16; }\nfunction recoverOffset(value) { return (value - (value & lower16)) / factor16; }\nconst DEL_BEFORE = 1, DEL_AFTER = 2, DEL_ACROSS = 4, DEL_SIDE = 8;\n/**\nAn object representing a mapped position with extra\ninformation.\n*/\nclass MapResult {\n /**\n @internal\n */\n constructor(\n /**\n The mapped version of the position.\n */\n pos, \n /**\n @internal\n */\n delInfo, \n /**\n @internal\n */\n recover) {\n this.pos = pos;\n this.delInfo = delInfo;\n this.recover = recover;\n }\n /**\n Tells you whether the position was deleted, that is, whether the\n step removed the token on the side queried (via the `assoc`)\n argument from the document.\n */\n get deleted() { return (this.delInfo & DEL_SIDE) > 0; }\n /**\n Tells you whether the token before the mapped position was deleted.\n */\n get deletedBefore() { return (this.delInfo & (DEL_BEFORE | DEL_ACROSS)) > 0; }\n /**\n True when the token after the mapped position was deleted.\n */\n get deletedAfter() { return (this.delInfo & (DEL_AFTER | DEL_ACROSS)) > 0; }\n /**\n Tells whether any of the steps mapped through deletes across the\n position (including both the token before and after the\n position).\n */\n get deletedAcross() { return (this.delInfo & DEL_ACROSS) > 0; }\n}\n/**\nA map describing the deletions and insertions made by a step, which\ncan be used to find the correspondence between positions in the\npre-step version of a document and the same position in the\npost-step version.\n*/\nclass StepMap {\n /**\n Create a position map. The modifications to the document are\n represented as an array of numbers, in which each group of three\n represents a modified chunk as `[start, oldSize, newSize]`.\n */\n constructor(\n /**\n @internal\n */\n ranges, \n /**\n @internal\n */\n inverted = false) {\n this.ranges = ranges;\n this.inverted = inverted;\n if (!ranges.length && StepMap.empty)\n return StepMap.empty;\n }\n /**\n @internal\n */\n recover(value) {\n let diff = 0, index = recoverIndex(value);\n if (!this.inverted)\n for (let i = 0; i < index; i++)\n diff += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];\n return this.ranges[index * 3] + diff + recoverOffset(value);\n }\n mapResult(pos, assoc = 1) { return this._map(pos, assoc, false); }\n map(pos, assoc = 1) { return this._map(pos, assoc, true); }\n /**\n @internal\n */\n _map(pos, assoc, simple) {\n let diff = 0, oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;\n for (let i = 0; i < this.ranges.length; i += 3) {\n let start = this.ranges[i] - (this.inverted ? diff : 0);\n if (start > pos)\n break;\n let oldSize = this.ranges[i + oldIndex], newSize = this.ranges[i + newIndex], end = start + oldSize;\n if (pos <= end) {\n let side = !oldSize ? assoc : pos == start ? -1 : pos == end ? 1 : assoc;\n let result = start + diff + (side < 0 ? 0 : newSize);\n if (simple)\n return result;\n let recover = pos == (assoc < 0 ? start : end) ? null : makeRecover(i / 3, pos - start);\n let del = pos == start ? DEL_AFTER : pos == end ? DEL_BEFORE : DEL_ACROSS;\n if (assoc < 0 ? pos != start : pos != end)\n del |= DEL_SIDE;\n return new MapResult(result, del, recover);\n }\n diff += newSize - oldSize;\n }\n return simple ? pos + diff : new MapResult(pos + diff, 0, null);\n }\n /**\n @internal\n */\n touches(pos, recover) {\n let diff = 0, index = recoverIndex(recover);\n let oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;\n for (let i = 0; i < this.ranges.length; i += 3) {\n let start = this.ranges[i] - (this.inverted ? diff : 0);\n if (start > pos)\n break;\n let oldSize = this.ranges[i + oldIndex], end = start + oldSize;\n if (pos <= end && i == index * 3)\n return true;\n diff += this.ranges[i + newIndex] - oldSize;\n }\n return false;\n }\n /**\n Calls the given function on each of the changed ranges included in\n this map.\n */\n forEach(f) {\n let oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;\n for (let i = 0, diff = 0; i < this.ranges.length; i += 3) {\n let start = this.ranges[i], oldStart = start - (this.inverted ? diff : 0), newStart = start + (this.inverted ? 0 : diff);\n let oldSize = this.ranges[i + oldIndex], newSize = this.ranges[i + newIndex];\n f(oldStart, oldStart + oldSize, newStart, newStart + newSize);\n diff += newSize - oldSize;\n }\n }\n /**\n Create an inverted version of this map. The result can be used to\n map positions in the post-step document to the pre-step document.\n */\n invert() {\n return new StepMap(this.ranges, !this.inverted);\n }\n /**\n @internal\n */\n toString() {\n return (this.inverted ? \"-\" : \"\") + JSON.stringify(this.ranges);\n }\n /**\n Create a map that moves all positions by offset `n` (which may be\n negative). This can be useful when applying steps meant for a\n sub-document to a larger document, or vice-versa.\n */\n static offset(n) {\n return n == 0 ? StepMap.empty : new StepMap(n < 0 ? [0, -n, 0] : [0, 0, n]);\n }\n}\n/**\nA StepMap that contains no changed ranges.\n*/\nStepMap.empty = new StepMap([]);\n/**\nA mapping represents a pipeline of zero or more [step\nmaps](https://prosemirror.net/docs/ref/#transform.StepMap). It has special provisions for losslessly\nhandling mapping positions through a series of steps in which some\nsteps are inverted versions of earlier steps. (This comes up when\n‘[rebasing](/docs/guide/#transform.rebasing)’ steps for\ncollaboration or history management.)\n*/\nclass Mapping {\n /**\n Create a new mapping with the given position maps.\n */\n constructor(\n /**\n The step maps in this mapping.\n */\n maps = [], \n /**\n @internal\n */\n mirror, \n /**\n The starting position in the `maps` array, used when `map` or\n `mapResult` is called.\n */\n from = 0, \n /**\n The end position in the `maps` array.\n */\n to = maps.length) {\n this.maps = maps;\n this.mirror = mirror;\n this.from = from;\n this.to = to;\n }\n /**\n Create a mapping that maps only through a part of this one.\n */\n slice(from = 0, to = this.maps.length) {\n return new Mapping(this.maps, this.mirror, from, to);\n }\n /**\n @internal\n */\n copy() {\n return new Mapping(this.maps.slice(), this.mirror && this.mirror.slice(), this.from, this.to);\n }\n /**\n Add a step map to the end of this mapping. If `mirrors` is\n given, it should be the index of the step map that is the mirror\n image of this one.\n */\n appendMap(map, mirrors) {\n this.to = this.maps.push(map);\n if (mirrors != null)\n this.setMirror(this.maps.length - 1, mirrors);\n }\n /**\n Add all the step maps in a given mapping to this one (preserving\n mirroring information).\n */\n appendMapping(mapping) {\n for (let i = 0, startSize = this.maps.length; i < mapping.maps.length; i++) {\n let mirr = mapping.getMirror(i);\n this.appendMap(mapping.maps[i], mirr != null && mirr < i ? startSize + mirr : undefined);\n }\n }\n /**\n Finds the offset of the step map that mirrors the map at the\n given offset, in this mapping (as per the second argument to\n `appendMap`).\n */\n getMirror(n) {\n if (this.mirror)\n for (let i = 0; i < this.mirror.length; i++)\n if (this.mirror[i] == n)\n return this.mirror[i + (i % 2 ? -1 : 1)];\n }\n /**\n @internal\n */\n setMirror(n, m) {\n if (!this.mirror)\n this.mirror = [];\n this.mirror.push(n, m);\n }\n /**\n Append the inverse of the given mapping to this one.\n */\n appendMappingInverted(mapping) {\n for (let i = mapping.maps.length - 1, totalSize = this.maps.length + mapping.maps.length; i >= 0; i--) {\n let mirr = mapping.getMirror(i);\n this.appendMap(mapping.maps[i].invert(), mirr != null && mirr > i ? totalSize - mirr - 1 : undefined);\n }\n }\n /**\n Create an inverted version of this mapping.\n */\n invert() {\n let inverse = new Mapping;\n inverse.appendMappingInverted(this);\n return inverse;\n }\n /**\n Map a position through this mapping.\n */\n map(pos, assoc = 1) {\n if (this.mirror)\n return this._map(pos, assoc, true);\n for (let i = this.from; i < this.to; i++)\n pos = this.maps[i].map(pos, assoc);\n return pos;\n }\n /**\n Map a position through this mapping, returning a mapping\n result.\n */\n mapResult(pos, assoc = 1) { return this._map(pos, assoc, false); }\n /**\n @internal\n */\n _map(pos, assoc, simple) {\n let delInfo = 0;\n for (let i = this.from; i < this.to; i++) {\n let map = this.maps[i], result = map.mapResult(pos, assoc);\n if (result.recover != null) {\n let corr = this.getMirror(i);\n if (corr != null && corr > i && corr < this.to) {\n i = corr;\n pos = this.maps[corr].recover(result.recover);\n continue;\n }\n }\n delInfo |= result.delInfo;\n pos = result.pos;\n }\n return simple ? pos : new MapResult(pos, delInfo, null);\n }\n}\n\nconst stepsByID = Object.create(null);\n/**\nA step object represents an atomic change. It generally applies\nonly to the document it was created for, since the positions\nstored in it will only make sense for that document.\n\nNew steps are defined by creating classes that extend `Step`,\noverriding the `apply`, `invert`, `map`, `getMap` and `fromJSON`\nmethods, and registering your class with a unique\nJSON-serialization identifier using\n[`Step.jsonID`](https://prosemirror.net/docs/ref/#transform.Step^jsonID).\n*/\nclass Step {\n /**\n Get the step map that represents the changes made by this step,\n and which can be used to transform between positions in the old\n and the new document.\n */\n getMap() { return StepMap.empty; }\n /**\n Try to merge this step with another one, to be applied directly\n after it. Returns the merged step when possible, null if the\n steps can't be merged.\n */\n merge(other) { return null; }\n /**\n Deserialize a step from its JSON representation. Will call\n through to the step class' own implementation of this method.\n */\n static fromJSON(schema, json) {\n if (!json || !json.stepType)\n throw new RangeError(\"Invalid input for Step.fromJSON\");\n let type = stepsByID[json.stepType];\n if (!type)\n throw new RangeError(`No step type ${json.stepType} defined`);\n return type.fromJSON(schema, json);\n }\n /**\n To be able to serialize steps to JSON, each step needs a string\n ID to attach to its JSON representation. Use this method to\n register an ID for your step classes. Try to pick something\n that's unlikely to clash with steps from other modules.\n */\n static jsonID(id, stepClass) {\n if (id in stepsByID)\n throw new RangeError(\"Duplicate use of step JSON ID \" + id);\n stepsByID[id] = stepClass;\n stepClass.prototype.jsonID = id;\n return stepClass;\n }\n}\n/**\nThe result of [applying](https://prosemirror.net/docs/ref/#transform.Step.apply) a step. Contains either a\nnew document or a failure value.\n*/\nclass StepResult {\n /**\n @internal\n */\n constructor(\n /**\n The transformed document, if successful.\n */\n doc, \n /**\n The failure message, if unsuccessful.\n */\n failed) {\n this.doc = doc;\n this.failed = failed;\n }\n /**\n Create a successful step result.\n */\n static ok(doc) { return new StepResult(doc, null); }\n /**\n Create a failed step result.\n */\n static fail(message) { return new StepResult(null, message); }\n /**\n Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given\n arguments. Create a successful result if it succeeds, and a\n failed one if it throws a `ReplaceError`.\n */\n static fromReplace(doc, from, to, slice) {\n try {\n return StepResult.ok(doc.replace(from, to, slice));\n }\n catch (e) {\n if (e instanceof ReplaceError)\n return StepResult.fail(e.message);\n throw e;\n }\n }\n}\n\nfunction mapFragment(fragment, f, parent) {\n let mapped = [];\n for (let i = 0; i < fragment.childCount; i++) {\n let child = fragment.child(i);\n if (child.content.size)\n child = child.copy(mapFragment(child.content, f, child));\n if (child.isInline)\n child = f(child, parent, i);\n mapped.push(child);\n }\n return Fragment.fromArray(mapped);\n}\n/**\nAdd a mark to all inline content between two positions.\n*/\nclass AddMarkStep extends Step {\n /**\n Create a mark step.\n */\n constructor(\n /**\n The start of the marked range.\n */\n from, \n /**\n The end of the marked range.\n */\n to, \n /**\n The mark to add.\n */\n mark) {\n super();\n this.from = from;\n this.to = to;\n this.mark = mark;\n }\n apply(doc) {\n let oldSlice = doc.slice(this.from, this.to), $from = doc.resolve(this.from);\n let parent = $from.node($from.sharedDepth(this.to));\n let slice = new Slice(mapFragment(oldSlice.content, (node, parent) => {\n if (!node.isAtom || !parent.type.allowsMarkType(this.mark.type))\n return node;\n return node.mark(this.mark.addToSet(node.marks));\n }, parent), oldSlice.openStart, oldSlice.openEnd);\n return StepResult.fromReplace(doc, this.from, this.to, slice);\n }\n invert() {\n return new RemoveMarkStep(this.from, this.to, this.mark);\n }\n map(mapping) {\n let from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);\n if (from.deleted && to.deleted || from.pos >= to.pos)\n return null;\n return new AddMarkStep(from.pos, to.pos, this.mark);\n }\n merge(other) {\n if (other instanceof AddMarkStep &&\n other.mark.eq(this.mark) &&\n this.from <= other.to && this.to >= other.from)\n return new AddMarkStep(Math.min(this.from, other.from), Math.max(this.to, other.to), this.mark);\n return null;\n }\n toJSON() {\n return { stepType: \"addMark\", mark: this.mark.toJSON(),\n from: this.from, to: this.to };\n }\n /**\n @internal\n */\n static fromJSON(schema, json) {\n if (typeof json.from != \"number\" || typeof json.to != \"number\")\n throw new RangeError(\"Invalid input for AddMarkStep.fromJSON\");\n return new AddMarkStep(json.from, json.to, schema.markFromJSON(json.mark));\n }\n}\nStep.jsonID(\"addMark\", AddMarkStep);\n/**\nRemove a mark from all inline content between two positions.\n*/\nclass RemoveMarkStep extends Step {\n /**\n Create a mark-removing step.\n */\n constructor(\n /**\n The start of the unmarked range.\n */\n from, \n /**\n The end of the unmarked range.\n */\n to, \n /**\n The mark to remove.\n */\n mark) {\n super();\n this.from = from;\n this.to = to;\n this.mark = mark;\n }\n apply(doc) {\n let oldSlice = doc.slice(this.from, this.to);\n let slice = new Slice(mapFragment(oldSlice.content, node => {\n return node.mark(this.mark.removeFromSet(node.marks));\n }, doc), oldSlice.openStart, oldSlice.openEnd);\n return StepResult.fromReplace(doc, this.from, this.to, slice);\n }\n invert() {\n return new AddMarkStep(this.from, this.to, this.mark);\n }\n map(mapping) {\n let from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);\n if (from.deleted && to.deleted || from.pos >= to.pos)\n return null;\n return new RemoveMarkStep(from.pos, to.pos, this.mark);\n }\n merge(other) {\n if (other instanceof RemoveMarkStep &&\n other.mark.eq(this.mark) &&\n this.from <= other.to && this.to >= other.from)\n return new RemoveMarkStep(Math.min(this.from, other.from), Math.max(this.to, other.to), this.mark);\n return null;\n }\n toJSON() {\n return { stepType: \"removeMark\", mark: this.mark.toJSON(),\n from: this.from, to: this.to };\n }\n /**\n @internal\n */\n static fromJSON(schema, json) {\n if (typeof json.from != \"number\" || typeof json.to != \"number\")\n throw new RangeError(\"Invalid input for RemoveMarkStep.fromJSON\");\n return new RemoveMarkStep(json.from, json.to, schema.markFromJSON(json.mark));\n }\n}\nStep.jsonID(\"removeMark\", RemoveMarkStep);\n/**\nAdd a mark to a specific node.\n*/\nclass AddNodeMarkStep extends Step {\n /**\n Create a node mark step.\n */\n constructor(\n /**\n The position of the target node.\n */\n pos, \n /**\n The mark to add.\n */\n mark) {\n super();\n this.pos = pos;\n this.mark = mark;\n }\n apply(doc) {\n let node = doc.nodeAt(this.pos);\n if (!node)\n return StepResult.fail(\"No node at mark step's position\");\n let updated = node.type.create(node.attrs, null, this.mark.addToSet(node.marks));\n return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment.from(updated), 0, node.isLeaf ? 0 : 1));\n }\n invert(doc) {\n let node = doc.nodeAt(this.pos);\n if (node) {\n let newSet = this.mark.addToSet(node.marks);\n if (newSet.length == node.marks.length) {\n for (let i = 0; i < node.marks.length; i++)\n if (!node.marks[i].isInSet(newSet))\n return new AddNodeMarkStep(this.pos, node.marks[i]);\n return new AddNodeMarkStep(this.pos, this.mark);\n }\n }\n return new RemoveNodeMarkStep(this.pos, this.mark);\n }\n map(mapping) {\n let pos = mapping.mapResult(this.pos, 1);\n return pos.deletedAfter ? null : new AddNodeMarkStep(pos.pos, this.mark);\n }\n toJSON() {\n return { stepType: \"addNodeMark\", pos: this.pos, mark: this.mark.toJSON() };\n }\n /**\n @internal\n */\n static fromJSON(schema, json) {\n if (typeof json.pos != \"number\")\n throw new RangeError(\"Invalid input for AddNodeMarkStep.fromJSON\");\n return new AddNodeMarkStep(json.pos, schema.markFromJSON(json.mark));\n }\n}\nStep.jsonID(\"addNodeMark\", AddNodeMarkStep);\n/**\nRemove a mark from a specific node.\n*/\nclass RemoveNodeMarkStep extends Step {\n /**\n Create a mark-removing step.\n */\n constructor(\n /**\n The position of the target node.\n */\n pos, \n /**\n The mark to remove.\n */\n mark) {\n super();\n this.pos = pos;\n this.mark = mark;\n }\n apply(doc) {\n let node = doc.nodeAt(this.pos);\n if (!node)\n return StepResult.fail(\"No node at mark step's position\");\n let updated = node.type.create(node.attrs, null, this.mark.removeFromSet(node.marks));\n return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment.from(updated), 0, node.isLeaf ? 0 : 1));\n }\n invert(doc) {\n let node = doc.nodeAt(this.pos);\n if (!node || !this.mark.isInSet(node.marks))\n return this;\n return new AddNodeMarkStep(this.pos, this.mark);\n }\n map(mapping) {\n let pos = mapping.mapResult(this.pos, 1);\n return pos.deletedAfter ? null : new RemoveNodeMarkStep(pos.pos, this.mark);\n }\n toJSON() {\n return { stepType: \"removeNodeMark\", pos: this.pos, mark: this.mark.toJSON() };\n }\n /**\n @internal\n */\n static fromJSON(schema, json) {\n if (typeof json.pos != \"number\")\n throw new RangeError(\"Invalid input for RemoveNodeMarkStep.fromJSON\");\n return new RemoveNodeMarkStep(json.pos, schema.markFromJSON(json.mark));\n }\n}\nStep.jsonID(\"removeNodeMark\", RemoveNodeMarkStep);\n\n/**\nReplace a part of the document with a slice of new content.\n*/\nclass ReplaceStep extends Step {\n /**\n The given `slice` should fit the 'gap' between `from` and\n `to`—the depths must line up, and the surrounding nodes must be\n able to be joined with the open sides of the slice. When\n `structure` is true, the step will fail if the content between\n from and to is not just a sequence of closing and then opening\n tokens (this is to guard against rebased replace steps\n overwriting something they weren't supposed to).\n */\n constructor(\n /**\n The start position of the replaced range.\n */\n from, \n /**\n The end position of the replaced range.\n */\n to, \n /**\n The slice to insert.\n */\n slice, \n /**\n @internal\n */\n structure = false) {\n super();\n this.from = from;\n this.to = to;\n this.slice = slice;\n this.structure = structure;\n }\n apply(doc) {\n if (this.structure && contentBetween(doc, this.from, this.to))\n return StepResult.fail(\"Structure replace would overwrite content\");\n return StepResult.fromReplace(doc, this.from, this.to, this.slice);\n }\n getMap() {\n return new StepMap([this.from, this.to - this.from, this.slice.size]);\n }\n invert(doc) {\n return new ReplaceStep(this.from, this.from + this.slice.size, doc.slice(this.from, this.to));\n }\n map(mapping) {\n let from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);\n if (from.deletedAcross && to.deletedAcross)\n return null;\n return new ReplaceStep(from.pos, Math.max(from.pos, to.pos), this.slice);\n }\n merge(other) {\n if (!(other instanceof ReplaceStep) || other.structure || this.structure)\n return null;\n if (this.from + this.slice.size == other.from && !this.slice.openEnd && !other.slice.openStart) {\n let slice = this.slice.size + other.slice.size == 0 ? Slice.empty\n : new Slice(this.slice.content.append(other.slice.content), this.slice.openStart, other.slice.openEnd);\n return new ReplaceStep(this.from, this.to + (other.to - other.from), slice, this.structure);\n }\n else if (other.to == this.from && !this.slice.openStart && !other.slice.openEnd) {\n let slice = this.slice.size + other.slice.size == 0 ? Slice.empty\n : new Slice(other.slice.content.append(this.slice.content), other.slice.openStart, this.slice.openEnd);\n return new ReplaceStep(other.from, this.to, slice, this.structure);\n }\n else {\n return null;\n }\n }\n toJSON() {\n let json = { stepType: \"replace\", from: this.from, to: this.to };\n if (this.slice.size)\n json.slice = this.slice.toJSON();\n if (this.structure)\n json.structure = true;\n return json;\n }\n /**\n @internal\n */\n static fromJSON(schema, json) {\n if (typeof json.from != \"number\" || typeof json.to != \"number\")\n throw new RangeError(\"Invalid input for ReplaceStep.fromJSON\");\n return new ReplaceStep(json.from, json.to, Slice.fromJSON(schema, json.slice), !!json.structure);\n }\n}\nStep.jsonID(\"replace\", ReplaceStep);\n/**\nReplace a part of the document with a slice of content, but\npreserve a range of the replaced content by moving it into the\nslice.\n*/\nclass ReplaceAroundStep extends Step {\n /**\n Create a replace-around step with the given range and gap.\n `insert` should be the point in the slice into which the content\n of the gap should be moved. `structure` has the same meaning as\n it has in the [`ReplaceStep`](https://prosemirror.net/docs/ref/#transform.ReplaceStep) class.\n */\n constructor(\n /**\n The start position of the replaced range.\n */\n from, \n /**\n The end position of the replaced range.\n */\n to, \n /**\n The start of preserved range.\n */\n gapFrom, \n /**\n The end of preserved range.\n */\n gapTo, \n /**\n The slice to insert.\n */\n slice, \n /**\n The position in the slice where the preserved range should be\n inserted.\n */\n insert, \n /**\n @internal\n */\n structure = false) {\n super();\n this.from = from;\n this.to = to;\n this.gapFrom = gapFrom;\n this.gapTo = gapTo;\n this.slice = slice;\n this.insert = insert;\n this.structure = structure;\n }\n apply(doc) {\n if (this.structure && (contentBetween(doc, this.from, this.gapFrom) ||\n contentBetween(doc, this.gapTo, this.to)))\n return StepResult.fail(\"Structure gap-replace would overwrite content\");\n let gap = doc.slice(this.gapFrom, this.gapTo);\n if (gap.openStart || gap.openEnd)\n return StepResult.fail(\"Gap is not a flat range\");\n let inserted = this.slice.insertAt(this.insert, gap.content);\n if (!inserted)\n return StepResult.fail(\"Content does not fit in gap\");\n return StepResult.fromReplace(doc, this.from, this.to, inserted);\n }\n getMap() {\n return new StepMap([this.from, this.gapFrom - this.from, this.insert,\n this.gapTo, this.to - this.gapTo, this.slice.size - this.insert]);\n }\n invert(doc) {\n let gap = this.gapTo - this.gapFrom;\n return new ReplaceAroundStep(this.from, this.from + this.slice.size + gap, this.from + this.insert, this.from + this.insert + gap, doc.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);\n }\n map(mapping) {\n let from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);\n let gapFrom = this.from == this.gapFrom ? from.pos : mapping.map(this.gapFrom, -1);\n let gapTo = this.to == this.gapTo ? to.pos : mapping.map(this.gapTo, 1);\n if ((from.deletedAcross && to.deletedAcross) || gapFrom < from.pos || gapTo > to.pos)\n return null;\n return new ReplaceAroundStep(from.pos, to.pos, gapFrom, gapTo, this.slice, this.insert, this.structure);\n }\n toJSON() {\n let json = { stepType: \"replaceAround\", from: this.from, to: this.to,\n gapFrom: this.gapFrom, gapTo: this.gapTo, insert: this.insert };\n if (this.slice.size)\n json.slice = this.slice.toJSON();\n if (this.structure)\n json.structure = true;\n return json;\n }\n /**\n @internal\n */\n static fromJSON(schema, json) {\n if (typeof json.from != \"number\" || typeof json.to != \"number\" ||\n typeof json.gapFrom != \"number\" || typeof json.gapTo != \"number\" || typeof json.insert != \"number\")\n throw new RangeError(\"Invalid input for ReplaceAroundStep.fromJSON\");\n return new ReplaceAroundStep(json.from, json.to, json.gapFrom, json.gapTo, Slice.fromJSON(schema, json.slice), json.insert, !!json.structure);\n }\n}\nStep.jsonID(\"replaceAround\", ReplaceAroundStep);\nfunction contentBetween(doc, from, to) {\n let $from = doc.resolve(from), dist = to - from, depth = $from.depth;\n while (dist > 0 && depth > 0 && $from.indexAfter(depth) == $from.node(depth).childCount) {\n depth--;\n dist--;\n }\n if (dist > 0) {\n let next = $from.node(depth).maybeChild($from.indexAfter(depth));\n while (dist > 0) {\n if (!next || next.isLeaf)\n return true;\n next = next.firstChild;\n dist--;\n }\n }\n return false;\n}\n\nfunction addMark(tr, from, to, mark) {\n let removed = [], added = [];\n let removing, adding;\n tr.doc.nodesBetween(from, to, (node, pos, parent) => {\n if (!node.isInline)\n return;\n let marks = node.marks;\n if (!mark.isInSet(marks) && parent.type.allowsMarkType(mark.type)) {\n let start = Math.max(pos, from), end = Math.min(pos + node.nodeSize, to);\n let newSet = mark.addToSet(marks);\n for (let i = 0; i < marks.length; i++) {\n if (!marks[i].isInSet(newSet)) {\n if (removing && removing.to == start && removing.mark.eq(marks[i]))\n removing.to = end;\n else\n removed.push(removing = new RemoveMarkStep(start, end, marks[i]));\n }\n }\n if (adding && adding.to == start)\n adding.to = end;\n else\n added.push(adding = new AddMarkStep(start, end, mark));\n }\n });\n removed.forEach(s => tr.step(s));\n added.forEach(s => tr.step(s));\n}\nfunction removeMark(tr, from, to, mark) {\n let matched = [], step = 0;\n tr.doc.nodesBetween(from, to, (node, pos) => {\n if (!node.isInline)\n return;\n step++;\n let toRemove = null;\n if (mark instanceof MarkType) {\n let set = node.marks, found;\n while (found = mark.isInSet(set)) {\n (toRemove || (toRemove = [])).push(found);\n set = found.removeFromSet(set);\n }\n }\n else if (mark) {\n if (mark.isInSet(node.marks))\n toRemove = [mark];\n }\n else {\n toRemove = node.marks;\n }\n if (toRemove && toRemove.length) {\n let end = Math.min(pos + node.nodeSize, to);\n for (let i = 0; i < toRemove.length; i++) {\n let style = toRemove[i], found;\n for (let j = 0; j < matched.length; j++) {\n let m = matched[j];\n if (m.step == step - 1 && style.eq(matched[j].style))\n found = m;\n }\n if (found) {\n found.to = end;\n found.step = step;\n }\n else {\n matched.push({ style, from: Math.max(pos, from), to: end, step });\n }\n }\n }\n });\n matched.forEach(m => tr.step(new RemoveMarkStep(m.from, m.to, m.style)));\n}\nfunction clearIncompatible(tr, pos, parentType, match = parentType.contentMatch, clearNewlines = true) {\n let node = tr.doc.nodeAt(pos);\n let replSteps = [], cur = pos + 1;\n for (let i = 0; i < node.childCount; i++) {\n let child = node.child(i), end = cur + child.nodeSize;\n let allowed = match.matchType(child.type);\n if (!allowed) {\n replSteps.push(new ReplaceStep(cur, end, Slice.empty));\n }\n else {\n match = allowed;\n for (let j = 0; j < child.marks.length; j++)\n if (!parentType.allowsMarkType(child.marks[j].type))\n tr.step(new RemoveMarkStep(cur, end, child.marks[j]));\n if (clearNewlines && child.isText && parentType.whitespace != \"pre\") {\n let m, newline = /\\r?\\n|\\r/g, slice;\n while (m = newline.exec(child.text)) {\n if (!slice)\n slice = new Slice(Fragment.from(parentType.schema.text(\" \", parentType.allowedMarks(child.marks))), 0, 0);\n replSteps.push(new ReplaceStep(cur + m.index, cur + m.index + m[0].length, slice));\n }\n }\n }\n cur = end;\n }\n if (!match.validEnd) {\n let fill = match.fillBefore(Fragment.empty, true);\n tr.replace(cur, cur, new Slice(fill, 0, 0));\n }\n for (let i = replSteps.length - 1; i >= 0; i--)\n tr.step(replSteps[i]);\n}\n\nfunction canCut(node, start, end) {\n return (start == 0 || node.canReplace(start, node.childCount)) &&\n (end == node.childCount || node.canReplace(0, end));\n}\n/**\nTry to find a target depth to which the content in the given range\ncan be lifted. Will not go across\n[isolating](https://prosemirror.net/docs/ref/#model.NodeSpec.isolating) parent nodes.\n*/\nfunction liftTarget(range) {\n let parent = range.parent;\n let content = parent.content.cutByIndex(range.startIndex, range.endIndex);\n for (let depth = range.depth;; --depth) {\n let node = range.$from.node(depth);\n let index = range.$from.index(depth), endIndex = range.$to.indexAfter(depth);\n if (depth < range.depth && node.canReplace(index, endIndex, content))\n return depth;\n if (depth == 0 || node.type.spec.isolating || !canCut(node, index, endIndex))\n break;\n }\n return null;\n}\nfunction lift(tr, range, target) {\n let { $from, $to, depth } = range;\n let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);\n let start = gapStart, end = gapEnd;\n let before = Fragment.empty, openStart = 0;\n for (let d = depth, splitting = false; d > target; d--)\n if (splitting || $from.index(d) > 0) {\n splitting = true;\n before = Fragment.from($from.node(d).copy(before));\n openStart++;\n }\n else {\n start--;\n }\n let after = Fragment.empty, openEnd = 0;\n for (let d = depth, splitting = false; d > target; d--)\n if (splitting || $to.after(d + 1) < $to.end(d)) {\n splitting = true;\n after = Fragment.from($to.node(d).copy(after));\n openEnd++;\n }\n else {\n end++;\n }\n tr.step(new ReplaceAroundStep(start, end, gapStart, gapEnd, new Slice(before.append(after), openStart, openEnd), before.size - openStart, true));\n}\n/**\nTry to find a valid way to wrap the content in the given range in a\nnode of the given type. May introduce extra nodes around and inside\nthe wrapper node, if necessary. Returns null if no valid wrapping\ncould be found. When `innerRange` is given, that range's content is\nused as the content to fit into the wrapping, instead of the\ncontent of `range`.\n*/\nfunction findWrapping(range, nodeType, attrs = null, innerRange = range) {\n let around = findWrappingOutside(range, nodeType);\n let inner = around && findWrappingInside(innerRange, nodeType);\n if (!inner)\n return null;\n return around.map(withAttrs)\n .concat({ type: nodeType, attrs }).concat(inner.map(withAttrs));\n}\nfunction withAttrs(type) { return { type, attrs: null }; }\nfunction findWrappingOutside(range, type) {\n let { parent, startIndex, endIndex } = range;\n let around = parent.contentMatchAt(startIndex).findWrapping(type);\n if (!around)\n return null;\n let outer = around.length ? around[0] : type;\n return parent.canReplaceWith(startIndex, endIndex, outer) ? around : null;\n}\nfunction findWrappingInside(range, type) {\n let { parent, startIndex, endIndex } = range;\n let inner = parent.child(startIndex);\n let inside = type.contentMatch.findWrapping(inner.type);\n if (!inside)\n return null;\n let lastType = inside.length ? inside[inside.length - 1] : type;\n let innerMatch = lastType.contentMatch;\n for (let i = startIndex; innerMatch && i < endIndex; i++)\n innerMatch = innerMatch.matchType(parent.child(i).type);\n if (!innerMatch || !innerMatch.validEnd)\n return null;\n return inside;\n}\nfunction wrap(tr, range, wrappers) {\n let content = Fragment.empty;\n for (let i = wrappers.length - 1; i >= 0; i--) {\n if (content.size) {\n let match = wrappers[i].type.contentMatch.matchFragment(content);\n if (!match || !match.validEnd)\n throw new RangeError(\"Wrapper type given to Transform.wrap does not form valid content of its parent wrapper\");\n }\n content = Fragment.from(wrappers[i].type.create(wrappers[i].attrs, content));\n }\n let start = range.start, end = range.end;\n tr.step(new ReplaceAroundStep(start, end, start, end, new Slice(content, 0, 0), wrappers.length, true));\n}\nfunction setBlockType(tr, from, to, type, attrs) {\n if (!type.isTextblock)\n throw new RangeError(\"Type given to setBlockType should be a textblock\");\n let mapFrom = tr.steps.length;\n tr.doc.nodesBetween(from, to, (node, pos) => {\n let attrsHere = typeof attrs == \"function\" ? attrs(node) : attrs;\n if (node.isTextblock && !node.hasMarkup(type, attrsHere) &&\n canChangeType(tr.doc, tr.mapping.slice(mapFrom).map(pos), type)) {\n let convertNewlines = null;\n if (type.schema.linebreakReplacement) {\n let pre = type.whitespace == \"pre\", supportLinebreak = !!type.contentMatch.matchType(type.schema.linebreakReplacement);\n if (pre && !supportLinebreak)\n convertNewlines = false;\n else if (!pre && supportLinebreak)\n convertNewlines = true;\n }\n // Ensure all markup that isn't allowed in the new node type is cleared\n if (convertNewlines === false)\n replaceLinebreaks(tr, node, pos, mapFrom);\n clearIncompatible(tr, tr.mapping.slice(mapFrom).map(pos, 1), type, undefined, convertNewlines === null);\n let mapping = tr.mapping.slice(mapFrom);\n let startM = mapping.map(pos, 1), endM = mapping.map(pos + node.nodeSize, 1);\n tr.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));\n if (convertNewlines === true)\n replaceNewlines(tr, node, pos, mapFrom);\n return false;\n }\n });\n}\nfunction replaceNewlines(tr, node, pos, mapFrom) {\n node.forEach((child, offset) => {\n if (child.isText) {\n let m, newline = /\\r?\\n|\\r/g;\n while (m = newline.exec(child.text)) {\n let start = tr.mapping.slice(mapFrom).map(pos + 1 + offset + m.index);\n tr.replaceWith(start, start + 1, node.type.schema.linebreakReplacement.create());\n }\n }\n });\n}\nfunction replaceLinebreaks(tr, node, pos, mapFrom) {\n node.forEach((child, offset) => {\n if (child.type == child.type.schema.linebreakReplacement) {\n let start = tr.mapping.slice(mapFrom).map(pos + 1 + offset);\n tr.replaceWith(start, start + 1, node.type.schema.text(\"\\n\"));\n }\n });\n}\nfunction canChangeType(doc, pos, type) {\n let $pos = doc.resolve(pos), index = $pos.index();\n return $pos.parent.canReplaceWith(index, index + 1, type);\n}\n/**\nChange the type, attributes, and/or marks of the node at `pos`.\nWhen `type` isn't given, the existing node type is preserved,\n*/\nfunction setNodeMarkup(tr, pos, type, attrs, marks) {\n let node = tr.doc.nodeAt(pos);\n if (!node)\n throw new RangeError(\"No node at given position\");\n if (!type)\n type = node.type;\n let newNode = type.create(attrs, null, marks || node.marks);\n if (node.isLeaf)\n return tr.replaceWith(pos, pos + node.nodeSize, newNode);\n if (!type.validContent(node.content))\n throw new RangeError(\"Invalid content for node type \" + type.name);\n tr.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment.from(newNode), 0, 0), 1, true));\n}\n/**\nCheck whether splitting at the given position is allowed.\n*/\nfunction canSplit(doc, pos, depth = 1, typesAfter) {\n let $pos = doc.resolve(pos), base = $pos.depth - depth;\n let innerType = (typesAfter && typesAfter[typesAfter.length - 1]) || $pos.parent;\n if (base < 0 || $pos.parent.type.spec.isolating ||\n !$pos.parent.canReplace($pos.index(), $pos.parent.childCount) ||\n !innerType.type.validContent($pos.parent.content.cutByIndex($pos.index(), $pos.parent.childCount)))\n return false;\n for (let d = $pos.depth - 1, i = depth - 2; d > base; d--, i--) {\n let node = $pos.node(d), index = $pos.index(d);\n if (node.type.spec.isolating)\n return false;\n let rest = node.content.cutByIndex(index, node.childCount);\n let overrideChild = typesAfter && typesAfter[i + 1];\n if (overrideChild)\n rest = rest.replaceChild(0, overrideChild.type.create(overrideChild.attrs));\n let after = (typesAfter && typesAfter[i]) || node;\n if (!node.canReplace(index + 1, node.childCount) || !after.type.validContent(rest))\n return false;\n }\n let index = $pos.indexAfter(base);\n let baseType = typesAfter && typesAfter[0];\n return $pos.node(base).canReplaceWith(index, index, baseType ? baseType.type : $pos.node(base + 1).type);\n}\nfunction split(tr, pos, depth = 1, typesAfter) {\n let $pos = tr.doc.resolve(pos), before = Fragment.empty, after = Fragment.empty;\n for (let d = $pos.depth, e = $pos.depth - depth, i = depth - 1; d > e; d--, i--) {\n before = Fragment.from($pos.node(d).copy(before));\n let typeAfter = typesAfter && typesAfter[i];\n after = Fragment.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));\n }\n tr.step(new ReplaceStep(pos, pos, new Slice(before.append(after), depth, depth), true));\n}\n/**\nTest whether the blocks before and after a given position can be\njoined.\n*/\nfunction canJoin(doc, pos) {\n let $pos = doc.resolve(pos), index = $pos.index();\n return joinable($pos.nodeBefore, $pos.nodeAfter) &&\n $pos.parent.canReplace(index, index + 1);\n}\nfunction canAppendWithSubstitutedLinebreaks(a, b) {\n if (!b.content.size)\n a.type.compatibleContent(b.type);\n let match = a.contentMatchAt(a.childCount);\n let { linebreakReplacement } = a.type.schema;\n for (let i = 0; i < b.childCount; i++) {\n let child = b.child(i);\n let type = child.type == linebreakReplacement ? a.type.schema.nodes.text : child.type;\n match = match.matchType(type);\n if (!match)\n return false;\n if (!a.type.allowsMarks(child.marks))\n return false;\n }\n return match.validEnd;\n}\nfunction joinable(a, b) {\n return !!(a && b && !a.isLeaf && canAppendWithSubstitutedLinebreaks(a, b));\n}\n/**\nFind an ancestor of the given position that can be joined to the\nblock before (or after if `dir` is positive). Returns the joinable\npoint, if any.\n*/\nfunction joinPoint(doc, pos, dir = -1) {\n let $pos = doc.resolve(pos);\n for (let d = $pos.depth;; d--) {\n let before, after, index = $pos.index(d);\n if (d == $pos.depth) {\n before = $pos.nodeBefore;\n after = $pos.nodeAfter;\n }\n else if (dir > 0) {\n before = $pos.node(d + 1);\n index++;\n after = $pos.node(d).maybeChild(index);\n }\n else {\n before = $pos.node(d).maybeChild(index - 1);\n after = $pos.node(d + 1);\n }\n if (before && !before.isTextblock && joinable(before, after) &&\n $pos.node(d).canReplace(index, index + 1))\n return pos;\n if (d == 0)\n break;\n pos = dir < 0 ? $pos.before(d) : $pos.after(d);\n }\n}\nfunction join(tr, pos, depth) {\n let convertNewlines = null;\n let { linebreakReplacement } = tr.doc.type.schema;\n let $before = tr.doc.resolve(pos - depth), beforeType = $before.node().type;\n if (linebreakReplacement && beforeType.inlineContent) {\n let pre = beforeType.whitespace == \"pre\";\n let supportLinebreak = !!beforeType.contentMatch.matchType(linebreakReplacement);\n if (pre && !supportLinebreak)\n convertNewlines = false;\n else if (!pre && supportLinebreak)\n convertNewlines = true;\n }\n let mapFrom = tr.steps.length;\n if (convertNewlines === false) {\n let $after = tr.doc.resolve(pos + depth);\n replaceLinebreaks(tr, $after.node(), $after.before(), mapFrom);\n }\n if (beforeType.inlineContent)\n clearIncompatible(tr, pos + depth - 1, beforeType, $before.node().contentMatchAt($before.index()), convertNewlines == null);\n let mapping = tr.mapping.slice(mapFrom), start = mapping.map(pos - depth);\n tr.step(new ReplaceStep(start, mapping.map(pos + depth, -1), Slice.empty, true));\n if (convertNewlines === true) {\n let $full = tr.doc.resolve(start);\n replaceNewlines(tr, $full.node(), $full.before(), tr.steps.length);\n }\n return tr;\n}\n/**\nTry to find a point where a node of the given type can be inserted\nnear `pos`, by searching up the node hierarchy when `pos` itself\nisn't a valid place but is at the start or end of a node. Return\nnull if no position was found.\n*/\nfunction insertPoint(doc, pos, nodeType) {\n let $pos = doc.resolve(pos);\n if ($pos.parent.canReplaceWith($pos.index(), $pos.index(), nodeType))\n return pos;\n if ($pos.parentOffset == 0)\n for (let d = $pos.depth - 1; d >= 0; d--) {\n let index = $pos.index(d);\n if ($pos.node(d).canReplaceWith(index, index, nodeType))\n return $pos.before(d + 1);\n if (index > 0)\n return null;\n }\n if ($pos.parentOffset == $pos.parent.content.size)\n for (let d = $pos.depth - 1; d >= 0; d--) {\n let index = $pos.indexAfter(d);\n if ($pos.node(d).canReplaceWith(index, index, nodeType))\n return $pos.after(d + 1);\n if (index < $pos.node(d).childCount)\n return null;\n }\n return null;\n}\n/**\nFinds a position at or around the given position where the given\nslice can be inserted. Will look at parent nodes' nearest boundary\nand try there, even if the original position wasn't directly at the\nstart or end of that node. Returns null when no position was found.\n*/\nfunction dropPoint(doc, pos, slice) {\n let $pos = doc.resolve(pos);\n if (!slice.content.size)\n return pos;\n let content = slice.content;\n for (let i = 0; i < slice.openStart; i++)\n content = content.firstChild.content;\n for (let pass = 1; pass <= (slice.openStart == 0 && slice.size ? 2 : 1); pass++) {\n for (let d = $pos.depth; d >= 0; d--) {\n let bias = d == $pos.depth ? 0 : $pos.pos <= ($pos.start(d + 1) + $pos.end(d + 1)) / 2 ? -1 : 1;\n let insertPos = $pos.index(d) + (bias > 0 ? 1 : 0);\n let parent = $pos.node(d), fits = false;\n if (pass == 1) {\n fits = parent.canReplace(insertPos, insertPos, content);\n }\n else {\n let wrapping = parent.contentMatchAt(insertPos).findWrapping(content.firstChild.type);\n fits = wrapping && parent.canReplaceWith(insertPos, insertPos, wrapping[0]);\n }\n if (fits)\n return bias == 0 ? $pos.pos : bias < 0 ? $pos.before(d + 1) : $pos.after(d + 1);\n }\n }\n return null;\n}\n\n/**\n‘Fit’ a slice into a given position in the document, producing a\n[step](https://prosemirror.net/docs/ref/#transform.Step) that inserts it. Will return null if\nthere's no meaningful way to insert the slice here, or inserting it\nwould be a no-op (an empty slice over an empty range).\n*/\nfunction replaceStep(doc, from, to = from, slice = Slice.empty) {\n if (from == to && !slice.size)\n return null;\n let $from = doc.resolve(from), $to = doc.resolve(to);\n // Optimization -- avoid work if it's obvious that it's not needed.\n if (fitsTrivially($from, $to, slice))\n return new ReplaceStep(from, to, slice);\n return new Fitter($from, $to, slice).fit();\n}\nfunction fitsTrivially($from, $to, slice) {\n return !slice.openStart && !slice.openEnd && $from.start() == $to.start() &&\n $from.parent.canReplace($from.index(), $to.index(), slice.content);\n}\n// Algorithm for 'placing' the elements of a slice into a gap:\n//\n// We consider the content of each node that is open to the left to be\n// independently placeable. I.e. in , when the\n// paragraph on the left is open, \"foo\" can be placed (somewhere on\n// the left side of the replacement gap) independently from p(\"bar\").\n//\n// This class tracks the state of the placement progress in the\n// following properties:\n//\n// - `frontier` holds a stack of `{type, match}` objects that\n// represent the open side of the replacement. It starts at\n// `$from`, then moves forward as content is placed, and is finally\n// reconciled with `$to`.\n//\n// - `unplaced` is a slice that represents the content that hasn't\n// been placed yet.\n//\n// - `placed` is a fragment of placed content. Its open-start value\n// is implicit in `$from`, and its open-end value in `frontier`.\nclass Fitter {\n constructor($from, $to, unplaced) {\n this.$from = $from;\n this.$to = $to;\n this.unplaced = unplaced;\n this.frontier = [];\n this.placed = Fragment.empty;\n for (let i = 0; i <= $from.depth; i++) {\n let node = $from.node(i);\n this.frontier.push({\n type: node.type,\n match: node.contentMatchAt($from.indexAfter(i))\n });\n }\n for (let i = $from.depth; i > 0; i--)\n this.placed = Fragment.from($from.node(i).copy(this.placed));\n }\n get depth() { return this.frontier.length - 1; }\n fit() {\n // As long as there's unplaced content, try to place some of it.\n // If that fails, either increase the open score of the unplaced\n // slice, or drop nodes from it, and then try again.\n while (this.unplaced.size) {\n let fit = this.findFittable();\n if (fit)\n this.placeNodes(fit);\n else\n this.openMore() || this.dropNode();\n }\n // When there's inline content directly after the frontier _and_\n // directly after `this.$to`, we must generate a `ReplaceAround`\n // step that pulls that content into the node after the frontier.\n // That means the fitting must be done to the end of the textblock\n // node after `this.$to`, not `this.$to` itself.\n let moveInline = this.mustMoveInline(), placedSize = this.placed.size - this.depth - this.$from.depth;\n let $from = this.$from, $to = this.close(moveInline < 0 ? this.$to : $from.doc.resolve(moveInline));\n if (!$to)\n return null;\n // If closing to `$to` succeeded, create a step\n let content = this.placed, openStart = $from.depth, openEnd = $to.depth;\n while (openStart && openEnd && content.childCount == 1) { // Normalize by dropping open parent nodes\n content = content.firstChild.content;\n openStart--;\n openEnd--;\n }\n let slice = new Slice(content, openStart, openEnd);\n if (moveInline > -1)\n return new ReplaceAroundStep($from.pos, moveInline, this.$to.pos, this.$to.end(), slice, placedSize);\n if (slice.size || $from.pos != this.$to.pos) // Don't generate no-op steps\n return new ReplaceStep($from.pos, $to.pos, slice);\n return null;\n }\n // Find a position on the start spine of `this.unplaced` that has\n // content that can be moved somewhere on the frontier. Returns two\n // depths, one for the slice and one for the frontier.\n findFittable() {\n let startDepth = this.unplaced.openStart;\n for (let cur = this.unplaced.content, d = 0, openEnd = this.unplaced.openEnd; d < startDepth; d++) {\n let node = cur.firstChild;\n if (cur.childCount > 1)\n openEnd = 0;\n if (node.type.spec.isolating && openEnd <= d) {\n startDepth = d;\n break;\n }\n cur = node.content;\n }\n // Only try wrapping nodes (pass 2) after finding a place without\n // wrapping failed.\n for (let pass = 1; pass <= 2; pass++) {\n for (let sliceDepth = pass == 1 ? startDepth : this.unplaced.openStart; sliceDepth >= 0; sliceDepth--) {\n let fragment, parent = null;\n if (sliceDepth) {\n parent = contentAt(this.unplaced.content, sliceDepth - 1).firstChild;\n fragment = parent.content;\n }\n else {\n fragment = this.unplaced.content;\n }\n let first = fragment.firstChild;\n for (let frontierDepth = this.depth; frontierDepth >= 0; frontierDepth--) {\n let { type, match } = this.frontier[frontierDepth], wrap, inject = null;\n // In pass 1, if the next node matches, or there is no next\n // node but the parents look compatible, we've found a\n // place.\n if (pass == 1 && (first ? match.matchType(first.type) || (inject = match.fillBefore(Fragment.from(first), false))\n : parent && type.compatibleContent(parent.type)))\n return { sliceDepth, frontierDepth, parent, inject };\n // In pass 2, look for a set of wrapping nodes that make\n // `first` fit here.\n else if (pass == 2 && first && (wrap = match.findWrapping(first.type)))\n return { sliceDepth, frontierDepth, parent, wrap };\n // Don't continue looking further up if the parent node\n // would fit here.\n if (parent && match.matchType(parent.type))\n break;\n }\n }\n }\n }\n openMore() {\n let { content, openStart, openEnd } = this.unplaced;\n let inner = contentAt(content, openStart);\n if (!inner.childCount || inner.firstChild.isLeaf)\n return false;\n this.unplaced = new Slice(content, openStart + 1, Math.max(openEnd, inner.size + openStart >= content.size - openEnd ? openStart + 1 : 0));\n return true;\n }\n dropNode() {\n let { content, openStart, openEnd } = this.unplaced;\n let inner = contentAt(content, openStart);\n if (inner.childCount <= 1 && openStart > 0) {\n let openAtEnd = content.size - openStart <= openStart + inner.size;\n this.unplaced = new Slice(dropFromFragment(content, openStart - 1, 1), openStart - 1, openAtEnd ? openStart - 1 : openEnd);\n }\n else {\n this.unplaced = new Slice(dropFromFragment(content, openStart, 1), openStart, openEnd);\n }\n }\n // Move content from the unplaced slice at `sliceDepth` to the\n // frontier node at `frontierDepth`. Close that frontier node when\n // applicable.\n placeNodes({ sliceDepth, frontierDepth, parent, inject, wrap }) {\n while (this.depth > frontierDepth)\n this.closeFrontierNode();\n if (wrap)\n for (let i = 0; i < wrap.length; i++)\n this.openFrontierNode(wrap[i]);\n let slice = this.unplaced, fragment = parent ? parent.content : slice.content;\n let openStart = slice.openStart - sliceDepth;\n let taken = 0, add = [];\n let { match, type } = this.frontier[frontierDepth];\n if (inject) {\n for (let i = 0; i < inject.childCount; i++)\n add.push(inject.child(i));\n match = match.matchFragment(inject);\n }\n // Computes the amount of (end) open nodes at the end of the\n // fragment. When 0, the parent is open, but no more. When\n // negative, nothing is open.\n let openEndCount = (fragment.size + sliceDepth) - (slice.content.size - slice.openEnd);\n // Scan over the fragment, fitting as many child nodes as\n // possible.\n while (taken < fragment.childCount) {\n let next = fragment.child(taken), matches = match.matchType(next.type);\n if (!matches)\n break;\n taken++;\n if (taken > 1 || openStart == 0 || next.content.size) { // Drop empty open nodes\n match = matches;\n add.push(closeNodeStart(next.mark(type.allowedMarks(next.marks)), taken == 1 ? openStart : 0, taken == fragment.childCount ? openEndCount : -1));\n }\n }\n let toEnd = taken == fragment.childCount;\n if (!toEnd)\n openEndCount = -1;\n this.placed = addToFragment(this.placed, frontierDepth, Fragment.from(add));\n this.frontier[frontierDepth].match = match;\n // If the parent types match, and the entire node was moved, and\n // it's not open, close this frontier node right away.\n if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1)\n this.closeFrontierNode();\n // Add new frontier nodes for any open nodes at the end.\n for (let i = 0, cur = fragment; i < openEndCount; i++) {\n let node = cur.lastChild;\n this.frontier.push({ type: node.type, match: node.contentMatchAt(node.childCount) });\n cur = node.content;\n }\n // Update `this.unplaced`. Drop the entire node from which we\n // placed it we got to its end, otherwise just drop the placed\n // nodes.\n this.unplaced = !toEnd ? new Slice(dropFromFragment(slice.content, sliceDepth, taken), slice.openStart, slice.openEnd)\n : sliceDepth == 0 ? Slice.empty\n : new Slice(dropFromFragment(slice.content, sliceDepth - 1, 1), sliceDepth - 1, openEndCount < 0 ? slice.openEnd : sliceDepth - 1);\n }\n mustMoveInline() {\n if (!this.$to.parent.isTextblock)\n return -1;\n let top = this.frontier[this.depth], level;\n if (!top.type.isTextblock || !contentAfterFits(this.$to, this.$to.depth, top.type, top.match, false) ||\n (this.$to.depth == this.depth && (level = this.findCloseLevel(this.$to)) && level.depth == this.depth))\n return -1;\n let { depth } = this.$to, after = this.$to.after(depth);\n while (depth > 1 && after == this.$to.end(--depth))\n ++after;\n return after;\n }\n findCloseLevel($to) {\n scan: for (let i = Math.min(this.depth, $to.depth); i >= 0; i--) {\n let { match, type } = this.frontier[i];\n let dropInner = i < $to.depth && $to.end(i + 1) == $to.pos + ($to.depth - (i + 1));\n let fit = contentAfterFits($to, i, type, match, dropInner);\n if (!fit)\n continue;\n for (let d = i - 1; d >= 0; d--) {\n let { match, type } = this.frontier[d];\n let matches = contentAfterFits($to, d, type, match, true);\n if (!matches || matches.childCount)\n continue scan;\n }\n return { depth: i, fit, move: dropInner ? $to.doc.resolve($to.after(i + 1)) : $to };\n }\n }\n close($to) {\n let close = this.findCloseLevel($to);\n if (!close)\n return null;\n while (this.depth > close.depth)\n this.closeFrontierNode();\n if (close.fit.childCount)\n this.placed = addToFragment(this.placed, close.depth, close.fit);\n $to = close.move;\n for (let d = close.depth + 1; d <= $to.depth; d++) {\n let node = $to.node(d), add = node.type.contentMatch.fillBefore(node.content, true, $to.index(d));\n this.openFrontierNode(node.type, node.attrs, add);\n }\n return $to;\n }\n openFrontierNode(type, attrs = null, content) {\n let top = this.frontier[this.depth];\n top.match = top.match.matchType(type);\n this.placed = addToFragment(this.placed, this.depth, Fragment.from(type.create(attrs, content)));\n this.frontier.push({ type, match: type.contentMatch });\n }\n closeFrontierNode() {\n let open = this.frontier.pop();\n let add = open.match.fillBefore(Fragment.empty, true);\n if (add.childCount)\n this.placed = addToFragment(this.placed, this.frontier.length, add);\n }\n}\nfunction dropFromFragment(fragment, depth, count) {\n if (depth == 0)\n return fragment.cutByIndex(count, fragment.childCount);\n return fragment.replaceChild(0, fragment.firstChild.copy(dropFromFragment(fragment.firstChild.content, depth - 1, count)));\n}\nfunction addToFragment(fragment, depth, content) {\n if (depth == 0)\n return fragment.append(content);\n return fragment.replaceChild(fragment.childCount - 1, fragment.lastChild.copy(addToFragment(fragment.lastChild.content, depth - 1, content)));\n}\nfunction contentAt(fragment, depth) {\n for (let i = 0; i < depth; i++)\n fragment = fragment.firstChild.content;\n return fragment;\n}\nfunction closeNodeStart(node, openStart, openEnd) {\n if (openStart <= 0)\n return node;\n let frag = node.content;\n if (openStart > 1)\n frag = frag.replaceChild(0, closeNodeStart(frag.firstChild, openStart - 1, frag.childCount == 1 ? openEnd - 1 : 0));\n if (openStart > 0) {\n frag = node.type.contentMatch.fillBefore(frag).append(frag);\n if (openEnd <= 0)\n frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment.empty, true));\n }\n return node.copy(frag);\n}\nfunction contentAfterFits($to, depth, type, match, open) {\n let node = $to.node(depth), index = open ? $to.indexAfter(depth) : $to.index(depth);\n if (index == node.childCount && !type.compatibleContent(node.type))\n return null;\n let fit = match.fillBefore(node.content, true, index);\n return fit && !invalidMarks(type, node.content, index) ? fit : null;\n}\nfunction invalidMarks(type, fragment, start) {\n for (let i = start; i < fragment.childCount; i++)\n if (!type.allowsMarks(fragment.child(i).marks))\n return true;\n return false;\n}\nfunction definesContent(type) {\n return type.spec.defining || type.spec.definingForContent;\n}\nfunction replaceRange(tr, from, to, slice) {\n if (!slice.size)\n return tr.deleteRange(from, to);\n let $from = tr.doc.resolve(from), $to = tr.doc.resolve(to);\n if (fitsTrivially($from, $to, slice))\n return tr.step(new ReplaceStep(from, to, slice));\n let targetDepths = coveredDepths($from, tr.doc.resolve(to));\n // Can't replace the whole document, so remove 0 if it's present\n if (targetDepths[targetDepths.length - 1] == 0)\n targetDepths.pop();\n // Negative numbers represent not expansion over the whole node at\n // that depth, but replacing from $from.before(-D) to $to.pos.\n let preferredTarget = -($from.depth + 1);\n targetDepths.unshift(preferredTarget);\n // This loop picks a preferred target depth, if one of the covering\n // depths is not outside of a defining node, and adds negative\n // depths for any depth that has $from at its start and does not\n // cross a defining node.\n for (let d = $from.depth, pos = $from.pos - 1; d > 0; d--, pos--) {\n let spec = $from.node(d).type.spec;\n if (spec.defining || spec.definingAsContext || spec.isolating)\n break;\n if (targetDepths.indexOf(d) > -1)\n preferredTarget = d;\n else if ($from.before(d) == pos)\n targetDepths.splice(1, 0, -d);\n }\n // Try to fit each possible depth of the slice into each possible\n // target depth, starting with the preferred depths.\n let preferredTargetIndex = targetDepths.indexOf(preferredTarget);\n let leftNodes = [], preferredDepth = slice.openStart;\n for (let content = slice.content, i = 0;; i++) {\n let node = content.firstChild;\n leftNodes.push(node);\n if (i == slice.openStart)\n break;\n content = node.content;\n }\n // Back up preferredDepth to cover defining textblocks directly\n // above it, possibly skipping a non-defining textblock.\n for (let d = preferredDepth - 1; d >= 0; d--) {\n let leftNode = leftNodes[d], def = definesContent(leftNode.type);\n if (def && !leftNode.sameMarkup($from.node(Math.abs(preferredTarget) - 1)))\n preferredDepth = d;\n else if (def || !leftNode.type.isTextblock)\n break;\n }\n for (let j = slice.openStart; j >= 0; j--) {\n let openDepth = (j + preferredDepth + 1) % (slice.openStart + 1);\n let insert = leftNodes[openDepth];\n if (!insert)\n continue;\n for (let i = 0; i < targetDepths.length; i++) {\n // Loop over possible expansion levels, starting with the\n // preferred one\n let targetDepth = targetDepths[(i + preferredTargetIndex) % targetDepths.length], expand = true;\n if (targetDepth < 0) {\n expand = false;\n targetDepth = -targetDepth;\n }\n let parent = $from.node(targetDepth - 1), index = $from.index(targetDepth - 1);\n if (parent.canReplaceWith(index, index, insert.type, insert.marks))\n return tr.replace($from.before(targetDepth), expand ? $to.after(targetDepth) : to, new Slice(closeFragment(slice.content, 0, slice.openStart, openDepth), openDepth, slice.openEnd));\n }\n }\n let startSteps = tr.steps.length;\n for (let i = targetDepths.length - 1; i >= 0; i--) {\n tr.replace(from, to, slice);\n if (tr.steps.length > startSteps)\n break;\n let depth = targetDepths[i];\n if (depth < 0)\n continue;\n from = $from.before(depth);\n to = $to.after(depth);\n }\n}\nfunction closeFragment(fragment, depth, oldOpen, newOpen, parent) {\n if (depth < oldOpen) {\n let first = fragment.firstChild;\n fragment = fragment.replaceChild(0, first.copy(closeFragment(first.content, depth + 1, oldOpen, newOpen, first)));\n }\n if (depth > newOpen) {\n let match = parent.contentMatchAt(0);\n let start = match.fillBefore(fragment).append(fragment);\n fragment = start.append(match.matchFragment(start).fillBefore(Fragment.empty, true));\n }\n return fragment;\n}\nfunction replaceRangeWith(tr, from, to, node) {\n if (!node.isInline && from == to && tr.doc.resolve(from).parent.content.size) {\n let point = insertPoint(tr.doc, from, node.type);\n if (point != null)\n from = to = point;\n }\n tr.replaceRange(from, to, new Slice(Fragment.from(node), 0, 0));\n}\nfunction deleteRange(tr, from, to) {\n let $from = tr.doc.resolve(from), $to = tr.doc.resolve(to);\n let covered = coveredDepths($from, $to);\n for (let i = 0; i < covered.length; i++) {\n let depth = covered[i], last = i == covered.length - 1;\n if ((last && depth == 0) || $from.node(depth).type.contentMatch.validEnd)\n return tr.delete($from.start(depth), $to.end(depth));\n if (depth > 0 && (last || $from.node(depth - 1).canReplace($from.index(depth - 1), $to.indexAfter(depth - 1))))\n return tr.delete($from.before(depth), $to.after(depth));\n }\n for (let d = 1; d <= $from.depth && d <= $to.depth; d++) {\n if (from - $from.start(d) == $from.depth - d && to > $from.end(d) && $to.end(d) - to != $to.depth - d &&\n $from.start(d - 1) == $to.start(d - 1) && $from.node(d - 1).canReplace($from.index(d - 1), $to.index(d - 1)))\n return tr.delete($from.before(d), to);\n }\n tr.delete(from, to);\n}\n// Returns an array of all depths for which $from - $to spans the\n// whole content of the nodes at that depth.\nfunction coveredDepths($from, $to) {\n let result = [], minDepth = Math.min($from.depth, $to.depth);\n for (let d = minDepth; d >= 0; d--) {\n let start = $from.start(d);\n if (start < $from.pos - ($from.depth - d) ||\n $to.end(d) > $to.pos + ($to.depth - d) ||\n $from.node(d).type.spec.isolating ||\n $to.node(d).type.spec.isolating)\n break;\n if (start == $to.start(d) ||\n (d == $from.depth && d == $to.depth && $from.parent.inlineContent && $to.parent.inlineContent &&\n d && $to.start(d - 1) == start - 1))\n result.push(d);\n }\n return result;\n}\n\n/**\nUpdate an attribute in a specific node.\n*/\nclass AttrStep extends Step {\n /**\n Construct an attribute step.\n */\n constructor(\n /**\n The position of the target node.\n */\n pos, \n /**\n The attribute to set.\n */\n attr, \n // The attribute's new value.\n value) {\n super();\n this.pos = pos;\n this.attr = attr;\n this.value = value;\n }\n apply(doc) {\n let node = doc.nodeAt(this.pos);\n if (!node)\n return StepResult.fail(\"No node at attribute step's position\");\n let attrs = Object.create(null);\n for (let name in node.attrs)\n attrs[name] = node.attrs[name];\n attrs[this.attr] = this.value;\n let updated = node.type.create(attrs, null, node.marks);\n return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment.from(updated), 0, node.isLeaf ? 0 : 1));\n }\n getMap() {\n return StepMap.empty;\n }\n invert(doc) {\n return new AttrStep(this.pos, this.attr, doc.nodeAt(this.pos).attrs[this.attr]);\n }\n map(mapping) {\n let pos = mapping.mapResult(this.pos, 1);\n return pos.deletedAfter ? null : new AttrStep(pos.pos, this.attr, this.value);\n }\n toJSON() {\n return { stepType: \"attr\", pos: this.pos, attr: this.attr, value: this.value };\n }\n static fromJSON(schema, json) {\n if (typeof json.pos != \"number\" || typeof json.attr != \"string\")\n throw new RangeError(\"Invalid input for AttrStep.fromJSON\");\n return new AttrStep(json.pos, json.attr, json.value);\n }\n}\nStep.jsonID(\"attr\", AttrStep);\n/**\nUpdate an attribute in the doc node.\n*/\nclass DocAttrStep extends Step {\n /**\n Construct an attribute step.\n */\n constructor(\n /**\n The attribute to set.\n */\n attr, \n // The attribute's new value.\n value) {\n super();\n this.attr = attr;\n this.value = value;\n }\n apply(doc) {\n let attrs = Object.create(null);\n for (let name in doc.attrs)\n attrs[name] = doc.attrs[name];\n attrs[this.attr] = this.value;\n let updated = doc.type.create(attrs, doc.content, doc.marks);\n return StepResult.ok(updated);\n }\n getMap() {\n return StepMap.empty;\n }\n invert(doc) {\n return new DocAttrStep(this.attr, doc.attrs[this.attr]);\n }\n map(mapping) {\n return this;\n }\n toJSON() {\n return { stepType: \"docAttr\", attr: this.attr, value: this.value };\n }\n static fromJSON(schema, json) {\n if (typeof json.attr != \"string\")\n throw new RangeError(\"Invalid input for DocAttrStep.fromJSON\");\n return new DocAttrStep(json.attr, json.value);\n }\n}\nStep.jsonID(\"docAttr\", DocAttrStep);\n\n/**\n@internal\n*/\nlet TransformError = class extends Error {\n};\nTransformError = function TransformError(message) {\n let err = Error.call(this, message);\n err.__proto__ = TransformError.prototype;\n return err;\n};\nTransformError.prototype = Object.create(Error.prototype);\nTransformError.prototype.constructor = TransformError;\nTransformError.prototype.name = \"TransformError\";\n/**\nAbstraction to build up and track an array of\n[steps](https://prosemirror.net/docs/ref/#transform.Step) representing a document transformation.\n\nMost transforming methods return the `Transform` object itself, so\nthat they can be chained.\n*/\nclass Transform {\n /**\n Create a transform that starts with the given document.\n */\n constructor(\n /**\n The current document (the result of applying the steps in the\n transform).\n */\n doc) {\n this.doc = doc;\n /**\n The steps in this transform.\n */\n this.steps = [];\n /**\n The documents before each of the steps.\n */\n this.docs = [];\n /**\n A mapping with the maps for each of the steps in this transform.\n */\n this.mapping = new Mapping;\n }\n /**\n The starting document.\n */\n get before() { return this.docs.length ? this.docs[0] : this.doc; }\n /**\n Apply a new step in this transform, saving the result. Throws an\n error when the step fails.\n */\n step(step) {\n let result = this.maybeStep(step);\n if (result.failed)\n throw new TransformError(result.failed);\n return this;\n }\n /**\n Try to apply a step in this transformation, ignoring it if it\n fails. Returns the step result.\n */\n maybeStep(step) {\n let result = step.apply(this.doc);\n if (!result.failed)\n this.addStep(step, result.doc);\n return result;\n }\n /**\n True when the document has been changed (when there are any\n steps).\n */\n get docChanged() {\n return this.steps.length > 0;\n }\n /**\n @internal\n */\n addStep(step, doc) {\n this.docs.push(this.doc);\n this.steps.push(step);\n this.mapping.appendMap(step.getMap());\n this.doc = doc;\n }\n /**\n Replace the part of the document between `from` and `to` with the\n given `slice`.\n */\n replace(from, to = from, slice = Slice.empty) {\n let step = replaceStep(this.doc, from, to, slice);\n if (step)\n this.step(step);\n return this;\n }\n /**\n Replace the given range with the given content, which may be a\n fragment, node, or array of nodes.\n */\n replaceWith(from, to, content) {\n return this.replace(from, to, new Slice(Fragment.from(content), 0, 0));\n }\n /**\n Delete the content between the given positions.\n */\n delete(from, to) {\n return this.replace(from, to, Slice.empty);\n }\n /**\n Insert the given content at the given position.\n */\n insert(pos, content) {\n return this.replaceWith(pos, pos, content);\n }\n /**\n Replace a range of the document with a given slice, using\n `from`, `to`, and the slice's\n [`openStart`](https://prosemirror.net/docs/ref/#model.Slice.openStart) property as hints, rather\n than fixed start and end points. This method may grow the\n replaced area or close open nodes in the slice in order to get a\n fit that is more in line with WYSIWYG expectations, by dropping\n fully covered parent nodes of the replaced region when they are\n marked [non-defining as\n context](https://prosemirror.net/docs/ref/#model.NodeSpec.definingAsContext), or including an\n open parent node from the slice that _is_ marked as [defining\n its content](https://prosemirror.net/docs/ref/#model.NodeSpec.definingForContent).\n \n This is the method, for example, to handle paste. The similar\n [`replace`](https://prosemirror.net/docs/ref/#transform.Transform.replace) method is a more\n primitive tool which will _not_ move the start and end of its given\n range, and is useful in situations where you need more precise\n control over what happens.\n */\n replaceRange(from, to, slice) {\n replaceRange(this, from, to, slice);\n return this;\n }\n /**\n Replace the given range with a node, but use `from` and `to` as\n hints, rather than precise positions. When from and to are the same\n and are at the start or end of a parent node in which the given\n node doesn't fit, this method may _move_ them out towards a parent\n that does allow the given node to be placed. When the given range\n completely covers a parent node, this method may completely replace\n that parent node.\n */\n replaceRangeWith(from, to, node) {\n replaceRangeWith(this, from, to, node);\n return this;\n }\n /**\n Delete the given range, expanding it to cover fully covered\n parent nodes until a valid replace is found.\n */\n deleteRange(from, to) {\n deleteRange(this, from, to);\n return this;\n }\n /**\n Split the content in the given range off from its parent, if there\n is sibling content before or after it, and move it up the tree to\n the depth specified by `target`. You'll probably want to use\n [`liftTarget`](https://prosemirror.net/docs/ref/#transform.liftTarget) to compute `target`, to make\n sure the lift is valid.\n */\n lift(range, target) {\n lift(this, range, target);\n return this;\n }\n /**\n Join the blocks around the given position. If depth is 2, their\n last and first siblings are also joined, and so on.\n */\n join(pos, depth = 1) {\n join(this, pos, depth);\n return this;\n }\n /**\n Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.\n The wrappers are assumed to be valid in this position, and should\n probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).\n */\n wrap(range, wrappers) {\n wrap(this, range, wrappers);\n return this;\n }\n /**\n Set the type of all textblocks (partly) between `from` and `to` to\n the given node type with the given attributes.\n */\n setBlockType(from, to = from, type, attrs = null) {\n setBlockType(this, from, to, type, attrs);\n return this;\n }\n /**\n Change the type, attributes, and/or marks of the node at `pos`.\n When `type` isn't given, the existing node type is preserved,\n */\n setNodeMarkup(pos, type, attrs = null, marks) {\n setNodeMarkup(this, pos, type, attrs, marks);\n return this;\n }\n /**\n Set a single attribute on a given node to a new value.\n The `pos` addresses the document content. Use `setDocAttribute`\n to set attributes on the document itself.\n */\n setNodeAttribute(pos, attr, value) {\n this.step(new AttrStep(pos, attr, value));\n return this;\n }\n /**\n Set a single attribute on the document to a new value.\n */\n setDocAttribute(attr, value) {\n this.step(new DocAttrStep(attr, value));\n return this;\n }\n /**\n Add a mark to the node at position `pos`.\n */\n addNodeMark(pos, mark) {\n this.step(new AddNodeMarkStep(pos, mark));\n return this;\n }\n /**\n Remove a mark (or a mark of the given type) from the node at\n position `pos`.\n */\n removeNodeMark(pos, mark) {\n if (!(mark instanceof Mark)) {\n let node = this.doc.nodeAt(pos);\n if (!node)\n throw new RangeError(\"No node at position \" + pos);\n mark = mark.isInSet(node.marks);\n if (!mark)\n return this;\n }\n this.step(new RemoveNodeMarkStep(pos, mark));\n return this;\n }\n /**\n Split the node at the given position, and optionally, if `depth` is\n greater than one, any number of nodes above that. By default, the\n parts split off will inherit the node type of the original node.\n This can be changed by passing an array of types and attributes to\n use after the split.\n */\n split(pos, depth = 1, typesAfter) {\n split(this, pos, depth, typesAfter);\n return this;\n }\n /**\n Add the given mark to the inline content between `from` and `to`.\n */\n addMark(from, to, mark) {\n addMark(this, from, to, mark);\n return this;\n }\n /**\n Remove marks from inline nodes between `from` and `to`. When\n `mark` is a single mark, remove precisely that mark. When it is\n a mark type, remove all marks of that type. When it is null,\n remove all marks of any type.\n */\n removeMark(from, to, mark) {\n removeMark(this, from, to, mark);\n return this;\n }\n /**\n Removes all marks and nodes from the content of the node at\n `pos` that don't match the given new parent node type. Accepts\n an optional starting [content match](https://prosemirror.net/docs/ref/#model.ContentMatch) as\n third argument.\n */\n clearIncompatible(pos, parentType, match) {\n clearIncompatible(this, pos, parentType, match);\n return this;\n }\n}\n\nexport { AddMarkStep, AddNodeMarkStep, AttrStep, DocAttrStep, MapResult, Mapping, RemoveMarkStep, RemoveNodeMarkStep, ReplaceAroundStep, ReplaceStep, Step, StepMap, StepResult, Transform, TransformError, canJoin, canSplit, dropPoint, findWrapping, insertPoint, joinPoint, liftTarget, replaceStep };\n","import { Slice, Fragment, Mark, Node } from 'prosemirror-model';\nimport { ReplaceStep, ReplaceAroundStep, Transform } from 'prosemirror-transform';\n\nconst classesById = Object.create(null);\n/**\nSuperclass for editor selections. Every selection type should\nextend this. Should not be instantiated directly.\n*/\nclass Selection {\n /**\n Initialize a selection with the head and anchor and ranges. If no\n ranges are given, constructs a single range across `$anchor` and\n `$head`.\n */\n constructor(\n /**\n The resolved anchor of the selection (the side that stays in\n place when the selection is modified).\n */\n $anchor, \n /**\n The resolved head of the selection (the side that moves when\n the selection is modified).\n */\n $head, ranges) {\n this.$anchor = $anchor;\n this.$head = $head;\n this.ranges = ranges || [new SelectionRange($anchor.min($head), $anchor.max($head))];\n }\n /**\n The selection's anchor, as an unresolved position.\n */\n get anchor() { return this.$anchor.pos; }\n /**\n The selection's head.\n */\n get head() { return this.$head.pos; }\n /**\n The lower bound of the selection's main range.\n */\n get from() { return this.$from.pos; }\n /**\n The upper bound of the selection's main range.\n */\n get to() { return this.$to.pos; }\n /**\n The resolved lower bound of the selection's main range.\n */\n get $from() {\n return this.ranges[0].$from;\n }\n /**\n The resolved upper bound of the selection's main range.\n */\n get $to() {\n return this.ranges[0].$to;\n }\n /**\n Indicates whether the selection contains any content.\n */\n get empty() {\n let ranges = this.ranges;\n for (let i = 0; i < ranges.length; i++)\n if (ranges[i].$from.pos != ranges[i].$to.pos)\n return false;\n return true;\n }\n /**\n Get the content of this selection as a slice.\n */\n content() {\n return this.$from.doc.slice(this.from, this.to, true);\n }\n /**\n Replace the selection with a slice or, if no slice is given,\n delete the selection. Will append to the given transaction.\n */\n replace(tr, content = Slice.empty) {\n // Put the new selection at the position after the inserted\n // content. When that ended in an inline node, search backwards,\n // to get the position after that node. If not, search forward.\n let lastNode = content.content.lastChild, lastParent = null;\n for (let i = 0; i < content.openEnd; i++) {\n lastParent = lastNode;\n lastNode = lastNode.lastChild;\n }\n let mapFrom = tr.steps.length, ranges = this.ranges;\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);\n tr.replaceRange(mapping.map($from.pos), mapping.map($to.pos), i ? Slice.empty : content);\n if (i == 0)\n selectionToInsertionEnd(tr, mapFrom, (lastNode ? lastNode.isInline : lastParent && lastParent.isTextblock) ? -1 : 1);\n }\n }\n /**\n Replace the selection with the given node, appending the changes\n to the given transaction.\n */\n replaceWith(tr, node) {\n let mapFrom = tr.steps.length, ranges = this.ranges;\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);\n let from = mapping.map($from.pos), to = mapping.map($to.pos);\n if (i) {\n tr.deleteRange(from, to);\n }\n else {\n tr.replaceRangeWith(from, to, node);\n selectionToInsertionEnd(tr, mapFrom, node.isInline ? -1 : 1);\n }\n }\n }\n /**\n Find a valid cursor or leaf node selection starting at the given\n position and searching back if `dir` is negative, and forward if\n positive. When `textOnly` is true, only consider cursor\n selections. Will return null when no valid selection position is\n found.\n */\n static findFrom($pos, dir, textOnly = false) {\n let inner = $pos.parent.inlineContent ? new TextSelection($pos)\n : findSelectionIn($pos.node(0), $pos.parent, $pos.pos, $pos.index(), dir, textOnly);\n if (inner)\n return inner;\n for (let depth = $pos.depth - 1; depth >= 0; depth--) {\n let found = dir < 0\n ? findSelectionIn($pos.node(0), $pos.node(depth), $pos.before(depth + 1), $pos.index(depth), dir, textOnly)\n : findSelectionIn($pos.node(0), $pos.node(depth), $pos.after(depth + 1), $pos.index(depth) + 1, dir, textOnly);\n if (found)\n return found;\n }\n return null;\n }\n /**\n Find a valid cursor or leaf node selection near the given\n position. Searches forward first by default, but if `bias` is\n negative, it will search backwards first.\n */\n static near($pos, bias = 1) {\n return this.findFrom($pos, bias) || this.findFrom($pos, -bias) || new AllSelection($pos.node(0));\n }\n /**\n Find the cursor or leaf node selection closest to the start of\n the given document. Will return an\n [`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position\n exists.\n */\n static atStart(doc) {\n return findSelectionIn(doc, doc, 0, 0, 1) || new AllSelection(doc);\n }\n /**\n Find the cursor or leaf node selection closest to the end of the\n given document.\n */\n static atEnd(doc) {\n return findSelectionIn(doc, doc, doc.content.size, doc.childCount, -1) || new AllSelection(doc);\n }\n /**\n Deserialize the JSON representation of a selection. Must be\n implemented for custom classes (as a static class method).\n */\n static fromJSON(doc, json) {\n if (!json || !json.type)\n throw new RangeError(\"Invalid input for Selection.fromJSON\");\n let cls = classesById[json.type];\n if (!cls)\n throw new RangeError(`No selection type ${json.type} defined`);\n return cls.fromJSON(doc, json);\n }\n /**\n To be able to deserialize selections from JSON, custom selection\n classes must register themselves with an ID string, so that they\n can be disambiguated. Try to pick something that's unlikely to\n clash with classes from other modules.\n */\n static jsonID(id, selectionClass) {\n if (id in classesById)\n throw new RangeError(\"Duplicate use of selection JSON ID \" + id);\n classesById[id] = selectionClass;\n selectionClass.prototype.jsonID = id;\n return selectionClass;\n }\n /**\n Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,\n which is a value that can be mapped without having access to a\n current document, and later resolved to a real selection for a\n given document again. (This is used mostly by the history to\n track and restore old selections.) The default implementation of\n this method just converts the selection to a text selection and\n returns the bookmark for that.\n */\n getBookmark() {\n return TextSelection.between(this.$anchor, this.$head).getBookmark();\n }\n}\nSelection.prototype.visible = true;\n/**\nRepresents a selected range in a document.\n*/\nclass SelectionRange {\n /**\n Create a range.\n */\n constructor(\n /**\n The lower bound of the range.\n */\n $from, \n /**\n The upper bound of the range.\n */\n $to) {\n this.$from = $from;\n this.$to = $to;\n }\n}\nlet warnedAboutTextSelection = false;\nfunction checkTextSelection($pos) {\n if (!warnedAboutTextSelection && !$pos.parent.inlineContent) {\n warnedAboutTextSelection = true;\n console[\"warn\"](\"TextSelection endpoint not pointing into a node with inline content (\" + $pos.parent.type.name + \")\");\n }\n}\n/**\nA text selection represents a classical editor selection, with a\nhead (the moving side) and anchor (immobile side), both of which\npoint into textblock nodes. It can be empty (a regular cursor\nposition).\n*/\nclass TextSelection extends Selection {\n /**\n Construct a text selection between the given points.\n */\n constructor($anchor, $head = $anchor) {\n checkTextSelection($anchor);\n checkTextSelection($head);\n super($anchor, $head);\n }\n /**\n Returns a resolved position if this is a cursor selection (an\n empty text selection), and null otherwise.\n */\n get $cursor() { return this.$anchor.pos == this.$head.pos ? this.$head : null; }\n map(doc, mapping) {\n let $head = doc.resolve(mapping.map(this.head));\n if (!$head.parent.inlineContent)\n return Selection.near($head);\n let $anchor = doc.resolve(mapping.map(this.anchor));\n return new TextSelection($anchor.parent.inlineContent ? $anchor : $head, $head);\n }\n replace(tr, content = Slice.empty) {\n super.replace(tr, content);\n if (content == Slice.empty) {\n let marks = this.$from.marksAcross(this.$to);\n if (marks)\n tr.ensureMarks(marks);\n }\n }\n eq(other) {\n return other instanceof TextSelection && other.anchor == this.anchor && other.head == this.head;\n }\n getBookmark() {\n return new TextBookmark(this.anchor, this.head);\n }\n toJSON() {\n return { type: \"text\", anchor: this.anchor, head: this.head };\n }\n /**\n @internal\n */\n static fromJSON(doc, json) {\n if (typeof json.anchor != \"number\" || typeof json.head != \"number\")\n throw new RangeError(\"Invalid input for TextSelection.fromJSON\");\n return new TextSelection(doc.resolve(json.anchor), doc.resolve(json.head));\n }\n /**\n Create a text selection from non-resolved positions.\n */\n static create(doc, anchor, head = anchor) {\n let $anchor = doc.resolve(anchor);\n return new this($anchor, head == anchor ? $anchor : doc.resolve(head));\n }\n /**\n Return a text selection that spans the given positions or, if\n they aren't text positions, find a text selection near them.\n `bias` determines whether the method searches forward (default)\n or backwards (negative number) first. Will fall back to calling\n [`Selection.near`](https://prosemirror.net/docs/ref/#state.Selection^near) when the document\n doesn't contain a valid text position.\n */\n static between($anchor, $head, bias) {\n let dPos = $anchor.pos - $head.pos;\n if (!bias || dPos)\n bias = dPos >= 0 ? 1 : -1;\n if (!$head.parent.inlineContent) {\n let found = Selection.findFrom($head, bias, true) || Selection.findFrom($head, -bias, true);\n if (found)\n $head = found.$head;\n else\n return Selection.near($head, bias);\n }\n if (!$anchor.parent.inlineContent) {\n if (dPos == 0) {\n $anchor = $head;\n }\n else {\n $anchor = (Selection.findFrom($anchor, -bias, true) || Selection.findFrom($anchor, bias, true)).$anchor;\n if (($anchor.pos < $head.pos) != (dPos < 0))\n $anchor = $head;\n }\n }\n return new TextSelection($anchor, $head);\n }\n}\nSelection.jsonID(\"text\", TextSelection);\nclass TextBookmark {\n constructor(anchor, head) {\n this.anchor = anchor;\n this.head = head;\n }\n map(mapping) {\n return new TextBookmark(mapping.map(this.anchor), mapping.map(this.head));\n }\n resolve(doc) {\n return TextSelection.between(doc.resolve(this.anchor), doc.resolve(this.head));\n }\n}\n/**\nA node selection is a selection that points at a single node. All\nnodes marked [selectable](https://prosemirror.net/docs/ref/#model.NodeSpec.selectable) can be the\ntarget of a node selection. In such a selection, `from` and `to`\npoint directly before and after the selected node, `anchor` equals\n`from`, and `head` equals `to`..\n*/\nclass NodeSelection extends Selection {\n /**\n Create a node selection. Does not verify the validity of its\n argument.\n */\n constructor($pos) {\n let node = $pos.nodeAfter;\n let $end = $pos.node(0).resolve($pos.pos + node.nodeSize);\n super($pos, $end);\n this.node = node;\n }\n map(doc, mapping) {\n let { deleted, pos } = mapping.mapResult(this.anchor);\n let $pos = doc.resolve(pos);\n if (deleted)\n return Selection.near($pos);\n return new NodeSelection($pos);\n }\n content() {\n return new Slice(Fragment.from(this.node), 0, 0);\n }\n eq(other) {\n return other instanceof NodeSelection && other.anchor == this.anchor;\n }\n toJSON() {\n return { type: \"node\", anchor: this.anchor };\n }\n getBookmark() { return new NodeBookmark(this.anchor); }\n /**\n @internal\n */\n static fromJSON(doc, json) {\n if (typeof json.anchor != \"number\")\n throw new RangeError(\"Invalid input for NodeSelection.fromJSON\");\n return new NodeSelection(doc.resolve(json.anchor));\n }\n /**\n Create a node selection from non-resolved positions.\n */\n static create(doc, from) {\n return new NodeSelection(doc.resolve(from));\n }\n /**\n Determines whether the given node may be selected as a node\n selection.\n */\n static isSelectable(node) {\n return !node.isText && node.type.spec.selectable !== false;\n }\n}\nNodeSelection.prototype.visible = false;\nSelection.jsonID(\"node\", NodeSelection);\nclass NodeBookmark {\n constructor(anchor) {\n this.anchor = anchor;\n }\n map(mapping) {\n let { deleted, pos } = mapping.mapResult(this.anchor);\n return deleted ? new TextBookmark(pos, pos) : new NodeBookmark(pos);\n }\n resolve(doc) {\n let $pos = doc.resolve(this.anchor), node = $pos.nodeAfter;\n if (node && NodeSelection.isSelectable(node))\n return new NodeSelection($pos);\n return Selection.near($pos);\n }\n}\n/**\nA selection type that represents selecting the whole document\n(which can not necessarily be expressed with a text selection, when\nthere are for example leaf block nodes at the start or end of the\ndocument).\n*/\nclass AllSelection extends Selection {\n /**\n Create an all-selection over the given document.\n */\n constructor(doc) {\n super(doc.resolve(0), doc.resolve(doc.content.size));\n }\n replace(tr, content = Slice.empty) {\n if (content == Slice.empty) {\n tr.delete(0, tr.doc.content.size);\n let sel = Selection.atStart(tr.doc);\n if (!sel.eq(tr.selection))\n tr.setSelection(sel);\n }\n else {\n super.replace(tr, content);\n }\n }\n toJSON() { return { type: \"all\" }; }\n /**\n @internal\n */\n static fromJSON(doc) { return new AllSelection(doc); }\n map(doc) { return new AllSelection(doc); }\n eq(other) { return other instanceof AllSelection; }\n getBookmark() { return AllBookmark; }\n}\nSelection.jsonID(\"all\", AllSelection);\nconst AllBookmark = {\n map() { return this; },\n resolve(doc) { return new AllSelection(doc); }\n};\n// FIXME we'll need some awareness of text direction when scanning for selections\n// Try to find a selection inside the given node. `pos` points at the\n// position where the search starts. When `text` is true, only return\n// text selections.\nfunction findSelectionIn(doc, node, pos, index, dir, text = false) {\n if (node.inlineContent)\n return TextSelection.create(doc, pos);\n for (let i = index - (dir > 0 ? 0 : 1); dir > 0 ? i < node.childCount : i >= 0; i += dir) {\n let child = node.child(i);\n if (!child.isAtom) {\n let inner = findSelectionIn(doc, child, pos + dir, dir < 0 ? child.childCount : 0, dir, text);\n if (inner)\n return inner;\n }\n else if (!text && NodeSelection.isSelectable(child)) {\n return NodeSelection.create(doc, pos - (dir < 0 ? child.nodeSize : 0));\n }\n pos += child.nodeSize * dir;\n }\n return null;\n}\nfunction selectionToInsertionEnd(tr, startLen, bias) {\n let last = tr.steps.length - 1;\n if (last < startLen)\n return;\n let step = tr.steps[last];\n if (!(step instanceof ReplaceStep || step instanceof ReplaceAroundStep))\n return;\n let map = tr.mapping.maps[last], end;\n map.forEach((_from, _to, _newFrom, newTo) => { if (end == null)\n end = newTo; });\n tr.setSelection(Selection.near(tr.doc.resolve(end), bias));\n}\n\nconst UPDATED_SEL = 1, UPDATED_MARKS = 2, UPDATED_SCROLL = 4;\n/**\nAn editor state transaction, which can be applied to a state to\ncreate an updated state. Use\n[`EditorState.tr`](https://prosemirror.net/docs/ref/#state.EditorState.tr) to create an instance.\n\nTransactions track changes to the document (they are a subclass of\n[`Transform`](https://prosemirror.net/docs/ref/#transform.Transform)), but also other state changes,\nlike selection updates and adjustments of the set of [stored\nmarks](https://prosemirror.net/docs/ref/#state.EditorState.storedMarks). In addition, you can store\nmetadata properties in a transaction, which are extra pieces of\ninformation that client code or plugins can use to describe what a\ntransaction represents, so that they can update their [own\nstate](https://prosemirror.net/docs/ref/#state.StateField) accordingly.\n\nThe [editor view](https://prosemirror.net/docs/ref/#view.EditorView) uses a few metadata\nproperties: it will attach a property `\"pointer\"` with the value\n`true` to selection transactions directly caused by mouse or touch\ninput, a `\"composition\"` property holding an ID identifying the\ncomposition that caused it to transactions caused by composed DOM\ninput, and a `\"uiEvent\"` property of that may be `\"paste\"`,\n`\"cut\"`, or `\"drop\"`.\n*/\nclass Transaction extends Transform {\n /**\n @internal\n */\n constructor(state) {\n super(state.doc);\n // The step count for which the current selection is valid.\n this.curSelectionFor = 0;\n // Bitfield to track which aspects of the state were updated by\n // this transaction.\n this.updated = 0;\n // Object used to store metadata properties for the transaction.\n this.meta = Object.create(null);\n this.time = Date.now();\n this.curSelection = state.selection;\n this.storedMarks = state.storedMarks;\n }\n /**\n The transaction's current selection. This defaults to the editor\n selection [mapped](https://prosemirror.net/docs/ref/#state.Selection.map) through the steps in the\n transaction, but can be overwritten with\n [`setSelection`](https://prosemirror.net/docs/ref/#state.Transaction.setSelection).\n */\n get selection() {\n if (this.curSelectionFor < this.steps.length) {\n this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionFor));\n this.curSelectionFor = this.steps.length;\n }\n return this.curSelection;\n }\n /**\n Update the transaction's current selection. Will determine the\n selection that the editor gets when the transaction is applied.\n */\n setSelection(selection) {\n if (selection.$from.doc != this.doc)\n throw new RangeError(\"Selection passed to setSelection must point at the current document\");\n this.curSelection = selection;\n this.curSelectionFor = this.steps.length;\n this.updated = (this.updated | UPDATED_SEL) & ~UPDATED_MARKS;\n this.storedMarks = null;\n return this;\n }\n /**\n Whether the selection was explicitly updated by this transaction.\n */\n get selectionSet() {\n return (this.updated & UPDATED_SEL) > 0;\n }\n /**\n Set the current stored marks.\n */\n setStoredMarks(marks) {\n this.storedMarks = marks;\n this.updated |= UPDATED_MARKS;\n return this;\n }\n /**\n Make sure the current stored marks or, if that is null, the marks\n at the selection, match the given set of marks. Does nothing if\n this is already the case.\n */\n ensureMarks(marks) {\n if (!Mark.sameSet(this.storedMarks || this.selection.$from.marks(), marks))\n this.setStoredMarks(marks);\n return this;\n }\n /**\n Add a mark to the set of stored marks.\n */\n addStoredMark(mark) {\n return this.ensureMarks(mark.addToSet(this.storedMarks || this.selection.$head.marks()));\n }\n /**\n Remove a mark or mark type from the set of stored marks.\n */\n removeStoredMark(mark) {\n return this.ensureMarks(mark.removeFromSet(this.storedMarks || this.selection.$head.marks()));\n }\n /**\n Whether the stored marks were explicitly set for this transaction.\n */\n get storedMarksSet() {\n return (this.updated & UPDATED_MARKS) > 0;\n }\n /**\n @internal\n */\n addStep(step, doc) {\n super.addStep(step, doc);\n this.updated = this.updated & ~UPDATED_MARKS;\n this.storedMarks = null;\n }\n /**\n Update the timestamp for the transaction.\n */\n setTime(time) {\n this.time = time;\n return this;\n }\n /**\n Replace the current selection with the given slice.\n */\n replaceSelection(slice) {\n this.selection.replace(this, slice);\n return this;\n }\n /**\n Replace the selection with the given node. When `inheritMarks` is\n true and the content is inline, it inherits the marks from the\n place where it is inserted.\n */\n replaceSelectionWith(node, inheritMarks = true) {\n let selection = this.selection;\n if (inheritMarks)\n node = node.mark(this.storedMarks || (selection.empty ? selection.$from.marks() : (selection.$from.marksAcross(selection.$to) || Mark.none)));\n selection.replaceWith(this, node);\n return this;\n }\n /**\n Delete the selection.\n */\n deleteSelection() {\n this.selection.replace(this);\n return this;\n }\n /**\n Replace the given range, or the selection if no range is given,\n with a text node containing the given string.\n */\n insertText(text, from, to) {\n let schema = this.doc.type.schema;\n if (from == null) {\n if (!text)\n return this.deleteSelection();\n return this.replaceSelectionWith(schema.text(text), true);\n }\n else {\n if (to == null)\n to = from;\n to = to == null ? from : to;\n if (!text)\n return this.deleteRange(from, to);\n let marks = this.storedMarks;\n if (!marks) {\n let $from = this.doc.resolve(from);\n marks = to == from ? $from.marks() : $from.marksAcross(this.doc.resolve(to));\n }\n this.replaceRangeWith(from, to, schema.text(text, marks));\n if (!this.selection.empty)\n this.setSelection(Selection.near(this.selection.$to));\n return this;\n }\n }\n /**\n Store a metadata property in this transaction, keyed either by\n name or by plugin.\n */\n setMeta(key, value) {\n this.meta[typeof key == \"string\" ? key : key.key] = value;\n return this;\n }\n /**\n Retrieve a metadata property for a given name or plugin.\n */\n getMeta(key) {\n return this.meta[typeof key == \"string\" ? key : key.key];\n }\n /**\n Returns true if this transaction doesn't contain any metadata,\n and can thus safely be extended.\n */\n get isGeneric() {\n for (let _ in this.meta)\n return false;\n return true;\n }\n /**\n Indicate that the editor should scroll the selection into view\n when updated to the state produced by this transaction.\n */\n scrollIntoView() {\n this.updated |= UPDATED_SCROLL;\n return this;\n }\n /**\n True when this transaction has had `scrollIntoView` called on it.\n */\n get scrolledIntoView() {\n return (this.updated & UPDATED_SCROLL) > 0;\n }\n}\n\nfunction bind(f, self) {\n return !self || !f ? f : f.bind(self);\n}\nclass FieldDesc {\n constructor(name, desc, self) {\n this.name = name;\n this.init = bind(desc.init, self);\n this.apply = bind(desc.apply, self);\n }\n}\nconst baseFields = [\n new FieldDesc(\"doc\", {\n init(config) { return config.doc || config.schema.topNodeType.createAndFill(); },\n apply(tr) { return tr.doc; }\n }),\n new FieldDesc(\"selection\", {\n init(config, instance) { return config.selection || Selection.atStart(instance.doc); },\n apply(tr) { return tr.selection; }\n }),\n new FieldDesc(\"storedMarks\", {\n init(config) { return config.storedMarks || null; },\n apply(tr, _marks, _old, state) { return state.selection.$cursor ? tr.storedMarks : null; }\n }),\n new FieldDesc(\"scrollToSelection\", {\n init() { return 0; },\n apply(tr, prev) { return tr.scrolledIntoView ? prev + 1 : prev; }\n })\n];\n// Object wrapping the part of a state object that stays the same\n// across transactions. Stored in the state's `config` property.\nclass Configuration {\n constructor(schema, plugins) {\n this.schema = schema;\n this.plugins = [];\n this.pluginsByKey = Object.create(null);\n this.fields = baseFields.slice();\n if (plugins)\n plugins.forEach(plugin => {\n if (this.pluginsByKey[plugin.key])\n throw new RangeError(\"Adding different instances of a keyed plugin (\" + plugin.key + \")\");\n this.plugins.push(plugin);\n this.pluginsByKey[plugin.key] = plugin;\n if (plugin.spec.state)\n this.fields.push(new FieldDesc(plugin.key, plugin.spec.state, plugin));\n });\n }\n}\n/**\nThe state of a ProseMirror editor is represented by an object of\nthis type. A state is a persistent data structure—it isn't\nupdated, but rather a new state value is computed from an old one\nusing the [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) method.\n\nA state holds a number of built-in fields, and plugins can\n[define](https://prosemirror.net/docs/ref/#state.PluginSpec.state) additional fields.\n*/\nclass EditorState {\n /**\n @internal\n */\n constructor(\n /**\n @internal\n */\n config) {\n this.config = config;\n }\n /**\n The schema of the state's document.\n */\n get schema() {\n return this.config.schema;\n }\n /**\n The plugins that are active in this state.\n */\n get plugins() {\n return this.config.plugins;\n }\n /**\n Apply the given transaction to produce a new state.\n */\n apply(tr) {\n return this.applyTransaction(tr).state;\n }\n /**\n @internal\n */\n filterTransaction(tr, ignore = -1) {\n for (let i = 0; i < this.config.plugins.length; i++)\n if (i != ignore) {\n let plugin = this.config.plugins[i];\n if (plugin.spec.filterTransaction && !plugin.spec.filterTransaction.call(plugin, tr, this))\n return false;\n }\n return true;\n }\n /**\n Verbose variant of [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) that\n returns the precise transactions that were applied (which might\n be influenced by the [transaction\n hooks](https://prosemirror.net/docs/ref/#state.PluginSpec.filterTransaction) of\n plugins) along with the new state.\n */\n applyTransaction(rootTr) {\n if (!this.filterTransaction(rootTr))\n return { state: this, transactions: [] };\n let trs = [rootTr], newState = this.applyInner(rootTr), seen = null;\n // This loop repeatedly gives plugins a chance to respond to\n // transactions as new transactions are added, making sure to only\n // pass the transactions the plugin did not see before.\n for (;;) {\n let haveNew = false;\n for (let i = 0; i < this.config.plugins.length; i++) {\n let plugin = this.config.plugins[i];\n if (plugin.spec.appendTransaction) {\n let n = seen ? seen[i].n : 0, oldState = seen ? seen[i].state : this;\n let tr = n < trs.length &&\n plugin.spec.appendTransaction.call(plugin, n ? trs.slice(n) : trs, oldState, newState);\n if (tr && newState.filterTransaction(tr, i)) {\n tr.setMeta(\"appendedTransaction\", rootTr);\n if (!seen) {\n seen = [];\n for (let j = 0; j < this.config.plugins.length; j++)\n seen.push(j < i ? { state: newState, n: trs.length } : { state: this, n: 0 });\n }\n trs.push(tr);\n newState = newState.applyInner(tr);\n haveNew = true;\n }\n if (seen)\n seen[i] = { state: newState, n: trs.length };\n }\n }\n if (!haveNew)\n return { state: newState, transactions: trs };\n }\n }\n /**\n @internal\n */\n applyInner(tr) {\n if (!tr.before.eq(this.doc))\n throw new RangeError(\"Applying a mismatched transaction\");\n let newInstance = new EditorState(this.config), fields = this.config.fields;\n for (let i = 0; i < fields.length; i++) {\n let field = fields[i];\n newInstance[field.name] = field.apply(tr, this[field.name], this, newInstance);\n }\n return newInstance;\n }\n /**\n Start a [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.\n */\n get tr() { return new Transaction(this); }\n /**\n Create a new state.\n */\n static create(config) {\n let $config = new Configuration(config.doc ? config.doc.type.schema : config.schema, config.plugins);\n let instance = new EditorState($config);\n for (let i = 0; i < $config.fields.length; i++)\n instance[$config.fields[i].name] = $config.fields[i].init(config, instance);\n return instance;\n }\n /**\n Create a new state based on this one, but with an adjusted set\n of active plugins. State fields that exist in both sets of\n plugins are kept unchanged. Those that no longer exist are\n dropped, and those that are new are initialized using their\n [`init`](https://prosemirror.net/docs/ref/#state.StateField.init) method, passing in the new\n configuration object..\n */\n reconfigure(config) {\n let $config = new Configuration(this.schema, config.plugins);\n let fields = $config.fields, instance = new EditorState($config);\n for (let i = 0; i < fields.length; i++) {\n let name = fields[i].name;\n instance[name] = this.hasOwnProperty(name) ? this[name] : fields[i].init(config, instance);\n }\n return instance;\n }\n /**\n Serialize this state to JSON. If you want to serialize the state\n of plugins, pass an object mapping property names to use in the\n resulting JSON object to plugin objects. The argument may also be\n a string or number, in which case it is ignored, to support the\n way `JSON.stringify` calls `toString` methods.\n */\n toJSON(pluginFields) {\n let result = { doc: this.doc.toJSON(), selection: this.selection.toJSON() };\n if (this.storedMarks)\n result.storedMarks = this.storedMarks.map(m => m.toJSON());\n if (pluginFields && typeof pluginFields == 'object')\n for (let prop in pluginFields) {\n if (prop == \"doc\" || prop == \"selection\")\n throw new RangeError(\"The JSON fields `doc` and `selection` are reserved\");\n let plugin = pluginFields[prop], state = plugin.spec.state;\n if (state && state.toJSON)\n result[prop] = state.toJSON.call(plugin, this[plugin.key]);\n }\n return result;\n }\n /**\n Deserialize a JSON representation of a state. `config` should\n have at least a `schema` field, and should contain array of\n plugins to initialize the state with. `pluginFields` can be used\n to deserialize the state of plugins, by associating plugin\n instances with the property names they use in the JSON object.\n */\n static fromJSON(config, json, pluginFields) {\n if (!json)\n throw new RangeError(\"Invalid input for EditorState.fromJSON\");\n if (!config.schema)\n throw new RangeError(\"Required config field 'schema' missing\");\n let $config = new Configuration(config.schema, config.plugins);\n let instance = new EditorState($config);\n $config.fields.forEach(field => {\n if (field.name == \"doc\") {\n instance.doc = Node.fromJSON(config.schema, json.doc);\n }\n else if (field.name == \"selection\") {\n instance.selection = Selection.fromJSON(instance.doc, json.selection);\n }\n else if (field.name == \"storedMarks\") {\n if (json.storedMarks)\n instance.storedMarks = json.storedMarks.map(config.schema.markFromJSON);\n }\n else {\n if (pluginFields)\n for (let prop in pluginFields) {\n let plugin = pluginFields[prop], state = plugin.spec.state;\n if (plugin.key == field.name && state && state.fromJSON &&\n Object.prototype.hasOwnProperty.call(json, prop)) {\n instance[field.name] = state.fromJSON.call(plugin, config, json[prop], instance);\n return;\n }\n }\n instance[field.name] = field.init(config, instance);\n }\n });\n return instance;\n }\n}\n\nfunction bindProps(obj, self, target) {\n for (let prop in obj) {\n let val = obj[prop];\n if (val instanceof Function)\n val = val.bind(self);\n else if (prop == \"handleDOMEvents\")\n val = bindProps(val, self, {});\n target[prop] = val;\n }\n return target;\n}\n/**\nPlugins bundle functionality that can be added to an editor.\nThey are part of the [editor state](https://prosemirror.net/docs/ref/#state.EditorState) and\nmay influence that state and the view that contains it.\n*/\nclass Plugin {\n /**\n Create a plugin.\n */\n constructor(\n /**\n The plugin's [spec object](https://prosemirror.net/docs/ref/#state.PluginSpec).\n */\n spec) {\n this.spec = spec;\n /**\n The [props](https://prosemirror.net/docs/ref/#view.EditorProps) exported by this plugin.\n */\n this.props = {};\n if (spec.props)\n bindProps(spec.props, this, this.props);\n this.key = spec.key ? spec.key.key : createKey(\"plugin\");\n }\n /**\n Extract the plugin's state field from an editor state.\n */\n getState(state) { return state[this.key]; }\n}\nconst keys = Object.create(null);\nfunction createKey(name) {\n if (name in keys)\n return name + \"$\" + ++keys[name];\n keys[name] = 0;\n return name + \"$\";\n}\n/**\nA key is used to [tag](https://prosemirror.net/docs/ref/#state.PluginSpec.key) plugins in a way\nthat makes it possible to find them, given an editor state.\nAssigning a key does mean only one plugin of that type can be\nactive in a state.\n*/\nclass PluginKey {\n /**\n Create a plugin key.\n */\n constructor(name = \"key\") { this.key = createKey(name); }\n /**\n Get the active plugin with this key, if any, from an editor\n state.\n */\n get(state) { return state.config.pluginsByKey[this.key]; }\n /**\n Get the plugin's state from an editor state.\n */\n getState(state) { return state[this.key]; }\n}\n\nexport { AllSelection, EditorState, NodeSelection, Plugin, PluginKey, Selection, SelectionRange, TextSelection, Transaction };\n","import { TextSelection, NodeSelection, AllSelection, Selection } from 'prosemirror-state';\nimport { DOMSerializer, Fragment, Mark, Slice, DOMParser } from 'prosemirror-model';\nimport { dropPoint } from 'prosemirror-transform';\n\nconst domIndex = function (node) {\n for (var index = 0;; index++) {\n node = node.previousSibling;\n if (!node)\n return index;\n }\n};\nconst parentNode = function (node) {\n let parent = node.assignedSlot || node.parentNode;\n return parent && parent.nodeType == 11 ? parent.host : parent;\n};\nlet reusedRange = null;\n// Note that this will always return the same range, because DOM range\n// objects are every expensive, and keep slowing down subsequent DOM\n// updates, for some reason.\nconst textRange = function (node, from, to) {\n let range = reusedRange || (reusedRange = document.createRange());\n range.setEnd(node, to == null ? node.nodeValue.length : to);\n range.setStart(node, from || 0);\n return range;\n};\nconst clearReusedRange = function () {\n reusedRange = null;\n};\n// Scans forward and backward through DOM positions equivalent to the\n// given one to see if the two are in the same place (i.e. after a\n// text node vs at the end of that text node)\nconst isEquivalentPosition = function (node, off, targetNode, targetOff) {\n return targetNode && (scanFor(node, off, targetNode, targetOff, -1) ||\n scanFor(node, off, targetNode, targetOff, 1));\n};\nconst atomElements = /^(img|br|input|textarea|hr)$/i;\nfunction scanFor(node, off, targetNode, targetOff, dir) {\n for (;;) {\n if (node == targetNode && off == targetOff)\n return true;\n if (off == (dir < 0 ? 0 : nodeSize(node))) {\n let parent = node.parentNode;\n if (!parent || parent.nodeType != 1 || hasBlockDesc(node) || atomElements.test(node.nodeName) ||\n node.contentEditable == \"false\")\n return false;\n off = domIndex(node) + (dir < 0 ? 0 : 1);\n node = parent;\n }\n else if (node.nodeType == 1) {\n node = node.childNodes[off + (dir < 0 ? -1 : 0)];\n if (node.contentEditable == \"false\")\n return false;\n off = dir < 0 ? nodeSize(node) : 0;\n }\n else {\n return false;\n }\n }\n}\nfunction nodeSize(node) {\n return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;\n}\nfunction textNodeBefore$1(node, offset) {\n for (;;) {\n if (node.nodeType == 3 && offset)\n return node;\n if (node.nodeType == 1 && offset > 0) {\n if (node.contentEditable == \"false\")\n return null;\n node = node.childNodes[offset - 1];\n offset = nodeSize(node);\n }\n else if (node.parentNode && !hasBlockDesc(node)) {\n offset = domIndex(node);\n node = node.parentNode;\n }\n else {\n return null;\n }\n }\n}\nfunction textNodeAfter$1(node, offset) {\n for (;;) {\n if (node.nodeType == 3 && offset < node.nodeValue.length)\n return node;\n if (node.nodeType == 1 && offset < node.childNodes.length) {\n if (node.contentEditable == \"false\")\n return null;\n node = node.childNodes[offset];\n offset = 0;\n }\n else if (node.parentNode && !hasBlockDesc(node)) {\n offset = domIndex(node) + 1;\n node = node.parentNode;\n }\n else {\n return null;\n }\n }\n}\nfunction isOnEdge(node, offset, parent) {\n for (let atStart = offset == 0, atEnd = offset == nodeSize(node); atStart || atEnd;) {\n if (node == parent)\n return true;\n let index = domIndex(node);\n node = node.parentNode;\n if (!node)\n return false;\n atStart = atStart && index == 0;\n atEnd = atEnd && index == nodeSize(node);\n }\n}\nfunction hasBlockDesc(dom) {\n let desc;\n for (let cur = dom; cur; cur = cur.parentNode)\n if (desc = cur.pmViewDesc)\n break;\n return desc && desc.node && desc.node.isBlock && (desc.dom == dom || desc.contentDOM == dom);\n}\n// Work around Chrome issue https://bugs.chromium.org/p/chromium/issues/detail?id=447523\n// (isCollapsed inappropriately returns true in shadow dom)\nconst selectionCollapsed = function (domSel) {\n return domSel.focusNode && isEquivalentPosition(domSel.focusNode, domSel.focusOffset, domSel.anchorNode, domSel.anchorOffset);\n};\nfunction keyEvent(keyCode, key) {\n let event = document.createEvent(\"Event\");\n event.initEvent(\"keydown\", true, true);\n event.keyCode = keyCode;\n event.key = event.code = key;\n return event;\n}\nfunction deepActiveElement(doc) {\n let elt = doc.activeElement;\n while (elt && elt.shadowRoot)\n elt = elt.shadowRoot.activeElement;\n return elt;\n}\nfunction caretFromPoint(doc, x, y) {\n if (doc.caretPositionFromPoint) {\n try { // Firefox throws for this call in hard-to-predict circumstances (#994)\n let pos = doc.caretPositionFromPoint(x, y);\n // Clip the offset, because Chrome will return a text offset\n // into nodes, which can't be treated as a regular DOM\n // offset\n if (pos)\n return { node: pos.offsetNode, offset: Math.min(nodeSize(pos.offsetNode), pos.offset) };\n }\n catch (_) { }\n }\n if (doc.caretRangeFromPoint) {\n let range = doc.caretRangeFromPoint(x, y);\n if (range)\n return { node: range.startContainer, offset: Math.min(nodeSize(range.startContainer), range.startOffset) };\n }\n}\n\nconst nav = typeof navigator != \"undefined\" ? navigator : null;\nconst doc = typeof document != \"undefined\" ? document : null;\nconst agent = (nav && nav.userAgent) || \"\";\nconst ie_edge = /Edge\\/(\\d+)/.exec(agent);\nconst ie_upto10 = /MSIE \\d/.exec(agent);\nconst ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(agent);\nconst ie = !!(ie_upto10 || ie_11up || ie_edge);\nconst ie_version = ie_upto10 ? document.documentMode : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : 0;\nconst gecko = !ie && /gecko\\/(\\d+)/i.test(agent);\ngecko && +(/Firefox\\/(\\d+)/.exec(agent) || [0, 0])[1];\nconst _chrome = !ie && /Chrome\\/(\\d+)/.exec(agent);\nconst chrome = !!_chrome;\nconst chrome_version = _chrome ? +_chrome[1] : 0;\nconst safari = !ie && !!nav && /Apple Computer/.test(nav.vendor);\n// Is true for both iOS and iPadOS for convenience\nconst ios = safari && (/Mobile\\/\\w+/.test(agent) || !!nav && nav.maxTouchPoints > 2);\nconst mac = ios || (nav ? /Mac/.test(nav.platform) : false);\nconst windows = nav ? /Win/.test(nav.platform) : false;\nconst android = /Android \\d/.test(agent);\nconst webkit = !!doc && \"webkitFontSmoothing\" in doc.documentElement.style;\nconst webkit_version = webkit ? +(/\\bAppleWebKit\\/(\\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;\n\nfunction windowRect(doc) {\n let vp = doc.defaultView && doc.defaultView.visualViewport;\n if (vp)\n return {\n left: 0, right: vp.width,\n top: 0, bottom: vp.height\n };\n return { left: 0, right: doc.documentElement.clientWidth,\n top: 0, bottom: doc.documentElement.clientHeight };\n}\nfunction getSide(value, side) {\n return typeof value == \"number\" ? value : value[side];\n}\nfunction clientRect(node) {\n let rect = node.getBoundingClientRect();\n // Adjust for elements with style \"transform: scale()\"\n let scaleX = (rect.width / node.offsetWidth) || 1;\n let scaleY = (rect.height / node.offsetHeight) || 1;\n // Make sure scrollbar width isn't included in the rectangle\n return { left: rect.left, right: rect.left + node.clientWidth * scaleX,\n top: rect.top, bottom: rect.top + node.clientHeight * scaleY };\n}\nfunction scrollRectIntoView(view, rect, startDOM) {\n let scrollThreshold = view.someProp(\"scrollThreshold\") || 0, scrollMargin = view.someProp(\"scrollMargin\") || 5;\n let doc = view.dom.ownerDocument;\n for (let parent = startDOM || view.dom;; parent = parentNode(parent)) {\n if (!parent)\n break;\n if (parent.nodeType != 1)\n continue;\n let elt = parent;\n let atTop = elt == doc.body;\n let bounding = atTop ? windowRect(doc) : clientRect(elt);\n let moveX = 0, moveY = 0;\n if (rect.top < bounding.top + getSide(scrollThreshold, \"top\"))\n moveY = -(bounding.top - rect.top + getSide(scrollMargin, \"top\"));\n else if (rect.bottom > bounding.bottom - getSide(scrollThreshold, \"bottom\"))\n moveY = rect.bottom - rect.top > bounding.bottom - bounding.top\n ? rect.top + getSide(scrollMargin, \"top\") - bounding.top\n : rect.bottom - bounding.bottom + getSide(scrollMargin, \"bottom\");\n if (rect.left < bounding.left + getSide(scrollThreshold, \"left\"))\n moveX = -(bounding.left - rect.left + getSide(scrollMargin, \"left\"));\n else if (rect.right > bounding.right - getSide(scrollThreshold, \"right\"))\n moveX = rect.right - bounding.right + getSide(scrollMargin, \"right\");\n if (moveX || moveY) {\n if (atTop) {\n doc.defaultView.scrollBy(moveX, moveY);\n }\n else {\n let startX = elt.scrollLeft, startY = elt.scrollTop;\n if (moveY)\n elt.scrollTop += moveY;\n if (moveX)\n elt.scrollLeft += moveX;\n let dX = elt.scrollLeft - startX, dY = elt.scrollTop - startY;\n rect = { left: rect.left - dX, top: rect.top - dY, right: rect.right - dX, bottom: rect.bottom - dY };\n }\n }\n if (atTop || /^(fixed|sticky)$/.test(getComputedStyle(parent).position))\n break;\n }\n}\n// Store the scroll position of the editor's parent nodes, along with\n// the top position of an element near the top of the editor, which\n// will be used to make sure the visible viewport remains stable even\n// when the size of the content above changes.\nfunction storeScrollPos(view) {\n let rect = view.dom.getBoundingClientRect(), startY = Math.max(0, rect.top);\n let refDOM, refTop;\n for (let x = (rect.left + rect.right) / 2, y = startY + 1; y < Math.min(innerHeight, rect.bottom); y += 5) {\n let dom = view.root.elementFromPoint(x, y);\n if (!dom || dom == view.dom || !view.dom.contains(dom))\n continue;\n let localRect = dom.getBoundingClientRect();\n if (localRect.top >= startY - 20) {\n refDOM = dom;\n refTop = localRect.top;\n break;\n }\n }\n return { refDOM: refDOM, refTop: refTop, stack: scrollStack(view.dom) };\n}\nfunction scrollStack(dom) {\n let stack = [], doc = dom.ownerDocument;\n for (let cur = dom; cur; cur = parentNode(cur)) {\n stack.push({ dom: cur, top: cur.scrollTop, left: cur.scrollLeft });\n if (dom == doc)\n break;\n }\n return stack;\n}\n// Reset the scroll position of the editor's parent nodes to that what\n// it was before, when storeScrollPos was called.\nfunction resetScrollPos({ refDOM, refTop, stack }) {\n let newRefTop = refDOM ? refDOM.getBoundingClientRect().top : 0;\n restoreScrollStack(stack, newRefTop == 0 ? 0 : newRefTop - refTop);\n}\nfunction restoreScrollStack(stack, dTop) {\n for (let i = 0; i < stack.length; i++) {\n let { dom, top, left } = stack[i];\n if (dom.scrollTop != top + dTop)\n dom.scrollTop = top + dTop;\n if (dom.scrollLeft != left)\n dom.scrollLeft = left;\n }\n}\nlet preventScrollSupported = null;\n// Feature-detects support for .focus({preventScroll: true}), and uses\n// a fallback kludge when not supported.\nfunction focusPreventScroll(dom) {\n if (dom.setActive)\n return dom.setActive(); // in IE\n if (preventScrollSupported)\n return dom.focus(preventScrollSupported);\n let stored = scrollStack(dom);\n dom.focus(preventScrollSupported == null ? {\n get preventScroll() {\n preventScrollSupported = { preventScroll: true };\n return true;\n }\n } : undefined);\n if (!preventScrollSupported) {\n preventScrollSupported = false;\n restoreScrollStack(stored, 0);\n }\n}\nfunction findOffsetInNode(node, coords) {\n let closest, dxClosest = 2e8, coordsClosest, offset = 0;\n let rowBot = coords.top, rowTop = coords.top;\n let firstBelow, coordsBelow;\n for (let child = node.firstChild, childIndex = 0; child; child = child.nextSibling, childIndex++) {\n let rects;\n if (child.nodeType == 1)\n rects = child.getClientRects();\n else if (child.nodeType == 3)\n rects = textRange(child).getClientRects();\n else\n continue;\n for (let i = 0; i < rects.length; i++) {\n let rect = rects[i];\n if (rect.top <= rowBot && rect.bottom >= rowTop) {\n rowBot = Math.max(rect.bottom, rowBot);\n rowTop = Math.min(rect.top, rowTop);\n let dx = rect.left > coords.left ? rect.left - coords.left\n : rect.right < coords.left ? coords.left - rect.right : 0;\n if (dx < dxClosest) {\n closest = child;\n dxClosest = dx;\n coordsClosest = dx && closest.nodeType == 3 ? {\n left: rect.right < coords.left ? rect.right : rect.left,\n top: coords.top\n } : coords;\n if (child.nodeType == 1 && dx)\n offset = childIndex + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0);\n continue;\n }\n }\n else if (rect.top > coords.top && !firstBelow && rect.left <= coords.left && rect.right >= coords.left) {\n firstBelow = child;\n coordsBelow = { left: Math.max(rect.left, Math.min(rect.right, coords.left)), top: rect.top };\n }\n if (!closest && (coords.left >= rect.right && coords.top >= rect.top ||\n coords.left >= rect.left && coords.top >= rect.bottom))\n offset = childIndex + 1;\n }\n }\n if (!closest && firstBelow) {\n closest = firstBelow;\n coordsClosest = coordsBelow;\n dxClosest = 0;\n }\n if (closest && closest.nodeType == 3)\n return findOffsetInText(closest, coordsClosest);\n if (!closest || (dxClosest && closest.nodeType == 1))\n return { node, offset };\n return findOffsetInNode(closest, coordsClosest);\n}\nfunction findOffsetInText(node, coords) {\n let len = node.nodeValue.length;\n let range = document.createRange();\n for (let i = 0; i < len; i++) {\n range.setEnd(node, i + 1);\n range.setStart(node, i);\n let rect = singleRect(range, 1);\n if (rect.top == rect.bottom)\n continue;\n if (inRect(coords, rect))\n return { node, offset: i + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0) };\n }\n return { node, offset: 0 };\n}\nfunction inRect(coords, rect) {\n return coords.left >= rect.left - 1 && coords.left <= rect.right + 1 &&\n coords.top >= rect.top - 1 && coords.top <= rect.bottom + 1;\n}\nfunction targetKludge(dom, coords) {\n let parent = dom.parentNode;\n if (parent && /^li$/i.test(parent.nodeName) && coords.left < dom.getBoundingClientRect().left)\n return parent;\n return dom;\n}\nfunction posFromElement(view, elt, coords) {\n let { node, offset } = findOffsetInNode(elt, coords), bias = -1;\n if (node.nodeType == 1 && !node.firstChild) {\n let rect = node.getBoundingClientRect();\n bias = rect.left != rect.right && coords.left > (rect.left + rect.right) / 2 ? 1 : -1;\n }\n return view.docView.posFromDOM(node, offset, bias);\n}\nfunction posFromCaret(view, node, offset, coords) {\n // Browser (in caretPosition/RangeFromPoint) will agressively\n // normalize towards nearby inline nodes. Since we are interested in\n // positions between block nodes too, we first walk up the hierarchy\n // of nodes to see if there are block nodes that the coordinates\n // fall outside of. If so, we take the position before/after that\n // block. If not, we call `posFromDOM` on the raw node/offset.\n let outsideBlock = -1;\n for (let cur = node, sawBlock = false;;) {\n if (cur == view.dom)\n break;\n let desc = view.docView.nearestDesc(cur, true), rect;\n if (!desc)\n return null;\n if (desc.dom.nodeType == 1 && (desc.node.isBlock && desc.parent || !desc.contentDOM) &&\n // Ignore elements with zero-size bounding rectangles\n ((rect = desc.dom.getBoundingClientRect()).width || rect.height)) {\n if (desc.node.isBlock && desc.parent) {\n // Only apply the horizontal test to the innermost block. Vertical for any parent.\n if (!sawBlock && rect.left > coords.left || rect.top > coords.top)\n outsideBlock = desc.posBefore;\n else if (!sawBlock && rect.right < coords.left || rect.bottom < coords.top)\n outsideBlock = desc.posAfter;\n sawBlock = true;\n }\n if (!desc.contentDOM && outsideBlock < 0 && !desc.node.isText) {\n // If we are inside a leaf, return the side of the leaf closer to the coords\n let before = desc.node.isBlock ? coords.top < (rect.top + rect.bottom) / 2\n : coords.left < (rect.left + rect.right) / 2;\n return before ? desc.posBefore : desc.posAfter;\n }\n }\n cur = desc.dom.parentNode;\n }\n return outsideBlock > -1 ? outsideBlock : view.docView.posFromDOM(node, offset, -1);\n}\nfunction elementFromPoint(element, coords, box) {\n let len = element.childNodes.length;\n if (len && box.top < box.bottom) {\n for (let startI = Math.max(0, Math.min(len - 1, Math.floor(len * (coords.top - box.top) / (box.bottom - box.top)) - 2)), i = startI;;) {\n let child = element.childNodes[i];\n if (child.nodeType == 1) {\n let rects = child.getClientRects();\n for (let j = 0; j < rects.length; j++) {\n let rect = rects[j];\n if (inRect(coords, rect))\n return elementFromPoint(child, coords, rect);\n }\n }\n if ((i = (i + 1) % len) == startI)\n break;\n }\n }\n return element;\n}\n// Given an x,y position on the editor, get the position in the document.\nfunction posAtCoords(view, coords) {\n let doc = view.dom.ownerDocument, node, offset = 0;\n let caret = caretFromPoint(doc, coords.left, coords.top);\n if (caret)\n ({ node, offset } = caret);\n let elt = (view.root.elementFromPoint ? view.root : doc)\n .elementFromPoint(coords.left, coords.top);\n let pos;\n if (!elt || !view.dom.contains(elt.nodeType != 1 ? elt.parentNode : elt)) {\n let box = view.dom.getBoundingClientRect();\n if (!inRect(coords, box))\n return null;\n elt = elementFromPoint(view.dom, coords, box);\n if (!elt)\n return null;\n }\n // Safari's caretRangeFromPoint returns nonsense when on a draggable element\n if (safari) {\n for (let p = elt; node && p; p = parentNode(p))\n if (p.draggable)\n node = undefined;\n }\n elt = targetKludge(elt, coords);\n if (node) {\n if (gecko && node.nodeType == 1) {\n // Firefox will sometimes return offsets into nodes, which\n // have no actual children, from caretPositionFromPoint (#953)\n offset = Math.min(offset, node.childNodes.length);\n // It'll also move the returned position before image nodes,\n // even if those are behind it.\n if (offset < node.childNodes.length) {\n let next = node.childNodes[offset], box;\n if (next.nodeName == \"IMG\" && (box = next.getBoundingClientRect()).right <= coords.left &&\n box.bottom > coords.top)\n offset++;\n }\n }\n let prev;\n // When clicking above the right side of an uneditable node, Chrome will report a cursor position after that node.\n if (webkit && offset && node.nodeType == 1 && (prev = node.childNodes[offset - 1]).nodeType == 1 &&\n prev.contentEditable == \"false\" && prev.getBoundingClientRect().top >= coords.top)\n offset--;\n // Suspiciously specific kludge to work around caret*FromPoint\n // never returning a position at the end of the document\n if (node == view.dom && offset == node.childNodes.length - 1 && node.lastChild.nodeType == 1 &&\n coords.top > node.lastChild.getBoundingClientRect().bottom)\n pos = view.state.doc.content.size;\n // Ignore positions directly after a BR, since caret*FromPoint\n // 'round up' positions that would be more accurately placed\n // before the BR node.\n else if (offset == 0 || node.nodeType != 1 || node.childNodes[offset - 1].nodeName != \"BR\")\n pos = posFromCaret(view, node, offset, coords);\n }\n if (pos == null)\n pos = posFromElement(view, elt, coords);\n let desc = view.docView.nearestDesc(elt, true);\n return { pos, inside: desc ? desc.posAtStart - desc.border : -1 };\n}\nfunction nonZero(rect) {\n return rect.top < rect.bottom || rect.left < rect.right;\n}\nfunction singleRect(target, bias) {\n let rects = target.getClientRects();\n if (rects.length) {\n let first = rects[bias < 0 ? 0 : rects.length - 1];\n if (nonZero(first))\n return first;\n }\n return Array.prototype.find.call(rects, nonZero) || target.getBoundingClientRect();\n}\nconst BIDI = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n// Given a position in the document model, get a bounding box of the\n// character at that position, relative to the window.\nfunction coordsAtPos(view, pos, side) {\n let { node, offset, atom } = view.docView.domFromPos(pos, side < 0 ? -1 : 1);\n let supportEmptyRange = webkit || gecko;\n if (node.nodeType == 3) {\n // These browsers support querying empty text ranges. Prefer that in\n // bidi context or when at the end of a node.\n if (supportEmptyRange && (BIDI.test(node.nodeValue) || (side < 0 ? !offset : offset == node.nodeValue.length))) {\n let rect = singleRect(textRange(node, offset, offset), side);\n // Firefox returns bad results (the position before the space)\n // when querying a position directly after line-broken\n // whitespace. Detect this situation and and kludge around it\n if (gecko && offset && /\\s/.test(node.nodeValue[offset - 1]) && offset < node.nodeValue.length) {\n let rectBefore = singleRect(textRange(node, offset - 1, offset - 1), -1);\n if (rectBefore.top == rect.top) {\n let rectAfter = singleRect(textRange(node, offset, offset + 1), -1);\n if (rectAfter.top != rect.top)\n return flattenV(rectAfter, rectAfter.left < rectBefore.left);\n }\n }\n return rect;\n }\n else {\n let from = offset, to = offset, takeSide = side < 0 ? 1 : -1;\n if (side < 0 && !offset) {\n to++;\n takeSide = -1;\n }\n else if (side >= 0 && offset == node.nodeValue.length) {\n from--;\n takeSide = 1;\n }\n else if (side < 0) {\n from--;\n }\n else {\n to++;\n }\n return flattenV(singleRect(textRange(node, from, to), takeSide), takeSide < 0);\n }\n }\n let $dom = view.state.doc.resolve(pos - (atom || 0));\n // Return a horizontal line in block context\n if (!$dom.parent.inlineContent) {\n if (atom == null && offset && (side < 0 || offset == nodeSize(node))) {\n let before = node.childNodes[offset - 1];\n if (before.nodeType == 1)\n return flattenH(before.getBoundingClientRect(), false);\n }\n if (atom == null && offset < nodeSize(node)) {\n let after = node.childNodes[offset];\n if (after.nodeType == 1)\n return flattenH(after.getBoundingClientRect(), true);\n }\n return flattenH(node.getBoundingClientRect(), side >= 0);\n }\n // Inline, not in text node (this is not Bidi-safe)\n if (atom == null && offset && (side < 0 || offset == nodeSize(node))) {\n let before = node.childNodes[offset - 1];\n let target = before.nodeType == 3 ? textRange(before, nodeSize(before) - (supportEmptyRange ? 0 : 1))\n // BR nodes tend to only return the rectangle before them.\n // Only use them if they are the last element in their parent\n : before.nodeType == 1 && (before.nodeName != \"BR\" || !before.nextSibling) ? before : null;\n if (target)\n return flattenV(singleRect(target, 1), false);\n }\n if (atom == null && offset < nodeSize(node)) {\n let after = node.childNodes[offset];\n while (after.pmViewDesc && after.pmViewDesc.ignoreForCoords)\n after = after.nextSibling;\n let target = !after ? null : after.nodeType == 3 ? textRange(after, 0, (supportEmptyRange ? 0 : 1))\n : after.nodeType == 1 ? after : null;\n if (target)\n return flattenV(singleRect(target, -1), true);\n }\n // All else failed, just try to get a rectangle for the target node\n return flattenV(singleRect(node.nodeType == 3 ? textRange(node) : node, -side), side >= 0);\n}\nfunction flattenV(rect, left) {\n if (rect.width == 0)\n return rect;\n let x = left ? rect.left : rect.right;\n return { top: rect.top, bottom: rect.bottom, left: x, right: x };\n}\nfunction flattenH(rect, top) {\n if (rect.height == 0)\n return rect;\n let y = top ? rect.top : rect.bottom;\n return { top: y, bottom: y, left: rect.left, right: rect.right };\n}\nfunction withFlushedState(view, state, f) {\n let viewState = view.state, active = view.root.activeElement;\n if (viewState != state)\n view.updateState(state);\n if (active != view.dom)\n view.focus();\n try {\n return f();\n }\n finally {\n if (viewState != state)\n view.updateState(viewState);\n if (active != view.dom && active)\n active.focus();\n }\n}\n// Whether vertical position motion in a given direction\n// from a position would leave a text block.\nfunction endOfTextblockVertical(view, state, dir) {\n let sel = state.selection;\n let $pos = dir == \"up\" ? sel.$from : sel.$to;\n return withFlushedState(view, state, () => {\n let { node: dom } = view.docView.domFromPos($pos.pos, dir == \"up\" ? -1 : 1);\n for (;;) {\n let nearest = view.docView.nearestDesc(dom, true);\n if (!nearest)\n break;\n if (nearest.node.isBlock) {\n dom = nearest.contentDOM || nearest.dom;\n break;\n }\n dom = nearest.dom.parentNode;\n }\n let coords = coordsAtPos(view, $pos.pos, 1);\n for (let child = dom.firstChild; child; child = child.nextSibling) {\n let boxes;\n if (child.nodeType == 1)\n boxes = child.getClientRects();\n else if (child.nodeType == 3)\n boxes = textRange(child, 0, child.nodeValue.length).getClientRects();\n else\n continue;\n for (let i = 0; i < boxes.length; i++) {\n let box = boxes[i];\n if (box.bottom > box.top + 1 &&\n (dir == \"up\" ? coords.top - box.top > (box.bottom - coords.top) * 2\n : box.bottom - coords.bottom > (coords.bottom - box.top) * 2))\n return false;\n }\n }\n return true;\n });\n}\nconst maybeRTL = /[\\u0590-\\u08ac]/;\nfunction endOfTextblockHorizontal(view, state, dir) {\n let { $head } = state.selection;\n if (!$head.parent.isTextblock)\n return false;\n let offset = $head.parentOffset, atStart = !offset, atEnd = offset == $head.parent.content.size;\n let sel = view.domSelection();\n if (!sel)\n return $head.pos == $head.start() || $head.pos == $head.end();\n // If the textblock is all LTR, or the browser doesn't support\n // Selection.modify (Edge), fall back to a primitive approach\n if (!maybeRTL.test($head.parent.textContent) || !sel.modify)\n return dir == \"left\" || dir == \"backward\" ? atStart : atEnd;\n return withFlushedState(view, state, () => {\n // This is a huge hack, but appears to be the best we can\n // currently do: use `Selection.modify` to move the selection by\n // one character, and see if that moves the cursor out of the\n // textblock (or doesn't move it at all, when at the start/end of\n // the document).\n let { focusNode: oldNode, focusOffset: oldOff, anchorNode, anchorOffset } = view.domSelectionRange();\n let oldBidiLevel = sel.caretBidiLevel // Only for Firefox\n ;\n sel.modify(\"move\", dir, \"character\");\n let parentDOM = $head.depth ? view.docView.domAfterPos($head.before()) : view.dom;\n let { focusNode: newNode, focusOffset: newOff } = view.domSelectionRange();\n let result = newNode && !parentDOM.contains(newNode.nodeType == 1 ? newNode : newNode.parentNode) ||\n (oldNode == newNode && oldOff == newOff);\n // Restore the previous selection\n try {\n sel.collapse(anchorNode, anchorOffset);\n if (oldNode && (oldNode != anchorNode || oldOff != anchorOffset) && sel.extend)\n sel.extend(oldNode, oldOff);\n }\n catch (_) { }\n if (oldBidiLevel != null)\n sel.caretBidiLevel = oldBidiLevel;\n return result;\n });\n}\nlet cachedState = null;\nlet cachedDir = null;\nlet cachedResult = false;\nfunction endOfTextblock(view, state, dir) {\n if (cachedState == state && cachedDir == dir)\n return cachedResult;\n cachedState = state;\n cachedDir = dir;\n return cachedResult = dir == \"up\" || dir == \"down\"\n ? endOfTextblockVertical(view, state, dir)\n : endOfTextblockHorizontal(view, state, dir);\n}\n\n// View descriptions are data structures that describe the DOM that is\n// used to represent the editor's content. They are used for:\n//\n// - Incremental redrawing when the document changes\n//\n// - Figuring out what part of the document a given DOM position\n// corresponds to\n//\n// - Wiring in custom implementations of the editing interface for a\n// given node\n//\n// They form a doubly-linked mutable tree, starting at `view.docView`.\nconst NOT_DIRTY = 0, CHILD_DIRTY = 1, CONTENT_DIRTY = 2, NODE_DIRTY = 3;\n// Superclass for the various kinds of descriptions. Defines their\n// basic structure and shared methods.\nclass ViewDesc {\n constructor(parent, children, dom, \n // This is the node that holds the child views. It may be null for\n // descs that don't have children.\n contentDOM) {\n this.parent = parent;\n this.children = children;\n this.dom = dom;\n this.contentDOM = contentDOM;\n this.dirty = NOT_DIRTY;\n // An expando property on the DOM node provides a link back to its\n // description.\n dom.pmViewDesc = this;\n }\n // Used to check whether a given description corresponds to a\n // widget/mark/node.\n matchesWidget(widget) { return false; }\n matchesMark(mark) { return false; }\n matchesNode(node, outerDeco, innerDeco) { return false; }\n matchesHack(nodeName) { return false; }\n // When parsing in-editor content (in domchange.js), we allow\n // descriptions to determine the parse rules that should be used to\n // parse them.\n parseRule() { return null; }\n // Used by the editor's event handler to ignore events that come\n // from certain descs.\n stopEvent(event) { return false; }\n // The size of the content represented by this desc.\n get size() {\n let size = 0;\n for (let i = 0; i < this.children.length; i++)\n size += this.children[i].size;\n return size;\n }\n // For block nodes, this represents the space taken up by their\n // start/end tokens.\n get border() { return 0; }\n destroy() {\n this.parent = undefined;\n if (this.dom.pmViewDesc == this)\n this.dom.pmViewDesc = undefined;\n for (let i = 0; i < this.children.length; i++)\n this.children[i].destroy();\n }\n posBeforeChild(child) {\n for (let i = 0, pos = this.posAtStart;; i++) {\n let cur = this.children[i];\n if (cur == child)\n return pos;\n pos += cur.size;\n }\n }\n get posBefore() {\n return this.parent.posBeforeChild(this);\n }\n get posAtStart() {\n return this.parent ? this.parent.posBeforeChild(this) + this.border : 0;\n }\n get posAfter() {\n return this.posBefore + this.size;\n }\n get posAtEnd() {\n return this.posAtStart + this.size - 2 * this.border;\n }\n localPosFromDOM(dom, offset, bias) {\n // If the DOM position is in the content, use the child desc after\n // it to figure out a position.\n if (this.contentDOM && this.contentDOM.contains(dom.nodeType == 1 ? dom : dom.parentNode)) {\n if (bias < 0) {\n let domBefore, desc;\n if (dom == this.contentDOM) {\n domBefore = dom.childNodes[offset - 1];\n }\n else {\n while (dom.parentNode != this.contentDOM)\n dom = dom.parentNode;\n domBefore = dom.previousSibling;\n }\n while (domBefore && !((desc = domBefore.pmViewDesc) && desc.parent == this))\n domBefore = domBefore.previousSibling;\n return domBefore ? this.posBeforeChild(desc) + desc.size : this.posAtStart;\n }\n else {\n let domAfter, desc;\n if (dom == this.contentDOM) {\n domAfter = dom.childNodes[offset];\n }\n else {\n while (dom.parentNode != this.contentDOM)\n dom = dom.parentNode;\n domAfter = dom.nextSibling;\n }\n while (domAfter && !((desc = domAfter.pmViewDesc) && desc.parent == this))\n domAfter = domAfter.nextSibling;\n return domAfter ? this.posBeforeChild(desc) : this.posAtEnd;\n }\n }\n // Otherwise, use various heuristics, falling back on the bias\n // parameter, to determine whether to return the position at the\n // start or at the end of this view desc.\n let atEnd;\n if (dom == this.dom && this.contentDOM) {\n atEnd = offset > domIndex(this.contentDOM);\n }\n else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM)) {\n atEnd = dom.compareDocumentPosition(this.contentDOM) & 2;\n }\n else if (this.dom.firstChild) {\n if (offset == 0)\n for (let search = dom;; search = search.parentNode) {\n if (search == this.dom) {\n atEnd = false;\n break;\n }\n if (search.previousSibling)\n break;\n }\n if (atEnd == null && offset == dom.childNodes.length)\n for (let search = dom;; search = search.parentNode) {\n if (search == this.dom) {\n atEnd = true;\n break;\n }\n if (search.nextSibling)\n break;\n }\n }\n return (atEnd == null ? bias > 0 : atEnd) ? this.posAtEnd : this.posAtStart;\n }\n nearestDesc(dom, onlyNodes = false) {\n for (let first = true, cur = dom; cur; cur = cur.parentNode) {\n let desc = this.getDesc(cur), nodeDOM;\n if (desc && (!onlyNodes || desc.node)) {\n // If dom is outside of this desc's nodeDOM, don't count it.\n if (first && (nodeDOM = desc.nodeDOM) &&\n !(nodeDOM.nodeType == 1 ? nodeDOM.contains(dom.nodeType == 1 ? dom : dom.parentNode) : nodeDOM == dom))\n first = false;\n else\n return desc;\n }\n }\n }\n getDesc(dom) {\n let desc = dom.pmViewDesc;\n for (let cur = desc; cur; cur = cur.parent)\n if (cur == this)\n return desc;\n }\n posFromDOM(dom, offset, bias) {\n for (let scan = dom; scan; scan = scan.parentNode) {\n let desc = this.getDesc(scan);\n if (desc)\n return desc.localPosFromDOM(dom, offset, bias);\n }\n return -1;\n }\n // Find the desc for the node after the given pos, if any. (When a\n // parent node overrode rendering, there might not be one.)\n descAt(pos) {\n for (let i = 0, offset = 0; i < this.children.length; i++) {\n let child = this.children[i], end = offset + child.size;\n if (offset == pos && end != offset) {\n while (!child.border && child.children.length) {\n for (let i = 0; i < child.children.length; i++) {\n let inner = child.children[i];\n if (inner.size) {\n child = inner;\n break;\n }\n }\n }\n return child;\n }\n if (pos < end)\n return child.descAt(pos - offset - child.border);\n offset = end;\n }\n }\n domFromPos(pos, side) {\n if (!this.contentDOM)\n return { node: this.dom, offset: 0, atom: pos + 1 };\n // First find the position in the child array\n let i = 0, offset = 0;\n for (let curPos = 0; i < this.children.length; i++) {\n let child = this.children[i], end = curPos + child.size;\n if (end > pos || child instanceof TrailingHackViewDesc) {\n offset = pos - curPos;\n break;\n }\n curPos = end;\n }\n // If this points into the middle of a child, call through\n if (offset)\n return this.children[i].domFromPos(offset - this.children[i].border, side);\n // Go back if there were any zero-length widgets with side >= 0 before this point\n for (let prev; i && !(prev = this.children[i - 1]).size && prev instanceof WidgetViewDesc && prev.side >= 0; i--) { }\n // Scan towards the first useable node\n if (side <= 0) {\n let prev, enter = true;\n for (;; i--, enter = false) {\n prev = i ? this.children[i - 1] : null;\n if (!prev || prev.dom.parentNode == this.contentDOM)\n break;\n }\n if (prev && side && enter && !prev.border && !prev.domAtom)\n return prev.domFromPos(prev.size, side);\n return { node: this.contentDOM, offset: prev ? domIndex(prev.dom) + 1 : 0 };\n }\n else {\n let next, enter = true;\n for (;; i++, enter = false) {\n next = i < this.children.length ? this.children[i] : null;\n if (!next || next.dom.parentNode == this.contentDOM)\n break;\n }\n if (next && enter && !next.border && !next.domAtom)\n return next.domFromPos(0, side);\n return { node: this.contentDOM, offset: next ? domIndex(next.dom) : this.contentDOM.childNodes.length };\n }\n }\n // Used to find a DOM range in a single parent for a given changed\n // range.\n parseRange(from, to, base = 0) {\n if (this.children.length == 0)\n return { node: this.contentDOM, from, to, fromOffset: 0, toOffset: this.contentDOM.childNodes.length };\n let fromOffset = -1, toOffset = -1;\n for (let offset = base, i = 0;; i++) {\n let child = this.children[i], end = offset + child.size;\n if (fromOffset == -1 && from <= end) {\n let childBase = offset + child.border;\n // FIXME maybe descend mark views to parse a narrower range?\n if (from >= childBase && to <= end - child.border && child.node &&\n child.contentDOM && this.contentDOM.contains(child.contentDOM))\n return child.parseRange(from, to, childBase);\n from = offset;\n for (let j = i; j > 0; j--) {\n let prev = this.children[j - 1];\n if (prev.size && prev.dom.parentNode == this.contentDOM && !prev.emptyChildAt(1)) {\n fromOffset = domIndex(prev.dom) + 1;\n break;\n }\n from -= prev.size;\n }\n if (fromOffset == -1)\n fromOffset = 0;\n }\n if (fromOffset > -1 && (end > to || i == this.children.length - 1)) {\n to = end;\n for (let j = i + 1; j < this.children.length; j++) {\n let next = this.children[j];\n if (next.size && next.dom.parentNode == this.contentDOM && !next.emptyChildAt(-1)) {\n toOffset = domIndex(next.dom);\n break;\n }\n to += next.size;\n }\n if (toOffset == -1)\n toOffset = this.contentDOM.childNodes.length;\n break;\n }\n offset = end;\n }\n return { node: this.contentDOM, from, to, fromOffset, toOffset };\n }\n emptyChildAt(side) {\n if (this.border || !this.contentDOM || !this.children.length)\n return false;\n let child = this.children[side < 0 ? 0 : this.children.length - 1];\n return child.size == 0 || child.emptyChildAt(side);\n }\n domAfterPos(pos) {\n let { node, offset } = this.domFromPos(pos, 0);\n if (node.nodeType != 1 || offset == node.childNodes.length)\n throw new RangeError(\"No node after pos \" + pos);\n return node.childNodes[offset];\n }\n // View descs are responsible for setting any selection that falls\n // entirely inside of them, so that custom implementations can do\n // custom things with the selection. Note that this falls apart when\n // a selection starts in such a node and ends in another, in which\n // case we just use whatever domFromPos produces as a best effort.\n setSelection(anchor, head, view, force = false) {\n // If the selection falls entirely in a child, give it to that child\n let from = Math.min(anchor, head), to = Math.max(anchor, head);\n for (let i = 0, offset = 0; i < this.children.length; i++) {\n let child = this.children[i], end = offset + child.size;\n if (from > offset && to < end)\n return child.setSelection(anchor - offset - child.border, head - offset - child.border, view, force);\n offset = end;\n }\n let anchorDOM = this.domFromPos(anchor, anchor ? -1 : 1);\n let headDOM = head == anchor ? anchorDOM : this.domFromPos(head, head ? -1 : 1);\n let domSel = view.root.getSelection();\n let selRange = view.domSelectionRange();\n let brKludge = false;\n // On Firefox, using Selection.collapse to put the cursor after a\n // BR node for some reason doesn't always work (#1073). On Safari,\n // the cursor sometimes inexplicable visually lags behind its\n // reported position in such situations (#1092).\n if ((gecko || safari) && anchor == head) {\n let { node, offset } = anchorDOM;\n if (node.nodeType == 3) {\n brKludge = !!(offset && node.nodeValue[offset - 1] == \"\\n\");\n // Issue #1128\n if (brKludge && offset == node.nodeValue.length) {\n for (let scan = node, after; scan; scan = scan.parentNode) {\n if (after = scan.nextSibling) {\n if (after.nodeName == \"BR\")\n anchorDOM = headDOM = { node: after.parentNode, offset: domIndex(after) + 1 };\n break;\n }\n let desc = scan.pmViewDesc;\n if (desc && desc.node && desc.node.isBlock)\n break;\n }\n }\n }\n else {\n let prev = node.childNodes[offset - 1];\n brKludge = prev && (prev.nodeName == \"BR\" || prev.contentEditable == \"false\");\n }\n }\n // Firefox can act strangely when the selection is in front of an\n // uneditable node. See #1163 and https://bugzilla.mozilla.org/show_bug.cgi?id=1709536\n if (gecko && selRange.focusNode && selRange.focusNode != headDOM.node && selRange.focusNode.nodeType == 1) {\n let after = selRange.focusNode.childNodes[selRange.focusOffset];\n if (after && after.contentEditable == \"false\")\n force = true;\n }\n if (!(force || brKludge && safari) &&\n isEquivalentPosition(anchorDOM.node, anchorDOM.offset, selRange.anchorNode, selRange.anchorOffset) &&\n isEquivalentPosition(headDOM.node, headDOM.offset, selRange.focusNode, selRange.focusOffset))\n return;\n // Selection.extend can be used to create an 'inverted' selection\n // (one where the focus is before the anchor), but not all\n // browsers support it yet.\n let domSelExtended = false;\n if ((domSel.extend || anchor == head) && !brKludge) {\n domSel.collapse(anchorDOM.node, anchorDOM.offset);\n try {\n if (anchor != head)\n domSel.extend(headDOM.node, headDOM.offset);\n domSelExtended = true;\n }\n catch (_) {\n // In some cases with Chrome the selection is empty after calling\n // collapse, even when it should be valid. This appears to be a bug, but\n // it is difficult to isolate. If this happens fallback to the old path\n // without using extend.\n // Similarly, this could crash on Safari if the editor is hidden, and\n // there was no selection.\n }\n }\n if (!domSelExtended) {\n if (anchor > head) {\n let tmp = anchorDOM;\n anchorDOM = headDOM;\n headDOM = tmp;\n }\n let range = document.createRange();\n range.setEnd(headDOM.node, headDOM.offset);\n range.setStart(anchorDOM.node, anchorDOM.offset);\n domSel.removeAllRanges();\n domSel.addRange(range);\n }\n }\n ignoreMutation(mutation) {\n return !this.contentDOM && mutation.type != \"selection\";\n }\n get contentLost() {\n return this.contentDOM && this.contentDOM != this.dom && !this.dom.contains(this.contentDOM);\n }\n // Remove a subtree of the element tree that has been touched\n // by a DOM change, so that the next update will redraw it.\n markDirty(from, to) {\n for (let offset = 0, i = 0; i < this.children.length; i++) {\n let child = this.children[i], end = offset + child.size;\n if (offset == end ? from <= end && to >= offset : from < end && to > offset) {\n let startInside = offset + child.border, endInside = end - child.border;\n if (from >= startInside && to <= endInside) {\n this.dirty = from == offset || to == end ? CONTENT_DIRTY : CHILD_DIRTY;\n if (from == startInside && to == endInside &&\n (child.contentLost || child.dom.parentNode != this.contentDOM))\n child.dirty = NODE_DIRTY;\n else\n child.markDirty(from - startInside, to - startInside);\n return;\n }\n else {\n child.dirty = child.dom == child.contentDOM && child.dom.parentNode == this.contentDOM && !child.children.length\n ? CONTENT_DIRTY : NODE_DIRTY;\n }\n }\n offset = end;\n }\n this.dirty = CONTENT_DIRTY;\n }\n markParentsDirty() {\n let level = 1;\n for (let node = this.parent; node; node = node.parent, level++) {\n let dirty = level == 1 ? CONTENT_DIRTY : CHILD_DIRTY;\n if (node.dirty < dirty)\n node.dirty = dirty;\n }\n }\n get domAtom() { return false; }\n get ignoreForCoords() { return false; }\n isText(text) { return false; }\n}\n// A widget desc represents a widget decoration, which is a DOM node\n// drawn between the document nodes.\nclass WidgetViewDesc extends ViewDesc {\n constructor(parent, widget, view, pos) {\n let self, dom = widget.type.toDOM;\n if (typeof dom == \"function\")\n dom = dom(view, () => {\n if (!self)\n return pos;\n if (self.parent)\n return self.parent.posBeforeChild(self);\n });\n if (!widget.type.spec.raw) {\n if (dom.nodeType != 1) {\n let wrap = document.createElement(\"span\");\n wrap.appendChild(dom);\n dom = wrap;\n }\n dom.contentEditable = \"false\";\n dom.classList.add(\"ProseMirror-widget\");\n }\n super(parent, [], dom, null);\n this.widget = widget;\n this.widget = widget;\n self = this;\n }\n matchesWidget(widget) {\n return this.dirty == NOT_DIRTY && widget.type.eq(this.widget.type);\n }\n parseRule() { return { ignore: true }; }\n stopEvent(event) {\n let stop = this.widget.spec.stopEvent;\n return stop ? stop(event) : false;\n }\n ignoreMutation(mutation) {\n return mutation.type != \"selection\" || this.widget.spec.ignoreSelection;\n }\n destroy() {\n this.widget.type.destroy(this.dom);\n super.destroy();\n }\n get domAtom() { return true; }\n get side() { return this.widget.type.side; }\n}\nclass CompositionViewDesc extends ViewDesc {\n constructor(parent, dom, textDOM, text) {\n super(parent, [], dom, null);\n this.textDOM = textDOM;\n this.text = text;\n }\n get size() { return this.text.length; }\n localPosFromDOM(dom, offset) {\n if (dom != this.textDOM)\n return this.posAtStart + (offset ? this.size : 0);\n return this.posAtStart + offset;\n }\n domFromPos(pos) {\n return { node: this.textDOM, offset: pos };\n }\n ignoreMutation(mut) {\n return mut.type === 'characterData' && mut.target.nodeValue == mut.oldValue;\n }\n}\n// A mark desc represents a mark. May have multiple children,\n// depending on how the mark is split. Note that marks are drawn using\n// a fixed nesting order, for simplicity and predictability, so in\n// some cases they will be split more often than would appear\n// necessary.\nclass MarkViewDesc extends ViewDesc {\n constructor(parent, mark, dom, contentDOM, spec) {\n super(parent, [], dom, contentDOM);\n this.mark = mark;\n this.spec = spec;\n }\n static create(parent, mark, inline, view) {\n let custom = view.nodeViews[mark.type.name];\n let spec = custom && custom(mark, view, inline);\n if (!spec || !spec.dom)\n spec = DOMSerializer.renderSpec(document, mark.type.spec.toDOM(mark, inline), null, mark.attrs);\n return new MarkViewDesc(parent, mark, spec.dom, spec.contentDOM || spec.dom, spec);\n }\n parseRule() {\n if ((this.dirty & NODE_DIRTY) || this.mark.type.spec.reparseInView)\n return null;\n return { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };\n }\n matchesMark(mark) { return this.dirty != NODE_DIRTY && this.mark.eq(mark); }\n markDirty(from, to) {\n super.markDirty(from, to);\n // Move dirty info to nearest node view\n if (this.dirty != NOT_DIRTY) {\n let parent = this.parent;\n while (!parent.node)\n parent = parent.parent;\n if (parent.dirty < this.dirty)\n parent.dirty = this.dirty;\n this.dirty = NOT_DIRTY;\n }\n }\n slice(from, to, view) {\n let copy = MarkViewDesc.create(this.parent, this.mark, true, view);\n let nodes = this.children, size = this.size;\n if (to < size)\n nodes = replaceNodes(nodes, to, size, view);\n if (from > 0)\n nodes = replaceNodes(nodes, 0, from, view);\n for (let i = 0; i < nodes.length; i++)\n nodes[i].parent = copy;\n copy.children = nodes;\n return copy;\n }\n ignoreMutation(mutation) {\n return this.spec.ignoreMutation ? this.spec.ignoreMutation(mutation) : super.ignoreMutation(mutation);\n }\n destroy() {\n if (this.spec.destroy)\n this.spec.destroy();\n super.destroy();\n }\n}\n// Node view descs are the main, most common type of view desc, and\n// correspond to an actual node in the document. Unlike mark descs,\n// they populate their child array themselves.\nclass NodeViewDesc extends ViewDesc {\n constructor(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos) {\n super(parent, [], dom, contentDOM);\n this.node = node;\n this.outerDeco = outerDeco;\n this.innerDeco = innerDeco;\n this.nodeDOM = nodeDOM;\n }\n // By default, a node is rendered using the `toDOM` method from the\n // node type spec. But client code can use the `nodeViews` spec to\n // supply a custom node view, which can influence various aspects of\n // the way the node works.\n //\n // (Using subclassing for this was intentionally decided against,\n // since it'd require exposing a whole slew of finicky\n // implementation details to the user code that they probably will\n // never need.)\n static create(parent, node, outerDeco, innerDeco, view, pos) {\n let custom = view.nodeViews[node.type.name], descObj;\n let spec = custom && custom(node, view, () => {\n // (This is a function that allows the custom view to find its\n // own position)\n if (!descObj)\n return pos;\n if (descObj.parent)\n return descObj.parent.posBeforeChild(descObj);\n }, outerDeco, innerDeco);\n let dom = spec && spec.dom, contentDOM = spec && spec.contentDOM;\n if (node.isText) {\n if (!dom)\n dom = document.createTextNode(node.text);\n else if (dom.nodeType != 3)\n throw new RangeError(\"Text must be rendered as a DOM text node\");\n }\n else if (!dom) {\n let spec = DOMSerializer.renderSpec(document, node.type.spec.toDOM(node), null, node.attrs);\n ({ dom, contentDOM } = spec);\n }\n if (!contentDOM && !node.isText && dom.nodeName != \"BR\") { // Chrome gets confused by
\n if (!dom.hasAttribute(\"contenteditable\"))\n dom.contentEditable = \"false\";\n if (node.type.spec.draggable)\n dom.draggable = true;\n }\n let nodeDOM = dom;\n dom = applyOuterDeco(dom, outerDeco, node);\n if (spec)\n return descObj = new CustomNodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM || null, nodeDOM, spec, view, pos + 1);\n else if (node.isText)\n return new TextViewDesc(parent, node, outerDeco, innerDeco, dom, nodeDOM, view);\n else\n return new NodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM || null, nodeDOM, view, pos + 1);\n }\n parseRule() {\n // Experimental kludge to allow opt-in re-parsing of nodes\n if (this.node.type.spec.reparseInView)\n return null;\n // FIXME the assumption that this can always return the current\n // attrs means that if the user somehow manages to change the\n // attrs in the dom, that won't be picked up. Not entirely sure\n // whether this is a problem\n let rule = { node: this.node.type.name, attrs: this.node.attrs };\n if (this.node.type.whitespace == \"pre\")\n rule.preserveWhitespace = \"full\";\n if (!this.contentDOM) {\n rule.getContent = () => this.node.content;\n }\n else if (!this.contentLost) {\n rule.contentElement = this.contentDOM;\n }\n else {\n // Chrome likes to randomly recreate parent nodes when\n // backspacing things. When that happens, this tries to find the\n // new parent.\n for (let i = this.children.length - 1; i >= 0; i--) {\n let child = this.children[i];\n if (this.dom.contains(child.dom.parentNode)) {\n rule.contentElement = child.dom.parentNode;\n break;\n }\n }\n if (!rule.contentElement)\n rule.getContent = () => Fragment.empty;\n }\n return rule;\n }\n matchesNode(node, outerDeco, innerDeco) {\n return this.dirty == NOT_DIRTY && node.eq(this.node) &&\n sameOuterDeco(outerDeco, this.outerDeco) && innerDeco.eq(this.innerDeco);\n }\n get size() { return this.node.nodeSize; }\n get border() { return this.node.isLeaf ? 0 : 1; }\n // Syncs `this.children` to match `this.node.content` and the local\n // decorations, possibly introducing nesting for marks. Then, in a\n // separate step, syncs the DOM inside `this.contentDOM` to\n // `this.children`.\n updateChildren(view, pos) {\n let inline = this.node.inlineContent, off = pos;\n let composition = view.composing ? this.localCompositionInfo(view, pos) : null;\n let localComposition = composition && composition.pos > -1 ? composition : null;\n let compositionInChild = composition && composition.pos < 0;\n let updater = new ViewTreeUpdater(this, localComposition && localComposition.node, view);\n iterDeco(this.node, this.innerDeco, (widget, i, insideNode) => {\n if (widget.spec.marks)\n updater.syncToMarks(widget.spec.marks, inline, view);\n else if (widget.type.side >= 0 && !insideNode)\n updater.syncToMarks(i == this.node.childCount ? Mark.none : this.node.child(i).marks, inline, view);\n // If the next node is a desc matching this widget, reuse it,\n // otherwise insert the widget as a new view desc.\n updater.placeWidget(widget, view, off);\n }, (child, outerDeco, innerDeco, i) => {\n // Make sure the wrapping mark descs match the node's marks.\n updater.syncToMarks(child.marks, inline, view);\n // Try several strategies for drawing this node\n let compIndex;\n if (updater.findNodeMatch(child, outerDeco, innerDeco, i)) ;\n else if (compositionInChild && view.state.selection.from > off &&\n view.state.selection.to < off + child.nodeSize &&\n (compIndex = updater.findIndexWithChild(composition.node)) > -1 &&\n updater.updateNodeAt(child, outerDeco, innerDeco, compIndex, view)) ;\n else if (updater.updateNextNode(child, outerDeco, innerDeco, view, i, off)) ;\n else {\n // Add it as a new view\n updater.addNode(child, outerDeco, innerDeco, view, off);\n }\n off += child.nodeSize;\n });\n // Drop all remaining descs after the current position.\n updater.syncToMarks([], inline, view);\n if (this.node.isTextblock)\n updater.addTextblockHacks();\n updater.destroyRest();\n // Sync the DOM if anything changed\n if (updater.changed || this.dirty == CONTENT_DIRTY) {\n // May have to protect focused DOM from being changed if a composition is active\n if (localComposition)\n this.protectLocalComposition(view, localComposition);\n renderDescs(this.contentDOM, this.children, view);\n if (ios)\n iosHacks(this.dom);\n }\n }\n localCompositionInfo(view, pos) {\n // Only do something if both the selection and a focused text node\n // are inside of this node\n let { from, to } = view.state.selection;\n if (!(view.state.selection instanceof TextSelection) || from < pos || to > pos + this.node.content.size)\n return null;\n let textNode = view.input.compositionNode;\n if (!textNode || !this.dom.contains(textNode.parentNode))\n return null;\n if (this.node.inlineContent) {\n // Find the text in the focused node in the node, stop if it's not\n // there (may have been modified through other means, in which\n // case it should overwritten)\n let text = textNode.nodeValue;\n let textPos = findTextInFragment(this.node.content, text, from - pos, to - pos);\n return textPos < 0 ? null : { node: textNode, pos: textPos, text };\n }\n else {\n return { node: textNode, pos: -1, text: \"\" };\n }\n }\n protectLocalComposition(view, { node, pos, text }) {\n // The node is already part of a local view desc, leave it there\n if (this.getDesc(node))\n return;\n // Create a composition view for the orphaned nodes\n let topNode = node;\n for (;; topNode = topNode.parentNode) {\n if (topNode.parentNode == this.contentDOM)\n break;\n while (topNode.previousSibling)\n topNode.parentNode.removeChild(topNode.previousSibling);\n while (topNode.nextSibling)\n topNode.parentNode.removeChild(topNode.nextSibling);\n if (topNode.pmViewDesc)\n topNode.pmViewDesc = undefined;\n }\n let desc = new CompositionViewDesc(this, topNode, node, text);\n view.input.compositionNodes.push(desc);\n // Patch up this.children to contain the composition view\n this.children = replaceNodes(this.children, pos, pos + text.length, view, desc);\n }\n // If this desc must be updated to match the given node decoration,\n // do so and return true.\n update(node, outerDeco, innerDeco, view) {\n if (this.dirty == NODE_DIRTY ||\n !node.sameMarkup(this.node))\n return false;\n this.updateInner(node, outerDeco, innerDeco, view);\n return true;\n }\n updateInner(node, outerDeco, innerDeco, view) {\n this.updateOuterDeco(outerDeco);\n this.node = node;\n this.innerDeco = innerDeco;\n if (this.contentDOM)\n this.updateChildren(view, this.posAtStart);\n this.dirty = NOT_DIRTY;\n }\n updateOuterDeco(outerDeco) {\n if (sameOuterDeco(outerDeco, this.outerDeco))\n return;\n let needsWrap = this.nodeDOM.nodeType != 1;\n let oldDOM = this.dom;\n this.dom = patchOuterDeco(this.dom, this.nodeDOM, computeOuterDeco(this.outerDeco, this.node, needsWrap), computeOuterDeco(outerDeco, this.node, needsWrap));\n if (this.dom != oldDOM) {\n oldDOM.pmViewDesc = undefined;\n this.dom.pmViewDesc = this;\n }\n this.outerDeco = outerDeco;\n }\n // Mark this node as being the selected node.\n selectNode() {\n if (this.nodeDOM.nodeType == 1)\n this.nodeDOM.classList.add(\"ProseMirror-selectednode\");\n if (this.contentDOM || !this.node.type.spec.draggable)\n this.dom.draggable = true;\n }\n // Remove selected node marking from this node.\n deselectNode() {\n if (this.nodeDOM.nodeType == 1) {\n this.nodeDOM.classList.remove(\"ProseMirror-selectednode\");\n if (this.contentDOM || !this.node.type.spec.draggable)\n this.dom.removeAttribute(\"draggable\");\n }\n }\n get domAtom() { return this.node.isAtom; }\n}\n// Create a view desc for the top-level document node, to be exported\n// and used by the view class.\nfunction docViewDesc(doc, outerDeco, innerDeco, dom, view) {\n applyOuterDeco(dom, outerDeco, doc);\n let docView = new NodeViewDesc(undefined, doc, outerDeco, innerDeco, dom, dom, dom, view, 0);\n if (docView.contentDOM)\n docView.updateChildren(view, 0);\n return docView;\n}\nclass TextViewDesc extends NodeViewDesc {\n constructor(parent, node, outerDeco, innerDeco, dom, nodeDOM, view) {\n super(parent, node, outerDeco, innerDeco, dom, null, nodeDOM, view, 0);\n }\n parseRule() {\n let skip = this.nodeDOM.parentNode;\n while (skip && skip != this.dom && !skip.pmIsDeco)\n skip = skip.parentNode;\n return { skip: (skip || true) };\n }\n update(node, outerDeco, innerDeco, view) {\n if (this.dirty == NODE_DIRTY || (this.dirty != NOT_DIRTY && !this.inParent()) ||\n !node.sameMarkup(this.node))\n return false;\n this.updateOuterDeco(outerDeco);\n if ((this.dirty != NOT_DIRTY || node.text != this.node.text) && node.text != this.nodeDOM.nodeValue) {\n this.nodeDOM.nodeValue = node.text;\n if (view.trackWrites == this.nodeDOM)\n view.trackWrites = null;\n }\n this.node = node;\n this.dirty = NOT_DIRTY;\n return true;\n }\n inParent() {\n let parentDOM = this.parent.contentDOM;\n for (let n = this.nodeDOM; n; n = n.parentNode)\n if (n == parentDOM)\n return true;\n return false;\n }\n domFromPos(pos) {\n return { node: this.nodeDOM, offset: pos };\n }\n localPosFromDOM(dom, offset, bias) {\n if (dom == this.nodeDOM)\n return this.posAtStart + Math.min(offset, this.node.text.length);\n return super.localPosFromDOM(dom, offset, bias);\n }\n ignoreMutation(mutation) {\n return mutation.type != \"characterData\" && mutation.type != \"selection\";\n }\n slice(from, to, view) {\n let node = this.node.cut(from, to), dom = document.createTextNode(node.text);\n return new TextViewDesc(this.parent, node, this.outerDeco, this.innerDeco, dom, dom, view);\n }\n markDirty(from, to) {\n super.markDirty(from, to);\n if (this.dom != this.nodeDOM && (from == 0 || to == this.nodeDOM.nodeValue.length))\n this.dirty = NODE_DIRTY;\n }\n get domAtom() { return false; }\n isText(text) { return this.node.text == text; }\n}\n// A dummy desc used to tag trailing BR or IMG nodes created to work\n// around contentEditable terribleness.\nclass TrailingHackViewDesc extends ViewDesc {\n parseRule() { return { ignore: true }; }\n matchesHack(nodeName) { return this.dirty == NOT_DIRTY && this.dom.nodeName == nodeName; }\n get domAtom() { return true; }\n get ignoreForCoords() { return this.dom.nodeName == \"IMG\"; }\n}\n// A separate subclass is used for customized node views, so that the\n// extra checks only have to be made for nodes that are actually\n// customized.\nclass CustomNodeViewDesc extends NodeViewDesc {\n constructor(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, spec, view, pos) {\n super(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos);\n this.spec = spec;\n }\n // A custom `update` method gets to decide whether the update goes\n // through. If it does, and there's a `contentDOM` node, our logic\n // updates the children.\n update(node, outerDeco, innerDeco, view) {\n if (this.dirty == NODE_DIRTY)\n return false;\n if (this.spec.update && (this.node.type == node.type || this.spec.multiType)) {\n let result = this.spec.update(node, outerDeco, innerDeco);\n if (result)\n this.updateInner(node, outerDeco, innerDeco, view);\n return result;\n }\n else if (!this.contentDOM && !node.isLeaf) {\n return false;\n }\n else {\n return super.update(node, outerDeco, innerDeco, view);\n }\n }\n selectNode() {\n this.spec.selectNode ? this.spec.selectNode() : super.selectNode();\n }\n deselectNode() {\n this.spec.deselectNode ? this.spec.deselectNode() : super.deselectNode();\n }\n setSelection(anchor, head, view, force) {\n this.spec.setSelection ? this.spec.setSelection(anchor, head, view.root)\n : super.setSelection(anchor, head, view, force);\n }\n destroy() {\n if (this.spec.destroy)\n this.spec.destroy();\n super.destroy();\n }\n stopEvent(event) {\n return this.spec.stopEvent ? this.spec.stopEvent(event) : false;\n }\n ignoreMutation(mutation) {\n return this.spec.ignoreMutation ? this.spec.ignoreMutation(mutation) : super.ignoreMutation(mutation);\n }\n}\n// Sync the content of the given DOM node with the nodes associated\n// with the given array of view descs, recursing into mark descs\n// because this should sync the subtree for a whole node at a time.\nfunction renderDescs(parentDOM, descs, view) {\n let dom = parentDOM.firstChild, written = false;\n for (let i = 0; i < descs.length; i++) {\n let desc = descs[i], childDOM = desc.dom;\n if (childDOM.parentNode == parentDOM) {\n while (childDOM != dom) {\n dom = rm(dom);\n written = true;\n }\n dom = dom.nextSibling;\n }\n else {\n written = true;\n parentDOM.insertBefore(childDOM, dom);\n }\n if (desc instanceof MarkViewDesc) {\n let pos = dom ? dom.previousSibling : parentDOM.lastChild;\n renderDescs(desc.contentDOM, desc.children, view);\n dom = pos ? pos.nextSibling : parentDOM.firstChild;\n }\n }\n while (dom) {\n dom = rm(dom);\n written = true;\n }\n if (written && view.trackWrites == parentDOM)\n view.trackWrites = null;\n}\nconst OuterDecoLevel = function (nodeName) {\n if (nodeName)\n this.nodeName = nodeName;\n};\nOuterDecoLevel.prototype = Object.create(null);\nconst noDeco = [new OuterDecoLevel];\nfunction computeOuterDeco(outerDeco, node, needsWrap) {\n if (outerDeco.length == 0)\n return noDeco;\n let top = needsWrap ? noDeco[0] : new OuterDecoLevel, result = [top];\n for (let i = 0; i < outerDeco.length; i++) {\n let attrs = outerDeco[i].type.attrs;\n if (!attrs)\n continue;\n if (attrs.nodeName)\n result.push(top = new OuterDecoLevel(attrs.nodeName));\n for (let name in attrs) {\n let val = attrs[name];\n if (val == null)\n continue;\n if (needsWrap && result.length == 1)\n result.push(top = new OuterDecoLevel(node.isInline ? \"span\" : \"div\"));\n if (name == \"class\")\n top.class = (top.class ? top.class + \" \" : \"\") + val;\n else if (name == \"style\")\n top.style = (top.style ? top.style + \";\" : \"\") + val;\n else if (name != \"nodeName\")\n top[name] = val;\n }\n }\n return result;\n}\nfunction patchOuterDeco(outerDOM, nodeDOM, prevComputed, curComputed) {\n // Shortcut for trivial case\n if (prevComputed == noDeco && curComputed == noDeco)\n return nodeDOM;\n let curDOM = nodeDOM;\n for (let i = 0; i < curComputed.length; i++) {\n let deco = curComputed[i], prev = prevComputed[i];\n if (i) {\n let parent;\n if (prev && prev.nodeName == deco.nodeName && curDOM != outerDOM &&\n (parent = curDOM.parentNode) && parent.nodeName.toLowerCase() == deco.nodeName) {\n curDOM = parent;\n }\n else {\n parent = document.createElement(deco.nodeName);\n parent.pmIsDeco = true;\n parent.appendChild(curDOM);\n prev = noDeco[0];\n curDOM = parent;\n }\n }\n patchAttributes(curDOM, prev || noDeco[0], deco);\n }\n return curDOM;\n}\nfunction patchAttributes(dom, prev, cur) {\n for (let name in prev)\n if (name != \"class\" && name != \"style\" && name != \"nodeName\" && !(name in cur))\n dom.removeAttribute(name);\n for (let name in cur)\n if (name != \"class\" && name != \"style\" && name != \"nodeName\" && cur[name] != prev[name])\n dom.setAttribute(name, cur[name]);\n if (prev.class != cur.class) {\n let prevList = prev.class ? prev.class.split(\" \").filter(Boolean) : [];\n let curList = cur.class ? cur.class.split(\" \").filter(Boolean) : [];\n for (let i = 0; i < prevList.length; i++)\n if (curList.indexOf(prevList[i]) == -1)\n dom.classList.remove(prevList[i]);\n for (let i = 0; i < curList.length; i++)\n if (prevList.indexOf(curList[i]) == -1)\n dom.classList.add(curList[i]);\n if (dom.classList.length == 0)\n dom.removeAttribute(\"class\");\n }\n if (prev.style != cur.style) {\n if (prev.style) {\n let prop = /\\s*([\\w\\-\\xa1-\\uffff]+)\\s*:(?:\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|\\(.*?\\)|[^;])*/g, m;\n while (m = prop.exec(prev.style))\n dom.style.removeProperty(m[1]);\n }\n if (cur.style)\n dom.style.cssText += cur.style;\n }\n}\nfunction applyOuterDeco(dom, deco, node) {\n return patchOuterDeco(dom, dom, noDeco, computeOuterDeco(deco, node, dom.nodeType != 1));\n}\nfunction sameOuterDeco(a, b) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!a[i].type.eq(b[i].type))\n return false;\n return true;\n}\n// Remove a DOM node and return its next sibling.\nfunction rm(dom) {\n let next = dom.nextSibling;\n dom.parentNode.removeChild(dom);\n return next;\n}\n// Helper class for incrementally updating a tree of mark descs and\n// the widget and node descs inside of them.\nclass ViewTreeUpdater {\n constructor(top, lock, view) {\n this.lock = lock;\n this.view = view;\n // Index into `this.top`'s child array, represents the current\n // update position.\n this.index = 0;\n // When entering a mark, the current top and index are pushed\n // onto this.\n this.stack = [];\n // Tracks whether anything was changed\n this.changed = false;\n this.top = top;\n this.preMatch = preMatch(top.node.content, top);\n }\n // Destroy and remove the children between the given indices in\n // `this.top`.\n destroyBetween(start, end) {\n if (start == end)\n return;\n for (let i = start; i < end; i++)\n this.top.children[i].destroy();\n this.top.children.splice(start, end - start);\n this.changed = true;\n }\n // Destroy all remaining children in `this.top`.\n destroyRest() {\n this.destroyBetween(this.index, this.top.children.length);\n }\n // Sync the current stack of mark descs with the given array of\n // marks, reusing existing mark descs when possible.\n syncToMarks(marks, inline, view) {\n let keep = 0, depth = this.stack.length >> 1;\n let maxKeep = Math.min(depth, marks.length);\n while (keep < maxKeep &&\n (keep == depth - 1 ? this.top : this.stack[(keep + 1) << 1])\n .matchesMark(marks[keep]) && marks[keep].type.spec.spanning !== false)\n keep++;\n while (keep < depth) {\n this.destroyRest();\n this.top.dirty = NOT_DIRTY;\n this.index = this.stack.pop();\n this.top = this.stack.pop();\n depth--;\n }\n while (depth < marks.length) {\n this.stack.push(this.top, this.index + 1);\n let found = -1;\n for (let i = this.index; i < Math.min(this.index + 3, this.top.children.length); i++) {\n let next = this.top.children[i];\n if (next.matchesMark(marks[depth]) && !this.isLocked(next.dom)) {\n found = i;\n break;\n }\n }\n if (found > -1) {\n if (found > this.index) {\n this.changed = true;\n this.destroyBetween(this.index, found);\n }\n this.top = this.top.children[this.index];\n }\n else {\n let markDesc = MarkViewDesc.create(this.top, marks[depth], inline, view);\n this.top.children.splice(this.index, 0, markDesc);\n this.top = markDesc;\n this.changed = true;\n }\n this.index = 0;\n depth++;\n }\n }\n // Try to find a node desc matching the given data. Skip over it and\n // return true when successful.\n findNodeMatch(node, outerDeco, innerDeco, index) {\n let found = -1, targetDesc;\n if (index >= this.preMatch.index &&\n (targetDesc = this.preMatch.matches[index - this.preMatch.index]).parent == this.top &&\n targetDesc.matchesNode(node, outerDeco, innerDeco)) {\n found = this.top.children.indexOf(targetDesc, this.index);\n }\n else {\n for (let i = this.index, e = Math.min(this.top.children.length, i + 5); i < e; i++) {\n let child = this.top.children[i];\n if (child.matchesNode(node, outerDeco, innerDeco) && !this.preMatch.matched.has(child)) {\n found = i;\n break;\n }\n }\n }\n if (found < 0)\n return false;\n this.destroyBetween(this.index, found);\n this.index++;\n return true;\n }\n updateNodeAt(node, outerDeco, innerDeco, index, view) {\n let child = this.top.children[index];\n if (child.dirty == NODE_DIRTY && child.dom == child.contentDOM)\n child.dirty = CONTENT_DIRTY;\n if (!child.update(node, outerDeco, innerDeco, view))\n return false;\n this.destroyBetween(this.index, index);\n this.index++;\n return true;\n }\n findIndexWithChild(domNode) {\n for (;;) {\n let parent = domNode.parentNode;\n if (!parent)\n return -1;\n if (parent == this.top.contentDOM) {\n let desc = domNode.pmViewDesc;\n if (desc)\n for (let i = this.index; i < this.top.children.length; i++) {\n if (this.top.children[i] == desc)\n return i;\n }\n return -1;\n }\n domNode = parent;\n }\n }\n // Try to update the next node, if any, to the given data. Checks\n // pre-matches to avoid overwriting nodes that could still be used.\n updateNextNode(node, outerDeco, innerDeco, view, index, pos) {\n for (let i = this.index; i < this.top.children.length; i++) {\n let next = this.top.children[i];\n if (next instanceof NodeViewDesc) {\n let preMatch = this.preMatch.matched.get(next);\n if (preMatch != null && preMatch != index)\n return false;\n let nextDOM = next.dom, updated;\n // Can't update if nextDOM is or contains this.lock, except if\n // it's a text node whose content already matches the new text\n // and whose decorations match the new ones.\n let locked = this.isLocked(nextDOM) &&\n !(node.isText && next.node && next.node.isText && next.nodeDOM.nodeValue == node.text &&\n next.dirty != NODE_DIRTY && sameOuterDeco(outerDeco, next.outerDeco));\n if (!locked && next.update(node, outerDeco, innerDeco, view)) {\n this.destroyBetween(this.index, i);\n if (next.dom != nextDOM)\n this.changed = true;\n this.index++;\n return true;\n }\n else if (!locked && (updated = this.recreateWrapper(next, node, outerDeco, innerDeco, view, pos))) {\n this.destroyBetween(this.index, i);\n this.top.children[this.index] = updated;\n if (updated.contentDOM) {\n updated.dirty = CONTENT_DIRTY;\n updated.updateChildren(view, pos + 1);\n updated.dirty = NOT_DIRTY;\n }\n this.changed = true;\n this.index++;\n return true;\n }\n break;\n }\n }\n return false;\n }\n // When a node with content is replaced by a different node with\n // identical content, move over its children.\n recreateWrapper(next, node, outerDeco, innerDeco, view, pos) {\n if (next.dirty || node.isAtom || !next.children.length ||\n !next.node.content.eq(node.content) ||\n !sameOuterDeco(outerDeco, next.outerDeco) || !innerDeco.eq(next.innerDeco))\n return null;\n let wrapper = NodeViewDesc.create(this.top, node, outerDeco, innerDeco, view, pos);\n if (wrapper.contentDOM) {\n wrapper.children = next.children;\n next.children = [];\n for (let ch of wrapper.children)\n ch.parent = wrapper;\n }\n next.destroy();\n return wrapper;\n }\n // Insert the node as a newly created node desc.\n addNode(node, outerDeco, innerDeco, view, pos) {\n let desc = NodeViewDesc.create(this.top, node, outerDeco, innerDeco, view, pos);\n if (desc.contentDOM)\n desc.updateChildren(view, pos + 1);\n this.top.children.splice(this.index++, 0, desc);\n this.changed = true;\n }\n placeWidget(widget, view, pos) {\n let next = this.index < this.top.children.length ? this.top.children[this.index] : null;\n if (next && next.matchesWidget(widget) &&\n (widget == next.widget || !next.widget.type.toDOM.parentNode)) {\n this.index++;\n }\n else {\n let desc = new WidgetViewDesc(this.top, widget, view, pos);\n this.top.children.splice(this.index++, 0, desc);\n this.changed = true;\n }\n }\n // Make sure a textblock looks and behaves correctly in\n // contentEditable.\n addTextblockHacks() {\n let lastChild = this.top.children[this.index - 1], parent = this.top;\n while (lastChild instanceof MarkViewDesc) {\n parent = lastChild;\n lastChild = parent.children[parent.children.length - 1];\n }\n if (!lastChild || // Empty textblock\n !(lastChild instanceof TextViewDesc) ||\n /\\n$/.test(lastChild.node.text) ||\n (this.view.requiresGeckoHackNode && /\\s$/.test(lastChild.node.text))) {\n // Avoid bugs in Safari's cursor drawing (#1165) and Chrome's mouse selection (#1152)\n if ((safari || chrome) && lastChild && lastChild.dom.contentEditable == \"false\")\n this.addHackNode(\"IMG\", parent);\n this.addHackNode(\"BR\", this.top);\n }\n }\n addHackNode(nodeName, parent) {\n if (parent == this.top && this.index < parent.children.length && parent.children[this.index].matchesHack(nodeName)) {\n this.index++;\n }\n else {\n let dom = document.createElement(nodeName);\n if (nodeName == \"IMG\") {\n dom.className = \"ProseMirror-separator\";\n dom.alt = \"\";\n }\n if (nodeName == \"BR\")\n dom.className = \"ProseMirror-trailingBreak\";\n let hack = new TrailingHackViewDesc(this.top, [], dom, null);\n if (parent != this.top)\n parent.children.push(hack);\n else\n parent.children.splice(this.index++, 0, hack);\n this.changed = true;\n }\n }\n isLocked(node) {\n return this.lock && (node == this.lock || node.nodeType == 1 && node.contains(this.lock.parentNode));\n }\n}\n// Iterate from the end of the fragment and array of descs to find\n// directly matching ones, in order to avoid overeagerly reusing those\n// for other nodes. Returns the fragment index of the first node that\n// is part of the sequence of matched nodes at the end of the\n// fragment.\nfunction preMatch(frag, parentDesc) {\n let curDesc = parentDesc, descI = curDesc.children.length;\n let fI = frag.childCount, matched = new Map, matches = [];\n outer: while (fI > 0) {\n let desc;\n for (;;) {\n if (descI) {\n let next = curDesc.children[descI - 1];\n if (next instanceof MarkViewDesc) {\n curDesc = next;\n descI = next.children.length;\n }\n else {\n desc = next;\n descI--;\n break;\n }\n }\n else if (curDesc == parentDesc) {\n break outer;\n }\n else {\n // FIXME\n descI = curDesc.parent.children.indexOf(curDesc);\n curDesc = curDesc.parent;\n }\n }\n let node = desc.node;\n if (!node)\n continue;\n if (node != frag.child(fI - 1))\n break;\n --fI;\n matched.set(desc, fI);\n matches.push(desc);\n }\n return { index: fI, matched, matches: matches.reverse() };\n}\nfunction compareSide(a, b) {\n return a.type.side - b.type.side;\n}\n// This function abstracts iterating over the nodes and decorations in\n// a fragment. Calls `onNode` for each node, with its local and child\n// decorations. Splits text nodes when there is a decoration starting\n// or ending inside of them. Calls `onWidget` for each widget.\nfunction iterDeco(parent, deco, onWidget, onNode) {\n let locals = deco.locals(parent), offset = 0;\n // Simple, cheap variant for when there are no local decorations\n if (locals.length == 0) {\n for (let i = 0; i < parent.childCount; i++) {\n let child = parent.child(i);\n onNode(child, locals, deco.forChild(offset, child), i);\n offset += child.nodeSize;\n }\n return;\n }\n let decoIndex = 0, active = [], restNode = null;\n for (let parentIndex = 0;;) {\n let widget, widgets;\n while (decoIndex < locals.length && locals[decoIndex].to == offset) {\n let next = locals[decoIndex++];\n if (next.widget) {\n if (!widget)\n widget = next;\n else\n (widgets || (widgets = [widget])).push(next);\n }\n }\n if (widget) {\n if (widgets) {\n widgets.sort(compareSide);\n for (let i = 0; i < widgets.length; i++)\n onWidget(widgets[i], parentIndex, !!restNode);\n }\n else {\n onWidget(widget, parentIndex, !!restNode);\n }\n }\n let child, index;\n if (restNode) {\n index = -1;\n child = restNode;\n restNode = null;\n }\n else if (parentIndex < parent.childCount) {\n index = parentIndex;\n child = parent.child(parentIndex++);\n }\n else {\n break;\n }\n for (let i = 0; i < active.length; i++)\n if (active[i].to <= offset)\n active.splice(i--, 1);\n while (decoIndex < locals.length && locals[decoIndex].from <= offset && locals[decoIndex].to > offset)\n active.push(locals[decoIndex++]);\n let end = offset + child.nodeSize;\n if (child.isText) {\n let cutAt = end;\n if (decoIndex < locals.length && locals[decoIndex].from < cutAt)\n cutAt = locals[decoIndex].from;\n for (let i = 0; i < active.length; i++)\n if (active[i].to < cutAt)\n cutAt = active[i].to;\n if (cutAt < end) {\n restNode = child.cut(cutAt - offset);\n child = child.cut(0, cutAt - offset);\n end = cutAt;\n index = -1;\n }\n }\n else {\n while (decoIndex < locals.length && locals[decoIndex].to < end)\n decoIndex++;\n }\n let outerDeco = child.isInline && !child.isLeaf ? active.filter(d => !d.inline) : active.slice();\n onNode(child, outerDeco, deco.forChild(offset, child), index);\n offset = end;\n }\n}\n// List markers in Mobile Safari will mysteriously disappear\n// sometimes. This works around that.\nfunction iosHacks(dom) {\n if (dom.nodeName == \"UL\" || dom.nodeName == \"OL\") {\n let oldCSS = dom.style.cssText;\n dom.style.cssText = oldCSS + \"; list-style: square !important\";\n window.getComputedStyle(dom).listStyle;\n dom.style.cssText = oldCSS;\n }\n}\n// Find a piece of text in an inline fragment, overlapping from-to\nfunction findTextInFragment(frag, text, from, to) {\n for (let i = 0, pos = 0; i < frag.childCount && pos <= to;) {\n let child = frag.child(i++), childStart = pos;\n pos += child.nodeSize;\n if (!child.isText)\n continue;\n let str = child.text;\n while (i < frag.childCount) {\n let next = frag.child(i++);\n pos += next.nodeSize;\n if (!next.isText)\n break;\n str += next.text;\n }\n if (pos >= from) {\n if (pos >= to && str.slice(to - text.length - childStart, to - childStart) == text)\n return to - text.length;\n let found = childStart < to ? str.lastIndexOf(text, to - childStart - 1) : -1;\n if (found >= 0 && found + text.length + childStart >= from)\n return childStart + found;\n if (from == to && str.length >= (to + text.length) - childStart &&\n str.slice(to - childStart, to - childStart + text.length) == text)\n return to;\n }\n }\n return -1;\n}\n// Replace range from-to in an array of view descs with replacement\n// (may be null to just delete). This goes very much against the grain\n// of the rest of this code, which tends to create nodes with the\n// right shape in one go, rather than messing with them after\n// creation, but is necessary in the composition hack.\nfunction replaceNodes(nodes, from, to, view, replacement) {\n let result = [];\n for (let i = 0, off = 0; i < nodes.length; i++) {\n let child = nodes[i], start = off, end = off += child.size;\n if (start >= to || end <= from) {\n result.push(child);\n }\n else {\n if (start < from)\n result.push(child.slice(0, from - start, view));\n if (replacement) {\n result.push(replacement);\n replacement = undefined;\n }\n if (end > to)\n result.push(child.slice(to - start, child.size, view));\n }\n }\n return result;\n}\n\nfunction selectionFromDOM(view, origin = null) {\n let domSel = view.domSelectionRange(), doc = view.state.doc;\n if (!domSel.focusNode)\n return null;\n let nearestDesc = view.docView.nearestDesc(domSel.focusNode), inWidget = nearestDesc && nearestDesc.size == 0;\n let head = view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset, 1);\n if (head < 0)\n return null;\n let $head = doc.resolve(head), anchor, selection;\n if (selectionCollapsed(domSel)) {\n anchor = head;\n while (nearestDesc && !nearestDesc.node)\n nearestDesc = nearestDesc.parent;\n let nearestDescNode = nearestDesc.node;\n if (nearestDesc && nearestDescNode.isAtom && NodeSelection.isSelectable(nearestDescNode) && nearestDesc.parent\n && !(nearestDescNode.isInline && isOnEdge(domSel.focusNode, domSel.focusOffset, nearestDesc.dom))) {\n let pos = nearestDesc.posBefore;\n selection = new NodeSelection(head == pos ? $head : doc.resolve(pos));\n }\n }\n else {\n if (domSel instanceof view.dom.ownerDocument.defaultView.Selection && domSel.rangeCount > 1) {\n let min = head, max = head;\n for (let i = 0; i < domSel.rangeCount; i++) {\n let range = domSel.getRangeAt(i);\n min = Math.min(min, view.docView.posFromDOM(range.startContainer, range.startOffset, 1));\n max = Math.max(max, view.docView.posFromDOM(range.endContainer, range.endOffset, -1));\n }\n if (min < 0)\n return null;\n [anchor, head] = max == view.state.selection.anchor ? [max, min] : [min, max];\n $head = doc.resolve(head);\n }\n else {\n anchor = view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset, 1);\n }\n if (anchor < 0)\n return null;\n }\n let $anchor = doc.resolve(anchor);\n if (!selection) {\n let bias = origin == \"pointer\" || (view.state.selection.head < $head.pos && !inWidget) ? 1 : -1;\n selection = selectionBetween(view, $anchor, $head, bias);\n }\n return selection;\n}\nfunction editorOwnsSelection(view) {\n return view.editable ? view.hasFocus() :\n hasSelection(view) && document.activeElement && document.activeElement.contains(view.dom);\n}\nfunction selectionToDOM(view, force = false) {\n let sel = view.state.selection;\n syncNodeSelection(view, sel);\n if (!editorOwnsSelection(view))\n return;\n // The delayed drag selection causes issues with Cell Selections\n // in Safari. And the drag selection delay is to workarond issues\n // which only present in Chrome.\n if (!force && view.input.mouseDown && view.input.mouseDown.allowDefault && chrome) {\n let domSel = view.domSelectionRange(), curSel = view.domObserver.currentSelection;\n if (domSel.anchorNode && curSel.anchorNode &&\n isEquivalentPosition(domSel.anchorNode, domSel.anchorOffset, curSel.anchorNode, curSel.anchorOffset)) {\n view.input.mouseDown.delayedSelectionSync = true;\n view.domObserver.setCurSelection();\n return;\n }\n }\n view.domObserver.disconnectSelection();\n if (view.cursorWrapper) {\n selectCursorWrapper(view);\n }\n else {\n let { anchor, head } = sel, resetEditableFrom, resetEditableTo;\n if (brokenSelectBetweenUneditable && !(sel instanceof TextSelection)) {\n if (!sel.$from.parent.inlineContent)\n resetEditableFrom = temporarilyEditableNear(view, sel.from);\n if (!sel.empty && !sel.$from.parent.inlineContent)\n resetEditableTo = temporarilyEditableNear(view, sel.to);\n }\n view.docView.setSelection(anchor, head, view, force);\n if (brokenSelectBetweenUneditable) {\n if (resetEditableFrom)\n resetEditable(resetEditableFrom);\n if (resetEditableTo)\n resetEditable(resetEditableTo);\n }\n if (sel.visible) {\n view.dom.classList.remove(\"ProseMirror-hideselection\");\n }\n else {\n view.dom.classList.add(\"ProseMirror-hideselection\");\n if (\"onselectionchange\" in document)\n removeClassOnSelectionChange(view);\n }\n }\n view.domObserver.setCurSelection();\n view.domObserver.connectSelection();\n}\n// Kludge to work around Webkit not allowing a selection to start/end\n// between non-editable block nodes. We briefly make something\n// editable, set the selection, then set it uneditable again.\nconst brokenSelectBetweenUneditable = safari || chrome && chrome_version < 63;\nfunction temporarilyEditableNear(view, pos) {\n let { node, offset } = view.docView.domFromPos(pos, 0);\n let after = offset < node.childNodes.length ? node.childNodes[offset] : null;\n let before = offset ? node.childNodes[offset - 1] : null;\n if (safari && after && after.contentEditable == \"false\")\n return setEditable(after);\n if ((!after || after.contentEditable == \"false\") &&\n (!before || before.contentEditable == \"false\")) {\n if (after)\n return setEditable(after);\n else if (before)\n return setEditable(before);\n }\n}\nfunction setEditable(element) {\n element.contentEditable = \"true\";\n if (safari && element.draggable) {\n element.draggable = false;\n element.wasDraggable = true;\n }\n return element;\n}\nfunction resetEditable(element) {\n element.contentEditable = \"false\";\n if (element.wasDraggable) {\n element.draggable = true;\n element.wasDraggable = null;\n }\n}\nfunction removeClassOnSelectionChange(view) {\n let doc = view.dom.ownerDocument;\n doc.removeEventListener(\"selectionchange\", view.input.hideSelectionGuard);\n let domSel = view.domSelectionRange();\n let node = domSel.anchorNode, offset = domSel.anchorOffset;\n doc.addEventListener(\"selectionchange\", view.input.hideSelectionGuard = () => {\n if (domSel.anchorNode != node || domSel.anchorOffset != offset) {\n doc.removeEventListener(\"selectionchange\", view.input.hideSelectionGuard);\n setTimeout(() => {\n if (!editorOwnsSelection(view) || view.state.selection.visible)\n view.dom.classList.remove(\"ProseMirror-hideselection\");\n }, 20);\n }\n });\n}\nfunction selectCursorWrapper(view) {\n let domSel = view.domSelection(), range = document.createRange();\n if (!domSel)\n return;\n let node = view.cursorWrapper.dom, img = node.nodeName == \"IMG\";\n if (img)\n range.setStart(node.parentNode, domIndex(node) + 1);\n else\n range.setStart(node, 0);\n range.collapse(true);\n domSel.removeAllRanges();\n domSel.addRange(range);\n // Kludge to kill 'control selection' in IE11 when selecting an\n // invisible cursor wrapper, since that would result in those weird\n // resize handles and a selection that considers the absolutely\n // positioned wrapper, rather than the root editable node, the\n // focused element.\n if (!img && !view.state.selection.visible && ie && ie_version <= 11) {\n node.disabled = true;\n node.disabled = false;\n }\n}\nfunction syncNodeSelection(view, sel) {\n if (sel instanceof NodeSelection) {\n let desc = view.docView.descAt(sel.from);\n if (desc != view.lastSelectedViewDesc) {\n clearNodeSelection(view);\n if (desc)\n desc.selectNode();\n view.lastSelectedViewDesc = desc;\n }\n }\n else {\n clearNodeSelection(view);\n }\n}\n// Clear all DOM statefulness of the last node selection.\nfunction clearNodeSelection(view) {\n if (view.lastSelectedViewDesc) {\n if (view.lastSelectedViewDesc.parent)\n view.lastSelectedViewDesc.deselectNode();\n view.lastSelectedViewDesc = undefined;\n }\n}\nfunction selectionBetween(view, $anchor, $head, bias) {\n return view.someProp(\"createSelectionBetween\", f => f(view, $anchor, $head))\n || TextSelection.between($anchor, $head, bias);\n}\nfunction hasFocusAndSelection(view) {\n if (view.editable && !view.hasFocus())\n return false;\n return hasSelection(view);\n}\nfunction hasSelection(view) {\n let sel = view.domSelectionRange();\n if (!sel.anchorNode)\n return false;\n try {\n // Firefox will raise 'permission denied' errors when accessing\n // properties of `sel.anchorNode` when it's in a generated CSS\n // element.\n return view.dom.contains(sel.anchorNode.nodeType == 3 ? sel.anchorNode.parentNode : sel.anchorNode) &&\n (view.editable || view.dom.contains(sel.focusNode.nodeType == 3 ? sel.focusNode.parentNode : sel.focusNode));\n }\n catch (_) {\n return false;\n }\n}\nfunction anchorInRightPlace(view) {\n let anchorDOM = view.docView.domFromPos(view.state.selection.anchor, 0);\n let domSel = view.domSelectionRange();\n return isEquivalentPosition(anchorDOM.node, anchorDOM.offset, domSel.anchorNode, domSel.anchorOffset);\n}\n\nfunction moveSelectionBlock(state, dir) {\n let { $anchor, $head } = state.selection;\n let $side = dir > 0 ? $anchor.max($head) : $anchor.min($head);\n let $start = !$side.parent.inlineContent ? $side : $side.depth ? state.doc.resolve(dir > 0 ? $side.after() : $side.before()) : null;\n return $start && Selection.findFrom($start, dir);\n}\nfunction apply(view, sel) {\n view.dispatch(view.state.tr.setSelection(sel).scrollIntoView());\n return true;\n}\nfunction selectHorizontally(view, dir, mods) {\n let sel = view.state.selection;\n if (sel instanceof TextSelection) {\n if (mods.indexOf(\"s\") > -1) {\n let { $head } = sel, node = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter;\n if (!node || node.isText || !node.isLeaf)\n return false;\n let $newHead = view.state.doc.resolve($head.pos + node.nodeSize * (dir < 0 ? -1 : 1));\n return apply(view, new TextSelection(sel.$anchor, $newHead));\n }\n else if (!sel.empty) {\n return false;\n }\n else if (view.endOfTextblock(dir > 0 ? \"forward\" : \"backward\")) {\n let next = moveSelectionBlock(view.state, dir);\n if (next && (next instanceof NodeSelection))\n return apply(view, next);\n return false;\n }\n else if (!(mac && mods.indexOf(\"m\") > -1)) {\n let $head = sel.$head, node = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter, desc;\n if (!node || node.isText)\n return false;\n let nodePos = dir < 0 ? $head.pos - node.nodeSize : $head.pos;\n if (!(node.isAtom || (desc = view.docView.descAt(nodePos)) && !desc.contentDOM))\n return false;\n if (NodeSelection.isSelectable(node)) {\n return apply(view, new NodeSelection(dir < 0 ? view.state.doc.resolve($head.pos - node.nodeSize) : $head));\n }\n else if (webkit) {\n // Chrome and Safari will introduce extra pointless cursor\n // positions around inline uneditable nodes, so we have to\n // take over and move the cursor past them (#937)\n return apply(view, new TextSelection(view.state.doc.resolve(dir < 0 ? nodePos : nodePos + node.nodeSize)));\n }\n else {\n return false;\n }\n }\n }\n else if (sel instanceof NodeSelection && sel.node.isInline) {\n return apply(view, new TextSelection(dir > 0 ? sel.$to : sel.$from));\n }\n else {\n let next = moveSelectionBlock(view.state, dir);\n if (next)\n return apply(view, next);\n return false;\n }\n}\nfunction nodeLen(node) {\n return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;\n}\nfunction isIgnorable(dom, dir) {\n let desc = dom.pmViewDesc;\n return desc && desc.size == 0 && (dir < 0 || dom.nextSibling || dom.nodeName != \"BR\");\n}\nfunction skipIgnoredNodes(view, dir) {\n return dir < 0 ? skipIgnoredNodesBefore(view) : skipIgnoredNodesAfter(view);\n}\n// Make sure the cursor isn't directly after one or more ignored\n// nodes, which will confuse the browser's cursor motion logic.\nfunction skipIgnoredNodesBefore(view) {\n let sel = view.domSelectionRange();\n let node = sel.focusNode, offset = sel.focusOffset;\n if (!node)\n return;\n let moveNode, moveOffset, force = false;\n // Gecko will do odd things when the selection is directly in front\n // of a non-editable node, so in that case, move it into the next\n // node if possible. Issue prosemirror/prosemirror#832.\n if (gecko && node.nodeType == 1 && offset < nodeLen(node) && isIgnorable(node.childNodes[offset], -1))\n force = true;\n for (;;) {\n if (offset > 0) {\n if (node.nodeType != 1) {\n break;\n }\n else {\n let before = node.childNodes[offset - 1];\n if (isIgnorable(before, -1)) {\n moveNode = node;\n moveOffset = --offset;\n }\n else if (before.nodeType == 3) {\n node = before;\n offset = node.nodeValue.length;\n }\n else\n break;\n }\n }\n else if (isBlockNode(node)) {\n break;\n }\n else {\n let prev = node.previousSibling;\n while (prev && isIgnorable(prev, -1)) {\n moveNode = node.parentNode;\n moveOffset = domIndex(prev);\n prev = prev.previousSibling;\n }\n if (!prev) {\n node = node.parentNode;\n if (node == view.dom)\n break;\n offset = 0;\n }\n else {\n node = prev;\n offset = nodeLen(node);\n }\n }\n }\n if (force)\n setSelFocus(view, node, offset);\n else if (moveNode)\n setSelFocus(view, moveNode, moveOffset);\n}\n// Make sure the cursor isn't directly before one or more ignored\n// nodes.\nfunction skipIgnoredNodesAfter(view) {\n let sel = view.domSelectionRange();\n let node = sel.focusNode, offset = sel.focusOffset;\n if (!node)\n return;\n let len = nodeLen(node);\n let moveNode, moveOffset;\n for (;;) {\n if (offset < len) {\n if (node.nodeType != 1)\n break;\n let after = node.childNodes[offset];\n if (isIgnorable(after, 1)) {\n moveNode = node;\n moveOffset = ++offset;\n }\n else\n break;\n }\n else if (isBlockNode(node)) {\n break;\n }\n else {\n let next = node.nextSibling;\n while (next && isIgnorable(next, 1)) {\n moveNode = next.parentNode;\n moveOffset = domIndex(next) + 1;\n next = next.nextSibling;\n }\n if (!next) {\n node = node.parentNode;\n if (node == view.dom)\n break;\n offset = len = 0;\n }\n else {\n node = next;\n offset = 0;\n len = nodeLen(node);\n }\n }\n }\n if (moveNode)\n setSelFocus(view, moveNode, moveOffset);\n}\nfunction isBlockNode(dom) {\n let desc = dom.pmViewDesc;\n return desc && desc.node && desc.node.isBlock;\n}\nfunction textNodeAfter(node, offset) {\n while (node && offset == node.childNodes.length && !hasBlockDesc(node)) {\n offset = domIndex(node) + 1;\n node = node.parentNode;\n }\n while (node && offset < node.childNodes.length) {\n let next = node.childNodes[offset];\n if (next.nodeType == 3)\n return next;\n if (next.nodeType == 1 && next.contentEditable == \"false\")\n break;\n node = next;\n offset = 0;\n }\n}\nfunction textNodeBefore(node, offset) {\n while (node && !offset && !hasBlockDesc(node)) {\n offset = domIndex(node);\n node = node.parentNode;\n }\n while (node && offset) {\n let next = node.childNodes[offset - 1];\n if (next.nodeType == 3)\n return next;\n if (next.nodeType == 1 && next.contentEditable == \"false\")\n break;\n node = next;\n offset = node.childNodes.length;\n }\n}\nfunction setSelFocus(view, node, offset) {\n if (node.nodeType != 3) {\n let before, after;\n if (after = textNodeAfter(node, offset)) {\n node = after;\n offset = 0;\n }\n else if (before = textNodeBefore(node, offset)) {\n node = before;\n offset = before.nodeValue.length;\n }\n }\n let sel = view.domSelection();\n if (!sel)\n return;\n if (selectionCollapsed(sel)) {\n let range = document.createRange();\n range.setEnd(node, offset);\n range.setStart(node, offset);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n else if (sel.extend) {\n sel.extend(node, offset);\n }\n view.domObserver.setCurSelection();\n let { state } = view;\n // If no state update ends up happening, reset the selection.\n setTimeout(() => {\n if (view.state == state)\n selectionToDOM(view);\n }, 50);\n}\nfunction findDirection(view, pos) {\n let $pos = view.state.doc.resolve(pos);\n if (!(chrome || windows) && $pos.parent.inlineContent) {\n let coords = view.coordsAtPos(pos);\n if (pos > $pos.start()) {\n let before = view.coordsAtPos(pos - 1);\n let mid = (before.top + before.bottom) / 2;\n if (mid > coords.top && mid < coords.bottom && Math.abs(before.left - coords.left) > 1)\n return before.left < coords.left ? \"ltr\" : \"rtl\";\n }\n if (pos < $pos.end()) {\n let after = view.coordsAtPos(pos + 1);\n let mid = (after.top + after.bottom) / 2;\n if (mid > coords.top && mid < coords.bottom && Math.abs(after.left - coords.left) > 1)\n return after.left > coords.left ? \"ltr\" : \"rtl\";\n }\n }\n let computed = getComputedStyle(view.dom).direction;\n return computed == \"rtl\" ? \"rtl\" : \"ltr\";\n}\n// Check whether vertical selection motion would involve node\n// selections. If so, apply it (if not, the result is left to the\n// browser)\nfunction selectVertically(view, dir, mods) {\n let sel = view.state.selection;\n if (sel instanceof TextSelection && !sel.empty || mods.indexOf(\"s\") > -1)\n return false;\n if (mac && mods.indexOf(\"m\") > -1)\n return false;\n let { $from, $to } = sel;\n if (!$from.parent.inlineContent || view.endOfTextblock(dir < 0 ? \"up\" : \"down\")) {\n let next = moveSelectionBlock(view.state, dir);\n if (next && (next instanceof NodeSelection))\n return apply(view, next);\n }\n if (!$from.parent.inlineContent) {\n let side = dir < 0 ? $from : $to;\n let beyond = sel instanceof AllSelection ? Selection.near(side, dir) : Selection.findFrom(side, dir);\n return beyond ? apply(view, beyond) : false;\n }\n return false;\n}\nfunction stopNativeHorizontalDelete(view, dir) {\n if (!(view.state.selection instanceof TextSelection))\n return true;\n let { $head, $anchor, empty } = view.state.selection;\n if (!$head.sameParent($anchor))\n return true;\n if (!empty)\n return false;\n if (view.endOfTextblock(dir > 0 ? \"forward\" : \"backward\"))\n return true;\n let nextNode = !$head.textOffset && (dir < 0 ? $head.nodeBefore : $head.nodeAfter);\n if (nextNode && !nextNode.isText) {\n let tr = view.state.tr;\n if (dir < 0)\n tr.delete($head.pos - nextNode.nodeSize, $head.pos);\n else\n tr.delete($head.pos, $head.pos + nextNode.nodeSize);\n view.dispatch(tr);\n return true;\n }\n return false;\n}\nfunction switchEditable(view, node, state) {\n view.domObserver.stop();\n node.contentEditable = state;\n view.domObserver.start();\n}\n// Issue #867 / #1090 / https://bugs.chromium.org/p/chromium/issues/detail?id=903821\n// In which Safari (and at some point in the past, Chrome) does really\n// wrong things when the down arrow is pressed when the cursor is\n// directly at the start of a textblock and has an uneditable node\n// after it\nfunction safariDownArrowBug(view) {\n if (!safari || view.state.selection.$head.parentOffset > 0)\n return false;\n let { focusNode, focusOffset } = view.domSelectionRange();\n if (focusNode && focusNode.nodeType == 1 && focusOffset == 0 &&\n focusNode.firstChild && focusNode.firstChild.contentEditable == \"false\") {\n let child = focusNode.firstChild;\n switchEditable(view, child, \"true\");\n setTimeout(() => switchEditable(view, child, \"false\"), 20);\n }\n return false;\n}\n// A backdrop key mapping used to make sure we always suppress keys\n// that have a dangerous default effect, even if the commands they are\n// bound to return false, and to make sure that cursor-motion keys\n// find a cursor (as opposed to a node selection) when pressed. For\n// cursor-motion keys, the code in the handlers also takes care of\n// block selections.\nfunction getMods(event) {\n let result = \"\";\n if (event.ctrlKey)\n result += \"c\";\n if (event.metaKey)\n result += \"m\";\n if (event.altKey)\n result += \"a\";\n if (event.shiftKey)\n result += \"s\";\n return result;\n}\nfunction captureKeyDown(view, event) {\n let code = event.keyCode, mods = getMods(event);\n if (code == 8 || (mac && code == 72 && mods == \"c\")) { // Backspace, Ctrl-h on Mac\n return stopNativeHorizontalDelete(view, -1) || skipIgnoredNodes(view, -1);\n }\n else if ((code == 46 && !event.shiftKey) || (mac && code == 68 && mods == \"c\")) { // Delete, Ctrl-d on Mac\n return stopNativeHorizontalDelete(view, 1) || skipIgnoredNodes(view, 1);\n }\n else if (code == 13 || code == 27) { // Enter, Esc\n return true;\n }\n else if (code == 37 || (mac && code == 66 && mods == \"c\")) { // Left arrow, Ctrl-b on Mac\n let dir = code == 37 ? (findDirection(view, view.state.selection.from) == \"ltr\" ? -1 : 1) : -1;\n return selectHorizontally(view, dir, mods) || skipIgnoredNodes(view, dir);\n }\n else if (code == 39 || (mac && code == 70 && mods == \"c\")) { // Right arrow, Ctrl-f on Mac\n let dir = code == 39 ? (findDirection(view, view.state.selection.from) == \"ltr\" ? 1 : -1) : 1;\n return selectHorizontally(view, dir, mods) || skipIgnoredNodes(view, dir);\n }\n else if (code == 38 || (mac && code == 80 && mods == \"c\")) { // Up arrow, Ctrl-p on Mac\n return selectVertically(view, -1, mods) || skipIgnoredNodes(view, -1);\n }\n else if (code == 40 || (mac && code == 78 && mods == \"c\")) { // Down arrow, Ctrl-n on Mac\n return safariDownArrowBug(view) || selectVertically(view, 1, mods) || skipIgnoredNodes(view, 1);\n }\n else if (mods == (mac ? \"m\" : \"c\") &&\n (code == 66 || code == 73 || code == 89 || code == 90)) { // Mod-[biyz]\n return true;\n }\n return false;\n}\n\nfunction serializeForClipboard(view, slice) {\n view.someProp(\"transformCopied\", f => { slice = f(slice, view); });\n let context = [], { content, openStart, openEnd } = slice;\n while (openStart > 1 && openEnd > 1 && content.childCount == 1 && content.firstChild.childCount == 1) {\n openStart--;\n openEnd--;\n let node = content.firstChild;\n context.push(node.type.name, node.attrs != node.type.defaultAttrs ? node.attrs : null);\n content = node.content;\n }\n let serializer = view.someProp(\"clipboardSerializer\") || DOMSerializer.fromSchema(view.state.schema);\n let doc = detachedDoc(), wrap = doc.createElement(\"div\");\n wrap.appendChild(serializer.serializeFragment(content, { document: doc }));\n let firstChild = wrap.firstChild, needsWrap, wrappers = 0;\n while (firstChild && firstChild.nodeType == 1 && (needsWrap = wrapMap[firstChild.nodeName.toLowerCase()])) {\n for (let i = needsWrap.length - 1; i >= 0; i--) {\n let wrapper = doc.createElement(needsWrap[i]);\n while (wrap.firstChild)\n wrapper.appendChild(wrap.firstChild);\n wrap.appendChild(wrapper);\n wrappers++;\n }\n firstChild = wrap.firstChild;\n }\n if (firstChild && firstChild.nodeType == 1)\n firstChild.setAttribute(\"data-pm-slice\", `${openStart} ${openEnd}${wrappers ? ` -${wrappers}` : \"\"} ${JSON.stringify(context)}`);\n let text = view.someProp(\"clipboardTextSerializer\", f => f(slice, view)) ||\n slice.content.textBetween(0, slice.content.size, \"\\n\\n\");\n return { dom: wrap, text, slice };\n}\n// Read a slice of content from the clipboard (or drop data).\nfunction parseFromClipboard(view, text, html, plainText, $context) {\n let inCode = $context.parent.type.spec.code;\n let dom, slice;\n if (!html && !text)\n return null;\n let asText = text && (plainText || inCode || !html);\n if (asText) {\n view.someProp(\"transformPastedText\", f => { text = f(text, inCode || plainText, view); });\n if (inCode)\n return text ? new Slice(Fragment.from(view.state.schema.text(text.replace(/\\r\\n?/g, \"\\n\"))), 0, 0) : Slice.empty;\n let parsed = view.someProp(\"clipboardTextParser\", f => f(text, $context, plainText, view));\n if (parsed) {\n slice = parsed;\n }\n else {\n let marks = $context.marks();\n let { schema } = view.state, serializer = DOMSerializer.fromSchema(schema);\n dom = document.createElement(\"div\");\n text.split(/(?:\\r\\n?|\\n)+/).forEach(block => {\n let p = dom.appendChild(document.createElement(\"p\"));\n if (block)\n p.appendChild(serializer.serializeNode(schema.text(block, marks)));\n });\n }\n }\n else {\n view.someProp(\"transformPastedHTML\", f => { html = f(html, view); });\n dom = readHTML(html);\n if (webkit)\n restoreReplacedSpaces(dom);\n }\n let contextNode = dom && dom.querySelector(\"[data-pm-slice]\");\n let sliceData = contextNode && /^(\\d+) (\\d+)(?: -(\\d+))? (.*)/.exec(contextNode.getAttribute(\"data-pm-slice\") || \"\");\n if (sliceData && sliceData[3])\n for (let i = +sliceData[3]; i > 0; i--) {\n let child = dom.firstChild;\n while (child && child.nodeType != 1)\n child = child.nextSibling;\n if (!child)\n break;\n dom = child;\n }\n if (!slice) {\n let parser = view.someProp(\"clipboardParser\") || view.someProp(\"domParser\") || DOMParser.fromSchema(view.state.schema);\n slice = parser.parseSlice(dom, {\n preserveWhitespace: !!(asText || sliceData),\n context: $context,\n ruleFromNode(dom) {\n if (dom.nodeName == \"BR\" && !dom.nextSibling &&\n dom.parentNode && !inlineParents.test(dom.parentNode.nodeName))\n return { ignore: true };\n return null;\n }\n });\n }\n if (sliceData) {\n slice = addContext(closeSlice(slice, +sliceData[1], +sliceData[2]), sliceData[4]);\n }\n else { // HTML wasn't created by ProseMirror. Make sure top-level siblings are coherent\n slice = Slice.maxOpen(normalizeSiblings(slice.content, $context), true);\n if (slice.openStart || slice.openEnd) {\n let openStart = 0, openEnd = 0;\n for (let node = slice.content.firstChild; openStart < slice.openStart && !node.type.spec.isolating; openStart++, node = node.firstChild) { }\n for (let node = slice.content.lastChild; openEnd < slice.openEnd && !node.type.spec.isolating; openEnd++, node = node.lastChild) { }\n slice = closeSlice(slice, openStart, openEnd);\n }\n }\n view.someProp(\"transformPasted\", f => { slice = f(slice, view); });\n return slice;\n}\nconst inlineParents = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;\n// Takes a slice parsed with parseSlice, which means there hasn't been\n// any content-expression checking done on the top nodes, tries to\n// find a parent node in the current context that might fit the nodes,\n// and if successful, rebuilds the slice so that it fits into that parent.\n//\n// This addresses the problem that Transform.replace expects a\n// coherent slice, and will fail to place a set of siblings that don't\n// fit anywhere in the schema.\nfunction normalizeSiblings(fragment, $context) {\n if (fragment.childCount < 2)\n return fragment;\n for (let d = $context.depth; d >= 0; d--) {\n let parent = $context.node(d);\n let match = parent.contentMatchAt($context.index(d));\n let lastWrap, result = [];\n fragment.forEach(node => {\n if (!result)\n return;\n let wrap = match.findWrapping(node.type), inLast;\n if (!wrap)\n return result = null;\n if (inLast = result.length && lastWrap.length && addToSibling(wrap, lastWrap, node, result[result.length - 1], 0)) {\n result[result.length - 1] = inLast;\n }\n else {\n if (result.length)\n result[result.length - 1] = closeRight(result[result.length - 1], lastWrap.length);\n let wrapped = withWrappers(node, wrap);\n result.push(wrapped);\n match = match.matchType(wrapped.type);\n lastWrap = wrap;\n }\n });\n if (result)\n return Fragment.from(result);\n }\n return fragment;\n}\nfunction withWrappers(node, wrap, from = 0) {\n for (let i = wrap.length - 1; i >= from; i--)\n node = wrap[i].create(null, Fragment.from(node));\n return node;\n}\n// Used to group adjacent nodes wrapped in similar parents by\n// normalizeSiblings into the same parent node\nfunction addToSibling(wrap, lastWrap, node, sibling, depth) {\n if (depth < wrap.length && depth < lastWrap.length && wrap[depth] == lastWrap[depth]) {\n let inner = addToSibling(wrap, lastWrap, node, sibling.lastChild, depth + 1);\n if (inner)\n return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner));\n let match = sibling.contentMatchAt(sibling.childCount);\n if (match.matchType(depth == wrap.length - 1 ? node.type : wrap[depth + 1]))\n return sibling.copy(sibling.content.append(Fragment.from(withWrappers(node, wrap, depth + 1))));\n }\n}\nfunction closeRight(node, depth) {\n if (depth == 0)\n return node;\n let fragment = node.content.replaceChild(node.childCount - 1, closeRight(node.lastChild, depth - 1));\n let fill = node.contentMatchAt(node.childCount).fillBefore(Fragment.empty, true);\n return node.copy(fragment.append(fill));\n}\nfunction closeRange(fragment, side, from, to, depth, openEnd) {\n let node = side < 0 ? fragment.firstChild : fragment.lastChild, inner = node.content;\n if (fragment.childCount > 1)\n openEnd = 0;\n if (depth < to - 1)\n inner = closeRange(inner, side, from, to, depth + 1, openEnd);\n if (depth >= from)\n inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner)\n : inner.append(node.contentMatchAt(node.childCount).fillBefore(Fragment.empty, true));\n return fragment.replaceChild(side < 0 ? 0 : fragment.childCount - 1, node.copy(inner));\n}\nfunction closeSlice(slice, openStart, openEnd) {\n if (openStart < slice.openStart)\n slice = new Slice(closeRange(slice.content, -1, openStart, slice.openStart, 0, slice.openEnd), openStart, slice.openEnd);\n if (openEnd < slice.openEnd)\n slice = new Slice(closeRange(slice.content, 1, openEnd, slice.openEnd, 0, 0), slice.openStart, openEnd);\n return slice;\n}\n// Trick from jQuery -- some elements must be wrapped in other\n// elements for innerHTML to work. I.e. if you do `div.innerHTML =\n// \"..\"` the table cells are ignored.\nconst wrapMap = {\n thead: [\"table\"],\n tbody: [\"table\"],\n tfoot: [\"table\"],\n caption: [\"table\"],\n colgroup: [\"table\"],\n col: [\"table\", \"colgroup\"],\n tr: [\"table\", \"tbody\"],\n td: [\"table\", \"tbody\", \"tr\"],\n th: [\"table\", \"tbody\", \"tr\"]\n};\nlet _detachedDoc = null;\nfunction detachedDoc() {\n return _detachedDoc || (_detachedDoc = document.implementation.createHTMLDocument(\"title\"));\n}\nlet _policy = null;\nfunction maybeWrapTrusted(html) {\n let trustedTypes = window.trustedTypes;\n if (!trustedTypes)\n return html;\n // With the require-trusted-types-for CSP, Chrome will block\n // innerHTML, even on a detached document. This wraps the string in\n // a way that makes the browser allow us to use its parser again.\n if (!_policy)\n _policy = trustedTypes.createPolicy(\"ProseMirrorClipboard\", { createHTML: (s) => s });\n return _policy.createHTML(html);\n}\nfunction readHTML(html) {\n let metas = /^(\\s*]*>)*/.exec(html);\n if (metas)\n html = html.slice(metas[0].length);\n let elt = detachedDoc().createElement(\"div\");\n let firstTag = /<([a-z][^>\\s]+)/i.exec(html), wrap;\n if (wrap = firstTag && wrapMap[firstTag[1].toLowerCase()])\n html = wrap.map(n => \"<\" + n + \">\").join(\"\") + html + wrap.map(n => \"\").reverse().join(\"\");\n elt.innerHTML = maybeWrapTrusted(html);\n if (wrap)\n for (let i = 0; i < wrap.length; i++)\n elt = elt.querySelector(wrap[i]) || elt;\n return elt;\n}\n// Webkit browsers do some hard-to-predict replacement of regular\n// spaces with non-breaking spaces when putting content on the\n// clipboard. This tries to convert such non-breaking spaces (which\n// will be wrapped in a plain span on Chrome, a span with class\n// Apple-converted-space on Safari) back to regular spaces.\nfunction restoreReplacedSpaces(dom) {\n let nodes = dom.querySelectorAll(chrome ? \"span:not([class]):not([style])\" : \"span.Apple-converted-space\");\n for (let i = 0; i < nodes.length; i++) {\n let node = nodes[i];\n if (node.childNodes.length == 1 && node.textContent == \"\\u00a0\" && node.parentNode)\n node.parentNode.replaceChild(dom.ownerDocument.createTextNode(\" \"), node);\n }\n}\nfunction addContext(slice, context) {\n if (!slice.size)\n return slice;\n let schema = slice.content.firstChild.type.schema, array;\n try {\n array = JSON.parse(context);\n }\n catch (e) {\n return slice;\n }\n let { content, openStart, openEnd } = slice;\n for (let i = array.length - 2; i >= 0; i -= 2) {\n let type = schema.nodes[array[i]];\n if (!type || type.hasRequiredAttrs())\n break;\n content = Fragment.from(type.create(array[i + 1], content));\n openStart++;\n openEnd++;\n }\n return new Slice(content, openStart, openEnd);\n}\n\n// A collection of DOM events that occur within the editor, and callback functions\n// to invoke when the event fires.\nconst handlers = {};\nconst editHandlers = {};\nconst passiveHandlers = { touchstart: true, touchmove: true };\nclass InputState {\n constructor() {\n this.shiftKey = false;\n this.mouseDown = null;\n this.lastKeyCode = null;\n this.lastKeyCodeTime = 0;\n this.lastClick = { time: 0, x: 0, y: 0, type: \"\" };\n this.lastSelectionOrigin = null;\n this.lastSelectionTime = 0;\n this.lastIOSEnter = 0;\n this.lastIOSEnterFallbackTimeout = -1;\n this.lastFocus = 0;\n this.lastTouch = 0;\n this.lastChromeDelete = 0;\n this.composing = false;\n this.compositionNode = null;\n this.composingTimeout = -1;\n this.compositionNodes = [];\n this.compositionEndedAt = -2e8;\n this.compositionID = 1;\n // Set to a composition ID when there are pending changes at compositionend\n this.compositionPendingChanges = 0;\n this.domChangeCount = 0;\n this.eventHandlers = Object.create(null);\n this.hideSelectionGuard = null;\n }\n}\nfunction initInput(view) {\n for (let event in handlers) {\n let handler = handlers[event];\n view.dom.addEventListener(event, view.input.eventHandlers[event] = (event) => {\n if (eventBelongsToView(view, event) && !runCustomHandler(view, event) &&\n (view.editable || !(event.type in editHandlers)))\n handler(view, event);\n }, passiveHandlers[event] ? { passive: true } : undefined);\n }\n // On Safari, for reasons beyond my understanding, adding an input\n // event handler makes an issue where the composition vanishes when\n // you press enter go away.\n if (safari)\n view.dom.addEventListener(\"input\", () => null);\n ensureListeners(view);\n}\nfunction setSelectionOrigin(view, origin) {\n view.input.lastSelectionOrigin = origin;\n view.input.lastSelectionTime = Date.now();\n}\nfunction destroyInput(view) {\n view.domObserver.stop();\n for (let type in view.input.eventHandlers)\n view.dom.removeEventListener(type, view.input.eventHandlers[type]);\n clearTimeout(view.input.composingTimeout);\n clearTimeout(view.input.lastIOSEnterFallbackTimeout);\n}\nfunction ensureListeners(view) {\n view.someProp(\"handleDOMEvents\", currentHandlers => {\n for (let type in currentHandlers)\n if (!view.input.eventHandlers[type])\n view.dom.addEventListener(type, view.input.eventHandlers[type] = event => runCustomHandler(view, event));\n });\n}\nfunction runCustomHandler(view, event) {\n return view.someProp(\"handleDOMEvents\", handlers => {\n let handler = handlers[event.type];\n return handler ? handler(view, event) || event.defaultPrevented : false;\n });\n}\nfunction eventBelongsToView(view, event) {\n if (!event.bubbles)\n return true;\n if (event.defaultPrevented)\n return false;\n for (let node = event.target; node != view.dom; node = node.parentNode)\n if (!node || node.nodeType == 11 ||\n (node.pmViewDesc && node.pmViewDesc.stopEvent(event)))\n return false;\n return true;\n}\nfunction dispatchEvent(view, event) {\n if (!runCustomHandler(view, event) && handlers[event.type] &&\n (view.editable || !(event.type in editHandlers)))\n handlers[event.type](view, event);\n}\neditHandlers.keydown = (view, _event) => {\n let event = _event;\n view.input.shiftKey = event.keyCode == 16 || event.shiftKey;\n if (inOrNearComposition(view, event))\n return;\n view.input.lastKeyCode = event.keyCode;\n view.input.lastKeyCodeTime = Date.now();\n // Suppress enter key events on Chrome Android, because those tend\n // to be part of a confused sequence of composition events fired,\n // and handling them eagerly tends to corrupt the input.\n if (android && chrome && event.keyCode == 13)\n return;\n if (event.keyCode != 229)\n view.domObserver.forceFlush();\n // On iOS, if we preventDefault enter key presses, the virtual\n // keyboard gets confused. So the hack here is to set a flag that\n // makes the DOM change code recognize that what just happens should\n // be replaced by whatever the Enter key handlers do.\n if (ios && event.keyCode == 13 && !event.ctrlKey && !event.altKey && !event.metaKey) {\n let now = Date.now();\n view.input.lastIOSEnter = now;\n view.input.lastIOSEnterFallbackTimeout = setTimeout(() => {\n if (view.input.lastIOSEnter == now) {\n view.someProp(\"handleKeyDown\", f => f(view, keyEvent(13, \"Enter\")));\n view.input.lastIOSEnter = 0;\n }\n }, 200);\n }\n else if (view.someProp(\"handleKeyDown\", f => f(view, event)) || captureKeyDown(view, event)) {\n event.preventDefault();\n }\n else {\n setSelectionOrigin(view, \"key\");\n }\n};\neditHandlers.keyup = (view, event) => {\n if (event.keyCode == 16)\n view.input.shiftKey = false;\n};\neditHandlers.keypress = (view, _event) => {\n let event = _event;\n if (inOrNearComposition(view, event) || !event.charCode ||\n event.ctrlKey && !event.altKey || mac && event.metaKey)\n return;\n if (view.someProp(\"handleKeyPress\", f => f(view, event))) {\n event.preventDefault();\n return;\n }\n let sel = view.state.selection;\n if (!(sel instanceof TextSelection) || !sel.$from.sameParent(sel.$to)) {\n let text = String.fromCharCode(event.charCode);\n if (!/[\\r\\n]/.test(text) && !view.someProp(\"handleTextInput\", f => f(view, sel.$from.pos, sel.$to.pos, text)))\n view.dispatch(view.state.tr.insertText(text).scrollIntoView());\n event.preventDefault();\n }\n};\nfunction eventCoords(event) { return { left: event.clientX, top: event.clientY }; }\nfunction isNear(event, click) {\n let dx = click.x - event.clientX, dy = click.y - event.clientY;\n return dx * dx + dy * dy < 100;\n}\nfunction runHandlerOnContext(view, propName, pos, inside, event) {\n if (inside == -1)\n return false;\n let $pos = view.state.doc.resolve(inside);\n for (let i = $pos.depth + 1; i > 0; i--) {\n if (view.someProp(propName, f => i > $pos.depth ? f(view, pos, $pos.nodeAfter, $pos.before(i), event, true)\n : f(view, pos, $pos.node(i), $pos.before(i), event, false)))\n return true;\n }\n return false;\n}\nfunction updateSelection(view, selection, origin) {\n if (!view.focused)\n view.focus();\n if (view.state.selection.eq(selection))\n return;\n let tr = view.state.tr.setSelection(selection);\n if (origin == \"pointer\")\n tr.setMeta(\"pointer\", true);\n view.dispatch(tr);\n}\nfunction selectClickedLeaf(view, inside) {\n if (inside == -1)\n return false;\n let $pos = view.state.doc.resolve(inside), node = $pos.nodeAfter;\n if (node && node.isAtom && NodeSelection.isSelectable(node)) {\n updateSelection(view, new NodeSelection($pos), \"pointer\");\n return true;\n }\n return false;\n}\nfunction selectClickedNode(view, inside) {\n if (inside == -1)\n return false;\n let sel = view.state.selection, selectedNode, selectAt;\n if (sel instanceof NodeSelection)\n selectedNode = sel.node;\n let $pos = view.state.doc.resolve(inside);\n for (let i = $pos.depth + 1; i > 0; i--) {\n let node = i > $pos.depth ? $pos.nodeAfter : $pos.node(i);\n if (NodeSelection.isSelectable(node)) {\n if (selectedNode && sel.$from.depth > 0 &&\n i >= sel.$from.depth && $pos.before(sel.$from.depth + 1) == sel.$from.pos)\n selectAt = $pos.before(sel.$from.depth);\n else\n selectAt = $pos.before(i);\n break;\n }\n }\n if (selectAt != null) {\n updateSelection(view, NodeSelection.create(view.state.doc, selectAt), \"pointer\");\n return true;\n }\n else {\n return false;\n }\n}\nfunction handleSingleClick(view, pos, inside, event, selectNode) {\n return runHandlerOnContext(view, \"handleClickOn\", pos, inside, event) ||\n view.someProp(\"handleClick\", f => f(view, pos, event)) ||\n (selectNode ? selectClickedNode(view, inside) : selectClickedLeaf(view, inside));\n}\nfunction handleDoubleClick(view, pos, inside, event) {\n return runHandlerOnContext(view, \"handleDoubleClickOn\", pos, inside, event) ||\n view.someProp(\"handleDoubleClick\", f => f(view, pos, event));\n}\nfunction handleTripleClick(view, pos, inside, event) {\n return runHandlerOnContext(view, \"handleTripleClickOn\", pos, inside, event) ||\n view.someProp(\"handleTripleClick\", f => f(view, pos, event)) ||\n defaultTripleClick(view, inside, event);\n}\nfunction defaultTripleClick(view, inside, event) {\n if (event.button != 0)\n return false;\n let doc = view.state.doc;\n if (inside == -1) {\n if (doc.inlineContent) {\n updateSelection(view, TextSelection.create(doc, 0, doc.content.size), \"pointer\");\n return true;\n }\n return false;\n }\n let $pos = doc.resolve(inside);\n for (let i = $pos.depth + 1; i > 0; i--) {\n let node = i > $pos.depth ? $pos.nodeAfter : $pos.node(i);\n let nodePos = $pos.before(i);\n if (node.inlineContent)\n updateSelection(view, TextSelection.create(doc, nodePos + 1, nodePos + 1 + node.content.size), \"pointer\");\n else if (NodeSelection.isSelectable(node))\n updateSelection(view, NodeSelection.create(doc, nodePos), \"pointer\");\n else\n continue;\n return true;\n }\n}\nfunction forceDOMFlush(view) {\n return endComposition(view);\n}\nconst selectNodeModifier = mac ? \"metaKey\" : \"ctrlKey\";\nhandlers.mousedown = (view, _event) => {\n let event = _event;\n view.input.shiftKey = event.shiftKey;\n let flushed = forceDOMFlush(view);\n let now = Date.now(), type = \"singleClick\";\n if (now - view.input.lastClick.time < 500 && isNear(event, view.input.lastClick) && !event[selectNodeModifier]) {\n if (view.input.lastClick.type == \"singleClick\")\n type = \"doubleClick\";\n else if (view.input.lastClick.type == \"doubleClick\")\n type = \"tripleClick\";\n }\n view.input.lastClick = { time: now, x: event.clientX, y: event.clientY, type };\n let pos = view.posAtCoords(eventCoords(event));\n if (!pos)\n return;\n if (type == \"singleClick\") {\n if (view.input.mouseDown)\n view.input.mouseDown.done();\n view.input.mouseDown = new MouseDown(view, pos, event, !!flushed);\n }\n else if ((type == \"doubleClick\" ? handleDoubleClick : handleTripleClick)(view, pos.pos, pos.inside, event)) {\n event.preventDefault();\n }\n else {\n setSelectionOrigin(view, \"pointer\");\n }\n};\nclass MouseDown {\n constructor(view, pos, event, flushed) {\n this.view = view;\n this.pos = pos;\n this.event = event;\n this.flushed = flushed;\n this.delayedSelectionSync = false;\n this.mightDrag = null;\n this.startDoc = view.state.doc;\n this.selectNode = !!event[selectNodeModifier];\n this.allowDefault = event.shiftKey;\n let targetNode, targetPos;\n if (pos.inside > -1) {\n targetNode = view.state.doc.nodeAt(pos.inside);\n targetPos = pos.inside;\n }\n else {\n let $pos = view.state.doc.resolve(pos.pos);\n targetNode = $pos.parent;\n targetPos = $pos.depth ? $pos.before() : 0;\n }\n const target = flushed ? null : event.target;\n const targetDesc = target ? view.docView.nearestDesc(target, true) : null;\n this.target = targetDesc && targetDesc.dom.nodeType == 1 ? targetDesc.dom : null;\n let { selection } = view.state;\n if (event.button == 0 &&\n targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false ||\n selection instanceof NodeSelection && selection.from <= targetPos && selection.to > targetPos)\n this.mightDrag = {\n node: targetNode,\n pos: targetPos,\n addAttr: !!(this.target && !this.target.draggable),\n setUneditable: !!(this.target && gecko && !this.target.hasAttribute(\"contentEditable\"))\n };\n if (this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable)) {\n this.view.domObserver.stop();\n if (this.mightDrag.addAttr)\n this.target.draggable = true;\n if (this.mightDrag.setUneditable)\n setTimeout(() => {\n if (this.view.input.mouseDown == this)\n this.target.setAttribute(\"contentEditable\", \"false\");\n }, 20);\n this.view.domObserver.start();\n }\n view.root.addEventListener(\"mouseup\", this.up = this.up.bind(this));\n view.root.addEventListener(\"mousemove\", this.move = this.move.bind(this));\n setSelectionOrigin(view, \"pointer\");\n }\n done() {\n this.view.root.removeEventListener(\"mouseup\", this.up);\n this.view.root.removeEventListener(\"mousemove\", this.move);\n if (this.mightDrag && this.target) {\n this.view.domObserver.stop();\n if (this.mightDrag.addAttr)\n this.target.removeAttribute(\"draggable\");\n if (this.mightDrag.setUneditable)\n this.target.removeAttribute(\"contentEditable\");\n this.view.domObserver.start();\n }\n if (this.delayedSelectionSync)\n setTimeout(() => selectionToDOM(this.view));\n this.view.input.mouseDown = null;\n }\n up(event) {\n this.done();\n if (!this.view.dom.contains(event.target))\n return;\n let pos = this.pos;\n if (this.view.state.doc != this.startDoc)\n pos = this.view.posAtCoords(eventCoords(event));\n this.updateAllowDefault(event);\n if (this.allowDefault || !pos) {\n setSelectionOrigin(this.view, \"pointer\");\n }\n else if (handleSingleClick(this.view, pos.pos, pos.inside, event, this.selectNode)) {\n event.preventDefault();\n }\n else if (event.button == 0 &&\n (this.flushed ||\n // Safari ignores clicks on draggable elements\n (safari && this.mightDrag && !this.mightDrag.node.isAtom) ||\n // Chrome will sometimes treat a node selection as a\n // cursor, but still report that the node is selected\n // when asked through getSelection. You'll then get a\n // situation where clicking at the point where that\n // (hidden) cursor is doesn't change the selection, and\n // thus doesn't get a reaction from ProseMirror. This\n // works around that.\n (chrome && !this.view.state.selection.visible &&\n Math.min(Math.abs(pos.pos - this.view.state.selection.from), Math.abs(pos.pos - this.view.state.selection.to)) <= 2))) {\n updateSelection(this.view, Selection.near(this.view.state.doc.resolve(pos.pos)), \"pointer\");\n event.preventDefault();\n }\n else {\n setSelectionOrigin(this.view, \"pointer\");\n }\n }\n move(event) {\n this.updateAllowDefault(event);\n setSelectionOrigin(this.view, \"pointer\");\n if (event.buttons == 0)\n this.done();\n }\n updateAllowDefault(event) {\n if (!this.allowDefault && (Math.abs(this.event.x - event.clientX) > 4 ||\n Math.abs(this.event.y - event.clientY) > 4))\n this.allowDefault = true;\n }\n}\nhandlers.touchstart = view => {\n view.input.lastTouch = Date.now();\n forceDOMFlush(view);\n setSelectionOrigin(view, \"pointer\");\n};\nhandlers.touchmove = view => {\n view.input.lastTouch = Date.now();\n setSelectionOrigin(view, \"pointer\");\n};\nhandlers.contextmenu = view => forceDOMFlush(view);\nfunction inOrNearComposition(view, event) {\n if (view.composing)\n return true;\n // See https://www.stum.de/2016/06/24/handling-ime-events-in-javascript/.\n // On Japanese input method editors (IMEs), the Enter key is used to confirm character\n // selection. On Safari, when Enter is pressed, compositionend and keydown events are\n // emitted. The keydown event triggers newline insertion, which we don't want.\n // This method returns true if the keydown event should be ignored.\n // We only ignore it once, as pressing Enter a second time *should* insert a newline.\n // Furthermore, the keydown event timestamp must be close to the compositionEndedAt timestamp.\n // This guards against the case where compositionend is triggered without the keyboard\n // (e.g. character confirmation may be done with the mouse), and keydown is triggered\n // afterwards- we wouldn't want to ignore the keydown event in this case.\n if (safari && Math.abs(event.timeStamp - view.input.compositionEndedAt) < 500) {\n view.input.compositionEndedAt = -2e8;\n return true;\n }\n return false;\n}\n// Drop active composition after 5 seconds of inactivity on Android\nconst timeoutComposition = android ? 5000 : -1;\neditHandlers.compositionstart = editHandlers.compositionupdate = view => {\n if (!view.composing) {\n view.domObserver.flush();\n let { state } = view, $pos = state.selection.$to;\n if (state.selection instanceof TextSelection &&\n (state.storedMarks ||\n (!$pos.textOffset && $pos.parentOffset && $pos.nodeBefore.marks.some(m => m.type.spec.inclusive === false)))) {\n // Need to wrap the cursor in mark nodes different from the ones in the DOM context\n view.markCursor = view.state.storedMarks || $pos.marks();\n endComposition(view, true);\n view.markCursor = null;\n }\n else {\n endComposition(view, !state.selection.empty);\n // In firefox, if the cursor is after but outside a marked node,\n // the inserted text won't inherit the marks. So this moves it\n // inside if necessary.\n if (gecko && state.selection.empty && $pos.parentOffset && !$pos.textOffset && $pos.nodeBefore.marks.length) {\n let sel = view.domSelectionRange();\n for (let node = sel.focusNode, offset = sel.focusOffset; node && node.nodeType == 1 && offset != 0;) {\n let before = offset < 0 ? node.lastChild : node.childNodes[offset - 1];\n if (!before)\n break;\n if (before.nodeType == 3) {\n let sel = view.domSelection();\n if (sel)\n sel.collapse(before, before.nodeValue.length);\n break;\n }\n else {\n node = before;\n offset = -1;\n }\n }\n }\n }\n view.input.composing = true;\n }\n scheduleComposeEnd(view, timeoutComposition);\n};\neditHandlers.compositionend = (view, event) => {\n if (view.composing) {\n view.input.composing = false;\n view.input.compositionEndedAt = event.timeStamp;\n view.input.compositionPendingChanges = view.domObserver.pendingRecords().length ? view.input.compositionID : 0;\n view.input.compositionNode = null;\n if (view.input.compositionPendingChanges)\n Promise.resolve().then(() => view.domObserver.flush());\n view.input.compositionID++;\n scheduleComposeEnd(view, 20);\n }\n};\nfunction scheduleComposeEnd(view, delay) {\n clearTimeout(view.input.composingTimeout);\n if (delay > -1)\n view.input.composingTimeout = setTimeout(() => endComposition(view), delay);\n}\nfunction clearComposition(view) {\n if (view.composing) {\n view.input.composing = false;\n view.input.compositionEndedAt = timestampFromCustomEvent();\n }\n while (view.input.compositionNodes.length > 0)\n view.input.compositionNodes.pop().markParentsDirty();\n}\nfunction findCompositionNode(view) {\n let sel = view.domSelectionRange();\n if (!sel.focusNode)\n return null;\n let textBefore = textNodeBefore$1(sel.focusNode, sel.focusOffset);\n let textAfter = textNodeAfter$1(sel.focusNode, sel.focusOffset);\n if (textBefore && textAfter && textBefore != textAfter) {\n let descAfter = textAfter.pmViewDesc, lastChanged = view.domObserver.lastChangedTextNode;\n if (textBefore == lastChanged || textAfter == lastChanged)\n return lastChanged;\n if (!descAfter || !descAfter.isText(textAfter.nodeValue)) {\n return textAfter;\n }\n else if (view.input.compositionNode == textAfter) {\n let descBefore = textBefore.pmViewDesc;\n if (!(!descBefore || !descBefore.isText(textBefore.nodeValue)))\n return textAfter;\n }\n }\n return textBefore || textAfter;\n}\nfunction timestampFromCustomEvent() {\n let event = document.createEvent(\"Event\");\n event.initEvent(\"event\", true, true);\n return event.timeStamp;\n}\n/**\n@internal\n*/\nfunction endComposition(view, restarting = false) {\n if (android && view.domObserver.flushingSoon >= 0)\n return;\n view.domObserver.forceFlush();\n clearComposition(view);\n if (restarting || view.docView && view.docView.dirty) {\n let sel = selectionFromDOM(view);\n if (sel && !sel.eq(view.state.selection))\n view.dispatch(view.state.tr.setSelection(sel));\n else if ((view.markCursor || restarting) && !view.state.selection.empty)\n view.dispatch(view.state.tr.deleteSelection());\n else\n view.updateState(view.state);\n return true;\n }\n return false;\n}\nfunction captureCopy(view, dom) {\n // The extra wrapper is somehow necessary on IE/Edge to prevent the\n // content from being mangled when it is put onto the clipboard\n if (!view.dom.parentNode)\n return;\n let wrap = view.dom.parentNode.appendChild(document.createElement(\"div\"));\n wrap.appendChild(dom);\n wrap.style.cssText = \"position: fixed; left: -10000px; top: 10px\";\n let sel = getSelection(), range = document.createRange();\n range.selectNodeContents(dom);\n // Done because IE will fire a selectionchange moving the selection\n // to its start when removeAllRanges is called and the editor still\n // has focus (which will mess up the editor's selection state).\n view.dom.blur();\n sel.removeAllRanges();\n sel.addRange(range);\n setTimeout(() => {\n if (wrap.parentNode)\n wrap.parentNode.removeChild(wrap);\n view.focus();\n }, 50);\n}\n// This is very crude, but unfortunately both these browsers _pretend_\n// that they have a clipboard API—all the objects and methods are\n// there, they just don't work, and they are hard to test.\nconst brokenClipboardAPI = (ie && ie_version < 15) ||\n (ios && webkit_version < 604);\nhandlers.copy = editHandlers.cut = (view, _event) => {\n let event = _event;\n let sel = view.state.selection, cut = event.type == \"cut\";\n if (sel.empty)\n return;\n // IE and Edge's clipboard interface is completely broken\n let data = brokenClipboardAPI ? null : event.clipboardData;\n let slice = sel.content(), { dom, text } = serializeForClipboard(view, slice);\n if (data) {\n event.preventDefault();\n data.clearData();\n data.setData(\"text/html\", dom.innerHTML);\n data.setData(\"text/plain\", text);\n }\n else {\n captureCopy(view, dom);\n }\n if (cut)\n view.dispatch(view.state.tr.deleteSelection().scrollIntoView().setMeta(\"uiEvent\", \"cut\"));\n};\nfunction sliceSingleNode(slice) {\n return slice.openStart == 0 && slice.openEnd == 0 && slice.content.childCount == 1 ? slice.content.firstChild : null;\n}\nfunction capturePaste(view, event) {\n if (!view.dom.parentNode)\n return;\n let plainText = view.input.shiftKey || view.state.selection.$from.parent.type.spec.code;\n let target = view.dom.parentNode.appendChild(document.createElement(plainText ? \"textarea\" : \"div\"));\n if (!plainText)\n target.contentEditable = \"true\";\n target.style.cssText = \"position: fixed; left: -10000px; top: 10px\";\n target.focus();\n let plain = view.input.shiftKey && view.input.lastKeyCode != 45;\n setTimeout(() => {\n view.focus();\n if (target.parentNode)\n target.parentNode.removeChild(target);\n if (plainText)\n doPaste(view, target.value, null, plain, event);\n else\n doPaste(view, target.textContent, target.innerHTML, plain, event);\n }, 50);\n}\nfunction doPaste(view, text, html, preferPlain, event) {\n let slice = parseFromClipboard(view, text, html, preferPlain, view.state.selection.$from);\n if (view.someProp(\"handlePaste\", f => f(view, event, slice || Slice.empty)))\n return true;\n if (!slice)\n return false;\n let singleNode = sliceSingleNode(slice);\n let tr = singleNode\n ? view.state.tr.replaceSelectionWith(singleNode, preferPlain)\n : view.state.tr.replaceSelection(slice);\n view.dispatch(tr.scrollIntoView().setMeta(\"paste\", true).setMeta(\"uiEvent\", \"paste\"));\n return true;\n}\nfunction getText(clipboardData) {\n let text = clipboardData.getData(\"text/plain\") || clipboardData.getData(\"Text\");\n if (text)\n return text;\n let uris = clipboardData.getData(\"text/uri-list\");\n return uris ? uris.replace(/\\r?\\n/g, \" \") : \"\";\n}\neditHandlers.paste = (view, _event) => {\n let event = _event;\n // Handling paste from JavaScript during composition is very poorly\n // handled by browsers, so as a dodgy but preferable kludge, we just\n // let the browser do its native thing there, except on Android,\n // where the editor is almost always composing.\n if (view.composing && !android)\n return;\n let data = brokenClipboardAPI ? null : event.clipboardData;\n let plain = view.input.shiftKey && view.input.lastKeyCode != 45;\n if (data && doPaste(view, getText(data), data.getData(\"text/html\"), plain, event))\n event.preventDefault();\n else\n capturePaste(view, event);\n};\nclass Dragging {\n constructor(slice, move, node) {\n this.slice = slice;\n this.move = move;\n this.node = node;\n }\n}\nconst dragCopyModifier = mac ? \"altKey\" : \"ctrlKey\";\nhandlers.dragstart = (view, _event) => {\n let event = _event;\n let mouseDown = view.input.mouseDown;\n if (mouseDown)\n mouseDown.done();\n if (!event.dataTransfer)\n return;\n let sel = view.state.selection;\n let pos = sel.empty ? null : view.posAtCoords(eventCoords(event));\n let node;\n if (pos && pos.pos >= sel.from && pos.pos <= (sel instanceof NodeSelection ? sel.to - 1 : sel.to)) ;\n else if (mouseDown && mouseDown.mightDrag) {\n node = NodeSelection.create(view.state.doc, mouseDown.mightDrag.pos);\n }\n else if (event.target && event.target.nodeType == 1) {\n let desc = view.docView.nearestDesc(event.target, true);\n if (desc && desc.node.type.spec.draggable && desc != view.docView)\n node = NodeSelection.create(view.state.doc, desc.posBefore);\n }\n let draggedSlice = (node || view.state.selection).content();\n let { dom, text, slice } = serializeForClipboard(view, draggedSlice);\n // Pre-120 Chrome versions clear files when calling `clearData` (#1472)\n if (!event.dataTransfer.files.length || !chrome || chrome_version > 120)\n event.dataTransfer.clearData();\n event.dataTransfer.setData(brokenClipboardAPI ? \"Text\" : \"text/html\", dom.innerHTML);\n // See https://github.com/ProseMirror/prosemirror/issues/1156\n event.dataTransfer.effectAllowed = \"copyMove\";\n if (!brokenClipboardAPI)\n event.dataTransfer.setData(\"text/plain\", text);\n view.dragging = new Dragging(slice, !event[dragCopyModifier], node);\n};\nhandlers.dragend = view => {\n let dragging = view.dragging;\n window.setTimeout(() => {\n if (view.dragging == dragging)\n view.dragging = null;\n }, 50);\n};\neditHandlers.dragover = editHandlers.dragenter = (_, e) => e.preventDefault();\neditHandlers.drop = (view, _event) => {\n let event = _event;\n let dragging = view.dragging;\n view.dragging = null;\n if (!event.dataTransfer)\n return;\n let eventPos = view.posAtCoords(eventCoords(event));\n if (!eventPos)\n return;\n let $mouse = view.state.doc.resolve(eventPos.pos);\n let slice = dragging && dragging.slice;\n if (slice) {\n view.someProp(\"transformPasted\", f => { slice = f(slice, view); });\n }\n else {\n slice = parseFromClipboard(view, getText(event.dataTransfer), brokenClipboardAPI ? null : event.dataTransfer.getData(\"text/html\"), false, $mouse);\n }\n let move = !!(dragging && !event[dragCopyModifier]);\n if (view.someProp(\"handleDrop\", f => f(view, event, slice || Slice.empty, move))) {\n event.preventDefault();\n return;\n }\n if (!slice)\n return;\n event.preventDefault();\n let insertPos = slice ? dropPoint(view.state.doc, $mouse.pos, slice) : $mouse.pos;\n if (insertPos == null)\n insertPos = $mouse.pos;\n let tr = view.state.tr;\n if (move) {\n let { node } = dragging;\n if (node)\n node.replace(tr);\n else\n tr.deleteSelection();\n }\n let pos = tr.mapping.map(insertPos);\n let isNode = slice.openStart == 0 && slice.openEnd == 0 && slice.content.childCount == 1;\n let beforeInsert = tr.doc;\n if (isNode)\n tr.replaceRangeWith(pos, pos, slice.content.firstChild);\n else\n tr.replaceRange(pos, pos, slice);\n if (tr.doc.eq(beforeInsert))\n return;\n let $pos = tr.doc.resolve(pos);\n if (isNode && NodeSelection.isSelectable(slice.content.firstChild) &&\n $pos.nodeAfter && $pos.nodeAfter.sameMarkup(slice.content.firstChild)) {\n tr.setSelection(new NodeSelection($pos));\n }\n else {\n let end = tr.mapping.map(insertPos);\n tr.mapping.maps[tr.mapping.maps.length - 1].forEach((_from, _to, _newFrom, newTo) => end = newTo);\n tr.setSelection(selectionBetween(view, $pos, tr.doc.resolve(end)));\n }\n view.focus();\n view.dispatch(tr.setMeta(\"uiEvent\", \"drop\"));\n};\nhandlers.focus = view => {\n view.input.lastFocus = Date.now();\n if (!view.focused) {\n view.domObserver.stop();\n view.dom.classList.add(\"ProseMirror-focused\");\n view.domObserver.start();\n view.focused = true;\n setTimeout(() => {\n if (view.docView && view.hasFocus() && !view.domObserver.currentSelection.eq(view.domSelectionRange()))\n selectionToDOM(view);\n }, 20);\n }\n};\nhandlers.blur = (view, _event) => {\n let event = _event;\n if (view.focused) {\n view.domObserver.stop();\n view.dom.classList.remove(\"ProseMirror-focused\");\n view.domObserver.start();\n if (event.relatedTarget && view.dom.contains(event.relatedTarget))\n view.domObserver.currentSelection.clear();\n view.focused = false;\n }\n};\nhandlers.beforeinput = (view, _event) => {\n let event = _event;\n // We should probably do more with beforeinput events, but support\n // is so spotty that I'm still waiting to see where they are going.\n // Very specific hack to deal with backspace sometimes failing on\n // Chrome Android when after an uneditable node.\n if (chrome && android && event.inputType == \"deleteContentBackward\") {\n view.domObserver.flushSoon();\n let { domChangeCount } = view.input;\n setTimeout(() => {\n if (view.input.domChangeCount != domChangeCount)\n return; // Event already had some effect\n // This bug tends to close the virtual keyboard, so we refocus\n view.dom.blur();\n view.focus();\n if (view.someProp(\"handleKeyDown\", f => f(view, keyEvent(8, \"Backspace\"))))\n return;\n let { $cursor } = view.state.selection;\n // Crude approximation of backspace behavior when no command handled it\n if ($cursor && $cursor.pos > 0)\n view.dispatch(view.state.tr.delete($cursor.pos - 1, $cursor.pos).scrollIntoView());\n }, 50);\n }\n};\n// Make sure all handlers get registered\nfor (let prop in editHandlers)\n handlers[prop] = editHandlers[prop];\n\nfunction compareObjs(a, b) {\n if (a == b)\n return true;\n for (let p in a)\n if (a[p] !== b[p])\n return false;\n for (let p in b)\n if (!(p in a))\n return false;\n return true;\n}\nclass WidgetType {\n constructor(toDOM, spec) {\n this.toDOM = toDOM;\n this.spec = spec || noSpec;\n this.side = this.spec.side || 0;\n }\n map(mapping, span, offset, oldOffset) {\n let { pos, deleted } = mapping.mapResult(span.from + oldOffset, this.side < 0 ? -1 : 1);\n return deleted ? null : new Decoration(pos - offset, pos - offset, this);\n }\n valid() { return true; }\n eq(other) {\n return this == other ||\n (other instanceof WidgetType &&\n (this.spec.key && this.spec.key == other.spec.key ||\n this.toDOM == other.toDOM && compareObjs(this.spec, other.spec)));\n }\n destroy(node) {\n if (this.spec.destroy)\n this.spec.destroy(node);\n }\n}\nclass InlineType {\n constructor(attrs, spec) {\n this.attrs = attrs;\n this.spec = spec || noSpec;\n }\n map(mapping, span, offset, oldOffset) {\n let from = mapping.map(span.from + oldOffset, this.spec.inclusiveStart ? -1 : 1) - offset;\n let to = mapping.map(span.to + oldOffset, this.spec.inclusiveEnd ? 1 : -1) - offset;\n return from >= to ? null : new Decoration(from, to, this);\n }\n valid(_, span) { return span.from < span.to; }\n eq(other) {\n return this == other ||\n (other instanceof InlineType && compareObjs(this.attrs, other.attrs) &&\n compareObjs(this.spec, other.spec));\n }\n static is(span) { return span.type instanceof InlineType; }\n destroy() { }\n}\nclass NodeType {\n constructor(attrs, spec) {\n this.attrs = attrs;\n this.spec = spec || noSpec;\n }\n map(mapping, span, offset, oldOffset) {\n let from = mapping.mapResult(span.from + oldOffset, 1);\n if (from.deleted)\n return null;\n let to = mapping.mapResult(span.to + oldOffset, -1);\n if (to.deleted || to.pos <= from.pos)\n return null;\n return new Decoration(from.pos - offset, to.pos - offset, this);\n }\n valid(node, span) {\n let { index, offset } = node.content.findIndex(span.from), child;\n return offset == span.from && !(child = node.child(index)).isText && offset + child.nodeSize == span.to;\n }\n eq(other) {\n return this == other ||\n (other instanceof NodeType && compareObjs(this.attrs, other.attrs) &&\n compareObjs(this.spec, other.spec));\n }\n destroy() { }\n}\n/**\nDecoration objects can be provided to the view through the\n[`decorations` prop](https://prosemirror.net/docs/ref/#view.EditorProps.decorations). They come in\nseveral variants—see the static members of this class for details.\n*/\nclass Decoration {\n /**\n @internal\n */\n constructor(\n /**\n The start position of the decoration.\n */\n from, \n /**\n The end position. Will be the same as `from` for [widget\n decorations](https://prosemirror.net/docs/ref/#view.Decoration^widget).\n */\n to, \n /**\n @internal\n */\n type) {\n this.from = from;\n this.to = to;\n this.type = type;\n }\n /**\n @internal\n */\n copy(from, to) {\n return new Decoration(from, to, this.type);\n }\n /**\n @internal\n */\n eq(other, offset = 0) {\n return this.type.eq(other.type) && this.from + offset == other.from && this.to + offset == other.to;\n }\n /**\n @internal\n */\n map(mapping, offset, oldOffset) {\n return this.type.map(mapping, this, offset, oldOffset);\n }\n /**\n Creates a widget decoration, which is a DOM node that's shown in\n the document at the given position. It is recommended that you\n delay rendering the widget by passing a function that will be\n called when the widget is actually drawn in a view, but you can\n also directly pass a DOM node. `getPos` can be used to find the\n widget's current document position.\n */\n static widget(pos, toDOM, spec) {\n return new Decoration(pos, pos, new WidgetType(toDOM, spec));\n }\n /**\n Creates an inline decoration, which adds the given attributes to\n each inline node between `from` and `to`.\n */\n static inline(from, to, attrs, spec) {\n return new Decoration(from, to, new InlineType(attrs, spec));\n }\n /**\n Creates a node decoration. `from` and `to` should point precisely\n before and after a node in the document. That node, and only that\n node, will receive the given attributes.\n */\n static node(from, to, attrs, spec) {\n return new Decoration(from, to, new NodeType(attrs, spec));\n }\n /**\n The spec provided when creating this decoration. Can be useful\n if you've stored extra information in that object.\n */\n get spec() { return this.type.spec; }\n /**\n @internal\n */\n get inline() { return this.type instanceof InlineType; }\n /**\n @internal\n */\n get widget() { return this.type instanceof WidgetType; }\n}\nconst none = [], noSpec = {};\n/**\nA collection of [decorations](https://prosemirror.net/docs/ref/#view.Decoration), organized in such\na way that the drawing algorithm can efficiently use and compare\nthem. This is a persistent data structure—it is not modified,\nupdates create a new value.\n*/\nclass DecorationSet {\n /**\n @internal\n */\n constructor(local, children) {\n this.local = local.length ? local : none;\n this.children = children.length ? children : none;\n }\n /**\n Create a set of decorations, using the structure of the given\n document. This will consume (modify) the `decorations` array, so\n you must make a copy if you want need to preserve that.\n */\n static create(doc, decorations) {\n return decorations.length ? buildTree(decorations, doc, 0, noSpec) : empty;\n }\n /**\n Find all decorations in this set which touch the given range\n (including decorations that start or end directly at the\n boundaries) and match the given predicate on their spec. When\n `start` and `end` are omitted, all decorations in the set are\n considered. When `predicate` isn't given, all decorations are\n assumed to match.\n */\n find(start, end, predicate) {\n let result = [];\n this.findInner(start == null ? 0 : start, end == null ? 1e9 : end, result, 0, predicate);\n return result;\n }\n findInner(start, end, result, offset, predicate) {\n for (let i = 0; i < this.local.length; i++) {\n let span = this.local[i];\n if (span.from <= end && span.to >= start && (!predicate || predicate(span.spec)))\n result.push(span.copy(span.from + offset, span.to + offset));\n }\n for (let i = 0; i < this.children.length; i += 3) {\n if (this.children[i] < end && this.children[i + 1] > start) {\n let childOff = this.children[i] + 1;\n this.children[i + 2].findInner(start - childOff, end - childOff, result, offset + childOff, predicate);\n }\n }\n }\n /**\n Map the set of decorations in response to a change in the\n document.\n */\n map(mapping, doc, options) {\n if (this == empty || mapping.maps.length == 0)\n return this;\n return this.mapInner(mapping, doc, 0, 0, options || noSpec);\n }\n /**\n @internal\n */\n mapInner(mapping, node, offset, oldOffset, options) {\n let newLocal;\n for (let i = 0; i < this.local.length; i++) {\n let mapped = this.local[i].map(mapping, offset, oldOffset);\n if (mapped && mapped.type.valid(node, mapped))\n (newLocal || (newLocal = [])).push(mapped);\n else if (options.onRemove)\n options.onRemove(this.local[i].spec);\n }\n if (this.children.length)\n return mapChildren(this.children, newLocal || [], mapping, node, offset, oldOffset, options);\n else\n return newLocal ? new DecorationSet(newLocal.sort(byPos), none) : empty;\n }\n /**\n Add the given array of decorations to the ones in the set,\n producing a new set. Consumes the `decorations` array. Needs\n access to the current document to create the appropriate tree\n structure.\n */\n add(doc, decorations) {\n if (!decorations.length)\n return this;\n if (this == empty)\n return DecorationSet.create(doc, decorations);\n return this.addInner(doc, decorations, 0);\n }\n addInner(doc, decorations, offset) {\n let children, childIndex = 0;\n doc.forEach((childNode, childOffset) => {\n let baseOffset = childOffset + offset, found;\n if (!(found = takeSpansForNode(decorations, childNode, baseOffset)))\n return;\n if (!children)\n children = this.children.slice();\n while (childIndex < children.length && children[childIndex] < childOffset)\n childIndex += 3;\n if (children[childIndex] == childOffset)\n children[childIndex + 2] = children[childIndex + 2].addInner(childNode, found, baseOffset + 1);\n else\n children.splice(childIndex, 0, childOffset, childOffset + childNode.nodeSize, buildTree(found, childNode, baseOffset + 1, noSpec));\n childIndex += 3;\n });\n let local = moveSpans(childIndex ? withoutNulls(decorations) : decorations, -offset);\n for (let i = 0; i < local.length; i++)\n if (!local[i].type.valid(doc, local[i]))\n local.splice(i--, 1);\n return new DecorationSet(local.length ? this.local.concat(local).sort(byPos) : this.local, children || this.children);\n }\n /**\n Create a new set that contains the decorations in this set, minus\n the ones in the given array.\n */\n remove(decorations) {\n if (decorations.length == 0 || this == empty)\n return this;\n return this.removeInner(decorations, 0);\n }\n removeInner(decorations, offset) {\n let children = this.children, local = this.local;\n for (let i = 0; i < children.length; i += 3) {\n let found;\n let from = children[i] + offset, to = children[i + 1] + offset;\n for (let j = 0, span; j < decorations.length; j++)\n if (span = decorations[j]) {\n if (span.from > from && span.to < to) {\n decorations[j] = null;\n (found || (found = [])).push(span);\n }\n }\n if (!found)\n continue;\n if (children == this.children)\n children = this.children.slice();\n let removed = children[i + 2].removeInner(found, from + 1);\n if (removed != empty) {\n children[i + 2] = removed;\n }\n else {\n children.splice(i, 3);\n i -= 3;\n }\n }\n if (local.length)\n for (let i = 0, span; i < decorations.length; i++)\n if (span = decorations[i]) {\n for (let j = 0; j < local.length; j++)\n if (local[j].eq(span, offset)) {\n if (local == this.local)\n local = this.local.slice();\n local.splice(j--, 1);\n }\n }\n if (children == this.children && local == this.local)\n return this;\n return local.length || children.length ? new DecorationSet(local, children) : empty;\n }\n forChild(offset, node) {\n if (this == empty)\n return this;\n if (node.isLeaf)\n return DecorationSet.empty;\n let child, local;\n for (let i = 0; i < this.children.length; i += 3)\n if (this.children[i] >= offset) {\n if (this.children[i] == offset)\n child = this.children[i + 2];\n break;\n }\n let start = offset + 1, end = start + node.content.size;\n for (let i = 0; i < this.local.length; i++) {\n let dec = this.local[i];\n if (dec.from < end && dec.to > start && (dec.type instanceof InlineType)) {\n let from = Math.max(start, dec.from) - start, to = Math.min(end, dec.to) - start;\n if (from < to)\n (local || (local = [])).push(dec.copy(from, to));\n }\n }\n if (local) {\n let localSet = new DecorationSet(local.sort(byPos), none);\n return child ? new DecorationGroup([localSet, child]) : localSet;\n }\n return child || empty;\n }\n /**\n @internal\n */\n eq(other) {\n if (this == other)\n return true;\n if (!(other instanceof DecorationSet) ||\n this.local.length != other.local.length ||\n this.children.length != other.children.length)\n return false;\n for (let i = 0; i < this.local.length; i++)\n if (!this.local[i].eq(other.local[i]))\n return false;\n for (let i = 0; i < this.children.length; i += 3)\n if (this.children[i] != other.children[i] ||\n this.children[i + 1] != other.children[i + 1] ||\n !this.children[i + 2].eq(other.children[i + 2]))\n return false;\n return true;\n }\n /**\n @internal\n */\n locals(node) {\n return removeOverlap(this.localsInner(node));\n }\n /**\n @internal\n */\n localsInner(node) {\n if (this == empty)\n return none;\n if (node.inlineContent || !this.local.some(InlineType.is))\n return this.local;\n let result = [];\n for (let i = 0; i < this.local.length; i++) {\n if (!(this.local[i].type instanceof InlineType))\n result.push(this.local[i]);\n }\n return result;\n }\n forEachSet(f) { f(this); }\n}\n/**\nThe empty set of decorations.\n*/\nDecorationSet.empty = new DecorationSet([], []);\n/**\n@internal\n*/\nDecorationSet.removeOverlap = removeOverlap;\nconst empty = DecorationSet.empty;\n// An abstraction that allows the code dealing with decorations to\n// treat multiple DecorationSet objects as if it were a single object\n// with (a subset of) the same interface.\nclass DecorationGroup {\n constructor(members) {\n this.members = members;\n }\n map(mapping, doc) {\n const mappedDecos = this.members.map(member => member.map(mapping, doc, noSpec));\n return DecorationGroup.from(mappedDecos);\n }\n forChild(offset, child) {\n if (child.isLeaf)\n return DecorationSet.empty;\n let found = [];\n for (let i = 0; i < this.members.length; i++) {\n let result = this.members[i].forChild(offset, child);\n if (result == empty)\n continue;\n if (result instanceof DecorationGroup)\n found = found.concat(result.members);\n else\n found.push(result);\n }\n return DecorationGroup.from(found);\n }\n eq(other) {\n if (!(other instanceof DecorationGroup) ||\n other.members.length != this.members.length)\n return false;\n for (let i = 0; i < this.members.length; i++)\n if (!this.members[i].eq(other.members[i]))\n return false;\n return true;\n }\n locals(node) {\n let result, sorted = true;\n for (let i = 0; i < this.members.length; i++) {\n let locals = this.members[i].localsInner(node);\n if (!locals.length)\n continue;\n if (!result) {\n result = locals;\n }\n else {\n if (sorted) {\n result = result.slice();\n sorted = false;\n }\n for (let j = 0; j < locals.length; j++)\n result.push(locals[j]);\n }\n }\n return result ? removeOverlap(sorted ? result : result.sort(byPos)) : none;\n }\n // Create a group for the given array of decoration sets, or return\n // a single set when possible.\n static from(members) {\n switch (members.length) {\n case 0: return empty;\n case 1: return members[0];\n default: return new DecorationGroup(members.every(m => m instanceof DecorationSet) ? members :\n members.reduce((r, m) => r.concat(m instanceof DecorationSet ? m : m.members), []));\n }\n }\n forEachSet(f) {\n for (let i = 0; i < this.members.length; i++)\n this.members[i].forEachSet(f);\n }\n}\nfunction mapChildren(oldChildren, newLocal, mapping, node, offset, oldOffset, options) {\n let children = oldChildren.slice();\n // Mark the children that are directly touched by changes, and\n // move those that are after the changes.\n for (let i = 0, baseOffset = oldOffset; i < mapping.maps.length; i++) {\n let moved = 0;\n mapping.maps[i].forEach((oldStart, oldEnd, newStart, newEnd) => {\n let dSize = (newEnd - newStart) - (oldEnd - oldStart);\n for (let i = 0; i < children.length; i += 3) {\n let end = children[i + 1];\n if (end < 0 || oldStart > end + baseOffset - moved)\n continue;\n let start = children[i] + baseOffset - moved;\n if (oldEnd >= start) {\n children[i + 1] = oldStart <= start ? -2 : -1;\n }\n else if (oldStart >= baseOffset && dSize) {\n children[i] += dSize;\n children[i + 1] += dSize;\n }\n }\n moved += dSize;\n });\n baseOffset = mapping.maps[i].map(baseOffset, -1);\n }\n // Find the child nodes that still correspond to a single node,\n // recursively call mapInner on them and update their positions.\n let mustRebuild = false;\n for (let i = 0; i < children.length; i += 3)\n if (children[i + 1] < 0) { // Touched nodes\n if (children[i + 1] == -2) {\n mustRebuild = true;\n children[i + 1] = -1;\n continue;\n }\n let from = mapping.map(oldChildren[i] + oldOffset), fromLocal = from - offset;\n if (fromLocal < 0 || fromLocal >= node.content.size) {\n mustRebuild = true;\n continue;\n }\n // Must read oldChildren because children was tagged with -1\n let to = mapping.map(oldChildren[i + 1] + oldOffset, -1), toLocal = to - offset;\n let { index, offset: childOffset } = node.content.findIndex(fromLocal);\n let childNode = node.maybeChild(index);\n if (childNode && childOffset == fromLocal && childOffset + childNode.nodeSize == toLocal) {\n let mapped = children[i + 2]\n .mapInner(mapping, childNode, from + 1, oldChildren[i] + oldOffset + 1, options);\n if (mapped != empty) {\n children[i] = fromLocal;\n children[i + 1] = toLocal;\n children[i + 2] = mapped;\n }\n else {\n children[i + 1] = -2;\n mustRebuild = true;\n }\n }\n else {\n mustRebuild = true;\n }\n }\n // Remaining children must be collected and rebuilt into the appropriate structure\n if (mustRebuild) {\n let decorations = mapAndGatherRemainingDecorations(children, oldChildren, newLocal, mapping, offset, oldOffset, options);\n let built = buildTree(decorations, node, 0, options);\n newLocal = built.local;\n for (let i = 0; i < children.length; i += 3)\n if (children[i + 1] < 0) {\n children.splice(i, 3);\n i -= 3;\n }\n for (let i = 0, j = 0; i < built.children.length; i += 3) {\n let from = built.children[i];\n while (j < children.length && children[j] < from)\n j += 3;\n children.splice(j, 0, built.children[i], built.children[i + 1], built.children[i + 2]);\n }\n }\n return new DecorationSet(newLocal.sort(byPos), children);\n}\nfunction moveSpans(spans, offset) {\n if (!offset || !spans.length)\n return spans;\n let result = [];\n for (let i = 0; i < spans.length; i++) {\n let span = spans[i];\n result.push(new Decoration(span.from + offset, span.to + offset, span.type));\n }\n return result;\n}\nfunction mapAndGatherRemainingDecorations(children, oldChildren, decorations, mapping, offset, oldOffset, options) {\n // Gather all decorations from the remaining marked children\n function gather(set, oldOffset) {\n for (let i = 0; i < set.local.length; i++) {\n let mapped = set.local[i].map(mapping, offset, oldOffset);\n if (mapped)\n decorations.push(mapped);\n else if (options.onRemove)\n options.onRemove(set.local[i].spec);\n }\n for (let i = 0; i < set.children.length; i += 3)\n gather(set.children[i + 2], set.children[i] + oldOffset + 1);\n }\n for (let i = 0; i < children.length; i += 3)\n if (children[i + 1] == -1)\n gather(children[i + 2], oldChildren[i] + oldOffset + 1);\n return decorations;\n}\nfunction takeSpansForNode(spans, node, offset) {\n if (node.isLeaf)\n return null;\n let end = offset + node.nodeSize, found = null;\n for (let i = 0, span; i < spans.length; i++) {\n if ((span = spans[i]) && span.from > offset && span.to < end) {\n (found || (found = [])).push(span);\n spans[i] = null;\n }\n }\n return found;\n}\nfunction withoutNulls(array) {\n let result = [];\n for (let i = 0; i < array.length; i++)\n if (array[i] != null)\n result.push(array[i]);\n return result;\n}\n// Build up a tree that corresponds to a set of decorations. `offset`\n// is a base offset that should be subtracted from the `from` and `to`\n// positions in the spans (so that we don't have to allocate new spans\n// for recursive calls).\nfunction buildTree(spans, node, offset, options) {\n let children = [], hasNulls = false;\n node.forEach((childNode, localStart) => {\n let found = takeSpansForNode(spans, childNode, localStart + offset);\n if (found) {\n hasNulls = true;\n let subtree = buildTree(found, childNode, offset + localStart + 1, options);\n if (subtree != empty)\n children.push(localStart, localStart + childNode.nodeSize, subtree);\n }\n });\n let locals = moveSpans(hasNulls ? withoutNulls(spans) : spans, -offset).sort(byPos);\n for (let i = 0; i < locals.length; i++)\n if (!locals[i].type.valid(node, locals[i])) {\n if (options.onRemove)\n options.onRemove(locals[i].spec);\n locals.splice(i--, 1);\n }\n return locals.length || children.length ? new DecorationSet(locals, children) : empty;\n}\n// Used to sort decorations so that ones with a low start position\n// come first, and within a set with the same start position, those\n// with an smaller end position come first.\nfunction byPos(a, b) {\n return a.from - b.from || a.to - b.to;\n}\n// Scan a sorted array of decorations for partially overlapping spans,\n// and split those so that only fully overlapping spans are left (to\n// make subsequent rendering easier). Will return the input array if\n// no partially overlapping spans are found (the common case).\nfunction removeOverlap(spans) {\n let working = spans;\n for (let i = 0; i < working.length - 1; i++) {\n let span = working[i];\n if (span.from != span.to)\n for (let j = i + 1; j < working.length; j++) {\n let next = working[j];\n if (next.from == span.from) {\n if (next.to != span.to) {\n if (working == spans)\n working = spans.slice();\n // Followed by a partially overlapping larger span. Split that\n // span.\n working[j] = next.copy(next.from, span.to);\n insertAhead(working, j + 1, next.copy(span.to, next.to));\n }\n continue;\n }\n else {\n if (next.from < span.to) {\n if (working == spans)\n working = spans.slice();\n // The end of this one overlaps with a subsequent span. Split\n // this one.\n working[i] = span.copy(span.from, next.from);\n insertAhead(working, j, span.copy(next.from, span.to));\n }\n break;\n }\n }\n }\n return working;\n}\nfunction insertAhead(array, i, deco) {\n while (i < array.length && byPos(deco, array[i]) > 0)\n i++;\n array.splice(i, 0, deco);\n}\n// Get the decorations associated with the current props of a view.\nfunction viewDecorations(view) {\n let found = [];\n view.someProp(\"decorations\", f => {\n let result = f(view.state);\n if (result && result != empty)\n found.push(result);\n });\n if (view.cursorWrapper)\n found.push(DecorationSet.create(view.state.doc, [view.cursorWrapper.deco]));\n return DecorationGroup.from(found);\n}\n\nconst observeOptions = {\n childList: true,\n characterData: true,\n characterDataOldValue: true,\n attributes: true,\n attributeOldValue: true,\n subtree: true\n};\n// IE11 has very broken mutation observers, so we also listen to DOMCharacterDataModified\nconst useCharData = ie && ie_version <= 11;\nclass SelectionState {\n constructor() {\n this.anchorNode = null;\n this.anchorOffset = 0;\n this.focusNode = null;\n this.focusOffset = 0;\n }\n set(sel) {\n this.anchorNode = sel.anchorNode;\n this.anchorOffset = sel.anchorOffset;\n this.focusNode = sel.focusNode;\n this.focusOffset = sel.focusOffset;\n }\n clear() {\n this.anchorNode = this.focusNode = null;\n }\n eq(sel) {\n return sel.anchorNode == this.anchorNode && sel.anchorOffset == this.anchorOffset &&\n sel.focusNode == this.focusNode && sel.focusOffset == this.focusOffset;\n }\n}\nclass DOMObserver {\n constructor(view, handleDOMChange) {\n this.view = view;\n this.handleDOMChange = handleDOMChange;\n this.queue = [];\n this.flushingSoon = -1;\n this.observer = null;\n this.currentSelection = new SelectionState;\n this.onCharData = null;\n this.suppressingSelectionUpdates = false;\n this.lastChangedTextNode = null;\n this.observer = window.MutationObserver &&\n new window.MutationObserver(mutations => {\n for (let i = 0; i < mutations.length; i++)\n this.queue.push(mutations[i]);\n // IE11 will sometimes (on backspacing out a single character\n // text node after a BR node) call the observer callback\n // before actually updating the DOM, which will cause\n // ProseMirror to miss the change (see #930)\n if (ie && ie_version <= 11 && mutations.some(m => m.type == \"childList\" && m.removedNodes.length ||\n m.type == \"characterData\" && m.oldValue.length > m.target.nodeValue.length))\n this.flushSoon();\n else\n this.flush();\n });\n if (useCharData) {\n this.onCharData = e => {\n this.queue.push({ target: e.target, type: \"characterData\", oldValue: e.prevValue });\n this.flushSoon();\n };\n }\n this.onSelectionChange = this.onSelectionChange.bind(this);\n }\n flushSoon() {\n if (this.flushingSoon < 0)\n this.flushingSoon = window.setTimeout(() => { this.flushingSoon = -1; this.flush(); }, 20);\n }\n forceFlush() {\n if (this.flushingSoon > -1) {\n window.clearTimeout(this.flushingSoon);\n this.flushingSoon = -1;\n this.flush();\n }\n }\n start() {\n if (this.observer) {\n this.observer.takeRecords();\n this.observer.observe(this.view.dom, observeOptions);\n }\n if (this.onCharData)\n this.view.dom.addEventListener(\"DOMCharacterDataModified\", this.onCharData);\n this.connectSelection();\n }\n stop() {\n if (this.observer) {\n let take = this.observer.takeRecords();\n if (take.length) {\n for (let i = 0; i < take.length; i++)\n this.queue.push(take[i]);\n window.setTimeout(() => this.flush(), 20);\n }\n this.observer.disconnect();\n }\n if (this.onCharData)\n this.view.dom.removeEventListener(\"DOMCharacterDataModified\", this.onCharData);\n this.disconnectSelection();\n }\n connectSelection() {\n this.view.dom.ownerDocument.addEventListener(\"selectionchange\", this.onSelectionChange);\n }\n disconnectSelection() {\n this.view.dom.ownerDocument.removeEventListener(\"selectionchange\", this.onSelectionChange);\n }\n suppressSelectionUpdates() {\n this.suppressingSelectionUpdates = true;\n setTimeout(() => this.suppressingSelectionUpdates = false, 50);\n }\n onSelectionChange() {\n if (!hasFocusAndSelection(this.view))\n return;\n if (this.suppressingSelectionUpdates)\n return selectionToDOM(this.view);\n // Deletions on IE11 fire their events in the wrong order, giving\n // us a selection change event before the DOM changes are\n // reported.\n if (ie && ie_version <= 11 && !this.view.state.selection.empty) {\n let sel = this.view.domSelectionRange();\n // Selection.isCollapsed isn't reliable on IE\n if (sel.focusNode && isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset))\n return this.flushSoon();\n }\n this.flush();\n }\n setCurSelection() {\n this.currentSelection.set(this.view.domSelectionRange());\n }\n ignoreSelectionChange(sel) {\n if (!sel.focusNode)\n return true;\n let ancestors = new Set, container;\n for (let scan = sel.focusNode; scan; scan = parentNode(scan))\n ancestors.add(scan);\n for (let scan = sel.anchorNode; scan; scan = parentNode(scan))\n if (ancestors.has(scan)) {\n container = scan;\n break;\n }\n let desc = container && this.view.docView.nearestDesc(container);\n if (desc && desc.ignoreMutation({\n type: \"selection\",\n target: container.nodeType == 3 ? container.parentNode : container\n })) {\n this.setCurSelection();\n return true;\n }\n }\n pendingRecords() {\n if (this.observer)\n for (let mut of this.observer.takeRecords())\n this.queue.push(mut);\n return this.queue;\n }\n flush() {\n let { view } = this;\n if (!view.docView || this.flushingSoon > -1)\n return;\n let mutations = this.pendingRecords();\n if (mutations.length)\n this.queue = [];\n let sel = view.domSelectionRange();\n let newSel = !this.suppressingSelectionUpdates && !this.currentSelection.eq(sel) && hasFocusAndSelection(view) && !this.ignoreSelectionChange(sel);\n let from = -1, to = -1, typeOver = false, added = [];\n if (view.editable) {\n for (let i = 0; i < mutations.length; i++) {\n let result = this.registerMutation(mutations[i], added);\n if (result) {\n from = from < 0 ? result.from : Math.min(result.from, from);\n to = to < 0 ? result.to : Math.max(result.to, to);\n if (result.typeOver)\n typeOver = true;\n }\n }\n }\n if (gecko && added.length) {\n let brs = added.filter(n => n.nodeName == \"BR\");\n if (brs.length == 2) {\n let [a, b] = brs;\n if (a.parentNode && a.parentNode.parentNode == b.parentNode)\n b.remove();\n else\n a.remove();\n }\n else {\n let { focusNode } = this.currentSelection;\n for (let br of brs) {\n let parent = br.parentNode;\n if (parent && parent.nodeName == \"LI\" && (!focusNode || blockParent(view, focusNode) != parent))\n br.remove();\n }\n }\n }\n let readSel = null;\n // If it looks like the browser has reset the selection to the\n // start of the document after focus, restore the selection from\n // the state\n if (from < 0 && newSel && view.input.lastFocus > Date.now() - 200 &&\n Math.max(view.input.lastTouch, view.input.lastClick.time) < Date.now() - 300 &&\n selectionCollapsed(sel) && (readSel = selectionFromDOM(view)) &&\n readSel.eq(Selection.near(view.state.doc.resolve(0), 1))) {\n view.input.lastFocus = 0;\n selectionToDOM(view);\n this.currentSelection.set(sel);\n }\n else if (from > -1 || newSel) {\n if (from > -1) {\n view.docView.markDirty(from, to);\n checkCSS(view);\n }\n this.handleDOMChange(from, to, typeOver, added);\n if (view.docView && view.docView.dirty)\n view.updateState(view.state);\n else if (!this.currentSelection.eq(sel))\n selectionToDOM(view);\n this.currentSelection.set(sel);\n }\n }\n registerMutation(mut, added) {\n // Ignore mutations inside nodes that were already noted as inserted\n if (added.indexOf(mut.target) > -1)\n return null;\n let desc = this.view.docView.nearestDesc(mut.target);\n if (mut.type == \"attributes\" &&\n (desc == this.view.docView || mut.attributeName == \"contenteditable\" ||\n // Firefox sometimes fires spurious events for null/empty styles\n (mut.attributeName == \"style\" && !mut.oldValue && !mut.target.getAttribute(\"style\"))))\n return null;\n if (!desc || desc.ignoreMutation(mut))\n return null;\n if (mut.type == \"childList\") {\n for (let i = 0; i < mut.addedNodes.length; i++) {\n let node = mut.addedNodes[i];\n added.push(node);\n if (node.nodeType == 3)\n this.lastChangedTextNode = node;\n }\n if (desc.contentDOM && desc.contentDOM != desc.dom && !desc.contentDOM.contains(mut.target))\n return { from: desc.posBefore, to: desc.posAfter };\n let prev = mut.previousSibling, next = mut.nextSibling;\n if (ie && ie_version <= 11 && mut.addedNodes.length) {\n // IE11 gives us incorrect next/prev siblings for some\n // insertions, so if there are added nodes, recompute those\n for (let i = 0; i < mut.addedNodes.length; i++) {\n let { previousSibling, nextSibling } = mut.addedNodes[i];\n if (!previousSibling || Array.prototype.indexOf.call(mut.addedNodes, previousSibling) < 0)\n prev = previousSibling;\n if (!nextSibling || Array.prototype.indexOf.call(mut.addedNodes, nextSibling) < 0)\n next = nextSibling;\n }\n }\n let fromOffset = prev && prev.parentNode == mut.target\n ? domIndex(prev) + 1 : 0;\n let from = desc.localPosFromDOM(mut.target, fromOffset, -1);\n let toOffset = next && next.parentNode == mut.target\n ? domIndex(next) : mut.target.childNodes.length;\n let to = desc.localPosFromDOM(mut.target, toOffset, 1);\n return { from, to };\n }\n else if (mut.type == \"attributes\") {\n return { from: desc.posAtStart - desc.border, to: desc.posAtEnd + desc.border };\n }\n else { // \"characterData\"\n this.lastChangedTextNode = mut.target;\n return {\n from: desc.posAtStart,\n to: desc.posAtEnd,\n // An event was generated for a text change that didn't change\n // any text. Mark the dom change to fall back to assuming the\n // selection was typed over with an identical value if it can't\n // find another change.\n typeOver: mut.target.nodeValue == mut.oldValue\n };\n }\n }\n}\nlet cssChecked = new WeakMap();\nlet cssCheckWarned = false;\nfunction checkCSS(view) {\n if (cssChecked.has(view))\n return;\n cssChecked.set(view, null);\n if (['normal', 'nowrap', 'pre-line'].indexOf(getComputedStyle(view.dom).whiteSpace) !== -1) {\n view.requiresGeckoHackNode = gecko;\n if (cssCheckWarned)\n return;\n console[\"warn\"](\"ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.\");\n cssCheckWarned = true;\n }\n}\nfunction rangeToSelectionRange(view, range) {\n let anchorNode = range.startContainer, anchorOffset = range.startOffset;\n let focusNode = range.endContainer, focusOffset = range.endOffset;\n let currentAnchor = view.domAtPos(view.state.selection.anchor);\n // Since such a range doesn't distinguish between anchor and head,\n // use a heuristic that flips it around if its end matches the\n // current anchor.\n if (isEquivalentPosition(currentAnchor.node, currentAnchor.offset, focusNode, focusOffset))\n [anchorNode, anchorOffset, focusNode, focusOffset] = [focusNode, focusOffset, anchorNode, anchorOffset];\n return { anchorNode, anchorOffset, focusNode, focusOffset };\n}\n// Used to work around a Safari Selection/shadow DOM bug\n// Based on https://github.com/codemirror/dev/issues/414 fix\nfunction safariShadowSelectionRange(view, selection) {\n if (selection.getComposedRanges) {\n let range = selection.getComposedRanges(view.root)[0];\n if (range)\n return rangeToSelectionRange(view, range);\n }\n let found;\n function read(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n found = event.getTargetRanges()[0];\n }\n // Because Safari (at least in 2018-2022) doesn't provide regular\n // access to the selection inside a shadowRoot, we have to perform a\n // ridiculous hack to get at it—using `execCommand` to trigger a\n // `beforeInput` event so that we can read the target range from the\n // event.\n view.dom.addEventListener(\"beforeinput\", read, true);\n document.execCommand(\"indent\");\n view.dom.removeEventListener(\"beforeinput\", read, true);\n return found ? rangeToSelectionRange(view, found) : null;\n}\nfunction blockParent(view, node) {\n for (let p = node.parentNode; p && p != view.dom; p = p.parentNode) {\n let desc = view.docView.nearestDesc(p, true);\n if (desc && desc.node.isBlock)\n return p;\n }\n return null;\n}\n\n// Note that all referencing and parsing is done with the\n// start-of-operation selection and document, since that's the one\n// that the DOM represents. If any changes came in in the meantime,\n// the modification is mapped over those before it is applied, in\n// readDOMChange.\nfunction parseBetween(view, from_, to_) {\n let { node: parent, fromOffset, toOffset, from, to } = view.docView.parseRange(from_, to_);\n let domSel = view.domSelectionRange();\n let find;\n let anchor = domSel.anchorNode;\n if (anchor && view.dom.contains(anchor.nodeType == 1 ? anchor : anchor.parentNode)) {\n find = [{ node: anchor, offset: domSel.anchorOffset }];\n if (!selectionCollapsed(domSel))\n find.push({ node: domSel.focusNode, offset: domSel.focusOffset });\n }\n // Work around issue in Chrome where backspacing sometimes replaces\n // the deleted content with a random BR node (issues #799, #831)\n if (chrome && view.input.lastKeyCode === 8) {\n for (let off = toOffset; off > fromOffset; off--) {\n let node = parent.childNodes[off - 1], desc = node.pmViewDesc;\n if (node.nodeName == \"BR\" && !desc) {\n toOffset = off;\n break;\n }\n if (!desc || desc.size)\n break;\n }\n }\n let startDoc = view.state.doc;\n let parser = view.someProp(\"domParser\") || DOMParser.fromSchema(view.state.schema);\n let $from = startDoc.resolve(from);\n let sel = null, doc = parser.parse(parent, {\n topNode: $from.parent,\n topMatch: $from.parent.contentMatchAt($from.index()),\n topOpen: true,\n from: fromOffset,\n to: toOffset,\n preserveWhitespace: $from.parent.type.whitespace == \"pre\" ? \"full\" : true,\n findPositions: find,\n ruleFromNode,\n context: $from\n });\n if (find && find[0].pos != null) {\n let anchor = find[0].pos, head = find[1] && find[1].pos;\n if (head == null)\n head = anchor;\n sel = { anchor: anchor + from, head: head + from };\n }\n return { doc, sel, from, to };\n}\nfunction ruleFromNode(dom) {\n let desc = dom.pmViewDesc;\n if (desc) {\n return desc.parseRule();\n }\n else if (dom.nodeName == \"BR\" && dom.parentNode) {\n // Safari replaces the list item or table cell with a BR\n // directly in the list node (?!) if you delete the last\n // character in a list item or table cell (#708, #862)\n if (safari && /^(ul|ol)$/i.test(dom.parentNode.nodeName)) {\n let skip = document.createElement(\"div\");\n skip.appendChild(document.createElement(\"li\"));\n return { skip };\n }\n else if (dom.parentNode.lastChild == dom || safari && /^(tr|table)$/i.test(dom.parentNode.nodeName)) {\n return { ignore: true };\n }\n }\n else if (dom.nodeName == \"IMG\" && dom.getAttribute(\"mark-placeholder\")) {\n return { ignore: true };\n }\n return null;\n}\nconst isInline = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;\nfunction readDOMChange(view, from, to, typeOver, addedNodes) {\n let compositionID = view.input.compositionPendingChanges || (view.composing ? view.input.compositionID : 0);\n view.input.compositionPendingChanges = 0;\n if (from < 0) {\n let origin = view.input.lastSelectionTime > Date.now() - 50 ? view.input.lastSelectionOrigin : null;\n let newSel = selectionFromDOM(view, origin);\n if (newSel && !view.state.selection.eq(newSel)) {\n if (chrome && android &&\n view.input.lastKeyCode === 13 && Date.now() - 100 < view.input.lastKeyCodeTime &&\n view.someProp(\"handleKeyDown\", f => f(view, keyEvent(13, \"Enter\"))))\n return;\n let tr = view.state.tr.setSelection(newSel);\n if (origin == \"pointer\")\n tr.setMeta(\"pointer\", true);\n else if (origin == \"key\")\n tr.scrollIntoView();\n if (compositionID)\n tr.setMeta(\"composition\", compositionID);\n view.dispatch(tr);\n }\n return;\n }\n let $before = view.state.doc.resolve(from);\n let shared = $before.sharedDepth(to);\n from = $before.before(shared + 1);\n to = view.state.doc.resolve(to).after(shared + 1);\n let sel = view.state.selection;\n let parse = parseBetween(view, from, to);\n let doc = view.state.doc, compare = doc.slice(parse.from, parse.to);\n let preferredPos, preferredSide;\n // Prefer anchoring to end when Backspace is pressed\n if (view.input.lastKeyCode === 8 && Date.now() - 100 < view.input.lastKeyCodeTime) {\n preferredPos = view.state.selection.to;\n preferredSide = \"end\";\n }\n else {\n preferredPos = view.state.selection.from;\n preferredSide = \"start\";\n }\n view.input.lastKeyCode = null;\n let change = findDiff(compare.content, parse.doc.content, parse.from, preferredPos, preferredSide);\n if (change)\n view.input.domChangeCount++;\n if ((ios && view.input.lastIOSEnter > Date.now() - 225 || android) &&\n addedNodes.some(n => n.nodeType == 1 && !isInline.test(n.nodeName)) &&\n (!change || change.endA >= change.endB) &&\n view.someProp(\"handleKeyDown\", f => f(view, keyEvent(13, \"Enter\")))) {\n view.input.lastIOSEnter = 0;\n return;\n }\n if (!change) {\n if (typeOver && sel instanceof TextSelection && !sel.empty && sel.$head.sameParent(sel.$anchor) &&\n !view.composing && !(parse.sel && parse.sel.anchor != parse.sel.head)) {\n change = { start: sel.from, endA: sel.to, endB: sel.to };\n }\n else {\n if (parse.sel) {\n let sel = resolveSelection(view, view.state.doc, parse.sel);\n if (sel && !sel.eq(view.state.selection)) {\n let tr = view.state.tr.setSelection(sel);\n if (compositionID)\n tr.setMeta(\"composition\", compositionID);\n view.dispatch(tr);\n }\n }\n return;\n }\n }\n // Handle the case where overwriting a selection by typing matches\n // the start or end of the selected content, creating a change\n // that's smaller than what was actually overwritten.\n if (view.state.selection.from < view.state.selection.to &&\n change.start == change.endB &&\n view.state.selection instanceof TextSelection) {\n if (change.start > view.state.selection.from && change.start <= view.state.selection.from + 2 &&\n view.state.selection.from >= parse.from) {\n change.start = view.state.selection.from;\n }\n else if (change.endA < view.state.selection.to && change.endA >= view.state.selection.to - 2 &&\n view.state.selection.to <= parse.to) {\n change.endB += (view.state.selection.to - change.endA);\n change.endA = view.state.selection.to;\n }\n }\n // IE11 will insert a non-breaking space _ahead_ of the space after\n // the cursor space when adding a space before another space. When\n // that happened, adjust the change to cover the space instead.\n if (ie && ie_version <= 11 && change.endB == change.start + 1 &&\n change.endA == change.start && change.start > parse.from &&\n parse.doc.textBetween(change.start - parse.from - 1, change.start - parse.from + 1) == \" \\u00a0\") {\n change.start--;\n change.endA--;\n change.endB--;\n }\n let $from = parse.doc.resolveNoCache(change.start - parse.from);\n let $to = parse.doc.resolveNoCache(change.endB - parse.from);\n let $fromA = doc.resolve(change.start);\n let inlineChange = $from.sameParent($to) && $from.parent.inlineContent && $fromA.end() >= change.endA;\n let nextSel;\n // If this looks like the effect of pressing Enter (or was recorded\n // as being an iOS enter press), just dispatch an Enter key instead.\n if (((ios && view.input.lastIOSEnter > Date.now() - 225 &&\n (!inlineChange || addedNodes.some(n => n.nodeName == \"DIV\" || n.nodeName == \"P\"))) ||\n (!inlineChange && $from.pos < parse.doc.content.size && !$from.sameParent($to) &&\n (nextSel = Selection.findFrom(parse.doc.resolve($from.pos + 1), 1, true)) &&\n nextSel.head == $to.pos)) &&\n view.someProp(\"handleKeyDown\", f => f(view, keyEvent(13, \"Enter\")))) {\n view.input.lastIOSEnter = 0;\n return;\n }\n // Same for backspace\n if (view.state.selection.anchor > change.start &&\n looksLikeBackspace(doc, change.start, change.endA, $from, $to) &&\n view.someProp(\"handleKeyDown\", f => f(view, keyEvent(8, \"Backspace\")))) {\n if (android && chrome)\n view.domObserver.suppressSelectionUpdates(); // #820\n return;\n }\n // Chrome will occasionally, during composition, delete the\n // entire composition and then immediately insert it again. This is\n // used to detect that situation.\n if (chrome && change.endB == change.start)\n view.input.lastChromeDelete = Date.now();\n // This tries to detect Android virtual keyboard\n // enter-and-pick-suggestion action. That sometimes (see issue\n // #1059) first fires a DOM mutation, before moving the selection to\n // the newly created block. And then, because ProseMirror cleans up\n // the DOM selection, it gives up moving the selection entirely,\n // leaving the cursor in the wrong place. When that happens, we drop\n // the new paragraph from the initial change, and fire a simulated\n // enter key afterwards.\n if (android && !inlineChange && $from.start() != $to.start() && $to.parentOffset == 0 && $from.depth == $to.depth &&\n parse.sel && parse.sel.anchor == parse.sel.head && parse.sel.head == change.endA) {\n change.endB -= 2;\n $to = parse.doc.resolveNoCache(change.endB - parse.from);\n setTimeout(() => {\n view.someProp(\"handleKeyDown\", function (f) { return f(view, keyEvent(13, \"Enter\")); });\n }, 20);\n }\n let chFrom = change.start, chTo = change.endA;\n let tr, storedMarks, markChange;\n if (inlineChange) {\n if ($from.pos == $to.pos) { // Deletion\n // IE11 sometimes weirdly moves the DOM selection around after\n // backspacing out the first element in a textblock\n if (ie && ie_version <= 11 && $from.parentOffset == 0) {\n view.domObserver.suppressSelectionUpdates();\n setTimeout(() => selectionToDOM(view), 20);\n }\n tr = view.state.tr.delete(chFrom, chTo);\n storedMarks = doc.resolve(change.start).marksAcross(doc.resolve(change.endA));\n }\n else if ( // Adding or removing a mark\n change.endA == change.endB &&\n (markChange = isMarkChange($from.parent.content.cut($from.parentOffset, $to.parentOffset), $fromA.parent.content.cut($fromA.parentOffset, change.endA - $fromA.start())))) {\n tr = view.state.tr;\n if (markChange.type == \"add\")\n tr.addMark(chFrom, chTo, markChange.mark);\n else\n tr.removeMark(chFrom, chTo, markChange.mark);\n }\n else if ($from.parent.child($from.index()).isText && $from.index() == $to.index() - ($to.textOffset ? 0 : 1)) {\n // Both positions in the same text node -- simply insert text\n let text = $from.parent.textBetween($from.parentOffset, $to.parentOffset);\n if (view.someProp(\"handleTextInput\", f => f(view, chFrom, chTo, text)))\n return;\n tr = view.state.tr.insertText(text, chFrom, chTo);\n }\n }\n if (!tr)\n tr = view.state.tr.replace(chFrom, chTo, parse.doc.slice(change.start - parse.from, change.endB - parse.from));\n if (parse.sel) {\n let sel = resolveSelection(view, tr.doc, parse.sel);\n // Chrome will sometimes, during composition, report the\n // selection in the wrong place. If it looks like that is\n // happening, don't update the selection.\n // Edge just doesn't move the cursor forward when you start typing\n // in an empty block or between br nodes.\n if (sel && !(chrome && view.composing && sel.empty &&\n (change.start != change.endB || view.input.lastChromeDelete < Date.now() - 100) &&\n (sel.head == chFrom || sel.head == tr.mapping.map(chTo) - 1) ||\n ie && sel.empty && sel.head == chFrom))\n tr.setSelection(sel);\n }\n if (storedMarks)\n tr.ensureMarks(storedMarks);\n if (compositionID)\n tr.setMeta(\"composition\", compositionID);\n view.dispatch(tr.scrollIntoView());\n}\nfunction resolveSelection(view, doc, parsedSel) {\n if (Math.max(parsedSel.anchor, parsedSel.head) > doc.content.size)\n return null;\n return selectionBetween(view, doc.resolve(parsedSel.anchor), doc.resolve(parsedSel.head));\n}\n// Given two same-length, non-empty fragments of inline content,\n// determine whether the first could be created from the second by\n// removing or adding a single mark type.\nfunction isMarkChange(cur, prev) {\n let curMarks = cur.firstChild.marks, prevMarks = prev.firstChild.marks;\n let added = curMarks, removed = prevMarks, type, mark, update;\n for (let i = 0; i < prevMarks.length; i++)\n added = prevMarks[i].removeFromSet(added);\n for (let i = 0; i < curMarks.length; i++)\n removed = curMarks[i].removeFromSet(removed);\n if (added.length == 1 && removed.length == 0) {\n mark = added[0];\n type = \"add\";\n update = (node) => node.mark(mark.addToSet(node.marks));\n }\n else if (added.length == 0 && removed.length == 1) {\n mark = removed[0];\n type = \"remove\";\n update = (node) => node.mark(mark.removeFromSet(node.marks));\n }\n else {\n return null;\n }\n let updated = [];\n for (let i = 0; i < prev.childCount; i++)\n updated.push(update(prev.child(i)));\n if (Fragment.from(updated).eq(cur))\n return { mark, type };\n}\nfunction looksLikeBackspace(old, start, end, $newStart, $newEnd) {\n if ( // The content must have shrunk\n end - start <= $newEnd.pos - $newStart.pos ||\n // newEnd must point directly at or after the end of the block that newStart points into\n skipClosingAndOpening($newStart, true, false) < $newEnd.pos)\n return false;\n let $start = old.resolve(start);\n // Handle the case where, rather than joining blocks, the change just removed an entire block\n if (!$newStart.parent.isTextblock) {\n let after = $start.nodeAfter;\n return after != null && end == start + after.nodeSize;\n }\n // Start must be at the end of a block\n if ($start.parentOffset < $start.parent.content.size || !$start.parent.isTextblock)\n return false;\n let $next = old.resolve(skipClosingAndOpening($start, true, true));\n // The next textblock must start before end and end near it\n if (!$next.parent.isTextblock || $next.pos > end ||\n skipClosingAndOpening($next, true, false) < end)\n return false;\n // The fragments after the join point must match\n return $newStart.parent.content.cut($newStart.parentOffset).eq($next.parent.content);\n}\nfunction skipClosingAndOpening($pos, fromEnd, mayOpen) {\n let depth = $pos.depth, end = fromEnd ? $pos.end() : $pos.pos;\n while (depth > 0 && (fromEnd || $pos.indexAfter(depth) == $pos.node(depth).childCount)) {\n depth--;\n end++;\n fromEnd = false;\n }\n if (mayOpen) {\n let next = $pos.node(depth).maybeChild($pos.indexAfter(depth));\n while (next && !next.isLeaf) {\n next = next.firstChild;\n end++;\n }\n }\n return end;\n}\nfunction findDiff(a, b, pos, preferredPos, preferredSide) {\n let start = a.findDiffStart(b, pos);\n if (start == null)\n return null;\n let { a: endA, b: endB } = a.findDiffEnd(b, pos + a.size, pos + b.size);\n if (preferredSide == \"end\") {\n let adjust = Math.max(0, start - Math.min(endA, endB));\n preferredPos -= endA + adjust - start;\n }\n if (endA < start && a.size < b.size) {\n let move = preferredPos <= start && preferredPos >= endA ? start - preferredPos : 0;\n start -= move;\n if (start && start < b.size && isSurrogatePair(b.textBetween(start - 1, start + 1)))\n start += move ? 1 : -1;\n endB = start + (endB - endA);\n endA = start;\n }\n else if (endB < start) {\n let move = preferredPos <= start && preferredPos >= endB ? start - preferredPos : 0;\n start -= move;\n if (start && start < a.size && isSurrogatePair(a.textBetween(start - 1, start + 1)))\n start += move ? 1 : -1;\n endA = start + (endA - endB);\n endB = start;\n }\n return { start, endA, endB };\n}\nfunction isSurrogatePair(str) {\n if (str.length != 2)\n return false;\n let a = str.charCodeAt(0), b = str.charCodeAt(1);\n return a >= 0xDC00 && a <= 0xDFFF && b >= 0xD800 && b <= 0xDBFF;\n}\n\n/**\n@internal\n*/\nconst __parseFromClipboard = parseFromClipboard;\n/**\n@internal\n*/\nconst __endComposition = endComposition;\n/**\nAn editor view manages the DOM structure that represents an\neditable document. Its state and behavior are determined by its\n[props](https://prosemirror.net/docs/ref/#view.DirectEditorProps).\n*/\nclass EditorView {\n /**\n Create a view. `place` may be a DOM node that the editor should\n be appended to, a function that will place it into the document,\n or an object whose `mount` property holds the node to use as the\n document container. If it is `null`, the editor will not be\n added to the document.\n */\n constructor(place, props) {\n this._root = null;\n /**\n @internal\n */\n this.focused = false;\n /**\n Kludge used to work around a Chrome bug @internal\n */\n this.trackWrites = null;\n this.mounted = false;\n /**\n @internal\n */\n this.markCursor = null;\n /**\n @internal\n */\n this.cursorWrapper = null;\n /**\n @internal\n */\n this.lastSelectedViewDesc = undefined;\n /**\n @internal\n */\n this.input = new InputState;\n this.prevDirectPlugins = [];\n this.pluginViews = [];\n /**\n Holds `true` when a hack node is needed in Firefox to prevent the\n [space is eaten issue](https://github.com/ProseMirror/prosemirror/issues/651)\n @internal\n */\n this.requiresGeckoHackNode = false;\n /**\n When editor content is being dragged, this object contains\n information about the dragged slice and whether it is being\n copied or moved. At any other time, it is null.\n */\n this.dragging = null;\n this._props = props;\n this.state = props.state;\n this.directPlugins = props.plugins || [];\n this.directPlugins.forEach(checkStateComponent);\n this.dispatch = this.dispatch.bind(this);\n this.dom = (place && place.mount) || document.createElement(\"div\");\n if (place) {\n if (place.appendChild)\n place.appendChild(this.dom);\n else if (typeof place == \"function\")\n place(this.dom);\n else if (place.mount)\n this.mounted = true;\n }\n this.editable = getEditable(this);\n updateCursorWrapper(this);\n this.nodeViews = buildNodeViews(this);\n this.docView = docViewDesc(this.state.doc, computeDocDeco(this), viewDecorations(this), this.dom, this);\n this.domObserver = new DOMObserver(this, (from, to, typeOver, added) => readDOMChange(this, from, to, typeOver, added));\n this.domObserver.start();\n initInput(this);\n this.updatePluginViews();\n }\n /**\n Holds `true` when a\n [composition](https://w3c.github.io/uievents/#events-compositionevents)\n is active.\n */\n get composing() { return this.input.composing; }\n /**\n The view's current [props](https://prosemirror.net/docs/ref/#view.EditorProps).\n */\n get props() {\n if (this._props.state != this.state) {\n let prev = this._props;\n this._props = {};\n for (let name in prev)\n this._props[name] = prev[name];\n this._props.state = this.state;\n }\n return this._props;\n }\n /**\n Update the view's props. Will immediately cause an update to\n the DOM.\n */\n update(props) {\n if (props.handleDOMEvents != this._props.handleDOMEvents)\n ensureListeners(this);\n let prevProps = this._props;\n this._props = props;\n if (props.plugins) {\n props.plugins.forEach(checkStateComponent);\n this.directPlugins = props.plugins;\n }\n this.updateStateInner(props.state, prevProps);\n }\n /**\n Update the view by updating existing props object with the object\n given as argument. Equivalent to `view.update(Object.assign({},\n view.props, props))`.\n */\n setProps(props) {\n let updated = {};\n for (let name in this._props)\n updated[name] = this._props[name];\n updated.state = this.state;\n for (let name in props)\n updated[name] = props[name];\n this.update(updated);\n }\n /**\n Update the editor's `state` prop, without touching any of the\n other props.\n */\n updateState(state) {\n this.updateStateInner(state, this._props);\n }\n updateStateInner(state, prevProps) {\n var _a;\n let prev = this.state, redraw = false, updateSel = false;\n // When stored marks are added, stop composition, so that they can\n // be displayed.\n if (state.storedMarks && this.composing) {\n clearComposition(this);\n updateSel = true;\n }\n this.state = state;\n let pluginsChanged = prev.plugins != state.plugins || this._props.plugins != prevProps.plugins;\n if (pluginsChanged || this._props.plugins != prevProps.plugins || this._props.nodeViews != prevProps.nodeViews) {\n let nodeViews = buildNodeViews(this);\n if (changedNodeViews(nodeViews, this.nodeViews)) {\n this.nodeViews = nodeViews;\n redraw = true;\n }\n }\n if (pluginsChanged || prevProps.handleDOMEvents != this._props.handleDOMEvents) {\n ensureListeners(this);\n }\n this.editable = getEditable(this);\n updateCursorWrapper(this);\n let innerDeco = viewDecorations(this), outerDeco = computeDocDeco(this);\n let scroll = prev.plugins != state.plugins && !prev.doc.eq(state.doc) ? \"reset\"\n : state.scrollToSelection > prev.scrollToSelection ? \"to selection\" : \"preserve\";\n let updateDoc = redraw || !this.docView.matchesNode(state.doc, outerDeco, innerDeco);\n if (updateDoc || !state.selection.eq(prev.selection))\n updateSel = true;\n let oldScrollPos = scroll == \"preserve\" && updateSel && this.dom.style.overflowAnchor == null && storeScrollPos(this);\n if (updateSel) {\n this.domObserver.stop();\n // Work around an issue in Chrome, IE, and Edge where changing\n // the DOM around an active selection puts it into a broken\n // state where the thing the user sees differs from the\n // selection reported by the Selection object (#710, #973,\n // #1011, #1013, #1035).\n let forceSelUpdate = updateDoc && (ie || chrome) && !this.composing &&\n !prev.selection.empty && !state.selection.empty && selectionContextChanged(prev.selection, state.selection);\n if (updateDoc) {\n // If the node that the selection points into is written to,\n // Chrome sometimes starts misreporting the selection, so this\n // tracks that and forces a selection reset when our update\n // did write to the node.\n let chromeKludge = chrome ? (this.trackWrites = this.domSelectionRange().focusNode) : null;\n if (this.composing)\n this.input.compositionNode = findCompositionNode(this);\n if (redraw || !this.docView.update(state.doc, outerDeco, innerDeco, this)) {\n this.docView.updateOuterDeco(outerDeco);\n this.docView.destroy();\n this.docView = docViewDesc(state.doc, outerDeco, innerDeco, this.dom, this);\n }\n if (chromeKludge && !this.trackWrites)\n forceSelUpdate = true;\n }\n // Work around for an issue where an update arriving right between\n // a DOM selection change and the \"selectionchange\" event for it\n // can cause a spurious DOM selection update, disrupting mouse\n // drag selection.\n if (forceSelUpdate ||\n !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) &&\n anchorInRightPlace(this))) {\n selectionToDOM(this, forceSelUpdate);\n }\n else {\n syncNodeSelection(this, state.selection);\n this.domObserver.setCurSelection();\n }\n this.domObserver.start();\n }\n this.updatePluginViews(prev);\n if (((_a = this.dragging) === null || _a === void 0 ? void 0 : _a.node) && !prev.doc.eq(state.doc))\n this.updateDraggedNode(this.dragging, prev);\n if (scroll == \"reset\") {\n this.dom.scrollTop = 0;\n }\n else if (scroll == \"to selection\") {\n this.scrollToSelection();\n }\n else if (oldScrollPos) {\n resetScrollPos(oldScrollPos);\n }\n }\n /**\n @internal\n */\n scrollToSelection() {\n let startDOM = this.domSelectionRange().focusNode;\n if (!startDOM || !this.dom.contains(startDOM.nodeType == 1 ? startDOM : startDOM.parentNode)) ;\n else if (this.someProp(\"handleScrollToSelection\", f => f(this))) ;\n else if (this.state.selection instanceof NodeSelection) {\n let target = this.docView.domAfterPos(this.state.selection.from);\n if (target.nodeType == 1)\n scrollRectIntoView(this, target.getBoundingClientRect(), startDOM);\n }\n else {\n scrollRectIntoView(this, this.coordsAtPos(this.state.selection.head, 1), startDOM);\n }\n }\n destroyPluginViews() {\n let view;\n while (view = this.pluginViews.pop())\n if (view.destroy)\n view.destroy();\n }\n updatePluginViews(prevState) {\n if (!prevState || prevState.plugins != this.state.plugins || this.directPlugins != this.prevDirectPlugins) {\n this.prevDirectPlugins = this.directPlugins;\n this.destroyPluginViews();\n for (let i = 0; i < this.directPlugins.length; i++) {\n let plugin = this.directPlugins[i];\n if (plugin.spec.view)\n this.pluginViews.push(plugin.spec.view(this));\n }\n for (let i = 0; i < this.state.plugins.length; i++) {\n let plugin = this.state.plugins[i];\n if (plugin.spec.view)\n this.pluginViews.push(plugin.spec.view(this));\n }\n }\n else {\n for (let i = 0; i < this.pluginViews.length; i++) {\n let pluginView = this.pluginViews[i];\n if (pluginView.update)\n pluginView.update(this, prevState);\n }\n }\n }\n updateDraggedNode(dragging, prev) {\n let sel = dragging.node, found = -1;\n if (this.state.doc.nodeAt(sel.from) == sel.node) {\n found = sel.from;\n }\n else {\n let movedPos = sel.from + (this.state.doc.content.size - prev.doc.content.size);\n let moved = movedPos > 0 && this.state.doc.nodeAt(movedPos);\n if (moved == sel.node)\n found = movedPos;\n }\n this.dragging = new Dragging(dragging.slice, dragging.move, found < 0 ? undefined : NodeSelection.create(this.state.doc, found));\n }\n someProp(propName, f) {\n let prop = this._props && this._props[propName], value;\n if (prop != null && (value = f ? f(prop) : prop))\n return value;\n for (let i = 0; i < this.directPlugins.length; i++) {\n let prop = this.directPlugins[i].props[propName];\n if (prop != null && (value = f ? f(prop) : prop))\n return value;\n }\n let plugins = this.state.plugins;\n if (plugins)\n for (let i = 0; i < plugins.length; i++) {\n let prop = plugins[i].props[propName];\n if (prop != null && (value = f ? f(prop) : prop))\n return value;\n }\n }\n /**\n Query whether the view has focus.\n */\n hasFocus() {\n // Work around IE not handling focus correctly if resize handles are shown.\n // If the cursor is inside an element with resize handles, activeElement\n // will be that element instead of this.dom.\n if (ie) {\n // If activeElement is within this.dom, and there are no other elements\n // setting `contenteditable` to false in between, treat it as focused.\n let node = this.root.activeElement;\n if (node == this.dom)\n return true;\n if (!node || !this.dom.contains(node))\n return false;\n while (node && this.dom != node && this.dom.contains(node)) {\n if (node.contentEditable == 'false')\n return false;\n node = node.parentElement;\n }\n return true;\n }\n return this.root.activeElement == this.dom;\n }\n /**\n Focus the editor.\n */\n focus() {\n this.domObserver.stop();\n if (this.editable)\n focusPreventScroll(this.dom);\n selectionToDOM(this);\n this.domObserver.start();\n }\n /**\n Get the document root in which the editor exists. This will\n usually be the top-level `document`, but might be a [shadow\n DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM)\n root if the editor is inside one.\n */\n get root() {\n let cached = this._root;\n if (cached == null)\n for (let search = this.dom.parentNode; search; search = search.parentNode) {\n if (search.nodeType == 9 || (search.nodeType == 11 && search.host)) {\n if (!search.getSelection)\n Object.getPrototypeOf(search).getSelection = () => search.ownerDocument.getSelection();\n return this._root = search;\n }\n }\n return cached || document;\n }\n /**\n When an existing editor view is moved to a new document or\n shadow tree, call this to make it recompute its root.\n */\n updateRoot() {\n this._root = null;\n }\n /**\n Given a pair of viewport coordinates, return the document\n position that corresponds to them. May return null if the given\n coordinates aren't inside of the editor. When an object is\n returned, its `pos` property is the position nearest to the\n coordinates, and its `inside` property holds the position of the\n inner node that the position falls inside of, or -1 if it is at\n the top level, not in any node.\n */\n posAtCoords(coords) {\n return posAtCoords(this, coords);\n }\n /**\n Returns the viewport rectangle at a given document position.\n `left` and `right` will be the same number, as this returns a\n flat cursor-ish rectangle. If the position is between two things\n that aren't directly adjacent, `side` determines which element\n is used. When < 0, the element before the position is used,\n otherwise the element after.\n */\n coordsAtPos(pos, side = 1) {\n return coordsAtPos(this, pos, side);\n }\n /**\n Find the DOM position that corresponds to the given document\n position. When `side` is negative, find the position as close as\n possible to the content before the position. When positive,\n prefer positions close to the content after the position. When\n zero, prefer as shallow a position as possible.\n \n Note that you should **not** mutate the editor's internal DOM,\n only inspect it (and even that is usually not necessary).\n */\n domAtPos(pos, side = 0) {\n return this.docView.domFromPos(pos, side);\n }\n /**\n Find the DOM node that represents the document node after the\n given position. May return `null` when the position doesn't point\n in front of a node or if the node is inside an opaque node view.\n \n This is intended to be able to call things like\n `getBoundingClientRect` on that DOM node. Do **not** mutate the\n editor DOM directly, or add styling this way, since that will be\n immediately overriden by the editor as it redraws the node.\n */\n nodeDOM(pos) {\n let desc = this.docView.descAt(pos);\n return desc ? desc.nodeDOM : null;\n }\n /**\n Find the document position that corresponds to a given DOM\n position. (Whenever possible, it is preferable to inspect the\n document structure directly, rather than poking around in the\n DOM, but sometimes—for example when interpreting an event\n target—you don't have a choice.)\n \n The `bias` parameter can be used to influence which side of a DOM\n node to use when the position is inside a leaf node.\n */\n posAtDOM(node, offset, bias = -1) {\n let pos = this.docView.posFromDOM(node, offset, bias);\n if (pos == null)\n throw new RangeError(\"DOM position not inside the editor\");\n return pos;\n }\n /**\n Find out whether the selection is at the end of a textblock when\n moving in a given direction. When, for example, given `\"left\"`,\n it will return true if moving left from the current cursor\n position would leave that position's parent textblock. Will apply\n to the view's current state by default, but it is possible to\n pass a different state.\n */\n endOfTextblock(dir, state) {\n return endOfTextblock(this, state || this.state, dir);\n }\n /**\n Run the editor's paste logic with the given HTML string. The\n `event`, if given, will be passed to the\n [`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.\n */\n pasteHTML(html, event) {\n return doPaste(this, \"\", html, false, event || new ClipboardEvent(\"paste\"));\n }\n /**\n Run the editor's paste logic with the given plain-text input.\n */\n pasteText(text, event) {\n return doPaste(this, text, null, true, event || new ClipboardEvent(\"paste\"));\n }\n /**\n Serialize the given slice as it would be if it was copied from\n this editor. Returns a DOM element that contains a\n representation of the slice as its children, a textual\n representation, and the transformed slice (which can be\n different from the given input due to hooks like\n [`transformCopied`](https://prosemirror.net/docs/ref/#view.EditorProps.transformCopied)).\n */\n serializeForClipboard(slice) {\n return serializeForClipboard(this, slice);\n }\n /**\n Removes the editor from the DOM and destroys all [node\n views](https://prosemirror.net/docs/ref/#view.NodeView).\n */\n destroy() {\n if (!this.docView)\n return;\n destroyInput(this);\n this.destroyPluginViews();\n if (this.mounted) {\n this.docView.update(this.state.doc, [], viewDecorations(this), this);\n this.dom.textContent = \"\";\n }\n else if (this.dom.parentNode) {\n this.dom.parentNode.removeChild(this.dom);\n }\n this.docView.destroy();\n this.docView = null;\n clearReusedRange();\n }\n /**\n This is true when the view has been\n [destroyed](https://prosemirror.net/docs/ref/#view.EditorView.destroy) (and thus should not be\n used anymore).\n */\n get isDestroyed() {\n return this.docView == null;\n }\n /**\n Used for testing.\n */\n dispatchEvent(event) {\n return dispatchEvent(this, event);\n }\n /**\n Dispatch a transaction. Will call\n [`dispatchTransaction`](https://prosemirror.net/docs/ref/#view.DirectEditorProps.dispatchTransaction)\n when given, and otherwise defaults to applying the transaction to\n the current state and calling\n [`updateState`](https://prosemirror.net/docs/ref/#view.EditorView.updateState) with the result.\n This method is bound to the view instance, so that it can be\n easily passed around.\n */\n dispatch(tr) {\n let dispatchTransaction = this._props.dispatchTransaction;\n if (dispatchTransaction)\n dispatchTransaction.call(this, tr);\n else\n this.updateState(this.state.apply(tr));\n }\n /**\n @internal\n */\n domSelectionRange() {\n let sel = this.domSelection();\n if (!sel)\n return { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };\n return safari && this.root.nodeType === 11 &&\n deepActiveElement(this.dom.ownerDocument) == this.dom && safariShadowSelectionRange(this, sel) || sel;\n }\n /**\n @internal\n */\n domSelection() {\n return this.root.getSelection();\n }\n}\nfunction computeDocDeco(view) {\n let attrs = Object.create(null);\n attrs.class = \"ProseMirror\";\n attrs.contenteditable = String(view.editable);\n view.someProp(\"attributes\", value => {\n if (typeof value == \"function\")\n value = value(view.state);\n if (value)\n for (let attr in value) {\n if (attr == \"class\")\n attrs.class += \" \" + value[attr];\n else if (attr == \"style\")\n attrs.style = (attrs.style ? attrs.style + \";\" : \"\") + value[attr];\n else if (!attrs[attr] && attr != \"contenteditable\" && attr != \"nodeName\")\n attrs[attr] = String(value[attr]);\n }\n });\n if (!attrs.translate)\n attrs.translate = \"no\";\n return [Decoration.node(0, view.state.doc.content.size, attrs)];\n}\nfunction updateCursorWrapper(view) {\n if (view.markCursor) {\n let dom = document.createElement(\"img\");\n dom.className = \"ProseMirror-separator\";\n dom.setAttribute(\"mark-placeholder\", \"true\");\n dom.setAttribute(\"alt\", \"\");\n view.cursorWrapper = { dom, deco: Decoration.widget(view.state.selection.from, dom, { raw: true, marks: view.markCursor }) };\n }\n else {\n view.cursorWrapper = null;\n }\n}\nfunction getEditable(view) {\n return !view.someProp(\"editable\", value => value(view.state) === false);\n}\nfunction selectionContextChanged(sel1, sel2) {\n let depth = Math.min(sel1.$anchor.sharedDepth(sel1.head), sel2.$anchor.sharedDepth(sel2.head));\n return sel1.$anchor.start(depth) != sel2.$anchor.start(depth);\n}\nfunction buildNodeViews(view) {\n let result = Object.create(null);\n function add(obj) {\n for (let prop in obj)\n if (!Object.prototype.hasOwnProperty.call(result, prop))\n result[prop] = obj[prop];\n }\n view.someProp(\"nodeViews\", add);\n view.someProp(\"markViews\", add);\n return result;\n}\nfunction changedNodeViews(a, b) {\n let nA = 0, nB = 0;\n for (let prop in a) {\n if (a[prop] != b[prop])\n return true;\n nA++;\n }\n for (let _ in b)\n nB++;\n return nA != nB;\n}\nfunction checkStateComponent(plugin) {\n if (plugin.spec.state || plugin.spec.filterTransaction || plugin.spec.appendTransaction)\n throw new RangeError(\"Plugins passed directly to the view must not have a state component\");\n}\n\nexport { Decoration, DecorationSet, EditorView, __endComposition, __parseFromClipboard };\n","export var base = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 10: \"Enter\",\n 12: \"NumLock\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 44: \"PrintScreen\",\n 45: \"Insert\",\n 46: \"Delete\",\n 59: \";\",\n 61: \"=\",\n 91: \"Meta\",\n 92: \"Meta\",\n 106: \"*\",\n 107: \"+\",\n 108: \",\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 160: \"Shift\",\n 161: \"Shift\",\n 162: \"Control\",\n 163: \"Control\",\n 164: \"Alt\",\n 165: \"Alt\",\n 173: \"-\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\"\n}\n\nexport var shift = {\n 48: \")\",\n 49: \"!\",\n 50: \"@\",\n 51: \"#\",\n 52: \"$\",\n 53: \"%\",\n 54: \"^\",\n 55: \"&\",\n 56: \"*\",\n 57: \"(\",\n 59: \":\",\n 61: \"+\",\n 173: \"_\",\n 186: \":\",\n 187: \"+\",\n 188: \"<\",\n 189: \"_\",\n 190: \">\",\n 191: \"?\",\n 192: \"~\",\n 219: \"{\",\n 220: \"|\",\n 221: \"}\",\n 222: \"\\\"\"\n}\n\nvar mac = typeof navigator != \"undefined\" && /Mac/.test(navigator.platform)\nvar ie = typeof navigator != \"undefined\" && /MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent)\n\n// Fill in the digit keys\nfor (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i)\n\n// The function keys\nfor (var i = 1; i <= 24; i++) base[i + 111] = \"F\" + i\n\n// And the alphabetic keys\nfor (var i = 65; i <= 90; i++) {\n base[i] = String.fromCharCode(i + 32)\n shift[i] = String.fromCharCode(i)\n}\n\n// For each code that doesn't have a shift-equivalent, copy the base name\nfor (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code]\n\nexport function keyName(event) {\n // On macOS, keys held with Shift and Cmd don't reflect the effect of Shift in `.key`.\n // On IE, shift effect is never included in `.key`.\n var ignoreKey = mac && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey ||\n ie && event.shiftKey && event.key && event.key.length == 1 ||\n event.key == \"Unidentified\"\n var name = (!ignoreKey && event.key) ||\n (event.shiftKey ? shift : base)[event.keyCode] ||\n event.key || \"Unidentified\"\n // Edge sometimes produces wrong names (Issue #3)\n if (name == \"Esc\") name = \"Escape\"\n if (name == \"Del\") name = \"Delete\"\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/\n if (name == \"Left\") name = \"ArrowLeft\"\n if (name == \"Up\") name = \"ArrowUp\"\n if (name == \"Right\") name = \"ArrowRight\"\n if (name == \"Down\") name = \"ArrowDown\"\n return name\n}\n","import { keyName, base } from 'w3c-keyname';\nimport { Plugin } from 'prosemirror-state';\n\nconst mac = typeof navigator != \"undefined\" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : false;\nfunction normalizeKeyName(name) {\n let parts = name.split(/-(?!$)/), result = parts[parts.length - 1];\n if (result == \"Space\")\n result = \" \";\n let alt, ctrl, shift, meta;\n for (let i = 0; i < parts.length - 1; i++) {\n let mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod))\n meta = true;\n else if (/^a(lt)?$/i.test(mod))\n alt = true;\n else if (/^(c|ctrl|control)$/i.test(mod))\n ctrl = true;\n else if (/^s(hift)?$/i.test(mod))\n shift = true;\n else if (/^mod$/i.test(mod)) {\n if (mac)\n meta = true;\n else\n ctrl = true;\n }\n else\n throw new Error(\"Unrecognized modifier name: \" + mod);\n }\n if (alt)\n result = \"Alt-\" + result;\n if (ctrl)\n result = \"Ctrl-\" + result;\n if (meta)\n result = \"Meta-\" + result;\n if (shift)\n result = \"Shift-\" + result;\n return result;\n}\nfunction normalize(map) {\n let copy = Object.create(null);\n for (let prop in map)\n copy[normalizeKeyName(prop)] = map[prop];\n return copy;\n}\nfunction modifiers(name, event, shift = true) {\n if (event.altKey)\n name = \"Alt-\" + name;\n if (event.ctrlKey)\n name = \"Ctrl-\" + name;\n if (event.metaKey)\n name = \"Meta-\" + name;\n if (shift && event.shiftKey)\n name = \"Shift-\" + name;\n return name;\n}\n/**\nCreate a keymap plugin for the given set of bindings.\n\nBindings should map key names to [command](https://prosemirror.net/docs/ref/#commands)-style\nfunctions, which will be called with `(EditorState, dispatch,\nEditorView)` arguments, and should return true when they've handled\nthe key. Note that the view argument isn't part of the command\nprotocol, but can be used as an escape hatch if a binding needs to\ndirectly interact with the UI.\n\nKey names may be strings like `\"Shift-Ctrl-Enter\"`—a key\nidentifier prefixed with zero or more modifiers. Key identifiers\nare based on the strings that can appear in\n[`KeyEvent.key`](https:developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key).\nUse lowercase letters to refer to letter keys (or uppercase letters\nif you want shift to be held). You may use `\"Space\"` as an alias\nfor the `\" \"` name.\n\nModifiers can be given in any order. `Shift-` (or `s-`), `Alt-` (or\n`a-`), `Ctrl-` (or `c-` or `Control-`) and `Cmd-` (or `m-` or\n`Meta-`) are recognized. For characters that are created by holding\nshift, the `Shift-` prefix is implied, and should not be added\nexplicitly.\n\nYou can use `Mod-` as a shorthand for `Cmd-` on Mac and `Ctrl-` on\nother platforms.\n\nYou can add multiple keymap plugins to an editor. The order in\nwhich they appear determines their precedence (the ones early in\nthe array get to dispatch first).\n*/\nfunction keymap(bindings) {\n return new Plugin({ props: { handleKeyDown: keydownHandler(bindings) } });\n}\n/**\nGiven a set of bindings (using the same format as\n[`keymap`](https://prosemirror.net/docs/ref/#keymap.keymap)), return a [keydown\nhandler](https://prosemirror.net/docs/ref/#view.EditorProps.handleKeyDown) that handles them.\n*/\nfunction keydownHandler(bindings) {\n let map = normalize(bindings);\n return function (view, event) {\n let name = keyName(event), baseName, direct = map[modifiers(name, event)];\n if (direct && direct(view.state, view.dispatch, view))\n return true;\n // A character key\n if (name.length == 1 && name != \" \") {\n if (event.shiftKey) {\n // In case the name was already modified by shift, try looking\n // it up without its shift modifier\n let noShift = map[modifiers(name, event, false)];\n if (noShift && noShift(view.state, view.dispatch, view))\n return true;\n }\n if ((event.shiftKey || event.altKey || event.metaKey || name.charCodeAt(0) > 127) &&\n (baseName = base[event.keyCode]) && baseName != name) {\n // Try falling back to the keyCode when there's a modifier\n // active or the character produced isn't ASCII, and our table\n // produces a different name from the the keyCode. See #668,\n // #1060\n let fromCode = map[modifiers(baseName, event)];\n if (fromCode && fromCode(view.state, view.dispatch, view))\n return true;\n }\n }\n return false;\n };\n}\n\nexport { keydownHandler, keymap };\n","import { liftTarget, replaceStep, ReplaceStep, canJoin, joinPoint, canSplit, ReplaceAroundStep, findWrapping } from 'prosemirror-transform';\nimport { Slice, Fragment } from 'prosemirror-model';\nimport { NodeSelection, Selection, TextSelection, AllSelection, SelectionRange } from 'prosemirror-state';\n\n/**\nDelete the selection, if there is one.\n*/\nconst deleteSelection = (state, dispatch) => {\n if (state.selection.empty)\n return false;\n if (dispatch)\n dispatch(state.tr.deleteSelection().scrollIntoView());\n return true;\n};\nfunction atBlockStart(state, view) {\n let { $cursor } = state.selection;\n if (!$cursor || (view ? !view.endOfTextblock(\"backward\", state)\n : $cursor.parentOffset > 0))\n return null;\n return $cursor;\n}\n/**\nIf the selection is empty and at the start of a textblock, try to\nreduce the distance between that block and the one before it—if\nthere's a block directly before it that can be joined, join them.\nIf not, try to move the selected block closer to the next one in\nthe document structure by lifting it out of its parent or moving it\ninto a parent of the previous block. Will use the view for accurate\n(bidi-aware) start-of-textblock detection if given.\n*/\nconst joinBackward = (state, dispatch, view) => {\n let $cursor = atBlockStart(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutBefore($cursor);\n // If there is no node before this, try to lift\n if (!$cut) {\n let range = $cursor.blockRange(), target = range && liftTarget(range);\n if (target == null)\n return false;\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n }\n let before = $cut.nodeBefore;\n // Apply the joining algorithm\n if (deleteBarrier(state, $cut, dispatch, -1))\n return true;\n // If the node below has no content and the node above is\n // selectable, delete the node below and select the one above.\n if ($cursor.parent.content.size == 0 &&\n (textblockAt(before, \"end\") || NodeSelection.isSelectable(before))) {\n for (let depth = $cursor.depth;; depth--) {\n let delStep = replaceStep(state.doc, $cursor.before(depth), $cursor.after(depth), Slice.empty);\n if (delStep && delStep.slice.size < delStep.to - delStep.from) {\n if (dispatch) {\n let tr = state.tr.step(delStep);\n tr.setSelection(textblockAt(before, \"end\")\n ? Selection.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos, -1)), -1)\n : NodeSelection.create(tr.doc, $cut.pos - before.nodeSize));\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n if (depth == 1 || $cursor.node(depth - 1).childCount > 1)\n break;\n }\n }\n // If the node before is an atom, delete it\n if (before.isAtom && $cut.depth == $cursor.depth - 1) {\n if (dispatch)\n dispatch(state.tr.delete($cut.pos - before.nodeSize, $cut.pos).scrollIntoView());\n return true;\n }\n return false;\n};\n/**\nA more limited form of [`joinBackward`](https://prosemirror.net/docs/ref/#commands.joinBackward)\nthat only tries to join the current textblock to the one before\nit, if the cursor is at the start of a textblock.\n*/\nconst joinTextblockBackward = (state, dispatch, view) => {\n let $cursor = atBlockStart(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutBefore($cursor);\n return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;\n};\n/**\nA more limited form of [`joinForward`](https://prosemirror.net/docs/ref/#commands.joinForward)\nthat only tries to join the current textblock to the one after\nit, if the cursor is at the end of a textblock.\n*/\nconst joinTextblockForward = (state, dispatch, view) => {\n let $cursor = atBlockEnd(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutAfter($cursor);\n return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;\n};\nfunction joinTextblocksAround(state, $cut, dispatch) {\n let before = $cut.nodeBefore, beforeText = before, beforePos = $cut.pos - 1;\n for (; !beforeText.isTextblock; beforePos--) {\n if (beforeText.type.spec.isolating)\n return false;\n let child = beforeText.lastChild;\n if (!child)\n return false;\n beforeText = child;\n }\n let after = $cut.nodeAfter, afterText = after, afterPos = $cut.pos + 1;\n for (; !afterText.isTextblock; afterPos++) {\n if (afterText.type.spec.isolating)\n return false;\n let child = afterText.firstChild;\n if (!child)\n return false;\n afterText = child;\n }\n let step = replaceStep(state.doc, beforePos, afterPos, Slice.empty);\n if (!step || step.from != beforePos ||\n step instanceof ReplaceStep && step.slice.size >= afterPos - beforePos)\n return false;\n if (dispatch) {\n let tr = state.tr.step(step);\n tr.setSelection(TextSelection.create(tr.doc, beforePos));\n dispatch(tr.scrollIntoView());\n }\n return true;\n}\nfunction textblockAt(node, side, only = false) {\n for (let scan = node; scan; scan = (side == \"start\" ? scan.firstChild : scan.lastChild)) {\n if (scan.isTextblock)\n return true;\n if (only && scan.childCount != 1)\n return false;\n }\n return false;\n}\n/**\nWhen the selection is empty and at the start of a textblock, select\nthe node before that textblock, if possible. This is intended to be\nbound to keys like backspace, after\n[`joinBackward`](https://prosemirror.net/docs/ref/#commands.joinBackward) or other deleting\ncommands, as a fall-back behavior when the schema doesn't allow\ndeletion at the selected point.\n*/\nconst selectNodeBackward = (state, dispatch, view) => {\n let { $head, empty } = state.selection, $cut = $head;\n if (!empty)\n return false;\n if ($head.parent.isTextblock) {\n if (view ? !view.endOfTextblock(\"backward\", state) : $head.parentOffset > 0)\n return false;\n $cut = findCutBefore($head);\n }\n let node = $cut && $cut.nodeBefore;\n if (!node || !NodeSelection.isSelectable(node))\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos - node.nodeSize)).scrollIntoView());\n return true;\n};\nfunction findCutBefore($pos) {\n if (!$pos.parent.type.spec.isolating)\n for (let i = $pos.depth - 1; i >= 0; i--) {\n if ($pos.index(i) > 0)\n return $pos.doc.resolve($pos.before(i + 1));\n if ($pos.node(i).type.spec.isolating)\n break;\n }\n return null;\n}\nfunction atBlockEnd(state, view) {\n let { $cursor } = state.selection;\n if (!$cursor || (view ? !view.endOfTextblock(\"forward\", state)\n : $cursor.parentOffset < $cursor.parent.content.size))\n return null;\n return $cursor;\n}\n/**\nIf the selection is empty and the cursor is at the end of a\ntextblock, try to reduce or remove the boundary between that block\nand the one after it, either by joining them or by moving the other\nblock closer to this one in the tree structure. Will use the view\nfor accurate start-of-textblock detection if given.\n*/\nconst joinForward = (state, dispatch, view) => {\n let $cursor = atBlockEnd(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutAfter($cursor);\n // If there is no node after this, there's nothing to do\n if (!$cut)\n return false;\n let after = $cut.nodeAfter;\n // Try the joining algorithm\n if (deleteBarrier(state, $cut, dispatch, 1))\n return true;\n // If the node above has no content and the node below is\n // selectable, delete the node above and select the one below.\n if ($cursor.parent.content.size == 0 &&\n (textblockAt(after, \"start\") || NodeSelection.isSelectable(after))) {\n let delStep = replaceStep(state.doc, $cursor.before(), $cursor.after(), Slice.empty);\n if (delStep && delStep.slice.size < delStep.to - delStep.from) {\n if (dispatch) {\n let tr = state.tr.step(delStep);\n tr.setSelection(textblockAt(after, \"start\") ? Selection.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos)), 1)\n : NodeSelection.create(tr.doc, tr.mapping.map($cut.pos)));\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n }\n // If the next node is an atom, delete it\n if (after.isAtom && $cut.depth == $cursor.depth - 1) {\n if (dispatch)\n dispatch(state.tr.delete($cut.pos, $cut.pos + after.nodeSize).scrollIntoView());\n return true;\n }\n return false;\n};\n/**\nWhen the selection is empty and at the end of a textblock, select\nthe node coming after that textblock, if possible. This is intended\nto be bound to keys like delete, after\n[`joinForward`](https://prosemirror.net/docs/ref/#commands.joinForward) and similar deleting\ncommands, to provide a fall-back behavior when the schema doesn't\nallow deletion at the selected point.\n*/\nconst selectNodeForward = (state, dispatch, view) => {\n let { $head, empty } = state.selection, $cut = $head;\n if (!empty)\n return false;\n if ($head.parent.isTextblock) {\n if (view ? !view.endOfTextblock(\"forward\", state) : $head.parentOffset < $head.parent.content.size)\n return false;\n $cut = findCutAfter($head);\n }\n let node = $cut && $cut.nodeAfter;\n if (!node || !NodeSelection.isSelectable(node))\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos)).scrollIntoView());\n return true;\n};\nfunction findCutAfter($pos) {\n if (!$pos.parent.type.spec.isolating)\n for (let i = $pos.depth - 1; i >= 0; i--) {\n let parent = $pos.node(i);\n if ($pos.index(i) + 1 < parent.childCount)\n return $pos.doc.resolve($pos.after(i + 1));\n if (parent.type.spec.isolating)\n break;\n }\n return null;\n}\n/**\nJoin the selected block or, if there is a text selection, the\nclosest ancestor block of the selection that can be joined, with\nthe sibling above it.\n*/\nconst joinUp = (state, dispatch) => {\n let sel = state.selection, nodeSel = sel instanceof NodeSelection, point;\n if (nodeSel) {\n if (sel.node.isTextblock || !canJoin(state.doc, sel.from))\n return false;\n point = sel.from;\n }\n else {\n point = joinPoint(state.doc, sel.from, -1);\n if (point == null)\n return false;\n }\n if (dispatch) {\n let tr = state.tr.join(point);\n if (nodeSel)\n tr.setSelection(NodeSelection.create(tr.doc, point - state.doc.resolve(point).nodeBefore.nodeSize));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n/**\nJoin the selected block, or the closest ancestor of the selection\nthat can be joined, with the sibling after it.\n*/\nconst joinDown = (state, dispatch) => {\n let sel = state.selection, point;\n if (sel instanceof NodeSelection) {\n if (sel.node.isTextblock || !canJoin(state.doc, sel.to))\n return false;\n point = sel.to;\n }\n else {\n point = joinPoint(state.doc, sel.to, 1);\n if (point == null)\n return false;\n }\n if (dispatch)\n dispatch(state.tr.join(point).scrollIntoView());\n return true;\n};\n/**\nLift the selected block, or the closest ancestor block of the\nselection that can be lifted, out of its parent node.\n*/\nconst lift = (state, dispatch) => {\n let { $from, $to } = state.selection;\n let range = $from.blockRange($to), target = range && liftTarget(range);\n if (target == null)\n return false;\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n};\n/**\nIf the selection is in a node whose type has a truthy\n[`code`](https://prosemirror.net/docs/ref/#model.NodeSpec.code) property in its spec, replace the\nselection with a newline character.\n*/\nconst newlineInCode = (state, dispatch) => {\n let { $head, $anchor } = state.selection;\n if (!$head.parent.type.spec.code || !$head.sameParent($anchor))\n return false;\n if (dispatch)\n dispatch(state.tr.insertText(\"\\n\").scrollIntoView());\n return true;\n};\nfunction defaultBlockAt(match) {\n for (let i = 0; i < match.edgeCount; i++) {\n let { type } = match.edge(i);\n if (type.isTextblock && !type.hasRequiredAttrs())\n return type;\n }\n return null;\n}\n/**\nWhen the selection is in a node with a truthy\n[`code`](https://prosemirror.net/docs/ref/#model.NodeSpec.code) property in its spec, create a\ndefault block after the code block, and move the cursor there.\n*/\nconst exitCode = (state, dispatch) => {\n let { $head, $anchor } = state.selection;\n if (!$head.parent.type.spec.code || !$head.sameParent($anchor))\n return false;\n let above = $head.node(-1), after = $head.indexAfter(-1), type = defaultBlockAt(above.contentMatchAt(after));\n if (!type || !above.canReplaceWith(after, after, type))\n return false;\n if (dispatch) {\n let pos = $head.after(), tr = state.tr.replaceWith(pos, pos, type.createAndFill());\n tr.setSelection(Selection.near(tr.doc.resolve(pos), 1));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n/**\nIf a block node is selected, create an empty paragraph before (if\nit is its parent's first child) or after it.\n*/\nconst createParagraphNear = (state, dispatch) => {\n let sel = state.selection, { $from, $to } = sel;\n if (sel instanceof AllSelection || $from.parent.inlineContent || $to.parent.inlineContent)\n return false;\n let type = defaultBlockAt($to.parent.contentMatchAt($to.indexAfter()));\n if (!type || !type.isTextblock)\n return false;\n if (dispatch) {\n let side = (!$from.parentOffset && $to.index() < $to.parent.childCount ? $from : $to).pos;\n let tr = state.tr.insert(side, type.createAndFill());\n tr.setSelection(TextSelection.create(tr.doc, side + 1));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n/**\nIf the cursor is in an empty textblock that can be lifted, lift the\nblock.\n*/\nconst liftEmptyBlock = (state, dispatch) => {\n let { $cursor } = state.selection;\n if (!$cursor || $cursor.parent.content.size)\n return false;\n if ($cursor.depth > 1 && $cursor.after() != $cursor.end(-1)) {\n let before = $cursor.before();\n if (canSplit(state.doc, before)) {\n if (dispatch)\n dispatch(state.tr.split(before).scrollIntoView());\n return true;\n }\n }\n let range = $cursor.blockRange(), target = range && liftTarget(range);\n if (target == null)\n return false;\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n};\n/**\nCreate a variant of [`splitBlock`](https://prosemirror.net/docs/ref/#commands.splitBlock) that uses\na custom function to determine the type of the newly split off block.\n*/\nfunction splitBlockAs(splitNode) {\n return (state, dispatch) => {\n let { $from, $to } = state.selection;\n if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {\n if (!$from.parentOffset || !canSplit(state.doc, $from.pos))\n return false;\n if (dispatch)\n dispatch(state.tr.split($from.pos).scrollIntoView());\n return true;\n }\n if (!$from.depth)\n return false;\n let types = [];\n let splitDepth, deflt, atEnd = false, atStart = false;\n for (let d = $from.depth;; d--) {\n let node = $from.node(d);\n if (node.isBlock) {\n atEnd = $from.end(d) == $from.pos + ($from.depth - d);\n atStart = $from.start(d) == $from.pos - ($from.depth - d);\n deflt = defaultBlockAt($from.node(d - 1).contentMatchAt($from.indexAfter(d - 1)));\n let splitType = splitNode && splitNode($to.parent, atEnd, $from);\n types.unshift(splitType || (atEnd && deflt ? { type: deflt } : null));\n splitDepth = d;\n break;\n }\n else {\n if (d == 1)\n return false;\n types.unshift(null);\n }\n }\n let tr = state.tr;\n if (state.selection instanceof TextSelection || state.selection instanceof AllSelection)\n tr.deleteSelection();\n let splitPos = tr.mapping.map($from.pos);\n let can = canSplit(tr.doc, splitPos, types.length, types);\n if (!can) {\n types[0] = deflt ? { type: deflt } : null;\n can = canSplit(tr.doc, splitPos, types.length, types);\n }\n tr.split(splitPos, types.length, types);\n if (!atEnd && atStart && $from.node(splitDepth).type != deflt) {\n let first = tr.mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);\n if (deflt && $from.node(splitDepth - 1).canReplaceWith($first.index(), $first.index() + 1, deflt))\n tr.setNodeMarkup(tr.mapping.map($from.before(splitDepth)), deflt);\n }\n if (dispatch)\n dispatch(tr.scrollIntoView());\n return true;\n };\n}\n/**\nSplit the parent block of the selection. If the selection is a text\nselection, also delete its content.\n*/\nconst splitBlock = splitBlockAs();\n/**\nActs like [`splitBlock`](https://prosemirror.net/docs/ref/#commands.splitBlock), but without\nresetting the set of active marks at the cursor.\n*/\nconst splitBlockKeepMarks = (state, dispatch) => {\n return splitBlock(state, dispatch && (tr => {\n let marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks());\n if (marks)\n tr.ensureMarks(marks);\n dispatch(tr);\n }));\n};\n/**\nMove the selection to the node wrapping the current selection, if\nany. (Will not select the document node.)\n*/\nconst selectParentNode = (state, dispatch) => {\n let { $from, to } = state.selection, pos;\n let same = $from.sharedDepth(to);\n if (same == 0)\n return false;\n pos = $from.before(same);\n if (dispatch)\n dispatch(state.tr.setSelection(NodeSelection.create(state.doc, pos)));\n return true;\n};\n/**\nSelect the whole document.\n*/\nconst selectAll = (state, dispatch) => {\n if (dispatch)\n dispatch(state.tr.setSelection(new AllSelection(state.doc)));\n return true;\n};\nfunction joinMaybeClear(state, $pos, dispatch) {\n let before = $pos.nodeBefore, after = $pos.nodeAfter, index = $pos.index();\n if (!before || !after || !before.type.compatibleContent(after.type))\n return false;\n if (!before.content.size && $pos.parent.canReplace(index - 1, index)) {\n if (dispatch)\n dispatch(state.tr.delete($pos.pos - before.nodeSize, $pos.pos).scrollIntoView());\n return true;\n }\n if (!$pos.parent.canReplace(index, index + 1) || !(after.isTextblock || canJoin(state.doc, $pos.pos)))\n return false;\n if (dispatch)\n dispatch(state.tr.join($pos.pos).scrollIntoView());\n return true;\n}\nfunction deleteBarrier(state, $cut, dispatch, dir) {\n let before = $cut.nodeBefore, after = $cut.nodeAfter, conn, match;\n let isolated = before.type.spec.isolating || after.type.spec.isolating;\n if (!isolated && joinMaybeClear(state, $cut, dispatch))\n return true;\n let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);\n if (canDelAfter &&\n (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) &&\n match.matchType(conn[0] || after.type).validEnd) {\n if (dispatch) {\n let end = $cut.pos + after.nodeSize, wrap = Fragment.empty;\n for (let i = conn.length - 1; i >= 0; i--)\n wrap = Fragment.from(conn[i].create(null, wrap));\n wrap = Fragment.from(before.copy(wrap));\n let tr = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap, 1, 0), conn.length, true));\n let $joinAt = tr.doc.resolve(end + 2 * conn.length);\n if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type &&\n canJoin(tr.doc, $joinAt.pos))\n tr.join($joinAt.pos);\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n let selAfter = after.type.spec.isolating || (dir > 0 && isolated) ? null : Selection.findFrom($cut, 1);\n let range = selAfter && selAfter.$from.blockRange(selAfter.$to), target = range && liftTarget(range);\n if (target != null && target >= $cut.depth) {\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n }\n if (canDelAfter && textblockAt(after, \"start\", true) && textblockAt(before, \"end\")) {\n let at = before, wrap = [];\n for (;;) {\n wrap.push(at);\n if (at.isTextblock)\n break;\n at = at.lastChild;\n }\n let afterText = after, afterDepth = 1;\n for (; !afterText.isTextblock; afterText = afterText.firstChild)\n afterDepth++;\n if (at.canReplace(at.childCount, at.childCount, afterText.content)) {\n if (dispatch) {\n let end = Fragment.empty;\n for (let i = wrap.length - 1; i >= 0; i--)\n end = Fragment.from(wrap[i].copy(end));\n let tr = state.tr.step(new ReplaceAroundStep($cut.pos - wrap.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end, wrap.length, 0), 0, true));\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n }\n return false;\n}\nfunction selectTextblockSide(side) {\n return function (state, dispatch) {\n let sel = state.selection, $pos = side < 0 ? sel.$from : sel.$to;\n let depth = $pos.depth;\n while ($pos.node(depth).isInline) {\n if (!depth)\n return false;\n depth--;\n }\n if (!$pos.node(depth).isTextblock)\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(TextSelection.create(state.doc, side < 0 ? $pos.start(depth) : $pos.end(depth))));\n return true;\n };\n}\n/**\nMoves the cursor to the start of current text block.\n*/\nconst selectTextblockStart = selectTextblockSide(-1);\n/**\nMoves the cursor to the end of current text block.\n*/\nconst selectTextblockEnd = selectTextblockSide(1);\n// Parameterized commands\n/**\nWrap the selection in a node of the given type with the given\nattributes.\n*/\nfunction wrapIn(nodeType, attrs = null) {\n return function (state, dispatch) {\n let { $from, $to } = state.selection;\n let range = $from.blockRange($to), wrapping = range && findWrapping(range, nodeType, attrs);\n if (!wrapping)\n return false;\n if (dispatch)\n dispatch(state.tr.wrap(range, wrapping).scrollIntoView());\n return true;\n };\n}\n/**\nReturns a command that tries to set the selected textblocks to the\ngiven node type with the given attributes.\n*/\nfunction setBlockType(nodeType, attrs = null) {\n return function (state, dispatch) {\n let applicable = false;\n for (let i = 0; i < state.selection.ranges.length && !applicable; i++) {\n let { $from: { pos: from }, $to: { pos: to } } = state.selection.ranges[i];\n state.doc.nodesBetween(from, to, (node, pos) => {\n if (applicable)\n return false;\n if (!node.isTextblock || node.hasMarkup(nodeType, attrs))\n return;\n if (node.type == nodeType) {\n applicable = true;\n }\n else {\n let $pos = state.doc.resolve(pos), index = $pos.index();\n applicable = $pos.parent.canReplaceWith(index, index + 1, nodeType);\n }\n });\n }\n if (!applicable)\n return false;\n if (dispatch) {\n let tr = state.tr;\n for (let i = 0; i < state.selection.ranges.length; i++) {\n let { $from: { pos: from }, $to: { pos: to } } = state.selection.ranges[i];\n tr.setBlockType(from, to, nodeType, attrs);\n }\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\nfunction markApplies(doc, ranges, type, enterAtoms) {\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i];\n let can = $from.depth == 0 ? doc.inlineContent && doc.type.allowsMarkType(type) : false;\n doc.nodesBetween($from.pos, $to.pos, (node, pos) => {\n if (can || !enterAtoms && node.isAtom && node.isInline && pos >= $from.pos && pos + node.nodeSize <= $to.pos)\n return false;\n can = node.inlineContent && node.type.allowsMarkType(type);\n });\n if (can)\n return true;\n }\n return false;\n}\nfunction removeInlineAtoms(ranges) {\n let result = [];\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i];\n $from.doc.nodesBetween($from.pos, $to.pos, (node, pos) => {\n if (node.isAtom && node.content.size && node.isInline && pos >= $from.pos && pos + node.nodeSize <= $to.pos) {\n if (pos + 1 > $from.pos)\n result.push(new SelectionRange($from, $from.doc.resolve(pos + 1)));\n $from = $from.doc.resolve(pos + 1 + node.content.size);\n return false;\n }\n });\n if ($from.pos < $to.pos)\n result.push(new SelectionRange($from, $to));\n }\n return result;\n}\n/**\nCreate a command function that toggles the given mark with the\ngiven attributes. Will return `false` when the current selection\ndoesn't support that mark. This will remove the mark if any marks\nof that type exist in the selection, or add it otherwise. If the\nselection is empty, this applies to the [stored\nmarks](https://prosemirror.net/docs/ref/#state.EditorState.storedMarks) instead of a range of the\ndocument.\n*/\nfunction toggleMark(markType, attrs = null, options) {\n let removeWhenPresent = (options && options.removeWhenPresent) !== false;\n let enterAtoms = (options && options.enterInlineAtoms) !== false;\n let dropSpace = !(options && options.includeWhitespace);\n return function (state, dispatch) {\n let { empty, $cursor, ranges } = state.selection;\n if ((empty && !$cursor) || !markApplies(state.doc, ranges, markType, enterAtoms))\n return false;\n if (dispatch) {\n if ($cursor) {\n if (markType.isInSet(state.storedMarks || $cursor.marks()))\n dispatch(state.tr.removeStoredMark(markType));\n else\n dispatch(state.tr.addStoredMark(markType.create(attrs)));\n }\n else {\n let add, tr = state.tr;\n if (!enterAtoms)\n ranges = removeInlineAtoms(ranges);\n if (removeWhenPresent) {\n add = !ranges.some(r => state.doc.rangeHasMark(r.$from.pos, r.$to.pos, markType));\n }\n else {\n add = !ranges.every(r => {\n let missing = false;\n tr.doc.nodesBetween(r.$from.pos, r.$to.pos, (node, pos, parent) => {\n if (missing)\n return false;\n missing = !markType.isInSet(node.marks) && !!parent && parent.type.allowsMarkType(markType) &&\n !(node.isText && /^\\s*$/.test(node.textBetween(Math.max(0, r.$from.pos - pos), Math.min(node.nodeSize, r.$to.pos - pos))));\n });\n return !missing;\n });\n }\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i];\n if (!add) {\n tr.removeMark($from.pos, $to.pos, markType);\n }\n else {\n let from = $from.pos, to = $to.pos, start = $from.nodeAfter, end = $to.nodeBefore;\n let spaceStart = dropSpace && start && start.isText ? /^\\s*/.exec(start.text)[0].length : 0;\n let spaceEnd = dropSpace && end && end.isText ? /\\s*$/.exec(end.text)[0].length : 0;\n if (from + spaceStart < to) {\n from += spaceStart;\n to -= spaceEnd;\n }\n tr.addMark(from, to, markType.create(attrs));\n }\n }\n dispatch(tr.scrollIntoView());\n }\n }\n return true;\n };\n}\nfunction wrapDispatchForJoin(dispatch, isJoinable) {\n return (tr) => {\n if (!tr.isGeneric)\n return dispatch(tr);\n let ranges = [];\n for (let i = 0; i < tr.mapping.maps.length; i++) {\n let map = tr.mapping.maps[i];\n for (let j = 0; j < ranges.length; j++)\n ranges[j] = map.map(ranges[j]);\n map.forEach((_s, _e, from, to) => ranges.push(from, to));\n }\n // Figure out which joinable points exist inside those ranges,\n // by checking all node boundaries in their parent nodes.\n let joinable = [];\n for (let i = 0; i < ranges.length; i += 2) {\n let from = ranges[i], to = ranges[i + 1];\n let $from = tr.doc.resolve(from), depth = $from.sharedDepth(to), parent = $from.node(depth);\n for (let index = $from.indexAfter(depth), pos = $from.after(depth + 1); pos <= to; ++index) {\n let after = parent.maybeChild(index);\n if (!after)\n break;\n if (index && joinable.indexOf(pos) == -1) {\n let before = parent.child(index - 1);\n if (before.type == after.type && isJoinable(before, after))\n joinable.push(pos);\n }\n pos += after.nodeSize;\n }\n }\n // Join the joinable points\n joinable.sort((a, b) => a - b);\n for (let i = joinable.length - 1; i >= 0; i--) {\n if (canJoin(tr.doc, joinable[i]))\n tr.join(joinable[i]);\n }\n dispatch(tr);\n };\n}\n/**\nWrap a command so that, when it produces a transform that causes\ntwo joinable nodes to end up next to each other, those are joined.\nNodes are considered joinable when they are of the same type and\nwhen the `isJoinable` predicate returns true for them or, if an\narray of strings was passed, if their node type name is in that\narray.\n*/\nfunction autoJoin(command, isJoinable) {\n let canJoin = Array.isArray(isJoinable) ? (node) => isJoinable.indexOf(node.type.name) > -1\n : isJoinable;\n return (state, dispatch, view) => command(state, dispatch && wrapDispatchForJoin(dispatch, canJoin), view);\n}\n/**\nCombine a number of command functions into a single function (which\ncalls them one by one until one returns true).\n*/\nfunction chainCommands(...commands) {\n return function (state, dispatch, view) {\n for (let i = 0; i < commands.length; i++)\n if (commands[i](state, dispatch, view))\n return true;\n return false;\n };\n}\nlet backspace = chainCommands(deleteSelection, joinBackward, selectNodeBackward);\nlet del = chainCommands(deleteSelection, joinForward, selectNodeForward);\n/**\nA basic keymap containing bindings not specific to any schema.\nBinds the following keys (when multiple commands are listed, they\nare chained with [`chainCommands`](https://prosemirror.net/docs/ref/#commands.chainCommands)):\n\n* **Enter** to `newlineInCode`, `createParagraphNear`, `liftEmptyBlock`, `splitBlock`\n* **Mod-Enter** to `exitCode`\n* **Backspace** and **Mod-Backspace** to `deleteSelection`, `joinBackward`, `selectNodeBackward`\n* **Delete** and **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`\n* **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`\n* **Mod-a** to `selectAll`\n*/\nconst pcBaseKeymap = {\n \"Enter\": chainCommands(newlineInCode, createParagraphNear, liftEmptyBlock, splitBlock),\n \"Mod-Enter\": exitCode,\n \"Backspace\": backspace,\n \"Mod-Backspace\": backspace,\n \"Shift-Backspace\": backspace,\n \"Delete\": del,\n \"Mod-Delete\": del,\n \"Mod-a\": selectAll\n};\n/**\nA copy of `pcBaseKeymap` that also binds **Ctrl-h** like Backspace,\n**Ctrl-d** like Delete, **Alt-Backspace** like Ctrl-Backspace, and\n**Ctrl-Alt-Backspace**, **Alt-Delete**, and **Alt-d** like\nCtrl-Delete.\n*/\nconst macBaseKeymap = {\n \"Ctrl-h\": pcBaseKeymap[\"Backspace\"],\n \"Alt-Backspace\": pcBaseKeymap[\"Mod-Backspace\"],\n \"Ctrl-d\": pcBaseKeymap[\"Delete\"],\n \"Ctrl-Alt-Backspace\": pcBaseKeymap[\"Mod-Delete\"],\n \"Alt-Delete\": pcBaseKeymap[\"Mod-Delete\"],\n \"Alt-d\": pcBaseKeymap[\"Mod-Delete\"],\n \"Ctrl-a\": selectTextblockStart,\n \"Ctrl-e\": selectTextblockEnd\n};\nfor (let key in pcBaseKeymap)\n macBaseKeymap[key] = pcBaseKeymap[key];\nconst mac = typeof navigator != \"undefined\" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform)\n // @ts-ignore\n : typeof os != \"undefined\" && os.platform ? os.platform() == \"darwin\" : false;\n/**\nDepending on the detected platform, this will hold\n[`pcBasekeymap`](https://prosemirror.net/docs/ref/#commands.pcBaseKeymap) or\n[`macBaseKeymap`](https://prosemirror.net/docs/ref/#commands.macBaseKeymap).\n*/\nconst baseKeymap = mac ? macBaseKeymap : pcBaseKeymap;\n\nexport { autoJoin, baseKeymap, chainCommands, createParagraphNear, deleteSelection, exitCode, joinBackward, joinDown, joinForward, joinTextblockBackward, joinTextblockForward, joinUp, lift, liftEmptyBlock, macBaseKeymap, newlineInCode, pcBaseKeymap, selectAll, selectNodeBackward, selectNodeForward, selectParentNode, selectTextblockEnd, selectTextblockStart, setBlockType, splitBlock, splitBlockAs, splitBlockKeepMarks, toggleMark, wrapIn };\n","import { findWrapping, ReplaceAroundStep, canSplit, liftTarget, canJoin } from 'prosemirror-transform';\nimport { NodeRange, Fragment, Slice } from 'prosemirror-model';\nimport { Selection } from 'prosemirror-state';\n\nconst olDOM = [\"ol\", 0], ulDOM = [\"ul\", 0], liDOM = [\"li\", 0];\n/**\nAn ordered list [node spec](https://prosemirror.net/docs/ref/#model.NodeSpec). Has a single\nattribute, `order`, which determines the number at which the list\nstarts counting, and defaults to 1. Represented as an `
    `\nelement.\n*/\nconst orderedList = {\n attrs: { order: { default: 1, validate: \"number\" } },\n parseDOM: [{ tag: \"ol\", getAttrs(dom) {\n return { order: dom.hasAttribute(\"start\") ? +dom.getAttribute(\"start\") : 1 };\n } }],\n toDOM(node) {\n return node.attrs.order == 1 ? olDOM : [\"ol\", { start: node.attrs.order }, 0];\n }\n};\n/**\nA bullet list node spec, represented in the DOM as `